Browse Source

Merge branch 'saas_2022-06-01_zouxuan' of http://git.dayaedu.com/yonge/mec into saas_zouxuan_2022_05_31

 Conflicts:
	mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ImLiveBroadcastRoomDao.java
	mec-biz/src/main/java/com/ym/mec/biz/service/ImLiveBroadcastRoomService.java
	mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImLiveBroadcastRoomServiceImpl.java
	mec-web/src/main/java/com/ym/mec/web/controller/ImLiveBroadcastRoomController.java
zouxuan 3 years ago
parent
commit
e67f14a3e7
30 changed files with 587 additions and 110 deletions
  1. 14 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ImLiveBroadcastRoomDao.java
  2. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ImLiveRoomReservationDao.java
  3. 33 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ImLiveBroadcastRoomDto.java
  4. 41 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/RoomReservationUserSearch.java
  5. 35 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ImLiveBroadcastRoom.java
  6. 23 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TempBuyFreeLiveTheoryCourse.java
  7. 44 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/vo/ImLiveBroadcastRoomVo.java
  8. 80 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/vo/RoomReservationUserVo.java
  9. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/ImLiveBroadcastRoomService.java
  10. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/ImLiveRoomBlackService.java
  11. 13 4
      mec-biz/src/main/java/com/ym/mec/biz/service/ImLiveRoomReservationService.java
  12. 59 26
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImLiveBroadcastRoomServiceImpl.java
  13. 2 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImLiveRoomBlackServiceImpl.java
  14. 21 7
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImLiveRoomReservationServiceImpl.java
  15. 6 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/LiveGoodsMapperServiceImpl.java
  16. 17 14
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MemberRankSettingServiceImpl.java
  17. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PayServiceImpl.java
  18. 0 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java
  19. 4 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMessageServiceImpl.java
  20. 8 8
      mec-biz/src/main/resources/config/mybatis/FinancialExpenditureMapper.xml
  21. 69 16
      mec-biz/src/main/resources/config/mybatis/ImLiveBroadcastRoomMapper.xml
  22. 12 8
      mec-biz/src/main/resources/config/mybatis/ImLiveRoomBlackMapper.xml
  23. 41 2
      mec-biz/src/main/resources/config/mybatis/ImLiveRoomReservationMapper.xml
  24. 12 3
      mec-biz/src/main/resources/config/mybatis/TempBuyFreeLiveTheoryCourseMapper.xml
  25. 13 0
      mec-common/common-core/src/main/java/com/ym/mec/common/page/PageUtil.java
  26. 1 0
      mec-im/src/main/java/com/ym/mec/im/IMHelper.java
  27. 1 1
      mec-student/src/main/java/com/ym/mec/student/controller/DegreeController.java
  28. 1 1
      mec-student/src/main/java/com/ym/mec/student/controller/ImLiveRoomReservationController.java
  29. 10 1
      mec-web/src/main/java/com/ym/mec/web/controller/ImLiveBroadcastRoomController.java
  30. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/ImLiveRoomReservationController.java

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

@@ -3,10 +3,13 @@ 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.dto.RoomReservationUserSearch;
 import com.ym.mec.biz.dal.entity.ImLiveBroadcastRoom;
 import com.ym.mec.biz.dal.vo.BaseRoomUserVo;
 import com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomVo;
 import com.ym.mec.biz.dal.vo.LiveRoomGoodsOrderVo;
+import com.ym.mec.biz.dal.vo.RoomReservationUserVo;
+import com.ym.mec.common.page.PageInfo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -26,10 +29,20 @@ public interface ImLiveBroadcastRoomDao extends BaseMapper<ImLiveBroadcastRoom>
 
     int insertBatch(@Param("entities") List<ImLiveBroadcastRoom> entities);
 
-    IPage<Map<Integer,Object>> queryUserPageByTenantId(Page<Map<Integer,Object>> page);
+    IPage<Map<Integer, Object>> queryUserPageByTenantId(Page<Map<Integer, Object>> page);
 
     List<BaseRoomUserVo> queryBaseUserInfo(@Param("list") List<Integer> list);
 
+    /**
+     * 查询直播间预约用户信息
+     *
+     * @return
+     */
+    IPage<RoomReservationUserVo> queryRoomUser(@Param("page") IPage<RoomReservationUserVo> page,
+                                               @Param("query") RoomReservationUserSearch query);
+
+    String querySchoolIds(@Param("organIds") String organIds);
+
     List<LiveRoomGoodsOrderVo> queryLiveRoomGoodsOrderList(Map<String, Object> params);
 
     int countLiveRoomGoodsOrderList(Map<String, Object> params);

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ImLiveRoomReservationDao.java

