From 0bc74278ff8130936bc7aed763e8901fedb4f3b0 Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期五, 01 八月 2025 11:44:49 +0800
Subject: [PATCH] 故障报修新增hf编码

---
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportProductHazardsDto.java             |    4 ++
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamSecondMaintenanceOrderServiceImpl.java |    2 +
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/HfTemplateCategoryEnum.java            |    3 +
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/IEamBaseHFCodeService.java              |    2 -
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamReportProductHazardsQuery.java       |    4 ++
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java    |   18 +++++++++
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportAccidentsRegisterDto.java          |    4 ++
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamReportAccidentsRegisterQuery.java    |    4 ++
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportAccidentsRegister.java          |    4 ++
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportProductHazards.java             |    4 ++
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/mapper/xml/EamBaseHFCodeMapper.xml              |    0 
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportThreeNoSpare.java               |    4 ++
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamReportThreeNoSpareQuery.java         |    4 ++
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamBaseHFCodeServiceImpl.java      |    0 
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/mapper/EamBaseHFCodeMapper.java                 |    3 -
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportThreeNoSpareDto.java               |    4 ++
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamBaseHFCode.java                       |    0 
 17 files changed, 59 insertions(+), 5 deletions(-)

diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/HfTemplateCategoryEnum.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/HfTemplateCategoryEnum.java
index c4e0062..2fa63c4 100644
--- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/HfTemplateCategoryEnum.java
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/HfTemplateCategoryEnum.java
@@ -15,5 +15,8 @@
     TECHNICAL_STATUS_CHANGE, //鎶�鏈姸鎬佸彉鏇寸敵璇�
     TECHNICAL_STATUS_EVALUATION_APPLY, //鎶�鏈姸鎬侀壌瀹氱敵璇�
     TECHNICAL_STATUS_DEACTIVATE, //鍋滅敤鍔犲伐璁惧鐢宠鍗�
+    REPORT_ACCIDENTS_REGISTER, //璁惧浜嬫晠鐧昏琛�
+    REPORT_PRODUCT_HAZARDS, //浜у搧瀹夊叏闅愭偅纭
+    REPORT_THREE_NO_SPARE //涓変笉鏀捐繃鍘熷垯琛�
     ;
 }
diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportAccidentsRegisterDto.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportAccidentsRegisterDto.java
index 10fb8df..5a72396 100644
--- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportAccidentsRegisterDto.java
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportAccidentsRegisterDto.java
@@ -61,6 +61,10 @@
     @Excel(name = "璁惧ID", width = 15)
     @ApiModelProperty(value = "璁惧ID")
     private String equipmentId;
+    /**HF缂栫爜*/
+    @Excel(name = "HF缂栫爜", width = 15)
+    @ApiModelProperty(value = "HF缂栫爜")
+    private String hfCode;
     /**鐧昏鐘舵��*/
     @ApiModelProperty(value = "鐧昏鐘舵��")
     @Dict(dicCode = "eam_report_accidents_register_status")
diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportProductHazardsDto.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportProductHazardsDto.java
index 996fee1..c031d6f 100644
--- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportProductHazardsDto.java
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportProductHazardsDto.java
@@ -57,6 +57,10 @@
 	@Excel(name = "璁惧ID", width = 15)
     @ApiModelProperty(value = "璁惧ID")
     private String equipmentId;
+    /**HF缂栫爜*/
+    @Excel(name = "HF缂栫爜", width = 15)
+    @ApiModelProperty(value = "HF缂栫爜")
+    private String hfCode;
 	/**鎿嶄綔宸�*/
 	@Excel(name = "鎿嶄綔宸�", width = 15)
     @ApiModelProperty(value = "鎿嶄綔宸�")
diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportThreeNoSpareDto.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportThreeNoSpareDto.java
index 7aae2a1..9b392e4 100644
--- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportThreeNoSpareDto.java
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportThreeNoSpareDto.java
@@ -64,6 +64,10 @@
 	@Excel(name = "璁惧ID", width = 15)
     @ApiModelProperty(value = "璁惧ID")
     private String equipmentId;
