|
|
|
@ -447,12 +447,13 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
|
|
|
|
|
String orderCode = advanceEntity.getOrderCode(); |
|
|
|
|
Integer total = baseMapper.findAllNumByOrderCode(orderCode); |
|
|
|
|
|
|
|
|
|
String waybillNo = advanceEntity.getWaybillNo(); |
|
|
|
|
|
|
|
|
|
Long orderId = null; |
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = stockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId); |
|
|
|
|
if (Objects.isNull(stockArticleEntity)) { |
|
|
|
|
log.info("#############saveOrderAndPackage: 订单信息为空,同步订单信息"); |
|
|
|
|
//订单信息为空
|
|
|
|
|
String waybillNo = advanceEntity.getWaybillNo(); |
|
|
|
|
|
|
|
|
|
stockArticleEntity = new DistributionStockArticleEntity(); |
|
|
|
|
stockArticleEntity.setCreateUser(userId); |
|
|
|
@ -579,7 +580,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
|
|
|
|
|
stockArticleEntity.setOrderReceiveStatus("10"); |
|
|
|
|
stockArticleEntity.setFreezeStatus("10"); |
|
|
|
|
stockArticleEntity.setNotification(2); |
|
|
|
|
stockArticleEntity.setIsHaveData(2); |
|
|
|
|
stockArticleEntity.setIsHaveData(1); |
|
|
|
|
stockArticleEntity.setTrainNumber(advanceEntity.getTrainNumber()); |
|
|
|
|
stockArticleEntity.setSortingQuantity(0); |
|
|
|
|
stockArticleEntity.setDeliveryQuantity(0); |
|
|
|
@ -590,6 +591,10 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
|
|
|
|
|
stockArticleEntity.setTotalNumber(total); |
|
|
|
|
stockArticleClient.saveOrUpdate(stockArticleEntity); |
|
|
|
|
orderId = stockArticleEntity.getId(); |
|
|
|
|
|
|
|
|
|
if(StringUtil.isNotBlank(waybillNo)){ |
|
|
|
|
waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (Objects.isNull(orderId)) { |
|
|
|
|
log.warn("##############saveOrderAndPackage: 订单信息有误 orderId={}", orderId); |
|
|
|
@ -598,6 +603,8 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
|
|
|
|
|
|
|
|
|
|
stockArticleClient.updateAllOrderTotalNum(orderCode, total); |
|
|
|
|
|
|
|
|
|
log.info("##############saveOrderAndPackage: 当前处理orderCode:{} waybillNo{}",orderCode,waybillNo); |
|
|
|
|
|
|
|
|
|
List<DistributionParcelListEntity> parcelListEntityList = new ArrayList<>(); |
|
|
|
|
List<String> orderPackageCodes = new ArrayList<>(); |
|
|
|
|
for (TrunklineAdvanceDetailEntity advanceDetailEntity : detailList) { |
|
|
|
@ -612,7 +619,12 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
|
|
|
|
|
parcelList.setIsTransfer(1); |
|
|
|
|
parcelList.setWarehouse(warehouseEntity.getName()); |
|
|
|
|
parcelList.setWarehouseId(warehouseId); |
|
|
|
|
String waybillNo = advanceEntity.getWaybillNo(); |
|
|
|
|
if(Objects.isNull(waybillEntity)){ |
|
|
|
|
if(StringUtil.isNotBlank(waybillNo)){ |
|
|
|
|
waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!Objects.isNull(waybillEntity)) { |
|
|
|
|
Long departureWarehouseId = waybillEntity.getDepartureWarehouseId(); |
|
|
|
|
Long destinationWarehouseId = waybillEntity.getDestinationWarehouseId(); |
|
|
|
|