From 43a8037b60150b65651c03fd654621d37075d051 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期三, 16 四月 2025 18:00:26 +0800
Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop
---
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/QlyIsptItemServiceImpl.java | 36 +++++++++++++++++++++++++-----------
1 files changed, 25 insertions(+), 11 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..4fbb4bf 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
@@ -7,6 +7,8 @@
import com.vincent.rsf.server.manager.controller.params.IsptItemsParams;
import com.vincent.rsf.server.manager.controller.params.QlyInspectAndItem;
import com.vincent.rsf.server.manager.entity.QlyInspect;
+import com.vincent.rsf.server.manager.enums.QlyIsptResult;
+import com.vincent.rsf.server.manager.enums.QlyIsptStatus;
import com.vincent.rsf.server.manager.mapper.QlyIsptItemMapper;
import com.vincent.rsf.server.manager.entity.QlyIsptItem;
import com.vincent.rsf.server.manager.service.QlyInspectService;
@@ -42,18 +44,30 @@
}
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("淇敼澶辫触锛侊紒");
- }
+ if (Short.parseShort(params.getType()) == QlyIsptResult.QLY_ISPT_RESULT_EXCELLENT.val || Short.parseShort(params.getType()) == QlyIsptResult.QLY_ISPT_RESULT_DEFECT.val) {
+ //1锛氬悎鏍硷紝 2锛氫笉鍚堟牸, 0: 鍏跺畠锛堥粯璁わ級
+ isptItem.forEach(item -> {
+ if (Short.parseShort(params.getType()) == QlyIsptResult.QLY_ISPT_RESULT_EXCELLENT.val) {
+ //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, Short.parseShort(params.getType()))
+ .set(QlyIsptItem::getDisQty, item.getDisQty())
+ .in(QlyIsptItem::getId, item.getId()))) {
+ throw new CoolException("淇敼澶辫触锛侊紒");
+ }
+ });
} else {
if (!this.updateBatchById(isptItem)) {
throw new CoolException("鏄庣粏淇敼澶辫触");
}
}
-
List<QlyIsptItem> isptItems = this.list(new LambdaQueryWrapper<QlyIsptItem>().in(QlyIsptItem::getId, list));
if (isptItems.isEmpty()) {
throw new CoolException("鏁版嵁閿欒锛氭槑缁嗕笉瀛樺湪锛侊紒");
@@ -63,17 +77,17 @@
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 disQty = items.stream().mapToDouble(QlyIsptItem::getDisQty).sum();
Double qlyQty = safeQty + disQty;
//瀹夊叏鏁伴噺锛岃川妫�鏁伴噺
inspect.setSafeQty(safeQty)
.setIsptQty(qlyQty);
if (Double.compare(disQty, 0) > 0) {
- inspect.setIsptResult(Short.parseShort("4"));
+ inspect.setIsptResult(QlyIsptResult.QLY_ISPT_RESULT_SECTION.val);
}
- if (Double.compare(safeQty, rcptQty) == 0) {
- inspect.setIsptResult(Short.parseShort("1"));
+ if (Double.compare(safeQty, inspect.getDlyQty()) == 0) {
+// inspect.setIsptStatus(QlyIsptStatus.QLY_ISPT_STAS_DONE.val);
+ inspect.setIsptResult(QlyIsptResult.QLY_ISPT_RESULT_EXCELLENT.val);
}
if (!qlyInspectService.updateById(inspect)) {
throw new CoolException("璐ㄦ鏁伴噺淇敼澶辫触锛侊紒");
--
Gitblit v1.9.1