Browse Source

绩效评价-新增应用指标修改

tags/24080901
CMM 1 year ago
parent
commit
3c462257e9
7 changed files with 79 additions and 39 deletions
  1. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/AppAppraisalController.java
  2. +0
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/OrgSelfAppraisalController.java
  3. +58
    -29
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/AppAppraisalManage.java
  4. +6
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java
  5. +6
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceIndicatorAppIndexSaveDTO.java
  6. +1
    -7
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/AppAppraisalIndexDetailVO.java
  7. +6
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/AppIndexVO.java

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/AppAppraisalController.java View File

@@ -37,11 +37,11 @@ public class AppAppraisalController {

@GetMapping("/unEvaluate-list/{planId}/{reAppraisalGroupId}")
@ApiOperation("当前绩效评价应用待评价列表")
public PageVo<PerformanceAppraisalAppVO> pendingList(@PathVariable Long planId, @PathVariable Long reAppraisalGroupId, PerformanceAppraisalListReq req) {
public PageVo<PerformanceAppraisalAppVO> unEvaluateList(@PathVariable Long planId, @PathVariable Long reAppraisalGroupId, PerformanceAppraisalListReq req) {
return appAppraisalManage.unEvaluateList(planId,reAppraisalGroupId,req);
}

@GetMapping("/evaluated-list/{planId}")
@GetMapping("/evaluated-list/{planId}/{reAppraisalGroupId}")
@ApiOperation("当前绩效评价应用已评价列表")
public PageVo<PerformanceAppraisalAppVO> evaluatedList(@PathVariable Long planId, @PathVariable Long reAppraisalGroupId, PerformanceAppraisalListReq req) {
return appAppraisalManage.evaluatedList(planId,reAppraisalGroupId,req);


+ 0
- 1
pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/OrgSelfAppraisalController.java View File

@@ -57,5 +57,4 @@ public class OrgSelfAppraisalController {
public String submitSelfAppraisal(@Valid @RequestBody ProjectAppraisalDTO param){
return selfAppraisalManage.submitSelfAppraisal(param);
}

}

+ 58
- 29
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/AppAppraisalManage.java View File

@@ -145,23 +145,28 @@ public class AppAppraisalManage {
List<PerformanceAppraisalApplication> paas = performanceAppraisalApplicationService.list(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class)
.eq(PerformanceAppraisalApplication::getAppraisalId, group.getAppraisalId())
.eq(PerformanceAppraisalApplication::getIsCompleteAppraisal, Boolean.FALSE));
// 没有当前用户待评价的应用信息
if (CollUtil.isEmpty(paas)){
return PageVo.empty();
}
List<Long> ids = paas.stream().map(PerformanceAppraisalApplication::getApplicationId).collect(Collectors.toList());
// 从绩效评价打分信息表中获取上述绩效评价计划应用的打分信息
List<PerformanceAppraisalAppScoreInfo> appraisalScoreInfos = performanceAppraisalAppScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class)
.eq(PerformanceAppraisalAppScoreInfo::getAppraisalId, planId));
// 筛选出当前登录用户未进行打分的应用信息
List<Long> appIds = appraisalScoreInfos.stream()
.filter(a -> !employeeCode.equals(a.getAppraisalEmployeeCode()))
.map(PerformanceAppraisalAppScoreInfo::getApplicationId)
.collect(Collectors.toList());

List<Long> appIds;
if (CollUtil.isNotEmpty(appraisalScoreInfos)) {
// 筛选出当前登录用户已进行打分的应用信息
List<Long> scoredAppIds = appraisalScoreInfos.stream()
.filter(a -> employeeCode.equals(a.getAppraisalEmployeeCode()))
.map(PerformanceAppraisalAppScoreInfo::getApplicationId)
.collect(Collectors.toList());
ids.removeAll(scoredAppIds);
}
appIds = ids;
// 没有当前用户待评价的应用信息
if(CollUtil.isEmpty(appIds)){
return PageVo.empty();
}

Page<ProjectApplication> page = req.page();
LambdaQueryWrapper<ProjectApplication> wrapper = Wrappers.lambdaQuery(ProjectApplication.class)
.in(ProjectApplication::getId, appIds)
@@ -195,23 +200,27 @@ public class AppAppraisalManage {
PerformanceAppraisalProjectGroup group = groupService.getById(reAppraisalGroupId);
VUtils.isTrue(Objects.isNull(group)).throwMessage("分组不存在!");

// 获取分组所在评价计划添加的完成评价的应用信息
// 获取分组所在评价计划添加的完成评价的应用信息
List<PerformanceAppraisalApplication> paas = performanceAppraisalApplicationService.list(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class)
.eq(PerformanceAppraisalApplication::getAppraisalId, group.getAppraisalId())
.eq(PerformanceAppraisalApplication::getIsCompleteAppraisal, Boolean.FALSE));
.eq(PerformanceAppraisalApplication::getIsCompleteAppraisal, Boolean.TRUE));
if (CollUtil.isEmpty(paas)){
return PageVo.empty();
}
// 从绩效评价打分信息表中获取上述绩效评价计划应用的打分信息
List<PerformanceAppraisalAppScoreInfo> appraisalScoreInfos = performanceAppraisalAppScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class)
.eq(PerformanceAppraisalAppScoreInfo::getAppraisalId, planId));
// 筛选出当前登录用户已进行打分的应用信息
List<Long> appIds = appraisalScoreInfos.stream()
.filter(a -> employeeCode.equals(a.getAppraisalEmployeeCode()))
.map(PerformanceAppraisalAppScoreInfo::getApplicationId)
.collect(Collectors.toList());
List<Long> appIds = Lists.newArrayList();
if (CollUtil.isNotEmpty(appraisalScoreInfos)) {
// 筛选出当前登录用户已进行打分的应用信息
List<Long> scoredAppIds = appraisalScoreInfos.stream()
.filter(a -> employeeCode.equals(a.getAppraisalEmployeeCode()))
.map(PerformanceAppraisalAppScoreInfo::getApplicationId)
.collect(Collectors.toList());
appIds = scoredAppIds;
}

