JIWOO 2025-06-05
이지우 - 사용내역 진행 중
@379cc8fa43c05803530ed8ba7743b075daf49f87
src/main/java/itn/let/mjo/pay/web/MjonPayController.java
--- src/main/java/itn/let/mjo/pay/web/MjonPayController.java
+++ src/main/java/itn/let/mjo/pay/web/MjonPayController.java
@@ -2607,7 +2607,7 @@
 	 * @throws Exception
 	 */
     @RequestMapping(value= {"/web/member/pay/PayUserSWList.do"})
-	public String PayUserSWList(@ModelAttribute("mjonMsgVO") MjonMsgVO mjonMsgVO,
+	public String payUserSWList(@ModelAttribute("mjonMsgVO") MjonMsgVO mjonMsgVO,
 			MjonPayVO mjonPayVO,
 			MberManageVO mberManageVO, RedirectAttributes redirectAttributes,
 			HttpServletRequest request,
@@ -2622,6 +2622,14 @@
 		}    	
 		String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
 		mjonMsgVO.setUserId(userId);
+		
+
+		// 비즈니스 로직 부분
+//		Map<String, Object> resultMap = mjonPayService.payUserSWList(mjonPayVO);
+		
+		
+		
+		
 	/*	
 		{ // 충전캐시
 			String sumPayMoney = mjonPayService.selectAgentSumPayMoney(userId); 
@@ -2733,6 +2741,15 @@
 			model.addAttribute("endDate", DateUtils.getCurrentDate());
 		}
 		
+		
+		
+		
+		
+		
+		
+		
+		
+		
 		return "/web/pay/PayUserSWList";
 	}
    
src/main/resources/egovframework/sqlmap/let/msg/MjonMsgData_SQL_mysql.xml
--- src/main/resources/egovframework/sqlmap/let/msg/MjonMsgData_SQL_mysql.xml
+++ src/main/resources/egovframework/sqlmap/let/msg/MjonMsgData_SQL_mysql.xml
@@ -3168,6 +3168,7 @@
 		WHERE 1 = 1
 			AND pf.SentEA > 0
 			AND mjf.USER_ID = #userId#
+			AND mjf.RESERVE_C_YN = 'N'
 			
 	) AS pay
 	WHERE 1=1
@@ -3277,7 +3278,7 @@
 			, M.fileName3		AS fileName3 
 			, M.orderByCode		AS orderByCode
 			, M.msgId			AS msgId
-			, M.reqDate			AS reqDate
+			, DATE_FORMAT(M.reqDate, '%Y-%m-%d %H:%i')			AS reqDate
 		FROM
 			(SELECT
 				 DATE_FORMAT(B.REGDATE, '%Y-%m-%d %H:%i' )	AS regDate
@@ -3318,7 +3319,7 @@
 				/*and A.DEL_FLAG = 'N'*/
 				AND A.USER_ID	= #userId#
 				AND B.USER_ID	= #userId#
-				/*AND B.RESERVE_C_YN = 'N'*/
+				AND B.RESERVE_C_YN = 'N'
 			ORDER BY 1=1
 				, msgGroupId DESC
 				, sentDate DESC
@@ -3366,6 +3367,7 @@
 		WHERE 1 = 1
 			AND pf.SentEA > 0
 			AND mjf.USER_ID = #userId#
+			AND mjf.RESERVE_C_YN = 'N'
 			
 	) AS pay
 	WHERE 1=1
src/main/webapp/WEB-INF/jsp/web/pay/PayUserSWList.jsp
--- src/main/webapp/WEB-INF/jsp/web/pay/PayUserSWList.jsp
+++ src/main/webapp/WEB-INF/jsp/web/pay/PayUserSWList.jsp
@@ -47,7 +47,18 @@
 	thisYearStart = date.getFullYear() + "/01/01" ;
 	thisYearEnd = date.getFullYear() + "/12/31" ;
 	
+	$(document).on('change','#pageUnitS', function(){
+		setPageUnit($(this).val());
+		
+		payUserListAjax(1);
+		
+	});
+	
 });
+
+function setPageUnit(val){
+	$('#pageUnit').val(val); 
+}
 
 // 기간 요일 지정
 function setCalVal(val,targetObj){
@@ -90,42 +101,6 @@
 	$("#pageType").val(pageType);
 	payUserListTabMoveAjax(1);
 }