@@ -22,5 +22,12 @@ public interface ImLiveRoomReservationDao extends BaseMapper<ImLiveRoomReservati
 
     IPage<ImLiveBroadcastRoomVo> queryPageStudent(Page<ImLiveBroadcastRoomVo> page, @Param("param") Map<String, Object> param);
 
+    /**
+     * 查询房间预约人数
+     *
+     * @param roomIdList 房间id集合
+     * @return
+     */
+    List<ImLiveBroadcastRoomVo> selectCountRoomReservation(@Param("roomIdList") List<String> roomIdList);
 }
 

+ 33 - 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,16 @@ public class ImLiveBroadcastRoomDto implements Serializable {
     @ApiModelProperty(value = "房间配置")
     private RoomConfig roomConfig;
 
+    @NotBlank(message = "直播间类型不能为空")
+    @ApiModelProperty(value = "推广的直播间可见类型-全部可见、部分分部可见、部分合作单位可见")
+    private String popularizeType;
+
+    @ApiModelProperty(value = "分部id-多个id逗号分割")
+    private String popularizeOrgIds;
+
+    @ApiModelProperty(value = "学校id-合作单位id,多个id逗号分割")
+    private String popularizeSchoolIds;
+
     @ApiModel(value = "房间配置")
     public static class RoomConfig implements Serializable {
 
@@ -172,5 +181,28 @@ public class ImLiveBroadcastRoomDto implements Serializable {
         this.roomConfig = roomConfig;
     }
 
+    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;
+    }
 }
 

+ 41 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/RoomReservationUserSearch.java

@@ -0,0 +1,41 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * Description
+ *
+ * @author liujunchi
+ * @date 2022-05-31
+ */
+public class RoomReservationUserSearch extends QueryInfo {
+
+    @NotBlank(message = "房间号不能为空")
+    @ApiModelProperty("直播房间号")
+    private String roomUid;
+
+    @ApiModelProperty("用户编号/用户名/用户手机号")
+    private String search;
+
+
+    public String getRoomUid() {
+        return roomUid;
+    }
+
+    public void setRoomUid(String roomUid) {
+        this.roomUid = roomUid;
+    }
+
+    @Override
+    public String getSearch() {
+        return search;
+    }
+
+    @Override
+    public void setSearch(String search) {
+        this.search = search;
+    }
+}

+ 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;
+    }
 }
 

+ 23 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TempBuyFreeLiveTheoryCourse.java

