Merge branch '5419_전화번호거짓표시50건이상' into 4608_kmc암호화모듈
@ac0a3fb907502f7286e3684d52d3e12a826522f6
--- .gitignore
+++ .gitignore
... | ... | @@ -204,5 +204,9 @@ |
| 204 | 204 |
/.gemini.zip |
| 205 | 205 |
/CLAUDE.md |
| 206 | 206 |
|
| 207 |
+<<<<<<< HEAD |
|
| 207 | 208 |
# Mac OS |
| 209 |
+======= |
|
| 210 |
+### Mac OS ### |
|
| 211 |
+>>>>>>> refs/heads/5419_전화번호거짓표시50건이상 |
|
| 208 | 212 |
.DS_Store(No newline at end of file) |
--- src/main/java/itn/let/mjo/mjocommon/MjonCommon.java
+++ src/main/java/itn/let/mjo/mjocommon/MjonCommon.java
... | ... | @@ -3,6 +3,8 @@ |
| 3 | 3 |
import java.io.IOException; |
| 4 | 4 |
import java.io.UnsupportedEncodingException; |
| 5 | 5 |
import java.text.SimpleDateFormat; |
| 6 |
+import java.time.LocalDate; |
|
| 7 |
+import java.time.format.DateTimeFormatter; |
|
| 6 | 8 |
import java.util.Calendar; |
| 7 | 9 |
import java.util.Date; |
| 8 | 10 |
import java.util.List; |
... | ... | @@ -16,10 +18,8 @@ |
| 16 | 18 |
import org.apache.commons.httpclient.methods.PostMethod; |
| 17 | 19 |
import org.json.simple.JSONObject; |
| 18 | 20 |
import org.springframework.beans.factory.annotation.Value; |
| 19 |
-import org.springframework.stereotype.Component; |
|
| 20 | 21 |
import org.springframework.stereotype.Service; |
| 21 |
- |
|
| 22 |
-import com.mysql.jdbc.StringUtils; |
|
| 22 |
+import org.springframework.transaction.annotation.Transactional; |
|
| 23 | 23 |
|
| 24 | 24 |
import egovframework.com.idgen.CustomIdGnrService; |
| 25 | 25 |
import egovframework.rte.fdl.cmmn.exception.FdlException; |
... | ... | @@ -33,11 +33,15 @@ |
| 33 | 33 |
import itn.let.mjo.event.service.MjonEventService; |
| 34 | 34 |
import itn.let.mjo.event.service.MjonEventVO; |
| 35 | 35 |
import itn.let.mjo.msg.service.MjonMsgVO; |
| 36 |
+import itn.let.mjo.msg.service.impl.MjonMsgDAO; |
|
| 37 |
+import itn.let.mjo.msgdata.service.MjonMsgDataService; |
|
| 38 |
+import itn.let.mjo.msgdata.service.MjonMsgReturnVO; |
|
| 36 | 39 |
import itn.let.mjo.msgholiday.service.MsgAlarmSetVO; |
| 37 | 40 |
import itn.let.mjo.msgholiday.service.MsgHolidayService; |
| 38 | 41 |
import itn.let.mjo.msgholiday.service.MsgHolidayVO; |
| 39 | 42 |
import itn.let.sym.site.service.EgovSiteManagerService; |
| 40 | 43 |
import itn.let.sym.site.service.JoinSettingVO; |
| 44 |
+import itn.let.uat.uia.web.SendLogVO; |
|
| 41 | 45 |
import itn.let.uss.umt.service.EgovUserManageService; |
| 42 | 46 |
import itn.let.uss.umt.service.UserManageVO; |
| 43 | 47 |
import lombok.extern.slf4j.Slf4j; |
... | ... | @@ -70,6 +74,12 @@ |
| 70 | 74 |
|
| 71 | 75 |
@Resource(name = "egovMjonMsgIdCGnrService") |
| 72 | 76 |
private CustomIdGnrService idgenMsgCId; |
| 77 |
+ |
|
| 78 |
+ @Resource(name = "mjonMsgDAO") |
|
| 79 |
+ private MjonMsgDAO mjonMsgDAO; |
|
| 80 |
+ |
|
| 81 |
+ @Resource(name = "MjonMsgDataService") |
|
| 82 |
+ private MjonMsgDataService mjonMsgDataService; |
|
| 73 | 83 |
|
| 74 | 84 |
|
| 75 | 85 |
|
... | ... | @@ -784,8 +794,119 @@ |
| 784 | 794 |
return result; |
| 785 | 795 |
} |
| 786 | 796 |
|
| 797 |
+ public void sendMessagesIfOverFifty(int cnt, String callTo) throws Exception {
|
|
| 798 |
+ //대량문자 발송 안내 = 01 |
|
| 799 |
+ //50건 이상일 경우만 발송 |
|
| 800 |
+ if( |
|
| 801 |
+ cnt >= 50 |
|
| 802 |
+ && !sysMsgTodaySendYn(callTo) |
|
| 803 |
+ && "Y".equals(selectSmsNotiIfOverFiftySetting()) |
|
| 804 |
+ ) {
|
|
| 805 |
+ // 금일 1회 이상 보낸 이력없을 경우만 발송 |
|
| 806 |
+ String sendMsgType = "01"; |
|
| 807 |
+ String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
| 808 |
+ String contents = "[인터넷 대량문자발송안내] 문자온에서 "+ callTo + " 번호로 " + today + "에 인터넷 대량 문자(50통 이상)가 발송되었습니다." |
|
| 809 |
+ + "\n※ 번호도용이 의심되는 경우, 이용 중인 이동통신사의 휴대전화 번호도용 문자차단 부가서비스(무료)에 가입하여 피해를 예방할 수 있습니다."; |
|
| 810 |
+ this.sendSysMsg( |
|
| 811 |
+ "15518011" |
|
| 812 |
+ , callTo |
|
| 813 |
+ , contents |
|
| 814 |
+ , sendMsgType |
|
| 815 |
+ ); |
|
| 816 |
+ } |
|
| 817 |
+ } |
|
| 787 | 818 |
|
| 819 |
+ /** |
|
| 820 |
+ * Method Name : sendSysMsg |
|
| 821 |
+ * Description : 관리자 안내 문자 공통 |
|
| 822 |
+ * |
|
| 823 |
+ * @param callFrom : 발신번호 |
|
| 824 |
+ * @param callTo : 수신번호 |
|
| 825 |
+ * @param contents : 내용 |
|
| 826 |
+ * @param sendMsgType : 발신내용 타입 - 01: 대량문자발송안내 |
|
| 827 |
+ * @return |
|
| 828 |
+ * @throws Exception |
|
| 829 |
+ * @return MjonMsgReturnVO 설명 |
|
| 830 |
+ */ |
|
| 831 |
+ @Transactional(rollbackFor = Exception.class) |
|
| 832 |
+ public MjonMsgReturnVO sendSysMsg( |
|
| 833 |
+ String callFrom |
|
| 834 |
+ , String callTo |
|
| 835 |
+ , String contents |
|
| 836 |
+ , String sendMsgType |
|
| 837 |
+ ) throws Exception {
|
|
| 838 |
+ |
|
| 839 |
+ //결과 vo |
|
| 840 |
+ MjonMsgReturnVO returnVO = new MjonMsgReturnVO(); |
|
| 841 |
+ |
|
| 842 |
+ MjonMsgVO mjonMsgVO = new MjonMsgVO(); |
|
| 843 |
+ mjonMsgVO.setSmsTxt(contents); |
|
| 844 |
+ mjonMsgVO.setReserveYn("N");
|
|
| 845 |
+ // 시스템 문자발송 번호 |
|
| 846 |
+// mjonMsgVO.setCallFrom("15518011");
|
|
| 847 |
+ mjonMsgVO.setCallFrom(callFrom); |
|
| 848 |
+ mjonMsgVO.setCallTo(callTo); |
|
| 849 |
+ |
|
| 850 |
+ mjonMsgVO.setUserId("system");
|
|
| 851 |
+ |
|
| 852 |
+ /* |
|
| 853 |
+ * 본문길이에 따른 단문/장문 구분 |
|
| 854 |
+ * 단문 4 |
|
| 855 |
+ * 장문 6 |
|
| 856 |
+ * 2000자 이상 invalid |
|
| 857 |
+ */ |
|
| 858 |
+ String msgType = MsgSendUtils.getMsgTypeWithByteValidation(new MjonMsgSendVO(), contents);// |
|
| 859 |
+ mjonMsgVO.setMsgType(msgType); |
|
| 860 |
+ |
|
| 861 |
+ // MsgDiv - S: 단문, L: 장문, P: 그림 |
|
| 862 |
+ if("4".equalsIgnoreCase(msgType)) {
|
|
| 863 |
+ mjonMsgVO.setMsgDiv("S");
|
|
| 864 |
+ }else if("6".equalsIgnoreCase(msgType)) {
|
|
| 865 |
+ mjonMsgVO.setMsgDiv("L");
|
|
| 866 |
+ } |
|
| 867 |
+ else { // invalid
|
|
| 868 |
+ returnVO.setMsgGroupId("");
|
|
| 869 |
+ returnVO.setSendMsgCnt("0"); // 발송 건수 저장
|
|
| 870 |
+ returnVO.setSendMsgBlockCnt("0"); // 수신차단 건수 저장
|
|
| 871 |
+ return returnVO; |
|
| 872 |
+ } |
|
| 873 |
+ |
|
| 874 |
+ // 문자타입별 대표전송사 정보 |
|
| 875 |
+ MjonMsgVO mjonMsgVO2 = new MjonMsgVO(); |
|
| 876 |
+ mjonMsgVO2 = mjonMsgDAO.selectRepMsgAgetnInfo(mjonMsgVO); |
|
| 877 |
+ // 전송사 구분 코드 - 01 : 아이하트, 02 : 현대 퓨쳐넷, 03 : 아이엠오, 04 : 다우기술 |
|
| 878 |
+ mjonMsgVO.setAgentCode(mjonMsgVO2.getAgentCode()); //전송사 선택 |
|
| 879 |
+ // 전송금액 |
|
| 880 |
+ mjonMsgVO.setTotPrice(mjonMsgVO2.getAgentPrice().toString()); //총금액 |
|
| 881 |
+ mjonMsgVO.setEachPrice(mjonMsgVO2.getAgentPrice().toString()); //한건 금액 |
|
| 882 |
+ |
|
| 883 |
+ returnVO = mjonMsgDataService.insertSysMsgDataInfo(mjonMsgVO); |
|
| 884 |
+ |
|
| 885 |
+ // 시스템 발송 로그 |
|
| 886 |
+ SendLogVO sendLogVO = new SendLogVO(); |
|
| 887 |
+ // SendType 1:문자로 발송 2:이메일로 발송 |
|
| 888 |
+ sendLogVO.setSendId(returnVO.getMsgGroupId()); |
|
| 889 |
+ sendLogVO.setSendType("1");
|
|
| 890 |
+ sendLogVO.setFrstSendInfo(mjonMsgVO.getCallFrom()); |
|
| 891 |
+ sendLogVO.setReceive(mjonMsgVO.getCallTo()); |
|
| 892 |
+ sendLogVO.setContents(contents); |
|
| 893 |
+ sendLogVO.setSendMsgType(sendMsgType); |
|
| 894 |
+ |
|
| 895 |
+ mjonMsgDataService.insertSysMsgLog(sendLogVO); |
|
| 896 |
+ |
|
| 897 |
+ return returnVO; |
|
| 898 |
+ } |
|
| 788 | 899 |
|
| 900 |
+ private Boolean sysMsgTodaySendYn(String callTo) throws Exception {
|
|
| 901 |
+ SendLogVO sendLogVO = new SendLogVO(); |
|
| 902 |
+ sendLogVO.setReceive(callTo); |
|
| 903 |
+ |
|
| 904 |
+ return mjonMsgDataService.selectSysMsgTodaySendYn(sendLogVO); |
|
| 905 |
+ } |
|
| 789 | 906 |
|
| 907 |
+ private String selectSmsNotiIfOverFiftySetting() throws Exception {
|
|
| 908 |
+ JoinSettingVO joinSettingVO = egovSiteManagerService.selectAdminNotiDetail(); |
|
| 909 |
+ return joinSettingVO.getSmsNotiIfOverFifty(); |
|
| 910 |
+ } |
|
| 790 | 911 |
|
| 791 | 912 |
} |
--- src/main/java/itn/let/mjo/msgdata/service/MjonMsgDataService.java
+++ src/main/java/itn/let/mjo/msgdata/service/MjonMsgDataService.java
... | ... | @@ -190,7 +190,7 @@ |
| 190 | 190 |
|
| 191 | 191 |
public MjonMsgReturnVO sendSysMsgData(MjonMsgVO mjonMsgVO, HttpServletRequest request) throws Exception; |
| 192 | 192 |
|
| 193 |
- |
|
| 193 |
+ public Boolean selectSysMsgTodaySendYn(SendLogVO sendLogVO) throws Exception; |
|
| 194 | 194 |
|
| 195 | 195 |
|
| 196 | 196 |
} |
--- src/main/java/itn/let/mjo/msgdata/service/impl/MjonMsgDataDAO.java
+++ src/main/java/itn/let/mjo/msgdata/service/impl/MjonMsgDataDAO.java
... | ... | @@ -403,6 +403,10 @@ |
| 403 | 403 |
return result; |
| 404 | 404 |
} |
| 405 | 405 |
|
| 406 |
+ public Boolean selectSysMsgTodaySendYn(SendLogVO sendLogVO) throws Exception{
|
|
| 407 |
+ return (Boolean) select("mjonMsgDataDAO.selectSysMsgTodaySendYn",sendLogVO);
|
|
| 408 |
+ } |
|
| 409 |
+ |
|
| 406 | 410 |
|
| 407 | 411 |
/** |
| 408 | 412 |
* 다량 데이터를 Batch 처리로 MJ_MSG_DATA 테이블에 INSERT |
--- src/main/java/itn/let/mjo/msgdata/service/impl/MjonMsgDataServiceImpl.java
+++ src/main/java/itn/let/mjo/msgdata/service/impl/MjonMsgDataServiceImpl.java
... | ... | @@ -4187,6 +4187,13 @@ |
| 4187 | 4187 |
// 총 발송 건수 |
| 4188 | 4188 |
returnMap.put("resultSts", instTotalCnt);
|
| 4189 | 4189 |
|
| 4190 |
+ try {
|
|
| 4191 |
+ //50건이상 문자발송 시 안내메시지 전송 |
|
| 4192 |
+ mjonCommon.sendMessagesIfOverFifty(instTotalCnt, mjonMsgVO.getCallFrom()); |
|
| 4193 |
+ } catch (Exception e) {
|
|
| 4194 |
+ System.out.println("sendMessagesIfOverFifty method exception.");
|
|
| 4195 |
+ } |
|
| 4196 |
+ |
|
| 4190 | 4197 |
// TEST발송 시 발송 후 캐시가 있어야함. |
| 4191 | 4198 |
returnMap.put("afterCash", priceAndPoint.getBefCash(userId));
|
| 4192 | 4199 |
// |
... | ... | @@ -5148,4 +5155,9 @@ |
| 5148 | 5155 |
return returnVO; |
| 5149 | 5156 |
} |
| 5150 | 5157 |
|
| 5158 |
+ @Override |
|
| 5159 |
+ public Boolean selectSysMsgTodaySendYn(SendLogVO sendLogVO) throws Exception{
|
|
| 5160 |
+ return mjonMsgDataDAO.selectSysMsgTodaySendYn(sendLogVO); |
|
| 5161 |
+ } |
|
| 5162 |
+ |
|
| 5151 | 5163 |
} |
--- src/main/java/itn/let/sym/site/service/JoinSettingVO.java
+++ src/main/java/itn/let/sym/site/service/JoinSettingVO.java
... | ... | @@ -65,6 +65,7 @@ |
| 65 | 65 |
private String slackNoti; //관리자 SLACK 알림 여부 |
| 66 | 66 |
private String smishingNoti; //첫결제(카드제외) 스미싱의심 알림 여부 |
| 67 | 67 |
private String holiSmishingNoti; //야간 스미싱알림 여부 |
| 68 |
+ private String smsNotiIfOverFifty; //50건이상 문자발송 시 안내문자 발송 |
|
| 68 | 69 |
|
| 69 | 70 |
|
| 70 | 71 |
} |
--- src/main/java/itn/let/uat/uia/web/SendLogVO.java
+++ src/main/java/itn/let/uat/uia/web/SendLogVO.java
... | ... | @@ -19,6 +19,8 @@ |
| 19 | 19 |
/*내용*/ |
| 20 | 20 |
private String contents; |
| 21 | 21 |
|
| 22 |
+ private String sendMsgType; |
|
| 23 |
+ |
|
| 22 | 24 |
|
| 23 | 25 |
public String getSendId() {
|
| 24 | 26 |
return sendId; |
... | ... | @@ -62,5 +64,13 @@ |
| 62 | 64 |
public void setContents(String contents) {
|
| 63 | 65 |
this.contents = contents; |
| 64 | 66 |
} |
| 67 |
+ public String getSendMsgType() {
|
|
| 68 |
+ return sendMsgType; |
|
| 69 |
+ } |
|
| 70 |
+ public void setSendMsgType(String sendMsgType) {
|
|
| 71 |
+ this.sendMsgType = sendMsgType; |
|
| 72 |
+ } |
|
| 73 |
+ |
|
| 74 |
+ |
|
| 65 | 75 |
|
| 66 | 76 |
} |
--- src/main/resources/egovframework/spring/com/context-security.xml
+++ src/main/resources/egovframework/spring/com/context-security.xml
... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 |
xmlns:security="http://www.springframework.org/schema/security" |
| 5 | 5 |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd |
| 6 | 6 |
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.2.xsd |
| 7 |
- http://www.egovframe.go.kr/schema/egov-security http://www.egovframe.go.kr/schema/egov-security/egov-security-3.7.xsd"> |
|
| 7 |
+ http://www.egovframe.go.kr/schema/egov-security http://maven.egovframe.go.kr/schema/egov-security/egov-security-3.7.xsd"> |
|
| 8 | 8 |
|
| 9 | 9 |
<security:http pattern="/css/**" security="none"/> |
| 10 | 10 |
<security:http pattern="/html/**" security="none"/> |
--- src/main/resources/egovframework/sqlmap/let/msg/MjonMsgData_SQL_mysql.xml
+++ src/main/resources/egovframework/sqlmap/let/msg/MjonMsgData_SQL_mysql.xml
... | ... | @@ -3733,7 +3733,8 @@ |
| 3733 | 3733 |
RECEIVE, |
| 3734 | 3734 |
FRST_SEND_PNTTM, |
| 3735 | 3735 |
CHECK_NO, |
| 3736 |
- CONTENTS |
|
| 3736 |
+ CONTENTS, |
|
| 3737 |
+ SEND_MSG_TYPE |
|
| 3737 | 3738 |
) |
| 3738 | 3739 |
|
| 3739 | 3740 |
|
... | ... | @@ -3746,7 +3747,8 @@ |
| 3746 | 3747 |
#receive#, |
| 3747 | 3748 |
now(), |
| 3748 | 3749 |
#checkNo#, |
| 3749 |
- #contents# |
|
| 3750 |
+ #contents#, |
|
| 3751 |
+ #sendMsgType# |
|
| 3750 | 3752 |
) |
| 3751 | 3753 |
</insert> |
| 3752 | 3754 |
|
... | ... | @@ -8294,5 +8296,19 @@ |
| 8294 | 8296 |
|
| 8295 | 8297 |
</delete> |
| 8296 | 8298 |
|
| 8299 |
+ <select id="mjonMsgDataDAO.selectSysMsgTodaySendYn" parameterClass="SendLogVO" resultClass="boolean"> |
|
| 8300 |
+ SELECT |
|
| 8301 |
+ COUNT(1) > 1 AS todaySendYn |
|
| 8302 |
+ FROM |
|
| 8303 |
+ mj_system_send a |
|
| 8304 |
+ WHERE |
|
| 8305 |
+ RECEIVE = #receive# |
|
| 8306 |
+ <![CDATA[ |
|
| 8307 |
+ AND FRST_SEND_PNTTM >= CURDATE() |
|
| 8308 |
+ AND FRST_SEND_PNTTM < CURDATE() + INTERVAL 1 DAY |
|
| 8309 |
+ ]]> |
|
| 8310 |
+ AND SEND_MSG_TYPE = '01' |
|
| 8311 |
+ </select> |
|
| 8312 |
+ |
|
| 8297 | 8313 |
</sqlMap> |
| 8298 | 8314 |
|
--- src/main/resources/egovframework/sqlmap/let/sym/site/EgovSiteManage_SQL_Mysql.xml
+++ src/main/resources/egovframework/sqlmap/let/sym/site/EgovSiteManage_SQL_Mysql.xml
... | ... | @@ -980,6 +980,7 @@ |
| 980 | 980 |
IFNULL(SLACK_NOTI, 'N') AS slackNoti, |
| 981 | 981 |
IFNULL(SMISHING_NOTI, 'N') AS smishingNoti, |
| 982 | 982 |
IFNULL(HOLI_SMISHING_NOTI, 'N') AS holiSmishingNoti, |
| 983 |
+ IFNULL(SMS_NOTI_IF_OVER_FIFTY, 'N') AS smsNotiIfOverFifty, |
|
| 983 | 984 |
LAST_UPDUSR_ID AS lasUpdusrId, |
| 984 | 985 |
LAST_UPDT_PNTTM AS lastUpdtPnttm |
| 985 | 986 |
FROM MJ_MBER_SETTING |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?