From f06c7fca310d5c5429f23bcdf0f076117ead1370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?hagjoon=28=EC=9D=B4=ED=95=99=EC=A4=80=29?= Date: Tue, 14 Nov 2023 18:23:11 +0900 Subject: [PATCH] =?UTF-8?q?[=EB=A9=94=EC=9D=B8]=20=EC=9D=BC=EC=9D=BC=20?= =?UTF-8?q?=EB=B9=84=ED=96=89=ED=9A=9F=EC=88=98=20=ED=98=84=ED=99=A9=20:?= =?UTF-8?q?=20=EB=B9=84=ED=96=89=EA=B3=84=ED=9A=8D=EC=84=9C=20=EC=8A=B9?= =?UTF-8?q?=EC=9D=B8=20=ED=95=AD=EB=AA=A9=20=ED=91=9C=EC=B6=9C=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/dash/service/MainDashService.java | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/pav-server/src/main/java/com/palnet/biz/api/main/dash/service/MainDashService.java b/pav-server/src/main/java/com/palnet/biz/api/main/dash/service/MainDashService.java index ac0caa5b..ce9f3709 100644 --- a/pav-server/src/main/java/com/palnet/biz/api/main/dash/service/MainDashService.java +++ b/pav-server/src/main/java/com/palnet/biz/api/main/dash/service/MainDashService.java @@ -261,16 +261,21 @@ public class MainDashService { public List dailyFlightNumOfStcs(){ // 1. 전일 , 금일, 명일(내일) - Instant yesterday = Instant.now().minus(1, ChronoUnit.DAYS); - Instant today = Instant.now(); - Instant tomorrow = Instant.now().plus(1, ChronoUnit.DAYS); - - long yesterdayCount = fltPlanBasRepository.countByAprvlYnAndAprvlDtBetween("Y", yesterday, today); - log.info("yesterdayCount : {}", yesterdayCount); - long todayCount = fltPlanBasRepository.countByAprvlYnAndAprvlDtBetween("Y", today, today.plus(1, ChronoUnit.DAYS)); - log.info("todayCount : {}", todayCount); - long tomorrowCount = fltPlanBasRepository.countByAprvlYnAndAprvlDtBetween("Y", tomorrow, tomorrow.plus(1, ChronoUnit.DAYS)); - log.info("tomorrowCount : {} ", tomorrowCount); + Instant yesterdayStart = Instant.now().minus(1, ChronoUnit.DAYS).truncatedTo(ChronoUnit.DAYS); + Instant yesterdayEnd = Instant.now().truncatedTo(ChronoUnit.DAYS).minus(1, ChronoUnit.SECONDS); + Instant todayStart = Instant.now().truncatedTo(ChronoUnit.DAYS); + Instant todayEnd = Instant.now().plus(1, ChronoUnit.DAYS).minus(1, ChronoUnit.SECONDS); + Instant tomorrowStart = Instant.now().plus(1, ChronoUnit.DAYS).truncatedTo(ChronoUnit.DAYS); + Instant tomorrowEnd = Instant.now().plus(2, ChronoUnit.DAYS).minus(1, ChronoUnit.SECONDS); + + long yesterdayCount = fltPlanBasRepository.countByAprvlYnAndAprvlDtBetween("Y", yesterdayStart, yesterdayEnd); + log.info("yesterdayCount: {}", yesterdayCount); + + long todayCount = fltPlanBasRepository.countByAprvlYnAndAprvlDtBetween("Y", todayStart, todayEnd); + log.info("todayCount: {}", todayCount); + + long tomorrowCount = fltPlanBasRepository.countByAprvlYnAndAprvlDtBetween("Y", tomorrowStart, tomorrowEnd); + log.info("tomorrowCount: {}", tomorrowCount); // 카운트와 함께 MainDashFlightNumStcsModel 인스턴스 생성 List result = new ArrayList<>();