소스 검색

当前周次接口调整

dzx 1 년 전
부모
커밋
ba27edd46f
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      src/main/java/com/xjrsoft/module/schedule/controller/ScheduleController.java

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

@@ -176,10 +176,10 @@ public class ScheduleController {
         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 endDate = startDateTime.plusDays((i + 1) * 6).withHour(23).withMinute(59).withSecond(59).withNano(9999);
+                LocalDateTime startDate = startDateTime.plusDays(i * 7).withHour(0).withMinute(0).withSecond(0).withNano(0);
+                LocalDateTime endDate = startDate.plusDays(6).withHour(23).withMinute(59).withSecond(59).withNano(9999);
                 if (now.isAfter(startDate) && now.isBefore(endDate)) {
-                    return RT.ok(i);
+                    return RT.ok(i + 1);
                 }
             }
         }