Ver código fonte

Merge branch 'develop' into order

card007 5 anos atrás
pai
commit
5229d0bb1e

+ 57 - 0
src/main/java/com/style24/front/biz/dao/TsfCommonDao.java

@@ -0,0 +1,57 @@
+package com.style24.front.biz.dao;
+
+import org.springframework.stereotype.Repository;
+
+import com.style24.core.support.annotation.ShopDs;
+import com.style24.persistence.domain.InflowHst;
+
+/**
+ * 공통 Dao
+ *
+ * @author eskim
+ * @since 2021. 02. 09
+ */
+@ShopDs
+@Repository
+public interface TsfCommonDao {
+
+//	/**
+//	 * 사이트명 조회
+//	 *
+//	 * @param siteCd - 사이트코드
+//	 * @return
+//	 * @author gagamel
+//	 * @since 2020. 5. 26
+//	 */
+//	String getSiteName(String siteCd);
+
+	/**
+	 * 제휴링크 이력 생성
+	 *
+	 * @param inflow - 유입경로 정보
+	 * @author eskim
+	 * @date 2021. 02. 09
+	 */
+	void createInflowHst(InflowHst inflow);
+
+//	/**
+//	 * 기본답변문구내용 조회
+//	 *
+//	 * @param ansSq - 답변일련번호
+//	 * @return
+//	 * @author gagamel
+//	 * @since 2020. 3. 30
+//	 */
+//	TsfBasicAnswer getBasicAnswer(TsfBasicAnswer basicAnswer);
+//
+//	/**
+//	 * 앱 기기 등록
+//	 *
+//	 * @param
+//	 * @return
+//	 * @author sasa004
+//	 * @since 2020. 08. 10
+//	 */
+//	void saveMobileDevice(TsfMobileDevice mobileDevice);
+
+}

+ 38 - 25
src/main/java/com/style24/front/biz/dao/TsfGoodsDao.java

@@ -3,39 +3,52 @@ package com.style24.front.biz.dao;
 import com.style24.core.support.annotation.ShopDs;
 import com.style24.persistence.domain.Goods;
 import com.style24.persistence.domain.GoodsStock;
+import com.style24.persistence.domain.GoodsViewHst;
 
 /**
  * 상품 Dao
- * 
+ *
  * @author gagamel
  * @since 2020. 12. 29
  */
 @ShopDs
 public interface TsfGoodsDao {
-    /**
-     * 상품 정보 조회
-     * @param goods
-     * @return
-     * @author xodud1202
-     * @since 2021. 01. 28
-     */
-    Goods getGoodsInfo(Goods goods);
 
-    /**
-     * 사은품 구성 상품 정보 조회
-     * @param goods
-     * @return
-     * @author xodud1202
-     * @since 2021. 01. 28
-     */
-    Goods getGoodsCompsInfo(Goods goods);
+	/**
+	 * 상품 상세보기 이력 생성
+	 *
+	 * @param goodsViewHst
+	 * @return
+	 * @author eskim
+	 * @date 2021. 2. 9
+	 */
+	void createGoodsViewHst(GoodsViewHst goodsViewHst);
+
+	/**
+	 * 상품 정보 조회
+	 * @param goods
+	 * @return
+	 * @author xodud1202
+	 * @since 2021. 01. 28
+	 */
+	Goods getGoodsInfo(Goods goods);
+
+	/**
+	 * 사은품 구성 상품 정보 조회
+	 * @param goods
+	 * @return
+	 * @author xodud1202
+	 * @since 2021. 01. 28
+	 */
+	Goods getGoodsCompsInfo(Goods goods);
+
+	/**
+	 * 상품 재고 조회
+	 * @param goodsStock
+	 * @return
+	 * @author xodud1202
+	 * @since 2021. 01. 28
+	 */
+	GoodsStock getGoodsStockInfo(GoodsStock goodsStock);
 
-    /**
-     * 상품 재고 조회
-     * @param goodsStock
-     * @return
-     * @author xodud1202
-     * @since 2021. 01. 28
-     */
-    GoodsStock getGoodsStockInfo(GoodsStock goodsStock);
 }

+ 88 - 0
src/main/java/com/style24/front/biz/service/TsfCommonService.java

