From 4559444158b9ab3c29fb578e5dac6788ddccd53e Mon Sep 17 00:00:00 2001
From: pang.jiabao <pang_jiabao@163.com>
Date: 星期二, 13 八月 2024 22:02:41 +0800
Subject: [PATCH] 成品入库和界面显示

---
 src/main/webapp/static/js/locDetl/locDetl.js                         |   10 +-
 src/main/java/com/zy/asrs/importexcle/LocMatListener.java            |   25 +++++--
 src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java          |    1 
 src/main/webapp/static/js/mat/mat.js                                 |    2 
 src/main/webapp/views/mat/mat.html                                   |   40 ++++++------
 src/main/java/com/zy/asrs/entity/param/GwmsGenerateInventoryDto.java |    5 +
 src/main/webapp/static/js/common.js                                  |   49 ++++++++--------
 src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java          |   40 +++++++------
 8 files changed, 95 insertions(+), 77 deletions(-)

diff --git a/src/main/java/com/zy/asrs/entity/param/GwmsGenerateInventoryDto.java b/src/main/java/com/zy/asrs/entity/param/GwmsGenerateInventoryDto.java
index 0f51b11..2997e54 100644
--- a/src/main/java/com/zy/asrs/entity/param/GwmsGenerateInventoryDto.java
+++ b/src/main/java/com/zy/asrs/entity/param/GwmsGenerateInventoryDto.java
@@ -17,6 +17,11 @@
     public static class MatList{
         private String boxPos; // 绠卞瓙浣嶇疆
         private String packageGroupNo; // 鍖呰缁勫彿
+        private String boxType; // 鏈ㄧ绫诲瀷
+        private String rollType; // 绠¤姱绫诲瀷
+        private String wideInWidth; // 瀹炴祴瀹藉箙锛堝垎鍒囨垚鍝佷笅鏂欙級
+        private String thickness; // 鐢熺當鍘氬害锛堝垎鍒囨垚鍝佷笅鏂欙級
+        private String fqTime; // 鍒嗗垏涓嬫枡鏃堕棿
         private List<Rolls> rolls; // 鍗烽泦鍚�
     }
     @Data
