Commit c2df9072 authored by 刘林's avatar 刘林

fix(jg):设计年限功能修改

parent f462a6cd
...@@ -132,6 +132,11 @@ ...@@ -132,6 +132,11 @@
jri.EQU_CATEGORY AS equCategoryCode, jri.EQU_CATEGORY AS equCategoryCode,
jri.EQU_DEFINE AS equDefineCode, jri.EQU_DEFINE AS equDefineCode,
jfi.PRODUCE_DATE AS produceDate, jfi.PRODUCE_DATE AS produceDate,
tjodslq.safety_assessment_name as safetyAssessmentName,
tjodslq.safety_assessment_credit_code as safetyAssessmentCreditCode,
tjodslq.safety_assessment_report as safetyAssessmentReport,
tjodslq.safety_assessment_result as safetyAssessmentResult,
tjodslq.safety_assessment_date as safetyAssessmentDate,
(SELECT SEQUENCE_NBR FROM idx_biz_jg_inspection_detection_info WHERE "RECORD" = jui."RECORD" ORDER BY INSPECT_DATE DESC LIMIT 1) jySeq, (SELECT SEQUENCE_NBR FROM idx_biz_jg_inspection_detection_info WHERE "RECORD" = jui."RECORD" ORDER BY INSPECT_DATE DESC LIMIT 1) jySeq,
(SELECT INSPECT_ORG_NAME FROM idx_biz_jg_inspection_detection_info WHERE "RECORD" = jui."RECORD" ORDER BY INSPECT_DATE DESC LIMIT 1) inspectOrgName, (SELECT INSPECT_ORG_NAME FROM idx_biz_jg_inspection_detection_info WHERE "RECORD" = jui."RECORD" ORDER BY INSPECT_DATE DESC LIMIT 1) inspectOrgName,
(SELECT INSPECT_ORG_CODE FROM idx_biz_jg_inspection_detection_info WHERE "RECORD" = jui."RECORD" ORDER BY INSPECT_DATE DESC LIMIT 1) inspectOrgCode, (SELECT INSPECT_ORG_CODE FROM idx_biz_jg_inspection_detection_info WHERE "RECORD" = jui."RECORD" ORDER BY INSPECT_DATE DESC LIMIT 1) inspectOrgCode,
...@@ -143,6 +148,7 @@ ...@@ -143,6 +148,7 @@
FROM idx_biz_jg_use_info jui FROM idx_biz_jg_use_info jui
LEFT JOIN idx_biz_jg_factory_info jfi ON jui.RECORD = jfi.RECORD LEFT JOIN idx_biz_jg_factory_info jfi ON jui.RECORD = jfi.RECORD
LEFT JOIN idx_biz_jg_register_info jri ON jui.RECORD = jri.RECORD LEFT JOIN idx_biz_jg_register_info jri ON jui.RECORD = jri.RECORD
LEFT JOIN tzs_jg_over_design_service_life_eq tjodslq ON jui.RECORD = tjodslq.equ_id
WHERE jui.record IN WHERE jui.record IN
<foreach collection="records" item="record" open="(" close=")" separator=","> <foreach collection="records" item="record" open="(" close=")" separator=",">
#{record} #{record}
......
...@@ -700,33 +700,47 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign ...@@ -700,33 +700,47 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
} }
private void updateDesignInfo(TaskV2Model taskV2Model, JgOverDesignServiceLife jgOverDesignServiceLife, List<Map<String, Object>> equipmentLists, List<IdxBizJgDesignInfo> designInfoList) { private void updateDesignInfo(TaskV2Model taskV2Model, JgOverDesignServiceLife jgOverDesignServiceLife, List<Map<String, Object>> equipmentLists, List<IdxBizJgDesignInfo> designInfoList) {
String equListCode = Objects.toString(equipmentLists.get(0).get("equListCode"), ""); // String equListCode = Objects.toString(equipmentLists.get(0).get("equListCode"), "");
ZoneId zoneId = ZoneId.systemDefault(); // ZoneId zoneId = ZoneId.systemDefault();
designInfoList.forEach(designInfo -> { designInfoList.forEach(designInfo -> {
List<IdxBizJgInspectionDetectionInfo> inspectionList = // List<IdxBizJgInspectionDetectionInfo> inspectionList =
iIdxBizJgInspectionDetectionInfoService.queryInspectionListByRecord(designInfo.getRecord()); // iIdxBizJgInspectionDetectionInfoService.queryInspectionListByRecord(designInfo.getRecord());
designInfo.setOverDesignRegNum(Math.min(designInfo.getOverDesignRegNum() + 1, 2)); designInfo.setOverDesignRegNum(Math.min(designInfo.getOverDesignRegNum() + 1, 2));
IdxBizJgInspectionDetectionInfo inspectionDetectionInfo = inspectionList.stream() designInfo.setDelayServiceLifeDate(jgOverDesignServiceLife.getExtendUseDeadline());
.filter(info -> "6000".equals(equListCode) || "WTJY".equals(info.getInspectType())) // IdxBizJgInspectionDetectionInfo inspectionDetectionInfo = inspectionList.stream()
.findFirst() // .filter(info -> "6000".equals(equListCode) || "WTJY".equals(info.getInspectType()))
.orElse(null); // .findFirst()
if (inspectionDetectionInfo != null) { // .orElse(null);
boolean is6000 = "6000".equals(equListCode); // if (inspectionDetectionInfo != null) {
Date targetDate = is6000 ? inspectionDetectionInfo.getInspectDate() : inspectionDetectionInfo.getNextInspectDate(); // boolean is6000 = "6000".equals(equListCode);
if (targetDate != null) { // Date targetDate = is6000 ? inspectionDetectionInfo.getInspectDate() : inspectionDetectionInfo.getNextInspectDate();
// 将 targetDate 转换为 Instant,再转换为 LocalDate,避免解析错误 // if (targetDate != null) {
String resultDate = targetDate.toInstant() // 将 Date 转换为 Instant // // 将 targetDate 转换为 Instant,再转换为 LocalDate,避免解析错误
.atZone(zoneId) // 转为 ZoneDateTime // String resultDate = targetDate.toInstant() // 将 Date 转换为 Instant
.toLocalDate() // 转为 LocalDate // .atZone(zoneId) // 转为 ZoneDateTime
.plusYears(is6000 ? 4 : 0) // 根据条件加上年份 // .toLocalDate() // 转为 LocalDate
.toString(); // 转换为 String 类型 // .plusYears(is6000 ? 4 : 0) // 根据条件加上年份
designInfo.setDelayServiceLifeDate(resultDate); // .toString(); // 转换为 String 类型
} // designInfo.setDelayServiceLifeDate(resultDate);
} // }
// }
idxBizJgDesignInfoServiceImpl.saveOrUpdateBatch(designInfoList);
this.saveResumeInfo(taskV2Model, jgOverDesignServiceLife, designInfo);
}); });
idxBizJgDesignInfoServiceImpl.saveOrUpdateBatch(designInfoList);
this.saveResumeInfo(taskV2Model, jgOverDesignServiceLife, designInfoList);
}
private void saveResumeInfo(TaskV2Model taskV2Model, JgOverDesignServiceLife jgOverDesignServiceLife, List<IdxBizJgDesignInfo> designInfoList) {
jgResumeInfoService.saveBatchResume(designInfoList.stream().map(eq-> JgResumeInfoDto.builder().applyNo(jgOverDesignServiceLife.getApplyNo())
.businessType(BusinessTypeEnum.JG_MAINTENANCE_NOTIFICATION.getName())
.businessId(String.valueOf(jgOverDesignServiceLife.getSequenceNbr()))
.equId(eq.getRecord())
.approvalUnit(jgOverDesignServiceLife.getReceiveOrgName())
.approvalUnitCode(jgOverDesignServiceLife.getReceiveCompanyCode())
.status("正常")
.changeContent(BusinessTypeEnum.JG_OVER_DESIGN_SERVICE_LIFE.getName() + "业务办理")
.routePath(taskV2Model.getRoutePath())
.build()).collect(Collectors.toList())
);
} }
/** /**
...@@ -763,19 +777,7 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign ...@@ -763,19 +777,7 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
} }
} }
private void saveResumeInfo(TaskV2Model taskV2Model, JgOverDesignServiceLife jgOverDesignServiceLife, IdxBizJgDesignInfo designInfo) {
jgResumeInfoService.createWithModel(JgResumeInfoDto.builder()
.applyNo(jgOverDesignServiceLife.getApplyNo())
.businessType(BusinessTypeEnum.JG_OVER_DESIGN_SERVICE_LIFE.getName())
.businessId(jgOverDesignServiceLife.getSequenceNbr() + "")
.equId(designInfo.getRecord())
.approvalUnit(jgOverDesignServiceLife.getReceiveOrgName())
.approvalUnitCode(jgOverDesignServiceLife.getReceiveCompanyCode())
.status("正常")
.changeContent(BusinessTypeEnum.JG_OVER_DESIGN_SERVICE_LIFE.getName() + "业务办理")
.routePath(taskV2Model.getRoutePath())
.build());
}
private void buildTask(JgOverDesignServiceLife jgOverDesignServiceLife, WorkflowResultDto workflowResultDto) { private void buildTask(JgOverDesignServiceLife jgOverDesignServiceLife, WorkflowResultDto workflowResultDto) {
// 代办消息 // 代办消息
...@@ -914,6 +916,7 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign ...@@ -914,6 +916,7 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
.collect(Collectors.toList())); .collect(Collectors.toList()));
commonService.convertStringToJsonobject(resultDataMap, new String[]{"otherAccessories"}); commonService.convertStringToJsonobject(resultDataMap, new String[]{"otherAccessories"});
commonService.convertStringToJsonobject(resultDataMap, new String[]{"useRegistrationFormFile"}); commonService.convertStringToJsonobject(resultDataMap, new String[]{"useRegistrationFormFile"});
commonService.convertStringToJsonobject(resultDataMap, new String[]{"safetyAssessmentReport"});
return resultDataMap; return resultDataMap;
} }
......
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