From 6b3a3251bc06b081903dfe94134f034608c18ba4 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期三, 18 十二月 2024 16:03:01 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/qijisheng --- ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java | 87 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 86 insertions(+), 1 deletions(-) diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java index a6bb668..e0d3393 100644 --- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java @@ -34,6 +34,7 @@ import javax.annotation.Resource; import java.time.LocalDate; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @@ -415,9 +416,10 @@ for (Order datum : listR.getData()) { userIds.add(datum.getAppUserId()); } - IPage<AppUser> appuserPage = appUserService.getAppuserPage1(pageNum, pageSize, appUser,objectId); + IPage<AppUser> appuserPage = appUserService.getAppuserPage1(pageNum, pageSize, appUser,objectId,userIds); return R.ok(appuserPage); } + @GetMapping("/danger/info") @@ -480,6 +482,52 @@ appUserService.updateById(byId); return R.ok(); } + + @GetMapping("/select") + @ApiOperation(value = "用户列表-查询绑定人", tags = {"管理后台"}) + public R<AppUser> select(String phone) + { + AppUser byId = appUserService.lambdaQuery().eq(AppUser::getPhone,phone).one(); + if (byId==null){ + return R.fail("搜索失败,手机号错误。"); + } + return R.ok(byId); + } + + @GetMapping("/change/bind") + @ApiOperation(value = "用户列表-更换绑定人", tags = {"管理后台"}) + public R<AppUser> select(Long id,Long inviteId) + { + AppUser byId = appUserService.getById(id); + byId.setInviteUserId(inviteId); + byId.setTopInviteId(getTop(inviteId)); + appUserService.updateById(byId); + return R.ok(); + } + @GetMapping("/change/shop") + @ApiOperation(value = "用户列表-更换门店", tags = {"管理后台"}) + public R<AppUser> shop(Long id,Long shopId) + { + AppUser byId = appUserService.getById(id); + byId.setShopId(shopId); + appUserService.updateById(byId); + return R.ok(); + } + + + public Long getTop(Long inviteId){ + AppUser byId = appUserService.getById(inviteId); + if (byId!=null){ + return getTop(byId.getInviteUserId()); + }else { + return inviteId; + } + } + + + + + @Resource private ShopClient shopClient; @Resource @@ -514,8 +562,35 @@ if (lastOrder.getData()!=null){ byId.setLastOrderTime(lastOrder.getData().getCreateTime()); } + //消费总金额 return R.ok(byId); } + + @Resource + private UserChangeLogService userChangeLogService; + @GetMapping("/change/vip") + @ApiOperation(value = "用户列表-修改会员等级", tags = {"管理后台"}) + public R<Page<AppUser>> changevip(Long id,Integer vipId) + { + AppUser byId = appUserService.getById(id); + + UserChangeLog userChangeLog = new UserChangeLog(); + userChangeLog.setCreateTime(LocalDateTime.now()); + userChangeLog.setAppUserId(byId.getId()); + userChangeLog.setBeforeVipId(byId.getVipId()); + userChangeLog.setAfterVipId(vipId); + if (userChangeLog.getBeforeVipId()>userChangeLog.getAfterVipId()) { + userChangeLog.setChangeType(0); + }else { + userChangeLog.setChangeType(1); + } + userChangeLogService.save(userChangeLog); + byId.setVipId(vipId); + appUserService.updateById(byId); + return R.ok(); + + } + @GetMapping("/bottom") @ApiOperation(value = "用户列表-绑定下级列表", tags = {"管理后台"}) public R<Page<AppUser>> bottom(Long id,Integer pageNum,Integer pageSize) @@ -526,6 +601,16 @@ } + @GetMapping("/orders") + @ApiOperation(value = "用户列表-订单列表", tags = {"管理后台"}) + public R<List<Order>> orders(Long id) + { + R<List<Order>> listR = remoteOrderGoodsClient.byUserId(id); + return R.ok(listR.getData()); + + } + + -- Gitblit v1.7.1