luofl
2025-03-18 274673c7c81c639c1edb038281445f076c824dc1
迭代版本:2.28
3个文件已修改
57 ■■■■■ 已修改文件
ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/AppUser.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/resources/mapper/account/AppUserMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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;
    }
}
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 = {"门店后台"})
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>