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

Merge branch 'develop' into bin2107

bin2107 4 лет назад
Родитель
Сommit
fe63dda193

+ 19 - 1
src/main/java/com/style24/front/biz/dao/TsfRecentlyGoodsDao.java

@@ -44,7 +44,7 @@ public interface TsfRecentlyGoodsDao {
 	 * @author gagamel
 	 * @since 2021. 5. 13
 	 */
-	public void updateRecentlyGoodsAfterLogin(RecentlyGoods recentlyGoods);
+	void updateRecentlyGoodsAfterLogin(RecentlyGoods recentlyGoods);
 
 	/**
 	 * 최근본상품 목록
@@ -54,5 +54,23 @@ public interface TsfRecentlyGoodsDao {
 	 * @date 2021. 5. 13
 	 */
 	Collection<RecentlyGoods> getRecentlyGoodsList(RecentlyGoods recentlyGoods);
+	
+	/**
+	 * 최근 본 상품 목록 등록 여부 
+	 * @param recentlyGoods - 최근본상품 정보
+	 * @return
+	 * @author sowon
+	 * @date 2021. 6. 23
+	 */
+	int getRecentlyGoodsOwnCount(RecentlyGoods recentlyGoods);
+
+	/**
+	 * 기존 최근 본 상품 update
+	 * @param recentlyGoods - 최근본상품 정보
+	 * @author sowon
+	 * @date 2021. 6. 23
+	 */
+	void updateRecentlyGoods(RecentlyGoods recentlyGoods);
+
 
 }

+ 10 - 5
src/main/java/com/style24/front/biz/service/TsfRecentlyGoodsService.java

@@ -43,15 +43,20 @@ public class TsfRecentlyGoodsService {
 
 		// 최근본상품 건수
 		int totCnt = recentlyGoodsDao.getRecentlyGoodsTotalCount(recentlyGoods);
-		log.info("최근본상품 건수: {}", totCnt);
 
-		if (totCnt >= 50) {
+		if (totCnt > 50) {
 			// 맨 처음 등록된 상품 삭제
 			recentlyGoodsDao.deleteRecentlyFirstGoods(recentlyGoods);
 		}
-
-		// 최근본상품 생성
-		recentlyGoodsDao.createRecentlyGoods(recentlyGoods);
+		
+		// 등록 여부 
+		int ownCnt = recentlyGoodsDao.getRecentlyGoodsOwnCount(recentlyGoods);
+		if (ownCnt > 0) {
+			recentlyGoodsDao.updateRecentlyGoods(recentlyGoods);
+		}else {
+			// 최근본상품 생성
+			recentlyGoodsDao.createRecentlyGoods(recentlyGoods);
+		}
 	}
 
 	/**

+ 24 - 3
src/main/java/com/style24/persistence/mybatis/shop/TsfRecentlyGoods.xml

@@ -29,8 +29,7 @@
 		                                   OR
 		                                   CUST_NO = #{custNo}
 		                                  )
-		                           ORDER  BY RGOODS_SQ
-		                           LIMIT 1
+		                           ORDER  BY REG_DT LIMIT 1
 		                           ) Z
 		                     )
 	</delete>
@@ -81,7 +80,7 @@
 		     , GI.SYS_IMG_NM
 		FROM   (
 		        SELECT GOODS_CD
-		             , RANK() OVER(ORDER BY REG_DT DESC, GOODS_CD) AS DISP_ORD
+		             , RANK() OVER(ORDER BY UPD_DT DESC) AS DISP_ORD
 		        FROM   TB_RECENTLY_GOODS
 		        WHERE  1 = 1
 		        <choose>
@@ -105,4 +104,26 @@
 		ORDER  BY A.DISP_ORD
 	</select>
 	
+	<!-- 최근 본 상품 목록 등록 여부 -->
+	<select id="getRecentlyGoodsOwnCount" parameterType="RecentlyGoods" resultType="int">
+		/* TsfRecentlyGoods.getRecentlyGoodsOwnCount */
+		SELECT COUNT(*)
+		    FROM   TB_RECENTLY_GOODS
+		    WHERE  1 = 1
+		    AND    (
+		            (GOODS_CD =  #{goodsCd} AND JSESSION_ID =   #{jsessionId})
+		            OR
+		            (GOODS_CD =  #{goodsCd} AND CUST_NO =  #{custNo})
+		           )
+	</select>
+	
+	<update id="updateRecentlyGoods"  parameterType="RecentlyGoods">
+		/* TsfRecentlyGoods.updateRecentlyGoods */
+		UPDATE TB_RECENTLY_GOODS
+		SET    UPD_DT = NOW()
+		WHERE  1=1
+		AND    GOODS_CD    = #{goodsCd}
+		AND    CUST_NO     = #{custNo}
+	</update>
+	
 </mapper>

+ 11 - 2
src/main/webapp/WEB-INF/views/mob/app/SettingFormMob.html

@@ -174,10 +174,11 @@
 			}
 			if (isLogin) {
 				if (appAgreeYn === 'N') { // 마케팅도 N 처리
-					fnAppMkAgreeUpdate('N');
+					fnUpdatePush('N', 'N');
 					$('#btnMkSetting').prop('checked', false);
+				} else {
+					fnAppPushAgreeUpdate('Y');
 				}
-				fnAppPushAgreeUpdate(appAgreeYn);
 			}
 		}
 	});
