feat: 年度制修订流程结束后两个监听器
This commit is contained in:
+19
-76
@@ -1,11 +1,8 @@
|
||||
package com.jero.modules.activiti.process.esAnnualInit.listener;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.enums.ESPProjectType;
|
||||
import com.jero.modules.activiti.process.esInitChange.service.ProcessEsInitChangeService;
|
||||
import com.jero.modules.activiti.process.esAnnualInit.entity.ProcessEsAnnualInit;
|
||||
import com.jero.modules.activiti.process.esAnnualInit.service.impl.ProcessEsAnnualInitServiceImpl;
|
||||
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardPlan;
|
||||
import com.jero.modules.laws.enterprise.service.EnterpriseStandardPlanService;
|
||||
import com.jero.modules.laws.enterprise.util.BeanCopyUtils;
|
||||
@@ -29,82 +26,28 @@ public class ProcessESAnnualInitEndListener implements ExecutionListener {
|
||||
private EnterpriseStandardPlanService espService;
|
||||
|
||||
@Resource
|
||||
private ProcessEsInitChangeService esInitChangeService;
|
||||
private ProcessEsAnnualInitServiceImpl annualInitService;
|
||||
|
||||
/**
|
||||
* 企标立项变更流程结束之后需要把数据存入企标计划数据库 然后自动发起企标制修订流程
|
||||
* 流程结束之后需要把数据存入企标计划数据库
|
||||
*
|
||||
* @param delegateExecution
|
||||
*/
|
||||
@Override
|
||||
public void notify(DelegateExecution delegateExecution) {
|
||||
// log.info("企标立项变更流程结束 监听执行器开始执行");
|
||||
// // 获取流程实例ID
|
||||
// String processInstanceId = delegateExecution.getProcessInstanceId();
|
||||
// // 根据流程实例Id找到所有流程业务数据
|
||||
// LambdaQueryWrapper<ProcessEsInitChange> esInitChangeWrapper = new LambdaQueryWrapper<>();
|
||||
// esInitChangeWrapper.eq(ProcessEsInitChange::getProcessInstanceId, processInstanceId);
|
||||
// List<ProcessEsInitChange> processEsInitChanges = esInitChangeService.list(esInitChangeWrapper);
|
||||
// String applicationCategory = processEsInitChanges.get(0).getApplicationCategory();
|
||||
// String projectType = processEsInitChanges.get(0).getProjectType();
|
||||
// List<EnterpriseStandardPlan> enterpriseStandardPlans;
|
||||
// if (ESPApplicationCategoryEnum.INITIATION.getValue().equals(applicationCategory)) {
|
||||
// // 立项新增-Id置空
|
||||
// for (ProcessEsInitChange processEsInitChange : processEsInitChanges) {
|
||||
// processEsInitChange.setId(null);
|
||||
// }
|
||||
// // 转换为企标计划数据并入库
|
||||
// enterpriseStandardPlans = BeanCopyUtils.copyBeanList(processEsInitChanges, EnterpriseStandardPlan.class);
|
||||
// espService.saveBatch(enterpriseStandardPlans);
|
||||
// } else {
|
||||
// // 将Id设为企标计划的Id
|
||||
// for (ProcessEsInitChange processEsInitChange : processEsInitChanges) {
|
||||
// processEsInitChange.setId(processEsInitChange.getEspId());
|
||||
// }
|
||||
//
|
||||
// // 完成时间变更
|
||||
// if (ESPProjectType.COMPLETE_TIME_CHANGE.getValue().equals(projectType)) {
|
||||
// enterpriseStandardPlans = BeanCopyUtils.copyBeanList(processEsInitChanges, EnterpriseStandardPlan.class);
|
||||
// espService.saveOrUpdateBatch(enterpriseStandardPlans);
|
||||
// }
|
||||
//
|
||||
// // 工作中止
|
||||
// if (ESPProjectType.WORK_TERMINATE.getValue().equals(projectType)) {
|
||||
// // 将企标计划变更状态设为取消
|
||||
// for (ProcessEsInitChange processEsInitChange : processEsInitChanges) {
|
||||
// processEsInitChange.setProjectStatus(ESPChangeType.CANCEL.getValue());
|
||||
// }
|
||||
// enterpriseStandardPlans = BeanCopyUtils.copyBeanList(processEsInitChanges, EnterpriseStandardPlan.class);
|
||||
// espService.saveOrUpdateBatch(enterpriseStandardPlans);
|
||||
// }
|
||||
//
|
||||
// // 责任部门变更
|
||||
// if (ESPProjectType.RESPONSIBLE_DEPT_CHANGE.getValue().equals(projectType)) {
|
||||
// // 将企标计划变更状态设为变更
|
||||
// for (ProcessEsInitChange processEsInitChange : processEsInitChanges) {
|
||||
// processEsInitChange.setProjectStatus(ESPChangeType.CHANGE.getValue());
|
||||
// }
|
||||
// enterpriseStandardPlans = BeanCopyUtils.copyBeanList(processEsInitChanges, EnterpriseStandardPlan.class);
|
||||
// espService.saveOrUpdateBatch(enterpriseStandardPlans);
|
||||
// }
|
||||
//
|
||||
// // 合并
|
||||
// if (ESPProjectType.MERGE.getValue().equals(projectType)) {
|
||||
// for (ProcessEsInitChange processEsInitChange : processEsInitChanges) {
|
||||
// processEsInitChange.setId(null);
|
||||
// }
|
||||
// // 删除两个老企标计划
|
||||
// espService.deleteById(processEsInitChanges.get(0).getStandardIdOne());
|
||||
// espService.deleteById(processEsInitChanges.get(0).getStandardIdTwo());
|
||||
// // 生成新企标计划
|
||||
// enterpriseStandardPlans = BeanCopyUtils.copyBeanList(processEsInitChanges, EnterpriseStandardPlan.class);
|
||||
// espService.saveOrUpdateBatch(enterpriseStandardPlans);
|
||||
// }
|
||||
// }
|
||||
// log.info("数据存入企标计划数据库");
|
||||
// // 软删除流程数据
|
||||
// esInitChangeService.removeByProcessInstanceId(processInstanceId);
|
||||
// log.info("软删除流程数据");
|
||||
// //TODO 发起制修订流程
|
||||
// log.info("自动发起企标制修订流程");
|
||||
log.info("年度制修订标准化发起流程结束 监听执行器开始执行");
|
||||
// 获取流程实例ID
|
||||
String processInstanceId = delegateExecution.getProcessInstanceId();
|
||||
// 根据流程实例Id找到所有流程业务数据
|
||||
LambdaQueryWrapper<ProcessEsAnnualInit> esAnnualInitWrapper = new LambdaQueryWrapper<>();
|
||||
esAnnualInitWrapper.eq(ProcessEsAnnualInit::getProcessInstanceId, processInstanceId);
|
||||
List<ProcessEsAnnualInit> annualInits = annualInitService.list(esAnnualInitWrapper);
|
||||
List<EnterpriseStandardPlan> enterpriseStandardPlans;
|
||||
// 立项新增-Id置空
|
||||
annualInits.forEach(annualInit -> annualInit.setId(null));
|
||||
// 转换为企标计划数据并入库
|
||||
enterpriseStandardPlans = BeanCopyUtils.copyBeanList(annualInits, EnterpriseStandardPlan.class);
|
||||
espService.saveBatch(enterpriseStandardPlans);
|
||||
log.info("数据存入企标计划数据库");
|
||||
}
|
||||
}
|
||||
|
||||
+19
-76
@@ -1,11 +1,8 @@
|
||||
package com.jero.modules.activiti.process.esAnnualReport.listener;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.enums.ESPProjectType;
|
||||
import com.jero.modules.activiti.process.esInitChange.service.ProcessEsInitChangeService;
|
||||
import com.jero.modules.activiti.process.esAnnualReport.entity.ProcessEsAnnualReport;
|
||||
import com.jero.modules.activiti.process.esAnnualReport.service.impl.ProcessEsAnnualReportServiceImpl;
|
||||
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardPlan;
|
||||
import com.jero.modules.laws.enterprise.service.EnterpriseStandardPlanService;
|
||||
import com.jero.modules.laws.enterprise.util.BeanCopyUtils;
|
||||
@@ -29,82 +26,28 @@ public class ProcessESAnnualReportEndListener implements ExecutionListener {
|
||||
private EnterpriseStandardPlanService espService;
|
||||
|
||||
@Resource
|
||||
private ProcessEsInitChangeService esInitChangeService;
|
||||
private ProcessEsAnnualReportServiceImpl annualReportService;
|
||||
|
||||
/**
|
||||
* 企标立项变更流程结束之后需要把数据存入企标计划数据库 然后自动发起企标制修订流程
|
||||
* 流程结束之后需要把数据存入企标计划数据库
|
||||
*
|
||||
* @param delegateExecution
|
||||
*/
|
||||
@Override
|
||||
public void notify(DelegateExecution delegateExecution) {
|
||||
// log.info("企标立项变更流程结束 监听执行器开始执行");
|
||||
// // 获取流程实例ID
|
||||
// String processInstanceId = delegateExecution.getProcessInstanceId();
|
||||
// // 根据流程实例Id找到所有流程业务数据
|
||||
// LambdaQueryWrapper<ProcessEsInitChange> esInitChangeWrapper = new LambdaQueryWrapper<>();
|
||||
// esInitChangeWrapper.eq(ProcessEsInitChange::getProcessInstanceId, processInstanceId);
|
||||
// List<ProcessEsInitChange> processEsInitChanges = esInitChangeService.list(esInitChangeWrapper);
|
||||
// String applicationCategory = processEsInitChanges.get(0).getApplicationCategory();
|
||||
// String projectType = processEsInitChanges.get(0).getProjectType();
|
||||
// List<EnterpriseStandardPlan> enterpriseStandardPlans;
|
||||
// if (ESPApplicationCategoryEnum.INITIATION.getValue().equals(applicationCategory)) {
|
||||
// // 立项新增-Id置空
|
||||
// for (ProcessEsInitChange processEsInitChange : processEsInitChanges) {
|
||||
// processEsInitChange.setId(null);
|
||||
// }
|
||||
// // 转换为企标计划数据并入库
|
||||
// enterpriseStandardPlans = BeanCopyUtils.copyBeanList(processEsInitChanges, EnterpriseStandardPlan.class);
|
||||
// espService.saveBatch(enterpriseStandardPlans);
|
||||
// } else {
|
||||
// // 将Id设为企标计划的Id
|
||||
// for (ProcessEsInitChange processEsInitChange : processEsInitChanges) {
|
||||
// processEsInitChange.setId(processEsInitChange.getEspId());
|
||||
// }
|
||||
//
|
||||
// // 完成时间变更
|
||||
// if (ESPProjectType.COMPLETE_TIME_CHANGE.getValue().equals(projectType)) {
|
||||
// enterpriseStandardPlans = BeanCopyUtils.copyBeanList(processEsInitChanges, EnterpriseStandardPlan.class);
|
||||
// espService.saveOrUpdateBatch(enterpriseStandardPlans);
|
||||
// }
|
||||
//
|
||||
// // 工作中止
|
||||
// if (ESPProjectType.WORK_TERMINATE.getValue().equals(projectType)) {
|
||||
// // 将企标计划变更状态设为取消
|
||||
// for (ProcessEsInitChange processEsInitChange : processEsInitChanges) {
|
||||
// processEsInitChange.setProjectStatus(ESPChangeType.CANCEL.getValue());
|
||||
// }
|
||||
// enterpriseStandardPlans = BeanCopyUtils.copyBeanList(processEsInitChanges, EnterpriseStandardPlan.class);
|
||||
// espService.saveOrUpdateBatch(enterpriseStandardPlans);
|
||||
// }
|
||||
//
|
||||
// // 责任部门变更
|
||||
// if (ESPProjectType.RESPONSIBLE_DEPT_CHANGE.getValue().equals(projectType)) {
|
||||
// // 将企标计划变更状态设为变更
|
||||
// for (ProcessEsInitChange processEsInitChange : processEsInitChanges) {
|
||||
// processEsInitChange.setProjectStatus(ESPChangeType.CHANGE.getValue());
|
||||
// }
|
||||
// enterpriseStandardPlans = BeanCopyUtils.copyBeanList(processEsInitChanges, EnterpriseStandardPlan.class);
|
||||
// espService.saveOrUpdateBatch(enterpriseStandardPlans);
|
||||
// }
|
||||
//
|
||||
// // 合并
|
||||
// if (ESPProjectType.MERGE.getValue().equals(projectType)) {
|
||||
// for (ProcessEsInitChange processEsInitChange : processEsInitChanges) {
|
||||
// processEsInitChange.setId(null);
|
||||
// }
|
||||
// // 删除两个老企标计划
|
||||
// espService.deleteById(processEsInitChanges.get(0).getStandardIdOne());
|
||||
// espService.deleteById(processEsInitChanges.get(0).getStandardIdTwo());
|
||||
// // 生成新企标计划
|
||||
// enterpriseStandardPlans = BeanCopyUtils.copyBeanList(processEsInitChanges, EnterpriseStandardPlan.class);
|
||||
// espService.saveOrUpdateBatch(enterpriseStandardPlans);
|
||||
// }
|
||||
// }
|
||||
// log.info("数据存入企标计划数据库");
|
||||
// // 软删除流程数据
|
||||
// esInitChangeService.removeByProcessInstanceId(processInstanceId);
|
||||
// log.info("软删除流程数据");
|
||||
// //TODO 发起制修订流程
|
||||
// log.info("自动发起企标制修订流程");
|
||||
log.info("年度制修订各部门主动上报流程结束 监听执行器开始执行");
|
||||
// 获取流程实例ID
|
||||
String processInstanceId = delegateExecution.getProcessInstanceId();
|
||||
// 根据流程实例Id找到所有流程业务数据
|
||||
LambdaQueryWrapper<ProcessEsAnnualReport> esAnnualReportWrapper = new LambdaQueryWrapper<>();
|
||||
esAnnualReportWrapper.eq(ProcessEsAnnualReport::getProcessInstanceId, processInstanceId);
|
||||
List<ProcessEsAnnualReport> annualReports = annualReportService.list(esAnnualReportWrapper);
|
||||
List<EnterpriseStandardPlan> enterpriseStandardPlans;
|
||||
// 立项新增-Id置空
|
||||
annualReports.forEach(annualReport -> annualReport.setId(null));
|
||||
// 转换为企标计划数据并入库
|
||||
enterpriseStandardPlans = BeanCopyUtils.copyBeanList(annualReports, EnterpriseStandardPlan.class);
|
||||
espService.saveBatch(enterpriseStandardPlans);
|
||||
log.info("数据存入企标计划数据库");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user