| | |
| | | } |
| | | |
| | | /** |
| | | * 用户列表---开启 |
| | | * |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("openSwitchIsRobot/{userId}") |
| | | @ControllerEndpoint(operation = "会员列表---开启", exceptionMessage = "操作失败") |
| | | public FebsResponse openSwitchIsRobot(@NotNull(message = "{required}") @PathVariable String userId) { |
| | | return iAdminChatService.openSwitchIsRobot(userId); |
| | | } |
| | | /** |
| | | * 用户列表---关闭 |
| | | * |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("closeSwitchIsRobot/{userId}") |
| | | @ControllerEndpoint(operation = "会员列表---关闭", exceptionMessage = "操作失败") |
| | | public FebsResponse closeSwitchIsRobot(@NotNull(message = "{required}") @PathVariable String userId) { |
| | | return iAdminChatService.closeSwitchIsRobot(userId); |
| | | } |
| | | |
| | | /** |
| | | * 用户列表-系统拨付 |
| | | */ |
| | | @PostMapping("updateSystemPay") |
| | |
| | | * 版本信息 |
| | | */ |
| | | private String version; |
| | | |
| | | /** |
| | | * 邀请码 |
| | | */ |
| | | private String inviteId; |
| | | |
| | | /** |
| | | * 父级邀请码 |
| | | */ |
| | | private String referrerId; |
| | | |
| | | /** |
| | | * 邀请码链 |
| | | */ |
| | | private String referrerIds; |
| | | |
| | | /** |
| | | * 是否是机器人 0:否 1:是 |
| | | */ |
| | | private Integer isRobot; |
| | | /** |
| | | * 注册时间 |
| | | */ |
| | |
| | | void updateWithdrawStateById(@Param("state")int i,@Param("id")String id); |
| | | |
| | | void updateAmountFlowListByWithdrawId(@Param("id")String id, @Param("userId")String userId, @Param("state")int i); |
| | | |
| | | void updateIsRobotByUserId(@Param("userId")String userId, @Param("isRobot")int i); |
| | | } |
| | |
| | | FebsResponse agreeEvent(String id); |
| | | |
| | | FebsResponse disagreeEvent(String id); |
| | | |
| | | FebsResponse openSwitchIsRobot(String userId); |
| | | |
| | | FebsResponse closeSwitchIsRobot(String userId); |
| | | } |
| | |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.utils.RedisUtils; |
| | | import cc.mrbird.febs.mall.YesOrNoEnum; |
| | | import cc.mrbird.febs.mall.dto.AdminSystemPayDto; |
| | | import cc.mrbird.febs.mall.entity.ChatAmountFlow; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | |
| | | public class AdminChatServiceImpl extends ServiceImpl<ChatUserMapper, ChatUser> implements IAdminChatService { |
| | | |
| | | private final ChatAmountFlowMapper chatAmountFlowMapper; |
| | | private final RedisUtils redisUtils; |
| | | |
| | | @Override |
| | | public IPage<AdminChatUserVo> getUserList(ChatUser chatUser, QueryRequest request) { |
| | |
| | | return new FebsResponse().fail().message("会员信息不存在"); |
| | | } |
| | | this.baseMapper.updateStatusByUserId(userId,YesOrNoEnum.NO.getCode()); |
| | | if (chatUser != null) { |
| | | // 清理token |
| | | String token = chatUser.getToken(); |
| | | if (!StringUtils.isEmpty(token)) { |
| | | String TOKEN_REDIS_APP = "token:app:"; |
| | | redisUtils.del(TOKEN_REDIS_APP + token); |
| | | } |
| | | } |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse openSwitchIsRobot(String userId) { |
| | | ChatUser chatUser = this.baseMapper.selectByUserId(userId); |
| | | if(ObjectUtil.isEmpty(chatUser)) { |
| | | return new FebsResponse().fail().message("会员信息不存在"); |
| | | } |
| | | this.baseMapper.updateIsRobotByUserId(userId,1); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse closeSwitchIsRobot(String userId) { |
| | | ChatUser chatUser = this.baseMapper.selectByUserId(userId); |
| | | if(ObjectUtil.isEmpty(chatUser)) { |
| | | return new FebsResponse().fail().message("会员信息不存在"); |
| | | } |
| | | this.baseMapper.updateIsRobotByUserId(userId,0); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | } |
| | |
| | | * 账户可用 |
| | | */ |
| | | private BigDecimal avaAmount; |
| | | |
| | | /** |
| | | * 邀请码 |
| | | */ |
| | | private String inviteId; |
| | | |
| | | /** |
| | | * 邀请码 |
| | | */ |
| | | private String phone; |
| | | |
| | | /** |
| | | * 是否是机器人 0:否 1:是 |
| | | */ |
| | | private Integer isRobot; |
| | | } |
| | |
| | | # Redis数据库索引(默认为 0) |
| | | database: 2 |
| | | # Redis服务器地址 |
| | | host: 127.0.0.1 |
| | | host: 154.91.195.148 |
| | | # Redis服务器连接端口 |
| | | port: 6379 |
| | | # Redis 密码 |
| | |
| | | |
| | | # rabbitmq 配置 |
| | | rabbitmq: |
| | | host: 127.0.0.1 |
| | | host: 154.91.195.148 |
| | | port: 5672 |
| | | username: xc_rabbit |
| | | password: xuncong123 |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: dev |
| | | active: prod |
| | | |
| | | servlet: |
| | | multipart: |
| | |
| | | a.user_id userId, |
| | | a.nick_name nickName, |
| | | a.chat_no chatNo, |
| | | a.phone phone, |
| | | a.status status, |
| | | a.invite_id inviteId, |
| | | a.is_robot isRobot, |
| | | date_format(a.create_time, '%Y-%m-%d %H:%m:%s') createTime, |
| | | IFNULL(sum(b.total_amount), 0) totalAmount, |
| | | IFNULL(sum(b.ava_amount), 0) avaAmount |
| | |
| | | <if test="record.nickName != null and record.nickName != ''"> |
| | | and a.nick_name like CONCAT('%', CONCAT(#{record.nickName}, '%')) |
| | | </if> |
| | | <if test="record.chatNo != null and record.chatNo != ''"> |
| | | and a.chat_no = #{record.chatNo} |
| | | <if test="record.inviteId != null and record.inviteId != ''"> |
| | | and a.invite_id = #{record.inviteId} |
| | | </if> |
| | | <if test="record.status != null and record.status != ''"> |
| | | and a.status = #{record.status} |
| | |
| | | update chat_amount_flow set state = #{state} where user_id = #{userId} and relation_id = #{id} |
| | | </update> |
| | | |
| | | <update id="updateIsRobotByUserId"> |
| | | update chat_user |
| | | set |
| | | is_robot = #{isRobot} |
| | | where user_id = #{userId} |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | <option value="4">转账</option> |
| | | <option value="5">创建群聊</option> |
| | | <option value="6">系统拨付</option> |
| | | <option value="7">团队奖励</option> |
| | | <option value="8">集团奖励</option> |
| | | <option value="9">中雷补偿</option> |
| | | <option value="10">中雷扣除</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | 4: {title: '转账', color: 'orange'}, |
| | | 5: {title: '创建群聊', color: 'green'}, |
| | | 6: {title: '系统拨付', color: 'blue'}, |
| | | 7: {title: '团队奖励', color: 'blue'}, |
| | | 8: {title: '集团奖励', color: 'blue'}, |
| | | 9: {title: '中雷补偿', color: 'blue'}, |
| | | 10: {title: '中雷扣除', color: 'blue'}, |
| | | }[d.type]; |
| | | }} |
| | | <span class="layui-badge febs-bg-{{type.color}}">{{ type.title }}</span> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">微聊号:</label> |
| | | <label class="layui-form-label">邀请码:</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" placeholder="微聊号" name="chatNo" autocomplete="off" class="layui-input"> |
| | | <input type="text" placeholder="邀请码" name="inviteId" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | <input type="checkbox" value={{d.userId}} lay-text="正常|禁用" checked lay-skin="switch" lay-filter="switchStatus"> |
| | | {{# } else { }} |
| | | <input type="checkbox" value={{d.userId}} lay-text="正常|禁用" lay-skin="switch" lay-filter="switchStatus"> |
| | | {{# } }} |
| | | </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> |
| | | <style> |
| | |
| | | function getQueryParams() { |
| | | return { |
| | | nickName: $searchForm.find('input[name="nickName"]').val().trim(), |
| | | chatNo: $searchForm.find('input[name="chatNo"]').val().trim(), |
| | | inviteId: $searchForm.find('input[name="inviteId"]').val().trim(), |
| | | status: $searchForm.find("select[name='status']").val() |
| | | }; |
| | | } |
| | |
| | | totalRow: true ,// 开启合计行 |
| | | cols: [[ |
| | | {type: 'checkbox'}, |
| | | {field: 'userId', title: '标识', minWidth: 150,align:'left', totalRowText: '合计:',align:'center'}, |
| | | {field: 'nickName', title: '昵称', minWidth: 100,align:'left',align:'center'}, |
| | | {field: 'chatNo', title: '微聊号', minWidth: 150,align:'left',align:'center'}, |
| | | // {field: 'userId', title: '标识', minWidth: 150,align:'left'}, |
| | | {field: 'nickName', title: '昵称', minWidth: 100,align:'left', totalRowText: '合计:',align:'center'}, |
| | | {field: 'inviteId', title: '邀请码', minWidth: 100,align:'left',align:'center'}, |
| | | {field: 'phone', title: '注册号码', minWidth: 150,align:'left',align:'center'}, |
| | | {field: 'totalAmount', title: '账户总额', minWidth: 80,align:'left',totalRow: '{{= parseInt(d.totalAmount) }}',align:'center'}, |
| | | {field: 'avaAmount', title: '账户余额', minWidth: 80,align:'left',totalRow: '{{= parseInt(d.avaAmount) }}',align:'center'}, |
| | | {field: 'status', title: '账号状态', templet: '#switchStatus', minWidth: 80,align:'center'}, |
| | | {field: 'isRobot', title: '机器人', templet: '#switchIsRobot', minWidth: 80,align:'center'}, |
| | | {field: 'createTime', title: '注册时间', minWidth: 180,align:'center'}, |
| | | ]] |
| | | }); |
| | |
| | | }); |
| | | } |
| | | |
| | | form.on('switch(switchIsRobot)', function (data) { |
| | | if (data.elem.checked) { |
| | | openSwitchIsRobot(data.value); |
| | | } else { |
| | | closeSwitchIsRobot(data.value); |
| | | } |
| | | }) |
| | | function openSwitchIsRobot(userId) { |
| | | febs.get(ctx + 'admin/chat/openSwitchIsRobot/' + userId, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function closeSwitchIsRobot(userId) { |
| | | febs.get(ctx + 'admin/chat/closeSwitchIsRobot/' + userId, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | |
| | | }) |
| | | </script> |