From 8c2a5e73b08cddfee3fac4b6e9bf7c70245bcba7 Mon Sep 17 00:00:00 2001
From: “linengliang” <vanSuperEnergy@163.com>
Date: 星期三, 08 十一月 2023 14:15:21 +0800
Subject: [PATCH] 设备台账导入优化

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamEquipmentMapper.xml      |    2 +-
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java |   27 ++++++++++++++++-----------
 2 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java
index cdedcbf..82adf2e 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java
@@ -571,6 +571,8 @@
 					 String manageId = equipmentImportVo.getManageId();
 					 String constructorId = equipmentImportVo.getConstructorId();
 					 String teamId = equipmentImportVo.getTeamId();
+					 String propertyStatus = equipmentImportVo.getPropertyStatus();
+					 String abc = equipmentImportVo.getEquipmentImportanceId();
                      if(StringUtils.isBlank(equipmentImportVo.getNum())){
 						 exceptionInfo = exceptionInfo+"绗�"+(i+2)+"琛屽鍏ュけ璐�,鍘熷洜:缁熶竴缂栫爜缂哄け,璇峰~鍐欏繀濉」鍚庡啀瀵煎叆;";
 						 exceptionNum++;
@@ -681,7 +683,7 @@
 //					 }
 					 else{
 						 SysDepart use = departService.getOne(new QueryWrapper<SysDepart>().eq("depart_name",useId.trim()),false);
-						 if(ObjectUtils.isNull(useId)){
+						 if(ObjectUtils.isNotNull(use)){
 							 equipment.setUseId(use.getId());
 						 }else {
 							 exceptionInfo = exceptionInfo+"绗�"+(i+2)+"琛屽鍏ュけ璐�,鍘熷洜:涓嶅瓨鍦ㄨ浣跨敤閮ㄩ棬,璇风淮鎶ら儴闂ㄦ暟鎹悗鍐嶅鍏�;";
@@ -739,13 +741,14 @@
 							 	equipment.setConstructorId(constructor.getId());
 							 }
 						 }
-                         if(equipmentImportVo.getPropertyStatus().equals("warranty")){
+                         if(StringUtils.isNotBlank(propertyStatus)&&propertyStatus.equals("warranty")){
 							 if(
 							 		ObjectUtils.isNull(equipmentImportVo.getWarrantyStart())
 									 ||ObjectUtils.isNull(equipmentImportVo.getWarrantyEnd())
 							 ){
 								 exceptionInfo = exceptionInfo+"绗�"+(i+2)+"琛屽鍏ュけ璐�,鍘熷洜:璇ヨ澶囧浜庤川淇濇湡锛岃川淇濅俊鎭己澶憋紝璇峰厛缁存姢璐ㄤ繚寮�濮嬫椂闂存垨缁撴潫鏃堕棿;";
 								 exceptionNum++;
+								 continue;
 							 }
 
 						 }else{
@@ -797,16 +800,18 @@
 										 &&!equipmentCategory.getEquipmentCategoryUda1().equals("filesCarousel")
 										 &&!equipmentCategory.getEquipmentCategoryUda1().equals("tester")
 								 ){
-								 	if(equipmentImportVo.getEquipmentImportanceId().equals("A")){
-										equipment.setCheckPeriod(365*3+"");
+								 	if(StringUtils.isNotBlank(abc)){
+										if(abc.equals("A")){
+											equipment.setCheckPeriod(365*3+"");
+										}
+										if(
+												abc.equals("B")
+														||abc.equals("C")
+														||abc.equals("D")
+										){
+											equipment.setCheckPeriod(365*4+"");
+										}
 									}
-								 	if(
-								 			equipmentImportVo.getEquipmentImportanceId().equals("B")
-											||equipmentImportVo.getEquipmentImportanceId().equals("C")
-											||equipmentImportVo.getEquipmentImportanceId().equals("D")
-									){
-										 equipment.setCheckPeriod(365*4+"");
-								 	}
 								 }
 								 equipmentService.save(equipment);
 							 }else {
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamEquipmentMapper.xml b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamEquipmentMapper.xml
index 16d4a2e..42a6cb7 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamEquipmentMapper.xml
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamEquipmentMapper.xml
@@ -256,7 +256,7 @@
             and t1.num like concat('%',#{num},'%')
         </if>
         <if test="name != null and name != ''">
-            and t1.num like concat('%',#{name},'%')
+            and t1.name like concat('%',#{name},'%')
         </if>
         <if test="model != null and model != ''">
             and t1.model like concat('%',#{model},'%')

--
Gitblit v1.9.3