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

Merge remote-tracking branch 'origin/develop' into jsh77b

jsh77b 4 лет назад
Родитель
Сommit
739cfa9d8f

+ 28 - 8
src/main/java/com/style24/front/biz/service/TsfGiftcardService.java

@@ -2,11 +2,13 @@ package com.style24.front.biz.service;
 
 import java.util.Collection;
 
-import com.style24.core.biz.thirdparty.Yes24Giftcard;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import com.gagaframework.web.parameter.GagaMap;
+import com.gagaframework.web.rest.server.GagaResponseStatus;
+import com.style24.core.biz.thirdparty.Yes24Giftcard;
 import com.style24.front.biz.dao.TsfGiftcardDao;
 import com.style24.front.support.security.session.TsfSession;
 import com.style24.persistence.domain.GiftCard;
@@ -86,7 +88,9 @@ public class TsfGiftcardService {
 	 * @since 2021. 3. 15
 	 */
 	@Transactional("shopTxnManager")
-	public void createGiftcardUseConfirm(GiftCard giftcard) throws Exception {
+	public GagaMap createGiftcardUseConfirm(GiftCard giftcard) throws Exception {
+		GagaMap map = new GagaMap();
+		GagaMap error = new GagaMap();
 		// 고객번호 설정
 		int custNo = TsfSession.getInfo().getCustNo();
 		String ip = TsfSession.getIpAddress();
@@ -99,26 +103,39 @@ public class TsfGiftcardService {
 		String pubNo = giftcard.getGfcdNo();
 		String result =yes24Gift.soapDataTransfer(pubNo,ip,custNo);
 
+		// result message 설정
+		map.set("status", GagaResponseStatus.FAIL.getCode());
+
 		if (result.equals("01")) {
 			giftcard.setResultVal(result);  // 승인 결과 insert
 			giftcardDao.saveGiftcardApi(giftcard);
-			throw new IllegalArgumentException("존재하지 않는 상품권입니다.");
+			// throw new IllegalArgumentException("존재하지 않는 상품권입니다.");
+			error.set("message", "존재하지 않는 상품권입니다.");
+			map.set("error", error);
 		} else if (result.equals("02")) {
 			giftcard.setResultVal(result);  
 			giftcardDao.saveGiftcardApi(giftcard);
-			throw new IllegalArgumentException("이미 등록된 상품권입니다.");
+			// throw new IllegalArgumentException("이미 등록된 상품권입니다.");
+			error.set("message", "이미 등록된 상품권입니다.");
+			map.set("error", error);
 		} else if (result.equals("03")) {
 			giftcard.setResultVal(result);  
 			giftcardDao.saveGiftcardApi(giftcard);
-			throw new IllegalArgumentException("삭제된 상품권입니다.");
+			// throw new IllegalArgumentException("삭제된 상품권입니다.");
+			error.set("message", "삭제된 상품권입니다.");
+			map.set("error", error);
 		} else if (result.equals("04")) {
 			giftcard.setResultVal(result);  
 			giftcardDao.saveGiftcardApi(giftcard);
-			throw new IllegalArgumentException("기간이 만료된 상품권입니다.");
+			// throw new IllegalArgumentException("기간이 만료된 상품권입니다.");
+			error.set("message", "기간이 만료된 상품권입니다.");
+			map.set("error", error);
 		} else if (result.equals("99")) {
 			giftcard.setResultVal(result);  
 			giftcardDao.saveGiftcardApi(giftcard);
-			throw new IllegalArgumentException("시스템 오류입니다.");
+			// throw new IllegalArgumentException("시스템 오류입니다.");
+			error.set("message", "시스템 오류입니다.");
+			map.set("error", error);
 		} else{
 					
 			giftcard.setResultVal("00");  
@@ -143,9 +160,12 @@ public class TsfGiftcardService {
 			giftcard.setGfcdAmt(Integer.parseInt(param[1]));
 			
 			giftcardDao.createCustGiftcardHistory(giftcard);
-			
+
+			map.set("status", GagaResponseStatus.SUCCESS.getCode());
+			map.set("message", "상품권이 등록되었습니다.");
 		}
 
+		return map;
 	}
 	
 	 /**

+ 2 - 3
src/main/java/com/style24/front/biz/web/TsfMypageController.java

@@ -1621,9 +1621,8 @@ public class TsfMypageController extends TsfBaseController {
 	 */
 	@PostMapping("/gift/use/confirm")
 	@ResponseBody
-	public GagaResponse createGiftcardUseConfirm(@RequestBody GiftCard giftcard) throws Exception {
-		giftcardService.createGiftcardUseConfirm(giftcard);
-		return super.ok(message.getMessage("SUCC_0001"));
+	public GagaMap createGiftcardUseConfirm(@RequestBody GiftCard giftcard) throws Exception {
+		return giftcardService.createGiftcardUseConfirm(giftcard);
 	}
 
 	/**

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

@@ -913,7 +913,9 @@ public class TsfOrderController extends TsfBaseController {
 	public ModelAndView payResultResponse(Payment param, HttpServletRequest request, HttpServletResponse response) {
 		
 		// 2021.06.02 태팔요청
-		if(StringUtils.isBlank(param.getPgTid()) && StringUtils.isBlank(request.getParameter("tran_cd"))) {
+		// 2021.09.01 card007 카카오페이 pgToken 없으면 결제실패 페이지 리다이렉트 처리
+		if((StringUtils.isBlank(param.getPgTid()) && StringUtils.isBlank(request.getParameter("tran_cd")))
+			|| StringUtils.isBlank(param.getPgToken())) {
 			ModelAndView mav = new ModelAndView();
 			mav.setViewName("redirect:/order/payment/fail");
 			return mav;

+ 1 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsfCoupon.xml

@@ -202,6 +202,7 @@
 		            (CPN_TARGET = 'G260_12' AND RK <![CDATA[<=]]> 2) /*브랜드만 2개 노출*/
 		           )
 		    GROUP  BY CPN_ID, CPN_TARGET
+		    LIMIT 1
 		)
 		SELECT CP.CPN_ID
 		     , CP.END_ALIM_YN

+ 3 - 2
src/main/webapp/WEB-INF/views/mob/cart/CartListAjaxFormMob.html

@@ -916,14 +916,14 @@
 						var fbqContents = [];
 						var enlipleItems = [];
 						var totalCnt = 0;
-						
+
 						for (var i=0; i < list.length; i++) {
 							var item = list[i];
 							fbqContents.push({id: item.goodsCd, quantity: item.goodsQty + ''});
 							enlipleItems.push({productCode: item.goodsCd, productName: item.goodsNm, price: item.listPrice + '', dcPrice: item.currPrice + '', qty: item.goodsQty + ''});
 							totalCnt += item.goodsQty;
 						}
-						
+
 						fbq('track', 'InitiateCheckout', {
 							value: sumRealPayAmt,
 							currency: 'KRW',
@@ -941,6 +941,7 @@
 							$("#cartInfoForm").submit();
 						}
 					}
+					return false;
 				}
 
 				let info = list[listIndex];

+ 2 - 0
src/main/webapp/WEB-INF/views/web/cart/CartListAjaxFormWeb.html

@@ -1064,6 +1064,8 @@
 						$("#cartInfoForm").submit();
 					}
 				}
