From 2f4505f4e2a36245a49b87840b711ad00729891e Mon Sep 17 00:00:00 2001
From: ZY <zc857179121@qq.com>
Date: 星期一, 19 八月 2024 08:46:12 +0800
Subject: [PATCH] 1
---
src/main/java/com/zy/asrs/controller/OutController.java | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/OutController.java b/src/main/java/com/zy/asrs/controller/OutController.java
index 4a08e72..cf01421 100644
--- a/src/main/java/com/zy/asrs/controller/OutController.java
+++ b/src/main/java/com/zy/asrs/controller/OutController.java
@@ -83,17 +83,24 @@
for (OrderDetl orderDetl : orderDetls) {
double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getWorkQty()).orElse(0.0D);
- if (issued <= 0.0D) { continue; }
- List<LocDetl> locDetls = locDetlService.queryStock(orderDetls.get(0).getSPgNO());
+ if (issued <= 0.0D) {
+ continue;
+ }
+ List<LocDetl> locDetls;
+ if (Cools.isEmpty(orderDetls.get(0).getSPgNO())) {
+ locDetls = locDetlService.queryStockByModel(orderDetl.getModel());
+ } else {
+ locDetls = locDetlService.queryStock(orderDetl.getSPgNO());
+ }
for (LocDetl locDetl : locDetls) {
- if (locDetl.getMatnr().equals(orderDetl.getMatnr())){
+ if (locDetl.getMatnr().equals(orderDetl.getMatnr())) {
if (issued > 0) {
LocDto locDto = new LocDto(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getMaktx(), locDetl.getBatch(), orderDetl.getOrderNo(),
issued >= locDetl.getAnfme() ? locDetl.getAnfme() : issued);
List<Integer> staNos = staDescService.queryOutStaNosByLocNo(locDetl.getLocNo(), issued >= locDetl.getAnfme() ? 101 : 103);
locDto.setStaNos(staNos);
- locDtos.add(locDto);
locDto.setModel(locDetl.getModel());
+ locDtos.add(locDto);
exist.add(locDetl.getLocNo());
// 鍓╀綑寰呭嚭鏁伴噺閫掑噺
issued = issued - locDetl.getAnfme();
--
Gitblit v1.9.1