From c1e82be9145431e0f15cbb7cdab4af702cbffc3c Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期四, 10 七月 2025 10:31:17 +0800
Subject: [PATCH] 台账导入 导入模板

---
 db/template/设备台账导入模板.xls                                                                             |    0 
 db/template/设备点检标准导入模板.xlsx                                                                          |    0 
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamEquipmentDto.java                  |   18 ++++----
 db/template/生产设备二级保养规范.docx                                                                          |    0 
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java           |    3 +
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamEquipment.java                  |   18 ++++----
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamMaintenanceStandardController.java |   73 ++++++++++++++++++++++--------------
 db/template/生产设备三级保养规范.docx                                                                          |    0 
 8 files changed, 65 insertions(+), 47 deletions(-)

diff --git "a/db/template/\347\224\237\344\272\247\350\256\276\345\244\207\344\270\211\347\272\247\344\277\235\345\205\273\350\247\204\350\214\203.docx" "b/db/template/\347\224\237\344\272\247\350\256\276\345\244\207\344\270\211\347\272\247\344\277\235\345\205\273\350\247\204\350\214\203.docx"
index ada5153..363a18f 100644
--- "a/db/template/\347\224\237\344\272\247\350\256\276\345\244\207\344\270\211\347\272\247\344\277\235\345\205\273\350\247\204\350\214\203.docx"
+++ "b/db/template/\347\224\237\344\272\247\350\256\276\345\244\207\344\270\211\347\272\247\344\277\235\345\205\273\350\247\204\350\214\203.docx"
Binary files differ
diff --git "a/db/template/\347\224\237\344\272\247\350\256\276\345\244\207\344\272\214\347\272\247\344\277\235\345\205\273\350\247\204\350\214\203.docx" "b/db/template/\347\224\237\344\272\247\350\256\276\345\244\207\344\272\214\347\272\247\344\277\235\345\205\273\350\247\204\350\214\203.docx"
index 615547c..518d878 100644
--- "a/db/template/\347\224\237\344\272\247\350\256\276\345\244\207\344\272\214\347\272\247\344\277\235\345\205\273\350\247\204\350\214\203.docx"
+++ "b/db/template/\347\224\237\344\272\247\350\256\276\345\244\207\344\272\214\347\272\247\344\277\235\345\205\273\350\247\204\350\214\203.docx"
Binary files differ
diff --git "a/db/template/\350\256\276\345\244\207\345\217\260\350\264\246\345\257\274\345\205\245\346\250\241\346\235\277.xls" "b/db/template/\350\256\276\345\244\207\345\217\260\350\264\246\345\257\274\345\205\245\346\250\241\346\235\277.xls"
index 723c430..df9dac7 100644
--- "a/db/template/\350\256\276\345\244\207\345\217\260\350\264\246\345\257\274\345\205\245\346\250\241\346\235\277.xls"
+++ "b/db/template/\350\256\276\345\244\207\345\217\260\350\264\246\345\257\274\345\205\245\346\250\241\346\235\277.xls"
Binary files differ
diff --git "a/db/template/\350\256\276\345\244\207\347\202\271\346\243\200\346\240\207\345\207\206\345\257\274\345\205\245\346\250\241\346\235\277.xlsx" "b/db/template/\350\256\276\345\244\207\347\202\271\346\243\200\346\240\207\345\207\206\345\257\274\345\205\245\346\250\241\346\235\277.xlsx"
index 165d444..49f920f 100644
--- "a/db/template/\350\256\276\345\244\207\347\202\271\346\243\200\346\240\207\345\207\206\345\257\274\345\205\245\346\250\241\346\235\277.xlsx"
+++ "b/db/template/\350\256\276\345\244\207\347\202\271\346\243\200\346\240\207\345\207\206\345\257\274\345\205\245\346\250\241\346\235\277.xlsx"
Binary files differ
diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamEquipmentDto.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamEquipmentDto.java
index 0ff795d..4e05465 100644
--- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamEquipmentDto.java
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamEquipmentDto.java
@@ -92,7 +92,7 @@
     /**
      * 鎵�灞炲垎绫�
      */
