diff --git a/pmapi/lib/agent-boot-1.3.22.0215.jar b/pmapi/lib/agent-boot-1.3.22.0215.jar new file mode 100644 index 0000000..bee98fb Binary files /dev/null and b/pmapi/lib/agent-boot-1.3.22.0215.jar differ diff --git a/pmapi/lib/dom4j-2.0.2.jar b/pmapi/lib/dom4j-2.0.2.jar new file mode 100644 index 0000000..7039b80 Binary files /dev/null and b/pmapi/lib/dom4j-2.0.2.jar differ diff --git a/pmapi/lib/gson-2.8.0.jar b/pmapi/lib/gson-2.8.0.jar new file mode 100644 index 0000000..1235f63 Binary files /dev/null and b/pmapi/lib/gson-2.8.0.jar differ diff --git a/pmapi/lib/httpclient-4.5.13.jar b/pmapi/lib/httpclient-4.5.13.jar new file mode 100644 index 0000000..218ee25 Binary files /dev/null and b/pmapi/lib/httpclient-4.5.13.jar differ diff --git a/pmapi/lib/httpcore-4.4.13.jar b/pmapi/lib/httpcore-4.4.13.jar new file mode 100644 index 0000000..163dc43 Binary files /dev/null and b/pmapi/lib/httpcore-4.4.13.jar differ diff --git a/pmapi/lib/httpmime-4.5.13.jar b/pmapi/lib/httpmime-4.5.13.jar new file mode 100644 index 0000000..cc52f44 Binary files /dev/null and b/pmapi/lib/httpmime-4.5.13.jar differ diff --git a/pmapi/lib/jbArchivesTools-1.0-SNAPSHOT.jar b/pmapi/lib/jbArchivesTools-1.0-SNAPSHOT.jar new file mode 100644 index 0000000..460fca6 Binary files /dev/null and b/pmapi/lib/jbArchivesTools-1.0-SNAPSHOT.jar differ diff --git a/pmapi/lib/slf4j-api-1.7.29.jar b/pmapi/lib/slf4j-api-1.7.29.jar new file mode 100644 index 0000000..81ed475 Binary files /dev/null and b/pmapi/lib/slf4j-api-1.7.29.jar differ diff --git a/pmapi/lib/suwell-agent-http-1.7.220630.jar b/pmapi/lib/suwell-agent-http-1.7.220630.jar new file mode 100644 index 0000000..0873d69 Binary files /dev/null and b/pmapi/lib/suwell-agent-http-1.7.220630.jar differ diff --git a/pmapi/lib/suwell-agent-wrapper-1.6.221208.jar b/pmapi/lib/suwell-agent-wrapper-1.6.221208.jar new file mode 100644 index 0000000..374c378 Binary files /dev/null and b/pmapi/lib/suwell-agent-wrapper-1.6.221208.jar differ diff --git a/pmapi/lib/suwell-convert-base-1.5.19.0408.jar b/pmapi/lib/suwell-convert-base-1.5.19.0408.jar new file mode 100644 index 0000000..67469ef Binary files /dev/null and b/pmapi/lib/suwell-convert-base-1.5.19.0408.jar differ diff --git a/pmapi/lib/suwell-packet-wrapper-1.21.230306.jar b/pmapi/lib/suwell-packet-wrapper-1.21.230306.jar new file mode 100644 index 0000000..a85805d Binary files /dev/null and b/pmapi/lib/suwell-packet-wrapper-1.21.230306.jar differ diff --git a/pmapi/lib/suwell-rpc-manager-client-2.7.211125.jar b/pmapi/lib/suwell-rpc-manager-client-2.7.211125.jar new file mode 100644 index 0000000..1c9351b Binary files /dev/null and b/pmapi/lib/suwell-rpc-manager-client-2.7.211125.jar differ diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/AppAppraisalController.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/AppAppraisalController.java index 393e318..ded57ee 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/AppAppraisalController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/AppAppraisalController.java @@ -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 unEvaluateList(@PathVariable Long planId, @PathVariable Long reAppraisalGroupId, PerformanceAppraisalListReq req) { - return appAppraisalManage.unEvaluateList(planId,reAppraisalGroupId,req); + public PageVo unEvaluateList(@PathVariable Long planId, PerformanceAppraisalListReq req) { + return appAppraisalManage.unEvaluateList(planId,req); } - @GetMapping("/evaluated-list/{planId}/{reAppraisalGroupId}") + @GetMapping("/evaluated-list/{planId}") @ApiOperation("当前绩效评价应用已评价列表") - public PageVo evaluatedList(@PathVariable Long planId, @PathVariable Long reAppraisalGroupId, PerformanceAppraisalListReq req) { - return appAppraisalManage.evaluatedList(planId,reAppraisalGroupId,req); + public PageVo 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); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/IndicatorConfigController.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/IndicatorConfigController.java index b303a83..0c392c6 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/IndicatorConfigController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/IndicatorConfigController.java @@ -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); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/OrgSelfAppraisalController.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/OrgSelfAppraisalController.java index 79cb512..36c1e3c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/OrgSelfAppraisalController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/OrgSelfAppraisalController.java @@ -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); + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/ReAppraisalController.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/ReAppraisalController.java index dd9e956..a3c61f4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/ReAppraisalController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/ReAppraisalController.java @@ -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); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/RectifyAuditController.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/RectifyAuditController.java index 8c4e6db..f294ea4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/RectifyAuditController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/RectifyAuditController.java @@ -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); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/RectifyController.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/RectifyController.java index ebcb6f4..4dc1f1c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/RectifyController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/RectifyController.java @@ -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); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/VerifyController.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/VerifyController.java index b68015e..b60a3b4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/VerifyController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/VerifyController.java @@ -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); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/AppAppraisalManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/AppAppraisalManage.java index 1cd6822..1910309 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/AppAppraisalManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/AppAppraisalManage.java @@ -131,19 +131,28 @@ public class AppAppraisalManage { } - public PageVo unEvaluateList(Long planId, Long reAppraisalGroupId, PerformanceAppraisalListReq req) { + public PageVo 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 projectGroups = groupService.list(Wrappers.lambdaQuery(PerformanceAppraisalProjectGroup.class) + .eq(PerformanceAppraisalProjectGroup::getAppraisalId, planId)); + if (CollUtil.isEmpty(projectGroups)){ + throw new BizException("当前应用所在评价计划的分组信息不存在"); + } + // 判断分组内是否添加复评人员 + List reUsers = projectGroups.stream().map(PerformanceAppraisalProjectGroup::getReAppraisalUsers).collect(Collectors.toList()); + if (CollUtil.isEmpty(reUsers)){ + throw new BizException("当前评价计划分组内未添加复评人员!"); + } // 获取分组所在评价计划添加的未完成评价的应用信息 List 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 evaluatedList(Long planId, Long reAppraisalGroupId, PerformanceAppraisalListReq req) { + public PageVo 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 projectGroups = groupService.list(Wrappers.lambdaQuery(PerformanceAppraisalProjectGroup.class) + .eq(PerformanceAppraisalProjectGroup::getAppraisalId, planId)); + if (CollUtil.isEmpty(projectGroups)){ + throw new BizException("当前应用所在评价计划的分组信息不存在"); + } + // 判断分组内是否添加复评人员 + List reUsers = projectGroups.stream().map(PerformanceAppraisalProjectGroup::getReAppraisalUsers).collect(Collectors.toList()); + if (CollUtil.isEmpty(reUsers)){ + throw new BizException("当前评价计划分组内未添加复评人员!"); + } // 获取分组所在评价计划添加的已完成评价的应用信息 List 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 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 commonIndexDetails = commonIndexList.stream().map(i -> { AppIndexDetailVO vo = new AppIndexDetailVO(); @@ -312,7 +337,7 @@ public class AppAppraisalManage { Map 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 auxIndexDetails = auxIndexList.stream().map(i -> { AppIndexDetailVO vo = new AppIndexDetailVO(); @@ -332,11 +357,11 @@ public class AppAppraisalManage { Map 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 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()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/OrgSelfAppraisalManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/OrgSelfAppraisalManage.java index d5b6695..a0a0977 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/OrgSelfAppraisalManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/OrgSelfAppraisalManage.java @@ -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 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 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 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 templateDetails = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class) + .eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId, projectTemplate.getId()) + .eq(PerformanceIndicatorProjectTemplateDetail::getIsAdditional,Boolean.FALSE)); + // 获取模版附加绩效指标详情 + List additionalTemplateDetails = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class) + .eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId, projectTemplate.getId()) + .eq(PerformanceIndicatorProjectTemplateDetail::getIsAdditional,Boolean.TRUE)); + List templateDetailVos = templateDetailBuildHelper.buildTemplateDetail(templateDetails,projectCode,vo); + List additionalTemplateDetailVos = templateDetailBuildHelper.buildTemplateDetail(additionalTemplateDetails,projectCode,vo); + Map templateDetailVoMap = templateDetailVos.stream().collect(Collectors.toMap(ProjectTemplateDetailVO::getId, t -> t)); + + List exportDataList = Lists.newArrayList(); + // 构建指标和打分详情 + Map scoreInfoMap = performanceAppraisalScoreInfoService.list().stream() + .collect(Collectors.toMap(PerformanceAppraisalScoreInfo::getTemplateDetailId, p -> p)); + + // 筛选出所有三级指标 + List 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()); + } + } + } + } + } + + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/ReAppraisalManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/ReAppraisalManage.java index 8afefc3..58a8304 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/ReAppraisalManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/ReAppraisalManage.java @@ -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("分组内项目信息不存在!"); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/RectifyAuditManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/RectifyAuditManage.java index c67b030..0e793f7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/RectifyAuditManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/RectifyAuditManage.java @@ -81,7 +81,7 @@ public class RectifyAuditManage { List userRoleList = user.getUserRoleList(); List 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,46 +107,52 @@ public class RectifyAuditManage { // 获取分组所在的评价计划ID List appraisalIds = - groups.stream().map(PerformanceAppraisalProjectGroup::getAppraisalId).collect(Collectors.toList()); - Page page = req.page(); - LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(PerformanceAppraisal.class) - .in(PerformanceAppraisal::getId, appraisalIds).orderByDesc(PerformanceAppraisal::getUpdateOn); - performanceAppraisalService.page(page, wrapper); - if (0L == page.getTotal()) { - return PageVo.empty(); - } + groups.stream().map(PerformanceAppraisalProjectGroup::getAppraisalId).collect(Collectors.toList()); // 获取评价计划内的所有需整改核查项目信息(整改状态为整改待审核、整改审核不通过、整改审核通过) List 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(); } + + Set appraisalIdList = paps.stream().map(PerformanceAppraisalProject::getAppraisalId).collect(Collectors.toSet()); + + Page page = req.page(); + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(PerformanceAppraisal.class) + .in(PerformanceAppraisal::getId, appraisalIdList).orderByDesc(PerformanceAppraisal::getUpdateOn); + performanceAppraisalService.page(page, wrapper); + if (0L == page.getTotal()) { + return PageVo.empty(); + } + // 按评价计划分组 Map> papsMap = - paps.stream().collect(Collectors.groupingBy(PerformanceAppraisalProject::getAppraisalId)); + paps.stream().collect(Collectors.groupingBy(PerformanceAppraisalProject::getAppraisalId)); List res = page.getRecords().stream().map(p -> { PerformanceAppraisalVO vo = BeanUtil.copyProperties(p, PerformanceAppraisalVO.class); // 统计评价计划待核查项目数量(整改状态为:整改待审核) List projects = papsMap.get(p.getId()); - List unRectifyAuditProjects = - projects.stream().filter(d -> RectifyStatusEnum.TO_BE_REVIEWED.getCode().equals(d.getRectifyStatus())) - .collect(Collectors.toList()); - vo.setUnRectifyAuditNumber(unRectifyAuditProjects.size()); - // 统计评价计划已核查项目数量(整改状态为:整改核查不通过、整改审核通过) - List rectifiedAuditProjects = - paps.stream() - .filter(d -> RectifyStatusEnum.NOT_APPROVED.getCode().equals(d.getRectifyStatus()) - || RectifyStatusEnum.APPROVED.getCode().equals(d.getRectifyStatus())) - .collect(Collectors.toList()); - vo.setRectifiedAuditNumber(rectifiedAuditProjects.size()); + if (CollUtil.isNotEmpty(projects)) { + List unRectifyAuditProjects = + projects.stream().filter(d -> RectifyStatusEnum.TO_BE_REVIEWED.getCode().equals(d.getRectifyStatus())) + .collect(Collectors.toList()); + vo.setUnRectifyAuditNumber(unRectifyAuditProjects.size()); + // 统计评价计划已核查项目数量(整改状态为:整改核查不通过、整改审核通过) + List rectifiedAuditProjects = + paps.stream() + .filter(d -> RectifyStatusEnum.NOT_APPROVED.getCode().equals(d.getRectifyStatus()) + || RectifyStatusEnum.APPROVED.getCode().equals(d.getRectifyStatus())) + .collect(Collectors.toList()); + vo.setRectifiedAuditNumber(rectifiedAuditProjects.size()); + } return vo; }).collect(Collectors.toList()); return PageVo.of(res, page.getTotal()); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/VerifyManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/VerifyManage.java index 03c167b..03cd9ea 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/VerifyManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/VerifyManage.java @@ -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("分组内项目信息不存在!"); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/AppraisalScoreExportDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/AppraisalScoreExportDTO.java new file mode 100644 index 0000000..163c1c8 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/AppraisalScoreExportDTO.java @@ -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; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/AppAppraisalIndexDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/AppAppraisalIndexDetailVO.java index 2ec63cb..7bd3b86 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/AppAppraisalIndexDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/AppAppraisalIndexDetailVO.java @@ -29,6 +29,9 @@ public class AppAppraisalIndexDetailVO implements Serializable { @ApiModelProperty("应用状态") private String applicationStatus; + @ApiModelProperty("应用名称") + private String applicationName; + @ApiModelProperty("通用指标详情") private List commonIndexDetails;