Parcourir la source

이태영 - 20210423 USAFE 보증보험 개발중

xodud1202 il y a 5 ans
Parent
commit
bcdffd1d52

+ 37 - 1
src/main/java/com/style24/front/biz/service/TsfOrderService.java

@@ -639,6 +639,7 @@ public class TsfOrderService {
 	 * @author xodud1202
 	 * @since 2021. 04. 23
 	 */
+	@Transactional("shopTxnManager")
 	public GiftCard kcpCashReceiptsRequest(GiftCard param) {
 		GiftCard result = new GiftCard();
 		HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest();
@@ -729,8 +730,9 @@ public class TsfOrderService {
 	 * @author xodud1202
 	 * @since 2021. 04. 26
 	 */
+	@Transactional("shopTxnManager")
 	public String uSafeGuaranteeInsurance(Order param) {
-		InsuranceManager manager = new InsuranceManager("http://gateway.usafe.co.kr/esafe/guartrn.asp" , null );
+		InsuranceManager manager = new InsuranceManager(env.getProperty("usafe.guarantee.send.url") , null );
 
 		InsuranceInfo dInfo = new InsuranceInfo();
 
@@ -801,4 +803,38 @@ public class TsfOrderService {
 
 		return "SUCCESS";
 	}
+
+	/**
+	 * USAFE 보증보험 신청
+	 * temp.setOrdNo(111);			// 상품명 배열
+	 * @param param
+	 * @author xodud1202
+	 * @since 2021. 04. 26
+	 */
+	@Transactional("shopTxnManager")
+	public String uSafeGuaranteeDepositCompleted(Order param) {
+		// 보증보험 정보 조회
+		Order insurance = coreOrderDao.getInsuranceInfo(param);
+
+		if(insurance != null) {
+			// 보증보험 입금 완료 정보 송부
+			InsuranceManager manager = new InsuranceManager(env.getProperty("usafe.guarantee.send.url"), null);
+			String result = manager.confirmPayment(env.getProperty("usafe.guarantee.mall.id"), String.valueOf(param.getOrdNo()), insurance.getInsNo());
+
+			// 송부 결과
+			String rtnResult[]	= result.split("[\u007C]");
+			param.setResultCd(rtnResult[0]);
+			param.setResultMsg(rtnResult[1]);
+
+			if("0".equals(param.getResultCd())) {
+				param.setIfYn("Y");
+			} else {
+				param.setIfYn("F");
+			}
+
+			coreOrderDao.updateInsuranceInfo(param);
+		}
+
+		return "SUCCESS";
+	}
 }

+ 0 - 42
src/main/java/com/style24/front/biz/web/TsfCartController.java

@@ -148,48 +148,6 @@ public class TsfCartController extends TsfBaseController {
 		model.addAttribute("order", order);
 		model.addAttribute("IMG_PATH", env.getProperty("upload.goods.view"));
 
-
-		Order temp = new Order();
-		String[]	goodsNameArr	= new String[3];	 //상품명
-		String[]	goodsPriceArr	= new String[3];	 //가격
-		String[]	goodsQuantityArr = new String[3]; //상품수량
-
-		// goodsCount 수량에 맞춰 아래 필드 작성
-		goodsNameArr[0] = "테스트아이템1";
-		goodsNameArr[1] = "테스트아이템2";
-		goodsNameArr[2] = "테스트아이템3";
-
-		goodsPriceArr[0] = "100";
-		goodsPriceArr[1] = "500";
-		goodsPriceArr[2] = "300";
-
-		goodsQuantityArr[0] = "1";
-		goodsQuantityArr[1] = "2";
-		goodsQuantityArr[2] = "3";
-
-		temp.setItemNmArr(goodsNameArr);		// 상품명 배열
-		temp.setGoodsPriceArr(goodsPriceArr);	// 상품별 가격 배열
-		temp.setItemQtyArr(goodsQuantityArr);	// 상품별 수량 배열
-		temp.setOrdNo(6);						// 주문번호
-		temp.setRealOrdAmt(10200);				// 결제금액
-		temp.setBirthYmd("198912021");			// 생년월일 + 성별(남자 : 1, 여자 : 2)
-		temp.setPayMeans(TscConstants.PayMeans.BANK_DEPOSIT.value());		// 무통장입금 or 계좌이체
-		temp.setBankNm("신한은행");					// 은행코드
-
-		/* 무통장입금 : 가상계좌번호, 계좌이체 : pgTid */
-		temp.setVaNo("26190167204848");
-		temp.setOrdNm("이태영");				// 주문자명
-		temp.setOrdTelno("");					// 주문자전화1 ("-" 포함)
-		temp.setOrdPhnno("010-7111-4489");		// 주문자전화2 ("-" 포함)
-		temp.setRecipZipcode("08755");			// 주문자우편번호
-		temp.setRecipAddr("서울시 관악구 신림동 1414-26 해피타워 501호");	// 주문자주소
-		temp.setOrdEmail("xodud1202@naver.com");	// 주문자이메일
-		temp.setRecipNm("이태영");				// 수령인명
-		temp.setRecipTelno("");					// 수령인전화번호
-		temp.setRecipPhnno("010-7111-4489");	// 수령인휴대폰번호
-		temp.setCustNo(100010);
-		//orderService.uSafeGuaranteeInsurance(temp);
-
 		return super.getDeviceViewName("cart/CartListAjaxForm");
 	}
 

+ 3 - 1
src/main/java/com/style24/front/biz/web/TsfPgController.java

@@ -72,7 +72,9 @@ public class TsfPgController extends TsfBaseController {
 			order.setCustNo(0);
 			order.setUpdNo(0);
 			coreOrderService.updateOrderInfoVBank(order);
-			
+
+			// USAFE 보증보험 입금확인 송부
+			orderService.uSafeGuaranteeDepositCompleted(order);
 		} catch(Exception e) {
 			result = "9999";		// 실패. return 하지 말것.
 		}

+ 4 - 1
src/main/resources/config/application-locd.yml

@@ -54,7 +54,10 @@ upload:
 
 download.path: /WIDE/workspace/files/data
 
-usafe.guarantee.mall.id: TEST00
+# USAFE 보증보험 정보
+usafe.guarantee:
+    mall.id: TEST00
+    send.url: http://gateway.usafe.co.kr/esafe/guartrn.asp
 
 # PG
 pg:

+ 4 - 1
src/main/resources/config/application-run.yml

@@ -61,7 +61,10 @@ mail:
     image.url: http://www.style24.com/image/mailing
     template.path: /app/was/deploy/wivismall.front/WEB-INF/mail
 
-usafe.guarantee.mall.id: istyle2400
+# USAFE 보증보험 정보
+usafe.guarantee:
+    mall.id: istyle2400
+    send.url: https://gateway.usafe.co.kr/esafe/guartrn.asp
 
 # PG
 pg:

+ 5 - 1
src/main/resources/config/application-tsit.yml

@@ -54,7 +54,11 @@ upload:
 
 download.path: /TSIT/servers/files/data
 
-usafe.guarantee.mall.id: TEST00
+# USAFE 보증보험 정보
+usafe.guarantee:
+    mall.id: TEST00
+    send.url: http://gateway.usafe.co.kr/esafe/guartrn.asp
+
 
 # PG
 pg: