shangke 2 年 前
コミット
674d2710d2

+ 112 - 90
.idea/httpRequests/http-requests-log.http

@@ -1,6 +1,118 @@
 POST http://127.0.0.1:8005/imLiveBroadcastRoomMember/queryRoomMember
 Content-Type: application/json
 Authorization: bearer 70c30cec-f77c-4871-beaa-ce4b5224bf3e
+Content-Length: 82
+Proxy-Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{"rows":10,"page":1,"roomUid":"LIVE-2248324-1683860932420", "excludeBlacklist": 0}
+
+<> 2023-05-12T191018.200.json
+
+###
+
+POST http://127.0.0.1:8005/imLiveBroadcastRoomMember/queryRoomMember
+Content-Type: application/json
+Authorization: bearer 70c30cec-f77c-4871-beaa-ce4b5224bf3e
+Content-Length: 82
+Proxy-Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{"rows":10,"page":1,"roomUid":"LIVE-2248324-1683860932420", "excludeBlacklist": 1}
+
+<> 2023-05-12T191000.200.json
+
+###
+
+POST http://127.0.0.1:8005/imLiveBroadcastRoomMember/queryRoomMember
+Content-Type: application/json
+Authorization: bearer 70c30cec-f77c-4871-beaa-ce4b5224bf3e
+Content-Length: 59
+Proxy-Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{"rows":10,"page":1,"roomUid":"LIVE-2248475-1683777517444"}
+
+<> 2023-05-12T190114.200.json
+
+###
+
+POST http://127.0.0.1:8005/imLiveBroadcastRoomMember/queryRoomMember
+Content-Type: application/json
+Authorization: bearer 70c30cec-f77c-4871-beaa-ce4b5224bf3e
+Content-Length: 59
+Proxy-Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{"rows":10,"page":1,"roomUid":"LIVE-2248475-1683777517444"}
+
+<> 2023-05-12T185307.200.json
+
+###
+
+POST http://127.0.0.1:8005/imLiveBroadcastRoomMember/queryRoomMember
+Content-Type: application/json
+Authorization: bearer 70c30cec-f77c-4871-beaa-ce4b5224bf3e
+Content-Length: 59
+Proxy-Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{"rows":10,"page":1,"roomUid":"LIVE-2248475-1683777517444"}
+
+<> 2023-05-12T184904.200.json
+
+###
+
+POST http://127.0.0.1:8005/imLiveBroadcastRoomMember/queryRoomMember
+Content-Type: application/json
+Authorization: bearer 70c30cec-f77c-4871-beaa-ce4b5224bf3e
+Content-Length: 59
+Proxy-Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{"rows":10,"page":1,"roomUid":"LIVE-2248475-1683777517444"}
+
+<> 2023-05-12T184725.200.json
+
+###
+
+POST http://127.0.0.1:8005/imLiveBroadcastRoomMember/queryRoomMember
+Content-Type: application/json
+Authorization: bearer 70c30cec-f77c-4871-beaa-ce4b5224bf3e
+Content-Length: 59
+Proxy-Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{"rows":10,"page":1,"roomUid":"LIVE-2248475-1683777517444"}
+
+<> 2023-05-12T184519.200.json
+
+###
+
+POST http://127.0.0.1:8005/imLiveBroadcastRoomMember/queryRoomMember
+Content-Type: application/json
+Authorization: bearer 70c30cec-f77c-4871-beaa-ce4b5224bf3e
+Content-Length: 59
+Proxy-Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+{"rows":10,"page":1,"roomUid":"LIVE-2248475-1683777517444"}
+
+<> 2023-05-12T184412.200.json
+
+###
+
+POST http://127.0.0.1:8005/imLiveBroadcastRoomMember/queryRoomMember
+Content-Type: application/json
+Authorization: bearer 70c30cec-f77c-4871-beaa-ce4b5224bf3e
 Content-Length: 59
 Proxy-Connection: Keep-Alive
 User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
@@ -496,93 +608,3 @@ Accept-Encoding: br,deflate,gzip,x-gzip
 
 ###
 