+    /**HF缂栫爜*/
+    @Excel(name = "HF缂栫爜", width = 15)
+    @ApiModelProperty(value = "HF缂栫爜")
+    private String hfCode;
     /**鎻愪氦鐘舵��*/
     @Excel(name = "鎻愪氦鐘舵��", width = 15)
     @ApiModelProperty(value = "鎻愪氦鐘舵��")
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamBaseHFCode.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamBaseHFCode.java
similarity index 100%
rename from lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamBaseHFCode.java
rename to lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamBaseHFCode.java
diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportAccidentsRegister.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportAccidentsRegister.java
index 6fb4091..f0a591f 100644
--- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportAccidentsRegister.java
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportAccidentsRegister.java
@@ -105,6 +105,10 @@
 	@Excel(name = "閫犳垚缁撴灉", width = 15)
     @ApiModelProperty(value = "閫犳垚缁撴灉")
     private String causingResults;
+    /**HF缂栫爜*/
+    @Excel(name = "HF缂栫爜", width = 15)
+    @ApiModelProperty(value = "HF缂栫爜")
+    private String hfCode;
 	/**鎿嶄綔宸�*/
 	@Excel(name = "鎿嶄綔宸�", width = 15)
     @ApiModelProperty(value = "鎿嶄綔宸�")
diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportProductHazards.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportProductHazards.java
index 80967e0..b3c75ea 100644
--- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportProductHazards.java
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportProductHazards.java
@@ -122,6 +122,10 @@
     @Excel(name = "閮ㄧ骇棰嗗纭缁撴灉", width = 15)
     @ApiModelProperty(value = "閮ㄧ骇棰嗗纭缁撴灉")
     private String deputyDepartmentResult;
+    /**HF缂栫爜*/
+    @Excel(name = "HF缂栫爜", width = 15)
+    @ApiModelProperty(value = "HF缂栫爜")
+    private String hfCode;
     //鍒楄〃灞曠ず
     @TableField(exist = false)
     private String equipmentCode;
diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportThreeNoSpare.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportThreeNoSpare.java
index 8e57471..0ef550b 100644
--- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportThreeNoSpare.java
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportThreeNoSpare.java
@@ -130,4 +130,8 @@
     @Excel(name = "閫犳垚缁撴灉", width = 15)
     @ApiModelProperty(value = "閫犳垚缁撴灉")
     private transient String causingResults;
+    /**HF缂栫爜*/
+    @Excel(name = "HF缂栫爜", width = 15)
+    @ApiModelProperty(value = "HF缂栫爜")
+    private String hfCode;
 }
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamBaseHFCodeMapper.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/mapper/EamBaseHFCodeMapper.java
similarity index 82%
rename from lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamBaseHFCodeMapper.java
rename to lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/mapper/EamBaseHFCodeMapper.java
index 85b108d..0a0045c 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamBaseHFCodeMapper.java
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/mapper/EamBaseHFCodeMapper.java
@@ -1,8 +1,5 @@
 package org.jeecg.modules.eam.mapper;
 
-import java.util.List;
-
-import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.eam.entity.EamBaseHFCode;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamBaseHFCodeMapper.xml b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/mapper/xml/EamBaseHFCodeMapper.xml
similarity index 100%
rename from lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamBaseHFCodeMapper.xml
rename to lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/mapper/xml/EamBaseHFCodeMapper.xml
diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamReportAccidentsRegisterQuery.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamReportAccidentsRegisterQuery.java
index 820190d..08daba8 100644
--- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamReportAccidentsRegisterQuery.java
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamReportAccidentsRegisterQuery.java
@@ -54,6 +54,10 @@
     @Excel(name = "璁惧ID", width = 15)
     @ApiModelProperty(value = "璁惧ID")
     private String equipmentId;
