|
|
|
@ -269,18 +269,32 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
|
|
|
|
|
if (Func.isEmpty(one)){ |
|
|
|
|
log.info("#############拆包查询父级库存品物不存在##############id:{},MarketId:{},WarehouseId:{}",distributionStockListDTO.getId(),distributionStockListDTO.getMarketId(),myCurrentWarehouse.getId()); |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
BasicMaterialEntity materialEntity = basicMaterialClient.getMaterialOwnId(one.getMaterialId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(Func.isEmpty(materialEntity)){ |
|
|
|
|
log.info("#############拆包查询库存品物品不存在id:{}",distributionStockListDTO.getId()); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ((one.getQuantityStock() - one.getQuantityOccupied()) < distributionStockListDTO.getUnpackingQuantity()){ |
|
|
|
|
log.info("#############拆包查询父级库存品当前可用数量不足以支持拆包数量id:{},当前可用数量:{},拆包数量:{}",distributionStockListDTO.getId(),(one.getQuantityStock() - one.getQuantityOccupied()) ,distributionStockListDTO.getUnpackingQuantity()); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(one2)) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询是否存在有拆包产物
|
|
|
|
|
//存在则是进行数量的累加
|
|
|
|
|
//有修改
|
|
|
|
|
DistributionStockListEntity d = one2; |
|
|
|
|
d.setId(one2.getId()); |
|
|
|
|
int i = one2.getQuantityStock() + (distributionStockListDTO.getUnpackingQuantity()* Integer.parseInt(distributionStockListDTO.getPackageNum())) ; |
|
|
|
|
int i = one2.getQuantityStock() + (distributionStockListDTO.getUnpackingQuantity()* Integer.parseInt(materialEntity.getPackageNum())) ; |
|
|
|
|
log.info(one2.getIncomingBatch()+"拆包剩余在库数量:{}",i); |
|
|
|
|
d.setQuantityStock(i); |
|
|
|
|
d.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
@ -340,7 +354,7 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
|
|
|
|
|
distributionStockListEntity.setPid(one.getId()); |
|
|
|
|
distributionStockListEntity.setCargoNumber(basicMaterialEntity.getProductCode()); |
|
|
|
|
distributionStockListEntity.setSku(distributionStockListDTO.getSku()); |
|
|
|
|
distributionStockListEntity.setQuantityStock((distributionStockListDTO.getUnpackingQuantity() * Integer.parseInt(distributionStockListDTO.getPackageNum()))); |
|
|
|
|
distributionStockListEntity.setQuantityStock((distributionStockListDTO.getUnpackingQuantity() * Integer.parseInt(materialEntity.getPackageNum()))); |
|
|
|
|
distributionStockListEntity.setUnpackingQuantity(0); |
|
|
|
|
distributionStockListEntity.setOutboundQuantity(0); |
|
|
|
|
distributionStockListEntity.setMaterialId(aLong); |
|
|
|
@ -363,7 +377,7 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
|
|
|
|
|
distributionStockListInfo.setGroundingTime(new Date()); |
|
|
|
|
distributionStockListInfo.setPid(distributionStockListDTO.getId()); |
|
|
|
|
distributionStockListInfo.setSourceType("2"); |
|
|
|
|
distributionStockListInfo.setQuantityStock((distributionStockListDTO.getStoreNum() * Integer.parseInt(distributionStockListDTO.getPackageNum()))); |
|
|
|
|
distributionStockListInfo.setQuantityStock((distributionStockListDTO.getStoreNum() * Integer.parseInt(materialEntity.getPackageNum()))); |
|
|
|
|
distributionStockListInfoService.save(distributionStockListInfo); |
|
|
|
|
} else { |
|
|
|
|
log.error("#################查询库存品失败"); |
|
|
|
|