// 没有当前用户待评价的应用信息
// 没有当前用户评价的应用信息
if(CollUtil.isEmpty(appIds)){
return PageVo.empty();
}
@@ -261,11 +270,21 @@ public class AppAppraisalManage {


public AppAppraisalIndexDetailVO detail(Long appId) {

ProjectApplication projectApplication = projectApplicationService.getById(appId);

AppAppraisalIndexDetailVO resVo = new AppAppraisalIndexDetailVO();
if (Objects.nonNull(projectApplication)){
resVo.setBuildOrgName(projectApplication.getBuildOrgName());
// todo 应用状态 需通过appCode通过IRS接口获取,这里暂时写死 已验收
resVo.setApplicationStatus("已验收");
}
// 获取指标配置的应用指标信息
// 通用指标
List<PerformanceAppraisalAppIndicator> commonIndexList = performanceAppraisalAppIndicatorService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppIndicator.class)
.eq(PerformanceAppraisalAppIndicator::getIndexType, AppIndexTypeEnum.COMMON.getCode()));
.eq(PerformanceAppraisalAppIndicator::getIndexType, AppIndexTypeEnum.COMMON.getCode())
.eq(PerformanceAppraisalAppIndicator::getIsDisplay,Boolean.TRUE)
.orderBy(Boolean.TRUE,Boolean.TRUE,PerformanceAppraisalAppIndicator::getSort));
// 获取当前应用通用指标的的打分信息
Map<Long, PerformanceAppraisalAppScoreInfo> commonScoreInfoMap = performanceAppraisalAppScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class)
.eq(PerformanceAppraisalAppScoreInfo::getApplicationId, appId)
@@ -286,7 +305,9 @@ public class AppAppraisalManage {

// 辅助指标
List<PerformanceAppraisalAppIndicator> auxIndexList = performanceAppraisalAppIndicatorService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppIndicator.class)
.eq(PerformanceAppraisalAppIndicator::getIndexType, AppIndexTypeEnum.AUX.getCode()));
.eq(PerformanceAppraisalAppIndicator::getIndexType, AppIndexTypeEnum.AUX.getCode())
.eq(PerformanceAppraisalAppIndicator::getIsDisplay,Boolean.TRUE)
.orderBy(Boolean.TRUE,Boolean.TRUE,PerformanceAppraisalAppIndicator::getSort));
// 获取当前应用辅助指标的的打分信息
Map<Long, PerformanceAppraisalAppScoreInfo> auxScoreInfoMap = performanceAppraisalAppScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class)
.eq(PerformanceAppraisalAppScoreInfo::getApplicationId, appId)
@@ -350,32 +371,40 @@ public class AppAppraisalManage {
.map(AppAppraisalInfoDTO::getIndexId)
.collect(Collectors.toList());
// 查出通用、辅助应用指标分数信息
List<PerformanceAppraisalAppIndicator> indexList = performanceAppraisalAppIndicatorService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppIndicator.class)
.in(PerformanceAppraisalAppIndicator::getId, indexIds));
if (CollUtil.isEmpty(indexList)){
throw new BizException("评价指标不存在!");
Map<Long, PerformanceAppraisalAppIndicator> indexMap = MapUtil.newHashMap();
if (CollUtil.isNotEmpty(indexIds)) {
List<PerformanceAppraisalAppIndicator> indexList = performanceAppraisalAppIndicatorService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppIndicator.class)
.in(PerformanceAppraisalAppIndicator::getId, indexIds));
if (CollUtil.isEmpty(indexList)) {
throw new BizException("通用/辅助评价指标不存在!");
}
indexMap = indexList.stream().collect(Collectors.toMap(PerformanceAppraisalAppIndicator::getId, d -> d));
}
Map<Long, PerformanceAppraisalAppIndicator> indexMap = indexList.stream().collect(Collectors.toMap(PerformanceAppraisalAppIndicator::getId, d -> d));