-    @Excel(name = "鎵�灞炲垎绫�", width = 15, orderNum = "5")
+    @Excel(name = "鎵�灞炲垎绫�", width = 15, orderNum = "5",dicCode = "equipment_category")
     @ApiModelProperty(value = "鎵�灞炲垎绫�")
     @Dict(dicCode = "equipment_category")
     private String equipmentCategory;
@@ -296,7 +296,7 @@
     /**
      * 璐ㄤ繚寮�濮嬫棩鏈�
      */
-    @Excel(name = "璐ㄤ繚寮�濮嬫棩鏈�", width = 15, orderNum = "36")
+    @Excel(name = "璐ㄤ繚寮�濮嬫棩鏈�", width = 15, format = "yyyy/MM/dd", orderNum = "36")
     @ApiModelProperty(value = "璐ㄤ繚寮�濮嬫棩鏈�")
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -305,7 +305,7 @@
     /**
      * 璐ㄤ繚缁撴潫鏃ユ湡
      */
-    @Excel(name = "璐ㄤ繚缁撴潫鏃ユ湡", width = 15, orderNum = "37")
+    @Excel(name = "璐ㄤ繚缁撴潫鏃ユ湡", width = 15, format = "yyyy/MM/dd", orderNum = "37")
     @ApiModelProperty(value = "璐ㄤ繚缁撴潫鏃ユ湡")
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -321,7 +321,7 @@
 
     /**鏈�鏂颁簩淇濇棩鏈�*/
     @TableField(exist = false)
-    @Excel(name = "鏈�鏂颁簩淇濇棩鏈�", width = 15, orderNum = "39")
+    @Excel(name = "鏈�鏂颁簩淇濇棩鏈�", width = 15, format = "yyyy/MM/dd", orderNum = "39")
     @ApiModelProperty(value = "鏈�鏂颁簩淇濇棩鏈�")
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -329,7 +329,7 @@
 
     /**涓嬫浜屼繚鏃ユ湡*/
     @TableField(exist = false)
-    @Excel(name = "涓嬫浜屼繚鏃ユ湡", width = 15, orderNum = "40")
+    @Excel(name = "涓嬫浜屼繚鏃ユ湡", width = 15, format = "yyyy/MM/dd", orderNum = "40")
     @ApiModelProperty(value = "涓嬫浜屼繚鏃ユ湡")
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -338,7 +338,7 @@
 
     /**鏈涓変繚鏃ユ湡*/
     @TableField(exist = false)
-    @Excel(name = "鏈涓変繚鏃ユ湡", width = 15, orderNum = "41")
+    @Excel(name = "鏈涓変繚鏃ユ湡", width = 15, format = "yyyy/MM/dd", orderNum = "41")
     @ApiModelProperty(value = "鏈涓変繚鏃ユ湡")
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -346,7 +346,7 @@
 
     /**涓嬫涓変繚鏃ユ湡*/
     @TableField(exist = false)
-    @Excel(name = "涓嬫涓変繚鏃ユ湡", width = 15, orderNum = "42")
+    @Excel(name = "涓嬫涓変繚鏃ユ湡", width = 15, format = "yyyy/MM/dd", orderNum = "42")
     @ApiModelProperty(value = "涓嬫涓変繚鏃ユ湡")
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -360,14 +360,14 @@
 
     /**鏈�鏂版妧鏈姸鎬侀壌瀹氭棩鏈�*/
     @TableField(exist = false)
