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

상품 재고 연동 수정중

eskim 5 лет назад
Родитель
Сommit
547e5e2065

+ 40 - 1
src/main/java/com/style24/front/biz/dao/TsfGoodsDao.java

@@ -3,7 +3,25 @@ package com.style24.front.biz.dao;
 import java.util.Collection;
 import java.util.Collection;
 
 
 import com.style24.core.support.annotation.ShopDs;
 import com.style24.core.support.annotation.ShopDs;
-import com.style24.persistence.domain.*;
+import com.style24.persistence.domain.CardPromotion;
+import com.style24.persistence.domain.Cate4Srch;
+import com.style24.persistence.domain.Delivery;
+import com.style24.persistence.domain.Freegift;
+import com.style24.persistence.domain.Goods;
+import com.style24.persistence.domain.GoodsCompose;
+import com.style24.persistence.domain.GoodsDesc;
+import com.style24.persistence.domain.GoodsImg;
+import com.style24.persistence.domain.GoodsNotiInfo;
+import com.style24.persistence.domain.GoodsSafeNo;
+import com.style24.persistence.domain.GoodsSearch;
+import com.style24.persistence.domain.GoodsStock;
+import com.style24.persistence.domain.GoodsVideo;
+import com.style24.persistence.domain.GoodsViewHst;
+import com.style24.persistence.domain.Measurement;
+import com.style24.persistence.domain.Notice;
+import com.style24.persistence.domain.ReinboundInform;
+import com.style24.persistence.domain.SizeInfo;
+import com.style24.persistence.domain.Tmtb;
 import com.style24.persistence.domain.searchengine.SearchEngine;
 import com.style24.persistence.domain.searchengine.SearchEngine;
 
 
 /**
 /**
@@ -437,4 +455,25 @@ public interface TsfGoodsDao {
 	 * @since 2020. 05. 25
 	 * @since 2020. 05. 25
 	 */
 	 */
 	Collection<Goods> getCompsGoodsList(Goods goods);
 	Collection<Goods> getCompsGoodsList(Goods goods);
+
+	/**
+	 * 상품 예약판매여부 확인
+	 *
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @date 2021. 05. 30
+	 */
+	int getGoodsResSellCount(String goodsCd);
+
+	/**
+	 * 상품 사이즈 선택 시 매장 쵀대 재고수량 가져오기
+	 *
+	 * @param stock
+	 * @return
+	 * @author eskim
+	 * @since 2021. 05. 30
+	 */
+	int getGoodsStoreStockQty(GoodsStock goodsStock);
+
 }
 }

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

@@ -425,13 +425,13 @@ public class TsfGoodsService {
 	public int getGoodsStockQty(GoodsStock goodsStock) {
 	public int getGoodsStockQty(GoodsStock goodsStock) {
 		int result = 0;
 		int result = 0;
 		// 예약상품 여부 확인
 		// 예약상품 여부 확인
-		//int goodsResSellCount = goodsDao.getGoodsResSellCount(stock.getGoodsCd());
+//		int goodsResSellCount = goodsDao.getGoodsResSellCount(goodsStock.getGoodsCd());
 
 
-		//if ("N".equals(stock.getSelfGoodsYn()) || goodsResSellCount > 0) {
+//		if ("N".equals(goodsStock.getSelfGoodsYn()) || goodsResSellCount > 0) {
 		result = goodsDao.getGoodsStockQty(goodsStock);
 		result = goodsDao.getGoodsStockQty(goodsStock);
-		//} else {
-		//	result = goodsDao.getGoodsStoreStockQty(stock);
-		//}
+//		} else {
+//			result = goodsDao.getGoodsStoreStockQty(goodsStock);
+//		}
 
 
 		return result;
 		return result;
 	}
 	}

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

@@ -465,7 +465,7 @@ public class TsfGoodsController extends TsfBaseController {
 		int stockQty = 0;
 		int stockQty = 0;
 
 
 		stockQty = goodsService.getGoodsSetStockQty(goodsStock);
 		stockQty = goodsService.getGoodsSetStockQty(goodsStock);
-		log.info("[getAjaxGoodsSetStockQty] stockQty = {}", stockQty);
+		//log.info("[getAjaxGoodsSetStockQty] stockQty = {}", stockQty);
 		return String.valueOf(stockQty);
 		return String.valueOf(stockQty);
 	}
 	}
 
 
