Procházet zdrojové kódy

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

card007 před 5 roky
rodič
revize
ca7699c0bf

+ 24 - 0
src/main/java/com/style24/core/biz/dao/TscCouponDao.java

@@ -136,6 +136,14 @@ public interface TscCouponDao {
      */
     ArrayList<Coupon> getLimitedTimeCouponList(int cpnId);
 
+    /**
+     * 쿠폰 제휴채널 조회
+     * @param cpnId
+     * @author bin2107
+     * @since 2021. 04. 22
+     */
+    ArrayList<Coupon> getCouponAfChannelList(int cpnId);
+
     /**
      * 쿠폰 마스터 수정
      * @param
@@ -192,6 +200,14 @@ public interface TscCouponDao {
      */
     void deleteLimitedTimeCoupon(Coupon coupon);
 
+    /**
+     * 쿠폰 제휴링크 삭제
+     * @param
+     * @author bin2107
+     * @since 2021. 4. 22
+     */
+    void deleteCouponAfChannel(Coupon coupon);
+
     /**
      * 쿠폰 등록
      * @param params
@@ -248,6 +264,14 @@ public interface TscCouponDao {
      */
     void createLimitedTimeCoupon(CouponLimitedTime couponLimitedTime);
 
+    /**
+     * 쿠폰 제휴링크 저장
+     * @param couponLimitedTime
+     * @author bin2107
+     * @since 2021. 04. 22
+     */
+    void createCouponAfChannel(CouponAfChannel couponAfChannel);
+
     /**
      * 특정 쿠폰 발급받은 고객 조회
      * @param  custCoupon

+ 10 - 1
src/main/java/com/style24/core/biz/dao/TscOrderDao.java

@@ -741,5 +741,14 @@ public interface TscOrderDao {
 	 * @since 2021. 04. 20
 	 */
 	int createOrderChangeDetailHstChgStat(Order order);
-	
+
+	/**
+	 * 주문상세단품 상태값 변경
+	 *
+	 * @param order
+	 * @return int
+	 * @author jsshin
+	 * @since 2021. 04. 22
+	 */
+	int updateOrderDetailItemStat(Order order);
 }

+ 22 - 0
src/main/java/com/style24/core/biz/service/TscCouponService.java

@@ -208,6 +208,18 @@ public class TscCouponService {
         return couponDao.getLimitedTimeCouponList(cpnId);
     }
 
+    /**
+     * 쿠폰 제휴채널 조회
+     * @param
+     * @return
+     * @author bin2107
+     * @since 2021-04-22
+     */
+    public ArrayList<Coupon> getCouponAfChannelList(int cpnId) {
+        return couponDao.getCouponAfChannelList(cpnId);
+    }
+
+
     /**
      * 쿠폰 저장
      * @param params
@@ -226,6 +238,7 @@ public class TscCouponService {
             couponDao.deleteCouponRefVal(params);	// 공급업체,브랜드,카테고리,상품 삭제
             couponDao.deleteCouponBurden(params);	// 입점업체 분담율 삭제
             couponDao.deleteLimitedTimeCoupon(params);	// 선착순 쿠폰 삭제
+            couponDao.deleteCouponAfChannel(params);	// 제휴링크 삭제
         }else{	//등록모드일때
             params.setCpnStat("G232_10");
             couponDao.couponInsert(params);
@@ -304,6 +317,7 @@ public class TscCouponService {
         }
 
         // 입점업체분담율
+        log.info("CouponAfChannel params getBurdenList{}",params.getBurdenList());
         for(CouponBurden couponBurden : params.getBurdenList()){
             couponBurden.setCpnId(params.getCpnId());
             couponBurden.setRegNo(params.getRegNo());
@@ -318,6 +332,14 @@ public class TscCouponService {
             couponLimitedTime.setUpdNo(params.getUpdNo());
             couponDao.createLimitedTimeCoupon(couponLimitedTime);
         }
+        log.info("CouponAfChannel params getAfChannelList{}",params.getAfChannelList());
+        // 쿠폰제휴링크
+        for(CouponAfChannel couponAfChannel : params.getAfChannelList()){
+            couponAfChannel.setCpnId(params.getCpnId());
+            couponAfChannel.setRegNo(params.getRegNo());
+            log.info("CouponAfChannel  couponAfChannel{}",couponAfChannel);
+            couponDao.createCouponAfChannel(couponAfChannel);
+        }
 
         // 수정모드이고 변경된 쿠폰상태가 대기 , 중지 인경우 고객이 발급받은 내용도 변경
         if(cpnId != 0 &&

+ 5 - 1
src/main/java/com/style24/core/biz/service/TscOrderService.java

@@ -2157,9 +2157,13 @@ public class TscOrderService {
 	 */
 	@Transactional("shopTxnManager")
 	public void saveOrdDtlStat(Order order) {
+		// 주문상세 상태 변경
 		orderDao.changedOrdDtlStat(order);
+		// 주문상세 이력 저장
 		orderDao.createOrderDetailHst(order);
-	}
+		// 주문상세단품 상태 변경
+		orderDao.updateOrderDetailItemStat(order);
+ 	}
 }
 
 

