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 |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 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 826dec7..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,18 +143,18 @@
         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);
+        EamEquipmentFaultReason reason = eamEquipmentFaultReasonService.selectByFaultCode(BusinessCodeConst.EFR20250010);
         EamReportRepair entity = new EamReportRepair();
         entity.setEquipmentId(equipmentId);
         entity.setCreateBy(reportUser);
         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());
@@ -162,6 +163,8 @@
         this.baseMapper.insert(entity);
         //鏇存柊璁惧缁翠慨鐘舵��
         eamEquipmentExtendService.updateEquipmentRepairStatus(entity.getEquipmentId(), EquipmentRepairStatus.WAIT_REPAIR.name());
+        //鎺ㄩ�佷紒涓氬井淇℃秷鎭�
+        sendQywxTemplateCardMessage(entity);
         return entity;
     }
 
@@ -172,18 +175,18 @@
         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);
+        EamEquipmentFaultReason reason = eamEquipmentFaultReasonService.selectByFaultCode(BusinessCodeConst.EFR20250009);
         EamReportRepair entity = new EamReportRepair();
         entity.setEquipmentId(equipmentId);
         entity.setCreateBy(reportUser);
         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());
@@ -192,6 +195,8 @@
         this.baseMapper.insert(entity);
         //鏇存柊璁惧缁翠慨鐘舵��
         eamEquipmentExtendService.updateEquipmentRepairStatus(entity.getEquipmentId(), EquipmentRepairStatus.WAIT_REPAIR.name());
+        //鎺ㄩ�佷紒涓氬井淇℃秷鎭�
+        sendQywxTemplateCardMessage(entity);
         return entity;
     }
 
@@ -199,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