Merge branch '4875_발송_페이지_로딩_속도개선'

This commit is contained in:
hehihoho3@gmail.com 2025-01-13 17:08:41 +09:00
commit 99c305c16d
6 changed files with 120 additions and 42 deletions

View File

@ -208,7 +208,6 @@ public class MjonMsgDataController {
HttpServletRequest request,
ModelMap model,
RedirectAttributes redirectAttributes) throws Exception{
try {
/*
@ -287,9 +286,12 @@ public class MjonMsgDataController {
letterVO.setLastIndex(paginationInfo.getLastRecordIndex());
letterVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
List<?> resultPhoList = mjonMsgDataService.selectPhotoLetterList(letterVO);
model.addAttribute("resultPhoList", resultPhoList);
paginationInfo.setTotalRecordCount( resultPhoList.size()> 0 ? ((Long)((EgovMap)resultPhoList.get(0)).get("totCnt")).intValue() : 0);
model.addAttribute("paginationInfo", paginationInfo);
@ -442,6 +444,9 @@ public class MjonMsgDataController {
@RequestMapping(value= {"/web/mjon/msgdata/selectMsgDataSMLViewAjax.do"})
public String selectMsgDataSMLView(@ModelAttribute("searchVO") MjonMsgDataVO searchVO, CateCode cateCode, ModelMap model) throws Exception{
System.out.println(" : selectMsgDataSMLView : ");
long startTime = System.nanoTime(); // 시작 시간
//로그인 권한정보 불러오기
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
@ -662,23 +667,25 @@ public class MjonMsgDataController {
//최근 전송 내역
// 20241230 이호영
// 로딩 시간이 오래걸려 ajax로 따로 분리함
// Calendar cal = Calendar.getInstance();
// Date now = new Date();
/*
Calendar cal = Calendar.getInstance();
Date now = new Date();
// SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd");
SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd");
// cal.setTime(now);
// cal.add(Calendar.DATE, -3);
cal.setTime(now);
cal.add(Calendar.DATE, -3);
// String chkDate = format.format(cal.getTime());
// searchVO.setMyMsgStDt(chkDate); //검색 시작일 저장 - 현재날짜로 부터 3일 이전 날짜로 시작
// List<?> resultLatestMsgList = mjonMsgDataService.selectLatestMsgList(searchVO);
// model.addAttribute("resultLatestMsgList", resultLatestMsgList);
String chkDate = format.format(cal.getTime());
searchVO.setMyMsgStDt(chkDate); //검색 시작일 저장 - 현재날짜로 부터 3일 이전 날짜로 시작
List<?> resultLatestMsgList = mjonMsgDataService.selectLatestMsgList(searchVO);
model.addAttribute("resultLatestMsgList", resultLatestMsgList);
*/
//자주보내는 번호
List<?> resultBookMarkMsgList = mjonMsgDataService.selectBookMarkMsgList(searchVO);
model.addAttribute("resultBookMarkMsgList", resultBookMarkMsgList);
// List<?> resultBookMarkMsgList = mjonMsgDataService.selectBookMarkMsgList(searchVO);
// model.addAttribute("resultBookMarkMsgList", resultBookMarkMsgList);
/** pageing */
PaginationInfo paginationInfo = new PaginationInfo();
@ -698,12 +705,18 @@ public class MjonMsgDataController {
model.addAttribute("tabDision", searchVO.getTabDision());
long endTime = System.nanoTime(); // 종료 시간
// 실행 시간 계산 (나노초 단위)
long duration = endTime - startTime;
System.out.println("Execution time: " + duration + " nanoseconds");
System.out.println("Execution time: " + (duration / 1_000_000) + " milliseconds");
return "web/msgdata/MsgDataSMLView";
}
@RequestMapping(value= {"/web/mjon/msgdata/resultLatestMsgListAjax.do"})
public ResponseEntity<StatusResponse> cancelRegistIdChkAjax() throws Exception {
public ResponseEntity<StatusResponse> resultLatestMsgListAjax() throws Exception {
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
@ -732,6 +745,25 @@ public class MjonMsgDataController {
return ResponseEntity.ok().body(new StatusResponse(HttpStatus.OK, "", resultLatestMsgList));
}
@RequestMapping(value= {"/web/mjon/msgdata/resultBookMarkMsgList.do"})
public ResponseEntity<StatusResponse> resultBookMarkMsgList() throws Exception {
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
if(StringUtils.isEmpty(userId)) {
return ResponseEntity.ok().body(new StatusResponse(HttpStatus.OK, "", ""));
}
MjonMsgDataVO mjonMsgDataVO = new MjonMsgDataVO();
mjonMsgDataVO.setUserId(userId);
List<?> resultBookMarkMsgList = mjonMsgDataService.selectBookMarkMsgList(mjonMsgDataVO);
return ResponseEntity.ok().body(new StatusResponse(HttpStatus.OK, "", resultBookMarkMsgList));
}
/**
* 문자재전송 내용 처리

View File

@ -28,17 +28,15 @@ Globals.Env = dev
# mysql
Globals.DriverClassName=com.mysql.jdbc.Driver
Globals.Url=jdbc:mysql://192.168.0.125:3306/mjon
Globals.UserName= mjonUr
#Globals.Url=jdbc:mysql://192.168.0.125:3306/mjon_20230221
#Globals.UserName= mjonUr_20230221
Globals.Password= mjon!@#$
#Globals.Url=jdbc:mysql://192.168.0.125:3306/mjon
#Globals.UserName= mjonUr
#Globals.Password= mjon!@#$
# mysql-prod
#Globals.DriverClassName=com.mysql.jdbc.Driver
#Globals.Url=jdbc:mysql://139.150.72.157:3306/mjon
#Globals.UserName= mjonUr
#Globals.Password= mjon!@#$
Globals.Url=jdbc:mysql://139.150.72.157:3306/mjon
Globals.UserName= mjonUr
Globals.Password= mjon!@#$
# MainPage Setting(admin)
Globals.MainPage = /cmm/main/mainPage.do

View File

@ -123,8 +123,3 @@ Globals.pay.kgm.mobile.payMode=00
#Slack
Globals.slack.hooks.url=https://hooks.slack.com/services/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
Globals.slack.channel.name=\ud14c\uc2a4\ud2b8_mjon\uba54\uc2dc\uc9c0

View File

@ -2204,7 +2204,7 @@
</select>
<select id="mjonMsgDAO.selectBookMarkMsgList" parameterClass="mjonMsgDataVO" resultClass="egovMap">
/* mjonMsgDAO.selectBookMarkMsgList */
SELECT ADDR_ID AS addrId,
ADDR_GRP_ID AS addrGrpId,
MBER_ID AS mberId,

View File

@ -17,7 +17,9 @@
$(document).ready(function(){
console.log("12111111111111");
// console.log(' + $(#tabDision).val() : ',$('#tabDision').val())
// if($('#tabDision').val() == 'tab02'){
@ -193,11 +195,11 @@ $(document).ready(function(){
});
updateButtons(currentIndex);
// 최근 전송내역
resultLatestMsgList();
//자주보내는 번호
resultBookMarkMsgList();
});
@ -227,13 +229,12 @@ function resultLatestMsgList(){
// 데이터가 있는 경우
if (resultList && resultList.length > 0) {
resultList.forEach(function(item, index) {
console.log(item.callTo + " : " + item.callTo);
let listItem =
'<li id="latestLi">' +
'<input type="checkbox" id="addrChk_' + (index + 1) + '" name="latAddrChk" value="' + item.callTo + '">' +
'<label for="addrChk_' + (index + 1) + '" class="label">최근 전송내역</label>' +
'<p>' + item.callTo + '</p>' +
'<button type="button" id="latestAddrDel">' +
'<input type="checkbox" id="bokAddrChk_' + (index + 1) + '" name="bookAddrChk" value="' + item.addrPhoneNo + '">' +
'<label for="bokAddrChk_' + (index + 1) + '" class="label">최근 전송내역</label>' +
'<p>' + item.addrPhoneNo + '</p>' +
'<button type="button" id="bookMarkAddrDel">' +
'<img src="/publish/images/popup/close3.png" alt="전화번호 삭제">' +
'</button>' +
'</li>';
@ -244,7 +245,6 @@ function resultLatestMsgList(){
// 데이터가 없는 경우
$latestMsgUl.append('<li><p>최근 발송 내역이 없습니다.</p></li>');
}
// console.log('$latestMsgUl : ', $latestMsgUl.html());
},
error:function(request , status, error){
console.log(' error ?');
@ -254,6 +254,57 @@ function resultLatestMsgList(){
});
}
// 자주보내는 번호
function resultBookMarkMsgList(){
$.ajax({
type:"POST",
url:"/web/mjon/msgdata/resultBookMarkMsgList.do",
data:{},
dataType:'json',
// timeout:(1000*30),
success:function(data){
console.log('resultBookMarkMsgList data : ', data);
// 가져온 데이터 배열
let resultList = data.object;
let $bookMsgUl = $('#bookMsgUl'); // 기존 리스트 UL
console.log('let $bookMsgUl : ', $bookMsgUl);
// 기존 내용을 비우기
$bookMsgUl.empty();
// 데이터가 있는 경우
if (resultList && resultList.length > 0) {
resultList.forEach(function(item, index) {
console.log(item.addrPhoneNo + " : " + item.addrPhoneNo);
let listItem =
'<li id="bookMarkLi">' +
'<input type="checkbox" id="addrChk_' + (index + 1) + '" name="latAddrChk" value="' + item.addrPhoneNo + '">' +
'<label for="addrChk_' + (index + 1) + '" class="label">최근 전송내역</label>' +
'<p>' + item.addrPhoneNo + '</p>' +
'<button type="button" id="bookMarkAddrDel">' +
'<img src="/publish/images/popup/close3.png" alt="전화번호 삭제">' +
'</button>' +
'</li>';
$bookMsgUl.append(listItem);
});
} else {
// 데이터가 없는 경우
$bookMsgUl.append('<li><p>등록된 자주 보내는 번호 내역이 없습니다..</p></li>');
}
},
error:function(request , status, error){
console.log(' error ?');
console.log('request : ', request);
console.log('status : ', status);
}
});
}
/*
* 버튼 disabled 스크립트
*/
@ -3566,7 +3617,7 @@ function getMjMsgSentListAll(pageNo) {
<div class="history_cont hascont">
<div class="histroy_trans" id="bookMarkMsgArea">
<ul id="bookMsgUl">
<c:choose>
<%-- <c:choose>
<c:when test="${not empty resultBookMarkMsgList}">
<c:forEach var="bookMarkMsgList" items="${resultBookMarkMsgList}" varStatus="status">
<li id="bookMarkLi">
@ -3582,7 +3633,7 @@ function getMjMsgSentListAll(pageNo) {
<p>등록된 자주 보내는 번호 내역이 없습니다.</p>
</li>
</c:otherwise>
</c:choose>
</c:choose> --%>
</ul>
</div>
<div class="popup_btn_wrap2 hisroy_btn" style="width: 230px;">

View File

@ -173,10 +173,12 @@ function listMsgDataView(){
var sendData = $(document.goPageAjax).serializeArray() ;
console.log('sendData : ', sendData)
$(".contentArea").load("/web/mjon/msgdata/selectMsgDataSMLViewAjax.do", sendData ,function(response, status, xhr){
console.log(' contentArea : 문자전송 부분 로딩');
//문자 재전송 및 주소록 전달 처리를 위해 사용
$("#msgForm").ready(function(){ //문자 내용 폼이 로드된 후 실행
console.log(' contentArea : 문자전송 부분 로딩');
//헤더 문자검색 결과 처리
var headerMsgSearchFlag = '${headerMsgSearchVO.headerMsgSearchFlag}';