|
|
@@ -3,6 +3,7 @@ package com.ningdatech.pmapi.todocenter.manage; |
|
|
|
import static com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant.*; |
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
@@ -145,7 +146,7 @@ public class HandlerManage { |
|
|
|
updateProjectDelayApplyInfo(declaredProject,instanceId); |
|
|
|
break; |
|
|
|
case APPLY_BORROW: |
|
|
|
// 申请借阅审批逻辑 |
|
|
|
//TODO 申请借阅审批逻辑 |
|
|
|
break; |
|
|
|
default: |
|
|
|
throw new BizException("传入实例类型错误: " + instTypeEnum); |
|
|
@@ -217,11 +218,13 @@ public class HandlerManage { |
|
|
|
LocalDateTime approvalDate = declaredProject.getApprovalDate(); |
|
|
|
String buildCycle = declaredProject.getBuildCycle(); |
|
|
|
// 重新计算建设周期、验收时间 |
|
|
|
String constructCycle = buildCycle + delayApply.getDelayTime(); |
|
|
|
String constructCycle = String.valueOf(Integer.parseInt(buildCycle) + delayApply.getDelayTime()); |
|
|
|
declaredProject.setBuildCycle(constructCycle); |
|
|
|
Long delayedMonth = Long.valueOf(delayApply.getDelayTime()); |
|
|
|
String acceptTime = NdDateUtils.format(approvalDate.plusMonths(delayedMonth), DatePattern.NORM_DATETIME_MINUTE_PATTERN); |
|
|
|
declaredProject.setBuildCycle(acceptTime); |
|
|
|
Long constructMonth = Long.valueOf(constructCycle); |
|
|
|
declaredProject.setBuildCycle(String.valueOf(constructMonth)); |
|
|
|
String acceptTime = NdDateUtils.format(approvalDate.plusMonths(constructMonth), DatePattern.NORM_DATETIME_MINUTE_PATTERN); |
|
|
|
LocalDateTime time = LocalDateTime.parse(acceptTime, DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_MINUTE_PATTERN)); |
|
|
|
declaredProject.setPlanAcceptanceTime(time); |
|
|
|
declaredProject.setInstCode(instanceId); |
|
|
|
declaredProject.setApplyDelayFile(delayApply.getDelayApplyFile()); |
|
|
|
declaredProject.setApplyDelayReason(delayApply.getDelayApplyReason()); |
|
|
@@ -236,8 +239,16 @@ public class HandlerManage { |
|
|
|
*/ |
|
|
|
public void afterRejectTodo(Project declaredProject, HistoricProcessInstance instance) { |
|
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
|
// 更新项目状态和流程状态 |
|
|
|
updateRejectProjectStatus(userId, declaredProject); |
|
|
|
// 获取当前流程实例类型 |
|
|
|
String instanceId = declaredProject.getInstCode(); |
|
|
|
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
|
.eq(ProjectInst::getInstCode, instanceId)); |
|
|
|
Integer instType = projectInst.getInstType(); |
|
|
|
// 审批流程不是申请延期和申请借阅,需调用状态机 |
|
|
|
if (!InstTypeEnum.APPLY_DELAY.getCode().equals(instType) && !InstTypeEnum.APPLY_BORROW.getCode().equals(instType)) { |
|
|
|
// 更新项目状态和流程状态 |
|
|
|
updateRejectProjectStatus(userId, declaredProject); |
|
|
|
} |
|
|
|
//发送消息 |
|
|
|
noticeManage.sendNotice(instance.getStartUserId(),userId,declaredProject,instance.getProcessDefinitionName(), |
|
|
|
REJECT_MSG_TEMPLATE,MsgTypeEnum.PROJECT_REVIEW_REJECT); |
|
|
|