-    @Excel(name = "鏈�鏂版妧鏈姸鎬侀壌瀹氭棩鏈�", width = 15, orderNum = "44")
+    @Excel(name = "鏈�鏂版妧鏈姸鎬侀壌瀹氭棩鏈�", width = 15, format = "yyyy/MM/dd", orderNum = "44")
     @ApiModelProperty(value = "鏈�鏂版妧鏈姸鎬侀壌瀹氭棩鏈�")
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     private java.util.Date latestTechnologyCheck;
     /**鎶�鏈姸鎬佷笅娆¢壌瀹氭棩鏈�*/
     @TableField(exist = false)
-    @Excel(name = "鎶�鏈姸鎬佷笅娆¢壌瀹氭棩鏈�", width = 15, orderNum = "45")
+    @Excel(name = "鎶�鏈姸鎬佷笅娆¢壌瀹氭棩鏈�", width = 15, format = "yyyy/MM/dd", orderNum = "45")
     @ApiModelProperty(value = "鎶�鏈姸鎬佷笅娆¢壌瀹氭棩鏈�")
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamEquipment.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamEquipment.java
index 93a5b14..344c9bf 100644
--- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamEquipment.java
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamEquipment.java
@@ -126,7 +126,7 @@
     /**
      * 鎵�灞炲垎绫�
      */
-    @Excel(name = "鎵�灞炲垎绫�", width = 15, orderNum = "5")
+    @Excel(name = "鎵�灞炲垎绫�", width = 15, orderNum = "5",dicCode = "equipment_category")
     @ApiModelProperty(value = "鎵�灞炲垎绫�")
     @Dict(dicCode = "equipment_category")
     private String equipmentCategory;
@@ -331,7 +331,7 @@
     /**
      * 璐ㄤ繚寮�濮嬫棩鏈�
      */
-    @Excel(name = "璐ㄤ繚寮�濮嬫棩鏈�", width = 15, orderNum = "36")
+    @Excel(name = "璐ㄤ繚寮�濮嬫棩鏈�",  width = 25, format = "yyyy/MM/dd",  orderNum = "36")
     @ApiModelProperty(value = "璐ㄤ繚寮�濮嬫棩鏈�")
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -340,7 +340,7 @@
     /**
      * 璐ㄤ繚缁撴潫鏃ユ湡
      */
-    @Excel(name = "璐ㄤ繚缁撴潫鏃ユ湡", width = 15, orderNum = "37")
+    @Excel(name = "璐ㄤ繚缁撴潫鏃ユ湡", width = 15, format = "yyyy/MM/dd", orderNum = "37")
     @ApiModelProperty(value = "璐ㄤ繚缁撴潫鏃ユ湡")
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -356,7 +356,7 @@
 
     /**鏈�鏂颁簩淇濇棩鏈�*/
     @TableField(exist = false)
-    @Excel(name = "鏈�鏂颁簩淇濇棩鏈�", width = 15, orderNum = "39")
+    @Excel(name = "鏈�鏂颁簩淇濇棩鏈�", width = 15, format = "yyyy/MM/dd", orderNum = "39")
     @ApiModelProperty(value = "鏈�鏂颁簩淇濇棩鏈�")
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -364,7 +364,7 @@
 
     /**涓嬫浜屼繚鏃ユ湡*/
     @TableField(exist = false)
-    @Excel(name = "涓嬫浜屼繚鏃ユ湡", width = 15, orderNum = "40")
+    @Excel(name = "涓嬫浜屼繚鏃ユ湡", width = 15, format = "yyyy/MM/dd", orderNum = "40")
     @ApiModelProperty(value = "涓嬫浜屼繚鏃ユ湡")
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -373,7 +373,7 @@
 
     /**鏈涓変繚鏃ユ湡*/
     @TableField(exist = false)
-    @Excel(name = "鏈涓変繚鏃ユ湡", width = 15, orderNum = "41")
+    @Excel(name = "鏈涓変繚鏃ユ湡", width = 15,  format = "yyyy/MM/dd",orderNum = "41")
     @ApiModelProperty(value = "鏈涓変繚鏃ユ湡")
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -381,7 +381,7 @@
 
     /**涓嬫涓変繚鏃ユ湡*/
     @TableField(exist = false)
