From 161cdb87ddb09d99ef5af4b55e7e7b18c5084615 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期四, 08 五月 2025 15:27:04 +0800
Subject: [PATCH] #

---
 rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/WaitPakinServiceImpl.java |   30 +++++++++++++-----------------
 1 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/WaitPakinServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/WaitPakinServiceImpl.java
index a848234..0fde5f0 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/WaitPakinServiceImpl.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/WaitPakinServiceImpl.java
@@ -65,7 +65,6 @@
         }
         List<Short> asList = Arrays.asList(Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val), Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val));
         WaitPakin pakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>()
-                .notIn(WaitPakin::getIoStatus, asList)
                 .eq(WaitPakin::getBarcode, waitPakin.getBarcode()));
         if (!Objects.isNull(pakin)) {
             throw new CoolException("鎵樼洏鐮侊細" + waitPakin.getBarcode() + "宸茶缁勬墭鍗曪細" + pakin.getCode() + "浣跨敤锛侊紒");
@@ -201,8 +200,8 @@
             }
             List<Long> list = paramItems.stream().map(PakinItem::getId).collect(Collectors.toList());
             List<WaitPakinItem> pakinItems = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>()
-                    .eq(WaitPakinItem::getPakinId, waitPakins.getId())
-                    .in(WaitPakinItem::getSource, list));
+                    .in(WaitPakinItem::getId, list)
+                    );
             if (pakinItems.isEmpty()) {
                 throw new CoolException("鏁版嵁閿欒锛氱粍鎵樻槑缁嗕笉瀛樺湪锛侊紒");
             }
@@ -210,11 +209,11 @@
 //            if (!waitPakinItemService.removeByIds(ids)) {
 //                throw new CoolException("缁勬墭鏄庣粏瑙g粦澶辫触锛侊紒");
 //            }
-
-            List<WarehouseAreasItem> warehouseAreasItems = warehouseAreasItemService.listByIds(list);
+            List<Long> list2 = pakinItems.stream().map(WaitPakinItem::getSource).collect(Collectors.toList());
+            List<WarehouseAreasItem> warehouseAreasItems = warehouseAreasItemService.listByIds(list2);
             for (int i1 = 0; i1 < pakinItems.size(); i1++) {
                 for (PakinItem item : paramItems) {
-                    if (item.getId().equals(pakinItems.get(i1).getSource())) {
+                    if (item.getId().equals(pakinItems.get(i1).getId())) {
                         if (pakinItems.get(i1).getAnfme().compareTo(item.getReceiptQty()) > 0) {
                             if (item.getReceiptQty().compareTo(0.00) == 0) {
                                 throw new CoolException("瑙g粦鏁伴噺涓嶈兘涓洪浂锛侊紒");
@@ -231,17 +230,14 @@
                                 throw new CoolException("缁勬墭鏄庣粏鍒犻櫎澶辫触锛侊紒");
                             }
                         }
-                    }
-                }
-            }
-
-            for (int a = 0; a < paramItems.size(); a++) {
-                for (int i = 0; i < warehouseAreasItems.size(); i++) {
-                    if (warehouseAreasItems.get(i).getId().equals(paramItems.get(a).getId())) {
-                        double v = warehouseAreasItems.get(i).getWorkQty() - paramItems.get(a).getReceiptQty();
-                        warehouseAreasItems.get(i).setWorkQty(v);
-                        if (!warehouseAreasItemService.updateById(warehouseAreasItems.get(i))) {
-                            throw new CoolException("鏀惰揣鍖烘暟閲忎慨鏀瑰け璐ワ紒锛�");
+                        for (int i = 0; i < warehouseAreasItems.size(); i++) {
+                            if (warehouseAreasItems.get(i).getId().equals(pakinItems.get(i1).getSource())) {
+                                double v = warehouseAreasItems.get(i).getWorkQty() - item.getReceiptQty();
+                                warehouseAreasItems.get(i).setWorkQty(v);
+                                if (!warehouseAreasItemService.updateById(warehouseAreasItems.get(i))) {
+                                    throw new CoolException("鏀惰揣鍖烘暟閲忎慨鏀瑰け璐ワ紒锛�");
+                                }
+                            }
                         }
                     }
                 }

--
Gitblit v1.9.1