@@ -1228,7 +1228,7 @@ public class TsfGoodsController extends TsfBaseController {
 	@PostMapping("/detail/option1/list")
 	@PostMapping("/detail/option1/list")
 	@ResponseBody
 	@ResponseBody
 	public GagaMap getGoodsOption1List(@RequestBody Goods goods) {
 	public GagaMap getGoodsOption1List(@RequestBody Goods goods) {
-		
+
 		GagaMap result = new GagaMap();
 		GagaMap result = new GagaMap();
 		if (StringUtils.isEmpty(goods.getMastrGoodsCd())) {
 		if (StringUtils.isEmpty(goods.getMastrGoodsCd())) {
 			goods.setMastrGoodsCd(goods.getGoodsCd());
 			goods.setMastrGoodsCd(goods.getGoodsCd());

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

@@ -687,6 +687,31 @@
 		) Z
 		) Z
 	</select>
 	</select>
 	
 	
+	<!-- 상품 사이즈  매장 쵀대 재고수량 가져오기 -->
+	<select id="getGoodsStoreStockQty"  parameterType="GoodsStock" resultType="int">
+		/* TsfGoods.getGoodsStoreStockQty */
+		SELECT CASE WHEN STORE_MAX_QTY - MIN_ORD_QTY >= 0 THEN STORE_MAX_QTY
+		            ELSE 0 END
+		FROM (
+		      SELECT (CASE WHEN WMS_STOCK_QTY >= STORE_STOCK_QTY THEN WMS_STOCK_QTY
+		                       ELSE STORE_STOCK_QTY END) AS STORE_MAX_QTY
+		             , MIN_ORD_QTY
+		      FROM (
+		          SELECT CASE WHEN A.SOLDOUT_YN = 'Y' THEN 0
+		                      ELSE A.CURR_STOCK_QTY
+		                      END AS WMS_STOCK_QTY
+		               , CASE WHEN A.SOLDOUT_YN = 'Y' THEN 0
+		                      ELSE A.STORE_MAX_QTY
+		                      END AS STORE_STOCK_QTY
+		               , B.MIN_ORD_QTY
+		          FROM  TB_OPTION A
+		          INNER JOIN TB_GOODS B ON A.GOODS_CD = B.GOODS_CD
+		          WHERE A.GOODS_CD = #{goodsCd}
+		          AND A.OPT_CD = #{optCd}
+		          ) Z
+		     ) Y
+	</select>	
+	
 	<!-- 상품  공지 목록  -->
 	<!-- 상품  공지 목록  -->
 	<select id="getGoodsNoticeList"  parameterType="Goods" resultType="Notice">
 	<select id="getGoodsNoticeList"  parameterType="Goods" resultType="Notice">
 		/* TsfGoods.getGoodsNoticeList */
 		/* TsfGoods.getGoodsNoticeList */
@@ -3105,4 +3130,15 @@
 		              , GC.COMPS_GOODS_CD
 		              , GC.COMPS_GOODS_CD
 		      ORDER  BY GC.COMPS_GOODS_CD) A		<!-- 변경x > 네이버페이 KEY로 송부되는 순서 -->
 		      ORDER  BY GC.COMPS_GOODS_CD) A		<!-- 변경x > 네이버페이 KEY로 송부되는 순서 -->
 	</select>
 	</select>
+	
+	<!-- 상품 예약판매여부 확인 -->
+	<select id="getGoodsResSellCount" parameterType="String" resultType="int">
+		/* TsfGoods.getGoodsResSellCount */
+		SELECT  COUNT(*)
+		FROM TB_GOODS_RES_SELL 
+		WHERE GOODS_CD = #{goodsCd} 
+		AND USE_YN = 'Y'
+		AND DELV_RES_DT > SYSDATE
+	</select>
+	
 </mapper>
 </mapper>