From 846ef107b4f1a57114909371e828d0374e5ba7fc Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Fri, 21 Apr 2023 11:58:23 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=A4=84=E7=90=86?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/todocenter/manage/HandlerManage.java | 38 ++++++++++++++-------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java index 49c6e3e..5e95e1b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java @@ -3,13 +3,12 @@ package com.ningdatech.pmapi.todocenter.manage; import static com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant.*; import java.time.LocalDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Objects; -import java.util.Optional; +import java.util.*; import java.util.stream.Collectors; +import com.google.common.collect.Lists; import org.apache.commons.lang3.StringUtils; +import org.checkerframework.checker.nullness.qual.Nullable; import org.flowable.engine.HistoryService; import org.flowable.engine.RuntimeService; import org.flowable.engine.TaskService; @@ -89,17 +88,28 @@ public class HandlerManage { // 获取流程通过后当前流程详情 ProcessProgressVo newInstanceDetail = processInstanceService.getProgressInstanceDetail(null, instance.getId()); // 获取流程通过后当前审核人信息,向其发送工作通知 + // 会签/或签会有多个审核人 + List currentEmployeeCodeList = Lists.newArrayList(); List newProgressInfo = newInstanceDetail.getProgressInfo(); ProgressNode currentNode = newProgressInfo.get(newProgressInfo.size() - 1); - String currentEmployeeCode; + // 说明当前节点是子流程节点 if (currentNode.getNodeType().name().equals(NodeTypeEnum.SUB.name())) { List children = currentNode.getChildren(); // 获取子流程当前审核人节点 ProgressNode subCurrentNode = children.get(children.size() - 1); - currentEmployeeCode = subCurrentNode.getUserId(); + // 获取节点ID相同地审核节点 + List nodeList = children.stream() + .filter(c -> subCurrentNode.getNodeId().equals(c.getNodeId())) + .collect(Collectors.toList()); + List userIdList = nodeList.stream().map(ProgressNode::getUserId).collect(Collectors.toList()); + currentEmployeeCodeList.addAll(userIdList); } else { - currentEmployeeCode = currentNode.getUserId(); + List nodeList = newProgressInfo.stream() + .filter(c -> currentNode.getNodeId().equals(c.getNodeId())) + .collect(Collectors.toList()); + List userIdList = nodeList.stream().map(ProgressNode::getUserId).collect(Collectors.toList()); + currentEmployeeCodeList.addAll(userIdList); } // 流程通过后,判断当前登录用户是不是最后一个审核人 @@ -131,15 +141,17 @@ public class HandlerManage { noticeManage.sendNotice(instance.getStartUserId(),userId,declaredProject,instance.getProcessDefinitionName(), PASS_MSG_TEMPLATE2,MsgTypeEnum.PROJECT_REVIEW_PASS); } else { - // 若有下一个审核人(当前节点的用户), + // 若有下一个审核人(当前节点的用户),会签/或签会有多个 // 向其发送浙政钉工作通知:标题:审核任务 内容:【单位名称】的【项目名称】需要您审核。 // 获取发送浙政钉工作通知必要信息 - if (Objects.isNull(currentEmployeeCode)) { - throw new BizException("审核人信息不存在!"); + for (String currentEmployeeCode : currentEmployeeCodeList) { + if (Objects.isNull(currentEmployeeCode)) { + throw new BizException("审核人信息不存在!"); + } + //发送消息 + noticeManage.sendNotice(currentEmployeeCode,userId,declaredProject,instance.getProcessDefinitionName(), + PASS_MSG_TEMPLATE,MsgTypeEnum.PROJECT_REVIEW); } - //发送消息 - noticeManage.sendNotice(currentEmployeeCode,userId,declaredProject,instance.getProcessDefinitionName(), - PASS_MSG_TEMPLATE,MsgTypeEnum.PROJECT_REVIEW); } } From 745ee463811a5bbe1531a1959095ad678e08c9c7 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Fri, 21 Apr 2023 14:15:13 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=A2=84=E5=AE=A1=E5=B0=8Fbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java index 27405d1..bdb8f3d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java @@ -155,9 +155,8 @@ public class DefaultDeclaredProjectManage { return Collections.emptyMap(); } - UserFullInfoDTO startUser = userInfoHelper.getUserFullInfo(userFullInfo.getUserId()); - String startOrgCode = startUser.getEmpPosUnitCode(); - String startOrgName = startUser.getEmpPosUnitName(); + String startOrgCode = userFullInfo.getEmpPosUnitCode(); + String startOrgName = userFullInfo.getEmpPosUnitName(); String startOrgParentCode; String startOrgParentName; // 如果申报时 上级主管单位,由该单位自己审核 From 328e97101f1304f1cb5f41f563d2c6b4f1e9407f Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Fri, 21 Apr 2023 14:17:14 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=BA=93=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/utils/ProjectVersionUtil.java | 27 +++++++++------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/utils/ProjectVersionUtil.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/utils/ProjectVersionUtil.java index 8f96faf..4a5227b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/utils/ProjectVersionUtil.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/utils/ProjectVersionUtil.java @@ -63,28 +63,23 @@ public class ProjectVersionUtil { } // 获取之前版本的项目 - int index = projectList.size() - 1; - ProcessProgressVo instanceDetail = null; - while (index > 0){ - index = index - 1; - Project preProject = projectList.get(index); + for (Project preProject : projectList) { // 从项目流程实例关联表中查出实例详情 - List projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) - .eq(ProjectInst::getProjectId, preProject.getId()) - .eq(ProjectInst::getInstType,instTypeEnum.getCode())); + List projectInstList = projectInstService + .list(Wrappers.lambdaQuery(ProjectInst.class).eq(ProjectInst::getProjectId, preProject.getId()) + .eq(ProjectInst::getInstType, instTypeEnum.getCode())); if (CollUtil.isNotEmpty(projectInstList)) { List processProgressVoList = projectInstList.stream() - .map(p -> processInstanceService.getProgressInstanceDetail(null, p.getInstCode())) - .collect(Collectors.toList()); + .map(p -> processInstanceService.getProgressInstanceDetail(null, p.getInstCode())) + .collect(Collectors.toList()); // 筛选出上个版本该类型审核流程通过的流程详情 List instanceDetailList = processProgressVoList.stream() - .filter(p -> ProcessStatusEnum.APPROVED.getDesc().equals(p.getStatus())) - .collect(Collectors.toList()); - if (CollUtil.isEmpty(instanceDetailList)){ - continue; + .filter(p -> ProcessStatusEnum.APPROVED.getDesc().equals(p.getStatus())) + .collect(Collectors.toList()); + if (CollUtil.isNotEmpty(instanceDetailList)) { + // 获取最后一个流程详情 + return instanceDetailList.get(instanceDetailList.size() - 1); } - // 获取最后一个流程详情 - return instanceDetailList.get(instanceDetailList.size() - 1); } } return null;