-    @Excel(name = "涓嬫涓変繚鏃ユ湡", width = 15, orderNum = "42")
+    @Excel(name = "涓嬫涓変繚鏃ユ湡", width = 15, format = "yyyy/MM/dd", orderNum = "42")
     @ApiModelProperty(value = "涓嬫涓変繚鏃ユ湡")
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -395,14 +395,14 @@
 
     /**鏈�鏂版妧鏈姸鎬侀壌瀹氭棩鏈�*/
     @TableField(exist = false)
-    @Excel(name = "鏈�鏂版妧鏈姸鎬侀壌瀹氭棩鏈�", width = 15, orderNum = "44")
+    @Excel(name = "鏈�鏂版妧鏈姸鎬侀壌瀹氭棩鏈�", width = 15, format = "yyyy/MM/dd", orderNum = "44")
     @ApiModelProperty(value = "鏈�鏂版妧鏈姸鎬侀壌瀹氭棩鏈�")
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     private java.util.Date latestTechnologyCheck;
     /**鎶�鏈姸鎬佷笅娆¢壌瀹氭棩鏈�*/
     @TableField(exist = false)
-    @Excel(name = "鎶�鏈姸鎬佷笅娆¢壌瀹氭棩鏈�", width = 15, orderNum = "45")
+    @Excel(name = "鎶�鏈姸鎬佷笅娆¢壌瀹氭棩鏈�", width = 15, format = "yyyy/MM/dd", orderNum = "45")
     @ApiModelProperty(value = "鎶�鏈姸鎬佷笅娆¢壌瀹氭棩鏈�")
     @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
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 16f06a7..400264b 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
@@ -303,6 +303,9 @@
                         sb.append(String.format("璁惧缂栫爜[%s]淇濆瓨澶辫触锛屾棤娉曞鍏n\r", eamEquipment.getEquipmentCode()));
                         continue;
                     }
