|
|
@@ -160,6 +160,10 @@ public class TodoCenterManage { |
|
|
|
public PageVo<ResToBeProcessedVO> todoProjectList(ToBeProcessedReq param) { |
|
|
|
// 获取登录用户ID |
|
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
|
// 获取登录用户全量信息 |
|
|
|
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); |
|
|
|
// 获取员工浙政钉code |
|
|
|
String employeeCode = userFullInfo.getEmployeeCode(); |
|
|
|
|
|
|
|
// 查出项目库项目 |
|
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
@@ -186,6 +190,7 @@ public class TodoCenterManage { |
|
|
|
Integer pageSize = param.getPageSize(); |
|
|
|
req.setProcessDefId(param.getProcessDefId()); |
|
|
|
req.setUserId(String.valueOf(userId)); |
|
|
|
req.setEmployeeCode(employeeCode); |
|
|
|
List<ProcessTaskVo> todoList = processTaskService.getUserTodoList(req); |
|
|
|
|
|
|
|
if (CollUtil.isEmpty(todoList)) { |
|
|
@@ -232,6 +237,10 @@ public class TodoCenterManage { |
|
|
|
public void exportTodoList(HttpServletResponse response, ToBeProcessedExportReq param) { |
|
|
|
// 获取登录用户ID |
|
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
|
// 获取用户全量用户信息 |
|
|
|
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); |
|
|
|
// 获取登录用户浙政钉code |
|
|
|
String employeeCode = userFullInfo.getEmployeeCode(); |
|
|
|
|
|
|
|
// 查出项目库项目 |
|
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
@@ -253,6 +262,7 @@ public class TodoCenterManage { |
|
|
|
req.setInstCodes(instCodes); |
|
|
|
req.setProcessDefId(param.getProcessDefId()); |
|
|
|
req.setUserId(String.valueOf(userId)); |
|
|
|
req.setEmployeeCode(employeeCode); |
|
|
|
BeanUtils.copyProperties(param,req); |
|
|
|
userTodoList = processTaskService.getUserTodoList(req); |
|
|
|
} |
|
|
@@ -289,7 +299,10 @@ public class TodoCenterManage { |
|
|
|
public void handler(ReqProcessHandlerDTO param) { |
|
|
|
// 获取登录用户ID |
|
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
|
|
|
|
|
// 获取登录用户全量信息 |
|
|
|
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); |
|
|
|
// 获取登录用户浙政钉code |
|
|
|
String employeeCode = userFullInfo.getEmployeeCode(); |
|
|
|
// 获取入参 |
|
|
|
String processInstanceId = param.getInstanceId(); |
|
|
|
Long projectId = param.getProjectId(); |
|
|
@@ -313,7 +326,8 @@ public class TodoCenterManage { |
|
|
|
.singleResult(); |
|
|
|
// 获取流程发起人信息 |
|
|
|
String startUserId = instance.getStartUserId(); |
|
|
|
UserInfo startUserInfo = userInfoService.getById(Long.valueOf(startUserId)); |
|
|
|
UserInfo startUserInfo = userInfoService.getOne(Wrappers.lambdaQuery(UserInfo.class) |
|
|
|
.eq(UserInfo::getEmployeeCode, startUserId)); |
|
|
|
// 获取流程定义名称 |
|
|
|
String processDefinitionName = instance.getProcessDefinitionName(); |
|
|
|
|
|
|
@@ -323,7 +337,7 @@ public class TodoCenterManage { |
|
|
|
// 盖章并通过 |
|
|
|
case SEAL_PASS: |
|
|
|
// 通过该任务,流程到下一审核人处 |
|
|
|
processTaskService.handleTask(param, userId); |
|
|
|
processTaskService.handleTask(param, employeeCode); |
|
|
|
// 获取流程通过后的流程实例 |
|
|
|
HistoricProcessInstance newInstance = historyService.createHistoricProcessInstanceQuery() |
|
|
|
.processInstanceId(processInstanceId) |
|
|
@@ -397,7 +411,7 @@ public class TodoCenterManage { |
|
|
|
case REJECT: |
|
|
|
// 驳回该任务,中止流程并使项目进入对应状态,给项目创建人、流程发起人发送浙政钉工作通知: |
|
|
|
// 【项目名称】的【流程名称】被驳回,请及时处理。 |
|
|
|
processTaskService.handleTask(param, userId); |
|
|
|
processTaskService.handleTask(param, employeeCode); |
|
|
|
// 更新项目状态和流程状态 |
|
|
|
updateRejectProjectStatus(userId, declaredProject); |
|
|
|
// 获取发送浙政钉工作通知必要信息 |
|
|
@@ -412,7 +426,7 @@ public class TodoCenterManage { |
|
|
|
// 退回 |
|
|
|
case BACK: |
|
|
|
// 退回该任务 |
|
|
|
processTaskService.handleTask(param, userId); |
|
|
|
processTaskService.handleTask(param, employeeCode); |
|
|
|
// 给项目创建人、流程发起人发送浙政钉工作通知:【项目名称】的【流程名称】被退回,请及时处理。 |
|
|
|
// 获取发送浙政钉工作通知必要信息 |
|
|
|
WorkNoticeInfo backWorkNoticeInfo = getSendWorkNoticeInfo(startUserInfo); |
|
|
@@ -426,9 +440,9 @@ public class TodoCenterManage { |
|
|
|
// 撤回(流程发起人和当前流程审核人的前一个审核人操作) |
|
|
|
case WITHDRAW: |
|
|
|
// 登录用户是流程发起人,且是流程发起人撤回 |
|
|
|
if (userId.equals(Long.valueOf(startUserId)) |
|
|
|
if (employeeCode.equals(startUserId) |
|
|
|
&& ProcessConstant.Field.ROOT.equals(param.getTaskId())) { |
|
|
|
processTaskService.handleTask(param, userId); |
|
|
|
processTaskService.handleTask(param, employeeCode); |
|
|
|
// 若是流程发起人点击撤回,项目回到上一个状态,需调用状态机更新项目状态,流程状态更新为审核通过 |
|
|
|
switch (Objects.requireNonNull(ProjectStatusEnum.getValue(projectStatus))) { |
|
|
|
// 当前项目状态是单位内部审核中 |
|
|
@@ -475,7 +489,7 @@ public class TodoCenterManage { |
|
|
|
} else if (!userFlag) { |
|
|
|
throw new BizException("当前登录用户无法进行撤回操作!"); |
|
|
|
} else { |
|
|
|
processTaskService.handleTask(param, userId); |
|
|
|
processTaskService.handleTask(param, employeeCode); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
@@ -752,6 +766,10 @@ public class TodoCenterManage { |
|
|
|
|
|
|
|
// 获取登录用户ID |
|
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
|
// 获取登录用户全量信息 |
|
|
|
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); |
|
|
|
// 获取登录用户浙政钉code |
|
|
|
String employeeCode = userFullInfo.getEmployeeCode(); |
|
|
|
|
|
|
|
// 查出项目库项目 |
|
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
@@ -775,6 +793,7 @@ public class TodoCenterManage { |
|
|
|
Integer pageSize = param.getPageSize(); |
|
|
|
req.setProcessDefId(param.getProcessDefId()); |
|
|
|
req.setUserId(String.valueOf(userId)); |
|
|
|
req.setEmployeeCode(employeeCode); |
|
|
|
req.setInstCodes(instCodes); |
|
|
|
List<ProcessTaskVo> iDoList = processTaskService.getUserIdoList(req); |
|
|
|
if (CollUtil.isEmpty(iDoList)) { |
|
|
@@ -813,6 +832,10 @@ public class TodoCenterManage { |
|
|
|
public void idoExport(HttpServletResponse response, ToBeProcessedExportReq param) { |
|
|
|
// 获取登录用户ID |
|
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
|
// 获取登录用户全量信息 |
|
|
|
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); |
|
|
|
// 获取登录用户浙政钉code |
|
|
|
String employeeCode = userFullInfo.getEmployeeCode(); |
|
|
|
|
|
|
|
//因为要解耦 不能把项目和工作流一起查 |
|
|
|
// 查出项目库项目 |
|
|
@@ -836,6 +859,7 @@ public class TodoCenterManage { |
|
|
|
TodoCenterListReqDTO req = new TodoCenterListReqDTO(); |
|
|
|
req.setProcessDefId(param.getProcessDefId()); |
|
|
|
req.setUserId(String.valueOf(userId)); |
|
|
|
req.setEmployeeCode(employeeCode); |
|
|
|
req.setInstCodes(instCodes); |
|
|
|
userIdoList = processTaskService.getUserIdoList(req); |
|
|
|
} |
|
|
@@ -875,9 +899,12 @@ public class TodoCenterManage { |
|
|
|
* @since 2023/02/06 |
|
|
|
*/ |
|
|
|
public PageVo<ResToBeProcessedVO> mySubmittedList(ToBeProcessedReq param) { |
|
|
|
|
|
|
|
// 获取登录用户ID |
|
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
|
// 获取登录用户全量信息 |
|
|
|
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); |
|
|
|
// 获取登录用户浙政钉code |
|
|
|
String employeeCode = userFullInfo.getEmployeeCode(); |
|
|
|
|
|
|
|
// 查出项目库项目 |
|
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
@@ -903,6 +930,7 @@ public class TodoCenterManage { |
|
|
|
Integer pageSize = param.getPageSize(); |
|
|
|
req.setProcessDefId(param.getProcessDefId()); |
|
|
|
req.setUserId(String.valueOf(userId)); |
|
|
|
req.setEmployeeCode(employeeCode); |
|
|
|
req.setInstCodes(instCodes); |
|
|
|
List<ProcessInstanceVo> submittedList = processInstanceService.getUserSubmittedList(req); |
|
|
|
|
|
|
@@ -915,7 +943,6 @@ public class TodoCenterManage { |
|
|
|
.limit(pageSize) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
List<ResToBeProcessedVO> resVos = userSubmittedList.stream().map(d -> { |
|
|
|
ResToBeProcessedVO res = new ResToBeProcessedVO(); |
|
|
|
Project project = projectInfoMap.get(d.getInstanceId()); |
|
|
@@ -943,6 +970,10 @@ public class TodoCenterManage { |
|
|
|
|
|
|
|
// 获取登录用户ID |
|
|
|
long userId = LoginUserUtil.getUserId(); |
|
|
|
// 获取登录用户全量信息 |
|
|
|
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); |
|
|
|
// 获取登录用户浙政钉code |
|
|
|
String employeeCode = userFullInfo.getEmployeeCode(); |
|
|
|
|
|
|
|
// 查出项目库项目 |
|
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
@@ -965,6 +996,7 @@ public class TodoCenterManage { |
|
|
|
TodoCenterListReqDTO req = new TodoCenterListReqDTO(); |
|
|
|
req.setProcessDefId(param.getProcessDefId()); |
|
|
|
req.setUserId(String.valueOf(userId)); |
|
|
|
req.setEmployeeCode(employeeCode); |
|
|
|
req.setInstCodes(instCodes); |
|
|
|
userSubmittedList = processInstanceService.getUserSubmittedList(req); |
|
|
|
} |
|
|
@@ -1007,6 +1039,10 @@ public class TodoCenterManage { |
|
|
|
|
|
|
|
// 获取登录用户ID |
|
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
|
// 获取登录用户全量信息 |
|
|
|
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); |
|
|
|
// 获取登录用户浙政钉code |
|
|
|
String employeeCode = userFullInfo.getEmployeeCode(); |
|
|
|
|
|
|
|
// 查出项目库项目 |
|
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
@@ -1032,6 +1068,7 @@ public class TodoCenterManage { |
|
|
|
Integer pageSize = param.getPageSize(); |
|
|
|
req.setProcessDefId(param.getProcessDefId()); |
|
|
|
req.setUserId(String.valueOf(userId)); |
|
|
|
req.setEmployeeCode(employeeCode); |
|
|
|
req.setInstCodes(instCodes); |
|
|
|
BeanUtils.copyProperties(param,req); |
|
|
|
List<ProcessInstanceVo> ccMeList = processInstanceService.getCcMeList(req); |
|
|
@@ -1073,6 +1110,10 @@ public class TodoCenterManage { |
|
|
|
|
|
|
|
// 获取登录用户ID |
|
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
|
// 获取登录用户全量信息 |
|
|
|
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); |
|
|
|
// 获取登录用户浙政钉code |
|
|
|
String employeeCode = userFullInfo.getEmployeeCode(); |
|
|
|
|
|
|
|
// 查出项目库项目 |
|
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
@@ -1095,13 +1136,12 @@ public class TodoCenterManage { |
|
|
|
TodoCenterListReqDTO req = new TodoCenterListReqDTO(); |
|
|
|
req.setProcessDefId(param.getProcessDefId()); |
|
|
|
req.setUserId(String.valueOf(userId)); |
|
|
|
req.setEmployeeCode(employeeCode); |
|
|
|
req.setInstCodes(instCodes); |
|
|
|
BeanUtils.copyProperties(param,req); |
|
|
|
ccMeList = processInstanceService.getCcMeList(req); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ExcelExportWriter excelExportWriter = new ExcelExportWriter(); |
|
|
|
|
|
|
|
String fileName = null; |
|
|
@@ -1345,9 +1385,13 @@ public class TodoCenterManage { |
|
|
|
//获取当前登录人的 待办中心统计数据 |
|
|
|
public TodoCenterStatisticsVO todoCenterStatistics(){ |
|
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
|
// 获取登录用户全量信息 |
|
|
|
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); |
|
|
|
// 获取登录用户浙政钉code |
|
|
|
String employeeCode = userFullInfo.getEmployeeCode(); |
|
|
|
|
|
|
|
//为了查询效率 还是自己去写统计接口 |
|
|
|
TodoCenterStatisticsPO statistics = statisticsService.getStatistics(userId); |
|
|
|
TodoCenterStatisticsPO statistics = statisticsService.getStatistics(employeeCode); |
|
|
|
TodoCenterStatisticsVO statisticsVO = BeanUtil.copyProperties(statistics,TodoCenterStatisticsVO.class); |
|
|
|
|
|
|
|
return statisticsVO; |
|
|
|