From c3a72cea5680c579c87463f9dab6f79fbe3d7a87 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期二, 31 十二月 2024 08:59:20 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/common/web/WcsController.java |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/zy/common/web/WcsController.java b/src/main/java/com/zy/common/web/WcsController.java
index a2a8fa1..6b93c73 100644
--- a/src/main/java/com/zy/common/web/WcsController.java
+++ b/src/main/java/com/zy/common/web/WcsController.java
@@ -8,6 +8,7 @@
 import com.zy.asrs.entity.*;
 import com.zy.asrs.entity.param.EmptyPlateOutParam;
 import com.zy.asrs.service.*;
+import com.zy.asrs.service.impl.MatServiceImpl;
 import com.zy.asrs.utils.Utils;
 import com.zy.common.CodeRes;
 import com.zy.common.model.LocDto;
@@ -60,6 +61,8 @@
     private WrkMastLogService wrkMastLogService;
     @Autowired
     private WrkDetlLogService wrkDetlLogService;
+    @Autowired
+    private MatServiceImpl matService;
 
     @PostMapping("/pakin/loc/v1")
     @ResponseBody
@@ -357,7 +360,7 @@
         log.info("鏀跺埌WCS缃愯鍑哄簱鎺ュ彛璇锋眰");
         Date now = new Date();
         // 鏌ヨ搴撳瓨鐘舵�佷綅F 涓� 搴撳瓨鏄庣粏鍖呭惈璇ョ墿鏂欑殑搴撲綅
-        LocMast tarLoc = locMastService.getLocFByMatnr("BC20009TY13701530");
+        LocMast tarLoc = locMastService.getLocFByMatnr("CP24609KS12300118");
         if (Cools.isEmpty(tarLoc)) {
             throw new CoolException("娌℃湁鍙嚭搴撶殑搴撲綅");
         }
@@ -470,8 +473,19 @@
             if (!wrkMastService.updateById(wrkMast)) {
                 throw new CoolException("鏇存柊宸ヤ綔妗f暟鎹姸鎬佸け璐�");
             }
+            List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo());
+            for (WrkDetl wrkDetl : wrkDetls) {
+                Mat mat = matService.selectByMatnr("CP25009TY10000248");
+                WrkDetl wrkDetl1 = new WrkDetl();
+                wrkDetl1.sync(wrkDetl);
+                wrkDetl1.sync(mat);
+                wrkDetl1.setIoTime(now);
+                wrkDetlService.insert(wrkDetl1);
+            }
+            wrkDetlService.delete(new EntityWrapper<WrkDetl>().eq("matnr", "BC20009TY13701530").eq("wrk_no",wrkMast.getWrkNo()));
             // 鏇存柊鏄庣粏妗o_time (鍘嗗彶妗e叧鑱斾娇鐢級
-            wrkDetlService.updateIoTime(wrkMast.getWrkNo(), now);
+//            wrkDetlService.updateIoTime(wrkMast.getWrkNo(), now);
+
             // 淇敼搴撲綅鐘舵�� Q.鎷f枡/鐩樼偣/骞舵澘鍐嶅叆搴�
             LocMast locMast = locMastService.selectById(wrkMast.getLocNo());
             locMast.setLocSts("Q");

--
Gitblit v1.9.1