@@ -0,0 +1,88 @@
+package com.style24.front.biz.service;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.style24.core.support.env.TscConstants;
+import com.style24.front.biz.dao.TsfCommonDao;
+import com.style24.front.support.security.session.TsfSession;
+import com.style24.persistence.domain.InflowHst;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * 공통 Service
+ *
+ * @author eskim
+ * @since 2021. 02. 09
+ */
+@Service
+@Slf4j
+public class TsfCommonService {
+
+	@Autowired
+	private TsfCommonDao commonDao;
+
+	@Autowired
+	private Environment env;
+
+//	/**
+//	 * 사이트명 조회
+//	 *
+//	 * @param siteCd - 사이트코드
+//	 * @return
+//	 * @author gagamel
+//	 * @since 2020. 5. 26
+//	 */
+//	public String getSiteName(String siteCd) {
+//		return commonDao.getSiteName(siteCd);
+//	}
+
+	/**
+	 * 유입경로 이력 생성
+	 *
+	 * @param afLinkCd - 제휴링크코드
+	 * @author eskim
+	 * @date 2021. 02. 09
+	 */
+	@Transactional("shopTxnManager")
+	public void createInflowHst(InflowHst inflow) {
+		inflow.setSiteCd(TscConstants.Site.STYLE24.value());
+		inflow.setInflowRefer(TsfSession.getHttpServletRequest().getHeader("referer"));
+		inflow.setIpAddr(TsfSession.getIpAddress());
+		inflow.setJsessionId(TsfSession.getSessionId());
+		inflow.setFrontGb(TsfSession.getFrontGb());
+		inflow.setAppYn("true".equals(TsfSession.getAttribute("isApp")) ? "Y" : "N");
+		inflow.setOsType(TsfSession.getAttribute("osType"));
+		if (!StringUtils.isEmpty(inflow.getInflowRefer())) {
+			byte[] referBytes = inflow.getInflowRefer().getBytes();
+			if (referBytes.length > 500) {
+				inflow.setInflowRefer(new String(referBytes, 0, 500));
+			}
+		}
+		if (!StringUtils.isEmpty(inflow.getReturnUrl())) {
+			byte[] referBytes = inflow.getReturnUrl().getBytes();
+			if (referBytes.length > 1000) {
+				inflow.setReturnUrl(new String(referBytes, 0, 1000));
+			}
+		}
+
+		commonDao.createInflowHst(inflow);
+	}
+
+//	/**
+//	 * 앱 기기 등록
+//	 *
+//	 * @param
+//	 * @return
+//	 * @author sasa004
+//	 * @since 2020. 08. 10
+//	 */
+//	public void saveMobileDevice(TsfMobileDevice mobileDevice) {
+//		commonDao.saveMobileDevice(mobileDevice);
+//	}
+
+}

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

@@ -1,12 +1,17 @@
 package com.style24.front.biz.service;
 
-import com.style24.core.support.env.TscConstants;
-import com.style24.persistence.domain.Goods;
-import com.style24.persistence.domain.GoodsStock;
+import java.nio.charset.StandardCharsets;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
+import com.style24.core.support.env.TscConstants;
 import com.style24.front.biz.dao.TsfGoodsDao;
+import com.style24.front.support.security.session.TsfSession;
+import com.style24.persistence.domain.Goods;
+import com.style24.persistence.domain.GoodsStock;
+import com.style24.persistence.domain.GoodsViewHst;
 
 import lombok.extern.slf4j.Slf4j;
 
