From c97b9582f040d3001c673fcddd17603444b4b31a Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期五, 25 七月 2025 14:54:43 +0800
Subject: [PATCH] 设备故障登记

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportAccidentsRegisterController.java |   20 +++++++++-
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentServiceImpl.java     |    2 
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportAccidentsRegister.java        |   76 +++++++++++++++++++-------------------
 3 files changed, 57 insertions(+), 41 deletions(-)

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 fa0e0d0..c979f73 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
@@ -154,50 +154,50 @@
     @DateTimeFormat(pattern="yyyy-MM-dd")
     @ApiModelProperty(value = "涓績涓讳换纭鏃堕棿")
     private Date centerDirectorTime;
-	/**缁翠慨寮�濮嬫椂闂�*/
-	@Excel(name = "缁翠慨寮�濮嬫椂闂�", width = 15, format = "yyyy-MM-dd")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+	/**缁翠慨宸ョ‘璁�*/
+	@Excel(name = "缁翠慨宸ョ‘璁�", width = 15)
+    @ApiModelProperty(value = "缁翠慨宸ョ‘璁�")
+    @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
+    private String repairConfirm;
+    /**缁翠慨寮�濮嬫椂闂�*/
+    @Excel(name = "缁翠慨寮�濮嬫椂闂�", width = 15, format = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern="yyyy-MM-dd")
     @ApiModelProperty(value = "缁翠慨寮�濮嬫椂闂�")
     private Date reportStartTime;
-	/**璁惧鐘舵��*/
-	@Excel(name = "璁惧鐘舵��", width = 15)
+    /**璁惧鐘舵��*/
+    @Excel(name = "璁惧鐘舵��", width = 15)
     @ApiModelProperty(value = "璁惧鐘舵��")
     private String equipmentStatus;
-	/**鍘熷洜鍒嗘瀽*/
-	@Excel(name = "鍘熷洜鍒嗘瀽", width = 15)
+    /**鍘熷洜鍒嗘瀽*/
+    @Excel(name = "鍘熷洜鍒嗘瀽", width = 15)
     @ApiModelProperty(value = "鍘熷洜鍒嗘瀽")
     private String causeAnalysis;
-	/**妫�鏌ョ粨鏋�*/
-	@Excel(name = "妫�鏌ョ粨鏋�", width = 15)
+    /**妫�鏌ョ粨鏋�*/
+    @Excel(name = "妫�鏌ョ粨鏋�", width = 15)
     @ApiModelProperty(value = "妫�鏌ョ粨鏋�")
     private String inspectionResults;
-	/**閲囧彇鎺柦*/
-	@Excel(name = "閲囧彇鎺柦", width = 15)
+    /**閲囧彇鎺柦*/
+    @Excel(name = "閲囧彇鎺柦", width = 15)
     @ApiModelProperty(value = "閲囧彇鎺柦")
     private String takeSteps;
-	/**寤鸿閲囧彇鎺柦*/
-	@Excel(name = "寤鸿閲囧彇鎺柦", width = 15)
+    /**寤鸿閲囧彇鎺柦*/
+    @Excel(name = "寤鸿閲囧彇鎺柦", width = 15)
     @ApiModelProperty(value = "寤鸿閲囧彇鎺柦")
     private String suggestionTakeSteps;
-	/**寤鸿閲囧彇鎺柦鏃堕棿*/
-	@Excel(name = "寤鸿閲囧彇鎺柦鏃堕棿", width = 15, format = "yyyy-MM-dd")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    /**寤鸿閲囧彇鎺柦鏃堕棿*/
+    @Excel(name = "寤鸿閲囧彇鎺柦鏃堕棿", width = 15, format = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern="yyyy-MM-dd")
     @ApiModelProperty(value = "寤鸿閲囧彇鎺柦鏃堕棿")
     private Date suggestionTakeStepsTime;
-	/**缁翠慨宸ョ‘璁�*/
-	@Excel(name = "缁翠慨宸ョ‘璁�", width = 15)
-    @ApiModelProperty(value = "缁翠慨纭")
-    @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
-    private String repairConfirm;
     /**缁翠慨宸ョ‘璁ょ粨鏋�*/
     @Excel(name = "缁翠慨宸ョ‘璁ょ粨鏋�", width = 15)
     @ApiModelProperty(value = "缁翠慨宸ョ‘璁ょ粨鏋�")
     private String repairConfirmResult;
 	/**缁翠慨宸ョ‘璁ゆ剰瑙�*/
 	@Excel(name = "缁翠慨宸ョ‘璁ゆ剰瑙�", width = 15)
-    @ApiModelProperty(value = "缁翠慨纭鎰忚")
+    @ApiModelProperty(value = "缁翠慨宸ョ‘璁ゆ剰瑙�")
     private String repairConfirmComment;
 	/**缁翠慨宸ョ‘璁ゆ椂闂�*/
 	@Excel(name = "缁翠慨宸ョ‘璁ゆ椂闂�", width = 15, format = "yyyy-MM-dd")
@@ -243,27 +243,27 @@
     @DateTimeFormat(pattern="yyyy-MM-dd")
     @ApiModelProperty(value = "缁翠慨缁勯暱(鍖洪暱)纭鏃堕棿")
     private Date repairDistrictTime;
