주소록 30만건 테스트 - js 15000건
This commit is contained in:
parent
c460ab2e3f
commit
364328c959
@ -416,35 +416,95 @@ public class AddrVO extends ComDefaultVO{
|
||||
private int page = 1; // 기본 값 설정
|
||||
private int size = 10; // 기본 값 설정
|
||||
private int offset; // 기본 값 설정
|
||||
private String name;
|
||||
private String phone;
|
||||
private String rep1;
|
||||
private String rep2;
|
||||
private String rep3;
|
||||
private String rep4;
|
||||
|
||||
|
||||
|
||||
|
||||
public int getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public void setPage(int page) {
|
||||
if(page > 0) {
|
||||
this.page = page;
|
||||
}
|
||||
}
|
||||
|
||||
public int getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setSize(int size) {
|
||||
if(size > 0) {
|
||||
this.size = size;
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET 계산 메서드 추가
|
||||
public int getOffset() {
|
||||
return (page - 1) * size;
|
||||
}
|
||||
public int getOffset() {
|
||||
return offset;
|
||||
}
|
||||
public void setOffset(int offset) {
|
||||
this.offset = offset;
|
||||
}
|
||||
public void setSize(int size) {
|
||||
this.size = size;
|
||||
}
|
||||
public void setPage(int page) {
|
||||
this.page = page;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
public String getRep1() {
|
||||
return rep1;
|
||||
}
|
||||
public void setRep1(String rep1) {
|
||||
this.rep1 = rep1;
|
||||
}
|
||||
public String getRep2() {
|
||||
return rep2;
|
||||
}
|
||||
public void setRep2(String rep2) {
|
||||
this.rep2 = rep2;
|
||||
}
|
||||
public String getRep3() {
|
||||
return rep3;
|
||||
}
|
||||
public void setRep3(String rep3) {
|
||||
this.rep3 = rep3;
|
||||
}
|
||||
public String getRep4() {
|
||||
return rep4;
|
||||
}
|
||||
public void setRep4(String rep4) {
|
||||
this.rep4 = rep4;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// public void setPage(int page) {
|
||||
// if(page > 0) {
|
||||
// this.page = page;
|
||||
// }
|
||||
// }
|
||||
|
||||
//
|
||||
// public void setSize(int size) {
|
||||
// if(size > 0) {
|
||||
// this.size = size;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // OFFSET 계산 메서드 추가
|
||||
// public int getOffset() {
|
||||
// return (page - 1) * size;
|
||||
// }
|
||||
// public void setOffset(int offset) {
|
||||
// this.offset = offset;
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ public class AddrServiceImpl extends EgovAbstractServiceImpl implements AddrSer
|
||||
private static final Charset EUC_KR = Charset.forName("EUC-KR");
|
||||
// private static final int MAX_ADDR_CNT = 500000;
|
||||
//임시 500만개
|
||||
private static final int MAX_SINGLE_ENTRY_CNT = 1000000;
|
||||
private static final int MAX_SINGLE_ENTRY_CNT = 350000;
|
||||
private static final int MAX_ADDR_CNT = 10000000;
|
||||
private static final int BATCH_SIZE = 5000;
|
||||
private static final int THREAD_COUNT = 3;
|
||||
@ -493,7 +493,7 @@ public class AddrServiceImpl extends EgovAbstractServiceImpl implements AddrSer
|
||||
// 등록
|
||||
// Batch insert
|
||||
batchInsertAddrListAsync(addrListVO);
|
||||
// addrDAO.insertAddrList(addrListVO);
|
||||
// addrDAO.insertAddrList(addrListVO);
|
||||
|
||||
}
|
||||
|
||||
@ -524,8 +524,8 @@ public class AddrServiceImpl extends EgovAbstractServiceImpl implements AddrSer
|
||||
return new StatusResponse(
|
||||
HttpStatus.OK
|
||||
, message
|
||||
// , ""
|
||||
, LocalDateTime.now());
|
||||
, addrListVO.get(0).getAddrGrpId()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.net.URLDecoder;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
@ -74,6 +75,7 @@ import itn.com.utl.fcc.service.EgovStringUtil;
|
||||
import itn.let.lett.service.HashConfVO;
|
||||
import itn.let.lett.service.LetterService;
|
||||
import itn.let.lett.service.LetterVO;
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
import itn.let.mjo.addr.service.AddrGroupService;
|
||||
import itn.let.mjo.addr.service.AddrGroupVO;
|
||||
import itn.let.mjo.addr.service.AddrService;
|
||||
@ -1787,7 +1789,7 @@ public class MjonMsgDataController {
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value= {"/web/mjon/msgdata/selectMsgAddrListAjax_advc.do"})
|
||||
public ResponseEntity<?> selectMsgAddrListAjax_advc(@ModelAttribute("searchVO") AddrVO addrVO) {
|
||||
public ResponseEntity<StatusResponse> selectMsgAddrListAjax_advc(@ModelAttribute("searchVO") AddrVO addrVO) {
|
||||
|
||||
Map<String, Object> response = new HashMap<>();
|
||||
|
||||
@ -1796,11 +1798,7 @@ public class MjonMsgDataController {
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated() ? (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser() : null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if (userId.isEmpty()) {
|
||||
response.put("result", "loginFail");
|
||||
response.put("message", "로그인 후 이용이 가능합니다.");
|
||||
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(response);
|
||||
}
|
||||
if(StringUtils.isEmpty(userId)) return ResponseEntity.ok().body(new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용해 주세요", LocalDateTime.now()));
|
||||
|
||||
addrVO.setMberId(userId);
|
||||
|
||||
@ -1809,21 +1807,21 @@ public class MjonMsgDataController {
|
||||
addrVO.setOffset(offset);
|
||||
// 데이터 조회
|
||||
List<AddrVO> resultAddrList = mjonMsgDataService.selectMsgAddrListAjax_advc(addrVO);
|
||||
int totalCount = mjonMsgDataService.countByMsgAddrListAjax_advc(addrVO); // 필터에 맞는 총 레코드 수 가져오기
|
||||
// int totalCount = mjonMsgDataService.countByMsgAddrListAjax_advc(addrVO); // 필터에 맞는 총 레코드 수 가져오기
|
||||
|
||||
// 페이지네이션 계산
|
||||
int lastPage = (int) Math.ceil((double) totalCount / addrVO.getSize());
|
||||
// int lastPage = (int) Math.ceil((double) totalCount / addrVO.getSize());
|
||||
|
||||
// 응답 데이터 구성
|
||||
response.put("data", resultAddrList);
|
||||
response.put("last_page", lastPage); // 클라이언트가 사용할 수 있도록 last_page 포함
|
||||
response.put("total_count", totalCount); // 필요 시, 총 레코드 수 포함
|
||||
// response.put("data", resultAddrList);
|
||||
// response.put("last_page", lastPage); // 클라이언트가 사용할 수 있도록 last_page 포함
|
||||
// response.put("total_count", totalCount); // 필요 시, 총 레코드 수 포함
|
||||
|
||||
return ResponseEntity.ok().body(new StatusResponse(HttpStatus.OK, "",resultAddrList));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
|
||||
return ResponseEntity.ok().body(new StatusResponse(HttpStatus.BAD_REQUEST, "조회 요청 중 오류가 발생하였습니다.", LocalDateTime.now()));
|
||||
}
|
||||
return ResponseEntity.ok(response); // resultAddrList만 반환
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -3715,12 +3715,12 @@
|
||||
SELECT A.ADDR_ID AS addrId,
|
||||
A.ADDR_GRP_ID AS addrGrpId,
|
||||
A.MBER_ID AS mberId,
|
||||
A.ADDR_NM AS addrName,
|
||||
A.ADDR_PHONE_NO AS addrPhone,
|
||||
A.ADDR_INFO1 AS addrRep1,
|
||||
A.ADDR_INFO2 AS addrRep2,
|
||||
A.ADDR_INFO3 AS addrRep3,
|
||||
A.ADDR_INFO4 AS addrRep4,
|
||||
A.ADDR_NM AS name,
|
||||
A.ADDR_PHONE_NO AS phone,
|
||||
A.ADDR_INFO1 AS rep1,
|
||||
A.ADDR_INFO2 AS rep2,
|
||||
A.ADDR_INFO3 AS rep3,
|
||||
A.ADDR_INFO4 AS rep4,
|
||||
A.DELETE_YN AS deleteYn,
|
||||
A.BOOKMARK AS bookmark,
|
||||
IFNULL(B.ADDR_GRP_NM,'그룹미지정') AS addrGroupNm
|
||||
@ -3764,7 +3764,6 @@
|
||||
</isEqual>
|
||||
</isNotEmpty>
|
||||
ORDER BY A.ADDR_NM ASC, A.LAST_UPDT_PNTTM DESC
|
||||
LIMIT #size# OFFSET #offset#
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
@ -328,22 +328,28 @@ function SetAddrMassSave(){
|
||||
//로딩창 show
|
||||
fn_loadAddActive();
|
||||
|
||||
console.time('updateData');
|
||||
setTimeout(setSenderList_advc, 1000);
|
||||
// setTimeout(setSenderList_old, 1000);
|
||||
|
||||
console.timeEnd('updateData');
|
||||
// fn_loadAddActive();
|
||||
// setSenderList_advc();
|
||||
}
|
||||
}
|
||||
|
||||
// 주소록 등록 advc
|
||||
/* function setSenderList_advc(){
|
||||
function setSenderList_old(){
|
||||
|
||||
// tab에 해당하는 타블레이터 가져오기
|
||||
var $objTabul = fn_utils_getTabulator();
|
||||
var dataToSend = $objTabul.getData();
|
||||
|
||||
var addrGrpIdInfo = $("#addrGrpIdInfo").val();
|
||||
var addrGrpNmInfo = $("#addrGrpNm").val();
|
||||
|
||||
var tabulNm = fn_utils_getTabulatorNm();
|
||||
var tabluC = '.'+tabulNm
|
||||
|
||||
var $objTabul = fn_utils_getTabulator();
|
||||
var dataToSend = $objTabul.getData();
|
||||
var addrGrpIdInfo = $(tabluC+" #addrGrpIdInfo option:selected").val();
|
||||
var addrGrpNmInfo = $(tabluC+" #addrGrpNm").val();
|
||||
|
||||
var updateData = dataToSend.map(row => {
|
||||
row.addrGrpId = addrGrpIdInfo;
|
||||
@ -367,7 +373,7 @@ function SetAddrMassSave(){
|
||||
alert(data.message);
|
||||
// 데이터 비우기
|
||||
SetClear($objTabul);
|
||||
|
||||
setAddrMassClose();
|
||||
var selectMassVal = $("#addrGrpIdInfo option:selected").val();
|
||||
}
|
||||
else {
|
||||
@ -388,16 +394,19 @@ function SetAddrMassSave(){
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
function setSenderList_advc(){
|
||||
|
||||
var tabulNm = fn_utils_getTabulatorNm();
|
||||
var tabluC = '.'+tabulNm
|
||||
|
||||
var $objTabul = fn_utils_getTabulator();
|
||||
var dataToSend = $objTabul.getData();
|
||||
var addrGrpIdInfo = $("#addrGrpIdInfo").val();
|
||||
var addrGrpNmInfo = $("#addrGrpNm").val();
|
||||
var addrGrpIdInfo = $(tabluC+" #addrGrpIdInfo option:selected").val();
|
||||
var addrGrpNmInfo = $(tabluC+" #addrGrpNm").val();
|
||||
|
||||
var batchSize = 50000; // 배치 크기
|
||||
var batchSize = 15000; // 배치 크기
|
||||
var totalBatches = Math.ceil(dataToSend.length / batchSize); // 총 배치 수
|
||||
var currentBatch = 0; // 현재 배치 인덱스
|
||||
|
||||
@ -411,13 +420,11 @@ function setSenderList_advc(){
|
||||
var end = Math.min(start + batchSize, dataToSend.length);
|
||||
var batchData = dataToSend.slice(start, end);
|
||||
|
||||
console.time('updateData');
|
||||
var updateData = batchData.map(row => {
|
||||
row.addrGrpId = addrGrpIdInfo;
|
||||
row.addrGrpNm = addrGrpNmInfo;
|
||||
return row;
|
||||
});
|
||||
console.timeEnd('updateData');
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
@ -437,8 +444,12 @@ function setSenderList_advc(){
|
||||
alert("모든 데이터가 성공적으로 저장되었습니다.");
|
||||
// 데이터 비우기
|
||||
SetClear($objTabul);
|
||||
setAddrMassClose();
|
||||
} else {
|
||||
currentBatch++;
|
||||
// 새로만든 그룹ID나 기존 ID를 넣어줌
|
||||
// 그룹추가 시 배치별로 똑같은 그룹을 생성해서 방지차원으로 넣어줌
|
||||
addrGrpIdInfo = data.object;
|
||||
sendBatch(); // 다음 배치 전송
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -40,20 +40,20 @@ $(document).ready(function(){
|
||||
}},
|
||||
// {formatter:"rownum", align:"center", title:"No", hozAlign:"center", headerHozAlign:"center", field:"No", width:30},
|
||||
{formatter:"rownum", align:"center" ,title:"No", hozAlign:"center", headerHozAlign:"center", width:40},
|
||||
{title:"이름", field:"name", validator:["maxLength:12"], cellEdited:function(cell){
|
||||
{title:"이름", field:"name", editor:false, validator:["maxLength:12"], cellEdited:function(cell){
|
||||
fnReplCell();
|
||||
}},
|
||||
{title:"휴대폰", field:"phone", width:100, validator:["required","minLength:10", "maxLength:12"]},
|
||||
{title:"[*1*]", field:"rep1", minWidth:60, validator:["maxLength:40"], cellEdited:function(cell){
|
||||
{title:"휴대폰", field:"phone", width:100, editor:false, validator:["required","minLength:10", "maxLength:12"]},
|
||||
{title:"[*1*]", field:"rep1", minWidth:60, editor:false, validator:["maxLength:40"], cellEdited:function(cell){
|
||||
fnReplCell();
|
||||
}},
|
||||
{title:"[*2*]", field:"rep2", minWidth:60, validator:["maxLength:40"], cellEdited:function(cell){
|
||||
{title:"[*2*]", field:"rep2", minWidth:60, editor:false, validator:["maxLength:40"], cellEdited:function(cell){
|
||||
fnReplCell();
|
||||
}},
|
||||
{title:"[*3*]", field:"rep3", minWidth:60, validator:["maxLength:40"], cellEdited:function(cell){
|
||||
{title:"[*3*]", field:"rep3", minWidth:60, editor:false, validator:["maxLength:40"], cellEdited:function(cell){
|
||||
fnReplCell();
|
||||
}},
|
||||
{title:"[*4*]", field:"rep4", minWidth:60, validator:["maxLength:40"], cellEdited:function(cell){
|
||||
{title:"[*4*]", field:"rep4", minWidth:60, editor:false, validator:["maxLength:40"], cellEdited:function(cell){
|
||||
fnReplCell();
|
||||
}},
|
||||
|
||||
@ -96,31 +96,20 @@ $(document).ready(function(){
|
||||
placeholder: "주소록 그룹을 선택해 주세요.",
|
||||
resizableColumns: false,
|
||||
progressiveLoad:"scroll",
|
||||
// progressiveLoadScrollMargin:300, //trigger next ajax load when scroll bar is 300px or less from the bottom of the table.
|
||||
ajaxURL: "/web/mjon/msgdata/selectMsgAddrListAjax_advc.do", // 데이터 URL 설정
|
||||
ajaxConfig: {
|
||||
method: "GET",
|
||||
},
|
||||
ajaxParams: { // Initial AJAX parameters
|
||||
size: 350000, // Set initial page size
|
||||
type: "", // Default value, can be updated later
|
||||
searchAddrGrpId: "", // Default value, can be updated later
|
||||
searchKeyword: "", // Default value, can be updated later
|
||||
searchCondition: "" // Default value, can be updated later
|
||||
},
|
||||
columns: [
|
||||
{formatter: "rowSelection", titleFormatter: "rowSelection", clipboard: false, hozAlign: "center", headerSort: false, cellClick: function(e, cell) {
|
||||
cell.getRow().toggleSelect();
|
||||
}
|
||||
},
|
||||
{formatter: "rowSelection", clipboard: false, hozAlign: "center", headerSort: false},
|
||||
// {formatter: "rowSelection", titleFormatter: "rowSelection", clipboard: false, hozAlign: "center", headerSort: false, cellClick: function(e, cell) {
|
||||
// cell.getRow().toggleSelect();
|
||||
// }
|
||||
// },
|
||||
{formatter: "rownum", align: "center", title: "No", hozAlign: "center", headerHozAlign: "center", width: 60},
|
||||
{title: "그룹명", hozAlign: "center", field: "addrGroupNm", editor: "input", width: 100, validator: ["required", "minLength:2", "maxLength:40"]},
|
||||
{title: "이름", hozAlign: "center", field: "addrName", editor: "input", width: 100, validator: ["maxLength:12"]},
|
||||
{title: "휴대폰번호", hozAlign: "center", field: "addrPhone", editor: "input", width: 100, validator: ["required", "minLength:10", "maxLength:11"]},
|
||||
{title: "[*1*]", hozAlign: "center", field: "addrRep1", editor: "input", width: 84, validator: ["maxLength:40"]},
|
||||
{title: "[*2*]", hozAlign: "center", field: "addrRep2", editor: "input", width: 84, validator: ["maxLength:40"]},
|
||||
{title: "[*3*]", hozAlign: "center", field: "addrRep3", editor: "input", width: 84, validator: ["maxLength:40"]},
|
||||
{title: "[*4*]", hozAlign: "center", field: "addrRep4", editor: "input", width: 84, validator: ["maxLength:40"]},
|
||||
{title: "그룹명", hozAlign: "center", field: "addrGroupNm", editor: false, width: 100, validator: ["required", "minLength:2", "maxLength:40"]},
|
||||
{title: "이름", hozAlign: "center", field: "name", editor: false, width: 100, validator: ["maxLength:12"]},
|
||||
{title: "휴대폰번호", hozAlign: "center", field: "phone", editor: false, width: 100, validator: ["required", "minLength:10", "maxLength:11"]},
|
||||
{title: "[*1*]", hozAlign: "center", field: "rep1", editor: false, width: 84, validator: ["maxLength:40"]},
|
||||
{title: "[*2*]", hozAlign: "center", field: "rep2", editor: false, width: 84, validator: ["maxLength:40"]},
|
||||
{title: "[*3*]", hozAlign: "center", field: "rep3", editor: false, width: 84, validator: ["maxLength:40"]},
|
||||
{title: "[*4*]", hozAlign: "center", field: "rep4", editor: false, width: 84, validator: ["maxLength:40"]},
|
||||
],
|
||||
validationFailed: function(cell, value, parameters) {
|
||||
var valid = cell.isValid();
|
||||
@ -137,6 +126,7 @@ $(document).ready(function(){
|
||||
}
|
||||
cell.setValue("");
|
||||
}
|
||||
console.log('parameters : ', parameters);
|
||||
return value % parameters.addrPhone;
|
||||
},
|
||||
});
|
||||
@ -198,8 +188,8 @@ function updateButtons(currentIndex ) {
|
||||
|
||||
|
||||
var dataLength = tableL.getData().length;
|
||||
console.log('dataLength ', dataLength);
|
||||
console.log('currentIndex ', currentIndex);
|
||||
// console.log('dataLength ', dataLength);
|
||||
// console.log('currentIndex ', currentIndex);
|
||||
|
||||
|
||||
if (currentIndex <= 0) {
|
||||
@ -263,86 +253,7 @@ function updateTotCnt(data){
|
||||
|
||||
}
|
||||
|
||||
//주소록 불러오기에서 수신자 리스트 tabulator에 데이터 추가해주기
|
||||
function addPhoneInfo_advc(tableAddr){
|
||||
|
||||
// 기존 tableL의 데이터를 가져옵니다.
|
||||
var existingData = tableL.getData();
|
||||
|
||||
// 새로운 addrData를 만듭니다.
|
||||
var addrData = tableAddr.getSelectedData().map((row, index) => ({
|
||||
name: row.addrName,
|
||||
phone: removeDash(row.addrPhone),
|
||||
rep1: row.addrRep1,
|
||||
rep2: row.addrRep2,
|
||||
rep3: row.addrRep3,
|
||||
rep4: row.addrRep4,
|
||||
}));
|
||||
|
||||
// 기존 데이터와 새로운 데이터를 합칩니다.
|
||||
var combinedData = existingData.concat(addrData);
|
||||
|
||||
// 합쳐진 데이터를 tableL에 설정합니다.
|
||||
tableL.setData(combinedData);
|
||||
|
||||
/*
|
||||
var idx = 0;
|
||||
var newData = data;//중복 연락처는 하나만 남기고 모두 제거
|
||||
|
||||
var recTableData = tableL.getRows(); // 받는사람 리스트의 전체 목록을 저장
|
||||
var tableData = [];
|
||||
|
||||
//기존 받는사람 리스트를 배열에 미리 담아둔다.
|
||||
if(recTableData.length > 0){
|
||||
|
||||
for(var j=0; j < recTableData.length; j++){
|
||||
|
||||
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});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//받는사람 리스트를 담아둔 배열에 신규 추가 데이터를 추가해 준다.
|
||||
for(var i=0; i < newData.length; i++){
|
||||
|
||||
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});
|
||||
|
||||
}
|
||||
|
||||
// var temp = tableData.length;
|
||||
|
||||
//기존 수신 리스트를 지워준 후 신규 전체 리스트를 추가해준다.
|
||||
tableL.clearData(); //기존 받는사람 목록을 삭제.
|
||||
//tableL.addData(dupliPhoneData(tableData)); // 받는사람 목록에 주소 정보 입력하기
|
||||
tableL.addData(getSpupDupliPhoneDataChk(tableData)); // 받는사람 목록에 주소 정보 입력하기
|
||||
|
||||
_fileForm2 = []; //form file data 초기화
|
||||
_fileIdx = 0; //form file idx 초기화
|
||||
|
||||
|
||||
//일괄변환 문구 결제금액 처리
|
||||
*/
|
||||
totRows = tableL.getRows().length;
|
||||
updateTotCnt(totRows); //전체 데이터 갯수 구하기
|
||||
var smsTxtArea = $('#smsTxtArea').val();
|
||||
if(smsTxtArea.indexOf("[*이름*]") > -1
|
||||
|| smsTxtArea.indexOf("[*1*]") > -1
|
||||
|| smsTxtArea.indexOf("[*2*]") > -1
|
||||
|| smsTxtArea.indexOf("[*3*]") > -1
|
||||
|| smsTxtArea.indexOf("[*4*]") > -1){
|
||||
|
||||
fnReplCell();
|
||||
|
||||
}else{
|
||||
|
||||
//결제 금액 구하기
|
||||
totalPriceSum(totRows);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function addPhoneInfo(data){
|
||||
|
||||
if(data == null){
|
||||
@ -2860,37 +2771,43 @@ function fnAddrGrpSearch(){
|
||||
|
||||
|
||||
//주소록 불러오기 팝업의 그룹 선택시 우측에 주소록 불러오기
|
||||
function fnSelectAddrList(type, addrGrpId, item) {
|
||||
// 폴더 이미지 초기화 및 설정
|
||||
function fnSelectAddrList(type,addrGrpId,item){
|
||||
|
||||
// 주소록 그룹 열림, 닫힘 폴더이미지 초기화
|
||||
$(".adr_pop_list div p").each(function (index, item) {
|
||||
$(item).find("img").attr("src", "/publish/images/content/close_folder2.png");
|
||||
$(item).find("img").attr("alt", "폴더 닫힘");
|
||||
});
|
||||
|
||||
// var form = document.searchAddrGrpForm;
|
||||
// form.type.value = type;
|
||||
// form.searchAddrGrpId.value = addrGrpId;
|
||||
// form.searchKeyword.value = "";
|
||||
// form.searchCondition.value = form.searchAddrCondition.value;
|
||||
|
||||
// 왼쪽 그룹리스트의 그룹명을 선택 시 검색어를 초기화해준다.
|
||||
// form.searchAddrKeyword.value = "";
|
||||
|
||||
|
||||
var form = document.searchAddrGrpForm;
|
||||
form.type.value = type;
|
||||
form.searchAddrGrpId.value = addrGrpId;
|
||||
form.searchKeyword.value = "";
|
||||
form.searchCondition.value = form.searchAddrCondition.value;
|
||||
|
||||
//왼쪽 그룹리스트의 그룸명을 선택시 검색어를 초기화해준다.
|
||||
form.searchAddrKeyword.value="";
|
||||
|
||||
/*
|
||||
$(item).toggleClass("open");
|
||||
if ($(item).hasClass("open") === true) {
|
||||
$(item).find("img").attr("src", "/publish/images/content/open_folder2.png");
|
||||
$(item).find("img").attr("alt", "폴더 열림");
|
||||
}
|
||||
else {
|
||||
$(item).find("img").attr("src", "/publish/images/content/close_folder2.png");
|
||||
$(item).find("img").attr("alt", "폴더 닫힘");
|
||||
}
|
||||
*/
|
||||
|
||||
$(item).find("img").attr("src", "/publish/images/content/open_folder2.png");
|
||||
$(item).find("img").attr("alt", "폴더 열림");
|
||||
|
||||
// Tabulator의 ajaxParams 설정
|
||||
tableAddr.setData("/web/mjon/msgdata/selectMsgAddrListAjax_advc.do", {
|
||||
searchAddrGrpId: addrGrpId,
|
||||
type: type,
|
||||
// searchKeyword: form.searchAddrKeyword.value,
|
||||
// searchCondition: form.searchCondition.value,
|
||||
size: 350000, // 페이지당 로드할 데이터 수
|
||||
});
|
||||
|
||||
loadAddrList();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function fnAddrSearch(){
|
||||
|
||||
var form = document.searchAddrGrpForm;
|
||||
@ -2917,13 +2834,11 @@ function loadAddrList(){
|
||||
dataType:'json',
|
||||
async: true,
|
||||
cache: false,
|
||||
success: function (returnData, status) {
|
||||
console.log('returnData : ', returnData);
|
||||
if(status == 'success'){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
|
||||
success: function (data) {
|
||||
console.log('data : ', data);
|
||||
if(data.status == "OK"){ // status 확인 필요한가. 석세스 안뜨면 에러 가지 않나
|
||||
|
||||
if(returnData.result == "success"){
|
||||
|
||||
var addrList = returnData.resultAddrList;
|
||||
var addrList = data.object;
|
||||
|
||||
if(addrList.length == 0){
|
||||
|
||||
@ -2959,17 +2874,11 @@ function loadAddrList(){
|
||||
|
||||
//우측 주소록 리스트 Tabulator에 입력해주기
|
||||
// tableAddr.setData(tableData);
|
||||
// tableAddr.setData(addrList);
|
||||
tableAddr.updateOrAddData(addrList); // 무한 스크롤을 위해 데이터를 업데이트
|
||||
|
||||
}else{
|
||||
|
||||
alert(returnData.message);
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
} else if(status== 'fail'){
|
||||
tableAddr.setData(addrList);
|
||||
// tableAddr.updateOrAddData(addrList); // 무한 스크롤을 위해 데이터를 업데이트
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("주소록 불러오기에 실패하였습니다. !!");
|
||||
}
|
||||
},
|
||||
@ -3028,8 +2937,7 @@ function addrToList(){
|
||||
}
|
||||
|
||||
//주소록 불러오기에서 수신자 리스트 추가해 주기
|
||||
function addrToList_advc(){
|
||||
console.log('tableAddr :: ', tableAddr);
|
||||
function addrToList_advc(type){
|
||||
// var selectedData = tableAddr.getSelectedRows();
|
||||
var tableSize = tableAddr.getDataCount();
|
||||
var tableData = [];
|
||||
@ -3041,10 +2949,39 @@ function addrToList_advc(){
|
||||
|
||||
}else{ // 선택한 Row 데이터 저장해주기
|
||||
|
||||
//선택한 데이터 받는사람 리스트에 추가해 주기
|
||||
addPhoneInfo_advc(tableAddr);
|
||||
$(".closeAddr").trigger("click");
|
||||
// 기존 tableL의 데이터를 가져옵니다.
|
||||
var existingData = tableL.getData();
|
||||
var addrData;
|
||||
|
||||
if(type == 'all'){
|
||||
addrData = tableAddr.getData();
|
||||
}else{
|
||||
addrData = tableAddr.getSelectedData();
|
||||
}
|
||||
|
||||
// 기존 데이터와 새로운 데이터를 합칩니다.
|
||||
var combinedData = existingData.concat(addrData);
|
||||
|
||||
// 합쳐진 데이터를 tableL에 설정합니다.
|
||||
tableL.setData(combinedData);
|
||||
|
||||
//일괄변환 문구 결제금액 처리
|
||||
totRows = tableL.getRows().length;
|
||||
updateTotCnt(totRows); //전체 데이터 갯수 구하기
|
||||
var smsTxtArea = $('#smsTxtArea').val();
|
||||
if(smsTxtArea.indexOf("[*이름*]") > -1
|
||||
|| smsTxtArea.indexOf("[*1*]") > -1
|
||||
|| smsTxtArea.indexOf("[*2*]") > -1
|
||||
|| smsTxtArea.indexOf("[*3*]") > -1
|
||||
|| smsTxtArea.indexOf("[*4*]") > -1){
|
||||
|
||||
fnReplCell();
|
||||
}else{
|
||||
//결제 금액 구하기
|
||||
totalPriceSum(totRows);
|
||||
}
|
||||
|
||||
$(".closeAddr").trigger("click");
|
||||
//주소록 레이어 팝업의 Tabulator 데이터 지워주기
|
||||
tableAddr.clearData();
|
||||
|
||||
@ -3052,6 +2989,7 @@ function addrToList_advc(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
//주소록 팝업 닫기 기능
|
||||
function addrClose(){
|
||||
|
||||
@ -3747,7 +3685,8 @@ function getMjMsgSentListAll(pageNo) {
|
||||
</div>
|
||||
<div class="popup_btn_wrap2">
|
||||
<!-- <button type="button" onClick="javascript:addrToList(); return false;">추가</button> -->
|
||||
<button type="button" onClick="javascript:addrToList_advc(); return false;">추가</button>
|
||||
<button type="button" onClick="javascript:addrToList_advc('all'); return false;">전체추가</button>
|
||||
<button type="button" onClick="javascript:addrToList_advc('select'); return false;">선택추가</button>
|
||||
<button type="button" onClick="javascript:addrClose(); return false;">닫기</button>
|
||||
</div>
|
||||
<%-- 주소록 레이어 팝업 닫기 실행 코드 --%>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user