diff --git a/src/main/java/com/zy/asrs/importexcle/LocMatListener.java b/src/main/java/com/zy/asrs/importexcle/LocMatListener.java
index 502cfbc..c4775e8 100644
--- a/src/main/java/com/zy/asrs/importexcle/LocMatListener.java
+++ b/src/main/java/com/zy/asrs/importexcle/LocMatListener.java
@@ -87,6 +87,9 @@
         List<LocDetl> locDetls = new ArrayList<>();
             list.forEach(locMat -> {
                 LocMast locMast = locMastService.selectById(locMat.getA());
+                if (locMast == null) {
+                    throw new CoolException(locMat.getA() + ":搴撲綅涓嶅瓨鍦紒");
+                }
                 if (!locMast.getLocSts().equals("O")) {
                     throw new CoolException(locMat.getA() + ":搴撲綅涓嶄负绌猴紒");
                 }
@@ -94,19 +97,25 @@
                 if ("F".equals(locMat.getB())) {
                     LocDetl locDetl = new LocDetl();
                     locDetl.setLocNo(locMat.getA());
-                    locDetl.setZpallet("test" + num);
-                    locDetl.setAnfme(1.0);
                     locDetl.setMatnr("3渭m脳10mm");
                     locDetl.setMaktx("3渭m脳10mm");
-                    locDetl.setBatch("t" + num);
-                    locDetl.setSpecs("1");
-                    locDetl.setModel("t" + num);
-                    locDetl.setColor(locMat.getC()); // 鏈ㄧ绫诲瀷
-                    locDetl.setBrand("t" + num);
-                    locDetl.setPrice(800.0);
+                    String flag = "A" + num;
+                    locDetl.setUnit(flag);
+                    locDetl.setModel(flag);
+                    locDetl.setBrand(flag);
                     locDetl.setOrigin("涓�");
+                    locDetl.setColor(locMat.getC());
+                    locDetl.setManu("A");
+                    locDetl.setSku("10");
+                    locDetl.setItemNum("10");
+                    locDetl.setManuDate("2024-02-01 23:12:21");
                     locDetl.setWeight(900.0);
                     locDetl.setVolume(1000.0);
+                    locDetl.setSpecs("1");
+                    locDetl.setLength(800.0);
+                    locDetl.setZpallet(flag);
+                    locDetl.setBarcode(flag);
+                    locDetl.setAnfme(1.0);
                     locDetl.setModiTime(now);
                     locDetl.setModiUser(userId);
                     locDetl.setAppeTime(now);
diff --git a/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
index 15077f6..f931c8d 100644
--- a/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -1062,39 +1062,43 @@
                 WrkDetl wrkDetl = new WrkDetl();
                 wrkDetl.setWrkNo(wrkMast.getWrkNo());
                 obj.getRolls().forEach(roll -> {
-//                Mat mat = matService.selectByMatnr(roll.getSpecs());
-//                if (mat == null) {
-//                    mat = new Mat();
-//                    mat.setTagId(6L);
-//                    mat.setMatnr(roll.getSpecs());
-//                    mat.setMaktx(roll.getSpecs());
-//                    mat.setSpecs(roll.getSpecs());
-//                    mat.setStatus(1);
-//                    mat.setCreateTime(now);
-//                    mat.setUpdateTime(now);
-//                    if (!matService.insert(mat)) {
-//                        throw new CoolException("鐗╂枡瀵煎叆澶辫触锛�");
-//                    }
-//                }
                     wrkDetl.setWrkNo(wrkMast.getWrkNo());
                     wrkDetl.setMatnr(roll.getSpecs()); // 瑙勬牸
                     wrkDetl.setMaktx(roll.getSpecs()); //瑙勬牸
-                    wrkDetl.setBatch(roll.getBoxNo()); // 绠卞彿
+                    wrkDetl.setUnit(roll.getBoxNo()); // 绠卞彿
                     wrkDetl.setModel(roll.getRollNo()); // 鍗峰彿
                     wrkDetl.setBrand(obj.getPackageGroupNo()); // 鍖呰缁勫彿
-                    wrkDetl.setZpallet(param.getBarcode()); // 鎵樼洏鍚�
+                    wrkDetl.setZpallet(param.getBarcode()); // 鎵樼洏鐮�
+                    wrkDetl.setBarcode(param.getBarcode());
                     wrkDetl.setOrigin(obj.getBoxPos()); // 鏈ㄧ鍦ㄦ墭鐩樹綅缃�
+                    wrkDetl.setColor(obj.getBoxType()); // 鏈ㄧ绫诲瀷
+                    wrkDetl.setManu(obj.getRollType()); // 绠¤姱绫诲瀷
+                    wrkDetl.setSku(obj.getWideInWidth()); // 瀹炴祴瀹藉箙
+                    wrkDetl.setItemNum(obj.getThickness()); // 鐢熺當鍘氬害
+                    wrkDetl.setManuDate(obj.getFqTime()); // 鍒嗗垏涓嬫枡鏃堕棿
                     wrkDetl.setWeight(roll.getNetWeight()); // 鍑�閲�
                     wrkDetl.setVolume(roll.getGrossWeight()); // 姣涢噸
-                    wrkDetl.setPrice(roll.getLength());
-                    wrkDetl.setSpecs(String.valueOf(roll.getSplices()));
+                    wrkDetl.setLength(roll.getLength()); // 闀垮害
+                    wrkDetl.setSpecs(String.valueOf(roll.getSplices())); // 鎺ュご
                     wrkDetl.setAnfme(1.0);
+//                    wrkDetl.setThreeCode(null); // 閫氳繃mes鎴杄xcel瀵煎叆妫�娴嬫槸鍚﹀悎鏍� 0涓嶅悎鏍硷紝1 鍚堟牸
                     wrkDetl.setIoTime(now);
                     wrkDetl.setAppeTime(now);
                     wrkDetl.setModiTime(now);
                     if (!wrkDetlService.insert(wrkDetl)) {
                         throw new CoolException("淇濆瓨宸ヤ綔鏄庣粏澶辫触");
                     }
+
+                    // 鐗╂枡琛ㄥ浠戒竴浠�
+                    Mat mat = new Mat();
+                    mat.sync(wrkDetl);
+                    mat.setTagId(6L);
+                    mat.setCreateTime(now);
+                    mat.setUpdateTime(now);
+                    if (!matService.insert(mat)) {
+                        throw new CoolException("澶囦唤鐗╂枡琛ㄥけ璐�");
+                    }
+
                 });
             }
         }
diff --git a/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java b/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
index 1dc9867..3e18817 100644
--- a/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
+++ b/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -107,6 +107,7 @@
                             locDetl.setZpallet(wrkDetl.getZpallet()); // 鎵樼洏鏉$爜
                             locDetl.setModiTime(now);
                             locDetl.setAppeTime(now);
+                            locDetl.setBatch("");
                             if (!locDetlService.insert(locDetl)) {
 //                                exceptionHandle("鍏ㄦ澘鍏ュ簱 ===>> 娣诲姞搴撳瓨鏄庣粏澶辫触锛沎workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo());
                                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
diff --git a/src/main/webapp/static/js/common.js b/src/main/webapp/static/js/common.js
index 053e141..6fd3a37 100644
--- a/src/main/webapp/static/js/common.js
+++ b/src/main/webapp/static/js/common.js
@@ -182,30 +182,30 @@
 
 var matCols = [
     {field: 'matnr', align: 'center',title: '瑙勬牸', width: 180}
+    ,{field: 'unit', align: 'center',title: '绠卞彿', hide: false}
+    ,{field: 'model', align: 'center',title: '鍗峰彿', hide: false}
     // {field: 'id', align: 'center',title: 'ID'}
     // ,{field: 'uuid', align: 'center',title: '缂栧彿'}
     // ,{field: 'tagId$', align: 'center',title: '鎵�灞炲綊绫�'}
-    ,{field: 'maktx', align: 'center',title: '鍟嗗搧鍚嶇О锛堝搧鍚嶏級', width: 200}
+    ,{field: 'maktx', align: 'center',title: '鍟嗗搧鍚嶇О锛堝搧鍚嶏級', width: 200,hide: true}
     // ,{field: 'name', align: 'center',title: '鍒悕'}
-    ,{field: 'specs', align: 'center',title: '鎺ュご'}
-    ,{field: 'model', align: 'center',title: '鍗峰彿', hide: false}
-    ,{field: 'color', align: 'center',title: '棰滆壊', hide: true}
-    ,{field: 'brand', align: 'center',title: '鏈ㄧ绫诲瀷', hide: true}
-    ,{field: 'brand$', align: 'center',title: '鏈ㄧ绫诲瀷', hide: false}
-    ,{field: 'unit', align: 'center',title: '鍗曚綅', hide: false}
-    ,{field: 'price', align: 'center',title: '闀垮害', hide: false}
-    ,{field: 'sku', align: 'center',title: '鏈ㄧ缂栫爜', hide: false}
+    ,{field: 'brand', align: 'center',title: '鍖呰缁勫彿', hide: false}
+    ,{field: 'origin', align: 'center',title: '鏈ㄧ浣嶇疆', hide: false}
+    ,{field: 'color', align: 'center',title: '鏈ㄧ绫诲瀷', hide: false}
+    // ,{field: 'brand$', align: 'center',title: '鏈ㄧ绫诲瀷', hide: false}
+    ,{field: 'manu', align: 'center',title: '绠¤姱绫诲瀷', hide: false}
+    ,{field: 'sku', align: 'center',title: '瀹炴祴瀹藉箙', hide: false}
+    ,{field: 'itemNum', align: 'center',title: '鐢熺當鍘氬害', hide: false}
+    ,{field: 'manuDate', align: 'center',title: '鐢熶骇鏃ユ湡', hide: false}
     ,{field: 'units', align: 'center',title: '鍗曚綅閲�', hide: true}
     ,{field: 'barcode', align: 'center',title: '鏉$爜', hide: true}
-    ,{field: 'origin', align: 'center',title: '鏈ㄧ浣嶇疆', hide: false}
-    ,{field: 'manu', align: 'center',title: '鍘傚', hide: true}
-    ,{field: 'manuDate', align: 'center',title: '鐢熶骇鏃ユ湡', hide: true}
-    ,{field: 'itemNum', align: 'center',title: '鍝侀」鏁�', hide: true}
     ,{field: 'safeQty', align: 'center',title: '瀹夊叏搴撳瓨閲�', hide: true}
-    ,{field: 'weight', align: 'center',title: '鍗曠鍑�閲�', hide: true}
-    // ,{field: 'length', align: 'center',title: '鍗曠姣涢噸', hide: true}
-    ,{field: 'volume', align: 'center',title: '鍗曠姣涢噸', hide: false}
-    ,{field: 'threeCode', align: 'center',title: '绠卞瓙灏哄', hide: true}
+    ,{field: 'weight', align: 'center',title: '鍑�閲�', hide: false}
+    ,{field: 'volume', align: 'center',title: '姣涢噸', hide: false}
+    ,{field: 'length', align: 'center',title: '闀垮害', hide: false}
+    ,{field: 'price', align: 'center',title: '浠锋牸', hide: true}
+    ,{field: 'specs', align: 'center',title: '鎺ュご',hide: false}
+    ,{field: 'threeCode', align: 'center',title: '鍚堟牸鍚�', hide: true}
     ,{field: 'supp', align: 'center',title: '渚涘簲鍟�', hide: true}
     ,{field: 'suppCode', align: 'center',title: '渚涘簲鍟嗙紪鐮�', hide: true}
     ,{field: 'beBatch$', align: 'center',title: '鏄惁鎵规', hide: true}
@@ -226,27 +226,26 @@
     {field: 'matnr', align: 'center',title: '瑙勬牸', sort:false, hide: false}
     ,{field: 'maktx', align: 'center',title: '鍝佸悕', sort:true, hide: true}
     ,{field: 'orderNo', align: 'center',title: '鍗曟嵁缂栧彿', hide: true}
-    ,{field: 'batch', align: 'center',title: '绠卞彿', hide: false, sort:true}
+    ,{field: 'batch', align: 'center',title: '鎵规', hide: true, sort:true}
+    ,{field: 'unit', align: 'center',title: '绠卞彿', hide: false}
     ,{field: 'model', align: 'center',title: '鍗峰彿', hide: false}
-    ,{field: 'brand', align: 'center',title: '鏈ㄧ绫诲瀷', hide: true, sort:true}
+    ,{field: 'brand', align: 'center',title: '鍖呰缁勫彿', hide: true, sort:true}
     ,{field: 'brand$', align: 'center',title: '鏈ㄧ绫诲瀷', hide: false, sort:true}
     ,{field: 'anfme', align: 'center',title: '鏁伴噺', hide: false, sort:true}
     ,{field: 'zpallet', align: 'center',title: '鎵樼洏鏉$爜', hide: false}
-
     ,{field: 'specs', align: 'center',title: '鎺ュご', hide: false}
     ,{field: 'color', align: 'center',title: '棰滆壊', hide: true}
-    ,{field: 'unit', align: 'center',title: '鍗曚綅', hide: true}
-    ,{field: 'price', align: 'center',title: '闀垮害', hide: false}
-    ,{field: 'sku', align: 'center',title: 'sku', hide: true}
+    ,{field: 'price', align: 'center',title: '浠锋牸', hide: true}
+    ,{field: 'sku', align: 'center',title: '瀹炴祴瀹藉箙', hide: true}
     ,{field: 'units', align: 'center',title: '鍗曚綅閲�', hide: true}
     ,{field: 'barcode', align: 'center',title: '鏉$爜', hide: true}
     ,{field: 'origin', align: 'center',title: '鏈ㄧ浣嶇疆', hide: false}
     ,{field: 'manu', align: 'center',title: '鍘傚', hide: true}
     ,{field: 'manuDate', align: 'center',title: '鐢熶骇鏃ユ湡', hide: true}
-    ,{field: 'itemNum', align: 'center',title: '鍝侀」鏁�', hide: true}
+    ,{field: 'itemNum', align: 'center',title: '鐢熺當鍘氬害', hide: true}
     ,{field: 'safeQty', align: 'center',title: '瀹夊叏搴撳瓨閲�', hide: true}
     ,{field: 'weight', align: 'center',title: '鍗曠鍑�閲�', hide: false, sort:true}
-    // ,{field: 'length', align: 'center',title: '鍗曠姣涢噸', hide: true}
+    ,{field: 'length', align: 'center',title: '闀垮害', hide: false}
     ,{field: 'volume', align: 'center',title: '鍗曠姣涢噸', hide: false}
     ,{field: 'threeCode', align: 'center',title: '绠卞瓙灏哄', hide: true}
     ,{field: 'supp', align: 'center',title: '渚涘簲鍟�', hide: true}
diff --git a/src/main/webapp/static/js/locDetl/locDetl.js b/src/main/webapp/static/js/locDetl/locDetl.js
index 265898a..6caaeda 100644
--- a/src/main/webapp/static/js/locDetl/locDetl.js
+++ b/src/main/webapp/static/js/locDetl/locDetl.js
@@ -5,7 +5,7 @@
         {field: 'matnr', align: 'center',title: '瑙勬牸', sort:true,width: 120}
         ,{field: 'maktx', align: 'center',title: '鍟嗗搧鍚嶇О', sort:true,hide: true}
         ,{field: 'orderNo', align: 'center',title: '鍗曟嵁缂栧彿', hide: true}
-        ,{field: 'batch', align: 'center',title: '绠卞彿', width: 250, sort:true}
+        ,{field: 'batch', align: 'center',title: '鎵规', width: 250, sort:true,hide: true}
         ,{field: 'anfme', align: 'center',title: '鏁伴噺'}
         ,{field: 'zpallet', align: 'center',title: '鎵樼洏鏉$爜'}
         ,{field: 'specs', align: 'center',title: '鎺ュご'}
@@ -13,8 +13,8 @@
         ,{field: 'color', align: 'center',title: '鏈ㄧ绫诲瀷', hide: false,width: 250}
         ,{field: 'brand', align: 'center',title: '鍖呰缁勫彿', hide: false}
         ,{field: 'brand$', align: 'center',title: '鏈ㄧ绫诲瀷', hide: true}
-        ,{field: 'unit', align: 'center',title: '鍗曚綅', hide: true}
-        ,{field: 'price', align: 'center',title: '闀垮害', hide: false}
+        ,{field: 'unit', align: 'center',title: '绠卞彿', hide: false}
+        ,{field: 'price', align: 'center',title: '浠锋牸', hide: true}
         ,{field: 'sku', align: 'center',title: 'sku', hide: true}
         ,{field: 'units', align: 'center',title: '鍗曚綅閲�', hide: true}
         ,{field: 'barcode', align: 'center',title: '鏉$爜', hide: true}
@@ -24,9 +24,9 @@
         ,{field: 'itemNum', align: 'center',title: '鍝侀」鏁�', hide: true}
         ,{field: 'safeQty', align: 'center',title: '瀹夊叏搴撳瓨閲�', hide: true}
         ,{field: 'weight', align: 'center',title: '鍗曠鍑�閲�', hide: true}
-        // ,{field: 'length', align: 'center',title: '鍗曠姣涢噸', hide: true}
+        ,{field: 'length', align: 'center',title: '闀垮害', hide: false}
         ,{field: 'volume', align: 'center',title: '鍗曠姣涢噸', hide: false}
-        ,{field: 'threeCode', align: 'center',title: '绠卞瓙灏哄', hide: true}
+        ,{field: 'threeCode', align: 'center',title: '鍚堟牸鍚�', hide: false}
         ,{field: 'supp', align: 'center',title: '渚涘簲鍟�', hide: true}
         ,{field: 'suppCode', align: 'center',title: '渚涘簲鍟嗙紪鐮�', hide: true}
         ,{field: 'beBatch$', align: 'center',title: '鏄惁鎵规', hide: true}
diff --git a/src/main/webapp/static/js/mat/mat.js b/src/main/webapp/static/js/mat/mat.js
index 0fa6ccc..1e86f89 100644
--- a/src/main/webapp/static/js/mat/mat.js
+++ b/src/main/webapp/static/js/mat/mat.js
@@ -4,7 +4,7 @@
 function getCol() {
     var cols = [
         {type: 'checkbox'}
-        ,{field: 'tagId$', align: 'center',title: '褰掔被', templet: '#tagTpl'}
+        ,{field: 'tagId$', align: 'center',title: '褰掔被', templet: '#tagTpl',hide:true}
     ];
     cols.push.apply(cols, matCols);
     cols.push(
diff --git a/src/main/webapp/views/mat/mat.html b/src/main/webapp/views/mat/mat.html
index 4814be3..46603e0 100644
--- a/src/main/webapp/views/mat/mat.html
+++ b/src/main/webapp/views/mat/mat.html
@@ -60,27 +60,27 @@
 <div class="layui-fluid">
     <!-- 宸� -->
     <div class="layui-row layui-col-space15">
-        <div class="layui-col-md3">
-            <div class="layui-card">
-                <div class="layui-card-body" style="padding: 10px;">
-                    <!-- 鏍戝伐鍏锋爮 -->
-                    <div class="layui-form toolbar" id="organizationTreeBar">
-                        <div class="layui-inline" style="max-width: 200px;">
-                            <input id="condition" onkeyup="findData(this)" type="text" class="layui-input" placeholder="璇疯緭鍏ュ叧閿瓧" autocomplete="off">
-                        </div>
-                        <div class="layui-inline">
-                            <button class="layui-btn icon-btn layui-btn-sm" id="treeReset" style="padding: 0 10px">
-                                <i class="layui-icon layui-icon-close"></i>
-                            </button>
-                        </div>
-                    </div>
-                    <!-- 鏍� -->
-                    <div class="layui-form toolbar" id="organizationTree"></div>
-                </div>
-            </div>
-        </div>
+<!--        <div class="layui-col-md3">-->
+<!--            <div class="layui-card">-->
+<!--                <div class="layui-card-body" style="padding: 10px;">-->
+<!--                    &lt;!&ndash; 鏍戝伐鍏锋爮 &ndash;&gt;-->
+<!--                    <div class="layui-form toolbar" id="organizationTreeBar">-->
+<!--                        <div class="layui-inline" style="max-width: 200px;">-->
+<!--                            <input id="condition" onkeyup="findData(this)" type="text" class="layui-input" placeholder="璇疯緭鍏ュ叧閿瓧" autocomplete="off">-->
+<!--                        </div>-->
+<!--                        <div class="layui-inline">-->
+<!--                            <button class="layui-btn icon-btn layui-btn-sm" id="treeReset" style="padding: 0 10px">-->
+<!--                                <i class="layui-icon layui-icon-close"></i>-->
+<!--                            </button>-->
+<!--                        </div>-->
+<!--                    </div>-->
+<!--                    &lt;!&ndash; 鏍� &ndash;&gt;-->
+<!--                    <div class="layui-form toolbar" id="organizationTree"></div>-->
+<!--                </div>-->
+<!--            </div>-->
+<!--        </div>-->
         <!-- 鍙� -->
-        <div class="layui-col-md9">
+        <div class="layui-col-md12">
             <div class="layui-card">
                 <div class="layui-card-body" style="padding: 10px;">
                     <!-- 琛ㄦ牸宸ュ叿鏍�2 -->

--
Gitblit v1.9.1