ソースを参照

Merge remote-tracking branch 'origin/bin2107' into card007

card007 5 年 前
コミット
6e5dc2ea64

+ 34 - 0
src/main/java/com/style24/core/biz/dao/TscPopupDao.java

@@ -0,0 +1,34 @@
+package com.style24.core.biz.dao;
+
+import com.style24.core.support.annotation.ShopDs;
+import com.style24.persistence.domain.Popup;
+import org.springframework.stereotype.Repository;
+
+import java.util.Collection;
+
+/**
+ * 팝업 Dao
+ *
+ * @author bin2107
+ * @since 2020. 03. 03
+ */
+@ShopDs
+@Repository
+public interface TscPopupDao {
+
+    /**
+     * 팝업 리스트 카운트
+     * @return
+     * @author bin2107
+     * @since 2021. 3. 3
+     */
+    int getPopupListCount(Popup popup);
+
+    /**
+     * 팝업 리스트
+     * @return
+     * @author bin2107
+     * @since 2021. 3. 3
+     */
+    Collection<Popup> getPopupList(Popup popup);
+}

+ 32 - 0
src/main/java/com/style24/core/biz/service/TscKcpService.java

@@ -0,0 +1,32 @@
+package com.style24.core.biz.service;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Service;
+
+import com.gagaframework.web.parameter.GagaMap;
+import com.style24.persistence.domain.Order;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Service
+@Slf4j
+public class TscKcpService {
+	@Autowired
+	private Environment env;
+
+	public GagaMap kcpOrderRequest(Order param, HttpServletRequest request, HttpServletResponse response) {
+		GagaMap result = new GagaMap();
+		// PC pay_method
+		/* =  신용카드 : 100000000000, 계좌이체  : 010000000000, 가상계좌 : 001000000000 = */
+		/* =  포인트   : 000100000000, 휴대폰   : 000010000000, 상품권   : 000000001000  = */
+		/* =  ARS      : 000000000010                                                    = */
+
+
+
+		return result;
+	}
+}

+ 42 - 0
src/main/java/com/style24/core/biz/service/TscPopupService.java

@@ -0,0 +1,42 @@
+package com.style24.core.biz.service;
+
+import com.style24.core.biz.dao.TscPopupDao;
+import com.style24.persistence.domain.Popup;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Collection;
+
+/**
+ * 팝업 Service
+ *
+ * @author bin2107
+ * @since 2020. 03. 03
+ */
+@Service
+@Slf4j
+public class TscPopupService {
+    @Autowired
+    private TscPopupDao popupDao;
+
+    /**
+     * 팝업 리스트 카운트
+     * @return
+     * @author bin2107
+     * @since 2021. 3. 3
+     */
+    public int getPopupListCount(Popup popup) {
+        return popupDao.getPopupListCount(popup);
+    }
+
+    /**
+     * 팝업 리스트
+     * @return
+     * @author bin2107
+     * @since 2021. 3. 3
+     */
+    public Collection<Popup> getPopupList(Popup popup){
+        return popupDao.getPopupList(popup);
+    }
+}

+ 59 - 0
src/main/java/com/style24/core/biz/web/TscKcpController.java

@@ -0,0 +1,59 @@
+package com.style24.core.biz.web;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.gagaframework.web.parameter.GagaMap;
+import com.style24.core.biz.service.TscKcpService;
+import com.style24.core.biz.service.TscOrderService;
+import com.style24.persistence.domain.Order;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * KCP PG Controller
+ * @author xodud1202
+ * @since 2021. 03. 02
+ */
+@Controller
+@RequestMapping("/kcp")
+@Slf4j
+public class TscKcpController {
+	@Autowired
+	private TscKcpService kcpService;
+
+	@Autowired
+	private TscOrderService orderService;
+
+	@Autowired
+	private Environment env;
+
+	/**
+	 * KCP ORDER
+	 * @return
+	 * @author xodud1202
+	 * @since 2021. 01. 28
+	 */
+	@ResponseBody
+	@PostMapping("/test")
+	public GagaMap kcpTest(Order param, HttpServletRequest request, HttpServletResponse response) {
+		GagaMap result = new GagaMap();
+		try {
+			request.setCharacterEncoding("euc-kr");
+			result = kcpService.kcpOrderRequest(param, request, response);
+			result.put("message", "SUCCESS");
+		} catch (Exception e) {
+
+		}
+
+		return result;
+	}
+}

+ 17 - 1
src/main/java/com/style24/persistence/domain/Coupon.java