@@ -12,6 +12,10 @@ public class TempBuyFreeLiveTheoryCourse {
 	
 	/**  */
 	private Integer userId;
+
+	private String liveId;
+
+	private Integer liveGoodsId;
 	
 	/**  */
 	private java.util.Date createTime;
@@ -19,8 +23,26 @@ public class TempBuyFreeLiveTheoryCourse {
 	/**  */
 	private java.util.Date updateTime;
 
-	public TempBuyFreeLiveTheoryCourse(Integer userId) {
+	public TempBuyFreeLiveTheoryCourse(Integer userId,String liveId,Integer liveGoodsId) {
 		this.userId = userId;
+		this.liveId = liveId;
+		this.liveGoodsId = liveGoodsId;
+	}
+
+	public String getLiveId() {
+		return liveId;
+	}
+
+	public void setLiveId(String liveId) {
+		this.liveId = liveId;
+	}
+
+	public Integer getLiveGoodsId() {
+		return liveGoodsId;
+	}
+
+	public void setLiveGoodsId(Integer liveGoodsId) {
+		this.liveGoodsId = liveGoodsId;
 	}
 
 	public void setId(Integer id){

+ 44 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/vo/ImLiveBroadcastRoomVo.java

@@ -1,6 +1,5 @@
 package com.ym.mec.biz.dal.vo;
 
-
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -80,6 +79,15 @@ public class ImLiveBroadcastRoomVo implements Serializable {
     @ApiModelProperty(value = "当前登录人是否是黑名单用户 0否 1是")
     private Integer blacklistFlag = 0;
 
+    @ApiModelProperty(value = "推广的直播间可见类型-全部可见ALL、部分分部可见ORGAN、部分合作单位可见SCHOOL")
+    private String popularizeType;
+
+    @ApiModelProperty(value = "分部id-多个id逗号分割")
+    private String popularizeOrgIds;
+
+    @ApiModelProperty(value = "学校id-合作单位id,多个id逗号分割")
+    private String popularizeSchoolIds;
+
     @ApiModelProperty(value = "点赞数")
     private Integer likeNum;
     @ApiModelProperty(value = "当前观看人数")
@@ -87,6 +95,9 @@ public class ImLiveBroadcastRoomVo implements Serializable {
     @ApiModelProperty(value = "累计观看人数")
     private Integer totalLookNum;
 
+    @ApiModelProperty("预约人数")
+    private Integer roomReservationNum;
+
     public Integer getId() {
         return id;
     }
@@ -284,5 +295,37 @@ public class ImLiveBroadcastRoomVo implements Serializable {
     public void setBlacklistFlag(Integer blacklistFlag) {
         this.blacklistFlag = blacklistFlag;
     }
+
+    public Integer getRoomReservationNum() {
+        return roomReservationNum;
+    }
+
+    public void setRoomReservationNum(Integer roomReservationNum) {
+        this.roomReservationNum = roomReservationNum;
+    }
+
+    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;
+    }
 }
 

+ 80 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/vo/RoomReservationUserVo.java

@@ -0,0 +1,80 @@
+package com.ym.mec.biz.dal.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * Description
+ *
+ * @author liujunchi
+ * @date 2022-05-31
+ */
+@ApiModel("预约直播课人员信息")
+public class RoomReservationUserVo {
+
+    @ApiModelProperty("用户id")
+    private Long userId;
+
+    @ApiModelProperty("用户名")
+    private String username;
+
+    @ApiModelProperty("手机号")
+    private String phone;
+
+    @ApiModelProperty("分部id")
+    private Long organId;
+
+    @ApiModelProperty("分部名")
+    private  String organName;
+
+    @ApiModelProperty("声部名")
+    private String subjectName;
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public Long getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Long organId) {
+        this.organId = organId;
+    }
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+}

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

@@ -2,11 +2,13 @@ package com.ym.mec.biz.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 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.page.LiveRoomGoodsOrderQueryInfo;
 import com.ym.mec.biz.dal.vo.BaseRoomUserVo;
 import com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomVo;
 import com.ym.mec.biz.dal.vo.LiveRoomGoodsOrderVo;
+import com.ym.mec.biz.dal.vo.RoomReservationUserVo;
 import com.ym.mec.common.entity.ImUserState;
 import com.ym.mec.common.page.PageInfo;
 
@@ -87,6 +89,13 @@ public interface ImLiveBroadcastRoomService extends IService<ImLiveBroadcastRoom
      */
     List<BaseRoomUserVo> queryBaseUserInfo(List<Integer> userIdList);
 
+    /**
+     * 获取直播间预约用户信息
+     *
+     * @param query
+     * @return
+     */
+    PageInfo<RoomReservationUserVo> queryRoomUser(RoomReservationUserSearch query);
     //查询直播间商品订单列表
     PageInfo<LiveRoomGoodsOrderVo> queryLiveRoomGoodsOrderList(LiveRoomGoodsOrderQueryInfo queryInfo);
 }

+ 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);
 }
 

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

@@ -5,8 +5,8 @@ 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;
 
 /**
@@ -28,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);
 
@@ -38,5 +39,13 @@ public interface ImLiveRoomReservationService extends IService<ImLiveRoomReserva
      * 预约直播间推送极光
      */
     void push(ImLiveBroadcastRoom room);
+
+    /**
+     * 查询直播间预约人数
+     *
+     * @param roomIdList 房间号
+     * @return
+     */
+    List<ImLiveBroadcastRoomVo> countRoomReservation(List<String> roomIdList);
 }
 

+ 59 - 26
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImLiveBroadcastRoomServiceImpl.java

@@ -15,14 +15,13 @@ import com.ym.mec.biz.dal.dao.ImLiveBroadcastRoomDao;
 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.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.dto.RoomReservationUserSearch;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.page.LiveRoomGoodsOrderQueryInfo;
 import com.ym.mec.biz.dal.vo.BaseRoomUserVo;
 import com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomVo;
+import com.ym.mec.biz.dal.vo.RoomReservationUserVo;
 import com.ym.mec.biz.dal.vo.LiveRoomGoodsOrderVo;
 import com.ym.mec.biz.dal.vo.RoomUserInfoVo;
 import com.ym.mec.biz.service.*;
