浏览代码

小组课

zouxuan 7 月之前
父节点
当前提交
1589e6fd12

+ 2 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/CourseGroupDao.java

@@ -276,5 +276,7 @@ public interface CourseGroupDao extends BaseMapper<CourseGroup> {
     void updateExposureNum(@Param("groupId") Long groupId, @Param("exposureNum") Integer exposureNum);
 
     int updateLockNum(@Param("groupId") Long groupId, @Param("num") int num);
+
+    void updateCourseStartTime(@Param("groupId") Long groupId);
 }
 

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

@@ -1501,6 +1501,10 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         List<Long> studentIds = studentPayments.stream().map(CourseScheduleStudentPayment::getUserId).collect(Collectors.toList());
         this.batchCheckStudentCourseTime(studentIds, timeList, CourseTimeEntity::getStartTime, CourseTimeEntity::getEndTime);
         baseMapper.courseAdjust(adjustVo);
+        if(StringUtils.equals("GROUP",schedule.getType())){
+            //更新开课时间
+            courseGroupService.getDao().updateCourseStartTime(schedule.getCourseGroupId());
+        }
         // 课程调整后给学生发消息
         sendCourseAdjustMessage(teacherId,studentIds,adjustVo.getCourseId(),adjustVo.getStartTime(),oldStartTime);
     }

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

@@ -1126,4 +1126,8 @@
         set lock_num_ = lock_num_ + #{num}
         where id_ = #{groupId} and lock_num_ + #{num} &lt;= max_student_num_ and lock_num_ + #{num} &gt;= 0
     </update>
+    <update id="updateCourseStartTime">
+        update course_group set course_start_time_ =
+        (select MIN(start_time_) from course_schedule where course_group_id_ = #{groupId}) WHERE id_ = #{groupId}
+    </update>
 </mapper>