+    /**HF缂栫爜*/
+    @Excel(name = "HF缂栫爜", width = 15)
+    @ApiModelProperty(value = "HF缂栫爜")
+    private String hfCode;
     /**鐧昏鐘舵��*/
     @ApiModelProperty(value = "鐧昏鐘舵��")
     @Dict(dicCode = "eam_report_accidents_register_status")
diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamReportProductHazardsQuery.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamReportProductHazardsQuery.java
index dd2a481..b4e32d3 100644
--- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamReportProductHazardsQuery.java
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamReportProductHazardsQuery.java
@@ -61,6 +61,10 @@
     @Excel(name = "璁惧ID", width = 15)
     @ApiModelProperty(value = "璁惧ID")
     private String equipmentId;
+    /**HF缂栫爜*/
+    @Excel(name = "HF缂栫爜", width = 15)
+    @ApiModelProperty(value = "HF缂栫爜")
+    private String hfCode;
     /**纭鐘舵��*/
     @Excel(name = "纭鐘舵��", width = 15)
     @ApiModelProperty(value = "纭鐘舵��")
diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamReportThreeNoSpareQuery.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamReportThreeNoSpareQuery.java
index ccd7df6..2b63334 100644
--- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamReportThreeNoSpareQuery.java
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamReportThreeNoSpareQuery.java
@@ -56,6 +56,10 @@
     @Excel(name = "璁惧ID", width = 15)
     @ApiModelProperty(value = "璁惧ID")
     private String equipmentId;
+    /**HF缂栫爜*/
+    @Excel(name = "HF缂栫爜", width = 15)
+    @ApiModelProperty(value = "HF缂栫爜")
+    private String hfCode;
     /**鎻愪氦鐘舵��*/
     @Excel(name = "鎻愪氦鐘舵��", width = 15)
     @ApiModelProperty(value = "鎻愪氦鐘舵��")
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamBaseHFCodeService.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/IEamBaseHFCodeService.java
similarity index 96%
rename from lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamBaseHFCodeService.java
rename to lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/IEamBaseHFCodeService.java
index 659db5d..6eacf53 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamBaseHFCodeService.java
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/IEamBaseHFCodeService.java
@@ -3,8 +3,6 @@
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.eam.entity.EamBaseHFCode;
 
