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/manage/RectifyAuditManage.java
tags/24080901
CMM 1 year ago
parent
commit
3f1d679f50
14 changed files with 237 additions and 28 deletions
  1. +8
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/AppAppraisalController.java
  2. +1
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/IndicatorConfigController.java
  3. +11
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/OrgSelfAppraisalController.java
  4. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/ReAppraisalController.java
  5. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/RectifyAuditController.java
  6. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/RectifyController.java
  7. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/VerifyController.java
  8. +38
    -13
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/AppAppraisalManage.java
  9. +104
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/OrgSelfAppraisalManage.java
  10. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/ReAppraisalManage.java
  11. +9
    -9
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/RectifyAuditManage.java
  12. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/VerifyManage.java
  13. +49
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/AppraisalScoreExportDTO.java
  14. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/AppAppraisalIndexDetailVO.java

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

@@ -2,6 +2,7 @@ package com.ningdatech.pmapi.performance.controller;

import javax.validation.Valid;

import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.performance.manage.AppAppraisalManage;
import com.ningdatech.pmapi.performance.model.vo.*;
import org.springframework.web.bind.annotation.*;
@@ -35,16 +36,16 @@ public class AppAppraisalController {
return appAppraisalManage.list(req);
}

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

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

@GetMapping("/detail/{appId}")
@@ -55,6 +56,7 @@ public class AppAppraisalController {

@PostMapping("/save")
@ApiOperation("保存分数")
@WebLog(value = "保存分数",modular = "绩效评价-应用评价")
public String saveAppraisal(@Valid @RequestBody ProjectAppraisalDTO param){
return appAppraisalManage.saveAppraisal(param);
}


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

@@ -126,6 +126,7 @@ public class IndicatorConfigController {

@ApiOperation(value = "应用指标启用(禁用)", notes = "应用指标启用(禁用)")
@PutMapping("/app/index/{appId}/active/{state}")
@WebLog("应用指标库指标启用(禁用)")
public String enOrDisAppIndex(@PathVariable Long appId,
@PathVariable Boolean state) {
Boolean result = indicatorConfigManage.enOrDisAppIndex(appId, state);


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

@@ -1,6 +1,8 @@
package com.ningdatech.pmapi.performance.controller;

import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.common.util.ExcelDownUtil;
import com.ningdatech.pmapi.performance.manage.OrgSelfAppraisalManage;
import com.ningdatech.pmapi.performance.model.dto.ProjectAppraisalDTO;
import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq;
@@ -12,6 +14,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

/**
@@ -54,7 +57,15 @@ public class OrgSelfAppraisalController {

@PostMapping("/submit-self-appraisal")
@ApiOperation("提交自评")
@WebLog(value = "提交自评",modular = "绩效评价-单位自评")
public String submitSelfAppraisal(@Valid @RequestBody ProjectAppraisalDTO param){
return selfAppraisalManage.submitSelfAppraisal(param);
}

@GetMapping("/score/export/{projectCode}")
@ApiOperation("自评打分导出")
@WebLog(value = "自评打分导出",modular = "绩效评价-单位自评")
private void exportScore(@PathVariable String projectCode, HttpServletResponse response){
ExcelDownUtil.downXls(response, projectCode, selfAppraisalManage::exportScore);
}
}

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

@@ -2,6 +2,7 @@ package com.ningdatech.pmapi.performance.controller;

import javax.validation.Valid;

import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.performance.manage.ReAppraisalManage;
import org.springframework.web.bind.annotation.*;

@@ -44,6 +45,7 @@ public class ReAppraisalController {

@PostMapping("/submit-reAppraisal")
@ApiOperation("提交复评")
@WebLog(value = "提交复评",modular = "绩效评价-人工复评")
public String submitReAppraisal(@Valid @RequestBody ProjectAppraisalDTO param){
return reAppraisalManage.submitReAppraisal(param);
}


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

@@ -2,6 +2,7 @@ package com.ningdatech.pmapi.performance.controller;

import javax.validation.Valid;

import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.performance.manage.RectifyAuditManage;
import org.springframework.web.bind.annotation.*;

@@ -49,6 +50,7 @@ public class RectifyAuditController {

@PostMapping("/submit")
@ApiOperation("提交整改审核结果")
@WebLog(value = "提交整改审核结果",modular = "绩效评价-项目整改核查")
public String submit(@Valid @RequestBody ProjectAppraisalDTO param){
return rectifyAuditManage.submit(param);
}


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

@@ -2,6 +2,7 @@ package com.ningdatech.pmapi.performance.controller;

import javax.validation.Valid;

import com.ningdatech.log.annotation.WebLog;
import org.springframework.web.bind.annotation.*;

import com.ningdatech.basic.model.PageVo;
@@ -59,6 +60,7 @@ public class RectifyController {

@PostMapping("/fill-out-result")
@ApiOperation("填写整改情况")
@WebLog(value = "填写整改情况",modular = "绩效评价-项目整改")
public String fillOutResult(@Valid @RequestBody ProjectAppraisalDTO param) {
return rectifyManage.fillOutResult(param);
}


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

@@ -2,6 +2,7 @@ package com.ningdatech.pmapi.performance.controller;

import javax.validation.Valid;

import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.performance.manage.VerifyManage;
import org.springframework.web.bind.annotation.*;

@@ -43,6 +44,7 @@ public class VerifyController {

@PostMapping("/submit-verify")
@ApiOperation("提交核查")
@WebLog(value = "提交核查",modular = "绩效评价-专家核查")
public String submitVerify(@Valid @RequestBody ProjectAppraisalDTO param){
return verifyManage.submitVerify(param);
}


+ 38
- 13
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/AppAppraisalManage.java View File

@@ -131,19 +131,28 @@ public class AppAppraisalManage {
}


public PageVo<PerformanceAppraisalAppVO> unEvaluateList(Long planId, Long reAppraisalGroupId, PerformanceAppraisalListReq req) {
public PageVo<PerformanceAppraisalAppVO> unEvaluateList(Long planId, PerformanceAppraisalListReq req) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();
String employeeCode = user.getEmployeeCode();

PerformanceAppraisal plan = performanceAppraisalService.getById(planId);
VUtils.isTrue(Objects.isNull(plan)).throwMessage("该评价计划不存在!");

PerformanceAppraisalProjectGroup group = groupService.getById(reAppraisalGroupId);
VUtils.isTrue(Objects.isNull(group)).throwMessage("分组不存在!");
// 判断当前评价计划分组是否存在
List<PerformanceAppraisalProjectGroup> projectGroups = groupService.list(Wrappers.lambdaQuery(PerformanceAppraisalProjectGroup.class)
.eq(PerformanceAppraisalProjectGroup::getAppraisalId, planId));
if (CollUtil.isEmpty(projectGroups)){
throw new BizException("当前应用所在评价计划的分组信息不存在");
}
// 判断分组内是否添加复评人员
List<String> reUsers = projectGroups.stream().map(PerformanceAppraisalProjectGroup::getReAppraisalUsers).collect(Collectors.toList());
if (CollUtil.isEmpty(reUsers)){
throw new BizException("当前评价计划分组内未添加复评人员!");
}

// 获取分组所在评价计划添加的未完成评价的应用信息
List<PerformanceAppraisalApplication> paas = performanceAppraisalApplicationService.list(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class)
.eq(PerformanceAppraisalApplication::getAppraisalId, group.getAppraisalId())
.eq(PerformanceAppraisalApplication::getAppraisalId, planId)
.eq(PerformanceAppraisalApplication::getIsCompleteAppraisal, Boolean.FALSE));
// 没有当前用户待评价的应用信息
if (CollUtil.isEmpty(paas)){
@@ -181,6 +190,7 @@ public class AppAppraisalManage {
.map(p -> {
PerformanceAppraisalAppVO vo = BeanUtil.copyProperties(p, PerformanceAppraisalAppVO.class);
vo.setCanAppraisal(checkCanAppraisal(employeeCode,p.getId(),planId));
vo.setApplicationName(StringUtils.isNotBlank(p.getApplicationName()) ? p.getApplicationName() : p.getRelatedExistsApplication());
vo.setAppraisalId(planId);
return vo;
})
@@ -189,7 +199,7 @@ public class AppAppraisalManage {
return PageVo.of(res,page.getTotal());
}

public PageVo<PerformanceAppraisalAppVO> evaluatedList(Long planId, Long reAppraisalGroupId, PerformanceAppraisalListReq req) {
public PageVo<PerformanceAppraisalAppVO> evaluatedList(Long planId, PerformanceAppraisalListReq req) {

UserInfoDetails user = LoginUserUtil.loginUserDetail();
String employeeCode = user.getEmployeeCode();
@@ -197,12 +207,20 @@ public class AppAppraisalManage {
PerformanceAppraisal plan = performanceAppraisalService.getById(planId);
VUtils.isTrue(Objects.isNull(plan)).throwMessage("该评价计划不存在!");

PerformanceAppraisalProjectGroup group = groupService.getById(reAppraisalGroupId);
VUtils.isTrue(Objects.isNull(group)).throwMessage("分组不存在!");

// 判断当前评价计划分组是否存在
List<PerformanceAppraisalProjectGroup> projectGroups = groupService.list(Wrappers.lambdaQuery(PerformanceAppraisalProjectGroup.class)
.eq(PerformanceAppraisalProjectGroup::getAppraisalId, planId));
if (CollUtil.isEmpty(projectGroups)){
throw new BizException("当前应用所在评价计划的分组信息不存在");
}
// 判断分组内是否添加复评人员
List<String> reUsers = projectGroups.stream().map(PerformanceAppraisalProjectGroup::getReAppraisalUsers).collect(Collectors.toList());
if (CollUtil.isEmpty(reUsers)){
throw new BizException("当前评价计划分组内未添加复评人员!");
}
// 获取分组所在评价计划添加的已完成评价的应用信息
List<PerformanceAppraisalApplication> paas = performanceAppraisalApplicationService.list(Wrappers.lambdaQuery(PerformanceAppraisalApplication.class)
.eq(PerformanceAppraisalApplication::getAppraisalId, group.getAppraisalId())
.eq(PerformanceAppraisalApplication::getAppraisalId, planId)
.eq(PerformanceAppraisalApplication::getIsCompleteAppraisal, Boolean.TRUE));
if (CollUtil.isEmpty(paas)){
return PageVo.empty();
@@ -239,6 +257,7 @@ public class AppAppraisalManage {
.map(p -> {
PerformanceAppraisalAppVO vo = BeanUtil.copyProperties(p, PerformanceAppraisalAppVO.class);
vo.setCanAppraisal(checkCanAppraisal(employeeCode,p.getId(),planId));
vo.setApplicationName(StringUtils.isNotBlank(p.getApplicationName()) ? p.getApplicationName() : p.getRelatedExistsApplication());
vo.setAppraisalId(planId);
return vo;
})
@@ -272,8 +291,14 @@ public class AppAppraisalManage {
public AppAppraisalIndexDetailVO detail(Long appId) {

ProjectApplication projectApplication = projectApplicationService.getById(appId);
VUtils.isTrue(Objects.isNull(projectApplication)).throwMessage("应用不存在!");

AppAppraisalIndexDetailVO resVo = new AppAppraisalIndexDetailVO();
if (StringUtils.isNotBlank(projectApplication.getApplicationName())) {
resVo.setApplicationName(projectApplication.getApplicationName());
}else {
resVo.setApplicationName(projectApplication.getRelatedExistsApplication());
}
if (Objects.nonNull(projectApplication)){
resVo.setBuildOrgName(projectApplication.getBuildOrgName());
// todo 应用状态 需通过appCode通过IRS接口获取,这里暂时写死 已验收
@@ -289,7 +314,7 @@ public class AppAppraisalManage {
Map<Long, PerformanceAppraisalAppScoreInfo> commonScoreInfoMap = performanceAppraisalAppScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class)
.eq(PerformanceAppraisalAppScoreInfo::getApplicationId, appId)
.eq(PerformanceAppraisalAppScoreInfo::getIndexType, AppIndexTypeEnum.COMMON.getCode()))
.stream().collect(Collectors.toMap(PerformanceAppraisalAppScoreInfo::getIndexId, p -> p));
.stream().collect(Collectors.toMap(PerformanceAppraisalAppScoreInfo::getId, p -> p));
if (CollUtil.isNotEmpty(commonIndexList)) {
List<AppIndexDetailVO> commonIndexDetails = commonIndexList.stream().map(i -> {
AppIndexDetailVO vo = new AppIndexDetailVO();
@@ -312,7 +337,7 @@ public class AppAppraisalManage {
Map<Long, PerformanceAppraisalAppScoreInfo> auxScoreInfoMap = performanceAppraisalAppScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class)
.eq(PerformanceAppraisalAppScoreInfo::getApplicationId, appId)
.eq(PerformanceAppraisalAppScoreInfo::getIndexType, AppIndexTypeEnum.AUX.getCode()))
.stream().collect(Collectors.toMap(PerformanceAppraisalAppScoreInfo::getIndexId, p -> p));
.stream().collect(Collectors.toMap(PerformanceAppraisalAppScoreInfo::getId, p -> p));
if (CollUtil.isNotEmpty(auxIndexList)) {
List<AppIndexDetailVO> auxIndexDetails = auxIndexList.stream().map(i -> {
AppIndexDetailVO vo = new AppIndexDetailVO();
@@ -332,11 +357,11 @@ public class AppAppraisalManage {
Map<Long, PerformanceAppraisalAppScoreInfo> businessScoreInfoMap = performanceAppraisalAppScoreInfoService.list(Wrappers.lambdaQuery(PerformanceAppraisalAppScoreInfo.class)
.eq(PerformanceAppraisalAppScoreInfo::getApplicationId, appId)
.eq(PerformanceAppraisalAppScoreInfo::getIndexType, AppIndexTypeEnum.BUSINESS.getCode()))
.stream().collect(Collectors.toMap(PerformanceAppraisalAppScoreInfo::getIndexId, p -> p));
.stream().collect(Collectors.toMap(PerformanceAppraisalAppScoreInfo::getId, p -> p));
if (CollUtil.isNotEmpty(coreBusinessIndicators)) {
List<AppBusinessIndexDetailVO> businessIndexDetails = coreBusinessIndicators.stream().map(c -> {
AppBusinessIndexDetailVO appBusinessIndexDetailVo = new AppBusinessIndexDetailVO();
BeanUtils.copyProperties(coreBusinessIndicators, appBusinessIndexDetailVo);
BeanUtils.copyProperties(c, appBusinessIndexDetailVo);
PerformanceAppraisalAppScoreInfo scoreInfo = businessScoreInfoMap.get(c.getId());
if (Objects.nonNull(scoreInfo)) {
appBusinessIndexDetailVo.setAppraisalScore(scoreInfo.getAppraisalScore());


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

@@ -5,13 +5,17 @@ import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.StrPool;
import com.ningdatech.pmapi.common.enumeration.CommonEnum;
import com.ningdatech.pmapi.performance.constant.BizConst;
import com.ningdatech.pmapi.performance.enumration.AppraisalTypeEnum;
import com.ningdatech.pmapi.performance.enumration.PerformanceTemplateTypeEnum;
import com.ningdatech.pmapi.performance.helper.TemplateDetailBuildHelper;
import com.ningdatech.pmapi.performance.model.dto.AppraisalScoreExportDTO;
import com.ningdatech.pmapi.performance.model.dto.ProjectAppraisalDTO;
import com.ningdatech.pmapi.performance.model.dto.ProjectAppraisalInfoDTO;
import com.ningdatech.pmapi.performance.model.entity.*;
@@ -36,6 +40,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*;
@@ -367,4 +372,103 @@ public class OrgSelfAppraisalManage {
}
return "提交失败";
}

public void exportScore(HttpServletResponse response, String projectCode) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();
String regionCode = user.getRegionCode();

ProjectAppraisalIndexDetailVO vo = new ProjectAppraisalIndexDetailVO();

// 根据项目编码获取最新版本的项目信息
Project project = projectService.getProjectByCode(projectCode);
VUtils.isTrue(Objects.isNull(project)).throwMessage("项目不存在!");
// 根据项目类型、预算年度、批复金额、项目标签匹配本区域指标模版
Integer projectType = project.getProjectType();
Integer projectYear = project.getProjectYear();
BigDecimal approvalAmount = project.getApprovalAmount();
VUtils.isTrue(Objects.isNull(approvalAmount)).throwMessage("未获取到该项目的立项批复金额");
// 根据项目code获取项目标签ID列表
List<Long> tagIdList = projectTagService.list(Wrappers.lambdaQuery(ProjectTag.class)
.eq(ProjectTag::getProjectCode, projectCode)).stream()
.map(ProjectTag::getTagId).collect(Collectors.toList());
VUtils.isTrue(CollUtil.isEmpty(tagIdList)).throwMessage("当前项目未设置标签,匹配不到指标模板,请至项目库或评价计划编辑页面设置标签!");

List<String> strIdList = tagIdList.stream().map(String::valueOf).collect(Collectors.toList());
String projectTagIds = String.join(StrPool.COMMA, strIdList);

Integer amountRange = null;
if (approvalAmount.compareTo(BigDecimal.valueOf(BizConst.FIVE_MILLION)) < 0){
amountRange = BizConst.AMOUNT_RANGE_ONE;
} else if (approvalAmount.compareTo(BigDecimal.valueOf(BizConst.FIVE_MILLION)) >= 0 &&
approvalAmount.compareTo(BigDecimal.valueOf(BizConst.TWENTY_MILLION)) < 0) {
amountRange = BizConst.AMOUNT_RANGE_TWO;
}else if (approvalAmount.compareTo(BigDecimal.valueOf(BizConst.TWENTY_MILLION)) >= 0){
amountRange = BizConst.AMOUNT_RANGE_THREE;
}
LambdaQueryWrapper<PerformanceIndicatorProjectTemplate> wrapper = Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplate.class)
.eq(PerformanceIndicatorProjectTemplate::getRegionCode, regionCode)
.eq(PerformanceIndicatorProjectTemplate::getProjectType, projectType)
.eq(PerformanceIndicatorProjectTemplate::getProjectYear, projectYear)
.eq(PerformanceIndicatorProjectTemplate::getAmountRange, amountRange)
.eq(PerformanceIndicatorProjectTemplate::getProjectTagIds,projectTagIds)
.orderByDesc(PerformanceIndicatorProjectTemplate::getUpdateOn);
PerformanceIndicatorProjectTemplate projectTemplate = indicatorProjectTemplateService.getOne(wrapper);

if (Objects.isNull(projectTemplate)){
throw new BizException("该项目匹配不到指标模板,请返回上一页或者刷新重试。");
}
// 装配项目指标详情及分数信息
// 获取模版绩效指标详情
List<PerformanceIndicatorProjectTemplateDetail> templateDetails = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class)
.eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId, projectTemplate.getId())
.eq(PerformanceIndicatorProjectTemplateDetail::getIsAdditional,Boolean.FALSE));
// 获取模版附加绩效指标详情
List<PerformanceIndicatorProjectTemplateDetail> additionalTemplateDetails = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class)
.eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId, projectTemplate.getId())
.eq(PerformanceIndicatorProjectTemplateDetail::getIsAdditional,Boolean.TRUE));
List<ProjectTemplateDetailVO> templateDetailVos = templateDetailBuildHelper.buildTemplateDetail(templateDetails,projectCode,vo);
List<ProjectTemplateDetailVO> additionalTemplateDetailVos = templateDetailBuildHelper.buildTemplateDetail(additionalTemplateDetails,projectCode,vo);
Map<Long, ProjectTemplateDetailVO> templateDetailVoMap = templateDetailVos.stream().collect(Collectors.toMap(ProjectTemplateDetailVO::getId, t -> t));

List<AppraisalScoreExportDTO> exportDataList = Lists.newArrayList();
// 构建指标和打分详情
Map<Long, PerformanceAppraisalScoreInfo> scoreInfoMap = performanceAppraisalScoreInfoService.list().stream()
.collect(Collectors.toMap(PerformanceAppraisalScoreInfo::getTemplateDetailId, p -> p));
// 筛选出所有三级指标
List<ProjectTemplateDetailVO> thirdVos = templateDetailVos.stream()
.filter(t -> PerformanceTemplateTypeEnum.THIRD_INDEX.getCode().equals(t.getType()))
.collect(Collectors.toList());
for (ProjectTemplateDetailVO templateDetailVo : thirdVos) {
AppraisalScoreExportDTO thirdDto = new AppraisalScoreExportDTO();
thirdDto.setThirdIndexName(templateDetailVo.getName());
thirdDto.setIndexDetail(templateDetailVo.getIndexDetail());
thirdDto.setGradeDetail(templateDetailVo.getGradeDetail());
thirdDto.setSupportMaterial(templateDetailVo.getSupportMaterial());
thirdDto.setIndexScore(templateDetailVo.getIndexScore());
thirdDto.setIsAdditional(CommonEnum.YES.getDesc());
PerformanceAppraisalScoreInfo appraisalScoreInfo = scoreInfoMap.get(templateDetailVo.getId());
if (Objects.nonNull(appraisalScoreInfo)) {
thirdDto.setAppraisalBasis(appraisalScoreInfo.getAppraisalBasis());
}
exportDataList.add(thirdDto);
// 二级指标名称
Long secondId = templateDetailVo.getParentId();
if (Objects.nonNull(secondId)) {
ProjectTemplateDetailVO secondTemplateDetailVo = templateDetailVoMap.get(secondId);
if (Objects.nonNull(secondTemplateDetailVo)) {
thirdDto.setSecondIndexName(secondTemplateDetailVo.getName());
// 一级指标名称
Long firstId = secondTemplateDetailVo.getParentId();
if (Objects.nonNull(firstId)){
ProjectTemplateDetailVO firstTemplateDetailVo = templateDetailVoMap.get(secondId);
if (Objects.nonNull(firstTemplateDetailVo)) {
thirdDto.setFirstIndexName(firstTemplateDetailVo.getName());
}
}
}
}
}

}
}

+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/ReAppraisalManage.java View File

@@ -163,6 +163,9 @@ public class ReAppraisalManage {

// 获取分组内的项目信息
PerformanceAppraisalProjectGroup projectGroup = groupService.getById(groupId);
if (Objects.isNull(projectGroup)){
throw new BizException("当前复评用户所在分组不存在!");
}
String projectCodes = projectGroup.getProjectCodes();
Long appraisalId = projectGroup.getAppraisalId();
VUtils.isTrue(StringUtils.isBlank(projectCodes)).throwMessage("分组内项目信息不存在!");


+ 9
- 9
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/RectifyAuditManage.java View File

@@ -81,7 +81,7 @@ public class RectifyAuditManage {
List<Role> userRoleList = user.getUserRoleList();
List<Long> roleIdList = userRoleList.stream().map(Role::getId).collect(Collectors.toList());
Role role =
roleService.getOne(Wrappers.lambdaQuery(Role.class).eq(Role::getName, RoleEnum.EXPERT.getDesc()));
roleService.getOne(Wrappers.lambdaQuery(Role.class).eq(Role::getName, RoleEnum.EXPERT.getDesc()));
if (Objects.isNull(role)) {
throw new BizException("登录用户没有专家角色!");
}
@@ -107,16 +107,16 @@ public class RectifyAuditManage {

// 获取分组所在的评价计划ID
List<Long> appraisalIds =
groups.stream().map(PerformanceAppraisalProjectGroup::getAppraisalId).collect(Collectors.toList());
groups.stream().map(PerformanceAppraisalProjectGroup::getAppraisalId).collect(Collectors.toList());

// 获取评价计划内的所有需整改核查项目信息(整改状态为整改待审核、整改审核不通过、整改审核通过)
List<PerformanceAppraisalProject> paps = performanceAppraisalProjectService.list(Wrappers
.lambdaQuery(PerformanceAppraisalProject.class)
.in(PerformanceAppraisalProject::getAppraisalId, appraisalIds)
.and(wp -> wp.eq(PerformanceAppraisalProject::getRectifyStatus, RectifyStatusEnum.TO_BE_REVIEWED.getCode())
.or().eq(PerformanceAppraisalProject::getRectifyStatus, RectifyStatusEnum.NOT_APPROVED.getCode()).or()
.eq(PerformanceAppraisalProject::getRectifyStatus, RectifyStatusEnum.APPROVED.getCode()))
.eq(PerformanceAppraisalProject::getIsRectify, Boolean.TRUE));
.lambdaQuery(PerformanceAppraisalProject.class)
.in(PerformanceAppraisalProject::getAppraisalId, appraisalIds)
.and(wp -> wp.eq(PerformanceAppraisalProject::getRectifyStatus, RectifyStatusEnum.TO_BE_REVIEWED.getCode())
.or().eq(PerformanceAppraisalProject::getRectifyStatus, RectifyStatusEnum.NOT_APPROVED.getCode()).or()
.eq(PerformanceAppraisalProject::getRectifyStatus, RectifyStatusEnum.APPROVED.getCode()))
.eq(PerformanceAppraisalProject::getIsRectify, Boolean.TRUE));
// 评价计划内符合条件的项目数为空
if (CollUtil.isEmpty(paps)) {
return PageVo.empty();
@@ -134,7 +134,7 @@ public class RectifyAuditManage {

// 按评价计划分组
Map<Long, List<PerformanceAppraisalProject>> papsMap =
paps.stream().collect(Collectors.groupingBy(PerformanceAppraisalProject::getAppraisalId));
paps.stream().collect(Collectors.groupingBy(PerformanceAppraisalProject::getAppraisalId));

List<PerformanceAppraisalVO> res = page.getRecords().stream().map(p -> {
PerformanceAppraisalVO vo = BeanUtil.copyProperties(p, PerformanceAppraisalVO.class);


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/VerifyManage.java View File

@@ -155,6 +155,9 @@ public class VerifyManage {

// 获取分组内的项目信息
PerformanceAppraisalProjectGroup projectGroup = groupService.getById(groupId);
if (Objects.isNull(projectGroup)){
throw new BizException("当前核查用户所在分组不存在!");
}
String projectCodes = projectGroup.getProjectCodes();
Long appraisalId = projectGroup.getAppraisalId();
VUtils.isTrue(StringUtils.isBlank(projectCodes)).throwMessage("分组内项目信息不存在!");


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

@@ -0,0 +1,49 @@
package com.ningdatech.pmapi.performance.model.dto;

import java.io.Serializable;
import java.math.BigDecimal;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* 绩效打分详情导出实体
*
* @author CMM
* @since 2023/08/16 10:31
*/
@Data
public class AppraisalScoreExportDTO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("一级指标名称")
private String firstIndexName;

@ApiModelProperty("二级指标名称")
private String secondIndexName;

@ApiModelProperty("三级指标名称")
private String thirdIndexName;

@ApiModelProperty("指标分值 3级指标才有")
private BigDecimal indexScore;

@ApiModelProperty("指标细则 3级指标才有")
private String indexDetail;

@ApiModelProperty("评分细则")
private String gradeDetail;

@ApiModelProperty("佐证材料描述")
private String supportMaterial;

@ApiModelProperty("自评依据")
private String appraisalBasis;

@ApiModelProperty("自评得分")
private BigDecimal appraisalScore;

@ApiModelProperty("是否为附加指标")
private String isAdditional;
}

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

@@ -29,6 +29,9 @@ public class AppAppraisalIndexDetailVO implements Serializable {
@ApiModelProperty("应用状态")
private String applicationStatus;

@ApiModelProperty("应用名称")
private String applicationName;

@ApiModelProperty("通用指标详情")
private List<AppIndexDetailVO> commonIndexDetails;



Loading…
Cancel
Save