[사용자] 결제관리 > 요금 사용내역 ==> 검색기간 필수값으로 변경 하고 기본값 제공 안함

This commit is contained in:
hylee 2024-07-04 17:30:24 +09:00
parent db60e6fb6b
commit 9b2fec3aeb
4 changed files with 60 additions and 9 deletions

View File

@ -61,6 +61,7 @@ import itn.com.cmm.EgovMessageSource;
import itn.com.cmm.LoginVO; import itn.com.cmm.LoginVO;
import itn.com.cmm.service.EgovCmmUseService; import itn.com.cmm.service.EgovCmmUseService;
import itn.com.cmm.service.FileVO; import itn.com.cmm.service.FileVO;
import itn.com.cmm.util.DateUtil;
import itn.com.cmm.util.MJUtil; import itn.com.cmm.util.MJUtil;
import itn.com.cmm.util.RedirectUrlMaker; import itn.com.cmm.util.RedirectUrlMaker;
import itn.com.cmm.util.StringUtil; import itn.com.cmm.util.StringUtil;
@ -2694,7 +2695,11 @@ public class MjonPayController {
model.addAttribute("negoPriceYn", negoPriceYn); model.addAttribute("negoPriceYn", negoPriceYn);
} }
{
// 초기 날짜 셋팅
model.addAttribute("startDate", DateUtil.getDateDaysAgo(365));
model.addAttribute("endDate", DateUtil.getCurrentDate());
}
return "/web/pay/PayUserSWList"; return "/web/pay/PayUserSWList";
} }
@ -2738,6 +2743,16 @@ public class MjonPayController {
mjonMsgVO.setSearchSortOrd("desc"); mjonMsgVO.setSearchSortOrd("desc");
} }
// 검색 데이터가 없거나
// 시작일자가 종료일자보다 이후이거나
// 기간이 365일이 넘으면 현재일부터 365일 날짜를 넣어서 검색
if(!DateUtil.dateChk365AndValueChk(mjonMsgVO.getStartDate(),mjonMsgVO.getEndDate() )) {
mjonMsgVO.setStartDate(DateUtil.getDateDaysAgo(365));
mjonMsgVO.setEndDate(DateUtil.getCurrentDate());
};
List<MjonMsgVO> payUserSWList = mjonMsgDataService.selectPayUserSWList(mjonMsgVO); List<MjonMsgVO> payUserSWList = mjonMsgDataService.selectPayUserSWList(mjonMsgVO);
paginationInfo.setTotalRecordCount(payUserSWList.size()> 0 ? payUserSWList.get(0).getTotCnt() : 0); paginationInfo.setTotalRecordCount(payUserSWList.size()> 0 ? payUserSWList.get(0).getTotCnt() : 0);
@ -2749,6 +2764,8 @@ public class MjonPayController {
}else { }else {
model.addAttribute("totSuccSendPrice", 0); model.addAttribute("totSuccSendPrice", 0);
} }
model.addAttribute("mjonMsgVO", mjonMsgVO);
} catch (Exception e) { } catch (Exception e) {
System.out.println("PayUserSWListAjax Controller Error!!! " + e); System.out.println("PayUserSWListAjax Controller Error!!! " + e);

View File

@ -161,12 +161,6 @@ function fn_dataValueChk(){
return false; return false;
} }
// 시작일자가 종료일자보다 이후인지 확인
if (start > end) {
alert("검색 시작일자는 종료일자보다 이전이어야 합니다.");
return false;
}
// 총 기간이 365일을 넘는지 확인 // 총 기간이 365일을 넘는지 확인
var diffTime = Math.abs(end - start); var diffTime = Math.abs(end - start);
var diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)); var diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));

View File

