Browse Source

Merge branch 'saas_2022_05_17_activity' of http://git.dayaedu.com/yonge/mec into saas_zouxuan_2022_05_31

zouxuan 3 years ago
parent
commit
019b066804

+ 27 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ImLiveRoomBlackDao.java

@@ -0,0 +1,27 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ym.mec.biz.dal.entity.ImLiveRoomBlack;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 直播房间黑名单表(ImLiveRoomBlack)表数据库访问层
+ *
+ * @author hgw
+ * @since 2022-05-30 14:58:31
+ */
+public interface ImLiveRoomBlackDao extends BaseMapper<ImLiveRoomBlack> {
+
+    int insertBatch(@Param("entities") List<ImLiveRoomBlack> entities);
+
+    <T> IPage<T> queryStudent(Page<T> page, @Param("param") Map<String, Object> param);
+
+    <T> IPage<T> queryBlackList(Page<T> page, @Param("param") Map<String, Object> param);
+
+}
+

+ 98 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ImLiveRoomBlack.java

@@ -0,0 +1,98 @@
+package com.ym.mec.biz.dal.entity;
+
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.TableId;
+
+import java.io.Serializable;
+
+/**
+ * 直播房间黑名单表(ImLiveRoomBlack)表实体类
+ *
+ * @author hgw
+ * @since 2022-05-30 14:58:31
+ */
+@ApiModel(value = "im_live_room_black-直播房间黑名单表")
+public class ImLiveRoomBlack implements Serializable {
+    @TableId(value = "id_", type = IdType.AUTO)
+    @ApiModelProperty(value = "主键")
+    private Integer id;
+
+    @TableField("room_uid_")
+    @ApiModelProperty(value = "直播间uid")
+    private String roomUid;
+
+    @TableField("user_id_")
+    @ApiModelProperty(value = "用户id")
+    private Integer userId;
+
+    @TableField("type_")
+    @ApiModelProperty(value = "-1公共黑名单 0指定直播间黑名单")
+    private Integer type;
+
+    @TableField("create_by_")
+    @ApiModelProperty(value = "创建人")
+    private Integer createBy;
+
+    @TableField("create_time_")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getRoomUid() {
+        return roomUid;
+    }
+
+    public void setRoomUid(String roomUid) {
+        this.roomUid = roomUid;
+    }
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public Integer getCreateBy() {
+        return createBy;
+    }
+
+    public void setCreateBy(Integer createBy) {
+        this.createBy = createBy;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+
+}
+

+ 69 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/vo/ImLiveRoomBlackVo.java

@@ -0,0 +1,69 @@
+package com.ym.mec.biz.dal.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@ApiModel(value = "直播间黑名单人员")
+public class ImLiveRoomBlackVo implements Serializable {
+    @ApiModelProperty(value = "用户id")
+    private Integer userId;
+
+    @ApiModelProperty(value = "用户昵称")
+    private String username;
+
+    @ApiModelProperty(value = "真实名称")
+    private String realName;
+
+    @ApiModelProperty(value = "手机号")
+    private String phone;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getRealName() {
+        return realName;
+    }
+
+    public void setRealName(String realName) {
+        this.realName = realName;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+}

+ 53 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/ImLiveRoomBlackService.java

@@ -0,0 +1,53 @@
+package com.ym.mec.biz.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.entity.ImLiveRoomBlack;
+import com.ym.mec.biz.dal.vo.ImLiveRoomBlackVo;
+import com.ym.mec.common.page.PageInfo;
+
+import java.util.Map;
+
+/**
+ * 直播房间黑名单表(ImLiveRoomBlack)表服务接口
+ *
+ * @author hgw
+ * @since 2022-05-30 14:58:32
+ */
+public interface ImLiveRoomBlackService extends IService<ImLiveRoomBlack> {
+
+    /**
+     * 查询当前机构学生 -下拉框
+     *
+     * @param param 参数
+     *              <p> search - 搜索关键字
+     *              <p> roomUid - 房间uid
+     */
+    PageInfo<SysUser> queryStudentList(Map<String, Object> param);
+
+    /**
+     * 添加用户到房间黑名单中
+     *
+     * @param param 参数
+     *              <P> roomUid 直播房间uid
+     *              <P> userIdList  用户id
+     */
+    void add(Map<String, Object> param);
+
+    /**
+     * 删除该用户从房间黑名单中移除
+     *
+     * @param param 参数
+     *              <P> roomUid 直播房间uid
+     *              <P> userIdList  用户id
+     */
+    void delete(Map<String, Object> param);
+
+    /**
+     * 查询房间的黑名单学生
+     * <P> roomUid 直播房间uid
+     * <P> search  搜索关键字
+     */
+    PageInfo<ImLiveRoomBlackVo> queryBlackList(Map<String, Object> param);
+}
+

+ 14 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImLiveBroadcastRoomServiceImpl.java

@@ -18,6 +18,7 @@ import com.ym.mec.biz.dal.dto.ImLiveBroadcastRoomDto;
 import com.ym.mec.biz.dal.entity.ImLiveBroadcastRoom;
 import com.ym.mec.biz.dal.entity.ImLiveBroadcastRoomData;
 import com.ym.mec.biz.dal.entity.ImLiveBroadcastRoomMember;
+import com.ym.mec.biz.dal.entity.ImLiveRoomBlack;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.page.LiveRoomGoodsOrderQueryInfo;
 import com.ym.mec.biz.dal.vo.BaseRoomUserVo;
@@ -87,6 +88,8 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
     private LiveGoodsMapperDao liveGoodsMapperDao;
     @Autowired
     private ImLiveRoomReservationService imLiveRoomReservationService;
+    @Autowired
+    private ImLiveRoomBlackService imLiveRoomBlackService;
 
     //待替换的变量
     public static final String USER_ID = "${userId}";
@@ -152,6 +155,14 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
             }
             throw new BizException("直播已结束!");
         }