-import javax.validation.Valid;
-
 /**
  * @Description: HFCode缁存姢
  * @Author: jeecg-boot
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamBaseHFCodeServiceImpl.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamBaseHFCodeServiceImpl.java
similarity index 100%
rename from lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamBaseHFCodeServiceImpl.java
rename to lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamBaseHFCodeServiceImpl.java
diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java
index d91513b..c2a3a21 100644
--- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java
@@ -12,6 +12,7 @@
 import org.apache.shiro.SecurityUtils;
 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;
@@ -65,6 +66,8 @@
     private ISysBusinessCodeRuleService businessCodeRuleService;
     @Autowired
     private IEamReportThreeNoSpareService eamReportThreeNoSpareService;
+    @Autowired
+    private IEamBaseHFCodeService hfCodeService;
     /**
      * 鍒嗛〉鍒楄〃
      *
@@ -201,6 +204,11 @@
             eamReportProductHazards.setReportId(eamReportRepair.getId());
             eamReportProductHazards.setDelFlag(Integer.valueOf(CommonConstant.DEFAULT_0));
             eamReportProductHazards.setConfirmStatus(EamReportProductHazardsEnum.PENDING_SUBMIT.name());
+            EamBaseHFCode eamBaseHFCode = hfCodeService.selectByCategory(HfTemplateCategoryEnum.REPORT_PRODUCT_HAZARDS.name());
+            if (eamBaseHFCode == null) {
+                throw new JeecgBootException("鏈厤缃骇鍝佸畨鍏ㄩ殣鎮g‘璁ょ殑HF缂栫爜锛屾坊鍔犲け璐ワ紒");
+            }
+            eamReportProductHazards.setHfCode(eamBaseHFCode.getHfCode());
             iEamReportProductHazardsService.save(eamReportProductHazards);
         }
         if (StrUtil.isNotEmpty(eamReportRepair.getIsAccidentsRegister())&&("1").equals(eamReportRepair.getIsAccidentsRegister())) {
@@ -211,6 +219,11 @@
             eamReportAccidentsRegister.setReportId(eamReportRepair.getId());
             eamReportAccidentsRegister.setDelFlag(Integer.valueOf(CommonConstant.DEFAULT_0));
             eamReportAccidentsRegister.setRegisterStatus(EamReportAccidentsRegisterEnum.PENDING_SUBMIT.name());
+            EamBaseHFCode eamBaseHFCode = hfCodeService.selectByCategory(HfTemplateCategoryEnum.REPORT_ACCIDENTS_REGISTER.name());
+            if (eamBaseHFCode == null) {
+                throw new JeecgBootException("鏈厤缃澶囦簨鏁呯櫥璁拌〃鐨凥F缂栫爜锛屾坊鍔犲け璐ワ紒");
+            }
+            eamReportAccidentsRegister.setHfCode(eamBaseHFCode.getHfCode());
             iEamReportAccidentsRegisterService.save(eamReportAccidentsRegister);
             //鐢熸垚涓変笉鍘熷垯
             EamReportThreeNoSpare eamReportThreeNoSpare = new EamReportThreeNoSpare();
@@ -220,6 +233,11 @@
             eamReportThreeNoSpare.setPreventionMeasures(eamReportAccidentsRegister.getTakeSteps());
             eamReportThreeNoSpare.setSubmitStatus(EamReportThreeNoSpareEnum.PENDING_SUBMIT.name());
             eamReportThreeNoSpare.setDelFlag(Integer.valueOf(CommonConstant.DEFAULT_0));
+            EamBaseHFCode threeHfCode = hfCodeService.selectByCategory(HfTemplateCategoryEnum.REPORT_THREE_NO_SPARE.name());
+            if (threeHfCode == null) {
+                throw new JeecgBootException("鏈厤缃笁涓嶆斁杩囧師鍒欒〃鐨凥F缂栫爜锛屾坊鍔犲け璐ワ紒");
+            }
+            eamReportThreeNoSpare.setHfCode(threeHfCode.getHfCode());
             eamReportThreeNoSpareService.save(eamReportThreeNoSpare);
         }
         //鐢熸垚缁翠慨宸ュ崟
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamSecondMaintenanceOrderServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamSecondMaintenanceOrderServiceImpl.java
index 8faaf0a..a24b234 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamSecondMaintenanceOrderServiceImpl.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamSecondMaintenanceOrderServiceImpl.java
@@ -392,6 +392,7 @@
                             EamSecondMaintenanceOrderDetail eamMaintenanceStandardDetail=new EamSecondMaintenanceOrderDetail();
                             BeanUtils.copyProperties(tableDetail, eamMaintenanceStandardDetail);
                             eamMaintenanceStandardDetail.setOrderId(entity.getId());
+                            eamMaintenanceStandardDetail.setCreateBy(user.getUsername());
                             addList.add(eamMaintenanceStandardDetail);
                         });
                         secondMaintenanceOrderDetailService.saveBatch(addList);
@@ -414,6 +415,7 @@
                             EamSecondMaintenanceOrderDetail eamMaintenanceStandardDetail=new EamSecondMaintenanceOrderDetail();
                             BeanUtils.copyProperties(tableDetail, eamMaintenanceStandardDetail);
                             eamMaintenanceStandardDetail.setOrderId(entity.getId());
+                            eamMaintenanceStandardDetail.setCreateBy(user.getUsername());
                             addList.add(eamMaintenanceStandardDetail);
                         });
                         secondMaintenanceOrderDetailService.saveBatch(addList);

--
Gitblit v1.9.3