+++ src/main/java/itn/com/cmm/util/MsgSendUtils.java
... | ... | @@ -0,0 +1,468 @@ |
| 1 | +package itn.com.cmm.util; | |
| 2 | + | |
| 3 | +import java.io.UnsupportedEncodingException; | |
| 4 | + | |
| 5 | +import org.apache.commons.lang3.StringUtils; | |
| 6 | +import org.springframework.http.HttpStatus; | |
| 7 | + | |
| 8 | +import itn.let.mail.service.StatusResponse; | |
| 9 | +import itn.let.mjo.msg.service.MjonMsgVO; | |
| 10 | +import itn.let.mjo.msgdata.service.ReplacementListsVO; | |
| 11 | +import lombok.extern.slf4j.Slf4j; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * | |
| 15 | + * @author : 이호영 | |
| 16 | + * @fileName : MsgSendUtils.java | |
| 17 | + * @date : 2024.09.23 | |
| 18 | + * @description : 메세지발송 데이터 다루는 유틸 | |
| 19 | + * =========================================================== | |
| 20 | + * DATE AUTHOR NOTE | |
| 21 | + * ----------------------------------------------------------- * | |
| 22 | + * 2024.09.23 이호영 최초 생성 | |
| 23 | + * | |
| 24 | + * | |
| 25 | + * | |
| 26 | + */ | |
| 27 | +@Slf4j | |
| 28 | +public final class MsgSendUtils { | |
| 29 | + | |
| 30 | + | |
| 31 | + /** | |
| 32 | + * @methodName : getSmsTxtBytes | |
| 33 | + * @author : 이호영 | |
| 34 | + * @date : 2024.09.23 | |
| 35 | + * @description : sms 텍스트 바이트 계산 후 return; | |
| 36 | + * @param smsTxt | |
| 37 | + * @return | |
| 38 | + * @throws UnsupportedEncodingException | |
| 39 | + */ | |
| 40 | + public static int getSmsTxtBytes(String smsTxt) throws UnsupportedEncodingException { //문자열 길이 체크 해주기 | |
| 41 | + int smsBytes = 0; | |
| 42 | + //문자 바이트 계산에 필요한 캐릭터 셋 : 한글 2Byte로 계산 | |
| 43 | + String charset = "euc-kr"; | |
| 44 | + if(StringUtils.isNotEmpty(smsTxt)) { | |
| 45 | + String smsCont = smsTxt.replace("\r\n", "\n"); | |
| 46 | + smsBytes = smsCont.getBytes(charset).length; | |
| 47 | + } | |
| 48 | + return smsBytes; | |
| 49 | + } | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * @methodName : getMsgType | |
| 53 | + * @author : 이호영 | |
| 54 | + * @date : 2024.09.23 | |
| 55 | + * @description : msgType 재정의 | |
| 56 | + * @param mjonMsgVO | |
| 57 | + * @param smsTxtByte | |
| 58 | + * @return | |
| 59 | + */ | |
| 60 | + public static String getMsgType(MjonMsgVO mjonMsgVO, int smsTxtByte) { | |
| 61 | + String msgType = mjonMsgVO.getMsgType(); | |
| 62 | + | |
| 63 | + // 내문자저장함에 저장 후 문자를 발송하는 경우 문자 타입이 숫자가 아닌 문자로 넘어와서 변경 처리함 | |
| 64 | + if ("P".equals(msgType) || "L".equals(msgType)) { | |
| 65 | + msgType = "6"; | |
| 66 | + } else if ("S".equals(msgType)) { | |
| 67 | + msgType = "4"; | |
| 68 | + } | |
| 69 | + | |
| 70 | + // 그림 이미지가 첨부된 경우 장문으로 설정 | |
| 71 | + if (mjonMsgVO.getFileName1() != null || (mjonMsgVO.getImgFilePath() != null && mjonMsgVO.getImgFilePath().length > 0)) { | |
| 72 | + msgType = "6"; | |
| 73 | + } else if (smsTxtByte > 2000) { | |
| 74 | + // 2000 Byte를 초과할 경우 에러 처리 (이 부분은 호출부에서 검사하도록 유지할 수도 있음) | |
| 75 | + return "INVALID"; // 이 값은 호출부에서 에러 처리를 하도록 활용할 수 있습니다. | |
| 76 | + } else if (smsTxtByte > 90) { | |
| 77 | + // 90Byte 초과 시 장문으로 설정 | |
| 78 | + msgType = "6"; | |
| 79 | + } else { | |
| 80 | + // 그 외 단문으로 설정 | |
| 81 | + msgType = "4"; | |
| 82 | + } | |
| 83 | + | |
| 84 | + return msgType; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public static float getValidPrice(Float personalPrice, Float defaultPrice) { | |
| 88 | + return (personalPrice != null && personalPrice > 0) ? personalPrice : defaultPrice; | |
| 89 | + } | |
| 90 | + | |
| 91 | + | |
| 92 | + /** | |
| 93 | + * @methodName : determinePriceByMsgType | |
| 94 | + * @author : 이호영 | |
| 95 | + * @date : 2024.09.24 | |
| 96 | + * @description : 문자 메시지 타입에 따라 단가를 결정하는 메서드 | |
| 97 | + * @param mjonMsgVO | |
| 98 | + * @param shortPrice | |
| 99 | + * @param longPrice | |
| 100 | + * @param picturePrice | |
| 101 | + * @param picture2Price | |
| 102 | + * @param picture3Price | |
| 103 | + * @return | |
| 104 | + */ | |
| 105 | + public static float determinePriceByMsgType(MjonMsgVO mjonMsgVO, float shortPrice, float longPrice, | |
| 106 | + float picturePrice, float picture2Price, float picture3Price) { | |
| 107 | + float price = 0; | |
| 108 | + String msgType = mjonMsgVO.getMsgType(); | |
| 109 | + | |
| 110 | + if ("4".equals(msgType)) { | |
| 111 | + price = shortPrice; | |
| 112 | + } else if ("6".equals(msgType)) { | |
| 113 | + // 파일 첨부 여부에 따라 장문 단가 설정 | |
| 114 | + if (mjonMsgVO.getFileName3() != null) { | |
| 115 | + price = picture3Price; | |
| 116 | + } else if (mjonMsgVO.getFileName2() != null) { | |
| 117 | + price = picture2Price; | |
| 118 | + } else if (mjonMsgVO.getFileName1() != null) { | |
| 119 | + price = picturePrice; | |
| 120 | + } else { | |
| 121 | + price = longPrice; | |
| 122 | + } | |
| 123 | + } | |
| 124 | + return price; | |
| 125 | + } | |
| 126 | + | |
| 127 | + public static boolean isReplacementRequired(MjonMsgVO mjonMsgVO) { | |
| 128 | + return "Y".equals(mjonMsgVO.getTxtReplYn()); | |
| 129 | + } | |
| 130 | + | |
| 131 | + public static boolean isReplacementDataValid(MjonMsgVO mjonMsgVO) { | |
| 132 | + String[] nameList = mjonMsgVO.getNameList(); | |
| 133 | + String[] rep1 = mjonMsgVO.getRep1List(); | |
| 134 | + String[] rep2 = mjonMsgVO.getRep2List(); | |
| 135 | + String[] rep3 = mjonMsgVO.getRep3List(); | |
| 136 | + String[] rep4 = mjonMsgVO.getRep4List(); | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + // 치환 문자 리스트가 유효한지 확인 | |
| 141 | + return !(isEmpty(nameList) | |
| 142 | + && isEmpty(rep1) | |
| 143 | + && isEmpty(rep2) | |
| 144 | + && isEmpty(rep3) | |
| 145 | + && isEmpty(rep4)); | |
| 146 | + } | |
| 147 | + | |
| 148 | + // 배열이 비어있는지 확인하는 메서드 | |
| 149 | + public static boolean isEmpty(String[] array) { | |
| 150 | + return array == null || array.length == 0; | |
| 151 | + } | |
| 152 | + | |
| 153 | + public static ReplacementListsVO createReplacementLists(MjonMsgVO mjonMsgVO) throws UnsupportedEncodingException { | |
| 154 | + ReplacementListsVO lists = new ReplacementListsVO(); | |
| 155 | + lists.initializeLists(mjonMsgVO); // 배열을 초기화합니다. | |
| 156 | + return lists; | |
| 157 | +// return populateReplacementLists(mjonMsgVO, lists); // 데이터를 배열에 채웁니다. | |
| 158 | + } | |
| 159 | + | |
| 160 | + /** | |
| 161 | + * @methodName : populateReplacementLists | |
| 162 | + * @author : 이호영 | |
| 163 | + * @date : 2024.09.26 | |
| 164 | + * @description : 배열에 데이터를 채우는 메서드 | |
| 165 | + * @param mjonMsgVO | |
| 166 | + * @param lists | |
| 167 | + * @param statusResponse | |
| 168 | + * @return | |
| 169 | + * @throws UnsupportedEncodingException | |
| 170 | + */ | |
| 171 | + public static void populateReplacementLists(MjonMsgVO mjonMsgVO, ReplacementListsVO lists, StatusResponse statusResponse){ | |
| 172 | + | |
| 173 | + | |
| 174 | + String[] nameList = mjonMsgVO.getNameList(); | |
| 175 | + String[] phone = mjonMsgVO.getCallToList(); | |
| 176 | + String[] rep1 = mjonMsgVO.getRep1List(); | |
| 177 | + String[] rep2 = mjonMsgVO.getRep2List(); | |
| 178 | + String[] rep3 = mjonMsgVO.getRep3List(); | |
| 179 | + String[] rep4 = mjonMsgVO.getRep4List(); | |
| 180 | + String smsTxt = mjonMsgVO.getSmsTxt(); | |
| 181 | + int fileCount = Integer.parseInt(mjonMsgVO.getFileCnt()); | |
| 182 | + | |
| 183 | + // 이름 치환 | |
| 184 | + int shortCnt = 0; | |
| 185 | + int longCnt = 0; | |
| 186 | + int imgCnt = 0; | |
| 187 | + for (int i = 0; i < phone.length; i++) { | |
| 188 | + | |
| 189 | + smsTxt = smsTxt.replaceAll(String.valueOf((char) 13), ""); | |
| 190 | + if (smsTxt.contains("[*이름*]")) { | |
| 191 | + if (nameList.length > i && StringUtil.isNotEmpty(nameList[i])) { | |
| 192 | + smsTxt = smsTxt.replaceAll("\\[\\*이름\\*\\]", StringUtil.getString(nameList[i].replaceAll("§", ","))); | |
| 193 | + } else { | |
| 194 | + smsTxt = smsTxt.replaceAll("\\[\\*이름\\*\\]", ""); | |
| 195 | + } | |
| 196 | + } | |
| 197 | + | |
| 198 | + // 문자 1 치환 | |
| 199 | + if (smsTxt.contains("[*1*]")) { | |
| 200 | + if (rep1.length > i && StringUtil.isNotEmpty(rep1[i])) { | |
| 201 | + smsTxt = smsTxt.replaceAll("\\[\\*1\\*\\]", StringUtil.getString(rep1[i].replaceAll("§", ","))); | |
| 202 | + } else { | |
| 203 | + smsTxt = smsTxt.replaceAll("\\[\\*1\\*\\]", ""); | |
| 204 | + } | |
| 205 | + } | |
| 206 | + | |
| 207 | + // 문자 2 치환 | |
| 208 | + if (smsTxt.contains("[*2*]")) { | |
| 209 | + if (rep2.length > i && StringUtil.isNotEmpty(rep2[i])) { | |
| 210 | + smsTxt = smsTxt.replaceAll("\\[\\*2\\*\\]", StringUtil.getString(rep2[i].replaceAll("§", ","))); | |
| 211 | + } else { | |
| 212 | + smsTxt = smsTxt.replaceAll("\\[\\*2\\*\\]", ""); | |
| 213 | + } | |
| 214 | + } | |
| 215 | + | |
| 216 | + // 문자 3 치환 | |
| 217 | + if (smsTxt.contains("[*3*]")) { | |
| 218 | + if (rep3.length > i && StringUtil.isNotEmpty(rep3[i])) { | |
| 219 | + smsTxt = smsTxt.replaceAll("\\[\\*3\\*\\]", StringUtil.getString(rep3[i].replaceAll("§", ","))); | |
| 220 | + } else { | |
| 221 | + smsTxt = smsTxt.replaceAll("\\[\\*3\\*\\]", ""); | |
| 222 | + } | |
| 223 | + } | |
| 224 | + | |
| 225 | + // 문자 4 치환 | |
| 226 | + if (smsTxt.contains("[*4*]")) { | |
| 227 | + if (rep4.length > i && StringUtil.isNotEmpty(rep4[i])) { | |
| 228 | + smsTxt = smsTxt.replaceAll("\\[\\*4\\*\\]", StringUtil.getString(rep4[i].replaceAll("§", ","))); | |
| 229 | + } else { | |
| 230 | + smsTxt = smsTxt.replaceAll("\\[\\*4\\*\\]", ""); | |
| 231 | + } | |
| 232 | + } | |
| 233 | + | |
| 234 | + try { | |
| 235 | + int bytes = getSmsTxtBytes(smsTxt); | |
| 236 | + | |
| 237 | + if(bytes < 2000) { | |
| 238 | + if(fileCount > 0) { | |
| 239 | + populateImgLists(lists, nameList, phone, rep1, rep2, rep3, rep4, smsTxt, i); | |
| 240 | + imgCnt++; | |
| 241 | + | |
| 242 | + }else if(bytes > 90) {//장문문자 리스트 만들기 | |
| 243 | + populateLongLists(lists, nameList, phone, rep1, rep2, rep3, rep4, smsTxt, i); | |
| 244 | + longCnt++; | |
| 245 | + } else {//단문문자 리스트 만들기 | |
| 246 | + populateShortLists(lists, nameList, phone, rep1, rep2, rep3, rep4, smsTxt, i); | |
| 247 | + shortCnt++; | |
| 248 | + } | |
| 249 | + }else { | |
| 250 | + statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "문자 치환 후 전송 문자 길이를 초과하였습니다."); | |
| 251 | + } | |
| 252 | + | |
| 253 | + } catch (UnsupportedEncodingException e) { | |
| 254 | + statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "전송 중 오류가 발생하였습니다."); | |
| 255 | + e.printStackTrace(); | |
| 256 | + } | |
| 257 | + } | |
| 258 | + | |
| 259 | + lists.setShortCnt(shortCnt); | |
| 260 | + lists.setLongCnt(longCnt); | |
| 261 | + lists.setImgCnt(imgCnt); | |
| 262 | + | |
| 263 | + } | |
| 264 | + | |
| 265 | + private static void populateShortLists(ReplacementListsVO lists, String[] nameList, String[] phone, String[] rep1, | |
| 266 | + String[] rep2, String[] rep3, String[] rep4, String smsTxt, int i) { | |
| 267 | + // 이름 치환 | |
| 268 | + if (smsTxt.contains("[*이름*]")) { | |
| 269 | + if (nameList.length > i && StringUtil.isNotEmpty(nameList[i])) { | |
| 270 | + lists.getShortNameList()[i] = StringUtil.getString(nameList[i].replaceAll("§", ",")); | |
| 271 | + } else { | |
| 272 | + lists.getShortNameList()[i] = " "; | |
| 273 | + } | |
| 274 | + } else { | |
| 275 | + lists.getShortNameList()[i] = getSafeValue(nameList, i); | |
| 276 | + } | |
| 277 | + | |
| 278 | + lists.getShortPhone()[i] = getSafeValue(phone, i); | |
| 279 | + | |
| 280 | + // 문자 1 치환 | |
| 281 | + if (smsTxt.contains("[*1*]")) { | |
| 282 | + lists.getShortRep1()[i] = getReplacementValue(rep1, i, "[*1*]"); | |
| 283 | + } else { | |
| 284 | + lists.getShortRep1()[i] = getSafeValue(rep1, i); | |
| 285 | + } | |
| 286 | + | |
| 287 | + // 문자 2 치환 | |
| 288 | + if (smsTxt.contains("[*2*]")) { | |
| 289 | + lists.getShortRep2()[i] = getReplacementValue(rep2, i, "[*2*]"); | |
| 290 | + } else { | |
| 291 | + lists.getShortRep2()[i] = getSafeValue(rep2, i); | |
| 292 | + } | |
| 293 | + | |
| 294 | + // 문자 3 치환 | |
| 295 | + if (smsTxt.contains("[*3*]")) { | |
| 296 | + lists.getShortRep3()[i] = getReplacementValue(rep3, i, "[*3*]"); | |
| 297 | + } else { | |
| 298 | + lists.getShortRep3()[i] = getSafeValue(rep3, i); | |
| 299 | + } | |
| 300 | + | |
| 301 | + // 문자 4 치환 | |
| 302 | + if (smsTxt.contains("[*4*]")) { | |
| 303 | + lists.getShortRep4()[i] = getReplacementValue(rep4, i, "[*4*]"); | |
| 304 | + } else { | |
| 305 | + lists.getShortRep4()[i] = getSafeValue(rep4, i); | |
| 306 | + } | |
| 307 | + } | |
| 308 | + | |
| 309 | + // 장문 리스트에 데이터를 채우는 메서드 | |
| 310 | + private static void populateLongLists(ReplacementListsVO lists, String[] nameList, String[] phone, String[] rep1, String[] rep2, String[] rep3, String[] rep4, String smsTxt, int i) { | |
| 311 | + // 이름 치환 | |
| 312 | + if (smsTxt.contains("[*이름*]")) { | |
| 313 | + if (nameList.length > i && StringUtil.isNotEmpty(nameList[i])) { | |
| 314 | + lists.getLongNameList()[i] = StringUtil.getString(nameList[i].replaceAll("§", ",")); | |
| 315 | + } else { | |
| 316 | + lists.getLongNameList()[i] = " "; | |
| 317 | + } | |
| 318 | + } else { | |
| 319 | + lists.getLongNameList()[i] = getSafeValue(nameList, i); | |
| 320 | + } | |
| 321 | + | |
| 322 | + lists.getLongPhone()[i] = getSafeValue(phone, i); | |
| 323 | + | |
| 324 | + // 문자 1 치환 | |
| 325 | + if (smsTxt.contains("[*1*]")) { | |
| 326 | + lists.getLongRep1()[i] = getReplacementValue(rep1, i, "[*1*]"); | |
| 327 | + } else { | |
| 328 | + lists.getLongRep1()[i] = getSafeValue(rep1, i); | |
| 329 | + } | |
| 330 | + | |
| 331 | + // 문자 2 치환 | |
| 332 | + if (smsTxt.contains("[*2*]")) { | |
| 333 | + lists.getLongRep2()[i] = getReplacementValue(rep2, i, "[*2*]"); | |
| 334 | + } else { | |
| 335 | + lists.getLongRep2()[i] = getSafeValue(rep2, i); | |
| 336 | + } | |
| 337 | + | |
| 338 | + // 문자 3 치환 | |
| 339 | + if (smsTxt.contains("[*3*]")) { | |
| 340 | + lists.getLongRep3()[i] = getReplacementValue(rep3, i, "[*3*]"); | |
| 341 | + } else { | |
| 342 | + lists.getLongRep3()[i] = getSafeValue(rep3, i); | |
| 343 | + } | |
| 344 | + | |
| 345 | + // 문자 4 치환 | |
| 346 | + if (smsTxt.contains("[*4*]")) { | |
| 347 | + lists.getLongRep4()[i] = getReplacementValue(rep4, i, "[*4*]"); | |
| 348 | + } else { | |
| 349 | + lists.getLongRep4()[i] = getSafeValue(rep4, i); | |
| 350 | + } | |
| 351 | + } | |
| 352 | + | |
| 353 | + // 그림 문자 리스트에 데이터를 채우는 메서드 | |
| 354 | + private static void populateImgLists(ReplacementListsVO lists, String[] nameList, String[] phone, String[] rep1, String[] rep2, String[] rep3, String[] rep4, String smsTxt, int i) { | |
| 355 | + | |
| 356 | + // 이름 치환 | |
| 357 | + if (smsTxt.contains("[*이름*]")) { | |
| 358 | + if (nameList.length > i && StringUtil.isNotEmpty(nameList[i])) { | |
| 359 | + lists.getImgNameList()[i] = StringUtil.getString(nameList[i].replaceAll("§", ",")); | |
| 360 | + } else { | |
| 361 | + lists.getImgNameList()[i] = " "; | |
| 362 | + } | |
| 363 | + } else { | |
| 364 | + lists.getImgNameList()[i] = getSafeValue(nameList, i); | |
| 365 | + } | |
| 366 | + | |
| 367 | + lists.getImgPhone()[i] = getSafeValue(phone, i); | |
| 368 | + | |
| 369 | + // 문자 1 치환 | |
| 370 | + if (smsTxt.contains("[*1*]")) { | |
| 371 | + lists.getImgRep1()[i] = getReplacementValue(rep1, i, "[*1*]"); | |
| 372 | + } else { | |
| 373 | + lists.getImgRep1()[i] = getSafeValue(rep1, i); | |
| 374 | + } | |
| 375 | + | |
| 376 | + // 문자 2 치환 | |
| 377 | + if (smsTxt.contains("[*2*]")) { | |
| 378 | + lists.getImgRep2()[i] = getReplacementValue(rep2, i, "[*2*]"); | |
| 379 | + } else { | |
| 380 | + lists.getImgRep2()[i] = getSafeValue(rep2, i); | |
| 381 | + } | |
| 382 | + | |
| 383 | + // 문자 3 치환 | |
| 384 | + if (smsTxt.contains("[*3*]")) { | |
| 385 | + lists.getImgRep3()[i] = getReplacementValue(rep3, i, "[*3*]"); | |
| 386 | + } else { | |
| 387 | + lists.getImgRep3()[i] = getSafeValue(rep3, i); | |
| 388 | + } | |
| 389 | + | |
| 390 | + // 문자 4 치환 | |
| 391 | + if (smsTxt.contains("[*4*]")) { | |
| 392 | + lists.getImgRep4()[i] = getReplacementValue(rep4, i, "[*4*]"); | |
| 393 | + } else { | |
| 394 | + lists.getImgRep4()[i] = getSafeValue(rep4, i); | |
| 395 | + } | |
| 396 | + | |
| 397 | + } | |
| 398 | + | |
| 399 | + // 배열 인덱스를 안전하게 접근하는 메서드 | |
| 400 | + private static String getSafeValue(String[] array, int index) { | |
| 401 | + return (array != null && array.length > index) ? array[index] : " "; | |
| 402 | + } | |
| 403 | + | |
| 404 | + // 치환 처리에 특수문자 제거 로직이 포함된 메서드 | |
| 405 | + private static String getReplacementValue(String[] array, int index, String placeholder) { | |
| 406 | + if (array != null && array.length > index && StringUtil.isNotEmpty(array[index])) { | |
| 407 | + return StringUtil.getString(array[index].replaceAll("§", ",")); | |
| 408 | + } else { | |
| 409 | + return " "; | |
| 410 | + } | |
| 411 | + } | |
| 412 | + | |
| 413 | + | |
| 414 | + /** | |
| 415 | + * @methodName : checkReplacementDataValidity | |
| 416 | + * @author : 이호영 | |
| 417 | + * @date : 2024.09.25 | |
| 418 | + * @description : 치환문자가 사용될 때 데이터가 올바른지 확인하는 메서드 | |
| 419 | + * @param mjonMsgVO | |
| 420 | + * @param modelAndView | |
| 421 | + * @return boolean | |
| 422 | + */ | |
| 423 | + public static boolean checkReplacementDataValidity(MjonMsgVO mjonMsgVO, StatusResponse statusResponse) { | |
| 424 | + String[] nameList = mjonMsgVO.getNameList(); | |
| 425 | + String[] phone = mjonMsgVO.getCallToList(); | |
| 426 | + String[] rep1 = mjonMsgVO.getRep1List(); | |
| 427 | + String[] rep2 = mjonMsgVO.getRep2List(); | |
| 428 | + String[] rep3 = mjonMsgVO.getRep3List(); | |
| 429 | + String[] rep4 = mjonMsgVO.getRep4List(); | |
| 430 | + | |
| 431 | + boolean isRepCountOk = true; | |
| 432 | + | |
| 433 | + // 치환 문자 전체 필수 체크 | |
| 434 | + if (mjonMsgVO.getSmsTxt().contains("[*이름*]") && nameList.length != phone.length) { | |
| 435 | + isRepCountOk = false; | |
| 436 | + } | |
| 437 | + if (mjonMsgVO.getSmsTxt().contains("[*1*]") && rep1.length != phone.length) { | |
| 438 | + isRepCountOk = false; | |
| 439 | + } | |
| 440 | + if (mjonMsgVO.getSmsTxt().contains("[*2*]") && rep2.length != phone.length) { | |
| 441 | + isRepCountOk = false; | |
| 442 | + } | |
| 443 | + if (mjonMsgVO.getSmsTxt().contains("[*3*]") && rep3.length != phone.length) { | |
| 444 | + isRepCountOk = false; | |
| 445 | + } | |
| 446 | + if (mjonMsgVO.getSmsTxt().contains("[*4*]") && rep4.length != phone.length) { | |
| 447 | + isRepCountOk = false; | |
| 448 | + } | |
| 449 | + | |
| 450 | + // 검증 결과가 false인 경우 에러 메시지 반환 | |
| 451 | + if (!isRepCountOk) { | |
| 452 | + | |
| 453 | + statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "특정문구 일괄변환 치환문자 데이터가 없습니다."); | |
| 454 | + return false; | |
| 455 | + } | |
| 456 | + | |
| 457 | + return true; | |
| 458 | + } | |
| 459 | + | |
| 460 | + | |
| 461 | + private static void statusResponseSet (StatusResponse statusResponse, HttpStatus httpStatus, String msg ) { | |
| 462 | + statusResponse.setStatus(httpStatus); | |
| 463 | + statusResponse.setMessage(msg); | |
| 464 | + | |
| 465 | + } | |
| 466 | + | |
| 467 | + | |
| 468 | +} |
--- src/main/java/itn/let/mail/service/StatusResponse.java
+++ src/main/java/itn/let/mail/service/StatusResponse.java
... | ... | @@ -85,13 +85,19 @@ |
| 85 | 85 |
this.timestamp = timestamp; |
| 86 | 86 |
this.messageTemp = messageTemp; |
| 87 | 87 |
} |
| 88 |
- |
|
| 89 |
- @Builder |
|
| 90 |
- public StatusResponse(HttpStatus status, String msg, Object data) {
|
|
| 88 |
+ |
|
| 89 |
+ public StatusResponse(HttpStatus status, String message) {
|
|
| 91 | 90 |
this.status = status; |
| 92 |
- this.message = msg; |
|
| 93 |
- this.object = data; |
|
| 91 |
+ this.message = message; |
|
| 94 | 92 |
} |
| 93 |
+ |
|
| 94 |
+ |
|
| 95 |
+ public StatusResponse(HttpStatus status, String message, Object object) {
|
|
| 96 |
+ this.status = status; |
|
| 97 |
+ this.message = message; |
|
| 98 |
+ this.object = object; |
|
| 99 |
+ } |
|
| 100 |
+ |
|
| 95 | 101 |
|
| 96 | 102 |
|
| 97 | 103 |
|
--- src/main/java/itn/let/mjo/msgdata/service/MjonMsgDataService.java
+++ src/main/java/itn/let/mjo/msgdata/service/MjonMsgDataService.java
... | ... | @@ -2,7 +2,10 @@ |
| 2 | 2 |
|
| 3 | 3 |
import java.util.List; |
| 4 | 4 |
|
| 5 |
+import javax.servlet.http.HttpServletRequest; |
|
| 6 |
+ |
|
| 5 | 7 |
import itn.let.lett.service.LetterVO; |
| 8 |
+import itn.let.mail.service.StatusResponse; |
|
| 6 | 9 |
import itn.let.mjo.addr.service.AddrVO; |
| 7 | 10 |
import itn.let.mjo.msg.service.MjonMsgVO; |
| 8 | 11 |
import itn.let.sym.site.service.JoinSettingVO; |
... | ... | @@ -179,6 +182,8 @@ |
| 179 | 182 |
|
| 180 | 183 |
//팩스 거래명세서 합산 정보 |
| 181 | 184 |
public List<MjonMsgVO> selectPayUserSumFaxList(MjonMsgVO mjonMsgVO) throws Exception; |
| 185 |
+ |
|
| 186 |
+ public StatusResponse sendMsgData_advc(MjonMsgVO mjonMsgVO, HttpServletRequest request) throws Exception; |
|
| 182 | 187 |
|
| 183 | 188 |
|
| 184 | 189 |
} |
+++ src/main/java/itn/let/mjo/msgdata/service/ReplacementListsVO.java
... | ... | @@ -0,0 +1,59 @@ |
| 1 | +package itn.let.mjo.msgdata.service; | |
| 2 | + | |
| 3 | +import itn.let.mjo.msg.service.MjonMsgVO; | |
| 4 | +import lombok.Getter; | |
| 5 | +import lombok.NoArgsConstructor; | |
| 6 | +import lombok.Setter; | |
| 7 | + | |
| 8 | +@Getter | |
| 9 | +@Setter | |
| 10 | +@NoArgsConstructor | |
| 11 | +public class ReplacementListsVO { | |
| 12 | + String[] shortNameList; | |
| 13 | + String[] shortPhone; | |
| 14 | + String[] shortRep1; | |
| 15 | + String[] shortRep2; | |
| 16 | + String[] shortRep3; | |
| 17 | + String[] shortRep4; | |
| 18 | + int shortCnt; | |
| 19 | + | |
| 20 | + String[] longNameList; | |
| 21 | + String[] longPhone; | |
| 22 | + String[] longRep1; | |
| 23 | + String[] longRep2; | |
| 24 | + String[] longRep3; | |
| 25 | + String[] longRep4; | |
| 26 | + int longCnt; | |
| 27 | + | |
| 28 | + String[] imgNameList; | |
| 29 | + String[] imgPhone; | |
| 30 | + String[] imgRep1; | |
| 31 | + String[] imgRep2; | |
| 32 | + String[] imgRep3; | |
| 33 | + String[] imgRep4; | |
| 34 | + int imgCnt; | |
| 35 | + | |
| 36 | + // 배열을 초기화하는 메서드 | |
| 37 | + public void initializeLists(MjonMsgVO mjonMsgVO) { | |
| 38 | + shortNameList = new String[Integer.parseInt(mjonMsgVO.getShortMsgCnt())]; | |
| 39 | + shortPhone = new String[shortNameList.length]; | |
| 40 | + shortRep1 = new String[shortNameList.length]; | |
| 41 | + shortRep2 = new String[shortNameList.length]; | |
| 42 | + shortRep3 = new String[shortNameList.length]; | |
| 43 | + shortRep4 = new String[shortNameList.length]; | |
| 44 | + | |
| 45 | + longNameList = new String[Integer.parseInt(mjonMsgVO.getLongMsgCnt())]; | |
| 46 | + longPhone = new String[longNameList.length]; | |
| 47 | + longRep1 = new String[longNameList.length]; | |
| 48 | + longRep2 = new String[longNameList.length]; | |
| 49 | + longRep3 = new String[longNameList.length]; | |
| 50 | + longRep4 = new String[longNameList.length]; | |
| 51 | + | |
| 52 | + imgNameList = new String[mjonMsgVO.getCallToList().length]; | |
| 53 | + imgPhone = new String[imgNameList.length]; | |
| 54 | + imgRep1 = new String[imgNameList.length]; | |
| 55 | + imgRep2 = new String[imgNameList.length]; | |
| 56 | + imgRep3 = new String[imgNameList.length]; | |
| 57 | + imgRep4 = new String[imgNameList.length]; | |
| 58 | + } | |
| 59 | +} |
--- src/main/java/itn/let/mjo/msgdata/service/impl/MjonMsgDataServiceImpl.java
+++ src/main/java/itn/let/mjo/msgdata/service/impl/MjonMsgDataServiceImpl.java
| This diff is too big to display. |
--- src/main/java/itn/let/mjo/msgdata/web/MjonMsgDataController.java
+++ src/main/java/itn/let/mjo/msgdata/web/MjonMsgDataController.java
... | ... | @@ -1795,7 +1795,7 @@ |
| 1795 | 1795 |
* @return |
| 1796 | 1796 |
* @throws Exception |
| 1797 | 1797 |
*/ |
| 1798 |
- @RequestMapping(value= {"/web/mjon/msgdata/selectMsgAddrListAjax_advc.do"})
|
|
| 1798 |
+ @RequestMapping(value= {"/web/mjon/msgdata/selectMsgAddrListAjaxQ.do"})
|
|
| 1799 | 1799 |
public ResponseEntity<StatusResponse> selectMsgAddrListAjax_advc(@ModelAttribute("searchVO") AddrVO addrVO) {
|
| 1800 | 1800 |
|
| 1801 | 1801 |
Map<String, Object> response = new HashMap<>(); |
... | ... | @@ -2197,7 +2197,7 @@ |
| 2197 | 2197 |
* 현재 로그인 세션도 만료 처리함 |
| 2198 | 2198 |
* */ |
| 2199 | 2199 |
boolean mberSttus = userManageService.selectUserStatusInfo(userId); |
| 2200 |
- |
|
| 2200 |
+ |
|
| 2201 | 2201 |
if(!mberSttus) {
|
| 2202 | 2202 |
|
| 2203 | 2203 |
modelAndView.addObject("message", "현재 고객님께서는 문자온 서비스 이용이 정지된 상태로 문자를 발송하실 수 없습니다. 이용정지 해제를 원하시면 고객센터로 연락주시기 바랍니다.");
|
... | ... | @@ -2247,14 +2247,10 @@ |
| 2247 | 2247 |
|
| 2248 | 2248 |
//메세지 타입이 단문이면 진짜 단문인지 한번더 확인해 준다. |
| 2249 | 2249 |
if(msgType.equals("4")) {
|
| 2250 |
- |
|
| 2251 | 2250 |
//메세지 길이가 90Byte를초과 하거나, 그림 이미지가 있는경우 메세지 타입을 6으로 변경해준다. |
| 2252 | 2251 |
if(FrBytes > 90 || mjonMsgVO.getImgFilePath().length > 0) {
|
| 2253 |
- |
|
| 2254 | 2252 |
msgType = "6"; |
| 2255 |
- |
|
| 2256 | 2253 |
} |
| 2257 |
- |
|
| 2258 | 2254 |
} |
| 2259 | 2255 |
|
| 2260 | 2256 |
mjonMsgVO.setMsgType(msgType); |
... | ... | @@ -3155,6 +3151,25 @@ |
| 3155 | 3151 |
return modelAndView; |
| 3156 | 3152 |
} |
| 3157 | 3153 |
|
| 3154 |
+ |
|
| 3155 |
+ /** |
|
| 3156 |
+ * 문자 발송 기능 |
|
| 3157 |
+ * @param searchVO |
|
| 3158 |
+ * @param model |
|
| 3159 |
+ * @return "/web/mjon/msgdata/sendMsgDataAjax.do" |
|
| 3160 |
+ * @throws Exception |
|
| 3161 |
+ */ |
|
| 3162 |
+ @RequestMapping(value= {"/web/mjon/msgdata/sendMsgDataAjax_advc.do"})
|
|
| 3163 |
+ public ResponseEntity<StatusResponse> sendMsgData_advc(@ModelAttribute("searchVO") MjonMsgVO mjonMsgVO,
|
|
| 3164 |
+ RedirectAttributes redirectAttributes, |
|
| 3165 |
+ HttpServletRequest request, |
|
| 3166 |
+ ModelMap model) throws Exception{
|
|
| 3167 |
+ |
|
| 3168 |
+ return ResponseEntity.ok().body(mjonMsgDataService.sendMsgData_advc(mjonMsgVO, request)) ; |
|
| 3169 |
+ |
|
| 3170 |
+ } |
|
| 3171 |
+ |
|
| 3172 |
+ |
|
| 3158 | 3173 |
/** |
| 3159 | 3174 |
* 관리자로 문자 발송해주기 |
| 3160 | 3175 |
* 사용자가 보낸 문자를 문자온 법인폰으로 발송해주는 기능 함수. |
--- src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataSMLView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataSMLView.jsp
... | ... | @@ -250,6 +250,7 @@ |
| 250 | 250 |
//전체 데이터 갯수 구하는 함수 |
| 251 | 251 |
function updateTotCnt(data){
|
| 252 | 252 |
|
| 253 |
+ console.log(' :: updateTotCnt :: ');
|
|
| 253 | 254 |
var rowTotCnt = data; |
| 254 | 255 |
$("#rowTotCnt").text(numberWithCommas(rowTotCnt));
|
| 255 | 256 |
|
... | ... | @@ -746,8 +747,8 @@ |
| 746 | 747 |
|
| 747 | 748 |
//문자 내용 입력시 바이트수 계산하기 |
| 748 | 749 |
$('#smsTxtArea').keyup(function(e){
|
| 749 |
- console.log("11$('.preview_auto').test() :: ",$('.realtime').html())
|
|
| 750 |
- console.log("11$('.preview_auto').test() :: ",$('.realtime').text())
|
|
| 750 |
+// console.log("11$('.preview_auto').test() :: ",$('.realtime').html())
|
|
| 751 |
+// console.log("11$('.preview_auto').test() :: ",$('.realtime').text())
|
|
| 751 | 752 |
|
| 752 | 753 |
var contents = $(this).val(); |
| 753 | 754 |
var adrYn = $("input[name=send_adYn]:checked").val();
|
... | ... | @@ -2200,7 +2201,7 @@ |
| 2200 | 2201 |
} |
| 2201 | 2202 |
|
| 2202 | 2203 |
//수신목록 전체 데이터 갯수 구하기 |
| 2203 |
- updateTotCnt(totRows); |
|
| 2204 |
+// updateTotCnt(totRows); |
|
| 2204 | 2205 |
|
| 2205 | 2206 |
//일괄변환 문구 결제금액 처리 |
| 2206 | 2207 |
if(contents.indexOf("[*이름*]") > -1
|
--- src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgdata/MsgDataView.jsp
... | ... | @@ -1050,20 +1050,25 @@ |
| 1050 | 1050 |
alert("현재 문자 발송하기 기능 점검 중입니다.\n\n1분 후 다시 시도해주세요.");
|
| 1051 | 1051 |
return false; |
| 1052 | 1052 |
} |
| 1053 |
- |
|
| 1054 |
- var testString = document.msgForm.smsTxtArea.value; |
|
| 1055 | 1053 |
|
| 1056 | 1054 |
var form = document.msgForm; |
| 1057 |
- |
|
| 1058 |
- //회원 보유 잔액 비교 |
|
| 1059 | 1055 |
var totPriceOnly = stringReplaceAll(form.totPrice.value, ",", ""); |
| 1060 | 1056 |
var userMoneyOnly = stringReplaceAll(form.myPrice.value, ",", ""); |
| 1057 |
+ |
|
| 1061 | 1058 |
if(parseFloat(userMoneyOnly) < parseFloat(totPriceOnly)){
|
| 1062 | 1059 |
alert("문자 발송에 필요한 회원님의 보유 잔액이 부족 합니다.");
|
| 1063 | 1060 |
return false; |
| 1064 | 1061 |
} |
| 1065 |
- |
|
| 1062 |
+ |
|
| 1066 | 1063 |
var loginVO = '${LoginVO}';
|
| 1064 |
+ if (!loginVO) {
|
|
| 1065 |
+ alert("문자발송 서비스는 로그인 후 이용 가능합니다.");
|
|
| 1066 |
+ return false; |
|
| 1067 |
+ } |
|
| 1068 |
+ |
|
| 1069 |
+ // 폼 유효성 검사 |
|
| 1070 |
+ if (!validateForm(form)) return false; |
|
| 1071 |
+ |
|
| 1067 | 1072 |
var adverYn = $("input[name='send_adYn']:checked").val();
|
| 1068 | 1073 |
var spamStatus = false; |
| 1069 | 1074 |
var exceptSpamYn = $("#exceptSpamYn").val(); //금지어 필터링 예외 여부 - N 일 경우만 스팸 검사를 진행
|
... | ... | @@ -1104,69 +1109,6 @@ |
| 1104 | 1109 |
// return false; |
| 1105 | 1110 |
//} |
| 1106 | 1111 |
|
| 1107 |
- if(form.callFromList.value == ""){
|
|
| 1108 |
- |
|
| 1109 |
- alert("발신번호를 입력해 주세요.");
|
|
| 1110 |
- return false; |
|
| 1111 |
- |
|
| 1112 |
- } |
|
| 1113 |
- |
|
| 1114 |
- var titleStatus = form.title_status.value; |
|
| 1115 |
- if(titleStatus == 'N'){//장문 제목 사용안함으로 선택시 제목에 있는 데이터 지워주기
|
|
| 1116 |
- |
|
| 1117 |
- form.mmsSubject.value = ""; |
|
| 1118 |
- |
|
| 1119 |
- }else{//장문 제목에 치환문자 포함된 경우 입력 못하도록 처리.
|
|
| 1120 |
- |
|
| 1121 |
- var mmsSubject = form.mmsSubject.value; |
|
| 1122 |
- if(getSpacialStringChk(mmsSubject)){
|
|
| 1123 |
- alert("문자 제목에는 치환문자(엑셀 내 *이름*, *1*, *2*, *3*, *4* 등)를 사용하실 수 없습니다.");
|
|
| 1124 |
- return false; |
|
| 1125 |
- } |
|
| 1126 |
- |
|
| 1127 |
- } |
|
| 1128 |
- |
|
| 1129 |
- //문자내용 첫글자에 특수기호 포함 여부 체크 |
|
| 1130 |
- var strCont = form.smsTxtArea.value; |
|
| 1131 |
- var rtnStr = strChinJpnCheck(strCont); |
|
| 1132 |
- |
|
| 1133 |
- //문자제목에 이모지가 있는지 체크 |
|
| 1134 |
- var titleStatusYn = $("input[name='title_status']:checked").val();
|
|
| 1135 |
- if(titleStatusYn == 'Y') {
|
|
| 1136 |
- if(!emojiCheck(form.mmsSubject.value)) return false; |
|
| 1137 |
- } |
|
| 1138 |
- |
|
| 1139 |
- //문자내용에 이모지가 있는지 체크 |
|
| 1140 |
- if(!emojiCheck(strCont)) return false; |
|
| 1141 |
- |
|
| 1142 |
- if(rtnStr.length > 0){
|
|
| 1143 |
- |
|
| 1144 |
- alert("입력하신 문구 중 \" " + rtnStr + " \" 는 일부 휴대폰에서 표기되지 않을 수 있습니다.");
|
|
| 1145 |
- |
|
| 1146 |
- } |
|
| 1147 |
- |
|
| 1148 |
- /* var strCont = form.smsTxtArea.value; |
|
| 1149 |
- var repStr = strFirstCharCheck(strCont); |
|
| 1150 |
- |
|
| 1151 |
- if(repStr.length > 0){
|
|
| 1152 |
- |
|
| 1153 |
- alert("문자 내용 첫 글자는 특수기호가 들어갈 수 없습니다.");
|
|
| 1154 |
- $('#smsTxtArea').val(strCont.replace(repStr, ""));
|
|
| 1155 |
- fnByteString(strCont.replace(repStr, "")); |
|
| 1156 |
- return false; |
|
| 1157 |
- |
|
| 1158 |
- } */ |
|
| 1159 |
- |
|
| 1160 |
- if(imgFilePath.length == 0){ // 그림문자일 경우 내용이 없어도 됨 , 장문 문자일 경우만 문자내용 체크함
|
|
| 1161 |
- |
|
| 1162 |
- if(form.smsTxtArea.value == ""){
|
|
| 1163 |
- |
|
| 1164 |
- alert("문자 내용을 입력해 주세요.");
|
|
| 1165 |
- return false; |
|
| 1166 |
- |
|
| 1167 |
- } |
|
| 1168 |
- |
|
| 1169 |
- } |
|
| 1170 | 1112 |
|
| 1171 | 1113 |
|
| 1172 | 1114 |
//광고 문자 내용 합쳐주기 |
... | ... | @@ -1312,7 +1254,8 @@ |
| 1312 | 1254 |
|
| 1313 | 1255 |
} |
| 1314 | 1256 |
|
| 1315 |
- |
|
| 1257 |
+ |
|
| 1258 |
+ console.log(' : 전송하시겠습니까 : ')
|
|
| 1316 | 1259 |
if(confirm("문자를 전송하시겠습니까?")){
|
| 1317 | 1260 |
imgFilePath = []; |
| 1318 | 1261 |
$('.thumb_wrap').find('.thumb_img').each(function(idx, el) {
|
... | ... | @@ -1390,7 +1333,7 @@ |
| 1390 | 1333 |
|
| 1391 | 1334 |
//문자내용이 입력된 경우 스팸 필터링 실행 |
| 1392 | 1335 |
if(!form.smsTxtArea.value == "" && exceptSpamYn == "N"){
|
| 1393 |
- |
|
| 1336 |
+ console.log(' : selectSpamTxtChkAjax : ')
|
|
| 1394 | 1337 |
var spmData = new FormData(form); |
| 1395 | 1338 |
url = "/web/mjon/msgdata/selectSpamTxtChkAjax.do"; |
| 1396 | 1339 |
|
... | ... | @@ -1452,6 +1395,7 @@ |
| 1452 | 1395 |
} |
| 1453 | 1396 |
|
| 1454 | 1397 |
var eventRemainCash = parseFloat(form.eventRemainCash.value); |
| 1398 |
+ console.log('eventStatus : ', eventStatus);
|
|
| 1455 | 1399 |
|
| 1456 | 1400 |
if(eventStatus == 'Y'){
|
| 1457 | 1401 |
|
... | ... | @@ -1629,8 +1573,9 @@ |
| 1629 | 1573 |
var form = document.msgForm; |
| 1630 | 1574 |
|
| 1631 | 1575 |
var data = new FormData(form); |
| 1632 |
- url = "/web/mjon/msgdata/sendMsgDataAjax.do"; |
|
| 1633 |
- |
|
| 1576 |
+// url = "/web/mjon/msgdata/sendMsgDataAjax.do"; |
|
| 1577 |
+ url = "/web/mjon/msgdata/sendMsgDataAjax_advc.do"; |
|
| 1578 |
+ console.log('url :: ', url);
|
|
| 1634 | 1579 |
$.ajax({
|
| 1635 | 1580 |
type: "POST", |
| 1636 | 1581 |
url: url, |
... | ... | @@ -1641,6 +1586,7 @@ |
| 1641 | 1586 |
contentType: false, |
| 1642 | 1587 |
cache: false, |
| 1643 | 1588 |
success: function (returnData, status) {
|
| 1589 |
+ console.log('returnData : ', returnData);
|
|
| 1644 | 1590 |
if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
|
| 1645 | 1591 |
if("fail" == returnData.result){
|
| 1646 | 1592 |
|
... | ... | @@ -1794,7 +1740,7 @@ |
| 1794 | 1740 |
form.eventStatus.value = 'N'; |
| 1795 | 1741 |
form.eventYn.value = 'N'; |
| 1796 | 1742 |
|
| 1797 |
- sendMsgAjax(0,0); |
|
| 1743 |
+ sendMsgAjax_advc(0,0); |
|
| 1798 | 1744 |
|
| 1799 | 1745 |
}else{
|
| 1800 | 1746 |
|
... | ... | @@ -1815,14 +1761,14 @@ |
| 1815 | 1761 |
}else{
|
| 1816 | 1762 |
|
| 1817 | 1763 |
//발송 Ajax 호출해주기 |
| 1818 |
- sendMsgAjax(0,0); |
|
| 1764 |
+ sendMsgAjax_advc(0,0); |
|
| 1819 | 1765 |
|
| 1820 | 1766 |
} |
| 1821 | 1767 |
|
| 1822 | 1768 |
}else{
|
| 1823 | 1769 |
|
| 1824 | 1770 |
//발송 Ajax 호출해주기 |
| 1825 |
- sendMsgAjax(0,0); |
|
| 1771 |
+ sendMsgAjax_advc(0,0); |
|
| 1826 | 1772 |
|
| 1827 | 1773 |
} |
| 1828 | 1774 |
|
... | ... | @@ -1830,6 +1776,46 @@ |
| 1830 | 1776 |
|
| 1831 | 1777 |
} |
| 1832 | 1778 |
|
| 1779 |
+ |
|
| 1780 |
+ |
|
| 1781 |
+//폼 유효성 검사 함수 |
|
| 1782 |
+function validateForm(form) {
|
|
| 1783 |
+ |
|
| 1784 |
+ if(form.callFromList.value == ""){
|
|
| 1785 |
+ |
|
| 1786 |
+ alert("발신번호를 입력해 주세요.");
|
|
| 1787 |
+ return false; |
|
| 1788 |
+ |
|
| 1789 |
+ } |
|
| 1790 |
+ |
|
| 1791 |
+ if (form.title_status.value === 'N') {
|
|
| 1792 |
+ form.mmsSubject.value = ""; |
|
| 1793 |
+ } else if (getSpacialStringChk(form.mmsSubject.value)) {
|
|
| 1794 |
+ alert("문자 제목에는 치환문자(엑셀 내 *이름*, *1*, *2*, *3*, *4* 등)를 사용하실 수 없습니다.");
|
|
| 1795 |
+ return false; |
|
| 1796 |
+ } |
|
| 1797 |
+ |
|
| 1798 |
+ //문자제목에 이모지가 있는지 체크 |
|
| 1799 |
+ var titleStatusYn = $("input[name='title_status']:checked").val();
|
|
| 1800 |
+ if(titleStatusYn == 'Y') {
|
|
| 1801 |
+ if(!emojiCheck(form.mmsSubject.value)) return false; |
|
| 1802 |
+ } |
|
| 1803 |
+ |
|
| 1804 |
+ // 문자내용에 이모지가 있는지 체크 |
|
| 1805 |
+ var strCont = form.smsTxtArea.value; |
|
| 1806 |
+ if (!emojiCheck(strCont)) return false; |
|
| 1807 |
+ |
|
| 1808 |
+ var rtnStr = strChinJpnCheck(strCont); |
|
| 1809 |
+ if(rtnStr.length > 0){
|
|
| 1810 |
+ alert("입력하신 문구 중 \" " + rtnStr + " \" 는 일부 휴대폰에서 표기되지 않을 수 있습니다.");
|
|
| 1811 |
+ } |
|
| 1812 |
+ |
|
| 1813 |
+ if (imgFilePath.length === 0 && !form.smsTxtArea.value) {
|
|
| 1814 |
+ alert("문자 내용을 입력해 주세요.");
|
|
| 1815 |
+ return false; |
|
| 1816 |
+ } |
|
| 1817 |
+ return true; |
|
| 1818 |
+} |
|
| 1833 | 1819 |
|
| 1834 | 1820 |
//이벤트가 아닌 일반 개별 단가 셋팅해주기 |
| 1835 | 1821 |
function getNorEachPrice(evnMsgType){
|
... | ... | @@ -1873,13 +1859,103 @@ |
| 1873 | 1859 |
} |
| 1874 | 1860 |
|
| 1875 | 1861 |
|
| 1876 |
-function sendMsgAjax(paramSmsCnt, paramBlockCnt){
|
|
| 1877 |
- |
|
| 1862 |
+function sendMsgAjax_advc(paramSmsCnt, paramBlockCnt){
|
|
| 1863 |
+ console.log('sendMsgAjax : ');
|
|
| 1878 | 1864 |
var form = document.msgForm; |
| 1879 | 1865 |
var reserYn = $("#reserveYn").val();
|
| 1880 | 1866 |
|
| 1881 | 1867 |
var data = new FormData(form); |
| 1882 |
- url = "/web/mjon/msgdata/sendMsgDataAjax.do"; |
|
| 1868 |
+// url = "/web/mjon/msgdata/sendMsgDataAjax.do"; |
|
| 1869 |
+ url = "/web/mjon/msgdata/sendMsgDataAjax_advc.do"; |
|
| 1870 |
+ |
|
| 1871 |
+ $.ajax({
|
|
| 1872 |
+ type: "POST", |
|
| 1873 |
+ url: url, |
|
| 1874 |
+ data: data, |
|
| 1875 |
+ dataType:'json', |
|
| 1876 |
+ async: true, |
|
| 1877 |
+ processData: false, |
|
| 1878 |
+ contentType: false, |
|
| 1879 |
+ cache: false, |
|
| 1880 |
+ success: function (data) {
|
|
| 1881 |
+ console.log('data : ', data);
|
|
| 1882 |
+ /* message:"특정문구 일괄변환 치환문자 데이터가 없습니다." |
|
| 1883 |
+ status:"BAD_REQUEST" */ |
|
| 1884 |
+ |
|
| 1885 |
+ var status = data.status; |
|
| 1886 |
+// if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
|
|
| 1887 |
+ if("OK" == status){
|
|
| 1888 |
+ |
|
| 1889 |
+ var smsCnt = Number(data.object.resultSts); |
|
| 1890 |
+ var blockCnt = Number(data.object.resultBlockSts); |
|
| 1891 |
+ |
|
| 1892 |
+ smsCnt = Number(smsCnt) + Number(paramSmsCnt); |
|
| 1893 |
+ blockCnt = Number(blockCnt) + Number(paramBlockCnt); |
|
| 1894 |
+ |
|
| 1895 |
+ if((smsCnt + blockCnt) == 0){
|
|
| 1896 |
+ |
|
| 1897 |
+ $('.pop_msg_spam').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'});
|
|
| 1898 |
+ $('.pop_msg_spam .msg_text').html("문자 발송(예약)에 실패하였습니다.<br/> 다시 시도해주세요. <br/>* 정상적으로 발송 시도하였으나 실패하신 경우 혹시 문자내용에 사용불가 이모지 <br/>또는 복사-붙여넣기로 인한 보이지 않는 특수문자가 포함되었는지 확인 후 다시 시도해주세요.");
|
|
| 1899 |
+ $('.mask').addClass('on');
|
|
| 1900 |
+ |
|
| 1901 |
+ }else{
|
|
| 1902 |
+ |
|
| 1903 |
+ $('.pop_msg_success').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'});
|
|
| 1904 |
+ //예약발송 건의 경우 결과 팝업 문구 변경 |
|
| 1905 |
+ if(reserYn == 'Y'){
|
|
| 1906 |
+ $('.pop_msg_success .msg_text').html("예약 성공 : <strong>"+ smsCnt + "</strong>건,수신거부 : <span>" + blockCnt + "</span>건의<br>문자가 예약 되었습니다.");
|
|
| 1907 |
+ }else{
|
|
| 1908 |
+ $('.pop_msg_success .msg_text').html("발송 성공 : <strong>"+ smsCnt + "</strong>건,수신거부 : <span>" + blockCnt + "</span>건의<br>문자가 발송 되었습니다.");
|
|
| 1909 |
+ } |
|
| 1910 |
+ |
|
| 1911 |
+ $('.mask').addClass('on');
|
|
| 1912 |
+ |
|
| 1913 |
+ } |
|
| 1914 |
+ |
|
| 1915 |
+ |
|
| 1916 |
+ }else if("BAD_REQUEST" == status){
|
|
| 1917 |
+ |
|
| 1918 |
+ alert(data.message); |
|
| 1919 |
+ return false; |
|
| 1920 |
+ |
|
| 1921 |
+ }else if("UNAUTHORIZED" == status){
|
|
| 1922 |
+ |
|
| 1923 |
+ alert(data.message); |
|
| 1924 |
+ //문자발송 URL Move |
|
| 1925 |
+ goMsgUrlMove(); |
|
| 1926 |
+ return false; |
|
| 1927 |
+ |
|
| 1928 |
+ }else if("NO_CONTENT" == status){
|
|
| 1929 |
+ |
|
| 1930 |
+ $('.pop_msg_fails').css({'display':'block','opacity':'1','left':'50%','top':'50%','transform':'translate(-50%,-50%)'});
|
|
| 1931 |
+ $('.pop_msg_fails .msg_text').html(returnData.message);
|
|
| 1932 |
+ $('.mask').addClass('on');
|
|
| 1933 |
+ |
|
| 1934 |
+ } |
|
| 1935 |
+ |
|
| 1936 |
+// } else if(status== 'fail'){
|
|
| 1937 |
+// alert(returnData.message); |
|
| 1938 |
+// } |
|
| 1939 |
+ }, |
|
| 1940 |
+ beforeSend : function(xmlHttpRequest) {
|
|
| 1941 |
+ //로딩창 show |
|
| 1942 |
+ $('.loading_layer').addClass('active');
|
|
| 1943 |
+ }, |
|
| 1944 |
+ complete : function(xhr, textStatus) {
|
|
| 1945 |
+ //로딩창 hide |
|
| 1946 |
+ $('.loading_layer').removeClass('active');
|
|
| 1947 |
+ }, |
|
| 1948 |
+ error: function (e) { alert("문자 발송에 실패하였습니다."); console.log("ERROR : ", e); }
|
|
| 1949 |
+ }); |
|
| 1950 |
+ |
|
| 1951 |
+} |
|
| 1952 |
+ |
|
| 1953 |
+function sendMsgAjax(paramSmsCnt, paramBlockCnt){
|
|
| 1954 |
+ var form = document.msgForm; |
|
| 1955 |
+ var reserYn = $("#reserveYn").val();
|
|
| 1956 |
+ |
|
| 1957 |
+ var data = new FormData(form); |
|
| 1958 |
+ url = "/web/mjon/msgdata/sendMsgDataAjax.do"; |
|
| 1883 | 1959 |
|
| 1884 | 1960 |
$.ajax({
|
| 1885 | 1961 |
type: "POST", |
--- src/main/webapp/WEB-INF/jsp/web/msgdata/excel/MsgExcelDataView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgdata/excel/MsgExcelDataView.jsp
... | ... | @@ -1082,7 +1082,10 @@ |
| 1082 | 1082 |
var form = document.msgForm; |
| 1083 | 1083 |
|
| 1084 | 1084 |
var data = new FormData(form); |
| 1085 |
- url = "/web/mjon/msgdata/sendMsgDataAjax.do"; |
|
| 1085 |
+// url = "/web/mjon/msgdata/sendMsgDataAjax.do"; |
|
| 1086 |
+ url = "/web/mjon/msgdata/sendMsgDataAjax_advc.do"; |
|
| 1087 |
+ |
|
| 1088 |
+ console.log('url : ', url);
|
|
| 1086 | 1089 |
|
| 1087 | 1090 |
$.ajax({
|
| 1088 | 1091 |
type: "POST", |
... | ... | @@ -1094,6 +1097,8 @@ |
| 1094 | 1097 |
contentType: false, |
| 1095 | 1098 |
cache: false, |
| 1096 | 1099 |
success: function (returnData, status) {
|
| 1100 |
+ console.log('returnData : ', returnData);
|
|
| 1101 |
+ console.log('status : ', status);
|
|
| 1097 | 1102 |
if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
|
| 1098 | 1103 |
if("fail" == returnData.result){
|
| 1099 | 1104 |
|
--- src/main/webapp/WEB-INF/jsp/web/msgdata/include/msgDataIncludeExcel.jsp
+++ src/main/webapp/WEB-INF/jsp/web/msgdata/include/msgDataIncludeExcel.jsp
... | ... | @@ -1,938 +1,940 @@ |
| 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 |
- |
|
| 7 |
-<script type="text/javascript" src="<c:url value='/publish/js/content.js'/>"></script> |
|
| 8 |
- |
|
| 9 |
-<script type="text/javascript"> |
|
| 10 |
- |
|
| 11 |
-var $tableExcel = null; //엑셀입력 탭 |
|
| 12 |
-var $tableError = null; //엑셀입력 탭 |
|
| 13 |
-$(document).ready(function(){
|
|
| 14 |
- |
|
| 15 |
- //Tabulator AJAX Data Loading |
|
| 16 |
- $tableError = new Tabulator("#tabulator_error", {
|
|
| 17 |
- height:"255px", |
|
| 18 |
- width:"100%", |
|
| 19 |
- layout:"fitColumns", |
|
| 20 |
- autoColumns:false, |
|
| 21 |
- headerHozAlign:"center", |
|
| 22 |
- validationMode:"highlight", |
|
| 23 |
- clipboard:false, |
|
| 24 |
- clipboardCopySelector:"table", |
|
| 25 |
- clipboardPasteAction:"insert", // insert, update, replace |
|
| 26 |
- placeholder:"등록 팝업에서 휴대폰을 선택 후 확인해주세요.", //fit columns to width of table (optional) |
|
| 27 |
- columns:[ //Define Table Columns |
|
| 28 |
- {title:"이름", field:"name", hozAlign:"center", headerHozAlign: "center", width:125},
|
|
| 29 |
- {title:"휴대폰", field:"phone", hozAlign:"center", headerHozAlign: "center", width:158},
|
|
| 30 |
- {title:"미등록 결과", field:"result", hozAlign:"center", headerHozAlign: "center", width:125}
|
|
| 31 |
- ] |
|
| 32 |
- }); |
|
| 33 |
- |
|
| 34 |
- |
|
| 35 |
- //Tabulator AJAX Data Loading |
|
| 36 |
- $tableExcel = new Tabulator("#tabulator_excel", {
|
|
| 37 |
- height:"255px", |
|
| 38 |
- width:"100%", |
|
| 39 |
- layout:"fitColumns", |
|
| 40 |
- autoColumns:false, |
|
| 41 |
- headerHozAlign:"center", |
|
| 42 |
- validationMode:"highlight", |
|
| 43 |
- clipboard:false, |
|
| 44 |
- clipboardCopySelector:"table", |
|
| 45 |
- clipboardPasteAction:"insert", // insert, update, replace |
|
| 46 |
- placeholder:"Excel 파일을 업로드 해주세요.", //fit columns to width of table (optional) |
|
| 47 |
- columns:[ //Define Table Columns |
|
| 48 |
- {formatter:"rowSelection", titleFormatter:"rowSelection",clipboard:false, headerHozAlign:"center", hozAlign:"center", headerSort:false, cellClick:function(e, cell){
|
|
| 49 |
- cell.getRow().toggleSelect(); |
|
| 50 |
- } |
|
| 51 |
- }, |
|
| 52 |
- {formatter:"rownum", align:"center" ,title:"No", hozAlign:"center", headerHozAlign:"center", width:40},
|
|
| 53 |
- {title:"A", field:"A", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
|
| 54 |
- {title:"B", field:"B", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
|
| 55 |
- {title:"C", field:"C", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
|
| 56 |
- {title:"D", field:"D", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
|
| 57 |
- {title:"E", field:"E", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
|
| 58 |
- {title:"F", field:"F", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]}
|
|
| 59 |
- ], |
|
| 60 |
- validationFailed:function(cell, value, parameters){ // 유효성 체크 함수
|
|
| 61 |
- var valid = cell.isValid(); |
|
| 62 |
- if(!valid){
|
|
| 63 |
- alert("양식에 맞지 않는 정보가 입력되었습니다.");
|
|
| 64 |
- |
|
| 65 |
- //해당 셀 데이터 삭제 |
|
| 66 |
- cell.setValue("");
|
|
| 67 |
- } |
|
| 68 |
- return value % parameters.phone; |
|
| 69 |
- }, |
|
| 70 |
- }); |
|
| 71 |
- |
|
| 72 |
- |
|
| 73 |
- |
|
| 74 |
- |
|
| 75 |
- // 타뷸레이터 width값 변경 시 위에 select width 값 변경 |
|
| 76 |
- var titleArray = ["A","B","C","D","E","F"]; |
|
| 77 |
- |
|
| 78 |
- $tableExcel.on("columnWidth",function(column){
|
|
| 79 |
- var titleIndex = titleArray.indexOf(column._column.definition.title); |
|
| 80 |
- titleIndex += 1; |
|
| 81 |
- if(titleIndex != 0){
|
|
| 82 |
- $('.select_adr_hd>div').eq(titleIndex).css('width', column._column.width);
|
|
| 83 |
- }else{
|
|
| 84 |
- $('.select_adr_hd>div').eq(0).css('width', column._column.width + 40);
|
|
| 85 |
- } |
|
| 86 |
- }); |
|
| 87 |
- |
|
| 88 |
- $tableExcel.on("scrollHorizontal",function(left){
|
|
| 89 |
- $(".adr_excel").scrollLeft(left);
|
|
| 90 |
- }) |
|
| 91 |
- |
|
| 92 |
- |
|
| 93 |
- $(".adr_excel").on("scroll",function(){
|
|
| 94 |
- $(".tabulator-tableholder").scrollLeft($(this).scrollLeft());
|
|
| 95 |
- }); |
|
| 96 |
- |
|
| 97 |
- |
|
| 98 |
- |
|
| 99 |
- |
|
| 100 |
- $("#excelFile").on("change", function(event) {
|
|
| 101 |
- var fileInfo = event.target.files; |
|
| 102 |
- if(fileInfo.length > 0){
|
|
| 103 |
- excelFileChange(fileInfo[0]); |
|
| 104 |
- } else {
|
|
| 105 |
- fn_loadRemoveActive(); // 파일이 선택되지 않은 경우 로딩 상태 제거 |
|
| 106 |
- setTimeout(() => { $(this).val(''); }, 0); // 파일 선택 초기화
|
|
| 107 |
- } |
|
| 108 |
- }); |
|
| 109 |
- |
|
| 110 |
- |
|
| 111 |
- |
|
| 112 |
- $(document).on('click', '#btnAddrMassClose', function() {
|
|
| 113 |
- // 대량등록 닫기 |
|
| 114 |
- setAddrMassClose(); |
|
| 115 |
- }); |
|
| 116 |
- |
|
| 117 |
- |
|
| 118 |
- $(document).on('click', '#closeBtn', function() {
|
|
| 119 |
- // 대량등록 닫기 |
|
| 120 |
- setAddrMassClose(); |
|
| 121 |
- }); |
|
| 122 |
- |
|
| 123 |
- |
|
| 124 |
- |
|
| 125 |
- |
|
| 126 |
- // 엑셀등록 닫기 |
|
| 127 |
- function setAddrMassClose() {
|
|
| 128 |
- $tableExcel.clearData(); |
|
| 129 |
- $("#excelRowTotCnt").text(0); //총건수 수정
|
|
| 130 |
- $("#excelRowDupCnt").text(0); //중복건수 수정
|
|
| 131 |
- $("#excelRowErrorCnt").text(0); //중복건수 수정
|
|
| 132 |
- dupliPhoneDataRealList.length = 0; // 중복 휴대폰번호 초기화 |
|
| 133 |
- addrMassDupliSaveList = null; |
|
| 134 |
- |
|
| 135 |
- |
|
| 136 |
- // popup 영역 |
|
| 137 |
- $tableError.clearData(); |
|
| 138 |
- // 중복 카운트 |
|
| 139 |
- $("#errorPopDupCnt").text(0);
|
|
| 140 |
- // 에러 카운트 |
|
| 141 |
- $("#errorPopErrorCnt").text(0);
|
|
| 142 |
- // |
|
| 143 |
- $("#errorPopTotCnt").text(0);
|
|
| 144 |
- |
|
| 145 |
- |
|
| 146 |
- } |
|
| 147 |
- |
|
| 148 |
- //############################################################################################# |
|
| 149 |
- //파일업로드 드래그앤 드롭 |
|
| 150 |
- //############################################################################################# |
|
| 151 |
- var objDragAndDrop = $(".upload_area");
|
|
| 152 |
- $(document).on("dragenter",".upload_area",function(e){
|
|
| 153 |
- e.stopPropagation(); |
|
| 154 |
- e.preventDefault(); |
|
| 155 |
- //$(this).css('border', '2px solid #0B85A1');
|
|
| 156 |
- }); |
|
| 157 |
- $(document).on("dragover",".upload_area",function(e){
|
|
| 158 |
- e.stopPropagation(); |
|
| 159 |
- e.preventDefault(); |
|
| 160 |
- }); |
|
| 161 |
- $(document).on("drop",".upload_area",function(e){
|
|
| 162 |
- fn_loadAddActive(); |
|
| 163 |
- e.preventDefault(); |
|
| 164 |
- var files = e.originalEvent.dataTransfer.files; |
|
| 165 |
- excelFileChange(files[0]); |
|
| 166 |
- }); |
|
| 167 |
- |
|
| 168 |
- $(document).on('dragenter', function (e){
|
|
| 169 |
- e.stopPropagation(); |
|
| 170 |
- e.preventDefault(); |
|
| 171 |
- }); |
|
| 172 |
- $(document).on('dragover', function (e){
|
|
| 173 |
- e.stopPropagation(); |
|
| 174 |
- e.preventDefault(); |
|
| 175 |
- //objDragAndDrop.css('border', '2px dotted #0B85A1');
|
|
| 176 |
- }); |
|
| 177 |
- $(document).on('drop', function (e){
|
|
| 178 |
- e.stopPropagation(); |
|
| 179 |
- e.preventDefault(); |
|
| 180 |
- }); |
|
| 181 |
- //파일 드래그앤드롭 종료 |
|
| 182 |
- |
|
| 183 |
- |
|
| 184 |
- |
|
| 185 |
- |
|
| 186 |
- |
|
| 187 |
- //타이틀 select 선택 이벤트 |
|
| 188 |
- $('.field-selector').on('change', function() {
|
|
| 189 |
- fn_loadAddActive(); |
|
| 190 |
- |
|
| 191 |
- setTimeout(() => {
|
|
| 192 |
- var selectedFields = []; |
|
| 193 |
- var isDuplicate = false; |
|
| 194 |
- |
|
| 195 |
- if($tableExcel.getData().length < 1){
|
|
| 196 |
- alert('데이터 입력 후 선택해 주세요.');
|
|
| 197 |
- $(this).val("");
|
|
| 198 |
- fn_loadRemoveActive(); |
|
| 199 |
- return false; |
|
| 200 |
- } |
|
| 201 |
- |
|
| 202 |
- // 중복체크 |
|
| 203 |
- $('.field-selector').each(function() {
|
|
| 204 |
- var selectedField = $(this).val(); |
|
| 205 |
- if (selectedField) {
|
|
| 206 |
- if (selectedFields.includes(selectedField)) {
|
|
| 207 |
- alert("중복된 필드를 선택할 수 없습니다.");
|
|
| 208 |
- $(this).val(""); // 중복 필드를 선택한 경우 빈 값으로 초기화
|
|
| 209 |
- isDuplicate = true; |
|
| 210 |
- return false; // 반복문 종료 |
|
| 211 |
- } |
|
| 212 |
- selectedFields.push(selectedField); |
|
| 213 |
- } |
|
| 214 |
- }); |
|
| 215 |
- |
|
| 216 |
- |
|
| 217 |
- // |
|
| 218 |
- updateTableFields($tableExcel); |
|
| 219 |
- |
|
| 220 |
- // 필드가 휴대폰이면 열 중복체크 |
|
| 221 |
- if($(this).val() == 'addrPhoneNo'){
|
|
| 222 |
- fn_phoneDupl($tableExcel); |
|
| 223 |
- } |
|
| 224 |
- fn_loadRemoveActive(); |
|
| 225 |
- |
|
| 226 |
- }, 0); // 지연 없이 즉시 실행되도록 0ms 지연을 설정 |
|
| 227 |
- |
|
| 228 |
- |
|
| 229 |
- }); |
|
| 230 |
- |
|
| 231 |
- |
|
| 232 |
- |
|
| 233 |
- // 받는사람 선택삭제 버튼 처리해주기 |
|
| 234 |
- $('#in_select_del').click(function(){
|
|
| 235 |
- |
|
| 236 |
- if($tableExcel == null || $tableExcel == ""){
|
|
| 237 |
- |
|
| 238 |
- alert("받는사람을 추가해 주세요.");
|
|
| 239 |
- return false; |
|
| 240 |
- |
|
| 241 |
- } |
|
| 242 |
- |
|
| 243 |
- var selectedData = $tableExcel.getSelectedRows(); |
|
| 244 |
- |
|
| 245 |
- if(selectedData == "" || selectedData == null){
|
|
| 246 |
- |
|
| 247 |
- alert("삭제할 연락처를 선택해주세요.");
|
|
| 248 |
- return false; |
|
| 249 |
- |
|
| 250 |
- }else{ // 선택한 Row 데이터 삭제하기
|
|
| 251 |
- |
|
| 252 |
- if(confirm("선택하신 받는 사람을 삭제하시겠습니까?")){
|
|
| 253 |
- |
|
| 254 |
- // 선택 데이터 삭제 |
|
| 255 |
- selectedData.forEach(row => row.delete()); |
|
| 256 |
- |
|
| 257 |
- |
|
| 258 |
- totRows = $tableExcel.getRows().length; |
|
| 259 |
- $("#excelRowTotCnt").text(totRows);
|
|
| 260 |
- |
|
| 261 |
- |
|
| 262 |
- } |
|
| 263 |
- |
|
| 264 |
- } |
|
| 265 |
- |
|
| 266 |
- }); |
|
| 267 |
- |
|
| 268 |
- // 추가버튼 |
|
| 269 |
- $('#btnAddrMassReg').click(function(){
|
|
| 270 |
- |
|
| 271 |
- if($tableExcel.getData().length < 1){
|
|
| 272 |
- alert("한 개 이상의 연락처를 입력하세요");
|
|
| 273 |
- return false; |
|
| 274 |
- } |
|
| 275 |
-// else if (selectedData.length > 20000) {
|
|
| 276 |
-// alert("2만줄 이상의 업로드는 데이터 부하로 업로드 할수 없습니다.");
|
|
| 277 |
-// return false; |
|
| 278 |
-// } |
|
| 279 |
- |
|
| 280 |
- |
|
| 281 |
- // tableExcel 그룹의 select 요소들을 확인 |
|
| 282 |
-// var isPhoneSelected = false; |
|
| 283 |
-// var isNameSelected = false; |
|
| 284 |
- var columns = $tableExcel.getColumns(); |
|
| 285 |
- var isAddrPhoneNoSelected = columns.some(column => column.getField() === 'addrPhoneNo'); |
|
| 286 |
- |
|
| 287 |
- if (!isAddrPhoneNoSelected) {
|
|
| 288 |
-// isPhoneSelected = true; |
|
| 289 |
- alert('휴대폰이 선택되지 않았습니다.');
|
|
| 290 |
- return false; |
|
| 291 |
- |
|
| 292 |
- } |
|
| 293 |
- |
|
| 294 |
- var addrData = $tableExcel.getData().map((row, index) => ({
|
|
| 295 |
- name: row.addrNm, |
|
| 296 |
- phone: removeDash(row.addrPhoneNo), |
|
| 297 |
- rep1: row.addrInfo1, |
|
| 298 |
- rep2: row.addrInfo2, |
|
| 299 |
- rep3: row.addrInfo3, |
|
| 300 |
- rep4: row.addrInfo4, |
|
| 301 |
- })); |
|
| 302 |
- |
|
| 303 |
- |
|
| 304 |
- |
|
| 305 |
- |
|
| 306 |
- |
|
| 307 |
- |
|
| 308 |
- // 기존 tableL의 데이터를 가져옵니다. |
|
| 309 |
- var existingData = tableL.getData(); |
|
| 310 |
- // 기존 데이터와 새로운 데이터를 합칩니다. |
|
| 311 |
- var combinedData = existingData.concat(addrData); |
|
| 312 |
- // 합쳐진 데이터를 tableL에 설정합니다. |
|
| 313 |
- tableL.setData(combinedData); |
|
| 314 |
- |
|
| 315 |
- // 미리보기 버튼 활성화 |
|
| 316 |
- updateButtons(0); |
|
| 317 |
- |
|
| 318 |
- var totRows = tableL.getRows().length; |
|
| 319 |
- updateTotCnt(totRows); //전체 데이터 갯수 구하기 |
|
| 320 |
- console.log('totRows : ', totRows);
|
|
| 321 |
- var smsTxtArea = $('#smsTxtArea').val();
|
|
| 322 |
- if(smsTxtArea.indexOf("[*이름*]") > -1
|
|
| 323 |
- || smsTxtArea.indexOf("[*1*]") > -1
|
|
| 324 |
- || smsTxtArea.indexOf("[*2*]") > -1
|
|
| 325 |
- || smsTxtArea.indexOf("[*3*]") > -1
|
|
| 326 |
- || smsTxtArea.indexOf("[*4*]") > -1){
|
|
| 327 |
- |
|
| 328 |
- fnReplCell(); |
|
| 329 |
- |
|
| 330 |
- }else{
|
|
| 331 |
- |
|
| 332 |
- //결제 금액 구하기 |
|
| 333 |
- totalPriceSum(totRows); |
|
| 334 |
- |
|
| 335 |
- } |
|
| 336 |
- |
|
| 337 |
- setAddrMassClose(); |
|
| 338 |
- $('#closeBtn').click();
|
|
| 339 |
- }); |
|
| 340 |
- |
|
| 341 |
- |
|
| 342 |
- |
|
| 343 |
- //받는사람 전체삭제 버튼 처리 |
|
| 344 |
- $('#allDel').click(function(){
|
|
| 345 |
- var data = $tableExcel.getRows(); |
|
| 346 |
- $tableExcel.clearData(); |
|
| 347 |
- $("#excelRowTotCnt").text(0); //총건수 수정
|
|
| 348 |
- $("#excelRowDupCnt").text(0); //중복건수 수정
|
|
| 349 |
- dupliPhoneDataRealList.length = 0; // 중복 휴대폰번호 초기화 |
|
| 350 |
- |
|
| 351 |
- // select box 초기화 |
|
| 352 |
- $('.field-selector').each(function() { $(this).val(''); });
|
|
| 353 |
- |
|
| 354 |
- }); |
|
| 355 |
- |
|
| 356 |
- |
|
| 357 |
- |
|
| 358 |
-}); |
|
| 359 |
- |
|
| 360 |
- |
|
| 361 |
- |
|
| 362 |
-function excelFileChange(file) {
|
|
| 363 |
- if (file) {
|
|
| 364 |
- |
|
| 365 |
- // 파일 크기 체크 (20MB) |
|
| 366 |
- const maxSize = 20 * 1024 * 1024; // 20MB in bytes |
|
| 367 |
- if (file.size > maxSize) {
|
|
| 368 |
- alert('파일 크기는 20MB를 초과할 수 없습니다.');
|
|
| 369 |
- return; |
|
| 370 |
- } |
|
| 371 |
- |
|
| 372 |
- fn_loadAddActive(); |
|
| 373 |
- var reader = new FileReader(); |
|
| 374 |
- var extension = file.name.split('.').pop().toLowerCase();
|
|
| 375 |
- reader.onload = function(e) {
|
|
| 376 |
- setTimeout(() => { // 파일 읽기 완료 후 실행되도록 함
|
|
| 377 |
- if (extension === 'xlsx') {
|
|
| 378 |
- var data = new Uint8Array(e.target.result); |
|
| 379 |
- var workbook = XLSX.read(data, {type: 'array'});
|
|
| 380 |
- var firstSheet = workbook.Sheets[workbook.SheetNames[0]]; |
|
| 381 |
- var jsonData = XLSX.utils.sheet_to_json(firstSheet, {header: 1});
|
|
| 382 |
- processExcelData(jsonData); |
|
| 383 |
- } else if (extension === 'txt') {
|
|
| 384 |
- var textData = e.target.result; |
|
| 385 |
- processTextData(textData); |
|
| 386 |
- } else {
|
|
| 387 |
- alert('지원되지 않는 파일 형식입니다.');
|
|
| 388 |
- } |
|
| 389 |
- fn_loadRemoveActive(); |
|
| 390 |
- }, 0); // 지연 없이 즉시 실행되도록 0ms 지연을 설정 |
|
| 391 |
- }; |
|
| 392 |
- if (extension === 'xlsx') {
|
|
| 393 |
- reader.readAsArrayBuffer(file); |
|
| 394 |
- } else if (extension === 'txt') {
|
|
| 395 |
- reader.readAsText(file); |
|
| 396 |
- } |
|
| 397 |
- } |
|
| 398 |
-} |
|
| 399 |
- |
|
| 400 |
- |
|
| 401 |
-// 엑셀 데이터 처리 함수 |
|
| 402 |
-function processExcelData(data) {
|
|
| 403 |
- var keys = ['A', 'B', 'C', 'D', 'E', 'F', 'G']; |
|
| 404 |
- var tableData = []; |
|
| 405 |
- var totalRows = data.length - 2; // 전체 데이터 수 (1, 2행 제외) |
|
| 406 |
- |
|
| 407 |
- |
|
| 408 |
- // 3번째 행부터 입력 |
|
| 409 |
- data.slice(0).forEach((row, index) => {
|
|
| 410 |
- var rowData = {};
|
|
| 411 |
- keys.forEach((key, idx) => { // index 변수명 변경 (내부와 외부에서 사용되므로 충돌 방지)
|
|
| 412 |
-// console.log('row[idx] : ', row[idx]);
|
|
| 413 |
-// rowData[key] = row[idx] ? row[idx].trim() : ""; // 각 컬럼에 대해 기본값을 설정 |
|
| 414 |
- rowData[key] = (typeof row[idx] === 'string') ? row[idx].trim() : row[idx]; |
|
| 415 |
- }); |
|
| 416 |
- tableData.push(rowData); |
|
| 417 |
- |
|
| 418 |
- }); |
|
| 419 |
- |
|
| 420 |
- updateTable(tableData); |
|
| 421 |
-} |
|
| 422 |
- |
|
| 423 |
- |
|
| 424 |
-// 텍스트 데이터 처리 함수 |
|
| 425 |
-function processTextData(text) {
|
|
| 426 |
- var lines = text.split('\n'); // 각 줄을 배열로 분리
|
|
| 427 |
- var keys = ['A', 'B', 'C', 'D', 'E', 'F', 'G']; |
|
| 428 |
- var tableData = []; |
|
| 429 |
- |
|
| 430 |
- lines.forEach(line => {
|
|
| 431 |
- var rowData = {};
|
|
| 432 |
- var row = line.split(','); // 쉼표로 분리
|
|
| 433 |
- keys.forEach((key, index) => {
|
|
| 434 |
- rowData[key] = row[index] ? row[index].trim() : ""; // 각 컬럼에 대해 기본값을 설정 |
|
| 435 |
- }); |
|
| 436 |
- tableData.push(rowData); |
|
| 437 |
- }); |
|
| 438 |
- |
|
| 439 |
- updateTable(tableData); |
|
| 440 |
-} |
|
| 441 |
- |
|
| 442 |
-//공통 테이블 업데이트 함수 |
|
| 443 |
-function updateTable(tableData) {
|
|
| 444 |
- $tableExcel.setColumns([ //Define Table Columns |
|
| 445 |
- {formatter:"rowSelection", titleFormatter:"rowSelection",clipboard:false, headerHozAlign:"center", hozAlign:"center", headerSort:false, cellClick:function(e, cell){
|
|
| 446 |
- cell.getRow().toggleSelect(); |
|
| 447 |
- } |
|
| 448 |
- }, |
|
| 449 |
- {formatter:"rownum", align:"center" ,title:"No", hozAlign:"center", headerHozAlign:"center", width:60},
|
|
| 450 |
- {title:"A", field:"A", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
|
| 451 |
- {title:"B", field:"B", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
|
| 452 |
- {title:"C", field:"C", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
|
| 453 |
- {title:"D", field:"D", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
|
| 454 |
- {title:"E", field:"E", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
|
| 455 |
- {title:"F", field:"F", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]}
|
|
| 456 |
- ]); |
|
| 457 |
- |
|
| 458 |
- $tableExcel.setData(tableData).then(() => {
|
|
| 459 |
- // excelRowTotCnt 업데이트 |
|
| 460 |
- document.getElementById("excelRowTotCnt").innerText = tableData.length;
|
|
| 461 |
- }); |
|
| 462 |
- |
|
| 463 |
- fn_loadRemoveActive(); |
|
| 464 |
-} |
|
| 465 |
- |
|
| 466 |
- |
|
| 467 |
- |
|
| 468 |
-/* |
|
| 469 |
-* 타이틀 select 선택할때마다 실행해서 |
|
| 470 |
-* 데이터테이블 필드값 수정 |
|
| 471 |
-*/ |
|
| 472 |
-function updateTableFields($objTabul) {
|
|
| 473 |
- var currentData = $objTabul.getData(); |
|
| 474 |
- var columns = [ |
|
| 475 |
- {formatter: "rowSelection", titleFormatter: "rowSelection", clipboard: false, hozAlign: "center", headerHozAlign: "center", headerSort: false, cellClick: function(e, cell) {
|
|
| 476 |
- cell.getRow().toggleSelect(); |
|
| 477 |
- }} |
|
| 478 |
- ,{formatter:"rownum", align:"center", title:"No", hozAlign:"center", headerHozAlign:"center", width:60}
|
|
| 479 |
- ]; |
|
| 480 |
- |
|
| 481 |
- var fieldMapping = []; |
|
| 482 |
- $('.field-selector').each(function(index) {
|
|
| 483 |
- var selectedField = $(this).val(); |
|
| 484 |
- // ASCII 문자 코드 사용 - 65=A, 66=B ... |
|
| 485 |
- var field = String.fromCharCode(65 + index); |
|
| 486 |
- if (selectedField) {
|
|
| 487 |
- columns.push({
|
|
| 488 |
- title: field |
|
| 489 |
- , field: selectedField |
|
| 490 |
- , hozAlign: "center" |
|
| 491 |
- , headerHozAlign: "center" |
|
| 492 |
-// , editor: "input" |
|
| 493 |
- , editor: false |
|
| 494 |
- , width: 140 |
|
| 495 |
- , validator: ["maxLength:100", "string"] |
|
| 496 |
- }); |
|
| 497 |
- fieldMapping.push(selectedField); |
|
| 498 |
- } else {
|
|
| 499 |
- columns.push({
|
|
| 500 |
- title: field |
|
| 501 |
- , field: field |
|
| 502 |
- , hozAlign: "center" |
|
| 503 |
- , headerHozAlign: "center" |
|
| 504 |
- , editor: false |
|
| 505 |
-// , editor: "input" |
|
| 506 |
- , width: 140 |
|
| 507 |
- , validator: ["maxLength:100", "string"] |
|
| 508 |
- }); |
|
| 509 |
- fieldMapping.push(field); |
|
| 510 |
- } |
|
| 511 |
- }); |
|
| 512 |
- |
|
| 513 |
- var updatedData = currentData.map(row => {
|
|
| 514 |
- var newRow = {};
|
|
| 515 |
- fieldMapping.forEach((field, index) => {
|
|
| 516 |
- newRow[field] = row[Object.keys(row)[index]] || ""; |
|
| 517 |
- }); |
|
| 518 |
- return newRow; |
|
| 519 |
- }); |
|
| 520 |
- |
|
| 521 |
- $objTabul.setColumns(columns); |
|
| 522 |
- $objTabul.setData(updatedData); |
|
| 523 |
-} |
|
| 524 |
- |
|
| 525 |
- |
|
| 526 |
-/** |
|
| 527 |
- * @ 핸드폰 중복 데이터 |
|
| 528 |
- * */ |
|
| 529 |
-function fn_phoneDupl($objTabul) {
|
|
| 530 |
- |
|
| 531 |
- $tableError.clearData(); |
|
| 532 |
- |
|
| 533 |
- var data = $objTabul.getData(); |
|
| 534 |
- var phoneNumberChk = false; |
|
| 535 |
- var existingNumbers = new Set(); // 배열에서 Set으로 변경 |
|
| 536 |
- |
|
| 537 |
- let errorCount = 0; // 중복 번호 개수를 저장할 변수 |
|
| 538 |
- let duplicateCount = 0; // 중복 번호 개수를 저장할 변수 |
|
| 539 |
- |
|
| 540 |
- const errors = []; // 오류 데이터를 저장할 배열 |
|
| 541 |
- const newData = []; // 유효한 데이터만 저장할 새로운 배열 |
|
| 542 |
- |
|
| 543 |
- data.forEach((row, index) => {
|
|
| 544 |
- |
|
| 545 |
- const number = row.addrPhoneNo; |
|
| 546 |
- |
|
| 547 |
- // number가 null, undefined, 빈 문자열이거나 숫자인 경우 처리 |
|
| 548 |
- if (!number || (typeof number === 'string' && !number.trim())){
|
|
| 549 |
- console.log("number : ", number);
|
|
| 550 |
- return; |
|
| 551 |
- } |
|
| 552 |
- |
|
| 553 |
- const formattedNumber = formatPhoneNumber(number); // 번호 표준화 |
|
| 554 |
- const cleanedNumber = formattedNumber.replace(/[^0-9]/g, ''); // 숫자만 남김 |
|
| 555 |
- |
|
| 556 |
- if (!existingNumbers.has(cleanedNumber)) { // 중복 번호 체크
|
|
| 557 |
- if (isValidPhoneNumber(formattedNumber)) { // 유효성 검사
|
|
| 558 |
- row.addrPhoneNo = formattedNumber; |
|
| 559 |
- existingNumbers.add(cleanedNumber); // 추가된 번호를 기존 목록에 추가 |
|
| 560 |
- newData.push(row); // 유효한 데이터만 새로운 배열에 추가 |
|
| 561 |
- } else {
|
|
| 562 |
- // 오류: 유효성 통과 못함 |
|
| 563 |
- errorCount++; |
|
| 564 |
- |
|
| 565 |
- errors.push({
|
|
| 566 |
- name: row.addrNm, // 이름 |
|
| 567 |
- phone: row.addrPhoneNo, // 폰번호 |
|
| 568 |
- result: "오류" // 결과 메시지 추가 |
|
| 569 |
- }); |
|
| 570 |
- } |
|
| 571 |
- } else {
|
|
| 572 |
- // 중복 |
|
| 573 |
- duplicateCount++; |
|
| 574 |
- |
|
| 575 |
- errors.push({
|
|
| 576 |
- name: row.addrNm, // 이름 |
|
| 577 |
- phone: row.addrPhoneNo, // 폰번호 |
|
| 578 |
- result: "중복" // 결과 메시지 추가 |
|
| 579 |
- }); |
|
| 580 |
- } |
|
| 581 |
- }); |
|
| 582 |
- |
|
| 583 |
- // data 배열을 newData 배열로 대체 |
|
| 584 |
- data = newData; |
|
| 585 |
- |
|
| 586 |
- |
|
| 587 |
- // 수정된 데이터로 테이블 업데이트 |
|
| 588 |
- $objTabul.setData(data); |
|
| 589 |
- // 오류 총 카운트 |
|
| 590 |
- $("#excelRowTotCnt").text($objTabul.getDataCount());
|
|
| 591 |
- // 중복 카운트 |
|
| 592 |
- $("#excelRowDupCnt").text(duplicateCount);
|
|
| 593 |
- // 에러 카운트 |
|
| 594 |
- $("#excelRowErrorCnt").text(errorCount);
|
|
| 595 |
- |
|
| 596 |
- // popup 영역 |
|
| 597 |
- $("#errorPopTotCnt").text($objTabul.getDataCount());
|
|
| 598 |
- // 중복 카운트 |
|
| 599 |
- $("#errorPopDupCnt").text(duplicateCount);
|
|
| 600 |
- // 에러 카운트 |
|
| 601 |
- $("#errorPopErrorCnt").text(errorCount);
|
|
| 602 |
- |
|
| 603 |
- |
|
| 604 |
- $tableError.setData(errors); |
|
| 605 |
- |
|
| 606 |
- if(errorCount > 0){
|
|
| 607 |
- alert('휴대폰 형식에 맞지 않는 데이터는 삭제 후 업로드 됩니다.\nex) 발송불가 특수문자, 자릿수 오류 등');
|
|
| 608 |
- } |
|
| 609 |
- |
|
| 610 |
- |
|
| 611 |
- |
|
| 612 |
-} |
|
| 613 |
- |
|
| 614 |
-function fn_dupliPopupShow(){
|
|
| 615 |
- |
|
| 616 |
- $("#tableExcelDupliBtn").show();
|
|
| 617 |
-} |
|
| 618 |
- |
|
| 619 |
-function makeAddrMassDupliPop(dupliPhoneDataRealList) {
|
|
| 620 |
- var sHtml = ""; |
|
| 621 |
- sHtml += "<div class='' style='overflow-x:auto; height:350px;'>"; |
|
| 622 |
- sHtml += "<table class='tType4'>"; |
|
| 623 |
- sHtml += " <colgroup>"; |
|
| 624 |
- sHtml += " <col style='width:auto' />"; |
|
| 625 |
- sHtml += " </colgroup>"; |
|
| 626 |
- sHtml += " <thead>"; |
|
| 627 |
- sHtml += " <tr>"; |
|
| 628 |
- sHtml += " <th>중복 휴대폰번호 (" + numberWithCommas(dupliPhoneDataRealList.length) + "개)</th>";
|
|
| 629 |
- sHtml += " </tr>"; |
|
| 630 |
- sHtml += " </thead>"; |
|
| 631 |
- sHtml += " <tbody>"; |
|
| 632 |
- for (var i = 0; i < dupliPhoneDataRealList.length; i++) {
|
|
| 633 |
- sHtml += " <tr>"; |
|
| 634 |
- sHtml += " <td>" + dupliPhoneDataRealList[i] + "</td>"; |
|
| 635 |
- sHtml += " </tr>"; |
|
| 636 |
- } |
|
| 637 |
- sHtml += " </tbody>"; |
|
| 638 |
- sHtml += " </table>"; |
|
| 639 |
- sHtml += " </div>"; |
|
| 640 |
- |
|
| 641 |
- $("#addrMassDupli_layer").html(sHtml);
|
|
| 642 |
- fn_dupliPopupShow(); |
|
| 643 |
- |
|
| 644 |
-} |
|
| 645 |
- |
|
| 646 |
- |
|
| 647 |
-function fn_dupliPopupShow(){
|
|
| 648 |
- $('#tableExcelDupliBtn').show();
|
|
| 649 |
-} |
|
| 650 |
- |
|
| 651 |
-//한국의 핸드폰 번호 형식 검사 함수 |
|
| 652 |
-function isValidKoreanPhoneNumber(phone) {
|
|
| 653 |
- // 하이픈(-)을 제거하고 숫자만 남긴 후 검사 |
|
| 654 |
- var cleaned = phone.replace(/-/g, ''); |
|
| 655 |
- // 010, 011, 016, 017, 018, 019로 시작하고 10~11자리인 경우 유효 |
|
| 656 |
- var valid = /^(010|011|016|017|018|019)\d{7,8}$/.test(cleaned);
|
|
| 657 |
- return valid; |
|
| 658 |
-} |
|
| 659 |
- |
|
| 660 |
- |
|
| 661 |
- |
|
| 662 |
- |
|
| 663 |
-// 상단 설명 더보기 |
|
| 664 |
-function popMore(e){
|
|
| 665 |
- $(e).closest(".pop_more_cont").toggleClass("pop_more_click");
|
|
| 666 |
- |
|
| 667 |
- if($(e).closest(".pop_more_cont").is(".pop_more_click")){
|
|
| 668 |
- $(e).html('숨기기');
|
|
| 669 |
- $(e).append('<i></i>');
|
|
| 670 |
- }else {
|
|
| 671 |
- $(e).html('더보기');
|
|
| 672 |
- $(e).append('<i></i>');
|
|
| 673 |
- } |
|
| 674 |
-} |
|
| 675 |
- |
|
| 676 |
- |
|
| 677 |
- |
|
| 678 |
- |
|
| 679 |
-</script> |
|
| 680 |
- |
|
| 681 |
-<!-- 중복전화번호 data-tooltip:addrMassDupli_layer --> |
|
| 682 |
-<div class="tooltip-wrap"> |
|
| 683 |
- <div class="popup-com addrMassDupli_layer" tabindex="0" data-tooltip-con="addrMassDupli_layer" data-focus="addrMassDupli_layer" data-focus-prev="addrMassDupli_layer-close" style="width: 270px; height: 500px;"> |
|
| 684 |
- <div class="popup_heading"> |
|
| 685 |
- <p>중복 휴대폰번호</p> |
|
| 686 |
- <button type="button" class="tooltip-close" data-focus="addrMassDupli_layer-close" onclick="setAddrDupliClose();"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> |
|
| 687 |
- </div> |
|
| 688 |
- <div class="layer_in" style="padding:20px 0px;" id="addrMassDupli_layer"> |
|
| 689 |
- </div> |
|
| 690 |
- |
|
| 691 |
- <div class="popup_btn_wrap2" style="margin-top: 0px;"> |
|
| 692 |
- <button type="button" class="tooltip-close" data-focus="addrMassDupli_layer-close" data-focus-next="addrMassDupli_layer">닫기</button> |
|
| 693 |
- </div> |
|
| 694 |
- |
|
| 695 |
- </div> |
|
| 696 |
-</div> |
|
| 697 |
- |
|
| 698 |
- |
|
| 699 |
-<!-- 주소록 상세 결과 팝업 data-tooltip:adr_popup14 --> |
|
| 700 |
- <div class="tooltip-wrap"> |
|
| 701 |
- <div class="popup-com adr_layer adr_popup14" tabindex="0" data-tooltip-con="adr_popup14" data-focus="adr_popup14" data-focus-prev="adr_popu14-close" style="width: 450px;"> |
|
| 702 |
- <div class="popup_heading"> |
|
| 703 |
- <p>주소록 상세 결과</p> |
|
| 704 |
- <button type="button" class="tooltip-close" data-focus="adr_popup14-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> |
|
| 705 |
- </div> |
|
| 706 |
- <div class="layer_in" style="padding:30px 20px;"> |
|
| 707 |
- <div class="table_top"> |
|
| 708 |
- <p> |
|
| 709 |
- 총 <span class="c_e40000" id="errorPopTotCnt">0</span>건 |
|
| 710 |
- / 중복 <span class="c_002c9a" id="errorPopDupCnt">0</span>건 |
|
| 711 |
- / 오류 <span class="c_002c9a" id="errorPopErrorCnt">0</span>건</p> |
|
| 712 |
- <button type="button" class="excel_btn btnType" id="errorExcelBtn"><i class="downroad"></i>엑셀 다운로드</button> |
|
| 713 |
- </div> |
|
| 714 |
- <div class="tb_wrap adr_list" id="tabulator_error"> |
|
| 715 |
- <!-- $tableError 참고 --> |
|
| 716 |
- </div> |
|
| 717 |
- <ul class="cf_text_ul"> |
|
| 718 |
- <li>*중복번호는 하나의 번호만 등록됩니다.</li> |
|
| 719 |
- <li>*휴대폰 형식에 맞지 않는 데이터는 삭제 후 업로드 됩니다.</li> |
|
| 720 |
- <li>ex) 발송불가 특수문자, 자릿수 오류 등</li> |
|
| 721 |
- </ul> |
|
| 722 |
- <div class="popup_btn_wrap2"> |
|
| 723 |
-<!-- <button type="button">저장</button> --> |
|
| 724 |
- <button type="button" class="tooltip-close" data-focus="adr_popup14-close" data-focus-next="adr_popup14">닫기</button> |
|
| 725 |
- </div> |
|
| 726 |
- </div> |
|
| 727 |
- </div> |
|
| 728 |
- </div> |
|
| 729 |
- |
|
| 730 |
-<!--// 중복전화번호 팝업 --> |
|
| 731 |
- <div class="popup_heading"> |
|
| 732 |
- <p>엑셀 불러오기</p> |
|
| 733 |
- <button type="button" class="tooltip-close" id="closeBtn" data-focus="popup02-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> |
|
| 734 |
- </div> |
|
| 735 |
- <div class="layer_in" style="padding: 25px 30px;"> |
|
| 736 |
-<!-- <div class="list_tab_wrap2"> --> |
|
| 737 |
- <!-- tab button --> |
|
| 738 |
-<!-- <ul class="list_tab" id="tbTabl"> --> |
|
| 739 |
-<!-- <li class="tab active" data-tabul="tableExcel"><button type="button" onclick="popupTab(this,'1'); fn_tabToggle('1');">엑셀입력</button></li> -->
|
|
| 740 |
-<!-- <li class="tab" data-tabul="tableClip"><button type="button" onclick="popupTab(this,'2'); fn_tabToggle('2');">붙여넣기</button></li> -->
|
|
| 741 |
-<!-- <li class="tab" data-tabul="tableSelf"><button type="button" onclick="popupTab(this,'3'); fn_tabToggle('3');">직접입력</button></li> -->
|
|
| 742 |
-<!-- </ul>// tab button --> |
|
| 743 |
-<!-- </div> --> |
|
| 744 |
- <!-- 엑셀입력 --> |
|
| 745 |
- <div class="popCont current pop_more_cont" id="popCont_1"> |
|
| 746 |
- <div class="titBox"> |
|
| 747 |
- <p>- 주소록은 한 번에 최대 30만건까지 등록(EXCEL파일, 최대용량 20MB) 가능합니다. </p> |
|
| 748 |
- <p>- 엑셀 파일에 비밀번호 설정, 제한된 보기, 수식 등이 설정되어 있는 경우 업로드가 불가합니다.</p> |
|
| 749 |
- <p>- 구분선(|), 역슬래시(\, ₩), 큰따옴표(") 등 발송불가 특수문자는 저장되지 않습니다.</p>
|
|
| 750 |
- <p>- 이름 200byte, [*1*]~[*4*] 200byte, 메모 250byte까지 입력 가능합니다.</p> |
|
| 751 |
- <p>- 주소록 등록이 어려우신 경우에는 <a href="<c:url value='/web/mjon/addragency/selectAddrAgencyList.do'/>" style="font-weight: bold; color: blue;">주소록 입력대행</a> 메뉴를 이용하실 수 있습니다. </p> |
|
| 752 |
- </div> |
|
| 753 |
- <div class="pop_more_wrap"> |
|
| 754 |
- <button type="button" class="pop_more" onclick="popMore(this);">더보기<i></i></button> |
|
| 755 |
- </div> |
|
| 756 |
- </div><!--// 엑셀입력 --> |
|
| 757 |
- |
|
| 758 |
- <!-- 공통 --> |
|
| 759 |
- <div> |
|
| 760 |
- <table class="layer_tType1"> |
|
| 761 |
- <caption>엑셀입력 표</caption> |
|
| 762 |
- <colgroup> |
|
| 763 |
- <col style="width: 95px"> |
|
| 764 |
- <col style="width: auto"> |
|
| 765 |
- </colgroup> |
|
| 766 |
- <tbody> |
|
| 767 |
- <tr> |
|
| 768 |
- <!-- <th>그룹 선택</th> |
|
| 769 |
- <td> |
|
| 770 |
- <label for="" class="label">그룹 선택</label> |
|
| 771 |
- <select id="addrGrpIdInfo" name="addrGrpIdInfo"> |
|
| 772 |
- </select> |
|
| 773 |
- <label for="" class="label">그룹명 입력</label> |
|
| 774 |
- <input type="text" id="addrGrpNm" name="addrGrpNm" placeholder="새 그룹명을 입력해주세요." onfocus="this.placeholder=''" onblur="this.placeholder='새 그룹명을 입력해주세요.'"class="inputLight" style="width: 300px;"> |
|
| 775 |
- <input type="file" id="excelFile" accept=".xls, .xlsx, .txt" style="display:none"/> |
|
| 776 |
- <button type="button" class="excel_btn2 btnType c3"><i class="uproad"></i>엑셀, TXT파일 업로드</button> |
|
| 777 |
- </td> --> |
|
| 778 |
- <td colspan="2" style="padding:20px 0;"> |
|
| 779 |
- <div class="file_upload_wrap" style="width:100%;display:flex;"> |
|
| 780 |
- <div class="file_add upload_area"> |
|
| 781 |
- <p><img src="/publish/images/content/file_add.png" alt="파일 붙여넣기">마우스로 엑셀, TXT파일을 여기에 끌어다 놓으세요</p> |
|
| 782 |
- </div> |
|
| 783 |
- <input type="file" id="excelFile" accept=".xls, .xlsx, .txt" style="display:none"/> |
|
| 784 |
- <button type="button" class="excel_btn2 btnType c3"><i class="uproad"></i>엑셀, TXT파일 업로드</button> |
|
| 785 |
- </div> |
|
| 786 |
- </td> |
|
| 787 |
- </tr> |
|
| 788 |
- </tbody> |
|
| 789 |
- </table> |
|
| 790 |
- </div> |
|
| 791 |
- |
|
| 792 |
- |
|
| 793 |
- <div class="excel_middle2"> |
|
| 794 |
- <p> |
|
| 795 |
- 총 <span class="c_e40000 fwBold" id="excelRowTotCnt">0</span>건 |
|
| 796 |
- / 중복 <span class="c_002c9a fwBold" id="excelRowDupCnt">0</span>건 |
|
| 797 |
- / 오류 <span class="c_002c9a fwBold" id="excelRowErrorCnt">0</span>건 |
|
| 798 |
- <button type="button" class="btn_list_detail" data-tooltip="adr_popup14"><img src="/publish/images/search.png"></button> |
|
| 799 |
- </p> |
|
| 800 |
-<!-- --> |
|
| 801 |
-<!-- <button type="button" class="btnType btnType6" data-tooltip="addrMassDupli_layer" id="tableExcelDupliBtn">중복번호</button> --> |
|
| 802 |
-<!-- --> |
|
| 803 |
-<!-- <button type="button" class="btnType btnType6" data-tooltip="addrMassSaveDupli_layer" onclick="GetAddrMassSaveDupli()" id="btnAddrMassSaveDupli">중복번호</button> --> |
|
| 804 |
- </p> |
|
| 805 |
-<!-- <button type="button" class="btnType btnType6 addCallToF">번호추가</button> --> |
|
| 806 |
- </div> |
|
| 807 |
- |
|
| 808 |
- |
|
| 809 |
- |
|
| 810 |
- |
|
| 811 |
- <div class="adr_excel" style="margin-top: 13px; overflow-x:auto;"> |
|
| 812 |
-<!-- <div class="adr_excel" style="margin-top: 13px;"> --> |
|
| 813 |
- <!-- thead --> |
|
| 814 |
- <div class="adr_hd select_adr_hd" data-group="tableExcel"> |
|
| 815 |
- <div style="width: 100px;"></div> |
|
| 816 |
- <div style="width: 140px;"> |
|
| 817 |
- <label for="" class="label"></label> |
|
| 818 |
- <select class="field-selector"> |
|
| 819 |
- <option value="">선택하기</option> |
|
| 820 |
- <option value="addrNm">이름</option> |
|
| 821 |
- <option value="addrPhoneNo">휴대폰</option> |
|
| 822 |
- <option value="addrInfo1">[*1*]</option> |
|
| 823 |
- <option value="addrInfo2">[*2*]</option> |
|
| 824 |
- <option value="addrInfo3">[*3*]</option> |
|
| 825 |
- <option value="addrInfo4">[*4*]</option> |
|
| 826 |
-<!-- <option value="addrComment">메모</option> --> |
|
| 827 |
- </select> |
|
| 828 |
- </div> |
|
| 829 |
- <div style="width: 140px;"> |
|
| 830 |
- <label for="" class="label"></label> |
|
| 831 |
- <select class="field-selector"> |
|
| 832 |
- <option value="">선택하기</option> |
|
| 833 |
- <option value="addrNm">이름</option> |
|
| 834 |
- <option value="addrPhoneNo">휴대폰</option> |
|
| 835 |
- <option value="addrInfo1">[*1*]</option> |
|
| 836 |
- <option value="addrInfo2">[*2*]</option> |
|
| 837 |
- <option value="addrInfo3">[*3*]</option> |
|
| 838 |
- <option value="addrInfo4">[*4*]</option> |
|
| 839 |
-<!-- <option value="addrComment">메모</option> --> |
|
| 840 |
- </select> |
|
| 841 |
- </div> |
|
| 842 |
- <div style="width: 140px;"> |
|
| 843 |
- <label for="" class="label"></label> |
|
| 844 |
- <select class="field-selector"> |
|
| 845 |
- <option value="">선택하기</option> |
|
| 846 |
- <option value="addrNm">이름</option> |
|
| 847 |
- <option value="addrPhoneNo">휴대폰</option> |
|
| 848 |
- <option value="addrInfo1">[*1*]</option> |
|
| 849 |
- <option value="addrInfo2">[*2*]</option> |
|
| 850 |
- <option value="addrInfo3">[*3*]</option> |
|
| 851 |
- <option value="addrInfo4">[*4*]</option> |
|
| 852 |
-<!-- <option value="addrComment">메모</option> --> |
|
| 853 |
- </select> |
|
| 854 |
- </div> |
|
| 855 |
- <div style="width: 140px;"> |
|
| 856 |
- <label for="" class="label"></label> |
|
| 857 |
- <select class="field-selector"> |
|
| 858 |
- <option value="">선택하기</option> |
|
| 859 |
- <option value="addrNm">이름</option> |
|
| 860 |
- <option value="addrPhoneNo">휴대폰</option> |
|
| 861 |
- <option value="addrInfo1">[*1*]</option> |
|
| 862 |
- <option value="addrInfo2">[*2*]</option> |
|
| 863 |
- <option value="addrInfo3">[*3*]</option> |
|
| 864 |
- <option value="addrInfo4">[*4*]</option> |
|
| 865 |
-<!-- <option value="addrComment">메모</option> --> |
|
| 866 |
- </select> |
|
| 867 |
- </div> |
|
| 868 |
- <div style="width: 140px;"> |
|
| 869 |
- <label for="" class="label"></label> |
|
| 870 |
- <select class="field-selector"> |
|
| 871 |
- <option value="">선택하기</option> |
|
| 872 |
- <option value="addrNm">이름</option> |
|
| 873 |
- <option value="addrPhoneNo">휴대폰</option> |
|
| 874 |
- <option value="addrInfo1">[*1*]</option> |
|
| 875 |
- <option value="addrInfo2">[*2*]</option> |
|
| 876 |
- <option value="addrInfo3">[*3*]</option> |
|
| 877 |
- <option value="addrInfo4">[*4*]</option> |
|
| 878 |
-<!-- <option value="addrComment">메모</option> --> |
|
| 879 |
- </select> |
|
| 880 |
- </div> |
|
| 881 |
- <div style="width: 140px;"> |
|
| 882 |
- <label for="" class="label"></label> |
|
| 883 |
- <select class="field-selector"> |
|
| 884 |
- <option value="">선택하기</option> |
|
| 885 |
- <option value="addrNm">이름</option> |
|
| 886 |
- <option value="addrPhoneNo">휴대폰</option> |
|
| 887 |
- <option value="addrInfo1">[*1*]</option> |
|
| 888 |
- <option value="addrInfo2">[*2*]</option> |
|
| 889 |
- <option value="addrInfo3">[*3*]</option> |
|
| 890 |
- <option value="addrInfo4">[*4*]</option> |
|
| 891 |
-<!-- <option value="addrComment">메모</option> --> |
|
| 892 |
- </select> |
|
| 893 |
- </div> |
|
| 894 |
- <!-- <div style="width: 125px;"> |
|
| 895 |
- <label for="" class="label"></label> |
|
| 896 |
- <select class="field-selector"> |
|
| 897 |
- <option value="">선택하기</option> |
|
| 898 |
- <option value="addrNm">이름</option> |
|
| 899 |
- <option value="addrPhoneNo">휴대폰</option> |
|
| 900 |
- <option value="addrInfo1">[*1*]</option> |
|
| 901 |
- <option value="addrInfo2">[*2*]</option> |
|
| 902 |
- <option value="addrInfo3">[*3*]</option> |
|
| 903 |
- <option value="addrInfo4">[*4*]</option> |
|
| 904 |
- <option value="addrComment">메모</option> |
|
| 905 |
- </select> |
|
| 906 |
- </div> --> |
|
| 907 |
- </div> |
|
| 908 |
- </div> |
|
| 909 |
- |
|
| 910 |
- <div class="drag_drop_wrap callList_includ_box" id="tabulator_excel"> |
|
| 911 |
-<!-- <img src="/publish/images/content/excel.jpg" style="width: 100%;"> --> |
|
| 912 |
- </div> |
|
| 913 |
- <div class="excel_middle"> |
|
| 914 |
- <div class="select_btnWrap clearfix"> |
|
| 915 |
- <div> |
|
| 916 |
- <button type="button" id="allDel"><i class="remove_img"></i>전체삭제</button> |
|
| 917 |
- <button type="button" id="in_select_del"><i class="remove_img"></i>선택삭제</button> |
|
| 918 |
- </div> |
|
| 919 |
- |
|
| 920 |
- </div> |
|
| 921 |
- </div><!--// 공통 --> |
|
| 922 |
- |
|
| 923 |
- <!-- 붙여놓기 설명 --> |
|
| 924 |
-<!-- <div class="req_area"> --> |
|
| 925 |
-<!-- <div class="text_box"> --> |
|
| 926 |
-<!-- - 휴대폰 번호가 입력된 txt 파일을 열어 복사(Ctrl+c) + 붙여넣기(Ctrl+v)로도 입력하실 수 있습니다.<br> --> |
|
| 927 |
-<!-- - 휴대폰 번호는 필수입력 항목입니다.<br> --> |
|
| 928 |
-<!-- - 이름,휴대폰 번호,[*1*],[*2*],[*3*],[*4*],메모 순서대로 입력해주세요.(예 : 010-1234-5678,홍길동,변수1…메모)<br> --> |
|
| 929 |
-<!-- - 이름은 24byte, [*1*]~[*4*] 40byte, 메모는 250byte까지 입력 가능합니다.<br> --> |
|
| 930 |
-<!-- - '오류 검사'를 통해 등록된 데이터에 전화번호 입력 오류를 확인하실 수 있습니다. --> |
|
| 931 |
-<!-- </div> --> |
|
| 932 |
-<!-- </div> --> |
|
| 933 |
- <div class="popup_btn_wrap2" style="margin: 0 auto 30px auto;"> |
|
| 934 |
- <button type="button" id="btnAddrMassReg">추가</button> |
|
| 935 |
- <button type="button" id="btnAddrMassClose" class="tooltip-close" data-focus="adr_popup01-close" data-focus-next="popup02">닫기</button> |
|
| 936 |
- </div> |
|
| 937 |
- |
|
| 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 |
+ |
|
| 7 |
+<script type="text/javascript" src="<c:url value='/publish/js/content.js'/>"></script> |
|
| 8 |
+ |
|
| 9 |
+<script type="text/javascript"> |
|
| 10 |
+ |
|
| 11 |
+var $tableExcel = null; //엑셀입력 탭 |
|
| 12 |
+var $tableError = null; //엑셀입력 탭 |
|
| 13 |
+$(document).ready(function(){
|
|
| 14 |
+ |
|
| 15 |
+ //Tabulator AJAX Data Loading |
|
| 16 |
+ $tableError = new Tabulator("#tabulator_error", {
|
|
| 17 |
+ height:"255px", |
|
| 18 |
+ width:"100%", |
|
| 19 |
+ layout:"fitColumns", |
|
| 20 |
+ autoColumns:false, |
|
| 21 |
+ headerHozAlign:"center", |
|
| 22 |
+ validationMode:"highlight", |
|
| 23 |
+ clipboard:false, |
|
| 24 |
+ clipboardCopySelector:"table", |
|
| 25 |
+ clipboardPasteAction:"insert", // insert, update, replace |
|
| 26 |
+ placeholder:"등록 팝업에서 휴대폰을 선택 후 확인해주세요.", //fit columns to width of table (optional) |
|
| 27 |
+ columns:[ //Define Table Columns |
|
| 28 |
+ {title:"이름", field:"name", hozAlign:"center", headerHozAlign: "center", width:125},
|
|
| 29 |
+ {title:"휴대폰", field:"phone", hozAlign:"center", headerHozAlign: "center", width:158},
|
|
| 30 |
+ {title:"미등록 결과", field:"result", hozAlign:"center", headerHozAlign: "center", width:125}
|
|
| 31 |
+ ] |
|
| 32 |
+ }); |
|
| 33 |
+ |
|
| 34 |
+ |
|
| 35 |
+ //Tabulator AJAX Data Loading |
|
| 36 |
+ $tableExcel = new Tabulator("#tabulator_excel", {
|
|
| 37 |
+ height:"255px", |
|
| 38 |
+ width:"100%", |
|
| 39 |
+ layout:"fitColumns", |
|
| 40 |
+ autoColumns:false, |
|
| 41 |
+ headerHozAlign:"center", |
|
| 42 |
+ validationMode:"highlight", |
|
| 43 |
+ clipboard:false, |
|
| 44 |
+ clipboardCopySelector:"table", |
|
| 45 |
+ clipboardPasteAction:"insert", // insert, update, replace |
|
| 46 |
+ placeholder:"Excel 파일을 업로드 해주세요.", //fit columns to width of table (optional) |
|
| 47 |
+ columns:[ //Define Table Columns |
|
| 48 |
+ {formatter:"rowSelection", titleFormatter:"rowSelection",clipboard:false, headerHozAlign:"center", hozAlign:"center", headerSort:false, cellClick:function(e, cell){
|
|
| 49 |
+ cell.getRow().toggleSelect(); |
|
| 50 |
+ } |
|
| 51 |
+ }, |
|
| 52 |
+ {formatter:"rownum", align:"center" ,title:"No", hozAlign:"center", headerHozAlign:"center", width:40},
|
|
| 53 |
+ {title:"A", field:"A", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
|
| 54 |
+ {title:"B", field:"B", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
|
| 55 |
+ {title:"C", field:"C", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
|
| 56 |
+ {title:"D", field:"D", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
|
| 57 |
+ {title:"E", field:"E", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
|
| 58 |
+ {title:"F", field:"F", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]}
|
|
| 59 |
+ ], |
|
| 60 |
+ validationFailed:function(cell, value, parameters){ // 유효성 체크 함수
|
|
| 61 |
+ var valid = cell.isValid(); |
|
| 62 |
+ if(!valid){
|
|
| 63 |
+ alert("양식에 맞지 않는 정보가 입력되었습니다.");
|
|
| 64 |
+ |
|
| 65 |
+ //해당 셀 데이터 삭제 |
|
| 66 |
+ cell.setValue("");
|
|
| 67 |
+ } |
|
| 68 |
+ return value % parameters.phone; |
|
| 69 |
+ }, |
|
| 70 |
+ }); |
|
| 71 |
+ |
|
| 72 |
+ |
|
| 73 |
+ |
|
| 74 |
+ |
|
| 75 |
+ // 타뷸레이터 width값 변경 시 위에 select width 값 변경 |
|
| 76 |
+ var titleArray = ["A","B","C","D","E","F"]; |
|
| 77 |
+ |
|
| 78 |
+ $tableExcel.on("columnWidth",function(column){
|
|
| 79 |
+ var titleIndex = titleArray.indexOf(column._column.definition.title); |
|
| 80 |
+ titleIndex += 1; |
|
| 81 |
+ if(titleIndex != 0){
|
|
| 82 |
+ $('.select_adr_hd>div').eq(titleIndex).css('width', column._column.width);
|
|
| 83 |
+ }else{
|
|
| 84 |
+ $('.select_adr_hd>div').eq(0).css('width', column._column.width + 40);
|
|
| 85 |
+ } |
|
| 86 |
+ }); |
|
| 87 |
+ |
|
| 88 |
+ $tableExcel.on("scrollHorizontal",function(left){
|
|
| 89 |
+ $(".adr_excel").scrollLeft(left);
|
|
| 90 |
+ }) |
|
| 91 |
+ |
|
| 92 |
+ |
|
| 93 |
+ $(".adr_excel").on("scroll",function(){
|
|
| 94 |
+ $(".tabulator-tableholder").scrollLeft($(this).scrollLeft());
|
|
| 95 |
+ }); |
|
| 96 |
+ |
|
| 97 |
+ |
|
| 98 |
+ |
|
| 99 |
+ |
|
| 100 |
+ $("#excelFile").on("change", function(event) {
|
|
| 101 |
+ var fileInfo = event.target.files; |
|
| 102 |
+ if(fileInfo.length > 0){
|
|
| 103 |
+ excelFileChange(fileInfo[0]); |
|
| 104 |
+ } else {
|
|
| 105 |
+ fn_loadRemoveActive(); // 파일이 선택되지 않은 경우 로딩 상태 제거 |
|
| 106 |
+ setTimeout(() => { $(this).val(''); }, 0); // 파일 선택 초기화
|
|
| 107 |
+ } |
|
| 108 |
+ }); |
|
| 109 |
+ |
|
| 110 |
+ |
|
| 111 |
+ |
|
| 112 |
+ $(document).on('click', '#btnAddrMassClose', function() {
|
|
| 113 |
+ |
|
| 114 |
+ $('.field-selector').each(function() { $(this).val(''); });
|
|
| 115 |
+ setAddrMassClose(); |
|
| 116 |
+ }); |
|
| 117 |
+ |
|
| 118 |
+ |
|
| 119 |
+ $(document).on('click', '#closeBtn', function() {
|
|
| 120 |
+ // 대량등록 닫기 |
|
| 121 |
+ setAddrMassClose(); |
|
| 122 |
+ }); |
|
| 123 |
+ |
|
| 124 |
+ |
|
| 125 |
+ |
|
| 126 |
+ |
|
| 127 |
+ // 엑셀등록 닫기 |
|
| 128 |
+ function setAddrMassClose() {
|
|
| 129 |
+ $tableExcel.clearData(); |
|
| 130 |
+ $("#excelRowTotCnt").text(0); //총건수 수정
|
|
| 131 |
+ $("#excelRowDupCnt").text(0); //중복건수 수정
|
|
| 132 |
+ $("#excelRowErrorCnt").text(0); //중복건수 수정
|
|
| 133 |
+ dupliPhoneDataRealList.length = 0; // 중복 휴대폰번호 초기화 |
|
| 134 |
+ addrMassDupliSaveList = null; |
|
| 135 |
+ |
|
| 136 |
+ |
|
| 137 |
+ // popup 영역 |
|
| 138 |
+ $tableError.clearData(); |
|
| 139 |
+ // 중복 카운트 |
|
| 140 |
+ $("#errorPopDupCnt").text(0);
|
|
| 141 |
+ // 에러 카운트 |
|
| 142 |
+ $("#errorPopErrorCnt").text(0);
|
|
| 143 |
+ // |
|
| 144 |
+ $("#errorPopTotCnt").text(0);
|
|
| 145 |
+ |
|
| 146 |
+ |
|
| 147 |
+ } |
|
| 148 |
+ |
|
| 149 |
+ //############################################################################################# |
|
| 150 |
+ //파일업로드 드래그앤 드롭 |
|
| 151 |
+ //############################################################################################# |
|
| 152 |
+ var objDragAndDrop = $(".upload_area");
|
|
| 153 |
+ $(document).on("dragenter",".upload_area",function(e){
|
|
| 154 |
+ e.stopPropagation(); |
|
| 155 |
+ e.preventDefault(); |
|
| 156 |
+ //$(this).css('border', '2px solid #0B85A1');
|
|
| 157 |
+ }); |
|
| 158 |
+ $(document).on("dragover",".upload_area",function(e){
|
|
| 159 |
+ e.stopPropagation(); |
|
| 160 |
+ e.preventDefault(); |
|
| 161 |
+ }); |
|
| 162 |
+ $(document).on("drop",".upload_area",function(e){
|
|
| 163 |
+ fn_loadAddActive(); |
|
| 164 |
+ e.preventDefault(); |
|
| 165 |
+ var files = e.originalEvent.dataTransfer.files; |
|
| 166 |
+ excelFileChange(files[0]); |
|
| 167 |
+ }); |
|
| 168 |
+ |
|
| 169 |
+ $(document).on('dragenter', function (e){
|
|
| 170 |
+ e.stopPropagation(); |
|
| 171 |
+ e.preventDefault(); |
|
| 172 |
+ }); |
|
| 173 |
+ $(document).on('dragover', function (e){
|
|
| 174 |
+ e.stopPropagation(); |
|
| 175 |
+ e.preventDefault(); |
|
| 176 |
+ //objDragAndDrop.css('border', '2px dotted #0B85A1');
|
|
| 177 |
+ }); |
|
| 178 |
+ $(document).on('drop', function (e){
|
|
| 179 |
+ e.stopPropagation(); |
|
| 180 |
+ e.preventDefault(); |
|
| 181 |
+ }); |
|
| 182 |
+ //파일 드래그앤드롭 종료 |
|
| 183 |
+ |
|
| 184 |
+ |
|
| 185 |
+ |
|
| 186 |
+ |
|
| 187 |
+ |
|
| 188 |
+ //타이틀 select 선택 이벤트 |
|
| 189 |
+ $('.field-selector').on('change', function() {
|
|
| 190 |
+ fn_loadAddActive(); |
|
| 191 |
+ |
|
| 192 |
+ setTimeout(() => {
|
|
| 193 |
+ var selectedFields = []; |
|
| 194 |
+ var isDuplicate = false; |
|
| 195 |
+ |
|
| 196 |
+ if($tableExcel.getData().length < 1){
|
|
| 197 |
+ alert('데이터 입력 후 선택해 주세요.');
|
|
| 198 |
+ $(this).val("");
|
|
| 199 |
+ fn_loadRemoveActive(); |
|
| 200 |
+ return false; |
|
| 201 |
+ } |
|
| 202 |
+ |
|
| 203 |
+ // 중복체크 |
|
| 204 |
+ $('.field-selector').each(function() {
|
|
| 205 |
+ var selectedField = $(this).val(); |
|
| 206 |
+ if (selectedField) {
|
|
| 207 |
+ if (selectedFields.includes(selectedField)) {
|
|
| 208 |
+ alert("중복된 필드를 선택할 수 없습니다.");
|
|
| 209 |
+ $(this).val(""); // 중복 필드를 선택한 경우 빈 값으로 초기화
|
|
| 210 |
+ isDuplicate = true; |
|
| 211 |
+ return false; // 반복문 종료 |
|
| 212 |
+ } |
|
| 213 |
+ selectedFields.push(selectedField); |
|
| 214 |
+ } |
|
| 215 |
+ }); |
|
| 216 |
+ |
|
| 217 |
+ |
|
| 218 |
+ // |
|
| 219 |
+ updateTableFields($tableExcel); |
|
| 220 |
+ |
|
| 221 |
+ // 필드가 휴대폰이면 열 중복체크 |
|
| 222 |
+ if($(this).val() == 'addrPhoneNo'){
|
|
| 223 |
+ fn_phoneDupl($tableExcel); |
|
| 224 |
+ } |
|
| 225 |
+ fn_loadRemoveActive(); |
|
| 226 |
+ |
|
| 227 |
+ }, 0); // 지연 없이 즉시 실행되도록 0ms 지연을 설정 |
|
| 228 |
+ |
|
| 229 |
+ |
|
| 230 |
+ }); |
|
| 231 |
+ |
|
| 232 |
+ |
|
| 233 |
+ |
|
| 234 |
+ // 받는사람 선택삭제 버튼 처리해주기 |
|
| 235 |
+ $('#in_select_del').click(function(){
|
|
| 236 |
+ |
|
| 237 |
+ if($tableExcel == null || $tableExcel == ""){
|
|
| 238 |
+ |
|
| 239 |
+ alert("받는사람을 추가해 주세요.");
|
|
| 240 |
+ return false; |
|
| 241 |
+ |
|
| 242 |
+ } |
|
| 243 |
+ |
|
| 244 |
+ var selectedData = $tableExcel.getSelectedRows(); |
|
| 245 |
+ |
|
| 246 |
+ if(selectedData == "" || selectedData == null){
|
|
| 247 |
+ |
|
| 248 |
+ alert("삭제할 연락처를 선택해주세요.");
|
|
| 249 |
+ return false; |
|
| 250 |
+ |
|
| 251 |
+ }else{ // 선택한 Row 데이터 삭제하기
|
|
| 252 |
+ |
|
| 253 |
+ if(confirm("선택하신 받는 사람을 삭제하시겠습니까?")){
|
|
| 254 |
+ |
|
| 255 |
+ // 선택 데이터 삭제 |
|
| 256 |
+ selectedData.forEach(row => row.delete()); |
|
| 257 |
+ |
|
| 258 |
+ |
|
| 259 |
+ totRows = $tableExcel.getRows().length; |
|
| 260 |
+ $("#excelRowTotCnt").text(totRows);
|
|
| 261 |
+ |
|
| 262 |
+ |
|
| 263 |
+ } |
|
| 264 |
+ |
|
| 265 |
+ } |
|
| 266 |
+ |
|
| 267 |
+ }); |
|
| 268 |
+ |
|
| 269 |
+ // 추가버튼 |
|
| 270 |
+ $('#btnAddrMassReg').click(function(){
|
|
| 271 |
+ |
|
| 272 |
+ if($tableExcel.getData().length < 1){
|
|
| 273 |
+ alert("한 개 이상의 연락처를 입력하세요");
|
|
| 274 |
+ return false; |
|
| 275 |
+ } |
|
| 276 |
+// else if (selectedData.length > 20000) {
|
|
| 277 |
+// alert("2만줄 이상의 업로드는 데이터 부하로 업로드 할수 없습니다.");
|
|
| 278 |
+// return false; |
|
| 279 |
+// } |
|
| 280 |
+ |
|
| 281 |
+ |
|
| 282 |
+ // tableExcel 그룹의 select 요소들을 확인 |
|
| 283 |
+// var isPhoneSelected = false; |
|
| 284 |
+// var isNameSelected = false; |
|
| 285 |
+ var columns = $tableExcel.getColumns(); |
|
| 286 |
+ var isAddrPhoneNoSelected = columns.some(column => column.getField() === 'addrPhoneNo'); |
|
| 287 |
+ |
|
| 288 |
+ if (!isAddrPhoneNoSelected) {
|
|
| 289 |
+// isPhoneSelected = true; |
|
| 290 |
+ alert('휴대폰이 선택되지 않았습니다.');
|
|
| 291 |
+ return false; |
|
| 292 |
+ |
|
| 293 |
+ } |
|
| 294 |
+ |
|
| 295 |
+ var addrData = $tableExcel.getData().map((row, index) => ({
|
|
| 296 |
+ name: row.addrNm, |
|
| 297 |
+ phone: removeDash(row.addrPhoneNo), |
|
| 298 |
+ rep1: row.addrInfo1, |
|
| 299 |
+ rep2: row.addrInfo2, |
|
| 300 |
+ rep3: row.addrInfo3, |
|
| 301 |
+ rep4: row.addrInfo4, |
|
| 302 |
+ })); |
|
| 303 |
+ |
|
| 304 |
+ |
|
| 305 |
+ |
|
| 306 |
+ |
|
| 307 |
+ |
|
| 308 |
+ |
|
| 309 |
+ // 기존 tableL의 데이터를 가져옵니다. |
|
| 310 |
+ var existingData = tableL.getData(); |
|
| 311 |
+ // 기존 데이터와 새로운 데이터를 합칩니다. |
|
| 312 |
+ var combinedData = existingData.concat(addrData); |
|
| 313 |
+ // 합쳐진 데이터를 tableL에 설정합니다. |
|
| 314 |
+ tableL.setData(combinedData); |
|
| 315 |
+ |
|
| 316 |
+ // 미리보기 버튼 활성화 |
|
| 317 |
+ updateButtons(0); |
|
| 318 |
+ |
|
| 319 |
+ var totRows = tableL.getRows().length; |
|
| 320 |
+ updateTotCnt(totRows); //전체 데이터 갯수 구하기 |
|
| 321 |
+ console.log('totRows : ', totRows);
|
|
| 322 |
+ var smsTxtArea = $('#smsTxtArea').val();
|
|
| 323 |
+ if(smsTxtArea.indexOf("[*이름*]") > -1
|
|
| 324 |
+ || smsTxtArea.indexOf("[*1*]") > -1
|
|
| 325 |
+ || smsTxtArea.indexOf("[*2*]") > -1
|
|
| 326 |
+ || smsTxtArea.indexOf("[*3*]") > -1
|
|
| 327 |
+ || smsTxtArea.indexOf("[*4*]") > -1){
|
|
| 328 |
+ |
|
| 329 |
+ fnReplCell(); |
|
| 330 |
+ |
|
| 331 |
+ }else{
|
|
| 332 |
+ |
|
| 333 |
+ //결제 금액 구하기 |
|
| 334 |
+ totalPriceSum(totRows); |
|
| 335 |
+ |
|
| 336 |
+ } |
|
| 337 |
+ |
|
| 338 |
+ setAddrMassClose(); |
|
| 339 |
+ $('.field-selector').each(function() { $(this).val(''); });
|
|
| 340 |
+ $('#closeBtn').click();
|
|
| 341 |
+ }); |
|
| 342 |
+ |
|
| 343 |
+ |
|
| 344 |
+ |
|
| 345 |
+ //받는사람 전체삭제 버튼 처리 |
|
| 346 |
+ $('#allDel').click(function(){
|
|
| 347 |
+ var data = $tableExcel.getRows(); |
|
| 348 |
+ $tableExcel.clearData(); |
|
| 349 |
+ $("#excelRowTotCnt").text(0); //총건수 수정
|
|
| 350 |
+ $("#excelRowDupCnt").text(0); //중복건수 수정
|
|
| 351 |
+ dupliPhoneDataRealList.length = 0; // 중복 휴대폰번호 초기화 |
|
| 352 |
+ |
|
| 353 |
+ // select box 초기화 |
|
| 354 |
+ $('.field-selector').each(function() { $(this).val(''); });
|
|
| 355 |
+ |
|
| 356 |
+ }); |
|
| 357 |
+ |
|
| 358 |
+ |
|
| 359 |
+ |
|
| 360 |
+}); |
|
| 361 |
+ |
|
| 362 |
+ |
|
| 363 |
+ |
|
| 364 |
+function excelFileChange(file) {
|
|
| 365 |
+ if (file) {
|
|
| 366 |
+ |
|
| 367 |
+ // 파일 크기 체크 (20MB) |
|
| 368 |
+ const maxSize = 20 * 1024 * 1024; // 20MB in bytes |
|
| 369 |
+ if (file.size > maxSize) {
|
|
| 370 |
+ alert('파일 크기는 20MB를 초과할 수 없습니다.');
|
|
| 371 |
+ return; |
|
| 372 |
+ } |
|
| 373 |
+ |
|
| 374 |
+ fn_loadAddActive(); |
|
| 375 |
+ var reader = new FileReader(); |
|
| 376 |
+ var extension = file.name.split('.').pop().toLowerCase();
|
|
| 377 |
+ reader.onload = function(e) {
|
|
| 378 |
+ setTimeout(() => { // 파일 읽기 완료 후 실행되도록 함
|
|
| 379 |
+ if (extension === 'xlsx') {
|
|
| 380 |
+ var data = new Uint8Array(e.target.result); |
|
| 381 |
+ var workbook = XLSX.read(data, {type: 'array'});
|
|
| 382 |
+ var firstSheet = workbook.Sheets[workbook.SheetNames[0]]; |
|
| 383 |
+ var jsonData = XLSX.utils.sheet_to_json(firstSheet, {header: 1});
|
|
| 384 |
+ processExcelData(jsonData); |
|
| 385 |
+ } else if (extension === 'txt') {
|
|
| 386 |
+ var textData = e.target.result; |
|
| 387 |
+ processTextData(textData); |
|
| 388 |
+ } else {
|
|
| 389 |
+ alert('지원되지 않는 파일 형식입니다.');
|
|
| 390 |
+ } |
|
| 391 |
+ fn_loadRemoveActive(); |
|
| 392 |
+ }, 0); // 지연 없이 즉시 실행되도록 0ms 지연을 설정 |
|
| 393 |
+ }; |
|
| 394 |
+ if (extension === 'xlsx') {
|
|
| 395 |
+ reader.readAsArrayBuffer(file); |
|
| 396 |
+ } else if (extension === 'txt') {
|
|
| 397 |
+ reader.readAsText(file); |
|
| 398 |
+ } |
|
| 399 |
+ } |
|
| 400 |
+} |
|
| 401 |
+ |
|
| 402 |
+ |
|
| 403 |
+// 엑셀 데이터 처리 함수 |
|
| 404 |
+function processExcelData(data) {
|
|
| 405 |
+ var keys = ['A', 'B', 'C', 'D', 'E', 'F', 'G']; |
|
| 406 |
+ var tableData = []; |
|
| 407 |
+ var totalRows = data.length - 2; // 전체 데이터 수 (1, 2행 제외) |
|
| 408 |
+ |
|
| 409 |
+ |
|
| 410 |
+ // 3번째 행부터 입력 |
|
| 411 |
+ data.slice(0).forEach((row, index) => {
|
|
| 412 |
+ var rowData = {};
|
|
| 413 |
+ keys.forEach((key, idx) => { // index 변수명 변경 (내부와 외부에서 사용되므로 충돌 방지)
|
|
| 414 |
+// console.log('row[idx] : ', row[idx]);
|
|
| 415 |
+// rowData[key] = row[idx] ? row[idx].trim() : ""; // 각 컬럼에 대해 기본값을 설정 |
|
| 416 |
+ rowData[key] = (typeof row[idx] === 'string') ? row[idx].trim() : row[idx]; |
|
| 417 |
+ }); |
|
| 418 |
+ tableData.push(rowData); |
|
| 419 |
+ |
|
| 420 |
+ }); |
|
| 421 |
+ |
|
| 422 |
+ updateTable(tableData); |
|
| 423 |
+} |
|
| 424 |
+ |
|
| 425 |
+ |
|
| 426 |
+// 텍스트 데이터 처리 함수 |
|
| 427 |
+function processTextData(text) {
|
|
| 428 |
+ var lines = text.split('\n'); // 각 줄을 배열로 분리
|
|
| 429 |
+ var keys = ['A', 'B', 'C', 'D', 'E', 'F', 'G']; |
|
| 430 |
+ var tableData = []; |
|
| 431 |
+ |
|
| 432 |
+ lines.forEach(line => {
|
|
| 433 |
+ var rowData = {};
|
|
| 434 |
+ var row = line.split(','); // 쉼표로 분리
|
|
| 435 |
+ keys.forEach((key, index) => {
|
|
| 436 |
+ rowData[key] = row[index] ? row[index].trim() : ""; // 각 컬럼에 대해 기본값을 설정 |
|
| 437 |
+ }); |
|
| 438 |
+ tableData.push(rowData); |
|
| 439 |
+ }); |
|
| 440 |
+ |
|
| 441 |
+ updateTable(tableData); |
|
| 442 |
+} |
|
| 443 |
+ |
|
| 444 |
+//공통 테이블 업데이트 함수 |
|
| 445 |
+function updateTable(tableData) {
|
|
| 446 |
+ $tableExcel.setColumns([ //Define Table Columns |
|
| 447 |
+ {formatter:"rowSelection", titleFormatter:"rowSelection",clipboard:false, headerHozAlign:"center", hozAlign:"center", headerSort:false, cellClick:function(e, cell){
|
|
| 448 |
+ cell.getRow().toggleSelect(); |
|
| 449 |
+ } |
|
| 450 |
+ }, |
|
| 451 |
+ {formatter:"rownum", align:"center" ,title:"No", hozAlign:"center", headerHozAlign:"center", width:60},
|
|
| 452 |
+ {title:"A", field:"A", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
|
| 453 |
+ {title:"B", field:"B", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
|
| 454 |
+ {title:"C", field:"C", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
|
| 455 |
+ {title:"D", field:"D", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
|
| 456 |
+ {title:"E", field:"E", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]},
|
|
| 457 |
+ {title:"F", field:"F", hozAlign:"center", headerHozAlign: "center", width:140, validator:["maxLength:100", "string"]}
|
|
| 458 |
+ ]); |
|
| 459 |
+ |
|
| 460 |
+ $tableExcel.setData(tableData).then(() => {
|
|
| 461 |
+ // excelRowTotCnt 업데이트 |
|
| 462 |
+ document.getElementById("excelRowTotCnt").innerText = tableData.length;
|
|
| 463 |
+ }); |
|
| 464 |
+ |
|
| 465 |
+ fn_loadRemoveActive(); |
|
| 466 |
+} |
|
| 467 |
+ |
|
| 468 |
+ |
|
| 469 |
+ |
|
| 470 |
+/* |
|
| 471 |
+* 타이틀 select 선택할때마다 실행해서 |
|
| 472 |
+* 데이터테이블 필드값 수정 |
|
| 473 |
+*/ |
|
| 474 |
+function updateTableFields($objTabul) {
|
|
| 475 |
+ var currentData = $objTabul.getData(); |
|
| 476 |
+ var columns = [ |
|
| 477 |
+ {formatter: "rowSelection", titleFormatter: "rowSelection", clipboard: false, hozAlign: "center", headerHozAlign: "center", headerSort: false, cellClick: function(e, cell) {
|
|
| 478 |
+ cell.getRow().toggleSelect(); |
|
| 479 |
+ }} |
|
| 480 |
+ ,{formatter:"rownum", align:"center", title:"No", hozAlign:"center", headerHozAlign:"center", width:60}
|
|
| 481 |
+ ]; |
|
| 482 |
+ |
|
| 483 |
+ var fieldMapping = []; |
|
| 484 |
+ $('.field-selector').each(function(index) {
|
|
| 485 |
+ var selectedField = $(this).val(); |
|
| 486 |
+ // ASCII 문자 코드 사용 - 65=A, 66=B ... |
|
| 487 |
+ var field = String.fromCharCode(65 + index); |
|
| 488 |
+ if (selectedField) {
|
|
| 489 |
+ columns.push({
|
|
| 490 |
+ title: field |
|
| 491 |
+ , field: selectedField |
|
| 492 |
+ , hozAlign: "center" |
|
| 493 |
+ , headerHozAlign: "center" |
|
| 494 |
+// , editor: "input" |
|
| 495 |
+ , editor: false |
|
| 496 |
+ , width: 140 |
|
| 497 |
+ , validator: ["maxLength:100", "string"] |
|
| 498 |
+ }); |
|
| 499 |
+ fieldMapping.push(selectedField); |
|
| 500 |
+ } else {
|
|
| 501 |
+ columns.push({
|
|
| 502 |
+ title: field |
|
| 503 |
+ , field: field |
|
| 504 |
+ , hozAlign: "center" |
|
| 505 |
+ , headerHozAlign: "center" |
|
| 506 |
+ , editor: false |
|
| 507 |
+// , editor: "input" |
|
| 508 |
+ , width: 140 |
|
| 509 |
+ , validator: ["maxLength:100", "string"] |
|
| 510 |
+ }); |
|
| 511 |
+ fieldMapping.push(field); |
|
| 512 |
+ } |
|
| 513 |
+ }); |
|
| 514 |
+ |
|
| 515 |
+ var updatedData = currentData.map(row => {
|
|
| 516 |
+ var newRow = {};
|
|
| 517 |
+ fieldMapping.forEach((field, index) => {
|
|
| 518 |
+ newRow[field] = row[Object.keys(row)[index]] || ""; |
|
| 519 |
+ }); |
|
| 520 |
+ return newRow; |
|
| 521 |
+ }); |
|
| 522 |
+ |
|
| 523 |
+ $objTabul.setColumns(columns); |
|
| 524 |
+ $objTabul.setData(updatedData); |
|
| 525 |
+} |
|
| 526 |
+ |
|
| 527 |
+ |
|
| 528 |
+/** |
|
| 529 |
+ * @ 핸드폰 중복 데이터 |
|
| 530 |
+ * */ |
|
| 531 |
+function fn_phoneDupl($objTabul) {
|
|
| 532 |
+ |
|
| 533 |
+ $tableError.clearData(); |
|
| 534 |
+ |
|
| 535 |
+ var data = $objTabul.getData(); |
|
| 536 |
+ var phoneNumberChk = false; |
|
| 537 |
+ var existingNumbers = new Set(); // 배열에서 Set으로 변경 |
|
| 538 |
+ |
|
| 539 |
+ let errorCount = 0; // 중복 번호 개수를 저장할 변수 |
|
| 540 |
+ let duplicateCount = 0; // 중복 번호 개수를 저장할 변수 |
|
| 541 |
+ |
|
| 542 |
+ const errors = []; // 오류 데이터를 저장할 배열 |
|
| 543 |
+ const newData = []; // 유효한 데이터만 저장할 새로운 배열 |
|
| 544 |
+ |
|
| 545 |
+ data.forEach((row, index) => {
|
|
| 546 |
+ |
|
| 547 |
+ const number = row.addrPhoneNo; |
|
| 548 |
+ |
|
| 549 |
+ // number가 null, undefined, 빈 문자열이거나 숫자인 경우 처리 |
|
| 550 |
+ if (!number || (typeof number === 'string' && !number.trim())){
|
|
| 551 |
+ console.log("number : ", number);
|
|
| 552 |
+ return; |
|
| 553 |
+ } |
|
| 554 |
+ |
|
| 555 |
+ const formattedNumber = formatPhoneNumber(number); // 번호 표준화 |
|
| 556 |
+ const cleanedNumber = formattedNumber.replace(/[^0-9]/g, ''); // 숫자만 남김 |
|
| 557 |
+ |
|
| 558 |
+ if (!existingNumbers.has(cleanedNumber)) { // 중복 번호 체크
|
|
| 559 |
+ if (isValidPhoneNumber(formattedNumber)) { // 유효성 검사
|
|
| 560 |
+ row.addrPhoneNo = formattedNumber; |
|
| 561 |
+ existingNumbers.add(cleanedNumber); // 추가된 번호를 기존 목록에 추가 |
|
| 562 |
+ newData.push(row); // 유효한 데이터만 새로운 배열에 추가 |
|
| 563 |
+ } else {
|
|
| 564 |
+ // 오류: 유효성 통과 못함 |
|
| 565 |
+ errorCount++; |
|
| 566 |
+ |
|
| 567 |
+ errors.push({
|
|
| 568 |
+ name: row.addrNm, // 이름 |
|
| 569 |
+ phone: row.addrPhoneNo, // 폰번호 |
|
| 570 |
+ result: "오류" // 결과 메시지 추가 |
|
| 571 |
+ }); |
|
| 572 |
+ } |
|
| 573 |
+ } else {
|
|
| 574 |
+ // 중복 |
|
| 575 |
+ duplicateCount++; |
|
| 576 |
+ |
|
| 577 |
+ errors.push({
|
|
| 578 |
+ name: row.addrNm, // 이름 |
|
| 579 |
+ phone: row.addrPhoneNo, // 폰번호 |
|
| 580 |
+ result: "중복" // 결과 메시지 추가 |
|
| 581 |
+ }); |
|
| 582 |
+ } |
|
| 583 |
+ }); |
|
| 584 |
+ |
|
| 585 |
+ // data 배열을 newData 배열로 대체 |
|
| 586 |
+ data = newData; |
|
| 587 |
+ |
|
| 588 |
+ |
|
| 589 |
+ // 수정된 데이터로 테이블 업데이트 |
|
| 590 |
+ $objTabul.setData(data); |
|
| 591 |
+ // 오류 총 카운트 |
|
| 592 |
+ $("#excelRowTotCnt").text($objTabul.getDataCount());
|
|
| 593 |
+ // 중복 카운트 |
|
| 594 |
+ $("#excelRowDupCnt").text(duplicateCount);
|
|
| 595 |
+ // 에러 카운트 |
|
| 596 |
+ $("#excelRowErrorCnt").text(errorCount);
|
|
| 597 |
+ |
|
| 598 |
+ // popup 영역 |
|
| 599 |
+ $("#errorPopTotCnt").text($objTabul.getDataCount());
|
|
| 600 |
+ // 중복 카운트 |
|
| 601 |
+ $("#errorPopDupCnt").text(duplicateCount);
|
|
| 602 |
+ // 에러 카운트 |
|
| 603 |
+ $("#errorPopErrorCnt").text(errorCount);
|
|
| 604 |
+ |
|
| 605 |
+ |
|
| 606 |
+ $tableError.setData(errors); |
|
| 607 |
+ |
|
| 608 |
+ if(errorCount > 0){
|
|
| 609 |
+ alert('휴대폰 형식에 맞지 않는 데이터는 삭제 후 업로드 됩니다.\nex) 발송불가 특수문자, 자릿수 오류 등');
|
|
| 610 |
+ } |
|
| 611 |
+ |
|
| 612 |
+ |
|
| 613 |
+ |
|
| 614 |
+} |
|
| 615 |
+ |
|
| 616 |
+function fn_dupliPopupShow(){
|
|
| 617 |
+ |
|
| 618 |
+ $("#tableExcelDupliBtn").show();
|
|
| 619 |
+} |
|
| 620 |
+ |
|
| 621 |
+function makeAddrMassDupliPop(dupliPhoneDataRealList) {
|
|
| 622 |
+ var sHtml = ""; |
|
| 623 |
+ sHtml += "<div class='' style='overflow-x:auto; height:350px;'>"; |
|
| 624 |
+ sHtml += "<table class='tType4'>"; |
|
| 625 |
+ sHtml += " <colgroup>"; |
|
| 626 |
+ sHtml += " <col style='width:auto' />"; |
|
| 627 |
+ sHtml += " </colgroup>"; |
|
| 628 |
+ sHtml += " <thead>"; |
|
| 629 |
+ sHtml += " <tr>"; |
|
| 630 |
+ sHtml += " <th>중복 휴대폰번호 (" + numberWithCommas(dupliPhoneDataRealList.length) + "개)</th>";
|
|
| 631 |
+ sHtml += " </tr>"; |
|
| 632 |
+ sHtml += " </thead>"; |
|
| 633 |
+ sHtml += " <tbody>"; |
|
| 634 |
+ for (var i = 0; i < dupliPhoneDataRealList.length; i++) {
|
|
| 635 |
+ sHtml += " <tr>"; |
|
| 636 |
+ sHtml += " <td>" + dupliPhoneDataRealList[i] + "</td>"; |
|
| 637 |
+ sHtml += " </tr>"; |
|
| 638 |
+ } |
|
| 639 |
+ sHtml += " </tbody>"; |
|
| 640 |
+ sHtml += " </table>"; |
|
| 641 |
+ sHtml += " </div>"; |
|
| 642 |
+ |
|
| 643 |
+ $("#addrMassDupli_layer").html(sHtml);
|
|
| 644 |
+ fn_dupliPopupShow(); |
|
| 645 |
+ |
|
| 646 |
+} |
|
| 647 |
+ |
|
| 648 |
+ |
|
| 649 |
+function fn_dupliPopupShow(){
|
|
| 650 |
+ $('#tableExcelDupliBtn').show();
|
|
| 651 |
+} |
|
| 652 |
+ |
|
| 653 |
+//한국의 핸드폰 번호 형식 검사 함수 |
|
| 654 |
+function isValidKoreanPhoneNumber(phone) {
|
|
| 655 |
+ // 하이픈(-)을 제거하고 숫자만 남긴 후 검사 |
|
| 656 |
+ var cleaned = phone.replace(/-/g, ''); |
|
| 657 |
+ // 010, 011, 016, 017, 018, 019로 시작하고 10~11자리인 경우 유효 |
|
| 658 |
+ var valid = /^(010|011|016|017|018|019)\d{7,8}$/.test(cleaned);
|
|
| 659 |
+ return valid; |
|
| 660 |
+} |
|
| 661 |
+ |
|
| 662 |
+ |
|
| 663 |
+ |
|
| 664 |
+ |
|
| 665 |
+// 상단 설명 더보기 |
|
| 666 |
+function popMore(e){
|
|
| 667 |
+ $(e).closest(".pop_more_cont").toggleClass("pop_more_click");
|
|
| 668 |
+ |
|
| 669 |
+ if($(e).closest(".pop_more_cont").is(".pop_more_click")){
|
|
| 670 |
+ $(e).html('숨기기');
|
|
| 671 |
+ $(e).append('<i></i>');
|
|
| 672 |
+ }else {
|
|
| 673 |
+ $(e).html('더보기');
|
|
| 674 |
+ $(e).append('<i></i>');
|
|
| 675 |
+ } |
|
| 676 |
+} |
|
| 677 |
+ |
|
| 678 |
+ |
|
| 679 |
+ |
|
| 680 |
+ |
|
| 681 |
+</script> |
|
| 682 |
+ |
|
| 683 |
+<!-- 중복전화번호 data-tooltip:addrMassDupli_layer --> |
|
| 684 |
+<div class="tooltip-wrap"> |
|
| 685 |
+ <div class="popup-com addrMassDupli_layer" tabindex="0" data-tooltip-con="addrMassDupli_layer" data-focus="addrMassDupli_layer" data-focus-prev="addrMassDupli_layer-close" style="width: 270px; height: 500px;"> |
|
| 686 |
+ <div class="popup_heading"> |
|
| 687 |
+ <p>중복 휴대폰번호</p> |
|
| 688 |
+ <button type="button" class="tooltip-close" data-focus="addrMassDupli_layer-close" onclick="setAddrDupliClose();"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> |
|
| 689 |
+ </div> |
|
| 690 |
+ <div class="layer_in" style="padding:20px 0px;" id="addrMassDupli_layer"> |
|
| 691 |
+ </div> |
|
| 692 |
+ |
|
| 693 |
+ <div class="popup_btn_wrap2" style="margin-top: 0px;"> |
|
| 694 |
+ <button type="button" class="tooltip-close" data-focus="addrMassDupli_layer-close" data-focus-next="addrMassDupli_layer">닫기</button> |
|
| 695 |
+ </div> |
|
| 696 |
+ |
|
| 697 |
+ </div> |
|
| 698 |
+</div> |
|
| 699 |
+ |
|
| 700 |
+ |
|
| 701 |
+<!-- 주소록 상세 결과 팝업 data-tooltip:adr_popup14 --> |
|
| 702 |
+ <div class="tooltip-wrap"> |
|
| 703 |
+ <div class="popup-com adr_layer adr_popup14" tabindex="0" data-tooltip-con="adr_popup14" data-focus="adr_popup14" data-focus-prev="adr_popu14-close" style="width: 450px;"> |
|
| 704 |
+ <div class="popup_heading"> |
|
| 705 |
+ <p>주소록 상세 결과</p> |
|
| 706 |
+ <button type="button" class="tooltip-close" data-focus="adr_popup14-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> |
|
| 707 |
+ </div> |
|
| 708 |
+ <div class="layer_in" style="padding:30px 20px;"> |
|
| 709 |
+ <div class="table_top"> |
|
| 710 |
+ <p> |
|
| 711 |
+ 총 <span class="c_e40000" id="errorPopTotCnt">0</span>건 |
|
| 712 |
+ / 중복 <span class="c_002c9a" id="errorPopDupCnt">0</span>건 |
|
| 713 |
+ / 오류 <span class="c_002c9a" id="errorPopErrorCnt">0</span>건</p> |
|
| 714 |
+ <button type="button" class="excel_btn btnType" id="errorExcelBtn"><i class="downroad"></i>엑셀 다운로드</button> |
|
| 715 |
+ </div> |
|
| 716 |
+ <div class="tb_wrap adr_list" id="tabulator_error"> |
|
| 717 |
+ <!-- $tableError 참고 --> |
|
| 718 |
+ </div> |
|
| 719 |
+ <ul class="cf_text_ul"> |
|
| 720 |
+ <li>*중복번호는 하나의 번호만 등록됩니다.</li> |
|
| 721 |
+ <li>*휴대폰 형식에 맞지 않는 데이터는 삭제 후 업로드 됩니다.</li> |
|
| 722 |
+ <li>ex) 발송불가 특수문자, 자릿수 오류 등</li> |
|
| 723 |
+ </ul> |
|
| 724 |
+ <div class="popup_btn_wrap2"> |
|
| 725 |
+<!-- <button type="button">저장</button> --> |
|
| 726 |
+ <button type="button" class="tooltip-close" data-focus="adr_popup14-close" data-focus-next="adr_popup14">닫기</button> |
|
| 727 |
+ </div> |
|
| 728 |
+ </div> |
|
| 729 |
+ </div> |
|
| 730 |
+ </div> |
|
| 731 |
+ |
|
| 732 |
+<!--// 중복전화번호 팝업 --> |
|
| 733 |
+ <div class="popup_heading"> |
|
| 734 |
+ <p>엑셀 불러오기</p> |
|
| 735 |
+ <button type="button" class="tooltip-close" id="closeBtn" data-focus="popup02-close"><img src="/publish/images/content/layerPopup_close.png" alt="팝업 닫기"></button> |
|
| 736 |
+ </div> |
|
| 737 |
+ <div class="layer_in" style="padding: 25px 30px;"> |
|
| 738 |
+<!-- <div class="list_tab_wrap2"> --> |
|
| 739 |
+ <!-- tab button --> |
|
| 740 |
+<!-- <ul class="list_tab" id="tbTabl"> --> |
|
| 741 |
+<!-- <li class="tab active" data-tabul="tableExcel"><button type="button" onclick="popupTab(this,'1'); fn_tabToggle('1');">엑셀입력</button></li> -->
|
|
| 742 |
+<!-- <li class="tab" data-tabul="tableClip"><button type="button" onclick="popupTab(this,'2'); fn_tabToggle('2');">붙여넣기</button></li> -->
|
|
| 743 |
+<!-- <li class="tab" data-tabul="tableSelf"><button type="button" onclick="popupTab(this,'3'); fn_tabToggle('3');">직접입력</button></li> -->
|
|
| 744 |
+<!-- </ul>// tab button --> |
|
| 745 |
+<!-- </div> --> |
|
| 746 |
+ <!-- 엑셀입력 --> |
|
| 747 |
+ <div class="popCont current pop_more_cont" id="popCont_1"> |
|
| 748 |
+ <div class="titBox"> |
|
| 749 |
+ <p>- 주소록은 한 번에 최대 30만건까지 등록(EXCEL파일, 최대용량 20MB) 가능합니다. </p> |
|
| 750 |
+ <p>- 엑셀 파일에 비밀번호 설정, 제한된 보기, 수식 등이 설정되어 있는 경우 업로드가 불가합니다.</p> |
|
| 751 |
+ <p>- 구분선(|), 역슬래시(\, ₩), 큰따옴표(") 등 발송불가 특수문자는 저장되지 않습니다.</p>
|
|
| 752 |
+ <p>- 이름 200byte, [*1*]~[*4*] 200byte, 메모 250byte까지 입력 가능합니다.</p> |
|
| 753 |
+ <p>- 주소록 등록이 어려우신 경우에는 <a href="<c:url value='/web/mjon/addragency/selectAddrAgencyList.do'/>" style="font-weight: bold; color: blue;">주소록 입력대행</a> 메뉴를 이용하실 수 있습니다. </p> |
|
| 754 |
+ </div> |
|
| 755 |
+ <div class="pop_more_wrap"> |
|
| 756 |
+ <button type="button" class="pop_more" onclick="popMore(this);">더보기<i></i></button> |
|
| 757 |
+ </div> |
|
| 758 |
+ </div><!--// 엑셀입력 --> |
|
| 759 |
+ |
|
| 760 |
+ <!-- 공통 --> |
|
| 761 |
+ <div> |
|
| 762 |
+ <table class="layer_tType1"> |
|
| 763 |
+ <caption>엑셀입력 표</caption> |
|
| 764 |
+ <colgroup> |
|
| 765 |
+ <col style="width: 95px"> |
|
| 766 |
+ <col style="width: auto"> |
|
| 767 |
+ </colgroup> |
|
| 768 |
+ <tbody> |
|
| 769 |
+ <tr> |
|
| 770 |
+ <!-- <th>그룹 선택</th> |
|
| 771 |
+ <td> |
|
| 772 |
+ <label for="" class="label">그룹 선택</label> |
|
| 773 |
+ <select id="addrGrpIdInfo" name="addrGrpIdInfo"> |
|
| 774 |
+ </select> |
|
| 775 |
+ <label for="" class="label">그룹명 입력</label> |
|
| 776 |
+ <input type="text" id="addrGrpNm" name="addrGrpNm" placeholder="새 그룹명을 입력해주세요." onfocus="this.placeholder=''" onblur="this.placeholder='새 그룹명을 입력해주세요.'"class="inputLight" style="width: 300px;"> |
|
| 777 |
+ <input type="file" id="excelFile" accept=".xls, .xlsx, .txt" style="display:none"/> |
|
| 778 |
+ <button type="button" class="excel_btn2 btnType c3"><i class="uproad"></i>엑셀, TXT파일 업로드</button> |
|
| 779 |
+ </td> --> |
|
| 780 |
+ <td colspan="2" style="padding:20px 0;"> |
|
| 781 |
+ <div class="file_upload_wrap" style="width:100%;display:flex;"> |
|
| 782 |
+ <div class="file_add upload_area"> |
|
| 783 |
+ <p><img src="/publish/images/content/file_add.png" alt="파일 붙여넣기">마우스로 엑셀, TXT파일을 여기에 끌어다 놓으세요</p> |
|
| 784 |
+ </div> |
|
| 785 |
+ <input type="file" id="excelFile" accept=".xls, .xlsx, .txt" style="display:none"/> |
|
| 786 |
+ <button type="button" class="excel_btn2 btnType c3"><i class="uproad"></i>엑셀, TXT파일 업로드</button> |
|
| 787 |
+ </div> |
|
| 788 |
+ </td> |
|
| 789 |
+ </tr> |
|
| 790 |
+ </tbody> |
|
| 791 |
+ </table> |
|
| 792 |
+ </div> |
|
| 793 |
+ |
|
| 794 |
+ |
|
| 795 |
+ <div class="excel_middle2"> |
|
| 796 |
+ <p> |
|
| 797 |
+ 총 <span class="c_e40000 fwBold" id="excelRowTotCnt">0</span>건 |
|
| 798 |
+ / 중복 <span class="c_002c9a fwBold" id="excelRowDupCnt">0</span>건 |
|
| 799 |
+ / 오류 <span class="c_002c9a fwBold" id="excelRowErrorCnt">0</span>건 |
|
| 800 |
+ <button type="button" class="btn_list_detail" data-tooltip="adr_popup14"><img src="/publish/images/search.png"></button> |
|
| 801 |
+ </p> |
|
| 802 |
+<!-- --> |
|
| 803 |
+<!-- <button type="button" class="btnType btnType6" data-tooltip="addrMassDupli_layer" id="tableExcelDupliBtn">중복번호</button> --> |
|
| 804 |
+<!-- --> |
|
| 805 |
+<!-- <button type="button" class="btnType btnType6" data-tooltip="addrMassSaveDupli_layer" onclick="GetAddrMassSaveDupli()" id="btnAddrMassSaveDupli">중복번호</button> --> |
|
| 806 |
+ </p> |
|
| 807 |
+<!-- <button type="button" class="btnType btnType6 addCallToF">번호추가</button> --> |
|
| 808 |
+ </div> |
|
| 809 |
+ |
|
| 810 |
+ |
|
| 811 |
+ |
|
| 812 |
+ |
|
| 813 |
+ <div class="adr_excel" style="margin-top: 13px; overflow-x:auto;"> |
|
| 814 |
+<!-- <div class="adr_excel" style="margin-top: 13px;"> --> |
|
| 815 |
+ <!-- thead --> |
|
| 816 |
+ <div class="adr_hd select_adr_hd" data-group="tableExcel"> |
|
| 817 |
+ <div style="width: 100px;"></div> |
|
| 818 |
+ <div style="width: 140px;"> |
|
| 819 |
+ <label for="" class="label"></label> |
|
| 820 |
+ <select class="field-selector"> |
|
| 821 |
+ <option value="">선택하기</option> |
|
| 822 |
+ <option value="addrNm">이름</option> |
|
| 823 |
+ <option value="addrPhoneNo">휴대폰</option> |
|
| 824 |
+ <option value="addrInfo1">[*1*]</option> |
|
| 825 |
+ <option value="addrInfo2">[*2*]</option> |
|
| 826 |
+ <option value="addrInfo3">[*3*]</option> |
|
| 827 |
+ <option value="addrInfo4">[*4*]</option> |
|
| 828 |
+<!-- <option value="addrComment">메모</option> --> |
|
| 829 |
+ </select> |
|
| 830 |
+ </div> |
|
| 831 |
+ <div style="width: 140px;"> |
|
| 832 |
+ <label for="" class="label"></label> |
|
| 833 |
+ <select class="field-selector"> |
|
| 834 |
+ <option value="">선택하기</option> |
|
| 835 |
+ <option value="addrNm">이름</option> |
|
| 836 |
+ <option value="addrPhoneNo">휴대폰</option> |
|
| 837 |
+ <option value="addrInfo1">[*1*]</option> |
|
| 838 |
+ <option value="addrInfo2">[*2*]</option> |
|
| 839 |
+ <option value="addrInfo3">[*3*]</option> |
|
| 840 |
+ <option value="addrInfo4">[*4*]</option> |
|
| 841 |
+<!-- <option value="addrComment">메모</option> --> |
|
| 842 |
+ </select> |
|
| 843 |
+ </div> |
|
| 844 |
+ <div style="width: 140px;"> |
|
| 845 |
+ <label for="" class="label"></label> |
|
| 846 |
+ <select class="field-selector"> |
|
| 847 |
+ <option value="">선택하기</option> |
|
| 848 |
+ <option value="addrNm">이름</option> |
|
| 849 |
+ <option value="addrPhoneNo">휴대폰</option> |
|
| 850 |
+ <option value="addrInfo1">[*1*]</option> |
|
| 851 |
+ <option value="addrInfo2">[*2*]</option> |
|
| 852 |
+ <option value="addrInfo3">[*3*]</option> |
|
| 853 |
+ <option value="addrInfo4">[*4*]</option> |
|
| 854 |
+<!-- <option value="addrComment">메모</option> --> |
|
| 855 |
+ </select> |
|
| 856 |
+ </div> |
|
| 857 |
+ <div style="width: 140px;"> |
|
| 858 |
+ <label for="" class="label"></label> |
|
| 859 |
+ <select class="field-selector"> |
|
| 860 |
+ <option value="">선택하기</option> |
|
| 861 |
+ <option value="addrNm">이름</option> |
|
| 862 |
+ <option value="addrPhoneNo">휴대폰</option> |
|
| 863 |
+ <option value="addrInfo1">[*1*]</option> |
|
| 864 |
+ <option value="addrInfo2">[*2*]</option> |
|
| 865 |
+ <option value="addrInfo3">[*3*]</option> |
|
| 866 |
+ <option value="addrInfo4">[*4*]</option> |
|
| 867 |
+<!-- <option value="addrComment">메모</option> --> |
|
| 868 |
+ </select> |
|
| 869 |
+ </div> |
|
| 870 |
+ <div style="width: 140px;"> |
|
| 871 |
+ <label for="" class="label"></label> |
|
| 872 |
+ <select class="field-selector"> |
|
| 873 |
+ <option value="">선택하기</option> |
|
| 874 |
+ <option value="addrNm">이름</option> |
|
| 875 |
+ <option value="addrPhoneNo">휴대폰</option> |
|
| 876 |
+ <option value="addrInfo1">[*1*]</option> |
|
| 877 |
+ <option value="addrInfo2">[*2*]</option> |
|
| 878 |
+ <option value="addrInfo3">[*3*]</option> |
|
| 879 |
+ <option value="addrInfo4">[*4*]</option> |
|
| 880 |
+<!-- <option value="addrComment">메모</option> --> |
|
| 881 |
+ </select> |
|
| 882 |
+ </div> |
|
| 883 |
+ <div style="width: 140px;"> |
|
| 884 |
+ <label for="" class="label"></label> |
|
| 885 |
+ <select class="field-selector"> |
|
| 886 |
+ <option value="">선택하기</option> |
|
| 887 |
+ <option value="addrNm">이름</option> |
|
| 888 |
+ <option value="addrPhoneNo">휴대폰</option> |
|
| 889 |
+ <option value="addrInfo1">[*1*]</option> |
|
| 890 |
+ <option value="addrInfo2">[*2*]</option> |
|
| 891 |
+ <option value="addrInfo3">[*3*]</option> |
|
| 892 |
+ <option value="addrInfo4">[*4*]</option> |
|
| 893 |
+<!-- <option value="addrComment">메모</option> --> |
|
| 894 |
+ </select> |
|
| 895 |
+ </div> |
|
| 896 |
+ <!-- <div style="width: 125px;"> |
|
| 897 |
+ <label for="" class="label"></label> |
|
| 898 |
+ <select class="field-selector"> |
|
| 899 |
+ <option value="">선택하기</option> |
|
| 900 |
+ <option value="addrNm">이름</option> |
|
| 901 |
+ <option value="addrPhoneNo">휴대폰</option> |
|
| 902 |
+ <option value="addrInfo1">[*1*]</option> |
|
| 903 |
+ <option value="addrInfo2">[*2*]</option> |
|
| 904 |
+ <option value="addrInfo3">[*3*]</option> |
|
| 905 |
+ <option value="addrInfo4">[*4*]</option> |
|
| 906 |
+ <option value="addrComment">메모</option> |
|
| 907 |
+ </select> |
|
| 908 |
+ </div> --> |
|
| 909 |
+ </div> |
|
| 910 |
+ </div> |
|
| 911 |
+ |
|
| 912 |
+ <div class="drag_drop_wrap callList_includ_box" id="tabulator_excel"> |
|
| 913 |
+<!-- <img src="/publish/images/content/excel.jpg" style="width: 100%;"> --> |
|
| 914 |
+ </div> |
|
| 915 |
+ <div class="excel_middle"> |
|
| 916 |
+ <div class="select_btnWrap clearfix"> |
|
| 917 |
+ <div> |
|
| 918 |
+ <button type="button" id="allDel"><i class="remove_img"></i>전체삭제</button> |
|
| 919 |
+ <button type="button" id="in_select_del"><i class="remove_img"></i>선택삭제</button> |
|
| 920 |
+ </div> |
|
| 921 |
+ |
|
| 922 |
+ </div> |
|
| 923 |
+ </div><!--// 공통 --> |
|
| 924 |
+ |
|
| 925 |
+ <!-- 붙여놓기 설명 --> |
|
| 926 |
+<!-- <div class="req_area"> --> |
|
| 927 |
+<!-- <div class="text_box"> --> |
|
| 928 |
+<!-- - 휴대폰 번호가 입력된 txt 파일을 열어 복사(Ctrl+c) + 붙여넣기(Ctrl+v)로도 입력하실 수 있습니다.<br> --> |
|
| 929 |
+<!-- - 휴대폰 번호는 필수입력 항목입니다.<br> --> |
|
| 930 |
+<!-- - 이름,휴대폰 번호,[*1*],[*2*],[*3*],[*4*],메모 순서대로 입력해주세요.(예 : 010-1234-5678,홍길동,변수1…메모)<br> --> |
|
| 931 |
+<!-- - 이름은 24byte, [*1*]~[*4*] 40byte, 메모는 250byte까지 입력 가능합니다.<br> --> |
|
| 932 |
+<!-- - '오류 검사'를 통해 등록된 데이터에 전화번호 입력 오류를 확인하실 수 있습니다. --> |
|
| 933 |
+<!-- </div> --> |
|
| 934 |
+<!-- </div> --> |
|
| 935 |
+ <div class="popup_btn_wrap2" style="margin: 0 auto 30px auto;"> |
|
| 936 |
+ <button type="button" id="btnAddrMassReg">추가</button> |
|
| 937 |
+ <button type="button" id="btnAddrMassClose" class="tooltip-close" data-focus="adr_popup01-close" data-focus-next="popup02">닫기</button> |
|
| 938 |
+ </div> |
|
| 939 |
+ |
|
| 938 | 940 |
</div>(No newline at end of file) |
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?