feat: 企标更改流程自动修改企标状态为试运行
This commit is contained in:
+19
-3
@@ -1,6 +1,7 @@
|
||||
package com.jero.modules.activiti.process.esChange.listener;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.jero.modules.activiti.process.common.enums.StandardStateEnum;
|
||||
import com.jero.modules.activiti.process.esChange.entity.ProcessEsChange;
|
||||
import com.jero.modules.activiti.process.esChange.service.ProcessEsChangeService;
|
||||
import com.jero.modules.laws.common.constant.FieldCommon;
|
||||
@@ -15,6 +16,7 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -72,10 +74,7 @@ public class ProcessESChangeEndListener implements ExecutionListener {
|
||||
parameterMap.put(FieldCommon.AUTH_DEPT, change.getAuthDept());
|
||||
parameterMap.put(FieldCommon.STANDARD_SYSTEM, change.getStandardSystem());
|
||||
parameterMap.put(FieldCommon.STANDARD_ENGLISH_NAME, change.getStandardEnglishName());
|
||||
parameterMap.put(FieldCommon.RELEASE_DATE, formatter.format(change.getReleaseDate()));
|
||||
parameterMap.put(FieldCommon.IMPLEMENTATION_DATE, formatter.format(change.getImplementationDate()));
|
||||
parameterMap.put(FieldCommon.TRY_FLAG, change.getTryFlag());
|
||||
parameterMap.put(FieldCommon.TRIAL_PERIOD, change.getTrialPeriod());
|
||||
parameterMap.put(FieldCommon.PART_NAME, change.getPartName());
|
||||
parameterMap.put(FieldCommon.MAIN_DRAFT_USER, change.getMainDraftingUser());
|
||||
parameterMap.put(FieldCommon.MAIN_DRAFTING_UNIT, change.getMainDraftingUnit());
|
||||
@@ -85,5 +84,22 @@ public class ProcessESChangeEndListener implements ExecutionListener {
|
||||
parameterMap.put(FieldCommon.ASSOCIATED_FILE, change.getAssociatedFile());
|
||||
parameterMap.put(FieldCommon.ACQUISITION_DEGREE, change.getAcquisitionDegree());
|
||||
parameterMap.put(FieldCommon.INTERNATIONAL_STANDARD_NUM, change.getInternationalStandardNum());
|
||||
// 是否试行
|
||||
Date releaseDate = change.getReleaseDate();
|
||||
boolean tryFlag = !change.getTryFlag().equals("0");
|
||||
String trialPeriod = change.getTrialPeriod();
|
||||
if (tryFlag) {
|
||||
// 如果是试行 并且当前时间处于发布日期+试行周期期间内,则更改标准状态为试运行
|
||||
if (releaseDate != null && trialPeriod != null) {
|
||||
Date endDate = new Date(releaseDate.getTime() + (long) Integer.parseInt(trialPeriod) * 24 * 60 * 60 * 1000 * 30);
|
||||
Date now = new Date();
|
||||
if (now.before(endDate)) {
|
||||
parameterMap.put(FieldCommon.STANDARD_STATE, StandardStateEnum.TRIAL_OPERATION.getStateValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
parameterMap.put(FieldCommon.RELEASE_DATE, formatter.format(releaseDate));
|
||||
parameterMap.put(FieldCommon.TRY_FLAG, change.getTryFlag());
|
||||
parameterMap.put(FieldCommon.TRIAL_PERIOD, change.getTrialPeriod());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user