Selaa lähdekoodia

待办中心-获取流程处理详情修改

master
CMM 1 vuosi sitten
vanhempi
commit
069442977e
3 muutettua tiedostoa jossa 40 lisäystä ja 27 poistoa
  1. +2
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java
  2. +36
    -21
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  3. +2
    -3
      pmapi/src/test/java/com/ningdatech/pmapi/todocenter/TodoCenterTest.java

+ 2
- 3
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java Näytä tiedosto

@@ -64,11 +64,10 @@ public class TodoCenterController {
* @param nodeId 当前获取流程人员关联的流程节点ID
* @return 流程进度及表单详情
*/
@GetMapping("/progress/{instanceId}/{nodeId}")
@GetMapping("/progress/{instanceId}/{projectId}")
public ApiResponse<ProcessProgressDetailVo> 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));
}

/**


+ 36
- 21
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java Näytä tiedosto

@@ -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<HistoricVariableInstance> formDatas = null;
if (nodeId.equals("undefined")) {
List<HistoricTaskInstance> 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<HistoricTaskInstance> 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<HistoricTaskInstance> 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<String, Object> nodePropsValue = (Map<String, Object>) 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<String> userSet = new HashSet<>();
//userSet.add(String.valueOf(userInfo.getId()));


+ 2
- 3
pmapi/src/test/java/com/ningdatech/pmapi/todocenter/TodoCenterTest.java Näytä tiedosto

@@ -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("发送工作通知结束");
}


Loading…
Peruuta
Tallenna