浏览代码

增加 直播间首页推广 根据创建直播间条件可见功能

hgw 3 年之前
父节点
当前提交
3402d710e6

+ 3 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ImLiveBroadcastRoomDao.java

@@ -38,6 +38,8 @@ public interface ImLiveBroadcastRoomDao extends BaseMapper<ImLiveBroadcastRoom>
      * @return
      */
     IPage<RoomReservationUserVo> queryRoomUser(@Param("page") IPage<RoomReservationUserVo> page,
-                                                  @Param("query") RoomReservationUserSearch query);
+                                               @Param("query") RoomReservationUserSearch query);
+
+    String querySchoolIds(@Param("organIds") String organIds);
 }
 

+ 21 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ImLiveBroadcastRoomDto.java

@@ -1,6 +1,5 @@
 package com.ym.mec.biz.dal.dto;
 
-
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -49,6 +48,12 @@ public class ImLiveBroadcastRoomDto implements Serializable {
     @ApiModelProperty(value = "房间配置")
     private RoomConfig roomConfig;
 
+    @ApiModelProperty(value = "推广的直播间可见类型-全部可见、部分分部可见、部分合作单位可见")
+    private String popularizeType;
+
+    @ApiModelProperty(value = "根据推广类型填入的id-全部可见则没有值,分部则是分部id,合作单位则是合作单位id,多个id逗号分割")
+    private String popularizeTypeIds;
+
     @ApiModel(value = "房间配置")
     public static class RoomConfig implements Serializable {
 
@@ -172,5 +177,20 @@ public class ImLiveBroadcastRoomDto implements Serializable {
         this.roomConfig = roomConfig;
     }
 
+    public String getPopularizeType() {
+        return popularizeType;
+    }
+
+    public void setPopularizeType(String popularizeType) {
+        this.popularizeType = popularizeType;
+    }
+
+    public String getPopularizeTypeIds() {
+        return popularizeTypeIds;
+    }
+
+    public void setPopularizeTypeIds(String popularizeTypeIds) {
+        this.popularizeTypeIds = popularizeTypeIds;
+    }
 }
 

+ 35 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ImLiveBroadcastRoom.java

@@ -71,6 +71,18 @@ public class ImLiveBroadcastRoom implements Serializable {
     @ApiModelProperty(value = "是否在首页推广 0否 1是 - 每个机构只能有一个直播间在首页推广")
     private Integer popularize;
 
+    @TableField("popularize_type_")
+    @ApiModelProperty(value = "推广的直播间可见类型-全部可见ALL、部分分部可见ORGAN、部分合作单位可见SCHOOL")
+    private String popularizeType;
+
+    @TableField("popularize_org_ids_")
+    @ApiModelProperty(value = "分部id-多个id逗号分割")
+    private String popularizeOrgIds;
+
+    @ApiModelProperty(value = "学校id-合作单位id,多个id逗号分割")
+    @TableField("popularize_school_ids_")
+    private String popularizeSchoolIds;
+
     @TableField("created_by_")
     @ApiModelProperty(value = "创建人")
     private Integer createdBy;
@@ -243,5 +255,28 @@ public class ImLiveBroadcastRoom implements Serializable {
         this.updatedTime = updatedTime;
     }
 
+    public String getPopularizeType() {
+        return popularizeType;
+    }
+
+    public void setPopularizeType(String popularizeType) {
+        this.popularizeType = popularizeType;
+    }
+
+    public String getPopularizeOrgIds() {
+        return popularizeOrgIds;
+    }
+
+    public void setPopularizeOrgIds(String popularizeOrgIds) {
+        this.popularizeOrgIds = popularizeOrgIds;
+    }
+
+    public String getPopularizeSchoolIds() {
+        return popularizeSchoolIds;
+    }
+
+    public void setPopularizeSchoolIds(String popularizeSchoolIds) {
+        this.popularizeSchoolIds = popularizeSchoolIds;
+    }
 }
 

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

@@ -49,5 +49,14 @@ public interface ImLiveRoomBlackService extends IService<ImLiveRoomBlack> {
      * <P> search  搜索关键字
      */
     PageInfo<ImLiveRoomBlackVo> queryBlackList(Map<String, Object> param);
+
+    /**
+     * 发送黑名单消息到直播房间
+     *
+     * @param roomUid    房间uid
+     * @param fromUserId 发送人id
+     * @param userId     用户id
+     */
+    void sendBlackMsg(String roomUid, Integer fromUserId, Integer userId, String type);
 }
 

+ 4 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/ImLiveRoomReservationService.java

@@ -5,7 +5,6 @@ import com.ym.mec.biz.dal.entity.ImLiveBroadcastRoom;
 import com.ym.mec.biz.dal.entity.ImLiveRoomReservation;
 import com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomVo;
 import com.ym.mec.common.page.PageInfo;
-import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
 import java.util.Map;
@@ -29,9 +28,10 @@ public interface ImLiveRoomReservationService extends IService<ImLiveRoomReserva
     void cancel(ImLiveRoomReservation entity);
 
     /**
-     * 分页查询直播间
-     * @param param
-     * <p> liveState 直播状态 0未开始 1开始 2结束
+     * 学生端-分页查询直播间
+     *
+     * @param param 参数
+     *              <p> liveState 直播状态 0未开始 1开始 2结束
      */
     PageInfo<ImLiveBroadcastRoomVo> queryPageStudent(Map<String, Object> param);
 

+ 22 - 25
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImLiveBroadcastRoomServiceImpl.java

@@ -16,10 +16,7 @@ import com.ym.mec.biz.dal.dao.LiveGoodsMapperDao;
 import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dto.ImLiveBroadcastRoomDto;
 import com.ym.mec.biz.dal.dto.RoomReservationUserSearch;
-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.entity.*;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.vo.BaseRoomUserVo;
 import com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomVo;
@@ -89,6 +86,8 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
     private ImLiveRoomReservationService imLiveRoomReservationService;
     @Autowired
     private ImLiveRoomBlackService imLiveRoomBlackService;
+    @Autowired
+    private EmployeeService employeeService;
 
     //待替换的变量
     public static final String USER_ID = "${userId}";
@@ -183,6 +182,7 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
     private ImLiveBroadcastRoomVo getImLiveBroadcastRoomVo(String roomUid) {
         List<ImLiveBroadcastRoomVo> list = baseMapper.queryPage(new HashMap<String, Object>() {{
             put("roomUid", roomUid);
+            put("allRoom", 1);
         }});
         if (CollectionUtils.isEmpty(list)) {
             return null;
@@ -191,17 +191,23 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
     }
 
     /**
-     * 分页查询直播间列表
+     * 后台-分页查询直播间列表
      */
     @Override
     public PageInfo<ImLiveBroadcastRoomVo> queryPage(Map<String, Object> param) {
-        Page<ImLiveBroadcastRoomVo> pageInfo = PageUtil.getPageInfo(param);
+        Page<ImLiveBroadcastRoomVo> pageInfo = PageUtil.concatTimePage(param, "startTime", "endTime");
         pageInfo.setDesc("a.created_time_");
         param.put("tenantId", TenantContextHolder.getTenantId());
-        BiConsumer<String, String> addTimeCons = (key, time) -> Optional.ofNullable(param.get(key)).map(String::valueOf)
-                .ifPresent(date -> param.put(key, date + " " + time));
-        addTimeCons.accept("startTime", "00:00:00");
-        addTimeCons.accept("endTime", "23:59:59");
+        //查询该人员分部  及 分部下包含的学校(合作单位)
+        Integer userId = getSysUser().getId();
+        Employee employee = employeeService.get(userId);
+        if (Objects.nonNull(employee) && Objects.nonNull(employee.getOrganIdList())) {
+            param.put("organIds", employee.getOrganIdList());
+            String schoolIds = baseMapper.querySchoolIds(employee.getOrganIdList());
+            if (StringUtils.isNotBlank(schoolIds)) {
+                param.put("schoolIds", schoolIds);
+            }
+        }
         IPage<ImLiveBroadcastRoomVo> page = baseMapper.queryPage(pageInfo, param);
 
         // 查询预约人数
@@ -214,7 +220,7 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
 
         List<ImLiveBroadcastRoomVo> countRoomReservationList = imLiveRoomReservationService.countRoomReservation(roomIdList);
         Map<String, List<ImLiveBroadcastRoomVo>> collect = countRoomReservationList.stream()
-                                               .collect(Collectors.groupingBy(ImLiveBroadcastRoomVo::getRoomUid));
+                .collect(Collectors.groupingBy(ImLiveBroadcastRoomVo::getRoomUid));
         for (ImLiveBroadcastRoomVo record : records) {
             List<ImLiveBroadcastRoomVo> imLiveBroadcastRoomVos = collect.get(record.getRoomUid());
             if (CollectionUtils.isEmpty(imLiveBroadcastRoomVos)) {
@@ -352,21 +358,12 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
      */
     @Override
     public ImLiveBroadcastRoomVo queryPopularizeRoom() {
-        //查询该学生信息-获取分部
-        SysUser user = getSysUser();
-        //查询哪些分部无法推广直播间
-        String popularizeOrgan = sysConfigDao.findConfigValue("live_popularize_organ");
-        if (StringUtils.isNotBlank(popularizeOrgan)) {
-            List<String> organList = WrapperUtil.toList(popularizeOrgan);
-            if (Objects.nonNull(user.getOrganId()) && !organList.contains(user.getOrganId().toString())) {
-                return null;
-            }
-        }
         Map<String, Object> param = new HashMap<>();
         param.put("tenantId", TenantContextHolder.getTenantId());
         param.put("popularize", 1);
         param.put("liveState", 1);
-        List<ImLiveBroadcastRoomVo> list = baseMapper.queryPage(param);
+        PageInfo<ImLiveBroadcastRoomVo> pageInfo = imLiveRoomReservationService.queryPageStudent(param);
+        List<ImLiveBroadcastRoomVo> list = pageInfo.getRows();
         if (CollectionUtils.isNotEmpty(list)) {
             return list.get(0);
         }
@@ -1058,13 +1055,13 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
     private SysUser getSysUser(Integer userId) {
         return Optional.ofNullable(userId)
                 .map(sysUserFeignService::queryUserById)
-                .orElseThrow(() -> new BizException("用户不存在"));
+                .orElseThrow(() -> new BizException("用户不存在."));
     }
 
     private SysUser getSysUser() {
         //修改机构基础信息
         return Optional.ofNullable(sysUserFeignService.queryUserInfo())
-                .orElseThrow(() -> new BizException("用户不存在"));
+                .orElseThrow(() -> new BizException("用户不存在."));
     }
 
     /**
@@ -1174,7 +1171,7 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
     public PageInfo<RoomReservationUserVo> queryRoomUser(RoomReservationUserSearch query) {
 
 
-        IPage<RoomReservationUserVo> page = new Page<>(query.getPage(),query.getRows());
+        IPage<RoomReservationUserVo> page = new Page<>(query.getPage(), query.getRows());
         page = baseMapper.queryRoomUser(page, query);
         return PageUtil.pageInfo(page);
     }

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

@@ -136,7 +136,7 @@ public class ImLiveRoomBlackServiceImpl extends ServiceImpl<ImLiveRoomBlackDao,
      * @param fromUserId 发送人id
      * @param userId     用户id
      */
-    private void sendBlackMsg(String roomUid, Integer fromUserId, Integer userId, String type) {
+    public 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);

+ 17 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImLiveRoomReservationServiceImpl.java

@@ -11,9 +11,11 @@ import com.ym.mec.biz.dal.dao.ImLiveRoomReservationDao;
 import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.entity.ImLiveBroadcastRoom;
 import com.ym.mec.biz.dal.entity.ImLiveRoomReservation;
+import com.ym.mec.biz.dal.entity.Student;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomVo;
 import com.ym.mec.biz.service.ImLiveRoomReservationService;
+import com.ym.mec.biz.service.StudentService;
 import com.ym.mec.biz.service.SysConfigService;
 import com.ym.mec.biz.service.SysMessageService;
 import com.ym.mec.common.exception.BizException;
@@ -47,7 +49,7 @@ public class ImLiveRoomReservationServiceImpl extends ServiceImpl<ImLiveRoomRese
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private SysConfigDao sysConfigDao;
+    private StudentService studentService;
     @Autowired
     private SysMessageService sysMessageService;
 
@@ -84,14 +86,21 @@ public class ImLiveRoomReservationServiceImpl extends ServiceImpl<ImLiveRoomRese
      */
     @Override
     public PageInfo<ImLiveBroadcastRoomVo> queryPageStudent(Map<String, Object> param) {
-        param.put("userId", getUser().getId());
-        Page<ImLiveBroadcastRoomVo> pageInfo = PageUtil.getPageInfo(param);
+        SysUser user = getUser();
+        Page<ImLiveBroadcastRoomVo> pageInfo = PageUtil.concatTimePage(param,"startTime","endTime");
         pageInfo.setDesc("a.created_time_");
+        param.put("userId", user.getId());
         param.put("tenantId", TenantContextHolder.getTenantId());
-        BiConsumer<String, String> addTimeCons = (key, time) -> Optional.ofNullable(param.get(key)).map(String::valueOf)
-                .ifPresent(date -> param.put(key, date + " " + time));
-        addTimeCons.accept("startTime", "00:00:00");
-        addTimeCons.accept("endTime", "23:59:59");
+        //查询该学员 所属分部
+        Integer organId = user.getOrganId();
+        if(Objects.nonNull(organId)){
+            param.put("organId", organId);
+        }
+        //合作单位
+        Student student = studentService.get(user.getId());
+        if(Objects.nonNull(student) && Objects.nonNull(student.getCooperationOrganId())){
+            param.put("schoolId",student.getCooperationOrganId());
+        }
         IPage<ImLiveBroadcastRoomVo> page = baseMapper.queryPageStudent(pageInfo, param);
         return PageUtil.pageInfo(page);
     }
@@ -132,9 +141,7 @@ public class ImLiveRoomReservationServiceImpl extends ServiceImpl<ImLiveRoomRese
 
     @Override
     public List<ImLiveBroadcastRoomVo> countRoomReservation(List<String> roomIdList) {
-
-        return  baseMapper.selectCountRoomReservation(roomIdList);
-
+        return baseMapper.selectCountRoomReservation(roomIdList);
     }
 
     private SysUser getUser() {

+ 59 - 28
mec-biz/src/main/resources/config/mybatis/ImLiveBroadcastRoomMapper.xml

@@ -15,28 +15,28 @@
         <result column="live_state_" jdbcType="INTEGER" property="liveState"/>
         <result column="room_state_" jdbcType="INTEGER" property="roomState"/>
         <result column="popularize_" jdbcType="INTEGER" property="popularize"/>
+        <result column="popularize_type_" jdbcType="VARCHAR" property="popularizeType"/>
+        <result column="popularize_org_ids_" jdbcType="VARCHAR" property="popularizeOrgIds"/>
+        <result column="popularize_school_ids_" jdbcType="VARCHAR" property="popularizeSchoolIds"/>
         <result column="created_by_" jdbcType="INTEGER" property="createdBy"/>
         <result column="created_time_" jdbcType="TIMESTAMP" property="createdTime"/>
         <result column="updated_by_" jdbcType="INTEGER" property="updatedBy"/>
         <result column="updated_time_" jdbcType="TIMESTAMP" property="updatedTime"/>
     </resultMap>
 
-    <sql id="Base_Column_List">
-        id_
-        , tenant_id_, speaker_id_, room_uid_, room_title_, live_start_time_, live_end_time_, live_remark_, pre_template_, room_config_, live_state_, room_state_, popularize_, created_by_, created_time_, updated_by_, updated_time_
-    </sql>
-
     <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
             parameterType="com.ym.mec.biz.dal.entity.ImLiveBroadcastRoom">
         insert into im_live_broadcast_room(tenant_id_, speaker_id_, room_uid_, room_title_, live_start_time_,
-        live_end_time_, live_remark_, pre_template_, room_config_, live_state_, room_state_, popularize_, created_by_, created_time_,
-        updated_by_, updated_time_)
+        live_end_time_, live_remark_, pre_template_, room_config_, live_state_, room_state_,
+        popularize_, popularize_type_,popularize_org_ids_,popularize_school_ids_,
+        created_by_, created_time_, updated_by_, updated_time_)
         values
         <foreach collection="entities" item="entity" separator=",">
             (#{entity.tenantId}, #{entity.speakerId}, #{entity.roomUid}, #{entity.roomTitle}, #{entity.liveStartTime},
             #{entity.liveEndTime}, #{entity.liveRemark}, #{entity.preTemplate}, #{entity.roomConfig},
-            #{entity.liveState}, #{entity.roomState}, #{entity.popularize}, #{entity.createdBy}, #{entity.createdTime}, #{entity.updatedBy},
-            #{entity.updatedTime})
+            #{entity.liveState}, #{entity.roomState}, #{entity.popularize},
+            #{entity.popularizeType},#{entity.popularizeOrgIds},#{entity.popularizeSchoolIds},
+            #{entity.createdBy}, #{entity.createdTime}, #{entity.updatedBy},#{entity.updatedTime})
         </foreach>
     </insert>
 
@@ -58,8 +58,31 @@
         c.real_name_ AS createdByName,
         a.pre_template_ AS preTemplate,
         a.room_config_ AS roomConfig,
-        a.popularize_ AS popularize
-        from im_live_broadcast_room as a
+        a.popularize_ AS popularize,
+        a.popularize_type_ AS popularizeType,
+        a.popularize_org_ids_ AS popularizeOrgIds,
+        a.popularize_school_ids_ AS popularizeSchoolIds
+        from (
+        select *
+        from im_live_broadcast_room
+        <if test="param.allRoom == null">
+            where popularize_type_ = 'ALL'
+        </if>
+        <if test="param.organIds != null">
+            union all
+            select *
+            from im_live_broadcast_room as a
+            where popularize_type_ = 'ORGAN'
+            and INTE_ARRAY(a.popularize_org_ids_, #{param.organIds}) = 1
+        </if>
+        <if test="param.organIds != null">
+            union all
+            select *
+            from im_live_broadcast_room as a
+            where popularize_type_ = 'SCHOOL'
+            and INTE_ARRAY(a.popularize_school_ids_, #{param.schoolIds}) = 1
+        </if>
+        ) as a
         left join tenant_info AS t on a.tenant_id_ = t.id_
         left join sys_user AS b on a.speaker_id_ = b.id_
         left join sys_user AS c on a.created_by_ = c.id_
@@ -94,17 +117,22 @@
     </select>
 
     <select id="queryUserPageByTenantId" resultType="map">
-        SELECT id_,username_
+        SELECT id_, username_
         FROM sys_user
-        WHERE tenant_id_ = 1 and user_type_ = 'STUDENT' and lock_flag_=0 and del_flag_= 0 and is_super_admin_=0
-        and username_ is not null and username_ != ''
+        WHERE tenant_id_ = 1
+          and user_type_ = 'STUDENT'
+          and lock_flag_ = 0
+          and del_flag_ = 0
+          and is_super_admin_ = 0
+          and username_ is not null
+          and username_ != ''
     </select>
 
     <select id="queryBaseUserInfo" resultType="com.ym.mec.biz.dal.vo.BaseRoomUserVo">
-    select
+        select
         id_ AS userId,
         username_ AS userName
-    from sys_user
+        from sys_user
         <where>
             id_ IN
             <foreach collection="list" item="id" open="(" separator="," close=")">
@@ -116,23 +144,26 @@
     <select id="queryRoomUser" resultType="com.ym.mec.biz.dal.vo.RoomReservationUserVo">
 
         select
-            su.id_ as userId
-            ,su.username_ as username
-            ,su.phone_ as phone
-            ,su.organ_id_ as organId
-            ,o.name_ as organName
-            ,(select group_concat(sub.name_) from subject sub
-                where find_in_set(sub.id_,s.subject_id_list_) and sub.del_flag_ = 0 ) as subjectName
+        su.id_ as userId
+        ,su.username_ as username
+        ,su.phone_ as phone
+        ,su.organ_id_ as organId
+        ,o.name_ as organName
+        ,(select group_concat(sub.name_) from subject sub
+        where find_in_set(sub.id_,s.subject_id_list_) and sub.del_flag_ = 0 ) as subjectName
         from im_live_room_reservation ilrr
         left join sys_user su on su.id_ = ilrr.user_id_
         left join organization o on o.id_ = su.organ_id_
         left join student s on s.user_id_ = su.id_
         where ilrr.room_uid_ = #{query.roomUid}
-            <if test="query.search != null and query.search != ''">
-                and (su.id_ like concat('%',#{query.search},'%')
-                    or su.phone_ like concat('%',#{query.search},'%')
-                    or su.username_ like concat('%',#{query.search},'%'))
-            </if>
+        <if test="query.search != null and query.search != ''">
+            and (su.id_ like concat('%',#{query.search},'%')
+            or su.phone_ like concat('%',#{query.search},'%')
+            or su.username_ like concat('%',#{query.search},'%'))
+        </if>
+    </select>
 
+    <select id="querySchoolIds" resultType="string">
+        select GROUP_CONCAT(id_)  from cooperation_organ where  find_in_set(organ_id_,#{organIds})
     </select>
 </mapper>

+ 23 - 2
mec-biz/src/main/resources/config/mybatis/ImLiveRoomReservationMapper.xml

@@ -42,8 +42,24 @@
         a.pre_template_ AS preTemplate,
         a.room_config_ AS roomConfig,
         a.popularize_ AS popularize,
-        case when  d.user_id_ is null then 0 else 1 end as reserve
-        from im_live_broadcast_room as a
+        IF(d.user_id_ is null, 0, 1) as reserve
+        from (
+        select *
+        from im_live_broadcast_room
+        where popularize_type_ = 'ALL'
+        union all
+        select *
+        from im_live_broadcast_room
+        where popularize_type_ = 'ORGAN'
+        AND FIND_IN_SET(#{param.organId}, popularize_org_ids_)
+        <if test="param.schoolId != null">
+            union all
+            select *
+            from im_live_broadcast_room
+            where popularize_type_ = 'SCHOOL'
+            AND FIND_IN_SET(#{param.schoolId}, popularize_school_ids_)
+        </if>
+        ) as a
         left join tenant_info AS t on a.tenant_id_ = t.id_
         left join sys_user AS b on a.speaker_id_ = b.id_
         left join sys_user AS c on a.created_by_ = c.id_
@@ -62,6 +78,9 @@
             <if test="param.endTime != null">
                 <![CDATA[ AND a.live_start_time_  <= #{param.endTime} ]]>
             </if>
+            <if test="param.popularize != null">
+                and a.popularize_ = #{param.popularize}
+            </if>
         </where>
     </select>
 
@@ -81,4 +100,6 @@
         </where>
         group by lbr.room_uid_
     </select>
+
+
 </mapper>

+ 13 - 0
mec-common/common-core/src/main/java/com/ym/mec/common/page/PageUtil.java

@@ -7,6 +7,7 @@ import com.ym.mec.common.tenant.TenantContextHolder;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Optional;
+import java.util.function.BiConsumer;
 
 /**
  * @author hgw
@@ -47,6 +48,18 @@ public class PageUtil {
     }
 
     /**
+     * 分页有需要拼接时分秒要求的可以使用这个方法
+     */
+    public static <T> Page<T> concatTimePage(Map<String, Object> param, String startTime, String endTime) {
+        Page<T> pageInfo = PageUtil.getPageInfo(param);
+        BiConsumer<String, String> addTimeCons = (key, time) -> Optional.ofNullable(param.get(key)).map(String::valueOf)
+                .ifPresent(date -> param.put(key, date + " " + time));
+        addTimeCons.accept(startTime, "00:00:00");
+        addTimeCons.accept(endTime, "23:59:59");
+        return pageInfo;
+    }
+
+    /**
      * 获取Map中的关键字获取分页数据
      *
      * @param param Map<String, Object> param

+ 1 - 0
mec-im/src/main/java/com/ym/mec/im/IMHelper.java

@@ -434,6 +434,7 @@ public class IMHelper {
         log.info("publish msg: {}", msgStr);
         sb.append("&objectName=").append(URLEncoder.encode(message.getObjectName(), UTF8));
         sb.append("&content=").append(URLEncoder.encode(msgStr, UTF8));
+        sb.append("&isIncludeSender=1");
 
         String body = sb.toString();
         if (body.indexOf("&") == 0) {

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/controller/ImLiveBroadcastRoomController.java

@@ -48,7 +48,7 @@ public class ImLiveBroadcastRoomController extends BaseController {
             @ApiImplicitParam(name = "page", dataType = "Integer", value = "页数"),
             @ApiImplicitParam(name = "rows", dataType = "Integer", value = "每页数量"),
     })
-    @ApiOperation("分页查询直播间列表")
+    @ApiOperation("后台-分页查询直播间列表")
     @PostMapping("/queryPage")
     public HttpResponseResult<PageInfo<ImLiveBroadcastRoomVo>> queryPage(@RequestBody Map<String, Object> param) {
         return succeed(imLiveBroadcastRoomService.queryPage(param));

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/controller/ImLiveRoomReservationController.java

@@ -59,7 +59,7 @@ public class ImLiveRoomReservationController extends BaseController {
             @ApiImplicitParam(name = "page", dataType = "Integer", value = "页数"),
             @ApiImplicitParam(name = "rows", dataType = "Integer", value = "每页数量"),
     })
-    @ApiOperation("分页查询直播间列表")
+    @ApiOperation("学生端-分页查询直播间")
     @PostMapping("/queryPageStudent")
     public HttpResponseResult<PageInfo<ImLiveBroadcastRoomVo>> queryPageStudent(@RequestBody Map<String, Object> param) {
         return succeed(imLiveRoomReservationService.queryPageStudent(param));