+                    EamEquipmentExtend eamEquipmentExtend=new EamEquipmentExtend();
+                    BeanUtils.copyProperties(eamEquipmentExtend,equipment);
+                    eamEquipmentExtendService.save(eamEquipmentExtend);
                 }
                 log.info("娑堣�楁椂闂�" + (System.currentTimeMillis() - start) + "姣");
                 //update-end-author:taoyan date:20190528 for:鎵归噺鎻掑叆鏁版嵁
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamMaintenanceStandardController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamMaintenanceStandardController.java
index e6f9f67..0d7d06e 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamMaintenanceStandardController.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamMaintenanceStandardController.java
@@ -30,6 +30,7 @@
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
 
 /**
  * @Description: 淇濆吇鏍囧噯
@@ -232,15 +233,17 @@
     @DeleteMapping(value = "/deleteBatch")
     public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
         List<String> list = Arrays.asList(ids.split(","));
+        AtomicInteger i = new AtomicInteger();
         list.forEach(id -> {
             EamMaintenanceStandard entity = eamMaintenanceStandardService.getById(id);
             if (entity != null&&entity.getStandardStatus().equals(MaintenanceStandardStatusEnum.WAIT_SUBMIT.name())) {
                 //鍙垹闄ょ姸鎬佷负寰呮彁浜ょ殑
+                i.getAndIncrement();
                 entity.setDelFlag(CommonConstant.DEL_FLAG_1);
                 eamMaintenanceStandardService.updateById(entity);
             }
         });
-        return Result.OK("鎵归噺鍒犻櫎鎴愬姛锛�");
+        return Result.OK("鎵归噺鍒犻櫎鎴愬姛,宸插垹闄ょ姸鎬佷负寰呮彁浜ょ殑淇濆吇鏍囧噯锛屽垹闄ゆ暟閲忎负"+i);
     }
 
     /**
@@ -282,18 +285,18 @@
 
             for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
                 MultipartFile file = entity.getValue();
-                file.getOriginalFilename();
-                return eamMaintenanceStandardService.importPointInspectionExcel(file);
+                String fileName = file.getOriginalFilename();
+                Result<?> importResult=eamMaintenanceStandardService.importPointInspectionExcel(file);
+                if (importResult.isSuccess()) {
+                    successCount++;
+                } else {
+                    results.put(fileName, importResult.getMessage());
+                    failureCount++;
+                }
             }
 
-            // 鏋勫缓鍝嶅簲
-            Map<String, Object> response = new HashMap<>();
-            response.put("results", results);
-            response.put("totalFiles", fileMap.size());
-            response.put("successCount", successCount);
-            response.put("failureCount", failureCount);
-
-            return Result.ok("瀵煎叆瀹屾垚" + response);
+            // 鏋勫缓鏈�缁堝搷搴�
+            return getResult(results, fileMap.size(), successCount, failureCount);
 
         } catch (Exception e) {
             log.error("鐐规瀵煎叆澶勭悊寮傚父", e);
@@ -318,18 +321,18 @@
 
             for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
                 MultipartFile file = entity.getValue();
-                file.getOriginalFilename();
-                return eamMaintenanceStandardService.importMaintenanceStandard(file, "SECOND");
+                String fileName = file.getOriginalFilename();
+                Result<?> importResult=eamMaintenanceStandardService.importMaintenanceStandard(file, "SECOND");
+                if (importResult.isSuccess()) {
+                    successCount++;
+                } else {
+                    results.put(fileName, importResult.getMessage());
+                    failureCount++;
+                }
             }
 
             // 鏋勫缓鏈�缁堝搷搴�
-            Map<String, Object> response = new HashMap<>();
-            response.put("results", results);
-            response.put("totalFiles", fileMap.size());
-            response.put("successCount", successCount);
-            response.put("failureCount", failureCount);
-
-            return Result.ok("瀵煎叆瀹屾垚"+response);
+            return getResult(results, fileMap.size(), successCount, failureCount);
 
         } catch (Exception e) {
             log.error("瀵煎叆澶勭悊寮傚父", e);
@@ -353,18 +356,18 @@
 
             for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
                 MultipartFile file = entity.getValue();
-                file.getOriginalFilename();
-                return eamMaintenanceStandardService.importMaintenanceStandard(file, "THIRD");
+                String fileName = file.getOriginalFilename();
+                Result<?> importResult= eamMaintenanceStandardService.importMaintenanceStandard(file, "THIRD");
+                if (importResult.isSuccess()) {
+                    successCount++;
+                } else {
+                    results.put(fileName, importResult.getMessage());
+                    failureCount++;
+                }
             }
 
             // 鏋勫缓鏈�缁堝搷搴�
-            Map<String, Object> response = new HashMap<>();
-            response.put("results", results);
-            response.put("totalFiles", fileMap.size());
-            response.put("successCount", successCount);
-            response.put("failureCount", failureCount);
-
-            return Result.ok("瀵煎叆瀹屾垚"+response);
+            return getResult(results, fileMap.size(), successCount, failureCount);
 
         } catch (Exception e) {
             log.error("瀵煎叆澶勭悊寮傚父", e);
@@ -372,4 +375,16 @@
         }
     }
 
+    private Result<?> getResult(Map<String, String> results, int fileCount, int successCount, int failureCount) {
+        List<String> response = new ArrayList<>();
+        response.add("鎬绘枃浠舵暟锛�" + fileCount);
+        response.add("鎴愬姛鏁帮細" + successCount);
+        response.add("澶辫触鏁帮細" + failureCount);
+        if (failureCount > 0) {
+            response.add("閿欒淇℃伅锛�" + results.values());
+            return Result.error("閮ㄥ垎鏂囦欢瀵煎叆澶辫触锛�" + response);
+        }
+        return Result.ok("鎵�鏈夋枃浠跺鍏ユ垚鍔燂細" + response);
+    }
+
 }

--
Gitblit v1.9.3