Просмотр исходного кода

입점업체 클레임 개발중

tsit14 5 лет назад
Родитель
Сommit
06852dee67

+ 60 - 7
src/main/java/com/style24/scm/biz/web/TssOrderChangeController.java

@@ -1,19 +1,25 @@
 package com.style24.scm.biz.web;
 
 import java.util.Collection;
+import java.util.List;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
+import com.gagaframework.web.parameter.GagaMap;
 import com.style24.core.biz.service.TscOrderService;
 import com.style24.persistence.domain.Order;
 import com.style24.scm.biz.service.TssRendererService;
 import com.style24.scm.support.controller.TssBaseController;
+import com.style24.scm.support.security.session.TssSession;
 
 import lombok.extern.slf4j.Slf4j;
 
@@ -47,7 +53,7 @@ public class TssOrderChangeController extends TssBaseController {
 	 * @author jsh77b
 	 * @since 2020. 12. 22
 	 */
-	@GetMapping("/withdraw/confirm/form")
+	@GetMapping("/seller/withdraw/confirm/form")
 	public ModelAndView rtnReqForm(@RequestParam(value = "ordNo") int ordNo, @RequestParam(value = "ordDtlNo") int ordDtlNo
 			, @RequestParam(value = "delvFeeCd") String delvFeeCd, @RequestParam(value = "delvFeeCdGrp") String delvFeeCdGrp
 			, @RequestParam(value = "ordChgSq") int ordChgSq) {
@@ -55,30 +61,77 @@ public class TssOrderChangeController extends TssBaseController {
 		Order order = new Order();
 		order.setOrdChgSq(ordChgSq);
 		
-		Collection<Order> orderWidthdrawList = coreOrderService.getOrderSellerClaimList(order);
+		List<Order> orderWithdrawList = coreOrderService.getOrderSellerClaimList(order);
 		int index 			= 0;
 		String chgGb 		= "";
 		String wdGb 		= "";
 		String chgReason 	= "";
+		String chgMemo 		= "";
 		
-		for (Order orderWidthdraw : orderWidthdrawList) {
+		for (Order orderWithdraw : orderWithdrawList) {
 			if (index == 0) {
-				chgGb 		= orderWidthdraw.getChgGb();
-				wdGb 		= orderWidthdraw.getWdGb();
-				chgReason 	= orderWidthdraw.getChgReason();
+				chgGb 		= orderWithdraw.getChgGb();
+				wdGb 		= orderWithdraw.getWdGb();
+				ordChgSq	= orderWithdraw.getOrdChgSq();
+				ordNo		= orderWithdraw.getOrdNo();
+				chgReason 	= orderWithdraw.getChgReason();
+				chgMemo 	= orderWithdraw.getChgMemo();
 			}
 			index++;
 		}
 		
 		ModelAndView mav = new ModelAndView();
-		mav.addObject("orderWidthdrawList"	, orderWidthdrawList);									// 회수컨펌대상목록
+		mav.addObject("orderWithdrawList"	, orderWithdrawList);									// 회수컨펌대상목록
 		mav.addObject("chgGb"				, chgGb);												// 변경구분 
 		mav.addObject("wdGb"				, wdGb);												// 회수구분
+		mav.addObject("ordChgSq"			, ordChgSq);											// 변경번호
+		mav.addObject("ordNo"				, ordNo);												// 주문번호
 		mav.addObject("chgReason"			, chgReason);											// 변경사유
+		mav.addObject("chgMemo"				, chgMemo);												// 변경메모
 		mav.addObject("chgReasonList1"		, rendererService.getAvailCommonCodeList("G688"));		// 반품사유
 		mav.addObject("chgReasonList2"		, rendererService.getAvailCommonCodeList("G689"));		// 교환사유
 		mav.setViewName("order/OrderWithdrawConfirmForm");
 		
 		return mav;
 	}
+	
+	/**
+	 * 입점업체 상품검수중 목록 회수컨펌 처리
+	 * @param order - 주문정보
+	 * @return Collection<Order>
+	 * @author jsh77b
+	 * @since 2020. 11. 16
+	 */
+	@PostMapping("/seller/widthdraw/confirm/update")
+	@ResponseBody
+	public GagaMap sellerWidthdrawConfirm(@RequestBody Order order) throws Exception {
+		
+		// 1. 회수컨펌
+		int userNo = TssSession.getInfo().getUserNo();
+		String result = coreOrderService.withdrawConfirm(order, userNo);
+		
+		GagaMap map = new GagaMap();
+		map.set("msg", result);
+		return map;
+	}
+	
+	/**
+	 * 입점업체 상품검수중 목록 회수컨펌목록 처리
+	 * @param order - 주문정보
+	 * @return Collection<Order>
+	 * @author jsh77b
+	 * @since 2020. 11. 16
+	 */
+	@PostMapping("/seller/widthdrawList/confirm/update")
+	@ResponseBody
+	public GagaMap sellerWidthdrawListConfirm(@RequestBody Collection<Order> orderList) throws Exception {
+		
+		// 1. 회수컨펌
+		int userNo = TssSession.getInfo().getUserNo();
+		String result = coreOrderService.withdrawConfirmList(orderList, userNo);
+		
+		GagaMap map = new GagaMap();
+		map.set("msg", result);
+		return map;
+	}
 }

+ 1 - 1
src/main/webapp/WEB-INF/views/order/OrderSellerClaimListForm.html

@@ -129,7 +129,7 @@ var columnDefs = [
 	{headerName: "브랜드",			field:"brandKnm",			width:100, cellClass: 'text-center'},
 	{headerName: "주문번호",			field:"ordNo",				width:100, cellClass: 'text-center'},
 	{headerName: "주문상세번호",		field:"ordDtlNo",			width:100, cellClass: 'text-center'},
-	{headerName: "주문변경번호",		field:"ordChgSq",		width:100, cellClass: 'text-center', hide: true},
+	{headerName: "주문변경번호",		field:"ordChgSq",			width:100, cellClass: 'text-center', hide: true},
 	{headerName: "클레임상태",			field:"chgStatNm", 			width:100, cellClass: 'text-center'},
 	{headerName: "요청일시",			field:"regDt", 				width:150, cellClass: 'text-center'},
 	{headerName: "요청자명",			field:"chgerNm",			width:100, cellClass: 'text-center'},

+ 5 - 6
src/main/webapp/WEB-INF/views/order/OrderSellerWithdrawListForm.html

@@ -111,7 +111,7 @@
 			</ul>
 			
 			<div class="panelContent" style="overflow: hidden;">
-				<div id="gridList" style="width: 100%; height: 700px;" class="ag-theme-balham lh30"></div>
+				<div id="gridList" style="width: 100%; height: 500px;" class="ag-theme-balham lh30"></div>
 			</div>
 		</div>
 	</form>
@@ -173,21 +173,20 @@ $('#btnInit').on('click', function() {
 	$("#multiBrand").empty();
 });
 
-// 입고확인
+// 목록회수컨펌
 $('#btnSave').on('click', function () {
-	
 	var selectedData = gridOptions.api.getSelectedRows();
 	if (selectedData.length == 0) {
 		mcxDialog.alert('선택된 행이 없습니다.');
 		return;
 	}
 	
-	mcxDialog.confirm('입고확인 하시겠습니까?', {
+	mcxDialog.confirm('선택된 행을 회수컨펌 하시겠습니까?', {
 		cancelBtnText	: "취소",
 		sureBtnText		: "확인",
 		sureBtnClick	: function(){
 			var jsonData = JSON.stringify(selectedData);
-			gagajf.ajaxJsonSubmit('/order/seller/claim/chgStat31/save', jsonData, fnSaveCallback);
+			gagajf.ajaxJsonSubmit('/order/seller/widthdrawList/confirm/update', jsonData, fnSaveCallback);
 		}
 	});
 });
@@ -242,7 +241,7 @@ var fnReturnRequest = function (paramData, ordChgSq) {
 	param += "&delvFeeCdGrp="	+ paramArr[3];
 	param += "&ordChgSq=" 		+ ordChgSq;
 	
-	var actionUrl = "/orderChange/withdraw/confirm/form?" + param;
+	var actionUrl = "/orderChange/seller/withdraw/confirm/form?" + param;
 	
 	cfnOpenModalPopup(actionUrl, 'popupReturnRequestForm');
 };

+ 95 - 10
src/main/webapp/WEB-INF/views/order/OrderWithdrawConfirmForm.html

@@ -24,14 +24,18 @@
 			<form id="cancelRequestFrm" name="cancelRequestFrm" action="/orderChange/return" method="post" target="hdFrameForOrderCancel">
 				<input type="hidden" name="ordNo" 			th:value="${ordNo}"/>
 				<input type="hidden" name="ordChgSq" 		th:value="${ordChgSq}"/>
-				<input type="hidden" name="chgReason" 		value=""/>
-				<input type="hidden" name="chgReasonDesc" 	value=""/>
+				<input type="hidden" name="chgReason" 		th:value="${chgReason}"/>
 				
-				<h4>회수정보</h4>
+				<th:block th:if="${chgGb} == 'G680_30'">
+					<h4>반품정보</h4>
+				</th:block>
+				<th:block th:if="${chgGb} == 'G680_40'">
+					<h4>교환정보</h4>
+				</th:block>
 				<div id="gridOrderWithdrawList" style="width:100%; height: 200px;" class="ag-theme-balham"></div>
 				
 				<div style="text-align:right; padding-bottom:5px; padding-top:5px;">
-					<button type="button" class="btn btn-success" id="rtnReqCancelBtn" onclick="fnCnclReq('rtnReqComplete');">회수컨펌</button>
+					<button type="button" class="btn btn-success" id="widthdrawConfirmBtn">회수컨펌</button>
 				</div>
 				
 				<table class="frmStyle">
@@ -92,7 +96,7 @@
 						<tr>
 							<th>요청메모</th>
 							<td colspan="5">
-								<textarea id="chgMemo" name="chgMemo" style="height:80px;" placeholder="취소사유를 300자내외로 작성해 주세요"></textarea>
+								<textarea id="chgMemo" name="chgMemo" style="height:80px;" placeholder="취소사유를 300자내외로 작성해 주세요" th:text="${chgMemo}"></textarea>
 							</td>
 						</tr>
 					</tbody>
@@ -105,8 +109,10 @@
 <!-- data -->
 <script th:inline="javascript">
 /*<![CDATA[*/
-var orderWidthdrawList 	= [[${orderWidthdrawList}]];	// 회수대상목록
-var sessRoleCd 			= [[${sessionInfo.roleCd}]];
+var orderWithdrawList 	= [[${orderWithdrawList}]];		// 회수대상목록
+var sessRoleCd 			= [[${sessionInfo.roleCd}]];	// 권한코드
+var chgReason			= [[${chgReason}]];				// 사유코드
+var chgGb				= [[${chgGb}]];					// 요천구분
 
 var columnWidthdrawList = [
 	{headerName: "입점업체",			field:"supplyCompNm",		width:120, cellClass: 'text-center'	, hide: true},
@@ -130,20 +136,99 @@ var columnWidthdrawList = [
 	{headerName: "요청수량",			field:"chgQty",				width:100, cellClass: 'text-center'},
 	{headerName: "교환상세번호",		field:"exchangeOrdDtlNo",	width:100, cellClass: 'text-center'},
 	{headerName: "교환옵션1",			field:"optCd11",			width:100, cellClass: 'text-center'},
-	{headerName: "교환옵션2",			field:"optCd12",			width:100, cellClass: 'text-center'}
+	{headerName: "교환옵션2",			field:"optCd12",			width:100, cellClass: 'text-center'},
+	{headerName: "물류메모",			field:"whMemo",				width:200, cellClass: 'text-left'	, editable:true}
 ];
 
 var gridOptionsWidthdrawList = gagaAgGrid.getGridOptions(columnWidthdrawList);
 </script>
 
 <script th:inline="javascript">
+
+// 사유코드체크
+var fnChangeChgReason = function(reasonCd) {
+	var customerReasonArr = ['G688_10', 'G689_10'];	
+	isCustomer = false;
+	
+	// 귀책사유체크(취소,반품,교환)
+	for (i=0 ; i<customerReasonArr.length ; i++) {
+		if (customerReasonArr[i] == reasonCd) {
+			isCustomer = true;
+		}
+	}
+	
+	// 귀책사유체크(회사,고객)
+	if (isCustomer) {
+		$("#imputeReason").text("고객");
+	} else {
+		$("#imputeReason").text("회사");
+	}
+	
+	$('#cancelRequestFrm input[name=chgReason]').val(reasonCd);
+}
+
 $(document).ready(function() {
 	// 1. 그리드생성
 	gagaAgGrid.createGrid('gridOrderWithdrawList', gridOptionsWidthdrawList);
-	gridOptionsWidthdrawList.api.setRowData(orderWidthdrawList);
+	gridOptionsWidthdrawList.api.setRowData(orderWithdrawList);
 	
-	// 2.1 TOTAL ROWS 없애기
+	// 2. TOTAL ROWS 없애기
 	gagaAgGrid.hideStatusBar('gridOrderWithdrawList');
+	
+	// 사유체크실행
+	fnChangeChgReason(chgReason);
+});
+
+
+// 회수컨펌버튼
+$("#widthdrawConfirmBtn").on("click", function(){
+	
+	// 1. 취소사유 체크
+	var chgReason = $("#cancelRequestFrm select[name=selectChgReason]").val();
+	if (gagajf.isNull(chgReason)) {
+		mcxDialog.alert("취소사유를 입력하세요."); 
+		return ;
+	}
+	
+	// 변경신청목록
+	var withdrawConfirmList = [];
+	
+	for (i=0 ; i<orderWithdrawList.length ; i++) {
+		var obj = new Object();
+		obj.ordChgSq 	= orderWithdrawList[i].ordChgSq;
+		obj.ordNo 		= orderWithdrawList[i].ordNo;
+		obj.ordDtlNo	= orderWithdrawList[i].ordDtlNo;
+		obj.whMemo 		= orderWithdrawList[i].whMemo;
+		
+		withdrawConfirmList.push(obj);
+	}
+	
+	// 2. 데이타적재
+	var jsonObj = {
+		"ordNo"					: $('#cancelRequestFrm input[name=ordNo]').val()
+		,"ordChgSq"				: $('#cancelRequestFrm input[name=ordChgSq]').val()
+		,"chgReason" 			: $('#cancelRequestFrm input[name=chgReason]').val()
+		,"chgMemo"				: $('#chgMemo').val()
+		,"isCustomer"			: isCustomer
+		,"withdrawConfirmList"	: withdrawConfirmList
+	}
+	
+	// 주문번호, 취소사유, 취소메모, (취소, 반품, 교환 신청 정보 목록), 환불계좌
+	var jsonData = JSON.stringify(jsonObj);
+	
+	mcxDialog.confirm('회수컨펌을 진행 하시겠습니까?', {
+		cancelBtnText		: "취소",
+		sureBtnClick		: function(){
+			gagajf.ajaxJsonSubmit(
+				"/orderChange/seller/widthdraw/confirm/update"
+				, jsonData
+				, function() {
+					uifnPopupClose('popupReturnRequestForm');
+					fnSearch();
+				}
+			);
+		}
+	});
 });
 </script>
 </html>