|
|
|
@ -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();
|
|
|
|
|