Merge branch '5419_전화번호거짓표시50건이상' into 4608_kmc암호화모듈
This commit is contained in:
commit
ac0a3fb907
4
.gitignore
vendored
4
.gitignore
vendored
@ -204,5 +204,9 @@ rebel.xml
|
||||
/.gemini.zip
|
||||
/CLAUDE.md
|
||||
|
||||
<<<<<<< HEAD
|
||||
# Mac OS
|
||||
=======
|
||||
### Mac OS ###
|
||||
>>>>>>> refs/heads/5419_전화번호거짓표시50건이상
|
||||
.DS_Store
|
||||
@ -3,6 +3,8 @@ package itn.let.mjo.mjocommon;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@ -16,10 +18,8 @@ import org.apache.commons.httpclient.HttpStatus;
|
||||
import org.apache.commons.httpclient.methods.PostMethod;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.mysql.jdbc.StringUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import egovframework.com.idgen.CustomIdGnrService;
|
||||
import egovframework.rte.fdl.cmmn.exception.FdlException;
|
||||
@ -33,11 +33,15 @@ import itn.let.mail.service.StatusResponse;
|
||||
import itn.let.mjo.event.service.MjonEventService;
|
||||
import itn.let.mjo.event.service.MjonEventVO;
|
||||
import itn.let.mjo.msg.service.MjonMsgVO;
|
||||
import itn.let.mjo.msg.service.impl.MjonMsgDAO;
|
||||
import itn.let.mjo.msgdata.service.MjonMsgDataService;
|
||||
import itn.let.mjo.msgdata.service.MjonMsgReturnVO;
|
||||
import itn.let.mjo.msgholiday.service.MsgAlarmSetVO;
|
||||
import itn.let.mjo.msgholiday.service.MsgHolidayService;
|
||||
import itn.let.mjo.msgholiday.service.MsgHolidayVO;
|
||||
import itn.let.sym.site.service.EgovSiteManagerService;
|
||||
import itn.let.sym.site.service.JoinSettingVO;
|
||||
import itn.let.uat.uia.web.SendLogVO;
|
||||
import itn.let.uss.umt.service.EgovUserManageService;
|
||||
import itn.let.uss.umt.service.UserManageVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -70,6 +74,12 @@ public class MjonCommon {
|
||||
|
||||
@Resource(name = "egovMjonMsgIdCGnrService")
|
||||
private CustomIdGnrService idgenMsgCId;
|
||||
|
||||
@Resource(name = "mjonMsgDAO")
|
||||
private MjonMsgDAO mjonMsgDAO;
|
||||
|
||||
@Resource(name = "MjonMsgDataService")
|
||||
private MjonMsgDataService mjonMsgDataService;
|
||||
|
||||
|
||||
|
||||
@ -784,8 +794,119 @@ private int parseIntOrDefault(String value, int defaultValue) {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void sendMessagesIfOverFifty(int cnt, String callTo) throws Exception {
|
||||
//대량문자 발송 안내 = 01
|
||||
//50건 이상일 경우만 발송
|
||||
if(
|
||||
cnt >= 50
|
||||
&& !sysMsgTodaySendYn(callTo)
|
||||
&& "Y".equals(selectSmsNotiIfOverFiftySetting())
|
||||
) {
|
||||
// 금일 1회 이상 보낸 이력없을 경우만 발송
|
||||
String sendMsgType = "01";
|
||||
String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
String contents = "[인터넷 대량문자발송안내] 문자온에서 "+ callTo + " 번호로 " + today + "에 인터넷 대량 문자(50통 이상)가 발송되었습니다."
|
||||
+ "\n※ 번호도용이 의심되는 경우, 이용 중인 이동통신사의 휴대전화 번호도용 문자차단 부가서비스(무료)에 가입하여 피해를 예방할 수 있습니다.";
|
||||
this.sendSysMsg(
|
||||
"15518011"
|
||||
, callTo
|
||||
, contents
|
||||
, sendMsgType
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method Name : sendSysMsg
|
||||
* Description : 관리자 안내 문자 공통
|
||||
*
|
||||
* @param callFrom : 발신번호
|
||||
* @param callTo : 수신번호
|
||||
* @param contents : 내용
|
||||
* @param sendMsgType : 발신내용 타입 - 01: 대량문자발송안내
|
||||
* @return
|
||||
* @throws Exception
|
||||
* @return MjonMsgReturnVO 설명
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public MjonMsgReturnVO sendSysMsg(
|
||||
String callFrom
|
||||
, String callTo
|
||||
, String contents
|
||||
, String sendMsgType
|
||||
) throws Exception {
|
||||
|
||||
//결과 vo
|
||||
MjonMsgReturnVO returnVO = new MjonMsgReturnVO();
|
||||
|
||||
MjonMsgVO mjonMsgVO = new MjonMsgVO();
|
||||
mjonMsgVO.setSmsTxt(contents);
|
||||
mjonMsgVO.setReserveYn("N");
|
||||
// 시스템 문자발송 번호
|
||||
// mjonMsgVO.setCallFrom("15518011");
|
||||
mjonMsgVO.setCallFrom(callFrom);
|
||||
mjonMsgVO.setCallTo(callTo);
|
||||
|
||||
mjonMsgVO.setUserId("system");
|
||||
|
||||
/*
|
||||
* 본문길이에 따른 단문/장문 구분
|
||||
* 단문 4
|
||||
* 장문 6
|
||||
* 2000자 이상 invalid
|
||||
*/
|
||||
String msgType = MsgSendUtils.getMsgTypeWithByteValidation(new MjonMsgSendVO(), contents);//
|
||||
mjonMsgVO.setMsgType(msgType);
|
||||
|
||||
// MsgDiv - S: 단문, L: 장문, P: 그림
|
||||
if("4".equalsIgnoreCase(msgType)) {
|
||||
mjonMsgVO.setMsgDiv("S");
|
||||
}else if("6".equalsIgnoreCase(msgType)) {
|
||||
mjonMsgVO.setMsgDiv("L");
|
||||
}
|
||||
else { // invalid
|
||||
returnVO.setMsgGroupId("");
|
||||
returnVO.setSendMsgCnt("0"); // 발송 건수 저장
|
||||
returnVO.setSendMsgBlockCnt("0"); // 수신차단 건수 저장
|
||||
return returnVO;
|
||||
}
|
||||
|
||||
// 문자타입별 대표전송사 정보
|
||||
MjonMsgVO mjonMsgVO2 = new MjonMsgVO();
|
||||
mjonMsgVO2 = mjonMsgDAO.selectRepMsgAgetnInfo(mjonMsgVO);
|
||||
// 전송사 구분 코드 - 01 : 아이하트, 02 : 현대 퓨쳐넷, 03 : 아이엠오, 04 : 다우기술
|
||||
mjonMsgVO.setAgentCode(mjonMsgVO2.getAgentCode()); //전송사 선택
|
||||
// 전송금액
|
||||
mjonMsgVO.setTotPrice(mjonMsgVO2.getAgentPrice().toString()); //총금액
|
||||
mjonMsgVO.setEachPrice(mjonMsgVO2.getAgentPrice().toString()); //한건 금액
|
||||
|
||||
returnVO = mjonMsgDataService.insertSysMsgDataInfo(mjonMsgVO);
|
||||
|
||||
// 시스템 발송 로그
|
||||
SendLogVO sendLogVO = new SendLogVO();
|
||||
// SendType 1:문자로 발송 2:이메일로 발송
|
||||
sendLogVO.setSendId(returnVO.getMsgGroupId());
|
||||
sendLogVO.setSendType("1");
|
||||
sendLogVO.setFrstSendInfo(mjonMsgVO.getCallFrom());
|
||||
sendLogVO.setReceive(mjonMsgVO.getCallTo());
|
||||
sendLogVO.setContents(contents);
|
||||
sendLogVO.setSendMsgType(sendMsgType);
|
||||
|
||||
mjonMsgDataService.insertSysMsgLog(sendLogVO);
|
||||
|
||||
return returnVO;
|
||||
}
|
||||
|
||||
private Boolean sysMsgTodaySendYn(String callTo) throws Exception {
|
||||
SendLogVO sendLogVO = new SendLogVO();
|
||||
sendLogVO.setReceive(callTo);
|
||||
|
||||
return mjonMsgDataService.selectSysMsgTodaySendYn(sendLogVO);
|
||||
}
|
||||
|
||||
private String selectSmsNotiIfOverFiftySetting() throws Exception {
|
||||
JoinSettingVO joinSettingVO = egovSiteManagerService.selectAdminNotiDetail();
|
||||
return joinSettingVO.getSmsNotiIfOverFifty();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -190,7 +190,7 @@ public interface MjonMsgDataService {
|
||||
|
||||
public MjonMsgReturnVO sendSysMsgData(MjonMsgVO mjonMsgVO, HttpServletRequest request) throws Exception;
|
||||
|
||||
|
||||
public Boolean selectSysMsgTodaySendYn(SendLogVO sendLogVO) throws Exception;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -403,6 +403,10 @@ public class MjonMsgDataDAO extends EgovAbstractDAO {
|
||||
return result;
|
||||
}
|
||||
|
||||
public Boolean selectSysMsgTodaySendYn(SendLogVO sendLogVO) throws Exception{
|
||||
return (Boolean) select("mjonMsgDataDAO.selectSysMsgTodaySendYn",sendLogVO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 다량 데이터를 Batch 처리로 MJ_MSG_DATA 테이블에 INSERT
|
||||
|
||||
@ -4187,6 +4187,13 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
// 총 발송 건수
|
||||
returnMap.put("resultSts", instTotalCnt);
|
||||
|
||||
try {
|
||||
//50건이상 문자발송 시 안내메시지 전송
|
||||
mjonCommon.sendMessagesIfOverFifty(instTotalCnt, mjonMsgVO.getCallFrom());
|
||||
} catch (Exception e) {
|
||||
System.out.println("sendMessagesIfOverFifty method exception.");
|
||||
}
|
||||
|
||||
// TEST발송 시 발송 후 캐시가 있어야함.
|
||||
returnMap.put("afterCash", priceAndPoint.getBefCash(userId));
|
||||
//
|
||||
@ -5148,4 +5155,9 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
return returnVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean selectSysMsgTodaySendYn(SendLogVO sendLogVO) throws Exception{
|
||||
return mjonMsgDataDAO.selectSysMsgTodaySendYn(sendLogVO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -65,6 +65,7 @@ public class JoinSettingVO {
|
||||
private String slackNoti; //관리자 SLACK 알림 여부
|
||||
private String smishingNoti; //첫결제(카드제외) 스미싱의심 알림 여부
|
||||
private String holiSmishingNoti; //야간 스미싱알림 여부
|
||||
private String smsNotiIfOverFifty; //50건이상 문자발송 시 안내문자 발송
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -19,6 +19,8 @@ public class SendLogVO {
|
||||
/*내용*/
|
||||
private String contents;
|
||||
|
||||
private String sendMsgType;
|
||||
|
||||
|
||||
public String getSendId() {
|
||||
return sendId;
|
||||
@ -62,5 +64,13 @@ public class SendLogVO {
|
||||
public void setContents(String contents) {
|
||||
this.contents = contents;
|
||||
}
|
||||
public String getSendMsgType() {
|
||||
return sendMsgType;
|
||||
}
|
||||
public void setSendMsgType(String sendMsgType) {
|
||||
this.sendMsgType = sendMsgType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
xmlns:security="http://www.springframework.org/schema/security"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
|
||||
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.2.xsd
|
||||
http://www.egovframe.go.kr/schema/egov-security http://www.egovframe.go.kr/schema/egov-security/egov-security-3.7.xsd">
|
||||
http://www.egovframe.go.kr/schema/egov-security http://maven.egovframe.go.kr/schema/egov-security/egov-security-3.7.xsd">
|
||||
|
||||
<security:http pattern="/css/**" security="none"/>
|
||||
<security:http pattern="/html/**" security="none"/>
|
||||
|
||||
@ -3733,7 +3733,8 @@
|
||||
RECEIVE,
|
||||
FRST_SEND_PNTTM,
|
||||
CHECK_NO,
|
||||
CONTENTS
|
||||
CONTENTS,
|
||||
SEND_MSG_TYPE
|
||||
)
|
||||
|
||||
|
||||
@ -3746,7 +3747,8 @@
|
||||
#receive#,
|
||||
now(),
|
||||
#checkNo#,
|
||||
#contents#
|
||||
#contents#,
|
||||
#sendMsgType#
|
||||
)
|
||||
</insert>
|
||||
|
||||
@ -8294,5 +8296,19 @@
|
||||
|
||||
</delete>
|
||||
|
||||
<select id="mjonMsgDataDAO.selectSysMsgTodaySendYn" parameterClass="SendLogVO" resultClass="boolean">
|
||||
SELECT
|
||||
COUNT(1) > 1 AS todaySendYn
|
||||
FROM
|
||||
mj_system_send a
|
||||
WHERE
|
||||
RECEIVE = #receive#
|
||||
<![CDATA[
|
||||
AND FRST_SEND_PNTTM >= CURDATE()
|
||||
AND FRST_SEND_PNTTM < CURDATE() + INTERVAL 1 DAY
|
||||
]]>
|
||||
AND SEND_MSG_TYPE = '01'
|
||||
</select>
|
||||
|
||||
</sqlMap>
|
||||
|
||||
|
||||
@ -980,6 +980,7 @@
|
||||
IFNULL(SLACK_NOTI, 'N') AS slackNoti,
|
||||
IFNULL(SMISHING_NOTI, 'N') AS smishingNoti,
|
||||
IFNULL(HOLI_SMISHING_NOTI, 'N') AS holiSmishingNoti,
|
||||
IFNULL(SMS_NOTI_IF_OVER_FIFTY, 'N') AS smsNotiIfOverFifty,
|
||||
LAST_UPDUSR_ID AS lasUpdusrId,
|
||||
LAST_UPDT_PNTTM AS lastUpdtPnttm
|
||||
FROM MJ_MBER_SETTING
|
||||
|
||||
Loading…
Reference in New Issue
Block a user