fix(企标稽查整改): 81096

This commit is contained in:
yjz
2024-01-23 11:25:41 +08:00
parent 3d99d03a06
commit 88722aa321
@@ -263,49 +263,58 @@ public class EsInspectRectifyFlowServiceImpl implements IEsInspectRectifyFlowSer
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date parse = dateFormat.parse(dateFormat.format(date));
// 是否申请延期
if (EsInspectRectifyCommon.OPERATION_TYPE_2.equals(processEsInspectReportVO.getOperationType())
&& (processEsInspectReportVO.getApplyDelayDate().before(parse)
|| processEsInspectReportVO.getApplyDelayDate().equals(parse))){
// 生成新整改流程
EsInspectRectifyFlowVO newEsInspectReportFlowVO = new EsInspectRectifyFlowVO();
// 处理流程信息
ProcessAll newProcessAll = new ProcessAll();
newProcessAll.setProjectId(String.valueOf(SnowflakeUtils.snowflake()));
newProcessAll.setPrcName(processAll.getPrcName());
newEsInspectReportFlowVO.setProcessAll(newProcessAll);
if (EsInspectRectifyCommon.OPERATION_TYPE_2.equals(processEsInspectReportVO.getOperationType())){
// 更新整改计划完成日期
enterpriseStandardInspectRectifyPlanService.update(
new LambdaUpdateWrapper<EnterpriseStandardInspectRectifyPlan>()
.eq(EnterpriseStandardInspectRectifyPlan::getId, processEsInspectReportVO.getInspectRectifyPlanId())
.set(EnterpriseStandardInspectRectifyPlan::getPlanCompleteDate, processEsInspectReportVO.getApplyDelayDate()));
// 整改计划
EnterpriseStandardInspectRectifyPlan enterpriseStandardInspectRectifyPlan = enterpriseStandardInspectRectifyPlanService.getById(processEsInspectReportVO.getInspectRectifyPlanId());
// 申请延期日期 <= 当前日期 立即生成新流程
if (processEsInspectReportVO.getApplyDelayDate().before(parse)
|| processEsInspectReportVO.getApplyDelayDate().equals(parse)){
// 生成新整改流程
EsInspectRectifyFlowVO newEsInspectReportFlowVO = new EsInspectRectifyFlowVO();
// 处理流程信息
ProcessAll newProcessAll = new ProcessAll();
newProcessAll.setProjectId(String.valueOf(SnowflakeUtils.snowflake()));
newProcessAll.setPrcName(processAll.getPrcName());
newEsInspectReportFlowVO.setProcessAll(newProcessAll);
// 处理流程审批信息
ProcessApprovalRecord newProcessApprovalRecord = new ProcessApprovalRecord();
newProcessApprovalRecord.setId(String.valueOf(SnowflakeUtils.snowflake()));
newProcessApprovalRecord.setProjectId(newProcessAll.getProjectId());
newProcessApprovalRecord.setUserId(enterpriseStandardInspectRectifyPlan.getResponseUser());
newEsInspectReportFlowVO.setProcessApprovalRecord(newProcessApprovalRecord);
// 整改计划
EnterpriseStandardInspectRectifyPlan enterpriseStandardInspectRectifyPlan =
enterpriseStandardInspectRectifyPlanService.getById(processEsInspectReportVO.getInspectRectifyPlanId());
// 处理业务表数据
ProcessEsInspectRectify processEsInspectRectify = new ProcessEsInspectRectify();
processEsInspectRectify.setId(String.valueOf(SnowflakeUtils.snowflake()));
processEsInspectRectify.setProjectId(newProcessAll.getProjectId());
processEsInspectRectify.setIsDelayCreate(YesOrNoEnum.NO.getValue());
processEsInspectRectify.setInspectRectifyPlanId(processEsInspectReportVO.getInspectRectifyPlanId());
newEsInspectReportFlowVO.setProcessEsInspectRectify(processEsInspectRectify);
processEsInspectRectifyService.save(processEsInspectRectify);
// 处理流程审批信息
ProcessApprovalRecord newProcessApprovalRecord = new ProcessApprovalRecord();
newProcessApprovalRecord.setId(String.valueOf(SnowflakeUtils.snowflake()));
newProcessApprovalRecord.setProjectId(newProcessAll.getProjectId());
newProcessApprovalRecord.setUserId(enterpriseStandardInspectRectifyPlan.getResponseUser());
newEsInspectReportFlowVO.setProcessApprovalRecord(newProcessApprovalRecord);
// 处理人员信息
Map<String, Object> newMap = new HashMap<>();
newMap.put("responsible", enterpriseStandardInspectRectifyPlan.getResponseUser());
newMap.put("leader", "请选择");
newMap.put("responsibleApproval", "请选择");
newEsInspectReportFlowVO.setMap(newMap);
createReportFlow(newEsInspectReportFlowVO);
// 处理业务表数据
ProcessEsInspectRectify processEsInspectRectify = new ProcessEsInspectRectify();
processEsInspectRectify.setId(String.valueOf(SnowflakeUtils.snowflake()));
processEsInspectRectify.setProjectId(newProcessAll.getProjectId());
processEsInspectRectify.setIsDelayCreate(YesOrNoEnum.NO.getValue());
processEsInspectRectify.setInspectRectifyPlanId(processEsInspectReportVO.getInspectRectifyPlanId());
newEsInspectReportFlowVO.setProcessEsInspectRectify(processEsInspectRectify);
processEsInspectRectifyService.save(processEsInspectRectify);
// 修改状态
processEsInspectRectifyService.update(
new LambdaUpdateWrapper<ProcessEsInspectRectify>()
.in(ProcessEsInspectRectify::getId, processEsInspectReportVO.getId())
.set(ProcessEsInspectRectify::getIsDelayCreate, YesOrNoEnum.YES.getValue()));
// 处理人员信息
Map<String, Object> newMap = new HashMap<>();
newMap.put("responsible", enterpriseStandardInspectRectifyPlan.getResponseUser());
newMap.put("leader", "请选择");
newMap.put("responsibleApproval", "请选择");
newEsInspectReportFlowVO.setMap(newMap);
createReportFlow(newEsInspectReportFlowVO);
// 修改状态
processEsInspectRectifyService.update(
new LambdaUpdateWrapper<ProcessEsInspectRectify>()
.in(ProcessEsInspectRectify::getId, processEsInspectReportVO.getId())
.set(ProcessEsInspectRectify::getIsDelayCreate, YesOrNoEnum.YES.getValue()));
}
}else {
// 更新整改状态
enterpriseStandardInspectRectifyPlanService.update(new LambdaUpdateWrapper<EnterpriseStandardInspectRectifyPlan>()