Преглед на файлове

Merge branch 'zx_online_update_1218' of http://git.dayaedu.com/yonge/cooleshow into zx_online_update_1218

刘俊驰 преди 2 седмици
родител
ревизия
ecacfba451

+ 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/vo/LiveCourseGroupVo.java

@@ -62,6 +62,9 @@ public class LiveCourseGroupVo {
     @ApiModelProperty(value = "老师姓名")
     private String teacherName;
 
+    @ApiModelProperty(value = "老师编号")
+    private Integer teacherId;
+
     @ApiModelProperty("订单号")
     private String orderNo;
 

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

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

@@ -183,7 +183,8 @@
         cg.im_group_id_  as imGroupId,
         cg.course_plan_ as coursePlan,
         su.username_ as teacherName,
-        su.phone_ as phone
+        su.phone_ as phone,
+        cg.teacher_id_ as teacherId
         from course_group cg
         left join sys_user su on su.id_ = cg. teacher_id_
         <if test="param.studentId != null">
@@ -352,7 +353,7 @@
             <if test="param.status != null">
                 <choose>
                     <when test="param.status == @com.yonge.cooleshow.biz.dal.enums.StudentCourseEnum@TRUANT">
-                        and sa.id_ is null
+                        and sa.id_ is null AND cs.status_ IN ('ING','COMPLETE')
                     </when>
                     <when test="param.status == @com.yonge.cooleshow.biz.dal.enums.StudentCourseEnum@ATTENDCLASS">
                         and sa.id_ is not null
@@ -588,6 +589,9 @@
         <if test="param.startTime != null">
             AND cs.start_time_ &lt;= #{param.startTime}
         </if>
+        <if test="param.search != null and param.search != ''">
+            AND cs.id_ = #{param.search}
+        </if>
         <if test="param.endTime != null">
             AND cs.end_time_ &gt;= #{param.endTime}
         </if>

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

@@ -207,7 +207,7 @@
             cs.status_ AS `status`,
             g.subject_id_ AS subjectId,
             sb.name_ AS subjectName,
-            concat(cg.name_,'-第',cs.class_num_,'课') as courseGroupName,
+            concat(g.name_,'-第',cs.class_num_,'课') as courseGroupName,
             u.del_flag_ as delFlag,
             p.course_id_ AS courseId,
             p.course_group_id_ AS courseGoupId,
@@ -602,7 +602,7 @@
                 AND g.subject_id_ = #{param.subjectId}
             </if>
             <if test="param.groupState !=null and param.groupState !=''">
-                AND find_in_set(cg.status_, #{param.groupState})
+                AND find_in_set(g.status_, #{param.groupState})
             </if>
             <if test="param.courseState != null">
                 <if test="param.courseState == 'COMPLETE'">
@@ -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 != ''">