Bladeren bron

获取 子流程名称

tags/24080901
PoffyZhang 1 jaar geleden
bovenliggende
commit
4ba1e97d61
2 gewijzigde bestanden met toevoegingen van 24 en 0 verwijderingen
  1. +21
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  2. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ResToBeProcessedVO.java

+ 21
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java Bestand weergeven

@@ -20,6 +20,9 @@ import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.assertj.core.util.Lists;
import org.flowable.bpmn.model.BpmnModel;
import org.flowable.bpmn.model.FlowElement;
import org.flowable.bpmn.model.FlowElementsContainer;
import org.flowable.bpmn.model.SubProcess;
import org.flowable.engine.HistoryService;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.RuntimeService;
@@ -203,6 +206,8 @@ public class TodoCenterManage {
.filter(v -> processSet.add(v.getNodeId()))
.collect(Collectors.toMap(ProcessTaskVo::getNodeId, v -> v));



List<ResToBeProcessedVO> resVos = userTodoList.stream().map(d -> {
Project projectInfo = projectInfoMap.get(d.getInstanceId());
ResToBeProcessedVO res = new ResToBeProcessedVO();
@@ -217,11 +222,26 @@ public class TodoCenterManage {
res.setProcessLaunchTime(d.getTaskCreateTime());
res.setProcessDefName(d.getProcessDefName());
res.setTaskId(d.getTaskId());
res.setNodeName(findSubProcessName(d));
return res;
}).collect(Collectors.toList());
return PageVo.of(resVos, list.size());
}

private String findSubProcessName(ProcessTaskVo d) {

BpmnModel bpmnModel = repositoryService.getBpmnModel(d.getProcessDefId());

if(Objects.nonNull(bpmnModel)){
FlowElement flowElement = bpmnModel.getFlowElement(d.getTaskDefKey());
FlowElementsContainer parentContainer = flowElement.getParentContainer();
if(parentContainer instanceof SubProcess){
return ((SubProcess) parentContainer).getName();
}
}
return null;
}

/**
* 待办中心列表导出
*
@@ -544,6 +564,7 @@ public class TodoCenterManage {
res.setProcessLaunchTime(d.getCreateTime());
res.setProcessHandleTime(d.getTaskEndTime());
res.setTaskId(d.getTaskId());
res.setNodeName(findSubProcessName(d));
return res;
}).collect(Collectors.toList());
return PageVo.of(resVos, iDoList.size());


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ResToBeProcessedVO.java Bestand weergeven

@@ -38,6 +38,9 @@ public class ResToBeProcessedVO implements Serializable {
@ApiModelProperty("项目名称")
private String projectName;

@ApiModelProperty("大节点名称(单位配置的名字)")
private String nodeName;

@ApiModelProperty("建设单位名称")
private String buildOrg;



Laden…
Annuleren
Opslaan