Просмотр исходного кода

Merge branch 'feature/0529-live' of http://git.dayaedu.com/yonge/mec into feature/0529-live

liujc 1 год назад
Родитель
Сommit
a6416c9089

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

@@ -3510,10 +3510,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             List<StudentCourseScheduleRecordDto> notStartRecords = courseScheduleDao.findStudentCourseScheduleNotStartRecords(user.getId().longValue(),
                     queryInfo.getDate());
             if (notStartRecords != null && notStartRecords.size() > 0) {
-//				Set<Integer> classGroupIds = notStartRecords.stream().map(e -> e.getClassGroupId()).collect(Collectors.toSet());
-//				Map<Integer,Integer> totalNumMap = MapUtil.convertIntegerMap(courseScheduleDao.countTotalNumByClassGroupId(classGroupIds,queryInfo.getDate()));
-//				Map<Integer,Integer> currentNumMap = MapUtil.convertIntegerMap(courseScheduleDao.countCurrentNumByClassGroupId(classGroupIds,queryInfo.getDate()));
-                notStartRecords.forEach(e -> {
+				notStartRecords.forEach(e -> {
                     e.setRestOfClass(notStartRecords.size());
                 });
             }

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

@@ -428,7 +428,7 @@ public class FinancialExpenditureServiceImpl extends BaseServiceImpl<Long, Finan
                         returnFeeDto.setConfirmReturnActivityGive(true);
                         returnFeeDto.setGroupId(financialExpenditure.getVipGroupId());
                         returnFeeDto.setVipGroupId(financialExpenditure.getVipGroupId());
-                        if(returnFeeDto.getGroupType() == GroupType.VIP){
+                        if(returnFeeDto.getGroupType() == GroupType.VIP || returnFeeDto.getGroupType() == GroupType.LIVE){
                             vipGroupService.applyRefundForStudentOa(returnFeeDto);
                         }else if(returnFeeDto.getGroupType() == GroupType.COMM || returnFeeDto.getGroupType() == GroupType.PRACTICE){
                             groupClassService.cancelGroupOa(returnFeeDto);

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java

@@ -770,11 +770,18 @@ public class StudentManageServiceImpl implements StudentManageService {
             pageInfo.setTotal(count);
             params.put("offset", pageInfo.getOffset());
             dataList = studentManageDao.findStudentVipGroupClass(params);
+            List<String> vipGroupIds = dataList.stream().map(e -> e.getVipGroupId().toString()).distinct().collect(Collectors.toList());
+            Map<String, Long> totalClassTimeMap = MapUtil.convertIntegerMap(courseScheduleDao.countTotalCourseScheduleNum(vipGroupIds, queryInfo.getGroupType()));
+            Map<String, Long> currentClassTimeMap = MapUtil.convertIntegerMap(courseScheduleDao.countCourseScheduleNum(vipGroupIds, queryInfo.getGroupType()));
             Set<Integer> teacherIds = dataList.stream().map(e -> e.getTeacherId()).collect(Collectors.toSet());
             teacherIds.addAll(dataList.stream().map(e -> e.getEduTeacherId()).collect(Collectors.toSet()));
             List<Map<Integer, String>> maps = teacherDao.queryNameByIds(StringUtils.join(teacherIds, ","));
             Map<Integer, String> teacherNameMap = MapUtil.convertMybatisMap(maps);
             dataList.forEach(e -> {
+                Long aLong = totalClassTimeMap.get(e.getVipGroupId().toString());
+                Long aLong1 = currentClassTimeMap.get(e.getVipGroupId().toString());
+                e.setCurrentClassTimes(aLong1 == null ? 0 : aLong1.intValue());
+                e.setTotalClassTimes(aLong == null ? 0 : aLong.intValue());
                 e.setTeacherName(teacherNameMap.get(e.getTeacherId()));
                 e.setEduTeacherName(teacherNameMap.get(e.getEduTeacherId()));
             });

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

@@ -3100,7 +3100,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         if (classStudentMapperByUserIdAndClassGroupId.getStatus().equals(ClassGroupStudentStatusEnum.QUIT)) {
             throw new BizException("学生 {} {} 已经是退学状态", studentId, user.getUsername());
         }
-        //不再校验退费金额
         BigDecimal amount = returnFeeDto.getAmount();
         if (!classStudentMapperByUserIdAndClassGroupId.getStatus().equals(ClassGroupStudentStatusEnum.QUIT_SCHOOL)) {
             if (Objects.isNull(amount)) {

+ 4 - 4
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -2624,7 +2624,7 @@
         </if>
         <if test="searchType == 'TEACHER_ERR_ATTENDANCE'">
             AND ta.teacher_id_ = cs.actual_teacher_id_
-            AND cs.status_ = 'OVER'
+            AND cs.status_ = 'OVER' AND cs.group_type_ != 'LIVE'
             AND ((ta.sign_in_status_ = 0 OR ta.sign_in_status_ IS NULL OR ta.sign_out_status_ = 0 OR ta.sign_out_status_ IS NULL)
             AND ta.complaints_content_ IS NULL AND ta.dispose_content_ IS NULL)
             AND (ta.sign_out_status_ IS NOT NULL OR ta.sign_in_status_ IS NOT NULL)
@@ -2632,14 +2632,14 @@
             AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_) AND cssp.id_ IS NOT NULL
         </if>
         <if test="searchType == 'STUDENT_ERR_ATTENDANCE'">
-            AND cs.status_ = 'OVER'
+            AND cs.status_ = 'OVER' AND cs.group_type_ != 'LIVE'
             AND (sa.id_ IS NULL OR (sa.status_ = 'TRUANT' AND sa.visit_flag_ = 0))
             AND EXISTS (SELECT id_ FROM course_schedule_teacher_salary WHERE cs.id_=course_schedule_id_ AND settlement_time_ IS NULL)
             AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_) AND cssp.id_ IS NOT NULL
             AND (ta.sign_out_status_ IS NOT NULL OR ta.sign_in_status_ IS NOT NULL)
         </if>
         <if test="searchType == 'NO_ATTENDANCE'">
-            AND ta.teacher_id_ = cs.actual_teacher_id_
+            AND ta.teacher_id_ = cs.actual_teacher_id_ AND cs.group_type_ != 'LIVE'
             AND cs.status_ = 'OVER' AND ta.sign_in_time_ IS NULL AND ta.sign_out_time_ IS NULL
             AND ta.complaints_content_ IS NULL AND ta.dispose_content_ IS NULL
             AND EXISTS (SELECT id_ FROM course_schedule_teacher_salary WHERE cs.id_=course_schedule_id_ AND settlement_time_ IS NULL)
@@ -4042,7 +4042,7 @@
     </resultMap>
     <sql id="queryCourseEvaluateSql">
         <where>
-            cs.status_ = 'OVER' AND ta.sign_in_time_ IS NOT NULL
+            cs.status_ = 'OVER' AND ta.sign_in_time_ IS NOT NULL AND cs.group_type_ != 'LIVE'
             AND cs.del_flag_ = 0 AND (cs.is_lock_ = 0 OR cs.is_lock_ IS NULL) AND cs.pre_course_flag_ = 0
             AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_) AND sa.id_ IS NOT NULL
             <if test="teacherId != null">

+ 1 - 0
mec-biz/src/main/resources/config/mybatis/ImLiveRoomVideoMapper.xml

@@ -38,6 +38,7 @@
                  left join im_live_broadcast_room b on a.room_uid_ = b.room_uid_
         where a.room_uid_ = #{roomUid}
           and a.type = 2
+        GROUP BY a.id_
     </select>
 
     <select id="queryByRoomIds" resultType="com.ym.mec.biz.dal.vo.ImLiveRoomVideoVo">

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml

@@ -699,7 +699,7 @@
     </resultMap>
     <select id="findStudentVipGroupClass" resultMap="StudentManageVipGroupClassDto">
         SELECT vg.id_,vg.name_ vip_group_name_,vg.group_status_ status_,vg.user_id_,vg.educational_teacher_id_,cg.student_num_,
-        vgc.name_,vg.courses_start_date,cg.current_class_times_,cg.total_class_times_
+        vgc.name_,vg.courses_start_date
         FROM class_group_student_mapper cgsm
         LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
         LEFT JOIN vip_group vg ON cg.music_group_id_ = vg.id_

+ 10 - 1
mec-im/src/main/java/com/ym/service/Impl/LiveRoomServiceImpl.java

@@ -340,6 +340,15 @@ public class LiveRoomServiceImpl implements LiveRoomService {
         imLiveRoomVideo.setUrl(event.getVideoUrl());
         imLiveRoomVideo.setType(2);
 
-        imLiveRoomVideoService.save(imLiveRoomVideo);
+        // 回放记录已存在,直接忽略
+        ImLiveRoomVideo video = imLiveRoomVideoService.lambdaQuery()
+                .eq(ImLiveRoomVideo::getRoomUid, imLiveRoomVideo.getRoomUid())
+                .eq(ImLiveRoomVideo::getRecordId, imLiveRoomVideo.getRecordId())
+                .last("LIMIT 1")
+                .one();
+        if (Objects.isNull(video)) {
+            imLiveRoomVideoService.save(imLiveRoomVideo);
+        }
+
     }
 }