fix -- 修复"我的流程"显示分类错误bug

This commit is contained in:
konbai
2022-03-12 00:01:21 +08:00
parent ae24174746
commit 77850488e4
5 changed files with 36 additions and 23 deletions

View File

@@ -49,7 +49,7 @@ public class WfDefinitionVo {
*/
@ExcelProperty(value = "分类编码")
@ApiModelProperty("分类编码")
private String categoryCode;
private String category;
@ApiModelProperty("版本")
private Integer version;

View File

@@ -86,7 +86,7 @@ public class WfDefinitionServiceImpl extends FlowServiceFactory implements IWfDe
vo.setProcessKey(processDefinition.getKey());
vo.setProcessName(processDefinition.getName());
vo.setVersion(processDefinition.getVersion());
vo.setCategoryCode(processDefinition.getCategory());
vo.setCategory(processDefinition.getCategory());
vo.setDeploymentId(processDefinition.getDeploymentId());
vo.setSuspended(processDefinition.isSuspended());
WfFormVo formVo = formMapper.selectFormByDeployId(deploymentId);
@@ -95,7 +95,7 @@ public class WfDefinitionServiceImpl extends FlowServiceFactory implements IWfDe
vo.setFormName(formVo.getFormName());
}
// 流程定义时间
vo.setCategoryCode(deployment.getCategory());
vo.setCategory(deployment.getCategory());
vo.setDeploymentTime(deployment.getDeploymentTime());
definitionVoList.add(vo);
}
@@ -125,7 +125,7 @@ public class WfDefinitionServiceImpl extends FlowServiceFactory implements IWfDe
vo.setProcessKey(item.getKey());
vo.setProcessName(item.getName());
vo.setVersion(item.getVersion());
vo.setCategoryCode(item.getCategory());
vo.setCategory(item.getCategory());
vo.setDeploymentId(item.getDeploymentId());
vo.setSuspended(item.isSuspended());
// BeanUtil.copyProperties(item, vo);

View File

@@ -424,29 +424,29 @@ public class WfTaskServiceImpl extends FlowServiceFactory implements IWfTaskServ
List<HistoricProcessInstance> historicProcessInstances = historicProcessInstanceQuery
.listPage(offset, pageQuery.getPageSize());
page.setTotal(historicProcessInstanceQuery.count());
List<WfTaskVo> flowList = new ArrayList<>();
List<WfTaskVo> taskVoList = new ArrayList<>();
for (HistoricProcessInstance hisIns : historicProcessInstances) {
WfTaskVo flowTask = new WfTaskVo();
flowTask.setCreateTime(hisIns.getStartTime());
flowTask.setFinishTime(hisIns.getEndTime());
flowTask.setProcInsId(hisIns.getId());
WfTaskVo taskVo = new WfTaskVo();
taskVo.setCreateTime(hisIns.getStartTime());
taskVo.setFinishTime(hisIns.getEndTime());
taskVo.setProcInsId(hisIns.getId());
// 计算耗时
if (Objects.nonNull(hisIns.getEndTime())) {
long time = hisIns.getEndTime().getTime() - hisIns.getStartTime().getTime();
flowTask.setDuration(getDate(time));
taskVo.setDuration(getDate(time));
} else {
long time = System.currentTimeMillis() - hisIns.getStartTime().getTime();
flowTask.setDuration(getDate(time));
taskVo.setDuration(getDate(time));
}
// 流程部署实例信息
Deployment deployment = repositoryService.createDeploymentQuery()
.deploymentId(hisIns.getDeploymentId()).singleResult();
flowTask.setDeployId(hisIns.getDeploymentId());
flowTask.setProcDefId(hisIns.getProcessDefinitionId());
flowTask.setProcDefName(hisIns.getProcessDefinitionName());
flowTask.setProcDefVersion(hisIns.getProcessDefinitionVersion());
flowTask.setCategory(deployment.getCategory());
taskVo.setDeployId(hisIns.getDeploymentId());
taskVo.setProcDefId(hisIns.getProcessDefinitionId());
taskVo.setProcDefName(hisIns.getProcessDefinitionName());
taskVo.setProcDefVersion(hisIns.getProcessDefinitionVersion());
taskVo.setCategory(deployment.getCategory());
// 当前所处流程 todo: 本地启动放开以下注释
// List<Task> taskList = taskService.createTaskQuery().processInstanceId(hisIns.getId()).list();
// if (CollectionUtils.isNotEmpty(taskList)) {
@@ -455,9 +455,9 @@ public class WfTaskServiceImpl extends FlowServiceFactory implements IWfTaskServ
// List<HistoricTaskInstance> historicTaskInstance = historyService.createHistoricTaskInstanceQuery().processInstanceId(hisIns.getId()).orderByHistoricTaskInstanceEndTime().desc().list();
// flowTask.setTaskId(historicTaskInstance.get(0).getId());
// }
flowList.add(flowTask);
taskVoList.add(taskVo);
}
page.setRecords(flowList);
page.setRecords(taskVoList);
return TableDataInfo.build(page);
}