diff --git a/blade-service-api/logpm-business-api/src/main/java/com/logpm/business/feign/IBusinessPreOrderClient.java b/blade-service-api/logpm-business-api/src/main/java/com/logpm/business/feign/IBusinessPreOrderClient.java index ff0e1c16e..d2931e88f 100644 --- a/blade-service-api/logpm-business-api/src/main/java/com/logpm/business/feign/IBusinessPreOrderClient.java +++ b/blade-service-api/logpm-business-api/src/main/java/com/logpm/business/feign/IBusinessPreOrderClient.java @@ -23,6 +23,6 @@ public interface IBusinessPreOrderClient { Integer inOrderByOrderPackageCode(@RequestParam("orderPackageCode") String orderPackageCode, @RequestParam("carNum") String carNum); @PostMapping(SAVEOTHERDATABASENEW) - void saveOtherDataBaseNew(@RequestParam("userId") String tenantId, @RequestBody List dataResult, @RequestParam("mallName") String mallName); + void saveOtherDataBaseNew(@RequestParam("tenantId") String tenantId, @RequestBody List dataResult, @RequestParam("mallName") String mallName); } diff --git a/blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessAsyncServiceImpl.java b/blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessAsyncServiceImpl.java index 2cd4d291c..b0e074f8c 100644 --- a/blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessAsyncServiceImpl.java +++ b/blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessAsyncServiceImpl.java @@ -38,11 +38,12 @@ public class BusinessAsyncServiceImpl implements IBusinessAsyncService { if (tenant1.isSuccess()) { Tenant tenant = tenant1.getData(); if (ObjectUtil.isEmpty(tenant)) { - log.info(">>>>>>>>>>>>> saveOtherDataBaseNew 租户不存在"); + log.warn(">>>>>>>>>>>>> saveOtherDataBaseNew 租户不存在"); return; } if (dataResult.isEmpty()) { - log.info(" saveOtherDataBaseNew dataResult 参数错误"); + log.warn(" saveOtherDataBaseNew dataResult 参数错误"); + return; } LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -50,7 +51,7 @@ public class BusinessAsyncServiceImpl implements IBusinessAsyncService { lambdaQueryWrapper.in(BusinessPreOrderEntity::getOrderCode, orderCodeList); List list = businessPreOrderService.list(lambdaQueryWrapper); - + log.info(" saveOtherDataBaseNew list {} :", list); // 找到已经推送的包件信息 并将其标记为删除状态 List temsp = new ArrayList<>(); for (BusinessPreOrderEntity distributionBusinessPreOrderEntity : list) { @@ -69,7 +70,7 @@ public class BusinessAsyncServiceImpl implements IBusinessAsyncService { } else { temsp.add(distributionBusinessPreOrderEntity.getId()); } - }else if(distributionBusinessPreOrderEntity.getConditions().equals(3) &&distributionBusinessPreOrderEntity.getFirsts().equals(businessPreOrderEntity.getFirsts())){ + } else if (distributionBusinessPreOrderEntity.getConditions().equals(3) && distributionBusinessPreOrderEntity.getFirsts().equals(businessPreOrderEntity.getFirsts())) { if (distributionBusinessPreOrderEntity.getInWarehouse().equals(1)) { // 需要删除集合中的数据 dataResult.remove(i); @@ -88,7 +89,7 @@ public class BusinessAsyncServiceImpl implements IBusinessAsyncService { for (BusinessPreOrderEntity distributionBusinessPreOrderEntity : dataResult) { distributionBusinessPreOrderEntity.setTenantId(tenant.getTenantId()); } - + log.info(" saveBatch dataResult {} :", dataResult); // 执行保存操作 businessPreOrderService.saveBatch(dataResult); diff --git a/blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessPreOrderServiceImpl.java b/blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessPreOrderServiceImpl.java index 061b45ade..b31dc4760 100644 --- a/blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessPreOrderServiceImpl.java +++ b/blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessPreOrderServiceImpl.java @@ -102,7 +102,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImplbusinessPreOrderEntity.getId().equals(a.getId())).findFirst().get(); + BusinessPreOrderVO t = businessPreOrderList.stream().filter(a -> businessPreOrderEntity.getId().equals(a.getId())).findFirst().get(); if (1 == businessPreOrderEntity.getInWarehouse()) { - throw new CustomerException( businessPreOrderEntity.getFirsts() + "已入库"); + throw new CustomerException(businessPreOrderEntity.getFirsts() + "已入库"); } // 构建 订单 @@ -847,7 +847,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl #{item} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AsyncServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AsyncServiceImpl.java index a5fd5b843..4dd7d46fc 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AsyncServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AsyncServiceImpl.java @@ -95,17 +95,17 @@ public class AsyncServiceImpl implements IAsyncService { if (tenantFeign.isSuccess()) { tenant = tenantFeign.getData(); } - String mallName = tenant.getTenantName(); - log.info(">>> 执行保存数据到商家数据的功能 商家名称{}",tenant.getTenantName()); +// String mallName = tenant.getTenantName(); + log.info(">>> 执行保存数据到商家数据的功能 商家名称{}", tenant.getTenantName()); for (TrunklineAdvanceEntity trunklineAdvanceEntity : trunklineAdvanceEntities) { - List t = trunklineAdvanceDetailEntities.stream().filter(trunklineAdvanceDetailEntity -> trunklineAdvanceDetailEntity.getAdvanceId().equals(trunklineAdvanceEntity.getId())).collect(Collectors.toList()); + List t = trunklineAdvanceDetailEntities.stream().filter(trunklineAdvanceDetailEntity -> trunklineAdvanceDetailEntity.getAdvanceId().equals(trunklineAdvanceEntity.getId())).collect(Collectors.toList()); - saveTrunklineAdvanceEntity(trunklineAdvanceEntity, mallName); + saveTrunklineAdvanceEntity(trunklineAdvanceEntity, tenant); // 保存暂存子表 - saveTrunklineAdvanceDetailEntity(t, trunklineAdvanceEntity, mallName); + saveTrunklineAdvanceDetailEntity(t, trunklineAdvanceEntity, tenant); } List collect = trunklineAdvanceEntities.stream().map(TrunklineAdvanceEntity::getId).distinct().collect(Collectors.toList()); @@ -113,7 +113,7 @@ public class AsyncServiceImpl implements IAsyncService { List listByAdvanceIds = advanceDetailService.findAdvanceDetailVoByAdvanceIds(collect); // 保存运单 - BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(mallName); + BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(tenant.getTenantName()); List collect1 = trunklineWaybillOrderEntities.stream().filter(trunklineWaybillOrderEntity -> trunklineWaybillOrderEntity.getWaybillId().equals(waybillBilllByWaybillNo.getId())).collect(Collectors.toList()); @@ -254,7 +254,7 @@ public class AsyncServiceImpl implements IAsyncService { trunklineWaybillTrackEntity.setWaybillId(waybillBilllByWaybillNo.getId()); trunklineWaybillTrackEntity.setTenantId(tenant.getTenantId()); - BasicdataWarehouseEntity basicdataWarehouseEntity1 = getBasicdataWarehouseEntity(mallName); + BasicdataWarehouseEntity basicdataWarehouseEntity1 = getBasicdataWarehouseEntity(tenant.getTenantName()); trunklineWaybillTrackEntity.setWarehouseId(basicdataWarehouseEntity1.getId()); trunklineWaybillTrackEntity.setWarehouseName(basicdataWarehouseEntity1.getName()); trunklineWaybillTrackService.save(trunklineWaybillTrackEntity); @@ -264,11 +264,11 @@ public class AsyncServiceImpl implements IAsyncService { @ChangeAsync() @Override - public void deleteWaybillData(String tenantId, String waybillNo,String consignee) { + public void deleteWaybillData(String tenantId, String waybillNo, String consignee) { - try{ - log.info("执行删除商场推送数据清理动作 商场名称:{}",consignee); + try { + log.info("执行删除商场推送数据清理动作 商场名称:{}", consignee); // 根据运单号删除运单logpm_trunkline_waybill_package 的数据 trunklineWaybillPackageService.deleteByWaybillNo(waybillNo); // 根据运单号删除 logpm_trunkline_waybill_order 的数据 @@ -288,12 +288,11 @@ public class AsyncServiceImpl implements IAsyncService { // 根据运单号 删除 logpm_trunkline_waybill_track trunklineWaybillTrackService.deleteByWaybillNo(waybillNo); - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } - } private BasicdataWarehouseEntity getBasicdataWarehouseEntity(String mallName) { @@ -306,8 +305,7 @@ public class AsyncServiceImpl implements IAsyncService { return basicdataWarehouseEntity; } - private void saveTrunklineAdvanceDetailEntity(List t, TrunklineAdvanceEntity trunklineAdvanceEntity, String mallName) { - Tenant tenant = changeDataBase(mallName); + private void saveTrunklineAdvanceDetailEntity(List t, TrunklineAdvanceEntity trunklineAdvanceEntity, Tenant tenant) { List ids = Collections.singletonList(trunklineAdvanceEntity.getId()); @@ -333,7 +331,7 @@ public class AsyncServiceImpl implements IAsyncService { trunklineAdvanceDetailEntity.setTenantId(tenant.getTenantId()); trunklineAdvanceDetailEntity.setIncomingWarehouseId(null); trunklineAdvanceDetailEntity.setIncomingWarehouseName(null); - BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(mallName); + BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(tenant.getTenantName()); if (basicdataWarehouseEntity != null) { trunklineAdvanceDetailEntity.setWarehouseId(basicdataWarehouseEntity.getId()); trunklineAdvanceDetailEntity.setWarehouseName(basicdataWarehouseEntity.getName()); @@ -346,8 +344,7 @@ public class AsyncServiceImpl implements IAsyncService { } - private TrunklineAdvanceEntity saveTrunklineAdvanceEntity(TrunklineAdvanceEntity trunklineAdvanceEntity, String mallName) { - Tenant tenant = changeDataBase(mallName); + private TrunklineAdvanceEntity saveTrunklineAdvanceEntity(TrunklineAdvanceEntity trunklineAdvanceEntity, Tenant tenant) { // 查找商户的暂存单是否存在改制 QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -355,7 +352,7 @@ public class AsyncServiceImpl implements IAsyncService { queryWrapper.eq("waybill_no", trunklineAdvanceEntity.getWaybillNo()) .last("limit 1"); TrunklineAdvanceEntity trunklineAdvanceEntity1 = advanceService.getOne(queryWrapper); - BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(mallName); + BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(tenant.getTenantName()); if (ObjectUtil.isEmpty(trunklineAdvanceEntity1)) { // 保存对象 if (basicdataWarehouseEntity != null) {