|
@@ -2753,13 +2753,18 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
String sn = pdaGroupDiskDTO.getSn(); // 条码号
|
|
|
String boxNo = StringUtils.isNotBlank(pdaGroupDiskDTO.getBoxNo()) ? pdaGroupDiskDTO.getBoxNo() : palletNoTo; //箱号
|
|
|
BigDecimal qty = new BigDecimal(pdaGroupDiskDTO.getQty()); // 数量
|
|
|
- WmsDocOrderHeader wmsDocOrderHeader = selectWmsDocOrderHeaderByErpNo(pdaGroupDiskDTO.getOrderNo());
|
|
|
- String orderNo = wmsDocOrderHeader.getOrderNo();
|
|
|
-
|
|
|
// 根据条码获取物料号
|
|
|
CodeSkuRelationshipVO codeSkuRelationshipVO = codeSkuRelationshipService.checkIsProduct(sn);
|
|
|
// 物料编码
|
|
|
String sku = codeSkuRelationshipVO.getSku();
|
|
|
+ WmsDocOrderHeader wmsDocOrderHeader = selectWmsDocOrderHeaderByErpNo(pdaGroupDiskDTO.getOrderNo());
|
|
|
+ String orderNo = wmsDocOrderHeader.getOrderNo();
|
|
|
+ List<WmsDocOrderDetails> wmsDocOrderDetailsList = wmsDocOrderDetailsService.queryWmsDocOrderDetailsByOrderNo(orderNo);
|
|
|
+ List<WmsDocOrderDetails> wmsDocOrderDetailsMatchSkuList = wmsDocOrderDetailsList.stream().filter(item -> item.getSku().equals(sku)).collect(Collectors.toList());
|
|
|
+ if (CollectionUtil.isEmpty(wmsDocOrderDetailsMatchSkuList)){
|
|
|
+ throw new BaseException("出库明细未绑定此类产品!");
|
|
|
+ }
|
|
|
+
|
|
|
//创建新批次
|
|
|
String lotNum = IdWorker.getIdStr();
|
|
|
invLotAttService.insertInvLotAtt(buildInvLotAtt(lotNum, palletNoTo, orderNo, sn, sku));
|
|
@@ -2778,10 +2783,9 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
|
|
|
invLotLocIdService.insertInvLotLocId(buildInvLotLocId(lotNum, qty, locationId, orderNo, sku));
|
|
|
}
|
|
|
|
|
|
- List<WmsDocOrderDetails> wmsDocOrderDetailsList = wmsDocOrderDetailsService.queryWmsDocOrderDetailsByOrderNo(orderNo);
|
|
|
+
|
|
|
//筛选出相同sku并且数量未分配或未分配完的明细信息
|
|
|
- List<WmsDocOrderDetails> wmsDocOrderDetailsFilterList = wmsDocOrderDetailsList.stream().filter(item -> CompareUtil.compare(item.getSku(), sku) == 0 &&
|
|
|
- CompareUtil.compare(item.getQtyOrdered().subtract(item.getQtyAllocated()), BigDecimal.ZERO) > 0).collect(Collectors.toList());
|
|
|
+ List<WmsDocOrderDetails> wmsDocOrderDetailsFilterList = wmsDocOrderDetailsMatchSkuList.stream().filter(item -> CompareUtil.compare(item.getQtyOrdered().subtract(item.getQtyAllocated()), BigDecimal.ZERO) > 0).collect(Collectors.toList());
|
|
|
for (WmsDocOrderDetails wmsDocOrderDetails : wmsDocOrderDetailsFilterList) {
|
|
|
//明细已分配数量
|
|
|
BigDecimal wmsDocOrderDetailsQtyAllocated = ObjectUtil.isNotNull(wmsDocOrderDetails.getQtyAllocated()) ? wmsDocOrderDetails.getQtyAllocated() : BigDecimal.ZERO;
|