From a7deab744e1b8f65345483afcafc587e2a94ae98 Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Fri, 16 Oct 2026 17:11:18 +0800 Subject: [PATCH] =?UTF-8?q?WDR=E5=92=8CEngChgLevel=E9=83=BD=E5=BF=85?= =?UTF-8?q?=E9=A1=BB=E4=BD=BF=E7=94=A8HU=E4=B8=8A=E7=9A=84WDR=E5=92=8CEngC?= =?UTF-8?q?hgLevel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../other/entity/OtherOutboundTransSubDto.java | 6 ++++++ .../service/impl/OtherOutboundServiceImpl.java | 17 ++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/gaotao/modules/other/entity/OtherOutboundTransSubDto.java b/src/main/java/com/gaotao/modules/other/entity/OtherOutboundTransSubDto.java index 9733368b..0460ea10 100644 --- a/src/main/java/com/gaotao/modules/other/entity/OtherOutboundTransSubDto.java +++ b/src/main/java/com/gaotao/modules/other/entity/OtherOutboundTransSubDto.java @@ -20,4 +20,10 @@ public class OtherOutboundTransSubDto { private String direction; private String wdrNo; + + /** + * 工程变更级别,来源为 handling_unit.eng_chg_level。 + * 其它出库汇总和 IFS 扣账都按该值区分库存身份。 + */ + private String engChgLevel; } diff --git a/src/main/java/com/gaotao/modules/other/service/impl/OtherOutboundServiceImpl.java b/src/main/java/com/gaotao/modules/other/service/impl/OtherOutboundServiceImpl.java index 168497a1..64f5e6c9 100644 --- a/src/main/java/com/gaotao/modules/other/service/impl/OtherOutboundServiceImpl.java +++ b/src/main/java/com/gaotao/modules/other/service/impl/OtherOutboundServiceImpl.java @@ -86,8 +86,9 @@ public class OtherOutboundServiceImpl implements OtherOutboundService { ifsDto.setIfsLocationNo(detail.getLocationId()); ifsDto.setIfsLotBatchNo(detail.getBatchNo()); ifsDto.setIfsSerialNo("*"); + // WDR、工程变更级别已按 HU 原值写入明细,IFS 必须用同一库存身份,不能写死或用占位值 ifsDto.setIfsWdrNo(detail.getWdrNo()); - ifsDto.setIfsEngChgLevel("1"); + ifsDto.setIfsEngChgLevel(detail.getEngChgLevel()); ifsDto.setIfsActivitySeq(BigDecimal.ZERO); ifsDto.setIfsHandlingUnitID(BigDecimal.ZERO); ifsDto.setIfsQuantity(detail.getTransQty()); @@ -205,7 +206,9 @@ public class OtherOutboundServiceImpl implements OtherOutboundService { subDto.setLocationId(hu.getLocationId()); // 使用当前库位 subDto.setTransQty(hu.getQty().toString()); subDto.setDirection("-"); // 出库方向 - subDto.setWdrNo("*"); + // 库存身份以标签为准,后续汇总和 IFS 出库都沿用 HU 上的原值 + subDto.setWdrNo(hu.getWdr()); + subDto.setEngChgLevel(hu.getEngChgLevel()); subList.add(subDto); } @@ -261,6 +264,7 @@ public class OtherOutboundServiceImpl implements OtherOutboundService { detailSub.setLocationId(subDto.getLocationId()); detailSub.setOrderRef3(subDto.getWdrNo()); detailSub.setOrderRef4(subDto.getWarehouseId()); + detailSub.setEngChgLevel(subDto.getEngChgLevel()); // 更新HandlingUnit状态 HandlingUnit handlingUnit = handlingUnitService.lambdaQuery() @@ -284,7 +288,7 @@ public class OtherOutboundServiceImpl implements OtherOutboundService { detailSubs.add(detailSub); } - //总计sub数量添加到list + // 按库存身份汇总。WDR、工程变更级别不同的标签不能并成一行,否则 IFS 会扣错库存 Map, Double> collect = detailSubs.stream().collect( Collectors.groupingBy(item -> Arrays.asList( item.getSite(), @@ -292,7 +296,8 @@ public class OtherOutboundServiceImpl implements OtherOutboundService { item.getBatchNo(), item.getLocationId(), item.getOrderRef3(), - item.getOrderRef4() + item.getOrderRef4(), + item.getEngChgLevel() ), Collectors.summingDouble(TransDetailSub::getSubQty))); Double index = 1.0; @@ -309,6 +314,7 @@ public class OtherOutboundServiceImpl implements OtherOutboundService { detail.setLocationId(key.get(3)); detail.setWdrNo(key.get(4)); detail.setOrderRef4(key.get(5)); + detail.setEngChgLevel(key.get(6)); detail.setTransQty(new BigDecimal(totalQty)); detail.setDirection(direction); detailList.add(detail); @@ -323,8 +329,9 @@ public class OtherOutboundServiceImpl implements OtherOutboundService { && detailList.get(i).getPartNo().equals(sub.getPartNo()) && detailList.get(i).getBatchNo().equals(sub.getBatchNo()) && detailList.get(i).getLocationId().equals(sub.getLocationId()) - && detailList.get(i).getWdrNo().equals(sub.getOrderRef3()) + && Objects.equals(detailList.get(i).getWdrNo(), sub.getOrderRef3()) && detailList.get(i).getOrderRef4().equals(sub.getOrderRef4()) + && Objects.equals(detailList.get(i).getEngChgLevel(), sub.getEngChgLevel()) ){ sub.setItemNo(detailList.get(i).getItemNo()); break;