From 679337e1b556d5e225ba692ef12ccddd3447a9f2 Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期五, 12 十二月 2025 12:34:20 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java |   48 ++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 38 insertions(+), 10 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
index ba089da..3848d97 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -1589,17 +1589,16 @@
         if (Objects.isNull(params.getBsCode())) {
             throw new CoolException("BS鐮佷笉鑳戒负绌猴紒锛�");
         }
-        Task task = taskService.selectOne(new EntityWrapper<Task>()
-                .eq("io_type", TaskIOType.PICK_OUT.type)
-                .eq("wrk_sts", 14)
-                .eq("barcode", params.getCarBarcode()));
-        if (Objects.isNull(task)) {
-            throw new CoolException("鏁版嵁閿欒锛氫换鍔′俊鎭瓨鍦紒锛�");
-        }
+//        Task task = taskService.selectOne(new EntityWrapper<Task>()
+//                .eq("io_type", TaskIOType.PICK_OUT.type)
+//                .eq("wrk_sts", 14)
+//                .eq("barcode", params.getCarBarcode()));
+//        if (Objects.isNull(task)) {
+//            throw new CoolException("鏁版嵁閿欒锛氫换鍔′俊鎭瓨鍦紒锛�");
+//        }
 
-        List<TaskDetl> taskDetl = taskDetlService.selectList(new EntityWrapper<TaskDetl>()
+        List<BasStationDetl> taskDetl = basStationDetlService.selectList(new EntityWrapper<BasStationDetl>()
                 .eq("three_code", params.getBsCode())
-                .eq("wrk_no", task.getWrkNo())
                 .eq("zpallet", params.getCarBarcode()));
 
         if (Objects.isNull(taskDetl) || taskDetl.isEmpty()) {
@@ -1688,9 +1687,22 @@
                 throw new CoolException("鐗╂枡锛�" + detlDto.getMatnr() + ", 瓒呭嚭褰撳墠鎵樼洏瑁呰浇涓婇檺锛侊紒");
             }
 
+            BasStationDetl stationDetl = basStationDetlService.selectOne(new EntityWrapper<BasStationDetl>()
+                    .eq("zpallet", param.getCarBarcode())
+                    .eq("three_code", detlDto.getThreeCode()));
+            if (Objects.isNull(stationDetl)) {
+                throw new CoolException("鏄庣粏鍐呭涓嶅瓨鍦紒锛�");
+            }
+
+            Double v = stationDetl.getAnfme() - stationDetl.getWorkQty();
+            if (detlDto.getAnfme().compareTo(v) > 0) {
+                throw new CoolException("缁勬墭涓婇檺涓猴細" + stationDetl.getAnfme() + ", 宸茬粍鎵橈細" + stationDetl.getWorkQty() + ", 杩樺彲缁勬墭锛�" + v);
+            }
+
             WaitPakin waitPakin = new WaitPakin();
             BeanUtils.copyProperties(mat, waitPakin);
             waitPakin.setBatch(detlDto.getBatch());
+            waitPakin.setType(param.getType());
             waitPakin.setZpallet(param.getBarcode());
             // 璁剧疆缁勬墭绫诲瀷
             waitPakin.setType(param.getType());
@@ -1698,6 +1710,7 @@
             waitPakin.setAnfme(detlDto.getAnfme());
             waitPakin.setThreeCode(detlDto.getThreeCode());
             waitPakin.setStatus("Y");
+            waitPakin.setSuppCode(detlDto.getStandby1());
             waitPakin.setStandby1(detlDto.getStandby1());
             waitPakin.setStandby2(detlDto.getStandby2());
             waitPakin.setStandby3(detlDto.getStandby3());
@@ -1711,6 +1724,20 @@
             if (!waitPakinService.insert(waitPakin)) {
                 throw new CoolException("淇濆瓨鍏ュ簱閫氱煡妗eけ璐�");
             }
+
+            Double v1 = stationDetl.getWorkQty() + detlDto.getAnfme();
+            stationDetl.setWorkQty(v1);
+
+            if (!basStationDetlService.updateById(stationDetl)) {
+                throw new CoolException("绔欑偣鏄庣粏淇敼澶辫触");
+            }
+
+            if (v1.compareTo(stationDetl.getWorkQty()) >= 0) {
+                if (!basStationDetlService.deleteById(stationDetl)) {
+                    throw new CoolException("鍘熷鏁版嵁绉婚櫎澶辫触锛�");
+                }
+            }
+
         }
     }
 
@@ -1814,6 +1841,7 @@
                         .setOrderNo(orderPakin.getOrderNo())
                         .setDevNo(basStation.getDevNo())
                         .setBarcode(params.getTarBarcode())
+                        .setZpallet(params.getTarBarcode())
                         .setBatch(combMat.getBatch())
                         .setStandby1(combMat.getStandby1())
                         .setAnfme(combMat.getWorkQty().doubleValue());
@@ -2212,7 +2240,7 @@
         task.setWrkNo(workNo)
                 .setIoTime(new Date())
                 .setWrkSts(11L) // 宸ヤ綔鐘舵�侊細11.鐢熸垚鍑哄簱ID
-                .setIoType(loc.getLocSts().equals("D") ? 110 : 103) // 鍏ュ嚭搴撶姸鎬侊細 11.搴撴牸绉昏浇
+                .setIoType(loc.getLocSts().equals("D") ? 110 : 101) // 鍏ュ嚭搴撶姸鎬侊細 11.搴撴牸绉昏浇
                 .setTaskType("agv")
                 .setIoPri(10D)
                 .setFullPlt(loc.getLocSts().equals("D") ? "N" : "Y") // 婊℃澘锛歒

--
Gitblit v1.9.1