From 794d1cbef5f3a15b96e55c8002f9dfccf00e64c4 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo <583671871@qq.com> Date: Fri, 7 Mar 2025 11:17:02 +0800 Subject: [PATCH] =?UTF-8?q?feat(all):=20=E4=BB=B7=E6=A0=BC=E4=BD=93?= =?UTF-8?q?=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1 优化价格体系查询逻辑 --- .../impl/BasicdataPriceServiceImpl.java | 39 ++++++++++++++++++- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java index 84c969ab6..6b22adc7a 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java @@ -3061,12 +3061,12 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl routeEntities = basicdataPriceRouteService.list(wrapper); + // 如果到区没有查到价格,就到市 + if (CollUtil.isEmpty(routeEntities) && ObjectUtil.isNotEmpty(param.getEndCountyId())) { + LambdaQueryWrapper wrapper1= Wrappers.lambdaQuery() + .eq(BasicdataPriceRouteEntity::getPriceId, priceEntity.getId()) + .eq(BasicdataPriceRouteEntity::getSendOrgId, param.getSendOrgId()) + .eq(BasicdataPriceRouteEntity::getStartProvinceId, param.getStartProvinceId()) + .eq(BasicdataPriceRouteEntity::getStartCityId, param.getStartCityId()) + .eq(BasicdataPriceRouteEntity::getEndProvinceId, param.getEndProvinceId()) + .eq(BasicdataPriceRouteEntity::getEndCityId, param.getEndCityId()); + if (ObjectUtil.isNotEmpty(param.getStartCountyId())) { + wrapper1.eq(BasicdataPriceRouteEntity::getStartCountyId, param.getStartCountyId()); + } else { + wrapper1.isNull(BasicdataPriceRouteEntity::getStartCountyId); + } + wrapper1.eq(BasicdataPriceRouteEntity::getServiceType, ServiceTypeEnums.PICK_UP.getCode()); + wrapper1.isNull(BasicdataPriceRouteEntity::getEndCountyId); + routeEntities = basicdataPriceRouteService.list(wrapper1); + } if (CollUtil.isNotEmpty(routeEntities)) { PriceRouteVO detail = basicdataPriceRouteService.detail(routeEntities.get(0).getId()); PricePickupVO pickup = new PricePickupVO(); @@ -3102,6 +3120,23 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl routeEntities = basicdataPriceRouteService.list(wrapper); + if (CollUtil.isEmpty(routeEntities) && ObjectUtil.isNotEmpty(param.getEndCountyId())) { + LambdaQueryWrapper wrapper1= Wrappers.lambdaQuery() + .eq(BasicdataPriceRouteEntity::getPriceId, priceEntity.getId()) + .eq(BasicdataPriceRouteEntity::getSendOrgId, param.getSendOrgId()) + .eq(BasicdataPriceRouteEntity::getStartProvinceId, param.getStartProvinceId()) + .eq(BasicdataPriceRouteEntity::getStartCityId, param.getStartCityId()) + .eq(BasicdataPriceRouteEntity::getEndProvinceId, param.getEndProvinceId()) + .eq(BasicdataPriceRouteEntity::getEndCityId, param.getEndCityId()); + if (ObjectUtil.isNotEmpty(param.getStartCountyId())) { + wrapper1.eq(BasicdataPriceRouteEntity::getStartCountyId, param.getStartCountyId()); + } else { + wrapper1.isNull(BasicdataPriceRouteEntity::getStartCountyId); + } + wrapper1.eq(BasicdataPriceRouteEntity::getServiceType, ServiceTypeEnums.TRUNK_LINE.getCode()); + wrapper1.isNull(BasicdataPriceRouteEntity::getEndCountyId); + routeEntities = basicdataPriceRouteService.list(wrapper1); + } if (CollUtil.isNotEmpty(routeEntities)) { PriceRouteVO detail = basicdataPriceRouteService.detail(routeEntities.get(0).getId()); PriceTrunkLineVO trunkLineVO = new PriceTrunkLineVO();