|
|
@@ -21,6 +21,8 @@ import org.flowable.engine.HistoryService; |
|
|
|
import org.flowable.engine.RuntimeService; |
|
|
|
import org.flowable.engine.TaskService; |
|
|
|
import org.flowable.engine.history.HistoricProcessInstance; |
|
|
|
import org.flowable.engine.runtime.ActivityInstance; |
|
|
|
import org.flowable.engine.runtime.ActivityInstanceQuery; |
|
|
|
import org.flowable.engine.task.Comment; |
|
|
|
import org.flowable.variable.api.history.HistoricVariableInstance; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
@@ -202,8 +204,8 @@ public class TodoCenterManage { |
|
|
|
Map<String, ProcessTaskVo> taskMap = userTodoList.stream() |
|
|
|
.sorted((t1,t2) -> t2.getTaskCreateTime().compareTo(t1.getTaskCreateTime())) |
|
|
|
.collect(Collectors.toList()).stream() |
|
|
|
.filter(v -> processSet.add(v.getInstanceId())) |
|
|
|
.collect(Collectors.toMap(ProcessTaskVo::getInstanceId, v -> v)); |
|
|
|
.filter(v -> processSet.add(v.getNodeId())) |
|
|
|
.collect(Collectors.toMap(ProcessTaskVo::getNodeId, v -> v)); |
|
|
|
|
|
|
|
List<ResToBeProcessedVO> resVos = userTodoList.stream().map(d -> { |
|
|
|
Project projectInfo = projectInfoMap.get(d.getInstanceId()); |
|
|
@@ -213,11 +215,12 @@ public class TodoCenterManage { |
|
|
|
res.setProjectId(projectInfo.getId()); |
|
|
|
res.setBuildOrg(projectInfo.getBuildOrgName()); |
|
|
|
res.setDeclaredAmount(projectInfo.getDeclareAmount()); |
|
|
|
ProcessTaskVo taskVo = taskMap.get(d.getInstanceId()); |
|
|
|
res.setNodeId(taskVo.getTaskDefKey()); |
|
|
|
ProcessTaskVo taskVo = taskMap.get(d.getNodeId()); |
|
|
|
res.setNodeId(d.getNodeId()); |
|
|
|
res.setProcessStatusName(taskVo.getStatus()); |
|
|
|
res.setProcessLaunchTime(d.getTaskCreateTime()); |
|
|
|
res.setProcessDefName(d.getProcessDefName()); |
|
|
|
res.setTaskId(d.getTaskId()); |
|
|
|
return res; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
return PageVo.of(resVos, list.size()); |
|
|
@@ -305,7 +308,7 @@ public class TodoCenterManage { |
|
|
|
* @author CMM |
|
|
|
* @since 2023/02/01 |
|
|
|
*/ |
|
|
|
public void handler(ReqProcessHandlerDTO param) { |
|
|
|
public String handler(ReqProcessHandlerDTO param) { |
|
|
|
// 获取登录用户ID |
|
|
|
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); |
|
|
|
// 获取登录用户浙政钉code |
|
|
@@ -340,7 +343,8 @@ public class TodoCenterManage { |
|
|
|
processTaskService.handleTask(param, employeeCode); |
|
|
|
//通过审核后 所处理的逻辑 |
|
|
|
handlerManage.afterPassTodo(declaredProject,instance); |
|
|
|
break; |
|
|
|
|
|
|
|
return findNextTaskId(instance); |
|
|
|
// 驳回 |
|
|
|
case REJECT: |
|
|
|
// 驳回该任务,中止流程并使项目进入对应状态,给项目创建人、流程发起人发送浙政钉工作通知: |
|
|
@@ -380,6 +384,26 @@ public class TodoCenterManage { |
|
|
|
default: |
|
|
|
throw new IllegalStateException("Unexpected value: " + param.getAction()); |
|
|
|
} |
|
|
|
return "操作成功"; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 寻找下一个审核task |
|
|
|
* @param instance |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private String findNextTaskId(HistoricProcessInstance instance) { |
|
|
|
List<ActivityInstance> userTasks = runtimeService.createActivityInstanceQuery() |
|
|
|
.activityType("userTask") |
|
|
|
.processInstanceId(instance.getId()) |
|
|
|
.orderByActivityInstanceStartTime() |
|
|
|
.desc() |
|
|
|
.unfinished() |
|
|
|
.list(); |
|
|
|
if(CollUtil.isEmpty(userTasks)){ |
|
|
|
return "处理成功"; |
|
|
|
} |
|
|
|
return userTasks.get(0).getTaskId(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|