Browse Source

课表调整

dzx 5 months ago
parent
commit
f77fdac0ba

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

@@ -221,7 +221,7 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
             int weeks = (int) Math.ceil((double) days / 7);
             if (dto.getWeek() == null) {
                 for (int i = 0; i < weeks; i++) {
-                    LocalDateTime startDate = startDateTime.plusDays(i * 6).withHour(0).withMinute(0).withSecond(0).withNano(0);
+                    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);
                     if (now.isAfter(startDate) && now.isBefore(endDate)) {
                         tableVo.setWeek("第" + (i + 1) + "周");
@@ -230,7 +230,7 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
                     tableVo.setEndDate(endDate.toLocalDate());
                 }
             } else {
-                LocalDateTime startDate = startDateTime.plusDays((dto.getWeek() - 1) * 6).withHour(0).withMinute(0).withSecond(0).withNano(0);
+                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);
                 dto.setStartDate(startDate);
                 dto.setEndDate(endDate);

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

@@ -330,7 +330,7 @@ public class ScheduleController {
         int weeks = (int) Math.ceil((double) days / 7);
         List<ScheduleWeekVo> result = new ArrayList<>();
         for (int i = 0; i < weeks; i++) {
-            LocalDateTime startDate = startDateTime.plusDays(i * 6).withHour(0).withMinute(0).withSecond(0).withNano(0);
+            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);
             int week = i + 1;
             result.add(