diff --git a/src/main/java/com/example/device/controller/DeviceStatus.java b/src/main/java/com/example/device/controller/DeviceStatus.java index 214f2a1..88b6460 100644 --- a/src/main/java/com/example/device/controller/DeviceStatus.java +++ b/src/main/java/com/example/device/controller/DeviceStatus.java @@ -171,10 +171,10 @@ public class DeviceStatus { * */ - @Scheduled(cron = "0 30 11,15,17,23 * * ?") + @Scheduled(cron = "0 8 * * ?") public void calculateSuccessRate() { - LocalDateTime todayStart = LocalDateTime.now().truncatedTo(ChronoUnit.DAYS); + LocalDateTime todayStart = LocalDateTime.now().truncatedTo(ChronoUnit.DAYS).minusDays(1); LocalDateTime currentTime = LocalDateTime.now(); @@ -197,7 +197,7 @@ public class DeviceStatus { LocalDateTime dateTime = LocalDateTime.now(); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); String formattedDateTime = dateTime.format(formatter); - String filePath = "/home/excel/"+formattedDateTime+"--deviceStatus.xlsx"; + String filePath = "/Users/mengfanfeng/Downloads/excel/"+formattedDateTime+"--deviceStatus.xlsx"; try (Workbook workbook = new XSSFWorkbook()) { FileOutputStream fileOut = new FileOutputStream(filePath); workbook.write(fileOut);