Browse Source

1、试听课

Joburgess 5 years ago
parent
commit
67fdee7aee

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

@@ -60,7 +60,7 @@ public interface EduPracticeGroupService {
      * @date 2020/2/2
      * @return java.util.Map
      */
-    Map<Integer, List<String>> getEnableApplyDatesWithWeek();
+    Map<Integer, List<String>> getEnableApplyDatesWithWeek(int startWeekDay);
 
     /**
      * @describe 获取指定教师的空闲时间——试听

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/EduPracticeGroupServiceImpl.java

@@ -616,7 +616,7 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
     }
 
     @Override
-    public Map<Integer, List<String>> getEnableApplyDatesWithWeek() {
+    public Map<Integer, List<String>> getEnableApplyDatesWithWeek(int startWeekDay) {
         Map<Integer, List<String>> result = new HashMap<>();
         SysConfig practiceApplyIntervalTimeConfig = sysConfigService.findByParamName(SysConfigService.PRACTICE_APPLY_INTERVAL_TIME);
         Integer practiceApplyIntervalMinutes = practiceApplyIntervalTimeConfig.getParanValue(Integer.class);
@@ -630,7 +630,7 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
                 break;
             }
         }
-        for (int i = 1; i <= 7; i++) {
+        for (int i = startWeekDay; i <= 7; i++) {
             List<String> tempTimes = new ArrayList<>();
             for (String applyDayTime : dayApplyTimes) {
                 tempTimes.add(applyDayTime);
@@ -728,7 +728,7 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
         }
         LocalDate sunday = monday.with(weekFields.dayOfWeek(), DayOfWeek.SUNDAY.getValue());
 
-        Map<Integer, List<String>> weekNumApplyTimesMap = getEnableApplyDatesWithWeek();
+        Map<Integer, List<String>> weekNumApplyTimesMap = getEnableApplyDatesWithWeek(monday.getDayOfWeek().getValue());
         List<CourseSchedule> allTeacherCourses = courseScheduleDao.findTeacherCoursesWithDateRangeWithoutMusicGroup(teacherId, Date.from(monday.atStartOfDay(zoneId).toInstant()), Date.from(sunday.atStartOfDay(zoneId).toInstant()));
         allTeacherCourses.sort(Comparator.comparing(CourseSchedule::getStartClassTime));