|
@@ -10,6 +10,7 @@ import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessI
|
|
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmCategoryDO;
|
|
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionExtDO;
|
|
|
import cn.iocoder.yudao.module.bpm.enums.DictDataConstants;
|
|
|
+import cn.iocoder.yudao.module.bpm.enums.OaAuditStatusEnum;
|
|
|
import cn.iocoder.yudao.module.bpm.event.BpmProcessInstanceStatusEvent;
|
|
|
import cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmConstants;
|
|
|
import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.FlowableUtils;
|
|
@@ -28,8 +29,10 @@ import org.mapstruct.Mapping;
|
|
|
import org.mapstruct.MappingTarget;
|
|
|
import org.mapstruct.factory.Mappers;
|
|
|
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 流程实例 Convert
|
|
@@ -49,6 +52,9 @@ public interface BpmProcessInstanceConvert {
|
|
|
Map<Long, DeptRespDTO> deptMap,
|
|
|
Map<String, BpmProcessDefinitionExtDO> bpmProcessDefinitionExtDOMap) {
|
|
|
PageResult<BpmProcessInstanceRespVO> vpPageResult = BeanUtils.toBean(pageResult, BpmProcessInstanceRespVO.class);
|
|
|
+ // 状态
|
|
|
+ Map<String, String> statusMap = Arrays.stream(OaAuditStatusEnum.values())
|
|
|
+ .collect(Collectors.toMap(OaAuditStatusEnum::getStatus, OaAuditStatusEnum::getStatusDesc));
|
|
|
for (int i = 0; i < pageResult.getList().size(); i++) {
|
|
|
BpmProcessInstanceRespVO respVO = vpPageResult.getList().get(i);
|
|
|
HistoricProcessInstance historicProcessInstance = pageResult.getList().get(i);
|
|
@@ -58,6 +64,7 @@ public interface BpmProcessInstanceConvert {
|
|
|
processInstanceStatus = Integer.valueOf(DictDataConstants.OA_AUDIT_STATUS_AUDITED);
|
|
|
}
|
|
|
respVO.setStatus(processInstanceStatus);
|
|
|
+ respVO.setStatusDesc(statusMap.get(String.valueOf(respVO.getStatus())));
|
|
|
|
|
|
MapUtils.findAndThen(processDefinitionMap, respVO.getProcessDefinitionId(),
|
|
|
processDefinition -> respVO.setCategory(processDefinition.getCategory()));
|