From 273e605c07488911229da645df2f4b128c2d14e4 Mon Sep 17 00:00:00 2001
From: zyx <zyx123456>
Date: 星期三, 28 二月 2024 08:35:02 +0800
Subject: [PATCH] 海诺尔 物料打印码 pda移库增加

---
 src/main/java/com/zy/asrs/controller/OrderController.java  |    1 
 src/main/webapp/static/js/picking/picking.js               |    2 
 src/main/java/com/zy/asrs/utils/PlaExcelListener.java      |  111 +++++++++++++++++++++----------------
 src/main/webapp/static/js/locDetlStatis/locDetlStatis.js   |    7 ++
 src/main/webapp/static/js/pla/plaDetl.js                   |    2 
 src/main/webapp/static/js/saasLog/saasLog.js               |    7 +
 src/main/webapp/views/locDetlStatis/locDetlStatis.html     |    6 +-
 src/main/java/com/zy/asrs/controller/MobileController.java |    5 +
 8 files changed, 84 insertions(+), 57 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/MobileController.java b/src/main/java/com/zy/asrs/controller/MobileController.java
index dea887e..22f753b 100644
--- a/src/main/java/com/zy/asrs/controller/MobileController.java
+++ b/src/main/java/com/zy/asrs/controller/MobileController.java
@@ -430,7 +430,7 @@
         for (Object o : jsonArray){
             JSONObject jsonObject = (JSONObject)o;
             String batch = jsonObject.get("batch").toString();
-            Integer packageNo = Integer.parseInt(json.get("packageNo").toString());
+            Integer packageNo = Integer.parseInt(jsonObject.get("packageNo").toString());
             if(Cools.isEmpty(locNo) || Cools.isEmpty(batch) || Cools.isEmpty(packageNo)){
                 return R.error("鏈夊弬鏁颁负绌猴紝鏃犳硶鍏ュ簱");
             }
@@ -572,6 +572,9 @@
 
         String s = "2024010502";
         System.out.println(s.substring(8,10));
+
+        Object s1 = "8";
+        System.out.println(Integer.parseInt(s1.toString()));
     }
 
 }
