Pārlūkot izejas kodu

이태영 - 20210616 네이버페이 주문형 개발 중

xodud lee 4 gadi atpakaļ
vecāks
revīzija
ec60018caf

+ 21 - 9
src/main/java/com/style24/admin/biz/web/TsaOrderChangeController.java

@@ -1,9 +1,9 @@
 package com.style24.admin.biz.web;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
+import java.util.*;
 
+import com.style24.core.biz.service.*;
+import com.style24.persistence.domain.Payment;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -22,12 +22,6 @@ import com.style24.admin.biz.service.TsaOrderChangeService;
 import com.style24.admin.biz.service.TsaRendererService;
 import com.style24.admin.support.controller.TsaBaseController;
 import com.style24.admin.support.security.session.TsaSession;
-import com.style24.core.biz.service.TscKakaotalkService;
-import com.style24.core.biz.service.TscKcpService;
-import com.style24.core.biz.service.TscMailService;
-import com.style24.core.biz.service.TscOrderChangeService;
-import com.style24.core.biz.service.TscOrderRefundService;
-import com.style24.core.biz.service.TscOrderService;
 import com.style24.core.support.env.TscConstants;
 import com.style24.core.support.message.TscMessageByLocale;
 import com.style24.persistence.domain.CustAccount;
@@ -68,6 +62,9 @@ public class TsaOrderChangeController extends TsaBaseController {
 	@Autowired
 	private TscKcpService coreKcpService;
 
+	@Autowired
+	private TscNaverPayService coreNaverPayService;
+
 	@Autowired
 	private TscKakaotalkService coreKakaotalkService;
 
@@ -232,6 +229,13 @@ public class TsaOrderChangeController extends TsaBaseController {
 		// 2021.06.09 취소접수승인
 		else if ("cnclReqComplete".equals(cnclReq.getReqGbn())) {
 			result = coreOrderChangeService.approveCancelRequest(cnclReq, userNo);
+			if(StringUtils.isNotBlank(result.getString("pgGb")) && TscConstants.PgGb.NAVER_ORDER.value().equals(result.getString("pgGb"))) {
+				Order order = new Order();
+				order.setOrdNo(cnclReq.getOrdNo());
+				order.setOrdChgSq(cnclReq.getOrdChgSq());
+				order.setRegNo(userNo);
+				coreNaverPayService.sendNaverPayOrderCancelConfirm(order);
+			}
 		}
 		// 2021.06.09 취소접수철회
 		else if ("cnclReqCancel".equals(cnclReq.getReqGbn())) {
@@ -247,6 +251,14 @@ public class TsaOrderChangeController extends TsaBaseController {
 
 		if (ordChgSq > 0) {
 			try {
+				Payment payment = new Payment();
+				payment.setOrdNo(cnclReq.getOrdNo());
+				payment = coreOrderChangeService.getPaymentInfo(payment);
+				// 네이버페이 주문형 데이터는 알림톡, 메일 송부X
+				if(TscConstants.PgGb.NAVER_ORDER.value().equals(payment.getPgGb())) {
+					return super.ok("성공");
+				}
+
 				// 취소 알림톡 관련 정보 조회
 				OrderChange orderChange = coreOrderChangeService.getKakaoOrderCancelInfo(ordChgSq);
 

+ 5 - 0
src/main/resources/config/application-locd.yml

@@ -100,6 +100,11 @@ naverPay:
     order.api.url: https://test-api.pay.naver.com/o/customer/api/order/v20/register
     order.pc.url: https://test-order.pay.naver.com/customer/buy/
     order.mobile.url: https://test-m.pay.naver.com/o/customer/buy/
+    access.license: 01000100005b15bb8faab722d100d589f34bd64843659e37a168b3617443c4f52a3fda45b8
+    secret.key: AQABAADtZ/jOC1Y3LNsyI0TWwCMvPfrg0sqM9pnxliSegbjSqQ==
+    port.address: http://sandbox.api.naver.com/Checkout/MallService5
+    service.name: MallService5
+    version: 5.0
 
 # 샵링커 API(개발계정)
 shoplinker:

+ 7 - 0
src/main/webapp/WEB-INF/views/order/CnclReqForm.html

@@ -846,6 +846,7 @@ var gridOptionsDelvCdList = gagaAgGrid.getGridOptions(columnDelvCdList);
 <script>
 // 현재 사유는 고객 입니다.
 var isCustomer = true;
+var pgGb		= orderInfoList[0].pgGb;	// PG구분
 
 // 환불예상금액계산
 var fnCalculateRefundAmt = function (obj) {
@@ -1204,6 +1205,12 @@ $(document).ready(function() {
 		$("#cnclReqCompleteBtn").css("display", "none");
 		$("#cnclReqCancelBtn").css("display", "none");
 	}
+
+	// 네이버페이 주문형일 경우 취소 접수, 완료 버튼 hide
+	if(pgGb == "NAVER_ORDER") {
+		$("#cnclReqBtn").css("display", "none");
+		$("#cnclCompleteBtn").css("display", "none");
+	}
 	
 	// 6. 취소사유 선택
 	if (ordChgSq > 0 && chgStat != 'G685_40') {