From 87cdb6ee2a471bc7b5c608f0af71918a22aa6f80 Mon Sep 17 00:00:00 2001
From: houjie <714924425@qq.com>
Date: 星期五, 01 九月 2023 15:14:50 +0800
Subject: [PATCH] 备件库存 导入  优化

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/spare/controller/SparesPartInventoryController.java |   17 +----------------
 lxzn-module-eam/src/main/java/org/jeecg/modules/spare/entity/SparesPartInventory.java               |   16 ++++++++--------
 2 files changed, 9 insertions(+), 24 deletions(-)

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/spare/controller/SparesPartInventoryController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/spare/controller/SparesPartInventoryController.java
index 0b9419d..751e5e4 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/spare/controller/SparesPartInventoryController.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/spare/controller/SparesPartInventoryController.java
@@ -188,31 +188,16 @@
             params.setNeedSave(true);
             try {
                 List<SparesPartInventory> list = ExcelImportUtil.importExcel(file.getInputStream(), SparesPartInventory.class, params);
-             /*   for (SparesPartInventory temp : list) {
-                    temp.setSparePartId(mainId);
-                    if (!StringUtils.isNotEmpty(sparePart.getName()))
-                        return Result.error("鏂囦欢瀵煎叆澶辫触: 绗�" + (i + 1) + "琛屽浠跺悕绉颁笉鑳戒负绌�");
-                    if (!StringUtils.isNotEmpty(sparePart.getNum()))
-                        return Result.error("鏂囦欢瀵煎叆澶辫触: 绗�" + (i + 1) + "琛屽浠剁紪鐮佷笉鑳戒负绌�");
-                    if (!StringUtils.isNotEmpty(sparePart.getSpecification()))
-                        return Result.error("鏂囦欢瀵煎叆澶辫触: 绗�" + (i + 1) + "琛屽浠惰鏍间笉鑳戒负绌�");
-                    if (!StringUtils.isNotEmpty(sparePart.getModel()))
-                        return Result.error("鏂囦欢瀵煎叆澶辫触: 绗�" + (i + 1) + "琛屽浠跺瀷鍙蜂笉鑳戒负绌�");
-
-                }*/
+                long start = System.currentTimeMillis();
                 for (int i = 0; i < list.size(); i++) {
-
                     SparesPartInventory sparesPartInventory = list.get(i);
                     sparesPartInventory.setSparePartId(mainId);
                     if (!StringUtils.isNotEmpty(sparesPartInventory.getBatchNum()))
                         return Result.error("鏂囦欢瀵煎叆澶辫触: 绗�" + (i + 1) + "琛屾壒娆″彿涓嶈兘涓虹┖");
                     if (sparesPartInventory.getMainQuantity() <= 0)
                         return Result.error("鏂囦欢瀵煎叆澶辫触: 绗�" + (i + 1) + "琛屾暟閲忎笉鑳戒负灏忎簬绛変簬0");
-
                 }
 
-
-                long start = System.currentTimeMillis();
                 sparesPartInventoryService.saveBatch(list);
                 log.info("娑堣�楁椂闂�" + (System.currentTimeMillis() - start) + "姣");
                 return Result.OK("鏂囦欢瀵煎叆鎴愬姛锛佹暟鎹鏁帮細" + list.size());
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/spare/entity/SparesPartInventory.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/spare/entity/SparesPartInventory.java
index ddeeebd..68b76d0 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/spare/entity/SparesPartInventory.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/spare/entity/SparesPartInventory.java
@@ -54,43 +54,43 @@
     /**
      * 鍒堕�犲晢
      */
-    @Excel(name = "鍒堕�犲晢", width = 15, dictTable = "mom_base_constructor", dicCode = "id", dicText = "name")
+    @Excel(name = "鍒堕�犲晢", width = 15)
     @ApiModelProperty(value = "鍒堕�犲晢")
     @Dict(dictTable = "mom_base_constructor", dicCode = "id", dicText = "name")
     private java.lang.String constructorId;
     /**
      * 涓诲崟浣峣d
      */
-    @Excel(name = "涓诲崟浣峣d", width = 15, dictTable = "mom_base_unit", dicCode = "id", dicText = "name")
+    @Excel(name = "鍗曚綅", width = 15)
     @ApiModelProperty(value = "涓诲崟浣峣d")
     @Dict(dictTable = "mom_base_unit", dicCode = "id", dicText = "name")
     private java.lang.String mainUnitId;
     /**
      * 杈呭崟浣峣d
      */
-    @Excel(name = "杈呭崟浣峣d", width = 15, dictTable = "mom_base_unit", dicCode = "id", dicText = "name")
+    @Excel(name = "杈呭崟浣峣d", width = 15)
     @ApiModelProperty(value = "杈呭崟浣峣d")
     @Dict(dictTable = "mom_base_unit", dicCode = "id", dicText = "name")
     private java.lang.String auxiliaryUnitId;
 
-    @Excel(name = "浠撳簱id", width = 15, dictTable = "mom_base_warehouse", dicCode = "id", dicText = "name")
+    @Excel(name = "浠撳簱", width = 15)
     @ApiModelProperty(value = "浠撳簱id")
     @Dict(dictTable = "mom_base_warehouse", dicCode = "id", dicText = "name")
     private java.lang.String warehouseId;
 
-    @Excel(name = "搴撳尯id", width = 15, dictTable = "mom_base_warehouse_area", dicCode = "id", dicText = "name")
+    @Excel(name = "搴撳尯", width = 15)
     @ApiModelProperty(value = "搴撳尯id")
     @Dict(dictTable = "mom_base_warehouse_area", dicCode = "id", dicText = "name")
     private java.lang.String warehouseAreaId;
 
-    @Excel(name = "搴撲綅id", width = 15, dictTable = "mom_base_warehouse_location", dicCode = "id", dicText = "name")
+    @Excel(name = "搴撲綅", width = 15)
     @ApiModelProperty(value = "搴撲綅id")
     @Dict(dictTable = "mom_base_warehouse_location", dicCode = "id", dicText = "name")
     private java.lang.String warehouseLocationId;
     /**
      * 涓绘暟閲�
      */
-    @Excel(name = "涓绘暟閲�", width = 15)
+    @Excel(name = "鏁伴噺", width = 15)
     @ApiModelProperty(value = "涓绘暟閲�")
     private java.lang.Double mainQuantity;
     /**
@@ -112,7 +112,7 @@
     /**
      * 渚涘簲鍟唅d
      */
-    @Excel(name = "渚涘簲鍟唅d", width = 15)
+    @Excel(name = "渚涘簲鍟�", width = 15)
     @ApiModelProperty(value = "渚涘簲鍟唅d")
     private String supplierId;
 

--
Gitblit v1.9.3