From 49b8b52ae6dfb28e3e9a741bb277c231bd13418d Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期五, 04 七月 2025 15:51:45 +0800
Subject: [PATCH] 库存明细出库

---
 zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/MobileServiceImpl.java |   80 ++++++++++++++++++++--------------------
 1 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/MobileServiceImpl.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/MobileServiceImpl.java
index dc72f46..5363d26 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/MobileServiceImpl.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/MobileServiceImpl.java
@@ -106,7 +106,9 @@
                     .setMatnr(orderdetl.getMatnr())
                     .setDetlId(orderdetl.getDetlId())
                     .setIoStatus(0)
-                    .setOrderNo(orderdetl.getOrderNo()).setOrderId(orderdetl.getOrderId()).setStatus(1);
+                    .setOrderNo(orderdetl.getOrderNo())
+                    .setOrderId(orderdetl.getOrderId())
+                    .setStatus(1);
             waitPakins.add(waitPakin);
         });
 
@@ -115,8 +117,9 @@
             waitPakinService.comb(pakin);
         });
 
+
         // UTC鍏ュ簱鍗曟嵁(闈炲钩搴撳叆搴撳崟鎹�)
-        if (order.getOrderType() != OrderType.PK_IN_ORDER.id) {
+        if (!ordersParam.getInType().equals(OrderType.PK_IN_ORDER.id)) {
             /*** 椤圭洰涓嬪彂娴佺▼ * 1. PDA缁勬嫋閫氱煡妗�* 2. 鐢熸垚浠诲姟妗�* 3. 閫氳繃瀹氭椂浠诲姟涓嬪彂鑷矱SS** */
             //鐢熸垚浠诲姟妗�
             GeneratePakInParam generatePakInParam = new GeneratePakInParam();
@@ -202,6 +205,7 @@
             WaitPakinLog pakinLog = new WaitPakinLog();
             BeanUtils.copyProperties(waitPakin, pakinLog);
             pakinLog.setIoStatus(1);
+            pakinLog.setId(null);
             if (!waitPakinLogService.saveOrUpdate(pakinLog)) {
                 throw new CoolException("缁勬嫋鍘嗗彶妗f洿鏂板け璐�");
             }
@@ -215,13 +219,14 @@
         List<Order> orders = orderService.list(new LambdaQueryWrapper<Order>().in(Order::getId, list));
         //璁㈠崟鍏ュ巻鍙叉。
         orders.forEach(order -> {
-            if (order.getOrderType() != OrderType.PK_IN_ORDER.id) {
-                throw new CoolException("褰撳墠璁㈠崟绫诲瀷:" + order.getOrderType() + ",涓嶅彲鍋氬钩搴撲笂鏋舵搷浣滐紒锛�");
-            }
+//            if (order.getOrderType() != OrderType.PK_IN_ORDER.id) {
+//                throw new CoolException("褰撳墠璁㈠崟绫诲瀷:" + order.getOrderType() + ",涓嶅彲鍋氬钩搴撲笂鏋舵搷浣滐紒锛�");
+//            }
             //淇敼璁㈠崟鐘舵�佷负宸插畬鎴�
             order.setOrderSettle(OrderSettleType.COMPLETE.val());
             OrderLog orderLog = new OrderLog();
             BeanUtils.copyProperties(order, orderLog);
+            orderLog.setId(null);
             if (!orderLogService.save(orderLog)) {
                 throw new CoolException("鍘嗗彶鍗曟嵁鏇存柊澶辫触锛侊紒");
             }
@@ -239,6 +244,7 @@
             BeanUtils.copyProperties(delt, detlLog);
             detlLog.setQty(delt.getWorkQty());
             detlLog.setWorkQty(0.0);
+            detlLog.setId(null);
             detlLogs.add(detlLog);
         });
 
@@ -391,7 +397,10 @@
             if (Objects.isNull(order)) {
                 throw new CoolException("缁戝畾璁㈠崟涓嶅瓨鍦紒锛�");
             }
-            siteNo.setOrderNo(order.getOrderNo()).setOrderId(order.getId()).setSiteStatus(CacheSiteStatusType.R.id).setBarcode(param.get("barcode").toString());
+            siteNo.setOrderNo(order.getOrderNo())
+                    .setOrderId(order.getId())
+                    .setSiteStatus(CacheSiteStatusType.R.id)
+                    .setBarcode(param.get("barcode").toString());
             if (cacheSiteMapper.updateById(siteNo) < 1) {
                 throw new CoolException("璁㈠崟鎾浣嶇粦瀹氬け璐ワ紒锛�" );
             }
@@ -407,7 +416,7 @@
             if (StringUtil.isNullOrEmpty(siteNo.getOrderNo())) {
                 throw new CoolException("褰撳墠鎾绔欑偣鏈粦瀹氳鍗曪紒锛�");
             }
-           siteNo.setOrderId(null).setOrderNo(null).setSiteNo("0");
+           siteNo.setOrderId(null).setOrderNo(null).setBarcode(null).setSiteNo("0");
             if (cacheSiteMapper.updateById(siteNo) < 1) {
                 throw new CoolException("璁㈠崟涓庢挱绉嶄綅瑙g粦澶辫触锛侊紒" );
             }
@@ -468,6 +477,7 @@
             }
             OrderDetlLog orderDetlLog = new OrderDetlLog();
             BeanUtils.copyProperties(byId, orderDetlLog);
+            orderDetlLog.setId(null);
             orderDetlLog.setQty(order.getWorkQty());
             orderDetlLog.setWorkQty(0.0);
             if (!orderDetlLogService.save(orderDetlLog)) {
@@ -511,6 +521,7 @@
         orderList.forEach(one -> {
             OrderLog orderLog = new OrderLog();
             BeanUtils.copyProperties(one, orderLog);
+            orderLog.setId(null);
             orderLog.setOrderSettle(OrderSettleType.COMPLETE.val());
 
             if (!orderLogService.save(orderLog)) {
@@ -528,39 +539,6 @@
                 if (orderService.updateById(one));
             }
         });
-
-        Set<Long> waveIds = orderList.stream().map(Order::getWaveId).collect(Collectors.toSet());
-        if (waveIds.isEmpty()) {
-            throw new CoolException("娉㈡淇℃伅涓虹┖锛侊紒");
-        }
-        List<Wave> waves = waveService.list(new LambdaQueryWrapper<Wave>().eq(Wave::getId, waveIds));
-        for (Wave wave : waves) {
-            WaveLog waveLog = new WaveLog();
-            waveLog.sync(wave);
-            waveLog.setId(null);
-            if (!waveLogService.save(waveLog)) {
-                throw new CoolException("娉㈡杞巻鍙插け璐�");
-            }
-
-            List<WaveDetl> waveDetls = waveDetlService.list(new LambdaQueryWrapper<WaveDetl>().eq(WaveDetl::getWaveId, wave.getId()));
-            for (WaveDetl waveDetl : waveDetls) {
-                WaveDetlLog waveDetlLog = new WaveDetlLog();
-                waveDetlLog.sync(waveDetl);
-                waveDetlLog.setId(null);
-                waveDetlLog.setWaveId(waveLog.getId());
-                if (!waveDetlLogService.save(waveDetlLog)) {
-                    throw new CoolException("娉㈡鏄庣粏杞巻鍙插け璐�");
-                }
-
-                if (!waveDetlService.removeById(waveDetl.getId())) {
-                    throw new CoolException("娉㈡鏄庣粏鍒犻櫎澶辫触");
-                }
-            }
-
-            if (!waveService.removeById(wave.getId())) {
-                throw new CoolException("娉㈡鍒犻櫎澶辫触");
-            }
-        }
 
         Set<Long> ordersSet = orderList.stream().map(Order::getId).collect(Collectors.toSet());
         List<PlatformDetl> platDetls = platformDetlService.list(new LambdaQueryWrapper<PlatformDetl>().in(PlatformDetl::getOrderId, ordersSet));
@@ -582,4 +560,26 @@
         return R.ok("鍙戣揣瀹屾垚锛侊紒");
     }
 
+    /**
+     * @author Ryan
+     * @date 2025/6/28
+     * @description: 鑾峰彇骞冲簱鎺ㄨ崘搴撲綅
+     * @version 1.0
+     */
+    @Override
+    public R getRecommendLocs() {
+        return locService.getRecommengLocs();
+    }
+
+    /**
+     * @author Ryan
+     * @date 2025/6/28
+     * @description: 鏌ヨ鐗╂枡淇℃伅
+     * @version 1.0
+     */
+    @Override
+    public R getMatsByCode(String matnr) {
+        return R.ok().add(matService.list(new LambdaQueryWrapper<Mat>().eq(Mat::getMatnr, matnr)));
+    }
+
 }

--
Gitblit v1.9.1