From adcccd48501fef21d364859bb2cfb383ebde2a8c Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期五, 28 十一月 2025 15:24:46 +0800
Subject: [PATCH] 保留拣货数量两位小数

---
 rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/PdaOutStockServiceImpl.java |    8 +++++---
 rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/ReportMsgServiceImpl.java   |    2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/PdaOutStockServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/PdaOutStockServiceImpl.java
index d8b524c..e2cf92e 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/PdaOutStockServiceImpl.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/PdaOutStockServiceImpl.java
@@ -341,7 +341,8 @@
                     }
                 }
 
-                item.setQty(item.getQty() + taskItem.getAnfme()).setOrderId(order.getId()).setOrderItemId(orderItem.getId());
+                Double picQty = Math.round((item.getQty() + taskItem.getAnfme()) * 100) / 100.0;
+                item.setQty(picQty).setOrderId(order.getId()).setOrderItemId(orderItem.getId());
                 if (!taskItemService.updateById(item)) {
                     throw new CoolException("鐘舵�佸畬鎴愬け璐ワ紒锛�");
                 }
@@ -357,9 +358,10 @@
         });
 
         List<WkOrderItem> orderItems = asnOrderItemService.list(new LambdaQueryWrapper<WkOrderItem>().eq(WkOrderItem::getOrderId, params.getOrderId()));
-        double total = orderItems.stream().mapToDouble(WkOrderItem::getQty).sum();
+        Double total = orderItems.stream().mapToDouble(WkOrderItem::getQty).sum();
         Double wkQty = orderItems.stream().mapToDouble(WkOrderItem::getWorkQty).sum();
-        order.setQty(total).setWorkQty(order.getWorkQty().compareTo(wkQty) < 0 ? 0.0 : (total - wkQty));
+        double v = order.getWorkQty().compareTo(wkQty) < 0 ? 0.0 : Math.round((total - wkQty) * 100) / 100.0;
+        order.setQty(total).setWorkQty(v);
         if (!asnOrderService.updateById(order)) {
             throw new CoolException("璁㈠崟鏁伴噺鏇存柊澶辫触锛侊紒");
         }
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/ReportMsgServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/ReportMsgServiceImpl.java
index 56a5de0..aa73bc1 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/ReportMsgServiceImpl.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/ReportMsgServiceImpl.java
@@ -389,7 +389,7 @@
                 Set<Long> stockIds = stockItems.stream().map(StockItem::getStockId).collect(Collectors.toSet());
                 List<Stock> stocks = stockService.listByIds(stockIds);
                 //杩囨护鎷h揣鍏ュ簱鏄庣粏锛岄伩鍏嶄笂鎶�
-                List<Stock> stockList = stocks.stream().filter(stock -> stock.getType().equals(OrderType.ORDER_OUT.type)).collect(Collectors.toList());
+                List<Stock> stockList = stocks.stream().filter(stock -> stock.getType().equals(OrderType.ORDER_OUT.type) && !Objects.isNull(stock.getSourceCode())).collect(Collectors.toList());
                 List<Long> list = stockList.stream().map(Stock::getId).collect(Collectors.toList());
                 List<StockItem> stockItems1 = stockItemService.list(new LambdaQueryWrapper<StockItem>().in(StockItem::getStockId, list));
                 String finalNickName = nickName;

--
Gitblit v1.9.1