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

금액정보 유효성체크 추가

tsit14 5 лет назад
Родитель
Сommit
2dc96eebc9

+ 75 - 13
src/main/java/com/style24/front/biz/service/TsfOrderService.java

@@ -541,30 +541,92 @@ public class TsfOrderService {
 		order.setFrontGb(TsfSession.getFrontGb());
 		Collection<Order> cartGoodsList = coreOrderService.getCartGoodsList(order);
 		
-		int orderDetailCurrPriceSum 	= 0;
-		int orderDetailRealOrdAmtSum 	= 0;
-		int cpn1DcAmtSum				= 0;
-		int tmtb1DcAmtSum				= 0;
-		int tmtb2DcAmtSum				= 0;
-		int goodsCpnDcAmtSum			= 0;
-		int cartCpnDcAmtSum				= 0;
+		int orgGoodsSumAmt 			= 0;
+		int cpn1DcSumAmt			= 0;
+		int tmtb1DcSumAmt			= 0;
+		int tmtb2DcSumAmt			= 0;
+		int goodsCpnDcSumAmt		= 0;
+		int cartCpnDcSumAmt			= 0;
+		int prePntDcSumAmt			= 0;
+		int pntDcSumAmt				= 0;
+		int gfcdUseSumAmt			= 0;
+		int realOrdSumAmt 			= 0;
 		
-		int cartCurrPriceSum 			= 0;
-		int cartRealOrdAmtSum 			= 0;
+		int cartOrgGoodsSumAmt 		= 0;
+		int cartRealOrdSumAmt 		= 0;
 		
 		// 주문서화면 금액정보 체크
 		for (Order orderDetail : orderDetailList) {
-			orderDetailCurrPriceSum 	= orderDetailCurrPriceSum + orderDetail.getCurrPrice();
-			orderDetailRealOrdAmtSum 	= orderDetailRealOrdAmtSum + orderDetail.getRealOrdAmt();
+			orgGoodsSumAmt 				= orgGoodsSumAmt 	+ orderDetail.getCurrPrice();
+			cpn1DcSumAmt 				= cpn1DcSumAmt 		+ orderDetail.getCpn1DcAmt();
+			tmtb1DcSumAmt 				= tmtb1DcSumAmt 	+ orderDetail.getTmtb1DcAmt();
+			tmtb2DcSumAmt 				= tmtb2DcSumAmt 	+ orderDetail.getTmtb2DcAmt();
+			goodsCpnDcSumAmt			= goodsCpnDcSumAmt 	+ orderDetail.getGoodsCpnDcAmt();
+			cartCpnDcSumAmt				= cartCpnDcSumAmt 	+ orderDetail.getCartCpnDcAmt();
+			prePntDcSumAmt				= prePntDcSumAmt 	+ orderDetail.getPrePntDcAmt();
+			pntDcSumAmt					= pntDcSumAmt 		+ orderDetail.getPntDcAmt();
+			gfcdUseSumAmt				= gfcdUseSumAmt 	+ orderDetail.getGfcdUseAmt();
+			realOrdSumAmt 				= realOrdSumAmt 	+ orderDetail.getRealOrdAmt();
 		}
 		
+		if (orgGoodsSumAmt != order.getOrgGoodsSumAmt()) {
+			resultStr = "판매가 금액정보가 잘못 되었습니다.";
+			return resultStr;
+		}
+		
+		if (cpn1DcSumAmt != order.getCpn1DcSumAmt()) {
+			resultStr = "즉시할인 금액정보가 잘못 되었습니다.";
+			return resultStr;
+		}
+		
+		if (tmtb1DcSumAmt != order.getTmtb1DcSumAmt()) {
+			resultStr = "수량다다익선 할인 금액정보가 잘못 되었습니다.";
+			return resultStr;
+		}
+		
+		if (tmtb2DcSumAmt != order.getTmtb2DcSumAmt()) {
+			resultStr = "금액다다익선 할인 금액정보가 잘못 되었습니다.";
+			return resultStr;
+		}
+		
+		if (goodsCpnDcSumAmt != order.getGoodsCpnDcSumAmt()) {
+			resultStr = "상품쿠폰 할인 금액정보가 잘못 되었습니다.";
+			return resultStr;
+		}
+		
+		if (cartCpnDcSumAmt != order.getCartCpnDcSumAmt()) {
+			resultStr = "장바구니쿠폰 할인 금액정보가 잘못 되었습니다.";
+			return resultStr;
+		}
+		
+		if (prePntDcSumAmt != order.getPrePntDcSumAmt()) {
+			resultStr = "선포인트 할인 금액정보가 잘못 되었습니다.";
+			return resultStr;
+		}
+		
+		if (pntDcSumAmt != order.getPntDcSumAmt()) {
+			resultStr = "포인트 할인 금액정보가 잘못 되었습니다.";
+			return resultStr;
+		}
+		
+		if (gfcdUseSumAmt != order.getGfcdUseSumAmt()) {
+			resultStr = "상품권 사용 금액정보가 잘못 되었습니다.";
+			return resultStr;
+		}
+		
+		if (realOrdSumAmt != order.getRealOrdSumAmt()) {
+			resultStr = "실결제 금액정보가 잘못 되었습니다.";
+			return resultStr;
+		}
+		
+		
 		// 장바구니 금액정보 체크
 		for (Order orderDetail : cartGoodsList) {
-			cartCurrPriceSum 			= cartCurrPriceSum + orderDetail.getOrgCurrPrice();
+			cartOrgGoodsSumAmt 			= cartOrgGoodsSumAmt + orderDetail.getOrgCurrPrice();
 		}
 		
 		// 판매가비교
-		if (orderDetailCurrPriceSum != cartCurrPriceSum) {
+		if (orgGoodsSumAmt != cartOrgGoodsSumAmt) {
 			resultStr = "금액정보가 잘못 되었습니다.";
 			return resultStr;
 		}

+ 12 - 37
src/main/java/com/style24/front/biz/web/TsfOrderController.java

@@ -738,45 +738,11 @@ public class TsfOrderController extends TsfBaseController {
 		// 3. 주문기본정보등록(주문접수)
 		coreOrderService.createPreOrder(order);
 		
-		// 4. 2021.05.10 장바구니정보 정보 삭제
+		// 4. 2021.05.10 장바구니정보 주문번호 업데이트
 		orderService.insertCartHstOrdNo(order);
-		
-		log.info("order.getEntryNo()           ::: {}", order.getEntryNo());
-		log.info("order.getPgGb()              ::: {}", order.getPgGb());
-		log.info("order.getPayMeans()          ::: {}", order.getPayMeans());
-		log.info("order.getOrdNo()             ::: {}", order.getOrdNo());
-		log.info("order.getGoodsNm()           ::: {}", order.getGoodsNm());
-		log.info("order.getOrdGoodsQty()       ::: {}", order.getOrdGoodsQty());
-		log.info("order.getPayAmt()            ::: {}", order.getPayAmt());
-		log.info("order.getOrdNm()             ::: {}", order.getOrdNm());
-		log.info("order.getOrdPhnno()          ::: {}", order.getOrdPhnno());
-		log.info("order.getCustNo()            ::: {}", order.getCustNo());
-		log.info("order.getFreegiftValArr()    ::: {}", order.getFreegiftValArr());
-		log.info("order.getFreegiftSqArr()     ::: {}", order.getFreegiftSqArr());
-		log.info("order.getSexGb()             ::: {}", order.getSexGb());
-		log.info("order.getBirthYmd()          ::: {}", order.getBirthYmd());
-		log.info("order.getGiftMsg()           ::: {}", order.getGiftMsg());
-		
-		for (int i = 0 ; i < order.getFreegiftGoodsArr().length ; i++) {
-			log.info("order.getFreegiftGoodsArr()  ::: {}", order.getFreegiftGoodsArr()[i]);
-		}
-
-		// 필수 데이터
-		// pgGb = 결제타입, payMeans = 결제수단, ordNo = 주문번호, goodsNm = 상품명, payAmt = 실결제금액, ordNm = 주문자명, ordPhnno = 휴대폰번호, custNo = 고객번호
-		// 선택 데이터
-		// ordEmail = 주문자메일, ordTelno = 전화번호
-		
-		/* 
-		=== 카카오페이 & 네이버페이 파라메터 ===
-		ordNo = 주문번호
-		custNo = 고객번호
-		goodsNm = 상품명
-		ordGoodsQty = 주문상품수량
-		payAmt = 결제금액
-		======================
-		*/
 
 		Payment payment = orderService.setPgDataInfo(order);
+		
 		// 2021.05.10 추가
 		payment.setPayUrl("/create/preOrder");
 		payment.setRetUrl("/pay/result/response");
@@ -828,7 +794,16 @@ public class TsfOrderController extends TsfBaseController {
 		coreOrderService.updateOrderInfo(order);
 		
 		// 4. 2021.05.10 장바구니정보 삭제
-		orderService.deleteCartOrdNo(order);
+		boolean cartDelTemp = true;
+		if (TsfSession.isLogin()) {
+			if ("jsh77b".equals(TsfSession.getInfo().getCustId()) || "xodud1202".equals(TsfSession.getInfo().getCustId()) || "card007".equals(TsfSession.getInfo().getCustId())) {
+				cartDelTemp = false;
+			}
+		}
+		
+		if (cartDelTemp) {
+			orderService.deleteCartOrdNo(order);
+		}
 		
 		// TODO 5. 2021.05.10 보증보험 API 연동
 		orderService.updateInsurance(order);

+ 10 - 0
src/main/webapp/WEB-INF/views/mob/order/OrderFormMob.html

@@ -1247,6 +1247,16 @@ var paymentInfoSet = function() {
 						,"giftMsg"				: giftMsg
 						,"custPayMeans"			: custPayMeans
 						,"cartSqArr"			: cartSqArr
+						,"orgGoodsSumAmt"		: $("#orderAmtForm .orgGoodsSumAmt").text()
+						,"cpn1DcSumAmt"			: $("#orderAmtForm .cpn1DcSumAmt").text()
+						,"tmtb1DcSumAmt"		: $("#orderAmtForm .tmtb1DcSumAmt").text()
+						,"tmtb2DcSumAmt"		: $("#orderAmtForm .tmtb2DcSumAmt").text()
+						,"goodsCpnDcSumAmt"		: $("#orderAmtForm .goodsCpnDcSumAmt").text()
+						,"cartCpnDcSumAmt"		: $("#orderAmtForm .cartCpnDcSumAmt").text()
+						,"prePntDcSumAmt"		: $("#orderAmtForm .prePntDcSumAmt").text()
+						,"pntDcSumAmt"			: $("#orderAmtForm .pntDcSumAmt").text()
+						,"gfcdUseSumAmt"		: $("#orderAmtForm .gfcdUseSumAmt").text()
+						,"realOrdSumAmt"		: $("#orderAmtForm .realOrdSumAmt").text()
 					};
 					
 					$.ajax( {

+ 10 - 0
src/main/webapp/WEB-INF/views/web/order/OrderFormWeb.html

@@ -1229,6 +1229,16 @@ var paymentInfoSet = function() {
 						,"giftMsg"				: ""
 						,"custPayMeans"			: custPayMeans
 						,"cartSqArr"			: cartSqArr
+						,"orgGoodsSumAmt"		: $("#orderAmtForm .orgGoodsSumAmt").text()
+						,"cpn1DcSumAmt"			: $("#orderAmtForm .cpn1DcSumAmt").text()
+						,"tmtb1DcSumAmt"		: $("#orderAmtForm .tmtb1DcSumAmt").text()
+						,"tmtb2DcSumAmt"		: $("#orderAmtForm .tmtb2DcSumAmt").text()
+						,"goodsCpnDcSumAmt"		: $("#orderAmtForm .goodsCpnDcSumAmt").text()
+						,"cartCpnDcSumAmt"		: $("#orderAmtForm .cartCpnDcSumAmt").text()
+						,"prePntDcSumAmt"		: $("#orderAmtForm .prePntDcSumAmt").text()
+						,"pntDcSumAmt"			: $("#orderAmtForm .pntDcSumAmt").text()
+						,"gfcdUseSumAmt"		: $("#orderAmtForm .gfcdUseSumAmt").text()
+						,"realOrdSumAmt"		: $("#orderAmtForm .realOrdSumAmt").text()
 					};
 					
 					$.ajax( {