|
|
|
@ -541,13 +541,14 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
distributionStockArticleEntity.setConsigneeMobile(advanceEntity.getCustomerPhone());//收货人电话
|
|
|
|
|
distributionStockArticleEntity.setWarehouse(basicdataWarehouseEntity.getName()); |
|
|
|
|
distributionStockArticleEntity.setWarehouseId(basicdataWarehouseEntity.getId()); |
|
|
|
|
|
|
|
|
|
distributionStockArticleEntity.setDealerCode(advanceEntity.getDealerCode()); |
|
|
|
|
distributionStockArticleEntity.setDealerName(advanceEntity.getDealerName()); |
|
|
|
|
|
|
|
|
|
if (ObjectUtils.isNotNull(wayBillEntity)) { |
|
|
|
|
// distributionStockArticleEntity.setConsigneeUnit(wayBillEntity.getTakeCompany());//收货单位(经销商)
|
|
|
|
|
// distributionStockArticleEntity.setConsigneePerson(wayBillEntity.getTakePerson());//收货人
|
|
|
|
|
// distributionStockArticleEntity.setConsigneeAddress(wayBillEntity.getTakeAddress());//收货人地址
|
|
|
|
|
// distributionStockArticleEntity.setConsigneeMobile(wayBillEntity.getTakePhone());//收货人电话
|
|
|
|
|
distributionStockArticleEntity.setConsigneeUnit(wayBillEntity.getTakeCompany());//收货单位(经销商)
|
|
|
|
|
distributionStockArticleEntity.setConsigneePerson(wayBillEntity.getTakePerson());//收货人
|
|
|
|
|
distributionStockArticleEntity.setConsigneeAddress(wayBillEntity.getTakeAddress());//收货人地址
|
|
|
|
|
distributionStockArticleEntity.setConsigneeMobile(wayBillEntity.getTakePhone());//收货人电话
|
|
|
|
|
wayBillNo = wayBillEntity.getWaybillNo(); |
|
|
|
|
distributionStockArticleEntity.setWaybillNumber(wayBillNo); |
|
|
|
|
// 根据老运单上的仓库名称找寻新的仓库名称
|
|
|
|
@ -573,7 +574,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String customerName = advanceEntity.getDealerName();//客户名称
|
|
|
|
|
String customerName = wayBillEntity.getTakeCompany();//客户名称
|
|
|
|
|
|
|
|
|
|
//通过客户名称去查询客户的服务类型、
|
|
|
|
|
distributionStockArticleEntity.setTypeService("1");//默认商配
|
|
|
|
@ -586,6 +587,10 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
distributionStockArticleEntity.setMallName(basicdataClientEntity.getClientName()); |
|
|
|
|
distributionStockArticleEntity.setMallCode(basicdataClientEntity.getClientCode()); |
|
|
|
|
|
|
|
|
|
distributionStockArticleEntity.setDealerCode(basicdataClientEntity.getClientCode()); |
|
|
|
|
distributionStockArticleEntity.setDealerName(basicdataClientEntity.getClientName()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// todo 这里需要去查询门店 和新系统的门店ID 进行绑定
|
|
|
|
|
String peisongType = getPeisongTypeByClientId(basicdataClientEntity.getId()); |
|
|
|
|
log.info("订单同步peisongType {} ", peisongType); |
|
|
|
@ -660,6 +665,10 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
Integer carsType = orderDetailEntity.getCarsType(); |
|
|
|
|
Integer signState = orderDetailEntity.getSignState(); |
|
|
|
|
waybillNo = orderDetailEntity.getWaybillNo(); |
|
|
|
|
|
|
|
|
|
//存入运单信息
|
|
|
|
|
WayBillEntity waybillEntity = saveWaybillEntity(waybillNo); |
|
|
|
|
|
|
|
|
|
DistributionParcelListEntityVO vo = advanceDetailClient.getByUnitNoAndWarehouseId(unitNo,oldWarehouseId); |
|
|
|
|
|
|
|
|
|
DistributionParcelListEntity entity = new DistributionParcelListEntity(); |
|
|
|
@ -700,8 +709,13 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
entity.setAcceptWarehouseId(distributionStockArticleEntity.getAcceptWarehouseId()); |
|
|
|
|
|
|
|
|
|
//进销售
|
|
|
|
|
entity.setDealerCode(distributionStockArticleEntity.getDealerCode()); |
|
|
|
|
entity.setDealerName(distributionStockArticleEntity.getDealerName()); |
|
|
|
|
if(Objects.isNull(waybillEntity)){ |
|
|
|
|
entity.setDealerCode(distributionStockArticleEntity.getDealerCode()); |
|
|
|
|
entity.setDealerName(distributionStockArticleEntity.getDealerName()); |
|
|
|
|
}else{ |
|
|
|
|
entity.setDealerCode(distributionStockArticleEntity.getDealerCode()); |
|
|
|
|
entity.setDealerName(waybillEntity.getTakeCompany()); |
|
|
|
|
} |
|
|
|
|
entity.setWarehouseEntryTimeEnd(CommonUtil.StringToDate(operationTime)); |
|
|
|
|
|
|
|
|
|
// 绑定部门--仓库
|
|
|
|
@ -725,15 +739,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
log.warn("#################handleDataToPlatform: 保存包件信息失败 orderCode={}", entity.getOrderCode()); |
|
|
|
|
throw new CustomerException(405, "保存包件信息失败"); |
|
|
|
|
} |
|
|
|
|
//存入运单信息
|
|
|
|
|
WarehouseWaybillEntity waybillEntity = saveWaybillEntity(waybillNo); |
|
|
|
|
|
|
|
|
|
if(!Objects.isNull(waybillEntity)){ |
|
|
|
|
|
|
|
|
|
distributionStockArticleEntity.getW |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -747,8 +753,8 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
distributionStockArticleEntity.setStoreName(advanceEntity.getStoreName()); |
|
|
|
|
distributionStockArticleEntity.setStoreCode(advanceEntity.getStoreNo()); |
|
|
|
|
|
|
|
|
|
distributionStockArticleEntity.setDealerCode(advanceEntity.getDealerCode()); |
|
|
|
|
distributionStockArticleEntity.setDealerName(advanceEntity.getDealerName()); |
|
|
|
|
// distributionStockArticleEntity.setDealerCode(advanceEntity.getDealerCode());
|
|
|
|
|
// distributionStockArticleEntity.setDealerName(advanceEntity.getDealerName());
|
|
|
|
|
|
|
|
|
|
// 最终客户
|
|
|
|
|
distributionStockArticleEntity.setCustomerName(advanceEntity.getCustomerName()); |
|
|
|
@ -778,19 +784,21 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private WarehouseWaybillEntity saveWaybillEntity(String waybillNo) { |
|
|
|
|
private WayBillEntity saveWaybillEntity(String waybillNo) { |
|
|
|
|
log.info("#################handleDataToPlatform.saveWaybillEntity: {}", waybillNo); |
|
|
|
|
|
|
|
|
|
if (StringUtil.isBlank(waybillNo)) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
//如果新系统中不存在这个运单,那么就去查询老系统的运单数据
|
|
|
|
|
WayBillEntity wayBillEntity = wayBillClient.getByWaybillNo(waybillNo); |
|
|
|
|
|
|
|
|
|
//通过运单号先去查询新系统是否存在这个运单号
|
|
|
|
|
WarehouseWaybillEntity warehouseWaybill = warehouseWaybillClient.findByWaybillNo(waybillNo); |
|
|
|
|
log.info("#################handleDataToPlatform.warehouseWaybill: {}", warehouseWaybill); |
|
|
|
|
|
|
|
|
|
if (Objects.isNull(warehouseWaybill)) { |
|
|
|
|
//如果新系统中不存在这个运单,那么就去查询老系统的运单数据
|
|
|
|
|
WayBillEntity wayBillEntity = wayBillClient.getByWaybillNo(waybillNo); |
|
|
|
|
|
|
|
|
|
log.info("#################handleDataToPlatform.wayBillEntity: {}", wayBillEntity); |
|
|
|
|
if (Objects.isNull(wayBillEntity)) { |
|
|
|
|
log.warn("##############saveWaybillEntity: 老系统中未找到对应运单waybillNo={}", waybillNo); |
|
|
|
@ -877,6 +885,6 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
|
|
|
|
|
warehouseWaybillClient.updateEntity(warehouseWaybill); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return warehouseWaybill; |
|
|
|
|
return wayBillEntity; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|