@@ -23,6 +28,63 @@ public class TsfGoodsService {
 	@Autowired
 	private TsfGoodsDao goodsDao;
 
+	/**
+	 * 상품뷰이력 생성
+	 *
+	 * @param goodsCd - 상품코드
+	 * @param ithrCd - 유입코드
+	 * @return
+	 * @author eskim
+	 * @since 2021. 2. 09
+	 */
+	@Transactional("shopTxnManager")
+	public void createGoodsViewHst(String goodsCd, String ithrCd) {
+		// 상품뷰이력 생성
+		GoodsViewHst goodsViewHst = new GoodsViewHst();
+		goodsViewHst.setGoodsCd(goodsCd);
+		goodsViewHst.setJsessionId(TsfSession.getSessionId());
+		goodsViewHst.setSiteCd(TscConstants.Site.STYLE24.value());
+		goodsViewHst.setFrontGb(TsfSession.getFrontGb());
+		goodsViewHst.setAfLinkCd(ithrCd);
+		goodsViewHst.setReferer(javaToOracleStringConvertor(TsfSession.getHttpServletRequest().getHeader("Referer"), 2000)); // byte 기준 2000 짜르기
+
+		if (TsfSession.getInfo() != null) {
+			goodsViewHst.setCustNo(TsfSession.getInfo().getCustNo());
+		}
+
+		goodsDao.createGoodsViewHst(goodsViewHst);
+	}
+
+	/**
+	 * byte 기준 데이터 자르기
+	 *
+	 * @param s
+	 * @param limitByteLength
+	 * @return
+	 * @author eskim
+	 * @since 2020. 9. 1.
+	 */
+	public String javaToOracleStringConvertor(String s, int limitByteLength) {
+		byte[] bytes = s.getBytes(StandardCharsets.UTF_8);
+		int length = bytes.length;
+		if (limitByteLength >= length) {
+			return s;
+		}
+		int totalByteCount = 0;
+		for (int i = 0; i < s.length();) {
+			int cp = s.codePointAt(i);
+			int n = Character.charCount(cp);
+			int byteCount = s.substring(i, i + n).getBytes(StandardCharsets.UTF_8).length;
+			if ((totalByteCount + byteCount) > limitByteLength) {
+
+				break;
+			}
+			totalByteCount += byteCount;
+			i += n;
+		}
+		return new String(bytes, 0, totalByteCount);
+	}
+
 	/**
 	 * 상품 정보 조회
 	 * @param goods

+ 37 - 19
src/main/java/com/style24/front/support/interceptor/TsfAflinkInterceptor.java

@@ -3,15 +3,25 @@ package com.style24.front.support.interceptor;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.servlet.ModelAndView;
 import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
 
+import com.style24.front.biz.service.TsfCommonService;
+import com.style24.front.support.security.session.TsfSession;
+import com.style24.persistence.domain.InflowHst;
+
 import lombok.extern.slf4j.Slf4j;
 
+import com.gagaframework.web.parameter.GagaMap;
+import com.gagaframework.web.parameter.GagaParameterUtil;
+import com.gagaframework.web.util.GagaStringUtil;
+
 /**
  * 제휴링크 Interceptor
- * 
+ *
  * @author gagamel
  * @since 2020. 9. 11
  */
@@ -19,27 +29,35 @@ import lombok.extern.slf4j.Slf4j;
 @Slf4j
 public class TsfAflinkInterceptor extends HandlerInterceptorAdapter {
 
-//	@Autowired
-//	private WfoCommonService commonService;
+	@Autowired
+	private TsfCommonService commonService;
 
 	@Override
 	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
-//		// Parameter
-//		GagaMap params = GagaParameterUtil.getParameterMap(request);
-//
-//		// 제휴링크코드
-//		String afLinkCd = params.getString("afLinkCd");
-//
-//		if (StringUtils.isNotBlank(afLinkCd)) {
-//			if (!afLinkCd.equals(FoSession.getAttribute("afLinkCd"))) {
-//				FoSession.setAttribute("afLinkCd", afLinkCd);
-//			}
-//		} else {
-//			afLinkCd = "AF001"; // STYLE24
-//			FoSession.setAttribute("afLinkCd", afLinkCd);
-//		}
-//
-//		commonService.createInflowHistory(afLinkCd);
+		// Parameter
+		GagaMap params = GagaParameterUtil.getParameterMap(request);
+
+		// 제휴링크코드
+		String afLinkCd = params.getString("afLinkCd");
+
+		if (StringUtils.isNotBlank(afLinkCd)) {
+			if (!afLinkCd.equals(TsfSession.getAttribute("afLinkCd"))) {
+				TsfSession.setAttribute("afLinkCd", afLinkCd);
+			}
+		} else {
+			afLinkCd = "AF001"; // STYLE24
+			TsfSession.setAttribute("afLinkCd", afLinkCd);
+		}
+
+		String queryString = GagaStringUtil.convertParameterToQueryString(request.getParameterMap());
+		if (StringUtils.isNotBlank(queryString)) {
+			queryString = "?" + queryString;
+		}
+
+		InflowHst inflow = new InflowHst();
+		inflow.setAfLinkCd(afLinkCd);
+		inflow.setReturnUrl(request.getRequestURL() + queryString);
+		commonService.createInflowHst(inflow);
 
 		return super.preHandle(request, response, handler);
 	}

+ 37 - 28
src/main/java/com/style24/front/support/interceptor/TsfGoodsViewInterceptor.java

@@ -3,15 +3,24 @@ package com.style24.front.support.interceptor;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 import org.springframework.web.servlet.ModelAndView;
 import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
 
+import com.style24.front.biz.service.TsfGoodsService;
+import com.style24.front.support.env.TsfConstants;
+
 import lombok.extern.slf4j.Slf4j;
 
+import com.gagaframework.web.parameter.GagaMap;
+import com.gagaframework.web.parameter.GagaParameterUtil;
+import com.gagaframework.web.util.GagaCookieUtil;
+
 /**
  * 상품뷰 Interceptor
- * 
+ *
  * @author gagamel
  * @since 2020. 9. 11
  */
@@ -19,37 +28,37 @@ import lombok.extern.slf4j.Slf4j;
 @Slf4j
 public class TsfGoodsViewInterceptor extends HandlerInterceptorAdapter {
 
-//	@Value("${has-ssl}")
-//	private String hasSsl;
+	@Value("${has-ssl}")
+	private String hasSsl;
 
-//	@Autowired
-//	private WfoGoodsService goodsService;
+	@Autowired
+	private TsfGoodsService goodsService;
 
 	@Override
 	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
-//		// Parameter
-//		GagaMap params = GagaParameterUtil.getParameterMap(request);
-//
-//		// 상품뷰이력 생성
-//		goodsService.createGoodsViewHistory(params.getString("goodsCd"), params.getString("ithrCd"));
-//
-//		// SSL Server
-//		boolean isSslServer = Boolean.parseBoolean(hasSsl);
-//		log.debug("isSslServer: [{}]", isSslServer);
-//
-//		if (isSslServer) {
-//			// 상품유입경로 쿠키 설정
-//			GagaCookieUtil.setSecureCookie(response, FoConstants.CK_PREFIX + "_ithrCd", params.getString("ithrCd"), -1);
-//
-//			// 컨텐츠위치코드 쿠키 설정
-//			GagaCookieUtil.setSecureCookie(response, FoConstants.CK_PREFIX + "_contentsLoc", params.getString("contentsLoc"), -1);
-//		} else {
-//			// 상품유입경로 쿠키 설정
-//			GagaCookieUtil.setCookie(response, FoConstants.CK_PREFIX + "_ithrCd", params.getString("ithrCd"), -1);
-//
-//			// 컨텐츠위치코드 쿠키 설정
-//			GagaCookieUtil.setCookie(response, FoConstants.CK_PREFIX + "_contentsLoc", params.getString("contentsLoc"), -1);
-//		}
+		// Parameter
+		GagaMap params = GagaParameterUtil.getParameterMap(request);
+
+		// 상품뷰이력 생성
+		goodsService.createGoodsViewHst(params.getString("goodsCd"), params.getString("ithrCd"));
+
+		// SSL Server
+		boolean isSslServer = Boolean.parseBoolean(hasSsl);
+		log.debug("isSslServer: [{}]", isSslServer);
+
+		if (isSslServer) {
+			// 상품유입경로 쿠키 설정
+			GagaCookieUtil.setSecureCookie(response, TsfConstants.CK_PREFIX + "_ithrCd", params.getString("ithrCd"), -1);
+
+			// 컨텐츠위치코드 쿠키 설정
+			GagaCookieUtil.setSecureCookie(response, TsfConstants.CK_PREFIX + "_contentsLoc", params.getString("contentsLoc"), -1);
+		} else {
+			// 상품유입경로 쿠키 설정
+			GagaCookieUtil.setCookie(response, TsfConstants.CK_PREFIX + "_ithrCd", params.getString("ithrCd"), -1);
+
+			// 컨텐츠위치코드 쿠키 설정
+			GagaCookieUtil.setCookie(response, TsfConstants.CK_PREFIX + "_contentsLoc", params.getString("contentsLoc"), -1);
+		}
 
 		return super.preHandle(request, response, handler);
 	}

+ 39 - 0
src/main/java/com/style24/persistence/domain/CardPromotion.java

@@ -0,0 +1,39 @@
+package com.style24.persistence.domain;
+
+import com.style24.persistence.TscBaseDomain;
+
+import lombok.Data;
+
+/**
+ * 카드프로모션 Domain
+ *
+ * @author eskim
+ * @since 2021. 01. 29
+ */
+@SuppressWarnings("serial")
+@Data
+public class CardPromotion extends TscBaseDomain {
+
+	private Integer cardPrmtSq;	// 카드프로모션일련번호
+	private String prmtNm;	// 프로모션명
+	private String prmtStd;	// 프로모션시작일
+	private String prmtEdd;	// 프로모션종료일
+	private String prmtGb;	// 프로모션구분(A:할인, B:무이자)
+	private String dcGb;	// 행사구분(프로모션구분이 A:할인인 경우 1:즉시할인,2:청구할인,3:제휴카드)
+	private String linkUrl;	// 연결URL
+	private String note;	// 안내
+	private String dispYn;	// 표시여부
+
+	private Integer cardPrmtCdtSq;	// 카드프로모션행사조건일련번호
+	private int minPayAmt;	// 최소결제금액
+	private String dcWay;	// 할인구분할인방식(공통코드G240, 프로모션구분이 A:할인인 경우)
+	private int dcVal;	// 할인값(프로모션구분이 A:할인인 경우, 할인방식이 금액이면 할인금액, 율이면 할인율)
+	private int maxDcAmt;	// 최대할인금액(프로모션구분이 A:할인인 경우)
+	private String minNoItrt;	// 최소무이자월수(프로모션구분이 B:무이자 인경우)
+	private String maxNoItrt;	// 최대무이자월수(프로모션구분이 B:무이자 인경우)
+
+	private String prmtTargetCd;	// 포로모션대상카드(공통코드G941)
+	private String prmtTargetNm;	// 카드명
+
+	private int rownum;
+}

+ 33 - 33
src/main/java/com/style24/persistence/domain/Goods.java

@@ -71,42 +71,42 @@ public class Goods extends TscBaseDomain {
 
 	private String brandnm;		//브랜드명
 	private String brandGrpNm;	//브랜드그룹명
-	private String frontGb;
-	private String isApp;
-	private String siteCd;
-	private String cateGb;
-	private String afLinkCd;
-	private String ithrCd;
-	private String contentsLoc;
-	private int pntRate;
-	private String prePntUsableYn;
-	private String niClsfCd;
-	private String brandTcateCd;
-	private String adminYn;
-	private String preview;
-	private String viewDt;
-	private String custGb;
-	private String custGrade;
-	private String custNo;
-	private String soldoutGoodsDisplayYn = "N";
-	private int pointUnit = 10;
-	private String goodsNmFull;
-	private String sysImgNm;
-	private String logoFileNm;
-	private int stockQty;
-	private String soldoutYn;
-	private String wishYn;
-	private String socialSq;
-	private String socialTypeNm;
-	private String socialType;
-	private String socialTnm;
-	private String socialStdt;
-	private String socialEddt;
-	private String planDtlSq;
+	private String frontGb;		//프론트구분
+	private String isApp;		//앱구분
+	private String siteCd;		//사이트코드
+//	private String cateGb;		//카테구분
+	private String afLinkCd;	//제휴링크코드
+	private String ithrCd;		//위치코드
+	private String contentsLoc;	//컨텐츠위치
+	private int pntRate;		//적립율
+	private String prePntUsableYn;	//적립율즉시사용여부
+	private String niClsfCd;	//고시분류코드
+	private String brandTcateNo;	//브랜드카테1번호
+	private String adminYn;		//어드민조회여부
+	private String preview;		//미리보기여부
+	private String viewDt;		//미리보기일시
+	private String custGb;		//고객구분
+	private String custGrade;	//고객등급
+	private String custNo;		//고객번호
+	private String soldoutGoodsDisplayYn = "N";	//품절노추여부
+	private int pointUnit = 10;	//포인트단위
+	private String goodsNmFull;	//상품타이틀+ 상품명
+	private String sysImgNm;	//상품이미지
+	private String logoFileNm;	//브랜드로고이미지
+	private int stockQty;		//재고
+	private String soldoutYn;	//품절여부
+	private String wishYn;		//위시리스트여부
+	private String goodsCdIncludeYn;	//상품코드포함 여부
+	private String socialSq;	//소셜번호
+//	private String socialTypeNm;	//소셜타입명
+	private String socialType;	//소셜타입
+	private String socialTnm;	//소셜명
+	private String socialStdt;	//소셜시작일
+	private String socialEddt;	//소셜종료일
+	private String planDtlSq;	//기획전상세번호
 
 	private int floorUnit; // 절사단위(10:일원단위절사, 100:십원단위절사, 1000:백원단위절사)
 
-
 	private String skuModelNo;		// SKUModelNo(WMS)
 	private String compsGoodsCd;	// 세트 구성품 상품번호
 	private String optCd;			// 옵션코드

+ 39 - 0
src/main/java/com/style24/persistence/domain/GoodsImg.java

@@ -0,0 +1,39 @@
+package com.style24.persistence.domain;
+
+import com.style24.persistence.TscBaseDomain;
+
+import lombok.Data;
+
+/**
+ * 상품 이미지 Domain
+ * @author eskim
+ * @since 2020. 10. 20
+ */
+@SuppressWarnings("serial")
+@Data
+public class GoodsImg extends TscBaseDomain {
+
+	private String goodsCd;
+	private String colorCd;
+	private int dispOrd;
+	private String orgImgNm;
+	private String sysImgNm;
+	private String defaultImgYn;
+	private String mouseoverImgYn;
+	private String colorNm;
+	private String mode;
+	private int defaultImgOrd;
+	private int mouseoverImgOrd;
+	private String sysImgUrl;
+	private int brandNo;
+
+	private String goodsImgPath;
+	private String col;
+	private String mainColorCd;
+	private String mainColorYn;
+	private String colorEnm;
+	private String optCd1;
+
+
+
+}

+ 47 - 0
src/main/java/com/style24/persistence/domain/GoodsNotiInfo.java

@@ -0,0 +1,47 @@
+package com.style24.persistence.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.style24.persistence.TscBaseDomain;
+
+import lombok.Data;
+
+/**
+ * 상품 고시 Domain
+ *
+ * @author eskim
+ * @since 2020. 10. 20
+ */
+@SuppressWarnings("serial")
+@Data
+public class GoodsNotiInfo extends TscBaseDomain {
+
+	private String goodsCd;
+	private String niClsfCd;
+	private String niItemCd;
+	private String niContent;
+	private int dispOrd;
+
+	private String niItemNm;
+	private String supplyVendorCd;
+
+	// 상품고시정보조회에서 사용
+	private String goodsNm;
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] goodsCds;
+	private String col1;
+	private String col2;
+	private String col3;
+	private String col4;
+	private String col5;
+	private String col6;
+	private String col7;
+	private String col8;
+	private String col9;
+	private String col10;
+	private String col11;
+	private String col12;
+	private String col13;
+	private String col14;
+	private int colCnt;
+
+}

+ 28 - 0
src/main/java/com/style24/persistence/domain/InflowHst.java

@@ -0,0 +1,28 @@
+package com.style24.persistence.domain;
+
+import com.style24.persistence.TscBaseDomain;
+
+import lombok.Data;
+
+/**
+ *  제휴링크 이력 Domain
+ *
+ * @author eskim
+ * @since 2020. 03. 02
+ */
+@SuppressWarnings("serial")
+@Data
+public class InflowHst extends TscBaseDomain {
+
+	private String inflowDt;		// 유입일시
+	private String siteCd;			// 사이트코드
+	private String inflowRefer;		// 유입REFER
+	private String ipAddr;			// IP주소
+	private String afLinkCd;		// 제휴링크코드
+	private String jsessionId;		// J세션 ID
+	private String frontGb;			// PC,MO구분
+	private String appYn;			// APP구분
+	private String osType;			// Mobile OS 구분
+	private String returnUrl;		// return URL
+
+}

+ 27 - 0
src/main/java/com/style24/persistence/domain/VideoDisploc.java

@@ -0,0 +1,27 @@
+package com.style24.persistence.domain;
+
+import com.style24.persistence.TscBaseDomain;
+
+import lombok.Data;
+
+/**
+ * 동영상 Domain
+ *
+ * @author eskim
+ * @since 2021. 2. 9
+ */
+@SuppressWarnings("serial")
+@Data
+public class VideoDisploc extends TscBaseDomain {
+
+	private int videoSq;
+	private String videoGb;
+	private String videoVal;
+
+	private String displocGb;
+	private String displocVal;
+	private String delYn;
+
+	private String imgType;
+	private String imgPath1;
+}

+ 62 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsfCommon.xml

@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.style24.front.biz.dao.TsfCommonDao">
+
+	<!-- 페이징을 위한 select절 상단 -->
+	<sql id="selectForPagingHeader">
+		SELECT *
+		FROM   (
+	</sql>
+
+	<!-- 페이징을 위한 select절 하단 -->
+	<sql id="selectForPagingFooter">
+		       ) ORIGINAL
+		WHERE  NUMB BETWEEN #{pageable.startRow} AND #{pageable.endRow}
+	</sql>
+	
+	<!-- 제휴링크 이력 추가 -->
+	<insert id="createInflowHst" parameterType="TsfInflow">
+		/* TsfCommon.createInflowHst */
+		INSERT INTO TB_INFLOW_HST (
+		       INFLOW_DT
+		     , SITE_CD
+		     , FRONT_GB
+		     , APP_YN
+		     , OS_TYPE
+		     , AF_LINK_CD
+		     , PAGE_URL
+		     , INFLOW_REFER
+		     , IP_ADDR
+		     , JSESSION_ID
+		)
+		SELECT NOW()
+		     , #{siteCd}
+		     , #{frontGb}
+		     , #{appYn}
+		     , #{osType}
+		     , AF_LINK_CD
+		     , #{pageUrl}
+		     , #{inflowRefer}
+		     , #{ipAddr}
+		     , #{jsessionId}
+		FROM   TB_AF_LINK
+		WHERE  AF_LINK_CD = #{afLinkCd}
+		AND    USE_YN = 'Y'
+		
+		SELECT SYSDATE        AS INFLOW_DT
+		     , #{siteCd}      AS SITE_CD
+		     , #{inflowRefer} AS INFLOW_REFER
+		     , #{ipAddr}      AS IP_ADDR
+		     , AF_LINK_CD
+		     , #{jsessionId}  AS JSESSION_ID
+		     , #{frontGb}     AS FRONT_GB
+		     , #{appYn}       AS APP_YN
+		     , #{osType}      AS OS_TYPE
+		     , #{returnUrl}   AS PAGE_URL
+		FROM   TB_AF_LINK
+		WHERE  AF_LINK_CD = #{afLinkCd}
+		AND    USE_YN = 'Y'
+	</insert>
+	
+
+</mapper>

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

@@ -233,38 +233,30 @@
 		            AND SITE_CD = #{siteCd}
 		            AND USE_YN = 'Y') AS BRAND_CATE1_NO
 		    FROM TB_GOODS G
