|
@@ -1,20 +1,13 @@ |
|
|
package com.ningdatech.pmapi.todocenter.manage; |
|
|
package com.ningdatech.pmapi.todocenter.manage; |
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
import cn.hutool.core.util.StrUtil; |
|
|
import cn.hutool.core.util.StrUtil; |
|
|
import cn.hutool.json.JSONUtil; |
|
|
import cn.hutool.json.JSONUtil; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.xxpt.gateway.shared.api.request.OapiMessageWorkNotificationRequest; |
|
|
|
|
|
import com.alibaba.xxpt.gateway.shared.api.response.OapiMessageWorkNotificationResponse; |
|
|
|
|
|
import com.alibaba.xxpt.gateway.shared.client.http.ExecutableClient; |
|
|
|
|
|
import com.alibaba.xxpt.gateway.shared.client.http.IntelligentGetClient; |
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
|
import com.ningdatech.basic.enumeration.Status; |
|
|
import com.ningdatech.basic.enumeration.Status; |
|
|
import com.ningdatech.basic.exception.BizException; |
|
|
import com.ningdatech.basic.exception.BizException; |
|
|
import com.ningdatech.basic.model.PageVo; |
|
|
import com.ningdatech.basic.model.PageVo; |
|
@@ -66,18 +59,18 @@ import com.wflow.workflow.bean.vo.ProcessTaskVo; |
|
|
import com.wflow.workflow.config.WflowGlobalVarDef; |
|
|
import com.wflow.workflow.config.WflowGlobalVarDef; |
|
|
import com.wflow.workflow.enums.ProcessHandlerEnum; |
|
|
import com.wflow.workflow.enums.ProcessHandlerEnum; |
|
|
import com.wflow.workflow.service.FormService; |
|
|
import com.wflow.workflow.service.FormService; |
|
|
import com.wflow.workflow.service.*; |
|
|
|
|
|
|
|
|
import com.wflow.workflow.service.ProcessModelService; |
|
|
|
|
|
import com.wflow.workflow.service.ProcessNodeCatchService; |
|
|
|
|
|
import com.wflow.workflow.service.UserDeptOrLeaderService; |
|
|
import com.wflow.workflow.utils.Executor; |
|
|
import com.wflow.workflow.utils.Executor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.assertj.core.util.Maps; |
|
|
import org.assertj.core.util.Maps; |
|
|
import org.flowable.bpmn.model.Process; |
|
|
|
|
|
import org.flowable.bpmn.model.*; |
|
|
import org.flowable.bpmn.model.*; |
|
|
import org.flowable.engine.*; |
|
|
import org.flowable.engine.*; |
|
|
import org.flowable.engine.history.HistoricActivityInstance; |
|
|
import org.flowable.engine.history.HistoricActivityInstance; |
|
|
import org.flowable.engine.history.HistoricProcessInstance; |
|
|
import org.flowable.engine.history.HistoricProcessInstance; |
|
|
import org.flowable.engine.history.HistoricProcessInstanceQuery; |
|
|
import org.flowable.engine.history.HistoricProcessInstanceQuery; |
|
|
import org.flowable.engine.impl.util.ProcessDefinitionUtil; |
|
|
|
|
|
import org.flowable.engine.runtime.ActivityInstance; |
|
|
import org.flowable.engine.runtime.ActivityInstance; |
|
|
import org.flowable.engine.runtime.Execution; |
|
|
import org.flowable.engine.runtime.Execution; |
|
|
import org.flowable.engine.task.Comment; |
|
|
import org.flowable.engine.task.Comment; |
|
@@ -87,7 +80,6 @@ import org.flowable.task.api.TaskQuery; |
|
|
import org.flowable.task.api.history.HistoricTaskInstance; |
|
|
import org.flowable.task.api.history.HistoricTaskInstance; |
|
|
import org.flowable.task.service.history.NativeHistoricTaskInstanceQuery; |
|
|
import org.flowable.task.service.history.NativeHistoricTaskInstanceQuery; |
|
|
import org.flowable.variable.api.history.HistoricVariableInstance; |
|
|
import org.flowable.variable.api.history.HistoricVariableInstance; |
|
|
import org.flowable.variable.api.history.HistoricVariableInstanceQuery; |
|
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
import org.springframework.beans.BeanUtils; |
|
|
import org.springframework.stereotype.Component; |
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
@@ -126,8 +118,8 @@ public class TodoCenterManage { |
|
|
private final IUserInfoService userInfoService; |
|
|
private final IUserInfoService userInfoService; |
|
|
private final IProjectService projectService; |
|
|
private final IProjectService projectService; |
|
|
private final StateMachineUtils stateMachineUtils; |
|
|
private final StateMachineUtils stateMachineUtils; |
|
|
@Resource(name = "executableClient") |
|
|
|
|
|
private ExecutableClient client; |
|
|
|
|
|
|
|
|
// @Resource(name = "executableClient") |
|
|
|
|
|
// private ExecutableClient client; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 待办中心待我处理项目列表查询 |
|
|
* 待办中心待我处理项目列表查询 |
|
@@ -142,7 +134,7 @@ public class TodoCenterManage { |
|
|
// long userId = LoginUserUtil.getUserId(); |
|
|
// long userId = LoginUserUtil.getUserId(); |
|
|
|
|
|
|
|
|
// Long userId = 381496L; |
|
|
// Long userId = 381496L; |
|
|
Long userId = 6418616L; |
|
|
|
|
|
|
|
|
Long userId = 6418616L; |
|
|
// Long userId = 61769799L; |
|
|
// Long userId = 61769799L; |
|
|
TaskQuery taskQuery = taskService.createTaskQuery(); |
|
|
TaskQuery taskQuery = taskService.createTaskQuery(); |
|
|
taskQuery.active().taskCandidateOrAssigned(String.valueOf(userId)).orderByTaskCreateTime().desc(); |
|
|
taskQuery.active().taskCandidateOrAssigned(String.valueOf(userId)).orderByTaskCreateTime().desc(); |
|
@@ -207,7 +199,7 @@ public class TodoCenterManage { |
|
|
// result = resVos.stream().peek(v -> v.setOwner(userMap.get(userId))) |
|
|
// result = resVos.stream().peek(v -> v.setOwner(userMap.get(userId))) |
|
|
// .collect(Collectors.toList()); |
|
|
// .collect(Collectors.toList()); |
|
|
} |
|
|
} |
|
|
if (isEmpty(resVos)){ |
|
|
|
|
|
|
|
|
if (isEmpty(resVos)) { |
|
|
return PageVo.empty(); |
|
|
return PageVo.empty(); |
|
|
} |
|
|
} |
|
|
return PageVo.of(resVos, total); |
|
|
return PageVo.of(resVos, total); |
|
@@ -234,7 +226,7 @@ public class TodoCenterManage { |
|
|
taskQuery.active().taskCandidateOrAssigned(String.valueOf(userId)).orderByTaskCreateTime().desc(); |
|
|
taskQuery.active().taskCandidateOrAssigned(String.valueOf(userId)).orderByTaskCreateTime().desc(); |
|
|
List<Task> taskList = taskQuery.list(); |
|
|
List<Task> taskList = taskQuery.list(); |
|
|
ReqToBeProcessedDTO reqToBeProcessedDTO = new ReqToBeProcessedDTO(); |
|
|
ReqToBeProcessedDTO reqToBeProcessedDTO = new ReqToBeProcessedDTO(); |
|
|
BeanUtils.copyProperties(param,reqToBeProcessedDTO); |
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(param, reqToBeProcessedDTO); |
|
|
List<Project> records = getToBeProcessedProjects(reqToBeProcessedDTO, taskList); |
|
|
List<Project> records = getToBeProcessedProjects(reqToBeProcessedDTO, taskList); |
|
|
ExcelExportWriter excelExportWriter = new ExcelExportWriter(); |
|
|
ExcelExportWriter excelExportWriter = new ExcelExportWriter(); |
|
|
|
|
|
|
|
@@ -322,7 +314,7 @@ public class TodoCenterManage { |
|
|
Long userId = 61769799L; |
|
|
Long userId = 61769799L; |
|
|
|
|
|
|
|
|
// 若进行的是撤回操作(流程发起人和当前流程审核人的前一个审核人操作) |
|
|
// 若进行的是撤回操作(流程发起人和当前流程审核人的前一个审核人操作) |
|
|
if (param.getAction().equals(ProcessHandlerEnum.WITHDRAW)){ |
|
|
|
|
|
|
|
|
if (param.getAction().equals(ProcessHandlerEnum.WITHDRAW)) { |
|
|
HistoricTaskInstance handledTaskInstance = historyService.createHistoricTaskInstanceQuery().taskId(param.getTaskId()).singleResult(); |
|
|
HistoricTaskInstance handledTaskInstance = historyService.createHistoricTaskInstanceQuery().taskId(param.getTaskId()).singleResult(); |
|
|
doWithDrawProcess(handledTaskInstance, userId); |
|
|
doWithDrawProcess(handledTaskInstance, userId); |
|
|
return; |
|
|
return; |
|
@@ -392,12 +384,13 @@ public class TodoCenterManage { |
|
|
// sendWorkNoticeToStartUser(task, projectName, rootNode); |
|
|
// sendWorkNoticeToStartUser(task, projectName, rootNode); |
|
|
|
|
|
|
|
|
// 更新项目状态和流程状态 |
|
|
// 更新项目状态和流程状态 |
|
|
updateRejectProjectStatus(userId,declaredProject); |
|
|
|
|
|
|
|
|
updateRejectProjectStatus(userId, declaredProject); |
|
|
taskService.complete(param.getTaskId(), var); |
|
|
taskService.complete(param.getTaskId(), var); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 当为驳回操作时,更新项目表中的项目状态 |
|
|
* 当为驳回操作时,更新项目表中的项目状态 |
|
|
|
|
|
* |
|
|
* @param userId |
|
|
* @param userId |
|
|
* @param declaredProject |
|
|
* @param declaredProject |
|
|
* @return void |
|
|
* @return void |
|
@@ -486,7 +479,7 @@ public class TodoCenterManage { |
|
|
String.valueOf(userId), JSONObject.toJSONString(param.getAuditInfo()))); |
|
|
String.valueOf(userId), JSONObject.toJSONString(param.getAuditInfo()))); |
|
|
} |
|
|
} |
|
|
// 如果流程状态是被退回状态,流程通过后,当前审核人一定不是最后一个审核人(至多是最后一个),更新流程状态为审核中 |
|
|
// 如果流程状态是被退回状态,流程通过后,当前审核人一定不是最后一个审核人(至多是最后一个),更新流程状态为审核中 |
|
|
if (ProcessStatusEnum.BE_BACKED.getCode().equals(declaredProject.getProcessStatus())){ |
|
|
|
|
|
|
|
|
if (ProcessStatusEnum.BE_BACKED.getCode().equals(declaredProject.getProcessStatus())) { |
|
|
// 通过该任务,流程到下一审核人处 |
|
|
// 通过该任务,流程到下一审核人处 |
|
|
taskService.complete(param.getTaskId(), var); |
|
|
taskService.complete(param.getTaskId(), var); |
|
|
// 更新流程状态为审核中 |
|
|
// 更新流程状态为审核中 |
|
@@ -526,13 +519,13 @@ public class TodoCenterManage { |
|
|
switch (Objects.requireNonNull(ProjectStatusEnum.getValue(status))) { |
|
|
switch (Objects.requireNonNull(ProjectStatusEnum.getValue(status))) { |
|
|
// 当前项目状态是单位内部审核中 |
|
|
// 当前项目状态是单位内部审核中 |
|
|
case UNDER_INTERNAL_AUDIT: |
|
|
case UNDER_INTERNAL_AUDIT: |
|
|
// 当前项目状态是预审中 |
|
|
|
|
|
|
|
|
// 当前项目状态是预审中 |
|
|
case PRE_APPLYING: |
|
|
case PRE_APPLYING: |
|
|
// 当前项目状态是部门联审中 |
|
|
|
|
|
|
|
|
// 当前项目状态是部门联审中 |
|
|
case DEPARTMENT_JOINT_REVIEW: |
|
|
case DEPARTMENT_JOINT_REVIEW: |
|
|
// 当前项目状态是方案评审中 |
|
|
|
|
|
|
|
|
// 当前项目状态是方案评审中 |
|
|
case SCHEME_UNDER_REVIEW: |
|
|
case SCHEME_UNDER_REVIEW: |
|
|
// 当前项目状态是终验审核中 |
|
|
|
|
|
|
|
|
// 当前项目状态是终验审核中 |
|
|
case FINAL_ACCEPTANCE_IS_UNDER_REVIEW: |
|
|
case FINAL_ACCEPTANCE_IS_UNDER_REVIEW: |
|
|
updatePassProjectStatus(userId, declaredProject); |
|
|
updatePassProjectStatus(userId, declaredProject); |
|
|
break; |
|
|
break; |
|
@@ -557,6 +550,7 @@ public class TodoCenterManage { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 当为通过操作时,更新项目表中项目状态 |
|
|
* 当为通过操作时,更新项目表中项目状态 |
|
|
|
|
|
* |
|
|
* @param userId |
|
|
* @param userId |
|
|
* @param declaredProject |
|
|
* @param declaredProject |
|
|
* @return void |
|
|
* @return void |
|
@@ -605,7 +599,7 @@ public class TodoCenterManage { |
|
|
/** |
|
|
/** |
|
|
* 获取流程发起节点的用户ID |
|
|
* 获取流程发起节点的用户ID |
|
|
* |
|
|
* |
|
|
* @param rootNode 根节点 |
|
|
|
|
|
|
|
|
* @param rootNode 根节点 |
|
|
* @param processInstanceId |
|
|
* @param processInstanceId |
|
|
* @return java.lang.String |
|
|
* @return java.lang.String |
|
|
* @author CMM |
|
|
* @author CMM |
|
@@ -637,7 +631,7 @@ public class TodoCenterManage { |
|
|
/** |
|
|
/** |
|
|
* 获取当前节点的下一个节点的审核用户ID |
|
|
* 获取当前节点的下一个节点的审核用户ID |
|
|
* |
|
|
* |
|
|
* @param currentNode 当前节点 |
|
|
|
|
|
|
|
|
* @param currentNode 当前节点 |
|
|
* @param processInstanceId |
|
|
* @param processInstanceId |
|
|
* @return java.lang.String 下一个节点的审核用户ID |
|
|
* @return java.lang.String 下一个节点的审核用户ID |
|
|
* @author CMM |
|
|
* @author CMM |
|
@@ -693,38 +687,38 @@ public class TodoCenterManage { |
|
|
*/ |
|
|
*/ |
|
|
private void sendWorkNotice(UserInfo auditUserInfo, String msg) { |
|
|
private void sendWorkNotice(UserInfo auditUserInfo, String msg) { |
|
|
// TODO 获取浙政钉唯一标识 |
|
|
// TODO 获取浙政钉唯一标识 |
|
|
String dingKey = null; |
|
|
|
|
|
IntelligentGetClient intelligentGetClient = client.newIntelligentGetClient(DingConstant.WORKING_NOTICE); |
|
|
|
|
|
OapiMessageWorkNotificationRequest request = new OapiMessageWorkNotificationRequest(); |
|
|
|
|
|
// 消息体(参考下文示例消息格式) |
|
|
|
|
|
MessageText messageText = new MessageText(); |
|
|
|
|
|
messageText.setMsgType("text"); |
|
|
|
|
|
MessageContent messageContent = new MessageContent(); |
|
|
|
|
|
|
|
|
|
|
|
messageContent.setContent(msg); |
|
|
|
|
|
messageText.setText(messageContent); |
|
|
|
|
|
request.setMsg(JSONUtil.toJsonStr(messageText)); |
|
|
|
|
|
// 构建唯一的消息ID |
|
|
|
|
|
// String bizMsgId = "ZB_URGE_NOTICE_" + "_" + auditUserInfo.getDeptId() + "_" + auditUserInfo.getUserId(); |
|
|
|
|
|
// request.setBizMsgId(bizMsgId); |
|
|
|
|
|
request.setBizMsgId(null); |
|
|
|
|
|
// 租户id |
|
|
|
|
|
// request.setTenantId(GovDingProperties.tenantId.toString()); |
|
|
|
|
|
request.setReceiverIds(dingKey); |
|
|
|
|
|
// 获取结果 |
|
|
|
|
|
OapiMessageWorkNotificationResponse apiResult = intelligentGetClient.get(request); |
|
|
|
|
|
if (!apiResult.getSuccess() || !JSONUtil.parseObj(apiResult.getContent()).getBool("success")) { |
|
|
|
|
|
log.warn("发送工作通知失败: {}", apiResult.getContent()); |
|
|
|
|
|
throw new BizException(Status.BAD_REQUEST.toString()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// String dingKey = null; |
|
|
|
|
|
// IntelligentGetClient intelligentGetClient = client.newIntelligentGetClient(DingConstant.WORKING_NOTICE); |
|
|
|
|
|
// OapiMessageWorkNotificationRequest request = new OapiMessageWorkNotificationRequest(); |
|
|
|
|
|
// // 消息体(参考下文示例消息格式) |
|
|
|
|
|
// MessageText messageText = new MessageText(); |
|
|
|
|
|
// messageText.setMsgType("text"); |
|
|
|
|
|
// MessageContent messageContent = new MessageContent(); |
|
|
|
|
|
// |
|
|
|
|
|
// messageContent.setContent(msg); |
|
|
|
|
|
// messageText.setText(messageContent); |
|
|
|
|
|
// request.setMsg(JSONUtil.toJsonStr(messageText)); |
|
|
|
|
|
// // 构建唯一的消息ID |
|
|
|
|
|
// // String bizMsgId = "ZB_URGE_NOTICE_" + "_" + auditUserInfo.getDeptId() + "_" + auditUserInfo.getUserId(); |
|
|
|
|
|
// // request.setBizMsgId(bizMsgId); |
|
|
|
|
|
// request.setBizMsgId(null); |
|
|
|
|
|
// // 租户id |
|
|
|
|
|
// // request.setTenantId(GovDingProperties.tenantId.toString()); |
|
|
|
|
|
// request.setReceiverIds(dingKey); |
|
|
|
|
|
// // 获取结果 |
|
|
|
|
|
// OapiMessageWorkNotificationResponse apiResult = intelligentGetClient.get(request); |
|
|
|
|
|
// if (!apiResult.getSuccess() || !JSONUtil.parseObj(apiResult.getContent()).getBool("success")) { |
|
|
|
|
|
// log.warn("发送工作通知失败: {}", apiResult.getContent()); |
|
|
|
|
|
// throw new BizException(Status.BAD_REQUEST.toString()); |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 撤销流程处理 |
|
|
* 撤销流程处理 |
|
|
* |
|
|
* |
|
|
* @param handledTaskInstance 已处理的历史任务实例 |
|
|
|
|
|
* @param userId 当前登录用户ID |
|
|
|
|
|
|
|
|
* @param handledTaskInstance 已处理的历史任务实例 |
|
|
|
|
|
* @param userId 当前登录用户ID |
|
|
*/ |
|
|
*/ |
|
|
private void doWithDrawProcess(HistoricTaskInstance handledTaskInstance, Long userId) { |
|
|
private void doWithDrawProcess(HistoricTaskInstance handledTaskInstance, Long userId) { |
|
|
String processInstanceId = handledTaskInstance.getProcessInstanceId(); |
|
|
String processInstanceId = handledTaskInstance.getProcessInstanceId(); |
|
@@ -757,13 +751,13 @@ public class TodoCenterManage { |
|
|
switch (Objects.requireNonNull(ProjectStatusEnum.getValue(status))) { |
|
|
switch (Objects.requireNonNull(ProjectStatusEnum.getValue(status))) { |
|
|
// 当前项目状态是单位内部审核中 |
|
|
// 当前项目状态是单位内部审核中 |
|
|
case UNDER_INTERNAL_AUDIT: |
|
|
case UNDER_INTERNAL_AUDIT: |
|
|
// 当前项目状态是预审中 |
|
|
|
|
|
|
|
|
// 当前项目状态是预审中 |
|
|
case PRE_APPLYING: |
|
|
case PRE_APPLYING: |
|
|
// 当前项目状态是部门联审中 |
|
|
|
|
|
|
|
|
// 当前项目状态是部门联审中 |
|
|
case DEPARTMENT_JOINT_REVIEW: |
|
|
case DEPARTMENT_JOINT_REVIEW: |
|
|
// 当前项目状态是方案评审中 |
|
|
|
|
|
|
|
|
// 当前项目状态是方案评审中 |
|
|
case SCHEME_UNDER_REVIEW: |
|
|
case SCHEME_UNDER_REVIEW: |
|
|
// 当前项目状态是终验审核中 |
|
|
|
|
|
|
|
|
// 当前项目状态是终验审核中 |
|
|
case FINAL_ACCEPTANCE_IS_UNDER_REVIEW: |
|
|
case FINAL_ACCEPTANCE_IS_UNDER_REVIEW: |
|
|
updateWithdrawProjectStatus(userId, declaredProject); |
|
|
updateWithdrawProjectStatus(userId, declaredProject); |
|
|
break; |
|
|
break; |
|
@@ -798,7 +792,7 @@ public class TodoCenterManage { |
|
|
|
|
|
|
|
|
// TODO 判断前一个审核人的部门和当前登录用户的部门是否是同一个,如果是同一个才可以撤回,否则抛出异常 |
|
|
// TODO 判断前一个审核人的部门和当前登录用户的部门是否是同一个,如果是同一个才可以撤回,否则抛出异常 |
|
|
Boolean orgFlag = true; |
|
|
Boolean orgFlag = true; |
|
|
if (orgFlag){ |
|
|
|
|
|
|
|
|
if (orgFlag) { |
|
|
// 注意:是前一个审核人,说明此时仍在一个审核流程中,项目状态不需要改变,流程状态也不要改变,仍为审核中 |
|
|
// 注意:是前一个审核人,说明此时仍在一个审核流程中,项目状态不需要改变,流程状态也不要改变,仍为审核中 |
|
|
// 在审核记录中移除前一个审核人提交过的审核意见 |
|
|
// 在审核记录中移除前一个审核人提交过的审核意见 |
|
|
Comment comment = taskService.getProcessInstanceComments(processInstanceId).stream() |
|
|
Comment comment = taskService.getProcessInstanceComments(processInstanceId).stream() |
|
@@ -819,7 +813,7 @@ public class TodoCenterManage { |
|
|
.map(Execution::getActivityId) |
|
|
.map(Execution::getActivityId) |
|
|
.collect(Collectors.toList()), handledNode.getId()) |
|
|
.collect(Collectors.toList()), handledNode.getId()) |
|
|
.changeState(); |
|
|
.changeState(); |
|
|
}else { |
|
|
|
|
|
|
|
|
} else { |
|
|
throw new BizException("下一个审核人和您不是同一个部门,无法撤回!"); |
|
|
throw new BizException("下一个审核人和您不是同一个部门,无法撤回!"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -829,6 +823,7 @@ public class TodoCenterManage { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 当为撤回操作时,更新项目表中的项目状态为前一个状态 |
|
|
* 当为撤回操作时,更新项目表中的项目状态为前一个状态 |
|
|
|
|
|
* |
|
|
* @param userId |
|
|
* @param userId |
|
|
* @param declaredProject |
|
|
* @param declaredProject |
|
|
* @return void |
|
|
* @return void |
|
@@ -882,7 +877,7 @@ public class TodoCenterManage { |
|
|
// TODO 流程变成【被退回】状态,待我处理中,为流程发起人增加一条待办记录, |
|
|
// TODO 流程变成【被退回】状态,待我处理中,为流程发起人增加一条待办记录, |
|
|
// 执行自定义回退逻辑,回退到流程发起人 |
|
|
// 执行自定义回退逻辑,回退到流程发起人 |
|
|
// 注意:因为审核人有执行退回的权限,且是退回到流程发起人,说明是在同一个流程实例中,所以项目状态不需要更新 |
|
|
// 注意:因为审核人有执行退回的权限,且是退回到流程发起人,说明是在同一个流程实例中,所以项目状态不需要更新 |
|
|
managementService.executeCommand(new BackToHisApprovalNodeCmd(runtimeService,bpmnModel,param.getTaskId(), rootNode.getId())); |
|
|
|
|
|
|
|
|
managementService.executeCommand(new BackToHisApprovalNodeCmd(runtimeService, bpmnModel, param.getTaskId(), rootNode.getId())); |
|
|
runtimeService.setVariables(param.getInstanceId(), |
|
|
runtimeService.setVariables(param.getInstanceId(), |
|
|
Maps.newHashMap("approve_" + param.getTaskId(), param.getAction())); |
|
|
Maps.newHashMap("approve_" + param.getTaskId(), param.getAction())); |
|
|
log.info("用户[{}] 退回流程[{}] [{} -> {}]", userId, param.getInstanceId(), |
|
|
log.info("用户[{}] 退回流程[{}] [{} -> {}]", userId, param.getInstanceId(), |
|
@@ -900,6 +895,7 @@ public class TodoCenterManage { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 给流程发起人发送流程退回工作通知 |
|
|
* 给流程发起人发送流程退回工作通知 |
|
|
|
|
|
* |
|
|
* @param task |
|
|
* @param task |
|
|
* @param projectName |
|
|
* @param projectName |
|
|
* @param rootNode |
|
|
* @param rootNode |
|
@@ -940,7 +936,7 @@ public class TodoCenterManage { |
|
|
.executionIds(historicTaskInstances.stream().map(HistoricTaskInstance::getExecutionId).collect(Collectors.toSet())) |
|
|
.executionIds(historicTaskInstances.stream().map(HistoricTaskInstance::getExecutionId).collect(Collectors.toSet())) |
|
|
.processInstanceId(instanceId) |
|
|
.processInstanceId(instanceId) |
|
|
.list(); |
|
|
.list(); |
|
|
}else { |
|
|
|
|
|
|
|
|
} else { |
|
|
formDatas = historyService |
|
|
formDatas = historyService |
|
|
.createHistoricVariableInstanceQuery() |
|
|
.createHistoricVariableInstanceQuery() |
|
|
.processInstanceId(instanceId) |
|
|
.processInstanceId(instanceId) |
|
@@ -1103,7 +1099,7 @@ public class TodoCenterManage { |
|
|
// 获取登录用户ID |
|
|
// 获取登录用户ID |
|
|
// long userId = LoginUserUtil.getUserId(); |
|
|
// long userId = LoginUserUtil.getUserId(); |
|
|
|
|
|
|
|
|
Long userId = 381496L; |
|
|
|
|
|
|
|
|
Long userId = 381496L; |
|
|
// Long userId = 6418616L; |
|
|
// Long userId = 6418616L; |
|
|
// Long userId = 61769799L; |
|
|
// Long userId = 61769799L; |
|
|
|
|
|
|
|
@@ -1184,10 +1180,10 @@ public class TodoCenterManage { |
|
|
// result = resVos.stream().peek(v -> v.setOwner(userMap.get(userId))) |
|
|
// result = resVos.stream().peek(v -> v.setOwner(userMap.get(userId))) |
|
|
// .collect(Collectors.toList()); |
|
|
// .collect(Collectors.toList()); |
|
|
} |
|
|
} |
|
|
if (isEmpty(resVos)){ |
|
|
|
|
|
|
|
|
if (isEmpty(resVos)) { |
|
|
return PageVo.empty(); |
|
|
return PageVo.empty(); |
|
|
} |
|
|
} |
|
|
return PageVo.of(resVos,total); |
|
|
|
|
|
|
|
|
return PageVo.of(resVos, total); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@@ -1244,7 +1240,7 @@ public class TodoCenterManage { |
|
|
.map(HistoricTaskInstance::getProcessInstanceId) |
|
|
.map(HistoricTaskInstance::getProcessInstanceId) |
|
|
.collect(Collectors.toSet()); |
|
|
.collect(Collectors.toSet()); |
|
|
ReqToBeProcessedDTO reqToBeProcessedDTO = new ReqToBeProcessedDTO(); |
|
|
ReqToBeProcessedDTO reqToBeProcessedDTO = new ReqToBeProcessedDTO(); |
|
|
BeanUtils.copyProperties(param,reqToBeProcessedDTO); |
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(param, reqToBeProcessedDTO); |
|
|
List<Project> records = getHandledProjects(reqToBeProcessedDTO, taskProcessInsIds); |
|
|
List<Project> records = getHandledProjects(reqToBeProcessedDTO, taskProcessInsIds); |
|
|
|
|
|
|
|
|
ExcelExportWriter excelExportWriter = new ExcelExportWriter(); |
|
|
ExcelExportWriter excelExportWriter = new ExcelExportWriter(); |
|
@@ -1462,7 +1458,7 @@ public class TodoCenterManage { |
|
|
.map(h -> h.getId()) |
|
|
.map(h -> h.getId()) |
|
|
.collect(Collectors.toSet()); |
|
|
.collect(Collectors.toSet()); |
|
|
ReqToBeProcessedDTO reqToBeProcessedDTO = new ReqToBeProcessedDTO(); |
|
|
ReqToBeProcessedDTO reqToBeProcessedDTO = new ReqToBeProcessedDTO(); |
|
|
BeanUtils.copyProperties(param,reqToBeProcessedDTO); |
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(param, reqToBeProcessedDTO); |
|
|
List<Project> records = getMySubmittedProjects(reqToBeProcessedDTO, historicProcessInstanceIds); |
|
|
List<Project> records = getMySubmittedProjects(reqToBeProcessedDTO, historicProcessInstanceIds); |
|
|
|
|
|
|
|
|
ExcelExportWriter excelExportWriter = new ExcelExportWriter(); |
|
|
ExcelExportWriter excelExportWriter = new ExcelExportWriter(); |
|
@@ -1626,7 +1622,7 @@ public class TodoCenterManage { |
|
|
.collect(Collectors.toList()); |
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
ReqToBeProcessedDTO reqToBeProcessedDTO = new ReqToBeProcessedDTO(); |
|
|
ReqToBeProcessedDTO reqToBeProcessedDTO = new ReqToBeProcessedDTO(); |
|
|
BeanUtils.copyProperties(param,reqToBeProcessedDTO); |
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(param, reqToBeProcessedDTO); |
|
|
List<Project> records = getCcMeProjects(reqToBeProcessedDTO, processInsIds); |
|
|
List<Project> records = getCcMeProjects(reqToBeProcessedDTO, processInsIds); |
|
|
|
|
|
|
|
|
ExcelExportWriter excelExportWriter = new ExcelExportWriter(); |
|
|
ExcelExportWriter excelExportWriter = new ExcelExportWriter(); |
|
|