From 274673c7c81c639c1edb038281445f076c824dc1 Mon Sep 17 00:00:00 2001
From: luofl <1442745593@qq.com>
Date: 星期二, 18 三月 2025 09:08:17 +0800
Subject: [PATCH] 迭代版本:2.28

---
 ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUser.java            |   16 ++++++++++++++++
 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java |   36 ++++++++++++++++++++++++++++++++++++
 ruoyi-service/ruoyi-account/src/main/resources/mapper/account/AppUserMapper.xml               |    5 ++++-
 3 files changed, 56 insertions(+), 1 deletions(-)

diff --git a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUser.java b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUser.java
index ca0c317..c3b250c 100644
--- a/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUser.java
+++ b/ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUser.java
@@ -339,11 +339,27 @@
     @TableField(exist = false)
     private Set<Long> userIds;
 
+    @TableField(exist = false)
+    private Integer excludeStatus;
+
     public String getIdStr(){
         return String.valueOf(id);
     }
 
 
+    public Integer getUserTotalPoint(){
+        if (lowerLevelSharePoint == null){
+            lowerLevelSharePoint = 0;
+        }
+        if (shopSharePoint == null){
+            shopSharePoint = 0;
+        }
+        if (shopAchievementPoint == null){
+            shopAchievementPoint = 0;
+        }
+        return totalPoint - lowerLevelSharePoint - shopSharePoint - shopAchievementPoint;
+    }
+
 
 
 }
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 e99289b..7d2c4ab 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
@@ -733,6 +733,7 @@
             shopId = sysUser.getObjectId();
             userId = orderClient.getAppUserByShoppingShop(shopId).getData();
         }
+        appUser.setExcludeStatus(3);
         IPage<AppUser> appuserPage = appUserService.getAppuserPage(pageNum, pageSize, appUser, shopId, userId);
         for (AppUser record : appuserPage.getRecords()) {
             if (record.getInviteUserId() != null) {
@@ -747,11 +748,46 @@
                     record.setShopName(shopById.getData().getName());
                 }
             }
+            record.setTotalPoint(record.getUserTotalPoint());
         }
         return R.ok(appuserPage);
     }
 
 
+    /**
+     * 获取用户积分列表
+     */
+    @GetMapping("/getUserPotPage")
+    public R<IPage<AppUser>> getUserPotPage(@ApiParam("页码") @RequestParam Integer pageNum,
+                                               @ApiParam("每一页数据大小") Integer pageSize,
+                                               AppUser appUser) {
+        Long userid = tokenService.getLoginUser().getUserid();
+        SysUser sysUser = sysUserClient.getSysUser(userid).getData();
+        Integer shopId = null;
+        Set<Long> userId = null;
+        if(sysUser.getRoleType() == 2){
+            shopId = sysUser.getObjectId();
+            userId = orderClient.getAppUserByShoppingShop(shopId).getData();
+        }
+        IPage<AppUser> appuserPage = appUserService.getAppuserPage(pageNum, pageSize, appUser, shopId, userId);
+        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());
+                }
+            }
+            record.setTotalPoint(record.getUserTotalPoint());
+        }
+        return R.ok(appuserPage);
+    }
+
 
     @GetMapping("/shop/getAppuserPage")
     @ApiOperation(value = "用户列表", tags = {"门店后台"})
diff --git a/ruoyi-service/ruoyi-account/src/main/resources/mapper/account/AppUserMapper.xml b/ruoyi-service/ruoyi-account/src/main/resources/mapper/account/AppUserMapper.xml
index 91a119e..47bdd70 100644
--- a/ruoyi-service/ruoyi-account/src/main/resources/mapper/account/AppUserMapper.xml
+++ b/ruoyi-service/ruoyi-account/src/main/resources/mapper/account/AppUserMapper.xml
@@ -53,7 +53,10 @@
         SELECT *
         FROM t_app_user ta
         <where>
-            ta.del_flag = 0 and ta.status != 3
+            ta.del_flag = 0
+            <if test="appUser.excludeStatus != null">
+                and ta.status != #{appUser.excludeStatus}
+            </if>
             <if test="appUser.name != null and appUser.name != ''">
                 and ta.`name` like CONCAT('%',#{appUser.name},'%')
             </if>

--
Gitblit v1.7.1