@ -56,12 +56,50 @@ function setCalVal(val,targetObj){
// 요금사용내역 리스트 // 요금사용내역 리스트
function payUserListAjax(pageNo){ function payUserListAjax(pageNo){
if(!fn_dataValueChk()){
return;
};
document.listForm.pageIndex.value = pageNo; document.listForm.pageIndex.value = pageNo;
var sendData= $(document.listForm).serializeArray(); var sendData= $(document.listForm).serializeArray();
$("#payUserListLoad").load("/web/member/pay/PayUserSWListAjax.do", sendData ,function(response, status, xhr){ $("#payUserListLoad").load("/web/member/pay/PayUserSWListAjax.do", sendData ,function(response, status, xhr){
}); });
} }
function fn_dataValueChk(){
// 시작일자와 종료일자를 가져오기
var startDate = document.getElementById("startDate").value;
var endDate = document.getElementById("endDate").value;
// 날짜가 입력되었는지 확인
if (!startDate || !endDate) {
alert("검색 시작일자와 종료일자를 입력해주세요.");
return false;
}
// 날짜 형식으로 변환
var start = new Date(startDate);
var end = new Date(endDate);
// 날짜 유효성 체크
if (isNaN(start.getTime()) || isNaN(end.getTime())) {
alert("유효한 날짜 형식을 입력해주세요.");
return false;
}
// 총 기간이 365일을 넘는지 확인
var diffTime = Math.abs(end - start);
var diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
if (diffDays > 365) {
alert("총 검색 기간은 1년을 넘을 수 없습니다.");
return false;
}
return true;
}
function payUserTab(obj, pageType){ function payUserTab(obj, pageType){
var $tab = $(obj).closest("li"); var $tab = $(obj).closest("li");
@ -482,9 +520,9 @@ function fnRevDetailPop03(msgGroupId){
<div class="btn_left"> <div class="btn_left">
<span class="cal_label">기간선택</span> <span class="cal_label">기간선택</span>
<div class="calendar_wrap"> <div class="calendar_wrap">
<input type="text" class="startDate inp calendar" title="검색 시작일" id="startDate" name="startDate" value="" data-datecontrol="true"> <input type="text" class="startDate inp calendar" title="검색 시작일" id="startDate" name="startDate" value="${startDate }" data-datecontrol="true">
<span class="dateEtc">~</span> <span class="dateEtc">~</span>
<input type="text" class="endDate inp calendar" title="검색 종료일" id="endDate" name="endDate" value="" data-datecontrol="true"> <input type="text" class="endDate inp calendar" title="검색 종료일" id="endDate" name="endDate" value="${endDate }" data-datecontrol="true">
</div> </div>
<button type="button" onclick="setCalVal(thisYearStart,'startDate');setCalVal( thisYearEnd,'endDate'); return false;" class="btnType btnType19">이번년도</button> <button type="button" onclick="setCalVal(thisYearStart,'startDate');setCalVal( thisYearEnd,'endDate'); return false;" class="btnType btnType19">이번년도</button>
<button type="button" onclick="setCalVal(lastfulstday,'startDate');setCalVal( lastfuledday,'endDate'); return false;" class="btnType btnType19">전월</button> <button type="button" onclick="setCalVal(lastfulstday,'startDate');setCalVal( lastfuledday,'endDate'); return false;" class="btnType btnType19">전월</button>

View File

@ -20,6 +20,8 @@
<script src="/publish/js/content.js"></script> <script src="/publish/js/content.js"></script>
<script> <script>
$(document).ready(function(){ $(document).ready(function(){
$('#startDate').val('${mjonMsgVO.startDate}');
$('#endDate').val('${mjonMsgVO.endDate}');
/* 목록 정렬 항목 아이콘 표시 */ /* 목록 정렬 항목 아이콘 표시 */
var searchSortCnd = $("[name='searchSortCnd']").val(); var searchSortCnd = $("[name='searchSortCnd']").val();
var searchSortOrd = $("[name='searchSortOrd']").val(); var searchSortOrd = $("[name='searchSortOrd']").val();