// 查出应用业务指标分数信息
List<ProjectCoreBusinessIndicators> businessIndexList = projectCoreBusinessIndicatorsService.list(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class)
.in(ProjectCoreBusinessIndicators::getId, businessIndexIds));
if (CollUtil.isEmpty(indexList)){
throw new BizException("评价指标不存在!");
Map<Long, ProjectCoreBusinessIndicators> businessIndexMap = MapUtil.newHashMap();
if (CollUtil.isNotEmpty(businessIndexIds)) {
List<ProjectCoreBusinessIndicators> businessIndexList = projectCoreBusinessIndicatorsService.list(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class)
.in(ProjectCoreBusinessIndicators::getId, businessIndexIds));
if (CollUtil.isEmpty(businessIndexList)) {
throw new BizException("核心业务评价指标不存在!");
}
businessIndexMap = businessIndexList.stream().collect(Collectors.toMap(ProjectCoreBusinessIndicators::getId, d -> d));
}
Map<Long, ProjectCoreBusinessIndicators> businessIndexMap = businessIndexList.stream().collect(Collectors.toMap(ProjectCoreBusinessIndicators::getId, d -> d));

Map<Long, PerformanceAppraisalAppIndicator> finalIndexMap = indexMap;
Map<Long, ProjectCoreBusinessIndicators> finalBusinessIndexMap = businessIndexMap;
List<PerformanceAppraisalAppScoreInfo> scoreInfos = appAppraisalInfoList.stream().map(a -> {
if (AppIndexTypeEnum.COMMON.getCode().equals(a.getIndexType()) ||
AppIndexTypeEnum.AUX.getCode().equals(a.getIndexType())){
PerformanceAppraisalAppIndicator appIndicator = indexMap.get(a.getIndexId());
PerformanceAppraisalAppIndicator appIndicator = finalIndexMap.get(a.getIndexId());
BigDecimal score = a.getScore();
BigDecimal indexScore = appIndicator.getIndexScore();
if (score.compareTo(indexScore) > 0 || score.compareTo(BigDecimal.ZERO) < 0){
throw new BizException("评价得分必须大于等于0且小于等于指标分值!");
}
} else if (AppIndexTypeEnum.BUSINESS.getCode().equals(a.getIndexType())) {
ProjectCoreBusinessIndicators coreBusinessIndicators = businessIndexMap.get(a.getIndexId());
ProjectCoreBusinessIndicators coreBusinessIndicators = finalBusinessIndexMap.get(a.getIndexId());
BigDecimal score = a.getScore();
BigDecimal indexScore = coreBusinessIndicators.getScore();
if (score.compareTo(indexScore) > 0 || score.compareTo(BigDecimal.ZERO) < 0){


+ 6
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java View File

@@ -415,6 +415,9 @@ public class PerformanceAppraisalPlanManage {
.eq(PerformanceAppraisalProject::getAppraisalId,editDTO.getId()));
// 删除项目的打分信息
List<Long> projectIds = editDTO.getProjects().stream().map(AppraisalProjectDTO::getId).collect(Collectors.toList());
if (CollUtil.isEmpty(projectIds)){
throw new BizException("请选择至少一个评价项目!");
}
List<String> projectCodes = projectService.listByIds(projectIds).stream().map(Project::getProjectCode).collect(Collectors.toList());
// 删除项目的打分信息
performanceAppraisalScoreInfoService.remove(Wrappers.lambdaQuery(PerformanceAppraisalScoreInfo.class)
@@ -457,6 +460,9 @@ public class PerformanceAppraisalPlanManage {
.eq(PerformanceAppraisalApplication::getAppraisalId,editDTO.getId()));
// 删除计划内应用的打分信息
List<Long> applicationIdList = editDTO.getApplicationIds();
if (CollUtil.isEmpty(applicationIdList)){
throw new BizException("请选择至少一个应用!");
}
// 删除应用的打分信息
performanceAppraisalAppScoreInfoService.remove(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class)
.eq(PerformanceAppraisalAppScoreInfo::getAppraisalId,editDTO.getId())


+ 6
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceIndicatorAppIndexSaveDTO.java View File

@@ -46,4 +46,10 @@ public class PerformanceIndicatorAppIndexSaveDTO implements Serializable {

@ApiModelProperty("指标分值")
private BigDecimal indexScore;

@ApiModelProperty("单位")
private String unit;

@ApiModelProperty("指标定义")
private String indexDef;
}

+ 1
- 7
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/AppAppraisalIndexDetailVO.java View File

@@ -27,7 +27,7 @@ public class AppAppraisalIndexDetailVO implements Serializable {
private String buildOrgName;

@ApiModelProperty("应用状态")
private Integer projectStatus;
private String applicationStatus;

@ApiModelProperty("通用指标详情")
private List<AppIndexDetailVO> commonIndexDetails;
@@ -38,10 +38,4 @@ public class AppAppraisalIndexDetailVO implements Serializable {
@ApiModelProperty("业务指标详情")
private List<AppBusinessIndexDetailVO> businessIndexDetails;

@ApiModelProperty("评价分数信息")
private List<PerformanceAppraisalAppScoreInfo> appraisalScoreInfo;

@ApiModelProperty("评价得分信息")
private Map<String, BigDecimal> appraisalTotalScoreInfo;

}

+ 6
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/AppIndexVO.java View File

@@ -47,6 +47,12 @@ public class AppIndexVO implements Serializable {
@ApiModelProperty("是否展示")
private Boolean isDisplay;

@ApiModelProperty("单位")
private String unit;

@ApiModelProperty("指标定义")
private String indexDef;

@ApiModelProperty("创建时间")
private LocalDateTime createOn;



Loading…
Cancel
Save