ソースを参照

회수컨펌 수정

jsh77b 4 年 前
コミット
a96dfa7d91

+ 6 - 0
src/main/java/com/style24/admin/biz/web/TsaOrderChangeScmController.java

@@ -56,6 +56,7 @@ public class TsaOrderChangeScmController extends TsaBaseController {
 		
 		Order order = new Order();
 		order.setOrdChgSq(ordChgSq);
+		order.setOrdNo(ordNo);
 		
 		// 2021.06.25 페이징 처리
 		order.setPageable(new TscPageRequest(order.getPageNo() - 1, order.getPageSize()));
@@ -90,6 +91,11 @@ public class TsaOrderChangeScmController extends TsaBaseController {
 		mav.addObject("chgMemo"				, chgMemo);												// 변경메모
 		mav.addObject("chgReasonList1"		, rendererService.getAvailCommonCodeList("G688"));		// 반품사유
 		mav.addObject("chgReasonList2"		, rendererService.getAvailCommonCodeList("G689"));		// 교환사유
+		
+		// 2021.12.10 추가
+		Collection<Order> orderInfoList = coreOrderService.getOrderInfoList(order);
+		mav.addObject("orderInfoList"		, orderInfoList);
+				
 		mav.setViewName("order/OrderWithdrawConfirmForm");
 		
 		return mav;

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

@@ -2,7 +2,7 @@
 <html lang="ko" xmlns:th="http://www.thymeleaf.org">
 <!--
  *******************************************************************************
- * @source  : CancelRequestForm.html
+ * @source  : OrderWithdrawConfirmForm.html
  * @desc    : 입점업체 회수컨펌 화면
  *============================================================================
  * STYLE24
@@ -115,6 +115,11 @@ var orderWithdrawList 	= [[${orderWithdrawList}]];		// 회수대상목록
 var sessRoleCd 			= [[${sessionInfo.roleCd}]];	// 권한코드
 var chgReason			= [[${chgReason}]];				// 사유코드
 var chgGb				= [[${chgGb}]];					// 요천구분
+var orderInfoList 		= [[${orderInfoList}]];			// 주문기본정보
+var ordNo				= orderInfoList[0].ordNo;		// 주문번호
+var payGb 				= orderInfoList[0].payGb;		// 결제수단
+var payMeans 			= orderInfoList[0].payMeans;	// 결제방법
+var payStat				= orderInfoList[0].payStat;		// 결제상태
 
 var columnWidthdrawList = [
 	{headerName: "입점업체",			field:"supplyCompNm",		width:120, cellClass: 'text-center'	, hide: true},
@@ -140,6 +145,105 @@ var columnWidthdrawList = [
 	{headerName: "교환옵션1",			field:"optCd11",			width:100, cellClass: 'text-center'},
 	{headerName: "교환옵션2",			field:"optCd12",			width:100, cellClass: 'text-center'},
 	{headerName: "물류메모",			field:"whMemo",				width:200, cellClass: 'text-left'	, editable:true},
+	{
+		headerName		: "주문"
+		, field			: "ordAmt"
+		, width			: 80
+		, cellClass		: 'text-right'
+		, cellRenderer	: function (params) {
+			return params.value.addComma();
+		}
+	},
+	{
+		headerName		: "취소"
+		, field			: "cnclRtnAmt"
+		, width			: 80
+		, cellClass		: 'text-right'
+		, cellRenderer	: function (params) {
+			return params.value.addComma();
+		}
+	},
+	{
+		headerName		: "즉시할인"
+		, field			: "cpn1DcAmt"
+		, width			: 80
+		, cellClass		: 'text-right'
+		, cellRenderer	: function (params) {
+			return params.value.addComma();
+		}
+	},
+	{
+		headerName		: "다다익선1"
+		, field			: "tmtb1DcAmt"
+		, width			: 80
+		, cellClass		: 'text-right'
+		, cellRenderer	: function (params) {
+			return params.value.addComma();
+		}
+	},
+	{
+		headerName		: "다다익선2"
+		, field			: "tmtb2DcAmt"
+		, width			: 80
+		, cellClass		: 'text-right'
+		, cellRenderer	: function (params) {
+			return params.value.addComma();
+		}
+	},
+	{
+		headerName		: "상품쿠폰"
+		, field			: "goodsCpnDcAmt"
+		, width			: 80
+		, cellClass		: 'text-right'
+		, cellRenderer	: function (params) {
+			return params.value.addComma();
+		}
+	},
+	{
+		headerName		: "장바구니쿠폰"
+		, field			: "cartCpnDcAmt"
+		, width			: 100
+		, cellClass		: 'text-right'
+		, cellRenderer	: function (params) {
+			return params.value.addComma();
+		}
+	},
+	{
+		headerName		: "포인트"
+		, field			: "pntDcAmt"
+		, width			: 80
+		, cellClass		: 'text-right'
+		, cellRenderer	: function (params) {
+			return params.value.addComma();
+		}
+	},
+	{
+		headerName		: "선포인트"
+		, field			: "prePntDcAmt"
+		, width			: 80
+		, cellClass		: 'text-right'
+		, cellRenderer	: function (params) {
+			return params.value.addComma();
+		}
+	},
+	{
+		headerName		: "상품권"
+		, field			: "gfcdUseAmt"
+		, width			: 80
+		, cellClass		: 'text-right'
+		, cellRenderer	: function (params) {
+			return params.value.addComma();
+		}
+	},
+	{
+		headerName		: "실결제금액"
+		, field			: "realOrdAmt"
+		, width			: 100
+		, cellClass		: 'text-right'
+		, cellRenderer	: function (params) {
+			return params.value.addComma();
+		}
+	},
 	{headerName: "주문자명",			field:"ordNm",				width:120, cellClass: 'text-left'	, hide: true},
 	{headerName: "주문자핸드폰번호",	field:"ordPhnno",			width:120, cellClass: 'text-left'	, hide: true},
 ];
@@ -171,6 +275,77 @@ var fnChangeChgReason = function(reasonCd) {
 	$('#cancelRequestFrm input[name=chgReason]').val(reasonCd);
 }
 
+//환불예상금액계산
+var fnCalculateRefundAmt = function (obj) {
+	
+	// 2021.05.25 수정
+	var ordDtlNoArr 		= [];
+	var cnclRtnReqQtyArr 	= [];
+	
+	// 1. 반품신청수량 체크
+	for (i=0 ; i<orderWithdrawList.length ; i++) {
+		if (orderWithdrawList[i].chgQty > 0) {
+			// 반품신청값설정
+			ordDtlNoArr.push(orderWithdrawList[i].ordDtlNo);
+			cnclRtnReqQtyArr.push(orderWithdrawList[i].chgQty);
+		}
+	}
+	
+	// 2. 추가정보설정
+	var chgerNm 	= orderInfoList[0].ordNm;
+	var chgerEmail 	= orderInfoList[0].ordEmail;
+	var chgerPhnno 	= orderInfoList[0].ordPhnno;
+	var chgerTelno 	= orderInfoList[0].ordTelno;
+	var custNo		= orderInfoList[0].custNo;
+	var delvFeeCd	= orderInfoList[0].delvFeeCd;
+	
+	// 환불금액계산호출
+	var jsonObj = {
+		"ordNo"					: ordNo
+		,"ordDtlNoArr"			: ordDtlNoArr
+		,"cnclRtnReqQtyArr"		: cnclRtnReqQtyArr
+		,"isCustomer" 			: isCustomer
+		,"chgerNm"				: chgerNm
+		,"chgerEmail"			: chgerEmail
+		,"chgerPhnno"			: chgerPhnno
+		,"custNo"				: custNo
+		,"ordNm"				: chgerNm
+		,"ordPhnno"				: chgerPhnno
+		,"delvFeeCd"			: delvFeeCd
+	}
+	
+	var jsonData = JSON.stringify(jsonObj);
+	
+	gagajf.ajaxJsonSubmit(
+		'/orderChange/cancel/refundAmt'
+		, jsonData
+		, function(result) {
+			// 2021.12.01 취소금액설정
+			if (result.cancelOrderRefundList != null && result.cancelOrderRefundList.length > 0) {
+				for (i=0 ; i<result.cancelOrderRefundList.length ; i++) {
+					for (j=0 ; j<orderWithdrawList.length ; j++) {
+						if (result.cancelOrderRefundList[i].ordDtlNo == orderWithdrawList[j].ordDtlNo) {
+							orderWithdrawList[j].cnclRtnAmt 	= result.cancelOrderRefundList[i].cnclRtnAmt;		// 취소금액
+							orderWithdrawList[j].cpn1DcAmt 		= result.cancelOrderRefundList[i].cpn1DcAmt;		// 즉시할인쿠폰금액
+							orderWithdrawList[j].tmtb1DcAmt 	= result.cancelOrderRefundList[i].tmtb1DcAmt;		// 수량할인다다익선금액
+							orderWithdrawList[j].tmtb2DcAmt 	= result.cancelOrderRefundList[i].tmtb2DcAmt;		// 금액할인다다익선금액
+							orderWithdrawList[j].goodsCpnDcAmt 	= result.cancelOrderRefundList[i].goodsCpnDcAmt;	// 상품쿠폰금액
+							orderWithdrawList[j].cartCpnDcAmt 	= result.cancelOrderRefundList[i].cartCpnDcAmt;		// 장바구니쿠폰금액
+							orderWithdrawList[j].pntDcAmt 		= result.cancelOrderRefundList[i].pntDcAmt;			// 포인트금액
+							orderWithdrawList[j].prePntDcAmt 	= result.cancelOrderRefundList[i].prePntDcAmt;		// 선포인트금액
+							orderWithdrawList[j].gfcdUseAmt 	= result.cancelOrderRefundList[i].gfcdUseAmt;		// 상품권적용금액
+							orderWithdrawList[j].realOrdAmt 	= result.cancelOrderRefundList[i].realOrdAmt;		// 실결제금액
+						}
+					}
+				}
+				
+				// 주문변경대상정보 재설정
+				gridOptionsWidthdrawList.api.setRowData(orderWithdrawList);
+			}
+		}
+	);
+}
+
 $(document).ready(function() {
 	// 1. 그리드생성
 	gagaAgGrid.createGrid('gridOrderWithdrawList', gridOptionsWidthdrawList);
@@ -181,6 +356,9 @@ $(document).ready(function() {
 	
 	// 사유체크실행
 	fnChangeChgReason(chgReason);
+	
+	// 2021.12.10 취소금액계산
+	fnCalculateRefundAmt(null);
 });