fix(projectName)

approve-sys
bob 2 years ago
parent fcca534f2b
commit d02056c0e2

@ -102,4 +102,9 @@ public class FlowTaskDto implements Serializable {
@ApiModelProperty("任务状态")
private String status;
@ApiModelProperty("工作问题")
private String workIssue;
@ApiModelProperty("项目名称")
private String projectName;
}

@ -26,6 +26,8 @@ import com.ruoyi.flowable.flow.FindNextNodeUtil;
import com.ruoyi.flowable.flow.FlowableUtils;
import com.ruoyi.flowable.service.IFlowTaskService;
import com.ruoyi.flowable.service.ISysDeployFormService;
import com.ruoyi.system.domain.SysProject;
import com.ruoyi.system.service.ISysProjectService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService;
import lombok.extern.slf4j.Slf4j;
@ -83,6 +85,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
@Resource
private ISysDeployFormService sysInstanceFormService;
@Resource
private ISysProjectService sysProjectService;
/**
*
@ -448,7 +452,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
public Page<FlowTaskDto> buildFlowTask(Integer pageNum, Integer pageSize, HistoricProcessInstanceQuery historicProcessInstanceQuery) {
Page<FlowTaskDto> page = new Page<>();
List<HistoricProcessInstance> historicProcessInstances = historicProcessInstanceQuery.listPage(pageSize * (pageNum - 1), pageSize);
List<HistoricProcessInstance> historicProcessInstances = historicProcessInstanceQuery.includeProcessVariables().listPage(pageSize * (pageNum - 1), pageSize);
page.setTotal(historicProcessInstanceQuery.count());
List<FlowTaskDto> flowList = new ArrayList<>();
for (HistoricProcessInstance hisIns : historicProcessInstances) {
@ -475,11 +479,19 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
flowTask.setCategory(pd.getCategory());
flowTask.setProcDefVersion(pd.getVersion());
flowTask.setStatus(hisIns.getBusinessStatus());
if (MapUtils.isNotEmpty(hisIns.getProcessVariables())
&& hisIns.getProcessVariables().containsKey("submitDate")
&& StringUtils.isNotBlank(MapUtils.getString(hisIns.getProcessVariables(), "submitDate"))) {
String submitDate = MapUtils.getString(hisIns.getProcessVariables(), "submitDate");
flowTask.setCreateTime(DateUtil.parse(submitDate));
if (MapUtils.isNotEmpty(hisIns.getProcessVariables())) {
if (hisIns.getProcessVariables().containsKey("submitDate") && StringUtils.isNotBlank(MapUtils.getString(hisIns.getProcessVariables(), "submitDate"))) {
String submitDate = MapUtils.getString(hisIns.getProcessVariables(), "submitDate");
flowTask.setCreateTime(DateUtil.parse(submitDate));
}
if (hisIns.getProcessVariables().containsKey("issue") && StringUtils.isNotBlank(MapUtils.getString(hisIns.getProcessVariables(), "issue"))) {
flowTask.setWorkIssue(MapUtils.getString(hisIns.getProcessVariables(), "issue"));
}
if (hisIns.getProcessVariables().containsKey("projectId") && Objects.nonNull(MapUtils.getLong(hisIns.getProcessVariables(), "projectId"))) {
Long projectId = MapUtils.getLong(hisIns.getProcessVariables(), "projectId");
SysProject project = sysProjectService.selectSysProjectById(projectId);
flowTask.setProjectName(Objects.nonNull(project) ? project.getName() : "");
}
}
// 当前所处流程 todo: 本地启动放开以下注释
// List<Task> taskList = taskService.createTaskQuery().processInstanceId(hisIns.getId()).list();

@ -61,8 +61,8 @@
<el-table v-loading="loading" :data="myProcessList" border @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="流程编号" align="center" prop="procInsId" :show-overflow-tooltip="true"/>
<el-table-column label="流程名称" align="center" prop="procDefName" :show-overflow-tooltip="true"/>
<el-table-column label="项目名称" align="center" prop="projectName" :show-overflow-tooltip="true"/>
<el-table-column label="工作问题" align="center" prop="workIssue" :show-overflow-tooltip="true"/>
<el-table-column label="流程类别" align="center" prop="category" width="100px" />
<el-table-column label="流程版本" align="center" width="80px">
<template slot-scope="scope">

Loading…
Cancel
Save