From fc12805d240c384191a5e683071c037ab7b05670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=85=81=E6=9E=9E?= <3422692813@qq.com> Date: Wed, 13 Nov 2024 17:32:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InspectionMallPartnersController.java | 6 +-- .../ShopInspectionGoodsController.java | 2 +- .../impl/AppInspectionPartnerServiceImpl.java | 2 +- .../impl/ShopInspectionGoodsServiceImpl.java | 12 +++--- .../impl/PartnerCustomerInfoServiceImpl.java | 26 ------------ .../impl/RescueDriverInfoServiceImpl.java | 41 ++++++++++--------- 6 files changed, 34 insertions(+), 55 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionMallPartnersController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionMallPartnersController.java index 4d5d3018..bb16d0e2 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionMallPartnersController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/InspectionMallPartnersController.java @@ -117,7 +117,7 @@ public class InspectionMallPartnersController extends BaseController { ShopMallPartners partner = new ShopMallPartners(); if (roles.contains("jcshop")){ LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); - queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0"); + queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1"); partner = shopMallPartnersService.getOne(queryWrapper); if (ObjectUtil.isEmpty(partner)){ return error(); @@ -150,7 +150,7 @@ public class InspectionMallPartnersController extends BaseController { ShopMallPartners partner = new ShopMallPartners(); if (roles.contains("jcshop")){ LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); - queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0"); + queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1"); partner = shopMallPartnersService.getOne(queryWrapper); if (ObjectUtil.isEmpty(partner)){ return error(); @@ -270,7 +270,7 @@ public class InspectionMallPartnersController extends BaseController { ShopMallPartners partner = new ShopMallPartners(); if (roles.contains("jcshop")){ LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); - queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0"); + queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1"); partner = shopMallPartnersService.getOne(queryWrapper); if (ObjectUtil.isEmpty(partner)){ return CommonResult.error(-1,"信息有误"); diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/ShopInspectionGoodsController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/ShopInspectionGoodsController.java index ce67a2df..35071c7f 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/ShopInspectionGoodsController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/ShopInspectionGoodsController.java @@ -186,7 +186,7 @@ public class ShopInspectionGoodsController extends BaseController ShopMallPartners partner = new ShopMallPartners(); if (roles.contains("jcshop")){ LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); - queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0"); + queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1"); partner = appInspectionPartnerService.getOne(queryWrapper); if (ObjectUtil.isEmpty(partner)){ return error(); diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java index 69287197..0db942eb 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java @@ -174,7 +174,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl queryWrapper =new LambdaQueryWrapper<>(); - queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0"); + queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1"); partner = this.getOne(queryWrapper); if (ObjectUtil.isEmpty(partner)){ throw new Exception("信息有误"); diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/ShopInspectionGoodsServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/ShopInspectionGoodsServiceImpl.java index d12aeda4..4325ebba 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/ShopInspectionGoodsServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/ShopInspectionGoodsServiceImpl.java @@ -246,11 +246,13 @@ public class ShopInspectionGoodsServiceImpl extends ServiceImpl categoryList() throws Exception { ShopMallPartners one = appInspectionPartnerService.shopInfoByUserId(); List shopInspectionCategories = appInspectionPartnerService.categoryList(one.getPartnerId()); - for (ShopInspectionCategory shopInspectionCategory : shopInspectionCategories) { - LambdaQueryWrapper templateLambdaQueryWrapper =new LambdaQueryWrapper<>(); - templateLambdaQueryWrapper.eq(InspectionCategoryTemplate::getCategoryId,shopInspectionCategory.getId()).orderByAsc(InspectionCategoryTemplate::getSkuPrice); - List list = categoryTemplateService.list(templateLambdaQueryWrapper); - shopInspectionCategory.setTemplates(list); + if (CollectionUtil.isNotEmpty(shopInspectionCategories)) { + for (ShopInspectionCategory shopInspectionCategory : shopInspectionCategories) { + LambdaQueryWrapper templateLambdaQueryWrapper = new LambdaQueryWrapper<>(); + templateLambdaQueryWrapper.eq(InspectionCategoryTemplate::getCategoryId, shopInspectionCategory.getId()).orderByAsc(InspectionCategoryTemplate::getSkuPrice); + List list = categoryTemplateService.list(templateLambdaQueryWrapper); + shopInspectionCategory.setTemplates(list); + } } return shopInspectionCategories; } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/service/impl/PartnerCustomerInfoServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/service/impl/PartnerCustomerInfoServiceImpl.java index 1dfda244..4948842b 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/service/impl/PartnerCustomerInfoServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/partner/service/impl/PartnerCustomerInfoServiceImpl.java @@ -65,12 +65,6 @@ public class PartnerCustomerInfoServiceImpl extends ServiceImpl