From d52bab61f91056e75e60ddeda76a72cd1bd63615 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期四, 07 八月 2025 14:40:00 +0800
Subject: [PATCH] no message
---
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/WaitPakinServiceImpl.java | 29 ++++++++++++++++++++---------
1 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/WaitPakinServiceImpl.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/WaitPakinServiceImpl.java
index 09011e2..c5e3ca2 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/WaitPakinServiceImpl.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/WaitPakinServiceImpl.java
@@ -36,7 +36,7 @@
@Override
@Transactional(rollbackFor = Exception.class)
- public boolean comb(WaitPakin waitPakin) {
+ public boolean comb(WaitPakin waitPakin, Long inType) {
//缁勬墭瑙勫垯鏍¢獙
waitPakinRuleService.rule(waitPakin);
@@ -59,14 +59,23 @@
throw new CoolException("璁㈠崟鏄庣粏涓嶅瓨鍦�");
}
- //鍙敤鏁伴噺
- Double count = orderDetl.getAnfme() - orderDetl.getQty() - orderDetl.getWorkQty() - orderDetl.getWaitQty();
- if (waitPakin.getAnfme() > count) {
- throw new CoolException("缁勬墭鏁伴噺瓒呰繃鍓╀綑鍙敤鏁伴噺");
+ if (inType.equals(OrderType.PK_IN_ORDER.id)) {
+ Double sCount = Math.round((orderDetl.getAnfme() - orderDetl.getWaitQty()) * 1000) / 1000.0;
+ if (waitPakin.getAnfme().compareTo(sCount) > 0) {
+ throw new CoolException("缁勬墭鏁伴噺瓒呰繃鍓╀綑鍙敤鏁伴噺");
+ }
+ } else {
+// Double count = orderDetl.getAnfme() - orderDetl.getQty() - orderDetl.getWorkQty() - orderDetl.getWaitQty();
+ Double count = Math.round((orderDetl.getAnfme() - orderDetl.getWorkQty() - orderDetl.getQty()) * 1000) / 1000.0;
+ if (waitPakin.getAnfme().compareTo(count) > 0) {
+ throw new CoolException("缁勬墭鏁伴噺瓒呰繃鍓╀綑鍙敤鏁伴噺");
+ }
}
//鏌ヨ鏄惁瀛樺湪鐩稿悓鏄庣粏鍜屾墭鐩樼爜鐨勭粍鎵橀�氱煡妗�
- WaitPakin waitPakin1 = this.getOne(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, waitPakin.getBarcode()).eq(WaitPakin::getDetlId, waitPakin.getDetlId()));
+ WaitPakin waitPakin1 = this.getOne(new LambdaQueryWrapper<WaitPakin>()
+ .eq(WaitPakin::getBarcode, waitPakin.getBarcode())
+ .eq(WaitPakin::getDetlId, waitPakin.getDetlId()));
if (waitPakin1 == null) {
//涓嶅瓨鍦ㄧ粍鎵橀�氱煡妗o紝鍒涘缓
waitPakin.setMatnr(orderDetl.getMat$().getMatnr());
@@ -75,8 +84,9 @@
throw new CoolException("娣诲姞澶辫触");
}
}else {
+ Double total = waitPakin1.getAnfme() + waitPakin.getAnfme();
//瀛樺湪缁勬墭閫氱煡妗o紝鏇存柊
- waitPakin1.setAnfme(waitPakin1.getAnfme() + waitPakin.getAnfme());
+ waitPakin1.setAnfme(total);
waitPakin1.setUpdateTime(new Date());
if (!this.updateById(waitPakin1)) {
throw new CoolException("娣诲姞澶辫触");
@@ -90,8 +100,9 @@
}
//濡傛灉鏄钩搴撳叆搴撳崟锛屼慨鏀硅鍗曟槑缁嗘墽琛屾暟閲�
- if (order.getOrderType() == OrderType.PK_IN_ORDER.id) {
- orderDetl.setWorkQty(waitPakin.getAnfme());
+ if (inType.equals(OrderType.PK_IN_ORDER.id)) {
+ Double workQty = Math.round((orderDetl.getWorkQty() + waitPakin.getAnfme()) * 1000) / 1000.0;
+ orderDetl.setWorkQty(workQty);
orderDetlService.updateById(orderDetl);
}
--
Gitblit v1.9.1