-GET http://127.0.0.1:8005/schoolStaff/getAllStaffs
-Authorization: bearer 8b2589c4-da6a-4cf8-b061-92bcaa6b6ddc
-Proxy-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-<> 2023-05-08T185236.200.json
-
-###
-
-GET http://127.0.0.1:8005/schoolStaff/getAllStaffs
-Authorization: bearer 8b2589c4-da6a-4cf8-b061-92bcaa6b6ddc
-Proxy-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-<> 2023-05-08T184524.200.json
-
-###
-
-GET http://127.0.0.1:8005/open/school/cooperation?id=3
-Proxy-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-<> 2023-05-08T174953.200.json
-
-###
-
-POST http://127.0.0.1:8005/open/school/staffSave
-Content-Type: application/json
-Content-Length: 101
-Proxy-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-{
-  "schoolId": 3,
-  "userType": "SCHOOL_LEADER",
-  "username": "李四",
-  "mobile": "18682475959"
-}
-
-<> 2023-05-08T162159.200.json
-
-###
-
-GET http://127.0.0.1:8005/schoolStaff/queryUserInfo
-Authorization: bearer 8b2589c4-da6a-4cf8-b061-92bcaa6b6ddc
-Proxy-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-<> 2023-05-08T161647.200.json
-
-###
-
-GET http://127.0.0.1:8005/schoolStaff/queryUserInfo
-Authorization: bearer 8b2589c4-da6a-4cf8-b061-92bcaa6b6ddc
-Proxy-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-<> 2023-05-08T155712.200.json
-
-###
-
-GET http://127.0.0.1:8005/schoolStaff/queryUserInfo
-Authorization: 515c41b5-f967-4206-aefa-c5add17007d7
-Proxy-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-<> 2023-05-08T155604.200.json
-
-###
-
-POST http://127.0.0.1:8001/smsLogin?clientId=EDUCATION&clientSecret=EDUCATION&deviceNum=&phone=18682475952&smsCode=666666
-Content-Type: application/x-www-form-urlencoded
-Content-Length: 2
-Proxy-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-{}
-
-<> 2023-05-08T155551.200.json
-
-###
-

+ 26 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImLiveBroadcastRoomMemberServiceImpl.java

@@ -3,6 +3,8 @@ package com.ym.mec.biz.service.impl;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.ImLiveBroadcastRoomMemberDao;
@@ -102,18 +104,36 @@ public class ImLiveBroadcastRoomMemberServiceImpl extends ServiceImpl<ImLiveBroa
                     .collect(Collectors.toMap(Organization::getId, Organization::getName, (o, n) -> n));
 
             List<Integer> studentIds = records.stream()
-                    .filter(x -> StringUtils.isNotBlank(x.getFingerprint()))
+                    .filter(x -> StringUtils.isBlank(x.getFingerprint()))
                     .map(ImLiveBroadcastRoomMemberVo::getStudentId)
                     .filter(Objects::nonNull)
                     .distinct().collect(Collectors.toList());
 
             // 学生报名乐团
-            Map<Integer, String> musicGroupMap = baseMapper.selectStudentMusicGroup(studentIds).stream()
-                    .collect(Collectors.toMap(ImLiveBroadcastRoomMemberVo::getStudentId, ImLiveBroadcastRoomMemberVo::getMusicGroupName, (o, n) -> n));
-
+            Map<Integer, String> musicGroupMap = Maps.newConcurrentMap();
             // 学生声部名称
