[KISA] 전화번호 거짓표시 금지 고시 개정 관련 "대량문자 발송안내 서비스" 시스템 적용 요청
http://pms.iten.co.kr:9999/issues/5419
This commit is contained in:
parent
39f63e611b
commit
c664e67c59
3
.gitignore
vendored
3
.gitignore
vendored
@ -203,3 +203,6 @@ rebel.xml
|
|||||||
/mvnw.cmd
|
/mvnw.cmd
|
||||||
/.gemini.zip
|
/.gemini.zip
|
||||||
/CLAUDE.md
|
/CLAUDE.md
|
||||||
|
|
||||||
|
### Mac OS ###
|
||||||
|
.DS_Store
|
||||||
@ -3,6 +3,8 @@ package itn.let.mjo.mjocommon;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -16,10 +18,8 @@ import org.apache.commons.httpclient.HttpStatus;
|
|||||||
import org.apache.commons.httpclient.methods.PostMethod;
|
import org.apache.commons.httpclient.methods.PostMethod;
|
||||||
import org.json.simple.JSONObject;
|
import org.json.simple.JSONObject;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import com.mysql.jdbc.StringUtils;
|
|
||||||
|
|
||||||
import egovframework.com.idgen.CustomIdGnrService;
|
import egovframework.com.idgen.CustomIdGnrService;
|
||||||
import egovframework.rte.fdl.cmmn.exception.FdlException;
|
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.MjonEventService;
|
||||||
import itn.let.mjo.event.service.MjonEventVO;
|
import itn.let.mjo.event.service.MjonEventVO;
|
||||||
import itn.let.mjo.msg.service.MjonMsgVO;
|
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.MsgAlarmSetVO;
|
||||||
import itn.let.mjo.msgholiday.service.MsgHolidayService;
|
import itn.let.mjo.msgholiday.service.MsgHolidayService;
|
||||||
import itn.let.mjo.msgholiday.service.MsgHolidayVO;
|
import itn.let.mjo.msgholiday.service.MsgHolidayVO;
|
||||||
import itn.let.sym.site.service.EgovSiteManagerService;
|
import itn.let.sym.site.service.EgovSiteManagerService;
|
||||||
import itn.let.sym.site.service.JoinSettingVO;
|
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.EgovUserManageService;
|
||||||
import itn.let.uss.umt.service.UserManageVO;
|
import itn.let.uss.umt.service.UserManageVO;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -70,6 +74,12 @@ public class MjonCommon {
|
|||||||
|
|
||||||
@Resource(name = "egovMjonMsgIdCGnrService")
|
@Resource(name = "egovMjonMsgIdCGnrService")
|
||||||
private CustomIdGnrService idgenMsgCId;
|
private CustomIdGnrService idgenMsgCId;
|
||||||
|
|
||||||
|
@Resource(name = "mjonMsgDAO")
|
||||||
|
private MjonMsgDAO mjonMsgDAO;
|
||||||
|
|
||||||
|
@Resource(name = "MjonMsgDataService")
|
||||||
|
private MjonMsgDataService mjonMsgDataService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -784,7 +794,114 @@ private int parseIntOrDefault(String value, int defaultValue) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void sendMessagesIfOverFifty(int cnt, String callTo) throws Exception {
|
||||||
|
//대량문자 발송 안내 = 01
|
||||||
|
|
||||||
|
//50건 이상일 경우만 발송
|
||||||
|
if(cnt >= 50) {
|
||||||
|
// 금일 1회 이상 보낸 이력없을 경우만 발송
|
||||||
|
if(!sysMsgTodaySendYn(callTo)) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -190,7 +190,7 @@ public interface MjonMsgDataService {
|
|||||||
|
|
||||||
public MjonMsgReturnVO sendSysMsgData(MjonMsgVO mjonMsgVO, HttpServletRequest request) throws Exception;
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean selectSysMsgTodaySendYn(SendLogVO sendLogVO) throws Exception{
|
||||||
|
return (Boolean) select("mjonMsgDataDAO.selectSysMsgTodaySendYn",sendLogVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 다량 데이터를 Batch 처리로 MJ_MSG_DATA 테이블에 INSERT
|
* 다량 데이터를 Batch 처리로 MJ_MSG_DATA 테이블에 INSERT
|
||||||
|
|||||||
@ -4187,6 +4187,12 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
|||||||
// 총 발송 건수
|
// 총 발송 건수
|
||||||
returnMap.put("resultSts", instTotalCnt);
|
returnMap.put("resultSts", instTotalCnt);
|
||||||
|
|
||||||
|
try {
|
||||||
|
mjonCommon.sendMessagesIfOverFifty(instTotalCnt, mjonMsgVO.getCallFrom());
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println("sendMessagesIfOverFifty method exception.");
|
||||||
|
}
|
||||||
|
|
||||||
// TEST발송 시 발송 후 캐시가 있어야함.
|
// TEST발송 시 발송 후 캐시가 있어야함.
|
||||||
returnMap.put("afterCash", priceAndPoint.getBefCash(userId));
|
returnMap.put("afterCash", priceAndPoint.getBefCash(userId));
|
||||||
//
|
//
|
||||||
@ -5148,4 +5154,9 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
|||||||
return returnVO;
|
return returnVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean selectSysMsgTodaySendYn(SendLogVO sendLogVO) throws Exception{
|
||||||
|
return mjonMsgDataDAO.selectSysMsgTodaySendYn(sendLogVO);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,6 +19,8 @@ public class SendLogVO {
|
|||||||
/*내용*/
|
/*내용*/
|
||||||
private String contents;
|
private String contents;
|
||||||
|
|
||||||
|
private String sendMsgType;
|
||||||
|
|
||||||
|
|
||||||
public String getSendId() {
|
public String getSendId() {
|
||||||
return sendId;
|
return sendId;
|
||||||
@ -62,5 +64,13 @@ public class SendLogVO {
|
|||||||
public void setContents(String contents) {
|
public void setContents(String contents) {
|
||||||
this.contents = 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"
|
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
|
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.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="/css/**" security="none"/>
|
||||||
<security:http pattern="/html/**" security="none"/>
|
<security:http pattern="/html/**" security="none"/>
|
||||||
|
|||||||
@ -3733,7 +3733,8 @@
|
|||||||
RECEIVE,
|
RECEIVE,
|
||||||
FRST_SEND_PNTTM,
|
FRST_SEND_PNTTM,
|
||||||
CHECK_NO,
|
CHECK_NO,
|
||||||
CONTENTS
|
CONTENTS,
|
||||||
|
SEND_MSG_TYPE
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -3746,7 +3747,8 @@
|
|||||||
#receive#,
|
#receive#,
|
||||||
now(),
|
now(),
|
||||||
#checkNo#,
|
#checkNo#,
|
||||||
#contents#
|
#contents#,
|
||||||
|
#sendMsgType#
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@ -8294,5 +8296,19 @@
|
|||||||
|
|
||||||
</delete>
|
</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>
|
</sqlMap>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user