카카오 친구톡 발송화면 Tabulator 적용중
@a94a7529cddea0876130ec2a187ecfe438f530bc
--- src/main/java/itn/let/kakao/user/kakaoFt/web/KakaoFriendsTalkSendController.java
+++ src/main/java/itn/let/kakao/user/kakaoFt/web/KakaoFriendsTalkSendController.java
... | ... | @@ -76,9 +76,11 @@ |
| 76 | 76 |
String author = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getAuthority()); |
| 77 | 77 |
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId()); |
| 78 | 78 |
|
| 79 |
- if(userId == "") {
|
|
| 79 |
+ /*if(userId == "") {
|
|
| 80 | 80 |
return "redirect:/web/user/login/login.do"; |
| 81 |
- } |
|
| 81 |
+ }*/ |
|
| 82 |
+ |
|
| 83 |
+ model.addAttribute("loginVO", loginVO);
|
|
| 82 | 84 |
|
| 83 | 85 |
try {
|
| 84 | 86 |
|
--- src/main/java/itn/let/kakao/user/kakaoFt/web/KakaoFriendsTalkTemplateController.java
+++ src/main/java/itn/let/kakao/user/kakaoFt/web/KakaoFriendsTalkTemplateController.java
... | ... | @@ -651,6 +651,11 @@ |
| 651 | 651 |
paginationInfo.setTotalRecordCount(kakaoTemplateInfoList.size() > 0 ? ((KakaoVO)kakaoTemplateInfoList.get(0)).getTotCnt() : 0); |
| 652 | 652 |
model.addAttribute("paginationInfo", paginationInfo);
|
| 653 | 653 |
|
| 654 |
+ //사용자 등록 발신프로필 정보 조회해오기 |
|
| 655 |
+ searchVO.setUserId(userId); |
|
| 656 |
+ List<KakaoVO> resultProfileList = kakaoApiService.selectKakaoProfileList(searchVO); |
|
| 657 |
+ model.addAttribute("resultProfileList", resultProfileList);
|
|
| 658 |
+ |
|
| 654 | 659 |
} catch (Exception e) {
|
| 655 | 660 |
System.out.println("selectKakaoFriendsTemplateListAjax Controller Error !!! " + e);
|
| 656 | 661 |
} |
--- src/main/webapp/WEB-INF/jsp/web/kakao/include/KaKaoAlimtalkTopMenuTap.jsp
+++ src/main/webapp/WEB-INF/jsp/web/kakao/include/KaKaoAlimtalkTopMenuTap.jsp
... | ... | @@ -1,7 +1,6 @@ |
| 1 | 1 |
<%@ page language="java" contentType="text/html; charset=UTF-8" %> |
| 2 | 2 |
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> |
| 3 | 3 |
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> |
| 4 |
-<%@ page import="itn.com.cmm.LoginVO" %> |
|
| 5 | 4 |
|
| 6 | 5 |
<script type="text/javascript"> |
| 7 | 6 |
|
--- src/main/webapp/WEB-INF/jsp/web/kakao/msgdata/ft/KakaoFriendsTalkMsgDataView.jsp
+++ src/main/webapp/WEB-INF/jsp/web/kakao/msgdata/ft/KakaoFriendsTalkMsgDataView.jsp
... | ... | @@ -6,16 +6,19 @@ |
| 6 | 6 |
|
| 7 | 7 |
<script src="/js/kakao/templateComm.js"></script> |
| 8 | 8 |
|
| 9 |
-<script type="text/javascript" src="<c:out value='/js/kakao/at/tabulator.js' />"></script> |
|
| 9 |
+<script type="text/javascript" src="<c:out value='/js/MJUtill.js' />"></script> |
|
| 10 |
+<script type="text/javascript" src="<c:out value='/js/kakao/ft/ftTabulator.js' />"></script> |
|
| 10 | 11 |
<script type="text/javascript" src="<c:out value='/js/kakao/at/addr.js' />"></script> |
| 11 | 12 |
<script type="text/javascript" src="<c:out value='/js/common/popup.js' />"></script> |
| 12 | 13 |
<script type="text/javascript" src="<c:out value='/js/kakao/ft/friendstalkExcel.js' />"></script> |
| 14 |
+ |
|
| 13 | 15 |
|
| 14 | 16 |
<script type="text/javascript"> |
| 15 | 17 |
/* 파일등록 */ |
| 16 | 18 |
var _fileIdx = 0; |
| 17 | 19 |
var _fileForm2 = new Array(); |
| 18 | 20 |
var fileExt = ""; // 첨부파일 확장자 |
| 21 |
+var excelAddr = []; //엑셀 불러오기에서 내용 저장하는 배열 변수 |
|
| 19 | 22 |
|
| 20 | 23 |
$(document).ready(function (){
|
| 21 | 24 |
|
... | ... | @@ -44,6 +47,27 @@ |
| 44 | 47 |
|
| 45 | 48 |
var contents = $('#inputTemplateContent').val();
|
| 46 | 49 |
setContentsLengForFriends(contents); |
| 50 |
+ |
|
| 51 |
+ }); |
|
| 52 |
+ |
|
| 53 |
+ $("#excelAdd").click(function(){
|
|
| 54 |
+ |
|
| 55 |
+ if(excelAddr.length > 0){
|
|
| 56 |
+ |
|
| 57 |
+ //첨부파일로 불러온 데이터를 받는사람 목록에 추가해 준다. |
|
| 58 |
+ addPhoneInfo(excelAddr); |
|
| 59 |
+ |
|
| 60 |
+ //첨부파일 초기화 시켜주기 |
|
| 61 |
+ $("#excelFile").val("");
|
|
| 62 |
+ $("#excelNm").val("");
|
|
| 63 |
+ |
|
| 64 |
+ }else{
|
|
| 65 |
+ |
|
| 66 |
+ alert("추가 엑셀 데이터가 없습니다.");
|
|
| 67 |
+ return false; |
|
| 68 |
+ |
|
| 69 |
+ } |
|
| 70 |
+ |
|
| 47 | 71 |
|
| 48 | 72 |
}); |
| 49 | 73 |
}); |
... | ... | @@ -87,9 +111,11 @@ |
| 87 | 111 |
|
| 88 | 112 |
//미리보기에 이미지 표시해주기 |
| 89 | 113 |
var imgUrl = '${resultTemplateVO.templateImageUrl}';
|
| 90 |
- $('.kakao_image').css("display", "block");
|
|
| 91 |
- $("#kakaoImg").attr("src", imgUrl);
|
|
| 92 | 114 |
|
| 115 |
+ if(imgUrl != ''){
|
|
| 116 |
+ $('.kakao_image').css("display", "block");
|
|
| 117 |
+ $("#kakaoImg").attr("src", imgUrl);
|
|
| 118 |
+ } |
|
| 93 | 119 |
|
| 94 | 120 |
//초기 템플릿 내용 글자수 처리해주기 |
| 95 | 121 |
var tmpContents = $('#inputTemplateContent').val();
|
... | ... | @@ -585,6 +611,13 @@ |
| 585 | 611 |
|
| 586 | 612 |
}); |
| 587 | 613 |
|
| 614 |
+function fnEmptyId(){
|
|
| 615 |
+ |
|
| 616 |
+ alert("로그인 후 이용이 가능합니다.");
|
|
| 617 |
+ return false; |
|
| 618 |
+ |
|
| 619 |
+} |
|
| 620 |
+ |
|
| 588 | 621 |
</script> |
| 589 | 622 |
|
| 590 | 623 |
<!-- 로딩바 --> |
... | ... | @@ -636,7 +669,7 @@ |
| 636 | 669 |
<tr> |
| 637 | 670 |
<th>채널ID</th> |
| 638 | 671 |
<td> |
| 639 |
- <label for="" class="채널ID 선택"></label> |
|
| 672 |
+ <label for="selectAgentCode" class="채널ID 선택"></label> |
|
| 640 | 673 |
<select class="select_gray_type" name="selectAgentCode" id="selectAgentCode" onchange="javascript:fnAgentCodeChg();"> |
| 641 | 674 |
<option value="">채널ID 선택</option> |
| 642 | 675 |
<c:forEach var="kakaoProfileInfo" items="${resultProfileList}" varStatus="status">
|
... | ... | @@ -842,10 +875,25 @@ |
| 842 | 875 |
</div> |
| 843 | 876 |
</div> |
| 844 | 877 |
<div class="btn_popup_wrap template_call_wrap"> |
| 845 |
- <button type="button" class="btnType btnType8" onclick="window.open('/web/mjon/kakao/template/selectKakaoFriendsTemplateListPopupAjax.do','_blank','width=930, height=780, top=100, left=100, fullscreen=no, menubar=no, status=no, toolbar=no, titlebar=yes, location=no, scrollbars=yes')">템플릿 불러오기</button>
|
|
| 878 |
+ <c:choose> |
|
| 879 |
+ <c:when test="${not empty loginVO.id}">
|
|
| 880 |
+ <button type="button" class="btnType btnType8" onclick="window.open('/web/mjon/kakao/template/selectKakaoFriendsTemplateListPopupAjax.do','_blank','width=930, height=780, top=100, left=100, fullscreen=no, menubar=no, status=no, toolbar=no, titlebar=yes, location=no, scrollbars=yes')">템플릿 불러오기</button>
|
|
| 881 |
+ </c:when> |
|
| 882 |
+ <c:otherwise> |
|
| 883 |
+ <button type="button" class="btnType btnType8" onclick="javascript:fnEmptyId();">템플릿 불러오기</button> |
|
| 884 |
+ </c:otherwise> |
|
| 885 |
+ </c:choose> |
|
| 846 | 886 |
</div> |
| 847 | 887 |
<div class="send_btnWrap"> |
| 848 |
- <button type="button" class="btnType btn_text_save" onclick="javascript:myTemplateSave();">내용 저장하기</button> |
|
| 888 |
+ <c:choose> |
|
| 889 |
+ <c:when test="${not empty loginVO.id}">
|
|
| 890 |
+ <button type="button" class="btnType btn_text_save" onclick="javascript:myTemplateSave();">내용 저장하기</button> |
|
| 891 |
+ </c:when> |
|
| 892 |
+ <c:otherwise> |
|
| 893 |
+ <button type="button" class="btnType btn_text_save" onclick="javascript:fnEmptyId();">내용 저장하기</button> |
|
| 894 |
+ </c:otherwise> |
|
| 895 |
+ </c:choose> |
|
| 896 |
+ |
|
| 849 | 897 |
<button type="button" class="btnType btnType9" onclick="javascript:fnContentsReset();">초기화</button> |
| 850 | 898 |
</div> |
| 851 | 899 |
</div> |
... | ... | @@ -854,7 +902,7 @@ |
| 854 | 902 |
<tr> |
| 855 | 903 |
<th>버튼</th> |
| 856 | 904 |
<td class="template_button"> |
| 857 |
- <select name="" id="" class="select_gray_type template_button_select"> |
|
| 905 |
+ <select name="tmpBtnSelect" id="tmpBtnSelect" class="select_gray_type template_button_select"> |
|
| 858 | 906 |
<option value="button_type_0">버튼타입 선택</option> |
| 859 | 907 |
<option value="button_type_1">배송조회</option> |
| 860 | 908 |
<option value="button_type_2">웹링크</option> |
... | ... | @@ -999,16 +1047,16 @@ |
| 999 | 1047 |
<td class="putText"> |
| 1000 | 1048 |
<div class="clearfix receipt_num"> |
| 1001 | 1049 |
<div class="receipt_num_top"> |
| 1002 |
- <label for="" class="label">받는 번호입력</label> |
|
| 1003 |
- <input type="text" placeholder="번호를 입력하세요" onfocus="this.placeholder=''" onblur="this.placeholder='번호를 입력하세요'" style="width:340px;"> |
|
| 1004 |
- <button type="button" class="btnType btnType6">번호추가</button> |
|
| 1050 |
+ <label for="callTo" class="label">받는 번호입력</label> |
|
| 1051 |
+ <input type="text" placeholder="번호를 입력하세요" id="callTo" name="callTo" onfocus="this.placeholder=''" onblur="this.placeholder='번호를 입력하세요'" style="width:340px;"> |
|
| 1052 |
+ <button type="button" class="btnType btnType6 addCallToF">번호추가</button> |
|
| 1005 | 1053 |
<span><span class="vMiddle">*</span> 중복번호는 한번만 발송됩니다.</span> |
| 1006 | 1054 |
</div> |
| 1007 | 1055 |
<div class="receipt_num_midde"> |
| 1008 | 1056 |
<div class="listType list01 callList_box" id="callList_box"> |
| 1009 | 1057 |
<div class="list_table list_head"> |
| 1010 | 1058 |
<div class="cb_wrap"> |
| 1011 |
- <label for="" class="label"></label> |
|
| 1059 |
+ <label for="select_all" class="label"></label> |
|
| 1012 | 1060 |
<input type="checkbox" id="select_all"> |
| 1013 | 1061 |
</div> |
| 1014 | 1062 |
<div class="list_table_num"> |
... | ... | @@ -1091,7 +1139,8 @@ |
| 1091 | 1139 |
<tr> |
| 1092 | 1140 |
<th colspan="2" class="replace_send_th"> |
| 1093 | 1141 |
<div class="title_th"><p>대체문자</p> |
| 1094 |
- <input type="checkbox" id="send_fail_check" class="send_fail_check"><label for="send_fail_check">친구톡 전송 실패 시 문자 전송</label> |
|
| 1142 |
+ <input type="checkbox" id="send_fail_check" class="send_fail_check"> |
|
| 1143 |
+ <label for="send_fail_check">친구톡 전송 실패 시 문자 전송</label> |
|
| 1095 | 1144 |
</div> |
| 1096 | 1145 |
<div class="replace_send_wrap"> |
| 1097 | 1146 |
<table class="tType1"> |
... | ... | @@ -1103,7 +1152,7 @@ |
| 1103 | 1152 |
<tr> |
| 1104 | 1153 |
<th>발신번호</th> |
| 1105 | 1154 |
<td> |
| 1106 |
- <label for="callFrom" class="label"></label> |
|
| 1155 |
+ <label for="callFromList" class="label"></label> |
|
| 1107 | 1156 |
<select id="callFromList" name="callFromList" class="sel_number"> |
| 1108 | 1157 |
<c:choose> |
| 1109 | 1158 |
<c:when test="${not empty resultPhonList}">
|
... | ... | @@ -1210,7 +1259,7 @@ |
| 1210 | 1259 |
<input type="text" class="startDate2 inp resDate calendar picker__input picker__input--active" title="검색 시작일" id="startDate2" name="startDate2" value="" data-datecontrol="true" readonly="" aria-haspopup="true" aria-expanded="true" aria-readonly="false" aria-owns="startDate2_root"> |
| 1211 | 1260 |
</div> |
| 1212 | 1261 |
<div class="selBox"> |
| 1213 |
- <label for="" class="label">시 선택</label> |
|
| 1262 |
+ <label for="msgResHour" class="label">시 선택</label> |
|
| 1214 | 1263 |
<select class="selType1" id="msgResHour" name="msgResHour"> |
| 1215 | 1264 |
<c:forEach var="hour" begin="0" end="23" step="1" varStatus="status"> |
| 1216 | 1265 |
<c:choose> |
... | ... | @@ -1223,7 +1272,7 @@ |
| 1223 | 1272 |
</c:choose> |
| 1224 | 1273 |
</c:forEach> |
| 1225 | 1274 |
</select> |
| 1226 |
- <label for="" class="label">분 선택</label> |
|
| 1275 |
+ <label for="msgResMin" class="label">분 선택</label> |
|
| 1227 | 1276 |
<select class="selType1" id="msgResMin" name="msgResMin"> |
| 1228 | 1277 |
<c:forEach var="min" begin="0" end="55" step="5"> |
| 1229 | 1278 |
<c:choose> |
... | ... | @@ -1240,7 +1289,7 @@ |
| 1240 | 1289 |
</div> |
| 1241 | 1290 |
<div class="rev_bottom"> |
| 1242 | 1291 |
<input type="checkbox" id="inputDivideChk" name="inputDivideChk"> |
| 1243 |
- <label for="">분할전송</label> |
|
| 1292 |
+ <label for="inputDivideChk">분할전송</label> |
|
| 1244 | 1293 |
<select class="selType1" id="divideCnt" name="divideCnt"> |
| 1245 | 1294 |
<option value="2">2</option> |
| 1246 | 1295 |
<option value="10">10</option> |
... | ... | @@ -1288,7 +1337,7 @@ |
| 1288 | 1337 |
<input type="hidden" name="searchCondition" id="searchCondition" value="0" /> |
| 1289 | 1338 |
<div class="adr_pop_left"> |
| 1290 | 1339 |
<div class="adr_left_search"> |
| 1291 |
- <label for="searchKeyword" class="label">그룹명 검색</label> |
|
| 1340 |
+ <label for="searchGrpKeyword" class="label">그룹명 검색</label> |
|
| 1292 | 1341 |
<input type="text" name="searchGrpKeyword" id="searchGrpKeyword" placeholder="그룹명 검색" onfocus="this.placeholder=''" onblur="this.placeholder='그룹명 검색'" class="inputLight"> |
| 1293 | 1342 |
<button type="button" onClick="javascrit:fnAddrGrpSearch(); return false;"><img src="/publish/images/popup/search.png" alt="검색"></button> |
| 1294 | 1343 |
</div> |
... | ... | @@ -1353,7 +1402,7 @@ |
| 1353 | 1402 |
<button type="button" class="excel_btn" onclick="location.href='/download/msg/엑셀주소록_등록양식.xlsx'"><i class="downroad"></i>샘플파일 다운로드</button> |
| 1354 | 1403 |
</div> |
| 1355 | 1404 |
<div class="attachedFile"> |
| 1356 |
- <label for="" class="attachedFile_label">첨부파일</label> |
|
| 1405 |
+ <label for="excelNm" class="attachedFile_label">첨부파일</label> |
|
| 1357 | 1406 |
<input type="text" id="excelNm" value="" readonly> |
| 1358 | 1407 |
<input type="file" id="excelFile" accept=".xls, .xlsx" onchange="excelExport(event); return false;" style="display:none"/> |
| 1359 | 1408 |
<button type="button" class="btnType btnType6 c1">찾아보기</button> |
... | ... | @@ -1362,7 +1411,7 @@ |
| 1362 | 1411 |
</div> |
| 1363 | 1412 |
</div><!--// 엑셀파일 불러오기 --> |
| 1364 | 1413 |
<div class="popup_btn_wrap2"> |
| 1365 |
- <button type="button" class="tooltip-close" data-focus="popup02-close" data-focus-next="popup02" onclick="excelAdd()">추가</button> |
|
| 1414 |
+ <button type="button" class="tooltip-close" data-focus="popup02-close" data-focus-next="popup02" id="excelAdd">추가</button> |
|
| 1366 | 1415 |
<button type="button" class="tooltip-close" data-focus="popup02-close" data-focus-next="popup02">닫기</button> |
| 1367 | 1416 |
</div> |
| 1368 | 1417 |
</div> |
--- src/main/webapp/WEB-INF/jsp/web/kakao/template/ft/KakaoFriendstalkTemplateList.jsp
+++ src/main/webapp/WEB-INF/jsp/web/kakao/template/ft/KakaoFriendstalkTemplateList.jsp
... | ... | @@ -426,7 +426,7 @@ |
| 426 | 426 |
</c:forEach> |
| 427 | 427 |
</select> |
| 428 | 428 |
<div class="search"> |
| 429 |
- <label for="id" class="label"></label> |
|
| 429 |
+ <label for="inputSearchKeyword" class="label"></label> |
|
| 430 | 430 |
<input type="text" class="search_input" id="inputSearchKeyword" name="inputSearchKeyword" value="<c:out value=""/>" placeholder="템플릿명을 입력하세요." onfocus="this.placeholder=''" onblur="this.placeholder='검색어를 입력하세요.'"> |
| 431 | 431 |
<button type="button" class="btnType btnType2" onclick="selectTemplateListLoad('1');">검색</button>
|
| 432 | 432 |
</div> |
--- src/main/webapp/WEB-INF/jsp/web/kakao/template/ft/KakaoFriendstalkTemplateListPopupAjax.jsp
+++ src/main/webapp/WEB-INF/jsp/web/kakao/template/ft/KakaoFriendstalkTemplateListPopupAjax.jsp
... | ... | @@ -106,7 +106,8 @@ |
| 106 | 106 |
function selectTemplateListLoad(page){
|
| 107 | 107 |
|
| 108 | 108 |
var form = document.listForm; |
| 109 |
- |
|
| 109 |
+ form.searchKeyword.value = $("#inputSearchKeyword").val();
|
|
| 110 |
+ form.senderKey.value = $("select[name='selectAgentCode_select']").val();
|
|
| 110 | 111 |
form.pageIndex.value = page; |
| 111 | 112 |
form.action = "/web/mjon/kakao/template/selectKakaoFriendsTemplateListPopupAjax.do"; |
| 112 | 113 |
form.submit(); |
... | ... | @@ -123,9 +124,11 @@ |
| 123 | 124 |
|
| 124 | 125 |
</script> |
| 125 | 126 |
<body> |
| 127 |
+ |
|
| 126 | 128 |
<form id="listForm" name="listForm" method="post"> |
| 127 | 129 |
<input type="hidden" id="pageIndex" name="pageIndex" value="1"/> |
| 128 |
- |
|
| 130 |
+ <input type="hidden" id="searchKeyword" name="searchKeyword" value=""/> |
|
| 131 |
+ <input type="hidden" id="senderKey" name="senderKey" value=""/> |
|
| 129 | 132 |
</form> |
| 130 | 133 |
<div class="info_popup ad_layer template_choice_popup adpopup01" style="width:930px;"> |
| 131 | 134 |
<div class="popup_heading"> |
... | ... | @@ -133,21 +136,22 @@ |
| 133 | 136 |
</div> |
| 134 | 137 |
<div class="layer_in"> |
| 135 | 138 |
<div class="popup_search_wrap type2 grayborder grayfill"> |
| 136 |
- <select name="" id="" class="popup_select_type template_type"> |
|
| 137 |
- <option value="">전체메시지</option> |
|
| 139 |
+ <select name="selectAgentCode_select" id="selectAgentCode_select" class="selType2"> |
|
| 140 |
+ <option value="">채널ID 선택</option> |
|
| 141 |
+ <c:forEach var="kakaoProfileInfo" items="${resultProfileList}" varStatus="status">
|
|
| 142 |
+ <option value="${kakaoProfileInfo.senderKey}" <c:if test="${searchVO.senderKey eq kakaoProfileInfo.senderKey}">selected</c:if> ><c:out value='${kakaoProfileInfo.yellowId}'/></option>
|
|
| 143 |
+ </c:forEach> |
|
| 138 | 144 |
</select> |
| 139 |
- <select name="" id="" class="popup_select_type emphasis_type"> |
|
| 140 |
- <option value="">정렬방법</option> |
|
| 141 |
- </select> |
|
| 142 |
- <input type="text" placeholder="템플릿명을 입력해주세요." class="inputType template_name"> |
|
| 143 |
- <button type="button" class="popup_button_type bluefill">검색</button> |
|
| 145 |
+ <label for="searchKeyword" class="label"></label> |
|
| 146 |
+ <input type="text" class="search_input" id="inputSearchKeyword" name="inputSearchKeyword" value="<c:out value="${searchVO.searchKeyword}"/>" placeholder="템플릿명을 입력하세요." onfocus="this.placeholder=''" onblur="this.placeholder='검색어를 입력하세요.'">
|
|
| 147 |
+ <button type="button" class="btnType btnType2" onclick="selectTemplateListLoad('1');">검색</button>
|
|
| 144 | 148 |
</div> |
| 145 | 149 |
<div class="template_list"> |
| 146 | 150 |
<ul class="kakao_template_list thumbnail_list"> |
| 147 | 151 |
<c:choose> |
| 148 | 152 |
<c:when test="${not empty kakaoTemplateInfoList}">
|
| 149 | 153 |
<c:forEach var="templatInfoList" items="${kakaoTemplateInfoList}" varStatus="status">
|
| 150 |
- <li> |
|
| 154 |
+ <li onClick="fnTemplateDetail('<c:out value="${templatInfoList.friendId}"/>'); return false;" style="cursor:pointer;">
|
|
| 151 | 155 |
<div class="kakao_template_wrap"> |
| 152 | 156 |
<div class="template_cont"> |
| 153 | 157 |
<div class="title"> |
... | ... | @@ -177,10 +181,10 @@ |
| 177 | 181 |
<p class="cf_text">수신거부 | 홈 > 채널차단</p> |
| 178 | 182 |
</c:if> |
| 179 | 183 |
</div> |
| 180 |
- <div class="btn_wrap"> |
|
| 184 |
+ <%-- <div class="btn_wrap"> |
|
| 181 | 185 |
<button type="button" class="btnType btnType3 btn_template_use" onClick="fnTemplateDetail('<c:out value="${templatInfoList.friendId}"/>'); return false;">템플릿 사용하기</button>
|
| 182 |
- </div> |
|
| 183 |
- <%-- <div class="kakao_template_info"> |
|
| 186 |
+ </div> --%> |
|
| 187 |
+ <div class="kakao_template_info"> |
|
| 184 | 188 |
<dl> |
| 185 | 189 |
<dt>템플릿명</dt> |
| 186 | 190 |
<dd> |
... | ... | @@ -191,7 +195,7 @@ |
| 191 | 195 |
<dt>등록일</dt> |
| 192 | 196 |
<dd><c:out value="${templatInfoList.frstRegistPnttm}"/></dd>
|
| 193 | 197 |
</dl> |
| 194 |
- </div> --%> |
|
| 198 |
+ </div> |
|
| 195 | 199 |
</li> |
| 196 | 200 |
</c:forEach> |
| 197 | 201 |
</c:when> |
--- src/main/webapp/js/kakao/ft/friendstalkExcel.js
+++ src/main/webapp/js/kakao/ft/friendstalkExcel.js
... | ... | @@ -29,6 +29,130 @@ |
| 29 | 29 |
//엑셀 파일 불러오기 |
| 30 | 30 |
function excelExport(event){
|
| 31 | 31 |
|
| 32 |
+ var data = new FormData(document.excelForm); |
|
| 33 |
+ data.append("file0", $('#excelFile').prop('files')[0]);
|
|
| 34 |
+ |
|
| 35 |
+ var fileValue = $("#excelFile").val().split("\\");
|
|
| 36 |
+ var fileName = fileValue[fileValue.length-1]; |
|
| 37 |
+ |
|
| 38 |
+ var fileExt = fileName.split('.').pop().toLowerCase();
|
|
| 39 |
+ |
|
| 40 |
+ if(fileExt.length > 0){
|
|
| 41 |
+ if($.inArray(fileExt, ['txt','xls','xlsx']) == -1) {
|
|
| 42 |
+ |
|
| 43 |
+ alert('txt, xls, xlsx 파일만 업로드 할수 있습니다.');
|
|
| 44 |
+ return false; |
|
| 45 |
+ |
|
| 46 |
+ } |
|
| 47 |
+ |
|
| 48 |
+ |
|
| 49 |
+ var url = ""; |
|
| 50 |
+ |
|
| 51 |
+ if(fileExt == "xls" || fileExt == "xlsx"){
|
|
| 52 |
+ |
|
| 53 |
+ url = "/web/mjon/msgdata/sendExelFilePhoneNumAjax.do"; |
|
| 54 |
+ |
|
| 55 |
+ }else if(fileExt = "txt"){
|
|
| 56 |
+ |
|
| 57 |
+ url = "/web/mjon/msgdata/sendTxtFilePhoneNumAjax.do"; |
|
| 58 |
+ |
|
| 59 |
+ }else{
|
|
| 60 |
+ |
|
| 61 |
+ alert('txt, xls, xlsx 파일만 업로드 할수 있습니다.');
|
|
| 62 |
+ return; |
|
| 63 |
+ |
|
| 64 |
+ } |
|
| 65 |
+ |
|
| 66 |
+ //엑셀 데이터 변수에 자료가 있으면 지워준다. |
|
| 67 |
+ if(excelAddr.length > 0){
|
|
| 68 |
+ |
|
| 69 |
+ excelAddr = []; |
|
| 70 |
+ |
|
| 71 |
+ } |
|
| 72 |
+ |
|
| 73 |
+ $.ajax({
|
|
| 74 |
+ type: "POST", |
|
| 75 |
+ enctype: 'multipart/form-data', |
|
| 76 |
+ url: url, |
|
| 77 |
+ data: data, |
|
| 78 |
+ dataType:'json', |
|
| 79 |
+ async: true, |
|
| 80 |
+ processData: false, |
|
| 81 |
+ contentType: false, |
|
| 82 |
+ cache: false, |
|
| 83 |
+ //timeout: 600000, |
|
| 84 |
+ success: function (returnData, status) {
|
|
| 85 |
+ if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
|
|
| 86 |
+ |
|
| 87 |
+ if(returnData.success){
|
|
| 88 |
+ |
|
| 89 |
+ var data = returnData.data; |
|
| 90 |
+ var message = returnData.message; |
|
| 91 |
+ |
|
| 92 |
+ if(message != '' ){
|
|
| 93 |
+ alert(returnData.message); |
|
| 94 |
+ } |
|
| 95 |
+ |
|
| 96 |
+ if(data != null){
|
|
| 97 |
+ |
|
| 98 |
+ $.each(data, function(i, item){
|
|
| 99 |
+ |
|
| 100 |
+ if(checkHpNum(item.phone)){
|
|
| 101 |
+ |
|
| 102 |
+ excelAddr.push({phone: item.phone, name: item.name, rep1: item.replace1, rep2: item.replace2, rep3: item.replace3, rep4: item.replace4});
|
|
| 103 |
+ console.log(item.phone); |
|
| 104 |
+ }/* else{
|
|
| 105 |
+ |
|
| 106 |
+ alert("엑셀 파일 데이터의 형식이 맞지 않는 부분이 있습니다.");
|
|
| 107 |
+ excelAddr = []; //엑셀 데이터 저장 변수 초기화 |
|
| 108 |
+ $("#excelFile").val(""); //첨부파일 input 초기화
|
|
| 109 |
+ $("#excelNm").val(""); // 첨부파일 명 초기화
|
|
| 110 |
+ fileName = ""; |
|
| 111 |
+ return; |
|
| 112 |
+ |
|
| 113 |
+ } */ |
|
| 114 |
+ |
|
| 115 |
+ }); |
|
| 116 |
+ |
|
| 117 |
+ } |
|
| 118 |
+ |
|
| 119 |
+ }else{
|
|
| 120 |
+ alert(returnData.message); |
|
| 121 |
+// alert("첨부파일 불러오는 중 오류가 발생하였습니다.");
|
|
| 122 |
+ excelAddr = []; //엑셀 데이터 저장 변수 초기화 |
|
| 123 |
+ $("#excelFile").val(""); //첨부파일 input 초기화
|
|
| 124 |
+ $("#excelNm").val(""); // 첨부파일 명 초기화
|
|
| 125 |
+ fileName = ""; |
|
| 126 |
+ return; |
|
| 127 |
+ |
|
| 128 |
+ } |
|
| 129 |
+ } else if(status== 'fail'){
|
|
| 130 |
+ alert("첨부파일 불러오는 중 오류가 발생하였습니다.");
|
|
| 131 |
+ console.log("status : fail ~");
|
|
| 132 |
+ } |
|
| 133 |
+ }, |
|
| 134 |
+ error: function (e) {
|
|
| 135 |
+ alert("첨부파일 불러오는 중 오류가 발생하였습니다.");
|
|
| 136 |
+ console.log("ERROR : ", e);
|
|
| 137 |
+ }, |
|
| 138 |
+ beforeSend : function(xmlHttpRequest) {
|
|
| 139 |
+ //로딩창 show |
|
| 140 |
+ $('.loading_layer').addClass('active');
|
|
| 141 |
+ }, |
|
| 142 |
+ complete : function(xhr, textStatus) {
|
|
| 143 |
+ //로딩창 hide |
|
| 144 |
+ $('.loading_layer').removeClass('active');
|
|
| 145 |
+ } |
|
| 146 |
+ }); |
|
| 147 |
+ |
|
| 148 |
+ $("#excelFile").val("");
|
|
| 149 |
+ $("#excelNm").val(fileName);
|
|
| 150 |
+ |
|
| 151 |
+ } |
|
| 152 |
+ |
|
| 153 |
+} |
|
| 154 |
+/*function excelExport(event){
|
|
| 155 |
+ |
|
| 32 | 156 |
var fileValue = $("#excelFile").val().split("\\");
|
| 33 | 157 |
var fileName = fileValue[fileValue.length-1]; |
| 34 | 158 |
|
... | ... | @@ -48,7 +172,7 @@ |
| 48 | 172 |
|
| 49 | 173 |
} |
| 50 | 174 |
|
| 51 |
-} |
|
| 175 |
+}*/ |
|
| 52 | 176 |
|
| 53 | 177 |
|
| 54 | 178 |
//엑셀파일 자료 데이터베이스에 입력해주기 |
--- src/main/webapp/js/kakao/ft/ftTabulator.js
+++ src/main/webapp/js/kakao/ft/ftTabulator.js
... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 |
* @author : 우영두 |
| 4 | 4 |
* @fileName : ftTabulator.js |
| 5 | 5 |
* @date : 2024.01.09 |
| 6 |
- * @description : tabulator 관련 js |
|
| 6 |
+ * @description : 받는사람 목록 tabulator 관련 js |
|
| 7 | 7 |
* =========================================================== |
| 8 | 8 |
* DATE AUTHOR NOTE |
| 9 | 9 |
* ----------------------------------------------------------- * |
... | ... | @@ -14,7 +14,7 @@ |
| 14 | 14 |
*/ |
| 15 | 15 |
|
| 16 | 16 |
$(document).ready(function (){
|
| 17 |
- /** |
|
| 17 |
+ |
|
| 18 | 18 |
//받는사람 연락처 내용 처리 |
| 19 | 19 |
//Tabulator AJAX Data Loading |
| 20 | 20 |
tableL = new Tabulator(".callList_box", {
|
... | ... | @@ -88,7 +88,7 @@ |
| 88 | 88 |
|
| 89 | 89 |
}); |
| 90 | 90 |
|
| 91 |
- */ |
|
| 91 |
+ |
|
| 92 | 92 |
//주소록 불러오기 팝업 내용 |
| 93 | 93 |
//Tabulator AJAX Data Loading |
| 94 | 94 |
tableAddr = new Tabulator(".callAddr_box", {
|
... | ... | @@ -147,38 +147,57 @@ |
| 147 | 147 |
|
| 148 | 148 |
//핸드폰 번호에 '-' 문자 제거하기 |
| 149 | 149 |
callToNum = removeDash(callToNum); |
| 150 |
- |
|
| 151 |
- var dpCnt = 0; |
|
| 152 |
- $(".phoneArea p").each(function(index, item){
|
|
| 153 |
- if(this.textContent == callToNum){
|
|
| 154 |
- |
|
| 155 |
- dpCnt++; |
|
| 156 |
- |
|
| 157 |
- alert("받는사람 리스트에 동일한 연락처가 있습니다.");
|
|
| 158 |
- $('#callTo').val("");
|
|
| 159 |
- return false; |
|
| 160 |
- } |
|
| 161 |
- }); |
|
| 150 |
+ |
|
| 151 |
+ //기존 받는사람 연락처 모두 불러오기 |
|
| 152 |
+ var data = tableL.getRows(); |
|
| 153 |
+ var tableData = []; |
|
| 154 |
+ var dpCnt = 0; |
|
| 155 |
+ for(var i=0; i < tableL.getRows().length; i++){
|
|
| 156 |
+ |
|
| 157 |
+ if(callToNum == data[i].getData().phone){
|
|
| 158 |
+ |
|
| 159 |
+ dpCnt++; |
|
| 160 |
+ |
|
| 161 |
+ } |
|
| 162 |
+ |
|
| 163 |
+ } |
|
| 164 |
+ |
|
| 165 |
+ if(dpCnt > 0){
|
|
| 166 |
+ |
|
| 167 |
+ alert("받는사람 리스트에 동일한 연락처가 있습니다.");
|
|
| 168 |
+ $('#callTo').val("");
|
|
| 169 |
+ return false; |
|
| 170 |
+ |
|
| 171 |
+ }else{
|
|
| 172 |
+ |
|
| 173 |
+ tabledata = [{phone: callToNum},];
|
|
| 174 |
+ |
|
| 175 |
+ //빈 row 데이터 삭제하기 |
|
| 176 |
+ var befData = tableL.getRows(); |
|
| 177 |
+ var totLen = tableL.getRows().length; |
|
| 178 |
+ |
|
| 179 |
+ for(var i=0; i < totLen; i++){
|
|
| 180 |
+ |
|
| 181 |
+ tableData.push({phone: data[i].getData().phone.trim(), name: data[i].getData().name});
|
|
| 182 |
+ |
|
| 183 |
+ } |
|
| 184 |
+ |
|
| 185 |
+ //연락처 추가해 주기 |
|
| 186 |
+ addPhoneInfo(tabledata); |
|
| 187 |
+ |
|
| 188 |
+ //tableL.addData(tabledata); |
|
| 189 |
+ |
|
| 190 |
+ //전체 데이터 갯수 구하기 |
|
| 191 |
+ //totRows = tableL.getRows().length; |
|
| 192 |
+ //updateTotCnt(totRows); |
|
| 193 |
+ |
|
| 194 |
+ //결제 금액 구하기 |
|
| 195 |
+ totalPriceSum(totRows); |
|
| 196 |
+ |
|
| 197 |
+ $('#callTo').val("");
|
|
| 198 |
+ |
|
| 199 |
+ } |
|
| 162 | 200 |
|
| 163 |
- if(dpCnt > 0){
|
|
| 164 |
- alert("받는사람 리스트에 동일한 연락처가 있습니다.");
|
|
| 165 |
- $('#callTo').val("");
|
|
| 166 |
- return false; |
|
| 167 |
- }else{
|
|
| 168 |
- // fn_displayJsonToHtmlTable 재사용을 위한 |
|
| 169 |
- // 파라미터 형변환 |
|
| 170 |
- var data =[]; |
|
| 171 |
- data.push({ phone: callToNum, name: ''});
|
|
| 172 |
- fn_displayJsonToHtmlTable(data); |
|
| 173 |
- |
|
| 174 |
- /* |
|
| 175 |
- * 토탈 카운트 화면에 노출 |
|
| 176 |
- */ |
|
| 177 |
- updateTotCnt(); |
|
| 178 |
- |
|
| 179 |
- // 번호 추가란 초기화 |
|
| 180 |
- $('#callTo').val('');
|
|
| 181 |
- } |
|
| 182 | 201 |
}); |
| 183 | 202 |
|
| 184 | 203 |
|
... | ... | @@ -449,68 +468,104 @@ |
| 449 | 468 |
} |
| 450 | 469 |
|
| 451 | 470 |
//주소록 불러오기에서 수신자 리스트 화면에 추가해주기 |
| 452 |
-function addPhoneInfo(taData){
|
|
| 471 |
+function addPhoneInfo(data){
|
|
| 453 | 472 |
|
| 454 |
- if(taData == null){
|
|
| 473 |
+ if(data == null){
|
|
| 474 |
+ |
|
| 455 | 475 |
alert("연락처 정보가 없습니다.");
|
| 456 | 476 |
return; |
| 477 |
+ |
|
| 478 |
+ }else{
|
|
| 479 |
+ |
|
| 480 |
+ var idx = 0; |
|
| 481 |
+ var newData = data;//중복 연락처는 하나만 남기고 모두 제거 |
|
| 482 |
+ |
|
| 483 |
+ var recTableData = tableL.getRows(); // 받는사람 리스트의 전체 목록을 저장 |
|
| 484 |
+ var tableData = []; |
|
| 485 |
+ |
|
| 486 |
+ //기존 받는사람 리스트를 배열에 미리 담아둔다. |
|
| 487 |
+ if(recTableData.length > 0){
|
|
| 488 |
+ |
|
| 489 |
+ for(var j=0; j < recTableData.length; j++){
|
|
| 490 |
+ |
|
| 491 |
+ tableData.push({phone: removeDash(recTableData[j].getData().phone) , name: recTableData[j].getData().name, rep1: recTableData[j].getData().rep1, rep2: recTableData[j].getData().rep2, rep3: recTableData[j].getData().rep3, rep4: recTableData[j].getData().rep4});
|
|
| 492 |
+ |
|
| 493 |
+ } |
|
| 494 |
+ |
|
| 495 |
+ } |
|
| 496 |
+ |
|
| 497 |
+ //받는사람 리스트를 담아둔 배열에 신규 추가 데이터를 추가해 준다. |
|
| 498 |
+ for(var i=0; i < newData.length; i++){
|
|
| 499 |
+ |
|
| 500 |
+ tableData.push({phone: removeDash(newData[i].phone) , name: newData[i].name, rep1: newData[i].rep1, rep2: newData[i].rep2, rep3: newData[i].rep3, rep4: newData[i].rep4});
|
|
| 501 |
+ |
|
| 502 |
+ } |
|
| 503 |
+ |
|
| 504 |
+ var temp = tableData.length; |
|
| 505 |
+ |
|
| 506 |
+ //기존 수신 리스트를 지워준 후 신규 전체 리스트를 추가해준다. |
|
| 507 |
+ tableL.clearData(); //기존 받는사람 목록을 삭제. |
|
| 508 |
+ tableL.addData(dupliPhoneData(tableData)); // 받는사람 목록에 주소 정보 입력하기 |
|
| 509 |
+ _fileForm2 = []; //form file data 초기화 |
|
| 510 |
+ _fileIdx = 0; //form file idx 초기화 |
|
| 511 |
+ |
|
| 512 |
+ totRows = tableL.getRows().length; |
|
| 513 |
+ updateTotCnt(totRows); //전체 데이터 갯수 구하기 |
|
| 514 |
+ |
|
| 515 |
+ var smsTxtArea = $('#smsTxtArea').val();
|
|
| 516 |
+ //일괄변환 문구 결제금액 처리 |
|
| 517 |
+ if(smsTxtArea.indexOf("[*이름*]") > -1
|
|
| 518 |
+ || smsTxtArea.indexOf("[*1*]") > -1
|
|
| 519 |
+ || smsTxtArea.indexOf("[*2*]") > -1
|
|
| 520 |
+ || smsTxtArea.indexOf("[*3*]") > -1
|
|
| 521 |
+ || smsTxtArea.indexOf("[*4*]") > -1){
|
|
| 522 |
+ |
|
| 523 |
+ fnReplCell(); |
|
| 524 |
+ |
|
| 525 |
+ }else{
|
|
| 526 |
+ |
|
| 527 |
+ //결제 금액 구하기 |
|
| 528 |
+ totalPriceSum(totRows); |
|
| 529 |
+ |
|
| 530 |
+ } |
|
| 531 |
+ |
|
| 457 | 532 |
} |
| 458 | 533 |
|
| 459 |
- /* |
|
| 460 |
- * 주소록 데이터 화면에 추가 |
|
| 461 |
- */ |
|
| 462 |
- this.fn_displayJsonToHtmlTable(taData); |
|
| 534 |
+} |
|
| 463 | 535 |
|
| 464 |
- /* |
|
| 465 |
- * 토탈 카운트 화면에 노출 |
|
| 466 |
- */ |
|
| 467 |
- this.updateTotCnt(); |
|
| 536 |
+ |
|
| 537 |
+function addrToList(){
|
|
| 538 |
+ |
|
| 539 |
+ var selectedData = tableAddr.getSelectedRows(); |
|
| 540 |
+ var tableData = []; |
|
| 541 |
+ |
|
| 542 |
+ if(selectedData == "" || selectedData == null){
|
|
| 468 | 543 |
|
| 544 |
+ alert("주소록을 선택해 주세요.");
|
|
| 545 |
+ return false; |
|
| 546 |
+ |
|
| 547 |
+ }else{ // 선택한 Row 데이터 저장해주기
|
|
| 548 |
+ |
|
| 549 |
+ for(var i=0; i < selectedData.length; i++){
|
|
| 550 |
+ |
|
| 551 |
+ //좌측 받는사람 리스트를 담아둔 배열에 데이터를 추가해 준다. |
|
| 552 |
+ tableData.push({phone: removeDash(selectedData[i].getData().addrPhone),
|
|
| 553 |
+ name: selectedData[i].getData().addrName, |
|
| 554 |
+ rep1: selectedData[i].getData().addrRep1, |
|
| 555 |
+ rep2: selectedData[i].getData().addrRep2, |
|
| 556 |
+ rep3: selectedData[i].getData().addrRep3, |
|
| 557 |
+ rep4: selectedData[i].getData().addrRep4} |
|
| 558 |
+ ); |
|
| 559 |
+ |
|
| 560 |
+ } |
|
| 561 |
+ |
|
| 562 |
+ //선택한 데이터 받는사람 리스트에 추가해 주기 |
|
| 563 |
+ addPhoneInfo(tableData); |
|
| 564 |
+ $(".closeAddr").trigger("click");
|
|
| 565 |
+ |
|
| 566 |
+ //주소록 레이어 팝업의 Tabulator 데이터 지워주기 |
|
| 567 |
+ tableAddr.clearData(); |
|
| 568 |
+ |
|
| 569 |
+ } |
|
| 570 |
+ |
|
| 469 | 571 |
} |
| 470 |
- |
|
| 471 |
-/* |
|
| 472 |
-* 주소록 데이터 화면에 추가 |
|
| 473 |
-*/ |
|
| 474 |
-function fn_displayJsonToHtmlTable(taData){
|
|
| 475 |
- |
|
| 476 |
- // fn_viewDataInit01(); |
|
| 477 |
- // 치환문자가 있으면 데이터 초기화 |
|
| 478 |
- |
|
| 479 |
- |
|
| 480 |
- var $htmlBody = $('#wrap01_body');
|
|
| 481 |
- |
|
| 482 |
- var addHtml = '<div class="list_table list_body excelBody01">' |
|
| 483 |
- +'\t<div class="cb_wrap">' |
|
| 484 |
- +'\t\t<label for="" class="label"></label>' |
|
| 485 |
- +'\t\t<input type="checkbox" class="wrap01C">' |
|
| 486 |
- +'\t</div>' |
|
| 487 |
- +'\t<div class="list_table_num phoneArea">' |
|
| 488 |
- +'\t\t<p>$PHONE$</p>' |
|
| 489 |
- +'\t</div>' |
|
| 490 |
- /*23.04.06 이름제거 요청으로인한 화면 이름 제거*/ |
|
| 491 |
- /*+'\t<div class="list_table_name">' |
|
| 492 |
- +'\t\t<p>$NAME$</p>' |
|
| 493 |
- +'\t</div>'*/ |
|
| 494 |
- +'</div>'; |
|
| 495 |
- |
|
| 496 |
- |
|
| 497 |
- |
|
| 498 |
- |
|
| 499 |
- var totalDuplCnt = $('#rowDupCnt').text();
|
|
| 500 |
- |
|
| 501 |
- var itemPhone; |
|
| 502 |
- var itemName; |
|
| 503 |
- $.each(taData, function(index, item){
|
|
| 504 |
- itemPhone = item.phone; |
|
| 505 |
- itemName = item.name; |
|
| 506 |
- // == null ? '': item.name; |
|
| 507 |
- if(!phoneDupl(itemPhone)) |
|
| 508 |
- /*23.04.06 이름제거 요청으로인한 화면 이름 제거*/ |
|
| 509 |
-// $htmlBody.append(addHtml.replace('$PHONE$', itemPhone).replace('$NAME$', itemName ??= ''));
|
|
| 510 |
- $htmlBody.append(addHtml.replace('$PHONE$', itemPhone));
|
|
| 511 |
- else |
|
| 512 |
- totalDuplCnt++; |
|
| 513 |
- }); |
|
| 514 |
- $('#rowDupCnt').text(totalDuplCnt);
|
|
| 515 |
-} |
|
| 516 |
- |
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?