From 35f7901210de45eefaa58b38db23405c561f9484 Mon Sep 17 00:00:00 2001 From: zhangherong <571457620@qq.com> Date: 星期五, 22 八月 2025 11:29:38 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java index 210b5d3..ef674b6 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java @@ -11,6 +11,7 @@ import org.jeecg.common.api.vo.FileUploadResult; import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.DataBaseConstant; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.util.oConvertUtils; import org.jeecg.modules.eam.aspect.annotation.EquipmentHistoryLog; @@ -142,7 +143,7 @@ StringBuilder sb = new StringBuilder(); detailList.forEach(detail -> { sb.append(detail.getItemCode()).append("銆�"); - sb.append(detail.getExceptionDescription()).append(";"); + sb.append(detail.getExceptionDescription()).append("; "); }); EamEquipmentFaultReason reason = eamEquipmentFaultReasonService.selectByFaultCode(BusinessCodeConst.EFR20250010); EamReportRepair entity = new EamReportRepair(); @@ -151,9 +152,9 @@ entity.setFaultStartTime(new Date()); entity.setBreakdownFlag(CommonConstant.DEFAULT_0); entity.setDelFlag(CommonConstant.DEL_FLAG_0); + entity.setFaultDescription(sb.toString()); if(reason == null){ entity.setFaultName("鍛ㄤ繚鎵ц鎶ヤ慨澶勭悊"); - entity.setFaultDescription(sb.toString()); }else { entity.setFaultName(reason.getFaultName()); entity.setFaultType(reason.getFaultCategory()); @@ -174,7 +175,7 @@ StringBuilder sb = new StringBuilder(); detailList.forEach(detail -> { sb.append(detail.getItemCode()).append("銆�"); - sb.append(detail.getExceptionDescription()).append(";"); + sb.append(detail.getExceptionDescription()).append("; "); }); EamEquipmentFaultReason reason = eamEquipmentFaultReasonService.selectByFaultCode(BusinessCodeConst.EFR20250009); EamReportRepair entity = new EamReportRepair(); @@ -183,9 +184,9 @@ entity.setFaultStartTime(new Date()); entity.setBreakdownFlag(CommonConstant.DEFAULT_0); entity.setDelFlag(CommonConstant.DEL_FLAG_0); + entity.setFaultDescription(sb.toString()); if(reason == null){ entity.setFaultName("鐐规鎵ц鎶ヤ慨澶勭悊"); - entity.setFaultDescription(sb.toString()); }else { entity.setFaultName(reason.getFaultName()); entity.setFaultType(reason.getFaultCategory()); @@ -203,6 +204,10 @@ @Transactional(rollbackFor = Exception.class) @EquipmentHistoryLog(operationTag = EquipmentOperationTagEnum.REPORT_REPAIR, businessTable = "eam_report_repair") public EamReportRepair add(EamReportRepair eamReportRepair) { + EamEquipment equipment = eamEquipmentService.getById(eamReportRepair.getEquipmentId()); + if (equipment == null) { + throw new JeecgBootException("璁惧涓嶅瓨鍦紝璇锋鏌ワ紒"); + } eamReportRepair.setReportStatus(ReportRepairEnum.WAIT_REPAIR.name()); eamReportRepair.setDelFlag(CommonConstant.DEL_FLAG_0); // 闄勪欢澶勭悊 -- Gitblit v1.9.3