@@ -232,6 +233,14 @@
 		gagajf.ajaxJsonSubmit('/app/mkagree/update', jsonData);
 	}
 
+	var fnUpdatePush = function (appAgreeYn, mkAgreeYn) {
+		let params = {}
+		params.appAgreeYn = appAgreeYn;
+		params.mkAgreeYn = mkAgreeYn;
+		let jsonData = JSON.stringify(params);
+		gagajf.ajaxJsonSubmit('/app/push/update', jsonData);
+	}
+
 	// 안드로이드 앱
 	$('#chk-2').on('click', function () {
 		document.location.href='update://?link=https://play.google.com/store/apps/details?id=';

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

@@ -2390,11 +2390,36 @@
 		params.ithrCd = "IN15_05";
 		fnGoodsLikeSearch(params);
 	
+		// selecter
+		$(function(){
+			var opt_select = new sCombo('.pd .op1 .opt_select .select_custom');
+		});
+		
 		var opt_selecter01_1 = new sCombo('.pop_option_select .select_custom.item_opt1.item_opt1_1');
+		$('.pd .pop_option_select .select_custom.item_opt1.item_opt1_1 .combo .list > li').click(function(e) {
+			$(this).parents('.form_field').next('.form_field').find('.select_custom').attr('disabled', false);
+			return false;
+		});
 		var opt_selecter01_2 = new sCombo('.pop_option_select .select_custom.item_opt1.item_opt1_2');
+		$('.pd .pop_option_select .select_custom.item_opt1.item_opt1_2 .combo .list > li').click(function(e) {
+			$(this).parents('.form_field').next('.form_field').find('.select_custom').attr('disabled', false);
+			return false;
+		});
 		var opt_selecter01_3 = new sCombo('.pop_option_select .select_custom.item_opt1.item_opt1_3');
+		$('.pd .pop_option_select .select_custom.item_opt1.item_opt1_3 .combo .list > li').click(function(e) {
+			$(this).parents('.form_field').next('.form_field').find('.select_custom').attr('disabled', false);
+			return false;
+		});
 		var opt_selecter01_4 = new sCombo('.pop_option_select .select_custom.item_opt1.item_opt1_4');
+		$('.pd .pop_option_select .select_custom.item_opt1.item_opt1_4 .combo .list > li').click(function(e) {
+			$(this).parents('.form_field').next('.form_field').find('.select_custom').attr('disabled', false);
+			return false;
+		});
 		var opt_selecter01_5 = new sCombo('.pop_option_select .select_custom.item_opt1.item_opt1_5');
+		$('.pd .pop_option_select .select_custom.item_opt1.item_opt1_5 .combo .list > li').click(function(e) {
+			$(this).parents('.form_field').next('.form_field').find('.select_custom').attr('disabled', false);
+			return false;
+		});
 
 		if (!gagajf.isNull([[${goodsInfo.socialSq}]])){
 			$('.timer_box').css('display', 'block');

+ 8 - 4
src/main/webapp/WEB-INF/views/web/common/fragments/FooterWeb.html

@@ -977,9 +977,9 @@
 						$('#quickMenuTodayGoods').html('');
 						
 						$('#quick01').find('span').html(result.length);
-						
+						let tag = '';
 						if (result.length > 0) {
-							let tag = '<div class="product_count"><span class="c_primary">' + result.length + '</span>개의 상품</div>\n';
+							tag += '<div class="product_count"><span class="c_primary">' + result.length + '</span>개의 상품</div>\n';
 							tag += '	<div class="itemsGrp">\n';
 							
 							$.each(result, function (idx, item) {
@@ -996,10 +996,14 @@
 							
 							tag += '	</div>\n';
 							
-							$('#quickMenuTodayGoods').html(tag);
 						} else {
-							$('#quickMenuTodayGoods').addClass('nodata');
+							tag += '<div class="no_item">';
+							tag += '	최근 본 상품이 없습니다.';
+							tag += '</div>';
+							
+							$('#quickMenuTodayGoods').attr('class','quick_body nodata');
 						}
+						$('#quickMenuTodayGoods').html(tag);
 					}
 			});
 // 	});