+ 3 - 0
src/main/java/com/style24/persistence/domain/Coupon.java

@@ -120,6 +120,8 @@ public class Coupon extends TscBaseDomain {
     private String couponStat;			// 쿠폰 다운받았는지 여부
     private String title;				//기획전 에서 설정한 쿠폰 타이틀
     private String note;				//기획전 에서 설정한 쿠폰 유의사항
+    
+    private String planCouponStat;
     // 그리드 파라미터
     List<CouponRefval> supplyCompList;          // 공급업체 리스트
     List<CouponRefval> brandList;               // 브랜드 리스트
@@ -144,6 +146,7 @@ public class Coupon extends TscBaseDomain {
     private String[] payTypeArr;
 
     List<CouponLimitedTime> limitedTimeCpnList; //선착순 쿠폰 리스트
+    List<CouponAfChannel> afChannelList; //쿠폰 제휴채널 리스트
 
     // Pagination
     private TscPageRequest pageable;

+ 22 - 0
src/main/java/com/style24/persistence/domain/CouponAfChannel.java

@@ -0,0 +1,22 @@
+package com.style24.persistence.domain;
+
+import com.style24.persistence.TscBaseDomain;
+import lombok.Data;
+
+/**
+ * 쿠폰 제휴채널 도메인
+ * @author bin2107
+ * @since 2021-04-22
+ */
+@SuppressWarnings("serial")
+@Data
+public class CouponAfChannel extends TscBaseDomain {
+    private int  cpnId;					// 쿠폰ID
+    private String afLinkCd;
+
+    private String afLinkNm;
+    private int freeRate;
+    private int dispOrd;
+    private String afChannel;
+
+}

+ 5 - 0
src/main/java/com/style24/persistence/domain/WmsDelivery.java

@@ -20,15 +20,20 @@ public class WmsDelivery extends TscBaseDomain {
 	private Integer productNo;
 	private Integer ordNo;
 	private Integer ordDtlNo;
+	private Integer ordDtlItemSq;
+	private Integer optCd;
 	
 	private String skuCode;
 	private String stockLoc;
 	private String whCode;
 	private String cancelYn;
 	private String chkYn;
+	private String goodsType;
+	
 	
 	private int locQty;
 	private int chgQty;
+	private int itemQty;
 	
 	
 }

+ 46 - 2
src/main/java/com/style24/persistence/mybatis/shop/TscCoupon.xml

@@ -288,6 +288,7 @@
         WHERE CPN_ID = #{cpnId}
     </select>
 
+    <!-- 선착순쿠폰 조회 -->
     <select id="getLimitedTimeCouponList" parameterType="int" resultType="CouponLimitedTime">
         /* TscCoupon.getLimitedTimeCouponList */
         SELECT	LIMIT_CPN_ID
@@ -307,6 +308,20 @@
           AND  DEL_YN = 'N'
     </select>
 
+    <!-- 쿠폰 제휴채널 조회 -->
+    <select id="getCouponAfChannelList" parameterType="int" resultType="CouponAfChannel">
+        /* TscCoupon.getCouponAfChannelList */
+        SELECT A.CPN_ID
+             ,A.AF_LINK_CD
+             ,B.AF_LINK_NM
+             ,A.REG_DT
+             ,B.FEE_RATE
+             ,B.DISP_ORD
+             ,B.AF_CHANNEL
+        FROM TB_COUPON_AF_CHANNEL A LEFT JOIN TB_AF_LINK B ON A.AF_LINK_CD = B.AF_LINK_CD
+        WHERE CPN_ID = #{cpnId}
+    </select>
+
     <update id="updateCouponMstInfo" parameterType="Coupon">
         /* TscCoupon.updateCouponMstInfo */
         UPDATE	TB_COUPON	SET
@@ -414,8 +429,19 @@
         /* TscCoupon.deleteLimitedTimeCoupon */
         UPDATE TB_LIMITED_TIME_COUPON SET
             DEL_YN = 'Y'
-                                        , UPD_NO = #{updNo}
-                                        , UPD_DT = CURRENT_TIMESTAMP
+          , UPD_NO = #{updNo}
+          , UPD_DT = CURRENT_TIMESTAMP
+        WHERE CPN_ID = #{cpnId}
+          AND DEL_YN = 'N'
+    </update>
+
+    <!-- 쿠폰 제휴링크 삭제 -->
+    <update id="deleteCouponAfChannel" parameterType="Coupon">
+        /* TscCoupon.deleteCouponAfChannel */
+        UPDATE TB_COUPON_AF_CHANNEL SET
+            DEL_YN = 'Y'
+            , UPD_NO = #{updNo}
+            , UPD_DT = CURRENT_TIMESTAMP
         WHERE CPN_ID = #{cpnId}
           AND DEL_YN = 'N'
     </update>
@@ -740,6 +766,24 @@
             , UPD_DT = CURRENT_TIMESTAMP()
     </insert>
 
+    <!-- 쿠폰 제휴링크 저장 -->
+    <insert id="createCouponAfChannel" parameterType="CouponAfChannel">
+        /* TscCoupon.createLimitedTimeCoupon */
+        INSERT INTO TB_COUPON_AF_CHANNEL (
+                                          CPN_ID
+                                          , AF_LINK_CD
+                                          , REG_NO
+                                          , REG_DT
+        ) VALUES (
+            #{cpnId}
+            , #{afLinkCd}
+            , #{regNo}
+            , CURRENT_TIMESTAMP()
+        ) ON DUPLICATE KEY UPDATE
+          REG_NO = #{regNo}
+        , REG_DT = CURRENT_TIMESTAMP()
+    </insert>
+
     <!-- 특정 쿠폰 발급받은 회원 조회-->
     <select id="getCouponIssueCustList" parameterType="CustCoupon" resultType="CustCoupon">
         /* TscCoupon.getCouponIssueCustList */

+ 12 - 0
src/main/java/com/style24/persistence/mybatis/shop/TscOrder.xml

@@ -3574,6 +3574,18 @@
 		  FROM TB_ORDER_CHANGE_DETAIL
 		 WHERE ORD_CHG_SQ = #{ordChgSq}
 	</insert>
+
+	<!-- 주문상세단품 상태값 변경-->
+	<update id="updateOrderDetailItemStat" parameterType="Order">
+	/* TscOrder.updateOrderDetailItemStat */
+		UPDATE TB_ORDER_DETAIL_ITEM
+		SET    ORD_DTL_STAT = #{ordDtlStat}
+		     , UPD_NO = #{updNo}
+		     , UPD_DT = NOW()
+		WHERE  ORD_NO = #{ordNo}
+		AND    ORD_DTL_NO = #{ordDtlNo}
+	</update>
+
 </mapper>
 
 

+ 5 - 5
src/main/java/com/style24/persistence/mybatis/wms/TscWmsDelivery.xml

@@ -99,16 +99,16 @@
 	<update id="updateWmsIfDeliveryOrderItemCancel" parameterType="WmsDelivery">
 		/* TscWmsDelivery.updateWmsIfDeliveryOrderItemCancel */
 			UPDATE istyle24_Wmsif.dbo.TB_IF_DeliveryOrderItem SET
-			  StatusCd = CASE WHEN (Qty - Cqty) = #{chgQty} THEN '60' ELSE StatusCd END 
-			, IsCancel = CASE WHEN (Qty - Cqty) = #{chgQty} THEN 1    ELSE IsCancel END 
-			, Cqty     =  #{chgQty}
+			  StatusCd = CASE WHEN (Qty - Cqty) = #{itemQty} THEN '60' ELSE StatusCd END 
+			, IsCancel = CASE WHEN (Qty - Cqty) = #{itemQty} THEN 1    ELSE IsCancel END 
+			, Cqty     =  #{itemQty}
 			WHERE 1=1
 			  <if test='ordDtlNo != null and ordDtlNo != ""'>
 			  AND OrderDtlNo = #{ordDtlNo}
 			  </if>
-			  <if test='ordDtlNo = null or ordDtlNo = ""'>
+			  <if test='ordDtlNo == null or ordDtlNo == ""'>
 			  AND ProductNo  = #{productNo}
-			  AND SKUCode    = #{skuCode}  	
+			  AND SKUCode    = #{optCd}  	
 			  </if>	
 			  AND (GiftYn != 'Y' OR GiftYn IS NULL) 
 	</update>