Prechádzať zdrojové kódy

Merge branch 'develop' into jmh

jmh 4 rokov pred
rodič
commit
ca66185fbc

+ 6 - 0
src/main/java/com/style24/front/biz/service/TsfCartService.java

@@ -117,6 +117,9 @@ public class TsfCartService {
 					goods.setSiteCd(TscConstants.Site.STYLE24.value());
 
 					goods = goodsService.getGoodsInfo(goods);
+					result.put("price", goods.getCurrPrice());
+					result.put("goodsNm", goods.getGoodsNm());
+					result.put("custNo", login.getCustNo());
 
 					// 신규 고객 주문 가능 상품 체크
 					if("Y".equals(goods.getNewCustOrdYn())) {
@@ -213,6 +216,9 @@ public class TsfCartService {
 				goods.setSiteCd(TscConstants.Site.STYLE24.value());
 
 				goods = goodsService.getGoodsInfo(goods);
+				result.put("price", goods.getCurrPrice());
+				result.put("goodsNm", goods.getGoodsNm());
+				result.put("custNo", login.getCustNo());
 
 				// 신규 고객 주문 가능 상품 체크
 				if("Y".equals(goods.getNewCustOrdYn())) {

+ 25 - 2
src/main/java/com/style24/front/biz/service/TsfCouponService.java

@@ -1,5 +1,6 @@
 package com.style24.front.biz.service;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
@@ -8,6 +9,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.thymeleaf.util.StringUtils;
 
+import com.gagaframework.web.util.GagaDateUtil;
 import com.style24.core.biz.dao.TscCouponDao;
 import com.style24.core.biz.service.TscOrderService;
 import com.style24.core.support.env.TscConstants;
@@ -23,8 +25,6 @@ import com.style24.persistence.domain.Order;
 
 import lombok.extern.slf4j.Slf4j;
 
-import com.gagaframework.web.util.GagaDateUtil;
-
 /**
  * 쿠폰 Service
  *
@@ -330,6 +330,29 @@ public class TsfCouponService {
 		return couponDao.getGoodsCouponList(goods);
 	}
 
+	/**
+	 * 딜상품 쿠폰 조회
+	 * @param Goods
+	 * @return Collection<Coupon>
+	 * @author card007
+	 * @since 2021. 08. 24
+	 */
+	public Collection<Coupon> getGoodsDealCouponList(Goods goods) {
+		Collection<Coupon> couponList = new ArrayList<>();
+		List<Integer> cpnIdList = new ArrayList<>();
+
+		for (Coupon coupon : couponDao.getGoodsCouponList(goods)) {
+			Integer cpnId = coupon.getCpnId();
+
+			if(!cpnIdList.contains(cpnId)) {
+				cpnIdList.add(cpnId);
+				couponList.add(coupon);
+			}
+		}
+
+		return couponList;
+	}
+
 	/**
 	 * 상품 즉시할인 쿠폰 조회
 	 * @param goods

+ 2 - 0
src/main/java/com/style24/front/biz/web/TsfDisplayController.java

@@ -905,6 +905,8 @@ public class TsfDisplayController extends TsfBaseController {
 		}
 
 		Collection<SearchEngine> dataList = new ArrayList<SearchEngine>();
+		
+		log.info("params.getSortingType() ::: {}", params.getSortingType());
 
 		GoodsListResponse response = diquest.getGoodsList(params);
 		pageable.setTotalCount(response.getTotalCount());

+ 15 - 6
src/main/java/com/style24/front/biz/web/TsfGoodsController.java

@@ -18,6 +18,10 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
+import com.gagaframework.web.parameter.GagaMap;
+import com.gagaframework.web.rest.server.GagaResponse;
+import com.gagaframework.web.rest.server.GagaResponseStatus;
+import com.gagaframework.web.util.GagaCookieUtil;
 import com.style24.core.biz.service.TscEnvsetService;
 import com.style24.core.biz.service.TscLookbookService;
 import com.style24.core.support.env.TscConstants;
@@ -57,11 +61,6 @@ import com.style24.persistence.domain.searchengine.FeedbackResponse;
 
 import lombok.extern.slf4j.Slf4j;
 
-import com.gagaframework.web.parameter.GagaMap;
-import com.gagaframework.web.rest.server.GagaResponse;
-import com.gagaframework.web.rest.server.GagaResponseStatus;
-import com.gagaframework.web.util.GagaCookieUtil;
-
 /**
  * 상품 Controller
  *
@@ -618,6 +617,7 @@ public class TsfGoodsController extends TsfBaseController {
 	@PostMapping("/coupon/layer")
 	public ModelAndView goodsCouponForm(Goods goods) {
 		ModelAndView mav = new ModelAndView();
+		Collection<Coupon> goodsCouponList;
 		// 상품관련 기본값 설정(회원 등급, 앱, PC/모바일 등)
 		setGoods(goods);
 
@@ -634,13 +634,22 @@ public class TsfGoodsController extends TsfBaseController {
 				String[] arrGoodsCd = arrGoodsList.stream().toArray(String[]::new);
 				goods.setArrGoodsCd(arrGoodsCd);
 			}
+
+			// 딜상품쿠폰정보(중복제거)
+			goodsCouponList = couponService.getGoodsDealCouponList(goods);
+		} else {
+			// 상품쿠폰정보
+			goodsCouponList = couponService.getGoodsCouponList(goods);
 		}
+
 		// 상품쿠폰정보
-		mav.addObject("goodsCouponList", couponService.getGoodsCouponList(goods));
+		mav.addObject("goodsCouponList", goodsCouponList);
+
 		// 상품 기본정보
 		mav.addObject("params", goods);
 
 		mav.setViewName(super.getDeviceViewName("goods/GoodsCouponForm"));
+
 		return mav;
 	}
 

+ 36 - 32
src/main/java/com/style24/persistence/mybatis/shop/TsfCoupon.xml

@@ -464,22 +464,24 @@
 		                                                                  )
 		                                                  ) >0
 		                        ) 
-		                        OR /* 적용대상:브랜드*/
-		                        (CP.APPLY_SCOPE = 'I' AND (SELECT COUNT(1) FROM TB_COUPON_REFVAL
-		                                                   WHERE CPN_ID = CP.CPN_ID
-		                                                   AND CPN_TARGET = 'G260_12' 
-		                                                   AND DEL_YN = 'N'
-		                                                   AND REF_VAL = G.BRAND_CD
-		                                                   AND IFNULL(REF_FORMAL_GB,G.FORMAL_GB) = G.FORMAL_GB
-		                                                  ) >0
-		                        ) 
-		                        OR /* 적용대상:공급업체*/
-		                        (CP.APPLY_SCOPE = 'I' AND (SELECT COUNT(1) FROM TB_COUPON_REFVAL
-		                                                   WHERE CPN_ID = CP.CPN_ID
-		                                                   AND CPN_TARGET = 'G260_13' 
-		                                                   AND DEL_YN = 'N'
-		                                                   AND REF_VAL = G.SUPPLY_COMP_CD
-		                                                  ) >0
+		                        /* 2021.08.23 적용대상 : 브랜드, 공급업체 */
+		                        OR 
+		                        (CP.APPLY_SCOPE = 'I' AND (SELECT COUNT(1) 
+		                                                   FROM   TB_COUPON_REFVAL CR1
+		                                                   INNER  JOIN TB_COUPON_REFVAL CR2
+		                                                   ON     1=1
+		                                                   AND    CR2.CPN_ID = CP.CPN_ID
+		                                                   AND    CR2.CPN_TARGET = 'G260_12' 
+		                                                   AND    CR2.DEL_YN = 'N'
+		                                                   AND    CR2.REF_VAL = G.SUPPLY_COMP_CD
+		                                                   AND    IFNULL(CR1.REF_FORMAL_GB, G.FORMAL_GB) = G.FORMAL_GB
+		                                                   WHERE  1=1
+		                                                   AND    CR1.CPN_ID = CP.CPN_ID
+		                                                   AND    CR1.CPN_TARGET = 'G260_12' 
+		                                                   AND    CR1.DEL_YN = 'N'
+		                                                   AND    CR1.REF_VAL = G.BRAND_CD
+		                                                   AND    IFNULL(CR1.REF_FORMAL_GB, G.FORMAL_GB) = G.FORMAL_GB
+		                                                  ) > 0
 		                        )
 		                      )
 		                AND NOT EXISTS (
@@ -902,22 +904,24 @@
 		                                                                  )
 		                                                  ) >0
 		                        ) 
-		                        OR /* 적용대상:브랜드*/
-		                        (CP.APPLY_SCOPE = 'I' AND (SELECT COUNT(1) FROM TB_COUPON_REFVAL
-		                                                   WHERE CPN_ID = CP.CPN_ID
-		                                                   AND CPN_TARGET = 'G260_12' 
-		                                                   AND DEL_YN = 'N'
-		                                                   AND REF_VAL = G.BRAND_CD
-		                                                   AND IFNULL(REF_FORMAL_GB,G.FORMAL_GB) = G.FORMAL_GB
-		                                                  ) >0
-		                        ) 
-		                        OR /* 적용대상:공급업체*/
-		                        (CP.APPLY_SCOPE = 'I' AND (SELECT COUNT(1) FROM TB_COUPON_REFVAL
-		                                                   WHERE CPN_ID = CP.CPN_ID
-		                                                   AND CPN_TARGET = 'G260_13' 
-		                                                   AND DEL_YN = 'N'
-		                                                   AND REF_VAL = G.SUPPLY_COMP_CD
-		                                                  ) >0
+		                        /* 2021.08.23 적용대상 : 브랜드, 공급업체 and 조건변경 */
+		                        OR 
+		                        (CP.APPLY_SCOPE = 'I' AND (SELECT COUNT(1) 
+		                                                   FROM   TB_COUPON_REFVAL CR1
+		                                                   INNER  JOIN TB_COUPON_REFVAL CR2
+		                                                   ON     1=1
+		                                                   AND    CR2.CPN_ID = CP.CPN_ID
+		                                                   AND    CR2.CPN_TARGET = 'G260_12' 
+		                                                   AND    CR2.DEL_YN = 'N'
+		                                                   AND    CR2.REF_VAL = G.SUPPLY_COMP_CD
+		                                                   AND    IFNULL(CR1.REF_FORMAL_GB, G.FORMAL_GB) = G.FORMAL_GB
+		                                                   WHERE  1=1
+		                                                   AND    CR1.CPN_ID = CP.CPN_ID
+		                                                   AND    CR1.CPN_TARGET = 'G260_12' 
+		                                                   AND    CR1.DEL_YN = 'N'
+		                                                   AND    CR1.REF_VAL = G.BRAND_CD
+		                                                   AND    IFNULL(CR1.REF_FORMAL_GB, G.FORMAL_GB) = G.FORMAL_GB
+		                                                  ) > 0
 		                        )
 		                      )
 		                AND NOT EXISTS (

+ 12 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsfDisplay.xml

@@ -1243,6 +1243,12 @@
 		    WHERE	1=1
 		    AND		B.USE_YN = 'Y'
 		    AND		BG.USE_YN = 'Y'
+		    AND     EXISTS (
+		                SELECT 1
+		                FROM   TB_GOODS G
+		                WHERE  G.BRAND_CD = B.BRAND_CD
+		                AND    G.GOODS_STAT = 'G008_90'
+		            )
 		<if test='selfYn != null and selfYn == "Y"'>
 		    <!-- AND		B.SELF_YN = 'Y'  21.07.28 기획 한리더 요청으로 입점 브랜드도 노출하도록 수정 -->
 		    AND		(BG.LOGO_FILE_NM <![CDATA[<>]]> '' AND BG.LOGO_FILE_NM IS NOT NULL)
@@ -1290,6 +1296,12 @@
 		      <if test="brandGroupNm != null and brandGroupNm != ''">
 		      AND	(BG.BRAND_GROUP_ENM LIKE CONCAT('%',#{brandGroupNm},'%') OR BG.BRAND_GROUP_KNM LIKE CONCAT('%',#{brandGroupNm},'%'))
 		      </if>
+		      AND   EXISTS (
+		                SELECT 1
+		                FROM   TB_GOODS G
+		                WHERE  G.BRAND_CD = B.BRAND_CD
+		                AND    G.GOODS_STAT = 'G008_90'
+		            )
 		      GROUP BY BG.BRAND_GROUP_NO, B.BRAND_ENM, B.BRAND_KNM
 		) Z
 		WHERE	1=1

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

@@ -835,7 +835,7 @@
 		     , B.RTN_LOC_ZIPCODE
 		     , B.RTN_LOC_BASE_ADDR
 		     , B.RTN_LOC_DTL_ADDR
-		     , B.RTN_LOC_TELNO
+		     , IFNULL(B.RTN_LOC_TELNO, '1544-5336') AS RTN_LOC_TELNO
 		     , B.RTN_LOC_NM
 		     , S.NOTE
 		     , SC.SHIP_COMP_CD

+ 2 - 1
src/main/webapp/WEB-INF/views/mob/goods/GoodsDealDetailFormMob.html

@@ -287,6 +287,7 @@
 												},
 												success : function(result) {
 													if (result.state == "sucess") {
+														enp('create', 'conversion', 'is24', { device: 'M', paySys: 'naverPay' });	// 모비온 네이버주문형 클릭시
 														document.nPayForm.action = result.npayOrderUrl + "/" + result.orderKey + "/" + result.resultNo;
 														document.nPayForm.submit();
 													} else {
@@ -965,7 +966,7 @@
 		let alertMsg = '';
 		
 		if (ea < minOrdQty) {
-			alertMsg = minOrdQty+"개 부터 구매 가능합니다.";;
+			alertMsg = minOrdQty+"개 부터 구매 가능합니다.";
 			ea = minOrdQty;
 		}
 

+ 1 - 0
src/main/webapp/WEB-INF/views/mob/goods/GoodsDetailFormMob.html

@@ -1237,6 +1237,7 @@
 											},
 											success : function(result) {
 												if (result.state == "sucess") {
+													enp('create', 'conversion', 'is24', { device: 'M', paySys: 'naverPay' });	// 모비온 네이버주문형 클릭시
 													document.nPayForm.action = result.npayOrderUrl + "/" + result.orderKey + "/" + result.resultNo;
 													document.nPayForm.submit();
 												} else {

+ 1 - 0
src/main/webapp/WEB-INF/views/web/goods/GoodsDealDetailFormWeb.html

@@ -1517,6 +1517,7 @@
 			},
 			success : function(result) {
 				if (result.state == "sucess") {
+					enp('create', 'conversion', 'is24', { device: 'W', paySys: 'naverPay' });	// 모비온 네이버주문형 클릭시
 					window.open('about:blank', 'popupView');
 					document.nPayForm.target = 'popupView';
 					document.nPayForm.action = result.npayOrderUrl + "/" + result.orderKey + "/" + result.resultNo;

+ 1 - 0
src/main/webapp/WEB-INF/views/web/goods/GoodsDetailFormWeb.html

@@ -529,6 +529,7 @@
 													},
 													success : function(result) {
 														if (result.state == "sucess") {
+															enp('create', 'conversion', 'is24', { device: 'W', paySys: 'naverPay' });	// 모비온 네이버주문형 클릭시
 															window.open('about:blank', 'popupView');
 															document.nPayForm.target = 'popupView';
 															document.nPayForm.action = result.npayOrderUrl + "/" + result.orderKey + "/" + result.resultNo;

+ 25 - 0
src/main/webapp/ux/style24_link.js

@@ -338,6 +338,31 @@ function cfnAddCart(cartList) {
 							getCartList(data);
 						}
 					}
+
+					// 크리테오 광고스크립트?
+					if(result.custNo != null && result.custNo > 0) {
+						window.criteo_q = window.criteo_q || [];
+						let deviceType = /iPad/.test(navigator.userAgent) ? "t" : /Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Silk/.test(navigator.userAgent) ? "m" : "d";
+						// 장바구니에 추가 된 각 상품에 대한 새 객체 추가
+						window.criteo_q.push(
+							{ event: "setAccount", account: 6762}, // 이 라인은 업데이트하면 안됩니다
+							{ event: "setEmail", email: criteoEmail }, // 유저가 로그인이 안되 있는 경우 빈 문자열을 전달
+							{ event: "setSiteType", type: deviceType},
+							{ event: "viewBasket", item: [{id: cartList[0].goodsCd, price:result.price, quantity: cartList[0].goodsQty }]}
+						);
+					}
+
+					// 페이스북 픽셀 (장바구니 담기)
+					fbq('track', 'AddToCart',{
+							value: result.price,
+							currency: 'KRW',
+							contents: [{
+									id: cartList[0].goodsCd,
+									name: result.goodsNm,
+									quantity: cartList[0].goodsQty
+								}],
+						}
+					);
 				} else if (result.cartGb == "O"){
 					// 신규 고객 판매 상품 체크
 					if(result.newCustCanYn == "N") {