사용자 알림 설정에 따른 즉시 발송
This commit is contained in:
parent
0decb976c5
commit
3e88ee9889
@ -198,12 +198,13 @@ public final class MsgSendUtils {
|
|||||||
* @param statusResponse
|
* @param statusResponse
|
||||||
* @param agentSendCounts
|
* @param agentSendCounts
|
||||||
* @param sendRateList
|
* @param sendRateList
|
||||||
|
* @param isNotified
|
||||||
* @return call by reference
|
* @return call by reference
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public static Boolean populateSendLists(MjonMsgVO mjonMsgVO, List<MjonMsgSendVO> mjonMsgSendListVO
|
public static Boolean populateSendLists(MjonMsgVO mjonMsgVO, List<MjonMsgSendVO> mjonMsgSendListVO
|
||||||
, StatusResponse statusResponse, List<String> resultSpamTxt
|
, StatusResponse statusResponse, List<String> resultSpamTxt
|
||||||
, Map<String, Integer> agentSendCounts, List<MjonMsgVO> sendRateList) throws Exception{
|
, Map<String, Integer> agentSendCounts, List<MjonMsgVO> sendRateList, boolean isNotified) throws Exception{
|
||||||
|
|
||||||
log.info(" :: populateSendLists :: ");
|
log.info(" :: populateSendLists :: ");
|
||||||
|
|
||||||
@ -299,7 +300,7 @@ public final class MsgSendUtils {
|
|||||||
if (!replaceYN) {
|
if (!replaceYN) {
|
||||||
// 스팸 체크와 메시지 타입 체크 각각 한 번만 수행
|
// 스팸 체크와 메시지 타입 체크 각각 한 번만 수행
|
||||||
if (!hasPerformedSpamCheck) {
|
if (!hasPerformedSpamCheck) {
|
||||||
checkSpamAndSetStatus(mjonMsgVO, smsSpamChkTxt, resultSpamTxt);
|
checkSpamAndSetStatus(mjonMsgVO, smsSpamChkTxt, resultSpamTxt, isNotified);
|
||||||
hasPerformedSpamCheck = true;
|
hasPerformedSpamCheck = true;
|
||||||
}
|
}
|
||||||
if (!hasPerformedMsgType) {
|
if (!hasPerformedMsgType) {
|
||||||
@ -315,7 +316,7 @@ public final class MsgSendUtils {
|
|||||||
{// 치환 문자인 경우
|
{// 치환 문자인 경우
|
||||||
// 스팸 체크는 `spamChkSize`만큼 반복 수행
|
// 스팸 체크는 `spamChkSize`만큼 반복 수행
|
||||||
if (sampleCounter < spamChkSize && !"Y".equals(mjonMsgVO.getSpamStatus())) {
|
if (sampleCounter < spamChkSize && !"Y".equals(mjonMsgVO.getSpamStatus())) {
|
||||||
checkSpamAndSetStatus(mjonMsgVO, smsSpamChkTxt, resultSpamTxt);
|
checkSpamAndSetStatus(mjonMsgVO, smsSpamChkTxt, resultSpamTxt, isNotified);
|
||||||
sampleCounter++;
|
sampleCounter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -419,7 +420,10 @@ public final class MsgSendUtils {
|
|||||||
sendVO.setFileCnt(mjonMsgVO.getFileCnt());
|
sendVO.setFileCnt(mjonMsgVO.getFileCnt());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void checkSpamAndSetStatus(MjonMsgVO mjonMsgVO, String personalizedSmsTxt, List<String> resultSpamTxt) throws Exception {
|
private static void checkSpamAndSetStatus(MjonMsgVO mjonMsgVO, String personalizedSmsTxt, List<String> resultSpamTxt, boolean isNotified) throws Exception {
|
||||||
|
|
||||||
|
|
||||||
|
mjonMsgVO.setSpamStatus("N");
|
||||||
|
|
||||||
if(StringUtils.isNotEmpty(personalizedSmsTxt)) {
|
if(StringUtils.isNotEmpty(personalizedSmsTxt)) {
|
||||||
|
|
||||||
@ -442,21 +446,12 @@ public final class MsgSendUtils {
|
|||||||
spmFilterTxt = StringUtil.getWordLeft(spmFilterTxt.trim(), 1);
|
spmFilterTxt = StringUtil.getWordLeft(spmFilterTxt.trim(), 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
log.info(" + spmFilterTxt :: [{}]", spmFilterTxt);
|
|
||||||
log.info(" + resultParser :: [{}]", resultParser);
|
|
||||||
|
|
||||||
// mjonMsgVO.setSpamKeyword(spmFilterTxt);
|
|
||||||
mjonMsgVO.setSpamStatus("Y");
|
mjonMsgVO.setSpamStatus("Y");
|
||||||
mjonMsgVO.setDelayYn("Y");
|
if(isNotified) {
|
||||||
|
mjonMsgVO.setDelayYn("Y");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
mjonMsgVO.setSpamStatus("N");
|
|
||||||
}
|
|
||||||
|
|
||||||
}else {
|
|
||||||
mjonMsgVO.setSpamStatus("N");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -545,7 +545,7 @@ private int parseIntOrDefault(String value, int defaultValue) {
|
|||||||
|
|
||||||
// 알림 발송
|
// 알림 발송
|
||||||
if (!isNotificationAllowed) {
|
if (!isNotificationAllowed) {
|
||||||
getAdminSandSlack(mjonMsgVO);
|
// getAdminSandSlack(mjonMsgVO);
|
||||||
return true; // 알림 발송 성공
|
return true; // 알림 발송 성공
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -562,6 +562,7 @@ private int parseIntOrDefault(String value, int defaultValue) {
|
|||||||
MsgAlarmSetVO msgAlarmSetVO = new MsgAlarmSetVO();
|
MsgAlarmSetVO msgAlarmSetVO = new MsgAlarmSetVO();
|
||||||
msgAlarmSetVO.setUseYn("Y");
|
msgAlarmSetVO.setUseYn("Y");
|
||||||
msgAlarmSetVO.setFirstIndex(0);
|
msgAlarmSetVO.setFirstIndex(0);
|
||||||
|
msgAlarmSetVO.setRecordCountPerPage(10000);
|
||||||
return msgHolidayService.selectAlarmSettingList(msgAlarmSetVO);
|
return msgHolidayService.selectAlarmSettingList(msgAlarmSetVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -572,7 +573,7 @@ private int parseIntOrDefault(String value, int defaultValue) {
|
|||||||
|
|
||||||
MsgHolidayVO msgHolidayVO = new MsgHolidayVO();
|
MsgHolidayVO msgHolidayVO = new MsgHolidayVO();
|
||||||
msgHolidayVO.setFirstIndex(0);
|
msgHolidayVO.setFirstIndex(0);
|
||||||
msgHolidayVO.setRecordCountPerPage(100);
|
msgHolidayVO.setRecordCountPerPage(10000);
|
||||||
msgHolidayVO.setSearchHoliYear(Integer.toString(year));
|
msgHolidayVO.setSearchHoliYear(Integer.toString(year));
|
||||||
return msgHolidayService.selectMsgHolidayList(msgHolidayVO);
|
return msgHolidayService.selectMsgHolidayList(msgHolidayVO);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.poi.ss.usermodel.Cell;
|
import org.apache.poi.ss.usermodel.Cell;
|
||||||
import org.apache.poi.ss.usermodel.CellStyle;
|
import org.apache.poi.ss.usermodel.CellStyle;
|
||||||
import org.apache.poi.ss.usermodel.Font;
|
import org.apache.poi.ss.usermodel.Font;
|
||||||
@ -1280,7 +1281,7 @@ public class MjonMsgController {
|
|||||||
searchVO.setSearchSortCnd("FRST_REGIST_PNTTM");
|
searchVO.setSearchSortCnd("FRST_REGIST_PNTTM");
|
||||||
searchVO.setSearchSortOrd("desc");
|
searchVO.setSearchSortOrd("desc");
|
||||||
}
|
}
|
||||||
|
System.out.println("searchVO.getCancelResultYn() :: "+ searchVO.getCancelResultYn());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 2024.01.26 우영두 변경
|
* 2024.01.26 우영두 변경
|
||||||
@ -1294,6 +1295,13 @@ public class MjonMsgController {
|
|||||||
searchVO.setNtceEndde(toDay);
|
searchVO.setNtceEndde(toDay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 조건 값이 없을때 미처리 상태 노출
|
||||||
|
if(StringUtils.isEmpty(searchVO.getCancelResultYn())) {
|
||||||
|
searchVO.setCancelResultYn("N");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
List<MjonMsgVO> resultList = new ArrayList<MjonMsgVO>();
|
List<MjonMsgVO> resultList = new ArrayList<MjonMsgVO>();
|
||||||
resultList = mjonMsgService.selectMjonHoliMsgList(searchVO);
|
resultList = mjonMsgService.selectMjonHoliMsgList(searchVO);
|
||||||
model.addAttribute("resultList", resultList);
|
model.addAttribute("resultList", resultList);
|
||||||
|
|||||||
@ -4054,6 +4054,12 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
|||||||
// UserManageVO userManageVO = MjonCommon.getUserManageInfo(userId);
|
// UserManageVO userManageVO = MjonCommon.getUserManageInfo(userId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 스팸 및 스미싱 의심이면 slack 알림
|
||||||
|
boolean isNotified = mjonCommon.processUserAndCheckSms(mjonMsgVO, userId);
|
||||||
|
|
||||||
|
|
||||||
// 스팸관련 키워드 select
|
// 스팸관련 키워드 select
|
||||||
List<String> resultSpamTxt = mjonMsgDataService.selectSpamKeywordList();
|
List<String> resultSpamTxt = mjonMsgDataService.selectSpamKeywordList();
|
||||||
|
|
||||||
@ -4066,7 +4072,7 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
|||||||
* 전송사 코드 셋팅
|
* 전송사 코드 셋팅
|
||||||
*/
|
*/
|
||||||
if (!MsgSendUtils.populateSendLists(mjonMsgVO, mjonMsgSendVOList, statusResponse, resultSpamTxt,
|
if (!MsgSendUtils.populateSendLists(mjonMsgVO, mjonMsgSendVOList, statusResponse, resultSpamTxt,
|
||||||
agentSendCounts, sendRateList)) {
|
agentSendCounts, sendRateList, isNotified)) {
|
||||||
;
|
;
|
||||||
// 문자 치환 후 전송 문자 길이를 초과하였습니다.
|
// 문자 치환 후 전송 문자 길이를 초과하였습니다.
|
||||||
// 문자 치환 중 오류가 발생하였습니다.
|
// 문자 치환 중 오류가 발생하였습니다.
|
||||||
@ -4153,13 +4159,13 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
|||||||
log.debug("총 단가 합계: [{}]", mjonMsgVO.getTotPrice());
|
log.debug("총 단가 합계: [{}]", mjonMsgVO.getTotPrice());
|
||||||
//
|
//
|
||||||
|
|
||||||
// 스팸 및 스미싱 의심이면 slack 알림
|
|
||||||
boolean isNotified = mjonCommon.processUserAndCheckSms(mjonMsgVO, userId);
|
|
||||||
|
|
||||||
if (isNotified) {
|
if (isNotified) {
|
||||||
System.out.println("스미싱 알림이 처리되었습니다.");
|
System.out.println("스미싱 알림이 처리되었습니다.");
|
||||||
} else {
|
mjonCommon.getAdminSandSlack(mjonMsgVO);
|
||||||
|
} else if("Y".equalsIgnoreCase(mjonMsgVO.getSpamStatus())){
|
||||||
System.out.println("알림 조건을 충족하지 않았습니다.");
|
System.out.println("알림 조건을 충족하지 않았습니다.");
|
||||||
|
mjonMsgDAO.insertSpamPassMsgData(mjonMsgVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
statusResponse.setStatus(HttpStatus.OK);
|
statusResponse.setStatus(HttpStatus.OK);
|
||||||
@ -4191,6 +4197,11 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
|||||||
|
|
||||||
mjonMsgVO.setMsgGroupId(mjonMsgSendVO.getMsgGroupId());
|
mjonMsgVO.setMsgGroupId(mjonMsgSendVO.getMsgGroupId());
|
||||||
mjonMsgVO.setMsgType(mjonMsgSendVO.getMsgType());
|
mjonMsgVO.setMsgType(mjonMsgSendVO.getMsgType());
|
||||||
|
|
||||||
|
|
||||||
|
//test - 스미싱의심 [발송승인, 발송취소] 조건
|
||||||
|
// mjonMsgVO.setDelayYn("N");
|
||||||
|
|
||||||
mjonMsgDAO.insertGroupMsgData(mjonMsgVO);
|
mjonMsgDAO.insertGroupMsgData(mjonMsgVO);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user