fix: 80689 企标计划--当前日期大于计划日期,且未完成制修订流程,项目状态未更新

This commit is contained in:
2024-01-16 13:41:43 +08:00
parent b7a3fb736b
commit 98400cb036
2 changed files with 52 additions and 2 deletions
@@ -112,8 +112,15 @@ public class ProcessESRevisionEndListener implements ExecutionListener {
BeanCopyUtils.copyBeanList(reviewMeetingDetailVOS, EnterpriseStandardRmrEvaluateDetail.class);
rmrEvaluateDetails.forEach(r -> r.setReviewMeetingId(esRmr.getId()));
rmrDetailService.saveBatch(rmrEvaluateDetails);
// 企标计划改为已完成
esp.setProjectStatus(ESPProjectStatus.COMPLETED.getValue());
// 企标计划改为已完成或者逾期完成
Date curDate = new Date();
if (curDate.after(esp.getDraftPlannedCompleteDate()) ||
curDate.after(esp.getSolicitationDraftPlanCompleteDate()) ||
curDate.after(esp.getPlanApprovalDate())) {
esp.setProjectStatus(ESPProjectStatus.OVERDUE_COMPLETED.getValue());
} else {
esp.setProjectStatus(ESPProjectStatus.COMPLETED.getValue());
}
espService.updateById(esp);
// 软删除制修订计划
esRevisionService.removeById(data.getId());
@@ -0,0 +1,43 @@
package com.jero.modules.laws.enterprise.job;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.common.constant.enums.YesOrNoEnum;
import com.jero.modules.activiti.process.esInitChange.entity.enums.ESPProjectStatus;
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardPlan;
import com.jero.modules.laws.enterprise.service.EnterpriseStandardPlanService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
* @author: Mzaxd
* @Date: 2024/1/16 11:42
*/
public class ESPlanProjectStatusJob implements Job {
@Resource
private EnterpriseStandardPlanService espService;
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
// 每天执行定时任务 判断所有进行中的计划是否逾期 逾期则修改项目状态为逾期
LambdaQueryWrapper<EnterpriseStandardPlan> espWrapper = new LambdaQueryWrapper<>();
espWrapper.eq(EnterpriseStandardPlan::getProjectStatus, ESPProjectStatus.IN_PROGRESS.getValue());
espWrapper.eq(EnterpriseStandardPlan::getDelFlag, YesOrNoEnum.NO.getValue());
List<EnterpriseStandardPlan> list = espService.list(espWrapper);
Date curDate = new Date();
list.forEach(p -> {
if (curDate.after(p.getDraftPlannedCompleteDate()) ||
curDate.after(p.getSolicitationDraftPlanCompleteDate()) ||
curDate.after(p.getPlanApprovalDate())) {
p.setProjectStatus(ESPProjectStatus.OVERDUE.getValue());
}
});
espService.updateBatchById(list);
}
}