From beb3256ada372fe8e59722ae1441db6954419290 Mon Sep 17 00:00:00 2001 From: dy-hu Date: Tue, 9 Jul 2024 15:33:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=AE=B6=E7=AB=AF=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=BB=91=E5=90=8D=E5=8D=95=E6=9F=A5=E8=AF=A2=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E6=89=80=E5=B1=9E=E5=95=86=E5=AE=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cereshop/business/controller/BusinessBuyerUserController.java | 6 ++++-- .../shop/cereshop/business/dao/business/BusinessBuyerUserDAO.java | 2 ++ .../business/service/buyer/CereBusinessBuyerUserService.java | 2 +- .../service/buyer/impl/CereBusinessBuyerUserServiceImpl.java | 8 ++++---- .../resources/mybatis/mapper/business/BusinessBuyerUserDAO.xml | 4 ++++ 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/cereshop-business/src/main/java/com/shop/cereshop/business/controller/BusinessBuyerUserController.java b/cereshop-business/src/main/java/com/shop/cereshop/business/controller/BusinessBuyerUserController.java index f875f2e..69823d8 100644 --- a/cereshop-business/src/main/java/com/shop/cereshop/business/controller/BusinessBuyerUserController.java +++ b/cereshop-business/src/main/java/com/shop/cereshop/business/controller/BusinessBuyerUserController.java @@ -176,8 +176,10 @@ public class BusinessBuyerUserController { @NoRepeatSubmit @ApiOperation(value = "搜索用户信息") @NoRepeatWebLog - public Result> searchUser(@RequestBody BusinessUserSearchParam param) { - Page page = cereBuyerUserService.searchUser(param); + public Result> searchUser(@RequestBody BusinessUserSearchParam param, HttpServletRequest request) { + //获取当前登录账户 + CerePlatformBusinessUser user = (CerePlatformBusinessUser) request.getAttribute("user"); + Page page = cereBuyerUserService.searchUser(String.valueOf(user.getBusinessId()), param); return new Result(page); } diff --git a/cereshop-business/src/main/java/com/shop/cereshop/business/dao/business/BusinessBuyerUserDAO.java b/cereshop-business/src/main/java/com/shop/cereshop/business/dao/business/BusinessBuyerUserDAO.java index 98daa5b..4632864 100644 --- a/cereshop-business/src/main/java/com/shop/cereshop/business/dao/business/BusinessBuyerUserDAO.java +++ b/cereshop-business/src/main/java/com/shop/cereshop/business/dao/business/BusinessBuyerUserDAO.java @@ -63,4 +63,6 @@ public interface BusinessBuyerUserDAO extends BaseMapper { List getUserLabels(BusinessBuyerGetLabelsParam param); int increaseCredit(@Param("buyerUserId") long buyerUserId, @Param("credit") Integer credit); + + List getBuyerUserBySearch(String project, String searchContent); } diff --git a/cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/CereBusinessBuyerUserService.java b/cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/CereBusinessBuyerUserService.java index 53df10a..47e1a01 100644 --- a/cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/CereBusinessBuyerUserService.java +++ b/cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/CereBusinessBuyerUserService.java @@ -79,5 +79,5 @@ public interface CereBusinessBuyerUserService { * @param param * @return */ - Page searchUser(BusinessUserSearchParam param); + Page searchUser(String project, BusinessUserSearchParam param); } diff --git a/cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/impl/CereBusinessBuyerUserServiceImpl.java b/cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/impl/CereBusinessBuyerUserServiceImpl.java index a52f994..40ac66c 100644 --- a/cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/impl/CereBusinessBuyerUserServiceImpl.java +++ b/cereshop-business/src/main/java/com/shop/cereshop/business/service/buyer/impl/CereBusinessBuyerUserServiceImpl.java @@ -237,17 +237,17 @@ public class CereBusinessBuyerUserServiceImpl implements CereBusinessBuyerUserSe } @Override - public Page searchUser(BusinessUserSearchParam param) { + public Page searchUser(String project, BusinessUserSearchParam param) { PageHelper.startPage(param.getPage(),param.getPageSize()); - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + /* LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(CereBuyerUser::getBuyerUserId, param.getSearchKey()) .or() .eq(CereBuyerUser::getWechatOpenId, param.getSearchKey()) .or() .like(CereBuyerUser::getName, param.getSearchKey()) .or() - .eq(CereBuyerUser::getPhone, param.getSearchKey()); - List userList = businessBuyerUserDAO.selectList(wrapper); + .eq(CereBuyerUser::getPhone, param.getSearchKey());*/ + List userList = businessBuyerUserDAO.getBuyerUserBySearch(project, param.getSearchKey()); PageInfo pageInfo=new PageInfo<>(userList); Page page=new Page(pageInfo.getList(),pageInfo.getTotal()); return page; diff --git a/cereshop-business/src/main/resources/mybatis/mapper/business/BusinessBuyerUserDAO.xml b/cereshop-business/src/main/resources/mybatis/mapper/business/BusinessBuyerUserDAO.xml index f7d33a4..d89aee6 100644 --- a/cereshop-business/src/main/resources/mybatis/mapper/business/BusinessBuyerUserDAO.xml +++ b/cereshop-business/src/main/resources/mybatis/mapper/business/BusinessBuyerUserDAO.xml @@ -344,4 +344,8 @@ LEFT JOIN cere_platform_label b ON a.buyer_label_id=b.buyer_label_id where a.buyer_user_id=#{buyerUserId} + +