Browse Source

Merge branch 'ls2_performance_appraisal_0801' of http://git.ningdatech.com/liushuai/project-management into dev

 Conflicts:
	pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexTemplateVO.java
master
CMM 1 year ago
parent
commit
c69f083d23
4 changed files with 23 additions and 9 deletions
  1. +4
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/constant/BizConst.java
  2. +15
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java
  3. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/OrgSelfAppraisalManage.java
  4. +3
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexTemplateVO.java

+ 4
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/constant/BizConst.java View File

@@ -31,4 +31,8 @@ public interface BizConst {
* 立项批复金额大于2000万
*/
Integer AMOUNT_RANGE_THREE = 3;
/**
* 复评员
*/
String REAPPRAISAL_ROLE = "复评员";
}

+ 15
- 4
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java View File

@@ -44,6 +44,7 @@ import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@@ -100,9 +101,15 @@ public class IndicatorConfigManage {
}
ProjectIndexTemplateVO vo = BeanUtil.copyProperties(template,
ProjectIndexTemplateVO.class);
String projectTagIds = template.getProjectTagIds();
if (StringUtils.isNotBlank(projectTagIds)){
List<Long> proTagIdList = Arrays.stream(projectTagIds.split(StrPool.COMMA)).map(Long::valueOf).collect(Collectors.toList());
vo.setProjectTagIds(proTagIdList);
}
// 获取模版绩效指标详情
List<PerformanceIndicatorProjectTemplateDetail> templateDetails = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class)
.eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId, id));
.eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId, id)
.eq(PerformanceIndicatorProjectTemplateDetail::getIsAdditional,Boolean.FALSE));
// 获取模版附加绩效指标详情
List<PerformanceIndicatorProjectTemplateDetail> additionalTemplateDetails = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class)
.eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId, id)
@@ -151,10 +158,13 @@ public class IndicatorConfigManage {
if(CollUtil.isNotEmpty(dto.getTemplateDetails())){
//先删除
indicatorProjectTemplateDetailService.remove(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class)
.eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId,dto.getId()));
.eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId,dto.getId())
.eq(PerformanceIndicatorProjectTemplateDetail::getIsAdditional,Boolean.FALSE));
analysisTemplateDetails(dto.getTemplateDetails(),template.getId());
//校检 所有3级指标(不包括附加指标) 总分是不是100
List<PerformanceIndicatorProjectTemplateDetail> indexList = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class)
.eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId, template.getId())
.eq(PerformanceIndicatorProjectTemplateDetail::getIsAdditional,Boolean.FALSE)
.eq(PerformanceIndicatorProjectTemplateDetail::getType,PerformanceTemplateTypeEnum.THIRD_INDEX.getCode()));
if(CollUtil.isNotEmpty(indexList)){
BigDecimal sum = indexList.stream()
@@ -164,7 +174,6 @@ public class IndicatorConfigManage {
boolean score = (BigDecimal.valueOf(100)).equals(sum);
VUtils.isTrue(Boolean.FALSE.equals(score)).throwMessage("总分不是100 操作失败!");
}
analysisTemplateDetails(dto.getTemplateDetails(),template.getId());
}
// 保存 模版附加指标详情
if (CollUtil.isNotEmpty(dto.getAdditionalIndexDetails())){
@@ -220,6 +229,7 @@ public class IndicatorConfigManage {
templateDetail.setTemplateId(templateId);
// 一级指标的父ID为null
templateDetail.setParentId(parentId);
templateDetail.setIsAdditional(Boolean.FALSE);

indicatorProjectTemplateDetailService.save(templateDetail);

@@ -334,7 +344,8 @@ public class IndicatorConfigManage {
.eq(PerformanceIndicatorProjectTemplate::getProjectType, projectTemplate.getProjectType())
.eq(PerformanceIndicatorProjectTemplate::getProjectYear, projectTemplate.getProjectYear())
.eq(PerformanceIndicatorProjectTemplate::getAmountRange, projectTemplate.getAmountRange())
.eq(PerformanceIndicatorProjectTemplate::getProjectTagIds, projectTemplate.getProjectTagIds()));
.eq(PerformanceIndicatorProjectTemplate::getProjectTagIds, projectTemplate.getProjectTagIds())
.eq(PerformanceIndicatorProjectTemplate::getStatus,CommonEnum.YES.getCode()));
if (Objects.nonNull(template)){
throw new BizException("相同配置的模板已存在,当前模板无法启用!");
}


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/OrgSelfAppraisalManage.java View File

@@ -77,7 +77,7 @@ public class OrgSelfAppraisalManage {
Role role = roleService.getOne(Wrappers.lambdaQuery(Role.class)
.eq(Role::getName, RoleEnum.COMPANY_MANAGER.getDesc()));
if (Objects.isNull(role)){
throw new BizException("系统没有单位管理员角色!");
throw new BizException("登录用户没有单位管理员角色!");
}

// 登录用户不是单位管理员,不能查看本单位的自评计划列表


+ 3
- 4
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexTemplateVO.java View File

@@ -50,15 +50,14 @@ public class ProjectIndexTemplateVO implements Serializable {
@ApiModelProperty("状态 0关闭 1开启")
private Integer status;

@ApiModelProperty("项目标签信息")
private List<Long> projectTagIds;

@ApiModelProperty("绩效指标详情")
private List<ProjectTemplateDetailVO> templateDetails;

@ApiModelProperty("附加绩效指标详情")
private List<ProjectTemplateDetailVO> additionalIndexDetails;

@ApiModelProperty("项目标签ID")
private Long projectTagId;

@ApiModelProperty("项目标签名称")
private String projectTagName;
}

Loading…
Cancel
Save