Browse Source

add:1.增加异常入库的包件限制

visual
pref_mail@163.com 5 months ago
parent
commit
3d5e05311f
  1. 63
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

63
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -7706,13 +7706,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByOrderPackageCodeAndStatus(scanCode);
if (!Objects.isNull(parcelListEntity)) {
Long warehouseId = parcelListEntity.getWarehouseId();
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
DistributionStockArticleEntity newStockArticle = new DistributionStockArticleEntity();
BeanUtil.copy(stockArticleEntity, newStockArticle);
newStockArticle.setId(null);
newStockArticle.setHandQuantity(0);
Long orderId = distributionStockArticleClient.addData(newStockArticle);
// 判断包件查询出来的入库数据 和当前操作的入库仓 是否一致
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if(myCurrentWarehouse == null){
return R.fail(405, "仓库信息不存在 ,请选择入库仓库");
}
if(NumberUtil.equals(myCurrentWarehouse.getId(),warehouseId)){
return R.fail(405, "包件已入库!");
}
DistributionStockArticleEntity stockArticleEntity = getDistributionStockArticle(orderCode,warehouseId,myCurrentWarehouse.getName(),scanCode);
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(unloadNodeId);
DistributionParcelListEntity newParcelList = new DistributionParcelListEntity();
BeanUtil.copy(parcelListEntity, newParcelList);
@ -7726,7 +7729,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
newParcelList.setIsTransfer(1);
}
newParcelList.setTrainNumber(loadCode);
newParcelList.setStockArticleId(orderId);
newParcelList.setStockArticleId(stockArticleEntity.getId());
distributionParcelListClient.add(newParcelList);
// stockArticleEntity.setHandQuantity(stockArticleEntity.getHandQuantity() - 1);
@ -7748,6 +7751,52 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
}
private DistributionStockArticleEntity getDistributionStockArticle(String orderCode, Long warehouseId,String warehouseName,String scanCode) {
DistributionStockArticleEntity stockArticleByOrderCodeAndWarehouseId = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
if(Objects.isNull(stockArticleByOrderCodeAndWarehouseId)) {
TrunklineAdvanceDetailEntity entityByOrderPackageCode = trunklineAdvanceDetailService.findEntityByOrderPackageCode(scanCode);
if(Objects.isNull(entityByOrderPackageCode)){
stockArticleByOrderCodeAndWarehouseId = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, entityByOrderPackageCode.getNowWarehouseId());
if(Objects.isNull(stockArticleByOrderCodeAndWarehouseId)){
stockArticleByOrderCodeAndWarehouseId.setId(null);
stockArticleByOrderCodeAndWarehouseId.setWarehouseId(warehouseId);
stockArticleByOrderCodeAndWarehouseId.setWarehouseId(warehouseId);
stockArticleByOrderCodeAndWarehouseId.setWarehouse(warehouseName);
stockArticleByOrderCodeAndWarehouseId.setGenre(1);
stockArticleByOrderCodeAndWarehouseId.setHandQuantity(0);
stockArticleByOrderCodeAndWarehouseId.setCompleteSet(1);
stockArticleByOrderCodeAndWarehouseId.setStockupStatus("10");
stockArticleByOrderCodeAndWarehouseId.setReservationStatus("10");
stockArticleByOrderCodeAndWarehouseId.setOrderStatus("10");
stockArticleByOrderCodeAndWarehouseId.setGroundingStatus("10");
stockArticleByOrderCodeAndWarehouseId.setOrderReceiveStatus("10");
stockArticleByOrderCodeAndWarehouseId.setFreezeStatus("10");
stockArticleByOrderCodeAndWarehouseId.setSortingQuantity(0);
stockArticleByOrderCodeAndWarehouseId.setDeliveryQuantity(0);
stockArticleByOrderCodeAndWarehouseId.setTransferQuantity(0);
stockArticleByOrderCodeAndWarehouseId.setSigninQuantity(0);
stockArticleByOrderCodeAndWarehouseId.setIncomingNum(0);
stockArticleByOrderCodeAndWarehouseId.setAllocation(null);
stockArticleByOrderCodeAndWarehouseId.setTrays(null);
Long orderId = distributionStockArticleClient.addData(stockArticleByOrderCodeAndWarehouseId);
stockArticleByOrderCodeAndWarehouseId.setId(orderId);
}
}
}
// 存在就返回
return stockArticleByOrderCodeAndWarehouseId;
}
@Override
public R transitOrderPageList(LoadCarsDTO loadCarsDTO) {
IPage<Object> page = new Page<>();

Loading…
Cancel
Save