+        room.setBlacklistFlag(0);
+        //黑名单查询-查询当前用户是否在黑名单中
+        int count = imLiveRoomBlackService.count(Wrappers.<ImLiveRoomBlack>lambdaQuery()
+                .eq(ImLiveRoomBlack::getRoomUid, roomUid)
+                .eq(ImLiveRoomBlack::getUserId, sysUser.getId()));
+        if (count > 0) {
+            room.setBlacklistFlag(1);
+        }
         return room;
     }
 
@@ -163,7 +174,9 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
     @Override
     public ImLiveBroadcastRoomVo queryRoomInfo(String roomUid) {
         ImLiveBroadcastRoomVo roomVo = getImLiveBroadcastRoomVo(roomUid);
-        if (roomVo == null) return null;
+        if (roomVo == null) {
+            return null;
+        }
         getRoomData(roomVo);
         return roomVo;
     }

+ 171 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImLiveRoomBlackServiceImpl.java

@@ -0,0 +1,171 @@
+package com.ym.mec.biz.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.ImLiveRoomBlackDao;
+import com.ym.mec.biz.dal.entity.ImLiveRoomBlack;
+import com.ym.mec.biz.dal.vo.ImLiveRoomBlackVo;
+import com.ym.mec.biz.service.ImLiveRoomBlackService;
+import com.ym.mec.common.entity.ImRoomMessage;
+import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.page.PageUtil;
+import com.ym.mec.common.page.WrapperUtil;
+import com.ym.mec.common.tenant.TenantContextHolder;
+import com.ym.mec.im.ImFeignService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+
+/**
+ * 直播房间黑名单表(ImLiveRoomBlack)表服务实现类
+ *
+ * @author hgw
+ * @since 2022-05-30 14:58:32
+ */
+@Service("imLiveRoomBlackService")
+public class ImLiveRoomBlackServiceImpl extends ServiceImpl<ImLiveRoomBlackDao, ImLiveRoomBlack> implements ImLiveRoomBlackService {
+
+    private final static Logger log = LoggerFactory.getLogger(ImLiveRoomBlackServiceImpl.class);
+
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private ImFeignService imFeignService;
+
+    /**
+     * 查询当前机构学生 -下拉框
+     *
+     * @param param 参数
+     *              <p> search - 搜索关键字
+     *              <p> roomUid - 房间uid
+     */
+    @Override
+    public PageInfo<SysUser> queryStudentList(Map<String, Object> param) {
+        WrapperUtil.toStr(param, "search", "搜索关键字不能为空");
+        Page<SysUser> pageInfo = PageUtil.getPageInfo(param);
+        pageInfo.setDesc("a.id_");
+        Integer tenantId = TenantContextHolder.getTenantId();
+        //管理员机构id 是-1
+        if (Objects.nonNull(tenantId) && tenantId == -1) {
+            param.put("tenantId", tenantId);
+        }
+        return PageUtil.pageInfo(baseMapper.queryStudent(pageInfo, param));
+    }
+
+    /**
+     * 添加用户到房间黑名单中
+     *
+     * @param param 参数
+     *              <P> roomUid 直播房间uid
+     *              <P> userIdList  用户id
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void add(Map<String, Object> param) {
+        String roomUid = WrapperUtil.toStr(param, "roomUid");
+        List<String> userIdList = WrapperUtil.toList(WrapperUtil.toStr(param, "userIdList", "用户id不能为空"));
+        userIdList.forEach(userIdStr -> {
+            Integer userId = Integer.parseInt(userIdStr);
+            int count = this.count(Wrappers.<ImLiveRoomBlack>lambdaQuery()
+                    .eq(ImLiveRoomBlack::getRoomUid, roomUid)
+                    .eq(ImLiveRoomBlack::getUserId, userId));
+            if (count > 0) {
+                throw new BizException("该用户已在黑名单中");
+            }
+            ImLiveRoomBlack imLiveRoomBlack = new ImLiveRoomBlack();
+            imLiveRoomBlack.setRoomUid(roomUid);
+            imLiveRoomBlack.setUserId(userId);
+            imLiveRoomBlack.setType(0);
+            imLiveRoomBlack.setCreateBy(getSysUser().getId());
+            imLiveRoomBlack.setCreateTime(new Date());
+            this.save(imLiveRoomBlack);
+            //发送消息到直播房间
+            this.sendBlackMsg(roomUid, userId, userId, ImRoomMessage.BLOCK_BLACK_USER);
+        });
+    }
+
+    /**
+     * 删除该用户从房间黑名单中移除
+     *
+     * @param param 参数
+     *              <P> roomUid 直播房间uid
+     *              <P> userIdList  用户id
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void delete(Map<String, Object> param) {
+        String roomUid = WrapperUtil.toStr(param, "roomUid");
+        List<String> userIdList = WrapperUtil.toList(WrapperUtil.toStr(param, "userIdList", "用户id不能为空"));
+        userIdList.forEach(userIdStr -> {
+            Integer userId = Integer.parseInt(userIdStr);
+            this.remove(Wrappers.<ImLiveRoomBlack>lambdaQuery()
+                    .eq(ImLiveRoomBlack::getRoomUid, roomUid)
+                    .eq(ImLiveRoomBlack::getUserId, userId));
+            //发送消息到直播房间
+            this.sendBlackMsg(roomUid, userId, userId, ImRoomMessage.UNBLOCK_BLACK_USER);
+        });
+    }
+
+    /**
+     * 查询房间的黑名单学生
+     * <P> roomUid 直播房间uid
+     * <P> search  搜索关键字
+     */
+    @Override
+    public PageInfo<ImLiveRoomBlackVo> queryBlackList(Map<String, Object> param) {
+        WrapperUtil.toStr(param, "roomUid", "房间编号不能为空");
+        Page<ImLiveRoomBlackVo> pageInfo = PageUtil.getPageInfo(param);
+        pageInfo.setDesc("a.create_time_");
+        IPage<ImLiveRoomBlackVo> imLiveRoomBlackVoIPage = baseMapper.queryBlackList(pageInfo, param);
+        return PageUtil.pageInfo(imLiveRoomBlackVoIPage);
+    }
+
+    /**
+     * 发送黑名单消息到直播房间
+     *
+     * @param roomUid    房间uid
+     * @param fromUserId 发送人id
+     * @param userId     用户id
+     */
+    private void sendBlackMsg(String roomUid, Integer fromUserId, Integer userId, String type) {
+        //校验传入参数,房间uid和发送人id不能为空
+        if (!WrapperUtil.checkObj(roomUid, fromUserId, userId, type)) {
+            log.info(" sendBlackMsg>>>> param is null   roomUid: {}  fromUserId:{}  type:{}", roomUid, fromUserId, type);
+            return;
+        }
+        ImRoomMessage message = new ImRoomMessage();
+        message.setIsIncludeSender(1);
+        message.setObjectName(type);
+        message.setToChatroomId(roomUid);
+        HashMap<String, Integer> sendMap = new HashMap<>();
+        sendMap.put("userId", userId);
+        message.setFromUserId(fromUserId.toString());
+        message.setContent(sendMap);
+        //发送消息
+        try {
+            imFeignService.publishRoomMsg(message);
+            log.info("sendBlackMsg>>>> message: {}", JSONObject.toJSONString(message));
+        } catch (Exception e) {
+            log.error("sendBlackMsg>>>> error {}", e.getMessage());
+            log.error("sendBlackMsg>>>> sendMessage {} :", JSONObject.toJSONString(message));
+        }
+    }
+
+    private SysUser getSysUser() {
+        //修改机构基础信息
+        return Optional.ofNullable(sysUserFeignService.queryUserInfo())
+                .orElseThrow(() -> new BizException("用户不存在"));
+    }
+
+}
+

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysCouponServiceImpl.java

