From 65775e1357468c9abcf29d212eb0669d8282bf7a Mon Sep 17 00:00:00 2001
From: verou <857149855@qq.com>
Date: 星期五, 11 四月 2025 16:38:40 +0800
Subject: [PATCH] fix:收货单字段修改
---
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/QlyIsptItemServiceImpl.java | 27 ++++++++++++++++++++-------
1 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/QlyIsptItemServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/QlyIsptItemServiceImpl.java
index ac33377..84f0eda 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/QlyIsptItemServiceImpl.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/QlyIsptItemServiceImpl.java
@@ -43,11 +43,23 @@
List<QlyIsptItem> isptItem = params.getIsptItem();
List<Long> list = isptItem.stream().map(QlyIsptItem::getId).collect(Collectors.toList());
if (params.getType().equals("2") || params.getType().equals("1")) {
- if (!this.update(new LambdaUpdateWrapper<QlyIsptItem>()
- .set(QlyIsptItem::getIsptResult, params.getType())
- .in(QlyIsptItem::getId, list))) {
- throw new CoolException("淇敼澶辫触锛侊紒");
- }
+ isptItem.forEach(item -> {
+ if (params.getType().equals("1")) {
+ //TODO 鍏堟崱鍚庢敹涓洪�佽揣鏁伴噺锛屽厛鏀跺悗鎹′负鏀惰揣鏁伴噺
+ item.setSafeQty(item.getDlyQty());
+ item.setDisQty(0.0);
+ } else {
+ item.setSafeQty(0.0);
+ item.setDisQty(item.getDlyQty());
+ }
+ if (!this.update(new LambdaUpdateWrapper<QlyIsptItem>()
+ .set(QlyIsptItem::getSafeQty, item.getSafeQty())
+ .set(QlyIsptItem::getIsptResult, params.getType())
+ .set(QlyIsptItem::getDisQty, item.getDisQty())
+ .in(QlyIsptItem::getId, item.getId()))) {
+ throw new CoolException("淇敼澶辫触锛侊紒");
+ }
+ });
} else {
if (!this.updateBatchById(isptItem)) {
throw new CoolException("鏄庣粏淇敼澶辫触");
@@ -63,7 +75,7 @@
QlyInspect inspect = qlyInspectService.getById(key);
List<QlyIsptItem> items = listMap.get(key);
Double safeQty = items.stream().mapToDouble(QlyIsptItem::getSafeQty).sum();
- Double rcptQty = items.stream().mapToDouble(QlyIsptItem::getSafeQty).sum();
+ Double dlyQty = items.stream().mapToDouble(QlyIsptItem::getDlyQty).sum();
Double disQty = items.stream().mapToDouble(QlyIsptItem::getDisQty).sum();
Double qlyQty = safeQty + disQty;
//瀹夊叏鏁伴噺锛岃川妫�鏁伴噺
@@ -72,7 +84,8 @@
if (Double.compare(disQty, 0) > 0) {
inspect.setIsptResult(Short.parseShort("4"));
}
- if (Double.compare(safeQty, rcptQty) == 0) {
+ if (Double.compare(safeQty, dlyQty) == 0) {
+ inspect.setIsptStatus("1");
inspect.setIsptResult(Short.parseShort("1"));
}
if (!qlyInspectService.updateById(inspect)) {
--
Gitblit v1.9.1