-		       , TB_BRAND B
-		       , TB_COLOR C
-		       , (SELECT GOODS_CD
-		               , MAX(CASE WHEN SOLDOUT_YN = 'Y' THEN 0
-		                          WHEN UPPER(NVL(#{isApp},'FALSE')) = 'TRUE' THEN CURR_APP_STOCK_QTY
-		                          WHEN #{frontGb} = 'M' THEN CURR_MO_STOCK_QTY
-		                          ELSE CURR_PC_STOCK_QTY
-		                     END) AS STOCK_QTY
-		          FROM VW_STOCK
-		          WHERE SOLDOUT_YN = 'N'
-		          GROUP BY GOODS_CD) S
-		       , (SELECT GOODS_CD
-		               , MAX(CASE WHEN SOLDOUT_YN = 'Y' THEN 0
-		                          WHEN UPPER(NVL(#{isApp},'FALSE')) = 'TRUE' THEN CURR_APP_STOCK_QTY
-		                          WHEN #{frontGb} = 'M' THEN CURR_MO_STOCK_QTY
-		                          ELSE CURR_PC_STOCK_QTY
-		                     END) AS STOCK_QTY
-		          FROM VW_STOCK_COMPOSE
-		          WHERE SOLDOUT_YN = 'N'
-		          GROUP BY GOODS_CD) S1
+		    INNER JOIN TB_BRAND B ON G.BRAND_CD = B.BRAND_CD
+		                          AND B.USE_YN = 'Y'
+		    LEFT OUTER JOIN (SELECT GOODS_CD
+		                          , MAX(CASE WHEN SOLDOUT_YN = 'Y' THEN 0
+		                                     ELSE CURR_STOCK_QTY
+		                                     END) AS STOCK_QTY
+		                     FROM VW_STOCK
+		                     WHERE SOLDOUT_YN = 'N'
+		                     GROUP BY GOODS_CD) S ON G.GOODS_CD = S.GOODS_CD
+		    LEFT OUTER JOIN (SELECT GOODS_CD
+		                          , MAX(CASE WHEN SOLDOUT_YN = 'Y' THEN 0
+		                                     ELSE CURR_STOCK_QTY
+		                                     END) AS STOCK_QTY
+		                     FROM VW_STOCK_COMPOSE
+		                     WHERE SOLDOUT_YN = 'N'
+		                     GROUP BY GOODS_CD) S1 G.GOODS_CD = S1.GOODS_CD
 		    WHERE G.GOODS_NUM = (SELECT GOODS_NUM FROM TB_GOODS WHERE GOODS_CD = #{goodsCd})
 		    AND G.GOODS_TYPE = 'G056_N' -- 일반상품
 		    -- AND G.SELF_MALL_YN = 'Y' -- 자사몰 노출
-		    AND G.BRAND_CD = B.BRAND_CD
-		    AND B.USE_YN = 'Y'
-		    AND G.GOODS_CD = S.GOODS_CD(+)
-		    AND G.GOODS_CD = S1.GOODS_CD(+)
-		    <if test='goodsCdincludeYn != null and goodsCdincludeYn == "N"'>
+		    <if test='goodsCdIncludeYn != null and goodsCdIncludeYn == "N"'>
 		    AND G.GOODS_CD <![CDATA[<>]]> #{goodsCd}
 		    </if>
 		    <if test='adminYn == null or adminYn != "Y"'>
-		    AND G.GOODS_STAT = '90'
+		    AND G.GOODS_STAT = 'G008_90'
 		    </if>
 		) Z
 		WHERE 1 = 1
@@ -273,7 +265,51 @@
 		</if>
 		ORDER BY Z.COLOR_CD
 	</select>
+		
+	<!-- 상품 동영상정보 -->
+	<select id="getVideoList" parameterType="String" resultType="VideoDisploc">
+		/* TsfGoods.getVideoList */
+		SELECT A.VIDEO_SQ
+		     , A.DISPLOC_VAL
+		     , B.VIDEO_GB
+		     , B.VIDEO_VAL
+		FROM TB_VIDEO_DISPLOC A
+		INNER JOIN TB_VIDEO B ON A.VIDEO_SQ = B.VIDEO_SQ
+		                      AND B.DISP_YN = 'Y'
+		WHERE A.DISPLOC_GB = 'G'
+		AND A.DISPLOC_VAL = #{goodsCd}
+		AND A.DISP_YN = 'Y'
+		ORDER BY A.VIDEO_SQ DESC
+	</select>
 	
+	<!-- 상품 고시정보 목록 -->
+	<select id="getGoodsNotiList" parameterType="Goods" resultType="GoodsNotiInfo">
+		/* TsfGoods.getGoodsNotiList */
+		SELECT A.GOODS_CD
+		     , A.NI_CLSF_CD
+		     , A.NI_ITEM_CD
+		     , FN_GET_CODE_NM('G005',A.NI_ITEM_CD) AS NI_ITEM_NM
+		     , A.NI_CONTENT
+		     , A.DISP_ORD
+		FROM TB_GOODS_NOTI_INFO A
+		WHERE A.GOODS_CD = #{goodsCd}
+		ORDER BY A.DISP_ORD
+	</select>
+		
+	<!-- 상품 이미지 정보 -->
+	<select id="getGoodsImg" parameterType="String" resultType="GoodsImg">
+		/* TsfGoods.getGoodsImg */
+		SELECT GOODS_CD
+		     , COLOR_CD
+		     , DISP_ORD
+		     , SYS_IMG_NM
+		     , DEFAULT_IMG_YN
+		     , MOUSEOVER_IMG_YN
+		     , REG_NO
+		FROM TB_GOODS_IMG
+		WHERE GOODS_CD = #{goodsCd}
+		ORDER BY DISP_ORD
+	</select>
 	
 	<!-- 구성 상품 정보 -->
 	<select id="getGoodsCompsInfo" parameterType="Goods" resultType="Goods">
@@ -313,4 +349,51 @@
 		 WHERE VS.GOODS_CD = #{goodsCd}
 		   AND VS.OPT_CD = #{optCd}
 	</select>
+	
+	<!-- 무이자 혜택안내 -->
+	<select id="getCardPromotionList" parameterType="CardPromotion" resultType="CardPromotion">
+		/* TsfGoods.getCardPromotionList */
+		SELECT * 
+		FROM (
+		      SELECT A.CARD_PRMT_SQ 
+		           , A.PRMT_NM 
+		           , A.PRMT_GB 
+		           , A.DC_GB 
+		           , A.LINK_URL 
+		           , A.NOTE 
+		           , B.CARD_PRMT_CDT_SQ 
+		           , B.MIN_PAY_AMT 
+		           , B.MAX_NO_ITRT 
+		           , B.MIN_NO_ITRT 
+		           , B.DC_WAY 
+		           , B.DC_VAL 
+		           , C.PRMT_TARGET_CD 
+		           , D.CD_NM 
+		           , RANK() OVER(PARTITION BY A.PRMT_GB, A.DC_GB ORDER BY A.CARD_PRMT_SQ , B.CARD_PRMT_CDT_SQ, C.PRMT_TARGET_CD DESC) RNUM
+		      FROM TB_CARD_PROMOTION A
+		      INNER JOIN TB_CARD_PROMOTION_CONDITION B ON A.CARD_PRMT_SQ = B.CARD_PRMT_SQ
+		      INNER JOIN TB_CARD_PROMOTION_TARGET C ON B.CARD_PRMT_CDT_SQ = C.CARD_PRMT_CDT_SQ
+		      INNER JOIN TB_COMMON_CODE D ON C.PRMT_TARGET_CD  = D.CD 
+		                                  AND D.CD_GB = 'G941'
+		                                  AND D.USE_YN ='Y'
+		      WHERE NOW() BETWEEN A.PRMT_STD AND A.PRMT_EDD
+		      AND A.DISP_YN  = 'Y'
+		      <if test="prmtGb != null and prmtGb != '' ">
+		      AND A.PRMT_GB = #{prmtGb} -- A:프로모션, B:무이자
+		      </if>
+		      <if test='prmtGb != null and prmtGb == "A" '>
+		      <choose>
+		          <when test='dcGb != null and dcGb=="3"'>
+		      AND A.DC_GB IN ('3')
+		          </when>
+		          <otherwise>
+		      AND A.DC_GB IN ('1','2')
+		          </otherwise>
+		      </choose>
+		      </if>
+		) A
+		<if test="rownum != null and rownum > 0 ">
+		LIMIT 1
+		</if>
+	</select>
 </mapper>