From 7c77e020b81e42fb65aa966742ff7c93e73668e1 Mon Sep 17 00:00:00 2001
From: cuikaidong <ckd2942379034@163.com>
Date: 星期一, 26 五月 2025 17:57:55 +0800
Subject: [PATCH] 设备调拨功能增加

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 50 insertions(+), 0 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 faf446f..f89bc51 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
@@ -148,4 +148,54 @@
         this.baseMapper.updateById(eamReportRepair);
         return true;
     }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    @EquipmentHistoryLog(operationTag = EquipmentOperationTagEnum.REPORT_REPAIR, businessTable = "eam_report_repair")
+    public EamReportRepair reportRepairFromSecondMaintenance(String equipmentId, String reportUser, List<EamSecondMaintenanceOrderDetail> detailList) {
+        StringBuilder sb = new StringBuilder();
+        detailList.forEach(detail -> {
+            sb.append(detail.getItemCode()).append("銆�");
+            sb.append(detail.getExceptionDescription()).append(";");
+        });
+        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.setFaultName("浜屼繚鎵ц鎶ヤ慨澶勭悊");
+        entity.setFaultDescription(sb.toString());
+        entity.setFaultType(CommonConstant.DEFAULT_1);
+        entity.setReportStatus(ReportRepairEnum.WAIT_REPAIR.name());
+        this.baseMapper.insert(entity);
+        //鏇存柊璁惧缁翠慨鐘舵��
+        eamEquipmentExtendService.updateEquipmentRepairStatus(entity.getEquipmentId(), EquipmentRepairStatus.WAIT_REPAIR.name());
+        return entity;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    @EquipmentHistoryLog(operationTag = EquipmentOperationTagEnum.REPORT_REPAIR, businessTable = "eam_report_repair")
+    public EamReportRepair reportRepairFromThirdMaintenance(String equipmentId, String reportUser, List<EamThirdMaintenanceOrderDetail> detailList) {
+        StringBuilder sb = new StringBuilder();
+        detailList.forEach(detail -> {
+            sb.append(detail.getItemCode()).append("銆�");
+            sb.append(detail.getExceptionDescription()).append(";");
+        });
+        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.setFaultName("涓変繚鎵ц鎶ヤ慨澶勭悊");
+        entity.setFaultDescription(sb.toString());
+        entity.setFaultType(CommonConstant.DEFAULT_1);
+        entity.setReportStatus(ReportRepairEnum.WAIT_REPAIR.name());
+        this.baseMapper.insert(entity);
+        //鏇存柊璁惧缁翠慨鐘舵��
+        eamEquipmentExtendService.updateEquipmentRepairStatus(entity.getEquipmentId(), EquipmentRepairStatus.WAIT_REPAIR.name());
+        return entity;
+    }
 }

--
Gitblit v1.9.3