+				
+				return false;
 			}
 
 			let info = list[listIndex];

+ 10 - 23
src/main/webapp/WEB-INF/views/web/display/MallMainFormWeb.html

@@ -23,7 +23,6 @@
 
 	<div class="wrap ">
 		<th:block th:if="${mainLayoutList}" th:each="mainLayoutData, mainStat : ${mainLayoutList}" th:with="contentsLoc=${#strings.replace(mainLayoutData.contentsLoc,'SMM','')}">
-<!--			<th:block th:if="${mainLayoutData.ContentsList != null and !mainLayoutData.ContentsList.empty}">-->
 				<th:block th:if="${contentsLoc=='001'}">
 					<!-- 1. 비주얼 슬라이드 -->
 					<div class="content wide main_visual" th:if="${mainLayoutData.ContentsList != null and !mainLayoutData.ContentsList.empty}">
@@ -74,9 +73,8 @@
 						</div>
 					</div>
 				</th:block>
-
-				<!-- 2. 스타일리포트 -->
 				<th:block th:if="${contentsLoc=='002'}">
+					<!-- 2. 스타일리포트 -->
 					<div class="content main_stylereport" th:if="${mainLayoutData.ContentsList != null and !mainLayoutData.ContentsList.empty}">
 						<th:block th:if="${mainLayoutData.contentsTitle != null and !mainLayoutData.contentsTitle.empty}">
 						<div class="cont_head">
