Browse Source

WDR和EngChgLevel都必须使用HU上的WDR和EngChgLevel

master
han\hanst 3 weeks ago
parent
commit
a7deab744e
  1. 6
      src/main/java/com/gaotao/modules/other/entity/OtherOutboundTransSubDto.java
  2. 17
      src/main/java/com/gaotao/modules/other/service/impl/OtherOutboundServiceImpl.java

6
src/main/java/com/gaotao/modules/other/entity/OtherOutboundTransSubDto.java

@ -20,4 +20,10 @@ public class OtherOutboundTransSubDto {
private String direction; private String direction;
private String wdrNo; private String wdrNo;
/**
* 工程变更级别,来源为 handling_unit.eng_chg_level。
* 其它出库汇总和 IFS 扣账都按该值区分库存身份。
*/
private String engChgLevel;
} }

17
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.setIfsLocationNo(detail.getLocationId());
ifsDto.setIfsLotBatchNo(detail.getBatchNo()); ifsDto.setIfsLotBatchNo(detail.getBatchNo());
ifsDto.setIfsSerialNo("*"); ifsDto.setIfsSerialNo("*");
// WDR、工程变更级别已按 HU 原值写入明细,IFS 必须用同一库存身份,不能写死或用占位值
ifsDto.setIfsWdrNo(detail.getWdrNo()); ifsDto.setIfsWdrNo(detail.getWdrNo());
ifsDto.setIfsEngChgLevel("1");
ifsDto.setIfsEngChgLevel(detail.getEngChgLevel());
ifsDto.setIfsActivitySeq(BigDecimal.ZERO); ifsDto.setIfsActivitySeq(BigDecimal.ZERO);
ifsDto.setIfsHandlingUnitID(BigDecimal.ZERO); ifsDto.setIfsHandlingUnitID(BigDecimal.ZERO);
ifsDto.setIfsQuantity(detail.getTransQty()); ifsDto.setIfsQuantity(detail.getTransQty());
@ -205,7 +206,9 @@ public class OtherOutboundServiceImpl implements OtherOutboundService {
subDto.setLocationId(hu.getLocationId()); // 使用当前库位 subDto.setLocationId(hu.getLocationId()); // 使用当前库位
subDto.setTransQty(hu.getQty().toString()); subDto.setTransQty(hu.getQty().toString());
subDto.setDirection("-"); // 出库方向 subDto.setDirection("-"); // 出库方向
subDto.setWdrNo("*");
// 库存身份以标签为准,后续汇总和 IFS 出库都沿用 HU 上的原值
subDto.setWdrNo(hu.getWdr());
subDto.setEngChgLevel(hu.getEngChgLevel());
subList.add(subDto); subList.add(subDto);
} }
@ -261,6 +264,7 @@ public class OtherOutboundServiceImpl implements OtherOutboundService {
detailSub.setLocationId(subDto.getLocationId()); detailSub.setLocationId(subDto.getLocationId());
detailSub.setOrderRef3(subDto.getWdrNo()); detailSub.setOrderRef3(subDto.getWdrNo());
detailSub.setOrderRef4(subDto.getWarehouseId()); detailSub.setOrderRef4(subDto.getWarehouseId());
detailSub.setEngChgLevel(subDto.getEngChgLevel());
// 更新HandlingUnit状态 // 更新HandlingUnit状态
HandlingUnit handlingUnit = handlingUnitService.lambdaQuery() HandlingUnit handlingUnit = handlingUnitService.lambdaQuery()
@ -284,7 +288,7 @@ public class OtherOutboundServiceImpl implements OtherOutboundService {
detailSubs.add(detailSub); detailSubs.add(detailSub);
} }
//总计sub数量添加到list
// 按库存身份汇总。WDR、工程变更级别不同的标签不能并成一行,否则 IFS 会扣错库存
Map<List<String>, Double> collect = detailSubs.stream().collect( Map<List<String>, Double> collect = detailSubs.stream().collect(
Collectors.groupingBy(item -> Arrays.asList( Collectors.groupingBy(item -> Arrays.asList(
item.getSite(), item.getSite(),
@ -292,7 +296,8 @@ public class OtherOutboundServiceImpl implements OtherOutboundService {
item.getBatchNo(), item.getBatchNo(),
item.getLocationId(), item.getLocationId(),
item.getOrderRef3(), item.getOrderRef3(),
item.getOrderRef4()
item.getOrderRef4(),
item.getEngChgLevel()
), Collectors.summingDouble(TransDetailSub::getSubQty))); ), Collectors.summingDouble(TransDetailSub::getSubQty)));
Double index = 1.0; Double index = 1.0;
@ -309,6 +314,7 @@ public class OtherOutboundServiceImpl implements OtherOutboundService {
detail.setLocationId(key.get(3)); detail.setLocationId(key.get(3));
detail.setWdrNo(key.get(4)); detail.setWdrNo(key.get(4));
detail.setOrderRef4(key.get(5)); detail.setOrderRef4(key.get(5));
detail.setEngChgLevel(key.get(6));
detail.setTransQty(new BigDecimal(totalQty)); detail.setTransQty(new BigDecimal(totalQty));
detail.setDirection(direction); detail.setDirection(direction);
detailList.add(detail); detailList.add(detail);
@ -323,8 +329,9 @@ public class OtherOutboundServiceImpl implements OtherOutboundService {
&& detailList.get(i).getPartNo().equals(sub.getPartNo()) && detailList.get(i).getPartNo().equals(sub.getPartNo())
&& detailList.get(i).getBatchNo().equals(sub.getBatchNo()) && detailList.get(i).getBatchNo().equals(sub.getBatchNo())
&& detailList.get(i).getLocationId().equals(sub.getLocationId()) && 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()) && detailList.get(i).getOrderRef4().equals(sub.getOrderRef4())
&& Objects.equals(detailList.get(i).getEngChgLevel(), sub.getEngChgLevel())
){ ){
sub.setItemNo(detailList.get(i).getItemNo()); sub.setItemNo(detailList.get(i).getItemNo());
break; break;

Loading…
Cancel
Save