|
|
|
@ -44,6 +44,7 @@ import org.springblade.common.utils.CommonUtil;
|
|
|
|
|
import org.springblade.core.redis.cache.BladeRedis; |
|
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
|
import org.springblade.system.feign.IRegionFeign; |
|
|
|
|
import org.springframework.amqp.rabbit.connection.CorrelationData; |
|
|
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
@ -95,6 +96,8 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
|
|
|
|
|
private final RabbitTemplate rabbitTemplate; |
|
|
|
|
|
|
|
|
|
private final IRegionFeign regionFeign; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
@Override |
|
|
|
@ -811,6 +814,12 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
log.warn("##############waybillDataHandler: 老系统中未找到对应运单waybillNo={}", orderCode); |
|
|
|
|
throw new CustomerException("老系统中未找到对应运单"); |
|
|
|
|
} |
|
|
|
|
// Integer desOldWarehouseId = wayBillEntity.getWarehouseId();
|
|
|
|
|
// if(!oldWarehouseId.equals(desOldWarehouseId)){
|
|
|
|
|
// log.warn("##############waybillDataHandler: 该运单还未到达目的仓 oldWarehouseId={}", oldWarehouseId);
|
|
|
|
|
// throw new CustomerException("该运单还未到达目的仓");
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String waybillNo = wayBillEntity.getWaybillNo(); |
|
|
|
|
|
|
|
|
@ -820,11 +829,11 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
warehouseWaybill = saveZeroWayBillData(wayBillEntity); |
|
|
|
|
} |
|
|
|
|
//创建在库订单
|
|
|
|
|
createZeroStockArticle(warehouseWaybill,num); |
|
|
|
|
createZeroStockArticle(warehouseWaybill,num,newWarehouseId); |
|
|
|
|
log.info("###############waybillDataHandler: 处理数据结束 waybillNo={}", waybillNo); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void createZeroStockArticle(WarehouseWaybillEntity warehouseWaybill,Integer num) { |
|
|
|
|
private void createZeroStockArticle(WarehouseWaybillEntity warehouseWaybill,Integer num,Long newWarehouseId) { |
|
|
|
|
//判断新系统是否有这条订单数据
|
|
|
|
|
//自动生成的在库订单就用运单号作为订单号
|
|
|
|
|
String waybillNo = warehouseWaybill.getWaybillNo(); |
|
|
|
@ -954,6 +963,11 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
entity.setOrderPackageLoadingStatus("10"); |
|
|
|
|
entity.setWaybillNumber(distributionStockArticleEntity.getWaybillNumber()); |
|
|
|
|
entity.setWarehouseEntryTimeEnd(date); |
|
|
|
|
if(destinationWarehouseId.equals(newWarehouseId)){ |
|
|
|
|
entity.setIsTransfer(0); |
|
|
|
|
}else{ |
|
|
|
|
entity.setIsTransfer(1); |
|
|
|
|
} |
|
|
|
|
entity.setSendWarehouseId(warehouseWaybill.getDepartureWarehouseId()); |
|
|
|
|
entity.setSendWarehouseName(warehouseWaybill.getDepartureWarehouseName()); |
|
|
|
|
entity.setAcceptWarehouseId(warehouseWaybill.getDestinationWarehouseId()); |
|
|
|
@ -1048,6 +1062,9 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
warehouseWaybill.setConsigneeName(wayBillEntity.getTakePerson()); |
|
|
|
|
warehouseWaybill.setConsigneeMobile(wayBillEntity.getTakeMobile()); |
|
|
|
|
warehouseWaybill.setConsigneeAddress(wayBillEntity.getTakeAddress()); |
|
|
|
|
String arriveSite = wayBillEntity.getArriveSite(); |
|
|
|
|
String code = regionFeign.getCode(arriveSite); |
|
|
|
|
warehouseWaybill.setDestinationCode(code); |
|
|
|
|
warehouseWaybill.setDestination(wayBillEntity.getArriveSite()); |
|
|
|
|
warehouseWaybill.setGoodsName(packname); |
|
|
|
|
warehouseWaybill.setTotalCount(number); |
|
|
|
@ -1078,6 +1095,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
warehouseWaybill.setClaimingValue(wayBillEntity.getValue()); |
|
|
|
|
warehouseWaybill.setPayType(wayBillEntity.getPayType()+""); |
|
|
|
|
warehouseWaybill.setPayWay(wayBillEntity.getPaymentMethod()+""); |
|
|
|
|
warehouseWaybill.setWaybillType(2); |
|
|
|
|
warehouseWaybill.setXPay(wayBillEntity.getXPay()); |
|
|
|
|
warehouseWaybill.setDPay(wayBillEntity.getDPay()); |
|
|
|
|
warehouseWaybill.setHPay(wayBillEntity.getHPay()); |
|
|
|
|