|
|
|
@ -62,18 +62,21 @@ public class Job { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 每日04:00更新基础数据
|
|
|
|
// 每日04:00更新基础数据
|
|
|
|
@Scheduled(cron = "0 0 23 * * ?") |
|
|
|
@Scheduled(cron = "0 0 4 * * ?") |
|
|
|
public void updateBaseData() { |
|
|
|
public void updateBaseData() { |
|
|
|
// 0秒
|
|
|
|
// 0秒
|
|
|
|
log.info("获取数据-------updateBaseData-----------"); |
|
|
|
log.info("获取数据-------updateBaseData-----------"); |
|
|
|
//LocalDateTime.now().minusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0).atZone(ZoneId.systemDefault()).toInstant()
|
|
|
|
|
|
|
|
//LocalDateTime.now().minusDays(1).withHour(23).withMinute(59).withSecond(59).atZone(ZoneId.systemDefault()).toInstant()
|
|
|
|
|
|
|
|
LocalDateTime firstDay = LocalDate.now() |
|
|
|
LocalDateTime firstDay = LocalDate.now() |
|
|
|
.withDayOfYear(1) |
|
|
|
.withDayOfYear(1) |
|
|
|
.atStartOfDay(); |
|
|
|
.atStartOfDay(); |
|
|
|
List<Date> happenTime = new ArrayList<>(); |
|
|
|
List<Date> happenTime = new ArrayList<>(); |
|
|
|
Date start = Date.from(firstDay.atZone(ZoneId.systemDefault()).toInstant()); |
|
|
|
// Date start = Date.from(firstDay.atZone(ZoneId.systemDefault()).toInstant());
|
|
|
|
Date end = Date.from(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant()); |
|
|
|
// Date end = Date.from(LocalDateTime.now().atZone(ZoneId.systemDefault()).toInstant());
|
|
|
|
|
|
|
|
Date start = Date.from(LocalDateTime.now().minusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0).atZone(ZoneId.systemDefault()).toInstant()); |
|
|
|
|
|
|
|
Date end = Date.from(LocalDateTime.now().minusDays(1).withHour(23).withMinute(59).withSecond(59).atZone(ZoneId.systemDefault()).toInstant()); |
|
|
|
|
|
|
|
|
|
|
|
happenTime.add(start); |
|
|
|
happenTime.add(start); |
|
|
|
happenTime.add(end); |
|
|
|
happenTime.add(end); |
|
|
|
businessDepartService.generate(happenTime); |
|
|
|
businessDepartService.generate(happenTime); |
|
|
|
|