@@ -90,6 +89,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}";
@@ -184,6 +185,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;
@@ -192,18 +194,44 @@ 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);
+
+        // 查询预约人数
+        List<ImLiveBroadcastRoomVo> records = page.getRecords();
+        if (CollectionUtils.isEmpty(records)) {
+            return PageUtil.pageInfo(page);
+        }
+
+        List<String> roomIdList = records.stream().map(ImLiveBroadcastRoomVo::getRoomUid).collect(Collectors.toList());
+
+        List<ImLiveBroadcastRoomVo> countRoomReservationList = imLiveRoomReservationService.countRoomReservation(roomIdList);
+        Map<String, List<ImLiveBroadcastRoomVo>> collect = countRoomReservationList.stream()
+                .collect(Collectors.groupingBy(ImLiveBroadcastRoomVo::getRoomUid));
+        for (ImLiveBroadcastRoomVo record : records) {
+            List<ImLiveBroadcastRoomVo> imLiveBroadcastRoomVos = collect.get(record.getRoomUid());
+            if (CollectionUtils.isEmpty(imLiveBroadcastRoomVos)) {
+                continue;
+            }
+            record.setRoomReservationNum(imLiveBroadcastRoomVos.get(0).getRoomReservationNum());
+        }
+
         return PageUtil.pageInfo(page);
     }
 
@@ -242,14 +270,21 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
     @Transactional(rollbackFor = Exception.class)
     public void update(ImLiveBroadcastRoomDto dto) {
         Date now = new Date();
+        Integer userId = getSysUser().getId();
+        ImLiveBroadcastRoom obj = this.getById(dto.getId());
+        obj.setUpdatedBy(userId);
+        obj.setUpdatedTime(now);
+        //如果直播已经则只能修改是否全员禁麦 和聊天功能
+        if (obj.getLiveState() == 1) {
+            obj.setRoomConfig(JSONObject.toJSONString(dto.getRoomConfig()));
+            this.updateById(obj);
+            return;
+        }
         if (now.getTime() > dto.getLiveStartTime().getTime()) {
             throw new BizException("设置的直播开始时间不能小于当前时间");
         }
-        ImLiveBroadcastRoom obj = this.getById(dto.getId());
         BeanUtils.copyProperties(dto, obj);
         obj.setRoomConfig(JSONObject.toJSONString(dto.getRoomConfig()));
-        obj.setUpdatedBy(getSysUser().getId());
-        obj.setUpdatedTime(now);
         log.info("update room  >>>  :{}", JSONObject.toJSONString(obj));
         this.updateById(obj);
     }
@@ -333,21 +368,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);
         }
@@ -1039,13 +1065,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("用户不存在."));
     }
 
     /**
@@ -1152,6 +1178,13 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
     }
 
     @Override
+    public PageInfo<RoomReservationUserVo> queryRoomUser(RoomReservationUserSearch query) {
+        IPage<RoomReservationUserVo> page = new Page<>(query.getPage(), query.getRows());
+        page = baseMapper.queryRoomUser(page, query);
+        return PageUtil.pageInfo(page);
+    }
+
+    @Override
     public PageInfo<LiveRoomGoodsOrderVo> queryLiveRoomGoodsOrderList(LiveRoomGoodsOrderQueryInfo queryInfo) {
         PageInfo<LiveRoomGoodsOrderVo> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
         Map<String, Object> params = new HashMap<String, Object>();

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

@@ -51,12 +51,11 @@ public class ImLiveRoomBlackServiceImpl extends ServiceImpl<ImLiveRoomBlackDao,
      */
     @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) {
+        if (Objects.nonNull(tenantId) && tenantId != -1) {
             param.put("tenantId", tenantId);
         }
         return PageUtil.pageInfo(baseMapper.queryStudent(pageInfo, param));
@@ -137,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);

+ 21 - 7
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);
     }
@@ -130,6 +139,11 @@ public class ImLiveRoomReservationServiceImpl extends ServiceImpl<ImLiveRoomRese
                 .eq(ImLiveRoomReservation::getRoomUid, room.getRoomUid()));
     }
 
