Browse Source

Merge remote-tracking branch 'origin/pre-production' into pre-production

chenglong
zhenghaoyu 1 year ago
parent
commit
94e574c3d1
  1. 2
      blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/entity/IndicatorsEntity.java
  2. 2
      blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/vo/ClassifyVO.java
  3. 7
      blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/vo/IndicatorsVO.java
  4. 27
      blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/vo/api/BeIndicatorsVO.java
  5. 3
      blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/vo/api/ClassifyApiVO.java
  6. 5
      blade-service/logpm-supervise/pom.xml
  7. 25
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/api/ClassifyApi.java
  8. 2
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/ClassifyMapper.xml
  9. 2
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/IndicatorsAnnexMapper.java
  10. 4
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/IndicatorsAnnexMapper.xml
  11. 18
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/IndicatorsMapper.java
  12. 34
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/IndicatorsMapper.xml
  13. 16
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/IClassifyService.java
  14. 89
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/ClassifyServiceImpl.java
  15. 47
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/wrapper/PointsWrapper.java

2
blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/entity/IndicatorsEntity.java

@ -29,6 +29,8 @@ public class IndicatorsEntity extends TenantEntity {
@ApiModelProperty(value = "考核指标")
private Long classifyId;
@ApiModelProperty(value = "分数")
private int point;

2
blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/vo/ClassifyVO.java

@ -37,5 +37,7 @@ public class ClassifyVO extends ClassifyEntity {
private List<PointsEntity> pointsEntities = new ArrayList<>();
private List<PointsVO> pointsVOS ;
}

7
blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/vo/IndicatorsVO.java

@ -16,6 +16,13 @@ public class IndicatorsVO extends IndicatorsEntity {
private String classifyName;
private Long parentClassifyId;
private String createdUserName;
private Integer bonusPoin;
private Integer deductionPoints;
private String parentClassifyName;
private List<IndicatorsAnnexEntity> pictures = new ArrayList<>();

27
blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/vo/api/BeIndicatorsVO.java

@ -0,0 +1,27 @@
package com.logpm.supervise.vo.api;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.supervise.entity.IndicatorsAnnexEntity;
import com.logpm.supervise.entity.IndicatorsEntity;
import com.logpm.supervise.vo.IndicatorsVO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.ArrayList;
import java.util.List;
@Data
public class BeIndicatorsVO {
private static final long serialVersionUID = 1L;
//加分
private Integer bonusPoins;
//总分
private Integer totalPoints;
//扣分
private Integer deductionPoints;
private Page<IndicatorsVO> indicatorsVOS;
}

3
blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/vo/api/ClassifyApiVO.java

@ -2,6 +2,7 @@ package com.logpm.supervise.vo.api;
import com.logpm.supervise.entity.ClassifyEntity;
import com.logpm.supervise.vo.PointsVO;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -12,4 +13,6 @@ import java.util.List;
public class ClassifyApiVO extends ClassifyEntity {
private List<ClassifyApiVO> children;
private List<PointsVO> pointsVOS;
}

5
blade-service/logpm-supervise/pom.xml

@ -39,6 +39,11 @@
<artifactId>logpm-supervise-api</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-system-api</artifactId>
<version>3.2.0.RELEASE</version>
</dependency>
</dependencies>

25
blade-service/logpm-supervise/src/main/java/com/logpm/supervise/api/ClassifyApi.java

@ -62,11 +62,12 @@ public class ClassifyApi {
@GetMapping("/myApiIndicatorsDetail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "我的考核列表")
public R myApiIndicatorsDetail(@RequestParam Long Id) {
R r = classifyService.myApiIndicatorsDetail(Id);
public R myApiIndicatorsDetail(@RequestParam Long id) {
R r = classifyService.myApiIndicatorsDetail(id);
return r;
}
@PostMapping("/updateApiIndicators")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "小程序保存考核内容", notes = "传入classify")
@ -75,11 +76,21 @@ public class ClassifyApi {
return r;
}
@GetMapping("/beMyApiIndicators")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "我被考核的列表")
public R beMyApiIndicators(@RequestParam Map<String, Object> params,Query query) {
IPage<IndicatorsVO> page = Condition.getPage(query);
R r = classifyService.beMyApiIndicators(params,page);
return r;
}
@GetMapping("/deptList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "我被考核的列表")
public R deptList() {
R r = classifyService.deptList();
return r;
}
}

2
blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/ClassifyMapper.xml

@ -56,7 +56,7 @@
</select>
<select id="selectAllClassifyList" resultType="com.logpm.supervise.vo.api.ClassifyApiVO">
SELECT * FROM sup_classify WHERE is_deleted = 0
<if test="pid != null and pid = 0">
<if test="pid != null and pid == 0">
and p_id = 0
</if>
<if test="pid != null and pid != 0">

2
blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/IndicatorsAnnexMapper.java

@ -17,5 +17,5 @@ public interface IndicatorsAnnexMapper extends BaseMapper<IndicatorsAnnexEntity>
* 删除考核所关联的附件资源
* @param id
*/
void deleteResourceByInstanceoId(@Param("") Long id);
void deleteResourceByInstanceoId(@Param("indicatorsId") Long indicatorsId);
}

4
blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/IndicatorsAnnexMapper.xml

@ -8,8 +8,8 @@
<select id="findListByIndicatorsIdAndType" resultType="com.logpm.supervise.entity.IndicatorsAnnexEntity">
select *
from sup_indicators_annex
where indicators_id = #{id}
and `type` = #{type}
and indicators_id = #{id}
and type = #{type}
</select>
</mapper>

18
blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/IndicatorsMapper.java

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.supervise.dto.IndicatorsDTO;
import com.logpm.supervise.entity.IndicatorsEntity;
import com.logpm.supervise.vo.IndicatorsVO;
import com.logpm.supervise.vo.api.BeIndicatorsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -25,5 +26,20 @@ public interface IndicatorsMapper extends BaseMapper<IndicatorsEntity> {
* @param params
* @return
*/
Page<IndicatorsVO> selectMyApiIndicators(IPage<IndicatorsVO> page, Map<String, Object> params);
Page<IndicatorsVO> selectMyApiIndicators(IPage<IndicatorsVO> page,@Param("params") Map<String, Object> params);
/**
* 查询我被考核的列表
* @param page
* @param params
* @return
*/
Page<IndicatorsVO> selectBeMyApiIndicators(IPage<IndicatorsVO> page,@Param("params") Map<String, Object> params);
/**
* 查询我的分数
* @param params
* @return
*/
BeIndicatorsVO selectMyPoints(@Param("params")Map<String, Object> params);
}

34
blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/IndicatorsMapper.xml

@ -46,16 +46,42 @@
and si.id = #{id}
</select>
<select id="selectMyApiIndicators" resultType="com.logpm.supervise.vo.IndicatorsVO">
SELECT * FROM sup_indicators WHERE is_deleted = 0 and create_user = #{params.userId}
SELECT si.*,sc.name AS classifyName FROM sup_indicators AS si LEFT JOIN sup_classify AS sc ON si.classify_id = sc.id
WHERE si.is_deleted = 0 and si.create_user = #{params.userId} AND sc.is_deleted = 0
<if test="params.assessDept != null and params.assessDept != ''" >
and assess_dept = #{params.assessDept}
and si.assess_dept = #{params.assessDept}
</if>
<if test="params.startTime != null and params.startTime != ''" >
and date_format(create_time,'%y%m%d%') >= date_format(#{params.startTime},'%y%m%d%')
and date_format(si.create_time,'%y%m%d%') >= date_format(#{params.startTime},'%y%m%d%')
</if>
<if test="params.endTime != null and params.endTime != ''" >
and date_format(create_time,'%y%m%d%') &lt;= date_format(#{params.endTime},'%y%m%d%')
and date_format(si.create_time,'%y%m%d%') &lt;= date_format(#{params.endTime},'%y%m%d%')
</if>
</select>
<select id="selectBeMyApiIndicators" resultType="com.logpm.supervise.vo.IndicatorsVO">
SELECT
si.*,
sc.NAME AS classifyName
FROM
sup_indicators AS si
LEFT JOIN sup_classify AS sc ON si.classify_id = sc.id
WHERE si.assess_dept = #{params.deptId} AND si.is_deleted = 0 AND sc.is_deleted = 0
<if test="params.startTime != null and params.startTime != ''" >
AND date_format(si.create_time,'%y%m%d%') >= date_format(#{params.startTime},'%y%m%d%')
</if>
<if test="params.endTime != null and params.endTime != ''" >
AND date_format(si.create_time,'%y%m%d%') &lt;= date_format(#{params.endTime},'%y%m%d%')
</if>
</select>
<select id="selectMyPoints" resultType="com.logpm.supervise.vo.api.BeIndicatorsVO">
<![CDATA[
SELECT 0 As totalPoints,
sum(case when point < 0 then point else 0 end) as deductionPoints ,
sum(case when point > 0 then point else 0 end) as bonusPoins
from sup_indicators
where assess_dept = #{params.deptId}
and DATE_FORMAT(create_time, '%Y%m') = DATE_FORMAT(CURDATE(), '%Y%m')
]]>
</select>
</mapper>

16
blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/IClassifyService.java

@ -54,7 +54,6 @@ public interface IClassifyService extends BaseService<ClassifyEntity> {
/**
* 查询指标项列表
* @param classify
* @return
*/
List<ClassifyApiVO> selectClassifyList();
@ -86,4 +85,19 @@ public interface IClassifyService extends BaseService<ClassifyEntity> {
* @return
*/
R updateApiIndicators(IndicatorsDTO instanceofDTO);
/**
*
* @param params
* @param page
* @return
*/
R beMyApiIndicators(Map<String, Object> params, IPage<IndicatorsVO> page);
/**
* 查询部门列表
* @return
*/
R deptList();
}

89
blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/ClassifyServiceImpl.java

@ -35,18 +35,28 @@ import com.logpm.supervise.service.IIndicatorsService;
import com.logpm.supervise.service.IPointsService;
import com.logpm.supervise.vo.ClassifyVO;
import com.logpm.supervise.vo.IndicatorsVO;
import com.logpm.supervise.vo.api.BeIndicatorsVO;
import com.logpm.supervise.vo.api.ClassifyApiVO;
import com.logpm.supervise.wrapper.ClassifyWrapper;
import com.logpm.supervise.wrapper.IndicatorsWrapper;
import com.logpm.supervise.wrapper.PointsWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.entity.Dept;
import org.springblade.system.entity.User;
import org.springblade.system.feign.IDeptClient;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.feign.IUserClient;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@ -73,6 +83,14 @@ public class ClassifyServiceImpl extends BaseServiceImpl<ClassifyMapper, Classif
private final IndicatorsMapper indicatorsMapper;
private final IDeptClient deptClient;
private final IUserClient userClient;
@Override
@ -195,9 +213,26 @@ public class ClassifyServiceImpl extends BaseServiceImpl<ClassifyMapper, Classif
Long pid = 0L;
List<ClassifyApiVO> classifyEntities = getClassifyList(pid);
for (ClassifyApiVO classifyEntity : classifyEntities) {
List<ClassifyApiVO> classifyList = getClassifyList(classifyEntity.getId());
if (!Objects.isNull(classifyList)){
classifyEntity.setChildren(classifyList);
if (classifyEntity.getPId().equals(0L)){
List<ClassifyApiVO> classifyList = new ArrayList<>();
List<ClassifyEntity> entityList = this.list(Wrappers.<ClassifyEntity>query().lambda()
.eq(ClassifyEntity::getPId, classifyEntity.getId())
.ne(ClassifyEntity::getPId, 0L)
);
for (ClassifyEntity entity : entityList) {
ClassifyVO classifyVO = ClassifyWrapper.build().entityVO(entity);
ClassifyApiVO classifyApiVO = Func.copy(classifyVO, ClassifyApiVO.class);
List<PointsEntity> list = pointsService.list(Wrappers.<PointsEntity>query().lambda()
.eq(PointsEntity::getClassifyId,entity.getId())
);
if(Func.isNotEmpty(list)){
classifyApiVO.setPointsVOS(PointsWrapper.build().listVO(list));
}
classifyList.add(classifyApiVO);
}
if (!Objects.isNull(classifyList)){
classifyEntity.setChildren(classifyList);
}
}
}
return classifyEntities;
@ -206,10 +241,13 @@ public class ClassifyServiceImpl extends BaseServiceImpl<ClassifyMapper, Classif
@Override
@Transactional
public R saveApiIndicators(IndicatorsDTO instanceofDTO) {
BladeUser user = AuthUtil.getUser();
//保存考核内容
IndicatorsEntity indicatorsEntity = Func.copy(instanceofDTO, IndicatorsEntity.class);
indicatorsEntity.setIndicatorsStatus(1);
indicatorsEntity.setAssessUserId(user.getUserId());
indicatorsEntity.setAssessDeptName(user.getNickName());
iIndicatorsService.save(indicatorsEntity);
if (Func.isNotEmpty(instanceofDTO.getResourceList())){
@ -246,6 +284,10 @@ public class ClassifyServiceImpl extends BaseServiceImpl<ClassifyMapper, Classif
//查询是否存在有附件
List<IndicatorsAnnexEntity> list = indicatorsAnnexService.list(Wrappers.<IndicatorsAnnexEntity>query().lambda().eq(IndicatorsAnnexEntity::getIndicatorsId, id));
IndicatorsVO indicatorsVO = IndicatorsWrapper.build().entityVO(indicatorsEntity);
R<User> userR = userClient.userInfoById(indicatorsVO.getCreateUser());
if (Func.isNotEmpty(userR)){
indicatorsVO.setCreatedUserName(userR.getData().getName());
}
if (Func.isNotEmpty(list)){
Map<Integer, List<IndicatorsAnnexEntity>> resourceMap = list.stream().collect(Collectors.groupingBy(IndicatorsAnnexEntity::getType));
if (Func.isNotEmpty(resourceMap.get(1))){
@ -276,6 +318,47 @@ public class ClassifyServiceImpl extends BaseServiceImpl<ClassifyMapper, Classif
return R.status(iIndicatorsService.updateById(indicatorsEntity));
}
/**
* @param params
* @param page
* @return
*/
@Override
public R beMyApiIndicators(Map<String, Object> params, IPage<IndicatorsVO> page) {
BladeUser user = AuthUtil.getUser();
BeIndicatorsVO beIndicatorsVO = null;
if (Func.isNotEmpty(user)){
// params.put("userId",user.getUserId());
if (Func.isNotEmpty(user.getDeptId())){
params.put("deptId",user.getDeptId());
beIndicatorsVO = indicatorsMapper.selectMyPoints(params);
}
}
//查询分数
//查询我被考核的列表
Page<IndicatorsVO> indicatorsVOPage = indicatorsMapper.selectBeMyApiIndicators(page, params);
if (Func.isNotEmpty(indicatorsVOPage)){
for (IndicatorsVO record : indicatorsVOPage.getRecords()) {
//查询创建人
R<User> userR = userClient.userInfoById(record.getCreateUser());
record.setCreatedUserName(userR.getData().getName());
}
beIndicatorsVO.setIndicatorsVOS(indicatorsVOPage);
}
return R.data(beIndicatorsVO);
}
/**
* @return
*/
@Override
public R deptList() {
BladeUser user = AuthUtil.getUser();
List<Dept> userDeptNode = deptClient.getUserDeptNode(Long.parseLong(user.getDeptId()));
return R.data(userDeptNode);
}
private List<ClassifyApiVO> getClassifyList(Long pid) {
return baseMapper.selectAllClassifyList(pid);
}

47
blade-service/logpm-supervise/src/main/java/com/logpm/supervise/wrapper/PointsWrapper.java

@ -0,0 +1,47 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.supervise.wrapper;
import com.logpm.supervise.entity.IndicatorsEntity;
import com.logpm.supervise.entity.PointsEntity;
import com.logpm.supervise.vo.IndicatorsVO;
import com.logpm.supervise.vo.PointsVO;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import java.util.Objects;
/**
* 分类指标表 包装类,返回视图层所需的字段
*
* @author BladeX
* @since 2024-01-23
*/
public class PointsWrapper extends BaseEntityWrapper<PointsEntity, PointsVO> {
public static PointsWrapper build() {
return new PointsWrapper();
}
@Override
public PointsVO entityVO(PointsEntity pointsEntity) {
PointsVO pointsVO = Objects.requireNonNull(BeanUtil.copy(pointsEntity, PointsVO.class));
return pointsVO;
}
}
Loading…
Cancel
Save