|
|
@@ -12,6 +12,7 @@ import java.util.stream.Collectors; |
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; |
|
|
|
import org.apache.commons.io.FileUtils; |
|
|
|
import org.assertj.core.util.Lists; |
|
|
|
import org.flowable.bpmn.model.*; |
|
|
@@ -290,11 +291,9 @@ public class TodoCenterManage { |
|
|
|
*/ |
|
|
|
public void handler(ReqProcessHandlerDTO param) { |
|
|
|
// 获取登录用户ID |
|
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
|
// 获取登录用户全量信息 |
|
|
|
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); |
|
|
|
UserInfoDetails user = LoginUserUtil.loginUserDetail(); |
|
|
|
// 获取登录用户浙政钉code |
|
|
|
String employeeCode = userFullInfo.getEmployeeCode(); |
|
|
|
String employeeCode = user.getEmployeeCode(); |
|
|
|
// 获取入参 |
|
|
|
String processInstanceId = param.getInstanceId(); |
|
|
|
Long projectId = param.getProjectId(); |
|
|
@@ -354,7 +353,7 @@ public class TodoCenterManage { |
|
|
|
// 当前项目状态是预审中 |
|
|
|
case PRE_APPLYING: |
|
|
|
//先修改项目状态 |
|
|
|
updatePassProjectStatus(userId, declaredProject); |
|
|
|
updatePassProjectStatus(user.getUserId(), declaredProject); |
|
|
|
//然后入库暂存库 |
|
|
|
projectStagingService.addByProject(declaredProject,"暂存入库 待提交部门联审"); |
|
|
|
break; |
|
|
@@ -366,7 +365,7 @@ public class TodoCenterManage { |
|
|
|
case SCHEME_UNDER_REVIEW: |
|
|
|
// 当前项目状态是终验审核中 |
|
|
|
case FINAL_ACCEPTANCE_IS_UNDER_REVIEW: |
|
|
|
updatePassProjectStatus(userId, declaredProject); |
|
|
|
updatePassProjectStatus(user.getUserId(), declaredProject); |
|
|
|
break; |
|
|
|
default: |
|
|
|
throw new IllegalStateException("Unexpected value: " + projectStatus); |
|
|
@@ -376,7 +375,7 @@ public class TodoCenterManage { |
|
|
|
String passMsg2 = String.format(PASS_MSG_TEMPLATE2, projectName, processDefinitionName); |
|
|
|
passWorkNoticeInfo2.setMsg(passMsg2); |
|
|
|
// 放入系统通知表中,保存记录 |
|
|
|
assemblyAuditNotify(userId, declaredProject, passMsg2); |
|
|
|
assemblyAuditNotify(user.getUserId(), declaredProject, passMsg2); |
|
|
|
// 放入工作通知暂存表中,通过扫表异步发送 |
|
|
|
workNoticeStagingService.addByWorkNotice(passWorkNoticeInfo2, MsgTypeEnum.PROJECT_REVIEW); |
|
|
|
} else { |
|
|
@@ -390,7 +389,7 @@ public class TodoCenterManage { |
|
|
|
String msg = String.format(PASS_MSG_TEMPLATE, sendWorkNoticeInfo.getOrganizationName(), projectName); |
|
|
|
sendWorkNoticeInfo.setMsg(msg); |
|
|
|
// 放入系统通知表中,保存记录 |
|
|
|
assemblyAuditNotify(userId, declaredProject, msg); |
|
|
|
assemblyAuditNotify(user.getUserId(), declaredProject, msg); |
|
|
|
// 放入工作通知暂存表中,通过扫表异步发送 |
|
|
|
workNoticeStagingService.addByWorkNotice(sendWorkNoticeInfo, MsgTypeEnum.PROJECT_REVIEW); |
|
|
|
} |
|
|
@@ -401,13 +400,13 @@ public class TodoCenterManage { |
|
|
|
// 【项目名称】的【流程名称】被驳回,请及时处理。 |
|
|
|
processTaskService.handleTask(param, employeeCode); |
|
|
|
// 更新项目状态和流程状态 |
|
|
|
updateRejectProjectStatus(userId, declaredProject); |
|
|
|
updateRejectProjectStatus(user.getUserId(), declaredProject); |
|
|
|
// 获取发送浙政钉工作通知必要信息 |
|
|
|
WorkNoticeInfo rejectWorkNoticeInfo = getSendWorkNoticeInfo(instance.getStartUserId()); |
|
|
|
String rejectMsg = String.format(REJECT_MSG_TEMPLATE, projectName, processDefinitionName); |
|
|
|
rejectWorkNoticeInfo.setMsg(rejectMsg); |
|
|
|
// 放入系统通知表中,保存记录 |
|
|
|
assemblyAuditNotify(userId, declaredProject, rejectMsg); |
|
|
|
assemblyAuditNotify(user.getUserId(), declaredProject, rejectMsg); |
|
|
|
// 放入工作通知暂存表中,通过扫表异步发送 |
|
|
|
workNoticeStagingService.addByWorkNotice(rejectWorkNoticeInfo, MsgTypeEnum.PROJECT_REVIEW); |
|
|
|
break; |
|
|
@@ -421,7 +420,7 @@ public class TodoCenterManage { |
|
|
|
String backMsg = String.format(BACK_MSG_TEMPLATE, projectName, processDefinitionName); |
|
|
|
backWorkNoticeInfo.setMsg(backMsg); |
|
|
|
// 放入系统通知表中,保存记录 |
|
|
|
assemblyAuditNotify(userId, declaredProject, backMsg); |
|
|
|
assemblyAuditNotify(user.getUserId(), declaredProject, backMsg); |
|
|
|
// 放入工作通知暂存表中,通过扫表异步发送 |
|
|
|
workNoticeStagingService.addByWorkNotice(backWorkNoticeInfo, MsgTypeEnum.PROJECT_REVIEW); |
|
|
|
break; |
|
|
@@ -443,7 +442,7 @@ public class TodoCenterManage { |
|
|
|
case SCHEME_UNDER_REVIEW: |
|
|
|
// 当前项目状态是终验审核中 |
|
|
|
case FINAL_ACCEPTANCE_IS_UNDER_REVIEW: |
|
|
|
updateWithdrawProjectStatus(userId, declaredProject); |
|
|
|
updateWithdrawProjectStatus(user.getUserId(), declaredProject); |
|
|
|
break; |
|
|
|
default: |
|
|
|
throw new IllegalStateException("Unexpected value: " + projectStatus); |
|
|
@@ -465,13 +464,13 @@ public class TodoCenterManage { |
|
|
|
} |
|
|
|
// 获取当前工作流任务前一个审核人信息 |
|
|
|
ProcessInstanceUserDto beforeUser = beforeProgressNode.getUser(); |
|
|
|
UserFullInfoDTO beforeUserInfo = userInfoHelper.getUserFullInfo(Long.valueOf(beforeUser.getUserId())); |
|
|
|
UserFullInfoDTO beforeUserInfo = userInfoHelper.getUserFullInfoByEmployeeCode(beforeUser.getUserId()); |
|
|
|
// 获取当前当前工作流任务当前审核人信息 |
|
|
|
ProcessInstanceUserDto currentUser = currentProgressNode.getUser(); |
|
|
|
UserFullInfoDTO currentUserInfo = userInfoHelper.getUserFullInfo(Long.valueOf(currentUser.getUserId())); |
|
|
|
UserFullInfoDTO currentUserInfo = userInfoHelper.getUserFullInfoByEmployeeCode(currentUser.getUserId()); |
|
|
|
// 判断当前工作流任务前一个审核人的部门和当前登录用户的部门是否是同一个,如果是同一个才可以撤回,否则抛出异常 |
|
|
|
boolean orgFlag = currentUserInfo.getOrganizationCode().equals(beforeUserInfo.getOrganizationCode()); |
|
|
|
boolean userFlag = beforeUser.getUserId().equals(String.valueOf(userId)); |
|
|
|
boolean userFlag = beforeUser.getUserId().equals(user.getEmployeeCode()); |
|
|
|
if (!orgFlag) { |
|
|
|
throw new BizException("下一个审核人和您不是同一个部门,无法撤回!"); |
|
|
|
} else if (!userFlag) { |
|
|
|