Browse Source

Merge branch 'feature/0803-im' of http://git.dayaedu.com/yonge/cooleshow

zouxuan 1 year ago
parent
commit
c7c6d40738

+ 6 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/ImGroupNoticeServiceImpl.java

@@ -46,12 +46,18 @@ public class ImGroupNoticeServiceImpl extends ServiceImpl<ImGroupNoticeDao, ImGr
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public void create(ImGroupNotice imGroupNotice) {
         Long userId = this.checkAdmin(imGroupNotice.getGroupId());
         Date date = new Date();
         imGroupNotice.setOperatorId(userId);
         imGroupNotice.setCreateTime(date);
         imGroupNotice.setUpdateTime(date);
+
+        // 群公告置顶 只能有一个
+        if(imGroupNotice.getTopFlag() != null && Boolean.TRUE.equals(imGroupNotice.getTopFlag())){
+            baseMapper.updateTopFlag(imGroupNotice.getGroupId());
+        }
         baseMapper.insert(imGroupNotice);
     }
 

+ 7 - 8
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/LiveRoomServiceImpl.java

@@ -699,14 +699,13 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
             List<CourseScheduleTeacherSalary> salaryList = courseScheduleTeacherSalaryService.list(Wrappers.<CourseScheduleTeacherSalary>lambdaQuery()
                     .eq(CourseScheduleTeacherSalary::getCourseScheduleId,schedule.getId())
             );
-            if (CollectionUtils.isEmpty(salaryList)) {
-                return;
+            if (!CollectionUtils.isEmpty(salaryList)) {
+                salaryList.forEach(salary -> {
+                    //修改教师课酬状态-已结算
+                    salary.setStatus(TeacherSalaryEnum.WAIT.getCode());
+                    courseScheduleTeacherSalaryService.updateById(salary);
+                });
             }
-            salaryList.forEach(salary -> {
-                //修改教师课酬状态-已结算
-                salary.setStatus(TeacherSalaryEnum.WAIT.getCode());
-                courseScheduleTeacherSalaryService.updateById(salary);
-            });
         }
         //修改房间状态
         room.setLiveState(2);
@@ -766,6 +765,7 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
         //删除该临时直播间列表
         RMap<Long, String> map = redissonClient.getMap(TEACHER_TEMP_LIVE_ROOM);
         map.remove(room.getSpeakerId());
+        tryDestroyLiveRoom(room);
     }
 
     /**
@@ -1742,7 +1742,6 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
         this.updateById(liveRoomUpdate);
 
 
-        //向聊天室发自定义消息踢出所有人
         try {
             LivePluginService pluginService = livePluginContext.getPluginService(room.getServiceProvider());
 

+ 1 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/RoomServiceImpl.java

@@ -177,7 +177,7 @@ public class RoomServiceImpl extends ServiceImpl<ImNetworkRoomDao, ImNetworkRoom
     public boolean isUserDisplay(String display, String imUserId) {
         boolean result = false;
         if (!display.isEmpty() && display.contains("userId=" + imUserId)) {
-            if (display.contains("type=0") || display.contains("type=2")) {
+            if (display.contains("type=0") || display.contains("type=1") || display.contains("type=3")) {
                 result = true;
             }
         }

+ 1 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseGroupMapper.xml

@@ -792,7 +792,7 @@
         FROM course_schedule_student_payment p
         LEFT JOIN sys_user u ON p.user_id_=u.id_
         LEFT JOIN course_schedule c ON p.course_id_=c.id_
-        LEFT JOIN student_attendance a ON p.user_id_=a.student_id_
+        LEFT JOIN student_attendance a ON p.user_id_=a.student_id_  and a.course_group_type_ = c.id_
         <where>
             <if test="courseId !=null">
                 AND p.course_id_=#{courseId}