From 56d62d9edb0dda9ae678dcea2323144db5d11c22 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期六, 28 十二月 2024 18:06:58 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java |   38 +++++++++++++++++++++++++++++++-------
 1 files changed, 31 insertions(+), 7 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 9f2829e..34a31bc 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
@@ -285,7 +285,7 @@
         }
         //当前绑定门店的店铺信息
         if (user.getShopId() != null) {
-            R<Shop> storeById = storeClient.getStoreById(user.getShopId());
+            R<Shop> storeById = shopClient.getShopById(user.getShopId());
             if (storeById.getData() != null) {
                 user.setShopName(storeById.getData().getName());
             }
@@ -393,12 +393,26 @@
                                             @ApiParam("每一页数据大小") Integer pageSize,
                                             AppUser appUser) {
         IPage<AppUser> appuserPage = appUserService.getAppuserPage(pageNum, pageSize, appUser);
+        for (AppUser record : appuserPage.getRecords()) {
+            if (record.getInviteUserId() != null) {
+                AppUser byId1 = appUserService.getById(record.getInviteUserId());
+                if (byId1!=null) {
+                    record.setInviteUserName(byId1.getName());
+                }
+            }
+            if (record.getShopId()!=null){
+                R<Shop> shopById = shopClient.getShopById(record.getShopId());
+                if (shopById.getData()!=null){
+                    record.setShopName(shopById.getData().getName());
+                }
+            }
+        }
         return R.ok(appuserPage);
     }
 
     @GetMapping("/shop/getAppuserPage")
     @ApiOperation(value = "用户列表", tags = {"门店后台"})
-    public R<IPage<AppUser>> shopGetAppuserPage(@ApiParam("页码") @RequestParam Integer pageNum,
+    public R<IPage<AppUser>> shopGetAppuserPage(@ApiParam("页码") @RequestParam Integer pageCurr,
                                                 @ApiParam("每一页数据大小") Integer pageSize,
                                                 AppUser appUser) {
         Integer objectId = tokenService.getLoginUser().getSysUser().getObjectId();
@@ -410,7 +424,7 @@
         for (Order datum : listR.getData()) {
             userIds.add(datum.getAppUserId());
         }
-        IPage<AppUser> appuserPage = appUserService.getAppuserPage1(pageNum, pageSize, appUser, objectId, userIds);
+        IPage<AppUser> appuserPage = appUserService.getAppuserPage1(pageCurr, pageSize, appUser, objectId, userIds);
         return R.ok(appuserPage);
     }
 
@@ -496,7 +510,7 @@
 
     @GetMapping("/change/shop")
     @ApiOperation(value = "用户列表-更换门店", tags = {"管理后台"})
-    public R<AppUser> shop(Long id, Long shopId) {
+    public R<AppUser> shop(Long id, Integer shopId) {
         AppUser byId = appUserService.getById(id);
         byId.setShopId(shopId);
         appUserService.updateById(byId);
@@ -540,7 +554,7 @@
         //推广人
         if (byId.getInviteUserId() != null) {
             AppUser byId1 = appUserService.getById(byId.getInviteUserId());
-            byId1.setInviteUserName(byId1.getInviteUserName());
+            byId.setInviteUserName(byId1.getInviteUserName());
         }
         //最后下单时间
         R<Order> lastOrder = remoteOrderGoodsClient.getLastOrder(id);
@@ -714,14 +728,24 @@
      * @return
      */
     @PostMapping("/upload")
-    public R<String> upload(MultipartFile file){
+    public String upload(MultipartFile file){
         String s = null;
         try {
             s = ObsUploadUtil.obsUpload(file);
         } catch (IOException e) {
             throw new RuntimeException(e);
         }
-        return R.ok(s);
+        return s;
+    }
+    
+    
+    /**
+     * 检查会员等级变更
+     * @param appUserId
+     */
+    @PostMapping("/vipUpgrade")
+    public void vipUpgrade(@RequestParam("appUserId") Long appUserId){
+        appUserService.vipUpgrade(appUserId);
     }
 }
 

--
Gitblit v1.7.1