@@ -59,7 +59,7 @@ public class Coupon extends TscBaseDomain {
     private String dcCdGb;                  // 할인코드유형 (공통코드G233)
     private String rdCpnNm;                 // 랜덤쿠폰 사용키 (시리얼명 or 난수)
 
-    private String custNo;
+    private int custNo;
     private String custNm;
     private String custGbNm;
     private String custGradeNm;
@@ -72,6 +72,22 @@ public class Coupon extends TscBaseDomain {
     private Integer limitCpnId;         // 선착순쿠폰일련번호
     private String delYn;
     private String cpnDesc;             // 쿠폰설명
+    // payco_redirect = Y           >> 페이코 송부시에만
+    // pay_mthod = 100000000000     >> 페이코 송부시에만
+    // pay_method = 100000000000    >> 페이코 송비시에
+    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+    private int[] cartSqArr;		// 장바구니 일련번호 배열
+    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+    private int[] currPrices;		// 상품가격 배열
+    private String custGb;			// 회원구분
+    private String custGrade;		// 회원등급
+    private int rdCpnId;			// 랜덤쿠폰번호
+    private int dcAmt;				// 할인적용금액
+    private int dcVal;				// 할인금액/율
+    private String result;			// 결과
+    private String frontGb;			// 화면 구분
+    private String availYn;			// 지급 받은 쿠폰 사용 가능 유무
+    private int downloadCnt;		// 다운로드수
 
     // 그리드 파라미터
     List<CouponRefval> supplyCompList;          // 공급업체 리스트

+ 50 - 0
src/main/java/com/style24/persistence/domain/Payment.java

@@ -0,0 +1,50 @@
+package com.style24.persistence.domain;
+
+import java.util.Collection;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.style24.core.support.util.CryptoUtils;
+import com.style24.persistence.TscBaseDomain;
+import com.style24.persistence.TscPageRequest;
+
+import lombok.Data;
+
+/**
+ * 알람 Domain
+ * 
+ * @author jsh77b
+ * @since 2021. 01. 18
+ */
+@SuppressWarnings("serial")
+@Data
+public class Payment extends TscBaseDomain {
+	// KCP
+	private String reqTx;			// 요청종류 (승인 : pay, 취소, 매입 : mod)
+	private String SiteCd;			// 회사코드
+	private String siteName;		// 사이트명
+	private int quotaopt;			// 할부옵션
+	private String currency;		// 결제 화폐단위
+	private String moduleType;		// 모듈타입
+	private String payMethod;		// 지불 방법(신용카드 : 100000000000, 계좌이체 : 010000000000, 가상계좌 : 001000000000, 포인트   : 000100000000, 휴대폰   : 000010000000, 상품권   : 000000001000, ARS      : 000000000010)
+	private String ordrIdxx;		// 주문번호
+	private String goodName;		// 상품명
+	private int goodMny;			// 결제금액
+	private String buyrName;		// 주문자명
+	private String buyrMail;		// 주문자 E-MAIL
+	private String buyrTel1;		// 주문자 연락처1(전화번호)
+	private String buyrTel2;		// 주문자 연락처2(휴대폰번호)
+	private String goodExpr;		// 2012년 8월 18일 전자상거래법 개정 관련 설정 부분 : 제공 기간 설정 0:일회성 1:기간설정(ex 1:2012010120120131)
+	// 필수 항목 : 아래 항목은 표준웹에서 값을 설정하는 부분으로 반드시 포함되어야 합니다 값을 설정하지 마십시오
+	private String resCd;
+	private String resMsg;
+	private String encInfo;
+	private String encData;
+	private String retPayMethod;
+	private String tranCd;
+	private String usePayMethod;
+	private String ordrChk;
+	private String cashYn;
+	private String cashTrCode;
+	private String cashIdInfo;
+}

+ 56 - 0
src/main/java/com/style24/persistence/domain/Popup.java

@@ -0,0 +1,56 @@
+package com.style24.persistence.domain;
+
+import com.style24.persistence.TscBaseDomain;
+import com.style24.persistence.TscPageRequest;
+import lombok.Data;
+
+/**
+ * 팝업 도메인
+ * @author bin2107
+ * @since 2021-03-03
+ */
+@SuppressWarnings("serial")
+@Data
+public class Popup extends TscBaseDomain {
+    private Integer popupSq;
+    private String  siteCd;
+    private String  frontGb;
+    private String  popupGb;
+    private String  imgUrl1;
+    private String  imgUrl2;
+    private String  imgUrl3;
+    private String  imgUrl4;
+    private String  imgUrl5;
+    private String  linkUrl1;
+    private String  linkUrl2;
+    private String  linkUrl3;
+    private String  linkUrl4;
+    private String  linkUrl5;
+    private String  viewPage;
+    private Integer cate1No;
+    private String  brandCd;
+    private Integer planSq;
+    private String  dispStdt;
+    private String  dispStTime;
+    private String  dispEddt;
+    private String  dispEdTime;
+    private Integer topLoc;
+    private Integer leftLoc;
+    private Integer popupWidth;
+    private Integer popupHeight;
+    private Integer unexpDays;
+    private int     dispOrd;
+    private String  useYn;
+    private String  displayYn;
+    private String  newImgFileNm1;
+    private String  newImgFileNm2;
+    private String  newImgFileNm3;
+    private String  newImgFileNm4;
+    private String  newImgFileNm5;
+
+    // Pagination
+    private TscPageRequest pageable;
+    private int pageNo = 1;
+    private int pageSize = 50;
+    private int pageUnit = 10;
+}

+ 90 - 0
src/main/java/com/style24/persistence/mybatis/shop/TscPopup.xml

@@ -0,0 +1,90 @@
+<?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.core.biz.dao.TscPopupDao">
+
+	<!-- 팝업 목록 건수 조회 -->
+	<select id="getPopupListCount" parameterType="Popup" resultType="int">
+		/* TscPopup.getPopupListCount */
+		SELECT	COUNT(*) AS TOTCNT
+		FROM	TB_POPUP A
+		LEFT OUTER JOIN TB_POPUP_FRONT B
+		ON 	A.POPUP_SQ = B.POPUP_SQ
+		WHERE	1=1
+		AND A.USE_YN = 'Y'
+		<if test='siteCd != null and siteCd != ""'>
+			AND A.SITE_CD = #{siteCd}
+		</if>
+		<if test='frontGb != null and frontGb != "" and frontGb != "A"'>
+			AND (A.FRONT_GB = 'A' OR A.FRONT_GB = #{frontGb} )
+		</if>
+		<if test="dispEddt != null and dispEddt ==''">
+		<![CDATA[
+		  AND 	A.DISP_STDT <= STR_TO_DATE(CONCAT(#{dispEddt},#{dispEdTime}),'%Y-%m-%d %H:%i:%S')
+		]]>
+		</if>
+		<if test="dispStdt != null and dispStdt ==''">
+		<![CDATA[
+		  AND 	A.DISP_STDT >= STR_TO_DATE(CONCAT(#{dispStdt},#{dispStTime}),'%Y-%m-%d %H:%i:%S')
+		]]>
+		</if>
+	</select>
+
+	<!-- 팝업 목록 조회 -->
+	<select id="getPopupList" parameterType="Popup" resultType="Popup">
+		/* TscPopup.getPopupList */
+		SELECT	A.POPUP_SQ
+			, A.SITE_CD
+			, A.FRONT_GB
+			, A.POPUP_GB
+			, A.IMG_URL1
+			, A.IMG_URL2
+			, A.IMG_URL3
+			, A.IMG_URL4
+			, A.IMG_URL5
+			, A.LINK_URL1
+			, A.LINK_URL2
+			, A.LINK_URL3
+			, A.LINK_URL4
+			, A.LINK_URL5
+			, A.VIEW_PAGE
+			, A.CATE1_NO
+			, A.BRAND_CD
+			, A.PLAN_SQ
+			, A.DISP_ORD
+			, A.TOP_LOC
+			, A.LEFT_LOC
+			, A.POPUP_WIDTH
+			, A.POPUP_HEIGHT
+			, A.UNEXP_DAYS
+			, DATE_FORMAT(A.DISP_STDT,'%Y-%m-%d') AS DISP_STDT
+			, DATE_FORMAT(A.DISP_STDT,'%H:%i:%S') AS DISP_ST_TIME
+			, DATE_FORMAT(A.DISP_EDDT,'%Y-%m-%d') AS DISP_EDDT
+			, DATE_FORMAT(A.DISP_EDDT,'%H:%i:%S') AS DISP_ED_TIME
+			, IFNULL(B.USE_YN, 'N') AS DISPLAY_YN
+			, A.REG_NO
+			, DATE_FORMAT(A.REG_DT,'%Y-%m-%d %H:%i:%S') AS REG_DT
+		FROM	TB_POPUP A
+		LEFT OUTER JOIN TB_POPUP_FRONT B
+		ON 	A.POPUP_SQ = B.POPUP_SQ
+		WHERE	1=1
+		AND A.USE_YN = 'Y'
+		<if test='siteCd != null and siteCd != ""'>
+			AND A.SITE_CD = #{siteCd}
+		</if>
+		<if test='frontGb != null and frontGb != "" and frontGb != "A"'>
+			AND (A.FRONT_GB = 'A' OR A.FRONT_GB = #{frontGb} )
+		</if>
+		<if test="dispEddt != null and dispEddt ==''">
+		<![CDATA[
+		  AND 	A.DISP_STDT <= STR_TO_DATE(CONCAT(#{dispEddt},#{dispEdTime}),'%Y-%m-%d %H:%i:%S')
+		]]>
+		</if>
+		<if test="dispStdt != null and dispStdt ==''">
+		<![CDATA[
+		  AND 	A.DISP_STDT >= STR_TO_DATE(CONCAT(#{dispStdt},#{dispStTime}),'%Y-%m-%d %H:%i:%S')
+		]]>
+		</if>
+		ORDER BY A.FRONT_GB, A.DISP_ORD, A.POPUP_SQ DESC
+	</select>
+
+</mapper>