+    @Override
+    public List<ImLiveBroadcastRoomVo> countRoomReservation(List<String> roomIdList) {
+        return baseMapper.selectCountRoomReservation(roomIdList);
+    }
+
     private SysUser getUser() {
         return Optional.ofNullable(sysUserFeignService.queryUserInfo())
                 .orElseThrow(() -> new BizException("用户信息获取失败,请刷新页面或者重新登录!"));

+ 6 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/LiveGoodsMapperServiceImpl.java

@@ -152,10 +152,12 @@ public class LiveGoodsMapperServiceImpl extends BaseServiceImpl<Integer, LiveGoo
 		//商品下架后,将缓存的库存设置为0
 		redissonClient.getBucket(RedisKeyConstant.LIVE_GOODS_STOCK_CACHE_KEY + liveId + liveGoodsId).set(0);
 		//如果下架的是免费的直播课商品,清空购买的学员的缓存记录
-		if(liveGoodsId.equals(2)){
-			//删除当前直播间免费直播课的购买记录缓存
-			redissonClient.getBucket(RedisKeyConstant.LIVE_GOODS_ZERO_CACHE_KEY + liveId).delete();
-		}
+//		if(liveGoodsId.equals(2) || liveGoodsId.equals(3) || liveGoodsId.equals(4)){
+//			//删除当前直播间免费直播课的购买记录缓存
+//			StringBuffer sb = new StringBuffer(RedisKeyConstant.LIVE_GOODS_ZERO_CACHE_KEY).append(liveId).
+//					append("_").append(liveGoodsId);
+//			redissonClient.getBucket(sb.toString()).delete();
+//		}
 	}
 
 	@Override

+ 17 - 14
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MemberRankSettingServiceImpl.java

@@ -275,8 +275,9 @@ public class MemberRankSettingServiceImpl extends BaseServiceImpl<Integer, Membe
             amount = vipGroupActivity.getMarketPrice();
             //扣减库存
             liveGoodsService.reduceGoodsStock(memberPayParamDto.getLiveGoodsId(),memberPayParamDto.getLiveId());
-        } else if (memberPayParamDto.getLiveGoodsId() == 2){
-            RBucket<List<Integer>> bucket = redissonClient.getBucket(RedisKeyConstant.LIVE_GOODS_ZERO_CACHE_KEY + memberPayParamDto.getLiveId());
+        } else if (memberPayParamDto.getLiveGoodsId() == 2 || memberPayParamDto.getLiveGoodsId() == 3 || memberPayParamDto.getLiveGoodsId() == 4){
+            StringBuffer sb = new StringBuffer(RedisKeyConstant.LIVE_GOODS_ZERO_CACHE_KEY).append(memberPayParamDto.getLiveGoodsId());
+            RBucket<List<Integer>> bucket = redissonClient.getBucket(sb.toString());
             List<Integer> list = bucket.get();
             if(CollectionUtils.isEmpty(list)){
                 list = new ArrayList<>();
@@ -286,12 +287,13 @@ public class MemberRankSettingServiceImpl extends BaseServiceImpl<Integer, Membe
                 throw new BizException("您已领取过本轮免费直播课");
             }
             //购买次数是否超过2次
-            int count = tempBuyFreeLiveTheoryCourseDao.countByUserId(sysUser.getId());
-            if(count >= 2){
-                throw new BizException("免费直播课已达到领取次数上限");
-            }
+//            int count = tempBuyFreeLiveTheoryCourseDao.countByUserId(sysUser.getId());
+//            if(count >= 2){
+//                throw new BizException("免费直播课已达到领取次数上限");
+//            }
             //保存购买记录
-            tempBuyFreeLiveTheoryCourseDao.insert(new TempBuyFreeLiveTheoryCourse(sysUser.getId()));
+            tempBuyFreeLiveTheoryCourseDao.insert(
+                    new TempBuyFreeLiveTheoryCourse(sysUser.getId(),memberPayParamDto.getLiveId(),memberPayParamDto.getLiveGoodsId()));
             //扣减库存
             liveGoodsService.reduceGoodsStock(memberPayParamDto.getLiveGoodsId(),memberPayParamDto.getLiveId());
             list.add(sysUser.getId());
@@ -342,8 +344,9 @@ public class MemberRankSettingServiceImpl extends BaseServiceImpl<Integer, Membe
                     return succeed;
                 }
             }
