From 069442977eb51c8a2ecb0aa3656cb5d1612ce75d Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Thu, 16 Feb 2023 12:41:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=85=E5=8A=9E=E4=B8=AD=E5=BF=83-=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=B5=81=E7=A8=8B=E5=A4=84=E7=90=86=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TodoCenterController.java | 5 +- .../pmapi/todocenter/manage/TodoCenterManage.java | 57 ++++++++++++++-------- .../pmapi/todocenter/TodoCenterTest.java | 5 +- 3 files changed, 40 insertions(+), 27 deletions(-) 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 913db14..81abe4f 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 @@ -64,11 +64,10 @@ public class TodoCenterController { * @param nodeId 当前获取流程人员关联的流程节点ID * @return 流程进度及表单详情 */ - @GetMapping("/progress/{instanceId}/{nodeId}") + @GetMapping("/progress/{instanceId}/{projectId}") public ApiResponse getProcessDetail(@PathVariable String instanceId, - @PathVariable(required = false) String nodeId, @PathVariable Long projectId) { - return ApiResponse.ofSuccess(todoCenterManage.getProcessDetail(nodeId, instanceId, projectId)); + return ApiResponse.ofSuccess(todoCenterManage.getProcessDetail(instanceId, projectId)); } /** 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 4688ff2..37df212 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 @@ -914,7 +914,7 @@ public class TodoCenterManage { * @param instanceId 流程实例ID * @return 流程进度及表单详情 */ - public ProcessProgressDetailVo getProcessDetail(String nodeId, String instanceId, Long projectId) { + public ProcessProgressDetailVo getProcessDetail(String instanceId, Long projectId) { HistoricProcessInstance instance = historyService.createHistoricProcessInstanceQuery() .processInstanceId(instanceId) .singleResult(); @@ -924,34 +924,49 @@ public class TodoCenterManage { .variableName(WflowGlobalVarDef.WFLOW_FORMS) .singleResult(); List formDatas = null; - if (nodeId.equals("undefined")) { - List historicTaskInstances = historyService.createHistoricTaskInstanceQuery().processInstanceId(instanceId).list(); - formDatas = historyService - .createHistoricVariableInstanceQuery() - .executionIds(historicTaskInstances.stream() - .map(HistoricTaskInstance::getExecutionId) - .collect(Collectors.toSet())) - .processInstanceId(instanceId) - .list(); - } else { - formDatas = historyService - .createHistoricVariableInstanceQuery() - .processInstanceId(instanceId) - .list(); - } + //if (nodeId.equals("undefined")) { + // List historicTaskInstances = historyService.createHistoricTaskInstanceQuery().processInstanceId(instanceId).list(); + // formDatas = historyService + // .createHistoricVariableInstanceQuery() + // .executionIds(historicTaskInstances.stream() + // .map(HistoricTaskInstance::getExecutionId) + // .collect(Collectors.toSet())) + // .processInstanceId(instanceId) + // .list(); + //} else { + // formDatas = historyService + // .createHistoricVariableInstanceQuery() + // .processInstanceId(instanceId) + // .list(); + //} + List historicTaskInstances = historyService.createHistoricTaskInstanceQuery() + .processInstanceId(instanceId).list(); + formDatas = historyService.createHistoricVariableInstanceQuery() + .executionIds(historicTaskInstances.stream() + .map(HistoricTaskInstance::getExecutionId) + .collect(Collectors.toSet())) + .processInstanceId(instanceId).list(); + // 取节点设置 HistoricVariableInstance nodeProps = historyService.createHistoricVariableInstanceQuery() .processInstanceId(instanceId).variableName(WflowGlobalVarDef.WFLOW_NODE_PROPS).singleResult(); Map nodePropsValue = (Map) nodeProps.getValue(); + ProcessNode currentNode = null; - if (StrUtil.isNotBlank(nodeId)) { - // 搜索当前版本流程的配置 - WflowModelHistorys modelHistory = modelHistorysMapper.selectOne(new QueryWrapper<>(WflowModelHistorys.builder() + //if (StrUtil.isNotBlank(nodeId)) { + // // 搜索当前版本流程的配置 + // WflowModelHistorys modelHistory = modelHistorysMapper.selectOne(new QueryWrapper<>(WflowModelHistorys.builder() + // .processDefId(instance.getProcessDefinitionId()) + // .version(instance.getProcessDefinitionVersion()) + // .build())); + // currentNode = nodeCatchService.reloadProcessByStr(modelHistory.getProcess()).get(nodeId); + //} + // 搜索当前版本流程的配置 + WflowModelHistorys modelHistory = modelHistorysMapper.selectOne(new QueryWrapper<>(WflowModelHistorys.builder() .processDefId(instance.getProcessDefinitionId()) .version(instance.getProcessDefinitionVersion()) .build())); - currentNode = nodeCatchService.reloadProcessByStr(modelHistory.getProcess()).get(nodeId); - } + currentNode = nodeCatchService.reloadProcessByStr(modelHistory.getProcess()).get("undefined"); //UserInfo userInfo = userInfoService.getById(Long.valueOf(instance.getStartUserId())); //HashSet userSet = new HashSet<>(); //userSet.add(String.valueOf(userInfo.getId())); diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/todocenter/TodoCenterTest.java b/pmapi/src/test/java/com/ningdatech/pmapi/todocenter/TodoCenterTest.java index 9803d2e..4ecc55e 100644 --- a/pmapi/src/test/java/com/ningdatech/pmapi/todocenter/TodoCenterTest.java +++ b/pmapi/src/test/java/com/ningdatech/pmapi/todocenter/TodoCenterTest.java @@ -27,10 +27,9 @@ public class TodoCenterTest extends AppTests { private ZwddClient zwddClient; @Test public void sendWorkNoticeTest(){ - // String msg = String.format(PASS_MSG_TEMPLATE, "发改委", "0216-4-测试项目"); - String msg = "发改委的0216-6-测试项目需要您审核"; + String msg = String.format(PASS_MSG_TEMPLATE, "发改委", "0216-7-测试项目"); log.info("开始发送工作通知"); - zwddClient.sendWorkNotice("846085","0216-7",msg); + zwddClient.sendWorkNotice("846085","0216-8",msg); // zwddClient.sendWorkNotice("829728","0216-5",msg); log.info("发送工作通知结束"); }