From b09865e3b4e43ec7110ca7472188478fcdb6fb0f Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期三, 22 三月 2023 09:41:32 +0800
Subject: [PATCH] #库存档案同步上报

---
 src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

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 c16f230..7b4bd8c 100644
--- a/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
+++ b/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -44,6 +44,8 @@
     @Autowired
     private OrderDetlService orderDetlService;
     @Autowired
+    private WaitPakinService waitPakinService;
+    @Autowired
     private ApiLogService apiLogService;
     @Value("${mes.url}")
     private String mesUrl;
@@ -152,7 +154,11 @@
                         locMast.setIoTime(now);
                         locMast.setModiTime(now);
                         locMast.setFireStatus(0);
-                        locMast.setPackStatus(1);
+                        if (locMast.getCrnNo()==1){
+                            locMast.setPackStatus(1);
+                        }else {
+                            locMast.setPackStatus(6);
+                        }
                         if (!locMastService.updateById(locMast)) {
 //                            exceptionHandle("鍏ㄦ澘鍏ュ簱 ===>> 淇敼搴撲綅鐘舵�佸け璐ワ紱[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo());
                             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -387,6 +393,23 @@
                         return FAIL.setMsg("鍏ㄦ澘鍑哄簱 ===>> 宸ヤ綔鏄庣粏妗d负绌�; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getSourceLocNo() + "]");
                     }
                     for (WrkDetl wrkDetl : wrkDetls101) {
+                        Date date = new Date();
+                        WaitPakin waitPakin = new WaitPakin();
+                        waitPakin.setMatnr(wrkDetl.getMatnr());
+                        waitPakin.setMaktx(wrkDetl.getMaktx());
+                        waitPakin.setZpallet(wrkDetl.getZpallet());   // Pack鐮�
+                        waitPakin.setIoStatus("N");     // 鍏ュ嚭鐘舵��
+                        waitPakin.setAnfme(1.0);  // 鏁伴噺
+                        waitPakin.setStatus("Y");    // 鐘舵��
+                        waitPakin.setManuDate(date.toString());
+                        waitPakin.setAppeUser(null);
+                        waitPakin.setAppeTime(date);
+                        waitPakin.setModiUser(null);
+                        waitPakin.setModiTime(date);
+//                        waitPakin.setDeadWarn(wrkDetl.getSettingTimes());
+                        if (!waitPakinService.insert(waitPakin)) {
+                            throw new CoolException("淇濆瓨鍏ュ簱閫氱煡妗eけ璐�");
+                        }
                         // 鏇存柊璁㈠崟瀹屾垚鏁伴噺
                         OrderDetl orderDetl = orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
                         try {

--
Gitblit v1.9.1