fix: 立项变更流程-工作终止 覆盖数据BUG

This commit is contained in:
2023-12-11 19:28:20 +08:00
parent 5ff36c5845
commit a88066a66e
@@ -1,6 +1,7 @@
package com.jero.modules.activiti.process.esInitChange.listener;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.jero.modules.activiti.process.esInitChange.entity.ProcessEsInitChange;
import com.jero.modules.activiti.process.esInitChange.entity.enums.ESPApplicationCategoryEnum;
import com.jero.modules.activiti.process.esInitChange.entity.enums.ESPChangeType;
@@ -79,13 +80,15 @@ public class ProcessESInitChangeEndListener implements ExecutionListener {
// 工作中止
if (ESPProjectType.WORK_TERMINATE.getValue().equals(projectType)) {
LambdaUpdateWrapper<EnterpriseStandardPlan> espWrapper = new LambdaUpdateWrapper<>();
// 将企标计划变更状态设为取消
for (ProcessEsInitChange processEsInitChange : processEsInitChanges) {
processEsInitChange.setProjectStatus(ESPProjectStatus.NOT_STARTED.getValue());
processEsInitChange.setChangeStatus(ESPChangeType.CANCEL.getValue());
espWrapper.eq(EnterpriseStandardPlan::getId, processEsInitChange.getEspId());
espWrapper.set(EnterpriseStandardPlan::getProjectStatus, ESPProjectStatus.NOT_STARTED.getValue());
espWrapper.set(EnterpriseStandardPlan::getChangeStatus, ESPChangeType.CANCEL.getValue());
espService.update(espWrapper);
espWrapper.clear();
}
enterpriseStandardPlans = BeanCopyUtils.copyBeanList(processEsInitChanges, EnterpriseStandardPlan.class);
espService.saveOrUpdateBatch(enterpriseStandardPlans);
}
// 责任部门变更