xiaoyong931011
2023-10-25 0e7e1cfea951c7aee59a862c514e08a040523d9f
版本管理
8 files modified
95 ■■■■ changed files
src/main/java/cc/mrbird/febs/mall/controller/AdminChatController.java 23 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/entity/ChatUser.java 4 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/mapper/ChatUserMapper.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/IAdminChatService.java 4 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/impl/AdminChatServiceImpl.java 20 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/vo/AdminChatUserPerkVo.java 4 ●●●● patch | view | raw | blame | history
src/main/resources/mapper/modules/ChatUserMapper.xml 8 ●●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/chat/userPerkList.html 30 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/controller/AdminChatController.java
@@ -64,6 +64,29 @@
     * @param userId
     * @return
     */
    @GetMapping("openSwitchGetBoom/{userId}")
    @ControllerEndpoint(operation = "会员列表---开启", exceptionMessage = "操作失败")
    public FebsResponse openSwitchGetBoom(@NotNull(message = "{required}") @PathVariable String userId) {
        return iAdminChatService.openSwitchGetBoom(userId);
    }
    /**
     * 用户列表---关闭
     *
     * @param userId
     * @return
     */
    @GetMapping("closeSwitchGetBoom/{userId}")
    @ControllerEndpoint(operation = "会员列表---关闭", exceptionMessage = "操作失败")
    public FebsResponse closeSwitchGetBoom(@NotNull(message = "{required}") @PathVariable String userId) {
        return iAdminChatService.closeSwitchGetBoom(userId);
    }
    /**
     * 用户列表---开启
     *
     * @param userId
     * @return
     */
    @GetMapping("openCreateGroup/{userId}")
    @ControllerEndpoint(operation = "会员列表---开启", exceptionMessage = "操作失败")
    public FebsResponse openCreateGroup(@NotNull(message = "{required}") @PathVariable String userId) {
src/main/java/cc/mrbird/febs/mall/entity/ChatUser.java
@@ -132,6 +132,10 @@
     * 是否允许创建群聊 1:可以 0:不可以
     */
    private Integer createGroup;
    /**
     * 是否中雷 1:是 0:否
     */
    private Integer getBoom;
}
src/main/java/cc/mrbird/febs/mall/mapper/ChatUserMapper.java
@@ -78,4 +78,6 @@
    void updateOverdueStatusById(@Param("overdueState")Integer overdueState, @Param("id")Long id);
    void updatePortraitById(@Param("userId")Long userId, @Param("portrait")String portrait);
    void updateGetBoomByUserId(@Param("userId")String userId, @Param("getBoom")int i);
}
src/main/java/cc/mrbird/febs/mall/service/IAdminChatService.java
@@ -65,4 +65,8 @@
    FebsResponse openCreateGroup(String userId);
    FebsResponse closeCreateGroup(String userId);
    FebsResponse openSwitchGetBoom(String userId);
    FebsResponse closeSwitchGetBoom(String userId);
}
src/main/java/cc/mrbird/febs/mall/service/impl/AdminChatServiceImpl.java
@@ -329,4 +329,24 @@
        this.baseMapper.updateCreateGroupByUserId(userId,0);
        return new FebsResponse().success();
    }
    @Override
    public FebsResponse openSwitchGetBoom(String userId) {
        ChatUser chatUser = this.baseMapper.selectByUserId(userId);
        if(ObjectUtil.isEmpty(chatUser)) {
            return new FebsResponse().fail().message("会员信息不存在");
        }
        this.baseMapper.updateGetBoomByUserId(userId,1);
        return new FebsResponse().success();
    }
    @Override
    public FebsResponse closeSwitchGetBoom(String userId) {
        ChatUser chatUser = this.baseMapper.selectByUserId(userId);
        if(ObjectUtil.isEmpty(chatUser)) {
            return new FebsResponse().fail().message("会员信息不存在");
        }
        this.baseMapper.updateGetBoomByUserId(userId,0);
        return new FebsResponse().success();
    }
}
src/main/java/cc/mrbird/febs/mall/vo/AdminChatUserPerkVo.java
@@ -43,6 +43,10 @@
     * 是否是机器人 0:否 1:是
     */
    private Integer isRobot;
    /**
     * 是否中雷 1:是 0:否
     */
    private Integer getBoom;
    /**
     * 发红包个数
src/main/resources/mapper/modules/ChatUserMapper.xml
@@ -43,6 +43,7 @@
        a.user_id userId,
        a.nick_name nickName,
        a.chat_no chatNo,
        a.get_boom getBoom,
        a.phone phone,
        a.invite_id inviteId,
        a.is_robot isRobot,
@@ -400,5 +401,12 @@
        where user_id = #{userId}
    </update>
    <update id="updateGetBoomByUserId">
        update chat_user
        set
            get_boom = #{getBoom}
        where user_id = #{userId}
    </update>
</mapper>
src/main/resources/templates/febs/views/modules/chat/userPerkList.html
@@ -61,13 +61,13 @@
    <a lay-event="edit" shiro:hasPermission="user:update"><i
            class="layui-icon febs-edit-area febs-blue">&#xe7a5;</i></a>
</script>
<!--<script type="text/html" id="switchIsRobot">-->
<!--    {{# if(d.isRobot === 1) { }}-->
<!--    <input type="checkbox" value={{d.userId}} lay-text="是|否" checked lay-skin="switch" lay-filter="switchIsRobot">-->
<!--    {{# } else { }}-->
<!--    <input type="checkbox" value={{d.userId}} lay-text="是|否" lay-skin="switch" lay-filter="switchIsRobot">-->
<!--    {{# } }}-->
<!--</script>-->
<script type="text/html" id="switchGetBoom">
    {{# if(d.getBoom === 1) { }}
    <input type="checkbox" value={{d.userId}} lay-text="是|否" checked lay-skin="switch" lay-filter="switchGetBoom">
    {{# } else { }}
    <input type="checkbox" value={{d.userId}} lay-text="是|否" lay-skin="switch" lay-filter="switchGetBoom">
    {{# } }}
</script>
<style>
    .layui-form-onswitch {
        background-color: #5FB878 !important;
@@ -145,7 +145,7 @@
                    {field: 'groupRedBagNum', title: '群红包数', minWidth: 80,align:'left'},
                    {field: 'redBagTotalAmount', title: '红包总额', minWidth: 80,align:'left'},
                    {field: 'redBagAvaAmount', title: '未领取', minWidth: 80,align:'left'},
                    // {field: 'isRobot', title: '机器人', templet: '#switchIsRobot', minWidth: 80,align:'center'},
                    {field: 'getBoom', title: '中雷', templet: '#switchGetBoom', minWidth: 80,align:'center'},
                    {field: 'createTime', title: '注册时间', minWidth: 180,align:'center'},
                ]]
            });
@@ -213,21 +213,21 @@
            });
        }
        form.on('switch(switchIsRobot)', function (data) {
        form.on('switch(switchGetBoom)', function (data) {
            if (data.elem.checked) {
                openSwitchIsRobot(data.value);
                openSwitchGetBoom(data.value);
            } else {
                closeSwitchIsRobot(data.value);
                closeSwitchGetBoom(data.value);
            }
        })
        function openSwitchIsRobot(userId) {
            febs.get(ctx + 'admin/chat/openSwitchIsRobot/' + userId, null, function () {
        function openSwitchGetBoom(userId) {
            febs.get(ctx + 'admin/chat/openSwitchGetBoom/' + userId, null, function () {
                febs.alert.success('操作成功');
                $reset.click();
            });
        }
        function closeSwitchIsRobot(userId) {
            febs.get(ctx + 'admin/chat/closeSwitchIsRobot/' + userId, null, function () {
        function closeSwitchGetBoom(userId) {
            febs.get(ctx + 'admin/chat/closeSwitchGetBoom/' + userId, null, function () {
                febs.alert.success('操作成功');
                $reset.click();
            });