스케쥴러 실행시간 조정

This commit is contained in:
itn 2023-08-25 15:20:52 +09:00
parent 1a1acd670f
commit 79ad8b0a4c

View File

@ -271,114 +271,91 @@ public class SchedulerUtil {
}
// AGENT별 SMS LMS MMS 발송건수 , 카카오 알림톡 발송건수 통계 스케쥴러
// @Scheduled(cron = "0 */10 * * * *") //10분마다 실행(TEST)
@Scheduled(cron = "0 10 1 * * *") // 매일 새벽1시 10분 실행
// @Scheduled(cron = "0 */30 * * * *") // 30분마다 실행
@SchedulerLock(name = "insertAgentSmsCountStat", lockAtMostForString = ONE_MIN, lockAtLeastForString = ONE_MIN)
public void agentSmsCountStatInsert() throws Exception {
// agent별 sms lms mms 발송건수 통계 데이터 upsert
//System.out.println("insertAgentSmsCountStat scheduler RUN (YESTERDAY)");
// int nowDate =EgovDateUtil.nowDateToInt("yyyyMMdd");
//int minusDate =EgovDateUtil.dayMinusToInt("yyyyMMdd", 1);
// 전일 문자발송 통계 insert
//MjonMsgStatVO mjonMsgStatVO = new MjonMsgStatVO();
//mjonMsgStatVO.setStatStartDate(minusDate);
//mjonMsgStatVO.setStatEndDate(minusDate);
//mjonMsgService.insertAgentSmsCountStat(mjonMsgStatVO);
try {
System.out.println("=============EgovSysLogScheduling=====insertAgentSmsCountStat scheduler RUN (YESTERDAY) =============>");
// int nowDate =EgovDateUtil.nowDateToInt("yyyyMMdd");
int minusDate =EgovDateUtil.dayMinusToInt("yyyyMMdd", 1);
int minusSevenDays =EgovDateUtil.dayMinusToInt("yyyyMMdd", 7);
// 전일 문자발송 통계 insert
MjonMsgStatVO mjonMsgStatVO = new MjonMsgStatVO();
mjonMsgStatVO.setStatStartDate(minusSevenDays);
mjonMsgStatVO.setStatEndDate(minusDate);
// 전일 문자발송 통계 insert
mjonMsgService.insertAgentSmsCountStat(mjonMsgStatVO);
//================================================================
//================================================================
// 전일 알림톡발송 통계 insert
MjonKakaoAtStatVO kakaoAtStatVO = new MjonKakaoAtStatVO();
kakaoAtStatVO.setStatStartDate(minusSevenDays);
kakaoAtStatVO.setStatEndDate(minusDate);
// 전일 알림톡발송 통계 insert
kakaoStatisticsService.insertKakaoAtCountStat(kakaoAtStatVO);
//================================================================
//================================================================
// 전일 알림톡발송 통계 insert
FaxStatVO faxStatVO = new FaxStatVO();
faxStatVO.setStatStartDate(minusSevenDays);
faxStatVO.setStatEndDate(minusDate);
// 전일 알림톡발송 통계 insert
faxAdmService.insertFaxCountStat(faxStatVO);
// do something...
}catch(Exception ex) {
ex.printStackTrace();
}
}
// AGENT별 SMS LMS MMS 발송건수 통계 스케쥴러
// @Scheduled(cron = "0 */10 * * * *") //10분마다 실행(TEST)
// @Scheduled(cron = "0 0 1 * * *") // 매일 새벽1시 실행
@Scheduled(cron = "0 */30 * * * *") // 30분마다 실행
@SchedulerLock(name = "insertAgentSmsCountStat", lockAtMostForString = ONE_MIN, lockAtLeastForString = ONE_MIN)
public void agentSmsCountStatInsert2() throws Exception {
// agent별 sms lms mms 발송건수 통계 데이터 upsert
//System.out.println("insertAgentSmsCountStat scheduler RUN (EVERY 30 MINUTES)");
//int nowDate =EgovDateUtil.nowDateToInt("yyyyMMdd");
// int minusDate =EgovDateUtil.dayMinusToInt("yyyyMMdd", 1);
// 당일 문자발송 통계 insert
//MjonMsgStatVO mjonMsgStatVO = new MjonMsgStatVO();
//mjonMsgStatVO.setStatStartDate(nowDate);
//mjonMsgStatVO.setStatEndDate(nowDate);
//mjonMsgService.insertAgentSmsCountStat(mjonMsgStatVO);
// AGENT별 SMS 발송건수 통계 스케쥴러
@Scheduled(cron = "0 5,35 * * * *") // 5,35분마다 실행
@SchedulerLock(name = "insertAgentSmsCountStatByMinute", lockAtMostForString = ONE_MIN, lockAtLeastForString = ONE_MIN)
public void agentSmsCountStatByMinuteInsert() throws Exception {
try {
System.out.println("=============EgovSysLogScheduling=====agentSmsCountStatInsert2 =============>");
System.out.println("=============EgovSysLogScheduling=====insertAgentSmsCountStatByMinute =============>");
int nowDate =EgovDateUtil.nowDateToInt("yyyyMMdd");
// int minusDate =EgovDateUtil.dayMinusToInt("yyyyMMdd", 1);
// 당일 문자발송 통계 insert
MjonMsgStatVO mjonMsgStatVO = new MjonMsgStatVO();
mjonMsgStatVO.setStatStartDate(nowDate);
mjonMsgStatVO.setStatEndDate(nowDate);
mjonMsgService.insertAgentSmsCountStat(mjonMsgStatVO);
//================================================================
//================================================================
}catch(Exception ex) {
ex.printStackTrace();
}
}
// AGENT별 Kakao 발송건수 통계 스케쥴러
@Scheduled(cron = "0 10,40 * * * *") // 10,40분마다 실행
@SchedulerLock(name = "insertAgentKakaoCountStatByMinute", lockAtMostForString = ONE_MIN, lockAtLeastForString = ONE_MIN)
public void agentKakaoCountStatByMinuteInsert() throws Exception {
try {
System.out.println("=============EgovSysLogScheduling=====insertAgentKakaoCountStatByMinute =============>");
int nowDate =EgovDateUtil.nowDateToInt("yyyyMMdd");
// 당일 알림톡발송 통계 insert
MjonKakaoAtStatVO kakaoAtStatVO = new MjonKakaoAtStatVO();
kakaoAtStatVO.setStatStartDate(nowDate);
kakaoAtStatVO.setStatEndDate(nowDate);
// 당일 알림톡발송 통계 insert
kakaoStatisticsService.insertKakaoAtCountStat(kakaoAtStatVO);
//================================================================
}catch(Exception ex) {
ex.printStackTrace();
}
}
// AGENT별 Fax 발송건수 통계 스케쥴러
@Scheduled(cron = "0 15,45 * * * *") // 15,45분마다 실행
@SchedulerLock(name = "insertAgentFaxCountStatByMinute", lockAtMostForString = ONE_MIN, lockAtLeastForString = ONE_MIN)
public void agentFaxCountStatByMinuteInsert() throws Exception {
try {
System.out.println("=============EgovSysLogScheduling=====insertAgentFaxCountStatByMinute =============>");
int nowDate =EgovDateUtil.nowDateToInt("yyyyMMdd");
// 전일 알림톡발송 통계 insert
FaxStatVO faxStatVO = new FaxStatVO();
faxStatVO.setStatStartDate(nowDate);
faxStatVO.setStatEndDate(nowDate);
// 전일 알림톡발송 통계 insert
faxAdmService.insertFaxCountStat(faxStatVO);
// do something...
}catch(Exception ex) {
ex.printStackTrace();
}
@ -428,9 +405,9 @@ public class SchedulerUtil {
}
// 대시보드 어제/오늘 접속현황 & 접속통계
@Scheduled(cron = "0 */30 * * * *") // 30분마다 실행
@Scheduled(cron = "0 20,50 * * * *") // 20,50분마다 실행
@SchedulerLock(name = "updateDashBoardStat", lockAtMostForString = ONE_MIN, lockAtLeastForString = ONE_MIN)
public void DashBoardStatUpdate() throws Exception {
public void dashBoardStatUpdate() throws Exception {
try {
System.out.println("=============EgovSysLogScheduling=====DashBoardStatUpdate =============>");
@ -455,7 +432,7 @@ public class SchedulerUtil {
}
// 이용약관 메일발송
@Scheduled(cron = "0 */10 * * * *") // 10분마다 실행
@Scheduled(cron = "0 */15 * * * *") // 15분마다 실행
@SchedulerLock(name = "sendTermsEmail", lockAtMostForString = ONE_MIN, lockAtLeastForString = ONE_MIN)
public void TermsEmailSend() throws Exception {
@ -474,7 +451,7 @@ public class SchedulerUtil {
return new JdbcTemplateLockProvider(dataSource);
}
@Scheduled(cron = "20 * * * * ?")
@Scheduled(cron = "0 0/3 * * * ?") // 3분마다 실행
@SchedulerLock(name = "runKakaoOneTime", lockAtMostForString = ONE_MIN, lockAtLeastForString = ONE_MIN)
public void runKakaoOneTime() throws Exception {