From 3d923487dbdb94870c4e2e91e9377f9fc2c99ac7 Mon Sep 17 00:00:00 2001 From: lulz1 Date: Fri, 14 Jun 2024 16:16:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=94=A8=E8=BD=A6?= =?UTF-8?q?=E5=88=B6=E5=BA=A6=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order_sync/AmapOrderSyncAdapter.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/chint/domain/service/order_sync/AmapOrderSyncAdapter.java b/src/main/java/com/chint/domain/service/order_sync/AmapOrderSyncAdapter.java index dfae6f6f..516f446d 100644 --- a/src/main/java/com/chint/domain/service/order_sync/AmapOrderSyncAdapter.java +++ b/src/main/java/com/chint/domain/service/order_sync/AmapOrderSyncAdapter.java @@ -161,20 +161,20 @@ public class AmapOrderSyncAdapter implements SupplierOrderSync { dto.setStatus("1"); -// Optional supplier = supplierRepository.findBySupplierName(SUPPLIER_AMAP); -// supplier.flatMap(Supplier::carSupplierProduct).ifPresent(carSupplierProduct -> { -// if (carSupplierProduct.getSupplierProductStandardLevelList() -// .stream() -// .filter(SupplierProductStandardLevel::inUse) -// .map(SupplierProductStandardLevel::getStandardLevelName) -// .anyMatch(standardLevel -> standardLevel.equals(routeRequestFields.getStandardLevel()))) { -// amapPolicyRepository.findByStandardLevel(routeRequestFields.getStandardLevel()) -// .ifPresent(policy -> dto.setRegulationId(policy.getAmapPolicyCode())); -// } else { -// throw new AuthException("你目前的公司暂不支持使用高德打车"); -// } -// }); -// + Optional supplier = supplierRepository.findBySupplierName(SUPPLIER_AMAP); + supplier.flatMap(Supplier::carSupplierProduct).ifPresent(carSupplierProduct -> { + if (carSupplierProduct.getSupplierProductStandardLevelList() + .stream() + .filter(SupplierProductStandardLevel::inUse) + .map(SupplierProductStandardLevel::getStandardLevelName) + .anyMatch(standardLevel -> standardLevel.equals(routeRequestFields.getStandardLevel()))) { + amapPolicyRepository.findByStandardLevel(routeRequestFields.getStandardLevel()) + .ifPresent(policy -> dto.setRegulationId(policy.getAmapPolicyCode())); + } else { + throw new AuthException("你目前的公司暂不支持使用高德打车"); + } + }); + // if (routeRequestFields.getAccountCompanyName().equals("浙江正泰物联技术有限公司") || // routeRequestFields.getAccountCompanyName().equals("浙江正泰仪器仪表有限责任公司") || // routeRequestFields.getAccountCompanyName().equals("浙江正泰水务科技有限公司") ||