|
|
@ -26,6 +26,8 @@ import com.ruoyi.flowable.flow.FindNextNodeUtil;
|
|
|
|
import com.ruoyi.flowable.flow.FlowableUtils;
|
|
|
|
import com.ruoyi.flowable.flow.FlowableUtils;
|
|
|
|
import com.ruoyi.flowable.service.IFlowTaskService;
|
|
|
|
import com.ruoyi.flowable.service.IFlowTaskService;
|
|
|
|
import com.ruoyi.flowable.service.ISysDeployFormService;
|
|
|
|
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.ISysRoleService;
|
|
|
|
import com.ruoyi.system.service.ISysUserService;
|
|
|
|
import com.ruoyi.system.service.ISysUserService;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@ -83,6 +85,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private ISysDeployFormService sysInstanceFormService;
|
|
|
|
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) {
|
|
|
|
public Page<FlowTaskDto> buildFlowTask(Integer pageNum, Integer pageSize, HistoricProcessInstanceQuery historicProcessInstanceQuery) {
|
|
|
|
|
|
|
|
|
|
|
|
Page<FlowTaskDto> page = new Page<>();
|
|
|
|
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());
|
|
|
|
page.setTotal(historicProcessInstanceQuery.count());
|
|
|
|
List<FlowTaskDto> flowList = new ArrayList<>();
|
|
|
|
List<FlowTaskDto> flowList = new ArrayList<>();
|
|
|
|
for (HistoricProcessInstance hisIns : historicProcessInstances) {
|
|
|
|
for (HistoricProcessInstance hisIns : historicProcessInstances) {
|
|
|
@ -475,12 +479,20 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
flowTask.setCategory(pd.getCategory());
|
|
|
|
flowTask.setCategory(pd.getCategory());
|
|
|
|
flowTask.setProcDefVersion(pd.getVersion());
|
|
|
|
flowTask.setProcDefVersion(pd.getVersion());
|
|
|
|
flowTask.setStatus(hisIns.getBusinessStatus());
|
|
|
|
flowTask.setStatus(hisIns.getBusinessStatus());
|
|
|
|
if (MapUtils.isNotEmpty(hisIns.getProcessVariables())
|
|
|
|
if (MapUtils.isNotEmpty(hisIns.getProcessVariables())) {
|
|
|
|
&& hisIns.getProcessVariables().containsKey("submitDate")
|
|
|
|
if (hisIns.getProcessVariables().containsKey("submitDate") && StringUtils.isNotBlank(MapUtils.getString(hisIns.getProcessVariables(), "submitDate"))) {
|
|
|
|
&& StringUtils.isNotBlank(MapUtils.getString(hisIns.getProcessVariables(), "submitDate"))) {
|
|
|
|
|
|
|
|
String submitDate = MapUtils.getString(hisIns.getProcessVariables(), "submitDate");
|
|
|
|
String submitDate = MapUtils.getString(hisIns.getProcessVariables(), "submitDate");
|
|
|
|
flowTask.setCreateTime(DateUtil.parse(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: 本地启动放开以下注释
|
|
|
|
// 当前所处流程 todo: 本地启动放开以下注释
|
|
|
|
// List<Task> taskList = taskService.createTaskQuery().processInstanceId(hisIns.getId()).list();
|
|
|
|
// List<Task> taskList = taskService.createTaskQuery().processInstanceId(hisIns.getId()).list();
|
|
|
|
// if (CollectionUtils.isNotEmpty(taskList)) {
|
|
|
|
// if (CollectionUtils.isNotEmpty(taskList)) {
|
|
|
|