From 1ef0bd5765b932defe19d719c3512282bbd29dce Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 27 Apr 2023 15:46:20 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8C=BA=E5=8E=BF=20500=E4=B8=87=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E9=87=8D=E5=A4=A7=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java index 1c4a134..d0ad64c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java @@ -94,7 +94,7 @@ public class WithDrawHandle { children = children.stream() .filter(c -> !NodeTypeEnum.CC.name().equals(c.getNodeType().name())) .collect(Collectors.toList()); - if (CollUtil.isEmpty(currentProgressInfo)){ + if (CollUtil.isEmpty(children)){ return Boolean.FALSE; } currentProgressNode = children.get(children.size() - 1); From 75270722a6d4436e5e041ecb6c4224be97e5b561 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 27 Apr 2023 17:50:58 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E5=8F=B0=20=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/DeclaredStatisticsMapper.xml | 4 +-- .../controller/TodoCenterController.java | 4 +-- .../pmapi/todocenter/manage/TodoCenterManage.java | 36 ++++++++++++++++++---- .../todocenter/model/vo/ResToBeProcessedVO.java | 3 ++ 4 files changed, 37 insertions(+), 10 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/DeclaredStatisticsMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/DeclaredStatisticsMapper.xml index def00d1..3087d8c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/DeclaredStatisticsMapper.xml +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/DeclaredStatisticsMapper.xml @@ -16,7 +16,7 @@ sum(p.approval_amount) approvalAmount FROM nd_project p - WHERE build_org_code = #{orgCode} and project_year = #{year} + WHERE build_org_code = #{orgCode} and project_year = #{year} and newest = true diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java index e151536..b2bd213 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java @@ -82,8 +82,8 @@ public class TodoCenterController { */ @PostMapping("/handler") public Object handler(@Valid @RequestBody ReqProcessHandlerDTO param) { - todoCenterManage.handler(param); - return "操作成功"; + String nextTaskId = todoCenterManage.handler(param); + return nextTaskId; } /** diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index 27e3e55..fb458bd 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -21,6 +21,8 @@ import org.flowable.engine.HistoryService; import org.flowable.engine.RuntimeService; import org.flowable.engine.TaskService; import org.flowable.engine.history.HistoricProcessInstance; +import org.flowable.engine.runtime.ActivityInstance; +import org.flowable.engine.runtime.ActivityInstanceQuery; import org.flowable.engine.task.Comment; import org.flowable.variable.api.history.HistoricVariableInstance; import org.springframework.beans.BeanUtils; @@ -202,8 +204,8 @@ public class TodoCenterManage { Map taskMap = userTodoList.stream() .sorted((t1,t2) -> t2.getTaskCreateTime().compareTo(t1.getTaskCreateTime())) .collect(Collectors.toList()).stream() - .filter(v -> processSet.add(v.getInstanceId())) - .collect(Collectors.toMap(ProcessTaskVo::getInstanceId, v -> v)); + .filter(v -> processSet.add(v.getNodeId())) + .collect(Collectors.toMap(ProcessTaskVo::getNodeId, v -> v)); List resVos = userTodoList.stream().map(d -> { Project projectInfo = projectInfoMap.get(d.getInstanceId()); @@ -213,11 +215,12 @@ public class TodoCenterManage { res.setProjectId(projectInfo.getId()); res.setBuildOrg(projectInfo.getBuildOrgName()); res.setDeclaredAmount(projectInfo.getDeclareAmount()); - ProcessTaskVo taskVo = taskMap.get(d.getInstanceId()); - res.setNodeId(taskVo.getTaskDefKey()); + ProcessTaskVo taskVo = taskMap.get(d.getNodeId()); + res.setNodeId(d.getNodeId()); res.setProcessStatusName(taskVo.getStatus()); res.setProcessLaunchTime(d.getTaskCreateTime()); res.setProcessDefName(d.getProcessDefName()); + res.setTaskId(d.getTaskId()); return res; }).collect(Collectors.toList()); return PageVo.of(resVos, list.size()); @@ -305,7 +308,7 @@ public class TodoCenterManage { * @author CMM * @since 2023/02/01 */ - public void handler(ReqProcessHandlerDTO param) { + public String handler(ReqProcessHandlerDTO param) { // 获取登录用户ID UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); // 获取登录用户浙政钉code @@ -340,7 +343,8 @@ public class TodoCenterManage { processTaskService.handleTask(param, employeeCode); //通过审核后 所处理的逻辑 handlerManage.afterPassTodo(declaredProject,instance); - break; + + return findNextTaskId(instance); // 驳回 case REJECT: // 驳回该任务,中止流程并使项目进入对应状态,给项目创建人、流程发起人发送浙政钉工作通知: @@ -380,6 +384,26 @@ public class TodoCenterManage { default: throw new IllegalStateException("Unexpected value: " + param.getAction()); } + return "操作成功"; + } + + /** + * 寻找下一个审核task + * @param instance + * @return + */ + private String findNextTaskId(HistoricProcessInstance instance) { + List userTasks = runtimeService.createActivityInstanceQuery() + .activityType("userTask") + .processInstanceId(instance.getId()) + .orderByActivityInstanceStartTime() + .desc() + .unfinished() + .list(); + if(CollUtil.isEmpty(userTasks)){ + return "处理成功"; + } + return userTasks.get(0).getTaskId(); } /** diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ResToBeProcessedVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ResToBeProcessedVO.java index a3fd9f5..fd53e7c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ResToBeProcessedVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ResToBeProcessedVO.java @@ -32,6 +32,9 @@ public class ResToBeProcessedVO implements Serializable { @ApiModelProperty("待处理节点ID") private String nodeId; + @ApiModelProperty("任务ID") + private String taskId; + @ApiModelProperty("项目名称") private String projectName; From 204cb91c9c0a6cbb508cb0f96e6bc54860bbcade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?niohe=C2=B7erbao?= Date: Fri, 28 Apr 2023 09:13:07 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=93=E5=AE=B6?= =?UTF-8?q?=E5=BA=93=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B6=E4=B8=8D=E7=94=9F?= =?UTF-8?q?=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../expert/mapper/ExpertAdminManageMapper.xml | 3 +-- .../pmapi/user/manage/UserInfoManage.java | 24 +++++++++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertAdminManageMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertAdminManageMapper.xml index 8eceaf9..425f052 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertAdminManageMapper.xml +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertAdminManageMapper.xml @@ -42,8 +42,7 @@ ) - -- ORDER BY create_on DESC - + ORDER BY update_on DESC diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java index 7a2d392..fb052a2 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java @@ -145,14 +145,28 @@ public class UserInfoManage { // 查重符合筛选条件的组织列表 if (StringUtils.isNotBlank(orgName)) { List dingOrganizationList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class) - .like(DingOrganization::getOrganizationName, orgName)); - List compliantOrgNameList = dingOrganizationList.stream() + .like(DingOrganization::getOrganizationName, orgName) + .notIn(DingOrganization::getTypeCode, "GOV_INTERNAL_INSTITUTION") + ); + + List compliantOrgNameCodeList = dingOrganizationList.stream() .map(DingOrganization::getOrganizationCode) .collect(Collectors.toList()); - if (CollUtil.isEmpty(compliantOrgNameList)) { + if (CollUtil.isEmpty(compliantOrgNameCodeList)) { + return new ArrayList<>(); + } + + // 取交集 + List tempCompliantOrgCodeList = new ArrayList<>(); + for (String compliantOrgNameCode : compliantOrgNameCodeList) { + if (compliantOrgCodeList.contains(compliantOrgNameCode)) { + tempCompliantOrgCodeList.add(compliantOrgNameCode); + } + } + compliantOrgCodeList = tempCompliantOrgCodeList; + if (CollUtil.isEmpty(compliantOrgCodeList)) { return new ArrayList<>(); } - compliantOrgCodeList.addAll(compliantOrgNameList); } if (StringUtils.isNotBlank(orgCode)) { @@ -417,7 +431,7 @@ public class UserInfoManage { resUserDetailVO.setOrgName(userFullInfo.getOrganizationName()); resUserDetailVO.setRegionCode(userFullInfo.getRegionCode()); resUserDetailVO.setRegionName(regionCacheHelper.getRegionName(userFullInfo.getRegionCode() - ,RegionConst.RL_COUNTY)); + , RegionConst.RL_COUNTY)); resUserDetailVO.setEmpPosUnitCode(userFullInfo.getEmpPosUnitCode()); resUserDetailVO.setEmpPosUnitName(userFullInfo.getEmpPosUnitName()); }