-	/**鍘熷洜鍒嗘瀽鏍稿鍚屾剰銆佷笉鍚屾剰*/
-	@Excel(name = "鍘熷洜鍒嗘瀽鏍稿鍚屾剰銆佷笉鍚屾剰", width = 15)
-    @ApiModelProperty(value = "鍘熷洜鍒嗘瀽鏍稿鍚屾剰銆佷笉鍚屾剰")
-    private String checkAgree;
-	/**涓嶅悓鎰忓師鍥犲垎鏋�*/
-	@Excel(name = "涓嶅悓鎰忓師鍥犲垎鏋�", width = 15)
-    @ApiModelProperty(value = "涓嶅悓鎰忓師鍥犲垎鏋�")
-    private String disagreeReason;
-	/**鏁存敼鎺柦*/
-	@Excel(name = "鏁存敼鎺柦", width = 15)
-    @ApiModelProperty(value = "鏁存敼鎺柦")
-    private String rectificationMeasures;
-	/**浜嬫晠缁撹*/
-	@Excel(name = "浜嬫晠缁撹", width = 15)
-    @ApiModelProperty(value = "浜嬫晠缁撹")
-    private String accidentConclusion;
 	/**鎶�鏈礋璐d汉*/
 	@Excel(name = "鎶�鏈礋璐d汉", width = 15)
     @ApiModelProperty(value = "鎶�鏈礋璐d汉")
     @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
     private String technicalDirector;
+    /**鍘熷洜鍒嗘瀽鏍稿鍚屾剰銆佷笉鍚屾剰*/
+    @Excel(name = "鍘熷洜鍒嗘瀽鏍稿鍚屾剰銆佷笉鍚屾剰", width = 15)
+    @ApiModelProperty(value = "鍘熷洜鍒嗘瀽鏍稿鍚屾剰銆佷笉鍚屾剰")
+    private String checkAgree;
+    /**涓嶅悓鎰忓師鍥犲垎鏋�*/
+    @Excel(name = "涓嶅悓鎰忓師鍥犲垎鏋�", width = 15)
+    @ApiModelProperty(value = "涓嶅悓鎰忓師鍥犲垎鏋�")
+    private String disagreeReason;
+    /**鏁存敼鎺柦*/
+    @Excel(name = "鏁存敼鎺柦", width = 15)
+    @ApiModelProperty(value = "鏁存敼鎺柦")
+    private String rectificationMeasures;
+    /**浜嬫晠缁撹*/
+    @Excel(name = "浜嬫晠缁撹", width = 15)
+    @ApiModelProperty(value = "浜嬫晠缁撹")
+    private String accidentConclusion;
     /**鎶�鏈礋璐d汉纭鎰忚*/
     @Excel(name = "鎶�鏈礋璐d汉纭鎰忚", width = 15)
     @ApiModelProperty(value = "鎶�鏈礋璐d汉纭鎰忚")
diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentServiceImpl.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentServiceImpl.java
index 5dbd7b1..a5ad134 100644
--- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentServiceImpl.java
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentServiceImpl.java
@@ -62,7 +62,7 @@
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    @EquipmentHistoryLog(operationTag = EquipmentOperationTagEnum.ACCEPTANCE, businessTable = "eam_equipment")
+//    @EquipmentHistoryLog(operationTag = EquipmentOperationTagEnum.ACCEPTANCE, businessTable = "eam_equipment")
     public EamEquipment saveEquipment(EamEquipment eamEquipment) {
         if (eamEquipment == null) {
             return null;
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportAccidentsRegisterController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportAccidentsRegisterController.java
index 52f42da..87da014 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportAccidentsRegisterController.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportAccidentsRegisterController.java
@@ -11,10 +11,15 @@
 import javax.servlet.http.HttpServletResponse;
 
 import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.parser.Feature;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.TranslateDictTextUtils;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.eam.constant.BusinessCodeConst;
 import org.jeecg.modules.eam.dto.EamReportAccidentsRegisterDto;
@@ -63,6 +68,10 @@
 	private IEamReportAccidentsRegisterService eamReportAccidentsRegisterService;
 	@Autowired
 	private IEamReportRepairService eamReportRepairService;
+	 @Autowired
+	 private ObjectMapper objectMapper;
+	 @Autowired
+	 private TranslateDictTextUtils translateDictTextUtils;
 	/**
 	 * 鍒嗛〉鍒楄〃鏌ヨ
 	 *
@@ -217,7 +226,7 @@
 	//@AutoLog(value = "璁惧浜嬫晠鐧昏琛�-閫氳繃id鏌ヨ")
 	@ApiOperation(value="璁惧浜嬫晠鐧昏琛�-閫氳繃id鏌ヨ", notes="璁惧浜嬫晠鐧昏琛�-閫氳繃id鏌ヨ")
 	@GetMapping(value = "/queryById")
-	public Result<EamReportAccidentsRegister> queryById(@RequestParam(name="id",required=true) String id) {
+	public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
 		EamReportAccidentsRegister eamReportAccidentsRegister = eamReportAccidentsRegisterService.getById(id);
 		if(eamReportAccidentsRegister==null) {
 			return Result.error("鏈壘鍒板搴旀暟鎹�");
@@ -226,7 +235,14 @@
 		eamReportAccidentsRegister.setScrapPartNumber(eamReportRepair.getScrapPartNumber());
 		eamReportAccidentsRegister.setScrapPartValue(eamReportRepair.getScrapPartValue());
 		eamReportAccidentsRegister.setScrapPartQuantity(eamReportRepair.getScrapPartQuantity());
-		return Result.OK(eamReportAccidentsRegister);
+		try {
+			String json = objectMapper.writeValueAsString(eamReportAccidentsRegister);
+			JSONObject item = JSONObject.parseObject(json, Feature.OrderedField);
+			translateDictTextUtils.translateField("variableFactorsValue", eamReportAccidentsRegister.getVariableFactorsValue(), item, "variable_factors_value");
+			return Result.OK(item);
+		} catch (JsonProcessingException e) {
+			return Result.error("鏁版嵁杞瘧澶辫触锛�");
+		}
 	}
 
     /**

--
Gitblit v1.9.3