-            Map<Integer, String> subjectMap = baseMapper.selectStudentSubject(studentIds).stream()
-                    .collect(Collectors.toMap(ImLiveBroadcastRoomMemberVo::getStudentId, ImLiveBroadcastRoomMemberVo::getSubName, (o, n) -> n));
+            Map<Integer, String> subjectMap = Maps.newConcurrentMap();
+
+            for (List<Integer> item : Lists.partition(studentIds, 500)) {
+                // 并发查询学生信息
+                Lists.partition(item, 50).parallelStream().forEach(data -> {
+
+                    // 学生报名乐团
+                    Map<Integer, String> musicMap = baseMapper.selectStudentMusicGroup(data).stream()
+                            .collect(Collectors.toMap(ImLiveBroadcastRoomMemberVo::getStudentId, ImLiveBroadcastRoomMemberVo::getMusicGroupName, (o, n) -> n));
+
+                    if (MapUtils.isNotEmpty(musicMap)) {
+                        musicGroupMap.putAll(musicMap);
+                    }
+
+                    // 学生声部名称
+                    Map<Integer, String> collect = baseMapper.selectStudentSubject(studentIds).stream()
+                            .collect(Collectors.toMap(ImLiveBroadcastRoomMemberVo::getStudentId, ImLiveBroadcastRoomMemberVo::getSubName, (o, n) -> n));
+                    if (MapUtils.isNotEmpty(collect)) {
+                        subjectMap.putAll(collect);
+                    }
+                });
+            }
 
             for (ImLiveBroadcastRoomMemberVo item : records) {
 

+ 20 - 27
mec-biz/src/main/resources/config/mybatis/ImLiveBroadcastRoomMemberMapper.xml

@@ -25,32 +25,22 @@
     </insert>
 
     <select id="queryMemberPage" resultType="com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomMemberVo">
-        select i.room_uid_ as roomUid,
-        i.room_title_ as roomTitle,
-        tu.real_name_ speakerName,
-        a.user_id_ as studentId,
-        a.whether_mic_status_ as whetherMicStatus,
-        a.fingerprint_ as fingerprint,
-        IFNULL(su.username_, a.visitor_name_) as studentName,
-        su.avatar_ as avatar,
-        su.phone_ as phone,
-        su.organ_id_ AS organId,
-        b.name_ as subName,
-        o.name_ organName,
-        GROUP_CONCAT(distinct mg.name_) musicGroupName,
-        a.join_time_ as joinTime,
-        a.total_time_ as totalViewTime,
-        if(ib.user_id_ is null, 0, 1) as blackFlag
-        from im_live_broadcast_room_member as a
-        left join sys_user as su on su.id_ = a.user_id_
-		LEFT JOIN student_registration sr ON sr.user_id_ = a.user_id_
-		LEFT JOIN music_group mg ON  mg.id_ = sr.music_group_id_
-        left join student st on su.id_ = st.user_id_
-        left join subject as b on st.subject_id_list_ = b.id_
-        left join im_live_broadcast_room as i on a.room_uid_ = i.room_uid_
-		left join `sys_user` tu on tu.`id_` = i.`speaker_id_` 
-		LEFT JOIN `organization` o on o.`id_` = su.`organ_id_`
-        left join im_live_room_black ib on ib.room_uid_ = a.room_uid_ and ib.user_id_ = a.user_id_
+        select
+            a.room_uid_ as roomUid,
+            a.user_id_ as studentId,
+            a.whether_mic_status_ as whetherMicStatus,
+            a.fingerprint_ as fingerprint,
+            IFNULL(su.username_, a.visitor_name_) as studentName,
+            su.avatar_ as avatar,
+            su.phone_ as phone,
+            su.organ_id_ AS organId,
+            a.join_time_ as joinTime,
+            a.total_time_ as totalViewTime,
+            if(ib.user_id_ is null, 0, 1) as blackFlag
+        from
+            im_live_broadcast_room_member as a
+            left join sys_user as su on su.id_ = a.user_id_
+            left join im_live_room_black ib on ib.room_uid_ = a.room_uid_ and ib.user_id_ = a.user_id_
         where a.room_uid_ = #{param.roomUid}
         <if test="param.search != null ">
             AND (
@@ -65,6 +55,9 @@
         <if test="param.whetherMicStatus != null">
             and a.whether_mic_status_ = #{param.whetherMicStatus}
         </if>
+        <if test="param.excludeBlacklist != null and param.excludeBlacklist == 1">
+            AND ib.user_id_ is null
+        </if>
         group by a.user_id_
         ORDER BY a.join_time_
     </select>
@@ -118,7 +111,7 @@
         SELECT
             st.user_id_ as studentId, b.name_ as subName
         FROM
-            left join student st left join subject as b on st.subject_id_list_ = b.id_
+            student st left join subject as b on st.subject_id_list_ = b.id_
         WHERE st.user_id_ IN (<foreach collection="studentIds" separator="," item="item">#{item}</foreach>)
     </select>
     <!--学生声部信息-->

+ 1 - 1
mec-common/common-core/pom.xml

@@ -64,7 +64,7 @@
 		<dependency>
 			<groupId>org.springframework.security.oauth</groupId>
 			<artifactId>spring-security-oauth2</artifactId>
-			<version>2.2.1.RELEASE</version>
+			<version>2.3.3.RELEASE</version>
 		</dependency>
 
 		<dependency>

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

@@ -52,6 +52,7 @@ public class ImLiveBroadcastRoomMemberController extends BaseController {
             @ApiImplicitParam(name = "roomUid", dataType = "String", value = "房间uid"),
             @ApiImplicitParam(name = "onlineStatus", dataType = "String ", value = "0:离线 1:在线  不传是全部"),
             @ApiImplicitParam(name = "whetherMicStatus", dataType = "String", value = "连麦状态 0:未申请1:申请连麦中2:连麦中"),
+            @ApiImplicitParam(name = "excludeBlacklist", dataType = "Integer", value = "黑名单排除 0:不排除 1:排除"),
             @ApiImplicitParam(name = "page", dataType = "Integer", value = "页数"),
             @ApiImplicitParam(name = "rows", dataType = "Integer", value = "每页数量"),
     })