Selaa lähdekoodia

Merge remote-tracking branch 'TSIT/mallmain' into style

card007 4 vuotta sitten
vanhempi
commit
272382e09c

+ 8 - 0
src/main/java/com/style24/admin/biz/dao/TsaDisplayDao.java

@@ -357,6 +357,14 @@ public interface TsaDisplayDao {
 
 	void saveContentsGoodsTemp(Contents contents);
 
+	/**
+	 * 브랜드 픽 상품 저장시 브랜드 그룹에 맞는 상품만 저장
+	 * @return
+	 * @author yujung
+	 * @since 2021. 11. 01
+	 */
+	void saveBrandpicContentsGoodsTemp(Contents contents);
+
 	/**
 	 * 메인전시 컨텐츠 임시 상품 -> 카테고리상품 저장
 	 * @return

+ 6 - 1
src/main/java/com/style24/admin/biz/service/TsaDisplayService.java

@@ -709,7 +709,12 @@ public class TsaDisplayService {
 //						contents1.setGoodsNm(contents1.getGoodsNmArr()[i]);
 //						contents1.setImgPath1(contents1.getGoodsImgArr()[i]);
 						contents1.setDispOrd(Integer.parseInt(contents1.getGoodsDispOrdArr()[i]));
-						displayDao.saveContentsGoodsTemp(contents1);
+						if ("SMM007".equals(contents1.getContentsLoc())) { // 브랜드픽 일 경우
+							displayDao.saveBrandpicContentsGoodsTemp(contents1);
+						} else {
+							displayDao.saveContentsGoodsTemp(contents1);
+						}
+
 					}
 				}
 			}

+ 71 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaDsiplay.xml

@@ -1772,7 +1772,9 @@
 		</if>
 		AND CONTENTS_LOC = #{contentsLoc}
 		<if test="brandGroupNo != null and brandGroupNo != ''">
+		    <if test="contentsLoc != 'SMM007'">
 		AND BRAND_GROUP_NO = #{brandGroupNo}
+		    </if>
 		</if>
 		AND CONTENTS_SQ = #{contentsSq}
 	</delete>
@@ -1835,6 +1837,75 @@
 		)
 	</insert>
 
+	<insert id="saveBrandpicContentsGoodsTemp" parameterType="Contents">
+		/* TsaDisplay.saveContentsGoodsTemp */
+		INSERT INTO TB_CONTENTS_GOODS
+		(
+		       BRAND_GROUP_NO
+		     , CATE_NO
+		     , LEAF_CATE_NO
+		     , CONTENTS_LOC
+		     , PRE_CONTENTS_SQ
+		     , CONTENTS_SQ
+		     , GOODS_CD
+		     , GOODS_NM
+		     , IMG_PATH1
+		     , DISP_ORD
+		     , REG_NO
+		     , REG_DT
+		)
+		SELECT IFNULL(NULLIF(B.BRAND_GROUP_NO,''),0)
+		     , #{cateNo}
+		     , IFNULL(
+		              (
+		               SELECT LEAF_CATE_NO
+		               FROM   (
+		                        SELECT LEAF_CATE_NO
+		                        FROM   TB_CATE_4SRCH
+		                        WHERE  1=1
+		                        <if test="cateNo != null and cateNo != ''">
+		                        AND    CATE1_NO = #{cateNo}
+								</if>
+		                        AND    CONTENTS_LOC = #{contentsLoc}) TMP),0)
+		     , #{contentsLoc}
+		     , #{preContentsSq}
+		     , #{contentsSq}
+		     , G.GOODS_CD
+		     , IFNULL(#{goodsNm},'')
+		     , IFNULL(#{imgPath1},'')
+		<choose>
+			<when test="dispOrd != null and dispOrd != ''">
+		     , #{dispOrd}
+			</when>
+			<otherwise>
+		     , (
+		        SELECT DISP_ORD
+		        FROM   (
+		                SELECT IFNULL((MAX(DISP_ORD) + 1), 1) AS DISP_ORD
+		                FROM   TB_CONTENTS_GOODS
+		                WHERE  1=1
+		                <if test="cateNo != null and cateNo != ''">
+		                AND    CATE_NO = #{cateNo}
+		                </if>
+		                AND    CONTENTS_LOC = #{contentsLoc}
+		                AND    CONTENTS_SQ = #{contentsSq}
+		                <if test="brandGroupNo != null and brandGroupNo != ''">
+		                AND    BRAND_GROUP_NO = #{brandGroupNo}
+		                </if>
+				       ) TMP
+		       )
+			</otherwise>
+		</choose>
+		     , #{regNo}
+		     , NOW()
+		FROM   TB_GOODS G
+		INNER  JOIN TB_BRAND B
+		ON     B.BRAND_CD = G.BRAND_CD
+		WHERE  1=1
+		AND    B.BRAND_GROUP_NO = #{brandGroupNo}
+		AND    G.GOODS_CD = #{goodsCd}
+	</insert>
+
 	<!-- 메인전시 컨텐츠 상품 삭제 -->
 	<delete id="deleteContentsGoods" parameterType="Contents">
 		/* TsaDisplay.deleteContentsGoods */

+ 2 - 1
src/main/webapp/WEB-INF/views/display/MainMultiContentsPopupForm.html

@@ -3,7 +3,7 @@
 	xmlns:th="http://www.thymeleaf.org">
 <!--
  *******************************************************************************
- * @source  : MainMultiContentsPopupForm.html
+ * @source  : .html
  * @desc    : 메인전시 컨텐츠 멀티 팝업 Page
  *============================================================================
  * STYLE24
@@ -26,6 +26,7 @@
 						<span class="cBlue">* 상단으로 드래그&amp;드랍하여 순서 변경 가능합니다.</span>
 						<br th:if="${contentsLoc=='SMM003' or contentsLoc=='SMM007' or contentsLoc=='SMM009' or contentsLoc=='SBM007' or contentsLoc=='SBM008' or contentsLoc=='SBM009' or contentsLoc=='SBM017' or contentsLoc=='SBM018' or contentsLoc=='SBM019' or contentsLoc=='SCM002' or contentsLoc=='SCM003' or contentsLoc=='SOM002' or contentsLoc=='SOM003'}">
 						<span class="cRed" th:if="${contentsLoc=='SMM003' or contentsLoc=='SBM007' or contentsLoc=='SCM002'}">* 신상품 최대 20개(수동설정 20개 미만일시, 수동 설정 + 최신 등록 상품)</span>
+						<span class="cBlue" th:if="${contentsLoc=='SMM007'}">* 브랜드 코드에 맞지 않는 상품은 임시저장 시 제외.</span><br th:if="${contentsLoc=='SMM007'}">
 						<span class="cRed" th:if="${contentsLoc=='SMM007'}">* 배너 최대 5개(수동설정 + 브랜드 룩북1개 + 진행중인 기획전)</span><br th:if="${contentsLoc=='SMM007'}">
 						<span class="cRed" th:if="${contentsLoc=='SMM007'}">* 상품 최대 3개(수동설정 3개 미만일시, 수동설정 + 브랜드 최신 등록 상품)</span>
 						<span class="cRed" th:if="${contentsLoc=='SMM009'}">* 키워드 최대 5개(수동설정 5개 미만일시, 추천솔루션 데이터 노출(키워드별 상품 7개))</span>