-
-
-
-
-
-function getUsedCashTotList(){
-    var sendData = {
-        "startDate" : $("#startDate").val(),
-        "endDate" : $("#endDate").val()
-    };
-
-    console.log('sendData : ', sendData);
-//         url: '/web/member/pay/getUsedCashTotList.do',
-
-    $.ajax({
-		type:"POST",
-		url:"<c:url value='/web/member/pay/getUsedCashTotList.do' />",
-		data: sendData,
-		dataType:'json',
-		success:function(data){
-            console.log('data :: ', data);
-            if(data.status == 'OK') {
-                // 성공 처리
-            } else {
-                // 오류 처리
-            }
-        },
-        error: function(jqXHR, textStatus, errorThrown) {
-            console.error("AJAX Error:", textStatus, errorThrown);
-            console.error("Response:", jqXHR.responseText);
-        }
-    });
-}
-	
-	
-
 
 
 /* 윈도우팝업 열기 */
@@ -534,6 +509,7 @@
 			<form id="listForm" name="listForm" method="post">
 				<input type="hidden" id="pageType" name="pageType"  value="<c:out value='${searchVO.pageType}'/>"/>
 				<input type="hidden" id="pageIndex" name="pageIndex" value="<c:out value='${searchVO.pageIndex}'/>"/>
+				<input type="hidden" id="pageUnit" name="pageUnit" value="10"/>
 				<div class="excel_middle">
 					<div class="select_btnWrap clearfix">
 						<div class="btn_left">
src/main/webapp/WEB-INF/jsp/web/pay/PayUserSWListAjax.jsp
--- src/main/webapp/WEB-INF/jsp/web/pay/PayUserSWListAjax.jsp
+++ src/main/webapp/WEB-INF/jsp/web/pay/PayUserSWListAjax.jsp
@@ -91,8 +91,39 @@
 });
 
 
