mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-09 08:20:31 +08:00
feat: add service config templates and extraction script
Former-commit-id: 1de24b7eb79676d1aba9d799a58c5a753290cf52
This commit is contained in:
+27
-22
@@ -383,47 +383,52 @@ public class DateUtils {
|
||||
case 0:
|
||||
nowStartTime = LocalDateTime.of(LocalDate.now(), LocalTime.MIN);
|
||||
nowEndTime = LocalDateTime.of(LocalDate.now(), LocalTime.MAX);
|
||||
timeList.add(new StartTimeAndEndTime(Long.valueOf(nowStartTime.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
Long.valueOf(nowEndTime.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
nowStartTime.getDayOfMonth() + "号"));
|
||||
timeList.add(
|
||||
new StartTimeAndEndTime(Long.valueOf(nowStartTime.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
Long.valueOf(nowEndTime.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
nowStartTime.getDayOfMonth() + "号"));
|
||||
for (i = 1; i < cycleNum; i++) {
|
||||
LocalDateTime firstDay = nowStartTime.minusDays(i);
|
||||
LocalDateTime lastDay = nowEndTime.minusDays(i);
|
||||
timeList.add(new StartTimeAndEndTime(Long.valueOf(firstDay.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
Long.valueOf(lastDay.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
firstDay.getDayOfMonth() + "号"));
|
||||
timeList.add(
|
||||
new StartTimeAndEndTime(Long.valueOf(firstDay.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
Long.valueOf(lastDay.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
firstDay.getDayOfMonth() + "号"));
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
nowMonday = LocalDateTime.of(LocalDate.now(), LocalTime.MIN).with(DayOfWeek.MONDAY);
|
||||
nowSunday = LocalDateTime.of(LocalDate.now(), LocalTime.MAX).with(DayOfWeek.SUNDAY);
|
||||
timeList.add(new StartTimeAndEndTime(Long.valueOf(nowMonday.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
Long.valueOf(nowSunday.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
nowMonday.get(WeekFields.ISO.weekOfWeekBasedYear()) + "周"));
|
||||
timeList
|
||||
.add(new StartTimeAndEndTime(Long.valueOf(nowMonday.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
Long.valueOf(nowSunday.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
nowMonday.get(WeekFields.ISO.weekOfWeekBasedYear()) + "周"));
|
||||
for (j = 1; j < cycleNum; j++) {
|
||||
LocalDateTime lastMonday = nowMonday.minusWeeks(j);
|
||||
LocalDateTime lastSunday = nowSunday.minusWeeks(j);
|
||||
timeList.add(new StartTimeAndEndTime(Long.valueOf(lastMonday.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
Long.valueOf(lastSunday.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
lastMonday.get(WeekFields.ISO.weekOfWeekBasedYear()) + "周"));
|
||||
timeList.add(
|
||||
new StartTimeAndEndTime(Long.valueOf(lastMonday.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
Long.valueOf(lastSunday.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
lastMonday.get(WeekFields.ISO.weekOfWeekBasedYear()) + "周"));
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
nowFirstDay =
|
||||
LocalDateTime.of(LocalDate.now(), LocalTime.MIN).with(TemporalAdjusters.firstDayOfMonth());
|
||||
nowLastDay =
|
||||
LocalDateTime.of(LocalDate.now(), LocalTime.MAX).with(TemporalAdjusters.lastDayOfMonth());
|
||||
timeList.add(new StartTimeAndEndTime(Long.valueOf(nowFirstDay.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
Long.valueOf(nowLastDay.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
nowFirstDay.get(ChronoField.MONTH_OF_YEAR) + "月"));
|
||||
nowLastDay = LocalDateTime.of(LocalDate.now(), LocalTime.MAX).with(TemporalAdjusters.lastDayOfMonth());
|
||||
timeList.add(
|
||||
new StartTimeAndEndTime(Long.valueOf(nowFirstDay.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
Long.valueOf(nowLastDay.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
nowFirstDay.get(ChronoField.MONTH_OF_YEAR) + "月"));
|
||||
for (k = 1; k < cycleNum; k++) {
|
||||
LocalDateTime firstDay =
|
||||
LocalDateTime.now().minusMonths(k).with(TemporalAdjusters.firstDayOfMonth()).with(LocalTime.MIN);
|
||||
LocalDateTime firstDay = LocalDateTime.now().minusMonths(k)
|
||||
.with(TemporalAdjusters.firstDayOfMonth()).with(LocalTime.MIN);
|
||||
LocalDateTime lastDay =
|
||||
LocalDateTime.now().minusMonths(k).with(TemporalAdjusters.lastDayOfMonth()).with(LocalTime.MAX);
|
||||
timeList.add(new StartTimeAndEndTime(Long.valueOf(firstDay.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
Long.valueOf(lastDay.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
firstDay.get(ChronoField.MONTH_OF_YEAR) + "月"));
|
||||
timeList.add(
|
||||
new StartTimeAndEndTime(Long.valueOf(firstDay.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
Long.valueOf(lastDay.toInstant(ZoneOffset.of("+8")).toEpochMilli()),
|
||||
firstDay.get(ChronoField.MONTH_OF_YEAR) + "月"));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user