From a5028fecf49946abd2cec7e2abe899d936c3436b Mon Sep 17 00:00:00 2001 From: luodangjia <luodangjia> Date: 星期三, 15 一月 2025 14:25:33 +0800 Subject: [PATCH] 12.18 --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java | 20 +++++++++++--------- 1 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java index 6fbad78..39c3874 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/GoodsServiceImpl.java @@ -92,6 +92,8 @@ + + @Override public PageInfo<GoodsVO> goodsList(Goods search) { Integer vipId = 0; @@ -127,13 +129,13 @@ @Override public int compare(GoodsVO o1, GoodsVO o2) { if(null != o1.getSellingPrice() && null != o2.getSellingPrice()){ - return o1.getSellingPrice().compareTo(o2.getSellingPrice()) * (StringUtils.isNotEmpty(search.getIsAsc()) ? -1 : 1); + return o1.getSellingPrice().compareTo(o2.getSellingPrice()) * ("desc".equals(search.getIsAsc()) ? -1 : 1); } if(null == o1.getSellingPrice() && null != o2.getSellingPrice()){ - return BigDecimal.ZERO.compareTo(o2.getSellingPrice()) * (StringUtils.isNotEmpty(search.getIsAsc()) ? -1 : 1); + return BigDecimal.ZERO.compareTo(o2.getSellingPrice()) * ("desc".equals(search.getIsAsc()) ? -1 : 1); } if(null != o1.getSellingPrice() && null == o2.getSellingPrice()){ - return o1.getSellingPrice().compareTo(BigDecimal.ZERO) * (StringUtils.isNotEmpty(search.getIsAsc()) ? -1 : 1); + return o1.getSellingPrice().compareTo(BigDecimal.ZERO) * ("desc".equals(search.getIsAsc()) ? -1 : 1); } return 0; } @@ -585,15 +587,15 @@ if(null == bargainPriceDetail){ //没有门店特价,判断地区价格配置 LambdaQueryWrapper<GoodsArea> queryWrapper = new LambdaQueryWrapper<GoodsArea>().eq(GoodsArea::getGoodsId, goodsId).eq(GoodsArea::getVip, vip); - if(StringUtils.isNotEmpty(districtCode)){ - queryWrapper.eq(GoodsArea::getDistrictsCode, districtCode); - } - if(StringUtils.isNotEmpty(cityCode)){ - queryWrapper.eq(GoodsArea::getCityCode, cityCode); - } if(StringUtils.isNotEmpty(provinceCode)){ queryWrapper.eq(GoodsArea::getProvinceCode, provinceCode); } + if(StringUtils.isNotEmpty(cityCode)){ + queryWrapper.and(i -> i.eq(GoodsArea::getCityCode, cityCode).or().isNull(GoodsArea::getCityCode)); + } + if(StringUtils.isNotEmpty(districtCode)){ + queryWrapper.and(i -> i.eq(GoodsArea::getDistrictsCode, districtCode).or().isNull(GoodsArea::getDistrictsCode)); + } GoodsArea goodsArea = goodsAreaService.getOne(queryWrapper); if(null == goodsArea){ //没有地区价格,则使用会员价格 -- Gitblit v1.7.1