-        } else if (memberPayParamDto.getLiveGoodsId() == 2){
-            RBucket<List<Integer>> bucket = redissonClient.getBucket(RedisKeyConstant.LIVE_GOODS_ZERO_CACHE_KEY + memberPayParamDto.getLiveId());
+        } else if (memberPayParamDto.getLiveGoodsId() == 2 || memberPayParamDto.getLiveGoodsId() == 3 || memberPayParamDto.getLiveGoodsId() == 4){
+            StringBuffer sb = new StringBuffer(RedisKeyConstant.LIVE_GOODS_ZERO_CACHE_KEY).append(memberPayParamDto.getLiveGoodsId());
+            RBucket<List<Integer>> bucket = redissonClient.getBucket(sb.toString());
             List<Integer> list = bucket.get();
             if(CollectionUtils.isEmpty(list)){
                 list = new ArrayList<>();
@@ -354,11 +357,11 @@ public class MemberRankSettingServiceImpl extends BaseServiceImpl<Integer, Membe
                 return succeed;
             }
             //购买次数是否超过2次
-            int count = tempBuyFreeLiveTheoryCourseDao.countByUserId(sysUser.getId());
-            if(count >= 2){
-                succeed.setMsg("免费直播课已达到领取次数上限");
-                return succeed;
-            }
+//            int count = tempBuyFreeLiveTheoryCourseDao.countByUserId(sysUser.getId());
+//            if(count >= 2){
+//                succeed.setMsg("免费直播课已达到领取次数上限");
+//                return succeed;
+//            }
         }else {
             succeed.setMsg("当前商品不可购买");
             return succeed;

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

@@ -250,7 +250,7 @@ public class PayServiceImpl implements PayService {
 									subBalance = subBalance.add(tempBalance);
 								}
 								tempCashAmount = spod.getPrice().subtract(tempBalance).multiply(groupPurchaseAmount).divide(totalGroupPurchaseAmount);
-								subCashAmount = subCashAmount.add(spod.getPrice().subtract(tempBalance).subtract(tempCashAmount));
+								subCashAmount = subCashAmount.add(tempCashAmount);
 								spod.setIncomeItem(OrderDetailTypeEnum.CLOUD_TEACHER.name());
 								spod.setIncome(tempCashAmount);
 								batchUpdateList.add(spod);

+ 0 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -349,8 +349,6 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
             sysUserCashAccountService.updateBalance(order.getUserId(), order.getActualAmount(),
                     PlatformCashAccountDetailTypeEnum.REFUNDS, order.getMemo() + ",订单号:" + order.getOrderNo());
 
-            //退还优惠券
-            sysCouponCodeService.quit(order.getCouponCodeId());
             if (StringUtils.isNotBlank(order.getPaymentChannel())
                     && order.getPaymentChannel().equals("ADAPAY")
                     && !rpMap.containsKey("simulation")) {

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

@@ -273,11 +273,11 @@ public class SysMessageServiceImpl extends BaseServiceImpl<Long, SysMessage> imp
 	public void batchSendImGroupMessage(String[] targetIds,String senderId,String extra,String imgUrl ) throws Exception {
 		URL url = new URL(imgUrl);
 		//获取文件名
-		String path = url.getPath();
-		String suffix = path.substring(path.lastIndexOf(".") + 1);
+//		String path = url.getPath();
+//		String suffix = path.substring(path.lastIndexOf(".") + 1);
 		BufferedImage bufferedImage = Thumbnails.of(url).scale(0.1f).outputQuality(0.25f).asBufferedImage();
 		ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-		ImageIO.write(bufferedImage, suffix, outputStream);
+		ImageIO.write(bufferedImage, "png", outputStream);
 		byte[] bytes = outputStream.toByteArray();
 		outputStream.close();
 		int length = bytes.length;
@@ -286,7 +286,7 @@ public class SysMessageServiceImpl extends BaseServiceImpl<Long, SysMessage> imp
 			throw new BizException("文件过大请调整 像素 或 文件大小");
 		}
 		ImMessageDto imMessageDto =
-				getImGroupMessage("RC:ImgMsg",senderId,targetIds,imageToBase64(bufferedImage, suffix),extra);
+				getImGroupMessage("RC:ImgMsg",senderId,targetIds,imageToBase64(bufferedImage, "png"),extra);
 		imMessageDto.setFileUrl(imgUrl);
 		ExecutorService executor = Executors.newCachedThreadPool();
 		CompletableFuture.runAsync(()->{

+ 8 - 8
mec-biz/src/main/resources/config/mybatis/FinancialExpenditureMapper.xml

@@ -230,26 +230,26 @@
         <result property="deptId" column="dept_id"/>
     </resultMap>
     <select id="getWorkOrderInfo" resultMap="PWorkOrderInfo">
-        SELECT woi.*,su.mec_user_id FROM mec_dev_api.p_work_order_info woi
-        LEFT JOIN mec_dev_api.p_work_order_circulation_history woch ON woi.id = woch.work_order
-        LEFT JOIN mec_dev_api.p_process_info pi ON pi.id = woi.classify
-        LEFT JOIN mec_dev_api.sys_user su ON su.user_id = woi.creator
+        SELECT woi.*,su.mec_user_id FROM oa_pro.p_work_order_info woi
+        LEFT JOIN oa_pro.p_work_order_circulation_history woch ON woi.id = woch.work_order
+        LEFT JOIN oa_pro.p_process_info pi ON pi.id = woi.classify
+        LEFT JOIN oa_pro.sys_user su ON su.user_id = woi.creator
         WHERE woi.is_end = 1  AND woi.is_denied = 0  AND woi.is_cancel = 0
         AND woch.`status` != 0 AND woi.id = #{workOrderId} AND pi.fee_type = 1 LIMIT 1
     </select>
     <select id="getFormStructure" resultType="java.lang.String">
-        SELECT form_structure FROM mec_dev_api.p_work_order_tpl_data WHERE work_order = #{workOrderId}
+        SELECT form_structure FROM oa_pro.p_work_order_tpl_data WHERE work_order = #{workOrderId}
     </select>
     <select id="getFormData" resultType="java.lang.String">
-        SELECT form_data FROM mec_dev_api.p_work_order_tpl_data WHERE work_order = #{workOrderId}
+        SELECT form_data FROM oa_pro.p_work_order_tpl_data WHERE work_order = #{workOrderId}
     </select>
     <select id="getTplInfo" resultType="java.lang.String">
-        SELECT form_structure FROM mec_dev_api.p_tpl_info WHERE id = #{tplInfoId}
+        SELECT form_structure FROM oa_pro.p_tpl_info WHERE id = #{tplInfoId}
     </select>
     <select id="findByBatchNoAndProcessNo" resultType="integer">
         SELECT id_ FROM financial_expenditure WHERE batch_no_ = #{workOrderId} AND financial_process_no_ = #{workOrderId} LIMIT 1
     </select>
     <select id="getDeptId" resultType="java.lang.Integer">
-        SELECT organ_id FROM mec_dev_api.sys_dept WHERE dept_id = #{deptId}
+        SELECT organ_id FROM oa_pro.sys_dept WHERE dept_id = #{deptId}
     </select>
 </mapper>

+ 69 - 16
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=")">
@@ -165,4 +193,29 @@
         <include refid="queryLiveRoomGoodsOrderSql"/>
     </select>
 
+    <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
+        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>
+    </select>
+
+    <select id="querySchoolIds" resultType="string">
+        select GROUP_CONCAT(id_)  from cooperation_organ where  find_in_set(organ_id_,#{organIds})
+    </select>
 </mapper>

+ 12 - 8
mec-biz/src/main/resources/config/mybatis/ImLiveRoomBlackMapper.xml

@@ -25,24 +25,28 @@
     </insert>
 
     <select id="queryStudent" parameterType="object" resultType="com.ym.mec.auth.api.entity.SysUser">
-        select a.id_        as id,
+        select distinct 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%'
+        <if test="param.roomUid != null">
+            and b.room_uid_ = #{param.roomUid}
+        </if>
+        where find_in_set('STUDENT', a.user_type_)
         and a.lock_flag_ = 0
         and a.del_flag_ = 0
-        and b.room_uid_ = #{roomUid}
-        <if test="tenantId != null ">
-            and tenant_id_ = #{tenantId}
+        <if test="param.tenantId != null ">
+            and tenant_id_ = #{param.tenantId}
         </if>
+        <if test="param.search != null ">
             and (
-                 `id_` LIKE CONCAT('%', #{search},'%')
-                  OR `username_` LIKE CONCAT('%', #{search},'%')
-                 OR `phone_` LIKE CONCAT('%', #{search},'%')
+                 a.`id_` LIKE CONCAT('%', #{param.search},'%')
+                  OR a.`username_` LIKE CONCAT('%', #{param.search},'%')
+                 OR a.`phone_` LIKE CONCAT('%', #{param.search},'%')
                )
+        </if>
     </select>
 
     <select id="queryBlackList"  parameterType="map" resultType="com.ym.mec.biz.dal.vo.ImLiveRoomBlackVo">

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

@@ -42,8 +42,25 @@
         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
+        a.popularize_type_ AS popularizeType,
+        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 +79,28 @@
             <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>
+
+    <select id="selectCountRoomReservation" resultType="com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomVo">
+        select
+        lbr.room_uid_ as roomUid,
+        count(1) as roomReservationNum
+        from im_live_room_reservation lbr
+
+        <where>
+            <if test="roomIdList != null and roomIdList.size() != 0">
+                and lbr.room_uid_ in
+                <foreach collection="roomIdList" separator="," close=")" open="(" item="item" >
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+        group by lbr.room_uid_
+    </select>
+
+
 </mapper>

+ 12 - 3
mec-biz/src/main/resources/config/mybatis/TempBuyFreeLiveTheoryCourseMapper.xml

@@ -9,6 +9,8 @@
 	<resultMap type="com.ym.mec.biz.dal.entity.TempBuyFreeLiveTheoryCourse" id="TempBuyFreeLiveTheoryCourse">
 		<result column="id_" property="id" />
 		<result column="user_id_" property="userId" />
+		<result column="live_id_" property="liveId" />
+		<result column="live_goods_id_" property="liveGoodsId" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 	</resultMap>
@@ -25,17 +27,24 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.TempBuyFreeLiveTheoryCourse" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO temp_buy_free_live_theory_course (user_id_,create_time_,update_time_) VALUES(#{userId},NOW(),NOW())
+		INSERT INTO temp_buy_free_live_theory_course (user_id_,live_id_,live_goods_id_,create_time_,update_time_)
+		VALUES(#{userId},#{liveId},#{liveGoodsId},NOW(),NOW())
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.TempBuyFreeLiveTheoryCourse">
 		UPDATE temp_buy_free_live_theory_course <set>
+		<if test="liveGoodsId != null">
+			live_goods_id_ = #{liveGoodsId},
+		</if>
+		<if test="liveId != null">
+			live_id_ = #{liveId},
+		</if>
 		<if test="userId != null">
-		user_id_ = #{userId},
+			user_id_ = #{userId},
 		</if>
 		<if test="updateTime != null">
-		update_time_ = #{updateTime},
+			update_time_ = #{updateTime},
 		</if>
 		</set> WHERE id_ = #{id}
 	</update>

+ 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-student/src/main/java/com/ym/mec/student/controller/DegreeController.java

@@ -94,7 +94,7 @@ public class DegreeController extends BaseController {
             teacherDao.updateUser(user);
         }
         degreeRegistration.setOrganId(user.getOrganId());
-        if(Objects.isNull(degreeRegistration.getOrganId()) || degreeRegistration.getOrganId() == 4){
+        if(Objects.isNull(degreeRegistration.getOrganId())){
             return failed("该分部暂未开放此活动");
         }
         HttpResponseResult pay = degreeRegistrationService.pay(degreeRegistration);

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

@@ -61,7 +61,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));

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

@@ -3,9 +3,11 @@ package com.ym.mec.web.controller;
 
 import com.ym.mec.biz.dal.dto.ImLiveBroadcastRoomDto;
 import com.ym.mec.biz.dal.page.LiveRoomGoodsOrderQueryInfo;
+import com.ym.mec.biz.dal.dto.RoomReservationUserSearch;
 import com.ym.mec.biz.dal.vo.BaseRoomUserVo;
 import com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomVo;
 import com.ym.mec.biz.dal.vo.LiveRoomGoodsOrderVo;
+import com.ym.mec.biz.dal.vo.RoomReservationUserVo;
 import com.ym.mec.biz.service.ImLiveBroadcastRoomService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -48,12 +50,19 @@ 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));
     }
 
+
+    @ApiOperation("直播间预约人员信息")
+    @PostMapping("/query/roomUser")
+    public HttpResponseResult<PageInfo<RoomReservationUserVo>> queryRoomUser(@RequestBody @Valid RoomReservationUserSearch query) {
+        return succeed(imLiveBroadcastRoomService.queryRoomUser(query));
+    }
+
     @ApiOperation("查询房间信息并校验房间是否合规")
     @GetMapping("/queryRoom")
     public HttpResponseResult<ImLiveBroadcastRoomVo> queryRoomAndCheck(@ApiParam(value = "房间uid", required = true) String roomUid,

+ 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));