Browse Source

小组课

zouxuan 1 month ago
parent
commit
10039d1734

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

@@ -487,13 +487,7 @@ public class CourseHomeworkServiceImpl extends ServiceImpl<CourseHomeworkDao, Co
      * @param courseScheduleId 课程id
      */
     private void checkCourseSchedule(Long courseScheduleId) {
-        // 1. 检查课程类型
         CourseSchedule courseSchedule = courseScheduleService.getById(courseScheduleId);
-        if (!CourseScheduleEnum.PRACTICE.getCode().equals(courseSchedule.getType())
-                && !CourseScheduleEnum.VIP.getCode().equals(courseSchedule.getType())
-                && !CourseScheduleEnum.PIANO_ROOM_CLASS.getCode().equals(courseSchedule.getType())) {
-            throw new BizException("不能布置课后作业");
-        }
         // 2. 检查课程结束
         if (!CourseScheduleEnum.COMPLETE.getCode().equals(courseSchedule.getStatus())) {
             throw  new BizException("课程未正常完成,不能布置课后作业");

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

@@ -2888,7 +2888,7 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         List<LiveCourseInfoVo.PlanVo> planVos = coursePlanService.queryCoursePlanByGroupId(courseGroup.getId());
         Map<Long, LiveCourseInfoVo.PlanVo> planMap = new HashMap<>();
         if(CollectionUtils.isNotEmpty(planVos)){
-            planMap = planVos.stream().collect(Collectors.toMap(LiveCourseInfoVo.PlanVo::getId, Function.identity()));
+            planMap = planVos.stream().collect(Collectors.toMap(LiveCourseInfoVo.PlanVo::getCourseId, Function.identity()));
         }
         for (CourseSchedule courseSchedule : courseSchedules) {
             CourseScheduleWrapper.MyCourseVo courseVo = new CourseScheduleWrapper.MyCourseVo();
@@ -2990,6 +2990,11 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         Map<Long, com.yonge.cooleshow.biz.dal.entity.SysUser> userMap = sysUserService.getMapByIds(teacherIds);
         List<CourseScheduleWrapper.StudentCourseList> courseVos = Lists.newArrayList();
         CourseGroup courseGroup = courseGroupService.lambdaQuery().eq(CourseGroup::getId, query.getCourseGroupId()).one();
+        List<LiveCourseInfoVo.PlanVo> planVos = coursePlanService.queryCoursePlanByGroupId(courseGroup.getId());
+        Map<Long, LiveCourseInfoVo.PlanVo> planMap = new HashMap<>();
+        if(CollectionUtils.isNotEmpty(planVos)){
+            planMap = planVos.stream().collect(Collectors.toMap(LiveCourseInfoVo.PlanVo::getCourseId, Function.identity()));
+        }
         Subject subject = subjectService.get(courseGroup.getSubjectId());
         for (CourseSchedule courseSchedule : courseSchedules) {
             CourseScheduleWrapper.StudentCourseList courseVo = new CourseScheduleWrapper.StudentCourseList();
@@ -3002,6 +3007,10 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
             courseVo.setCourseGroupName(courseGroup.getName() + "-第" + courseSchedule.getClassNum() + "课");
             courseVo.setSubjectId(courseGroup.getSubjectId());
             courseVo.setSubjectName(subject.getName());
+            LiveCourseInfoVo.PlanVo planVo = planMap.get(courseSchedule.getId());
+            if(planVo != null){
+                courseVo.setCoursePlan(planVo.getPlan());
+            }
             if(query.getAttendanceStatus() == null){
                 courseVo.setAttendanceStatus(attendanceMap.getOrDefault(courseSchedule.getId(),false));
             }else {

+ 3 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/course/CourseScheduleWrapper.java

@@ -120,6 +120,9 @@ public class CourseScheduleWrapper {
 
         @ApiModelProperty(value = "IM聊天用户ID")
         private String imUserId;
+
+        @ApiModelProperty(value = "课程规划")
+        private String coursePlan;
     }
 
 

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

@@ -612,7 +612,7 @@
                     AND cs.status_ = 'NOT_START'
                 </if>
                 <if test="param.courseState == 'ING'">
-                    AND cs.status_ = 'ING'
+                    AND cs.status_ != 'NOT_START' AND g.status_ = 'ING'
                 </if>
             </if>
             <if test="param.search != null and param.search != ''">