From 1e2a0e979435033db296045fb968d6a35a7b48e2 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Wed, 16 Aug 2023 09:43:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=A9=E6=95=88=E8=AF=84=E4=BB=B7-=E6=95=B4?= =?UTF-8?q?=E6=94=B9=E5=AE=A1=E6=A0=B8=E8=AF=84=E4=BB=B7=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../performance/manage/RectifyAuditManage.java | 42 ++++++++++++---------- 1 file changed, 24 insertions(+), 18 deletions(-) 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..45fa6f4 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 @@ -108,13 +108,6 @@ 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(); - } // 获取评价计划内的所有需整改核查项目信息(整改状态为整改待审核、整改审核不通过、整改审核通过) List paps = performanceAppraisalProjectService.list(Wrappers @@ -128,6 +121,17 @@ public class RectifyAuditManage { 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)); @@ -136,17 +140,19 @@ public class RectifyAuditManage { 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());