Browse Source

1.同步老系统代码逻辑更新

training
zhenghaoyu 1 year ago
parent
commit
ce08678f99
  1. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  2. 5
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java
  3. 52
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml

@ -333,13 +333,13 @@
ldsa.stockup_status, ldsa.reservation_status, ldsa.order_status, ldsa.grounding_status,
ldsa.order_receive_status,
ldsa.freeze_status, ldsa.notification, ldsa.fee, ldsa.rate, ldsa.advance_id, ldsa.waybill_id,
ldsa.waybill_number,
GROUP_CONCAT( DISTINCT ldpl.waybill_number ) waybillNumber,
ldsa.consignee_unit, ldsa.collect_fee, ldsa.storage_fee, ldsa.consignee_person, ldsa.consignee_address,
ldsa.consignee_mobile, ldsa.warehouse_entry_time_end,
ldsa.sorting_quantity, ldsa.delivery_quantity, ldsa.transfer_quantity,
ldsa.signin_quantity, ldsa.resource, ldsa.is_opai,
ldsa.inventory_date, ldsa.inventory_person, ldsa.inventory_person_id,
ldsa.available_quantity, ldsa.is_have_data, ldsa.stock_article_code, ldsa.dealer_name, ldsa.dealer_code,
ldsa.available_quantity, ldsa.is_have_data, ldsa.stock_article_code, GROUP_CONCAT( DISTINCT ldpl.dealer_name ) dealerName,, ldsa.dealer_code,
ldsa.train_number, ldsa.factory_train, ldsa.sending, ldsa.send_warehouse_id, ldsa.send_warehouse_name,
ldsa.is_zero, ldsa.accept_warehouse_id, ldsa.accept_warehouse_name, ldsa.order_delivery_status,
GROUP_CONCAT( DISTINCT lwtg.tray_code ) trays,

5
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java

@ -102,6 +102,11 @@ public class SyncOrderInfoToPlatform {
log.info("################syncOrderInfo: 同步成功{}个订单",orderCodeList.size());
one.setCurrentPage(j+1);
one.setFinishNum(one.getFinishNum() + orderCodeList.size());
if((j+1) == totalPage){
one.setSyncStatus(2);
}else{
one.setSyncStatus(1);
}
orderSyncRecordService.saveOrUpdate(one);
}catch (CustomerException e){
log.error(e.message,e);

52
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java

@ -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;
}
}

Loading…
Cancel
Save