@@ -105,9 +103,8 @@
 						</div>
 					</div>
 				</th:block>
-
-				<!-- 3. 트렌디한 신상아이템 -->
 				<th:block th:if="${contentsLoc=='003'}">
+					<!-- 3. 트렌디한 신상아이템 -->
 					<div class="content main_trendy" th:if="${mainLayoutData.goodsList != null}">
 						<div class="cont_head">
 							<p class="displayH t_c" th:text="${mainLayoutData.contentsTitle}"></p>
@@ -149,9 +146,8 @@
 						</div>
 					</div>
 				</th:block>
-
-				<!-- 4. 잇 아이템 -->
 				<th:block th:if="${contentsLoc=='004'}">
+					<!-- 4. 잇 아이템 -->
 					<div class="content main_it" th:if="${mainLayoutData.BestItemList != null}">
 						<div class="cont_head">
 							<p class="displayH" id="id004">
@@ -217,9 +213,8 @@
 						</div>
 					</div>
 				</th:block>
-
-				<!-- 5. 프로모션배너 -->
 				<th:block th:if="${contentsLoc=='005'}">
+					<!-- 5. 프로모션배너 -->
 					<div class="content main_2stage" th:if="${mainLayoutData.ContentsList != null}">
 						<div class="cont_head dpnone">
 							<p class="t_c">프로모션배너</p>
@@ -251,9 +246,8 @@
 						</div>
 					</div>
 				</th:block>
-
-				<!-- 6. 타임딜 : 슬라이드 -->
 				<th:block th:if="${contentsLoc=='006'}">
+					<!-- 6. 타임딜 : 슬라이드 -->
 					<th:block th:each="socialData, socialStat : ${mainLayoutData.socialInfo}">
 					<div class="content wide main_deal" th:if="${socialData.socialGoodsList != null and !socialData.socialGoodsList.empty}">
 						<div class="cont_head">
@@ -322,9 +316,8 @@
 					</div>
 					</th:block>
 				</th:block>
-
-				<!-- 7. 브랜드픽 -->
 				<th:block th:if="${contentsLoc=='007'}">
+					<!-- 7. 브랜드픽 -->
 					<div class="content main_pick">
 						<div class="cont_head">
 							<p class="displayH t_c" th:text="${mainLayoutData.contentsTitle}">브랜드 PICK1</p>
@@ -401,10 +394,9 @@
 						</div>
 					</div>
 				</th:block>
-
-				<!-- 8. 가로 긴 배너 슬라이드 -->
-				<!-- bnn_1stage -->
 				<th:block th:if="${contentsLoc=='008'}">
+					<!-- 8. 가로 긴 배너 슬라이드 -->
+					<!-- bnn_1stage -->
 					<div class="content wide main_1stage">
 						<div class="cont_head dpnone">
 							<p class="t_c">배너 슬라이드</p>
@@ -440,9 +432,8 @@
 						</div>
 					</div>
 				</th:block>
-
-				<!-- 9. MD추천 스타일 -->
 				<th:block th:if="${contentsLoc=='009'}">
+					<!-- 9. MD추천 스타일 -->
 					<div class="content main_recomm" >
 						<div class="cont_head">
 							<p class="displayH t_c" th:text="${mainLayoutData.contentsTitle}"></p>
@@ -503,9 +494,8 @@
 						</div>
 					</div>
 				</th:block>
-
-				<!-- 11. TV 슬라이드 -->
 				<th:block th:if="${contentsLoc=='011'}">
+					<!-- 11. TV 슬라이드 -->
 					<div class="content wide main_tv" th:if="${mainLayoutData.ContentsList != null}">
 						<div class="cont_head">
 							<p class="displayH t_c" th:text="${mainLayoutData.contentsTitle}"></p>
@@ -532,9 +522,6 @@
 					</div>
 				</th:block>
 			</th:block>
-<!--		</th:block>-->
-
-
 	<!-- End Of Main Contents -->
 	</div>
 </div>