--- pom.xml
+++ pom.xml
... | ... | @@ -144,11 +144,12 @@ |
| 144 | 144 |
<version>1.1.2</version> |
| 145 | 145 |
</dependency> |
| 146 | 146 |
|
| 147 |
- <dependency> |
|
| 148 |
- <groupId>cglib</groupId> |
|
| 149 |
- <artifactId>cglib</artifactId> |
|
| 150 |
- <version>3.1</version> |
|
| 151 |
- </dependency> |
|
| 147 |
+ <!-- https://mvnrepository.com/artifact/cglib/cglib --> |
|
| 148 |
+ <dependency> |
|
| 149 |
+ <groupId>cglib</groupId> |
|
| 150 |
+ <artifactId>cglib</artifactId> |
|
| 151 |
+ <version>3.3.0</version> |
|
| 152 |
+ </dependency> |
|
| 152 | 153 |
|
| 153 | 154 |
<dependency> |
| 154 | 155 |
<groupId>org.antlr</groupId> |
--- src/main/java/itn/com/cmm/util/MsgSendUtils.java
+++ src/main/java/itn/com/cmm/util/MsgSendUtils.java
... | ... | @@ -23,6 +23,7 @@ |
| 23 | 23 |
import itn.com.cmm.OptimalMsgResultDTO; |
| 24 | 24 |
import itn.let.mail.service.StatusResponse; |
| 25 | 25 |
import itn.let.mjo.event.service.MjonEventVO; |
| 26 |
+import itn.let.mjo.mjocommon.MjonCommon; |
|
| 26 | 27 |
import itn.let.mjo.msg.service.MjonMsgVO; |
| 27 | 28 |
import itn.let.mjo.msgagent.service.MjonMsgAgentStsVO; |
| 28 | 29 |
import itn.let.mjo.spammsg.web.ComGetSpamStringParser; |
... | ... | @@ -55,26 +56,6 @@ |
| 55 | 56 |
// 이벤트 최저 잔액 |
| 56 | 57 |
public static final double MIN_EVENT_REMAIN_CASH = 7.5; // 이벤트 최소 잔액 |
| 57 | 58 |
|
| 58 |
- /** |
|
| 59 |
- * @methodName : getSmsTxtBytes |
|
| 60 |
- * @author : 이호영 |
|
| 61 |
- * @date : 2024.09.23 |
|
| 62 |
- * @description : sms 텍스트 바이트 계산 후 return; |
|
| 63 |
- * @param smsTxt |
|
| 64 |
- * @return |
|
| 65 |
- * @throws UnsupportedEncodingException |
|
| 66 |
- */ |
|
| 67 |
- public static int getSmsTxtBytes(String smsTxt) throws UnsupportedEncodingException { //문자열 길이 체크 해주기
|
|
| 68 |
- int smsBytes = 0; |
|
| 69 |
- //문자 바이트 계산에 필요한 캐릭터 셋 : 한글 2Byte로 계산 |
|
| 70 |
- String charset = "euc-kr"; |
|
| 71 |
- if(StringUtils.isNotEmpty(smsTxt)) {
|
|
| 72 |
- String smsCont = smsTxt.replace("\r\n", "\n");
|
|
| 73 |
- smsBytes = smsCont.getBytes(charset).length; |
|
| 74 |
- } |
|
| 75 |
-// log.info(" + smsBytes :: [{}]", smsBytes);
|
|
| 76 |
- return smsBytes; |
|
| 77 |
- } |
|
| 78 | 59 |
|
| 79 | 60 |
/** |
| 80 | 61 |
* @methodName : getMsgType |
... | ... | @@ -96,7 +77,7 @@ |
| 96 | 77 |
// msgType = "4"; |
| 97 | 78 |
// } |
| 98 | 79 |
|
| 99 |
- int smsTxtByte = getSmsTxtBytes(p_smsTxt); |
|
| 80 |
+ int smsTxtByte = MjonCommon.getSmsTxtBytes(p_smsTxt); |
|
| 100 | 81 |
String msgType = SHORT_MSG_TYPE; |
| 101 | 82 |
|
| 102 | 83 |
// 1. 2000 Byte 초과는 에러 처리 |
... | ... | @@ -648,7 +629,7 @@ |
| 648 | 629 |
// 각 가격을 합산 |
| 649 | 630 |
totalPrice += Float.parseFloat(eachPrice); |
| 650 | 631 |
} |
| 651 |
- |
|
| 632 |
+ mjonMsgVO.setTotalPrice(totalPrice); |
|
| 652 | 633 |
|
| 653 | 634 |
} |
| 654 | 635 |
|
+++ src/main/java/itn/com/cmm/util/SlackMessageFormatUtil.java
... | ... | @@ -0,0 +1,144 @@ |
| 1 | +package itn.com.cmm.util; | |
| 2 | + | |
| 3 | +import org.apache.commons.lang3.StringUtils; | |
| 4 | + | |
| 5 | +import itn.let.kakao.kakaoComm.KakaoVO; | |
| 6 | +import itn.let.mjo.msg.service.MjonMsgVO; | |
| 7 | + | |
| 8 | +public class SlackMessageFormatUtil { | |
| 9 | + | |
| 10 | + private static final String PREFIX_SMISHING = "[스미싱의심]"; | |
| 11 | + private static final String PREFIX_RESERVE = "[예약]"; | |
| 12 | + private static final String PREFIX_IMAGE = "그림문자 "; | |
| 13 | + | |
| 14 | + /** | |
| 15 | + * 일반 SMS 메시지 텍스트 포맷팅 | |
| 16 | + */ | |
| 17 | + public static String formatSmsText(MjonMsgVO mjonMsgVO) { | |
| 18 | + String smsTxt = mjonMsgVO.getSmsTxt(); | |
| 19 | + String reserveYn = safeGetString(mjonMsgVO.getReserveYn()); | |
| 20 | + String delayYn = safeGetString(mjonMsgVO.getDelayYn()); | |
| 21 | + String smishingYn = safeGetString(mjonMsgVO.getSmishingYn()); | |
| 22 | + | |
| 23 | + // 공통 텍스트 포맷팅 로직 적용 | |
| 24 | + smsTxt = formatMessagePrefix(smsTxt, reserveYn, | |
| 25 | + "Y".equals(smishingYn) || "Y".equals(delayYn)); | |
| 26 | + | |
| 27 | + // 그림 문자 처리 (SMS 전용 로직) | |
| 28 | + int fileCount = parseIntOrDefault(mjonMsgVO.getFileCnt(), 0); | |
| 29 | + if ("6".equals(mjonMsgVO.getMsgType()) && fileCount > 0 && StringUtils.isEmpty(smsTxt)) { | |
| 30 | + smsTxt = "그림문자 " + smsTxt; | |
| 31 | + } | |
| 32 | + | |
| 33 | + return smsTxt; | |
| 34 | + } | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * 카카오톡 메시지 텍스트 포맷팅 | |
| 38 | + */ | |
| 39 | + public static String formatKakaoText(KakaoVO kakaoVO) { | |
| 40 | + String smsTxt = kakaoVO.getTemplateContent(); | |
| 41 | + String reserveYn = safeGetString(kakaoVO.getReserveYn()); | |
| 42 | + String atDelayYn = safeGetString(kakaoVO.getAtDelayYn()); | |
| 43 | + | |
| 44 | + // 공통 텍스트 포맷팅 로직 적용 | |
| 45 | + return formatMessagePrefix(smsTxt, reserveYn, "Y".equals(atDelayYn)); | |
| 46 | + } | |
| 47 | + | |
| 48 | + | |
| 49 | + public static String formatSandName(MjonMsgVO mjonMsgVO) { | |
| 50 | + String userId = mjonMsgVO.getUserId(); | |
| 51 | + String callFrom = mjonMsgVO.getCallFrom(); | |
| 52 | + String msgType = getMessageTypeLabel(mjonMsgVO.getMsgType(), mjonMsgVO.getFileCnt()); | |
| 53 | + return String.format("[%s][%s]%s", userId, callFrom, msgType); | |
| 54 | + } | |
| 55 | + | |
| 56 | + /** | |
| 57 | + * 메시지 접두사 포맷팅 공통 로직 (예약 및 스미싱 의심 접두사 처리) | |
| 58 | + * | |
| 59 | + * @param messageText 원본 메시지 텍스트 | |
| 60 | + * @param reserveYn 예약 여부 | |
| 61 | + * @param isSmishing 스미싱 의심 여부 | |
| 62 | + * @return 포맷팅된 메시지 텍스트 | |
| 63 | + */ | |
| 64 | + public static String formatMessagePrefix(String messageText, String reserveYn, boolean isSmishing) { | |
| 65 | + if ("Y".equals(reserveYn)) { | |
| 66 | + return isSmishing ? PREFIX_SMISHING + PREFIX_RESERVE + messageText : PREFIX_RESERVE + messageText; | |
| 67 | + } else if (isSmishing) { | |
| 68 | + return PREFIX_SMISHING + messageText; | |
| 69 | + } | |
| 70 | + return messageText; | |
| 71 | + } | |
| 72 | + | |
| 73 | + /** | |
| 74 | + * @카카오톡용 sandName 포맷팅 메서드 | |
| 75 | + */ | |
| 76 | + public static String formatKakaoSandName(KakaoVO kakaoVO) { | |
| 77 | + String userId = kakaoVO.getUserId(); | |
| 78 | + String callFrom = kakaoVO.getCallFrom(); | |
| 79 | + String msgType = getKakaoMessageTypeLabel(kakaoVO.getMsgType()); | |
| 80 | + return String.format("[%s][%s]%s", userId, callFrom, msgType); | |
| 81 | + } | |
| 82 | + | |
| 83 | + /** | |
| 84 | + * 메시지 타입 레이블 반환 (SMS 전용) | |
| 85 | + * | |
| 86 | + * @param msgType 메시지 타입 | |
| 87 | + * @param fileCnt 파일 개수 | |
| 88 | + * @return 메시지 타입 레이블 | |
| 89 | + */ | |
| 90 | + public static String getMessageTypeLabel(String msgType, String fileCnt) { | |
| 91 | + int fileCount = parseIntOrDefault(fileCnt, 0); | |
| 92 | + | |
| 93 | + switch (msgType) { | |
| 94 | + case "4": | |
| 95 | + return "[단문]"; | |
| 96 | + case "6": | |
| 97 | + return fileCount == 0 ? "[장문]" : "[그림]"; | |
| 98 | + default: | |
| 99 | + return ""; | |
| 100 | + } | |
| 101 | + } | |
| 102 | + | |
| 103 | + /** | |
| 104 | + * 카카오톡 메시지 타입 레이블 반환 | |
| 105 | + * | |
| 106 | + * @param msgType 메시지 타입 | |
| 107 | + * @return 메시지 타입 레이블 | |
| 108 | + */ | |
| 109 | + public static String getKakaoMessageTypeLabel(String msgType) { | |
| 110 | + switch (msgType) { | |
| 111 | + case "8": | |
| 112 | + return "[알림톡]"; | |
| 113 | + case "9": | |
| 114 | + return "[친구톡]"; | |
| 115 | + default: | |
| 116 | + return ""; | |
| 117 | + } | |
| 118 | + } | |
| 119 | + | |
| 120 | + /** | |
| 121 | + * 정수로 변환, 변환 실패 시 기본값 반환 | |
| 122 | + * | |
| 123 | + * @param value 변환할 문자열 | |
| 124 | + * @param defaultValue 기본값 | |
| 125 | + * @return 변환된 정수 또는 기본값 | |
| 126 | + */ | |
| 127 | + public static int parseIntOrDefault(String value, int defaultValue) { | |
| 128 | + try { | |
| 129 | + return Integer.parseInt(value); | |
| 130 | + } catch (NumberFormatException e) { | |
| 131 | + return defaultValue; | |
| 132 | + } | |
| 133 | + } | |
| 134 | + | |
| 135 | + /** | |
| 136 | + * 안전하게 문자열 가져오기 (null 체크) | |
| 137 | + * | |
| 138 | + * @param value 원본 문자열 | |
| 139 | + * @return 원본 문자열 또는 빈 문자열 | |
| 140 | + */ | |
| 141 | + public static String safeGetString(String value) { | |
| 142 | + return value == null ? "" : value; | |
| 143 | + } | |
| 144 | +} |
--- src/main/java/itn/let/kakao/kakaoComm/KakaoButtonVO.java
+++ src/main/java/itn/let/kakao/kakaoComm/KakaoButtonVO.java
... | ... | @@ -1,5 +1,9 @@ |
| 1 | 1 |
package itn.let.kakao.kakaoComm; |
| 2 | 2 |
|
| 3 |
+import lombok.Getter; |
|
| 4 |
+import lombok.Setter; |
|
| 5 |
+import lombok.ToString; |
|
| 6 |
+ |
|
| 3 | 7 |
/** |
| 4 | 8 |
* @FileName : KakaoButtonVO.java |
| 5 | 9 |
* @Project : mjon |
... | ... | @@ -8,6 +12,9 @@ |
| 8 | 12 |
|
| 9 | 13 |
* @프로그램 설명 : button, quickReplies 변수 |
| 10 | 14 |
*/ |
| 15 |
+@ToString |
|
| 16 |
+@Getter |
|
| 17 |
+@Setter |
|
| 11 | 18 |
public class KakaoButtonVO {
|
| 12 | 19 |
|
| 13 | 20 |
private String name = ""; // 버튼명 - linkType “AC” 선택 시 버튼명은 “채널추가” 로 고정 |
... | ... | @@ -17,49 +24,5 @@ |
| 17 | 24 |
private String linkMo = ""; // 모바일 웹 링크 주소 (WL 사용시 필수) |
| 18 | 25 |
private String linkPc = ""; // PC 웹 링크 주소 (WL 사용시 선택) |
| 19 | 26 |
private String pluginId = ""; // 플러그인 ID (P1, P2, P3 사용시 필수) |
| 20 |
- |
|
| 21 |
- public String getName() {
|
|
| 22 |
- return name; |
|
| 23 |
- } |
|
| 24 |
- public void setName(String name) {
|
|
| 25 |
- this.name = name; |
|
| 26 |
- } |
|
| 27 |
- public String getLinkType() {
|
|
| 28 |
- return linkType; |
|
| 29 |
- } |
|
| 30 |
- public void setLinkType(String linkType) {
|
|
| 31 |
- this.linkType = linkType; |
|
| 32 |
- } |
|
| 33 |
- public String getLinkAnd() {
|
|
| 34 |
- return linkAnd; |
|
| 35 |
- } |
|
| 36 |
- public void setLinkAnd(String linkAnd) {
|
|
| 37 |
- this.linkAnd = linkAnd; |
|
| 38 |
- } |
|
| 39 |
- public String getLinkIos() {
|
|
| 40 |
- return linkIos; |
|
| 41 |
- } |
|
| 42 |
- public void setLinkIos(String linkIos) {
|
|
| 43 |
- this.linkIos = linkIos; |
|
| 44 |
- } |
|
| 45 |
- public String getLinkMo() {
|
|
| 46 |
- return linkMo; |
|
| 47 |
- } |
|
| 48 |
- public void setLinkMo(String linkMo) {
|
|
| 49 |
- this.linkMo = linkMo; |
|
| 50 |
- } |
|
| 51 |
- public String getLinkPc() {
|
|
| 52 |
- return linkPc; |
|
| 53 |
- } |
|
| 54 |
- public void setLinkPc(String linkPc) {
|
|
| 55 |
- this.linkPc = linkPc; |
|
| 56 |
- } |
|
| 57 |
- public String getPluginId() {
|
|
| 58 |
- return pluginId; |
|
| 59 |
- } |
|
| 60 |
- public void setPluginId(String pluginId) {
|
|
| 61 |
- this.pluginId = pluginId; |
|
| 62 |
- } |
|
| 63 |
- |
|
| 64 | 27 |
|
| 65 | 28 |
} |
--- src/main/java/itn/let/kakao/kakaoComm/KakaoCommentVO.java
+++ src/main/java/itn/let/kakao/kakaoComm/KakaoCommentVO.java
... | ... | @@ -3,6 +3,10 @@ |
| 3 | 3 |
import java.util.ArrayList; |
| 4 | 4 |
import java.util.List; |
| 5 | 5 |
|
| 6 |
+import lombok.Getter; |
|
| 7 |
+import lombok.Setter; |
|
| 8 |
+import lombok.ToString; |
|
| 9 |
+ |
|
| 6 | 10 |
/** |
| 7 | 11 |
* @FileName : KakaoCommentVO.java |
| 8 | 12 |
* @Project : mjon |
... | ... | @@ -11,6 +15,9 @@ |
| 11 | 15 |
|
| 12 | 16 |
* @프로그램 설명 : comment 변수 |
| 13 | 17 |
*/ |
| 18 |
+@ToString |
|
| 19 |
+@Getter |
|
| 20 |
+@Setter |
|
| 14 | 21 |
public class KakaoCommentVO {
|
| 15 | 22 |
|
| 16 | 23 |
private String content = ""; // 댓글 본분 |
... | ... | @@ -26,60 +33,4 @@ |
| 26 | 33 |
private String originalFileName = ""; |
| 27 | 34 |
|
| 28 | 35 |
private String filePath = ""; |
| 29 |
- |
|
| 30 |
- public String getContent() {
|
|
| 31 |
- return content; |
|
| 32 |
- } |
|
| 33 |
- |
|
| 34 |
- public void setContent(String content) {
|
|
| 35 |
- this.content = content; |
|
| 36 |
- } |
|
| 37 |
- |
|
| 38 |
- public String getCreatedAt() {
|
|
| 39 |
- return createdAt; |
|
| 40 |
- } |
|
| 41 |
- |
|
| 42 |
- public void setCreatedAt(String createdAt) {
|
|
| 43 |
- this.createdAt = createdAt; |
|
| 44 |
- } |
|
| 45 |
- |
|
| 46 |
- public String getStatus() {
|
|
| 47 |
- return status; |
|
| 48 |
- } |
|
| 49 |
- |
|
| 50 |
- public void setStatus(String status) {
|
|
| 51 |
- this.status = status; |
|
| 52 |
- } |
|
| 53 |
- |
|
| 54 |
- public String getUserName() {
|
|
| 55 |
- return userName; |
|
| 56 |
- } |
|
| 57 |
- |
|
| 58 |
- public void setUserName(String userName) {
|
|
| 59 |
- this.userName = userName; |
|
| 60 |
- } |
|
| 61 |
- |
|
| 62 |
- public String getOriginalFileName() {
|
|
| 63 |
- return originalFileName; |
|
| 64 |
- } |
|
| 65 |
- |
|
| 66 |
- public void setOriginalFileName(String originalFileName) {
|
|
| 67 |
- this.originalFileName = originalFileName; |
|
| 68 |
- } |
|
| 69 |
- |
|
| 70 |
- public String getFilePath() {
|
|
| 71 |
- return filePath; |
|
| 72 |
- } |
|
| 73 |
- |
|
| 74 |
- public void setFilePath(String filePath) {
|
|
| 75 |
- this.filePath = filePath; |
|
| 76 |
- } |
|
| 77 |
- |
|
| 78 |
- public List<KakaoCommentVO> getAttachFileList() {
|
|
| 79 |
- return attachFileList; |
|
| 80 |
- } |
|
| 81 |
- |
|
| 82 |
- public void setAttachFileList(List<KakaoCommentVO> attachFileList) {
|
|
| 83 |
- this.attachFileList = attachFileList; |
|
| 84 |
- } |
|
| 85 | 36 |
} |
--- src/main/java/itn/let/kakao/kakaoComm/KakaoReturnVO.java
+++ src/main/java/itn/let/kakao/kakaoComm/KakaoReturnVO.java
... | ... | @@ -4,6 +4,9 @@ |
| 4 | 4 |
import java.util.List; |
| 5 | 5 |
|
| 6 | 6 |
import itn.com.cmm.ComDefaultVO; |
| 7 |
+import lombok.Getter; |
|
| 8 |
+import lombok.Setter; |
|
| 9 |
+import lombok.ToString; |
|
| 7 | 10 |
|
| 8 | 11 |
/** |
| 9 | 12 |
* @FileName : KakaoReturnVO.java |
... | ... | @@ -13,6 +16,9 @@ |
| 13 | 16 |
|
| 14 | 17 |
* @프로그램 설명 : 카카오톡 리턴 변수 목록 |
| 15 | 18 |
*/ |
| 19 |
+@Getter |
|
| 20 |
+@Setter |
|
| 21 |
+@ToString |
|
| 16 | 22 |
public class KakaoReturnVO extends ComDefaultVO{
|
| 17 | 23 |
|
| 18 | 24 |
private static final long serialVersionUID = 1L; |
... | ... | @@ -130,415 +136,4 @@ |
| 130 | 136 |
|
| 131 | 137 |
private String businessType = ""; //카카오톡 채널 비즈니스 인증 타입 |
| 132 | 138 |
|
| 133 |
- public static long getSerialversionuid() {
|
|
| 134 |
- return serialVersionUID; |
|
| 135 |
- } |
|
| 136 |
- |
|
| 137 |
- public String getBizReturnMsg() {
|
|
| 138 |
- return bizReturnMsg; |
|
| 139 |
- } |
|
| 140 |
- |
|
| 141 |
- public void setBizReturnMsg(String bizReturnMsg) {
|
|
| 142 |
- this.bizReturnMsg = bizReturnMsg; |
|
| 143 |
- } |
|
| 144 |
- |
|
| 145 |
- public String getBizReturnCode() {
|
|
| 146 |
- return bizReturnCode; |
|
| 147 |
- } |
|
| 148 |
- |
|
| 149 |
- public void setBizReturnCode(String bizReturnCode) {
|
|
| 150 |
- this.bizReturnCode = bizReturnCode; |
|
| 151 |
- } |
|
| 152 |
- |
|
| 153 |
- public String getProfileId() {
|
|
| 154 |
- return profileId; |
|
| 155 |
- } |
|
| 156 |
- |
|
| 157 |
- public void setProfileId(String profileId) {
|
|
| 158 |
- this.profileId = profileId; |
|
| 159 |
- } |
|
| 160 |
- |
|
| 161 |
- public String getTotalCount() {
|
|
| 162 |
- return totalCount; |
|
| 163 |
- } |
|
| 164 |
- |
|
| 165 |
- public void setTotalCount(String totalCount) {
|
|
| 166 |
- this.totalCount = totalCount; |
|
| 167 |
- } |
|
| 168 |
- |
|
| 169 |
- public String getTotalPage() {
|
|
| 170 |
- return totalPage; |
|
| 171 |
- } |
|
| 172 |
- |
|
| 173 |
- public void setTotalPage(String totalPage) {
|
|
| 174 |
- this.totalPage = totalPage; |
|
| 175 |
- } |
|
| 176 |
- |
|
| 177 |
- public String getCurrentPage() {
|
|
| 178 |
- return currentPage; |
|
| 179 |
- } |
|
| 180 |
- |
|
| 181 |
- public void setCurrentPage(String currentPage) {
|
|
| 182 |
- this.currentPage = currentPage; |
|
| 183 |
- } |
|
| 184 |
- |
|
| 185 |
- public String getSenderKey() {
|
|
| 186 |
- return senderKey; |
|
| 187 |
- } |
|
| 188 |
- |
|
| 189 |
- public void setSenderKey(String senderKey) {
|
|
| 190 |
- this.senderKey = senderKey; |
|
| 191 |
- } |
|
| 192 |
- |
|
| 193 |
- public String getSenderKeyType() {
|
|
| 194 |
- return senderKeyType; |
|
| 195 |
- } |
|
| 196 |
- |
|
| 197 |
- public void setSenderKeyType(String senderKeyType) {
|
|
| 198 |
- this.senderKeyType = senderKeyType; |
|
| 199 |
- } |
|
| 200 |
- |
|
| 201 |
- public String getTemplateCode() {
|
|
| 202 |
- return templateCode; |
|
| 203 |
- } |
|
| 204 |
- |
|
| 205 |
- public void setTemplateCode(String templateCode) {
|
|
| 206 |
- this.templateCode = templateCode; |
|
| 207 |
- } |
|
| 208 |
- |
|
| 209 |
- public String getTemplateName() {
|
|
| 210 |
- return templateName; |
|
| 211 |
- } |
|
| 212 |
- |
|
| 213 |
- public void setTemplateName(String templateName) {
|
|
| 214 |
- this.templateName = templateName; |
|
| 215 |
- } |
|
| 216 |
- |
|
| 217 |
- public String getCategoryCode() {
|
|
| 218 |
- return categoryCode; |
|
| 219 |
- } |
|
| 220 |
- |
|
| 221 |
- public void setCategoryCode(String categoryCode) {
|
|
| 222 |
- this.categoryCode = categoryCode; |
|
| 223 |
- } |
|
| 224 |
- |
|
| 225 |
- public String getCreatedAt() {
|
|
| 226 |
- return createdAt; |
|
| 227 |
- } |
|
| 228 |
- |
|
| 229 |
- public void setCreatedAt(String createdAt) {
|
|
| 230 |
- this.createdAt = createdAt; |
|
| 231 |
- } |
|
| 232 |
- |
|
| 233 |
- public String getModifiedAt() {
|
|
| 234 |
- return modifiedAt; |
|
| 235 |
- } |
|
| 236 |
- |
|
| 237 |
- public void setModifiedAt(String modifiedAt) {
|
|
| 238 |
- this.modifiedAt = modifiedAt; |
|
| 239 |
- } |
|
| 240 |
- |
|
| 241 |
- public String getServiceStatus() {
|
|
| 242 |
- return serviceStatus; |
|
| 243 |
- } |
|
| 244 |
- |
|
| 245 |
- public void setServiceStatus(String serviceStatus) {
|
|
| 246 |
- this.serviceStatus = serviceStatus; |
|
| 247 |
- } |
|
| 248 |
- |
|
| 249 |
- public List<KakaoReturnVO> getTemplatList() {
|
|
| 250 |
- return templatList; |
|
| 251 |
- } |
|
| 252 |
- |
|
| 253 |
- public void setTemplatList(List<KakaoReturnVO> templatList) {
|
|
| 254 |
- this.templatList = templatList; |
|
| 255 |
- } |
|
| 256 |
- |
|
| 257 |
- public String getUuid() {
|
|
| 258 |
- return uuid; |
|
| 259 |
- } |
|
| 260 |
- |
|
| 261 |
- public void setUuid(String uuid) {
|
|
| 262 |
- this.uuid = uuid; |
|
| 263 |
- } |
|
| 264 |
- |
|
| 265 |
- public String getName() {
|
|
| 266 |
- return name; |
|
| 267 |
- } |
|
| 268 |
- |
|
| 269 |
- public void setName(String name) {
|
|
| 270 |
- this.name = name; |
|
| 271 |
- } |
|
| 272 |
- |
|
| 273 |
- public String getStatus() {
|
|
| 274 |
- return status; |
|
| 275 |
- } |
|
| 276 |
- |
|
| 277 |
- public void setStatus(String status) {
|
|
| 278 |
- this.status = status; |
|
| 279 |
- } |
|
| 280 |
- |
|
| 281 |
- public boolean isBlock() {
|
|
| 282 |
- return block; |
|
| 283 |
- } |
|
| 284 |
- |
|
| 285 |
- public void setBlock(boolean block) {
|
|
| 286 |
- this.block = block; |
|
| 287 |
- } |
|
| 288 |
- |
|
| 289 |
- public boolean isDormant() {
|
|
| 290 |
- return dormant; |
|
| 291 |
- } |
|
| 292 |
- |
|
| 293 |
- public void setDormant(boolean dormant) {
|
|
| 294 |
- this.dormant = dormant; |
|
| 295 |
- } |
|
| 296 |
- |
|
| 297 |
- public String getTitle() {
|
|
| 298 |
- return title; |
|
| 299 |
- } |
|
| 300 |
- |
|
| 301 |
- public void setTitle(String title) {
|
|
| 302 |
- this.title = title; |
|
| 303 |
- } |
|
| 304 |
- |
|
| 305 |
- public String getDescription() {
|
|
| 306 |
- return description; |
|
| 307 |
- } |
|
| 308 |
- |
|
| 309 |
- public void setDescription(String description) {
|
|
| 310 |
- this.description = description; |
|
| 311 |
- } |
|
| 312 |
- |
|
| 313 |
- public String getImageUrl() {
|
|
| 314 |
- return imageUrl; |
|
| 315 |
- } |
|
| 316 |
- |
|
| 317 |
- public void setImageUrl(String imageUrl) {
|
|
| 318 |
- this.imageUrl = imageUrl; |
|
| 319 |
- } |
|
| 320 |
- |
|
| 321 |
- public String getListTitle() {
|
|
| 322 |
- return listTitle; |
|
| 323 |
- } |
|
| 324 |
- |
|
| 325 |
- public void setListTitle(String listTitle) {
|
|
| 326 |
- this.listTitle = listTitle; |
|
| 327 |
- } |
|
| 328 |
- |
|
| 329 |
- public String getListDescription() {
|
|
| 330 |
- return listDescription; |
|
| 331 |
- } |
|
| 332 |
- |
|
| 333 |
- public void setListDescription(String listDescription) {
|
|
| 334 |
- this.listDescription = listDescription; |
|
| 335 |
- } |
|
| 336 |
- |
|
| 337 |
- public String getSumTitle() {
|
|
| 338 |
- return sumTitle; |
|
| 339 |
- } |
|
| 340 |
- |
|
| 341 |
- public void setSumTitle(String sumTitle) {
|
|
| 342 |
- this.sumTitle = sumTitle; |
|
| 343 |
- } |
|
| 344 |
- |
|
| 345 |
- public String getSumDescription() {
|
|
| 346 |
- return sumDescription; |
|
| 347 |
- } |
|
| 348 |
- |
|
| 349 |
- public void setSumDescription(String sumDescription) {
|
|
| 350 |
- this.sumDescription = sumDescription; |
|
| 351 |
- } |
|
| 352 |
- |
|
| 353 |
- public String getProfileStatus() {
|
|
| 354 |
- return profileStatus; |
|
| 355 |
- } |
|
| 356 |
- |
|
| 357 |
- public void setProfileStatus(String profileStatus) {
|
|
| 358 |
- this.profileStatus = profileStatus; |
|
| 359 |
- } |
|
| 360 |
- |
|
| 361 |
- public boolean isAlimtalk() {
|
|
| 362 |
- return alimtalk; |
|
| 363 |
- } |
|
| 364 |
- |
|
| 365 |
- public void setAlimtalk(boolean alimtalk) {
|
|
| 366 |
- this.alimtalk = alimtalk; |
|
| 367 |
- } |
|
| 368 |
- |
|
| 369 |
- public boolean isBizchat() {
|
|
| 370 |
- return bizchat; |
|
| 371 |
- } |
|
| 372 |
- |
|
| 373 |
- public void setBizchat(boolean bizchat) {
|
|
| 374 |
- this.bizchat = bizchat; |
|
| 375 |
- } |
|
| 376 |
- |
|
| 377 |
- public boolean isBrandtalk() {
|
|
| 378 |
- return brandtalk; |
|
| 379 |
- } |
|
| 380 |
- |
|
| 381 |
- public void setBrandtalk(boolean brandtalk) {
|
|
| 382 |
- this.brandtalk = brandtalk; |
|
| 383 |
- } |
|
| 384 |
- |
|
| 385 |
- public String getCommittalCompanyName() {
|
|
| 386 |
- return committalCompanyName; |
|
| 387 |
- } |
|
| 388 |
- |
|
| 389 |
- public void setCommittalCompanyName(String committalCompanyName) {
|
|
| 390 |
- this.committalCompanyName = committalCompanyName; |
|
| 391 |
- } |
|
| 392 |
- |
|
| 393 |
- public String getChannelKey() {
|
|
| 394 |
- return channelKey; |
|
| 395 |
- } |
|
| 396 |
- |
|
| 397 |
- public void setChannelKey(String channelKey) {
|
|
| 398 |
- this.channelKey = channelKey; |
|
| 399 |
- } |
|
| 400 |
- |
|
| 401 |
- public boolean isBusinessProfile() {
|
|
| 402 |
- return businessProfile; |
|
| 403 |
- } |
|
| 404 |
- |
|
| 405 |
- public void setBusinessProfile(boolean businessProfile) {
|
|
| 406 |
- this.businessProfile = businessProfile; |
|
| 407 |
- } |
|
| 408 |
- |
|
| 409 |
- public String getBusinessType() {
|
|
| 410 |
- return businessType; |
|
| 411 |
- } |
|
| 412 |
- |
|
| 413 |
- public void setBusinessType(String businessType) {
|
|
| 414 |
- this.businessType = businessType; |
|
| 415 |
- } |
|
| 416 |
- |
|
| 417 |
- public String getTemplateMessageType() {
|
|
| 418 |
- return templateMessageType; |
|
| 419 |
- } |
|
| 420 |
- |
|
| 421 |
- public void setTemplateMessageType(String templateMessageType) {
|
|
| 422 |
- this.templateMessageType = templateMessageType; |
|
| 423 |
- } |
|
| 424 |
- |
|
| 425 |
- public String getTemplateEmphasizeType() {
|
|
| 426 |
- return templateEmphasizeType; |
|
| 427 |
- } |
|
| 428 |
- |
|
| 429 |
- public void setTemplateEmphasizeType(String templateEmphasizeType) {
|
|
| 430 |
- this.templateEmphasizeType = templateEmphasizeType; |
|
| 431 |
- } |
|
| 432 |
- |
|
| 433 |
- public String getTemplateContent() {
|
|
| 434 |
- return templateContent; |
|
| 435 |
- } |
|
| 436 |
- |
|
| 437 |
- public void setTemplateContent(String templateContent) {
|
|
| 438 |
- this.templateContent = templateContent; |
|
| 439 |
- } |
|
| 440 |
- |
|
| 441 |
- public String getTemplateExtra() {
|
|
| 442 |
- return templateExtra; |
|
| 443 |
- } |
|
| 444 |
- |
|
| 445 |
- public void setTemplateExtra(String templateExtra) {
|
|
| 446 |
- this.templateExtra = templateExtra; |
|
| 447 |
- } |
|
| 448 |
- |
|
| 449 |
- public String getTemplateAd() {
|
|
| 450 |
- return templateAd; |
|
| 451 |
- } |
|
| 452 |
- |
|
| 453 |
- public void setTemplateAd(String templateAd) {
|
|
| 454 |
- this.templateAd = templateAd; |
|
| 455 |
- } |
|
| 456 |
- |
|
| 457 |
- public String getTemplateImageName() {
|
|
| 458 |
- return templateImageName; |
|
| 459 |
- } |
|
| 460 |
- |
|
| 461 |
- public void setTemplateImageName(String templateImageName) {
|
|
| 462 |
- this.templateImageName = templateImageName; |
|
| 463 |
- } |
|
| 464 |
- |
|
| 465 |
- public String getTemplateImageUrl() {
|
|
| 466 |
- return templateImageUrl; |
|
| 467 |
- } |
|
| 468 |
- |
|
| 469 |
- public void setTemplateImageUrl(String templateImageUrl) {
|
|
| 470 |
- this.templateImageUrl = templateImageUrl; |
|
| 471 |
- } |
|
| 472 |
- |
|
| 473 |
- public String getTemplateTitle() {
|
|
| 474 |
- return templateTitle; |
|
| 475 |
- } |
|
| 476 |
- |
|
| 477 |
- public void setTemplateTitle(String templateTitle) {
|
|
| 478 |
- this.templateTitle = templateTitle; |
|
| 479 |
- } |
|
| 480 |
- |
|
| 481 |
- public String getTemplateSubtitle() {
|
|
| 482 |
- return templateSubtitle; |
|
| 483 |
- } |
|
| 484 |
- |
|
| 485 |
- public void setTemplateSubtitle(String templateSubtitle) {
|
|
| 486 |
- this.templateSubtitle = templateSubtitle; |
|
| 487 |
- } |
|
| 488 |
- |
|
| 489 |
- public String getTemplateHeader() {
|
|
| 490 |
- return templateHeader; |
|
| 491 |
- } |
|
| 492 |
- |
|
| 493 |
- public void setTemplateHeader(String templateHeader) {
|
|
| 494 |
- this.templateHeader = templateHeader; |
|
| 495 |
- } |
|
| 496 |
- |
|
| 497 |
- public Boolean getSecurityFlag() {
|
|
| 498 |
- return securityFlag; |
|
| 499 |
- } |
|
| 500 |
- |
|
| 501 |
- public void setSecurityFlag(Boolean securityFlag) {
|
|
| 502 |
- this.securityFlag = securityFlag; |
|
| 503 |
- } |
|
| 504 |
- |
|
| 505 |
- public String getInspectionStatus() {
|
|
| 506 |
- return inspectionStatus; |
|
| 507 |
- } |
|
| 508 |
- |
|
| 509 |
- public void setInspectionStatus(String inspectionStatus) {
|
|
| 510 |
- this.inspectionStatus = inspectionStatus; |
|
| 511 |
- } |
|
| 512 |
- |
|
| 513 |
- public List<KakaoButtonVO> getButtonList() {
|
|
| 514 |
- return buttonList; |
|
| 515 |
- } |
|
| 516 |
- |
|
| 517 |
- public void setButtonList(List<KakaoButtonVO> buttonList) {
|
|
| 518 |
- this.buttonList = buttonList; |
|
| 519 |
- } |
|
| 520 |
- |
|
| 521 |
- public List<KakaoButtonVO> getQuickReplyList() {
|
|
| 522 |
- return quickReplyList; |
|
| 523 |
- } |
|
| 524 |
- |
|
| 525 |
- public void setQuickReplyList(List<KakaoButtonVO> quickReplyList) {
|
|
| 526 |
- this.quickReplyList = quickReplyList; |
|
| 527 |
- } |
|
| 528 |
- |
|
| 529 |
- public List<KakaoCommentVO> getCommentList() {
|
|
| 530 |
- return commentList; |
|
| 531 |
- } |
|
| 532 |
- |
|
| 533 |
- public void setCommentList(List<KakaoCommentVO> commentList) {
|
|
| 534 |
- this.commentList = commentList; |
|
| 535 |
- } |
|
| 536 |
- |
|
| 537 |
- public List<KakaoItemVO> getItemList() {
|
|
| 538 |
- return itemList; |
|
| 539 |
- } |
|
| 540 |
- |
|
| 541 |
- public void setItemList(List<KakaoItemVO> itemList) {
|
|
| 542 |
- this.itemList = itemList; |
|
| 543 |
- } |
|
| 544 | 139 |
} |
+++ src/main/java/itn/let/kakao/kakaoComm/KakaoSendAdvcVO.java
... | ... | @@ -0,0 +1,116 @@ |
| 1 | +package itn.let.kakao.kakaoComm; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | +import java.util.List; | |
| 5 | +import java.util.Map; | |
| 6 | + | |
| 7 | +import lombok.Getter; | |
| 8 | +import lombok.Setter; | |
| 9 | + | |
| 10 | +/** | |
| 11 | +* @FileName : KakaoSendVO.java | |
| 12 | +* @Project : mjon | |
| 13 | +* @Date : 2025. 3. 25. | |
| 14 | +* @작성자 : 이호영 | |
| 15 | + | |
| 16 | +* @프로그램 설명 : 문자온 발송부분만 ADVC | |
| 17 | +*/ | |
| 18 | +@Getter | |
| 19 | +@Setter | |
| 20 | +public class KakaoSendAdvcVO implements Serializable { | |
| 21 | + | |
| 22 | + | |
| 23 | + /** | |
| 24 | + * | |
| 25 | + */ | |
| 26 | + private static final long serialVersionUID = 343099046833205405L; | |
| 27 | + | |
| 28 | + // ===== | |
| 29 | + // Insert 데이터 | |
| 30 | + private String msgId; // 문자ID | |
| 31 | + private String msgGroupId; // 전송그룹ID | |
| 32 | + private String msgGroupCnt; // 전송그룹ID | |
| 33 | + private String userId; // 사용자ID | |
| 34 | + private String agentCode; // 전송사코드 | |
| 35 | + private String senderKey; // 발신프로필 키 | |
| 36 | + private String templateCode; // 템플릿 코드 | |
| 37 | + private String callTo; // 수신번호 | |
| 38 | + private String callFrom; // 발신번호 | |
| 39 | + private String msgType; // 메시지 타입 | |
| 40 | + private String templateContent; // 템플릿 내용 | |
| 41 | + private String templateTitle; // 템플릿 제목 | |
| 42 | + List<KakaoButtonVO> buttonList; // 템플릿 버튼 리스트 | |
| 43 | + private String subMsgSendYn; // 대체문자 전송 여부 | |
| 44 | + private String subMsgTxt; // 대체문자 내용 | |
| 45 | + private String subMsgType; // 대체문자 타입 | |
| 46 | + private String reqDate; // 예약일시 | |
| 47 | + | |
| 48 | + private String jsonStr; // jsonStr | |
| 49 | + | |
| 50 | + // ===== | |
| 51 | + // ===== | |
| 52 | + | |
| 53 | + private String eachPrice; // sms 단가 | |
| 54 | + private String smsPrice; // sms 단가 | |
| 55 | + private String mmsPrice; // mms 단가 | |
| 56 | + private String totPrice; // mms 단가 | |
| 57 | + private String befCash; // mms 단가 | |
| 58 | + private String befPoint; // mms 단가 | |
| 59 | + private String kakaoAtPrice; // 카카오 알림톡 단가 | |
| 60 | + private String bizJsonName; // 카카오 알림톡 단가 | |
| 61 | + private String reserveYn; // 카카오 알림톡 단가 | |
| 62 | + private String atDelayYn; // 카카오 알림톡 단가 | |
| 63 | + private String bizKakaoResendOrgnlTxt; // 카카오 알림톡 단가 | |
| 64 | + private String bizKakaoResendType; // 카카오 알림톡 단가 | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + @Override | |
| 72 | + public String toString() { | |
| 73 | + return "MsgSendVO[" + | |
| 74 | + "\n msgId=[" + msgId + "]" + | |
| 75 | + "\n , msgGroupId=[" + msgGroupId + "]" + | |
| 76 | + "\n , msgGroupCnt=[" + msgGroupCnt + "]" + | |
| 77 | + "\n , userId=[" + userId + "]" + | |
| 78 | + "\n , agentCode=[" + agentCode + "]" + | |
| 79 | + "\n , senderKey=[" + senderKey + "]" + | |
| 80 | + "\n , templateCode=[" + templateCode + "]" + | |
| 81 | + "\n , callTo=[" + callTo + "]" + | |
| 82 | + "\n , callFrom=[" + callFrom + "]" + | |
| 83 | + "\n , msgType=[" + msgType + "]" + | |
| 84 | + "\n , templateContent=[" + templateContent + "]" + | |
| 85 | + "\n , templateTitle=[" + templateTitle + "]" + | |
| 86 | + "\n , buttonList=[" + buttonList.toString() + "]" + | |
| 87 | + "\n , subMsgSendYn=[" + subMsgSendYn + "]" + | |
| 88 | + "\n , subMsgTxt=[" + subMsgTxt + "]" + | |
| 89 | + "\n , subMsgType=[" + subMsgType + "]" + | |
| 90 | + "\n , reqDate=[" + reqDate + "]" + | |
| 91 | + "\n , jsonStr=[" + jsonStr + "]" + | |
| 92 | + "\n , ==== MJ_MSG_DATA INSERT DATA END =======" + | |
| 93 | + "\n " + | |
| 94 | + "\n , eachPrice=[" + eachPrice + "]" + | |
| 95 | + "\n , smsPrice=[" + smsPrice + "]" + | |
| 96 | + "\n , mmsPrice=[" + mmsPrice + "]" + | |
| 97 | + "\n , totPrice=[" + totPrice + "]" + | |
| 98 | + "\n , befCash=[" + befCash + "]" + | |
| 99 | + "\n , befPoint=[" + befPoint + "]" + | |
| 100 | + "\n , kakaoAtPrice=[" + kakaoAtPrice + "]" + | |
| 101 | + "\n , bizJsonName=[" + bizJsonName + "]" + | |
| 102 | + "\n , reserveYn=[" + reserveYn + "]" + | |
| 103 | + "\n , atDelayYn=[" + atDelayYn + "]" + | |
| 104 | + "\n , bizKakaoResendOrgnlTxt=[" + bizKakaoResendOrgnlTxt + "]" + | |
| 105 | + "\n , bizKakaoResendType=[" + bizKakaoResendType + "]" + | |
| 106 | + "\n ]"; | |
| 107 | + } | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | +} |
--- src/main/java/itn/let/kakao/kakaoComm/KakaoSendUtil.java
+++ src/main/java/itn/let/kakao/kakaoComm/KakaoSendUtil.java
... | ... | @@ -1,21 +1,38 @@ |
| 1 | 1 |
package itn.let.kakao.kakaoComm; |
| 2 | 2 |
|
| 3 |
+import java.text.ParseException; |
|
| 4 |
+import java.text.SimpleDateFormat; |
|
| 3 | 5 |
import java.util.ArrayList; |
| 6 |
+import java.util.Calendar; |
|
| 7 |
+import java.util.Date; |
|
| 4 | 8 |
import java.util.List; |
| 9 |
+import java.util.Map; |
|
| 10 |
+import java.util.regex.Matcher; |
|
| 11 |
+import java.util.regex.Pattern; |
|
| 5 | 12 |
|
| 6 | 13 |
import javax.annotation.Resource; |
| 7 | 14 |
|
| 15 |
+import org.apache.commons.collections4.CollectionUtils; |
|
| 16 |
+import org.apache.commons.lang3.StringUtils; |
|
| 8 | 17 |
import org.springframework.beans.factory.annotation.Autowired; |
| 18 |
+import org.springframework.http.HttpStatus; |
|
| 9 | 19 |
import org.springframework.stereotype.Component; |
| 10 | 20 |
|
| 21 |
+import egovframework.rte.fdl.idgnr.EgovIdGnrService; |
|
| 11 | 22 |
import itn.com.cmm.util.StringUtil; |
| 12 | 23 |
import itn.let.kakao.kakaoComm.kakaoApi.KakaoApiJsonSave; |
| 24 |
+import itn.let.kakao.kakaoComm.kakaoApi.KakaoApiTemplate; |
|
| 25 |
+import itn.let.mail.service.StatusResponse; |
|
| 26 |
+import itn.let.mjo.mjocommon.MjonCommon; |
|
| 13 | 27 |
import itn.let.mjo.msg.service.MjonMsgVO; |
| 14 | 28 |
import itn.let.mjo.msgdata.service.MjonMsgDataService; |
| 15 | 29 |
import itn.let.mjo.spammsg.web.ComGetSpamStringParser; |
| 30 |
+import itn.let.module.base.PriceAndPoint; |
|
| 16 | 31 |
import itn.let.sym.site.service.JoinSettingVO; |
| 17 | 32 |
import itn.let.uss.umt.service.MberManageVO; |
| 33 |
+import lombok.extern.slf4j.Slf4j; |
|
| 18 | 34 |
|
| 35 |
+@Slf4j |
|
| 19 | 36 |
@Component |
| 20 | 37 |
public class KakaoSendUtil {
|
| 21 | 38 |
|
... | ... | @@ -24,6 +41,374 @@ |
| 24 | 41 |
|
| 25 | 42 |
@Resource(name = "MjonMsgDataService") |
| 26 | 43 |
private MjonMsgDataService mjonMsgDataService; |
| 44 |
+ |
|
| 45 |
+ @Autowired |
|
| 46 |
+ KakaoApiTemplate kakaoApiTemplate; |
|
| 47 |
+ |
|
| 48 |
+ @Autowired |
|
| 49 |
+ private PriceAndPoint priceAndPoint; |
|
| 50 |
+ |
|
| 51 |
+ @Autowired |
|
| 52 |
+ private MjonCommon mjonCommon; |
|
| 53 |
+ |
|
| 54 |
+ // 클래스 수준에서 정적 Pattern 정의 (성능 최적화) |
|
| 55 |
+ private static final Pattern REPLACEMENT_PATTERN = Pattern.compile("#\\{[^}]+\\}");
|
|
| 56 |
+ |
|
| 57 |
+ private static final SimpleDateFormat DATE_FORMATTER = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
|
| 58 |
+ |
|
| 59 |
+ // 단문 메세지 타입 |
|
| 60 |
+ public static final String SHORT_MSG_TYPE = "SMS"; |
|
| 61 |
+ // 장문 메세지 타입 |
|
| 62 |
+ public static final String LONG_MSG_TYPE = "MMS"; |
|
| 63 |
+ |
|
| 64 |
+ /** |
|
| 65 |
+ * @methodName : populateSendLists _advc |
|
| 66 |
+ * @author : 이호영 |
|
| 67 |
+ * @date : 2025. 3. 7. |
|
| 68 |
+ * @description : 기존 kakaoSendPrice 개선 |
|
| 69 |
+ * @return : KakaoVO |
|
| 70 |
+ * @param kakaoVO |
|
| 71 |
+ * @param statusResponse |
|
| 72 |
+ * @return |
|
| 73 |
+ * @throws Exception |
|
| 74 |
+ * |
|
| 75 |
+ */ |
|
| 76 |
+ public List<KakaoSendAdvcVO> populateSendLists(KakaoVO kakaoVO, boolean isNotified, StatusResponse statusResponse) throws Exception {
|
|
| 77 |
+ |
|
| 78 |
+ //사용자 현재 보유 금액 불러오기(문자 발송 금액 차감 이전 금액) |
|
| 79 |
+// String befCash = kakaoVO.getBefCash(); |
|
| 80 |
+ |
|
| 81 |
+ |
|
| 82 |
+ |
|
| 83 |
+ |
|
| 84 |
+ log.info(" +kakaoVO.getVarListMap().size() :: [{}]", kakaoVO.getVarListMap().size());
|
|
| 85 |
+ |
|
| 86 |
+ List<KakaoSendAdvcVO> kakaoSendAdvcListVO = new ArrayList<>(); |
|
| 87 |
+ Calendar calendar = setupBaseDate(kakaoVO, isNotified); |
|
| 88 |
+ |
|
| 89 |
+ |
|
| 90 |
+ |
|
| 91 |
+ KakaoReturnVO templateDetail = kakaoApiTemplate.selectKakaoApiTemplateDetail(kakaoVO); |
|
| 92 |
+ String templateContent = templateDetail.getTemplateContent(); // 알림톡 템플릿 |
|
| 93 |
+ kakaoVO.setTemplateContent(templateContent); |
|
| 94 |
+ String templateTitle = templateDetail.getTemplateTitle(); |
|
| 95 |
+ |
|
| 96 |
+ |
|
| 97 |
+// log.info(" + templateDetail :: [{}]", templateDetail);
|
|
| 98 |
+// templateDetail.getButtonList().forEach(t->log.info(" + ButtonList :: [{}]", t.toString()));
|
|
| 99 |
+ |
|
| 100 |
+ Boolean hasContentReplacement = this.replBooleanStrChecker(templateContent); |
|
| 101 |
+ Boolean hasTitleReplacement = this.replBooleanStrChecker(templateTitle); |
|
| 102 |
+ Boolean hasButtonReplacement = this.needsButtonReplacement(templateDetail.getButtonList()); |
|
| 103 |
+ |
|
| 104 |
+ /** @jsonStr 필요유무 */ |
|
| 105 |
+ boolean hasTitleOrButtons = StringUtils.isNotEmpty(templateTitle) |
|
| 106 |
+ || CollectionUtils.isNotEmpty(templateDetail.getButtonList()); |
|
| 107 |
+ |
|
| 108 |
+ /** @jsonStr 반복유무 */ |
|
| 109 |
+ boolean needsJsonReplacement = hasTitleReplacement || hasButtonReplacement; |
|
| 110 |
+ String sharedJsonStr = null; |
|
| 111 |
+ |
|
| 112 |
+ String subMsgTxt = kakaoVO.getSubMsgTxt(); // 실패 대체 문자 |
|
| 113 |
+ |
|
| 114 |
+ // 시스템 기본 단가 정보 불러오기 |
|
| 115 |
+ JoinSettingVO sysJoinSetVO = mjonMsgDataService.selectJoinSettingInfo(); |
|
| 116 |
+ // 사용자 개인 단가 정보 불러오기 |
|
| 117 |
+ MberManageVO mberManageVO = mjonMsgDataService.selectMberManageInfo(kakaoVO.getUserId()); |
|
| 118 |
+ |
|
| 119 |
+ |
|
| 120 |
+ |
|
| 121 |
+ |
|
| 122 |
+ /** @MSGID KEY값 */ |
|
| 123 |
+ List<String> idList = mjonCommon.getNextCustomMsgCId(kakaoVO.getVarListMap().size()); |
|
| 124 |
+// for (int i = 0; i < kakaoSendAdvcListVO.size(); i++) {
|
|
| 125 |
+// kakaoSendAdvcListVO.get(i).setMsgId(idList.get(i)); |
|
| 126 |
+// kakaoSendAdvcListVO.get(i).setBizJsonName(idList.get(i)); |
|
| 127 |
+// } |
|
| 128 |
+ |
|
| 129 |
+ |
|
| 130 |
+ |
|
| 131 |
+ // 분할 건수 카운터 |
|
| 132 |
+ int counter = 0; |
|
| 133 |
+/** @Map에 총 갯수가 수신자 갯수와 동일함 */ |
|
| 134 |
+ List<Map<String, String>> varList = kakaoVO.getVarListMap(); |
|
| 135 |
+ for (int i = 0; i < varList.size(); i++) {
|
|
| 136 |
+// for(Map<String, String> variables : kakaoVO.getVarListMap()) {
|
|
| 137 |
+ // 치환 데이터 |
|
| 138 |
+ Map<String, String> variables = varList.get(i); |
|
| 139 |
+ |
|
| 140 |
+/** @공통 기본값 */ |
|
| 141 |
+ KakaoSendAdvcVO sendVO = createSendVO(kakaoVO); |
|
| 142 |
+ String msgId = idList.get(i); |
|
| 143 |
+ sendVO.setMsgId(msgId); |
|
| 144 |
+ |
|
| 145 |
+ // step1 |
|
| 146 |
+ // Step 1-1: 값 치환 및 수신번호 셋팅 |
|
| 147 |
+ // Step 1-2: 수신자 정보 설정 (callToList는 항상 설정). |
|
| 148 |
+ if (variables.containsKey("callToList")) {
|
|
| 149 |
+ sendVO.setCallTo(variables.get("callToList"));
|
|
| 150 |
+ variables.remove("callToList"); // 사용 후 제거.
|
|
| 151 |
+ } |
|
| 152 |
+ |
|
| 153 |
+/** @Step1-3: 템플릿 치환데이터 설정 */ |
|
| 154 |
+ if (hasContentReplacement) {
|
|
| 155 |
+ templateContent = mjonCommon.ATReplaceTemplateVariables(templateContent, variables); |
|
| 156 |
+ if(hasTitleReplacement) {
|
|
| 157 |
+ templateTitle = mjonCommon.ATReplaceTemplateVariables(templateTitle, variables); |
|
| 158 |
+ } |
|
| 159 |
+ } |
|
| 160 |
+/** @버튼 치환 */ // 버튼 리스트가 있으면 치환 수행, 항상 sendVO에 설정 |
|
| 161 |
+ List<KakaoButtonVO> buttonList = templateDetail.getButtonList(); |
|
| 162 |
+ if(hasButtonReplacement) {
|
|
| 163 |
+ buttonList = replaceButtonLinks(buttonList, variables); |
|
| 164 |
+ } |
|
| 165 |
+ sendVO.setButtonList(buttonList); |
|
| 166 |
+ |
|
| 167 |
+ sendVO.setTemplateTitle(templateTitle); |
|
| 168 |
+ sendVO.setTemplateContent(templateContent); |
|
| 169 |
+ |
|
| 170 |
+ |
|
| 171 |
+ // Step 1-4: 실패 대체 문자 치환데이터 설정 |
|
| 172 |
+ if("Y".equals(kakaoVO.getSubMsgSendYn())) { // 대체문자가 있나?
|
|
| 173 |
+ if ("Y".equals(kakaoVO.getSubMsgTxtReplYn())) { // 치환데이터가 있나?
|
|
| 174 |
+ subMsgTxt = mjonCommon.ATReplaceTemplateVariables(subMsgTxt, variables); |
|
| 175 |
+ } |
|
| 176 |
+ sendVO.setSubMsgTxt(subMsgTxt);// 실패 |
|
| 177 |
+ } |
|
| 178 |
+ sendVO.setSubMsgSendYn(kakaoVO.getSubMsgSendYn()); |
|
| 179 |
+ |
|
| 180 |
+ |
|
| 181 |
+ /* |
|
| 182 |
+ log.info("kakaoSendAdvcVO Details: [callTo={}\n, templateContent=\n{}\n, subMsgTxt=\n{}]\n\n\n\n",
|
|
| 183 |
+ kakaoSendAdvcVO.getCallTo(), |
|
| 184 |
+ kakaoSendAdvcVO.getTemplateContent(), |
|
| 185 |
+ kakaoSendAdvcVO.getSubMsgTxt() |
|
| 186 |
+ ); |
|
| 187 |
+ */ |
|
| 188 |
+ |
|
| 189 |
+ // Step1 END |
|
| 190 |
+ |
|
| 191 |
+ |
|
| 192 |
+// step3 |
|
| 193 |
+// 바이트 수 체크 및 금액설정 |
|
| 194 |
+ |
|
| 195 |
+ |
|
| 196 |
+ Float kakaoAtPrice = mberManageVO.getKakaoAtPrice(); |
|
| 197 |
+ // 유효한 단가 계산 |
|
| 198 |
+ float shortPrice = getValidPrice(mberManageVO.getShortPrice(), sysJoinSetVO.getShortPrice()); |
|
| 199 |
+ float longPrice = getValidPrice(mberManageVO.getLongPrice(), sysJoinSetVO.getLongPrice()); |
|
| 200 |
+ |
|
| 201 |
+ |
|
| 202 |
+ String shortPStr = Float.toString(shortPrice); |
|
| 203 |
+ String mmsPStr = Float.toString(longPrice); |
|
| 204 |
+ |
|
| 205 |
+ // 공통 가격 설정 |
|
| 206 |
+ sendVO.setSmsPrice(shortPStr); |
|
| 207 |
+ sendVO.setMmsPrice(mmsPStr); |
|
| 208 |
+ |
|
| 209 |
+ |
|
| 210 |
+ if("Y".equals(kakaoVO.getSubMsgSendYn())) {
|
|
| 211 |
+ int smsTxtByte = mjonCommon.getSmsTxtBytes(sendVO.getSubMsgTxt()); |
|
| 212 |
+ String sendType = getMsgType(smsTxtByte); |
|
| 213 |
+ sendVO.setSubMsgType(sendType); |
|
| 214 |
+ |
|
| 215 |
+ if ("INVALID".equals(sendType)) {
|
|
| 216 |
+ statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "전송 문자 길이를 초과하였습니다.");return kakaoSendAdvcListVO; |
|
| 217 |
+ } |
|
| 218 |
+ |
|
| 219 |
+ boolean isMms = "MMS".equals(sendType); |
|
| 220 |
+ sendVO.setEachPrice(isMms ? mmsPStr : shortPStr); |
|
| 221 |
+ |
|
| 222 |
+ |
|
| 223 |
+ } else {
|
|
| 224 |
+ kakaoAtPrice = getValidPrice(mberManageVO.getKakaoAtPrice(), sysJoinSetVO.getKakaoAtPrice()); |
|
| 225 |
+ sendVO.setEachPrice( Float.toString(kakaoAtPrice) ); |
|
| 226 |
+ } |
|
| 227 |
+ |
|
| 228 |
+ |
|
| 229 |
+ |
|
| 230 |
+ // step4 |
|
| 231 |
+ // 예약 시간 설정 및 분할 데이터 설정 |
|
| 232 |
+ if ("Y".equalsIgnoreCase(kakaoVO.getReserveYn())
|
|
| 233 |
+ && "Y".equalsIgnoreCase(kakaoVO.getDivideChk()) |
|
| 234 |
+ && counter == Integer.parseInt(kakaoVO.getDivideCnt())) |
|
| 235 |
+ {
|
|
| 236 |
+ counter = 0; |
|
| 237 |
+ calendar.add(Calendar.MINUTE, Integer.parseInt(kakaoVO.getDivideTime())); |
|
| 238 |
+ } |
|
| 239 |
+ counter++; |
|
| 240 |
+ // 즉시 발송인경우 현재 시간 |
|
| 241 |
+ // 예약인 경우 위에 설정한 시간 입력 |
|
| 242 |
+ sendVO.setReqDate(DATE_FORMATTER.format(calendar.getTime())); |
|
| 243 |
+ |
|
| 244 |
+ |
|
| 245 |
+ |
|
| 246 |
+/** @step5 전송 메세지 설정 json파일 만들기*/ |
|
| 247 |
+ // 타이틀과 버튼이 있고 |
|
| 248 |
+ if(hasTitleOrButtons) {
|
|
| 249 |
+ // 버튼과 타이틀에 치환데이터가 있으면 json String을 계속 생성 |
|
| 250 |
+ if(needsJsonReplacement) {
|
|
| 251 |
+ sharedJsonStr = kakaoApiJsonSave.kakaoApiJsonSave_advc(sendVO, templateDetail); |
|
| 252 |
+ sendVO.setBizJsonName(msgId); |
|
| 253 |
+ sendVO.setJsonStr(sharedJsonStr); |
|
| 254 |
+ } else if (StringUtils.isEmpty(sharedJsonStr)) {
|
|
| 255 |
+ // 치환 데이터가 없고 아직 생성되지 않았으면 한 번만 생성 |
|
| 256 |
+ sharedJsonStr = kakaoApiJsonSave.kakaoApiJsonSave_advc(sendVO, templateDetail); |
|
| 257 |
+ sendVO.setBizJsonName(idList.get(0)); |
|
| 258 |
+ sendVO.setJsonStr(sharedJsonStr); |
|
| 259 |
+ }else {
|
|
| 260 |
+ sendVO.setBizJsonName(idList.get(0)); |
|
| 261 |
+ } |
|
| 262 |
+ |
|
| 263 |
+ } |
|
| 264 |
+ kakaoSendAdvcListVO.add(sendVO); |
|
| 265 |
+ } |
|
| 266 |
+ |
|
| 267 |
+ |
|
| 268 |
+ return kakaoSendAdvcListVO; |
|
| 269 |
+ } |
|
| 270 |
+ |
|
| 271 |
+ private Calendar setupBaseDate(KakaoVO kakaoVO, boolean isNotified) throws ParseException {
|
|
| 272 |
+ // 예약 시간 기본값 설정 |
|
| 273 |
+ Date now = new Date(); |
|
| 274 |
+ // ReqDate가 비어 있으면 현재 시간으로 설정, 그렇지 않으면 ReqDate로 설정 |
|
| 275 |
+ // 화면에서 예약문자면 예약시간을 regDate로 설정한다. |
|
| 276 |
+ Date baseDate; |
|
| 277 |
+ if (StringUtils.isEmpty(kakaoVO.getReqDate())) {
|
|
| 278 |
+ kakaoVO.setReqDate(DATE_FORMATTER.format(now)); // ReqDate에 현재 시간 설정 |
|
| 279 |
+ baseDate = now; |
|
| 280 |
+ } else {
|
|
| 281 |
+ baseDate = DATE_FORMATTER.parse(kakaoVO.getReqDate()); // ReqDate를 baseDate로 설정 |
|
| 282 |
+ } |
|
| 283 |
+ |
|
| 284 |
+ // 시간 성정 |
|
| 285 |
+ Calendar calendar = Calendar.getInstance(); |
|
| 286 |
+ calendar.setTime(baseDate); // calendar에 baseDate 설정 |
|
| 287 |
+ |
|
| 288 |
+ // 지연 여부 처리 |
|
| 289 |
+ // 알림톡 스미싱의심 + 공휴일알림 조건이 맞으면 30분 delay |
|
| 290 |
+ if ( "Y".equalsIgnoreCase(kakaoVO.getAtSmishingYn()) |
|
| 291 |
+ && isNotified) {
|
|
| 292 |
+ calendar.add(Calendar.MINUTE, 30); // 모든 시간을 30분 뒤로 미룸 |
|
| 293 |
+ } |
|
| 294 |
+ return calendar; |
|
| 295 |
+ } |
|
| 296 |
+ |
|
| 297 |
+ /** |
|
| 298 |
+ * @methodName : createSendVO |
|
| 299 |
+ * @author : 이호영 |
|
| 300 |
+ * @date : 2025. 3. 19. |
|
| 301 |
+ * @description : populateSendLists 반복에 필요한 공통생성 부분 |
|
| 302 |
+ * @return : KakaoSendAdvcVO |
|
| 303 |
+ * @param kakaoVO |
|
| 304 |
+ * @return |
|
| 305 |
+ * |
|
| 306 |
+ */ |
|
| 307 |
+ private KakaoSendAdvcVO createSendVO(KakaoVO kakaoVO) {
|
|
| 308 |
+ KakaoSendAdvcVO sendVO = new KakaoSendAdvcVO(); |
|
| 309 |
+ sendVO.setMsgType("8");
|
|
| 310 |
+ sendVO.setSenderKey(kakaoVO.getSenderKey()); |
|
| 311 |
+ sendVO.setTemplateCode(kakaoVO.getTemplateCode()); |
|
| 312 |
+ sendVO.setUserId(kakaoVO.getUserId()); |
|
| 313 |
+ sendVO.setCallFrom(kakaoVO.getCallFrom()); |
|
| 314 |
+ sendVO.setAgentCode("04");
|
|
| 315 |
+ return sendVO; |
|
| 316 |
+ } |
|
| 317 |
+ |
|
| 318 |
+ private List<KakaoButtonVO> replaceButtonLinks(List<KakaoButtonVO> buttonList, |
|
| 319 |
+ Map<String, String> variables) {
|
|
| 320 |
+ |
|
| 321 |
+ if (buttonList != null) {
|
|
| 322 |
+ for (KakaoButtonVO button : buttonList) {
|
|
| 323 |
+ // 각 링크 필드에 대해 치환 수행 |
|
| 324 |
+ if (button.getLinkAnd() != null) {
|
|
| 325 |
+ button.setLinkAnd(mjonCommon.ATReplaceTemplateVariables(button.getLinkAnd(), variables)); |
|
| 326 |
+ } |
|
| 327 |
+ if (button.getLinkIos() != null) {
|
|
| 328 |
+ button.setLinkIos(mjonCommon.ATReplaceTemplateVariables(button.getLinkIos(), variables)); |
|
| 329 |
+ } |
|
| 330 |
+ if (button.getLinkMo() != null) {
|
|
| 331 |
+ button.setLinkMo(mjonCommon.ATReplaceTemplateVariables(button.getLinkMo(), variables)); |
|
| 332 |
+ } |
|
| 333 |
+ if (button.getLinkPc() != null) {
|
|
| 334 |
+ button.setLinkPc(mjonCommon.ATReplaceTemplateVariables(button.getLinkPc(), variables)); |
|
| 335 |
+ } |
|
| 336 |
+ } |
|
| 337 |
+ // 치환된 버튼 리스트를 sendVO에 반영 |
|
| 338 |
+// sendVO.setButtonList(buttonList); // KakaoSendAdvcVO에 setButtonList가 있다고 가정 |
|
| 339 |
+ } |
|
| 340 |
+ |
|
| 341 |
+ return buttonList; |
|
| 342 |
+ } |
|
| 343 |
+ |
|
| 344 |
+ /** |
|
| 345 |
+ * 버튼 리스트에 치환 패턴(#{...})이 있는지 확인합니다.
|
|
| 346 |
+ * @param buttonList 버튼 리스트 (null 가능) |
|
| 347 |
+ * @return 치환 패턴이 있으면 true, 없으면 false |
|
| 348 |
+ */ |
|
| 349 |
+ private boolean needsButtonReplacement(List<KakaoButtonVO> buttonList) {
|
|
| 350 |
+ if (buttonList == null) {
|
|
| 351 |
+ return false; |
|
| 352 |
+ } |
|
| 353 |
+ return buttonList.stream().anyMatch(button -> |
|
| 354 |
+ replBooleanStrChecker(button.getLinkAnd()) || |
|
| 355 |
+ replBooleanStrChecker(button.getLinkIos()) || |
|
| 356 |
+ replBooleanStrChecker(button.getLinkMo()) || |
|
| 357 |
+ replBooleanStrChecker(button.getLinkPc()) |
|
| 358 |
+ ); |
|
| 359 |
+ } |
|
| 360 |
+ |
|
| 361 |
+ /** |
|
| 362 |
+ * 입력 문자열에 치환 패턴(#{...})이 있는지 확인합니다.
|
|
| 363 |
+ * @param input 확인할 문자열 (null 가능) |
|
| 364 |
+ * @return 치환 패턴이 있으면 true, 없으면 false |
|
| 365 |
+ */ |
|
| 366 |
+ private boolean replBooleanStrChecker(String input) {
|
|
| 367 |
+ // #{...} 패턴을 확인하는 정규 표현식
|
|
| 368 |
+ if (input == null) {
|
|
| 369 |
+ return false; |
|
| 370 |
+ } |
|
| 371 |
+ Matcher matcher = REPLACEMENT_PATTERN.matcher(input); |
|
| 372 |
+ return matcher.find(); |
|
| 373 |
+ } |
|
| 374 |
+ |
|
| 375 |
+ |
|
| 376 |
+ public Float getValidPrice(Float personalPrice, Float defaultPrice) {
|
|
| 377 |
+ return (personalPrice != null && personalPrice > 0) ? personalPrice : defaultPrice; |
|
| 378 |
+ } |
|
| 379 |
+ |
|
| 380 |
+ |
|
| 381 |
+ /** |
|
| 382 |
+ * @methodName : getMsgType |
|
| 383 |
+ * @author : 이호영 |
|
| 384 |
+ * @date : 2025. 3. 12. |
|
| 385 |
+ * @description : 메세지 타입 구하기 |
|
| 386 |
+ * @return : String |
|
| 387 |
+ * @param smsTxtByte |
|
| 388 |
+ * @return |
|
| 389 |
+ * |
|
| 390 |
+ */ |
|
| 391 |
+ private String getMsgType(int smsTxtByte) {
|
|
| 392 |
+ // TODO Auto-generated method stub |
|
| 393 |
+ |
|
| 394 |
+ String msgType = SHORT_MSG_TYPE; |
|
| 395 |
+ |
|
| 396 |
+ // 1. 2000 Byte 초과는 에러 처리 |
|
| 397 |
+ if (smsTxtByte > 2000) {
|
|
| 398 |
+ return "INVALID"; |
|
| 399 |
+ } |
|
| 400 |
+ |
|
| 401 |
+ // 2. 문자 길이에 따라 메시지 타입 설정 (90 Byte 초과는 장문) |
|
| 402 |
+ if (smsTxtByte > 90) {
|
|
| 403 |
+ msgType = LONG_MSG_TYPE; |
|
| 404 |
+ } |
|
| 405 |
+ |
|
| 406 |
+ return msgType; |
|
| 407 |
+ } |
|
| 408 |
+ |
|
| 409 |
+ |
|
| 410 |
+ |
|
| 411 |
+ |
|
| 27 | 412 |
|
| 28 | 413 |
|
| 29 | 414 |
/** |
... | ... | @@ -34,13 +419,11 @@ |
| 34 | 419 |
*/ |
| 35 | 420 |
public KakaoVO kakaoSendPrice(KakaoVO kakaoVO) throws Exception {
|
| 36 | 421 |
|
| 37 |
- //사용자 현재 보유 금액 불러오기(문자 발송 금액 차감 이전 금액) |
|
| 38 |
- String befCash = kakaoVO.getBefCash(); |
|
| 422 |
+ System.out.println(" :: kakaoSendPrice :: ");
|
|
| 39 | 423 |
|
| 40 |
- //VO에서 현재 보유금액이 없으면 디비에서 조회해서 불러옴 |
|
| 41 |
- if("".equals(befCash) || befCash == null) {
|
|
| 42 |
- |
|
| 43 |
- } |
|
| 424 |
+ //사용자 현재 보유 금액 불러오기(문자 발송 금액 차감 이전 금액) |
|
| 425 |
+// String befCash = kakaoVO.getBefCash(); |
|
| 426 |
+ |
|
| 44 | 427 |
MjonMsgVO mjonMsgVO = new MjonMsgVO(); |
| 45 | 428 |
mjonMsgVO.setUserId(kakaoVO.getUserId()); |
| 46 | 429 |
String userMoney = mjonMsgDataService.selectBeforeCashData(mjonMsgVO); |
... | ... | @@ -55,6 +438,7 @@ |
| 55 | 438 |
|
| 56 | 439 |
/** 대체문자 여부 체크(있으면 대체문자 가격으로 없으면 카카오톡 가격으로) */ |
| 57 | 440 |
//대체문자 발송 여부 확인 |
| 441 |
+ System.out.println(" :: kakaoVO.getSubMsgSendYn() :: "+ kakaoVO.getSubMsgSendYn());
|
|
| 58 | 442 |
if(kakaoVO.getSubMsgSendYn().equals("Y")) {
|
| 59 | 443 |
|
| 60 | 444 |
|
... | ... | @@ -401,6 +785,107 @@ |
| 401 | 785 |
varValInfo = kakaoVO.getVarValList().get(count); |
| 402 | 786 |
} |
| 403 | 787 |
String jsonFileName = kakaoApiJsonSave.kakaoApiJsonSave(kakaoVO, varValInfo); |
| 788 |
+ setSendMsgVO.setBizJsonName(jsonFileName); //json 파일명 |
|
| 789 |
+ } |
|
| 790 |
+ |
|
| 791 |
+ kakaoSendList.add(setSendMsgVO); |
|
| 792 |
+ } |
|
| 793 |
+ kakaoVO.setKakaoSendList(kakaoSendList); |
|
| 794 |
+ |
|
| 795 |
+ } catch (Exception e) {
|
|
| 796 |
+ System.out.println(e.toString()); |
|
| 797 |
+ e.printStackTrace(); |
|
| 798 |
+ } |
|
| 799 |
+ |
|
| 800 |
+ return kakaoVO; |
|
| 801 |
+ } |
|
| 802 |
+ |
|
| 803 |
+ /** |
|
| 804 |
+ * @methodName : kakaoSendMsg_advc |
|
| 805 |
+ * @author : 이호영 |
|
| 806 |
+ * @date : 2025. 3. 13. |
|
| 807 |
+ * @description : kakaoSendMsg 개선 |
|
| 808 |
+ * @return : KakaoVO |
|
| 809 |
+ * @param kakaoVO |
|
| 810 |
+ * @return |
|
| 811 |
+ * @throws Exception |
|
| 812 |
+ * |
|
| 813 |
+ */ |
|
| 814 |
+ public KakaoVO kakaoSendMsg_advc(KakaoVO kakaoVO) throws Exception {
|
|
| 815 |
+ List<KakaoVO> kakaoSendList = new ArrayList<KakaoVO>(); |
|
| 816 |
+ //전체 받는사람 수량만큼 반복 확인 |
|
| 817 |
+ int callToCnt = kakaoVO.getCallToList().length; |
|
| 818 |
+ try {
|
|
| 819 |
+ for(int count =0; count < callToCnt; count++) {
|
|
| 820 |
+ |
|
| 821 |
+ KakaoVO setSendMsgVO = new KakaoVO(); |
|
| 822 |
+ |
|
| 823 |
+ setSendMsgVO.setDestPhone(kakaoVO.getCallToList()[count]); // 수신 번호 |
|
| 824 |
+ // 카카오 전송내용 설정 |
|
| 825 |
+ // 변환문자 포함(Y), 미포함(N) |
|
| 826 |
+ if(kakaoVO.getTxtReplYn().equals("Y")) {
|
|
| 827 |
+ |
|
| 828 |
+ String templateContent = kakaoSubMagTxtRepl(kakaoVO.getTemplateContent(), kakaoVO, count); |
|
| 829 |
+ setSendMsgVO.setTemplateContent(templateContent); |
|
| 830 |
+ |
|
| 831 |
+ if(kakaoVO.getTemplateEmphasizeType().equals("TEXT")) {
|
|
| 832 |
+ |
|
| 833 |
+ String title = kakaoSubMagTxtRepl(kakaoVO.getTemplateTitle(), kakaoVO, count); |
|
| 834 |
+ String subTitle = kakaoVO.getTemplateSubtitle(); |
|
| 835 |
+// title = title +"§§"+ subTitle; |
|
| 836 |
+ setSendMsgVO.setTemplateEmphasizeType(kakaoVO.getTemplateEmphasizeType()); |
|
| 837 |
+ setSendMsgVO.setTemplateTitle(title); |
|
| 838 |
+ } |
|
| 839 |
+ |
|
| 840 |
+ }else {
|
|
| 841 |
+ |
|
| 842 |
+ if(kakaoVO.getTemplateEmphasizeType().equals("TEXT")) {
|
|
| 843 |
+ |
|
| 844 |
+ String title = kakaoSubMagTxtRepl(kakaoVO.getTemplateTitle(), kakaoVO, count); |
|
| 845 |
+ String subTitle = kakaoVO.getTemplateSubtitle(); |
|
| 846 |
+// title = title +"§§"+ subTitle; |
|
| 847 |
+ setSendMsgVO.setTemplateEmphasizeType(kakaoVO.getTemplateEmphasizeType()); |
|
| 848 |
+ setSendMsgVO.setTemplateTitle(title); |
|
| 849 |
+ } |
|
| 850 |
+ |
|
| 851 |
+ // 템플릿 내용 설정 |
|
| 852 |
+ setSendMsgVO.setTemplateContent(kakaoVO.getTemplateContent()); |
|
| 853 |
+ } |
|
| 854 |
+ |
|
| 855 |
+ //대체문자 포함(Y), 미포함(N) |
|
| 856 |
+ if(kakaoVO.getSubMsgSendYn().equals("Y")) {
|
|
| 857 |
+ |
|
| 858 |
+ String charset = "euc-kr"; //문자 바이트 계산에 필요한 캐릭터 셋 : 한글 2Byte로 계산 |
|
| 859 |
+ |
|
| 860 |
+ String tempSubMagTxt = kakaoVO.getSubMsgTxt().replace("\r\n", "\n");
|
|
| 861 |
+ kakaoVO.setKakaoSubMagOrgnlTxt(tempSubMagTxt); |
|
| 862 |
+ if(kakaoVO.getSubMsgTxtReplYn().equals("Y")) {
|
|
| 863 |
+ tempSubMagTxt = kakaoSubMagTxtRepl(tempSubMagTxt, kakaoVO, count); |
|
| 864 |
+ } |
|
| 865 |
+ System.out.println("@@ 대체문자내용 : " + tempSubMagTxt);
|
|
| 866 |
+ setSendMsgVO.setSubMsgTxt(tempSubMagTxt); |
|
| 867 |
+ |
|
| 868 |
+ int FrBytes = tempSubMagTxt.getBytes(charset).length; |
|
| 869 |
+ System.out.println("@@ 대체문자길이 : " + FrBytes);
|
|
| 870 |
+ //메세지 길이가 90Byte가 초과시 MMS |
|
| 871 |
+ if(FrBytes > 90) {
|
|
| 872 |
+ setSendMsgVO.setSubMsgType("MMS");
|
|
| 873 |
+ }else {// 아니면 SMS
|
|
| 874 |
+ setSendMsgVO.setSubMsgType("SMS");
|
|
| 875 |
+ } |
|
| 876 |
+ |
|
| 877 |
+ System.out.println("@@ 대체문자타입 : " + setSendMsgVO.getSubMsgType());
|
|
| 878 |
+ } |
|
| 879 |
+ |
|
| 880 |
+ if(kakaoVO.getBizJsonYn().equals("Y")) {
|
|
| 881 |
+ kakaoVO.setDestPhone(kakaoVO.getCallToList()[count]); // 수신 번호 |
|
| 882 |
+ |
|
| 883 |
+ String[] varValInfo = null; |
|
| 884 |
+ if( kakaoVO.getVarValList().size() != 0) {
|
|
| 885 |
+ varValInfo = kakaoVO.getVarValList().get(count); |
|
| 886 |
+ } |
|
| 887 |
+ String jsonFileName = kakaoApiJsonSave.kakaoApiJsonSave(kakaoVO, varValInfo); |
|
| 888 |
+// String jsonFileName = kakaoApiJsonSave.kakaoApiJsonSave_advc(kakaoVO, varValInfo); |
|
| 404 | 889 |
// String jsonFileName = kakaoApiJsonSave.kakaoApiJsonSave(kakaoVO, kakaoVO.getVarValList().get(count)); |
| 405 | 890 |
setSendMsgVO.setBizJsonName(jsonFileName); //json 파일명 |
| 406 | 891 |
} |
... | ... | @@ -509,6 +994,7 @@ |
| 509 | 994 |
|
| 510 | 995 |
|
| 511 | 996 |
public String kakaoSubMagTxtRepl(String tempSubMagTxt, KakaoVO kakaoVO, int count) {
|
| 997 |
+ System.out.println("tempSubMagTxt : "+ tempSubMagTxt);
|
|
| 512 | 998 |
|
| 513 | 999 |
// String tempSubMagTxt = kakaoVO.getSubMsgTxt().replace("\r\n", "\n");
|
| 514 | 1000 |
// String tempSubMagTxt = msgTxt; |
... | ... | @@ -550,6 +1036,7 @@ |
| 550 | 1036 |
} |
| 551 | 1037 |
return tempSubMagTxt; |
| 552 | 1038 |
} |
| 1039 |
+ |
|
| 553 | 1040 |
|
| 554 | 1041 |
public String kakaoFTSubMagTxtRepl(String tempSubMagTxt, KakaoVO kakaoVO, int count) throws Exception{
|
| 555 | 1042 |
|
... | ... | @@ -704,5 +1191,10 @@ |
| 704 | 1191 |
//} |
| 705 | 1192 |
return ""; |
| 706 | 1193 |
} |
| 707 |
- |
|
| 1194 |
+ |
|
| 1195 |
+ public static void statusResponseSet (StatusResponse statusResponse, HttpStatus httpStatus, String msg ) {
|
|
| 1196 |
+ statusResponse.setStatus(httpStatus); |
|
| 1197 |
+ statusResponse.setMessage(msg); |
|
| 1198 |
+ |
|
| 1199 |
+ } |
|
| 708 | 1200 |
} |
--- src/main/java/itn/let/kakao/kakaoComm/KakaoVO.java
+++ src/main/java/itn/let/kakao/kakaoComm/KakaoVO.java
... | ... | @@ -2,8 +2,11 @@ |
| 2 | 2 |
|
| 3 | 3 |
import java.util.ArrayList; |
| 4 | 4 |
import java.util.List; |
| 5 |
+import java.util.Map; |
|
| 5 | 6 |
|
| 6 | 7 |
import itn.let.mjo.msg.service.MjonMsgVO; |
| 8 |
+import lombok.Getter; |
|
| 9 |
+import lombok.Setter; |
|
| 7 | 10 |
|
| 8 | 11 |
/** |
| 9 | 12 |
* @FileName : KakaoVO.java |
... | ... | @@ -13,6 +16,8 @@ |
| 13 | 16 |
|
| 14 | 17 |
* @프로그램 설명 : 카카오톡 요청 변수 목록 (문자온VO를 상속 받음) |
| 15 | 18 |
*/ |
| 19 |
+@Getter |
|
| 20 |
+@Setter |
|
| 16 | 21 |
public class KakaoVO extends MjonMsgVO{
|
| 17 | 22 |
|
| 18 | 23 |
private static final long serialVersionUID = 536382850588307019L; |
... | ... | @@ -255,1030 +260,60 @@ |
| 255 | 260 |
private String msgResendAllTmpKey; |
| 256 | 261 |
private String msgResendAllYellowId; |
| 257 | 262 |
|
| 258 |
- public String getSuccessDay() {
|
|
| 259 |
- return successDay; |
|
| 260 |
- } |
|
| 263 |
+ private List<Map<String, String>> varListMap; |
|
| 261 | 264 |
|
| 262 |
- public void setSuccessDay(String successDay) {
|
|
| 263 |
- this.successDay = successDay; |
|
| 264 |
- } |
|
| 265 |
- |
|
| 266 |
- public String getSuccessMonth() {
|
|
| 267 |
- return successMonth; |
|
| 268 |
- } |
|
| 269 |
- |
|
| 270 |
- public void setSuccessMonth(String successMonth) {
|
|
| 271 |
- this.successMonth = successMonth; |
|
| 272 |
- } |
|
| 273 |
- |
|
| 274 |
- public String getSuccessYear() {
|
|
| 275 |
- return successYear; |
|
| 276 |
- } |
|
| 277 |
- |
|
| 278 |
- public void setSuccessYear(String successYear) {
|
|
| 279 |
- this.successYear = successYear; |
|
| 280 |
- } |
|
| 281 |
- |
|
| 282 |
- public String getSuccessCntDay() {
|
|
| 283 |
- return successCntDay; |
|
| 284 |
- } |
|
| 285 |
- |
|
| 286 |
- public void setSuccessCntDay(String successCntDay) {
|
|
| 287 |
- this.successCntDay = successCntDay; |
|
| 288 |
- } |
|
| 289 |
- |
|
| 290 |
- public String getSuccessCntMonth() {
|
|
| 291 |
- return successCntMonth; |
|
| 292 |
- } |
|
| 293 |
- |
|
| 294 |
- public void setSuccessCntMonth(String successCntMonth) {
|
|
| 295 |
- this.successCntMonth = successCntMonth; |
|
| 296 |
- } |
|
| 297 |
- |
|
| 298 |
- public String getSuccessCntYear() {
|
|
| 299 |
- return successCntYear; |
|
| 300 |
- } |
|
| 301 |
- |
|
| 302 |
- public void setSuccessCntYear(String successCntYear) {
|
|
| 303 |
- this.successCntYear = successCntYear; |
|
| 304 |
- } |
|
| 305 |
- |
|
| 306 |
- public static long getSerialversionuid() {
|
|
| 307 |
- return serialVersionUID; |
|
| 308 |
- } |
|
| 309 |
- |
|
| 310 |
- public String getCategoryDepth() {
|
|
| 311 |
- return categoryDepth; |
|
| 312 |
- } |
|
| 313 |
- |
|
| 314 |
- public void setCategoryDepth(String categoryDepth) {
|
|
| 315 |
- this.categoryDepth = categoryDepth; |
|
| 316 |
- } |
|
| 317 |
- |
|
| 318 |
- public String getCategoryType() {
|
|
| 319 |
- return categoryType; |
|
| 320 |
- } |
|
| 321 |
- |
|
| 322 |
- public void setCategoryType(String categoryType) {
|
|
| 323 |
- this.categoryType = categoryType; |
|
| 324 |
- } |
|
| 325 |
- |
|
| 326 |
- public String getCategoryCode() {
|
|
| 327 |
- return categoryCode; |
|
| 328 |
- } |
|
| 329 |
- |
|
| 330 |
- public void setCategoryCode(String categoryCode) {
|
|
| 331 |
- this.categoryCode = categoryCode; |
|
| 332 |
- } |
|
| 333 |
- |
|
| 334 |
- public String getCategoryGroupName() {
|
|
| 335 |
- return categoryGroupName; |
|
| 336 |
- } |
|
| 337 |
- |
|
| 338 |
- public void setCategoryGroupName(String categoryGroupName) {
|
|
| 339 |
- this.categoryGroupName = categoryGroupName; |
|
| 340 |
- } |
|
| 341 |
- |
|
| 342 |
- public String getCategoryName() {
|
|
| 343 |
- return categoryName; |
|
| 344 |
- } |
|
| 345 |
- |
|
| 346 |
- public void setCategoryName(String categoryName) {
|
|
| 347 |
- this.categoryName = categoryName; |
|
| 348 |
- } |
|
| 349 |
- |
|
| 350 |
- public String getCategoryInclusion() {
|
|
| 351 |
- return categoryInclusion; |
|
| 352 |
- } |
|
| 353 |
- |
|
| 354 |
- public void setCategoryInclusion(String categoryInclusion) {
|
|
| 355 |
- this.categoryInclusion = categoryInclusion; |
|
| 356 |
- } |
|
| 357 |
- |
|
| 358 |
- public String getCategoryExclusion() {
|
|
| 359 |
- return categoryExclusion; |
|
| 360 |
- } |
|
| 361 |
- |
|
| 362 |
- public void setCategoryExclusion(String categoryExclusion) {
|
|
| 363 |
- this.categoryExclusion = categoryExclusion; |
|
| 364 |
- } |
|
| 365 |
- |
|
| 366 |
- public String getBizUrl() {
|
|
| 367 |
- return bizUrl; |
|
| 368 |
- } |
|
| 369 |
- |
|
| 370 |
- public void setBizUrl(String bizUrl) {
|
|
| 371 |
- this.bizUrl = bizUrl; |
|
| 372 |
- } |
|
| 373 |
- |
|
| 374 |
- public String getBizReturnMsg() {
|
|
| 375 |
- return bizReturnMsg; |
|
| 376 |
- } |
|
| 377 |
- |
|
| 378 |
- public void setBizReturnMsg(String bizReturnMsg) {
|
|
| 379 |
- this.bizReturnMsg = bizReturnMsg; |
|
| 380 |
- } |
|
| 381 |
- |
|
| 382 |
- public String getBizReturnCode() {
|
|
| 383 |
- return bizReturnCode; |
|
| 384 |
- } |
|
| 385 |
- |
|
| 386 |
- public void setBizReturnCode(String bizReturnCode) {
|
|
| 387 |
- this.bizReturnCode = bizReturnCode; |
|
| 388 |
- } |
|
| 389 |
- |
|
| 390 |
- public String getPhoneNumber() {
|
|
| 391 |
- return phoneNumber; |
|
| 392 |
- } |
|
| 393 |
- |
|
| 394 |
- public void setPhoneNumber(String phoneNumber) {
|
|
| 395 |
- this.phoneNumber = phoneNumber; |
|
| 396 |
- } |
|
| 397 |
- |
|
| 398 |
- public String getYellowId() {
|
|
| 399 |
- return yellowId; |
|
| 400 |
- } |
|
| 401 |
- |
|
| 402 |
- public void setYellowId(String yellowId) {
|
|
| 403 |
- this.yellowId = yellowId; |
|
| 404 |
- } |
|
| 405 |
- |
|
| 406 |
- public String getBizJsonName() {
|
|
| 407 |
- return bizJsonName; |
|
| 408 |
- } |
|
| 409 |
- |
|
| 410 |
- public void setBizJsonName(String bizJsonName) {
|
|
| 411 |
- this.bizJsonName = bizJsonName; |
|
| 412 |
- } |
|
| 413 |
- |
|
| 414 |
- public String getToken() {
|
|
| 415 |
- return token; |
|
| 416 |
- } |
|
| 417 |
- |
|
| 418 |
- public void setToken(String token) {
|
|
| 419 |
- this.token = token; |
|
| 420 |
- } |
|
| 421 |
- |
|
| 422 |
- public String getSenderKey() {
|
|
| 423 |
- return senderKey; |
|
| 424 |
- } |
|
| 425 |
- |
|
| 426 |
- public void setSenderKey(String senderKey) {
|
|
| 427 |
- this.senderKey = senderKey; |
|
| 428 |
- } |
|
| 429 |
- |
|
| 430 |
- public String getProfileId() {
|
|
| 431 |
- return profileId; |
|
| 432 |
- } |
|
| 433 |
- |
|
| 434 |
- public void setProfileId(String profileId) {
|
|
| 435 |
- this.profileId = profileId; |
|
| 436 |
- } |
|
| 437 |
- |
|
| 438 |
- public String getUserId() {
|
|
| 439 |
- return userId; |
|
| 440 |
- } |
|
| 441 |
- |
|
| 442 |
- public void setUserId(String userId) {
|
|
| 443 |
- this.userId = userId; |
|
| 444 |
- } |
|
| 445 |
- |
|
| 446 |
- public String getImgTitle() {
|
|
| 447 |
- return imgTitle; |
|
| 448 |
- } |
|
| 449 |
- |
|
| 450 |
- public void setImgTitle(String imgTitle) {
|
|
| 451 |
- this.imgTitle = imgTitle; |
|
| 452 |
- } |
|
| 453 |
- |
|
| 454 |
- public String getImageType() {
|
|
| 455 |
- return imageType; |
|
| 456 |
- } |
|
| 457 |
- |
|
| 458 |
- public void setImageType(String imageType) {
|
|
| 459 |
- this.imageType = imageType; |
|
| 460 |
- } |
|
| 461 |
- |
|
| 462 |
- public String getImgLink() {
|
|
| 463 |
- return imgLink; |
|
| 464 |
- } |
|
| 465 |
- |
|
| 466 |
- public void setImgLink(String imgLink) {
|
|
| 467 |
- this.imgLink = imgLink; |
|
| 468 |
- } |
|
| 469 |
- |
|
| 470 |
- public String getTemplateName() {
|
|
| 471 |
- return templateName; |
|
| 472 |
- } |
|
| 473 |
- |
|
| 474 |
- public void setTemplateName(String templateName) {
|
|
| 475 |
- this.templateName = templateName; |
|
| 476 |
- } |
|
| 477 |
- |
|
| 478 |
- public String getTemplateMessageType() {
|
|
| 479 |
- return templateMessageType; |
|
| 480 |
- } |
|
| 481 |
- |
|
| 482 |
- public void setTemplateMessageType(String templateMessageType) {
|
|
| 483 |
- this.templateMessageType = templateMessageType; |
|
| 484 |
- } |
|
| 485 |
- |
|
| 486 |
- public String getTemplateEmphasizeType() {
|
|
| 487 |
- return templateEmphasizeType; |
|
| 488 |
- } |
|
| 489 |
- |
|
| 490 |
- public void setTemplateEmphasizeType(String templateEmphasizeType) {
|
|
| 491 |
- this.templateEmphasizeType = templateEmphasizeType; |
|
| 492 |
- } |
|
| 493 |
- |
|
| 494 |
- public String getTemplateContent() {
|
|
| 495 |
- return templateContent; |
|
| 496 |
- } |
|
| 497 |
- |
|
| 498 |
- public void setTemplateContent(String templateContent) {
|
|
| 499 |
- this.templateContent = templateContent; |
|
| 500 |
- } |
|
| 501 |
- |
|
| 502 |
- public String getTemplateExtra() {
|
|
| 503 |
- return templateExtra; |
|
| 504 |
- } |
|
| 505 |
- |
|
| 506 |
- public void setTemplateExtra(String templateExtra) {
|
|
| 507 |
- this.templateExtra = templateExtra; |
|
| 508 |
- } |
|
| 509 |
- |
|
| 510 |
- public String getTamplateAd() {
|
|
| 511 |
- return tamplateAd; |
|
| 512 |
- } |
|
| 513 |
- |
|
| 514 |
- public void setTamplateAd(String tamplateAd) {
|
|
| 515 |
- this.tamplateAd = tamplateAd; |
|
| 516 |
- } |
|
| 517 |
- |
|
| 518 |
- public String getTemplateImageName() {
|
|
| 519 |
- return templateImageName; |
|
| 520 |
- } |
|
| 521 |
- |
|
| 522 |
- public void setTemplateImageName(String templateImageName) {
|
|
| 523 |
- this.templateImageName = templateImageName; |
|
| 524 |
- } |
|
| 525 |
- |
|
| 526 |
- public String getTemplateImageUrl() {
|
|
| 527 |
- return templateImageUrl; |
|
| 528 |
- } |
|
| 529 |
- |
|
| 530 |
- public void setTemplateImageUrl(String templateImageUrl) {
|
|
| 531 |
- this.templateImageUrl = templateImageUrl; |
|
| 532 |
- } |
|
| 533 |
- |
|
| 534 |
- public String getTemplateTitle() {
|
|
| 535 |
- return templateTitle; |
|
| 536 |
- } |
|
| 537 |
- |
|
| 538 |
- public void setTemplateTitle(String templateTitle) {
|
|
| 539 |
- this.templateTitle = templateTitle; |
|
| 540 |
- } |
|
| 541 |
- |
|
| 542 |
- public String getTemplateSubtitle() {
|
|
| 543 |
- return templateSubtitle; |
|
| 544 |
- } |
|
| 545 |
- |
|
| 546 |
- public void setTemplateSubtitle(String templateSubtitle) {
|
|
| 547 |
- this.templateSubtitle = templateSubtitle; |
|
| 548 |
- } |
|
| 549 |
- |
|
| 550 |
- public String getTemplateHeader() {
|
|
| 551 |
- return templateHeader; |
|
| 552 |
- } |
|
| 553 |
- |
|
| 554 |
- public void setTemplateHeader(String templateHeader) {
|
|
| 555 |
- this.templateHeader = templateHeader; |
|
| 556 |
- } |
|
| 557 |
- |
|
| 558 |
- public Boolean getSecurityFlag() {
|
|
| 559 |
- return securityFlag; |
|
| 560 |
- } |
|
| 561 |
- |
|
| 562 |
- public void setSecurityFlag(Boolean securityFlag) {
|
|
| 563 |
- this.securityFlag = securityFlag; |
|
| 564 |
- } |
|
| 565 |
- |
|
| 566 |
- public List<KakaoButtonVO> getButtonVOList() {
|
|
| 567 |
- return buttonVOList; |
|
| 568 |
- } |
|
| 569 |
- |
|
| 570 |
- public void setButtonVOList(List<KakaoButtonVO> buttonVOList) {
|
|
| 571 |
- this.buttonVOList = buttonVOList; |
|
| 572 |
- } |
|
| 573 |
- |
|
| 574 |
- public String getButtonName() {
|
|
| 575 |
- return buttonName; |
|
| 576 |
- } |
|
| 577 |
- |
|
| 578 |
- public void setButtonName(String buttonName) {
|
|
| 579 |
- this.buttonName = buttonName; |
|
| 580 |
- } |
|
| 581 |
- |
|
| 582 |
- public String getButtonLinkType() {
|
|
| 583 |
- return buttonLinkType; |
|
| 584 |
- } |
|
| 585 |
- |
|
| 586 |
- public void setButtonLinkType(String buttonLinkType) {
|
|
| 587 |
- this.buttonLinkType = buttonLinkType; |
|
| 588 |
- } |
|
| 589 |
- |
|
| 590 |
- public String getButtonLinkAnd() {
|
|
| 591 |
- return buttonLinkAnd; |
|
| 592 |
- } |
|
| 593 |
- |
|
| 594 |
- public void setButtonLinkAnd(String buttonLinkAnd) {
|
|
| 595 |
- this.buttonLinkAnd = buttonLinkAnd; |
|
| 596 |
- } |
|
| 597 |
- |
|
| 598 |
- public String getButtonLinkIos() {
|
|
| 599 |
- return buttonLinkIos; |
|
| 600 |
- } |
|
| 601 |
- |
|
| 602 |
- public void setButtonLinkIos(String buttonLinkIos) {
|
|
| 603 |
- this.buttonLinkIos = buttonLinkIos; |
|
| 604 |
- } |
|
| 605 |
- |
|
| 606 |
- public String getButtonLinkMo() {
|
|
| 607 |
- return buttonLinkMo; |
|
| 608 |
- } |
|
| 609 |
- |
|
| 610 |
- public void setButtonLinkMo(String buttonLinkMo) {
|
|
| 611 |
- this.buttonLinkMo = buttonLinkMo; |
|
| 612 |
- } |
|
| 613 |
- |
|
| 614 |
- public String getButtonLinkPc() {
|
|
| 615 |
- return buttonLinkPc; |
|
| 616 |
- } |
|
| 617 |
- |
|
| 618 |
- public void setButtonLinkPc(String buttonLinkPc) {
|
|
| 619 |
- this.buttonLinkPc = buttonLinkPc; |
|
| 620 |
- } |
|
| 621 |
- |
|
| 622 |
- public String getButtonPluginId() {
|
|
| 623 |
- return buttonPluginId; |
|
| 624 |
- } |
|
| 625 |
- |
|
| 626 |
- public void setButtonPluginId(String buttonPluginId) {
|
|
| 627 |
- this.buttonPluginId = buttonPluginId; |
|
| 628 |
- } |
|
| 629 |
- |
|
| 630 |
- public String getQuickName() {
|
|
| 631 |
- return quickName; |
|
| 632 |
- } |
|
| 633 |
- |
|
| 634 |
- public void setQuickName(String quickName) {
|
|
| 635 |
- this.quickName = quickName; |
|
| 636 |
- } |
|
| 637 |
- |
|
| 638 |
- public String getQuickLinkType() {
|
|
| 639 |
- return quickLinkType; |
|
| 640 |
- } |
|
| 641 |
- |
|
| 642 |
- public void setQuickLinkType(String quickLinkType) {
|
|
| 643 |
- this.quickLinkType = quickLinkType; |
|
| 644 |
- } |
|
| 645 |
- |
|
| 646 |
- public String getQuickLinkAnd() {
|
|
| 647 |
- return quickLinkAnd; |
|
| 648 |
- } |
|
| 649 |
- |
|
| 650 |
- public void setQuickLinkAnd(String quickLinkAnd) {
|
|
| 651 |
- this.quickLinkAnd = quickLinkAnd; |
|
| 652 |
- } |
|
| 653 |
- |
|
| 654 |
- public String getQuickLinkIos() {
|
|
| 655 |
- return quickLinkIos; |
|
| 656 |
- } |
|
| 657 |
- |
|
| 658 |
- public void setQuickLinkIos(String quickLinkIos) {
|
|
| 659 |
- this.quickLinkIos = quickLinkIos; |
|
| 660 |
- } |
|
| 661 |
- |
|
| 662 |
- public String getQuickLinkMo() {
|
|
| 663 |
- return quickLinkMo; |
|
| 664 |
- } |
|
| 665 |
- |
|
| 666 |
- public void setQuickLinkMo(String quickLinkMo) {
|
|
| 667 |
- this.quickLinkMo = quickLinkMo; |
|
| 668 |
- } |
|
| 669 |
- |
|
| 670 |
- public String getQuickLinkPc() {
|
|
| 671 |
- return quickLinkPc; |
|
| 672 |
- } |
|
| 673 |
- |
|
| 674 |
- public void setQuickLinkPc(String quickLinkPc) {
|
|
| 675 |
- this.quickLinkPc = quickLinkPc; |
|
| 676 |
- } |
|
| 677 |
- |
|
| 678 |
- public String getSenderKeyType() {
|
|
| 679 |
- return senderKeyType; |
|
| 680 |
- } |
|
| 681 |
- |
|
| 682 |
- public void setSenderKeyType(String senderKeyType) {
|
|
| 683 |
- this.senderKeyType = senderKeyType; |
|
| 684 |
- } |
|
| 685 |
- |
|
| 686 |
- public String getDeleteYn() {
|
|
| 687 |
- return deleteYn; |
|
| 688 |
- } |
|
| 689 |
- |
|
| 690 |
- public void setDeleteYn(String deleteYn) {
|
|
| 691 |
- this.deleteYn = deleteYn; |
|
| 692 |
- } |
|
| 693 |
- |
|
| 694 |
- public String getTemplateCode() {
|
|
| 695 |
- return templateCode; |
|
| 696 |
- } |
|
| 697 |
- |
|
| 698 |
- public void setTemplateCode(String templateCode) {
|
|
| 699 |
- this.templateCode = templateCode; |
|
| 700 |
- } |
|
| 701 |
- |
|
| 702 |
- public String getNewTemplateCode() {
|
|
| 703 |
- return newTemplateCode; |
|
| 704 |
- } |
|
| 705 |
- |
|
| 706 |
- public void setNewTemplateCode(String newTemplateCode) {
|
|
| 707 |
- this.newTemplateCode = newTemplateCode; |
|
| 708 |
- } |
|
| 709 |
- |
|
| 710 |
- public String[] getArrTemplateCode() {
|
|
| 711 |
- return arrTemplateCode; |
|
| 712 |
- } |
|
| 713 |
- |
|
| 714 |
- public void setArrTemplateCode(String[] arrTemplateCode) {
|
|
| 715 |
- this.arrTemplateCode = arrTemplateCode; |
|
| 716 |
- } |
|
| 717 |
- |
|
| 718 |
- public String getTemplateStatus() {
|
|
| 719 |
- return templateStatus; |
|
| 720 |
- } |
|
| 721 |
- |
|
| 722 |
- public void setTemplateStatus(String templateStatus) {
|
|
| 723 |
- this.templateStatus = templateStatus; |
|
| 724 |
- } |
|
| 725 |
- |
|
| 726 |
- public String getKeyword() {
|
|
| 727 |
- return keyword; |
|
| 728 |
- } |
|
| 729 |
- |
|
| 730 |
- public void setKeyword(String keyword) {
|
|
| 731 |
- this.keyword = keyword; |
|
| 732 |
- } |
|
| 733 |
- |
|
| 734 |
- public String getSendPhone() {
|
|
| 735 |
- return sendPhone; |
|
| 736 |
- } |
|
| 737 |
- |
|
| 738 |
- public void setSendPhone(String sendPhone) {
|
|
| 739 |
- this.sendPhone = sendPhone; |
|
| 740 |
- } |
|
| 741 |
- |
|
| 742 |
- public String getDestPhone() {
|
|
| 743 |
- return destPhone; |
|
| 744 |
- } |
|
| 745 |
- |
|
| 746 |
- public void setDestPhone(String destPhone) {
|
|
| 747 |
- this.destPhone = destPhone; |
|
| 748 |
- } |
|
| 749 |
- |
|
| 750 |
- public String getSubMsgSendYn() {
|
|
| 751 |
- return subMsgSendYn; |
|
| 752 |
- } |
|
| 753 |
- |
|
| 754 |
- public void setSubMsgSendYn(String subMsgSendYn) {
|
|
| 755 |
- this.subMsgSendYn = subMsgSendYn; |
|
| 756 |
- } |
|
| 757 |
- |
|
| 758 |
- public String getCount() {
|
|
| 759 |
- return count; |
|
| 760 |
- } |
|
| 761 |
- |
|
| 762 |
- public void setCount(String count) {
|
|
| 763 |
- this.count = count; |
|
| 764 |
- } |
|
| 765 |
- |
|
| 766 |
- public String getPage() {
|
|
| 767 |
- return page; |
|
| 768 |
- } |
|
| 769 |
- |
|
| 770 |
- public void setPage(String page) {
|
|
| 771 |
- this.page = page; |
|
| 772 |
- } |
|
| 773 |
- |
|
| 774 |
- public String getBizUmid() {
|
|
| 775 |
- return bizUmid; |
|
| 776 |
- } |
|
| 777 |
- |
|
| 778 |
- public void setBizUmid(String bizUmid) {
|
|
| 779 |
- this.bizUmid = bizUmid; |
|
| 780 |
- } |
|
| 781 |
- |
|
| 782 |
- public List<String> getVarNmList() {
|
|
| 783 |
- return varNmList; |
|
| 784 |
- } |
|
| 785 |
- |
|
| 786 |
- public void setVarNmList(List<String> varNmList) {
|
|
| 787 |
- this.varNmList = varNmList; |
|
| 788 |
- } |
|
| 789 |
- |
|
| 790 |
- public List<String[]> getVarValList() {
|
|
| 791 |
- return varValList; |
|
| 792 |
- } |
|
| 793 |
- |
|
| 794 |
- public void setVarValList(List<String[]> varValList) {
|
|
| 795 |
- this.varValList = varValList; |
|
| 796 |
- } |
|
| 797 |
- |
|
| 798 |
- public String getFormListType() {
|
|
| 799 |
- return formListType; |
|
| 800 |
- } |
|
| 801 |
- |
|
| 802 |
- public void setFormListType(String formListType) {
|
|
| 803 |
- this.formListType = formListType; |
|
| 804 |
- } |
|
| 805 |
- |
|
| 806 |
- public String getSubMsgTxt() {
|
|
| 807 |
- return subMsgTxt; |
|
| 808 |
- } |
|
| 809 |
- |
|
| 810 |
- public void setSubMsgTxt(String subMsgTxt) {
|
|
| 811 |
- this.subMsgTxt = subMsgTxt; |
|
| 812 |
- } |
|
| 813 |
- |
|
| 814 |
- public String getBizJsonYn() {
|
|
| 815 |
- return bizJsonYn; |
|
| 816 |
- } |
|
| 817 |
- |
|
| 818 |
- public void setBizJsonYn(String bizJsonYn) {
|
|
| 819 |
- this.bizJsonYn = bizJsonYn; |
|
| 820 |
- } |
|
| 821 |
- |
|
| 822 |
- public String getSendType() {
|
|
| 823 |
- return sendType; |
|
| 824 |
- } |
|
| 825 |
- |
|
| 826 |
- public void setSendType(String sendType) {
|
|
| 827 |
- this.sendType = sendType; |
|
| 828 |
- } |
|
| 829 |
- |
|
| 830 |
- public String getAdFlag() {
|
|
| 831 |
- return adFlag; |
|
| 832 |
- } |
|
| 833 |
- |
|
| 834 |
- public void setAdFlag(String adFlag) {
|
|
| 835 |
- this.adFlag = adFlag; |
|
| 836 |
- } |
|
| 837 |
- |
|
| 838 |
- public List<KakaoVO> getKakaoSendList() {
|
|
| 839 |
- return kakaoSendList; |
|
| 840 |
- } |
|
| 841 |
- |
|
| 842 |
- public void setKakaoSendList(List<KakaoVO> kakaoSendList) {
|
|
| 843 |
- this.kakaoSendList = kakaoSendList; |
|
| 844 |
- } |
|
| 845 |
- |
|
| 846 |
- public String getSubMsgTxtReplYn() {
|
|
| 847 |
- return subMsgTxtReplYn; |
|
| 848 |
- } |
|
| 849 |
- |
|
| 850 |
- public void setSubMsgTxtReplYn(String subMsgTxtReplYn) {
|
|
| 851 |
- this.subMsgTxtReplYn = subMsgTxtReplYn; |
|
| 852 |
- } |
|
| 853 |
- |
|
| 854 |
- public String getSubMsgType() {
|
|
| 855 |
- return subMsgType; |
|
| 856 |
- } |
|
| 857 |
- |
|
| 858 |
- public void setSubMsgType(String subMsgType) {
|
|
| 859 |
- this.subMsgType = subMsgType; |
|
| 860 |
- } |
|
| 861 |
- public List<String[]> varValPaser(String[] varValList){
|
|
| 862 |
- |
|
| 863 |
- List<String[]> returnVarVal = new ArrayList<>(); |
|
| 864 |
- |
|
| 865 |
- for(String varVal : varValList) |
|
| 866 |
- {
|
|
| 867 |
- String[] strList = varVal.split("§");
|
|
| 868 |
- returnVarVal.add(strList); |
|
| 265 |
+ @Override |
|
| 266 |
+ public String toString() {
|
|
| 267 |
+ String varListMapString = "["; |
|
| 268 |
+ if (varListMap != null && !varListMap.isEmpty()) {
|
|
| 269 |
+ StringBuilder sb = new StringBuilder(); |
|
| 270 |
+ for (Map<String, String> map : varListMap) {
|
|
| 271 |
+ if (sb.length() > 0) |
|
| 272 |
+ sb.append(", ");
|
|
| 273 |
+ if (map == null) {
|
|
| 274 |
+ sb.append("null");
|
|
| 275 |
+ } else {
|
|
| 276 |
+ sb.append("{");
|
|
| 277 |
+ String prefix = ""; |
|
| 278 |
+ for (Map.Entry<String, String> entry : map.entrySet()) {
|
|
| 279 |
+ sb.append(prefix).append(entry.getKey()).append("=").append(entry.getValue());
|
|
| 280 |
+ prefix = ", "; |
|
| 281 |
+ } |
|
| 282 |
+ sb.append("}");
|
|
| 283 |
+ } |
|
| 284 |
+ } |
|
| 285 |
+ varListMapString += sb.toString(); |
|
| 869 | 286 |
} |
| 287 |
+ varListMapString += "]"; |
|
| 870 | 288 |
|
| 871 |
- return returnVarVal; |
|
| 872 |
- } |
|
| 873 |
- |
|
| 874 |
- public String getMenuTopTab() {
|
|
| 875 |
- return menuTopTab; |
|
| 876 |
- } |
|
| 877 |
- |
|
| 878 |
- public void setMenuTopTab(String menuTopTab) {
|
|
| 879 |
- this.menuTopTab = menuTopTab; |
|
| 880 |
- } |
|
| 881 |
- |
|
| 882 |
- public String getMenuSubTab() {
|
|
| 883 |
- return menuSubTab; |
|
| 884 |
- } |
|
| 885 |
- |
|
| 886 |
- public void setMenuSubTab(String menuSubTab) {
|
|
| 887 |
- this.menuSubTab = menuSubTab; |
|
| 888 |
- } |
|
| 889 |
- |
|
| 890 |
- public String getSearchCondition2() {
|
|
| 891 |
- return searchCondition2; |
|
| 892 |
- } |
|
| 893 |
- |
|
| 894 |
- public void setSearchCondition2(String searchCondition2) {
|
|
| 895 |
- this.searchCondition2 = searchCondition2; |
|
| 896 |
- } |
|
| 897 |
- |
|
| 898 |
- public String getKakaoResendSuccCount() {
|
|
| 899 |
- return kakaoResendSuccCount; |
|
| 900 |
- } |
|
| 901 |
- |
|
| 902 |
- public void setKakaoResendSuccCount(String kakaoResendSuccCount) {
|
|
| 903 |
- this.kakaoResendSuccCount = kakaoResendSuccCount; |
|
| 904 |
- } |
|
| 905 |
- |
|
| 906 |
- public String getKakaoResendFailCount() {
|
|
| 907 |
- return kakaoResendFailCount; |
|
| 908 |
- } |
|
| 909 |
- |
|
| 910 |
- public void setKakaoResendFailCount(String kakaoResendFailCount) {
|
|
| 911 |
- this.kakaoResendFailCount = kakaoResendFailCount; |
|
| 912 |
- } |
|
| 913 |
- |
|
| 914 |
- public String getAtSuccessCount() {
|
|
| 915 |
- return atSuccessCount; |
|
| 916 |
- } |
|
| 917 |
- |
|
| 918 |
- public void setAtSuccessCount(String atSuccessCount) {
|
|
| 919 |
- this.atSuccessCount = atSuccessCount; |
|
| 920 |
- } |
|
| 921 |
- |
|
| 922 |
- public String getFtSuccessCount() {
|
|
| 923 |
- return ftSuccessCount; |
|
| 924 |
- } |
|
| 925 |
- |
|
| 926 |
- public void setFtSuccessCount(String ftSuccessCount) {
|
|
| 927 |
- this.ftSuccessCount = ftSuccessCount; |
|
| 928 |
- } |
|
| 929 |
- |
|
| 930 |
- public String getAtFailCount() {
|
|
| 931 |
- return atFailCount; |
|
| 932 |
- } |
|
| 933 |
- |
|
| 934 |
- public void setAtFailCount(String atFailCount) {
|
|
| 935 |
- this.atFailCount = atFailCount; |
|
| 936 |
- } |
|
| 937 |
- |
|
| 938 |
- public String getFtFailCount() {
|
|
| 939 |
- return ftFailCount; |
|
| 940 |
- } |
|
| 941 |
- |
|
| 942 |
- public void setFtFailCount(String ftFailCount) {
|
|
| 943 |
- this.ftFailCount = ftFailCount; |
|
| 944 |
- } |
|
| 945 |
- |
|
| 946 |
- public String getAtSuccPrice() {
|
|
| 947 |
- return atSuccPrice; |
|
| 948 |
- } |
|
| 949 |
- |
|
| 950 |
- public void setAtSuccPrice(String atSuccPrice) {
|
|
| 951 |
- this.atSuccPrice = atSuccPrice; |
|
| 952 |
- } |
|
| 953 |
- |
|
| 954 |
- public String getFtSuccPrice() {
|
|
| 955 |
- return ftSuccPrice; |
|
| 956 |
- } |
|
| 957 |
- |
|
| 958 |
- public void setFtSuccPrice(String ftSuccPrice) {
|
|
| 959 |
- this.ftSuccPrice = ftSuccPrice; |
|
| 960 |
- } |
|
| 961 |
- |
|
| 962 |
- public String getAtFailPrice() {
|
|
| 963 |
- return atFailPrice; |
|
| 964 |
- } |
|
| 965 |
- |
|
| 966 |
- public void setAtFailPrice(String atFailPrice) {
|
|
| 967 |
- this.atFailPrice = atFailPrice; |
|
| 968 |
- } |
|
| 969 |
- |
|
| 970 |
- public String getFtFailPrice() {
|
|
| 971 |
- return ftFailPrice; |
|
| 972 |
- } |
|
| 973 |
- |
|
| 974 |
- public void setFtFailPrice(String ftFailPrice) {
|
|
| 975 |
- this.ftFailPrice = ftFailPrice; |
|
| 976 |
- } |
|
| 977 |
- |
|
| 978 |
- public String getKakaoResendSuccPrice() {
|
|
| 979 |
- return kakaoResendSuccPrice; |
|
| 980 |
- } |
|
| 981 |
- |
|
| 982 |
- public void setKakaoResendSuccPrice(String kakaoResendSuccPrice) {
|
|
| 983 |
- this.kakaoResendSuccPrice = kakaoResendSuccPrice; |
|
| 984 |
- } |
|
| 985 |
- |
|
| 986 |
- public String getKakaoResendFailPrice() {
|
|
| 987 |
- return kakaoResendFailPrice; |
|
| 988 |
- } |
|
| 989 |
- |
|
| 990 |
- public void setKakaoResendFailPrice(String kakaoResendFailPrice) {
|
|
| 991 |
- this.kakaoResendFailPrice = kakaoResendFailPrice; |
|
| 992 |
- } |
|
| 993 |
- |
|
| 994 |
- public String getAtSuccCntSum() {
|
|
| 995 |
- return atSuccCntSum; |
|
| 996 |
- } |
|
| 997 |
- |
|
| 998 |
- public void setAtSuccCntSum(String atSuccCntSum) {
|
|
| 999 |
- this.atSuccCntSum = atSuccCntSum; |
|
| 1000 |
- } |
|
| 1001 |
- |
|
| 1002 |
- public String getFtSuccCntSum() {
|
|
| 1003 |
- return ftSuccCntSum; |
|
| 1004 |
- } |
|
| 1005 |
- |
|
| 1006 |
- public void setFtSuccCntSum(String ftSuccCntSum) {
|
|
| 1007 |
- this.ftSuccCntSum = ftSuccCntSum; |
|
| 1008 |
- } |
|
| 1009 |
- |
|
| 1010 |
- public String getAtFailCntSum() {
|
|
| 1011 |
- return atFailCntSum; |
|
| 1012 |
- } |
|
| 1013 |
- |
|
| 1014 |
- public void setAtFailCntSum(String atFailCntSum) {
|
|
| 1015 |
- this.atFailCntSum = atFailCntSum; |
|
| 1016 |
- } |
|
| 1017 |
- |
|
| 1018 |
- public String getFtFailCntSum() {
|
|
| 1019 |
- return ftFailCntSum; |
|
| 1020 |
- } |
|
| 1021 |
- |
|
| 1022 |
- public void setFtFailCntSum(String ftFailCntSum) {
|
|
| 1023 |
- this.ftFailCntSum = ftFailCntSum; |
|
| 1024 |
- } |
|
| 1025 |
- |
|
| 1026 |
- public String getKakaoResenSuccSum() {
|
|
| 1027 |
- return kakaoResenSuccSum; |
|
| 1028 |
- } |
|
| 1029 |
- |
|
| 1030 |
- public void setKakaoResenSuccSum(String kakaoResenSuccSum) {
|
|
| 1031 |
- this.kakaoResenSuccSum = kakaoResenSuccSum; |
|
| 1032 |
- } |
|
| 1033 |
- |
|
| 1034 |
- public String getKakaoResenFailSum() {
|
|
| 1035 |
- return kakaoResenFailSum; |
|
| 1036 |
- } |
|
| 1037 |
- |
|
| 1038 |
- public void setKakaoResenFailSum(String kakaoResenFailSum) {
|
|
| 1039 |
- this.kakaoResenFailSum = kakaoResenFailSum; |
|
| 1040 |
- } |
|
| 1041 |
- |
|
| 1042 |
- public String getAtSuccPriceSum() {
|
|
| 1043 |
- return atSuccPriceSum; |
|
| 1044 |
- } |
|
| 1045 |
- |
|
| 1046 |
- public void setAtSuccPriceSum(String atSuccPriceSum) {
|
|
| 1047 |
- this.atSuccPriceSum = atSuccPriceSum; |
|
| 1048 |
- } |
|
| 1049 |
- |
|
| 1050 |
- public String getFtSuccPriceSum() {
|
|
| 1051 |
- return ftSuccPriceSum; |
|
| 1052 |
- } |
|
| 1053 |
- |
|
| 1054 |
- public void setFtSuccPriceSum(String ftSuccPriceSum) {
|
|
| 1055 |
- this.ftSuccPriceSum = ftSuccPriceSum; |
|
| 1056 |
- } |
|
| 1057 |
- |
|
| 1058 |
- public String getAtFailPriceSum() {
|
|
| 1059 |
- return atFailPriceSum; |
|
| 1060 |
- } |
|
| 1061 |
- |
|
| 1062 |
- public void setAtFailPriceSum(String atFailPriceSum) {
|
|
| 1063 |
- this.atFailPriceSum = atFailPriceSum; |
|
| 1064 |
- } |
|
| 1065 |
- |
|
| 1066 |
- public String getFtFailPriceSum() {
|
|
| 1067 |
- return ftFailPriceSum; |
|
| 1068 |
- } |
|
| 1069 |
- |
|
| 1070 |
- public void setFtFailPriceSum(String ftFailPriceSum) {
|
|
| 1071 |
- this.ftFailPriceSum = ftFailPriceSum; |
|
| 1072 |
- } |
|
| 1073 |
- |
|
| 1074 |
- public String getKakaoResendSuccPriceSum() {
|
|
| 1075 |
- return kakaoResendSuccPriceSum; |
|
| 1076 |
- } |
|
| 1077 |
- |
|
| 1078 |
- public void setKakaoResendSuccPriceSum(String kakaoResendSuccPriceSum) {
|
|
| 1079 |
- this.kakaoResendSuccPriceSum = kakaoResendSuccPriceSum; |
|
| 1080 |
- } |
|
| 1081 |
- |
|
| 1082 |
- public String getKakaoResendFailPriceSum() {
|
|
| 1083 |
- return kakaoResendFailPriceSum; |
|
| 1084 |
- } |
|
| 1085 |
- |
|
| 1086 |
- public void setKakaoResendFailPriceSum(String kakaoResendFailPriceSum) {
|
|
| 1087 |
- this.kakaoResendFailPriceSum = kakaoResendFailPriceSum; |
|
| 1088 |
- } |
|
| 1089 |
- |
|
| 1090 |
- public String getFriendId() {
|
|
| 1091 |
- return friendId; |
|
| 1092 |
- } |
|
| 1093 |
- |
|
| 1094 |
- public void setFriendId(String friendId) {
|
|
| 1095 |
- this.friendId = friendId; |
|
| 1096 |
- } |
|
| 1097 |
- |
|
| 1098 |
- public String getImageTitle() {
|
|
| 1099 |
- return imageTitle; |
|
| 1100 |
- } |
|
| 1101 |
- |
|
| 1102 |
- public void setImageTitle(String imageTitle) {
|
|
| 1103 |
- this.imageTitle = imageTitle; |
|
| 1104 |
- } |
|
| 1105 |
- |
|
| 1106 |
- public String getImageLink() {
|
|
| 1107 |
- return imageLink; |
|
| 1108 |
- } |
|
| 1109 |
- |
|
| 1110 |
- public void setImageLink(String imageLink) {
|
|
| 1111 |
- this.imageLink = imageLink; |
|
| 1112 |
- } |
|
| 1113 |
- |
|
| 1114 |
- public String getJsonText() {
|
|
| 1115 |
- return jsonText; |
|
| 1116 |
- } |
|
| 1117 |
- |
|
| 1118 |
- public void setJsonText(String jsonText) {
|
|
| 1119 |
- this.jsonText = jsonText; |
|
| 1120 |
- } |
|
| 1121 |
- |
|
| 1122 |
- public String getImageFileName() {
|
|
| 1123 |
- return imageFileName; |
|
| 1124 |
- } |
|
| 1125 |
- |
|
| 1126 |
- public void setImageFileName(String imageFileName) {
|
|
| 1127 |
- this.imageFileName = imageFileName; |
|
| 1128 |
- } |
|
| 1129 |
- |
|
| 1130 |
- public String getSbscrbDe() {
|
|
| 1131 |
- return sbscrbDe; |
|
| 1132 |
- } |
|
| 1133 |
- |
|
| 1134 |
- public void setSbscrbDe(String sbscrbDe) {
|
|
| 1135 |
- this.sbscrbDe = sbscrbDe; |
|
| 1136 |
- } |
|
| 1137 |
- |
|
| 1138 |
- public String getMoblphonNo() {
|
|
| 1139 |
- return moblphonNo; |
|
| 1140 |
- } |
|
| 1141 |
- |
|
| 1142 |
- public void setMoblphonNo(String moblphonNo) {
|
|
| 1143 |
- this.moblphonNo = moblphonNo; |
|
| 1144 |
- } |
|
| 1145 |
- |
|
| 1146 |
- public String getDept() {
|
|
| 1147 |
- return dept; |
|
| 1148 |
- } |
|
| 1149 |
- |
|
| 1150 |
- public void setDept(String dept) {
|
|
| 1151 |
- this.dept = dept; |
|
| 1152 |
- } |
|
| 1153 |
- |
|
| 1154 |
- public String getAtchFileId() {
|
|
| 1155 |
- return atchFileId; |
|
| 1156 |
- } |
|
| 1157 |
- |
|
| 1158 |
- public void setAtchFileId(String atchFileId) {
|
|
| 1159 |
- this.atchFileId = atchFileId; |
|
| 1160 |
- } |
|
| 1161 |
- |
|
| 1162 |
- public String getWorkAtchFileId() {
|
|
| 1163 |
- return workAtchFileId; |
|
| 1164 |
- } |
|
| 1165 |
- |
|
| 1166 |
- public void setWorkAtchFileId(String workAtchFileId) {
|
|
| 1167 |
- this.workAtchFileId = workAtchFileId; |
|
| 1168 |
- } |
|
| 1169 |
- |
|
| 1170 |
- public String getFileSn() {
|
|
| 1171 |
- return fileSn; |
|
| 1172 |
- } |
|
| 1173 |
- |
|
| 1174 |
- public void setFileSn(String fileSn) {
|
|
| 1175 |
- this.fileSn = fileSn; |
|
| 1176 |
- } |
|
| 1177 |
- |
|
| 1178 |
- public String getFileCn() {
|
|
| 1179 |
- return fileCn; |
|
| 1180 |
- } |
|
| 1181 |
- |
|
| 1182 |
- public void setFileCn(String fileCn) {
|
|
| 1183 |
- this.fileCn = fileCn; |
|
| 1184 |
- } |
|
| 1185 |
- |
|
| 1186 |
- public String getFileStreCours() {
|
|
| 1187 |
- return fileStreCours; |
|
| 1188 |
- } |
|
| 1189 |
- |
|
| 1190 |
- public void setFileStreCours(String fileStreCours) {
|
|
| 1191 |
- this.fileStreCours = fileStreCours; |
|
| 1192 |
- } |
|
| 1193 |
- |
|
| 1194 |
- public String getOrignlFileNm() {
|
|
| 1195 |
- return orignlFileNm; |
|
| 1196 |
- } |
|
| 1197 |
- |
|
| 1198 |
- public void setOrignlFileNm(String orignlFileNm) {
|
|
| 1199 |
- this.orignlFileNm = orignlFileNm; |
|
| 1200 |
- } |
|
| 1201 |
- |
|
| 1202 |
- public String getStreFileNm() {
|
|
| 1203 |
- return streFileNm; |
|
| 1204 |
- } |
|
| 1205 |
- |
|
| 1206 |
- public void setStreFileNm(String streFileNm) {
|
|
| 1207 |
- this.streFileNm = streFileNm; |
|
| 1208 |
- } |
|
| 1209 |
- |
|
| 1210 |
- public String getFileExtsn() {
|
|
| 1211 |
- return fileExtsn; |
|
| 1212 |
- } |
|
| 1213 |
- |
|
| 1214 |
- public void setFileExtsn(String fileExtsn) {
|
|
| 1215 |
- this.fileExtsn = fileExtsn; |
|
| 1216 |
- } |
|
| 1217 |
- |
|
| 1218 |
- public String getFileSize() {
|
|
| 1219 |
- return fileSize; |
|
| 1220 |
- } |
|
| 1221 |
- |
|
| 1222 |
- public void setFileSize(String fileSize) {
|
|
| 1223 |
- this.fileSize = fileSize; |
|
| 1224 |
- } |
|
| 1225 |
- |
|
| 1226 |
- public int getStartCount() {
|
|
| 1227 |
- return startCount; |
|
| 1228 |
- } |
|
| 1229 |
- |
|
| 1230 |
- public void setStartCount(int startCount) {
|
|
| 1231 |
- this.startCount = startCount; |
|
| 1232 |
- } |
|
| 1233 |
- |
|
| 1234 |
- public int getEndCount() {
|
|
| 1235 |
- return endCount; |
|
| 1236 |
- } |
|
| 1237 |
- |
|
| 1238 |
- public void setEndCount(int endCount) {
|
|
| 1239 |
- this.endCount = endCount; |
|
| 1240 |
- } |
|
| 1241 |
- |
|
| 1242 |
- public String getPhmType() {
|
|
| 1243 |
- return phmType; |
|
| 1244 |
- } |
|
| 1245 |
- |
|
| 1246 |
- public void setPhmType(String phmType) {
|
|
| 1247 |
- this.phmType = phmType; |
|
| 1248 |
- } |
|
| 1249 |
- |
|
| 1250 |
- public String getMsgResendAllFlag() {
|
|
| 1251 |
- return msgResendAllFlag; |
|
| 1252 |
- } |
|
| 1253 |
- |
|
| 1254 |
- public void setMsgResendAllFlag(String msgResendAllFlag) {
|
|
| 1255 |
- this.msgResendAllFlag = msgResendAllFlag; |
|
| 1256 |
- } |
|
| 1257 |
- |
|
| 1258 |
- public String getMsgResendAllGroupId() {
|
|
| 1259 |
- return msgResendAllGroupId; |
|
| 1260 |
- } |
|
| 1261 |
- |
|
| 1262 |
- public void setMsgResendAllGroupId(String msgResendAllGroupId) {
|
|
| 1263 |
- this.msgResendAllGroupId = msgResendAllGroupId; |
|
| 1264 |
- } |
|
| 1265 |
- |
|
| 1266 |
- public String getMsgResendAllTmpKey() {
|
|
| 1267 |
- return msgResendAllTmpKey; |
|
| 1268 |
- } |
|
| 1269 |
- |
|
| 1270 |
- public void setMsgResendAllTmpKey(String msgResendAllTmpKey) {
|
|
| 1271 |
- this.msgResendAllTmpKey = msgResendAllTmpKey; |
|
| 1272 |
- } |
|
| 1273 |
- |
|
| 1274 |
- public String getMsgResendAllYellowId() {
|
|
| 1275 |
- return msgResendAllYellowId; |
|
| 1276 |
- } |
|
| 1277 |
- |
|
| 1278 |
- public void setMsgResendAllYellowId(String msgResendAllYellowId) {
|
|
| 1279 |
- this.msgResendAllYellowId = msgResendAllYellowId; |
|
| 289 |
+ return "KakaoSendAdvcVO[" + |
|
| 290 |
+ "\n senderKey=[" + senderKey + "]" + |
|
| 291 |
+ "\n , subMsgTxtReplYn=[" + subMsgTxtReplYn + "]" + |
|
| 292 |
+ "\n , subMsgSendYn=[" + subMsgSendYn + "]" + |
|
| 293 |
+ "\n , reserveYn=[" + getReserveYn() + "]" + |
|
| 294 |
+ "\n , divideCnt=[" + getDivideCnt() + "]" + |
|
| 295 |
+ "\n , bizJsonYn=[" + bizJsonYn + "]" + |
|
| 296 |
+ "\n , templateEmphasizeType=[" + templateEmphasizeType + "]" + |
|
| 297 |
+ "\n , templateSubtitle=[" + templateSubtitle + "]" + |
|
| 298 |
+ "\n , txtReplYn=[" + getTxtReplYn() + "]" + |
|
| 299 |
+ "\n , callFrom=[" + getCallFrom() + "]" + |
|
| 300 |
+ "\n , templateCode=[" + templateCode + "]" + |
|
| 301 |
+ "\n , divideTime=[" + getDivideTime() + "]" + |
|
| 302 |
+ "\n , reqDate=[" + getReqDate() + "]" + |
|
| 303 |
+ "\n , atSmishingYn=[" + getAtSmishingYn() + "]" + |
|
| 304 |
+ "\n , menuTopTab=[" + menuTopTab + "]" + |
|
| 305 |
+ "\n , templateContent=[" + templateContent + "]" + |
|
| 306 |
+ "\n , templateTitle=[" + templateTitle + "]" + |
|
| 307 |
+ "\n , subMsgTxt=[" + subMsgTxt + "]" + |
|
| 308 |
+ "\n , divideChk=[" + getDivideChk() + "]" + |
|
| 309 |
+ "\n , sendType=[" + sendType + "]" + |
|
| 310 |
+ "\n , msgType=[" + getMsgType() + "]" + |
|
| 311 |
+ "\n , userId=[" + userId + "]" + |
|
| 312 |
+ "\n , varListMap=[" + varListMapString + "]" + |
|
| 313 |
+ "\n , befCash=[" + getBefCash() + "]" + |
|
| 314 |
+ "\n , befPoint=[" + getBefPoint() + "]" + |
|
| 315 |
+ "\n ]"; |
|
| 1280 | 316 |
} |
| 1281 |
- |
|
| 1282 | 317 |
|
| 1283 | 318 |
|
| 1284 | 319 |
} |
--- src/main/java/itn/let/kakao/kakaoComm/kakaoApi/KakaoApiJsonSave.java
+++ src/main/java/itn/let/kakao/kakaoComm/kakaoApi/KakaoApiJsonSave.java
... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 |
import java.text.SimpleDateFormat; |
| 9 | 9 |
import java.util.Date; |
| 10 | 10 |
import java.util.List; |
| 11 |
+import java.util.Map; |
|
| 11 | 12 |
|
| 12 | 13 |
import org.json.simple.JSONArray; |
| 13 | 14 |
import org.json.simple.JSONObject; |
... | ... | @@ -18,6 +19,7 @@ |
| 18 | 19 |
import itn.com.cmm.util.StringUtil; |
| 19 | 20 |
import itn.let.kakao.kakaoComm.KakaoButtonVO; |
| 20 | 21 |
import itn.let.kakao.kakaoComm.KakaoReturnVO; |
| 22 |
+import itn.let.kakao.kakaoComm.KakaoSendAdvcVO; |
|
| 21 | 23 |
import itn.let.kakao.kakaoComm.KakaoVO; |
| 22 | 24 |
|
| 23 | 25 |
@Component |
... | ... | @@ -32,7 +34,57 @@ |
| 32 | 34 |
|
| 33 | 35 |
static String json; |
| 34 | 36 |
|
| 35 |
- @SuppressWarnings("unchecked")
|
|
| 37 |
+ public String kakaoApiJsonSave_advc(KakaoSendAdvcVO sendVO, KakaoReturnVO templateDetail) {
|
|
| 38 |
+ |
|
| 39 |
+ // 버튼리스트 JSON 생성 |
|
| 40 |
+ JSONArray buttonList = new JSONArray(); |
|
| 41 |
+ for(KakaoButtonVO buttonInfoVO : sendVO.getButtonList()) {
|
|
| 42 |
+ JSONObject buttonInfo = new JSONObject(); |
|
| 43 |
+ |
|
| 44 |
+ buttonInfo.put("name", buttonInfoVO.getName());
|
|
| 45 |
+ buttonInfo.put("type", buttonInfoVO.getLinkType());
|
|
| 46 |
+ |
|
| 47 |
+ if(buttonInfoVO.getLinkType().equals("WL")) {
|
|
| 48 |
+ buttonInfo.put("url_mobile", buttonInfoVO.getLinkMo());
|
|
| 49 |
+ buttonInfo.put("url_pc", buttonInfoVO.getLinkPc());
|
|
| 50 |
+ }else if(buttonInfoVO.getLinkType().equals("AL")) {
|
|
| 51 |
+ buttonInfo.put("scheme_ios", buttonInfoVO.getLinkIos());
|
|
| 52 |
+ buttonInfo.put("scheme_android", buttonInfoVO.getLinkAnd());
|
|
| 53 |
+ }else if(buttonInfoVO.getLinkType().equals("BC")) {
|
|
| 54 |
+ // 상담톡 진행시 등록해야함 |
|
| 55 |
+ }else if(buttonInfoVO.getLinkType().equals("BT")) {
|
|
| 56 |
+ // 봇 전환 시 전달 |
|
| 57 |
+ } |
|
| 58 |
+ buttonList.add(buttonInfo); |
|
| 59 |
+ } |
|
| 60 |
+ |
|
| 61 |
+ // 강조유형 JSON 생성 |
|
| 62 |
+ JSONObject templateDetailInfo = new JSONObject(); |
|
| 63 |
+ String emphasizeType = templateDetail.getTemplateEmphasizeType(); |
|
| 64 |
+ |
|
| 65 |
+ |
|
| 66 |
+ if(emphasizeType.equals("TEXT")) {
|
|
| 67 |
+ templateDetailInfo.put("title", sendVO.getTemplateTitle());
|
|
| 68 |
+ }else if(emphasizeType.equals("IMAGE")) {
|
|
| 69 |
+ templateDetailInfo.put("msg_type", "ai");
|
|
| 70 |
+ } |
|
| 71 |
+ |
|
| 72 |
+ |
|
| 73 |
+ JSONObject jo = new JSONObject(); |
|
| 74 |
+ |
|
| 75 |
+ if(buttonList.size() != 0) {
|
|
| 76 |
+ jo.put("button", buttonList);
|
|
| 77 |
+ } |
|
| 78 |
+ if(templateDetailInfo.size() != 0) {
|
|
| 79 |
+ jo.put("extra", templateDetailInfo);
|
|
| 80 |
+ } |
|
| 81 |
+ |
|
| 82 |
+ // 입력 json 데이터를 파일로 변경 |
|
| 83 |
+ String jsonStr = jo.toString(); |
|
| 84 |
+ |
|
| 85 |
+ return jsonStr; |
|
| 86 |
+ } |
|
| 87 |
+ |
|
| 36 | 88 |
public String kakaoApiJsonSave(KakaoVO kakaoVO, String[] varValInfo) {
|
| 37 | 89 |
// json파일 저장 |
| 38 | 90 |
|
... | ... | @@ -109,12 +161,12 @@ |
| 109 | 161 |
for(int i=0; i < varNm.length; i++) {
|
| 110 | 162 |
for(int j=0; j < varValInfo.length; j++) {
|
| 111 | 163 |
if (templateTitle.indexOf(varNm[i]) > -1) {
|
| 112 |
- if(varValInfo[j] != null) {
|
|
| 113 |
- templateTitle = templateTitle.replaceAll(varNm[i] , StringUtil.getString(varValInfo[j])); |
|
| 114 |
- }else {
|
|
| 115 |
- templateTitle = templateTitle.replaceAll(varNm[i] , ""); |
|
| 116 |
- } |
|
| 117 |
- } |
|
| 164 |
+ if(varValInfo[j] != null) {
|
|
| 165 |
+ templateTitle = templateTitle.replaceAll(varNm[i] , StringUtil.getString(varValInfo[j])); |
|
| 166 |
+ }else {
|
|
| 167 |
+ templateTitle = templateTitle.replaceAll(varNm[i] , ""); |
|
| 168 |
+ } |
|
| 169 |
+ } |
|
| 118 | 170 |
} |
| 119 | 171 |
} |
| 120 | 172 |
|
... | ... | @@ -140,8 +192,8 @@ |
| 140 | 192 |
|
| 141 | 193 |
// 입력 json 데이터를 파일로 변경 |
| 142 | 194 |
String jsonStr = jo.toString(); |
| 143 |
- System.out.println("jsonFileName : "+jsonFileName);
|
|
| 144 |
- |
|
| 195 |
+// System.out.println("jsonFileName : "+jsonFileName);
|
|
| 196 |
+ |
|
| 145 | 197 |
File outPut = new File(jsonFileName); |
| 146 | 198 |
outPut.createNewFile(); |
| 147 | 199 |
|
--- src/main/java/itn/let/kakao/user/kakaoAt/service/KakaoAlimTalkService.java
+++ src/main/java/itn/let/kakao/user/kakaoAt/service/KakaoAlimTalkService.java
... | ... | @@ -2,7 +2,11 @@ |
| 2 | 2 |
|
| 3 | 3 |
import java.util.List; |
| 4 | 4 |
|
| 5 |
+import javax.servlet.http.HttpServletRequest; |
|
| 6 |
+ |
|
| 7 |
+import itn.let.kakao.kakaoComm.KakaoSendAdvcVO; |
|
| 5 | 8 |
import itn.let.kakao.kakaoComm.KakaoVO; |
| 9 |
+import itn.let.mail.service.StatusResponse; |
|
| 6 | 10 |
import itn.let.mjo.msgdata.service.MjonMsgReturnVO; |
| 7 | 11 |
|
| 8 | 12 |
public interface KakaoAlimTalkService {
|
... | ... | @@ -24,5 +28,7 @@ |
| 24 | 28 |
|
| 25 | 29 |
//카카오 친구톡 전송 실패 환불리스트 조회 |
| 26 | 30 |
public void selectKakaoFtSentRefundList() throws Exception; |
| 31 |
+ |
|
| 32 |
+ StatusResponse insertKakaoAtSandAjax_advc(KakaoVO kakaoVO, HttpServletRequest request) throws Exception; |
|
| 27 | 33 |
|
| 28 | 34 |
} |
--- src/main/java/itn/let/kakao/user/kakaoAt/service/impl/KakaoAlimTalkDAO.java
+++ src/main/java/itn/let/kakao/user/kakaoAt/service/impl/KakaoAlimTalkDAO.java
... | ... | @@ -6,6 +6,7 @@ |
| 6 | 6 |
import org.springframework.stereotype.Repository; |
| 7 | 7 |
|
| 8 | 8 |
import egovframework.rte.psl.dataaccess.EgovAbstractDAO; |
| 9 |
+import itn.let.kakao.kakaoComm.KakaoSendAdvcVO; |
|
| 9 | 10 |
import itn.let.kakao.kakaoComm.KakaoVO; |
| 10 | 11 |
|
| 11 | 12 |
@Repository("kakaoAlimTalkDAO")
|
... | ... | @@ -39,15 +40,6 @@ |
| 39 | 40 |
} catch (Exception e) {
|
| 40 | 41 |
System.out.println("++++++++++++++++++++ selectDeleteProfileInfo DAO Error !!! " + e);
|
| 41 | 42 |
} |
| 42 |
- |
|
| 43 |
- return result; |
|
| 44 |
- } |
|
| 45 |
- |
|
| 46 |
- public int insertKakaoAtDataInfo(List<KakaoVO> kakaoAtSandList) throws Exception{
|
|
| 47 |
- |
|
| 48 |
- int result = 0; |
|
| 49 |
- |
|
| 50 |
- result = update("kakaoAlimTalkDAO.insertKakaoAtDataInfo", kakaoAtSandList);
|
|
| 51 | 43 |
|
| 52 | 44 |
return result; |
| 53 | 45 |
} |
... | ... | @@ -94,4 +86,26 @@ |
| 94 | 86 |
public void updateKakaoFtNotSend(KakaoVO kakaoVO) {
|
| 95 | 87 |
select("kakaoAlimTalkDAO.updateKakaoFtNotSend", kakaoVO);
|
| 96 | 88 |
} |
| 89 |
+ |
|
| 90 |
+ public int insertKakaoAtDataInfo(List<KakaoVO> kakaoAtSandList) throws Exception{
|
|
| 91 |
+ |
|
| 92 |
+ int result = 0; |
|
| 93 |
+ |
|
| 94 |
+ result = update("kakaoAlimTalkDAO.insertKakaoAtDataInfo", kakaoAtSandList);
|
|
| 95 |
+ |
|
| 96 |
+ return result; |
|
| 97 |
+ } |
|
| 98 |
+ |
|
| 99 |
+ public int insertKakaoAtDataInfo_advc(List<KakaoSendAdvcVO> kakaoSendAdvcVOList) {
|
|
| 100 |
+ |
|
| 101 |
+ return update("kakaoAlimTalkDAO.insertKakaoAtDataInfo_advc", kakaoSendAdvcVOList);
|
|
| 102 |
+ } |
|
| 103 |
+ |
|
| 104 |
+ public void insertKakaoAtDataJsonInfo_advc(List<KakaoSendAdvcVO> kakaoSendAdvcVOList) {
|
|
| 105 |
+ insert("kakaoAlimTalkDAO.insertKakaoAtDataJsonInfo_advc", kakaoSendAdvcVOList);
|
|
| 106 |
+ } |
|
| 107 |
+ |
|
| 108 |
+ public void insertKakaoGroupDataTb_advc(KakaoSendAdvcVO sendVO) {
|
|
| 109 |
+ insert("kakaoAlimTalkDAO.insertKakaoGroupDataTb_advc", sendVO);
|
|
| 110 |
+ } |
|
| 97 | 111 |
} |
--- src/main/java/itn/let/kakao/user/kakaoAt/service/impl/KakaoAlimTalkServiceImpl.java
+++ src/main/java/itn/let/kakao/user/kakaoAt/service/impl/KakaoAlimTalkServiceImpl.java
... | ... | @@ -1,19 +1,40 @@ |
| 1 | 1 |
package itn.let.kakao.user.kakaoAt.service.impl; |
| 2 | 2 |
|
| 3 |
+import java.math.BigDecimal; |
|
| 4 |
+import java.math.RoundingMode; |
|
| 3 | 5 |
import java.text.SimpleDateFormat; |
| 6 |
+import java.time.Duration; |
|
| 7 |
+import java.time.Instant; |
|
| 4 | 8 |
import java.util.ArrayList; |
| 5 | 9 |
import java.util.Calendar; |
| 6 | 10 |
import java.util.Date; |
| 11 |
+import java.util.HashMap; |
|
| 7 | 12 |
import java.util.List; |
| 13 |
+import java.util.Map; |
|
| 14 |
+import java.util.Objects; |
|
| 15 |
+import java.util.Set; |
|
| 16 |
+import java.util.stream.Collectors; |
|
| 8 | 17 |
|
| 9 | 18 |
import javax.annotation.Resource; |
| 19 |
+import javax.servlet.http.HttpServletRequest; |
|
| 10 | 20 |
|
| 21 |
+import org.apache.commons.lang3.StringUtils; |
|
| 22 |
+import org.springframework.beans.factory.annotation.Autowired; |
|
| 23 |
+import org.springframework.http.HttpStatus; |
|
| 11 | 24 |
import org.springframework.stereotype.Service; |
| 12 | 25 |
|
| 13 | 26 |
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl; |
| 14 | 27 |
import egovframework.rte.fdl.idgnr.EgovIdGnrService; |
| 28 |
+import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper; |
|
| 29 |
+import itn.com.cmm.LoginVO; |
|
| 30 |
+import itn.com.cmm.MjonMsgSendVO; |
|
| 31 |
+import itn.com.utl.fcc.service.EgovStringUtil; |
|
| 32 |
+import itn.let.kakao.kakaoComm.KakaoSendAdvcVO; |
|
| 33 |
+import itn.let.kakao.kakaoComm.KakaoSendUtil; |
|
| 15 | 34 |
import itn.let.kakao.kakaoComm.KakaoVO; |
| 16 | 35 |
import itn.let.kakao.user.kakaoAt.service.KakaoAlimTalkService; |
| 36 |
+import itn.let.mail.service.StatusResponse; |
|
| 37 |
+import itn.let.mjo.mjocommon.MjonCommon; |
|
| 17 | 38 |
import itn.let.mjo.mjocommon.MjonHolidayApi; |
| 18 | 39 |
import itn.let.mjo.msg.service.MjonMsgVO; |
| 19 | 40 |
import itn.let.mjo.msg.service.impl.MjonMsgDAO; |
... | ... | @@ -24,9 +45,14 @@ |
| 24 | 45 |
import itn.let.mjo.msgholiday.service.impl.MsgHolidayDAO; |
| 25 | 46 |
import itn.let.mjo.pay.service.MjonPayService; |
| 26 | 47 |
import itn.let.mjo.pay.service.MjonPayVO; |
| 48 |
+import itn.let.module.base.PriceAndPoint; |
|
| 27 | 49 |
import itn.let.sym.site.service.JoinSettingVO; |
| 28 | 50 |
import itn.let.sym.site.service.impl.SiteManagerDAO; |
| 51 |
+import itn.let.uss.umt.service.EgovUserManageService; |
|
| 52 |
+import itn.let.uss.umt.service.UserManageVO; |
|
| 53 |
+import lombok.extern.slf4j.Slf4j; |
|
| 29 | 54 |
|
| 55 |
+@Slf4j |
|
| 30 | 56 |
@Service("kakaoAlimTalkService")
|
| 31 | 57 |
public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements KakaoAlimTalkService{
|
| 32 | 58 |
|
... | ... | @@ -47,12 +73,28 @@ |
| 47 | 73 |
|
| 48 | 74 |
@Resource(name = "egovMjonMsgIdGnrService") |
| 49 | 75 |
private EgovIdGnrService idgenMsgId; |
| 76 |
+ |
|
| 77 |
+ @Resource(name = "egovMjonMsgGroupIdGnrService") |
|
| 78 |
+ private EgovIdGnrService idgenMjonMsgGroupId; |
|
| 50 | 79 |
|
| 51 | 80 |
@Resource(name = "mjonPayService") |
| 52 | 81 |
private MjonPayService mjonPayService; |
| 53 | 82 |
|
| 54 | 83 |
@Resource(name = "egovMjonCashIdGnrService") |
| 55 | 84 |
private EgovIdGnrService idgenMjonCashId; |
| 85 |
+ |
|
| 86 |
+ /** userManageService */ |
|
| 87 |
+ @Resource(name = "userManageService") |
|
| 88 |
+ private EgovUserManageService userManageService; |
|
| 89 |
+ |
|
| 90 |
+ @Autowired |
|
| 91 |
+ KakaoSendUtil kakaoSendUtil; |
|
| 92 |
+ |
|
| 93 |
+ @Autowired |
|
| 94 |
+ private MjonCommon mjonCommon; |
|
| 95 |
+ |
|
| 96 |
+ @Autowired |
|
| 97 |
+ private PriceAndPoint priceAndPoint; |
|
| 56 | 98 |
|
| 57 | 99 |
//발신프로필 상태값 변경(삭제/복구 기능) |
| 58 | 100 |
@Override |
... | ... | @@ -816,4 +858,341 @@ |
| 816 | 858 |
} |
| 817 | 859 |
} |
| 818 | 860 |
} |
| 861 |
+ |
|
| 862 |
+ @Override |
|
| 863 |
+ public StatusResponse insertKakaoAtSandAjax_advc(KakaoVO kakaoVO, HttpServletRequest request) throws Exception {
|
|
| 864 |
+ |
|
| 865 |
+ log.info(" :: [{}]", kakaoVO.toString());
|
|
| 866 |
+ |
|
| 867 |
+ |
|
| 868 |
+ // 측정할 메소드 호출 전 시간 기록 |
|
| 869 |
+ Instant start = Instant.now(); |
|
| 870 |
+// KakaoSendAdvcVO |
|
| 871 |
+ |
|
| 872 |
+ Map<String, Object> returnMap = new HashMap<>(); |
|
| 873 |
+ |
|
| 874 |
+ LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated() |
|
| 875 |
+ ? (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser() |
|
| 876 |
+ : null; |
|
| 877 |
+ String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId()); |
|
| 878 |
+ |
|
| 879 |
+ if (userId.equals("")) {
|
|
| 880 |
+ return new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용이 가능합니다."); |
|
| 881 |
+ } |
|
| 882 |
+ |
|
| 883 |
+ kakaoVO.setUserId(userId); |
|
| 884 |
+ |
|
| 885 |
+ /** |
|
| 886 |
+ * 회원 정지된 상태이면 문자 발송이 안되도록 처리함 현재 로그인 세션도 만료 처리함 |
|
| 887 |
+ */ |
|
| 888 |
+ boolean mberSttus = userManageService.selectUserStatusInfo(userId); |
|
| 889 |
+ if (!mberSttus) {
|
|
| 890 |
+ request.getSession().invalidate(); |
|
| 891 |
+ // UNAUTHORIZED : 인증되지 않은 사용자가 접근하려고 할 때 |
|
| 892 |
+ return new StatusResponse(HttpStatus.UNAUTHORIZED, |
|
| 893 |
+ "현재 고객님께서는 문자온 서비스 이용이 정지된 상태로 알림톡을 발송하실 수 없습니다. 이용정지 해제를 원하시면 고객센터로 연락주시기 바랍니다."); |
|
| 894 |
+ } |
|
| 895 |
+ |
|
| 896 |
+ |
|
| 897 |
+ StatusResponse statusResponse = new StatusResponse(); |
|
| 898 |
+ |
|
| 899 |
+/** @isHolidayNotified |
|
| 900 |
+ * @false : 알림 X |
|
| 901 |
+ * @true : 알림 O */ |
|
| 902 |
+ boolean isNotified = mjonCommon.processUserAndCheckAT(kakaoVO); |
|
| 903 |
+ |
|
| 904 |
+ |
|
| 905 |
+/** @LETTNGNRLMBER 사용자 정보 -> 스미싱의심 여부 */ |
|
| 906 |
+ UserManageVO userManageVO = mjonCommon.getUserManageInfo(userId); |
|
| 907 |
+ kakaoVO.setAtSmishingYn(userManageVO.getAtSmishingYn()); |
|
| 908 |
+ |
|
| 909 |
+/** @카카오톡 전송 list 셋팅 -------------------------------------------*/ |
|
| 910 |
+ List<KakaoSendAdvcVO> kakaoSendAdvcListVO = kakaoSendUtil.populateSendLists(kakaoVO, isNotified, statusResponse); |
|
| 911 |
+ if (statusResponse.getStatus() != null && !statusResponse.getStatus().equals(HttpStatus.OK)) {
|
|
| 912 |
+ log.error(" + populateSendLists 처리 중 오류 발생: {}", statusResponse.getMessage());
|
|
| 913 |
+ return statusResponse; |
|
| 914 |
+ } |
|
| 915 |
+ |
|
| 916 |
+ |
|
| 917 |
+ |
|
| 918 |
+/** @전송금액 확인 --------------------------------------------------*/ |
|
| 919 |
+ if (!isCashSufficient(userId, kakaoSendAdvcListVO)) {
|
|
| 920 |
+ log.error("Insufficient balance for message sending.");
|
|
| 921 |
+ return new StatusResponse(HttpStatus.BAD_REQUEST, "문자 발송에 필요한 보유 잔액이 부족 합니다."); |
|
| 922 |
+ } |
|
| 923 |
+ |
|
| 924 |
+ |
|
| 925 |
+ |
|
| 926 |
+ Map<String, List<KakaoSendAdvcVO>> priceGroupedMessages = kakaoSendAdvcListVO.stream() |
|
| 927 |
+ .collect(Collectors.groupingBy(KakaoSendAdvcVO::getEachPrice)); |
|
| 928 |
+ |
|
| 929 |
+ |
|
| 930 |
+ // instTotalCnt : 화면에서 보여줄 총 발송건수 |
|
| 931 |
+ int instTotalCnt = 0; |
|
| 932 |
+ // 임시 |
|
| 933 |
+ List<String> nextMsgGroupIdA = new ArrayList<>(); |
|
| 934 |
+ // 대안: entrySet() 직접 사용 |
|
| 935 |
+ for (Map.Entry<String, List<KakaoSendAdvcVO>> entry : priceGroupedMessages.entrySet()) {
|
|
| 936 |
+ // entry 사용 |
|
| 937 |
+ |
|
| 938 |
+ List<KakaoSendAdvcVO> groupedMsgList = entry.getValue(); // 해당 가격의 메시지 리스트 |
|
| 939 |
+ |
|
| 940 |
+ String nextMsgGroupId = idgenMjonMsgGroupId.getNextStringId(); |
|
| 941 |
+ groupedMsgList.forEach(t -> t.setMsgGroupId(nextMsgGroupId)); |
|
| 942 |
+ |
|
| 943 |
+ |
|
| 944 |
+ // 발송 데이터 삽입 |
|
| 945 |
+ int instCnt = this.insertKakaoData_advc(groupedMsgList); |
|
| 946 |
+// int instCnt = 6; |
|
| 947 |
+ |
|
| 948 |
+ if(instCnt > 0) {
|
|
| 949 |
+ |
|
| 950 |
+ instTotalCnt += instCnt; |
|
| 951 |
+ |
|
| 952 |
+ KakaoSendAdvcVO sendVO = groupedMsgList.get(0); |
|
| 953 |
+ |
|
| 954 |
+/** @groupData 테이블 insert */ |
|
| 955 |
+ this.insertKakaoGroupDataTb_advc(instCnt, kakaoVO, sendVO); |
|
| 956 |
+ |
|
| 957 |
+ |
|
| 958 |
+/** @biz_kakao_price에 insert (대체문자 환불관련 테이블)*/ |
|
| 959 |
+ kakaoVO.setMsgGroupId(sendVO.getMsgGroupId()); |
|
| 960 |
+ kakaoVO.setKakaoAtPrice(Float.parseFloat(sendVO.getEachPrice())); |
|
| 961 |
+ kakaoVO.setSmsPrice(Float.parseFloat(sendVO.getSmsPrice())); |
|
| 962 |
+ kakaoVO.setMmsPrice(Float.parseFloat(sendVO.getMmsPrice())); |
|
| 963 |
+ |
|
| 964 |
+ kakaoAlimTalkDAO.insertKakaoSendPrice(kakaoVO); |
|
| 965 |
+ |
|
| 966 |
+ |
|
| 967 |
+ priceAndPoint.insertCashAndPoint(kakaoVO.getUserId() |
|
| 968 |
+ , -Float.parseFloat(sendVO.getTotPrice()) |
|
| 969 |
+ , "카카오 알림톡 총 "+groupedMsgList.size()+"건 중 " + instCnt + "건 발송" |
|
| 970 |
+ , nextMsgGroupId |
|
| 971 |
+ ); |
|
| 972 |
+ |
|
| 973 |
+ |
|
| 974 |
+/** @SLACK발송 */ |
|
| 975 |
+ /** @발송조건이되면 발송 */ |
|
| 976 |
+ if(isNotified) {
|
|
| 977 |
+ mjonCommon.getAdminKakaoAtSendSlack(kakaoVO); |
|
| 978 |
+ }else if("Y".equals(kakaoVO.getAtSmishingYn())){
|
|
| 979 |
+ /** @발송조건이 안되면 DB INSERT */ |
|
| 980 |
+ mjonMsgDAO.insertSpamPassMsgData(MjonMsgVO.builder() |
|
| 981 |
+ .msgGroupId(nextMsgGroupId) |
|
| 982 |
+ .userId(kakaoVO.getUserId()) |
|
| 983 |
+ .reqDate(kakaoVO.getReqDate()) |
|
| 984 |
+ .smsTxt(groupedMsgList.get(0).getTemplateContent()) |
|
| 985 |
+ .totalCallCnt(instCnt) |
|
| 986 |
+ .callFrom(kakaoVO.getCallFrom()) |
|
| 987 |
+ .msgType("8")
|
|
| 988 |
+ .reserveYn(kakaoVO.getReserveYn()) |
|
| 989 |
+ .build() |
|
| 990 |
+ ); |
|
| 991 |
+ } |
|
| 992 |
+ |
|
| 993 |
+ nextMsgGroupIdA.add(nextMsgGroupId); |
|
| 994 |
+ |
|
| 995 |
+ } |
|
| 996 |
+ |
|
| 997 |
+ } |
|
| 998 |
+ |
|
| 999 |
+ returnMap.put("resultSts", instTotalCnt);
|
|
| 1000 |
+ returnMap.put("reserYn", kakaoVO.getReserveYn());
|
|
| 1001 |
+ returnMap.put("groupIds", nextMsgGroupIdA);
|
|
| 1002 |
+ |
|
| 1003 |
+ |
|
| 1004 |
+ // 측정할 메소드 호출 후 시간 기록 |
|
| 1005 |
+ Instant end = Instant.now(); |
|
| 1006 |
+ |
|
| 1007 |
+ log.info(" + start :: [{}]", start);
|
|
| 1008 |
+ // 실행 시간 계산 (나노초, 밀리초, 초) |
|
| 1009 |
+ long seconds = Duration.between(start, end).getSeconds(); |
|
| 1010 |
+ System.out.println("메소드 실행 시간 (초): " + seconds + " s");
|
|
| 1011 |
+ double minutes = seconds / 60.0; // 소수점 포함을 위해 60.0으로 나눔 |
|
| 1012 |
+ |
|
| 1013 |
+ returnMap.put("second", seconds+" s");
|
|
| 1014 |
+ returnMap.put("minutes", minutes+" min");
|
|
| 1015 |
+ |
|
| 1016 |
+ |
|
| 1017 |
+// System.out.println("메소드 실행 시간 (분): " + minutes + " min");
|
|
| 1018 |
+ |
|
| 1019 |
+ |
|
| 1020 |
+ |
|
| 1021 |
+ |
|
| 1022 |
+// priceAndPoint.getBefCash(userId); |
|
| 1023 |
+ |
|
| 1024 |
+ |
|
| 1025 |
+ |
|
| 1026 |
+ |
|
| 1027 |
+ statusResponse.setStatus(HttpStatus.OK); |
|
| 1028 |
+ statusResponse.setObject(returnMap); |
|
| 1029 |
+ |
|
| 1030 |
+ return statusResponse; |
|
| 1031 |
+ } |
|
| 1032 |
+ |
|
| 1033 |
+ |
|
| 1034 |
+ |
|
| 1035 |
+ |
|
| 1036 |
+ private void insertKakaoGroupDataTb_advc(int instCnt, KakaoVO kakaoVO, KakaoSendAdvcVO sendVO) throws Exception {
|
|
| 1037 |
+ // TODO Auto-generated method stub |
|
| 1038 |
+ |
|
| 1039 |
+// log.info(" + insertKakaoGroupDataTb_advc kakaoVO :: \n[{}]", kakaoVO.toString());;
|
|
| 1040 |
+// log.info(" + insertKakaoGroupDataTb_advc kakaoSendAdvcVOList :: \n[{}]", sendVO.toString());
|
|
| 1041 |
+ |
|
| 1042 |
+ sendVO.setMsgGroupCnt(Integer.toString(instCnt)); |
|
| 1043 |
+ sendVO.setReserveYn(kakaoVO.getReserveYn()); |
|
| 1044 |
+ sendVO.setBefCash(priceAndPoint.getBefCash(sendVO.getUserId())); |
|
| 1045 |
+ sendVO.setBefPoint(priceAndPoint.getBefPoint(sendVO.getUserId())); |
|
| 1046 |
+ |
|
| 1047 |
+ Float eachPrice = Float.parseFloat(sendVO.getEachPrice()); |
|
| 1048 |
+ |
|
| 1049 |
+ Float totPrice = eachPrice * instCnt; |
|
| 1050 |
+ sendVO.setTotPrice(String.format("%.1f", totPrice));
|
|
| 1051 |
+ |
|
| 1052 |
+ sendVO.setAtDelayYn(kakaoVO.getAtSmishingYn()); |
|
| 1053 |
+ sendVO.setBizKakaoResendOrgnlTxt(kakaoVO.getSubMsgTxt()); |
|
| 1054 |
+ sendVO.setBizKakaoResendType(sendVO.getSubMsgType()); |
|
| 1055 |
+ |
|
| 1056 |
+ kakaoAlimTalkDAO.insertKakaoGroupDataTb_advc(sendVO); |
|
| 1057 |
+ |
|
| 1058 |
+ } |
|
| 1059 |
+ |
|
| 1060 |
+ /** |
|
| 1061 |
+ * @methodName : insertKakaoData_advc |
|
| 1062 |
+ * @author : 이호영 |
|
| 1063 |
+ * @date : 2025. 3. 20. |
|
| 1064 |
+ * @description : 카카오 batch 발송 => mj_msg_data |
|
| 1065 |
+ * @return : int |
|
| 1066 |
+ * @param kakaoSendAdvcVOList |
|
| 1067 |
+ * @param parentLoopCount |
|
| 1068 |
+ * @param isJsonNotEmpty |
|
| 1069 |
+ * @param isJsonNameAllSame |
|
| 1070 |
+ * @return |
|
| 1071 |
+ * |
|
| 1072 |
+ */ |
|
| 1073 |
+ private int insertKakaoData_advc(List<KakaoSendAdvcVO> kakaoSendAdvcVOList) {
|
|
| 1074 |
+ |
|
| 1075 |
+ |
|
| 1076 |
+ // 시작 시간 측정 |
|
| 1077 |
+ long totalStartTime = System.currentTimeMillis(); |
|
| 1078 |
+ |
|
| 1079 |
+ int totalSize = kakaoSendAdvcVOList.size(); // 총 데이터 개수 |
|
| 1080 |
+ // Batch 크기 설정 (고정값) |
|
| 1081 |
+// int batchSize = 10000; 465 |
|
| 1082 |
+ int batchSize = 50000; // 9분 18초 |
|
| 1083 |
+ |
|
| 1084 |
+ log.info("총 데이터 개수 :: [{}] ", totalSize);
|
|
| 1085 |
+ log.info("설정된 Batch 크기 :: [{}] ", batchSize);
|
|
| 1086 |
+ |
|
| 1087 |
+ // 총 insert 카운트 |
|
| 1088 |
+ int instCnt = 0; |
|
| 1089 |
+ int batchCount = 0; |
|
| 1090 |
+ |
|
| 1091 |
+ // 각 배치별 실행 시간 기록 |
|
| 1092 |
+ List<Double> batchExecutionTimes = new ArrayList<>(); |
|
| 1093 |
+ |
|
| 1094 |
+ |
|
| 1095 |
+ // 첫 번째 배치에서만 삽입했는지 추적하는 플래그 |
|
| 1096 |
+ for (int i = 0; i < totalSize; i += batchSize) {
|
|
| 1097 |
+ // Batch 시작 시간 측정 |
|
| 1098 |
+ long batchStartTime = System.currentTimeMillis(); |
|
| 1099 |
+ |
|
| 1100 |
+ // Batch 리스트 생성 |
|
| 1101 |
+ List<KakaoSendAdvcVO> batchList = kakaoSendAdvcVOList.subList(i, Math.min(i + batchSize, totalSize)); |
|
| 1102 |
+ System.out.println("Batch 시작 인덱스: " + i);
|
|
| 1103 |
+ |
|
| 1104 |
+ // mj_msg_data 테이블 insert |
|
| 1105 |
+ int insertedCount = kakaoAlimTalkDAO.insertKakaoAtDataInfo_advc(batchList); |
|
| 1106 |
+ |
|
| 1107 |
+ /** @kakaoSendUtil.populateSendLists |
|
| 1108 |
+ * 하단에서 |
|
| 1109 |
+ * getJsonStr 데이터 처리 후 활용 |
|
| 1110 |
+ * */ |
|
| 1111 |
+ batchList.removeIf(t -> StringUtils.isBlank(t.getJsonStr())); |
|
| 1112 |
+ if(batchList.size() > 0) {
|
|
| 1113 |
+ kakaoAlimTalkDAO.insertKakaoAtDataJsonInfo_advc(batchList); |
|
| 1114 |
+ } |
|
| 1115 |
+ instCnt += insertedCount; |
|
| 1116 |
+ |
|
| 1117 |
+ // Batch 종료 시간 측정 및 실행 시간 계산 |
|
| 1118 |
+ long batchEndTime = System.currentTimeMillis(); |
|
| 1119 |
+ double batchExecutionTimeInSeconds = (batchEndTime - batchStartTime) / 1000.0; |
|
| 1120 |
+ |
|
| 1121 |
+ // 실행 시간 기록 |
|
| 1122 |
+ batchExecutionTimes.add(batchExecutionTimeInSeconds); |
|
| 1123 |
+ batchCount++; |
|
| 1124 |
+ } |
|
| 1125 |
+ |
|
| 1126 |
+ // 종료 시간 측정 |
|
| 1127 |
+ long totalEndTime = System.currentTimeMillis(); |
|
| 1128 |
+ |
|
| 1129 |
+ // 총 실행 시간 계산 (밀리초 -> 초로 변환) |
|
| 1130 |
+ double totalExecutionTimeInSeconds = (totalEndTime - totalStartTime) / 1000.0; |
|
| 1131 |
+ |
|
| 1132 |
+ // 실행 시간 출력 |
|
| 1133 |
+ log.info("총 배치 실행 횟수 :: [{}] ", batchCount);
|
|
| 1134 |
+ log.info("batchSize :: [{}] ", batchSize);
|
|
| 1135 |
+ log.info("총 실행 시간 :: [{}] ", totalExecutionTimeInSeconds + "초");
|
|
| 1136 |
+ log.info("총 삽입 건수 :: [{}] ", instCnt);
|
|
| 1137 |
+ |
|
| 1138 |
+ // 각 배치별 실행 시간 출력 |
|
| 1139 |
+ for (int k = 0; k < batchExecutionTimes.size(); k++) {
|
|
| 1140 |
+ System.out.println("배치 " + (k + 1) + " 실행 시간 :: " + batchExecutionTimes.get(k) + "초");
|
|
| 1141 |
+ } |
|
| 1142 |
+ |
|
| 1143 |
+ return instCnt; |
|
| 1144 |
+ |
|
| 1145 |
+ } |
|
| 1146 |
+ |
|
| 1147 |
+ // 보유 금액이 충분한지 확인하는 메서드 |
|
| 1148 |
+ private boolean isCashSufficient(String userId, List<KakaoSendAdvcVO> kakaoSendAdvcListVO) throws Exception {
|
|
| 1149 |
+ |
|
| 1150 |
+ |
|
| 1151 |
+ String userMoney = priceAndPoint.getBefCash(userId); |
|
| 1152 |
+ // 쉼표 제거 |
|
| 1153 |
+ userMoney = userMoney.replace(",", "");
|
|
| 1154 |
+ |
|
| 1155 |
+ // 사용자 보유 금액 BigDecimal 변환 (HALF_EVEN 적용) |
|
| 1156 |
+ BigDecimal befCash = new BigDecimal(userMoney).setScale(2, RoundingMode.HALF_EVEN); |
|
| 1157 |
+ |
|
| 1158 |
+ // 총 메시지 금액 계산 (HALF_EVEN 적용) |
|
| 1159 |
+ BigDecimal totalEachPrice = kakaoSendAdvcListVO.stream() |
|
| 1160 |
+ .map(msg -> new BigDecimal(String.valueOf(msg.getEachPrice()))) // 변환 오류 방지 |
|
| 1161 |
+ .reduce(BigDecimal.ZERO, BigDecimal::add) |
|
| 1162 |
+ .setScale(2, RoundingMode.HALF_EVEN); // 일관성 유지 |
|
| 1163 |
+ |
|
| 1164 |
+ // 비교 수행 |
|
| 1165 |
+ return befCash.compareTo(totalEachPrice) >= 0; |
|
| 1166 |
+ } |
|
| 1167 |
+ |
|
| 1168 |
+ |
|
| 1169 |
+ |
|
| 1170 |
+ |
|
| 1171 |
+ |
|
| 1172 |
+ |
|
| 1173 |
+ |
|
| 1174 |
+ |
|
| 1175 |
+ |
|
| 1176 |
+ |
|
| 1177 |
+ |
|
| 1178 |
+ |
|
| 1179 |
+ |
|
| 1180 |
+ |
|
| 1181 |
+ |
|
| 1182 |
+ |
|
| 1183 |
+ |
|
| 1184 |
+ |
|
| 1185 |
+ |
|
| 1186 |
+ |
|
| 1187 |
+ |
|
| 1188 |
+ |
|
| 1189 |
+ |
|
| 1190 |
+ |
|
| 1191 |
+ |
|
| 1192 |
+ |
|
| 1193 |
+ |
|
| 1194 |
+ |
|
| 1195 |
+ |
|
| 1196 |
+ |
|
| 1197 |
+ |
|
| 819 | 1198 |
} |
--- src/main/java/itn/let/kakao/user/kakaoAt/web/KakaoAlimTalkSendController.java
+++ src/main/java/itn/let/kakao/user/kakaoAt/web/KakaoAlimTalkSendController.java
... | ... | @@ -35,9 +35,11 @@ |
| 35 | 35 |
import org.apache.poi.xssf.usermodel.XSSFSheet; |
| 36 | 36 |
import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| 37 | 37 |
import org.springframework.beans.factory.annotation.Autowired; |
| 38 |
+import org.springframework.http.ResponseEntity; |
|
| 38 | 39 |
import org.springframework.stereotype.Controller; |
| 39 | 40 |
import org.springframework.ui.ModelMap; |
| 40 | 41 |
import org.springframework.web.bind.annotation.ModelAttribute; |
| 42 |
+import org.springframework.web.bind.annotation.RequestBody; |
|
| 41 | 43 |
import org.springframework.web.bind.annotation.RequestMapping; |
| 42 | 44 |
import org.springframework.web.bind.annotation.RequestMethod; |
| 43 | 45 |
import org.springframework.web.bind.annotation.RequestParam; |
... | ... | @@ -59,6 +61,7 @@ |
| 59 | 61 |
import itn.com.cmm.util.StringUtil; |
| 60 | 62 |
import itn.com.utl.fcc.service.EgovStringUtil; |
| 61 | 63 |
import itn.let.kakao.kakaoComm.KakaoReturnVO; |
| 64 |
+import itn.let.kakao.kakaoComm.KakaoSendAdvcVO; |
|
| 62 | 65 |
import itn.let.kakao.kakaoComm.KakaoSendUtil; |
| 63 | 66 |
import itn.let.kakao.kakaoComm.KakaoVO; |
| 64 | 67 |
import itn.let.kakao.kakaoComm.kakaoApi.KakaoApiJsonSave; |
... | ... | @@ -67,6 +70,7 @@ |
| 67 | 70 |
import itn.let.kakao.kakaoComm.kakaoApi.KakaoApiTemplate; |
| 68 | 71 |
import itn.let.kakao.kakaoComm.kakaoApi.service.KakaoApiService; |
| 69 | 72 |
import itn.let.kakao.user.kakaoAt.service.KakaoAlimTalkService; |
| 73 |
+import itn.let.mail.service.StatusResponse; |
|
| 70 | 74 |
import itn.let.mjo.mjocommon.MjonCommon; |
| 71 | 75 |
import itn.let.mjo.mjocommon.MjonHolidayApi; |
| 72 | 76 |
import itn.let.mjo.msgdata.service.MjonMsgDataService; |
... | ... | @@ -239,6 +243,8 @@ |
| 239 | 243 |
|
| 240 | 244 |
|
| 241 | 245 |
return "web/kakao/msgdata/at/KakaoAlimtalkMsgDataView"; |
| 246 |
+// return "web/kakao/msgdata/at/KakaoAlimtalkMsgDataView_advcbackup_20250310"; |
|
| 247 |
+ |
|
| 242 | 248 |
} |
| 243 | 249 |
|
| 244 | 250 |
|
... | ... | @@ -1079,6 +1085,16 @@ |
| 1079 | 1085 |
return modelAndView; |
| 1080 | 1086 |
} |
| 1081 | 1087 |
|
| 1088 |
+ @RequestMapping(value= {"/web/mjon/kakao/alimtalk/kakaoAlimTalkMsgSendAjax_advc.do"}, method = RequestMethod.POST)
|
|
| 1089 |
+ public ResponseEntity<StatusResponse> kakaoAlimTalkMsgSendAjax_advc( |
|
| 1090 |
+ @RequestBody KakaoVO kakaoVO, |
|
| 1091 |
+ HttpServletRequest request |
|
| 1092 |
+ ) throws Exception {
|
|
| 1093 |
+ |
|
| 1094 |
+ System.out.println(" + kakaoAlimTalkMsgSendAjax_advc + ");
|
|
| 1095 |
+ return ResponseEntity.ok().body(kakaoAlimTalkService.insertKakaoAtSandAjax_advc(kakaoVO, request)) ; |
|
| 1096 |
+ } |
|
| 1097 |
+ |
|
| 1082 | 1098 |
@RequestMapping(value= {"/web/mjon/kakao/alimtalk/kakaoAlimTalkMsgSendAjax.do"}, method = RequestMethod.POST)
|
| 1083 | 1099 |
// @ResponseBody |
| 1084 | 1100 |
public ModelAndView kakaoAlimTalkMsgSendAjax( |
... | ... | @@ -1086,6 +1102,10 @@ |
| 1086 | 1102 |
HttpServletRequest request, |
| 1087 | 1103 |
@ModelAttribute("kakaoVO") KakaoVO kakaoVO
|
| 1088 | 1104 |
) throws Exception {
|
| 1105 |
+ // 시작 시간 |
|
| 1106 |
+ long startTime = System.currentTimeMillis(); |
|
| 1107 |
+ |
|
| 1108 |
+ System.out.println(" :: kakaoAlimTalkMsgSendAjax :: ");
|
|
| 1089 | 1109 |
ModelAndView modelAndView = new ModelAndView(); |
| 1090 | 1110 |
modelAndView.setViewName("jsonView");
|
| 1091 | 1111 |
|
... | ... | @@ -1410,7 +1430,7 @@ |
| 1410 | 1430 |
|
| 1411 | 1431 |
if(!smishingAlarmPassSts) {//평일,주말, 공휴일 알림설정 시간에 포함되지 않는 경우 슬랙 알림 발송
|
| 1412 | 1432 |
|
| 1413 |
- mjonCommon.getAdminKakaoAtSandSlack(kakaoVO); |
|
| 1433 |
+ mjonCommon.getAdminKakaoAtSendSlack(kakaoVO); |
|
| 1414 | 1434 |
|
| 1415 | 1435 |
} |
| 1416 | 1436 |
|
... | ... | @@ -1422,6 +1442,17 @@ |
| 1422 | 1442 |
} catch (Exception e) {
|
| 1423 | 1443 |
throw new Exception("++++++++++++++++++++++ getAdminPhoneSendMsgData Error !!! " + e);
|
| 1424 | 1444 |
} |
| 1445 |
+ // 종료 시간 |
|
| 1446 |
+ long endTime = System.currentTimeMillis(); |
|
| 1447 |
+ |
|
| 1448 |
+// 실행 시간 계산 (초 단위) |
|
| 1449 |
+ double executionTimeSeconds = (endTime - startTime) / 1000.0; |
|
| 1450 |
+ |
|
| 1451 |
+ System.out.println("실행 시간: " + String.format("%.3f", executionTimeSeconds) + "초");
|
|
| 1452 |
+ |
|
| 1453 |
+ |
|
| 1454 |
+ String returnTxt = String.format("%.3f", executionTimeSeconds) + "초";
|
|
| 1455 |
+ modelAndView.addObject("seconds", returnTxt);
|
|
| 1425 | 1456 |
|
| 1426 | 1457 |
return modelAndView; |
| 1427 | 1458 |
} |
--- src/main/java/itn/let/kakao/user/kakaoFt/web/KakaoFriendsTalkSendController.java
+++ src/main/java/itn/let/kakao/user/kakaoFt/web/KakaoFriendsTalkSendController.java
... | ... | @@ -663,7 +663,7 @@ |
| 663 | 663 |
if(!smishingAlarmPassSts) {//평일,주말, 공휴일 알림설정 시간에 포함되지 않는 경우 슬랙 알림 발송
|
| 664 | 664 |
|
| 665 | 665 |
MjonCommon comm = new MjonCommon(); |
| 666 |
- comm.getAdminKakaoAtSandSlack(kakaoVO); |
|
| 666 |
+ comm.getAdminKakaoAtSendSlack(kakaoVO); |
|
| 667 | 667 |
|
| 668 | 668 |
} |
| 669 | 669 |
|
--- src/main/java/itn/let/mjo/mjocommon/MjonCommon.java
+++ src/main/java/itn/let/mjo/mjocommon/MjonCommon.java
... | ... | @@ -1,10 +1,12 @@ |
| 1 | 1 |
package itn.let.mjo.mjocommon; |
| 2 | 2 |
|
| 3 | 3 |
import java.io.IOException; |
| 4 |
+import java.io.UnsupportedEncodingException; |
|
| 4 | 5 |
import java.text.SimpleDateFormat; |
| 5 | 6 |
import java.util.Calendar; |
| 6 | 7 |
import java.util.Date; |
| 7 | 8 |
import java.util.List; |
| 9 |
+import java.util.Map; |
|
| 8 | 10 |
|
| 9 | 11 |
import javax.annotation.Resource; |
| 10 | 12 |
|
... | ... | @@ -14,13 +16,17 @@ |
| 14 | 16 |
import org.apache.commons.httpclient.methods.PostMethod; |
| 15 | 17 |
import org.json.simple.JSONObject; |
| 16 | 18 |
import org.springframework.beans.factory.annotation.Value; |
| 19 |
+import org.springframework.stereotype.Component; |
|
| 17 | 20 |
import org.springframework.stereotype.Service; |
| 18 | 21 |
|
| 19 | 22 |
import com.mysql.jdbc.StringUtils; |
| 20 | 23 |
|
| 24 |
+import egovframework.com.idgen.CustomIdGnrService; |
|
| 25 |
+import egovframework.rte.fdl.cmmn.exception.FdlException; |
|
| 21 | 26 |
import itn.com.cmm.MjonMsgSendVO; |
| 22 | 27 |
import itn.com.cmm.OptimalMsgResultDTO; |
| 23 | 28 |
import itn.com.cmm.util.MsgSendUtils; |
| 29 |
+import itn.com.cmm.util.SlackMessageFormatUtil; |
|
| 24 | 30 |
import itn.let.kakao.kakaoComm.KakaoVO; |
| 25 | 31 |
import itn.let.mail.service.StatusResponse; |
| 26 | 32 |
import itn.let.mjo.event.service.MjonEventService; |
... | ... | @@ -36,7 +42,7 @@ |
| 36 | 42 |
import lombok.extern.slf4j.Slf4j; |
| 37 | 43 |
|
| 38 | 44 |
@Slf4j |
| 39 |
-@Service("MjonCommon")
|
|
| 45 |
+@Component |
|
| 40 | 46 |
public class MjonCommon {
|
| 41 | 47 |
|
| 42 | 48 |
|
... | ... | @@ -60,11 +66,14 @@ |
| 60 | 66 |
/** xpedite 솔루션 ID*/ |
| 61 | 67 |
@Value("#{globalSettings['Globals.slack.channel.name']}")
|
| 62 | 68 |
private String SLACK_CHANNEL; |
| 63 |
- |
|
| 69 |
+ |
|
| 70 |
+ @Resource(name = "egovMjonMsgIdCGnrService") |
|
| 71 |
+ private CustomIdGnrService idgenMsgCId; |
|
| 72 |
+ |
|
| 64 | 73 |
|
| 65 | 74 |
|
| 66 | 75 |
/** |
| 67 |
- * @methodName : getAdminMsgSandSlack |
|
| 76 |
+ * @methodName : getAdminSandSlack |
|
| 68 | 77 |
* @author : 이호영 |
| 69 | 78 |
* @date : 2024.12.04 |
| 70 | 79 |
* @description : 기존 메소드 리펙토링 |
... | ... | @@ -120,8 +129,8 @@ |
| 120 | 129 |
|
| 121 | 130 |
try {
|
| 122 | 131 |
// 메시지 내용 설정 |
| 123 |
- String smsTxt = formatSmsText(mjonMsgVO); |
|
| 124 |
- String sandName = formatSandName(mjonMsgVO); |
|
| 132 |
+ String smsTxt = SlackMessageFormatUtil.formatSmsText(mjonMsgVO); |
|
| 133 |
+ String sandName = SlackMessageFormatUtil.formatSandName(mjonMsgVO); |
|
| 125 | 134 |
|
| 126 | 135 |
// Slack 메시지 생성 |
| 127 | 136 |
JSONObject json = new JSONObject(); |
... | ... | @@ -150,94 +159,49 @@ |
| 150 | 159 |
} |
| 151 | 160 |
} |
| 152 | 161 |
|
| 153 |
- /** |
|
| 154 |
- * @throws Exception |
|
| 155 |
- * @Method Name : getAdminSlackSand |
|
| 156 |
- * @작성일 : 2022. 12. 6. |
|
| 157 |
- * @작성자 : WYH |
|
| 158 |
- * @Method 설명 : slack 메시지 전송 |
|
| 159 |
- */ |
|
| 160 |
- /*public void getAdminMsgSandSlack(MjonMsgVO mjonMsgVO) {
|
|
| 161 |
- |
|
| 162 |
+ public void getAdminKakaoAtSendSlack(KakaoVO kakaoVO) {
|
|
| 162 | 163 |
HttpClient client = new HttpClient(); |
| 163 |
- PostMethod post = new PostMethod(url); |
|
| 164 |
- JSONObject json = new JSONObject(); |
|
| 164 |
+ PostMethod post = new PostMethod(SLACK_URL); |
|
| 165 |
+ |
|
| 165 | 166 |
try {
|
| 166 |
- |
|
| 167 |
- String reserveYn = mjonMsgVO.getReserveYn(); |
|
| 168 |
- String delayYn = mjonMsgVO.getDelayYn(); |
|
| 169 |
- String smsTxt = mjonMsgVO.getSmsTxt(); |
|
| 170 |
- String smishingYn = mjonMsgVO.getSmishingYn(); |
|
| 171 |
- String reservSmsTxt = ""; |
|
| 172 |
- String smisingSmsTxt = ""; |
|
| 173 |
- //예약문자를 발송하는 경우 문자 내용 앞에 "[예약]" 표시되도록 처리 |
|
| 167 |
+ // 메시지 내용 설정 |
|
| 168 |
+ String smsTxt = SlackMessageFormatUtil.formatKakaoText(kakaoVO); |
|
| 169 |
+ String sandName = SlackMessageFormatUtil.formatKakaoSandName(kakaoVO); |
|
| 174 | 170 |
|
| 175 |
- if(reserveYn.equals("Y")) {
|
|
| 176 |
- |
|
| 177 |
- if(smishingYn.equals("Y") || delayYn.equals("Y")) {
|
|
| 178 |
- reservSmsTxt = "[스미싱의심][예약]" + smsTxt; |
|
| 179 |
- }else {
|
|
| 180 |
- reservSmsTxt = "[예약]" + smsTxt; |
|
| 181 |
- } |
|
| 182 |
- |
|
| 183 |
- smsTxt = reservSmsTxt; |
|
| 184 |
- System.out.println("smishingYn : "+ smishingYn);
|
|
| 185 |
- System.out.println("delayYn : "+ delayYn);
|
|
| 186 |
- }else if(smishingYn.equals("Y") || delayYn.equals("Y")) {
|
|
| 187 |
- |
|
| 188 |
- smisingSmsTxt = "[스미싱의심]" + smsTxt; |
|
| 189 |
- smsTxt = smisingSmsTxt; |
|
| 190 |
- } |
|
| 191 |
- |
|
| 192 |
- String sandName = mjonMsgVO.getCallFrom(); |
|
| 193 |
- String userId = mjonMsgVO.getUserId(); |
|
| 194 |
- String msgType = ""; |
|
| 195 |
- int fileCount = Integer.parseInt(mjonMsgVO.getFileCnt());//그림 이미지 갯수 |
|
| 196 |
- if(mjonMsgVO.getMsgType().equals("4")) { //단문 금액
|
|
| 197 |
- msgType = "[단문]"; |
|
| 198 |
- }else if(mjonMsgVO.getMsgType().equals("6")){
|
|
| 199 |
- if(fileCount == 0) {
|
|
| 200 |
- msgType = "[장문]"; |
|
| 201 |
- }else {
|
|
| 202 |
- msgType = "[그림]"; |
|
| 203 |
- // 2022.12.21 JSP => 텍스트없는 그림문자만 발송시 슬랙알림 안됨 |
|
| 204 |
- if (StringUtils.isNullOrEmpty(smsTxt)) {
|
|
| 205 |
- smsTxt = "그림문자 " + smsTxt; |
|
| 206 |
- } |
|
| 207 |
- } |
|
| 208 |
- } |
|
| 209 |
-// sandName = "[" + userId + "]" + "[" + sandName + "]" + msgType; |
|
| 210 |
- sandName = "[개발테스트]"+"[" + userId + "]" + "[" + sandName + "]" + msgType; |
|
| 211 |
- |
|
| 212 |
- json.put("channel", "mjon메시지");
|
|
| 171 |
+ // Slack 메시지 생성 |
|
| 172 |
+ JSONObject json = new JSONObject(); |
|
| 173 |
+ json.put("channel", SLACK_CHANNEL);
|
|
| 213 | 174 |
json.put("text", smsTxt);
|
| 214 | 175 |
json.put("username", sandName);
|
| 215 | 176 |
|
| 216 |
- |
|
| 177 |
+ // Slack 요청 |
|
| 217 | 178 |
post.addParameter("payload", json.toString());
|
| 218 |
- // 처음에 utf-8로 content-type안넣어주니까 한글은 깨져서 content-type넣어줌 |
|
| 219 | 179 |
post.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
|
| 180 |
+ |
|
| 181 |
+ // Slack 응답 처리 |
|
| 220 | 182 |
int responseCode = client.executeMethod(post); |
| 221 |
- String response = post.getResponseBodyAsString(); |
|
| 222 |
- if (responseCode != HttpStatus.SC_OK) {
|
|
| 223 |
- System.out.println("Response: " + response);
|
|
| 183 |
+ if (responseCode != HttpStatus.SC_OK) {
|
|
| 184 |
+ log.warn("Slack 메시지 전송 실패. Response: {}", post.getResponseBodyAsString());
|
|
| 224 | 185 |
} |
| 225 | 186 |
} catch (IllegalArgumentException e) {
|
| 226 |
- System.out.println("IllegalArgumentException posting to Slack " + e);
|
|
| 227 |
- } |
|
| 228 |
- catch (IOException e) {
|
|
| 229 |
- System.out.println("IOException posting to Slack " + e);
|
|
| 230 |
- } |
|
| 231 |
- catch (Exception e) {
|
|
| 232 |
- System.out.println("Exception posting to Slack " + e);
|
|
| 233 |
- e.printStackTrace(); |
|
| 187 |
+ log.error("Slack 메시지 전송 중 IllegalArgumentException 발생", e);
|
|
| 188 |
+ } catch (IOException e) {
|
|
| 189 |
+ log.error("Slack 메시지 전송 중 IOException 발생", e);
|
|
| 190 |
+ } catch (Exception e) {
|
|
| 191 |
+ log.error("Slack 메시지 전송 중 Exception 발생", e);
|
|
| 234 | 192 |
} finally {
|
| 235 | 193 |
post.releaseConnection(); |
| 236 | 194 |
} |
| 237 |
- |
|
| 238 |
- }*/ |
|
| 195 |
+ } |
|
| 239 | 196 |
|
| 197 |
+ private String formatKakaoSandName(KakaoVO kakaoVO) {
|
|
| 198 |
+ // TODO Auto-generated method stub |
|
| 199 |
+ return null; |
|
| 200 |
+ } |
|
| 201 |
+ |
|
| 240 | 202 |
|
| 203 |
+ |
|
| 204 |
+ |
|
| 241 | 205 |
/** |
| 242 | 206 |
* @Method Name : sendSimpleSlackMsg |
| 243 | 207 |
* @작성일 : 2022. 12. 9 |
... | ... | @@ -384,7 +348,7 @@ |
| 384 | 348 |
|
| 385 | 349 |
return mjonMsgVO; |
| 386 | 350 |
} |
| 387 |
- |
|
| 351 |
+ /* |
|
| 388 | 352 |
@SuppressWarnings("unchecked")
|
| 389 | 353 |
public void getAdminKakaoAtSandSlack(KakaoVO kakaoVO) {
|
| 390 | 354 |
|
... | ... | @@ -448,7 +412,7 @@ |
| 448 | 412 |
} |
| 449 | 413 |
|
| 450 | 414 |
} |
| 451 |
- |
|
| 415 |
+ */ |
|
| 452 | 416 |
|
| 453 | 417 |
public String getCreateMsgUserIdgen(String subUserId, String lastId) throws Exception{
|
| 454 | 418 |
|
... | ... | @@ -485,27 +449,6 @@ |
| 485 | 449 |
|
| 486 | 450 |
|
| 487 | 451 |
|
| 488 |
-private String formatSmsText(MjonMsgVO mjonMsgVO) {
|
|
| 489 |
- String smsTxt = mjonMsgVO.getSmsTxt(); |
|
| 490 |
- String reserveYn = safeGetString(mjonMsgVO.getReserveYn()); |
|
| 491 |
- String delayYn = safeGetString(mjonMsgVO.getDelayYn()); |
|
| 492 |
- String smishingYn = safeGetString(mjonMsgVO.getSmishingYn()); |
|
| 493 |
- |
|
| 494 |
- // 예약 문자와 스미싱 의심 처리 |
|
| 495 |
- if ("Y".equals(reserveYn)) {
|
|
| 496 |
- smsTxt = ("Y".equals(smishingYn) || "Y".equals(delayYn)) ? "[스미싱의심][예약]" + smsTxt : "[예약]" + smsTxt;
|
|
| 497 |
- } else if ("Y".equals(smishingYn) || "Y".equals(delayYn)) {
|
|
| 498 |
- smsTxt = "[스미싱의심]" + smsTxt; |
|
| 499 |
- } |
|
| 500 |
- |
|
| 501 |
- // 그림 문자 처리 |
|
| 502 |
- int fileCount = parseIntOrDefault(mjonMsgVO.getFileCnt(), 0); |
|
| 503 |
- if ("6".equals(mjonMsgVO.getMsgType()) && fileCount > 0 && StringUtils.isNullOrEmpty(smsTxt)) {
|
|
| 504 |
- smsTxt = "그림문자 " + smsTxt; |
|
| 505 |
- } |
|
| 506 |
- |
|
| 507 |
- return smsTxt; |
|
| 508 |
-} |
|
| 509 | 452 |
|
| 510 | 453 |
private String formatSandName(MjonMsgVO mjonMsgVO) {
|
| 511 | 454 |
String userId = mjonMsgVO.getUserId(); |
... | ... | @@ -542,7 +485,18 @@ |
| 542 | 485 |
|
| 543 | 486 |
|
| 544 | 487 |
|
| 545 |
- // 전체 로직 처리 (한 번에 모든 필요한 정보 반환) |
|
| 488 |
+ /** |
|
| 489 |
+ * @methodName : processUserAndCheckSms |
|
| 490 |
+ * @author : 이호영 |
|
| 491 |
+ * @date : 2025. 3. 25. |
|
| 492 |
+ * @description : SMS 알림 전체 로직 처리 (한 번에 모든 필요한 정보 반환) |
|
| 493 |
+ * @return : boolean |
|
| 494 |
+ * @param mjonMsgVO |
|
| 495 |
+ * @param userId |
|
| 496 |
+ * @return |
|
| 497 |
+ * @throws Exception |
|
| 498 |
+ * |
|
| 499 |
+ */ |
|
| 546 | 500 |
public boolean processUserAndCheckSms(MjonMsgVO mjonMsgVO, String userId) throws Exception {
|
| 547 | 501 |
UserManageVO userManageVO = getUserManageInfo(userId); |
| 548 | 502 |
|
... | ... | @@ -556,9 +510,39 @@ |
| 556 | 510 |
mjonMsgVO.setSmishingYn(smishingYn); // MjonMsgVO에 스미싱 정보 설정 |
| 557 | 511 |
|
| 558 | 512 |
// 스미싱 알림 처리 |
| 559 |
- return handleSmishingAlert(mjonMsgVO); // 알림 처리 결과 반환 |
|
| 513 |
+ return handleSmishingAlert(); // 알림 처리 결과 반환 |
|
| 560 | 514 |
} |
| 561 | 515 |
|
| 516 |
+ return false; // 알림 처리되지 않음 |
|
| 517 |
+ } |
|
| 518 |
+ |
|
| 519 |
+ /** |
|
| 520 |
+ * @methodName : processUserAndCheckAT |
|
| 521 |
+ * @author : 이호영 |
|
| 522 |
+ * @date : 2025. 3. 25. |
|
| 523 |
+ * @description : SMS 알림 전체 로직 처리 (한 번에 모든 필요한 정보 반환) |
|
| 524 |
+ * @return : boolean |
|
| 525 |
+ * @param mjonMsgVO |
|
| 526 |
+ * @param userId |
|
| 527 |
+ * @return |
|
| 528 |
+ * @throws Exception |
|
| 529 |
+ * |
|
| 530 |
+ */ |
|
| 531 |
+ public boolean processUserAndCheckAT(KakaoVO kakaoVO) throws Exception {
|
|
| 532 |
+ UserManageVO userManageVO = getUserManageInfo(kakaoVO.getUserId()); |
|
| 533 |
+ |
|
| 534 |
+ // 기본값 처리된 사용자 정보와 문자 상태 |
|
| 535 |
+ String adminSmsNoticeYn = userManageVO.getAdminSmsNoticeYn(); |
|
| 536 |
+ String atSmishingYn = userManageVO.getAtSmishingYn(); |
|
| 537 |
+ |
|
| 538 |
+ // 조건 체크 |
|
| 539 |
+ if ("Y".equals(adminSmsNoticeYn) || "Y".equals(atSmishingYn)) {
|
|
| 540 |
+ kakaoVO.setAtSmishingYn(atSmishingYn); // MjonMsgVO에 스미싱 정보 설정 |
|
| 541 |
+ |
|
| 542 |
+ // 스미싱 알림 처리 |
|
| 543 |
+ return handleSmishingAlert(); // 알림 처리 결과 반환 |
|
| 544 |
+ } |
|
| 545 |
+ |
|
| 562 | 546 |
return false; // 알림 처리되지 않음 |
| 563 | 547 |
} |
| 564 | 548 |
|
... | ... | @@ -572,18 +556,28 @@ |
| 572 | 556 |
} |
| 573 | 557 |
|
| 574 | 558 |
// 스미싱 알림 처리 |
| 575 |
- public boolean handleSmishingAlert(MjonMsgVO mjonMsgVO) throws Exception {
|
|
| 559 |
+ public boolean handleSmishingAlert() throws Exception {
|
|
| 560 |
+ /** |
|
| 561 |
+ * MJ_MBER_SETTING => 기본 시스템 알림 여부 |
|
| 562 |
+ * 슬랙 Y |
|
| 563 |
+ * 야간스미싱알림 Y |
|
| 564 |
+ * 등등 |
|
| 565 |
+ * |
|
| 566 |
+ */ |
|
| 576 | 567 |
JoinSettingVO joinSettingVO = egovSiteManagerService.selectAdminNotiDetail(); |
| 577 | 568 |
|
| 569 |
+/** @시스템 설정에 야간스미싱 알림 || 슬랙알림이 N이면 false*/ |
|
| 578 | 570 |
if (joinSettingVO == null || !"Y".equals(joinSettingVO.getHoliSmishingNoti()) || |
| 579 | 571 |
!"Y".equals(joinSettingVO.getSlackNoti())) {
|
| 580 | 572 |
return false; // 알림 조건 미충족 |
| 581 | 573 |
} |
| 582 | 574 |
|
| 583 |
- // 알림 조건 충족 시 추가 작업 |
|
| 575 |
+/** @MJ_SPAMPASS_ALARM : 현재 활성화된 알림 SELECT */ |
|
| 584 | 576 |
List<MsgAlarmSetVO> alarmList = getAlarmSettings(); |
| 577 |
+/** @MJ_HOLIDAY 시스템에 등록된 공휴일 설정 */ |
|
| 585 | 578 |
List<MsgHolidayVO> holidayList = getHolidayList(); |
| 586 |
- boolean isNotificationAllowed = new MjonHolidayApi().getHolidaySmishingPassStatus(alarmList, holidayList); |
|
| 579 |
+/** @MJ_HOLIDAY 시스템에 등록된 공휴일 설정 */ |
|
| 580 |
+ boolean isNotificationAllowed = new MjonHolidayApi().getHolidaySmishingPassStatus_advc(alarmList, holidayList); |
|
| 587 | 581 |
|
| 588 | 582 |
return !isNotificationAllowed; // 알림 발송 조건 미충족 |
| 589 | 583 |
} |
... | ... | @@ -699,9 +693,55 @@ |
| 699 | 693 |
|
| 700 | 694 |
|
| 701 | 695 |
|
| 696 |
+ public List<String> getNextCustomMsgCId (int cnt) throws FdlException {
|
|
| 697 |
+ |
|
| 698 |
+ List<String> idList = idgenMsgCId.getNextStringId(cnt); |
|
| 699 |
+ return idList; |
|
| 700 |
+ |
|
| 701 |
+ } |
|
| 702 | 702 |
|
| 703 | 703 |
|
| 704 |
- |
|
| 704 |
+ /** |
|
| 705 |
+ * @methodName : getSmsTxtBytes |
|
| 706 |
+ * @author : 이호영 |
|
| 707 |
+ * @date : 2024.09.23 |
|
| 708 |
+ * @description : sms 텍스트 바이트 계산 후 return; |
|
| 709 |
+ * @param smsTxt |
|
| 710 |
+ * @return |
|
| 711 |
+ * @throws UnsupportedEncodingException |
|
| 712 |
+ */ |
|
| 713 |
+ public static int getSmsTxtBytes(String smsTxt) throws UnsupportedEncodingException { //문자열 길이 체크 해주기
|
|
| 714 |
+ int smsBytes = 0; |
|
| 715 |
+ //문자 바이트 계산에 필요한 캐릭터 셋 : 한글 2Byte로 계산 |
|
| 716 |
+ String charset = "euc-kr"; |
|
| 717 |
+ if(org.apache.commons.lang3.StringUtils.isNotEmpty(smsTxt)) {
|
|
| 718 |
+ String smsCont = smsTxt.replace("\r\n", "\n");
|
|
| 719 |
+ smsBytes = smsCont.getBytes(charset).length; |
|
| 720 |
+ } |
|
| 721 |
+// log.info(" + smsBytes :: [{}]", smsBytes);
|
|
| 722 |
+ return smsBytes; |
|
| 723 |
+ } |
|
| 724 |
+ |
|
| 725 |
+ |
|
| 726 |
+ /** |
|
| 727 |
+ * @methodName : replaceTemplateVariables |
|
| 728 |
+ * @author : 이호영 |
|
| 729 |
+ * @date : 2025. 3. 12. |
|
| 730 |
+ * @description : 헬퍼 메서드: 템플릿 변수 치환 |
|
| 731 |
+ * @return : String |
|
| 732 |
+ * @param content |
|
| 733 |
+ * @param variables |
|
| 734 |
+ * @return |
|
| 735 |
+ */ |
|
| 736 |
+ public static String ATReplaceTemplateVariables(String content, Map<String, String> variables) {
|
|
| 737 |
+ String result = content; |
|
| 738 |
+ for (Map.Entry<String, String> entry : variables.entrySet()) {
|
|
| 739 |
+ String placeholder = entry.getKey(); |
|
| 740 |
+ String value = entry.getValue(); |
|
| 741 |
+ result = result.replace(placeholder, value); |
|
| 742 |
+ } |
|
| 743 |
+ return result; |
|
| 744 |
+ } |
|
| 705 | 745 |
|
| 706 | 746 |
|
| 707 | 747 |
|
--- src/main/java/itn/let/mjo/mjocommon/MjonHolidayApi.java
+++ src/main/java/itn/let/mjo/mjocommon/MjonHolidayApi.java
... | ... | @@ -231,4 +231,71 @@ |
| 231 | 231 |
return smishingAlarmPassSts; |
| 232 | 232 |
} |
| 233 | 233 |
|
| 234 |
+ /** |
|
| 235 |
+ * @methodName : getHolidaySmishingPassStatus_advc |
|
| 236 |
+ * @author : 이호영 |
|
| 237 |
+ * @date : 2025. 3. 19. |
|
| 238 |
+ * @description : getHolidaySmishingPassStatus 개선 버전 |
|
| 239 |
+ * @return : boolean |
|
| 240 |
+ * @param resultAlarmList |
|
| 241 |
+ * @param resultHolidayList |
|
| 242 |
+ * @return |
|
| 243 |
+ * @throws Exception |
|
| 244 |
+ * |
|
| 245 |
+ */ |
|
| 246 |
+ public boolean getHolidaySmishingPassStatus_advc(List<MsgAlarmSetVO> alarmList, List<MsgHolidayVO> holidayList) throws Exception{
|
|
| 247 |
+ |
|
| 248 |
+ Date now = new Date(); // 현재 시스템 시간 |
|
| 249 |
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); // 날짜-시간 포맷 (예: 2025-03-18 14:30)
|
|
| 250 |
+ |
|
| 251 |
+ // 현재 날짜와 요일 계산 |
|
| 252 |
+ Calendar cal = Calendar.getInstance(); |
|
| 253 |
+ cal.setTime(now); |
|
| 254 |
+ int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); // 1(일요일) ~ 7(토요일) |
|
| 255 |
+ // 오늘 날짜를 "yyyy-MM-dd" 형식으로 포맷팅 (mj_holiday.HOLIDAY_DATE와 비교용) |
|
| 256 |
+ String today = String.format("%d-%02d-%02d",
|
|
| 257 |
+ cal.get(Calendar.YEAR), |
|
| 258 |
+ cal.get(Calendar.MONTH) + 1, // Calendar.MONTH는 0부터 시작하므로 +1 |
|
| 259 |
+ cal.get(Calendar.DATE)); |
|
| 260 |
+ |
|
| 261 |
+ // 공휴일 여부 확인 |
|
| 262 |
+ // mj_holiday 테이블의 HOLIDAY_DATE와 오늘 날짜가 일치하는지 체크 |
|
| 263 |
+ // HOLIDAY_DATE는 'yyyy-MM-dd' 형식으로 저장됨 (예: '2025-01-01') |
|
| 264 |
+ boolean isHoliday = holidayList.stream() |
|
| 265 |
+ .anyMatch(holiday -> today.equals(holiday.getHolidayDate())); |
|
| 266 |
+ |
|
| 267 |
+ // 알람 설정 순회 |
|
| 268 |
+ // alarmList는 MsgAlarmSetVO 객체의 리스트로, 알람 타입과 시작/종료 시간을 포함 |
|
| 269 |
+ for (MsgAlarmSetVO alarm : alarmList) {
|
|
| 270 |
+ String alarmType = alarm.getAlarmType(); // 알람 유형: 'W'(평일), 'E'(주말), 'H'(공휴일) |
|
| 271 |
+ // 오늘 날짜에 알람 시작/종료 시간을 붙여 Date 객체로 변환 |
|
| 272 |
+ Date start = sdf.parse(today + " " + alarm.getAlarmStart()); // 예: "2025-03-18 09:00" |
|
| 273 |
+ Date end = sdf.parse(today + " " + alarm.getAlarmEnd()); // 예: "2025-03-18 18:00" |
|
| 274 |
+ |
|
| 275 |
+ // 현재 시간이 알람 시작~종료 시간 범위 내에 있는지 확인 |
|
| 276 |
+ boolean isWithinTime = now.after(start) && now.before(end); |
|
| 277 |
+ if (!isWithinTime) continue; // 시간 범위 밖이면 다음 알람으로 |
|
| 278 |
+ |
|
| 279 |
+ // 평일 체크 (월~금: dayOfWeek 2~6) |
|
| 280 |
+ // alarmType 'W'는 평일에만 적용 |
|
| 281 |
+ if (dayOfWeek > 1 && dayOfWeek < 7 && alarmType.equals("W")) {
|
|
| 282 |
+ return true; // 평일이고, 시간이 맞고, 타입이 'W'면 스미싱 알람 통과 |
|
| 283 |
+ } |
|
| 284 |
+ // 주말 체크 (일:1, 토:7) |
|
| 285 |
+ // alarmType 'E'는 주말에만 적용 |
|
| 286 |
+ else if ((dayOfWeek == 1 || dayOfWeek == 7) && alarmType.equals("E")) {
|
|
| 287 |
+ return true; // 주말이고, 시간이 맞고, 타입이 'E'면 스미싱 알람 통과 |
|
| 288 |
+ } |
|
| 289 |
+ // 공휴일 체크 |
|
| 290 |
+ // alarmType 'H'는 mj_holiday에 등록된 공휴일에 적용 |
|
| 291 |
+ // HOLIDAY_TYPE(1:법정, 2:임시, 3:기타)과 관계없이 날짜만 확인 |
|
| 292 |
+ else if (isHoliday && alarmType.equals("H")) {
|
|
| 293 |
+ return true; // 공휴일이고, 시간이 맞고, 타입이 'H'면 스미싱 알람 통과 |
|
| 294 |
+ } |
|
| 295 |
+ } |
|
| 296 |
+ |
|
| 297 |
+ // 모든 조건에 부합하지 않으면 false 반환 (스미싱 알람 비활성화) |
|
| 298 |
+ return false; |
|
| 299 |
+ } |
|
| 300 |
+ |
|
| 234 | 301 |
} |
--- src/main/java/itn/let/mjo/msg/service/MjonMsgVO.java
+++ src/main/java/itn/let/mjo/msg/service/MjonMsgVO.java
... | ... | @@ -7,12 +7,18 @@ |
| 7 | 7 |
|
| 8 | 8 |
import itn.com.cmm.ComDefaultVO; |
| 9 | 9 |
import itn.com.cmm.MjonMsgSendVO; |
| 10 |
+import lombok.AllArgsConstructor; |
|
| 11 |
+import lombok.Builder; |
|
| 10 | 12 |
import lombok.Getter; |
| 13 |
+import lombok.NoArgsConstructor; |
|
| 11 | 14 |
import lombok.Setter; |
| 12 | 15 |
|
| 13 | 16 |
@JsonIgnoreProperties(ignoreUnknown = true) |
| 14 | 17 |
@Getter |
| 15 | 18 |
@Setter |
| 19 |
+@Builder |
|
| 20 |
+@NoArgsConstructor |
|
| 21 |
+@AllArgsConstructor |
|
| 16 | 22 |
public class MjonMsgVO extends ComDefaultVO{
|
| 17 | 23 |
|
| 18 | 24 |
private static final long serialVersionUID = 1L; |
--- src/main/java/itn/let/mjo/msgdata/service/impl/MjonMsgDataServiceImpl.java
+++ src/main/java/itn/let/mjo/msgdata/service/impl/MjonMsgDataServiceImpl.java
... | ... | @@ -4061,7 +4061,7 @@ |
| 4061 | 4061 |
|
| 4062 | 4062 |
System.out.println("================================");
|
| 4063 | 4063 |
// 스팸 및 스미싱 의심이면 slack 알림 |
| 4064 |
- boolean isHolidayNotified = mjonCommon.handleSmishingAlert(mjonMsgVO); |
|
| 4064 |
+ boolean isHolidayNotified = mjonCommon.handleSmishingAlert(); |
|
| 4065 | 4065 |
|
| 4066 | 4066 |
|
| 4067 | 4067 |
// 스팸관련 키워드 select |
... | ... | @@ -4095,7 +4095,9 @@ |
| 4095 | 4095 |
MsgSendUtils.setPriceforVO(mjonMsgVO, mjonMsgSendVOList, sysJoinSetVO, mberManageVO); |
| 4096 | 4096 |
|
| 4097 | 4097 |
// msg_id 대량 생성 |
| 4098 |
- List<String> idList = idgenMsgCId.getNextStringId(mjonMsgSendVOList.size()); |
|
| 4098 |
+ |
|
| 4099 |
+// List<String> idList = idgenMsgCId.getNextStringId(mjonMsgSendVOList.size()); |
|
| 4100 |
+ List<String> idList = mjonCommon.getNextCustomMsgCId(mjonMsgSendVOList.size()); |
|
| 4099 | 4101 |
for (int i = 0; i < mjonMsgSendVOList.size(); i++) {
|
| 4100 | 4102 |
mjonMsgSendVOList.get(i).setMsgId(idList.get(i)); |
| 4101 | 4103 |
} |
... | ... | @@ -4136,7 +4138,6 @@ |
| 4136 | 4138 |
int instTotalCnt = 0; |
| 4137 | 4139 |
// Step 2: 그룹화 된 데이터를 그룹별로 insert 처리 |
| 4138 | 4140 |
for (Map.Entry<String, List<MjonMsgSendVO>> entry : priceGroupedMessages.entrySet()) {
|
| 4139 |
- String price = entry.getKey(); // 가격 (String) |
|
| 4140 | 4141 |
List<MjonMsgSendVO> groupedMsgList = entry.getValue(); // 해당 가격의 메시지 리스트 |
| 4141 | 4142 |
|
| 4142 | 4143 |
// msgGroupId 생성 |
... | ... | @@ -4172,7 +4173,7 @@ |
| 4172 | 4173 |
// 수신거부 목록 업데이트 |
| 4173 | 4174 |
// returnMap.put("resultSts", instCnt);
|
| 4174 | 4175 |
|
| 4175 |
- log.debug("가격 [{}]의 총 갯수: [{}]", price, groupedMsgList.size());
|
|
| 4176 |
+ log.debug("가격 [{}]의 총 갯수: [{}]", entry.getKey(), groupedMsgList.size());
|
|
| 4176 | 4177 |
|
| 4177 | 4178 |
} |
| 4178 | 4179 |
|
--- src/main/java/itn/let/mjo/msgdata/web/MjonMsgDataController.java
+++ src/main/java/itn/let/mjo/msgdata/web/MjonMsgDataController.java
... | ... | @@ -2090,16 +2090,8 @@ |
| 2090 | 2090 |
|
| 2091 | 2091 |
} |
| 2092 | 2092 |
|
| 2093 |
- long startTime = System.currentTimeMillis(); // 시작 시간 측정 |
|
| 2094 |
- |
|
| 2095 | 2093 |
List<AddrVO> resultAddrList = mjonMsgDataService.selectMsgAddrListAjax(addrVO); |
| 2096 | 2094 |
|
| 2097 |
- long endTime = System.currentTimeMillis(); // 종료 시간 측정 |
|
| 2098 |
- |
|
| 2099 |
- long elapsedTime = endTime - startTime; // 소요 시간 계산 |
|
| 2100 |
- System.out.println("소요 시간: " + elapsedTime + " 밀리초");
|
|
| 2101 |
- |
|
| 2102 |
- |
|
| 2103 | 2095 |
|
| 2104 | 2096 |
modelAndView.addObject("resultAddrList", resultAddrList);
|
| 2105 | 2097 |
modelAndView.addObject("result", "success");
|
--- src/main/resources/egovframework/sqlmap/let/mjo/kakao/Kakao_AT_SQL_Mysql.xml
+++ src/main/resources/egovframework/sqlmap/let/mjo/kakao/Kakao_AT_SQL_Mysql.xml
... | ... | @@ -4,9 +4,10 @@ |
| 4 | 4 |
========= ======= ================================================= |
| 5 | 5 |
2023.02.02 우영두 |
| 6 | 6 |
--> |
| 7 |
-<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-config-2.dtd"> |
|
| 7 |
+<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> |
|
| 8 | 8 |
<sqlMap namespace="kakaoAlimTalk"> |
| 9 | 9 |
<typeAlias alias="kakaoVO" type="itn.let.kakao.kakaoComm.KakaoVO"/> |
| 10 |
+ <typeAlias alias="kakaoSendAdvcVO" type="itn.let.kakao.kakaoComm.KakaoSendAdvcVO"/> |
|
| 10 | 11 |
|
| 11 | 12 |
<insert id="kakaoAlimTalkDAO.insertKakaoAtDataInfo" parameterClass="java.util.List"> |
| 12 | 13 |
INSERT INTO MJ_MSG_DATA |
... | ... | @@ -54,6 +55,119 @@ |
| 54 | 55 |
</iterate> |
| 55 | 56 |
</insert> |
| 56 | 57 |
|
| 58 |
+ <insert id="kakaoAlimTalkDAO.insertKakaoAtDataInfo_advc" parameterClass="java.util.List"> |
|
| 59 |
+ INSERT INTO MJ_MSG_DATA |
|
| 60 |
+ ( |
|
| 61 |
+ MSG_ID |
|
| 62 |
+ , MSG_GROUP_ID |
|
| 63 |
+ , USER_ID |
|
| 64 |
+ , AGENT_CODE |
|
| 65 |
+ , CUR_STATE |
|
| 66 |
+ |
|
| 67 |
+ , MSG_NOTICETALK_SENDER_KEY |
|
| 68 |
+ , MSG_NOTICETALK_TMP_KEY |
|
| 69 |
+ , CALL_TO |
|
| 70 |
+ , CALL_FROM |
|
| 71 |
+ , MSG_TYPE |
|
| 72 |
+ |
|
| 73 |
+ , SMS_TXT |
|
| 74 |
+ , BIZ_KAKAO_TITLE |
|
| 75 |
+ |
|
| 76 |
+ , BIZ_KAKAO_RESEND_YN |
|
| 77 |
+ , BIZ_KAKAO_RESEND_DATA |
|
| 78 |
+ , BIZ_KAKAO_RESEND_TYPE |
|
| 79 |
+ , BIZ_KAKAO_JSON_FILE |
|
| 80 |
+ , REQ_DATE |
|
| 81 |
+ )VALUES |
|
| 82 |
+ <iterate conjunction=","> |
|
| 83 |
+ ( |
|
| 84 |
+ #[].msgId# |
|
| 85 |
+ , #[].msgGroupId# |
|
| 86 |
+ , #[].userId# |
|
| 87 |
+ , #[].agentCode# |
|
| 88 |
+ , 0 |
|
| 89 |
+ |
|
| 90 |
+ , #[].senderKey# |
|
| 91 |
+ , #[].templateCode# |
|
| 92 |
+ , #[].callTo# |
|
| 93 |
+ , #[].callFrom# |
|
| 94 |
+ , #[].msgType# |
|
| 95 |
+ |
|
| 96 |
+ , #[].templateContent# |
|
| 97 |
+ , #[].templateTitle# |
|
| 98 |
+ |
|
| 99 |
+ , #[].subMsgSendYn# |
|
| 100 |
+ , #[].subMsgTxt# |
|
| 101 |
+ , #[].subMsgType# |
|
| 102 |
+ , #[].bizJsonName# |
|
| 103 |
+ , #[].reqDate# |
|
| 104 |
+ ) |
|
| 105 |
+ </iterate> |
|
| 106 |
+ </insert> |
|
| 107 |
+ <insert id="kakaoAlimTalkDAO.insertKakaoAtDataJsonInfo_advc" parameterClass="java.util.List"> |
|
| 108 |
+ INSERT INTO BIZ_ATTACHMENTS |
|
| 109 |
+ ( |
|
| 110 |
+ MSG_KEY |
|
| 111 |
+ , TYPE |
|
| 112 |
+ , CONTENTS |
|
| 113 |
+ )VALUES |
|
| 114 |
+ <iterate conjunction=","> |
|
| 115 |
+ ( |
|
| 116 |
+ #[].msgId# |
|
| 117 |
+ , 'JSON' |
|
| 118 |
+ , #[].jsonStr# |
|
| 119 |
+ ) |
|
| 120 |
+ </iterate> |
|
| 121 |
+ </insert> |
|
| 122 |
+ |
|
| 123 |
+ <insert id="kakaoAlimTalkDAO.insertKakaoGroupDataTb_advc" parameterClass="kakaoSendAdvcVO"> |
|
| 124 |
+ INSERT INTO MJ_MSG_GROUP_DATA |
|
| 125 |
+ ( |
|
| 126 |
+ MSG_GROUP_ID, |
|
| 127 |
+ USER_ID, |
|
| 128 |
+ CALL_FROM, |
|
| 129 |
+ SMS_TXT, |
|
| 130 |
+ |
|
| 131 |
+ REQ_DATE, |
|
| 132 |
+ MSG_GROUP_CNT, |
|
| 133 |
+ MSG_TYPE, |
|
| 134 |
+ |
|
| 135 |
+ AGENT_CODE, |
|
| 136 |
+ EACH_PRICE, |
|
| 137 |
+ RESERVE_YN, |
|
| 138 |
+ BEF_CASH, |
|
| 139 |
+ BEF_POINT, |
|
| 140 |
+ |
|
| 141 |
+ TOT_PRICE, |
|
| 142 |
+ |
|
| 143 |
+ AT_DELAY_YN, |
|
| 144 |
+ BIZ_KAKAO_RESEND_ORGNL_TXT, |
|
| 145 |
+ BIZ_KAKAO_RESEND_TYPE |
|
| 146 |
+ )VALUES |
|
| 147 |
+ ( |
|
| 148 |
+ #msgGroupId#, |
|
| 149 |
+ #userId#, |
|
| 150 |
+ #callFrom#, |
|
| 151 |
+ #templateContent#, |
|
| 152 |
+ |
|
| 153 |
+ #reqDate#, |
|
| 154 |
+ #msgGroupCnt#, |
|
| 155 |
+ #msgType#, |
|
| 156 |
+ |
|
| 157 |
+ #agentCode#, |
|
| 158 |
+ #eachPrice#, |
|
| 159 |
+ #reserveYn#, |
|
| 160 |
+ #befCash#, |
|
| 161 |
+ #befPoint#, |
|
| 162 |
+ |
|
| 163 |
+ #totPrice#, |
|
| 164 |
+ |
|
| 165 |
+ #atDelayYn#, |
|
| 166 |
+ #bizKakaoResendOrgnlTxt#, |
|
| 167 |
+ #bizKakaoResendType# |
|
| 168 |
+ ) |
|
| 169 |
+ </insert> |
|
| 170 |
+ |
|
| 57 | 171 |
<insert id="kakaoAlimTalkDAO.insertKakaoSendPrice" parameterClass="kakaoVO"> |
| 58 | 172 |
INSERT INTO BIZ_KAKAO_PRICE |
| 59 | 173 |
( |
--- src/main/resources/egovframework/sqlmap/let/uss/umt/EgovUserManage_SQL_Mysql.xml
+++ src/main/resources/egovframework/sqlmap/let/uss/umt/EgovUserManage_SQL_Mysql.xml
... | ... | @@ -1315,6 +1315,7 @@ |
| 1315 | 1315 |
ADMIN_SMS_NOTICE_YN AS adminSmsNoticeYn |
| 1316 | 1316 |
,PRE_PAYMENT_YN AS prePaymentYn |
| 1317 | 1317 |
,SMISHING_YN AS smishingYn |
| 1318 |
+ ,AT_SMISHING_YN AS atSmishingYn |
|
| 1318 | 1319 |
,AUTO_CASH AS autoCash |
| 1319 | 1320 |
,IFNULL(BLINE_CODE, 'N') AS blineCode |
| 1320 | 1321 |
,IFNULL(RECOMMEND_ID, '') AS recommendId |
--- src/main/webapp/WEB-INF/jsp/web/kakao/msgdata/at/KakaoAlimtalkMsgDataView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/kakao/msgdata/at/KakaoAlimtalkMsgDataView.jsp
... | ... | @@ -7,6 +7,8 @@ |
| 7 | 7 |
|
| 8 | 8 |
<!-- <script src="/publish/js/content.js"></script> --> |
| 9 | 9 |
<!-- 주소록관련 js --> |
| 10 |
+ |
|
| 11 |
+ |
|
| 10 | 12 |
<script type="text/javascript" defer src="<c:out value='/js/kakao/at/init.js' />"></script> |
| 11 | 13 |
<script type="text/javascript" src="<c:out value='/js/kakao/at/tabulator.js' />"></script> |
| 12 | 14 |
<script type="text/javascript" src="<c:out value='/js/kakao/at/addr.js' />"></script> |
... | ... | @@ -15,7 +17,6 @@ |
| 15 | 17 |
<script type="text/javascript" src="<c:out value='/js/common/popup.js' />"></script> |
| 16 | 18 |
<script type="text/javascript"> |
| 17 | 19 |
var loginVO = '${loginVO}';
|
| 18 |
- |
|
| 19 | 20 |
// 체크박스 동적 바인딩 |
| 20 | 21 |
$(document).on('click','.wrap01C', function(){
|
| 21 | 22 |
var total = $(".wrap01C").length;
|
... | ... | @@ -87,28 +88,52 @@ |
| 87 | 88 |
|
| 88 | 89 |
//선택삭제 버튼 클릭 이벤트 |
| 89 | 90 |
$("#select_del").on('click', function(){
|
| 90 |
- |
|
| 91 |
- if($('.wrap01C:checkbox:checked').length < 1)
|
|
| 92 |
- {
|
|
| 93 |
- alert("삭제할 연락처를 선택해주세요.!!");
|
|
| 91 |
+ |
|
| 92 |
+ |
|
| 93 |
+ if(tableL == null || tableL == ""){
|
|
| 94 |
+ |
|
| 95 |
+ alert("받는사람을 추가해 주세요.");
|
|
| 94 | 96 |
return false; |
| 97 |
+ |
|
| 95 | 98 |
} |
| 96 | 99 |
|
| 97 |
- $('.wrap01C').each(function(index, item){
|
|
| 98 |
- if($(item).is(':checked'))
|
|
| 99 |
- $(item).parent().parent().remove(); |
|
| 100 |
- }); |
|
| 101 |
- updateTotCnt(); |
|
| 100 |
+ var selectedData = tableL.getSelectedRows(); |
|
| 101 |
+ |
|
| 102 |
+ if(selectedData == "" || selectedData == null){
|
|
| 103 |
+ |
|
| 104 |
+ alert("삭제할 연락처를 선택해주세요.");
|
|
| 105 |
+ return false; |
|
| 106 |
+ |
|
| 107 |
+ // 선택한 Row 데이터 삭제하기 |
|
| 108 |
+ }else if(confirm("선택하신 받는 사람을 삭제하시겠습니까?")){
|
|
| 109 |
+ |
|
| 110 |
+ // 선택 데이터 삭제 |
|
| 111 |
+ selectedData.forEach(row => row.delete()); |
|
| 112 |
+ |
|
| 113 |
+ |
|
| 114 |
+ totRows = tableL.getRows().length; |
|
| 115 |
+ updateTotCnt(totRows); |
|
| 116 |
+ |
|
| 117 |
+ var smsTxtArea = $('#smsTxtArea').val();
|
|
| 118 |
+ |
|
| 119 |
+ //일괄변환 문구 결제금액 처리 |
|
| 120 |
+ |
|
| 121 |
+ } |
|
| 122 |
+ |
|
| 102 | 123 |
}); |
| 103 | 124 |
|
| 104 | 125 |
//선택삭제 버튼 클릭 이벤트 |
| 105 | 126 |
$("#all_del").on('click', function(){
|
| 106 |
- |
|
| 127 |
+ |
|
| 128 |
+ |
|
| 107 | 129 |
if(!confirm("받는사람 목록을 모두 삭제하시겠습니까?"))
|
| 108 | 130 |
return false; |
| 109 | 131 |
|
| 110 | 132 |
$('#wrap01_body .list_body').remove();
|
| 111 | 133 |
|
| 134 |
+ tableL.clearData(); |
|
| 135 |
+ |
|
| 136 |
+ |
|
| 112 | 137 |
$('#rowTotCnt').text(0);
|
| 113 | 138 |
$('#rowDupCnt').text(0);
|
| 114 | 139 |
}); |
... | ... | @@ -509,19 +534,13 @@ |
| 509 | 534 |
return false; |
| 510 | 535 |
} |
| 511 | 536 |
|
| 512 |
- //수신자 목록 체크 |
|
| 513 |
- if($('.phoneArea').length < 1)
|
|
| 514 |
- {
|
|
| 515 |
- alert('받는 사람 입력 후 발송해 주세요');
|
|
| 516 |
- return false; |
|
| 517 |
- } |
|
| 518 | 537 |
|
| 519 | 538 |
//수신자 목록 체크 |
| 520 |
- if($('.phoneArea').length > 500)
|
|
| 539 |
+ /* if($('.phoneArea').length > 500)
|
|
| 521 | 540 |
{
|
| 522 | 541 |
alert("최대 발송 건수는 500건 입니다.");
|
| 523 | 542 |
return false; |
| 524 |
- } |
|
| 543 |
+ } */ |
|
| 525 | 544 |
|
| 526 | 545 |
|
| 527 | 546 |
if($('#errorChk').val() === 'N'
|
... | ... | @@ -550,7 +569,7 @@ |
| 550 | 569 |
|
| 551 | 570 |
// 초기화 |
| 552 | 571 |
$('.varValList').remove();
|
| 553 |
- $('#bizForm #varNmList').val('');
|
|
| 572 |
+// $('#bizForm #varNmList').val('');
|
|
| 554 | 573 |
|
| 555 | 574 |
|
| 556 | 575 |
// 대체문자 전송 확인 |
... | ... | @@ -613,133 +632,227 @@ |
| 613 | 632 |
}else{
|
| 614 | 633 |
$('#bizForm #reqDate').val("");
|
| 615 | 634 |
} |
| 616 |
- |
|
| 635 |
+ |
|
| 636 |
+ var dataList = []; |
|
| 617 | 637 |
// 치환문자 있는 데이터 파씽 |
| 618 | 638 |
if($('#bizForm #txtReplYn').val() === 'Y'){
|
| 619 |
- fn_excelDataTransParsing(); |
|
| 639 |
+ // fn_excelDataTransParsing(); |
|
| 620 | 640 |
// 치환문자 있는 수신자 리스트 |
| 621 |
- fn_transCallToListParsing(); |
|
| 641 |
+ dataList = fn_transCallToListParsing(); |
|
| 622 | 642 |
}else{
|
| 623 |
- // 치환문자 없는 수신자 리스트 |
|
| 624 |
- fn_callToListParsing(); |
|
| 643 |
+ // 치환문자 없는 수신자 리스트 |
|
| 644 |
+ dataList = fn_callToListParsing(); |
|
| 625 | 645 |
} |
| 626 | 646 |
|
| 627 |
- $('#bizForm #senderKey').val($('#selectKakaoProfileList').val());
|
|
| 628 |
- $('#bizForm #templateCode').val($('#selectTemplateList').val());
|
|
| 629 | 647 |
|
| 648 |
+ |
|
| 649 |
+ //수신자 목록 체크 |
|
| 650 |
+ if(dataList.length < 1) |
|
| 651 |
+ {
|
|
| 652 |
+ alert('받는 사람 입력 후 발송해 주세요');
|
|
| 653 |
+ return false; |
|
| 654 |
+ } |
|
| 655 |
+ |
|
| 656 |
+ |
|
| 657 |
+ // 채널 ID |
|
| 658 |
+ $('#bizForm #senderKey').val($('#selectKakaoProfileList').val());
|
|
| 659 |
+ // 채널 > 템플릿 |
|
| 660 |
+ $('#bizForm #templateCode').val($('#selectTemplateList').val());
|
|
| 630 | 661 |
// 발신번호 |
| 631 | 662 |
$('#bizForm #callFrom').val(removeDash($('#callFromList option:selected').val()));
|
| 632 | 663 |
|
| 633 |
- if(confirm("알림톡을 발송하시겠습니까?")){
|
|
| 634 |
- var spamChk = true; |
|
| 635 |
- //2023.09.06 알림톡 스팸체크 기능 제거요청으로 인한 주석처리 |
|
| 636 |
- /*var spamChk = false; |
|
| 637 |
- var spmData = new FormData(document.bizForm); |
|
| 638 |
- $.ajax({
|
|
| 639 |
- type: "POST" |
|
| 640 |
- , url: "/web/mjon/alimtalk/selectSpamKakaoAlimtalkMsgChkAjax.do" |
|
| 641 |
- , data: spmData |
|
| 642 |
- , dataType:'json' |
|
| 643 |
- , async: false |
|
| 644 |
- , processData: false |
|
| 645 |
- , contentType: false |
|
| 646 |
- , cache: false |
|
| 647 |
- , success: function (returnData, status) {
|
|
| 648 |
- if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
|
|
| 649 |
- |
|
| 650 |
- if("fail" == returnData.result){
|
|
| 651 |
- alert(returnData.message); |
|
| 652 |
- return false; |
|
| 653 |
- }else if("loginFail" == returnData.result){
|
|
| 654 |
- alert(returnData.message); |
|
| 655 |
- return false; |
|
| 656 |
- }else if("spams" == returnData.result){
|
|
| 657 |
- alert("전송 내용에 스팸문구가 포함되어 있습니다.")
|
|
| 658 |
- return false; |
|
| 659 |
- }else{
|
|
| 660 |
- spamChk = true; |
|
| 661 |
- return false; |
|
| 662 |
- } |
|
| 663 |
- |
|
| 664 |
- } else if(status== 'fail'){
|
|
| 665 |
- alert(returnData.message); |
|
| 666 |
- return false; |
|
| 667 |
- } |
|
| 668 |
- } |
|
| 669 |
- , error: function (e) {
|
|
| 670 |
- alert("문자 발송에 실패하였습니다.");
|
|
| 671 |
- console.log("ERROR : ", e);
|
|
| 672 |
- return false; |
|
| 673 |
- } |
|
| 674 |
- }); */ |
|
| 675 |
- |
|
| 676 |
- if(spamChk){
|
|
| 677 |
- var data = new FormData(document.bizForm); |
|
| 678 |
- $.ajax({
|
|
| 679 |
- type: "POST" |
|
| 680 |
- , url: "/web/mjon/kakao/alimtalk/kakaoAlimTalkMsgSendAjax.do" |
|
| 681 |
- , data: data |
|
| 682 |
- , dataType: 'json' |
|
| 683 |
- , async: true |
|
| 684 |
- , processData: false |
|
| 685 |
- , contentType: false |
|
| 686 |
- , cache: false |
|
| 687 |
- , success: function (returnData, status) {
|
|
| 688 |
- if(status == 'success'){
|
|
| 689 |
- if("loginFail" == returnData.result){
|
|
| 690 |
- |
|
| 691 |
- alert(returnData.message); |
|
| 692 |
- return false; |
|
| 693 |
- |
|
| 694 |
- }else if('fail' == returnData.result){
|
|
| 695 |
- |
|
| 696 |
- alert(returnData.message); |
|
| 697 |
- return false; |
|
| 698 |
- |
|
| 699 |
- }else if('authFail' == returnData.result){
|
|
| 700 |
- |
|
| 701 |
- alert(returnData.message); |
|
| 702 |
- location.reload(); |
|
| 703 |
- |
|
| 704 |
- } else if(status == 'success'){
|
|
| 705 |
- |
|
| 706 |
- var kakaoSendCnt = returnData.resultSts; |
|
| 707 |
- |
|
| 708 |
- $('.pop_msg_success').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'});
|
|
| 709 |
- |
|
| 710 |
- //예약발송 건의 경우 결과 팝업 문구 변경 |
|
| 711 |
- if(reserYn == 'Y'){
|
|
| 712 |
- $('.pop_msg_success .msg_text').html("예약 성공 : <strong>"+ kakaoSendCnt + "</strong>건의<br>알림톡이 예약 되었습니다.");
|
|
| 713 |
- }else{
|
|
| 714 |
- $('.pop_msg_success .msg_text').html("발송 성공 : <strong>"+ kakaoSendCnt + "</strong>건의<br>알림톡이 발송 되었습니다.");
|
|
| 715 |
- } |
|
| 716 |
- |
|
| 717 |
- $('.mask').addClass('on');
|
|
| 718 |
- } |
|
| 719 |
- } |
|
| 720 |
- } |
|
| 721 |
- ,beforeSend : function(xmlHttpRequest) {
|
|
| 722 |
- //로딩창 show |
|
| 723 |
- $('.loading_layer').addClass('active');
|
|
| 724 |
- } |
|
| 725 |
- ,complete : function(xhr, textStatus) {
|
|
| 726 |
- //로딩창 hide |
|
| 727 |
- $('.loading_layer').removeClass('active');
|
|
| 728 |
- } |
|
| 729 |
- ,error: function (e) {
|
|
| 730 |
- console.log("ERROR : ", e);
|
|
| 731 |
- alert("카카오 알림톡 전송에 실패하였습니다.");
|
|
| 732 |
- } |
|
| 733 |
- }); |
|
| 664 |
+ // 폼 데이터를 배열로 직렬화 |
|
| 665 |
+ var form = $('#bizForm');
|
|
| 666 |
+ var formDataArray = form.serializeArray(); |
|
| 667 |
+ |
|
| 668 |
+ // 배열을 객체로 변환 |
|
| 669 |
+ var formData = {};
|
|
| 670 |
+ $.each(formDataArray, function(index, field) {
|
|
| 671 |
+ formData[field.name] = field.value; |
|
| 672 |
+ }); |
|
| 673 |
+ |
|
| 674 |
+ // 빈 값 제거 (참고 코드 기반) |
|
| 675 |
+ for (var key in formData) {
|
|
| 676 |
+ if (formData[key] === '' || formData[key] === null || formData[key] === undefined) {
|
|
| 677 |
+ delete formData[key]; |
|
| 734 | 678 |
} |
| 735 | 679 |
} |
| 680 |
+ |
|
| 681 |
+// delete formData['varNmList']; |
|
| 682 |
+ |
|
| 683 |
+ // 선택된 데이터 추가 (varListMap) |
|
| 684 |
+ formData["varListMap"] = dataList; |
|
| 685 |
+ console.log('formData : ', formData);
|
|
| 686 |
+ |
|
| 687 |
+ if(confirm("알림톡을 발송하시겠습니까?")){
|
|
| 688 |
+ |
|
| 689 |
+ // 프로그래스파 시간을 위한 계산 |
|
| 690 |
+ var estimtedTime = calculateEstimatedTime(dataList.length); |
|
| 691 |
+ |
|
| 692 |
+ $.ajax({
|
|
| 693 |
+ type: "POST", |
|
| 694 |
+ url: "/web/mjon/kakao/alimtalk/kakaoAlimTalkMsgSendAjax_advc.do", |
|
| 695 |
+ data: JSON.stringify(formData), |
|
| 696 |
+ contentType: 'application/json', |
|
| 697 |
+ dataType: 'json', |
|
| 698 |
+ success: function (data) {
|
|
| 699 |
+ console.log('data : ', data);
|
|
| 700 |
+ |
|
| 701 |
+ |
|
| 702 |
+ |
|
| 703 |
+ var status = data.status; |
|
| 704 |
+ if("OK" == status){
|
|
| 705 |
+ var resultSts = data.object.resultSts; |
|
| 706 |
+ var reserYn = data.object.reserYn; |
|
| 707 |
+ var resText = (reserYn === 'Y') ? '예약' : '발송'; |
|
| 708 |
+ |
|
| 709 |
+ $('.pop_msg_success').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'});
|
|
| 710 |
+ $('.pop_msg_success .msg_text').html(resText+" 성공 : <strong>"+ resultSts + "</strong>건의<br>알림톡이 " + resText + " 되었습니다.");
|
|
| 711 |
+ |
|
| 712 |
+ }else if("UNAUTHORIZED" == status){
|
|
| 713 |
+ alert(data.message); |
|
| 714 |
+ location.reload(); |
|
| 715 |
+ }else{
|
|
| 716 |
+ alert(data.message); |
|
| 717 |
+ return false; |
|
| 718 |
+ } |
|
| 719 |
+ |
|
| 720 |
+ |
|
| 721 |
+// if(data == 'success'){
|
|
| 722 |
+ /* if("loginFail" == returnData.result){
|
|
| 723 |
+ |
|
| 724 |
+ alert(returnData.message); |
|
| 725 |
+ return false; |
|
| 726 |
+ |
|
| 727 |
+ }else if('fail' == returnData.result){
|
|
| 728 |
+ |
|
| 729 |
+ alert(returnData.message); |
|
| 730 |
+ return false; |
|
| 731 |
+ |
|
| 732 |
+ }else if('authFail' == returnData.result){
|
|
| 733 |
+ |
|
| 734 |
+ alert(returnData.message); |
|
| 735 |
+ location.reload(); |
|
| 736 |
+ |
|
| 737 |
+ } else if(status == 'success'){
|
|
| 738 |
+ |
|
| 739 |
+ var kakaoSendCnt = returnData.resultSts; |
|
| 740 |
+ |
|
| 741 |
+ $('.pop_msg_success').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'});
|
|
| 742 |
+ |
|
| 743 |
+ //예약발송 건의 경우 결과 팝업 문구 변경 |
|
| 744 |
+ if(reserYn == 'Y'){
|
|
| 745 |
+ $('.pop_msg_success .msg_text').html("예약 성공 : <strong>"+ kakaoSendCnt + "</strong>건의<br>알림톡이 예약 되었습니다.");
|
|
| 746 |
+ }else{
|
|
| 747 |
+ $('.pop_msg_success .msg_text').html("발송 성공 : <strong>"+ kakaoSendCnt + "</strong>건의<br>알림톡이 발송 되었습니다.");
|
|
| 748 |
+ } |
|
| 749 |
+ |
|
| 750 |
+ $('.mask').addClass('on');
|
|
| 751 |
+ } */ |
|
| 752 |
+// } |
|
| 753 |
+ } |
|
| 754 |
+ ,beforeSend : function(xmlHttpRequest) {
|
|
| 755 |
+ //로딩창 show |
|
| 756 |
+// $('.loading_layer').addClass('active');
|
|
| 757 |
+ // 프로그래스 바 실행 |
|
| 758 |
+ progressStart(estimtedTime); |
|
| 759 |
+ } |
|
| 760 |
+ ,complete : function(xhr, textStatus) {
|
|
| 761 |
+ //로딩창 hide |
|
| 762 |
+// $('.loading_layer').removeClass('active');
|
|
| 763 |
+ |
|
| 764 |
+ // 프로그래스 바 종료 |
|
| 765 |
+ progressComplete();; |
|
| 766 |
+ } |
|
| 767 |
+ ,error: function (e) {
|
|
| 768 |
+ console.log("ERROR : ", e);
|
|
| 769 |
+ alert("카카오 알림톡 전송에 실패하였습니다.");
|
|
| 770 |
+ } |
|
| 771 |
+ }); |
|
| 772 |
+ } |
|
| 773 |
+} |
|
| 774 |
+//선택된 데이터의 길이에 따라 예상 시간 계산 함수 |
|
| 775 |
+function calculateEstimatedTime(selectedCount) {
|
|
| 776 |
+ //기준값 |
|
| 777 |
+ // const processTimePerBatch = 130; // 130초 |
|
| 778 |
+ |
|
| 779 |
+ |
|
| 780 |
+ // 30만건 기준 10분으로 기준을 잡아서 |
|
| 781 |
+ // 시간계산함 |
|
| 782 |
+ const processTimePerBatch = 600; |
|
| 783 |
+ const batchSize = 300000; |
|
| 784 |
+ |
|
| 785 |
+ // 1건당 처리 시간 |
|
| 786 |
+ const timePerRecord = processTimePerBatch / batchSize; |
|
| 787 |
+ |
|
| 788 |
+ // 예상 시간 계산 |
|
| 789 |
+ const estimatedTimeInSeconds = selectedCount * timePerRecord; |
|
| 790 |
+ |
|
| 791 |
+ return estimatedTimeInSeconds.toFixed(2); |
|
| 792 |
+} |
|
| 793 |
+ |
|
| 794 |
+ |
|
| 795 |
+//프로그레스바 |
|
| 796 |
+var start, change; |
|
| 797 |
+var progressInterval = null; // 전역 변수로 타이머 ID 관리 |
|
| 798 |
+function progressStart(time) {
|
|
| 799 |
+ // 기존 타이머 정지 및 초기화 |
|
| 800 |
+ if (progressInterval !== null) {
|
|
| 801 |
+ clearInterval(progressInterval); // 이전 타이머 정지 |
|
| 802 |
+ progressInterval = null; // 타이머 ID 초기화 |
|
| 803 |
+ } |
|
| 804 |
+ resetProgressBar(); // 프로그레스바 초기화 |
|
| 805 |
+ |
|
| 806 |
+ // 프로그레스바 보이기 |
|
| 807 |
+ $(".progress_bar_wrap").css("display", "flex");
|
|
| 808 |
+ |
|
| 809 |
+ // 프로그레스바 요소 가져오기 |
|
| 810 |
+ var timeText = document.querySelector(".time_text");
|
|
| 811 |
+ var bar = document.querySelector(".change_bar");
|
|
| 812 |
+ |
|
| 813 |
+ // 초기 상태 설정 |
|
| 814 |
+ var width = 1; |
|
| 815 |
+ var totalTime = time * 1000; // 총 실행 시간 (밀리초) |
|
| 816 |
+ var cmpWid = totalTime / 100; // width 증가 간격 (밀리초) |
|
| 817 |
+ |
|
| 818 |
+ // 새 타이머 시작 |
|
| 819 |
+ progressInterval = setInterval(changeWidth, cmpWid); |
|
| 820 |
+ |
|
| 821 |
+ function changeWidth() {
|
|
| 822 |
+ if (width >= 100) {
|
|
| 823 |
+ // 프로그레스바 100% 도달 |
|
| 824 |
+ clearInterval(progressInterval); // 타이머 종료 |
|
| 825 |
+ progressInterval = null; // 타이머 ID 초기화 |
|
| 826 |
+ |
|
| 827 |
+ timeText.innerHTML = "100%"; |
|
| 828 |
+ |
|
| 829 |
+ setTimeout(function () {
|
|
| 830 |
+ // 100% 표시 후 "잠시만 기다려주세요" 변경 |
|
| 831 |
+ timeText.innerHTML = "잠시만 기다려주세요..."; |
|
| 832 |
+ $(".time_text").addClass("animation");
|
|
| 833 |
+ }, 1000); |
|
| 834 |
+ } else {
|
|
| 835 |
+ // 프로그레스바 진행 |
|
| 836 |
+ width++; |
|
| 837 |
+ bar.style.width = width + "%"; |
|
| 838 |
+ timeText.innerHTML = width + "%"; |
|
| 839 |
+ } |
|
| 840 |
+ } |
|
| 841 |
+} |
|
| 842 |
+ |
|
| 843 |
+ |
|
| 844 |
+//프로그레스바 완료 |
|
| 845 |
+function progressComplete() {
|
|
| 846 |
+ // var width = parseInt($(".time_text").text().replace('%', '')) || 0; // 현재 width 가져오기
|
|
| 847 |
+ |
|
| 848 |
+ $(".progress_bar_wrap").hide();
|
|
| 736 | 849 |
} |
| 737 | 850 |
|
| 738 | 851 |
/* |
| 739 | 852 |
* 치환문자 있는 수신자 목록 파씽 |
| 740 | 853 |
*/ |
| 741 | 854 |
function fn_transCallToListParsing(){
|
| 742 |
- var callToList = []; |
|
| 855 |
+/* var callToList = []; |
|
| 743 | 856 |
// excel body |
| 744 | 857 |
$('.excelBody').each(function(indexBody, itemBody){
|
| 745 | 858 |
$(itemBody).find('.list_table_name').each(function(indexRow, itemRow){
|
... | ... | @@ -750,7 +863,31 @@ |
| 750 | 863 |
}); |
| 751 | 864 |
}); |
| 752 | 865 |
$('#bizForm #callToList').val(callToList);
|
| 866 |
+ */ |
|
| 753 | 867 |
|
| 868 |
+ var dataList = []; |
|
| 869 |
+ |
|
| 870 |
+ var headers = []; |
|
| 871 |
+ $('#excelHead .list_table_name').each(function() {
|
|
| 872 |
+ headers.push($(this).text().trim()); |
|
| 873 |
+ }); |
|
| 874 |
+ |
|
| 875 |
+ $('.excelBody').each(function() {
|
|
| 876 |
+ var row = {};
|
|
| 877 |
+ $(this).find('.list_table_name').each(function(index) {
|
|
| 878 |
+ var key = headers[index]; |
|
| 879 |
+ var value = $(this).text().trim(); |
|
| 880 |
+ if (index === 0) {
|
|
| 881 |
+ row["callToList"] = value; // 수신번호는 별도로 처리 |
|
| 882 |
+ } else {
|
|
| 883 |
+ row[key] = value; // |
|
| 884 |
+ } |
|
| 885 |
+ }); |
|
| 886 |
+ console.log(row) |
|
| 887 |
+ dataList.push(row); |
|
| 888 |
+ }); |
|
| 889 |
+ |
|
| 890 |
+ return dataList; |
|
| 754 | 891 |
} |
| 755 | 892 |
|
| 756 | 893 |
/* |
... | ... | @@ -758,13 +895,28 @@ |
| 758 | 895 |
*/ |
| 759 | 896 |
function fn_callToListParsing(){
|
| 760 | 897 |
|
| 761 |
- var callToList = []; |
|
| 762 |
- // excel body |
|
| 763 |
- $('.phoneArea').each(function(index, item){
|
|
| 764 |
- callToList.push($(item).text().replaceAll('\\t', ''));
|
|
| 898 |
+ var dataList = []; |
|
| 899 |
+ |
|
| 900 |
+/* $('.phoneArea').each(function(index, item){
|
|
| 901 |
+ var row = {};
|
|
| 902 |
+ var value = $(item).text().replaceAll('\\t', '')
|
|
| 903 |
+ row["callToList"] = value; // 수신번호는 별도로 처리 |
|
| 904 |
+ dataList.push(row); |
|
| 905 |
+ }); |
|
| 906 |
+ */ |
|
| 907 |
+ |
|
| 908 |
+ // Tabulator 테이블의 데이터 가져오기 |
|
| 909 |
+ var tableData = tableL.getData(); |
|
| 910 |
+ |
|
| 911 |
+ tableData.forEach(function(row){
|
|
| 912 |
+ var dataRow = {};
|
|
| 913 |
+ dataRow["callToList"] = row.phone; // phone 필드 값을 callToList로 저장 |
|
| 914 |
+ dataList.push(dataRow); |
|
| 765 | 915 |
}); |
| 766 | 916 |
|
| 767 |
- $('#bizForm #callToList').val(callToList);
|
|
| 917 |
+ return dataList; |
|
| 918 |
+ |
|
| 919 |
+ |
|
| 768 | 920 |
|
| 769 | 921 |
} |
| 770 | 922 |
|
... | ... | @@ -777,9 +929,8 @@ |
| 777 | 929 |
// title 배열 |
| 778 | 930 |
var varHead = []; |
| 779 | 931 |
// 값 배열 |
| 780 |
- var varVal = []; |
|
| 932 |
+// var varVal = []; |
|
| 781 | 933 |
|
| 782 |
- var inputTag = '<input type="hidden" class="varValList" name="varValList[$INDEX$]" value="$VAL$">'; |
|
| 783 | 934 |
|
| 784 | 935 |
// excel title |
| 785 | 936 |
$('#excelHead').find('div').each(function(index, item){
|
... | ... | @@ -803,7 +954,7 @@ |
| 803 | 954 |
$("#bizForm").append(inputTag.replace('$VAL$',varValTemp ).replace('$INDEX$',index ));
|
| 804 | 955 |
}); */ |
| 805 | 956 |
|
| 806 |
- $('.excelBody').each(function(index, item){
|
|
| 957 |
+/* $('.excelBody').each(function(index, item){
|
|
| 807 | 958 |
|
| 808 | 959 |
var valLeng = $('#excelHead').find('.list_table_name').length-1;
|
| 809 | 960 |
varValTemp = ''; |
... | ... | @@ -821,7 +972,7 @@ |
| 821 | 972 |
console.log('varValTemp : ',varValTemp);
|
| 822 | 973 |
varVal.push(varValTemp); |
| 823 | 974 |
}); |
| 824 |
- $('#bizForm #varValList').val(varVal);
|
|
| 975 |
+ $('#bizForm #varValList').val(varVal); */
|
|
| 825 | 976 |
} |
| 826 | 977 |
|
| 827 | 978 |
|
... | ... | @@ -881,9 +1032,9 @@ |
| 881 | 1032 |
$('#smsLen').val(conLeng);
|
| 882 | 1033 |
|
| 883 | 1034 |
|
| 1035 |
+ $('#msgLeng').html(conLeng + " / ");
|
|
| 884 | 1036 |
if(conLeng > 90){
|
| 885 | 1037 |
|
| 886 |
- $('#msgLeng').html(conLeng + " / ");
|
|
| 887 | 1038 |
$('#limitLeng').html("2000");
|
| 888 | 1039 |
$('.msg_com').html("장문");
|
| 889 | 1040 |
$('#msgType').val("6"); // 메세지 타입 설정
|
... | ... | @@ -897,7 +1048,6 @@ |
| 897 | 1048 |
|
| 898 | 1049 |
}else{
|
| 899 | 1050 |
|
| 900 |
- $('#msgLeng').html(conLeng + " / ");
|
|
| 901 | 1051 |
$('#limitLeng').html("90");
|
| 902 | 1052 |
$('.msg_com').html("단문");
|
| 903 | 1053 |
$('#msgType').val("4"); // 메세지 타입 설정
|
... | ... | @@ -910,7 +1060,7 @@ |
| 910 | 1060 |
} |
| 911 | 1061 |
|
| 912 | 1062 |
//수신목록 전체 데이터 갯수 구하기 |
| 913 |
- updateTotCnt(totRows); |
|
| 1063 |
+ //updateTotCnt(totRows); |
|
| 914 | 1064 |
} |
| 915 | 1065 |
|
| 916 | 1066 |
/** |
... | ... | @@ -1141,6 +1291,17 @@ |
| 1141 | 1291 |
</div> |
| 1142 | 1292 |
</div> |
| 1143 | 1293 |
|
| 1294 |
+ <div class="progress_bar_wrap"> |
|
| 1295 |
+ <div class="progress_box"> |
|
| 1296 |
+ <p class="time_text">0%</p> |
|
| 1297 |
+ <div class="bar"> |
|
| 1298 |
+ <span class="change_bar"></span> |
|
| 1299 |
+ </div> |
|
| 1300 |
+ </div> |
|
| 1301 |
+ <div class="btn_wrap"> |
|
| 1302 |
+ </div> |
|
| 1303 |
+ |
|
| 1304 |
+ </div> |
|
| 1144 | 1305 |
<!-- 기업회원 이동 팝업 --> |
| 1145 | 1306 |
<div class="tooltip-wrap cvt_member_popup_wrap"> |
| 1146 | 1307 |
<div class="popup-com cvt_member_layer" tabindex="0" data-tooltip-con="cvt_member_layer" data-focus="cvt_member_layer" data-focus-prev="cvt_member_layer-close"> |
... | ... | @@ -1192,8 +1353,8 @@ |
| 1192 | 1353 |
<input type="hidden" id="divideTime" name="divideTime" value=""> <!--전송일자--> |
| 1193 | 1354 |
|
| 1194 | 1355 |
<input type="hidden" id="callFrom" name="callFrom" value=""> <!--완 보내는사람 --> |
| 1195 |
- <input type="hidden" id="callToList" name="callToList" value=""> <!--완 받는사람 리스트--> |
|
| 1196 |
- <input type="hidden" id="varNmList" name="varNmList" value=""> <!--완 변수 이름 리스트--> |
|
| 1356 |
+<!-- <input type="hidden" id="callToList" name="callToList" value=""> 완 받는사람 리스트 --> |
|
| 1357 |
+<!-- <input type="hidden" id="varNmList" name="varNmList" value=""> 완 변수 이름 리스트 --> |
|
| 1197 | 1358 |
<input type="hidden" id="varValList" name="varValList" value=""> <!--완 변수 리스트--> |
| 1198 | 1359 |
|
| 1199 | 1360 |
<input type="hidden" id="atSmishingYn" name="atSmishingYn" value="${atSmishingYn}"> <!--알림톡 스미싱 여부-->
|
... | ... | @@ -1354,25 +1515,25 @@ |
| 1354 | 1515 |
</span> |
| 1355 | 1516 |
</div> |
| 1356 | 1517 |
<div class="receipt_num_midde"> |
| 1357 |
- <div class="listType list01" > |
|
| 1358 |
- <div class="list_table list_head"> |
|
| 1518 |
+ <div class="listType list01 callList_box_P"> |
|
| 1519 |
+ <!-- <div class="list_table list_head"> |
|
| 1359 | 1520 |
<div class="cb_wrap"> |
| 1360 | 1521 |
<label for="select_all" class="label"></label> |
| 1361 | 1522 |
<input type="checkbox" id="select_all"> |
| 1362 | 1523 |
</div> |
| 1363 | 1524 |
<div class="list_table_num"> |
| 1364 | 1525 |
<p>휴대폰</p> |
| 1365 |
-<!-- <img src="/publish/images/sortUp.png"> --> |
|
| 1366 |
-<!-- <img src="/publish/images/sortDown.png"> --> |
|
| 1526 |
+ <img src="/publish/images/sortUp.png"> |
|
| 1527 |
+ <img src="/publish/images/sortDown.png"> |
|
| 1367 | 1528 |
</div> |
| 1368 |
-<!-- <div class="list_table_name"> --> |
|
| 1369 |
-<!-- <p>이름</p> --> |
|
| 1370 |
-<!-- <img src="/publish/images/sortUp.png"> --> |
|
| 1371 |
-<!-- <img src="/publish/images/sortDown.png"> --> |
|
| 1372 |
-<!-- </div> --> |
|
| 1529 |
+ <div class="list_table_name"> |
|
| 1530 |
+ <p>이름</p> |
|
| 1531 |
+ <img src="/publish/images/sortUp.png"> |
|
| 1532 |
+ <img src="/publish/images/sortDown.png"> |
|
| 1533 |
+ </div> |
|
| 1373 | 1534 |
</div> |
| 1374 | 1535 |
<div class="list_body_wrap" id="wrap01_body"> |
| 1375 |
- </div> |
|
| 1536 |
+ </div> --> |
|
| 1376 | 1537 |
</div> |
| 1377 | 1538 |
<div class="put_right"> |
| 1378 | 1539 |
<div class="btn_popup_wrap spc_wrap"> |
... | ... | @@ -1684,7 +1845,9 @@ |
| 1684 | 1845 |
<!--// table --> |
| 1685 | 1846 |
</div> |
| 1686 | 1847 |
<div class="popup_btn_wrap2"> |
| 1687 |
- <button type="button" onClick="javascript:addrToList(); return false;">추가</button> |
|
| 1848 |
+ <button type="button" onClick="javascript:addrToList_advc('all'); return false;">전체추가</button>
|
|
| 1849 |
+ <button type="button" onClick="javascript:addrToList_advc('select'); return false;">선택추가</button>
|
|
| 1850 |
+<!-- <button type="button" onClick="javascript:addrToList(); return false;">추가</button> --> |
|
| 1688 | 1851 |
<button type="button" onClick="javascript:addrClose(); return false;">닫기</button> |
| 1689 | 1852 |
</div> |
| 1690 | 1853 |
<%-- 주소록 레이어 팝업 닫기 실행 코드 --%> |
... | ... | @@ -1773,6 +1936,7 @@ |
| 1773 | 1936 |
|
| 1774 | 1937 |
|
| 1775 | 1938 |
|
| 1939 |
+ |
|
| 1776 | 1940 |
<!-- 엑셀 불러오기 --> |
| 1777 | 1941 |
<form id="excelToolTipForm" name="excelToolTipForm" method="post"> |
| 1778 | 1942 |
<div class="tooltip-wrap"> |
+++ src/main/webapp/WEB-INF/jsp/web/kakao/msgdata/at/KakaoAlimtalkMsgDataView_advcbackup_20250310.jsp
... | ... | @@ -0,0 +1,1773 @@ |
| 1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | |
| 2 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | |
| 3 | +<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> | |
| 4 | +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> | |
| 5 | +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> | |
| 6 | +<%@ page import="itn.com.cmm.LoginVO" %> | |
| 7 | + | |
| 8 | +<!-- <script src="/publish/js/content.js"></script> --> | |
| 9 | +<!-- 주소록관련 js --> | |
| 10 | +<script type="text/javascript" defer src="<c:out value='/js/kakao/at/init.js' />"></script> | |
| 11 | +<script type="text/javascript" src="<c:out value='/js/kakao/at/tabulator.js' />"></script> | |
| 12 | +<script type="text/javascript" src="<c:out value='/js/kakao/at/addr.js' />"></script> | |
| 13 | +<script type="text/javascript" src="<c:out value='/js/kakao/at/alimtalkExcel.js' />"></script> | |
| 14 | +<script type="text/javascript" src="<c:out value='/js/kakao/at/priceClclt.js' />"></script> | |
| 15 | +<script type="text/javascript" src="<c:out value='/js/common/popup.js' />"></script> | |
| 16 | +<script type="text/javascript"> | |
| 17 | +var loginVO = '${loginVO}'; | |
| 18 | + | |
| 19 | +// 체크박스 동적 바인딩 | |
| 20 | +$(document).on('click','.wrap01C', function(){ | |
| 21 | + var total = $(".wrap01C").length; | |
| 22 | + var checked = $(".wrap01C:checked").length; | |
| 23 | + if(total != checked) $("#select_all").prop("checked", false); | |
| 24 | + else $("#select_all").prop("checked", true); | |
| 25 | +}); | |
| 26 | + | |
| 27 | +$(document).ready(function(){ | |
| 28 | + | |
| 29 | + //채널 ID change function | |
| 30 | + $("#selectKakaoProfileList").on("change", function(){ | |
| 31 | + | |
| 32 | + if(usrDeptChk()){ | |
| 33 | + | |
| 34 | + $("#selectTemplateList option").remove(); | |
| 35 | + selectTemplateList(); | |
| 36 | + | |
| 37 | + }else { | |
| 38 | + | |
| 39 | + $("#selectKakaoProfileList option:eq(0)").prop("selected", true); | |
| 40 | + | |
| 41 | + } | |
| 42 | + | |
| 43 | + }); | |
| 44 | + | |
| 45 | + //템플릿 change function | |
| 46 | + $("#selectTemplateList").on("change", function(){ | |
| 47 | + selectTemplateInfo($(this).val()); | |
| 48 | + fn_viewDataInit02(); | |
| 49 | + priceInit(); // 발송금액 라인 text / 금액 초기화 | |
| 50 | + }); | |
| 51 | + | |
| 52 | + $("#fileClick").click(function(){ | |
| 53 | + if($('#selectTemplateList').val() == '') | |
| 54 | + { | |
| 55 | + alert('템플릿을 선택 후 진행해 주세요.'); | |
| 56 | + return false; | |
| 57 | + } | |
| 58 | + if($("#tpButtonTypeDs").val() == "DS"){ | |
| 59 | + alert("템플릿 내용에 배송조회 버튼이 포함되어 있습니다. \n운송장 번호는 숫자만 등록해주세요") | |
| 60 | + } | |
| 61 | + $('#excelFile').val(''); | |
| 62 | + $("#excelFile").click(); | |
| 63 | + }); | |
| 64 | + | |
| 65 | + //즉시 발송 라디오 버튼 선택시 숨김처리 | |
| 66 | + $("#reserYnN").on('click', function(){ | |
| 67 | + $('.rev_selected').hide(); | |
| 68 | + $('.send_rev .send_content').css('padding-bottom','108px'); | |
| 69 | + $('.send_btn .btnType:first-child').html('발송하기'); | |
| 70 | + $('#bizForm #reserveYn').val($(this).val()); | |
| 71 | + }); | |
| 72 | + | |
| 73 | + //예약 발송 라디오 버튼 선택시 숨김 해제처리 | |
| 74 | + $("#reserYnY").on('click', function(){ | |
| 75 | + $('.rev_selected').show(); | |
| 76 | + $('.send_rev .send_content').css('padding-bottom','0'); | |
| 77 | + $('.send_btn .btnType:first-child').html('예약하기'); | |
| 78 | + $('#bizForm #reserveYn').val($(this).val()); | |
| 79 | + }); | |
| 80 | + | |
| 81 | + //전체선색 버튼 이벤트 | |
| 82 | + $("#select_all").on('click', function(){ | |
| 83 | + if($("#select_all").is(":checked")) $(".wrap01C").prop("checked", true); | |
| 84 | + else $(".wrap01C").prop("checked", false); | |
| 85 | + | |
| 86 | + }); | |
| 87 | + | |
| 88 | + //선택삭제 버튼 클릭 이벤트 | |
| 89 | + $("#select_del").on('click', function(){ | |
| 90 | + | |
| 91 | + if($('.wrap01C:checkbox:checked').length < 1) | |
| 92 | + { | |
| 93 | + alert("삭제할 연락처를 선택해주세요.!!"); | |
| 94 | + return false; | |
| 95 | + } | |
| 96 | + | |
| 97 | + $('.wrap01C').each(function(index, item){ | |
| 98 | + if($(item).is(':checked')) | |
| 99 | + $(item).parent().parent().remove(); | |
| 100 | + }); | |
| 101 | + updateTotCnt(); | |
| 102 | + }); | |
| 103 | + | |
| 104 | + //선택삭제 버튼 클릭 이벤트 | |
| 105 | + $("#all_del").on('click', function(){ | |
| 106 | + | |
| 107 | + if(!confirm("받는사람 목록을 모두 삭제하시겠습니까?")) | |
| 108 | + return false; | |
| 109 | + | |
| 110 | + $('#wrap01_body .list_body').remove(); | |
| 111 | + | |
| 112 | + $('#rowTotCnt').text(0); | |
| 113 | + $('#rowDupCnt').text(0); | |
| 114 | + }); | |
| 115 | + | |
| 116 | + /* | |
| 117 | + * 오류 검사 | |
| 118 | + */ | |
| 119 | + $('#check_validity').click(function(){ | |
| 120 | + var regExp_ctn = /^(01[016789]{1}|02|0[3-9]{1}[0-9]{1})([0-9]{3,4})([0-9]{4})$/; | |
| 121 | + // 치환문자 있는 데이터 | |
| 122 | + if($('#bizForm #txtReplYn').val() === 'N'){ | |
| 123 | + | |
| 124 | + if($('.phoneArea').length < 1){ | |
| 125 | + alert("등록된 연락처가 없습니다.") | |
| 126 | + return false; | |
| 127 | + } | |
| 128 | + | |
| 129 | + $('.phoneArea').each(function(index, item){ | |
| 130 | + var phoneVal = $(item).text().trim(); | |
| 131 | + if(phoneVal.length==11 || phoneVal.length==10) | |
| 132 | + { | |
| 133 | + if(!regExp_ctn.test(phoneVal)) | |
| 134 | + { | |
| 135 | + alert(phoneVal+"는 유효하지 않은 전화번호 입니다."); | |
| 136 | + return false; | |
| 137 | + } | |
| 138 | + } | |
| 139 | + else | |
| 140 | + { | |
| 141 | + alert("유효하지 않은 전화번호 입니다."); | |
| 142 | + return false; | |
| 143 | + } | |
| 144 | + }); | |
| 145 | + alert("오류 데이터가 없습니다."); | |
| 146 | + } | |
| 147 | + }); | |
| 148 | + | |
| 149 | + /** | |
| 150 | + * 템플릿 재선택 버튼 function | |
| 151 | + */ | |
| 152 | + $('#reSelectBtn').click(function(){ | |
| 153 | + var senderKey = $('#selectKakaoProfileList option:selected').val(); | |
| 154 | + | |
| 155 | + if(!senderKey) | |
| 156 | + { | |
| 157 | + alert("채널ID를 선택하고 다시 시도해 주세요."); | |
| 158 | + return false; | |
| 159 | + } | |
| 160 | + | |
| 161 | + | |
| 162 | + var url = ""; | |
| 163 | + var windowTargetName = "KakaoAlimtalkTemplateListPopupAjax"; | |
| 164 | +// var features = "width=930, height=860, top=100, left=100, fullscreen=no, menubar=no, status=no, toolbar=no, titlebar=yes, location=no, scrollbars=yes"; | |
| 165 | + // 2.POST로 데이터 전달 | |
| 166 | + document.templateListPopup.senderKey.value=$('#selectKakaoProfileList option:selected').val(); | |
| 167 | + document.templateListPopup.yellowId.value=$('#selectKakaoProfileList option:selected').text(); | |
| 168 | + document.templateListPopup.target=windowTargetName; | |
| 169 | + showPopup2('',windowTargetName ,'930','860'); | |
| 170 | + document.templateListPopup.submit(); | |
| 171 | + | |
| 172 | + }); | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + $("#send_fail_check").change(function(){ | |
| 177 | + if($("#send_fail_check").is(":checked")){ | |
| 178 | + | |
| 179 | + | |
| 180 | + if(loginVO == "" || loginVO == null){ | |
| 181 | + alert("로그인 후 사용 가능한 기능입니다."); | |
| 182 | + location.href="<c:url value='/web/user/login/login.do'/>"; | |
| 183 | + return false; | |
| 184 | + | |
| 185 | + $("#send_fail_check").prop("checked", false); | |
| 186 | + } | |
| 187 | + | |
| 188 | + if($('#callFromList').val() === ''){ | |
| 189 | + | |
| 190 | + if(confirm('대체문자 전송을 위한 발신번호가 등록되지 않았습니다. \n대체문자 발신번호를 지금 등록하시겠습니까?')){ | |
| 191 | + window.location="<c:out value='/web/user/sendNumberManage.do' />"; | |
| 192 | + } | |
| 193 | + $("#send_fail_check").prop("checked", false); | |
| 194 | + | |
| 195 | + }else if($('#selectTemplateList').val() == '') | |
| 196 | + { | |
| 197 | + alert('템플릿을 선택 후 진행해 주세요.'); | |
| 198 | + $("#send_fail_check").prop("checked", false); | |
| 199 | + return false; | |
| 200 | + }else{ | |
| 201 | + // 에러버튼 체크 초기화 | |
| 202 | + fn_insertErrorYN('N'); | |
| 203 | + | |
| 204 | + $('#smsTxtArea').val(''); | |
| 205 | +// // 미리보기 텍스트를 가져와 줄바꿈 처리 후 대체문자 내용으로 입력 | |
| 206 | + var template_text = $('.template_text').html().trim(); | |
| 207 | + template_text = XSSChange(template_text); | |
| 208 | + $('#smsTxtArea').val(template_text); | |
| 209 | + | |
| 210 | +// //문자 내용 입력시 바이트수 계산하기 | |
| 211 | + | |
| 212 | + $(".replace_send_wrap").slideDown(400); | |
| 213 | + thisFnByteString($('#smsTxtArea').val()); | |
| 214 | + } | |
| 215 | + }else{ | |
| 216 | + $(".replace_send_wrap").slideUp(400); | |
| 217 | + // 초기화 버튼 클릭 | |
| 218 | + $('#failCheckInit').click(); | |
| 219 | + $('.send_top .send_right .phone').css({'top': '0','transition': 'top .4s linear'}); | |
| 220 | + } | |
| 221 | + | |
| 222 | + // 금액 계산 fn 호출 | |
| 223 | + fn_priceClclt(); | |
| 224 | + }); | |
| 225 | + | |
| 226 | + // 대체문자 내용 수정 | |
| 227 | + $('#smsTxtArea').keyup(function(){ | |
| 228 | + // 금액 계산 fn 호출 | |
| 229 | + fn_priceClclt(); | |
| 230 | + // 문자 바이트수 체크 | |
| 231 | + thisFnByteString($('#smsTxtArea').val()); | |
| 232 | + // 에러버튼 체크 초기화 | |
| 233 | + fn_insertErrorYN('N'); | |
| 234 | + | |
| 235 | + }); | |
| 236 | +}); | |
| 237 | +function sendFailCheckInit(){ | |
| 238 | + | |
| 239 | + $("#send_fail_check").prop("checked", false); | |
| 240 | + | |
| 241 | +} | |
| 242 | + | |
| 243 | +function fnTemplateReg(){ | |
| 244 | + if(loginVO == "" || loginVO == null){ | |
| 245 | + alert("신규 템플릿 등록 서비스는 로그인 후 이용 가능합니다."); | |
| 246 | + location.href="<c:url value='/web/user/login/login.do'/>"; | |
| 247 | + return false; | |
| 248 | + } | |
| 249 | + if(usrDeptChk()){ | |
| 250 | + | |
| 251 | + if(confirm('신규 템플릿 등록 화면으로 이동하시겠습니까?')){ | |
| 252 | + location.href="<c:url value='/web/mjon/kakao/template/selectKaKaoTemplateList.do'/>"; | |
| 253 | + } | |
| 254 | + } | |
| 255 | + | |
| 256 | +} | |
| 257 | + | |
| 258 | +/* | |
| 259 | + * 탬플릿 재선택 팝업에서 실행하는 function | |
| 260 | + */ | |
| 261 | +function call_templateChange(templateId){ | |
| 262 | + | |
| 263 | + $('#selectTemplateList').val(templateId).prop('selected', true); | |
| 264 | + selectTemplateInfo(templateId); | |
| 265 | +// $('#selectTemplateList').val('bizp_2023021711142018819557746').prop('selected', true); | |
| 266 | +} | |
| 267 | + | |
| 268 | + | |
| 269 | +/** | |
| 270 | + * 먼저 불러온 DATA가 있으면 삭제 | |
| 271 | + * !! 화면에 보이는 data만 삭제 !! | |
| 272 | + * 치환 데이터 | |
| 273 | + */ | |
| 274 | +function fn_viewDataInit01(){ | |
| 275 | + | |
| 276 | + // excel Data (치환 문자 table) 비우기 | |
| 277 | + $('#excelHead').empty(); | |
| 278 | + $('.excelBody').remove(); | |
| 279 | + $('#excelNm01').val(''); | |
| 280 | + // 치환문자 없을 경우 | |
| 281 | +// $('#wrap01_body .list_body').remove(); | |
| 282 | +} | |
| 283 | + | |
| 284 | +/** | |
| 285 | + * 먼저 불러온 DATA가 있으면 삭제 | |
| 286 | + * !! 화면에 보이는 data만 삭제 !! | |
| 287 | + * 총건수, 중복건수 데이터 0으로 초기화 | |
| 288 | + * 엑셀 불러오기 데이터 | |
| 289 | + */ | |
| 290 | +function fn_viewDataInit02(){ | |
| 291 | + $('.excelBody').remove(); | |
| 292 | + $('#excelHead').empty(); | |
| 293 | + $('#rowTotCnt').text("0"); | |
| 294 | + $('#rowDupCnt').text("0"); | |
| 295 | +} | |
| 296 | + | |
| 297 | +/* | |
| 298 | + *변수 다운로드 excel show function | |
| 299 | + */ | |
| 300 | +function variableWrapShow(){ | |
| 301 | + $(".receiver_wrap02").attr("style","display: block !important;"); | |
| 302 | + $(".receiver_wrap01").attr("style","display: none !important;"); | |
| 303 | + $(".variable_wrap").show(); | |
| 304 | + $('#bizForm #txtReplYn').val('Y'); | |
| 305 | + | |
| 306 | +} | |
| 307 | + | |
| 308 | +/* | |
| 309 | + * 변수 다운로드 excel hide function | |
| 310 | + */ | |
| 311 | +function variableWrapHide(){ | |
| 312 | + $(".receiver_wrap01").attr("style","display: block !important;"); | |
| 313 | + $(".receiver_wrap02").attr("style","display: none !important;"); | |
| 314 | + $(".variable_wrap").hide(); | |
| 315 | + $('#bizForm #txtReplYn').val('N'); | |
| 316 | + | |
| 317 | +} | |
| 318 | + | |
| 319 | + | |
| 320 | +/* | |
| 321 | + * 등록된 발신 탬플릿 목록 조회 function | |
| 322 | + */ | |
| 323 | +function selectTemplateList(){ | |
| 324 | + var selectAgentCode = $("select[name='selectKakaoProfileList']").val(); | |
| 325 | + $.ajax({ | |
| 326 | + type: "POST" | |
| 327 | + , url: "<c:out value ='/web/mjon/kakao/alimtalk/selectKakaoApiTemplateAjax.do' />" | |
| 328 | + , data:{ "senderKey":selectAgentCode, "pageType":"notityTalk"} | |
| 329 | + , dataType:'json' | |
| 330 | + , cache: false | |
| 331 | + , async: false | |
| 332 | + , timeout: 600000 | |
| 333 | + , success: function (returnData, status) { | |
| 334 | + if(status == 'success'){ | |
| 335 | + | |
| 336 | + $("#selectTemplateList option").remove(); | |
| 337 | + $("#selectTemplateList").append("<option value=''>알림톡 템플릿 선택</option>"); | |
| 338 | + | |
| 339 | + var list = returnData.kakaoTemplateList; | |
| 340 | + for(var i=0; i < list.templatList.length; i++){ | |
| 341 | + $("#selectTemplateList").append("<option value='"+list.templatList[i].templateCode+"'>"+list.templatList[i].templateName+"</option>"); | |
| 342 | + } | |
| 343 | + | |
| 344 | + } else if(status== 'fail'){ | |
| 345 | + alert(returnData.message); | |
| 346 | + } | |
| 347 | + } | |
| 348 | + ,error: function (e) { | |
| 349 | + console.log("ERROR : ", e); | |
| 350 | + alert("관리자에게 문의해 주세요"); | |
| 351 | + } | |
| 352 | + }); | |
| 353 | +} | |
| 354 | + | |
| 355 | +/* | |
| 356 | + * 템플릿 선택하여 정보 가져오는 function | |
| 357 | + */ | |
| 358 | +function selectTemplateInfo(id){ | |
| 359 | + | |
| 360 | + var selectAgentCode = $("select[name='selectKakaoProfileList']").val(); | |
| 361 | + | |
| 362 | + $("#alimtalkTemplate").empty(); | |
| 363 | + | |
| 364 | + // 우측 본문내용 만들기 | |
| 365 | + $("#alimtalkTemplate").load("/web/mjon/kakao/template/selectKakaoApiTemplateDataViewLoadAjax.do" | |
| 366 | + , { | |
| 367 | + "senderKey":selectAgentCode | |
| 368 | + , "templateCode" : id | |
| 369 | + },function(){ | |
| 370 | + | |
| 371 | + | |
| 372 | + // =================== 대체문자 숨김 / html 초기화 | |
| 373 | + $(".replace_send_wrap").slideUp(400); | |
| 374 | + // 초기화 버튼 클릭 | |
| 375 | + $('#failCheckInit').click(); | |
| 376 | + $('.send_top .send_right .phone').css({'top': '0','transition': 'top .4s linear'}); | |
| 377 | + $("#send_fail_check").prop("checked", false); | |
| 378 | + // //=================== 대체문자 숨김 / html 초기화 | |
| 379 | + | |
| 380 | + | |
| 381 | + // 미리보기에 채널ID 노출 | |
| 382 | + $('#prev_p_top').text($('#selectKakaoProfileList option:selected').text()); | |
| 383 | + | |
| 384 | + | |
| 385 | + var tpTemplateContent = $('#tpTemplateContent').val(); | |
| 386 | + $("#senderKeyInfo").val(selectAgentCode); | |
| 387 | + $("#templateCodeInfo").val($('#tpTemplateCode').val()); | |
| 388 | + | |
| 389 | + //엑셀 샘플 정보 - 내용만 변수처리하기 | |
| 390 | + $("#excelTemplateContent").val(tpTemplateContent); | |
| 391 | + $("#excelTemplateSubtitle").val($('#tpTemplateSubtitle').val()); | |
| 392 | + $("#excelTemplateTitle").val($('#tpTemplateTitle').val()); | |
| 393 | + | |
| 394 | + if(($('#tpTemplateEmphasizeType').val() != "NONE") || $('#tpBottonListSize').val() != "0"){ | |
| 395 | + $('#bizForm #bizJsonYn').val('Y'); | |
| 396 | + }else{ | |
| 397 | + $('#bizForm #bizJsonYn').val('N'); | |
| 398 | + } | |
| 399 | + | |
| 400 | + | |
| 401 | + if($('#tpTemplateEmphasizeType').val() == "TEXT"){ | |
| 402 | + $("#templateEmphasizeType").val($('#tpTemplateEmphasizeType').val()); | |
| 403 | + $("#templateTitle").val($('#tpTemplateTitle').val()); | |
| 404 | + $("#templateSubtitle").val($('#tpTemplateSubtitle').val()); | |
| 405 | + } | |
| 406 | + | |
| 407 | + $("#bizForm #templateContent").val(tpTemplateContent); | |
| 408 | + templateChange(); | |
| 409 | + | |
| 410 | + }); | |
| 411 | +} | |
| 412 | + | |
| 413 | +/* | |
| 414 | + * 알림톡 변수가 있는지 체크해서 변수 다운로드 excel show / hide 하는 function | |
| 415 | + */ | |
| 416 | +function templateChange(){ | |
| 417 | + var varList = $("#excelTemplateContent").val().match(/#\{([^}]+)\}/g); | |
| 418 | + if(varList == null) | |
| 419 | + variableWrapHide(); | |
| 420 | + else | |
| 421 | + variableWrapShow(); | |
| 422 | + | |
| 423 | +} | |
| 424 | +//엑셀 업로드 양식 다운로드 받기 | |
| 425 | +function excelDownload(){ | |
| 426 | + | |
| 427 | + if(loginVO == "" || loginVO == null){ | |
| 428 | + alert("변수설정 엑셀파일 다운로드는 서비스는 로그인 후 이용 가능합니다."); | |
| 429 | + location.href="<c:url value='/web/user/login/login.do'/>"; | |
| 430 | + return false; | |
| 431 | + } | |
| 432 | + | |
| 433 | + var profile = $("#selectKakaoProfileList").val(); | |
| 434 | + var template = $("#selectTemplateList").val(); | |
| 435 | + | |
| 436 | + if(profile == ''){ | |
| 437 | + | |
| 438 | + alert("채널ID를 선택해주세요."); | |
| 439 | + return false; | |
| 440 | + | |
| 441 | + } | |
| 442 | + | |
| 443 | + if(template == ''){ | |
| 444 | + | |
| 445 | + alert("알림톡 템플릿을 선택해주세요."); | |
| 446 | + return false; | |
| 447 | + | |
| 448 | + } | |
| 449 | + | |
| 450 | + //합친 내용에서 변수 문자열 뽑기 - #과{}미포함 | |
| 451 | + var fullVarList = $("#excelTemplateContent").val().match(/(?<=\#\{)(.*?)(?=\})/g); | |
| 452 | + $('#excelForm #varNmList').val(fullVarList); | |
| 453 | + $('#excelForm').submit(); | |
| 454 | + | |
| 455 | +} | |
| 456 | + | |
| 457 | +function checkConf() { | |
| 458 | + var confCheck = false; | |
| 459 | + | |
| 460 | + $.ajax({ | |
| 461 | + type: "POST", | |
| 462 | + url: "/web/mjon/conf/selectMjonMsgUseConfAjax.do", | |
| 463 | + data: {}, | |
| 464 | + dataType:'json', | |
| 465 | + async: false, | |
| 466 | + success: function (returnData, status) { | |
| 467 | + if(returnData.result == "fail") { | |
| 468 | + console.log(returnData.message); | |
| 469 | + }else if(returnData.result == "success"){ | |
| 470 | + confCheck = true; | |
| 471 | + } | |
| 472 | + } | |
| 473 | + ,error: function (e) {console.log("ERROR : ", e); } | |
| 474 | + }); | |
| 475 | + | |
| 476 | + return confCheck; | |
| 477 | +} | |
| 478 | + | |
| 479 | +/* | |
| 480 | + * 등록된 발신 탬플릿 카카오톡 전송 | |
| 481 | + */ | |
| 482 | +function sendTemplateInfo(){ | |
| 483 | + | |
| 484 | + if(!checkConf()){ //문자온 conf-check | |
| 485 | + alert("현재 알림톡 발송하기 기능 점검 중입니다.\n\n1분 후 다시 시도해주세요."); | |
| 486 | + return false; | |
| 487 | + } | |
| 488 | + | |
| 489 | + if(loginVO == "" || loginVO == null){ | |
| 490 | + alert("카카오톡 발송 서비스는 로그인 후 이용 가능합니다."); | |
| 491 | + location.href="<c:url value='/web/user/login/login.do'/>"; | |
| 492 | + return false; | |
| 493 | + } | |
| 494 | + | |
| 495 | + if(!usrDeptChk()){ | |
| 496 | + return false; | |
| 497 | + } | |
| 498 | + | |
| 499 | + //채널ID / 템플릿 선택 | |
| 500 | + if(!$('#selectKakaoProfileList').val()) | |
| 501 | + { | |
| 502 | + alert('채널ID를 선택 후 발송해 주세요'); | |
| 503 | + return false; | |
| 504 | + } | |
| 505 | + | |
| 506 | + if(!$('#selectTemplateList').val() ) | |
| 507 | + { | |
| 508 | + alert('템플릿을 선택 후 발송해 주세요'); | |
| 509 | + return false; | |
| 510 | + } | |
| 511 | + | |
| 512 | + //수신자 목록 체크 | |
| 513 | + if($('.phoneArea').length < 1) | |
| 514 | + { | |
| 515 | + alert('받는 사람 입력 후 발송해 주세요'); | |
| 516 | + return false; | |
| 517 | + } | |
| 518 | + | |
| 519 | + //수신자 목록 체크 | |
| 520 | + if($('.phoneArea').length > 500) | |
| 521 | + { | |
| 522 | + alert("최대 발송 건수는 500건 입니다."); | |
| 523 | + return false; | |
| 524 | + } | |
| 525 | + | |
| 526 | + | |
| 527 | + if($('#errorChk').val() === 'N' | |
| 528 | + && $("#send_fail_check").is(":checked") | |
| 529 | + && $('#txtReplYn').val() === 'Y' | |
| 530 | + ) | |
| 531 | + { | |
| 532 | + alert('대체문자 전송을 원하시면 오류검사 버튼을 확인해 주세요.'); | |
| 533 | + return false; | |
| 534 | + } | |
| 535 | + | |
| 536 | + // 금액 확인 | |
| 537 | + // 사용자 금액 | |
| 538 | + var userMoney = $('#oriUserMoney').val(); | |
| 539 | + // 발송 금액 | |
| 540 | + var totalPriceTxt = $('#totalPriceTxt').text(); | |
| 541 | + // 금액 확인 | |
| 542 | + var resutlPrice = parseFloat(userMoney)-parseFloat(totalPriceTxt); | |
| 543 | + | |
| 544 | + // 음수면 -1 값 | |
| 545 | + if(Math.sign(resutlPrice) < 0) | |
| 546 | + { | |
| 547 | + alert("발송에 필요한 회원님의 보유 잔액이 부족 합니다."); | |
| 548 | + return false; | |
| 549 | + } | |
| 550 | + | |
| 551 | + // 초기화 | |
| 552 | + $('.varValList').remove(); | |
| 553 | + $('#bizForm #varNmList').val(''); | |
| 554 | + | |
| 555 | + | |
| 556 | + // 대체문자 전송 확인 | |
| 557 | + if($('#send_fail_check').is(':checked')){ | |
| 558 | + $('#bizForm #subMsgSendYn').val("Y"); | |
| 559 | + $('#bizForm #subMsgTxt').val($("#smsTxtArea").val()); | |
| 560 | + | |
| 561 | + var subMsgTxt = $("#smsTxtArea").val().match(/#\{([^}]+)\}/g); | |
| 562 | + if(subMsgTxt == null){ | |
| 563 | + $('#bizForm #subMsgTxtReplYn').val("N"); | |
| 564 | + }else{ | |
| 565 | + $('#bizForm #subMsgTxtReplYn').val("Y"); | |
| 566 | + } | |
| 567 | + }else{ | |
| 568 | + $('#bizForm #subMsgSendYn').val("N"); | |
| 569 | + } | |
| 570 | + | |
| 571 | + // 예약문자 및 분할전송 확인 | |
| 572 | + var reserYn = $("input[name=reserYn]:checked").val(); // 예약 발송 여부 확인 | |
| 573 | + $('#bizForm #reserveYn').val(reserYn); | |
| 574 | + if(reserYn == 'Y'){ | |
| 575 | + | |
| 576 | + var date = $(".resDate").val();//form.msgResDate.value; | |
| 577 | + var hour = $("select[name='msgResHour']").val(); | |
| 578 | + var min = $("select[name='msgResMin']").val(); | |
| 579 | + | |
| 580 | + if(date == ""){ | |
| 581 | + alert("예약전송 날짜를 선택해 주세요."); | |
| 582 | + return false; | |
| 583 | + | |
| 584 | + }else{ | |
| 585 | + | |
| 586 | + var now = new Date(); | |
| 587 | + var reqDate = date + " " + hour + ":" + min + ":00"; | |
| 588 | + var gapDate = getGapDayTime(date, hour, min); | |
| 589 | + | |
| 590 | + if(gapDate < 0){ // 음수이면 이전날짜, 크면 이후 날짜. | |
| 591 | + alert("예약 날짜는 현재 시간 이후의 날짜 및 시간을 선택해 주세요."); | |
| 592 | + return false; | |
| 593 | + }else{ | |
| 594 | + $('#bizForm #reqDate').val(reqDate); | |
| 595 | + } | |
| 596 | + } | |
| 597 | + | |
| 598 | + var divideChk = ""; | |
| 599 | + if($('#inputDivideChk').is(':checked')){ | |
| 600 | + divideChk = "Y"; | |
| 601 | + }else{ | |
| 602 | + divideChk = "N" | |
| 603 | + } | |
| 604 | + | |
| 605 | + //var divideCnt = $("select[name='frmDivideCnt']").val(); | |
| 606 | + var divideCnt = $('#frmDivideCnt').val(); | |
| 607 | + var divideTime = $("select[name='divideTime']").val(); | |
| 608 | + | |
| 609 | + $('#bizForm #divideChk').val(divideChk); | |
| 610 | + $('#bizForm #divideCnt').val(divideCnt); | |
| 611 | + $('#bizForm #divideTime').val(divideTime); | |
| 612 | + | |
| 613 | + }else{ | |
| 614 | + $('#bizForm #reqDate').val(""); | |
| 615 | + } | |
| 616 | + | |
| 617 | + // 치환문자 있는 데이터 파씽 | |
| 618 | + if($('#bizForm #txtReplYn').val() === 'Y'){ | |
| 619 | + fn_excelDataTransParsing(); | |
| 620 | + // 치환문자 있는 수신자 리스트 | |
| 621 | + fn_transCallToListParsing(); | |
| 622 | + }else{ | |
| 623 | + // 치환문자 없는 수신자 리스트 | |
| 624 | + fn_callToListParsing(); | |
| 625 | + } | |
| 626 | + | |
| 627 | + $('#bizForm #senderKey').val($('#selectKakaoProfileList').val()); | |
| 628 | + $('#bizForm #templateCode').val($('#selectTemplateList').val()); | |
| 629 | + | |
| 630 | + // 발신번호 | |
| 631 | + $('#bizForm #callFrom').val(removeDash($('#callFromList option:selected').val())); | |
| 632 | + | |
| 633 | + if(confirm("알림톡을 발송하시겠습니까?")){ | |
| 634 | + var spamChk = true; | |
| 635 | + //2023.09.06 알림톡 스팸체크 기능 제거요청으로 인한 주석처리 | |
| 636 | + /*var spamChk = false; | |
| 637 | + var spmData = new FormData(document.bizForm); | |
| 638 | + $.ajax({ | |
| 639 | + type: "POST" | |
| 640 | + , url: "/web/mjon/alimtalk/selectSpamKakaoAlimtalkMsgChkAjax.do" | |
| 641 | + , data: spmData | |
| 642 | + , dataType:'json' | |
| 643 | + , async: false | |
| 644 | + , processData: false | |
| 645 | + , contentType: false | |
| 646 | + , cache: false | |
| 647 | + , success: function (returnData, status) { | |
| 648 | + if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나 | |
| 649 | + | |
| 650 | + if("fail" == returnData.result){ | |
| 651 | + alert(returnData.message); | |
| 652 | + return false; | |
| 653 | + }else if("loginFail" == returnData.result){ | |
| 654 | + alert(returnData.message); | |
| 655 | + return false; | |
| 656 | + }else if("spams" == returnData.result){ | |
| 657 | + alert("전송 내용에 스팸문구가 포함되어 있습니다.") | |
| 658 | + return false; | |
| 659 | + }else{ | |
| 660 | + spamChk = true; | |
| 661 | + return false; | |
| 662 | + } | |
| 663 | + | |
| 664 | + } else if(status== 'fail'){ | |
| 665 | + alert(returnData.message); | |
| 666 | + return false; | |
| 667 | + } | |
| 668 | + } | |
| 669 | + , error: function (e) { | |
| 670 | + alert("문자 발송에 실패하였습니다."); | |
| 671 | + console.log("ERROR : ", e); | |
| 672 | + return false; | |
| 673 | + } | |
| 674 | + }); */ | |
| 675 | + | |
| 676 | + if(spamChk){ | |
| 677 | + var data = new FormData(document.bizForm); | |
| 678 | + $.ajax({ | |
| 679 | + type: "POST" | |
| 680 | + , url: "/web/mjon/kakao/alimtalk/kakaoAlimTalkMsgSendAjax.do" | |
| 681 | +// , url: "/web/mjon/kakao/alimtalk/kakaoAlimTalkMsgSendAjax_advc.do" | |
| 682 | + , data: data | |
| 683 | + , dataType: 'json' | |
| 684 | + , async: true | |
| 685 | + , processData: false | |
| 686 | + , contentType: false | |
| 687 | + , cache: false | |
| 688 | + , success: function (returnData, status) { | |
| 689 | + console.log('returnData : ', returnData); | |
| 690 | + if(status == 'success'){ | |
| 691 | + /* if("loginFail" == returnData.result){ | |
| 692 | + | |
| 693 | + alert(returnData.message); | |
| 694 | + return false; | |
| 695 | + | |
| 696 | + }else if('fail' == returnData.result){ | |
| 697 | + | |
| 698 | + alert(returnData.message); | |
| 699 | + return false; | |
| 700 | + | |
| 701 | + }else if('authFail' == returnData.result){ | |
| 702 | + | |
| 703 | + alert(returnData.message); | |
| 704 | + location.reload(); | |
| 705 | + | |
| 706 | + } else if(status == 'success'){ | |
| 707 | + | |
| 708 | + var kakaoSendCnt = returnData.resultSts; | |
| 709 | + | |
| 710 | + $('.pop_msg_success').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'}); | |
| 711 | + | |
| 712 | + //예약발송 건의 경우 결과 팝업 문구 변경 | |
| 713 | + if(reserYn == 'Y'){ | |
| 714 | + $('.pop_msg_success .msg_text').html("예약 성공 : <strong>"+ kakaoSendCnt + "</strong>건의<br>알림톡이 예약 되었습니다."); | |
| 715 | + }else{ | |
| 716 | + $('.pop_msg_success .msg_text').html("발송 성공 : <strong>"+ kakaoSendCnt + "</strong>건의<br>알림톡이 발송 되었습니다."); | |
| 717 | + } | |
| 718 | + | |
| 719 | + $('.mask').addClass('on'); | |
| 720 | + } */ | |
| 721 | + } | |
| 722 | + } | |
| 723 | + ,beforeSend : function(xmlHttpRequest) { | |
| 724 | + //로딩창 show | |
| 725 | + $('.loading_layer').addClass('active'); | |
| 726 | + } | |
| 727 | + ,complete : function(xhr, textStatus) { | |
| 728 | + //로딩창 hide | |
| 729 | + $('.loading_layer').removeClass('active'); | |
| 730 | + } | |
| 731 | + ,error: function (e) { | |
| 732 | + console.log("ERROR : ", e); | |
| 733 | + alert("카카오 알림톡 전송에 실패하였습니다."); | |
| 734 | + } | |
| 735 | + }); | |
| 736 | + } | |
| 737 | + } | |
| 738 | +} | |
| 739 | + | |
| 740 | +/* | |
| 741 | + * 치환문자 있는 수신자 목록 파씽 | |
| 742 | + */ | |
| 743 | +function fn_transCallToListParsing(){ | |
| 744 | + var callToList = []; | |
| 745 | + // excel body | |
| 746 | + $('.excelBody').each(function(indexBody, itemBody){ | |
| 747 | + $(itemBody).find('.list_table_name').each(function(indexRow, itemRow){ | |
| 748 | + if(indexRow == 0) | |
| 749 | + { | |
| 750 | + callToList.push($(itemRow).text().replaceAll('\\t', '')); | |
| 751 | + } | |
| 752 | + }); | |
| 753 | + }); | |
| 754 | + $('#bizForm #callToList').val(callToList); | |
| 755 | + | |
| 756 | +} | |
| 757 | + | |
| 758 | +/* | |
| 759 | + * 치환문자 없는 수신자 목록 파씽 | |
| 760 | + */ | |
| 761 | +function fn_callToListParsing(){ | |
| 762 | + | |
| 763 | + var callToList = []; | |
| 764 | + // excel body | |
| 765 | + $('.phoneArea').each(function(index, item){ | |
| 766 | + callToList.push($(item).text().replaceAll('\\t', '')); | |
| 767 | + }); | |
| 768 | + | |
| 769 | + $('#bizForm #callToList').val(callToList); | |
| 770 | + | |
| 771 | +} | |
| 772 | + | |
| 773 | +/* | |
| 774 | + * 받는사람 excel data 파씽 | |
| 775 | + */ | |
| 776 | +function fn_excelDataTransParsing(){ | |
| 777 | + | |
| 778 | + | |
| 779 | + // title 배열 | |
| 780 | + var varHead = []; | |
| 781 | + // 값 배열 | |
| 782 | + var varVal = []; | |
| 783 | + | |
| 784 | + var inputTag = '<input type="hidden" class="varValList" name="varValList[$INDEX$]" value="$VAL$">'; | |
| 785 | + | |
| 786 | + // excel title | |
| 787 | + $('#excelHead').find('div').each(function(index, item){ | |
| 788 | + if(index != 0) | |
| 789 | + varHead.push($(item).text().replaceAll('\\t', '')); | |
| 790 | + }); | |
| 791 | + $('#bizForm #varNmList').val(varHead); | |
| 792 | + | |
| 793 | + // excel body | |
| 794 | +/* $('.excelBody').each(function(index, item){ | |
| 795 | + varValTemp = []; | |
| 796 | + $(item).find('.list_table_name').each(function(index, item){ | |
| 797 | + if(index != 0){ | |
| 798 | + if(index == 1){ | |
| 799 | + varValTemp = $(item).text().replaceAll('\\t', ''); | |
| 800 | + }else | |
| 801 | + varValTemp += ","+$(item).text().replaceAll('\\t', ''); | |
| 802 | + } | |
| 803 | + }); | |
| 804 | + | |
| 805 | + $("#bizForm").append(inputTag.replace('$VAL$',varValTemp ).replace('$INDEX$',index )); | |
| 806 | + }); */ | |
| 807 | + | |
| 808 | + $('.excelBody').each(function(index, item){ | |
| 809 | + | |
| 810 | + var valLeng = $('#excelHead').find('.list_table_name').length-1; | |
| 811 | + varValTemp = ''; | |
| 812 | + | |
| 813 | + $(item).find('.list_table_name').each(function(index, item){ | |
| 814 | + if(index != 0) | |
| 815 | + { | |
| 816 | + var itemText = $(item).text().replaceAll('\\t', ''); | |
| 817 | + if(index !== 1) | |
| 818 | + varValTemp += '§'+itemText.replaceAll(',', 'Ï'); | |
| 819 | + else | |
| 820 | + varValTemp += itemText.replaceAll(',', 'Ï'); | |
| 821 | + } | |
| 822 | + }); | |
| 823 | + console.log('varValTemp : ',varValTemp); | |
| 824 | + varVal.push(varValTemp); | |
| 825 | + }); | |
| 826 | + $('#bizForm #varValList').val(varVal); | |
| 827 | +} | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | +//주소록 불러오기 버튼 클릭시 | |
| 832 | +$('.popupAddr').click(function(){ | |
| 833 | + | |
| 834 | + if(loginVO == "" || loginVO == null){ | |
| 835 | + alert("주소록 불러오기 서비스는 로그인 후 이용 가능합니다."); | |
| 836 | + location.href="<c:url value='/web/user/login/login.do'/>"; | |
| 837 | + return false; | |
| 838 | + } | |
| 839 | + | |
| 840 | + $("#addrGroupLoad").load("/web/mjon/msgdata/selectAddrGroupListAjax.do", "" ,function(response, status, xhr){ | |
| 841 | + //리스트 스크롤 처리해주기 | |
| 842 | + $(".adr_pop_list").mCustomScrollbar({ | |
| 843 | + axis: 'y', | |
| 844 | + scrollbarPosition: "outside", | |
| 845 | + theme: "dark", | |
| 846 | + autoHideScrollbar: false | |
| 847 | + }); | |
| 848 | + }); | |
| 849 | + | |
| 850 | +}); | |
| 851 | + | |
| 852 | + | |
| 853 | +//알림톡 상세보기 화면 호출 | |
| 854 | +function fnTemplateDetail(templateCode){ | |
| 855 | + var form = document.templateForm; | |
| 856 | + var selectAgentCode = $("select[name='selectKakaoProfileList']").val(); // 선택 채널ID | |
| 857 | + | |
| 858 | + form.senderKey.value = selectAgentCode; | |
| 859 | + form.templateCode.value = templateCode; | |
| 860 | + form.target='_blank'; | |
| 861 | + form.action="/web/mjon/kakao/template/requestKakaoApiTemplateDetail.do"; | |
| 862 | + form.submit(); | |
| 863 | + | |
| 864 | +} | |
| 865 | + | |
| 866 | + | |
| 867 | +//문자 바이트수 계산하기 함수 | |
| 868 | +function thisFnByteString(contents){ | |
| 869 | + var totalByte = 0; | |
| 870 | + //var content = contents; | |
| 871 | + var adverYn = $("input[name='send_adYn']:checked").val(); | |
| 872 | + var adTxtLeng = 0; | |
| 873 | + var denyTxtLeng = 0; | |
| 874 | + | |
| 875 | + $('#msgLeng').html(""); | |
| 876 | + $('#limitLeng').html(""); | |
| 877 | + var conLeng = conByteLeng(contents); // 내용 문자 입력 바이트 수 계산하기 | |
| 878 | + | |
| 879 | + | |
| 880 | + $('#msgLeng').text(conLeng); | |
| 881 | + | |
| 882 | + //문자 길이 변수에 저장해주기 | |
| 883 | + $('#smsLen').val(conLeng); | |
| 884 | + | |
| 885 | + | |
| 886 | + if(conLeng > 90){ | |
| 887 | + | |
| 888 | + $('#msgLeng').html(conLeng + " / "); | |
| 889 | + $('#limitLeng').html("2000"); | |
| 890 | + $('.msg_com').html("장문"); | |
| 891 | + $('#msgType').val("6"); // 메세지 타입 설정 | |
| 892 | + | |
| 893 | + $('.msg_com').removeClass("msg_short"); //단문 클래스 삭제하고 | |
| 894 | + $('.put_left').removeClass("short"); //내용 입력 박스 클래스 삭제 | |
| 895 | + $('.msg_com').addClass("msg_long"); // 장문 클래스 삽입 | |
| 896 | +// $('.put_left').addClass("long"); // 내용 입력 박스에 클래스 삽입 | |
| 897 | +// $('.msg_title').addClass('active'); | |
| 898 | + //document.getElementById("mmsSubject").disabled = false; | |
| 899 | + | |
| 900 | + }else{ | |
| 901 | + | |
| 902 | + $('#msgLeng').html(conLeng + " / "); | |
| 903 | + $('#limitLeng').html("90"); | |
| 904 | + $('.msg_com').html("단문"); | |
| 905 | + $('#msgType').val("4"); // 메세지 타입 설정 | |
| 906 | + $('.msg_com').removeClass("msg_long"); //단문 클래스 삭제하고 | |
| 907 | + $('.put_left').removeClass("long"); //내용 입력 박스 클래스 삭제 | |
| 908 | + $('.msg_com').addClass("msg_short"); // 장문 클래스 삽입 | |
| 909 | +// $('.put_left').addClass("short"); // 내용 입력 박스에 클래스 삽입 | |
| 910 | +// $('.msg_title, .title_wrap .textbox').removeClass('active'); | |
| 911 | + | |
| 912 | + } | |
| 913 | + | |
| 914 | + //수신목록 전체 데이터 갯수 구하기 | |
| 915 | + updateTotCnt(totRows); | |
| 916 | +} | |
| 917 | + | |
| 918 | +/** | |
| 919 | + * @description 대체문자 오류체크 funciton | |
| 920 | + */ | |
| 921 | +function fn_errorChk(){ | |
| 922 | + | |
| 923 | + // 대체문자가 없을 시 return false; | |
| 924 | + if($('#txtReplYn').val() === 'N') | |
| 925 | + { | |
| 926 | + alert('오류가 없습니다.'); | |
| 927 | + return false; | |
| 928 | + } | |
| 929 | + | |
| 930 | + // 치환 부분 변수명만 추출 = 배열 | |
| 931 | + var varList = $("#excelTemplateContent").val().match(/#\{([^}]+)\}/g); | |
| 932 | + | |
| 933 | + var smsTxt = $('#smsTxtArea').val(); | |
| 934 | + for(var i=0; i < varList.length; i++){ | |
| 935 | + if(smsTxt.indexOf(varList[i]) < 0){ | |
| 936 | + if(confirm(varList[i] + '값이 없습니다. 치환문자 없이 진행하시겠습니까?')){ | |
| 937 | + fn_insertErrorYN('Y'); | |
| 938 | + }; | |
| 939 | + return false; | |
| 940 | + } | |
| 941 | + smsTxt = smsTxt.replace(varList[i], ''); | |
| 942 | + }; | |
| 943 | + alert('오류가 없습니다.'); | |
| 944 | + fn_insertErrorYN('Y'); | |
| 945 | +} | |
| 946 | + | |
| 947 | + | |
| 948 | +function fn_insertErrorYN(val){ | |
| 949 | + $('#errorChk').val(val); | |
| 950 | +} | |
| 951 | + | |
| 952 | +function msgResultLink(){ | |
| 953 | + var reserYn = $("input[name=reserYn]:checked").val(); // 예약 발송 여부 확인 | |
| 954 | + if(reserYn == 'Y'){ | |
| 955 | + | |
| 956 | + location.href="/web/mjon/reservmsg/selectReservKaKaoView.do"; | |
| 957 | + | |
| 958 | + }else{ | |
| 959 | + location.href="/web/kakao/sent/selectKakaoSentView.do"; | |
| 960 | + } | |
| 961 | +} | |
| 962 | + | |
| 963 | +function msgSuccessClose(obj){ | |
| 964 | + $(obj).closest('.pop_msg_success').attr('style',''); | |
| 965 | + location.reload(true); | |
| 966 | + $('html').scrollTop(0); | |
| 967 | +} | |
| 968 | + | |
| 969 | +function goToKakaoTestPopUp(){ | |
| 970 | + | |
| 971 | + if(loginVO == "" || loginVO == null){ | |
| 972 | + alert("테스트 발송 서비스는 로그인 후 이용 가능합니다."); | |
| 973 | + location.href="<c:url value='/web/user/login/login.do'/>"; | |
| 974 | + return false; | |
| 975 | + } | |
| 976 | + | |
| 977 | + //기업회원 체크 | |
| 978 | + if(!usrDeptChk()){ | |
| 979 | + return false; | |
| 980 | + } | |
| 981 | + | |
| 982 | + var form = document.kakaoAtDataTestPopupForm; | |
| 983 | + var selectAgentCode = $("select[name='selectKakaoProfileList']").val(); | |
| 984 | + var selectTemplateCode = $("select[name='selectTemplateList']").val(); | |
| 985 | + var selectAgentTxt = $('#selectKakaoProfileList option:selected').text() | |
| 986 | + var txtRepYn = $('#bizForm #txtReplYn').val(); | |
| 987 | + var tpTemplateContent = $('#tpTemplateContent').val(); | |
| 988 | + var jsonYn = $('#bizForm #bizJsonYn').val(); | |
| 989 | + | |
| 990 | + if(selectAgentCode == '') { | |
| 991 | + alert("채널ID를 선택하고 다시 시도해 주세요."); | |
| 992 | + return false; | |
| 993 | + } | |
| 994 | + | |
| 995 | + if(selectTemplateCode == ''){ | |
| 996 | + alert('템플릿을 선택 후 진행해 주세요.'); | |
| 997 | + return false; | |
| 998 | + } | |
| 999 | + | |
| 1000 | + // 치환문자 있는 데이터 파씽 | |
| 1001 | + if($('#bizForm #txtReplYn').val() === 'Y'){ | |
| 1002 | + | |
| 1003 | + //수신자 목록 체크 | |
| 1004 | + if($('.phoneArea').length < 1){ | |
| 1005 | + alert('받는 사람 입력 후 발송해 주세요'); | |
| 1006 | + return false; | |
| 1007 | + } | |
| 1008 | + | |
| 1009 | + // title 배열 | |
| 1010 | + var varHead = []; | |
| 1011 | + // 값 배열 | |
| 1012 | + var varVal = []; | |
| 1013 | + | |
| 1014 | + // excel title | |
| 1015 | + $('#excelHead').find('div').each(function(index, item){ | |
| 1016 | + if(index != 0) | |
| 1017 | + varHead.push($(item).text().replaceAll('\\t', '')); | |
| 1018 | + }); | |
| 1019 | + form.varNmList.value = varHead; | |
| 1020 | + | |
| 1021 | + $('.excelBody').each(function(index, item){ | |
| 1022 | + varValTemp = ''; | |
| 1023 | + | |
| 1024 | + if(index == 0){ | |
| 1025 | + $(item).find('.list_table_name').each(function(index, item){ | |
| 1026 | + if(index != 0) | |
| 1027 | + { | |
| 1028 | + if(index !== 1) | |
| 1029 | + varValTemp += '§'+$(item).text().replaceAll('\\t', ''); | |
| 1030 | + else | |
| 1031 | + varValTemp += $(item).text().replaceAll('\\t', ''); | |
| 1032 | + } | |
| 1033 | + }); | |
| 1034 | + varVal.push(varValTemp); | |
| 1035 | + } | |
| 1036 | + }); | |
| 1037 | + form.varValList.value = varVal; | |
| 1038 | + } | |
| 1039 | + | |
| 1040 | + form.senderKey.value = selectAgentCode; | |
| 1041 | + form.templateCode.value = selectTemplateCode; | |
| 1042 | + form.agentCodeTxt.value = selectAgentTxt; | |
| 1043 | + form.txtReplYn.value = txtRepYn; | |
| 1044 | + form.templateContent.value = tpTemplateContent; | |
| 1045 | + form.bizJsonYn.value = jsonYn; | |
| 1046 | + | |
| 1047 | + form.method = "post"; | |
| 1048 | + window.open("about:blank", 'testSendPop', 'width=770, height=850, top=100, left=100, fullscreen=no, menubar=no, status=no, toolbar=no, titlebar=yes, location=no, scrollbars=1'); | |
| 1049 | + form.target = "testSendPop"; | |
| 1050 | + form.action = "/web/mjon/kakao/alimtalk/selectKakaoAlimtalkTemplateDataTestPopup.do"; | |
| 1051 | + form.submit(); | |
| 1052 | +} | |
| 1053 | + | |
| 1054 | +function goToReservKaKaoView(){ | |
| 1055 | + location.href="/web/mjon/reservmsg/selectReservKaKaoView.do"; | |
| 1056 | +} | |
| 1057 | + | |
| 1058 | +function goToSendKaKaoView(){ | |
| 1059 | + location.href="/web/kakao/sent/selectKakaoSentView.do"; | |
| 1060 | +} | |
| 1061 | +function goToPayUserKaKaoView(){ | |
| 1062 | + location.href="/web/member/pay/PayUserWithKakaoList.do"; | |
| 1063 | +} | |
| 1064 | + | |
| 1065 | +function checkNumber(event) { | |
| 1066 | + var divideCnt = $('#frmDivideCnt').val(); | |
| 1067 | + if(!(event.key >= 0 && event.key <= 9)) { | |
| 1068 | + return false; | |
| 1069 | + } | |
| 1070 | + | |
| 1071 | + var totCnt = divideCnt + "" + event.key; | |
| 1072 | + if(Number(totCnt) > 5000){ | |
| 1073 | + alert("분할전송 건수는 5,000건을 초과할 수 없습니다."); | |
| 1074 | + $('#frmDivideCnt').val("20"); | |
| 1075 | + return false; | |
| 1076 | + } | |
| 1077 | + | |
| 1078 | + return true; | |
| 1079 | +} | |
| 1080 | + | |
| 1081 | +</script> | |
| 1082 | + | |
| 1083 | + <div class="loading_layer"> | |
| 1084 | + <div class="loading_container"> | |
| 1085 | + <div class="bar"></div> | |
| 1086 | + <div class="text">Loading</div> | |
| 1087 | + </div> | |
| 1088 | + </div> | |
| 1089 | + | |
| 1090 | + <!-- 기업회원 이동 팝업 --> | |
| 1091 | + <div class="tooltip-wrap cvt_member_popup_wrap"> | |
| 1092 | + <div class="popup-com cvt_member_layer" tabindex="0" data-tooltip-con="cvt_member_layer" data-focus="cvt_member_layer" data-focus-prev="cvt_member_layer-close"> | |
| 1093 | + <div class="popup_heading"> | |
| 1094 | + <p>알림</p> | |
| 1095 | + <button type="button" class="tooltip-close" data-focus="cvt_member_layer-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> | |
| 1096 | + </div> | |
| 1097 | + <div class="layer_in"> | |
| 1098 | + <p>카카오톡 알림톡은 기업회원만 전송 가능합니다.<br>기업회원 전환 페이지로 이동하시겠습니까?</p> | |
| 1099 | + <div class="popup_btn_wrap2"> | |
| 1100 | + <button type="button" onclick="location.href='/web/user/membershipChange.do'">확인</button> | |
| 1101 | + <button type="button" class="tooltip-close" data-focus="cvt_member_layer-close" data-focus-next="cvt_member_layer">취소</button> | |
| 1102 | + </div> | |
| 1103 | + </div> | |
| 1104 | + </div> | |
| 1105 | + </div> | |
| 1106 | + <button type="button" id="btnDeptPop" data-tooltip="cvt_member_layer" style="display: none;"></button> | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + <!-- 템플릿 설정 디테일을 위한 FORM --> | |
| 1110 | + <form id="templateForm" name="templateForm" method="post"> | |
| 1111 | + <input type="hidden" name="senderKey" value=""/> | |
| 1112 | + <input type="hidden" name="templateCode" value=""/> | |
| 1113 | + <input type="hidden" name="arrTemplateCode" value=""/> | |
| 1114 | + </form> | |
| 1115 | + | |
| 1116 | + <form id="bizForm" name="bizForm" method="post"> | |
| 1117 | + <input type="hidden" id="menuTopTab" name="menuTopTab" value="tabAlim"> | |
| 1118 | + <input type="hidden" id="senderKey" name="senderKey" value=""> <!-- 카카오 보내는 사람 Key --> | |
| 1119 | + <input type="hidden" id="templateCode" name="templateCode" value=""> <!-- 카카오 전송 templat Code --> | |
| 1120 | + | |
| 1121 | + <input type="hidden" id="templateEmphasizeType" name="templateEmphasizeType" value=""> <!-- 카카오 전송 templateEmphasizeType 타입 --> | |
| 1122 | + | |
| 1123 | + <input type="hidden" id="templateContent" name="templateContent" value=""> <!-- 카카오 전송 templat내용 --> | |
| 1124 | + <input type="hidden" id="templateTitle" name="templateTitle" value=""> <!-- 카카오 전송 templat 타이틀 --> | |
| 1125 | + <input type="hidden" id="templateSubtitle" name="templateSubtitle" value=""> <!-- 카카오 전송 templat 서브 타이틀 --> | |
| 1126 | + | |
| 1127 | + <input type="hidden" id="subMsgTxtReplYn" name="subMsgTxtReplYn" value=""> <!-- 대체문자 전송내용에 변환문자가 있는지--> | |
| 1128 | + <input type="hidden" id="subMsgSendYn" name="subMsgSendYn" value=""> <!-- 대체문자 전송여부 - 알림톡 전송 실패 시 문자 전송--> | |
| 1129 | + <input type="hidden" id="subMsgTxt" name="subMsgTxt" value=""> <!-- 대체문자 전송내용 --> | |
| 1130 | + <input type="hidden" id="txtReplYn" name="txtReplYn" value="N"> <!-- 완 치환문자 여부 - --> | |
| 1131 | + <input type="hidden" id="bizJsonYn" name="bizJsonYn" value=""> <!-- JSON 생성 여부 --> | |
| 1132 | + | |
| 1133 | + <input type="hidden" id="reserveYn" name="reserveYn" value=""> <!-- 예약문자 여부 - 예약 선택 여부 // 아래 하단 화면 노출 여부도 같이--> | |
| 1134 | + <input type="hidden" id="reqDate" name="reqDate" value=""> <!--전송일자--> | |
| 1135 | + | |
| 1136 | + <input type="hidden" id="divideChk" name="divideChk" value=""> <!--전송일자--> | |
| 1137 | + <input type="hidden" id="divideCnt" name="divideCnt" value=""> <!--전송일자--> | |
| 1138 | + <input type="hidden" id="divideTime" name="divideTime" value=""> <!--전송일자--> | |
| 1139 | + | |
| 1140 | + <input type="hidden" id="callFrom" name="callFrom" value=""> <!--완 보내는사람 --> | |
| 1141 | + <input type="hidden" id="callToList" name="callToList" value=""> <!--완 받는사람 리스트--> | |
| 1142 | + <input type="hidden" id="varNmList" name="varNmList" value=""> <!--완 변수 이름 리스트--> | |
| 1143 | + <input type="hidden" id="varValList" name="varValList" value=""> <!--완 변수 리스트--> | |
| 1144 | + | |
| 1145 | + <input type="hidden" id="atSmishingYn" name="atSmishingYn" value="${atSmishingYn}"> <!--알림톡 스미싱 여부--> | |
| 1146 | + </form> | |
| 1147 | + | |
| 1148 | + <form id="excelForm" name="excelForm" action="<c:url value='/web/mjon/alimtalk/kakaoApiNotityTalkSampleExcelDownload.do'/>"> | |
| 1149 | + <input type="hidden" id="excelTemplateContent" name="excelTemplateContent" value=""> | |
| 1150 | + <input type="hidden" id="excelTemplateSubtitle" name="excelTemplateSubtitle" value=""> | |
| 1151 | + <input type="hidden" id="excelTemplateTitle" name="excelTemplateTitle" value=""> | |
| 1152 | + <input type="hidden" id="varNmList" name="varNmList" value=""> | |
| 1153 | + <input type="hidden" id="varValList" name="varValList[]" value=""> | |
| 1154 | + </form> | |
| 1155 | + | |
| 1156 | +<%-- <form id="templateListPopup" name="templateListPopup" action="<c:url value='/web/mjon/kakao/template/selectKakaoAlimtalkTemplateListPopupAjax.do'/>" method="post"> --%> | |
| 1157 | + <form id="templateListPopup" name="templateListPopup" action="<c:url value='/web/mjon/kakao/template/selectKakaoAlimtalkTemplateListPopupAjax.do'/>" method="post"> | |
| 1158 | + <input type="hidden" id="senderKey" name="senderKey" value=""> | |
| 1159 | + <input type="hidden" id="yellowId" name="yellowId" value=""> | |
| 1160 | + <input type="hidden" id="page" name="page" value="1"> | |
| 1161 | + <input type="hidden" id="formListType" name="formListType" value="thumbnail"> | |
| 1162 | + <input type="hidden" id="templateStatus" name="templateStatus" value="ACT"> <!-- 기본값 ACT:정상 --> | |
| 1163 | + </form> | |
| 1164 | + | |
| 1165 | + <!-- 테스트 전송 FORM --> | |
| 1166 | + <form id="kakaoAtDataTestPopupForm" name="kakaoAtDataTestPopupForm" method="post"> | |
| 1167 | + <input type="hidden" id="senderKey" name="senderKey" value=""> <!-- 카카오 보내는 사람 Key --> | |
| 1168 | + <input type="hidden" id="templateCode" name="templateCode" value=""> <!-- 카카오 전송 templat Code --> | |
| 1169 | + <input type="hidden" id="templateContent" name="templateContent" value=""> <!-- 카카오 전송 templat내용 --> | |
| 1170 | + <input type="hidden" id="agentCodeTxt" name="agentCodeTxt" value=""> <!-- 카카오 전송 templat Code --> | |
| 1171 | + <input type="hidden" id="txtReplYn" name="txtReplYn" value="N"> <!-- 치환문자 여부 - --> | |
| 1172 | + <input type="hidden" id="varNmList" name="varNmList" value=""> <!-- 변수 이름 리스트--> | |
| 1173 | + <input type="hidden" id="varValList" name="varValList" value=""> <!-- 변수 리스트--> | |
| 1174 | + <input type="hidden" id="bizJsonYn" name="bizJsonYn" value=""> <!-- 변수 리스트--> | |
| 1175 | + </form> | |
| 1176 | + | |
| 1177 | + <!-- 유저 보유잔액 --> | |
| 1178 | + <input type="hidden" id="oriUserMoney" value="<c:out value='${userMoney }' />"> | |
| 1179 | + | |
| 1180 | + <!-- 각 금액 단가 --> | |
| 1181 | + <input type="hidden" id="kakaoAtPrice" value="<c:out value='${sendPrice.kakaoAtPrice }' />"> <!-- 알림톡 단가 --> | |
| 1182 | + <input type="hidden" id="longPrice" value="<c:out value='${sendPrice.longPrice }' />"> <!-- mms 단가 --> | |
| 1183 | + <input type="hidden" id="shortPrice" value="<c:out value='${sendPrice.shortPrice }' />"> <!-- sms 단가 --> | |
| 1184 | + | |
| 1185 | + <!-- 각 금액 단가 --> | |
| 1186 | + <input type="hidden" id="errorChk" value="N"> <!-- sms 단가 --> | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + <div class="tooltip-wrap"> | |
| 1190 | + <!-- 문자발송 성공 레이어팝업 --> | |
| 1191 | + <div class="popup-com pop_msg_success"> | |
| 1192 | + <div class="popup_heading"> | |
| 1193 | + <p>알림톡 전송 결과</p> | |
| 1194 | + <button type="button" class="tooltip-close" onclick="msgSuccessClose(this);"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> | |
| 1195 | + </div> | |
| 1196 | + <div class="layer_in"> | |
| 1197 | + <div class="msg_text">발송 성공 : <strong>1</strong> 건,수신거부 : <span>0</span>건의<br>알림톡이 발송 되었습니다.</div> | |
| 1198 | + </div> | |
| 1199 | + <div class="popup_btn"> | |
| 1200 | + <button type="button" onclick="msgResultLink(); return false;">알림톡 발송결과 바로가기</button> | |
| 1201 | + <button type="button" class="tooltip-close" onclick="msgSuccessClose(this);">확인</button> | |
| 1202 | + </div> | |
| 1203 | + </div> | |
| 1204 | + </div> | |
| 1205 | + <div class="tooltip-wrap"> | |
| 1206 | + <!-- 문자발송 실패 레이어팝업 --> | |
| 1207 | + <div class="popup-com pop_msg_fails"> | |
| 1208 | + <div class="popup_heading"> | |
| 1209 | + <p>문자 전송 결과</p> | |
| 1210 | + <button type="button" class="tooltip-close" onclick="msgFailsClose(this);"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> | |
| 1211 | + </div> | |
| 1212 | + <div class="layer_in"> | |
| 1213 | + <div class="msg_text">발송 성공 : <strong>1</strong> 건,수신거부 : <span>0</span>건의<br>문자가 발송 되었습니다.</div> | |
| 1214 | + </div> | |
| 1215 | + <div class="popup_btn"> | |
| 1216 | + <button type="button" class="tooltip-close" onclick="msgFailsClose(this);">확인</button> | |
| 1217 | + </div> | |
| 1218 | + </div> | |
| 1219 | + </div> | |
| 1220 | + <div class="tooltip-wrap"> | |
| 1221 | + <!-- 문자발송 스팸 이용정지 레이어팝업 --> | |
| 1222 | + <div class="popup-com pop_msg_spam"> | |
| 1223 | + <div class="popup_heading"> | |
| 1224 | + <p>문자 전송 결과</p> | |
| 1225 | + <button type="button" class="tooltip-close" onclick="msgSpamClose(this);"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> | |
| 1226 | + </div> | |
| 1227 | + <div class="layer_in"> | |
| 1228 | + <div class="msg_text"></div> | |
| 1229 | + </div> | |
| 1230 | + <div class="popup_btn"> | |
| 1231 | + <button type="button" class="tooltip-close" onclick="msgSpamClose(this);">확인</button> | |
| 1232 | + </div> | |
| 1233 | + </div> | |
| 1234 | + </div> | |
| 1235 | + <div class="inner"> | |
| 1236 | + <!-- send top --> | |
| 1237 | + <div class="send_top"> | |
| 1238 | + <!-- tab button --> | |
| 1239 | + <%@include file="/WEB-INF/jsp/web/kakao/include/KaKaoAlimtalkTopMenuTap.jsp" %> | |
| 1240 | + <!--// tab button --> | |
| 1241 | + <!-- 카카오톡 설정 - 알림톡 템플릿 등록/관리 - 내템플릿 --> | |
| 1242 | + <div class="top_content kakaotalksend_cont current pay_tab_wrap"> | |
| 1243 | + <div class="send_general kakao_wrap"> | |
| 1244 | + <div class="send_left"> | |
| 1245 | + <table class="tType1"> | |
| 1246 | + <colgroup> | |
| 1247 | + <col style="width: 90px;"> | |
| 1248 | + <col style="width: auto;"> | |
| 1249 | + </colgroup> | |
| 1250 | + <tbody> | |
| 1251 | + <tr> | |
| 1252 | + <th>채널ID</th> | |
| 1253 | + <td> | |
| 1254 | + <label for="selectKakaoProfileList" class="채널ID 선택"></label> | |
| 1255 | + <select class="select_gray_type" id="selectKakaoProfileList" name="selectKakaoProfileList"> | |
| 1256 | + <option value="">채널ID 선택</option> | |
| 1257 | + <c:forEach var="kakaoProfileInfo" items="${kakaoProfileList}" varStatus="status"> | |
| 1258 | + <option value="${kakaoProfileInfo.senderKey}"><c:out value='${kakaoProfileInfo.yellowId}'/></option> | |
| 1259 | + </c:forEach> | |
| 1260 | + </select> | |
| 1261 | + | |
| 1262 | + </td> | |
| 1263 | + </tr> | |
| 1264 | + <tr> | |
| 1265 | + <th>템플릿</th> | |
| 1266 | + <td> | |
| 1267 | + <select class="select_gray_type" id="selectTemplateList" name="selectTemplateList"> | |
| 1268 | +<!-- <select name="" id="" class="select_gray_type"> --> | |
| 1269 | + <option value="">알림톡 템플릿 선택</option> | |
| 1270 | + </select> | |
| 1271 | +<!-- <button type="button" class="btnType btnType6" onclick="window.open('popup_allimtalk_template_choice.html','_blank','width=930, height=860, top=100, left=100, fullscreen=no, menubar=no, status=no, toolbar=no, titlebar=yes, location=no, scrollbars=yes')">템플릿 선택</button> --> | |
| 1272 | + <button type="button" class="btnType btnType6" onclick="javascript:fnTemplateReg(); return false;">템플릿 등록</button> | |
| 1273 | + <div class="variable_wrap"> | |
| 1274 | + <ul> | |
| 1275 | + <li>* 변수명 설정파일을 다운로드 받으신 후 전송대상과 변수를 입력 후 업로드해주세요.</li> | |
| 1276 | + <li>* 엑셀서식은 반드시 <span>텍스트 서식으로 등록</span>해주세요.</li> | |
| 1277 | + <li>* 한번에 전송가능한 <span>최대 발송건은 500건</span>입니다.</li> | |
| 1278 | + <li>* 배송조회시 운송장 번호는 <span>숫자만 등록</span>해주세요.</li> | |
| 1279 | + </ul> | |
| 1280 | + <button type="button" class="excel_btn" onclick="excelDownload();"><i></i> <c:out value="#"/>{변수명} 설정 파일 다운로드</button> | |
| 1281 | +<!-- <button type="button" class="excel_btn"><i></i> 변수명 설정 파일 다운로드</button> --> | |
| 1282 | + </div> | |
| 1283 | + </td> | |
| 1284 | + </tr> | |
| 1285 | + <tr> | |
| 1286 | + <th>받는사람</th> | |
| 1287 | + <td class="putText"> | |
| 1288 | + <div class="clearfix receipt_num receiver_wrap01"> | |
| 1289 | + <div class="receipt_num_top"> | |
| 1290 | + <label for="callTo" class="label">받는 번호입력</label> | |
| 1291 | + <input type="text" id="callTo" name="callTo" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');" placeholder="번호를 입력하세요" onfocus="this.placeholder=''" onblur="this.placeholder='번호를 입력하세요'" style="width:340px;"> | |
| 1292 | + <button type="button" class="btnType btnType6 addCallToF">번호추가</button> | |
| 1293 | + </br> | |
| 1294 | + <span> | |
| 1295 | + <span class="vMiddle">*</span> 중복번호는 한번만 발송됩니다. | |
| 1296 | + </span> | |
| 1297 | + </br> | |
| 1298 | + <span> | |
| 1299 | + <span class="vMiddle">*</span> 한번에 전송가능한 최대 발송건은 500건 입니다. | |
| 1300 | + </span> | |
| 1301 | + </div> | |
| 1302 | + <div class="receipt_num_midde"> | |
| 1303 | + <div class="listType list01" > | |
| 1304 | + <div class="list_table list_head"> | |
| 1305 | + <div class="cb_wrap"> | |
| 1306 | + <label for="select_all" class="label"></label> | |
| 1307 | + <input type="checkbox" id="select_all"> | |
| 1308 | + </div> | |
| 1309 | + <div class="list_table_num"> | |
| 1310 | + <p>휴대폰</p> | |
| 1311 | +<!-- <img src="/publish/images/sortUp.png"> --> | |
| 1312 | +<!-- <img src="/publish/images/sortDown.png"> --> | |
| 1313 | + </div> | |
| 1314 | +<!-- <div class="list_table_name"> --> | |
| 1315 | +<!-- <p>이름</p> --> | |
| 1316 | +<!-- <img src="/publish/images/sortUp.png"> --> | |
| 1317 | +<!-- <img src="/publish/images/sortDown.png"> --> | |
| 1318 | +<!-- </div> --> | |
| 1319 | + </div> | |
| 1320 | + <div class="list_body_wrap" id="wrap01_body"> | |
| 1321 | + </div> | |
| 1322 | + </div> | |
| 1323 | + <div class="put_right"> | |
| 1324 | + <div class="btn_popup_wrap spc_wrap"> | |
| 1325 | + <button type="button" data-tooltip="popup06" class="btnType btnType7 popupAddr">주소록 불러오기</button> | |
| 1326 | + </div> | |
| 1327 | + <div class="btn_popup_wrap"> | |
| 1328 | + <button type="button" data-tooltip="popup02" class="btnType btnType7">엑셀 불러오기</button> | |
| 1329 | + </div> | |
| 1330 | + <div class="btn_popup_wrap"> | |
| 1331 | + <button type="button" data-tooltip="popup03" class="btnType btnType7 tab1">최근 전송내역</button> | |
| 1332 | + </div> | |
| 1333 | + <div class="btn_popup_wrap"> | |
| 1334 | + <button type="button" data-tooltip="popup03" class="btnType btnType7 tab2">자주보내는 번호</button> | |
| 1335 | + </div> | |
| 1336 | + <div class="btn_popup_wrap check_validity_wrap"> | |
| 1337 | + <button type="button" class="btnType btnType7" id="check_validity">오류검사 <i class="qmMark"></i></button> | |
| 1338 | + <div class="error_hover_cont send_hover_cont"> | |
| 1339 | + <p>휴대폰 번호 입력 시 해당 휴대폰 번호에 대한 형식이 어긋나거나 휴대폰 번호에 오류가 있는지 등을 검사하는 기능</p> | |
| 1340 | + <span>(예시) 010-1234-0001(O) / 010-123-0001(X)</span> | |
| 1341 | + </div> | |
| 1342 | + </div> | |
| 1343 | + </div> | |
| 1344 | + </div> | |
| 1345 | + <div class="list_bottom clearfix"> | |
| 1346 | + <div class="remove_btnWrap"> | |
| 1347 | + <button type="button" class="btnType15" id="all_del"><i class="remove_img"></i>전체삭제</button> | |
| 1348 | + <button type="button" class="btnType15" id="select_del"><i class="remove_img"></i>선택삭제</button> | |
| 1349 | + </div> | |
| 1350 | + <div class="list_bottom_right"> | |
| 1351 | + <p>총 <span class="c_e40000" id="rowTotCnt">0</span>건 / 중복 <span class="c_002c9a" id="rowDupCnt">0</span>건</p> | |
| 1352 | +<!-- <button type="button" class="address_reg2">주소록에 등록</button> --> | |
| 1353 | + </div> | |
| 1354 | + </div> | |
| 1355 | + </div> | |
| 1356 | + <div class="clearfix receipt_num receiver_wrap02"> | |
| 1357 | + <div class="receipt_num_top"> | |
| 1358 | + <input type="text" placeholder="선택된 파일이 없습니다." onfocus="this.placeholder=''" onblur="this.placeholder='번호를 입력하세요'" style="width:340px;"> | |
| 1359 | + <button type="button" class="btnType btnType6" id="fileClick"/>파일선택</button> | |
| 1360 | + <input type="file" id="excelFile" accept=".xls, .xlsx" onchange="excelExportVarAjax(event); return false;" style="display:none"/> | |
| 1361 | + <!-- <input type="file" id="excelFile" accept=".xls, .xlsx" onchange="excelExport02(event); return false;" style="display:none"/> --> | |
| 1362 | + </div> | |
| 1363 | + <div class="receipt_num_midde"> | |
| 1364 | + <div class="listType list01" id="wrap02"> | |
| 1365 | + <!-- /publish/kakao_allimtalk_send.html 참고 --> | |
| 1366 | + <div class="list_table list_head" id="excelHead"> | |
| 1367 | + </div> | |
| 1368 | + <div class="list_body_wrap" id="excelBody02"> | |
| 1369 | + </div> | |
| 1370 | + </div> | |
| 1371 | + </div> | |
| 1372 | + </div> | |
| 1373 | + </td> | |
| 1374 | + </tr> | |
| 1375 | + <tr> | |
| 1376 | + <th colspan="2" class="billingAmount"> | |
| 1377 | + <div> | |
| 1378 | + <div class="final_pay"> | |
| 1379 | + <div class="pay_info_list"> | |
| 1380 | + <p>발송금액 :</p> | |
| 1381 | + <div class="info" id="repPriceTxt" style="display: none;"> | |
| 1382 | +<!-- <div class="info" id="repPriceTxt"> --> | |
| 1383 | +<!-- 단문 : <strong>20</strong>건<span>/</span> --> | |
| 1384 | +<!-- 장문 :<strong>150</strong>건<span>/</span> --> | |
| 1385 | +<!-- 그림문자 :<strong>30</strong>건 --> | |
| 1386 | + </div> | |
| 1387 | + </div> | |
| 1388 | + <p class="price"><span id="repPriceTxt"></span><span id="totalPriceTxt">0.0</span> 원<span></span></p> | |
| 1389 | + </div> | |
| 1390 | + <div class="pay_type clearfix"> | |
| 1391 | + <fmt:formatNumber type="number" maxFractionDigits="3" value="${userMoney}" var="commaPrice" /> | |
| 1392 | + <div> | |
| 1393 | + <input type="radio" id="radio_bill_1" name="radio_bill" checked="checked"> | |
| 1394 | + <label for="radio_bill_1">보유잔액</label> | |
| 1395 | + <label for="userMoney" class="la bel">보유잔액</label> | |
| 1396 | + <input type="text" id="userMoney" name="userMoney" value="<c:out value='${commaPrice}'/>" readonly> | |
| 1397 | + <span class="won">원</span> | |
| 1398 | + <button type="button" class="btnType btnType21" onclick="location.href='/web/member/pay/PayView.do'">충전</button> | |
| 1399 | + </div> | |
| 1400 | + <div></div> | |
| 1401 | + </div> | |
| 1402 | + </div> | |
| 1403 | + </th> | |
| 1404 | + </tr> | |
| 1405 | + <tr> | |
| 1406 | + <th colspan="2" class="replace_send_th"> | |
| 1407 | + <div class="title_th"><p>대체문자</p> | |
| 1408 | + <input type="checkbox" id="send_fail_check" style="margin: 0 8px 0 0;"><label for="send_fail_check">알림톡 전송 실패 시 문자 전송</label> | |
| 1409 | + </div> | |
| 1410 | + <div class="replace_send_wrap"> | |
| 1411 | +<!-- <div class="replace_send_wrap" style="display: block;"> --> | |
| 1412 | + <table class="tType1"> | |
| 1413 | + <colgroup> | |
| 1414 | + <col style="width: 90px;"> | |
| 1415 | + <col style="width: auto;"> | |
| 1416 | + </colgroup> | |
| 1417 | + <tbody> | |
| 1418 | + <tr> | |
| 1419 | + <th>발신번호</th> | |
| 1420 | + <td class="put_num"> | |
| 1421 | + <label for="callFromList" class="label"></label> | |
| 1422 | + <select id="callFromList" name="callFromList" class="sel_number"> | |
| 1423 | + <c:choose> | |
| 1424 | + <c:when test="${not empty resultPhonList}"> | |
| 1425 | + <c:forEach var="phonList" items="${resultPhonList}" varStatus="status"> | |
| 1426 | + <option value="${phonList}">${phonList}</option> | |
| 1427 | + </c:forEach> | |
| 1428 | + </c:when> | |
| 1429 | + <c:otherwise> | |
| 1430 | + <option value="">등록된 발신 번호가 없습니다.</option> | |
| 1431 | + </c:otherwise> | |
| 1432 | + </c:choose> | |
| 1433 | + </select> | |
| 1434 | + <button type="button" class="btnType btnType6" onclick="location.href='/web/user/sendNumberManage.do'">번호등록</button> | |
| 1435 | + </td> | |
| 1436 | + </tr> | |
| 1437 | + <tr> | |
| 1438 | + <th>내용</th> | |
| 1439 | + <td class="putText"> | |
| 1440 | + <div class="clearfix"> | |
| 1441 | + <div class="put_left short"> | |
| 1442 | + <!-- 업로드한 이미지의 썸네일 영역 --> | |
| 1443 | + <ul class="thumb_wrap liOnImg ui-sortable"></ul> | |
| 1444 | + <!-- //업로드한 이미지의 썸네일 영역 --> | |
| 1445 | + <label for="smsTxtArea" class="label"></label> | |
| 1446 | + <textarea id="smsTxtArea" name="smsTxtArea" class="put_text"></textarea> | |
| 1447 | + <div class="text_length"> | |
| 1448 | + <div name="afterDeny" id="afterDeny"> | |
| 1449 | + <p> | |
| 1450 | + <span class="fwMd" id="msgLeng">0 / | |
| 1451 | + </span> | |
| 1452 | + <span class="c_002c9a fwMd" id="limitLeng">90</span>byte | |
| 1453 | + </p> | |
| 1454 | + <span | |
| 1455 | + class="msg_com msg_short">단문</span> | |
| 1456 | + </div> | |
| 1457 | + </div> | |
| 1458 | + </div> | |
| 1459 | + <div class="put_right"> | |
| 1460 | + <button type="button" class="btnType btnType9" id="failCheckInit">초기화</button> | |
| 1461 | + <button type="button" class="btnType btnType7" onclick="javascript:fn_errorChk(); return false;">오류검사<i class="qmMark"></i></button> | |
| 1462 | +<!-- <button type="button" class="btnType btnType8" onclick="showPotoediter();">이미지 불러오기</button> --> | |
| 1463 | +<!-- <div class="send_btnWrap"> --> | |
| 1464 | +<!-- <button type="button" class="btnType btnType9">문자저장</button> --> | |
| 1465 | +<!-- </div> --> | |
| 1466 | + </div> | |
| 1467 | + | |
| 1468 | + </div> | |
| 1469 | +<!-- <p id="lowText">* 현재 [<span id="nowMsgType">단문</span>] <span class="c_e40000 fwBold nowMsgCnt">0</span>건 발송 가능합니다.</p> --> | |
| 1470 | + </td> | |
| 1471 | + </tr> | |
| 1472 | + </tbody> | |
| 1473 | + </table> | |
| 1474 | + </div> | |
| 1475 | + </th> | |
| 1476 | + </tr> | |
| 1477 | + </tbody> | |
| 1478 | + </table> | |
| 1479 | + </div> | |
| 1480 | + <div class="send_right"> | |
| 1481 | + <div class="phone"> | |
| 1482 | + <div class="phoneIn"> | |
| 1483 | + <p class="prev_p" id="prev_p_top"><img src="/publish/images/content/kakao_prev_icon.png" alt=""></p> | |
| 1484 | + <!-- 텍스트 미리보기 --> | |
| 1485 | + <div class="text_preview"> | |
| 1486 | + <div class="allimtalk_title"> | |
| 1487 | + <img src="/publish/images/content/icon_allimtalk.png" alt="">알림톡 도착 | |
| 1488 | + </div> | |
| 1489 | + <div class="allimtalk_content" id="alimtalkTemplate"> | |
| 1490 | + <p class="emphasis_side_text">템플릿을 선택해 주세요</p> | |
| 1491 | + </div> | |
| 1492 | + </div> | |
| 1493 | + <!-- //텍스트 미리보기 --> | |
| 1494 | + <div class="template_info_wrap"> | |
| 1495 | + <div class="template_byte"> | |
| 1496 | +<!-- <p><span class="fwMd" id="msgLeng">50 / </span><span class="c_002c9a fwMd" id="limitLeng">2000</span>byte</p> --> | |
| 1497 | + </div> | |
| 1498 | + <button type="button" class="btn_template_choice" id="reSelectBtn">템플릿 재선택</button> | |
| 1499 | + </div> | |
| 1500 | + </div> | |
| 1501 | + <p class="addText">※ 단말기 설정에 따라 다르게 보일 수 있습니다<p> | |
| 1502 | + </div> | |
| 1503 | + <div class="phone_bottom"> | |
| 1504 | + <div class="send_rev"> | |
| 1505 | + <div class="send_content" style="padding-bottom: 0;"> | |
| 1506 | + <div class="rev_radio"> | |
| 1507 | + <ul> | |
| 1508 | + <li> | |
| 1509 | + <input type="radio" id="reserYnN" name="reserYn" value="N" checked="checked"><label for="reserYnN">즉시</label> | |
| 1510 | + </li> | |
| 1511 | + <li> | |
| 1512 | + <input type="radio" id="reserYnY" name="reserYn" value="Y"><label for="reserYnY">예약</label> | |
| 1513 | + </li> | |
| 1514 | + </ul> | |
| 1515 | + </div> | |
| 1516 | + <div class="send_btn"> | |
| 1517 | + <button type="button" class="btnType btnType11" onclick="javascript:sendTemplateInfo(); return false;">발송하기</button> | |
| 1518 | + <button type="button" class="btnType btnType10" onclick="javascript:goToKakaoTestPopUp(); return false;">테스트발송</button> | |
| 1519 | + </div> | |
| 1520 | + </div> | |
| 1521 | + <div class="rev_selected"> | |
| 1522 | + <div class="rev_top"> | |
| 1523 | + <span>날짜 :</span> | |
| 1524 | + <div class="calendar_wrap"> | |
| 1525 | + <input type="text" class="startDate2 inp resDate calendar picker__input picker__input--active" title="검색 시작일" id="startDate2" name="startDate2" value="" data-datecontrol="true" readonly="" aria-haspopup="true" aria-expanded="true" aria-readonly="false" aria-owns="startDate2_root"> | |
| 1526 | + </div> | |
| 1527 | + <label for="msgResHour" class="label">시 선택</label> | |
| 1528 | + <div class="selBox"> | |
| 1529 | + <select class="selType1" id="msgResHour" name="msgResHour"> | |
| 1530 | + <c:forEach var="hour" begin="0" end="23" step="1" varStatus="status"> | |
| 1531 | + <c:choose> | |
| 1532 | + <c:when test="${hour < 10}"> | |
| 1533 | + <option value="0${hour}">0${hour}시</option> | |
| 1534 | + </c:when> | |
| 1535 | + <c:otherwise> | |
| 1536 | + <option value="${hour}">${hour}시</option> | |
| 1537 | + </c:otherwise> | |
| 1538 | + </c:choose> | |
| 1539 | + </c:forEach> | |
| 1540 | + </select> | |
| 1541 | + <label for="msgResMin" class="label">분 선택</label> | |
| 1542 | + <select class="selType1" id="msgResMin" name="msgResMin"> | |
| 1543 | + <c:forEach var="min" begin="0" end="55" step="5"> | |
| 1544 | + <c:choose> | |
| 1545 | + <c:when test="${min < 10}"> | |
| 1546 | + <option value="0${min}">0${min}분</option> | |
| 1547 | + </c:when> | |
| 1548 | + <c:otherwise> | |
| 1549 | + <option value="${min}">${min}분</option> | |
| 1550 | + </c:otherwise> | |
| 1551 | + </c:choose> | |
| 1552 | + </c:forEach> | |
| 1553 | + </select> | |
| 1554 | + </div> | |
| 1555 | + </div> | |
| 1556 | + <div class="rev_bottom"> | |
| 1557 | + <input type="checkbox" id="inputDivideChk" name="inputDivideChk"> | |
| 1558 | + <label for="inputDivideChk">분할전송</label> | |
| 1559 | + <input type="text" class="dividType1" id="frmDivideCnt" name="frmDivideCnt" value="20" onkeypress='return checkNumber(event)' maxlength="4"/> | |
| 1560 | + <label for="frmDivideCnt">건씩</label> | |
| 1561 | + <select class="selType1" id="divideTime" name="divideTime"> | |
| 1562 | + <option value="5">05분</option> | |
| 1563 | + <option value="10">10분</option> | |
| 1564 | + <option value="15">15분</option> | |
| 1565 | + <option value="20">20분</option> | |
| 1566 | + <option value="30">30분</option> | |
| 1567 | + </select> | |
| 1568 | + <label for="divideTime">간격</label> | |
| 1569 | + </div> | |
| 1570 | + </div> | |
| 1571 | + </div> | |
| 1572 | + </div> | |
| 1573 | + </div> | |
| 1574 | + </div> | |
| 1575 | + </div> | |
| 1576 | + </div> | |
| 1577 | + </div> | |
| 1578 | + <!--// send top --> | |
| 1579 | + | |
| 1580 | +<!-- 주소록 불러오기 --> | |
| 1581 | +<div class="tooltip-wrap"> | |
| 1582 | + <div class="popup-com import_layer popup06" tabindex="0" data-tooltip-con="popup06" data-focus="popup06" data-focus-prev="popup06-close" style="width: 1000px"> | |
| 1583 | + <div class="popup_heading"> | |
| 1584 | + <p><span>주소록 불러오기</p> | |
| 1585 | + <button type="button" onClick="javascript:addrClose(); return false;"> | |
| 1586 | + <img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> | |
| 1587 | + </div> | |
| 1588 | + <div class="layer_in"> | |
| 1589 | + <div class="titBox titBox_pad"> | |
| 1590 | + <p>- 주소록 수정 및 변경은 <span>[주소록 관리]</span>에서만 가능합니다.</p> | |
| 1591 | + <button type="button" class="adr_admin" onClick="location.href='/web/mjon/addr/selectAddrList.do'">주소록 관리</button> | |
| 1592 | + </div> | |
| 1593 | + <div class="adr_wrap"> | |
| 1594 | + <form id="searchAddrGrpForm" name="searchAddrGrpForm" method="post" style="display: flex; justify-content: space-between;"> | |
| 1595 | + <input type="hidden" id="searchAddrGrpId" name="searchAddrGrpId" value=""/> | |
| 1596 | + <input type="hidden" id="type" name="type" value="all"/> | |
| 1597 | + <input type="hidden" id="searchKeyword" name="searchKeyword" value=""/> | |
| 1598 | + <input type="hidden" name="searchCondition" id="searchCondition" value="0" /> | |
| 1599 | + <div class="adr_pop_left"> | |
| 1600 | + <div class="adr_left_search"> | |
| 1601 | + <label for="searchGrpKeyword" class="label">그룹명 검색</label> | |
| 1602 | + <input type="text" name="searchGrpKeyword" id="searchGrpKeyword" placeholder="그룹명 검색" onfocus="this.placeholder=''" onblur="this.placeholder='그룹명 검색'" class="inputLight"> | |
| 1603 | + <button type="button" onClick="javascrit:fnAddrGrpSearch(); return false;"><img src="/publish/images/popup/search.png" alt="검색"></button> | |
| 1604 | + </div> | |
| 1605 | + <div class="adr_pop_box"> | |
| 1606 | + <div id="addrGroupLoad"> | |
| 1607 | + </div> | |
| 1608 | + </div> | |
| 1609 | + <!-- <div class="popup_btn"> | |
| 1610 | + <button type="button" class="btnType" onClick="javascript:fnSelectAddrGrpList(); return false;">선택 그룹 추가</button> | |
| 1611 | + </div> --> | |
| 1612 | + </div> | |
| 1613 | + <div class="adr_pop_right"> | |
| 1614 | + <div class="clearfix"> | |
| 1615 | + <div class="btnWrap_last"> | |
| 1616 | + <label for="searchAddrCondition" class="label">카테고리 선택</label> | |
| 1617 | + <select id="searchAddrCondition" name="searchAddrCondition" class="selType2"> | |
| 1618 | + <option value='0'>전체</option> | |
| 1619 | + <option value='1'>그룹명</option> | |
| 1620 | + <option value='2'>이름</option> | |
| 1621 | + <option value='3'>핸드폰번호</option> | |
| 1622 | + </select> | |
| 1623 | + <label for="searchAddrKeyword" class="label">검색어 입력</label> | |
| 1624 | + <input type="text" id="searchAddrKeyword" name="searchAddrKeyword" placeholder="검색어를 입력하세요" onfocus="this.placeholder=''" onblur="this.placeholder='검색어를 입력하세요'" > | |
| 1625 | + <button type="button" class="btnType btnType17" onClick="javascrit:fnAddrSearch(); return false;">검색</button> | |
| 1626 | + </div> | |
| 1627 | + <!-- table --> | |
| 1628 | + <div class="adr_excel adr_pop_list2 callAddr_box"> | |
| 1629 | + </div> | |
| 1630 | + <!--// table --> | |
| 1631 | + </div> | |
| 1632 | + <div class="popup_btn_wrap2"> | |
| 1633 | + <button type="button" onClick="javascript:addrToList(); return false;">추가</button> | |
| 1634 | + <button type="button" onClick="javascript:addrClose(); return false;">닫기</button> | |
| 1635 | + </div> | |
| 1636 | + <%-- 주소록 레이어 팝업 닫기 실행 코드 --%> | |
| 1637 | + <input type="hidden" name="btnAddrClose" id="btnAddrClose" class="tooltip-close closeAddr" data-focus="popup06-close" /> | |
| 1638 | + </div> | |
| 1639 | + </form> | |
| 1640 | + </div> | |
| 1641 | + </div> | |
| 1642 | + </div> | |
| 1643 | +</div> | |
| 1644 | +<!--// 주소록 불러오기 --> | |
| 1645 | + | |
| 1646 | +<!-- 최근 전송 내역 --> | |
| 1647 | +<div class="tooltip-wrap"> | |
| 1648 | + <div class="popup-com history_layer popup03" tabindex="0" data-tooltip-con="popup03" data-focus="popup03" data-focus-prev="popup03-close"> | |
| 1649 | + <div class="popup_heading"> | |
| 1650 | + <p><span>전송내역</p> | |
| 1651 | + <button type="button" class="tooltip-close" data-focus="popup03-close" id="btnLatestAddPhoneClose"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> | |
| 1652 | + </div> | |
| 1653 | + <div class="layer_in"> | |
| 1654 | + <!-- tab button --> | |
| 1655 | + <ul class="tabType6"> | |
| 1656 | + <li class="tab active"><button type="button" onclick="TabType(this,'1');">최근 전송내역</button></li> | |
| 1657 | + <li class="tab"><button type="button" onclick="TabType(this,'2');">자주보내는 번호</button></li> | |
| 1658 | + </ul><!--// tab button --> | |
| 1659 | + <!-- 최근 전송내역 --> | |
| 1660 | + <div class="history_cont hascont current"> | |
| 1661 | + <div class="histroy_trans latestMsgArea" id="latestMsgArea"> | |
| 1662 | + <ul id="latestMsgUl"> | |
| 1663 | + <c:choose> | |
| 1664 | + <c:when test="${not empty resultLatestMsgList}"> | |
| 1665 | + <c:forEach var="latestMsgList" items="${resultLatestMsgList}" varStatus="status"> | |
| 1666 | + <li id="latestLi"> | |
| 1667 | + <input type="checkbox" id="addrChk_${status.count}" name="latAddrChk" value="<c:out value='${latestMsgList.callTo}'/>"> | |
| 1668 | + <label for="addrChk_${status.count}" class="label">최근 전송내역</label> | |
| 1669 | + <p><c:out value="${latestMsgList.callTo}"/></p> | |
| 1670 | + <button type="button" id="latestAddrDel"><img src="/publish/images/popup/close3.png" alt="전화번호 삭제"></button> | |
| 1671 | + </li> | |
| 1672 | + </c:forEach> | |
| 1673 | + </c:when> | |
| 1674 | + <c:otherwise> | |
| 1675 | + <li> | |
| 1676 | + <p>최근 발송 내역이 없습니다.</p> | |
| 1677 | + </li> | |
| 1678 | + </c:otherwise> | |
| 1679 | + </c:choose> | |
| 1680 | + </ul> | |
| 1681 | + </div> | |
| 1682 | + <div class="popup_btn_wrap2 hisroy_btn"> | |
| 1683 | + <button type="button" id="latestAddPhone">선택추가</button> | |
| 1684 | + <button type="button" id="latestCancelPhone">선택취소</button> | |
| 1685 | + </div> | |
| 1686 | + </div><!--// 최근 전송내역 --> | |
| 1687 | + <!-- 자주보내는 번호 --> | |
| 1688 | + <div class="history_cont hascont"> | |
| 1689 | + <div class="histroy_trans" id="bookMarkMsgArea"> | |
| 1690 | + <ul id="bookMsgUl"> | |
| 1691 | + <c:choose> | |
| 1692 | + <c:when test="${not empty resultBookMarkMsgList}"> | |
| 1693 | + <c:forEach var="bookMarkMsgList" items="${resultBookMarkMsgList}" varStatus="status"> | |
| 1694 | + <li id="bookMarkLi"> | |
| 1695 | + <input type="checkbox" id="bokAddrChk_${status.count}" name="bookAddrChk" value="<c:out value='${bookMarkMsgList.addrPhoneNo}'/>"> | |
| 1696 | + <label for="addrChk_${status.count}" class="label">최근 전송내역</label> | |
| 1697 | + <p><c:out value="${bookMarkMsgList.addrPhoneNo}"/></p> | |
| 1698 | + <button type="button" id="bookMarkAddrDel"><img src="/publish/images/popup/close3.png" alt="전화번호 삭제"></button> | |
| 1699 | + </li> | |
| 1700 | + </c:forEach> | |
| 1701 | + </c:when> | |
| 1702 | + <c:otherwise> | |
| 1703 | + <li> | |
| 1704 | + <p>등록된 자주 보내는 번호 내역이 없습니다.</p> | |
| 1705 | + </li> | |
| 1706 | + </c:otherwise> | |
| 1707 | + </c:choose> | |
| 1708 | + </ul> | |
| 1709 | + </div> | |
| 1710 | + <div class="popup_btn_wrap2 hisroy_btn"> | |
| 1711 | + <button type="button" id="bookMarkAddPhone">선택추가</button> | |
| 1712 | + <button type="button" id="bookMarkCancelPhone">선택취소</button> | |
| 1713 | + </div> | |
| 1714 | + </div><!--// 자주보내는 번호 --> | |
| 1715 | + </div> | |
| 1716 | + </div> | |
| 1717 | +</div> | |
| 1718 | +<!--// 전송내역 팝업 --> | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | +<!-- 엑셀 불러오기 --> | |
| 1723 | +<form id="excelToolTipForm" name="excelToolTipForm" method="post"> | |
| 1724 | + <div class="tooltip-wrap"> | |
| 1725 | + <div class="popup-com import_layer popup02" tabindex="0" data-tooltip-con="popup02" data-focus="popup02" data-focus-prev="popup02-close"> | |
| 1726 | + <div class="popup_heading"> | |
| 1727 | + <p><span>엑셀</span> 불러오기</p> | |
| 1728 | + <button type="button" class="tooltip-close" data-focus="popup02-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> | |
| 1729 | + </div> | |
| 1730 | + <div class="layer_in"> | |
| 1731 | + <!-- 엑셀파일 불러오기 --> | |
| 1732 | + <div class="hascont"> | |
| 1733 | + <div class="titBox"> | |
| 1734 | + <p>- 최대 2만 건까지 등록할 수 있습니다.</p> | |
| 1735 | + <p>- [엑셀 불러오기]시 문서의 A, B열을 불러옵니다.(지원하는 파일 형식 : xls, xlsx)</p> | |
| 1736 | + <p>- 휴대폰 항목은 숫자, 하이픈(-)만 인식하며, 번호 앞에 0이 생략되어도 정상 등록됩니다. | |
| 1737 | + </p> | |
| 1738 | + <!-- <button type="button" class="excel_btn" onclick="location.href='/cmm/fms/FileDown.do?atchFileId=FILE_000000000011651&fileSn=1'"><i></i>샘플파일 다운로드</button> --> | |
| 1739 | + <button type="button" class="excel_btn" onclick="location.href='/download/msg/알림톡_엑셀주소록_등록양식.xlsx'"><i class="downroad"></i>샘플파일 다운로드</button> | |
| 1740 | + </div> | |
| 1741 | + <div class="attachedFile"> | |
| 1742 | + <label for="excelNm01" class="attachedFile_label">첨부파일</label> | |
| 1743 | + <input type="text" id="excelNm01" value="" readonly> | |
| 1744 | + <input type="file" id="excelFile01" accept=".xls, .xlsx" onchange="excelExportAjax(event); return false;" style="display:none"/> | |
| 1745 | + <!-- <input type="file" id="excelFile01" accept=".xls, .xlsx" onchange="excelExport01(event); return false;" style="display:none"/> --> | |
| 1746 | + <button type="button" class="btnType btnType6 c1">찾아보기</button> | |
| 1747 | +<!-- <p><span class="vMiddle">*</span> 첨부된 파일은 <span class="c_e40000">[추가]버튼을 클릭</span>하셔야 받는 사람에 등록됩니다.</p> --> | |
| 1748 | + <p><span class="vMiddle">*</span> 첨부된 파일은 <span class="c_e40000">[추가]버튼을 클릭</span>하셔야 받는 사람에 등록됩니다.</p> | |
| 1749 | + </div> | |
| 1750 | + </div><!--// 엑셀파일 불러오기 --> | |
| 1751 | + <div class="popup_btn_wrap2"> | |
| 1752 | + <button type="button" class="tooltip-close" data-focus="popup02-close" data-focus-next="popup02" onclick="excelAddAjax()">추가</button> | |
| 1753 | + <!-- <button type="button" class="tooltip-close" data-focus="popup02-close" data-focus-next="popup02" onclick="excelAdd()">추가</button> --> | |
| 1754 | + <button type="button" class="tooltip-close" data-focus="popup02-close" data-focus-next="popup02">닫기</button> | |
| 1755 | + </div> | |
| 1756 | + </div> | |
| 1757 | + </div> | |
| 1758 | + </div><!--// 엑셀 불러오기 --> | |
| 1759 | +</form> | |
| 1760 | +<form id="excelVarFileForm" name="excelVarFileForm" method="post"> | |
| 1761 | + <input type="hidden" id="excelVarCnt" name="excelVarCnt" value="0"/> | |
| 1762 | + <input type="hidden" id="excelVarList" name="excelVarList" value=""/> | |
| 1763 | + | |
| 1764 | +</form> | |
| 1765 | + | |
| 1766 | +<form id="msgResendForm" name="msgResendForm" method="post"> | |
| 1767 | + <input name="msgResendFlag" type="hidden" value="N"/> | |
| 1768 | + <input name="msgSeqList" type="hidden" value=""/> | |
| 1769 | +</form> | |
| 1770 | +<form id="moveAddrForm" name="moveAddrForm" method="post"> | |
| 1771 | + <input name="moveAddrFlag" type="hidden" value="N"/> | |
| 1772 | + <input name="addrIdList" type="hidden" value=""/> | |
| 1773 | +</form> |
--- src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataSMLView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataSMLView.jsp
... | ... | @@ -18,8 +18,6 @@ |
| 18 | 18 |
|
| 19 | 19 |
$(document).ready(function(){
|
| 20 | 20 |
|
| 21 |
- |
|
| 22 |
- console.log(": MsgDataSMLView :");
|
|
| 23 | 21 |
|
| 24 | 22 |
// console.log(' + $(#tabDision).val() : ',$('#tabDision').val())
|
| 25 | 23 |
// if($('#tabDision').val() == 'tab02'){
|
--- src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataView.jsp
... | ... | @@ -71,8 +71,6 @@ |
| 71 | 71 |
</div> |
| 72 | 72 |
</div> |
| 73 | 73 |
<div class="btn_wrap"> |
| 74 |
- <!-- <button type="button" class="btnType btnType2" style="margin:50px 0;" onclick="progressStart(10,'완료되었습니다.');">시작</button> |
|
| 75 |
- <button type="button" class="btnType btnType2" style="margin:50px 0;" onclick="progressComplete('완료되었습니다.');return false;">멈춤</button> -->
|
|
| 76 | 74 |
</div> |
| 77 | 75 |
|
| 78 | 76 |
</div> |
--- src/main/webapp/js/MJUtill.js
+++ src/main/webapp/js/MJUtill.js
... | ... | @@ -200,6 +200,8 @@ |
| 200 | 200 |
|
| 201 | 201 |
//숫자 천단위 콤마 찍어주기 |
| 202 | 202 |
function numberWithCommas(x) {
|
| 203 |
+ console.log(' + typeof x : ',typeof x);
|
|
| 204 |
+ console.log(' + x : ',x);
|
|
| 203 | 205 |
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
| 204 | 206 |
} |
| 205 | 207 |
|
... | ... | @@ -1030,6 +1032,17 @@ |
| 1030 | 1032 |
} |
| 1031 | 1033 |
|
| 1032 | 1034 |
|
| 1035 |
+function setAllCntData(result){
|
|
| 1036 |
+ |
|
| 1037 |
+ console.log('result :: ', result);
|
|
| 1038 |
+ // 합쳐진 데이터를 tableL에 설정합니다. |
|
| 1039 |
+ tableL.setData(result.uniqueArray); |
|
| 1040 |
+ // 중복데이터 건수 입력 |
|
| 1041 |
+ setRowDupCnt(result.duplicateCount); |
|
| 1042 |
+ |
|
| 1043 |
+ $('#rowTotCnt').text(result.uniqueCount)
|
|
| 1044 |
+} |
|
| 1045 |
+ |
|
| 1033 | 1046 |
function validateRowLimit(totalRows, limit = 300000) {
|
| 1034 | 1047 |
// 값과 타입 확인 |
| 1035 | 1048 |
|
--- src/main/webapp/js/kakao/at/addr.js
+++ src/main/webapp/js/kakao/at/addr.js
... | ... | @@ -101,6 +101,7 @@ |
| 101 | 101 |
} |
| 102 | 102 |
|
| 103 | 103 |
//주소록 불러오기에서 수신자 리스트 추가해 주기 |
| 104 |
+/* |
|
| 104 | 105 |
function addrToList(){
|
| 105 | 106 |
|
| 106 | 107 |
var selectedData = tableAddr.getSelectedRows(); |
... | ... | @@ -114,10 +115,10 @@ |
| 114 | 115 |
}else{ // 선택한 Row 데이터 저장해주기
|
| 115 | 116 |
|
| 116 | 117 |
// 선택한 Row 데이터 저장해주기 |
| 117 |
- if(selectedData.length > 500){
|
|
| 118 |
- alert("최대 발송 건수는 500 입니다.");
|
|
| 119 |
- return false; |
|
| 120 |
- }else{
|
|
| 118 |
+// if(selectedData.length > 500){
|
|
| 119 |
+// alert("최대 발송 건수는 500 입니다.");
|
|
| 120 |
+// return false; |
|
| 121 |
+// }else{
|
|
| 121 | 122 |
for(var i=0; i < selectedData.length; i++){
|
| 122 | 123 |
|
| 123 | 124 |
//좌측 받는사람 리스트를 담아둔 배열에 데이터를 추가해 준다. |
... | ... | @@ -137,9 +138,67 @@ |
| 137 | 138 |
|
| 138 | 139 |
//주소록 레이어 팝업의 Tabulator 데이터 지워주기 |
| 139 | 140 |
tableAddr.clearData(); |
| 140 |
- } |
|
| 141 |
+// } |
|
| 141 | 142 |
} |
| 142 | 143 |
|
| 144 |
+} |
|
| 145 |
+*/ |
|
| 146 |
+ |
|
| 147 |
+//주소록 불러오기에서 수신자 리스트 추가해 주기 |
|
| 148 |
+function addrToList_advc(type){
|
|
| 149 |
+ |
|
| 150 |
+ |
|
| 151 |
+ // 선택된 데이터 또는 전체 데이터 변수 초기화 |
|
| 152 |
+ let selectedData = type === 'select' ? tableAddr.getSelectedRows() : tableAddr.getData(); |
|
| 153 |
+ |
|
| 154 |
+ // 데이터가 비어있으면 경고 후 종료 |
|
| 155 |
+ if (!selectedData || selectedData.length < 1) {
|
|
| 156 |
+ |
|
| 157 |
+ if(tableAddr.getDataCount() < 1){
|
|
| 158 |
+ alert("주소록을 선택해 주세요.");
|
|
| 159 |
+ }else{
|
|
| 160 |
+ alert("전화번호를 선택해 주세요.");
|
|
| 161 |
+ } |
|
| 162 |
+ |
|
| 163 |
+ return false; |
|
| 164 |
+ } |
|
| 165 |
+ |
|
| 166 |
+ |
|
| 167 |
+ // 데이터 변환 로직 |
|
| 168 |
+ const addrData = selectedData.map(row => {
|
|
| 169 |
+ const rowData = type === 'select' ? row.getData() : row; // 'select'는 행 객체에서 데이터 추출 |
|
| 170 |
+ return {
|
|
| 171 |
+ phone: removeDash(rowData.phone), |
|
| 172 |
+ }; |
|
| 173 |
+ }) |
|
| 174 |
+ .filter(row => checkHpNum(row.phone)); // 유효한 번호만 필터링; |
|
| 175 |
+ |
|
| 176 |
+ |
|
| 177 |
+ // 기존 tableL의 데이터를 가져옵니다. |
|
| 178 |
+ var existingData = tableL.getData(); |
|
| 179 |
+ // 기존 데이터와 새로운 데이터를 합칩니다. |
|
| 180 |
+ var combinedData = existingData.concat(addrData); |
|
| 181 |
+ |
|
| 182 |
+ // @ phone을 기준으로 중복 제거 및 갯수 계산 |
|
| 183 |
+ const result = removeDuplicatesAndCount(combinedData, 'phone'); |
|
| 184 |
+ |
|
| 185 |
+ |
|
| 186 |
+ |
|
| 187 |
+ // 총 30만건이 넘으면 false |
|
| 188 |
+ if (!validateRowLimit(result.uniqueCount)) {
|
|
| 189 |
+ return false; |
|
| 190 |
+ } |
|
| 191 |
+ |
|
| 192 |
+ setAllCntData(result); |
|
| 193 |
+ |
|
| 194 |
+ |
|
| 195 |
+ // 미리보기 버튼 활성화 |
|
| 196 |
+ |
|
| 197 |
+ |
|
| 198 |
+ $(".closeAddr").trigger("click");
|
|
| 199 |
+ //주소록 레이어 팝업의 Tabulator 데이터 지워주기 |
|
| 200 |
+ tableAddr.clearData(); |
|
| 201 |
+ fn_priceClclt(); |
|
| 143 | 202 |
} |
| 144 | 203 |
|
| 145 | 204 |
function loadAddrList(){
|
... | ... | @@ -150,7 +209,8 @@ |
| 150 | 209 |
*/ |
| 151 | 210 |
var data = $("#searchAddrGrpForm").serialize();
|
| 152 | 211 |
|
| 153 |
- var url = "/web/mjon/msgdata/selectMsgAddrListAjax.do"; |
|
| 212 |
+ // var url = "/web/mjon/msgdata/selectMsgAddrListAjax.do"; |
|
| 213 |
+ var url = "/web/mjon/msgdata/selectMsgAddrListAjax_advc.do"; |
|
| 154 | 214 |
|
| 155 | 215 |
$.ajax({
|
| 156 | 216 |
type: "POST", |
... | ... | @@ -159,43 +219,36 @@ |
| 159 | 219 |
dataType:'json', |
| 160 | 220 |
async: false, |
| 161 | 221 |
cache: false, |
| 162 |
- success: function (returnData, status) {
|
|
| 163 |
- console.log('returnData : ', returnData);
|
|
| 164 |
- if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
|
|
| 165 |
- if(returnData.result == "success"){
|
|
| 166 |
- |
|
| 167 |
- var addrList = returnData.resultAddrList; |
|
| 168 |
- var tableData = []; |
|
| 169 |
- |
|
| 170 |
- if(addrList.length == 0){
|
|
| 171 |
- |
|
| 172 |
- alert("주소록 정보가 없습니다.");
|
|
| 173 |
- tableAddr.setData(tableData); |
|
| 174 |
- return false; |
|
| 175 |
- } |
|
| 176 |
- |
|
| 177 |
- //받는사람 리스트를 담아둔 배열에 신규 추가 데이터를 추가해 준다. |
|
| 178 |
- for(var i=0; i < addrList.length; i++){
|
|
| 179 |
- |
|
| 180 |
- tableData.push({addrGroupNm: addrList[i].addrGrpNm, addrPhone: removeDash(addrList[i].addrPhoneNo) , addrName: addrList[i].addrNm, addrRep1: addrList[i].addrInfo1, addrRep2: addrList[i].addrInfo2, addrRep3: addrList[i].addrInfo3, addrRep4: addrList[i].addrInfo4});
|
|
| 181 |
- |
|
| 182 |
- } |
|
| 183 |
- |
|
| 184 |
- //우측 주소록 리스트 Tabulator에 입력해주기 |
|
| 185 |
- tableAddr.setData(tableData); |
|
| 186 |
- |
|
| 187 |
- }else{
|
|
| 188 |
- |
|
| 189 |
- alert(returnData.message); |
|
| 190 |
- return false; |
|
| 191 |
- |
|
| 192 |
- } |
|
| 193 |
- |
|
| 194 |
- } else if(status== 'fail'){
|
|
| 195 |
- alert("주소록 불러오기에 실패하였습니다. !!");
|
|
| 196 |
- } |
|
| 197 |
- }, |
|
| 198 |
- error: function (e) { alert("주소록 불러오기에 실패하였습니다."); console.log("ERROR : ", e); }
|
|
| 222 |
+ success: function (data) {
|
|
| 223 |
+ console.log('data : ', data);
|
|
| 224 |
+ if(data.status == "OK"){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
|
|
| 225 |
+ |
|
| 226 |
+ var addrList = data.object; |
|
| 227 |
+ |
|
| 228 |
+ if(addrList.length == 0){
|
|
| 229 |
+ |
|
| 230 |
+ alert("주소록 정보가 없습니다.");
|
|
| 231 |
+// tableAddr.setData([]); |
|
| 232 |
+ return false; |
|
| 233 |
+ } |
|
| 234 |
+ tableAddr.setData(addrList); |
|
| 235 |
+ } |
|
| 236 |
+ else |
|
| 237 |
+ {
|
|
| 238 |
+ alert("주소록 불러오기에 실패하였습니다. !!");
|
|
| 239 |
+ } |
|
| 240 |
+ }, |
|
| 241 |
+ error: function (e) {
|
|
| 242 |
+ alert("주소록 불러오기에 실패하였습니다."); console.log("ERROR : ", e);
|
|
| 243 |
+ } |
|
| 244 |
+ , beforeSend : function(xmlHttpRequest) {
|
|
| 245 |
+ //로딩창 show |
|
| 246 |
+ $('.loading_layer').addClass('active');
|
|
| 247 |
+ } |
|
| 248 |
+ , complete : function(xhr, textStatus) {
|
|
| 249 |
+ //로딩창 hide |
|
| 250 |
+ $('.loading_layer').removeClass('active');
|
|
| 251 |
+ } |
|
| 199 | 252 |
}); |
| 200 | 253 |
|
| 201 | 254 |
} |
--- src/main/webapp/js/kakao/at/alimtalkExcel.js
+++ src/main/webapp/js/kakao/at/alimtalkExcel.js
... | ... | @@ -198,6 +198,7 @@ |
| 198 | 198 |
* |
| 199 | 199 |
* */ |
| 200 | 200 |
function excelExportVarAjax(){
|
| 201 |
+ console.log(' :: excelExportVarAjax ::')
|
|
| 201 | 202 |
|
| 202 | 203 |
var data = document.getElementById('excelFile').files;
|
| 203 | 204 |
|
... | ... | @@ -245,7 +246,7 @@ |
| 245 | 246 |
//timeout: 600000, |
| 246 | 247 |
success: function (returnData, status) {
|
| 247 | 248 |
if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
|
| 248 |
- |
|
| 249 |
+ console.log('returnData : ', returnData);
|
|
| 249 | 250 |
if(returnData.success){
|
| 250 | 251 |
|
| 251 | 252 |
var data = returnData.data; |
... | ... | @@ -290,10 +291,10 @@ |
| 290 | 291 |
|
| 291 | 292 |
var totalDuplCnt = $('#rowDupCnt').text();//중복 건수 정보
|
| 292 | 293 |
var $excelBody = $('#excelBody02');
|
| 293 |
- var bodyData; |
|
| 294 | 294 |
var addDiv = ""; |
| 295 | 295 |
var phoneNum; |
| 296 | 296 |
|
| 297 |
+ var msgCnt = 0; |
|
| 297 | 298 |
//입력데이터를 역정렬해준다. |
| 298 | 299 |
data.reverse(); |
| 299 | 300 |
|
... | ... | @@ -337,6 +338,7 @@ |
| 337 | 338 |
|
| 338 | 339 |
if(lengthCheck){
|
| 339 | 340 |
addDiv += excelBody; |
| 341 |
+ msgCnt++; |
|
| 340 | 342 |
} |
| 341 | 343 |
|
| 342 | 344 |
} |
... | ... | @@ -359,6 +361,9 @@ |
| 359 | 361 |
|
| 360 | 362 |
//화면에 수신번호 및 변수 데이터 추가해 주기 |
| 361 | 363 |
$excelBody.append(addDiv); |
| 364 |
+ |
|
| 365 |
+ // 총 금액 계산 |
|
| 366 |
+ fn_priceClclt(msgCnt); |
|
| 362 | 367 |
|
| 363 | 368 |
} |
| 364 | 369 |
|
--- src/main/webapp/js/kakao/at/init.js
+++ src/main/webapp/js/kakao/at/init.js
... | ... | @@ -12,6 +12,8 @@ |
| 12 | 12 |
* |
| 13 | 13 |
* |
| 14 | 14 |
*/ |
| 15 |
+ |
|
| 16 |
+ |
|
| 15 | 17 |
$(document).ready(function(){
|
| 16 | 18 |
|
| 17 | 19 |
|
--- src/main/webapp/js/kakao/at/priceClclt.js
+++ src/main/webapp/js/kakao/at/priceClclt.js
... | ... | @@ -70,8 +70,6 @@ |
| 70 | 70 |
fn_priceClclt(); |
| 71 | 71 |
}); |
| 72 | 72 |
|
| 73 |
- |
|
| 74 |
- |
|
| 75 | 73 |
|
| 76 | 74 |
// 대상 노드에 감시자 전달 |
| 77 | 75 |
observer_wrap01.observe(target01, option); |
... | ... | @@ -85,18 +83,24 @@ |
| 85 | 83 |
/** |
| 86 | 84 |
* @description 금액 계산 function |
| 87 | 85 |
*/ |
| 88 |
-function fn_priceClclt(){
|
|
| 86 |
+function fn_priceClclt(phoneSu = 0){
|
|
| 89 | 87 |
|
| 90 |
- // 미리보기 텍스트 |
|
| 91 |
- var templateHtml = $('#smsTxtArea').val();
|
|
| 92 |
- // var templateHtml = $('.template_text').html();
|
|
| 93 |
- |
|
| 94 |
- // 수신 번호 개수 |
|
| 95 |
- var phoneSu = $('.phoneArea').length;
|
|
| 88 |
+ console.log(":: at fn_priceClclt :: ");
|
|
| 89 |
+ // 미리보기 텍스트 |
|
| 90 |
+ var templateHtml = $('#smsTxtArea').val();
|
|
| 91 |
+ // var templateHtml = $('.template_text').html();
|
|
| 92 |
+ |
|
| 93 |
+ // 치환문자 여부 확인 |
|
| 94 |
+ var txtReplYn = $('#txtReplYn').val()
|
|
| 95 |
+ console.log('txtReplYn : ', txtReplYn);
|
|
| 96 |
+ |
|
| 97 |
+ // 수신 번호 개수 |
|
| 98 |
+ if(phoneSu == 0 && txtReplYn == 'Y') |
|
| 99 |
+ phoneSu = $('.phoneArea').length;
|
|
| 100 |
+ if(phoneSu == 0 && txtReplYn == 'N') |
|
| 101 |
+ phoneSu = tableL.getData().length; |
|
| 96 | 102 |
// 대체문자 있는지 확인 |
| 97 | 103 |
var isSendFailChecked = $("#send_fail_check").is(":checked");
|
| 98 |
- // 치환문자 여부 확인 |
|
| 99 |
- var txtReplYn = $('#txtReplYn').val()
|
|
| 100 | 104 |
// 대체문자 하위에 장문 / 단문 select |
| 101 | 105 |
var msgTypeText = $('.msg_com').text().trim();
|
| 102 | 106 |
|
... | ... | @@ -212,8 +216,8 @@ |
| 212 | 216 |
if(msgTypeText == '단문') price = SHORT_PRICE * phoneSu; |
| 213 | 217 |
else if(msgTypeText == '장문') price = LONG_PRICE * phoneSu; |
| 214 | 218 |
else price = KAKAO_AT_PRICE * phoneSu; // 카카오 |
| 215 |
- |
|
| 216 |
- $('#totalPriceTxt').text((price).toFixed(1));
|
|
| 219 |
+ |
|
| 220 |
+ $('#totalPriceTxt').text(numberWithCommas((price).toFixed(1)));
|
|
| 217 | 221 |
} |
| 218 | 222 |
|
| 219 | 223 |
|
--- src/main/webapp/js/kakao/at/tabulator.js
+++ src/main/webapp/js/kakao/at/tabulator.js
... | ... | @@ -12,83 +12,41 @@ |
| 12 | 12 |
* |
| 13 | 13 |
* |
| 14 | 14 |
*/ |
| 15 |
- |
|
| 15 |
+var tableL = null; |
|
| 16 | 16 |
$(document).ready(function (){
|
| 17 |
- /** |
|
| 18 | 17 |
//받는사람 연락처 내용 처리 |
| 19 | 18 |
//Tabulator AJAX Data Loading |
| 20 |
- tableL = new Tabulator(".callList_box", {
|
|
| 19 |
+ tableL = new Tabulator(".callList_box_P", {
|
|
| 21 | 20 |
height:"255px", |
| 22 |
- layout:"fitColumns", |
|
| 23 |
- //data:tabledata, |
|
| 24 |
- //autoColumns:true, |
|
| 21 |
+ layout:"fitColumns", |
|
| 22 |
+ headerHozAlign:"center", |
|
| 23 |
+ validationMode:"highlight", |
|
| 25 | 24 |
headerHozAlign:"center", |
| 26 | 25 |
validationMode:"highlight", |
| 27 |
- //clipboard:false, |
|
| 28 |
- //clipboardCopySelector:"table", |
|
| 29 |
- //clipboardPasteAction:"insert", // insert, update, replace |
|
| 30 | 26 |
placeholder:"복사(Ctrl+C)한 내용을 여기에 붙여넣기(Ctrl+V) 해주세요.", //fit columns to width of table (optional) |
| 31 | 27 |
resizableColumns:false, |
| 28 |
+ columnDefaults:{ // 공통설정
|
|
| 29 |
+ hozAlign: "center", |
|
| 30 |
+ headerHozAlign: "center", |
|
| 31 |
+ editor: "input", |
|
| 32 |
+ editor: false |
|
| 33 |
+ }, |
|
| 32 | 34 |
columns:[ //Define Table Columns |
| 33 |
- {formatter:"rowSelection", titleFormatter:"rowSelection",clipboard:false, hozAlign:"center", headerSort:false, cellClick:function(e, cell){
|
|
| 35 |
+ {formatter:"rowSelection", titleFormatter:"rowSelection", width:60, clipboard:false, hozAlign:"center", headerSort:false, cellClick:function(e, cell){
|
|
| 34 | 36 |
cell.getRow().toggleSelect(); |
| 35 | 37 |
}}, |
| 36 |
- {title:"이름", hozAlign:"center", field:"name", editor:"input", validator:["maxLength:12"], cellEdited:function(cell){
|
|
| 37 |
- //cell - cell component |
|
| 38 |
- fnReplCell(); |
|
| 39 |
- }}, |
|
| 40 |
- {title:"휴대폰", hozAlign:"center", field:"phone", editor:"input", width:100, validator:["required","minLength:10", "maxLength:12"], cellEdited:function(cell){
|
|
| 38 |
+// {title:"이름", hozAlign:"center", field:"name", editor:"input", validator:["maxLength:12"], cellEdited:function(cell){
|
|
| 39 |
+// //cell - cell component |
|
| 40 |
+// fnReplCell(); |
|
| 41 |
+// }}, |
|
| 42 |
+ {title:"휴대폰", hozAlign:"center", field:"phone", editor:"input", validator:["required","minLength:10", "maxLength:12"], cellEdited:function(cell){
|
|
| 41 | 43 |
//cell - cell component |
| 42 | 44 |
fnDuplPhone(); |
| 43 | 45 |
}}, |
| 44 |
- {title:"[*1*]", hozAlign:"center", field:"rep1", editor:"input", minWidth:60, validator:["maxLength:40"], cellEdited:function(cell){
|
|
| 45 |
- //cell - cell component |
|
| 46 |
- fnReplCell(); |
|
| 47 |
- }}, |
|
| 48 |
- {title:"[*2*]", hozAlign:"center", field:"rep2", editor:"input", minWidth:60, validator:["maxLength:40"], cellEdited:function(cell){
|
|
| 49 |
- //cell - cell component |
|
| 50 |
- fnReplCell(); |
|
| 51 |
- }}, |
|
| 52 |
- {title:"[*3*]", hozAlign:"center", field:"rep3", editor:"input", minWidth:60, validator:["maxLength:40"], cellEdited:function(cell){
|
|
| 53 |
- //cell - cell component |
|
| 54 |
- fnReplCell(); |
|
| 55 |
- }}, |
|
| 56 |
- {title:"[*4*]", hozAlign:"center", field:"rep4", editor:"input", minWidth:60, validator:["maxLength:40"], cellEdited:function(cell){
|
|
| 57 |
- //cell - cell component |
|
| 58 |
- fnReplCell(); |
|
| 59 |
- }}, |
|
| 60 |
- |
|
| 61 |
- ], |
|
| 62 |
- validationFailed:function(cell, value, parameters){ // 유효성 체크 함수 - 아직 잘 모르겠음
|
|
| 63 |
- //take action on validation fail |
|
| 64 |
- var valid = cell.isValid(); |
|
| 65 |
- var fieldNm = cell.getField(); |
|
| 66 |
- var cellVal = cell.getValue(); |
|
| 67 |
- var returnVal = ""; |
|
| 68 |
- if(!valid){
|
|
| 69 |
- |
|
| 70 |
- if(fieldNm == "name"){
|
|
| 71 |
- alert("받는사람 이름은 최대 12글자까지만 입력 가능합니다.");
|
|
| 72 |
- cell.setValue(strMaxLengthSubstring(cellVal, 11)); //스크립트 함수가 0부터 시작이므로 원하는 글자수 -1을 해줘야한다. |
|
| 73 |
- cell.clearValidation(); |
|
| 74 |
- }else if(fieldNm == "phone"){
|
|
| 75 |
- alert("휴대폰번호는 하이픈(-)을 제외한 숫자만 정확히 입력해 주세요.");
|
|
| 76 |
- }else{
|
|
| 77 |
- alert("치환문자를 정확히 입력해 주세요. 40글자 이내로 입력 가능합니다.");
|
|
| 78 |
- cell.setValue(strMaxLengthSubstring(cellVal, 39)); |
|
| 79 |
- cell.clearValidation(); |
|
| 80 |
- } |
|
| 81 |
- |
|
| 82 |
- //해당 셀 데이터 삭제 |
|
| 83 |
- //cell.setValue("");
|
|
| 84 |
- |
|
| 85 |
- } |
|
| 86 |
- return value % parameters.phone; |
|
| 87 |
- }, |
|
| 46 |
+ ] |
|
| 88 | 47 |
|
| 89 | 48 |
}); |
| 90 | 49 |
|
| 91 |
- */ |
|
| 92 | 50 |
//주소록 불러오기 팝업 내용 |
| 93 | 51 |
//Tabulator AJAX Data Loading |
| 94 | 52 |
tableAddr = new Tabulator(".callAddr_box", {
|
... | ... | @@ -99,13 +57,13 @@ |
| 99 | 57 |
placeholder:"주소록 그룹을 선택해 주세요.", //fit columns to width of table (optional) |
| 100 | 58 |
resizableColumns:false, |
| 101 | 59 |
columns:[ //Define Table Columns |
| 102 |
- {formatter:"rowSelection", titleFormatter:"rowSelection",clipboard:false, hozAlign:"center", headerSort:false, cellClick:function(e, cell){
|
|
| 60 |
+ {formatter:"rowSelection", titleFormatter:"rowSelection",clipboard:false, hozAlign:"center", headerSort:false, width: 50, cellClick:function(e, cell){
|
|
| 103 | 61 |
cell.getRow().toggleSelect(); |
| 104 | 62 |
} |
| 105 | 63 |
}, |
| 106 |
- {title:"그룹명", hozAlign:"center", field:"addrGroupNm", editor:"input", width:120, validator:["required","minLength:2", "maxLength:40"]},
|
|
| 107 |
- {title:"이름", hozAlign:"center", field:"addrName", editor:"input", width:120, validator:["maxLength:12"]},
|
|
| 108 |
- {title:"휴대폰번호", hozAlign:"center", field:"addrPhone", editor:"input", width:120, validator:["required","minLength:10", "maxLength:11"]},
|
|
| 64 |
+ {title:"그룹명", hozAlign:"center", field:"addrGroupNm", widthGrow: 3, editor:"input", validator:["required","minLength:2", "maxLength:40"]},
|
|
| 65 |
+ {title:"이름", hozAlign:"center", field:"name", widthGrow: 2, editor:"input", validator:["maxLength:12"]},
|
|
| 66 |
+ {title:"휴대폰번호", hozAlign:"center", field:"phone", widthGrow: 3, editor:"input", validator:["required","minLength:10", "maxLength:11"]},
|
|
| 109 | 67 |
|
| 110 | 68 |
], |
| 111 | 69 |
validationFailed:function(cell, value, parameters){ // 유효성 체크 함수 - 아직 잘 모르겠음
|
... | ... | @@ -132,53 +90,32 @@ |
| 132 | 90 |
//받는사람 번호 버튼 클릭시 Tabulator에 데이터 넣어주기 |
| 133 | 91 |
$('.addCallToF').click(function(){
|
| 134 | 92 |
|
| 135 |
- var callToNum = $('#callTo').val();
|
|
| 136 |
- if(callToNum == null || callToNum == ""){
|
|
| 137 |
- |
|
| 138 |
- alert("받는사람 번호를 입력해 주세요.");
|
|
| 139 |
- return false; |
|
| 140 |
- |
|
| 141 |
- }else if(!checkHpNum(callToNum)){
|
|
| 142 |
- |
|
| 143 |
- alert("올바른 전화번호를 입력해 주세요.");
|
|
| 144 |
- $('#callTo').val("");
|
|
| 145 |
- return false; |
|
| 146 |
- } |
|
| 147 |
- |
|
| 148 |
- //핸드폰 번호에 '-' 문자 제거하기 |
|
| 149 |
- callToNum = removeDash(callToNum); |
|
| 93 |
+ // checkHpNum(callToNum) |
|
| 94 |
+ |
|
| 95 |
+ |
|
| 150 | 96 |
|
| 151 |
- var dpCnt = 0; |
|
| 152 |
- $(".phoneArea p").each(function(index, item){
|
|
| 153 |
- if(this.textContent == callToNum){
|
|
| 154 |
- |
|
| 155 |
- dpCnt++; |
|
| 156 |
- |
|
| 157 |
- alert("받는사람 리스트에 동일한 연락처가 있습니다.");
|
|
| 158 |
- $('#callTo').val("");
|
|
| 159 |
- return false; |
|
| 160 |
- } |
|
| 161 |
- }); |
|
| 162 |
- |
|
| 163 |
- if(dpCnt > 0){
|
|
| 164 |
- alert("받는사람 리스트에 동일한 연락처가 있습니다.");
|
|
| 165 |
- $('#callTo').val("");
|
|
| 166 |
- return false; |
|
| 167 |
- }else{
|
|
| 168 |
- // fn_displayJsonToHtmlTable 재사용을 위한 |
|
| 169 |
- // 파라미터 형변환 |
|
| 170 |
- var data =[]; |
|
| 171 |
- data.push({ phone: callToNum, name: ''});
|
|
| 172 |
- fn_displayJsonToHtmlTable(data); |
|
| 173 |
- |
|
| 174 |
- /* |
|
| 175 |
- * 토탈 카운트 화면에 노출 |
|
| 176 |
- */ |
|
| 177 |
- updateTotCnt(); |
|
| 178 |
- |
|
| 179 |
- // 번호 추가란 초기화 |
|
| 180 |
- $('#callTo').val('');
|
|
| 181 |
- } |
|
| 97 |
+ var textarea = $('#callTo');
|
|
| 98 |
+ const numbers = textarea.val().split('\n')
|
|
| 99 |
+ .map(num => removeDash(num.trim())) |
|
| 100 |
+ .filter(num => num !== "") |
|
| 101 |
+ .filter(num => checkHpNum(num)); // 유효한 번호만 필터링; |
|
| 102 |
+ |
|
| 103 |
+ |
|
| 104 |
+ |
|
| 105 |
+ const formattedData = numbers.map(num => ({phone: num}));
|
|
| 106 |
+ |
|
| 107 |
+ // 기존 tableL의 데이터를 가져옵니다. |
|
| 108 |
+ var existingData = tableL.getData(); |
|
| 109 |
+ // 기존 데이터와 새로운 데이터를 합칩니다. |
|
| 110 |
+ var combinedData = existingData.concat(formattedData); |
|
| 111 |
+ |
|
| 112 |
+ // @ phone을 기준으로 중복 제거 및 갯수 계산 |
|
| 113 |
+ const result = removeDuplicatesAndCount(combinedData, 'phone'); |
|
| 114 |
+ |
|
| 115 |
+ setAllCntData(result); |
|
| 116 |
+ |
|
| 117 |
+ textarea.val('');
|
|
| 118 |
+ fn_priceClclt(); |
|
| 182 | 119 |
}); |
| 183 | 120 |
|
| 184 | 121 |
|
... | ... | @@ -442,9 +379,9 @@ |
| 442 | 379 |
* 토탈 카운트 화면에 노출 |
| 443 | 380 |
* 변수 없는 리스트만 체크 |
| 444 | 381 |
*/ |
| 445 |
-function updateTotCnt(){
|
|
| 382 |
+function updateTotCnt(cnt){
|
|
| 446 | 383 |
|
| 447 |
- $("#rowTotCnt").text($('#wrap01_body .list_body').length);
|
|
| 384 |
+ $("#rowTotCnt").text(cnt);
|
|
| 448 | 385 |
|
| 449 | 386 |
} |
| 450 | 387 |
|
... | ... | @@ -456,10 +393,10 @@ |
| 456 | 393 |
return; |
| 457 | 394 |
} |
| 458 | 395 |
|
| 459 |
- if(taData.length > 500){
|
|
| 460 |
- alert("최대 발송 건수는 500건 입니다.");
|
|
| 461 |
- return; |
|
| 462 |
- } |
|
| 396 |
+// if(taData.length > 500){
|
|
| 397 |
+// alert("최대 발송 건수는 500건 입니다.");
|
|
| 398 |
+// return; |
|
| 399 |
+// } |
|
| 463 | 400 |
|
| 464 | 401 |
|
| 465 | 402 |
/* |
--- src/main/webapp/js/web/msgdata/msgDataView.js
+++ src/main/webapp/js/web/msgdata/msgDataView.js
... | ... | @@ -1269,8 +1269,6 @@ |
| 1269 | 1269 |
|
| 1270 | 1270 |
var url = "/web/mjon/msgdata/sendMsgDataAjax_advc.do"; |
| 1271 | 1271 |
// 시작 시간 |
| 1272 |
- const startTime = new Date(); |
|
| 1273 |
- |
|
| 1274 | 1272 |
|
| 1275 | 1273 |
// 프로그래스파 시간을 위한 계산 |
| 1276 | 1274 |
var estimtedTime = calculateEstimatedTime($selectedData.length); |
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?