-/* 사용내역서 클릭 시 내역서 새창 팝업 오픈  */
+/* 250530 - 거래명세서, 사용내역서 분리  */
 function fnShowPrintPopup() {
+    //만들려는 팝업의 크기
+    var url = "printMsgUsageDetailsAjax.do";
+    var popup_wid = '790';
+    var popup_ht = '800';
+    var popup_left = (window.screen.width/2)-(popup_wid/2);
+    var popup_top =(window.screen.height/2)-(popup_ht/2);
+    
+	//날짜 체크
+	if(($('#startDate').val() != '' && $('#endDate').val() == '') || ($('#startDate').val() == '' && $('#endDate').val() != '')){
+		alert("기간설정을 정상적으로 선택해 주세요.");
+		return;
+	}
+	
+	if( $('#startDate').val() != '' && $('#endDate').val() != '' ){
+		var iChkBeginDe = Number($('#startDate').val().replaceAll("/", ""));
+		var iChkEndDe =  Number($('#endDate').val().replaceAll("/", ""));
+		if(iChkBeginDe > iChkEndDe || iChkEndDe < iChkBeginDe ){
+			alert("기간설정의 시작일자는 종료일자 보다 클수 없습니다.");
+			return;
+		}
+	}
+	
+	document.listForm.action = url;
+	document.listForm.method = "post"; 
+	window.open("about:blank", 'printPop', 'width='+ popup_wid +', height='+ popup_ht +', left=' + popup_left + ', top='+ popup_top + ', fullscreen=no, menubar=no, status=no, toolbar=no, titlebar=yes, location=no, scrollbars=1');
+	document.listForm.target = "printPop";
+	document.listForm.submit();
+}
+
+/* 사용내역서 클릭 시 내역서 새창 팝업 오픈  */
+/* function fnShowPrintPopup() {
     //만들려는 팝업의 크기
     var url = "";
     var popup_wid = '830';
@@ -131,7 +162,7 @@
 	window.open("about:blank", 'printPop', 'width='+ popup_wid +', height='+ popup_ht +', left=' + popup_left + ', top='+ popup_top + ', fullscreen=no, menubar=no, status=no, toolbar=no, titlebar=yes, location=no, scrollbars=1');
 	document.listForm.target = "printPop";
 	document.listForm.submit();
-}
+} */
 
 /* 사용내역서 클릭 시 내역서 새창 팝업 오픈  */
 function fnShowPrintPopup_OLD() { 
@@ -214,41 +245,48 @@
 <div class="pay_cont current" id="listTab2_1">
 	<input type="hidden" id="searchSortCnd" name="searchSortCnd" value="<c:out value="${searchVO.searchSortCnd}" />" />
 	<input type="hidden" id="searchSortOrd" name="searchSortOrd" value="<c:out value="${searchVO.searchSortOrd}" />" />
+	<input type="hidden" id="addVatType" name="addVatType" value="N" />
 	<div class="list_info">
 		<p>총 <span>${paginationInfo.totalRecordCount}</span>건 &nbsp; (<fmt:formatNumber value="${totSuccSendPrice}" pattern="" /> 원)</p>
 		<div>
-			<button type="button" class="print_btn" onclick="javascript:fnPayUserPrintPopup();">
+			<!-- <button type="button" class="print_btn" onclick="javascript:fnPayUserPrintPopup();">
 				<i class="print_img"></i>인쇄하기
 			</button>
 			<button type="button" class="pdf_btn" onclick="javascript:fnShowPdfPrintPopup();">
 				<i class="pdf_img"></i>PDF저장
-			</button>
+			</button> -->
+			<c:choose>		
+				<c:when test="${not empty payUserSWList}">
+					<button type="button" class="btnType btn_36 border_gray btnType12" onclick="fnShowPrintPopup(); return false;">사용내역서</button>
+				</c:when>
+				<c:otherwise>
+					<button type="button" class="btnType btn_36 border_gray btnType12" onclick="alert('거래명세서, 사용내역서 발행할 요금사용내역이 없습니다.');">사용내역서</button>
+				</c:otherwise>
+			</c:choose>
 			<button type="button" class="excel_btn">
 				<i class="downroad"></i>엑셀 다운로드
 			</button>
+			<label for="pageUnitS" class="label">검색조건 선택</label>
+			<select id="pageUnitS" class="selType2">
+				<option value="10" <c:if test="${paginationInfo.recordCountPerPage == '10'}">selected</c:if> >10줄</option>
+				<option value="20" <c:if test="${paginationInfo.recordCountPerPage == '20'}">selected</c:if> >20줄</option>
+				<option value="30" <c:if test="${paginationInfo.recordCountPerPage == '30'}">selected</c:if> >30줄</option>
+				<option value="100" <c:if test="${paginationInfo.recordCountPerPage == '100'}">selected</c:if> >100줄</option>
+			</select>
 		</div>
 	</div>
 	<div class="tb_wrap">
 		<table class="tType4">
 			<colgroup>
-				<%-- <col style="width: 5%;"> --%>
-				<col style="width: *%;">
-				<col style="width: 15%;">
-				<col style="width: 15%;">
-				<col style="width: 15%;">
-				<col style="width: 20%;">
-<%-- 				<col style="width: 20%;"> --%>
-				<%-- <col style="width: 10%;">
+				<col style="width: auto;">
+				<col style="width: 9%;">
 				<col style="width: 10%;">
-				<col style="width: 10%;">
-				<col style="width: 10%;"> --%>
+				<col style="width: 12%;">
+				<col style="width: 12%;">
+				<col style="width: 16%;">
 			</colgroup>
 			<thead>
 				<tr>
-					<%-- <th rowspan="2">
-						<label for="" class="label">전체 선택</label>
-						<input type="checkbox" id="chkAll">
-					</th> --%>
 					<th rowspan="2">
 						발송일시
 						<div class="sort_wrap">
@@ -256,28 +294,18 @@
 						</div>
 					</th>
 					<th rowspan="2">
-						문자유형
+						형태
 						<div class="sort_wrap">
 							<input type="button" class="sort sortBtn" id="sort_orderByCode">
 						</div>
 					</th>
 					<th rowspan="2">내용</th>
-					<th rowspan="2">발송건수</th>
-					<!-- <th colspan="2">충전</th>
-					<th colspan="2">사용</th>
-					<th colspan="2">잔액</th> -->
-<!-- 					<th colspan="2">사용</th> -->
-					<th>사용</th>
-					<!-- <th>반환(실패)</th> -->
-					<!-- <th colspan="2">잔액</th> -->
+					<th colspan="2">발송건수</th>
+					<th rowspan="2">금액(원)</th>
 				</tr>
 				<tr>
-					<th>충전금</th>
-<!-- 					<th>포인트</th> -->
-					<!-- <th>캐시</th> -->
-					<!-- <th>포인트</th> -->
-					<!-- <th>충전금</th>
-					<th>포인트</th> -->
+					<th>성공</th>
+					<th style="border-right:1px solid #ccc;">실패</th>
 				</tr>
 			</thead>
 			<tbody>
@@ -285,10 +313,6 @@
 					<c:when test="${not empty payUserSWList}">
 						<c:forEach var="payUserInfo" items="${payUserSWList}" varStatus="status">
 							<tr>
-								<%-- <td>
-									<label for="" class="label">선택</label>
-									<input type="checkbox" name="eachChk">
-								</td> --%>
 								<td>
 									<p><c:out value="${payUserInfo.reqDate}"/></p>
 								</td>
@@ -339,11 +363,11 @@
 										<c:if test="${payUserInfo.msgTypeTxt eq 'fax'}">
 											(<c:out value="${payUserInfo.fileCnt}"/>매)
 										</c:if>
-										/ <c:out value="${payUserInfo.failSendCnt}"/>
-										<%-- <c:out value="${payUserInfo.sendCount}"/>
-										<c:if test="${payUserInfo.msgTypeTxt eq 'fax'}">
-										(<c:out value="${payUserInfo.fileCnt}"/>)
-										</c:if> --%>
+									</p>
+								</td>
+								<td>
+									<p class="fwRg c_222">
+										<c:out value="${payUserInfo.failSendCnt}"/>
 									</p>
 								</td>
 								<td>
@@ -352,58 +376,12 @@
 										<c:out value="${succCash}"/>
 									</p>
 								</td>
-								<%-- <td>
-									<p class="fwRg c_002c9a">
-										<fmt:formatNumber type="number" maxFractionDigits="3" value="${payUserInfo.failSendPrice}" var="failPrice" />
-										<c:out value="${failPrice}"/>
-									</p>
-								</td> --%>
-								<!-- <td>
-									<p class="fwRg c_002c9a">
-										0
-									</p>
-								</td> -->
-								<%-- <td>
-									<p>
-										<fmt:formatNumber type="number" maxFractionDigits="3" value="${payUserInfo.befCash}" var="befCash" />
-										<c:out value="${befCash}"/>
-									</p>
-								</td>
-								<td>
-									<p>
-										<fmt:formatNumber type="number" maxFractionDigits="3" value="${payUserInfo.befPoint}" var="befPoint" />
-										<c:out value="${befPoint}"/>																											
-									</p>
-								</td>
-								<td>
-									<p class="fwRg c_002c9a">
-										<fmt:formatNumber type="number" maxFractionDigits="3" value="${payUserInfo.totPrice}" var="totPrice" />
-										<c:out value="${totPrice}"/>
-									</p>
-								</td>
-								<td>
-									<p class="fwRg c_002c9a">
-										0
-									</p>
-								</td> --%>
-								<%-- <td>
-									<p class="fwRg c_222">
-										<fmt:formatNumber type="number" maxFractionDigits="3" value="${payUserInfo.thisPoint}" var="thisPoint" />
-										<c:out value="${thisPoint}"/>
-									</p>
-								</td>
-								<td>
-									<p class="fwRg c_222">
-										<fmt:formatNumber type="number" maxFractionDigits="3" value="${payUserInfo.befPoint}" var="befPoint" />
-										<c:out value="${befPoint}"/>																		
-									</p>
-								</td> --%>
 							</tr>
 						</c:forEach>
 					</c:when>
 					<c:otherwise>
 						<tr>
-							<td colspan="5">
+							<td colspan="6">
 								검색 결과가 없습니다.
 							</td>
 						</tr>
@@ -412,7 +390,9 @@
 			</tbody>
 		</table>
 	</div>
-	<div class="publish_btn clearfix">
+	
+	<!-- 250530 - 거래명세서, 사용내역서 분리 -->
+	<%-- <div class="publish_btn clearfix">
 		<div>
 			<input type="radio" name="publish" id="publish1" value="statement">
 			<label for="publish1">거래명세서</label>
@@ -434,7 +414,7 @@
 				</c:otherwise>
 			</c:choose>		
 		</div>
-	</div>
+	</div> --%>
 	
 	<!-- pagination -->
 	<c:if test="${!empty payUserSWList}">
Add a comment
List