Browse Source

课表查询接口调整

dzx 5 months ago
parent
commit
ccb2708810

+ 2 - 2
src/main/java/com/xjrsoft/module/courseTable/service/impl/CourseTableServiceImpl.java

@@ -222,7 +222,7 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
             if (dto.getWeek() == null) {
                 for (int i = 0; i < weeks; i++) {
                     LocalDateTime startDate = startDateTime.plusDays(i * 7).withHour(0).withMinute(0).withSecond(0).withNano(0);
-                    LocalDateTime endDate = startDateTime.plusDays((i + 1) * 6).withHour(23).withMinute(59).withSecond(59).withNano(9999);
+                    LocalDateTime endDate = startDate.plusDays(6).withHour(23).withMinute(59).withSecond(59).withNano(9999);
                     if (now.isAfter(startDate) && now.isBefore(endDate)) {
                         tableVo.setWeek("第" + (i + 1) + "周");
                     }
@@ -231,7 +231,7 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
                 }
             } else {
                 LocalDateTime startDate = startDateTime.plusDays((dto.getWeek() - 1) * 7).withHour(0).withMinute(0).withSecond(0).withNano(0);
-                LocalDateTime endDate = startDateTime.plusDays(dto.getWeek() * 6).withHour(23).withMinute(59).withSecond(59).withNano(9999);
+                LocalDateTime endDate = startDate.plusDays(6).withHour(23).withMinute(59).withSecond(59).withNano(9999);
                 dto.setStartDate(startDate);
                 dto.setEndDate(endDate);
                 tableVo.setWeek("第" + dto.getWeek() + "周");

+ 1 - 1
src/main/java/com/xjrsoft/module/schedule/controller/ScheduleController.java

@@ -338,7 +338,7 @@ public class ScheduleController {
         List<ScheduleWeekVo> result = new ArrayList<>();
         for (int i = 0; i < weeks; i++) {
             LocalDateTime startDate = startDateTime.plusDays(i * 7).withHour(0).withMinute(0).withSecond(0).withNano(0);
-            LocalDateTime endDate = startDateTime.plusDays((i + 1) * 6).withHour(23).withMinute(59).withSecond(59).withNano(9999);
+            LocalDateTime endDate = startDate.plusDays(6).withHour(23).withMinute(59).withSecond(59).withNano(9999);
             int week = i + 1;
             result.add(
                     new ScheduleWeekVo(){{