فهرست منبع

이태영 - 20210608 SCM 입점업체 주문 목록 페이징 처리

xodud lee 5 سال پیش
والد
کامیت
f967a7bb21

+ 28 - 5
src/main/java/com/style24/scm/biz/web/TssOrderController.java

@@ -109,9 +109,21 @@ public class TssOrderController extends TssBaseController {
 	 */
 	@PostMapping("/seller/unorder/list")
 	@ResponseBody
-	public Collection<Order> getOrderSellerUnorderList(@RequestBody Order order) {
+	public GagaMap getOrderSellerUnorderList(@RequestBody Order order) {
+		GagaMap result = new GagaMap();
+
+		order.setPageable(new TscPageRequest(0, 10000));
+
+		// 주문전체건수 조회
+		int totalCount = coreOrderService.getOrderSellerUnorderListCount(order);
+		order.getPageable().setTotalCount(totalCount);
+
 		Collection<Order> orderList = coreOrderService.getOrderSellerUnorderList(order);
-		return orderList;
+
+		result.set("pageing"	, order);
+		result.set("orderList"	, orderList);
+
+		return result;
 	}
 	
 	/**
@@ -325,11 +337,22 @@ public class TssOrderController extends TssBaseController {
 	 */
 	@PostMapping("/seller/order/list")
 	@ResponseBody
-	public Collection<Order> getOrderSellerOrderList(@RequestBody Order order) {
+	public GagaMap getOrderSellerOrderList(@RequestBody Order order) {
+		GagaMap result = new GagaMap();
+
+		order.setPageable(new TscPageRequest(order.getPageNo() - 1, order.getPageSize()));
+
+		// 주문전체건수 조회
+		int totalCount = coreOrderService.getOrderSellerUnorderListCount(order);
+		order.getPageable().setTotalCount(totalCount);
+
 		order.setIfYn("Y");			// 취소, 반품 신청/대기 건 제외하지 않도록 구분값 지정
-		log.info("CHECK IF_YN ::: {}", order.getIfYn());
 		Collection<Order> orderList = coreOrderService.getOrderSellerUnorderList(order);
-		return orderList;
+
+		result.set("pageing"	, order);
+		result.set("orderList"	, orderList);
+
+		return result;
 	}
 	
 	/**

+ 37 - 6
src/main/webapp/WEB-INF/views/order/OrderSellerDelvEndListForm.html

@@ -109,26 +109,44 @@
 		</div>
 
 		<div class="panelStyle">
-			<!--<ul class="panelBar">
-				<li>
+			<input type="hidden" name="pageNo" id="pageNo" value ="1"/>
+
+			<ul class="panelBar">
+				<!--<li>
 					<button type="button" class="btn btn-info btn-lg" onclick="cfnDownloadSampleFile('SF020');">입점송장번호등록다운로드</button>
 				</li>
 				<li class="aR">
 					<button type="button" id="btnExcelDown" class="btn btn-info btn-lg">엑셀다운로드</button>
 					<button type="button" id="btnInvoiceExcelUpLoad" class="btn btn-success btn-lg">송장엑셀업로드</button>
 					<button type="button" id="btnSave" class="btn btn-success btn-lg">저장</button>
+				</li>-->
+				<li class="aR">
+					검색결과 : <strong><span id="rowCntOrderList">0</span> 건</strong>&nbsp;
+					쪽번호 <span id="pgNo">0</span>/ <strong id="endPgNo">0</strong>&nbsp;&nbsp;
+					<select id="pageSize" name="pageSize">
+						<option value="100" selected="selected">100개씩 보기</option>
+						<option value="500">500개씩 보기</option>
+						<option value="1000">1000개씩 보기</option>
+						<option value="5000">5000개씩 보기</option>
+					</select>
 				</li>
-			</ul>-->
+			</ul>
 
 			<div class="panelContent" style="overflow: hidden;">
 				<div id="gridList" style="width: 100%; height: 400px;" class="ag-theme-balham lh30"></div>
 			</div>
+
+			<ul class="panelBar">
+				<li class="center">
+					<div class="tablePaging" id="orderListPagination"></div>
+				</li>
+			</ul>
 		</div>
 
 	</form>
 </div>
-	
-<script type="text/javascript" src="/ux/plugins/gaga/gaga.paging.js?v=2019072202"></script>
+
+<script type="text/javascript" src="/ux/plugins/gaga/gaga.paging.js?v=20210114"></script>
 
 <script th:inline="javascript">
 /*<![CDATA[*/
@@ -199,7 +217,20 @@ var fnSearch = function() {
 		}
 	}
 
-	gagaAgGrid.fetch($(formId).prop('action'), gridOptions, formId);
+	gagaPaging.init('searchForm', fnSearchCallBack, 'orderListPagination', 100);
+	gagaPaging.load($("#searchForm input[name=pageNo]").val());
+
+	// gagaAgGrid.fetch($(formId).prop('action'), gridOptions, formId);
+}
+
+var fnSearchCallBack = function(result){
+	$('#searchForm').find('#gridRowTotalCount').html(result.pageing.pageable.totalCount.addComma());
+	$('#searchForm').find('#pageNo').val(result.pageing.pageable.pageNo.addComma());
+	$('#searchForm').find('#pgNo').html(result.pageing.pageable.pageNo.addComma());
+	$('#searchForm').find('#endPgNo').html(result.pageing.pageable.totalPage.addComma());
+
+	gridOptions.api.setRowData(result.orderList);
+	gagaPaging.createPagination(result.pageing.pageable);
 }
 
 // 엑셀다운로드 시 주문상태 변경

+ 20 - 4
src/main/webapp/WEB-INF/views/order/OrderSellerDelvListForm.html

@@ -26,6 +26,7 @@
 	
 	<form id="searchForm" name="searchForm" action="#" th:action="@{'/order/seller/unorder/list'}">
 		<input type="hidden" name="ordDtlStat" value="G013_40" />
+		<input type="hidden" name="pageNo" id="pageNo" value ="1"/>
 		<input type="hidden" name="supplyCompCd" th:value="${supplyCompCd}" />
 		<div class="panelStyle">
 			<ul class="panelBar">
@@ -41,6 +42,8 @@
 	</form>
 </div>
 
+<script type="text/javascript" src="/ux/plugins/gaga/gaga.paging.js?v=20210114"></script>
+
 <script th:inline="javascript">
 var shipCompanyList = gagajf.convertToArray([[${shipCompanyList}]]);
 var columnDefs = [
@@ -107,8 +110,21 @@ gridOptions.stopEditingWhenGridLosesFocus = true;
 
 // 검색
 var fnSearch = function() {
-	var formId = '#searchForm';
-	gagaAgGrid.fetch($(formId).prop('action'), gridOptions, formId);
+	//var formId 		= '#searchForm';
+	//gagaAgGrid.fetch($(formId).prop('action'), gridOptions, formId);
+
+	gagaPaging.init('searchForm', fnSearchCallBack, 'orderListPagination', 100);
+	gagaPaging.load($("#searchForm input[name=pageNo]").val());
+}
+
+var fnSearchCallBack = function(result){
+	$('#searchForm').find('#gridRowTotalCount').html(result.pageing.pageable.totalCount.addComma());
+	$('#searchForm').find('#pageNo').val(result.pageing.pageable.pageNo.addComma());
+	$('#searchForm').find('#pgNo').html(result.pageing.pageable.pageNo.addComma());
+	$('#searchForm').find('#endPgNo').html(result.pageing.pageable.totalPage.addComma());
+
+	gridOptions.api.setRowData(result.orderList);
+	gagaPaging.createPagination(result.pageing.pageable);
 }
 
 //초기설정
@@ -136,14 +152,14 @@ $("#btnSave").on("click", function(e) {
 		}
 	}
 
-	mcxDialog.confirm('선택된 주문을 배송중으로 변경하시겠습니까?', {
+	/*mcxDialog.confirm('선택된 주문을 배송중으로 변경하시겠습니까?', {
 		cancelBtnText	: "취소",
 		sureBtnText		: "확인",
 		sureBtnClick	: function(){
 			var jsonData = JSON.stringify(selectedData);
 			gagajf.ajaxJsonSubmit('/order/seller/delv/started', jsonData, fnEndFunction);
 		}
-	});
+	});*/
 
 	// 엑셀다운로드
 	var fnEndFunction = function(result){

+ 18 - 4
src/main/webapp/WEB-INF/views/order/OrderSellerListForm.html

@@ -27,6 +27,7 @@
 	<form id="searchForm" name="searchForm" action="#" th:action="@{'/order/seller/unorder/list'}">
 		<input type="hidden" id="searchGb" name="searchGb" />
 		<input type="hidden" id="imageViewYn" name="imageViewYn" />
+		<input type="hidden" name="pageNo" id="pageNo" value ="1"/>
 		
 		<!-- 패널 영역1 -->
 		<div class="panelStyle" >
@@ -133,8 +134,8 @@
 <label class="off">
 	<a href="javascript:void(0);" id="hdOrderExcelList" style="display: none;">엑셀다운로드</a>
 </label>
-	
-<script type="text/javascript" src="/ux/plugins/gaga/gaga.paging.js?v=2019072202"></script>
+
+<script type="text/javascript" src="/ux/plugins/gaga/gaga.paging.js?v=20210114"></script>
 
 <script th:inline="javascript">
 /*<![CDATA[*/
@@ -218,8 +219,21 @@ var fnSearch = function() {
 			return;
 		}
 	}
-	
-	gagaAgGrid.fetch($(formId).prop('action'), gridOptions, formId);
+
+	gagaPaging.init('searchForm', fnSearchCallBack, 'orderListPagination', 100);
+	gagaPaging.load($("#searchForm input[name=pageNo]").val());
+
+	//gagaAgGrid.fetch($(formId).prop('action'), gridOptions, formId);
+}
+
+var fnSearchCallBack = function(result){
+	$('#searchForm').find('#gridRowTotalCount').html(result.pageing.pageable.totalCount.addComma());
+	$('#searchForm').find('#pageNo').val(result.pageing.pageable.pageNo.addComma());
+	$('#searchForm').find('#pgNo').html(result.pageing.pageable.pageNo.addComma());
+	$('#searchForm').find('#endPgNo').html(result.pageing.pageable.totalPage.addComma());
+
+	gridOptions.api.setRowData(result.orderList);
+	gagaPaging.createPagination(result.pageing.pageable);
 }
 
 // 엑셀다운로드 시 주문상태 변경