From 736d5e19b01e116d551d47e3782234ca3b62f0b4 Mon Sep 17 00:00:00 2001
From: zyx <zyx123456>
Date: 星期一, 01 四月 2024 19:35:08 +0800
Subject: [PATCH] 拣料出库任务号变更

---
 src/main/java/com/zy/asrs/controller/OrderController.java |   44 ++++++++++++++++++++------------------------
 1 files changed, 20 insertions(+), 24 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/OrderController.java b/src/main/java/com/zy/asrs/controller/OrderController.java
index 7db8719..3caedd3 100644
--- a/src/main/java/com/zy/asrs/controller/OrderController.java
+++ b/src/main/java/com/zy/asrs/controller/OrderController.java
@@ -439,43 +439,37 @@
         DataFormatter dataFormatter = new DataFormatter();
         for (int i = 1; i < totalRows; i++) {
             Row row = sheet.getRow(i);
-            // 璁㈠崟缂栧彿
-            String uuid = dataFormatter.formatCellValue(row.getCell(0));
-            // 鐗╂枡鍙�
-            String maktx = dataFormatter.formatCellValue(row.getCell(1));
-            // 鐗╂枡鍙�
+            //鍗曟嵁绫诲瀷
+            String docName =  dataFormatter.formatCellValue(row.getCell(0));
+            //鍗曟嵁缂栧彿
+            String uuid = dataFormatter.formatCellValue(row.getCell(1));
+            //鐗╂枡鍙�
             String matnr = dataFormatter.formatCellValue(row.getCell(2));
+            //閿�鍞崟鍙�
+            String csocode = dataFormatter.formatCellValue(row.getCell(3));
+            //鑷敱椤�
+            String isocode = dataFormatter.formatCellValue(row.getCell(4));
             // 鏁伴噺
-            Double anfme = Double.parseDouble(dataFormatter.formatCellValue(row.getCell(3)));
-            // 涓嬪崟鏃堕棿
-            String timeStr = dataFormatter.formatCellValue(row.getCell(4));
-            // 閿�鍞鍗曞彿
-            String csocode = dataFormatter.formatCellValue(row.getCell(5));
-            // 閿�鍞鍗曡鍙�
-            String isocode = dataFormatter.formatCellValue(row.getCell(6));
-            Date time = null;
-            try {
-                time = DateUtils.convert(timeStr, DateUtils.yyyyMMddHHmmss_F);
-            } catch (Exception e) {
-                throw new CoolException("绗�" + i + "琛屼笅鐨勯偅鏃堕棿瑙f瀽澶辫触锛岃閲嶆柊瀵煎叆锛�");
+            if(Cools.isEmpty(dataFormatter.formatCellValue(row.getCell(5)))){
+                continue;
             }
-            // 鍟嗗搧绯诲垪
-            String tagName = dataFormatter.formatCellValue(row.getCell(5));
-            // 瑙勬牸
-            String specs = dataFormatter.formatCellValue(row.getCell(6));
-
+            Double anfme = Double.parseDouble(dataFormatter.formatCellValue(row.getCell(5)));
             Mat mat = matService.selectByMatnr(matnr);
             if (null == mat) {
                 throw new CoolException(matnr + "鍟嗗搧缂栫爜鐨勫晢鍝佷笉瀛樺湪锛岃閲嶆柊瀵煎叆锛�");
             }
+
+            //String timeStr = DateUtils.convert(new Date());
+
+            DocType docType = docTypeService.selectOne(new EntityWrapper<DocType>().eq("doc_name", docName));
 
             Order order = orderService.selectByNo(uuid);
             if (null == order) {
                 order = new Order(
                         String.valueOf(snowflakeIdWorker.nextId()),    // 缂栧彿[闈炵┖]
                         uuid,    // 璁㈠崟缂栧彿
-                        timeStr,    // 鍗曟嵁鏃ユ湡
-                        14L,    // 鍗曟嵁绫诲瀷
+                        null,    // 鍗曟嵁鏃ユ湡
+                        docType.getDocId(),    // 鍗曟嵁绫诲瀷
                         null,    // 椤圭洰缂栧彿
                         null,    //
                         null,    // 璋冩嫧椤圭洰缂栧彿
@@ -524,6 +518,8 @@
                 orderDetl.setCreateTime(now);
                 orderDetl.setUpdateBy(userId);
                 orderDetl.setUpdateTime(now);
+                orderDetl.setThreeCode(csocode);
+                orderDetl.setDeadTime(isocode);
                 orderDetl.setStatus(1);
                 orderDetl.setQty(0.0D);
                 if (!orderDetlService.insert(orderDetl)) {

--
Gitblit v1.9.1