diff --git a/src/main/java/com/zy/asrs/controller/OrderController.java b/src/main/java/com/zy/asrs/controller/OrderController.java
index 7ba5554..863f61e 100644
--- a/src/main/java/com/zy/asrs/controller/OrderController.java
+++ b/src/main/java/com/zy/asrs/controller/OrderController.java
@@ -348,6 +348,7 @@
     public R query(String condition) {
         EntityWrapper<Order> wrapper = new EntityWrapper<>();
         wrapper.like("order_no", condition);
+        wrapper.le("settle",3);
         Page<Order> page = orderService.selectPage(new Page<>(0, 10), wrapper);
         List<Map<String, Object>> result = new ArrayList<>();
         for (Order order : page.getRecords()){
diff --git a/src/main/java/com/zy/asrs/utils/PlaExcelListener.java b/src/main/java/com/zy/asrs/utils/PlaExcelListener.java
index 83bc4ef..4cf7385 100644
--- a/src/main/java/com/zy/asrs/utils/PlaExcelListener.java
+++ b/src/main/java/com/zy/asrs/utils/PlaExcelListener.java
@@ -75,38 +75,8 @@
         }
         Pla pla = plaService.selectByBatchAndPackageNo(excel.getBatch(),excel.getPackageNo());
         if (pla == null) {
-            pla = excel;
-            pla.setStep(2);
             pla.setCreateTime(new Date());
-            pla.setModifyTime(new Date());
-            pla.setStatus(GlobleParameter.PLA_STATUS_00);
-            pla.setStockFreeze(1);
-            pla.setWeightAnfme(pla.getWeight());
-            Mat mat = matService.selectByMaktx(pla.getBrand());
-            if(Cools.isEmpty(mat)){
-                throw new CoolException("鏃犳硶鎵惧埌瀵瑰簲鐨勭墝鍙蜂俊鎭紝鐗屽彿=" + pla.getBrand());
-            }
-            pla.setMatnr(mat.getMatnr());
-            try {
-                pla.setType(getType(mat.getMatnr()));
-                //杞﹂棿銆佷骇绾裤�佷富浣�
-                setPla(pla);
-            }catch (Exception e){
-                log.info(e.getMessage() + "Pla: " + pla.getBatch());
-                throw new CoolException(e.getMessage() + "锛屾壒鍙凤細" + excel.getBatch() + ", 鍖呭彿锛�" + excel.getPackageNo());
-            }
-
-            if(!Cools.isEmpty(pla.getLocNo())){
-                Node node = nodeService.selectByUuid(pla.getLocNo());
-                if(Cools.isEmpty(node)){
-                    throw new CoolException("鏈兘鎵惧埌鐩稿簲鐨勫簱浣嶄俊鎭紝搴撲綅缂栧彿=" +pla.getLocNo());
-                    //log.info("鏈兘鎵惧埌鐩稿簲鐨勫簱浣嶄俊鎭紝搴撲綅缂栧彿={}",pla.getLocNo());
-                }
-                pla.setStash(node.getParentName());
-                pla.setLocNo(node.getUuid());
-                pla.setStatus(GlobleParameter.PLA_STATUS_1);
-                pla.setPakinTime(new Date());
-            }
+            plaCreate(pla,excel,matService,nodeService);
             try {
                 plaService.insert(pla);
             }catch (Exception e){
@@ -117,13 +87,15 @@
 //                throw new CoolException("淇濆瓨鍟嗗搧淇℃伅澶辫触锛屽晢鍝佺紪鐮侊細" + excel.getMatnr());
 //            }
             total++;
-        }else if (pla.getStatus().equals(GlobleParameter.PLA_STATUS_00)){
+        }else if(Cools.eq(pla.getStatus(),GlobleParameter.PLA_STATUS_0) || Cools.eq(pla.getStatus(),GlobleParameter.PLA_STATUS_1) || Cools.eq(pla.getStatus(),GlobleParameter.PLA_STATUS_00)){
             excel.setId(pla.getId());
             excel.setCreateTime(pla.getCreateTime());
-            excel.setModifyTime(new Date());
-            excel.setStep(2);
-            excel.setStatus(GlobleParameter.PLA_STATUS_00);
+            excel.setStatus(pla.getStatus());
+            excel.setPakinTime(pla.getPakinTime());
+            excel.setStash(pla.getStash());
+            excel.setLocNo(pla.getLocNo());
             BeanUtils.copyProperties(excel,pla);
+            pla = plaCreate(pla,excel,matService,nodeService);
             try {
                 plaService.updateById(pla);
             }catch (Exception e){
@@ -159,19 +131,24 @@
         String batch = pla.getBatch();
         String line = batch.substring(8,10);
 
-        pla.setLine(line);
-        if("绾爲鑴�".equals(pla.getType())){
-            if("01".equals(line) || "02".equals(line)){
-                pla.setOwner(OWNER_HZ);
-                pla.setWorkshop("涓�杞﹂棿");
-            }else {
-                pla.setOwner(OWNER_HNE);
-                pla.setWorkshop("涓夎溅闂�");
-            }
-        }else if ("鏀规�ф爲鑴�".equals(pla.getType())){
-            if ("01".equals(line) || "02".equals(line) || "03".equals(line) || "04".equals(line)){
-                pla.setOwner(OWNER_HNE);
-                pla.setWorkshop("浜岃溅闂�");
+        if(Cools.isEmpty(pla.getLine())){
+            pla.setLine(line);
+        }
+
+        if(Cools.isEmpty(pla.getOwner()) && Cools.isEmpty(pla.getWorkshop())){
+            if("绾爲鑴�".equals(pla.getType())){
+                if("01".equals(line) || "02".equals(line)){
+                    pla.setOwner(OWNER_HZ);
+                    pla.setWorkshop("涓�杞﹂棿");
+                }else {
+                    pla.setOwner(OWNER_HNE);
+                    pla.setWorkshop("涓夎溅闂�");
+                }
+            }else if ("鏀规�ф爲鑴�".equals(pla.getType())){
+                if ("01".equals(line) || "02".equals(line) || "03".equals(line) || "04".equals(line)){
+                    pla.setOwner(OWNER_HNE);
+                    pla.setWorkshop("浜岃溅闂�");
+                }
             }
         }
     }
@@ -188,4 +165,42 @@
     public int getTotal() {
         return total;
     }
+
+    private Pla plaCreate(Pla pla, PlaExcel excel, MatService matService, NodeService nodeService){
+        pla = excel;
+        pla.setStep(2);
+        pla.setModifyTime(new Date());
+        pla.setStatus(GlobleParameter.PLA_STATUS_00);
+        pla.setStockFreeze(1);
+        pla.setWeightAnfme(pla.getWeight());
+        Mat mat = matService.selectByMaktx(pla.getBrand());
+        if(Cools.isEmpty(mat)){
+            throw new CoolException("鏃犳硶鎵惧埌瀵瑰簲鐨勭墝鍙蜂俊鎭紝鐗屽彿=" + pla.getBrand());
+        }
+        pla.setMatnr(mat.getMatnr());
+        try {
+            if(Cools.isEmpty(pla.getType())){
+                pla.setType(getType(mat.getMatnr()));
+            }
+            //杞﹂棿銆佷骇绾裤�佷富浣�
+            setPla(pla);
+        }catch (Exception e){
+            log.info(e.getMessage() + "Pla: " + pla.getBatch());
+            throw new CoolException(e.getMessage() + "锛屾壒鍙凤細" + excel.getBatch() + ", 鍖呭彿锛�" + excel.getPackageNo());
+        }
+
+        if(!Cools.isEmpty(pla.getLocNo())){
+            Node node = nodeService.selectByUuid(pla.getLocNo());
+            if(Cools.isEmpty(node)){
+                throw new CoolException("鏈兘鎵惧埌鐩稿簲鐨勫簱浣嶄俊鎭紝搴撲綅缂栧彿=" +pla.getLocNo());
+                //log.info("鏈兘鎵惧埌鐩稿簲鐨勫簱浣嶄俊鎭紝搴撲綅缂栧彿={}",pla.getLocNo());
+            }
+            pla.setStash(node.getParentName());
+            pla.setLocNo(node.getUuid());
+            pla.setStatus(GlobleParameter.PLA_STATUS_1);
+            pla.setPakinTime(new Date());
+        }
+
+        return pla;
+    }
 }
diff --git a/src/main/webapp/static/js/locDetlStatis/locDetlStatis.js b/src/main/webapp/static/js/locDetlStatis/locDetlStatis.js
index 6a09c22..0239451 100644
--- a/src/main/webapp/static/js/locDetlStatis/locDetlStatis.js
+++ b/src/main/webapp/static/js/locDetlStatis/locDetlStatis.js
@@ -3,7 +3,7 @@
     var cols = [
         {field: 'brand', align: 'center',title: '鐗屽彿', style: 'font-weight: bold'},
         {field: 'matnr', align: 'center',title: '鍟嗗搧缂栧彿', style: 'font-weight: bold'},
-        {field: 'weight', align: 'center',title: '搴撳瓨鏁伴噺', style: 'font-weight: bold'}
+        {field: 'weight', align: 'center',title: '搴撳瓨閲嶉噺锛圞G锛�', style: 'font-weight: bold'}
     ];
     // arrRemove(detlCols, "field", "anfme")
     // arrRemove(detlCols, "field", "zpallet")
@@ -30,6 +30,11 @@
         limits: [20, 30, 50, 100, 200, 500],
         even: true,
         toolbar: '#toolbar',
+        defaultToolbar: ['filter', 'exports', 'print', {
+            title: '鎻愮ず',
+            layEvent: 'LAYTABLE_TIPS',
+            icon: 'layui-icon-tips'
+        }],
         cellMinWidth: 50,
         cols: [getCol()],
         request: {
diff --git a/src/main/webapp/static/js/picking/picking.js b/src/main/webapp/static/js/picking/picking.js
index 76a4937..353249b 100644
--- a/src/main/webapp/static/js/picking/picking.js
+++ b/src/main/webapp/static/js/picking/picking.js
@@ -31,7 +31,7 @@
             ,{align: 'center', title: '浜岀淮鐮�', toolbar: '#operate', width: 200 , hide:true}
             ,{align: 'center', title: '鏄庣粏', toolbar: '#tbLook', minWidth: 160, width: 160}
             ,{field: 'status$', align: 'center',title: '鐘舵��'}
-            // ,{field: 'custName', align: 'center',title: '瀹㈡埛鍚嶇О', width: 160}
+            ,{field: 'custName', align: 'center',title: '瀹㈡埛鍚嶇О', width: 160}
             ,{field: 'createTime$', align: 'center',title: '鎿嶄綔鏃堕棿'}
             ,{align: 'center', title: '鎿嶄綔', toolbar: '#operate'}
 
diff --git a/src/main/webapp/static/js/pla/plaDetl.js b/src/main/webapp/static/js/pla/plaDetl.js
index 4c5df0a..28312ed 100644
--- a/src/main/webapp/static/js/pla/plaDetl.js
+++ b/src/main/webapp/static/js/pla/plaDetl.js
@@ -120,7 +120,7 @@
         },
         //height: 'full',
         limit: 16,
-        limits: [16, 30, 50, 100, 200, 500],
+        limits: [ 50, 100, 200, 500,2000,5000,10000],
         even: true,
         toolbar: '#toolbar',
         cellMinWidth: 50,
diff --git a/src/main/webapp/static/js/saasLog/saasLog.js b/src/main/webapp/static/js/saasLog/saasLog.js
index 1c6c43e..644c637 100644
--- a/src/main/webapp/static/js/saasLog/saasLog.js
+++ b/src/main/webapp/static/js/saasLog/saasLog.js
@@ -25,9 +25,12 @@
             ,{field: 'id', align: 'center',title: 'id', hide:true}
             ,{field: 'locNo', align: 'center',title: '搴撲綅'}
             ,{field: 'type$', align: 'center',title: '鎿嶄綔绫诲瀷'}
-            ,{field: 'matnr', align: 'center',title: '鐗╂枡鍙�'}
+            ,{field: 'matnr', align: 'center',title: '鐗屽彿'}
+            ,{field: 'batch', align: 'center',title: '鎵瑰彿'}
+            ,{field: 'packageNo', align: 'center',title: '鍖呭彿'}
+            ,{field: 'targetLocNo', align: 'center',title: '鐩爣搴撲綅'}
             ,{field: 'anfme', align: 'center',title: '鏁伴噺'}
-            ,{field: 'createByName', align: 'center',title: '鎿嶄綔浜�'}
+            // ,{field: 'createByName', align: 'center',title: '鎿嶄綔浜�'}
             ,{field: 'ioTime$', align: 'center',title: '鎿嶄綔鏃堕棿'}
             ,{field: 'createBy', align: 'center',title: '', hide:true}
 
diff --git a/src/main/webapp/views/locDetlStatis/locDetlStatis.html b/src/main/webapp/views/locDetlStatis/locDetlStatis.html
index 0e61216..78b706d 100644
--- a/src/main/webapp/views/locDetlStatis/locDetlStatis.html
+++ b/src/main/webapp/views/locDetlStatis/locDetlStatis.html
@@ -42,9 +42,9 @@
 </div>
 <script type="text/html" id="toolbar">
 
-    <div class="layui-btn-container layui-col-md1">
-        <button class="layui-btn" lay-event="exportAll" style="margin-top: -0px">瀵煎嚭鍏ㄩ儴</button>
-    </div>
+<!--    <div class="layui-btn-container layui-col-md1">-->
+<!--        <button class="layui-btn" lay-event="exportAll" style="margin-top: -0px">瀵煎嚭鍏ㄩ儴</button>-->
+<!--    </div>-->
 </script>
 
 

--
Gitblit v1.9.1