이호영 이호영 2024-12-26
스미싱 알림 테스트 배포
@a39ec550924fadc0ae808f6bc4f9baeda86f6e96
src/main/java/itn/com/cmm/util/MsgSendUtils.java
--- src/main/java/itn/com/cmm/util/MsgSendUtils.java
+++ src/main/java/itn/com/cmm/util/MsgSendUtils.java
@@ -198,13 +198,13 @@
 	 * @param statusResponse
 	 * @param agentSendCounts 
 	 * @param sendRateList 
-	 * @param isNotified 
+	 * @param isHolidayNotified 
 	 * @return call by reference
 	 * @throws Exception 
 	 */
 	public static Boolean populateSendLists(MjonMsgVO mjonMsgVO, List<MjonMsgSendVO> mjonMsgSendListVO
 			, StatusResponse statusResponse, List<String> resultSpamTxt
-			, Map<String, Integer> agentSendCounts, List<MjonMsgVO> sendRateList, boolean isNotified) throws Exception{
+			, Map<String, Integer> agentSendCounts, List<MjonMsgVO> sendRateList, boolean isHolidayNotified) throws Exception{
 		
 		log.info(" :: populateSendLists :: ");
 		
@@ -300,7 +300,7 @@
 			if (!replaceYN) {
 				// 스팸 체크와 메시지 타입 체크 각각 한 번만 수행
 				if (!hasPerformedSpamCheck) {
-					checkSpamAndSetStatus(mjonMsgVO, smsSpamChkTxt, resultSpamTxt, isNotified);
+					checkSpamAndSetStatus(mjonMsgVO, smsSpamChkTxt, resultSpamTxt, isHolidayNotified);
 					hasPerformedSpamCheck = true;
 				}
 				if (!hasPerformedMsgType) {
@@ -316,7 +316,7 @@
 			{// 치환 문자인 경우
 				// 스팸 체크는 `spamChkSize`만큼 반복 수행
 				if (sampleCounter < spamChkSize && !"Y".equals(mjonMsgVO.getSpamStatus())) {
-					checkSpamAndSetStatus(mjonMsgVO, smsSpamChkTxt, resultSpamTxt, isNotified);
+					checkSpamAndSetStatus(mjonMsgVO, smsSpamChkTxt, resultSpamTxt, isHolidayNotified);
 					sampleCounter++;
 				}
 
@@ -422,7 +422,7 @@
 		sendVO.setFileCnt(mjonMsgVO.getFileCnt());
 	}
 
-	private static void checkSpamAndSetStatus(MjonMsgVO mjonMsgVO, String personalizedSmsTxt, List<String> resultSpamTxt, boolean isNotified) throws Exception {
+	private static void checkSpamAndSetStatus(MjonMsgVO mjonMsgVO, String personalizedSmsTxt, List<String> resultSpamTxt, boolean isHolidayNotified) throws Exception {
 		
 
 		mjonMsgVO.setSpamStatus("N");
@@ -451,7 +451,7 @@
 				}
 				
 				mjonMsgVO.setSpamStatus("Y");
-				if(isNotified) {
+				if(isHolidayNotified) {
 					mjonMsgVO.setDelayYn("Y");
 				}
 			}
@@ -925,7 +925,6 @@
 		}
 		// SMS 텍스트를 줄 단위로 나누기
 		String[] split = smsTxt.split("\n");
-		log.info(" : split.length :: [{}]", split.length);
 
 		if (split.length > 0) {
 			// "C" 메시지 종류인 경우 두 번째 줄, 그렇지 않으면 첫 번째 줄을 제목으로 설정
src/main/java/itn/let/mjo/mjocommon/MjonCommon.java
--- src/main/java/itn/let/mjo/mjocommon/MjonCommon.java
+++ src/main/java/itn/let/mjo/mjocommon/MjonCommon.java
@@ -531,8 +531,9 @@
 	}
 
 	// 스미싱 알림 처리
-	private boolean handleSmishingAlert(MjonMsgVO mjonMsgVO) throws Exception {
+	public boolean handleSmishingAlert(MjonMsgVO mjonMsgVO) throws Exception {
 		JoinSettingVO joinSettingVO = egovSiteManagerService.selectAdminNotiDetail();
+		
 		if (joinSettingVO == null || !"Y".equals(joinSettingVO.getHoliSmishingNoti()) || 
 			!"Y".equals(joinSettingVO.getSlackNoti())) {
 			return false; // 알림 조건 미충족
@@ -543,13 +544,11 @@
 		List<MsgHolidayVO> holidayList = getHolidayList();
 		boolean isNotificationAllowed = new MjonHolidayApi().getHolidaySmishingPassStatus(alarmList, holidayList);
 
-		// 알림 발송
-		if (!isNotificationAllowed) {
-//			getAdminSandSlack(mjonMsgVO);
-			return true; // 알림 발송 성공
-		}
-
-		return false; // 알림 발송 조건 미충족
+		System.out.println(" :: isNotificationAllowed : "+ isNotificationAllowed);
+		System.out.println(" :: isNotificationAllowed : "+ isNotificationAllowed);
+		System.out.println(" :: isNotificationAllowed : "+ isNotificationAllowed);
+		System.out.println(" :: isNotificationAllowed : "+ isNotificationAllowed);
+		return !isNotificationAllowed; // 알림 발송 조건 미충족
 	}
 
 	// 안전하게 문자열 가져오기
src/main/java/itn/let/mjo/msgdata/service/impl/MjonMsgDataServiceImpl.java
--- src/main/java/itn/let/mjo/msgdata/service/impl/MjonMsgDataServiceImpl.java
+++ src/main/java/itn/let/mjo/msgdata/service/impl/MjonMsgDataServiceImpl.java
@@ -4055,9 +4055,17 @@
 		
 		
 		
+		
 
+		System.out.println("================================");
 		// 스팸 및 스미싱 의심이면 slack 알림
-		boolean isNotified = mjonCommon.processUserAndCheckSms(mjonMsgVO, userId);
+		boolean isHolidayNotified = mjonCommon.handleSmishingAlert(mjonMsgVO);
+		System.out.println("isNotified :: "+ isHolidayNotified);
+		System.out.println("isNotified :: "+ isHolidayNotified);
+		System.out.println("isNotified :: "+ isHolidayNotified);
+		System.out.println("isNotified :: "+ isHolidayNotified);
+		System.out.println("isNotified :: "+ isHolidayNotified);
+//		boolean isNotified = mjonCommon.processUserAndCheckSms(mjonMsgVO, userId);
 		
 		
 		// 스팸관련 키워드 select
@@ -4072,7 +4080,7 @@
 		 *              전송사 코드 셋팅
 		 */
 		if (!MsgSendUtils.populateSendLists(mjonMsgVO, mjonMsgSendVOList, statusResponse, resultSpamTxt,
-				agentSendCounts, sendRateList, isNotified)) {
+				agentSendCounts, sendRateList, isHolidayNotified)) {
 			;
 			// 문자 치환 후 전송 문자 길이를 초과하였습니다.
 			// 문자 치환 중 오류가 발생하였습니다.
@@ -4160,7 +4168,7 @@
 //		
 
 
-		if (isNotified) {
+		if (isHolidayNotified) {
 			System.out.println("스미싱 알림이 처리되었습니다.");
 			mjonCommon.getAdminSandSlack(mjonMsgVO);
 		} else if("Y".equalsIgnoreCase(mjonMsgVO.getSpamStatus())){
Add a comment
List