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