@@ -72,6 +72,7 @@ public class SysCouponServiceImpl extends BaseServiceImpl<Integer, SysCoupon> im
             if (oldCoupon.getStockCount() - oldCoupon.getConsumeNum() > oldCoupon.getWarningStockNum()) {
                 oldCoupon.setWarningStatus(0);
             }
+            oldCoupon.setUseCondition(sysCoupon.getUseCondition());
             sysCouponDao.update(oldCoupon);
         } else {
             switch (sysCoupon.getType()) {

+ 67 - 0
mec-biz/src/main/resources/config/mybatis/ImLiveRoomBlackMapper.xml

@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ym.mec.biz.dal.dao.ImLiveRoomBlackDao">
+    <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.ImLiveRoomBlack">
+        <id column="id_" jdbcType="INTEGER" property="id"/>
+        <result column="room_uid_" jdbcType="VARCHAR" property="roomUid"/>
+        <result column="user_id_" jdbcType="INTEGER" property="userId"/>
+        <result column="type_" jdbcType="INTEGER" property="type"/>
+        <result column="create_by_" jdbcType="INTEGER" property="createBy"/>
+        <result column="create_time_" jdbcType="TIMESTAMP" property="createTime"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id_
+        , room_uid_, user_id_, type_, create_by_, create_time_
+    </sql>
+
+    <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
+            parameterType="com.ym.mec.biz.dal.entity.ImLiveRoomBlack">
+        insert into im_live_room_black(room_uid_, user_id_, type_, create_by_, create_time_)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.roomUid}, #{entity.userId}, #{entity.type}, #{entity.createBy}, #{entity.createTime})
+        </foreach>
+    </insert>
+
+    <select id="queryStudent" parameterType="object" resultType="com.ym.mec.auth.api.entity.SysUser">
+        select a.id_        as id,
+             a.username_  as username,
+             a.real_name_ as realName,
+             a.phone_     as phone
+        from sys_user as a
+        left join im_live_room_black as b on a.id_ != b.user_id_
+        where a.user_type_ like '%STUDENT%'
+        and a.lock_flag_ = 0
+        and a.del_flag_ = 0
+        and b.room_uid_ = #{roomUid}
+        <if test="tenantId != null ">
+            and tenant_id_ = #{tenantId}
+        </if>
+            and (
+                 `id_` LIKE CONCAT('%', #{search},'%')
+                  OR `username_` LIKE CONCAT('%', #{search},'%')
+                 OR `phone_` LIKE CONCAT('%', #{search},'%')
+               )
+    </select>
+
+    <select id="queryBlackList"  parameterType="map" resultType="com.ym.mec.biz.dal.vo.ImLiveRoomBlackVo">
+        select a.user_id_,
+               b.username_,
+               b.real_name_,
+               b.phone_,
+               a.create_time_
+        from im_live_room_black as a
+                 left join sys_user as b  on a.user_id_ = b.id_
+        where a.type_ = 0
+          and a.room_uid_ = #{param.roomUid}
+        <if test="param.search != null ">
+            and (
+            a.`user_id_` LIKE CONCAT('%', #{param.search},'%')
+            OR b.`username_` LIKE CONCAT('%', #{param.search},'%')
+            OR b.`phone_` LIKE CONCAT('%', #{param.search},'%')
+            )
+        </if>
+    </select>
+
+</mapper>

+ 24 - 18
mec-biz/src/main/resources/config/mybatis/TempLittleArtistTrainingCampMapper.xml

@@ -106,24 +106,30 @@
         e.name_ as imGroupName,
         ifnull(b.playDay, 0) as playDay,
         ifnull(c.playTime, 0) as playTime
-        FROM temp_little_artist_training_camp_user_relation as a
-        left join (select a.user_id_, count(playDay) as playDay
-        from (SELECT cr.`user_id_`,
-        date(cr.`create_time_`) as playDay
-        FROM `sys_music_compare_record` cr
-        WHERE date(cr.`create_time_`) &gt;= #{param.startTime}
-        AND date(cr.`create_time_`) &lt;= #{param.endTime}
-        GROUP BY cr.`user_id_`, date(cr.`create_time_`)
-        HAVING sum(cr.`play_time_`) > 1200) as a
-        group by a.user_id_) as b on a.user_id_ = b.user_id_
-        left join (SELECT cr.`user_id_`,
-        sum(cr.`play_time_`) as playTime
-        FROM `sys_music_compare_record` cr
-        WHERE date(cr.`create_time_`) &gt;= #{param.startTime}
-        AND date(cr.`create_time_`) &lt;= #{param.endTime}
-        GROUP BY cr.`user_id_`) as c on a.user_id_ = c.user_id_
-        left join sys_user as d on d.id_ = a.user_id_
-        left join im_group as e on a.im_group_id_ = e.id_
+        FROM `temp_little_artist_training_camp_user_relation` `a`
+        LEFT JOIN (
+        SELECT `a`.`user_id_`, COUNT(`playDay`) AS `playDay`
+        FROM (
+        SELECT `cr`.`user_id_`, DATE(`cr`.`create_time_`) AS `playDay`
+        FROM `sys_music_compare_record` `cr`
+        WHERE `cr`.`create_time_` &gt;= DATE_ADD(DATE(#{param.startTime}), INTERVAL IF(#{param.startTime} = DATE(#{param.startTime}), 0, 1) DAY)
+        AND `cr`.`create_time_` &lt; DATE_ADD(DATE(#{param.endTime}), INTERVAL 1 DAY)
+        GROUP BY `cr`.`user_id_`, DATE(`cr`.`create_time_`)
+        HAVING SUM(`cr`.`play_time_`) > 1200
+        ) `a`
+        GROUP BY `a`.`user_id_`
+        ) `b`
+        ON `a`.`user_id_` = `b`.`user_id_`
+        LEFT JOIN (
+        SELECT `cr`.`user_id_`, SUM(`cr`.`play_time_`) AS `playTime`
+        FROM `sys_music_compare_record` `cr`
+        WHERE `cr`.`create_time_` &gt;= DATE_ADD(DATE(#{param.startTime}), INTERVAL IF(#{param.startTime} = DATE(#{param.startTime}), 0, 1) DAY)
+        AND `cr`.`create_time_` &lt; DATE_ADD(DATE(#{param.endTime}), INTERVAL 1 DAY)
+        GROUP BY `cr`.`user_id_`
+        ) `c`
+        ON `a`.`user_id_` = `c`.`user_id_`
+        LEFT JOIN `sys_user` `d` ON `d`.`id_` = `a`.`user_id_`
+        LEFT JOIN `im_group` `e` ON `a`.`im_group_id_` = `e`.`id_`
         <where>
             a.activity_id_ = #{param.campId} and a.state_ = #{param.state}
             <if test="param.imGroupId != null">

+ 83 - 0
mec-web/src/main/java/com/ym/mec/web/controller/ImLiveRoomBlackController.java

@@ -0,0 +1,83 @@
+package com.ym.mec.web.controller;
+
+
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.vo.ImLiveRoomBlackVo;
+import com.ym.mec.biz.service.ImLiveRoomBlackService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.page.PageInfo;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.Map;
+
+/**
+ * 直播房间黑名单表(ImLiveRoomBlack)表控制层
+ *
+ * @author hgw
+ * @since 2022-05-30 14:58:31
+ */
+@RestController
+@RequestMapping("/imLiveRoomBlack")
+public class ImLiveRoomBlackController extends BaseController {
+    /**
+     * 服务对象
+     */
+    @Resource
+    private ImLiveRoomBlackService imLiveRoomBlackService;
+
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "roomUid", dataType = "String", value = "直播房间uid"),
+            @ApiImplicitParam(name = "search", dataType = "String", value = "搜索关键字-用户id,用户名,手机号", required = true),
+            @ApiImplicitParam(name = "page", dataType = "Integer", value = "页数"),
+            @ApiImplicitParam(name = "rows", dataType = "Integer", value = "每页数量"),
+    })
+    @ApiOperation("查询当前机构学生 -下拉框")
+    @PostMapping("/queryStudentList")
+    public HttpResponseResult<PageInfo<SysUser>> queryStudentList(@RequestBody Map<String, Object> param) {
+        return succeed(imLiveRoomBlackService.queryStudentList(param));
+    }
+
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "roomUid", dataType = "String", value = "直播房间uid"),
+            @ApiImplicitParam(name = "userIdList", dataType = "String", value = "用户id多个用逗号隔开"),
+    })
+    @ApiOperation("添加用户到房间黑名单中")
+    @PostMapping("/add")
+    public HttpResponseResult<Object> add(@RequestBody Map<String, Object> param) {
+        imLiveRoomBlackService.add(param);
+        return succeed();
+    }
+
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "roomUid", dataType = "String", value = "直播房间uid"),
+            @ApiImplicitParam(name = "userIdList", dataType = "String", value = "用户id多个用逗号隔开"),
+    })
+    @ApiOperation("删除该用户从房间黑名单中移除")
+    @PostMapping("/delete")
+    public HttpResponseResult<Object> delete(@RequestBody Map<String, Object> param) {
+        imLiveRoomBlackService.delete(param);
+        return succeed();
+    }
+
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "roomUid", dataType = "String", value = "直播房间uid"),
+            @ApiImplicitParam(name = "search", dataType = "String", value = "搜索关键字-用户id,用户名,手机号"),
+            @ApiImplicitParam(name = "page", dataType = "Integer", value = "页数"),
+            @ApiImplicitParam(name = "rows", dataType = "Integer", value = "每页数量"),
+    })
+    @ApiOperation("分页查询直播间列表")
+    @PostMapping("/queryBlackList")
+    public HttpResponseResult<PageInfo<ImLiveRoomBlackVo>> queryBlackList(@RequestBody Map<String, Object> param) {
+        return succeed(imLiveRoomBlackService.queryBlackList(param));
+    }
+
+}
+