From b997b97ec025dfc5641b572a4f9f01eff48fe10c Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 9 Nov 2023 11:26:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A1=E6=9F=A5=E6=B8=85=E5=8D=95=20?= =?UTF-8?q?=E6=9E=9A=E4=B8=BE=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/ReviewChecklistManage.java | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewChecklistManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewChecklistManage.java index 3009e9b..5887720 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewChecklistManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewChecklistManage.java @@ -137,27 +137,29 @@ public class ReviewChecklistManage { } Integer maxNums = reviewHumans.size(); - final Integer[] finishNums = {DeclaredProjectContant.ReviewChecklist.INIT_NUM}; + Integer finishNums = 0; Set computeHumanSet = reviewHumans.stream().collect(Collectors.toSet()); if(CollUtil.isEmpty(reviewChecklistApproves)){ item.setReviewCheckNotApprove(convertUser(userMap,computeHumanSet)); - return finishNums[0] + StrPool.SLASH + maxNums; + return finishNums + StrPool.SLASH + maxNums; } - reviewChecklistApproves.forEach(r -> { - if(StringUtils.isNotBlank(r.getCreateByCode()) || - computeHumanSet.contains(r.getCreateByCode())){ - //说明 有指定人 审核过 - finishNums[0]++; - if(StringUtils.isNotBlank(user.getEmployeeCode()) && user.getEmployeeCode().equals(r.getCreateByCode())){ + for(ReviewChecklistApprove approve : reviewChecklistApproves){ + if(StringUtils.isNotBlank(approve.getCreateByCode()) || + computeHumanSet.contains(approve.getCreateByCode())){ + if(StringUtils.isNotBlank(user.getEmployeeCode()) && + user.getEmployeeCode().equals(approve.getCreateByCode())){ item.setApproved(Boolean.TRUE); } - computeHumanSet.remove(r.getCreateByCode()); + if(computeHumanSet.remove(approve.getCreateByCode())){ + //说明 有指定人 审核过 + finishNums++; + } } - }); + } item.setReviewCheckNotApprove(convertUser(userMap,computeHumanSet)); - return finishNums[0] + StrPool.SLASH + maxNums; + return finishNums + StrPool.SLASH + maxNums; } private String convertUser(Map userMap, Set computeHumanSet) {