Commit 0e62989e authored by Rensq's avatar Rensq

优化危险作业暂存逻辑

parent fb4d4f5f
...@@ -64,17 +64,9 @@ import org.apache.poi.xwpf.usermodel.Document; ...@@ -64,17 +64,9 @@ import org.apache.poi.xwpf.usermodel.Document;
import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFPictureData; import org.apache.poi.xwpf.usermodel.XWPFPictureData;
import org.apache.xmlbeans.XmlOptions; import org.apache.xmlbeans.XmlOptions;
import org.flowable.bpmn.model.BpmnModel;
import org.flowable.bpmn.model.EndEvent;
import org.flowable.bpmn.model.Process;
import org.flowable.common.engine.api.FlowableObjectNotFoundException; import org.flowable.common.engine.api.FlowableObjectNotFoundException;
import org.flowable.common.engine.impl.identity.Authentication;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.RuntimeService; import org.flowable.engine.RuntimeService;
import org.flowable.engine.TaskService;
import org.flowable.engine.runtime.Execution;
import org.flowable.engine.runtime.ProcessInstance; import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.task.api.Task;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBody; import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBody;
import org.quartz.*; import org.quartz.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -616,8 +608,9 @@ public class THazardWorkPlanServiceImpl extends SuperServiceImpl<THazardWorkPlan ...@@ -616,8 +608,9 @@ public class THazardWorkPlanServiceImpl extends SuperServiceImpl<THazardWorkPlan
List<THazardAssessment> tHazardAssessments = tHazardAssessmentService.list(new QueryWrapper<THazardAssessment>().eq(THazardAssessment.PLAN_ID, tHazardWorkPlan.getId()) List<THazardAssessment> tHazardAssessments = tHazardAssessmentService.list(new QueryWrapper<THazardAssessment>().eq(THazardAssessment.PLAN_ID, tHazardWorkPlan.getId())
.isNotNull(THazardAssessment.PARTICIPANT_SIGNATURE) .isNotNull(THazardAssessment.PARTICIPANT_SIGNATURE)
.isNotNull(THazardAssessment.WORK_SITE_RESPONSIBLE_SIGNATURE) .isNotNull(THazardAssessment.WORK_SITE_RESPONSIBLE_SIGNATURE)
.ne(THazardAssessment.PARTICIPANT_SIGNATURE, "") //todo 生产环境数据库设置了 ora_input_emptystr_isnull 为on 去除空字符校验
.ne(THazardAssessment.WORK_SITE_RESPONSIBLE_SIGNATURE, "") //.ne(THazardAssessment.PARTICIPANT_SIGNATURE, "")
//.ne(THazardAssessment.WORK_SITE_RESPONSIBLE_SIGNATURE, "")
); );
log.info("危险作业流程--workProcessValidation---tHazardAssessments:{}", JSON.toJSONString(tHazardAssessments)); log.info("危险作业流程--workProcessValidation---tHazardAssessments:{}", JSON.toJSONString(tHazardAssessments));
...@@ -628,11 +621,11 @@ public class THazardWorkPlanServiceImpl extends SuperServiceImpl<THazardWorkPlan ...@@ -628,11 +621,11 @@ public class THazardWorkPlanServiceImpl extends SuperServiceImpl<THazardWorkPlan
} }
//如果为条件确认 //如果为条件确认
else if (workStatus.equals(WorkPlanStatusEnum.CONDITION_CONFIRMATION.getValue())) { else if (workStatus.equals(WorkPlanStatusEnum.CONDITION_CONFIRMATION.getValue())) {
List<String> dangeWorkType = sysDictDataService.getDictIdsByParentKeyAndType(WorkTypeEnum.ENTRY_EXIT_WAREHOUSE.getValue(), "dange_work_type"); List<String> dangeWorkTypes = sysDictDataService.getDictIdsByParentKeyAndType(WorkTypeEnum.ENTRY_EXIT_WAREHOUSE.getValue(), "dange_work_type");
//添加熏蒸作业 //添加熏蒸作业
SysDictData sysDictData = sysDictDataService.getDictByTypeAndValue("dange_work_type", WorkTypeEnum.FUMIGATION_WORK.getValue()); String dangeWorkType = sysDictDataService.getDictIdByKey("dange_work_type", WorkTypeEnum.FUMIGATION_WORK.getValue());
if (sysDictData != null) { if (StringUtils.isNotBlank(dangeWorkType)) {
dangeWorkType.add(sysDictData.getDictDataId()); dangeWorkTypes.add(dangeWorkType);
} }
//判断当前是否为 较大和高风险 //判断当前是否为 较大和高风险
boolean isHighRisk = WorkLevelEnum.MEDIUM_RISK.getValue().equals(escalatedLevelValue) || WorkLevelEnum.HIGH_RISK.getValue().equals(escalatedLevelValue); boolean isHighRisk = WorkLevelEnum.MEDIUM_RISK.getValue().equals(escalatedLevelValue) || WorkLevelEnum.HIGH_RISK.getValue().equals(escalatedLevelValue);
...@@ -640,15 +633,15 @@ public class THazardWorkPlanServiceImpl extends SuperServiceImpl<THazardWorkPlan ...@@ -640,15 +633,15 @@ public class THazardWorkPlanServiceImpl extends SuperServiceImpl<THazardWorkPlan
List<THazardConditionConfirmation> tHazardConditionConfirmations = tHazardConditionConfirmationService.list(new QueryWrapper<THazardConditionConfirmation>().eq(THazardConditionConfirmation.PLAN_ID, tHazardWorkPlan.getId()) List<THazardConditionConfirmation> tHazardConditionConfirmations = tHazardConditionConfirmationService.list(new QueryWrapper<THazardConditionConfirmation>().eq(THazardConditionConfirmation.PLAN_ID, tHazardWorkPlan.getId())
.eq(THazardConditionConfirmation.BATCH, tHazardWorkPlan.getBatch()) .eq(THazardConditionConfirmation.BATCH, tHazardWorkPlan.getBatch())
.and(wrapper -> { .and(wrapper -> {
wrapper.in(THazardConditionConfirmation.WORK_TYPE_ID, dangeWorkType) //如果是进出仓 wrapper.in(THazardConditionConfirmation.WORK_TYPE_ID, dangeWorkTypes) //如果是进出仓
.isNotNull(THazardConditionConfirmation.WORK_SITE_RESPONSIBLE_SIGNATURE) //作业现场负责人不能为空 .isNotNull(THazardConditionConfirmation.WORK_SITE_RESPONSIBLE_SIGNATURE) //作业现场负责人不能为空
.ne(THazardConditionConfirmation.WORK_SITE_RESPONSIBLE_SIGNATURE, "") //.ne(THazardConditionConfirmation.WORK_SITE_RESPONSIBLE_SIGNATURE, "")
.or() .or()
.notIn(THazardConditionConfirmation.WORK_TYPE_ID, dangeWorkType) //如果不为进出仓 .notIn(THazardConditionConfirmation.WORK_TYPE_ID, dangeWorkTypes) //如果不为进出仓
.isNotNull(isHighRisk, THazardConditionConfirmation.DEPARTMENT_SIGNATURE) //安全管理部门不能为空 .isNotNull(isHighRisk, THazardConditionConfirmation.DEPARTMENT_SIGNATURE) //安全管理部门不能为空
.ne(isHighRisk, THazardConditionConfirmation.DEPARTMENT_SIGNATURE, "") //.ne(isHighRisk, THazardConditionConfirmation.DEPARTMENT_SIGNATURE, "")
.isNotNull(THazardConditionConfirmation.WORK_SITE_RESPONSIBLE_SIGNATURE) //作业现场负责人不能为空 .isNotNull(THazardConditionConfirmation.WORK_SITE_RESPONSIBLE_SIGNATURE); //作业现场负责人不能为空
.ne(THazardConditionConfirmation.WORK_SITE_RESPONSIBLE_SIGNATURE, ""); //.ne(THazardConditionConfirmation.WORK_SITE_RESPONSIBLE_SIGNATURE, "");
}) })
); );
if (tHazardConditionConfirmations.size() < workTypesArrayLength) { if (tHazardConditionConfirmations.size() < workTypesArrayLength) {
...@@ -662,8 +655,8 @@ public class THazardWorkPlanServiceImpl extends SuperServiceImpl<THazardWorkPlan ...@@ -662,8 +655,8 @@ public class THazardWorkPlanServiceImpl extends SuperServiceImpl<THazardWorkPlan
.eq(THazardDisclosure.BATH, tHazardWorkPlan.getBatch()) .eq(THazardDisclosure.BATH, tHazardWorkPlan.getBatch())
.isNotNull(THazardDisclosure.DISCLOSURE_PERSON_SIGN) .isNotNull(THazardDisclosure.DISCLOSURE_PERSON_SIGN)
.isNotNull(THazardDisclosure.RECIPIENT_SIGNATURE) .isNotNull(THazardDisclosure.RECIPIENT_SIGNATURE)
.ne(THazardDisclosure.DISCLOSURE_PERSON_SIGN, "") //.ne(THazardDisclosure.DISCLOSURE_PERSON_SIGN, "")
.ne(THazardDisclosure.RECIPIENT_SIGNATURE, "") //.ne(THazardDisclosure.RECIPIENT_SIGNATURE, "")
); );
if (tHazardTechnicalDisclosures.size() < workTypesArrayLength) { if (tHazardTechnicalDisclosures.size() < workTypesArrayLength) {
throw new ServiceException(new ResponseInfo(200, "涉及其他类型的技术交底未签字[serviceError]")); throw new ServiceException(new ResponseInfo(200, "涉及其他类型的技术交底未签字[serviceError]"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment