Browse Source

尝试解决欧派数据推送 重复推送的问题

newStockUp
pref_mail@163.com 1 year ago
parent
commit
6437c97b7d
  1. 17
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryDataServiceImpl.java
  2. 17
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java

17
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryDataServiceImpl.java

@ -42,13 +42,18 @@ public class OuPaiFactoryDataServiceImpl implements IOuPaiFactoryDataService {
// 老系统的
// 包件收货需要验证 收货单是否在系统中存在
boolean isUpdate = ouPaiFactoryService.checkReceivingOrder(orderCode);
if (!isUpdate) {
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>重新获取收货单信息 start>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
code = ouPaiFactoryService.saveOuPaiFactoryOrderDTOByCarCarNumber(orderCode);
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>重新获取收货单信息 end>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
try{
boolean isUpdate = ouPaiFactoryService.checkReceivingOrder(orderCode);
if (!isUpdate) {
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>重新获取收货单信息 start>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
code = ouPaiFactoryService.saveOuPaiFactoryOrderDTOByCarCarNumber(orderCode);
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>重新获取收货单信息 end>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
}
code = ouPaiFactoryService.saveOuPaiPackageStatusByCodeByOld(key, event, warehouseName);
}catch ( Exception e){
log.error(">>>>>>>>>>>>>>>>>>> 欧派收获错误 {}",ouPaiDataPushVO);
}
code = ouPaiFactoryService.saveOuPaiPackageStatusByCodeByOld(key, event, warehouseName);
} else if (event == 3) {
// 收货单创建
// 获取需要处理的数据并存入数据库

17
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java

@ -162,9 +162,10 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
// saveOuPaiFactoryOrderDTOByCarCarNumber(orderCode);
// }
QueryWrapper<FactoryPackageEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("oid", key);
FactoryPackageEntity packageEntity = factoryPackageService.getOne(queryWrapper);
LambdaQueryWrapper<FactoryPackageEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(FactoryPackageEntity::getOid, key);
List<FactoryPackageEntity> list = factoryPackageService.list(queryWrapper);
String code = null;
String endWarehouseName = null;
String opShipNo = null;
@ -173,7 +174,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
String siteName = null;
String packageDetailNames = null;
String firstPackName, secondPackName, thirdPackName = null;
if (Objects.isNull(packageEntity)) {
if (Objects.isNull(list)) {
// 需要对
log.warn("############oid 查询数据失败: {}", key);
@ -221,6 +222,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
}
} else {
FactoryPackageEntity packageEntity = list.get(0);
packageEntity.setPackageStatus(5);
factoryPackageService.updateById(packageEntity);
code = packageEntity.getCode();
@ -648,8 +650,6 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
LambdaQueryWrapper<ReceivingOrderEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ReceivingOrderEntity::getCode,code);
List<ReceivingOrderEntity> receivingOrderEntities = receivingOrderMapper.selectList(lambdaQueryWrapper);
if(ObjectUtils.isNotNull(receivingOrderEntities)){
log.info(">>>>>>>>>>>>>>>>>>>>>>> 收货单已存在 {} ",code);
@ -836,9 +836,8 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
//保存订单成功,继续保存包件
Long orderId = factoryOrderEntity.getId();
String packageCode = packageEntity.getString("Code");
QueryWrapper<FactoryPackageEntity> packageEntityQueryWrapper = new QueryWrapper<>();
packageEntityQueryWrapper.eq("code", packageCode);
LambdaQueryWrapper<FactoryPackageEntity> packageEntityQueryWrapper = new LambdaQueryWrapper<>();
packageEntityQueryWrapper.eq(FactoryPackageEntity::getCode, packageCode);
FactoryPackageEntity factoryPackageEntity = factoryPackageService.getOne(packageEntityQueryWrapper);

Loading…
Cancel
Save