Quellcode durchsuchen

Merge branch 'develop' into card007

# Conflicts:
#	src/main/java/com/style24/admin/biz/web/TsaOrderChangeController.java
#	src/main/java/com/style24/persistence/domain/Order.java
card007 vor 5 Jahren
Ursprung
Commit
8b386c58e8
59 geänderte Dateien mit 4814 neuen und 2852 gelöschten Zeilen
  1. 35 0
      README.md
  2. 117 3
      src/main/java/com/style24/admin/biz/dao/TsaCouponDao.java
  3. 11 0
      src/main/java/com/style24/admin/biz/dao/TsaCustomerDao.java
  4. 36 27
      src/main/java/com/style24/admin/biz/dao/TsaMorebetterDao.java
  5. 17 9
      src/main/java/com/style24/admin/biz/dao/TsaRendererDao.java
  6. 26 0
      src/main/java/com/style24/admin/biz/dao/TsaSettleDao.java
  7. 244 82
      src/main/java/com/style24/admin/biz/service/TsaCouponService.java
  8. 35 0
      src/main/java/com/style24/admin/biz/service/TsaCustomerService.java
  9. 39 29
      src/main/java/com/style24/admin/biz/service/TsaGoodsService.java
  10. 45 32
      src/main/java/com/style24/admin/biz/service/TsaKakaoService.java
  11. 23 7
      src/main/java/com/style24/admin/biz/service/TsaMorebetterService.java
  12. 0 746
      src/main/java/com/style24/admin/biz/service/TsaOrderChangeService.java
  13. 21 11
      src/main/java/com/style24/admin/biz/service/TsaRendererService.java
  14. 37 0
      src/main/java/com/style24/admin/biz/service/TsaSettleService.java
  15. 58 1
      src/main/java/com/style24/admin/biz/web/TsaCustomerController.java
  16. 5 0
      src/main/java/com/style24/admin/biz/web/TsaDisplayController.java
  17. 17 12
      src/main/java/com/style24/admin/biz/web/TsaGoodsController.java
  18. 152 24
      src/main/java/com/style24/admin/biz/web/TsaMarketingController.java
  19. 86 25
      src/main/java/com/style24/admin/biz/web/TsaOrderChangeController.java
  20. 13 13
      src/main/java/com/style24/admin/biz/web/TsaRendererController.java
  21. 37 6
      src/main/java/com/style24/admin/biz/web/TsaSettleController.java
  22. 3 0
      src/main/java/com/style24/admin/biz/web/TsaSystemController.java
  23. 35 0
      src/main/java/com/style24/persistence/domain/AflinkFee.java
  24. 1 1
      src/main/java/com/style24/persistence/domain/Category.java
  25. 13 22
      src/main/java/com/style24/persistence/domain/Coupon.java
  26. 22 0
      src/main/java/com/style24/persistence/domain/CouponBurden.java
  27. 43 0
      src/main/java/com/style24/persistence/domain/CouponRefval.java
  28. 28 0
      src/main/java/com/style24/persistence/domain/CustCoupon.java
  29. 3 0
      src/main/java/com/style24/persistence/domain/CustomerSearch.java
  30. 1 0
      src/main/java/com/style24/persistence/domain/Goods.java
  31. 8 0
      src/main/java/com/style24/persistence/domain/GoodsSearch.java
  32. 1 4
      src/main/java/com/style24/persistence/domain/MoreBetter.java
  33. 0 5
      src/main/java/com/style24/persistence/domain/MoreBetterBurden.java
  34. 2 6
      src/main/java/com/style24/persistence/domain/MoreBetterGoods.java
  35. 0 4
      src/main/java/com/style24/persistence/domain/MoreBetterSection.java
  36. 0 84
      src/main/java/com/style24/persistence/domain/OrderChange.java
  37. 369 79
      src/main/java/com/style24/persistence/mybatis/shop/TsaCoupon.xml
  38. 78 0
      src/main/java/com/style24/persistence/mybatis/shop/TsaCustomer.xml
  39. 6 0
      src/main/java/com/style24/persistence/mybatis/shop/TsaGoods.xml
  40. 114 71
      src/main/java/com/style24/persistence/mybatis/shop/TsaMorebetter.xml
  41. 23 10
      src/main/java/com/style24/persistence/mybatis/shop/TsaRenderer.xml
  42. 75 0
      src/main/java/com/style24/persistence/mybatis/shop/TsaSettle.xml
  43. 21 0
      src/main/java/com/style24/persistence/mybatis/shop/TsaSystem.xml
  44. 89 0
      src/main/resources/config/application-tsit.yml
  45. 25 0
      src/main/resources/log/logback-tsit.xml
  46. 434 478
      src/main/webapp/WEB-INF/views/customer/CustomerDetailForm.html
  47. 326 59
      src/main/webapp/WEB-INF/views/display/CategoryGoodsForm.html
  48. 5 5
      src/main/webapp/WEB-INF/views/display/CategorySearchForm.html
  49. 9 4
      src/main/webapp/WEB-INF/views/goods/GoodsDetailForm.html
  50. 0 944
      src/main/webapp/WEB-INF/views/marketing/CouponCreatePopupForm.html
  51. 21 17
      src/main/webapp/WEB-INF/views/marketing/CouponListForm.html
  52. 1432 0
      src/main/webapp/WEB-INF/views/marketing/CouponPopupForm.html
  53. 243 0
      src/main/webapp/WEB-INF/views/marketing/CouponPubForCustPopupForm.html
  54. 92 26
      src/main/webapp/WEB-INF/views/marketing/MorebetterPopupForm.html
  55. 200 0
      src/main/webapp/WEB-INF/views/settle/AfLinkSettleForm.html
  56. 28 2
      src/main/webapp/WEB-INF/views/system/UserDetailForm.html
  57. 6 0
      src/main/webapp/WEB-INF/views/system/UserForm.html
  58. 3 3
      src/main/webapp/ux/js/admin.popup.js
  59. 1 1
      src/main/webapp/ux/js/admin.ui.js

+ 35 - 0
README.md

@@ -0,0 +1,35 @@
+# style24 
+
+## locd
+
+```
+-Dspring.profiles.active=locd
+```
+
+## locp
+
+```
+-Dspring.profiles.active=locp
+```
+
+## dev
+
+```
+-Dspring.profiles.active=dev
+```
+
+### 프로그래밍 규칙
+```
+1. Java Domain 생성시 DB의 Key가 되는 번호인 경우 Integer 타입으로 만들어줘야 한다.
+   > PK가 번호로 되어 있는 것은 db는 int unsigned 형식이고 자바에서는 Integer 형식
+
+2. Java Method 에 대한 네이밍 규칙은 Fullname으로 해야한다.
+   2.1 목록은 ~List
+   2.2 등록은 save~, create~
+   2.3 업데이트는 update~
+   2.4 삭제는 delete~
+
+3. Java Service 영역에서 CUD가 있으면 반드시 @Transactional("shopTxnManager") 명시해 줘야 한다.
+
+4. 팝업 화면에 대한 네이밍 규칙은 ~PopupForm.html 해야한다.
+```

+ 117 - 3
src/main/java/com/style24/admin/biz/dao/TsaCouponDao.java

@@ -3,10 +3,11 @@ package com.style24.admin.biz.dao;
 import java.util.ArrayList;
 import java.util.Collection;
 
+import com.style24.persistence.domain.*;
 import org.springframework.stereotype.Component;
 
 import com.style24.core.support.annotation.ShopDs;
-import com.style24.persistence.domain.Coupon;
+import org.springframework.stereotype.Component;
 
 /**
  * 쿠폰 DAO
@@ -19,7 +20,7 @@ public interface TsaCouponDao {
 
 	/**
 	 * 쿠폰 리스트 조회
-	 * @param  Coupon
+	 * @param  param
 	 * @return ArrayList<Coupon>
 	 * @author xyzp1539
 	 * @since 2020-12-22
@@ -28,7 +29,7 @@ public interface TsaCouponDao {
 
 	/**
 	 * 쿠폰 리스트 카운트 조회
-	 * @param  Coupon
+	 * @param  param
 	 * @return int
 	 * @author xyzp1539
 	 * @since 2020-12-22
@@ -52,4 +53,117 @@ public interface TsaCouponDao {
 	 */
 	Collection<Coupon> getCouponRetrieveList(Coupon coupon);
 
+	/**
+	 * 쿠폰 적용대상 등록
+	 * @param supplyComp
+	 * @author xyzp1539
+	 * @since  2021-01-14
+	 */
+	void saveCouponRefVal(CouponRefval supplyComp);
+
+	/**
+	 * 쿠폰 입점업체 분담 등록
+	 * @param burden
+	 * @author xyzp1539
+	 * @since  2021-01-14
+	 */
+	void saveCouponBurden(CouponBurden burden);
+
+	/**
+	 * 자사브랜드 조회
+	 * @param
+	 * @author xyzp1539
+	 * @since  2021-01-14
+	 */
+    Collection<CommonCode> getSelfBrandList();
+
+	/**
+	 * 쿠폰 상세 조회
+	 * @param  cpnId
+	 * @return Coupon
+	 * @author xyzp1539
+	 * @since 2021-01-15
+	 */
+    Coupon getCouponDetail(String cpnId);
+
+	/**
+	 * 쿠폰 발급개수 조회
+	 * @param  cpnId
+	 * @return int
+	 * @author xyzp1539
+	 * @since 2021-01-15
+	 */
+	int getCouponIssueCnt(String cpnId);
+
+	/**
+	 * 쿠폰 적용 대상 - 제외상품
+	 * @param  cpnRefval
+	 * @return Coupon
+	 * @author xyzp1539
+	 * @since 2021-01-18
+	 */
+	ArrayList<CouponRefval> getCouponRefvalExceptGoodsList(CouponRefval cpnRefval);
+
+	/**
+	 * 쿠폰 적용 대상 - 브랜드
+	 * @param cpnRefval
+	 * @return Coupon
+	 * @author xyzp1539
+	 * @since 2021-01-18
+	 */
+	ArrayList<CouponRefval> getCouponRefvalBrandList(CouponRefval cpnRefval);
+
+	/**
+	 * 쿠폰 적용 대상 - 카테고리
+	 * @param cpnRefval
+	 * @return Coupon
+	 * @author xyzp1539
+	 * @since 2021-01-18
+	 */
+	ArrayList<CouponRefval> getCouponRefvalCategoryList(CouponRefval cpnRefval);
+
+	/**
+	 * 쿠폰 적용 대상 - 적용/제외상품
+	 * @param  cpnRefval
+	 * @return Coupon
+	 * @author xyzp1539
+	 * @since 2021-01-18
+	 */
+	ArrayList<CouponRefval> getCouponRefvalGoodsList(CouponRefval cpnRefval);
+
+	/**
+	 * 쿠폰 적용 대상 - 공급처
+	 * @param cpnRefval
+	 * @return Coupon
+	 * @author xyzp1539
+	 * @since 2021-01-18
+	 */
+	ArrayList<CouponRefval> getCouponRefvalSupplyCompList(CouponRefval cpnRefval);
+
+	/**
+	 * 쿠폰 입점업쳅 분담율 조회
+	 * @param cpnId
+	 * @return  Coupon
+	 * @author xyzp1539
+	 * @since 2021-01-18
+	 */
+	ArrayList<Coupon> getCouponBurdenList(String cpnId);
+
+	/**
+	 * 쿠폰 적용대상 삭제
+	 * @param  couponRefval
+	 * @return
+	 * @author xyzp1539
+	 * @since 2021-01-19
+	 */
+    void updateCouponRefval(CouponRefval couponRefval);
+
+    /**
+     * 고객 쿠폰 발행
+     * @param  custPub
+     * @return
+     * @author xyzp1539
+     * @since 2021-01-21
+     */
+	void saveCouponCustPub(CustCoupon custPub);
 }

+ 11 - 0
src/main/java/com/style24/admin/biz/dao/TsaCustomerDao.java

@@ -35,6 +35,14 @@ public interface TsaCustomerDao {
 	 */
 	Customer getCustomerInfo(String custNo);
 
+	/**
+	 * 회원정보 수정
+	 * @param customer - 고객정보
+	 * @author jsshin
+	 * @since 2020. 01. 20
+	 */
+	void updateCustomerInfo(Customer customer);
+
 	/**
 	 * 탈퇴회원 목록
 	 * @param customerSearch - 검색조건
@@ -52,4 +60,7 @@ public interface TsaCustomerDao {
 	 * @since 2020. 01. 14
 	 */
 	Collection<Customer> getCustomerDormantList(CustomerSearch customerSearch);
+
+	void createException();
+
 }

+ 36 - 27
src/main/java/com/style24/admin/biz/dao/TsaMorebetterDao.java

@@ -21,16 +21,16 @@ public interface TsaMorebetterDao {
     /* CSB 진행 */
     /**
      * 다다익선 프로모션 리스트
-     * @param MoreBetter
+     * @param param
      * @return
      * @author bin2107
      * @since 2020. 12. 28
      */
-    Collection<MoreBetter> getMorebetterList(MoreBetter param);
+    Collection<MoreBetter> getMorebetterList(MoreBetter moreBetter);
 
     /**
      * 다다익선 상세조회
-     * @param MoreBetter
+     * @param tmtbSq
      * @return
      * @author bin2107
      * @since 2021. 1. 8
@@ -39,7 +39,7 @@ public interface TsaMorebetterDao {
 
     /**
      * 다다익선 구간 조회
-     * @param MoreBetter
+     * @param tmtbSq
      * @return
      * @author bin2107
      * @since 2021. 1. 8
@@ -48,22 +48,22 @@ public interface TsaMorebetterDao {
 
     /**
      * 다다익선 구간 조회
-     * @param MoreBetter
+     * @param moreBetterGoods
      * @return
      * @author bin2107
      * @since 2021. 1. 8
      */
-    Collection<MoreBetterGoods> getMorebetterSupplyCompList(MoreBetterGoods merebetterGoods);
+    Collection<MoreBetterGoods> getMorebetterSupplyCompList(MoreBetterGoods moreBetterGoods);
 
-    Collection<MoreBetterGoods> getMorebetterBrandList(MoreBetterGoods merebetterGoods);
+    Collection<MoreBetterGoods> getMorebetterBrandList(MoreBetterGoods moreBetterGoods);
 
-    Collection<MoreBetterGoods> getMorebetterApplyGoodsList(MoreBetterGoods merebetterGoods);
+    Collection<MoreBetterGoods> getMorebetterApplyGoodsList(MoreBetterGoods moreBetterGoods);
 
-    Collection<MoreBetterGoods> getMorebetterExceptGoodsList(MoreBetterGoods merebetterGoods);
+    Collection<MoreBetterGoods> getMorebetterExceptGoodsList(MoreBetterGoods moreBetterGoods);
 
     /**
      * 다다익선 구간 조회
-     * @param MoreBetter
+     * @param tmtbSq
      * @return
      * @author bin2107
      * @since 2021. 1. 8
@@ -72,52 +72,61 @@ public interface TsaMorebetterDao {
 
     /**
      * 다다익선 마스터(TB_TMTB) 저장
-     * @param MoreBetter
+     * @param moreBetter
      * @return
      * @author bin2107
      * @since 2020. 12. 28
      */
-    void saveMorebetterMst(MoreBetter tmtb);
+    void saveMorebetterMst(MoreBetter moreBetter);
 
     /**
      * 다다익선 적용대상 설정(TB_TMTB_GOODS) 저장
-     * @param MoreBetter
+     * @param moreBetterGoods
      * @return
      * @author bin2107
      * @since 2021. 1. 7
      */
-    void saveMorebetterGoods(MoreBetterGoods regSupplyComp);
+    void saveMorebetterGoods(MoreBetterGoods moreBetterGoods);
+
+    /**
+     * 다다익선 실제적용대상 설정(TB_TMTB_APPLY_GOODS) 저장
+     * @param moreBetterGoods
+     * @return
+     * @author bin2107
+     * @since 2021. 1. 20
+     */
+    void saveMorebetterApplyGoods(MoreBetterGoods moreBetterGoods);
 
     /**
      * 다다익선 할인구간설정 2차조건(TB_TMTB_SECTION) 저장
-     * @param MoreBetter
+     * @param moreBetterSection
      * @return
      * @author bin2107
      * @since 2021. 1. 6
      */
-    void saveMorebetterSection(MoreBetterSection regSection);
+    void saveMorebetterSection(MoreBetterSection moreBetterSection);
 
     /**
      * 다다익선 조건에 따른 할인혜택(금액할인) 설정(TB_TMTB_VAL) 저장
-     * @param MoreBetter
+     * @param moreBetterSection
      * @return
      * @author bin2107
      * @since 2021. 1. 6
      */
-    void saveMorebetterVal(MoreBetterSection regSection);
+    void saveMorebetterVal(MoreBetterSection moreBetterSection);
 
     /**
      * 다다익선 업체분담율(TB_TMTB_BURDEN) 저장
-     * @param MoreBetter
+     * @param moreBetterBurden
      * @return
      * @author bin2107
      * @since 2020. 12. 28
      */
-    void saveMorebetterBurden(MoreBetterBurden regBurden);
+    void saveMorebetterBurden(MoreBetterBurden moreBetterBurden);
 
     /**
      * 다다익선 공급업체(TB_TMTB_GOODS) 삭제
-     * @param MoreBetter
+     * @param moreBetterGoods
      * @return
      * @author bin2107
      * @since 2021. 1. 12
@@ -126,7 +135,7 @@ public interface TsaMorebetterDao {
 
     /**
      * 다다익선 브랜드(TB_TMTB_GOODS) 삭제
-     * @param MoreBetter
+     * @param moreBetterGoods
      * @return
      * @author bin2107
      * @since 2021. 1. 12
@@ -135,7 +144,7 @@ public interface TsaMorebetterDao {
 
     /**
      * 다다익선 적용상품(TB_TMTB_GOODS) 삭제
-     * @param MoreBetter
+     * @param moreBetterGoods
      * @return
      * @author bin2107
      * @since 2021. 1. 12
@@ -144,7 +153,7 @@ public interface TsaMorebetterDao {
 
     /**
      * 다다익선 제외상품(TB_TMTB_GOODS) 삭제
-     * @param MoreBetter
+     * @param moreBetterGoods
      * @return
      * @author bin2107
      * @since 2021. 1. 12
@@ -153,7 +162,7 @@ public interface TsaMorebetterDao {
 
     /**
      * 다다익선 할인구간설정(TB_TMTB_SECTION) 삭제
-     * @param MoreBetter
+     * @param moreBetterSection
      * @return
      * @author bin2107
      * @since 2021. 1. 6
@@ -162,7 +171,7 @@ public interface TsaMorebetterDao {
 
     /**
      * 다다익선 조건에 따른 할인혜택(금액할인) 설정(TB_TMTB_VAL) 삭제
-     * @param MoreBetter
+     * @param moreBetterSection
      * @return
      * @author bin2107
      * @since 2021. 1. 6
@@ -171,7 +180,7 @@ public interface TsaMorebetterDao {
 
     /**
      * 다다익선 업체분담율(TB_TMTB_BURDEN) 삭제
-     * @param MoreBetter
+     * @param moreBetterBurden
      * @return
      * @author bin2107
      * @since 2021. 1. 12

+ 17 - 9
src/main/java/com/style24/admin/biz/dao/TsaRendererDao.java

@@ -204,15 +204,6 @@ public interface TsaRendererDao {
 	 */
 	Collection<CommonCode> getQnaAnswerPhaseList(String ansClsf);
 
-//	/**
-//	 * 제휴링크 목록
-//	 * @param afChannel - 제휴채널
-//	 * @return
-//	 * @author gagamel
-//	 * @since 2020. 5. 4
-//	 */
-//	Collection<CommonCode> getAflinkList(String afChannel);
-
 	/**
 	 * 색상그룹코드 RGB 목록
 	 *
@@ -233,4 +224,21 @@ public interface TsaRendererDao {
 	 */
 	Collection<CommonCode> getSupplyDeliveryFeePolicyList(String supplyCompCd);
 
+	/**
+	 * 전체 제휴채널 목록
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 20
+	 */
+	Collection<CommonCode> getAllAflinkList();
+
+	/**
+	 * 제휴채널 목록
+	 * @param afChannel - 상위제휴채널
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 20
+	 */
+	Collection<CommonCode> getAflinkList(String afChannel);
+
 }

+ 26 - 0
src/main/java/com/style24/admin/biz/dao/TsaSettleDao.java

@@ -0,0 +1,26 @@
+package com.style24.admin.biz.dao;
+
+import java.util.Collection;
+
+import com.style24.core.support.annotation.ShopDs;
+import com.style24.persistence.domain.AflinkFee;
+
+/**
+ * 정산 Dao
+ *
+ * @author gagamel
+ * @since 2021. 1. 20
+ */
+@ShopDs
+public interface TsaSettleDao {
+
+	/**
+	 * 제휴채널정산 목록
+	 * @param afLinkFee - 제휴채널정산 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 20
+	 */
+	Collection<AflinkFee> getAfLinkFeeList(AflinkFee afLinkFee);
+
+}

+ 244 - 82
src/main/java/com/style24/admin/biz/service/TsaCouponService.java

@@ -8,6 +8,7 @@ import java.util.Date;
 
 import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
+import com.style24.persistence.domain.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -17,7 +18,6 @@ import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.style24.admin.biz.dao.TsaCouponDao;
 import com.style24.admin.support.security.session.TsaSession;
-import com.style24.persistence.domain.Coupon;
 
 import lombok.extern.slf4j.Slf4j;
 
@@ -37,9 +37,6 @@ public class TsaCouponService {
 	@Autowired
 	private TsaCommonService commonService;
 
-
-
-
 	/**
 	 * 쿠폰 저장
 	 * @param params
@@ -47,14 +44,14 @@ public class TsaCouponService {
 	 * @since  2021-01-11
 	 */
 	@Transactional("shopTxnManager")
-	public void couponSave(Coupon params) {
+	public void saveCoupon(Coupon params) {
 		String cpnId = "";		// 쿠폰ID
 
 		params.setRegNo(TsaSession.getInfo().getUserNo());
 		params.setUpdNo(TsaSession.getInfo().getUserNo());
 
 		// 자동생성이면 시퀀스 가져오기
-		/*if(StringUtils.isBlank(params.getCpnId())) {
+		if(StringUtils.isBlank(params.getCpnId())) {
 			Integer sequence = commonService.getNextSequence("SEQ_COUPON");
 			cpnId = "CPN"+sequence;
 		} else {
@@ -63,21 +60,107 @@ public class TsaCouponService {
 		params.setCpnId(cpnId);
 
 		couponDao.couponInsert(params);
-		*/
+
 		Gson gson = new Gson();
+		Integer sequence;
+		// 적용대상 - 공급업체
+		Collection<CouponRefval> supplyCompList = gson.fromJson(params.getSupplyCompList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
+		for(CouponRefval supplyComp : supplyCompList) {
+			sequence = null;
 
-		Collection<Coupon>	supplyCompList = gson.fromJson(params.getSupplyCompList() , new TypeToken<Collection<Coupon>>(){}.getType());
-		for(Coupon supplyComp : supplyCompList) {
-		//	couponDao.couponRefValInsert(supplyComp);
+			if(supplyComp.getCpnRefvalSq() != null && supplyComp.getCpnRefvalSq() > 0){
+				sequence = supplyComp.getCpnRefvalSq();
+			}
+
+			supplyComp.setCpnId(cpnId);
+			supplyComp.setCpnRefvalSq(sequence);
+			supplyComp.setCpnTarget("G260_13");
+			supplyComp.setRefVal(supplyComp.getSupplyCompCd());
+			supplyComp.setRegNo(TsaSession.getInfo().getUserNo());
+			supplyComp.setUpdNo(TsaSession.getInfo().getUserNo());
+			couponDao.saveCouponRefVal(supplyComp);
 		}
-		Collection<Coupon> brandList = gson.fromJson(params.getBrandList() , new TypeToken<Collection<Coupon>>(){}.getType());
-		Collection<Coupon> applyGoodsList = gson.fromJson(params.getApplyGoodsList() , new TypeToken<Collection<Coupon>>(){}.getType());
-		Collection<Coupon> cateList = gson.fromJson(params.getCateList() , new TypeToken<Collection<Coupon>>(){}.getType());
-		Collection<Coupon> exceptGoodsList = gson.fromJson(params.getExceptGoodsList() , new TypeToken<Collection<Coupon>>(){}.getType());
-		Collection<Coupon> burdenList = gson.fromJson(params.getBurdenList() , new TypeToken<Collection<Coupon>>(){}.getType());
+		// 적용대상 - 브랜드
+		Collection<CouponRefval> brandList = gson.fromJson(params.getBrandList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
+		for(CouponRefval brand : brandList) {
+			sequence = null;
 
-		//checkCpnValidation(params);
+			if(brand.getCpnRefvalSq() != null && brand.getCpnRefvalSq() > 0){
+				sequence = brand.getCpnRefvalSq();
+			}
 
+			brand.setCpnId(cpnId);
+			brand.setCpnRefvalSq(sequence);
+			brand.setCpnTarget("G260_12");
+			brand.setRefVal(brand.getBrandCd());
+			brand.setRegNo(TsaSession.getInfo().getUserNo());
+			brand.setUpdNo(TsaSession.getInfo().getUserNo());
+
+			couponDao.saveCouponRefVal(brand);
+		}
+		// 적용대상 - 적용상품
+		Collection<CouponRefval> applyGoodsList = gson.fromJson(params.getApplyGoodsList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
+		for(CouponRefval applyGoods : applyGoodsList ) {
+			sequence = null;
+
+			if(applyGoods.getCpnRefvalSq() != null && applyGoods.getCpnRefvalSq() > 0){
+				sequence = applyGoods.getCpnRefvalSq();
+			}
+			applyGoods.setCpnId(cpnId);
+			applyGoods.setCpnRefvalSq(sequence);
+			applyGoods.setCpnTarget("G260_10");
+			applyGoods.setRefVal(applyGoods.getGoodsCd());
+			applyGoods.setRegNo(TsaSession.getInfo().getUserNo());
+			applyGoods.setUpdNo(TsaSession.getInfo().getUserNo());
+
+			couponDao.saveCouponRefVal(applyGoods);
+		}
+		// 적용대상 - 카테고리
+		Collection<CouponRefval> cateList = gson.fromJson(params.getCateList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
+		for(CouponRefval cate : cateList ) {
+			sequence = null;
+
+			if(cate.getCpnRefvalSq() != null && cate.getCpnRefvalSq() > 0){
+				sequence = cate.getCpnRefvalSq();
+			}
+			cate.setCpnId(cpnId);
+			cate.setCpnRefvalSq(sequence);
+			cate.setCpnTarget("G260_11");
+			cate.setRefVal(cate.getCateNo());
+			cate.setRefFormalGb(cate.getFormalGb());
+			cate.setRefBrandCd(cate.getBrandCd());		// ag-grid 브랜드코드
+			cate.setRegNo(TsaSession.getInfo().getUserNo());
+			cate.setUpdNo(TsaSession.getInfo().getUserNo());
+
+			couponDao.saveCouponRefVal(cate);
+		}
+		// 적용대상 - 제외상품
+		Collection<CouponRefval> exceptGoodsList = gson.fromJson(params.getExceptGoodsList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
+		for(CouponRefval exceptGoods: exceptGoodsList ) {
+			sequence = null;
+
+			if(exceptGoods.getCpnRefvalSq() != null && exceptGoods.getCpnRefvalSq() > 0){
+				sequence = exceptGoods.getCpnRefvalSq();
+			}
+
+			exceptGoods.setCpnId(cpnId);
+			exceptGoods.setCpnRefvalSq(sequence);
+			exceptGoods.setCpnTarget("G260_14");
+			exceptGoods.setRefVal(exceptGoods.getGoodsCd());
+			exceptGoods.setRegNo(TsaSession.getInfo().getUserNo());
+			exceptGoods.setUpdNo(TsaSession.getInfo().getUserNo());
+
+			couponDao.saveCouponRefVal(exceptGoods);
+		}
+		// 입점업체분담율
+		Collection<CouponBurden> burdenList = gson.fromJson(params.getBurdenList() , new TypeToken<Collection<CouponBurden>>(){}.getType());
+		for(CouponBurden burden: burdenList ) {
+			burden.setCpnId(cpnId);
+			burden.setRegNo(TsaSession.getInfo().getUserNo());
+			burden.setUpdNo(TsaSession.getInfo().getUserNo());
+
+			couponDao.saveCouponBurden(burden);
+		}
 	}
 
 	/**
@@ -103,85 +186,164 @@ public class TsaCouponService {
 	}
 
 	/**
-	 * 쿠폰 벨리데이션 체크
-	 * @param params
+	 * 쿠폰조회 목록
+	 * @param coupon - 쿠폰 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 8
+	 */
+	public Collection<Coupon> getCouponRetrieveList(Coupon coupon) {
+		return couponDao.getCouponRetrieveList(coupon);
+	}
+
+	/**
+	 * 쿠폰조회 목록
+	 * @param
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 8
+	 */
+	public Collection<CommonCode> getSelfBrandList() {
+		return couponDao.getSelfBrandList();
+	}
+
+	/**
+	 * 쿠폰 상세 조회
+	 * @param  cpnId
+	 * @return Coupon
 	 * @author xyzp1539
-	 * @since  2021-01-12
+	 * @since 2021-01-15
 	 */
-	public void checkCpnValidation(Coupon params) {
-		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-		// 할인율이면  100% 초과 체크하기
-		if(params.getDcWay() != null && params.getDcWay().equals("G240_11")) {
-			if(params.getDcAval() > 100) {
-				throw new IllegalStateException("모바일 앱 할인율은 100을 초과할수 없습니다.");
-			} else if(params.getDcPval() > 100) {
-				throw new IllegalStateException("PC할인율은 100을 초과할수 없습니다.");
-			} else if(params.getDcMval() > 100) {
-				throw new IllegalStateException("모바일 웹 100을 초과할수 없습니다.");
-			}
-		}
+    public Coupon getCouponDetail(String cpnId) { return couponDao.getCouponDetail(cpnId);}
 
-		// 기간/일수구분이 일수인 경우 날짜 체크
-		if(params.getPdGb() != null && params.getPdGb().equals("D")) {
-			try {
-				Date date1 = format.parse(params.getAvailStdt());
-				Date date2 = format.parse(params.getAvailEddt());
-
-				log.info("checkCpnValidation params.getAvailEddt() :  {}" , params.getAvailEddt());
-				log.info("checkCpnValidation params.getAvailStdt :  {}" , params.getAvailStdt());
-				if(date2.before(date1)) {
-					throw new IllegalStateException("유효기간 종료날짜가 시작날짜보다 작습니다.");
-				}
-			} catch (ParseException exception) {
-			}
-		}
+	/**
+	 * 쿠폰 발급 개수 조회
+	 * @param  cpnId
+	 * @return  cnt
+	 * @author xyzp1539
+	 * @since 2021-01-15
+	 */
+	public int getCouponIssueCnt(String cpnId) {
+		return couponDao.getCouponIssueCnt(cpnId);
+	}
 
-		// 직접다운로드인 경우 기간 체크
-		if(params.getDnGb() != null && params.getDnGb().equals("G058_20")) {
-			try {
-				Date date1 = format.parse(params.getDownStdt());
-				Date date2 = format.parse(params.getDownEddt());
-
-				log.info("checkCpnValidation params.getDownStdt() :  {}" , params.getDownStdt());
-				log.info("checkCpnValidation params.getDownEddt :  {}" , params.getDownEddt());
-				if(date2.before(date1)) {
-					throw new IllegalStateException("다운로드 종료날짜가 시작날짜보다 작습니다.");
-				}
-			} catch (ParseException exception) {
-			}
-		}
+	/**
+	 * 쿠폰 적용 대상 - 제외상품
+	 * @param  cpnId
+	 * @return Coupon
+	 * @author xyzp1539
+	 * @since 2021-01-18
+	 */
+	public ArrayList<CouponRefval> getCouponRefvalExceptGoodsList(String cpnId ) {
+		CouponRefval cpnRefval = new CouponRefval();
+		cpnRefval.setCpnId(cpnId);
+		cpnRefval.setCpnTarget("G260_14");
+		return couponDao.getCouponRefvalExceptGoodsList(cpnRefval);
+	}
 
-		// 첫구매 적용하는 경우 날짜 체크
-		if(params.getFirstYn() != null && params.getFirstYn().equals("Y")) {
-			try {
-				Date date1 = format.parse(params.getBuyStdt());
-				Date date2 = format.parse(params.getBuyEddt());
-
-				log.info("checkCpnValidation params.getBuyStdt() :  {}" , params.getBuyStdt());
-				log.info("checkCpnValidation params.getBuyEddt :  {}" , params.getBuyEddt());
-				if(date2.before(date1)) {
-					throw new IllegalStateException("첫구매 종료날짜가 시작날짜보다 작습니다.");
-				}
-			} catch (ParseException exception) {
-			}
-		}
+	/**
+	 * 쿠폰 적용 대상 - 브랜드
+	 * @param cpnId
+	 * @return Coupon
+	 * @author xyzp1539
+	 * @since 2021-01-18
+	 */
+	public ArrayList<CouponRefval> getCouponRefvalBrandList(String cpnId ) {
+		CouponRefval cpnRefval = new CouponRefval();
+		cpnRefval.setCpnId(cpnId);
+		cpnRefval.setCpnTarget("G260_12");
+		return couponDao.getCouponRefvalBrandList(cpnRefval);
+	}
 
-		// 신규회원여부 적용하는 경우 날짜 체크
-		if(params.getCustJoinYn() != null && params.getCustJoinYn().equals("Y")) {
+	/**
+	 * 쿠폰 적용 대상 - 카테고리
+	 * @param cpnId
+	 * @return Coupon
+	 * @author xyzp1539
+	 * @since 2021-01-18
+	 */
+	public ArrayList<CouponRefval> getCouponRefvalCategoryList(String cpnId) {
+		CouponRefval cpnRefval = new CouponRefval();
+		cpnRefval.setCpnId(cpnId);
+		cpnRefval.setCpnTarget("G260_11");
+		return couponDao.getCouponRefvalCategoryList(cpnRefval);
+	}
 
-		}
+	/**
+	 * 쿠폰 적용 대상 - 적용상품
+	 * @param  cpnId
+	 * @return Coupon
+	 * @author xyzp1539
+	 * @since 2021-01-18
+	 */
+	public ArrayList<CouponRefval> getCouponRefvalGoodsList(String cpnId , String cpnTarget) {
+		CouponRefval cpnRefval = new CouponRefval();
+		cpnRefval.setCpnId(cpnId);
+		cpnRefval.setCpnTarget(cpnTarget);
+		return couponDao.getCouponRefvalGoodsList(cpnRefval);
+	}
 
+	/**
+	 * 쿠폰 적용 대상 - 공급처
+	 * @param cpnId
+	 * @return Coupon
+	 * @author xyzp1539
+	 * @since 2021-01-18
+	 */
+	public ArrayList<CouponRefval> getCouponRefvalSupplyCompList(String cpnId) {
+		CouponRefval cpnRefval = new CouponRefval();
+		cpnRefval.setCpnId(cpnId);
+		cpnRefval.setCpnTarget("G260_13");
+		return couponDao.getCouponRefvalSupplyCompList(cpnRefval);
 	}
 
 	/**
-	 * 쿠폰조회 목록
-	 * @param coupon - 쿠폰 정보
+	 * 쿠폰 입점업체 분담율 조회
+	 * @param  
+	 * @return 
+	 * @author xyzp1539
+	 * @since 2021-01-18
+	 */
+	public ArrayList<Coupon> getCouponBurdenList(String cpnId) {
+		return couponDao.getCouponBurdenList(cpnId);
+	}
+
+	/**
+	 * 쿠폰 적용대상 삭제
+	 * @param   couponRefval
 	 * @return
-	 * @author gagamel
-	 * @since 2021. 1. 8
+	 * @author xyzp1539
+	 * @since 2021-01-19
 	 */
-	public Collection<Coupon> getCouponRetrieveList(Coupon coupon) {
-		return couponDao.getCouponRetrieveList(coupon);
+	@Transactional("shopTxnManager")
+	public void updateCouponRefval(CouponRefval couponRefval) {
+		couponRefval.setUpdNo(TsaSession.getInfo().getUserNo());
+		couponDao.updateCouponRefval(couponRefval);
 	}
 
+	/**
+	 * 고객 쿠폰
+	 * @param
+	 * @return
+	 * @author xyzp1539
+	 * @since 2021-01-21
+	 */
+	@Transactional("shopTxnManager")
+	public void saveCouponCustPub(CustCoupon custCoupon) {
+		Gson gson = new Gson();
+
+		Collection<CustCoupon> custPubList = gson.fromJson(custCoupon.getCustList() , new TypeToken<Collection<CustCoupon>>(){}.getType());
+		for(CustCoupon custPub : custPubList ) {
+			custPub.setCpnId(custCoupon.getCpnId());
+			custPub.setAvailStdt(custCoupon.getAvailStdt());
+			custPub.setAvailEddt(custCoupon.getAvailEddt());
+			custPub.setPubReason(custCoupon.getPubReason());
+			custPub.setPubReasonDtl(custCoupon.getPubReasonDtl());
+			custPub.setEndAlimSendYn(custCoupon.getEndAlimSendYn());
+			custPub.setRegNo(TsaSession.getInfo().getUserNo());
+			custPub.setUpdNo(TsaSession.getInfo().getUserNo());
+
+			couponDao.saveCouponCustPub(custPub);
+		}
+	}
 }

+ 35 - 0
src/main/java/com/style24/admin/biz/service/TsaCustomerService.java

@@ -1,11 +1,15 @@
 package com.style24.admin.biz.service;
 
 import com.style24.admin.biz.dao.TsaCustomerDao;
+import com.style24.admin.support.security.session.TsaSession;
+import com.style24.core.biz.dao.TscCustomerDao;
+import com.style24.core.biz.service.TscCustomerService;
 import com.style24.persistence.domain.Customer;
 import com.style24.persistence.domain.CustomerSearch;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.Collection;
 
@@ -22,6 +26,9 @@ public class TsaCustomerService {
 	@Autowired
 	private TsaCustomerDao customerDao;
 
+	@Autowired
+	private TscCustomerService coreCustomerService;
+
 	/**
 	 * 활동회원 목록
 	 * @param customerSearch - 검색조건
@@ -44,6 +51,34 @@ public class TsaCustomerService {
 		return customerDao.getCustomerInfo(custNo);
 	}
 
+	/**
+	 * 회원정보 수정
+	 * @param customer - 고객정보
+	 * @author jsshin
+	 * @since 2020. 01. 20
+	 */
+	@Transactional("shopTxnManager")
+	public void saveCustomerInfo(Customer customer) {
+		Integer userNo = TsaSession.getInfo().getUserNo();
+		customer.setRegNo(userNo);
+		customer.setUpdNo(userNo);
+		// 고객 이력 생성
+		coreCustomerService.createCustomerHistory(customer);
+		// 정보 수정
+		customerDao.updateCustomerInfo(customer);
+	}
+
+	/**
+	 * 회원 비밀번호 수정
+	 * @param customer - 고객정보
+	 * @author jsshin
+	 * @since 2020. 01. 20
+	 */
+	@Transactional("shopTxnManager")
+	public void updateCustomerPassword(Customer customer) {
+		coreCustomerService.updateCustomerPassword(customer);
+	}
+
 	/**
 	 * 탈퇴회원 목록
 	 * @param customerSearch - 검색조건

+ 39 - 29
src/main/java/com/style24/admin/biz/service/TsaGoodsService.java

@@ -4,11 +4,11 @@ import java.io.IOException;
 import java.text.SimpleDateFormat;
 import java.util.Collection;
 
+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 org.springframework.util.StringUtils;
 
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -233,7 +233,7 @@ public class TsaGoodsService {
 			throw new IllegalStateException(message.getMessage("FAIL_1001"));
 
 		for (NotiInfo notiInfo : notiInfoList) {
-			if (!StringUtils.isEmpty(notiInfo.getNiContent())) {
+			if (!StringUtils.isBlank(notiInfo.getNiContent())) {
 				notiInfo.setNiContent(GagaStringUtil.replace(GagaStringUtil.replace(notiInfo.getNiContent(),"&lt;", "<"),"&gt;", ">"));
 			}
 			notiInfo.setRegNo(TsaSession.getInfo().getUserNo());
@@ -398,7 +398,7 @@ public class TsaGoodsService {
 			Collection<GagaMap> dataList = goodsDao.getGoodsInfoExcelList(goodsSearch); // map형식으로 조회
 			if (dataList != null && !dataList.isEmpty()) {
 				for (GagaMap gagaMap : dataList) {
-					if (!StringUtils.isEmpty(gagaMap.get("SYS_IMG_NM").toString()) ) {
+					if (!StringUtils.isBlank(gagaMap.get("SYS_IMG_NM").toString()) ) {
 						gagaMap.set("SYS_IMG_NM", targetPath + '/' +  gagaMap.get("SYS_IMG_NM").toString());
 					}
 				}
@@ -517,6 +517,11 @@ public class TsaGoodsService {
 		String goodsMobileDownDesc = this.getGoodsDescList(goods);
 		resultGoods.setGoodsMobileDownDesc(goodsMobileDownDesc);
 
+		// 상품 상세 (as-is)
+		goods.setDescGb("80");
+		String goodsDesc = this.getGoodsDescList(goods);
+		resultGoods.setGoodsDesc(goodsDesc);
+
 		return resultGoods;
 	}
 
@@ -699,8 +704,8 @@ public class TsaGoodsService {
 					brand.setBrandCd(originGoods.getBrandCd());
 					Collection<Brand> brandList = businessService.getBrandList(brand);
 					if (brandList != null && !brandList.isEmpty()) {
-						float pntPrate = 0;
-						float pntMrate = 0;
+						float pntPrate = 0f;
+						float pntMrate = 0f;
 						for (Brand tmpBrand : brandList) {
 							if ("G009_10".equals(goods.getFormalGb())) {
 								pntPrate = tmpBrand.getPntPrate10();
@@ -740,8 +745,8 @@ public class TsaGoodsService {
 				brand.setBrandCd(originGoods.getBrandCd());
 				Collection<Brand> brandList = businessService.getBrandList(brand);
 				if (brandList != null && !brandList.isEmpty()) {
-					float pntPrate = 0;
-					float pntMrate = 0;
+					float pntPrate = 0f;
+					float pntMrate = 0f;
 					for (Brand tmpBrand : brandList) {
 						if ("G009_10".equals(goods.getFormalGb())) {
 							pntPrate = tmpBrand.getPntPrate10();
@@ -783,11 +788,11 @@ public class TsaGoodsService {
 		String goodsNumFlag = "";
 		for (Goods goods : goodsList) {
 
-			if (!StringUtils.isEmpty(goodsCdFlag) && !StringUtils.isEmpty(goodsNumFlag)) {
+			if (!StringUtils.isBlank(goodsCdFlag) && !StringUtils.isBlank(goodsNumFlag)) {
 				throw new IllegalStateException("상품코드와 원코드 중 한 개의 셀에만 값을 입력해서 조회하세요.");
 			}
 
-			if (!StringUtils.isEmpty(goods.getSupplyCompCd())) {
+			if (!StringUtils.isBlank(goods.getSupplyCompCd())) {
 				goods.setGoodsCd(goods.getSupplyCompCd());
 			}
 
@@ -852,7 +857,7 @@ public class TsaGoodsService {
 			// 검색어 변경
 			String goodsSnm = goodsDao.getGoodsSnm(goods.getGoodsCd());
 			Goods tmpGoods = goodsDao.getGoods(goods);
-			if (tmpGoods != null && !StringUtils.isEmpty(tmpGoods.getGoodsSnm1())) {
+			if (tmpGoods != null && !StringUtils.isBlank(tmpGoods.getGoodsSnm1())) {
 				String[] arrGoodsSnm = tmpGoods.getGoodsSnm1().split(";");
 				StringBuilder tempGoodsSnm = new StringBuilder();
 				for (String loopGoodsSnm : arrGoodsSnm) {
@@ -948,6 +953,7 @@ public class TsaGoodsService {
 		goods.setRegNo(TsaSession.getInfo().getUserNo());
 		goods.setUpdNo(TsaSession.getInfo().getUserNo());
 
+		goods.setGoodsDesc(GagaStringUtil.replace(GagaStringUtil.replace(goods.getGoodsDesc(), "&lt;", "<"), "&gt;", ">"));
 		goods.setGoodsPcTopDesc(GagaStringUtil.replace(GagaStringUtil.replace(goods.getGoodsPcTopDesc(), "&lt;", "<"), "&gt;", ">"));
 		goods.setGoodsMobileTopDesc(GagaStringUtil.replace(GagaStringUtil.replace(goods.getGoodsMobileTopDesc(), "&lt;", "<"), "&gt;", ">"));
 		goods.setGoodsPcDownDesc(GagaStringUtil.replace(GagaStringUtil.replace(goods.getGoodsPcDownDesc(), "&lt;", "<"), "&gt;", ">"));
@@ -1001,7 +1007,7 @@ public class TsaGoodsService {
 		}
 		// 사용자 검색어를 검색어에 적용
 		String goodsSnm = goodsDao.getGoodsSnm(goods.getGoodsCd());
-		if (!StringUtils.isEmpty(goods.getGoodsSnm1())) {
+		if (!StringUtils.isBlank(goods.getGoodsSnm1())) {
 			goods.setGoodsSnm1(GagaStringUtil.replace(goods.getGoodsSnm1(), " ", "")); // 빈값 삭제
 			String[] arrGoodsSnm = goods.getGoodsSnm1().split(";");
 			StringBuilder tempGoodsSnm = new StringBuilder();
@@ -1024,8 +1030,8 @@ public class TsaGoodsService {
 				brand.setBrandCd(goods.getBrandCd());
 				Collection<Brand> brandList = businessService.getBrandList(brand);
 				if (brandList != null && !brandList.isEmpty()) {
-					float pntPrate = 0.0f;
-					float pntMrate = 0.0f;
+					float pntPrate = 0f;
+					float pntMrate = 0f;
 					for (Brand tmpBrand : brandList) {
 						if ("G009_10".equals(goods.getFormalGb())) {
 							pntPrate = tmpBrand.getPntPrate10();
@@ -1102,7 +1108,7 @@ public class TsaGoodsService {
 	 * @since 2020. 10. 27.
 	 */
 	private void saveGoodsDetailDesc(Goods goods) {
-		// 상품상세 구분(10:상품타이틀,20:상품타이틀내용,30:상품특징,40:상위컨텐츠,50:하위컨텐츠,60:하위컨텐츠-모바일,70:상위컨텐츠-모바일)
+		// 상품상세 구분(10:상품타이틀,20:상품타이틀내용,30:상품특징,40:상위컨텐츠,50:하위컨텐츠,60:하위컨텐츠-모바일,70:상위컨텐츠-모바일,80:상품상세(as-is))
 		GoodsDesc goodsDesc = new GoodsDesc();
 		goodsDesc.setGoodsCd(goods.getGoodsCd());
 		goodsDesc.setRegNo(goods.getRegNo());
@@ -1146,6 +1152,10 @@ public class TsaGoodsService {
 		goodsDesc.setGoodsDesc(goods.getGoodsMobileDownDesc());
 		this.saveGoodsDesc(goodsDesc);
 
+		// 상품상세(as-is,입점
+		goodsDesc.setDescGb("80");
+		goodsDesc.setGoodsDesc(goods.getGoodsDesc());
+		this.saveGoodsDesc(goodsDesc);
 	}
 
 	/**
@@ -1376,7 +1386,7 @@ public class TsaGoodsService {
 			Goods extendGoods = new Goods();
 			extendGoods.setGoodsCd(goodsCompose.getCompsGoodsCd());
 			extendGoods = goodsDao.getGoods(extendGoods);
-			if (StringUtils.isEmpty(extendGoods.getBrandCd())) {
+			if (StringUtils.isBlank(extendGoods.getBrandCd())) {
 				throw new IllegalStateException(message.getMessage("구성상품 중 " + goodsCompose.getCompsGoodsCd() + " 상품 정보를 확인해 주세요."));
 			}
 
@@ -1449,7 +1459,7 @@ public class TsaGoodsService {
 			Goods extendGoods = new Goods();
 			extendGoods.setGoodsCd(goodsCompose.getCompsGoodsCd());
 			extendGoods = goodsDao.getGoods(extendGoods);
-			if (StringUtils.isEmpty(extendGoods.getBrandCd())) {
+			if (StringUtils.isBlank(extendGoods.getBrandCd())) {
 				throw new IllegalStateException(message.getMessage("구성상품 중 " + goodsCompose.getCompsGoodsCd() + " 상품 정보를 확인해 주세요."));
 			}
 			listPriceSum += extendGoods.getListPrice() * goodsCompose.getQty() ;
@@ -1490,9 +1500,9 @@ public class TsaGoodsService {
 			throw new IllegalStateException(message.getMessage("구성상품 중 기준 상품의 브랜드를 확인해 주세요."));
 		}
 
-		float pntPrate = 0.0f;
-		float pntMrate = 0.0f;
-		float sellFeeRate = 0.0f;
+		float pntPrate = 0f;
+		float pntMrate = 0f;
+		float sellFeeRate = 0f;
 		String delvFeeCd = "";
 		for (Brand tmpBrand : brandList) {
 
@@ -1672,7 +1682,7 @@ public class TsaGoodsService {
 			goods.setRegNo(TsaSession.getInfo().getUserNo());
 			goods.setUpdNo(TsaSession.getInfo().getUserNo());
 
-			if (!StringUtils.isEmpty(goods.getGoodsTnm()) && !goods.getGoodsTnm().equals(goods.getGoodTnmInit())) {
+			if (!StringUtils.isBlank(goods.getGoodsTnm()) && !goods.getGoodsTnm().equals(goods.getGoodTnmInit())) {
 
 				// 상품이력 먼저 쌓기
 				goodsDao.createGoodsHst(goods);
@@ -1891,7 +1901,7 @@ public class TsaGoodsService {
 			noticeService.updateNotice(notice);
 		}
 
-		if (!StringUtils.isEmpty(notice.getGoodsList())) {
+		if (!StringUtils.isBlank(notice.getGoodsList())) {
 			Collection<NoticeGoods> noticeGoodsList = null;
 			try {
 				noticeGoodsList = mapper.readValue(notice.getGoodsList(), new TypeReference<Collection<NoticeGoods>>() {
@@ -2076,10 +2086,10 @@ public class TsaGoodsService {
 		int cnt = 0;
 		for (GoodsPriceRes goodsPriceRes : goodsPriceList) {
 
-			if (StringUtils.isEmpty(goodsPriceRes.getGoodsCd())) {
+			if (StringUtils.isBlank(goodsPriceRes.getGoodsCd())) {
 				return (cnt + 2) + "행의 상품코드를 확인해주세요";
 			}
-			if (StringUtils.isEmpty(goodsPriceRes.getResGoodsPrice())) {
+			if (StringUtils.isBlank(Integer.toString(goodsPriceRes.getResGoodsPrice()))) {
 				return (cnt + 2) + "행의 예약가격을 확인해주세요.";
 			}
 			if (goodsPriceRes.getResGoodsPrice() <= 0) {
@@ -2179,7 +2189,7 @@ public class TsaGoodsService {
 		if (video.getVideoSq() == null ||  video.getVideoSq() == 0) {
 
 			String videoSeq = goodsDao.getVideoSeq(video);
-			if (StringUtils.isEmpty(videoSeq)) {
+			if (StringUtils.isBlank(videoSeq)) {
 				goodsDao.createVideo(video);
 			}else {
 				//video.setVideoSq(Integer.parseInt(videoSeq));  //why?
@@ -2190,7 +2200,7 @@ public class TsaGoodsService {
 		if (video.getVideoSq() == null ||  video.getVideoSq() == 0) {
 			String videoSeq = goodsDao.getVideoSeq(video);
 
-			if (!StringUtils.isEmpty(videoSeq)) {
+			if (!StringUtils.isBlank(videoSeq)) {
 				video.setVideoSq(Integer.parseInt(videoSeq));
 			}
 		}
@@ -2230,12 +2240,12 @@ public class TsaGoodsService {
 			}
 			String videoSeq = goodsDao.getVideoSeq(video);
 
-			if (StringUtils.isEmpty(videoSeq)) {
+			if (StringUtils.isBlank(videoSeq)) {
 				goodsDao.createVideo(video);
 			}
 
 			videoSeq = goodsDao.getVideoSeq(video);
-			if (!StringUtils.isEmpty(videoSeq)) {
+			if (!StringUtils.isBlank(videoSeq)) {
 				video.setVideoSq(Integer.parseInt(videoSeq));
 			}
 			goodsDao.saveVideoDispLoc(video);
@@ -2353,7 +2363,7 @@ public class TsaGoodsService {
 
 		// 2. 일 최초 조회이면 테이블 삭제
 		String regYmd  = goodsDao.getGoodsNaverLowestPriceReqYmd();
-		if (!StringUtils.isEmpty(regYmd) && !regYmd.equals(GagaDateUtil.getToday())) {
+		if (!StringUtils.isBlank(regYmd) && !regYmd.equals(GagaDateUtil.getToday())) {
 			goodsDao.deleteGoodsNaverLowestPrice();
 		}
 
@@ -2473,7 +2483,7 @@ public class TsaGoodsService {
 			goodsDao.saveAdKeyword(adKeyword);
 		}
 
-		if (!StringUtils.isEmpty(adKeyword.getGoodsList())) {
+		if (!StringUtils.isBlank(adKeyword.getGoodsList())) {
 			Collection<AdKeywordGoods> adKeywordGoodsList = null;
 			try {
 				adKeywordGoodsList = mapper.readValue(adKeyword.getGoodsList(), new TypeReference<Collection<AdKeywordGoods>>() {

+ 45 - 32
src/main/java/com/style24/admin/biz/service/TsaKakaoService.java

@@ -1,11 +1,19 @@
 package com.style24.admin.biz.service;
 
+import com.gagaframework.web.parameter.GagaMap;
+import com.style24.admin.support.security.session.TsaSession;
+import com.style24.core.biz.service.TscCustomerService;
+import com.style24.core.support.env.TscConstants;
+import com.style24.persistence.domain.CustContactHst;
+import com.style24.persistence.domain.Customer;
+import com.style24.persistence.domain.SsgDirectMessage;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.style24.core.biz.thirdparty.SsgKakaoSender;
 
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * 카카오알림톡 Service. 모든 카카오알림톡 발송은 여기에서 처리한다.
@@ -20,38 +28,43 @@ public class TsaKakaoService {
 	@Autowired
 	private SsgKakaoSender kakaoSender;
 
-//	/**
-//	 * 고객 임시비밀번호 알림톡 발송
-//	 * @param counsel - 상담 정보
-//	 * @author gagamel
-//	 * @since 2020. 11. 9
-//	 */
-//	@Transactional("shopTxnManager")
-//	public void sendCustomerTempPassword(AdmCustomer customer) {
-//		SsgDirectMessage dm = new SsgDirectMessage();
-//		dm.setFuserid(String.valueOf(TsaSession.getInfo().getUserNo())); // 발송자ID
-//		dm.setFdestine(customer.getCellPhnno());
-//		dm.setFkkoresendtype("LMS");
-//
-//		GagaMap replaceInfo = new GagaMap();
-//		replaceInfo.setString("siteNm", customer.getSiteNm());
-//		replaceInfo.setString("custNm", customer.getCustNm());
-//		replaceInfo.setString("passwd", customer.getPasswd());
-//
-//		kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.TempPasswd.value(), dm, replaceInfo);
-//
-//		try {
-//			// 고객접촉이력 정보
-//			customer.setContactType("203"); // 접촉유형:임시비밀번호발급(공통코드G054)
-//			customer.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); // 접촉방법:알림톡+문자(공통코드G055)
-//			customer.setContactContents("고객 임시비밀번호 발송");
-//			customer.setReceiverId(customer.getCustNo());
-//			customerService.createCustomerContactHistory(customer);
-//		} catch (Exception e) {
-//			log.error("error", e);
-//			// Do nothing
-//		}
-//	}
+	@Autowired
+	private TscCustomerService coreCustomerService;
+
+	/**
+	 * 고객 임시비밀번호 알림톡 발송
+	 * @param customer - 고객 정보
+	 * @author jsshin
+	 * @since 2021. 01. 20
+	 */
+	@Transactional("shopTxnManager")
+	public void sendCustomerTempPassword(Customer customer) {
+		Integer userNo = TsaSession.getInfo().getUserNo();
+		SsgDirectMessage dm = new SsgDirectMessage();
+		dm.setFuserid(String.valueOf(userNo)); // 발송자NO
+		dm.setFdestine(customer.getCellPhnno());
+		dm.setFkkoresendtype("LMS");
+
+		GagaMap replaceInfo = new GagaMap();
+		replaceInfo.setString("siteNm", TscConstants.Style24Infomation.SITE_NAME.value());
+		replaceInfo.setString("custNm", customer.getCustNm());
+		replaceInfo.setString("passwd", customer.getPasswd());
+
+		kakaoSender.send(SsgKakaoSender.KakaoAnswerSq.TempPasswd.value(), dm, replaceInfo);
+
+		try {
+			CustContactHst custContactHst = new CustContactHst();
+			custContactHst.setContactType(TscConstants.ContactType.PASSWORD_INFO.value()); // 접촉유형:임시비밀번호발급(공통코드G054)
+			custContactHst.setContactMethod(TscConstants.ContactMethod.KAKAOTALK.value()); // 접촉방법:알림톡+문자(공통코드G055)
+			custContactHst.setContactContents("고객 임시비밀번호 발송");
+			custContactHst.setReceiverNo(customer.getCustNo());
+			custContactHst.setSenderNo(userNo);
+			coreCustomerService.createCustomerContactHistory(custContactHst);
+		} catch (Exception e) {
+			log.error("error", e);
+			// Do nothing
+		}
+	}
 //
 //	/**
 //	 * 일대일문의 답변 알림톡 발송

+ 23 - 7
src/main/java/com/style24/admin/biz/service/TsaMorebetterService.java

@@ -133,7 +133,7 @@ public class TsaMorebetterService {
 
         // <,> replace 처리
         moreBetter.setRegNo(TsaSession.getInfo().getUserNo());
-        moreBetter.setUdpNo(TsaSession.getInfo().getUserNo());
+        moreBetter.setUpdNo(TsaSession.getInfo().getUserNo());
 
         // TMTB 마스터(TB_TMTB) 저장
         morebetterDao.saveMorebetterMst(moreBetter);
@@ -154,7 +154,7 @@ public class TsaMorebetterService {
             regSupplyComp.setGoodsGb("G800_20");
             regSupplyComp.setTargetVal(regSupplyComp.getSupplyCompCd());
             regSupplyComp.setRegNo(moreBetter.getRegNo());
-            regSupplyComp.setUdpNo(moreBetter.getUdpNo());
+            regSupplyComp.setUpdNo(moreBetter.getUpdNo());
 
             morebetterDao.saveMorebetterGoods(regSupplyComp);
         }
@@ -174,7 +174,7 @@ public class TsaMorebetterService {
             regBrand.setGoodsGb("G800_20");
             regBrand.setTargetVal(regBrand.getBrandCd());
             regBrand.setRegNo(moreBetter.getRegNo());
-            regBrand.setUdpNo(moreBetter.getUdpNo());
+            regBrand.setUpdNo(moreBetter.getUpdNo());
 
             morebetterDao.saveMorebetterGoods(regBrand);
         }
@@ -190,12 +190,20 @@ public class TsaMorebetterService {
                 tmtbGoodsSq =  commonService.getNextSequence("SEQ_TMTB_GOODS");
                 regApplyGoods.setTmtbGoodsSq(tmtbGoodsSq);
             }
+
+            log.info("regApplyGoods.getTmtbApplyGoodsSq = {}",regApplyGoods.getTmtbApplyGoodsSq());
+            Integer tmtbApplyGoodsSq = regApplyGoods.getTmtbApplyGoodsSq();
+            if(tmtbApplyGoodsSq == null){
+                tmtbApplyGoodsSq =  commonService.getNextSequence("SEQ_TMTB_APPLY_GOODS");
+                regApplyGoods.setTmtbApplyGoodsSq(tmtbApplyGoodsSq);
+            }
             regApplyGoods.setTmtbSq(moreBetter.getTmtbSq());
             regApplyGoods.setTargetVal(regApplyGoods.getGoodsCd());
             regApplyGoods.setRegNo(moreBetter.getRegNo());
-            regApplyGoods.setUdpNo(moreBetter.getUdpNo());
+            regApplyGoods.setUpdNo(moreBetter.getUpdNo());
 
             morebetterDao.saveMorebetterGoods(regApplyGoods);
+            morebetterDao.saveMorebetterApplyGoods(regApplyGoods);
         }
 
         // 제외상품
@@ -209,12 +217,20 @@ public class TsaMorebetterService {
                 tmtbGoodsSq =  commonService.getNextSequence("SEQ_TMTB_GOODS");
                 regExceptGoods.setTmtbGoodsSq(tmtbGoodsSq);
             }
+
+            log.info("regExceptGoods.getTmtbApplyGoodsSq = {}",regExceptGoods.getTmtbApplyGoodsSq());
+            Integer tmtbApplyGoodsSq = regExceptGoods.getTmtbApplyGoodsSq();
+            if(tmtbApplyGoodsSq == null){
+                tmtbApplyGoodsSq =  commonService.getNextSequence("SEQ_TMTB_APPLY_GOODS");
+                regExceptGoods.setTmtbApplyGoodsSq(tmtbApplyGoodsSq);
+            }
             regExceptGoods.setTmtbSq(moreBetter.getTmtbSq());
             regExceptGoods.setTargetVal(regExceptGoods.getGoodsCd());
             regExceptGoods.setRegNo(moreBetter.getRegNo());
-            regExceptGoods.setUdpNo(moreBetter.getUdpNo());
+            regExceptGoods.setUpdNo(moreBetter.getUpdNo());
 
             morebetterDao.saveMorebetterGoods(regExceptGoods);
+            morebetterDao.saveMorebetterApplyGoods(regExceptGoods);
         }
 
         // 다다익선 할인구간 저장
@@ -239,7 +255,7 @@ public class TsaMorebetterService {
             }
             regSection.setTmtbSq(moreBetter.getTmtbSq());
             regSection.setRegNo(moreBetter.getRegNo());
-            regSection.setUdpNo(moreBetter.getUdpNo());
+            regSection.setUpdNo(moreBetter.getUpdNo());
 
             morebetterDao.saveMorebetterSection(regSection);
             morebetterDao.saveMorebetterVal(regSection);
@@ -257,7 +273,7 @@ public class TsaMorebetterService {
             }
             regBurden.setTmtbSq(moreBetter.getTmtbSq());
             regBurden.setRegNo(moreBetter.getRegNo());
-            regBurden.setUdpNo(moreBetter.getUdpNo());
+            regBurden.setUpdNo(moreBetter.getUpdNo());
 
             morebetterDao.saveMorebetterBurden(regBurden);
         }

+ 0 - 746
src/main/java/com/style24/admin/biz/service/TsaOrderChangeService.java

@@ -45,753 +45,7 @@ public class TsaOrderChangeService {
 
 	@Autowired
 	private ObjectMapper mapper;
-	
-	/**
-	 * 주문상세 > 주문취소신청 > 주문취소,반품,교환 대상목록
-	 * @param Order
-	 * @return Order
-	 * @author jsh77b
-	 * @since 2020. 12. 16
-	 */
-	public Collection<Order> getCancelRequestTargetList(Order order) {
-		return orderChangeDao.getCancelRequestTargetList(order);
-	}
-	
-	/**
-	 * 주문상세 > 주문취소신청 > 주문취소, 반품 환불 금액 계산
-	 * @param Order
-	 * @return Order
-	 * @author jsh77b
-	 * @since 2020. 12. 16
-	 */
-	public GagaMap orderCancelRefundAmt(List<Order> cancelReqList) {
-		GagaMap mav = new GagaMap();
-		
-		// 1. 변수설정
-		int spanPayAmt				= 0; // 총 결제 금액
-		int spanSumRealOrdAmt		= 0; // 상품 실결제 금액
-		int spanSumDeliveryFee		= 0; // 배송금액
-		int spanRtnSumDeliveryFee 	= 0; // 반품배송금액
-		int spanExcSumDeliveryFee 	= 0; // 교환배송금액
-		int spanOrdAmt				= 0; // 주문 상품 금액
-		int spanCnclRtnAmt			= 0; // 취소 상품 금액
-		int spanTotPntDcAmt			= 0; // 취소 사용 포인트
-		int spanPntDcAmt			= 0; // 고객 포인트
-		int spanPrePntDcAmt			= 0; // 상품 선포인트
-		int spanCpnDcAmt			= 0; // 취소 사용 쿠폰금액
-		int spanCpn1DcAmt			= 0; // 즉시할인쿠폰
-		int spanGoodsCpnDcAmt		= 0; // 상품쿠폰
-		int spanCartCpnDcAmt		= 0; // 장바구니쿠폰
-		int spanTmtbDcAmt			= 0; // 취소 다다익선 금액
-		int spanTmtb1DcAmt			= 0; // 수량할인
-		int spanTmtb2DcAmt			= 0; // 금액할인
-		int spanGfcdUseAmt			= 0; // 취소 고객 상품권 금액
-		int spanRealCnclRtnAmt		= 0; // 취소 상품 실결제 금액
-		int spanTotDeliveryFee		= 0; // 환불 배송 금액
-		int spanRefundAmt			= 0; // 환불 금액 합계
-		
-		int sumDeliveryFee			= 0; // 배송금액 (전체 취소시에 배송금액도 같이 환불)
-		
-		List<Order> cancelOrderRefundList 	= new ArrayList<Order>();	// 주문환불금액목록
-		List<Order> cancelDelvRefundList 	= new ArrayList<Order>();	// 주문환불배송금액목록
-		
-		Order orderObj	= new Order();
-		Order delvObj	= new Order();
-		int k 			= 0 ;
-		
-		// 2. 초기 배송정보 설정
-		delvObj.setOrdAmt(0);
-		delvObj.setCnclRtnAmt(0);
-		delvObj.setRealOrdAmt(0);
-		delvObj.setDelvFee(cancelReqList.get(k).getDelvFee());
-		delvObj.setMinOrdAmt(cancelReqList.get(k).getMinOrdAmt());
-		delvObj.setOrgDelvFee(cancelReqList.get(k).getOrgDelvFee());
-		delvObj.setRtnDelvFee(cancelReqList.get(k).getRtnDelvFee());
-		delvObj.setExcDelvFee(cancelReqList.get(k).getExcDelvFee());
-		delvObj.setSupplyCompCd(cancelReqList.get(k).getSupplyCompCd());
-		delvObj.setDelvFeeCd(cancelReqList.get(k).getDelvFeeCd());
-		delvObj.setAllCanYn(cancelReqList.get(k).getAllCanYn());
-		cancelDelvRefundList.add(delvObj);
-		
-		// 3. 취소신청수량 정보를 취소 환불 금액 계산
-		for (Order oneData : cancelReqList) {
-			orderObj	= new Order();
-			
-			// 3.1 주문기본정보 설정
-			orderObj.setItemQty(oneData.getItemQty());
-			orderObj.setOrdQty(oneData.getOrdQty());
-			orderObj.setCnclRtnQty(oneData.getCnclRtnQty());
-			orderObj.setOrdReqChgQty(oneData.getOrdReqChgQty());
-			orderObj.setOrdCanChgQty(oneData.getOrdCanChgQty());
-			orderObj.setItemPrice(oneData.getItemPrice());
-			orderObj.setOptAddPrice	(oneData.getOptAddPrice());
-			orderObj.setOrdAmt(oneData.getOrdAmt());
-			
-			orderObj.setOrdNo(oneData.getOrdNo());
-			orderObj.setOrdDtlNo(oneData.getOrdDtlNo());
-			orderObj.setGoodsCd(oneData.getGoodsCd());
-			orderObj.setGoodsNm(oneData.getGoodsNm());
-			orderObj.setOrdDtlItemSq(oneData.getOrdDtlItemSq());
-			orderObj.setItemCd(oneData.getItemCd());
-			orderObj.setItemNm(oneData.getItemNm());
-			orderObj.setOptCd1(oneData.getOptCd1());
-			orderObj.setOptCd2(oneData.getOptCd2());
-			
-			// 3.2 주문취소수량으로 취소율 정보 설정
-			int ordQty 			= oneData.getOrdQty();
-			int itemQty 		= oneData.getItemQty();
-			int ordCanChgQty 	= oneData.getOrdCanChgQty();
-			
-			float _appQty		= (float)ordCanChgQty / (float)ordQty;
-			
-			// 3.3 주문취소금액 & 취소할인금액 계산
-			orderObj.setCnclRtnAmt(((oneData.getItemPrice() + oneData.getOptAddPrice()) * itemQty) * ordCanChgQty);
-			orderObj.setCpn1DcAmt((int)(oneData.getCpn1DcAmt() 				* _appQty));
-			orderObj.setTmtb1DcAmt((int)(oneData.getTmtb1DcAmt() 			* _appQty));
-			orderObj.setTmtb2DcAmt((int)(oneData.getTmtb2DcAmt() 			* _appQty));
-			orderObj.setGoodsCpnDcAmt((int)(oneData.getGoodsCpnDcAmt() 		* _appQty));
-			orderObj.setCartCpnDcAmt((int)(oneData.getCartCpnDcAmt() 		* _appQty));
-			orderObj.setPntDcAmt((int)(oneData.getPntDcAmt() 				* _appQty));
-			orderObj.setPrePntDcAmt((int)(oneData.getPrePntDcAmt() 			* _appQty));
-			orderObj.setSavePntAmt((int)(oneData.getSavePntAmt() 			* _appQty));
-			orderObj.setGfcdUseAmt((int)(oneData.getGfcdUseAmt() 			* _appQty));
-			
-			// 3.4 취소할인합계금액 적용
-			int dcTotAmt		= 0;
-			dcTotAmt			+= orderObj.getTmtb1DcAmt();
-			dcTotAmt			+= orderObj.getTmtb2DcAmt();
-			dcTotAmt			+= orderObj.getGoodsCpnDcAmt();
-			dcTotAmt			+= orderObj.getCartCpnDcAmt();
-			dcTotAmt			+= orderObj.getPntDcAmt();
-			dcTotAmt			+= orderObj.getPrePntDcAmt();
-			dcTotAmt			+= orderObj.getCpn1DcAmt();
-			dcTotAmt			+= orderObj.getGfcdUseAmt();
-			
-			// 3.5 주문취소환불금액 계산
-			orderObj.setRealOrdAmt(orderObj.getCnclRtnAmt() - dcTotAmt);
-			
-			// 3.6 배송정보 관련 설정		
-			orderObj.setOrdDtlNo(oneData.getOrdDtlNo());
-			orderObj.setGoodsTypeNm(oneData.getGoodsTypeNm());
-			orderObj.setDelvFee(oneData.getDelvFee());
-			orderObj.setSupplyCompCd(oneData.getSupplyCompCd());
-			orderObj.setDelvFeeCd(oneData.getDelvFeeCd());
-			orderObj.setMinOrdAmt(oneData.getMinOrdAmt());
-			orderObj.setOrgDelvFee(oneData.getOrgDelvFee());
-			orderObj.setRtnDelvFee(oneData.getRtnDelvFee());
-			orderObj.setExcDelvFee(oneData.getExcDelvFee());
-			
-			// 3.7 주문상세상태체크
-			orderObj.setOrdDtlStat(oneData.getOrdDtlStat());
-			orderObj.setOrdDtlStatNm(oneData.getOrdDtlStatNm());
-			orderObj.setAllCanYn(oneData.getAllCanYn()); // 전체취소 여부 (기존의 취소 또는 출고, 반품, 교환 의 경우에는 전체취소 불가능)
-			
-			cancelOrderRefundList.add(orderObj);
-			
-			// 3.8 배송업체 & 배송비정책 조건으로 추가 배송비 금액 설정
-			if (cancelDelvRefundList.get(k).getSupplyCompCd().equals(orderObj.getSupplyCompCd()) && cancelDelvRefundList.get(k).getDelvFeeCd().equals(orderObj.getDelvFeeCd())) {
-				// 공급업체 와 배송정책코드가 같으면 주문금액, 취소금액 SUM
-				cancelDelvRefundList.get(k).setOrdAmt(cancelDelvRefundList.get(k).getOrdAmt() + orderObj.getOrdAmt());
-				cancelDelvRefundList.get(k).setCnclRtnAmt(cancelDelvRefundList.get(k).getCnclRtnAmt() + orderObj.getCnclRtnAmt());
-				cancelDelvRefundList.get(k).setRealOrdAmt(cancelDelvRefundList.get(k).getRealOrdAmt() + orderObj.getRealOrdAmt());
-				
-				if ("N".equals(orderObj.getAllCanYn())) {
-					cancelDelvRefundList.get(k).setAllCanYn("N");
-				}
-			} else {			
-				k++;
-				
-				delvObj	= new Order();
-				
-				// 공급업체 와 배송정책코드가 같지안으면 주문금액, 취소금액 RESET
-				delvObj.setOrdAmt(orderObj.getOrdAmt());
-				delvObj.setCnclRtnAmt(orderObj.getCnclRtnAmt());
-				delvObj.setRealOrdAmt(orderObj.getRealOrdAmt());
-				
-				delvObj.setDelvFee(orderObj.getDelvFee());
-				delvObj.setMinOrdAmt(orderObj.getMinOrdAmt());		
-				delvObj.setOrgDelvFee(orderObj.getOrgDelvFee());
-				delvObj.setRtnDelvFee(orderObj.getRtnDelvFee());
-				delvObj.setExcDelvFee(orderObj.getExcDelvFee());
-				delvObj.setSupplyCompCd(orderObj.getSupplyCompCd());
-				delvObj.setDelvFeeCd(orderObj.getDelvFeeCd());
-				delvObj.setAllCanYn(orderObj.getAllCanYn());
-				
-				cancelDelvRefundList.add(delvObj);
-			}
-			
-			// 3.9 FRONT 화면에서 사용 하는 변수 값 설정 & 계산
-			spanSumRealOrdAmt	+= oneData.getRealOrdAmt();
-			spanPntDcAmt		+= orderObj.getPntDcAmt();
-			spanPrePntDcAmt		+= orderObj.getPrePntDcAmt();
-			spanCpn1DcAmt		+= orderObj.getCpn1DcAmt();
-			spanGoodsCpnDcAmt	+= orderObj.getGoodsCpnDcAmt();
-			spanCartCpnDcAmt	+= orderObj.getCartCpnDcAmt();
-			spanTmtb1DcAmt		+= orderObj.getTmtb1DcAmt();
-			spanTmtb2DcAmt		+= orderObj.getTmtb2DcAmt();
-			spanGfcdUseAmt		+= orderObj.getGfcdUseAmt();
-			spanRealCnclRtnAmt	+= orderObj.getRealOrdAmt();
-		}
-		
-		// 4. 추가배송비 발생여부, 추가배송비, 배송비정책단위 전체취소 여부 체크
-		for (int i=0 ; i<cancelDelvRefundList.size() ; i++) {
-			Order obj = cancelDelvRefundList.get(i);
-			
-			// 취소금액이 있을때 처리
-			if (obj.getCnclRtnAmt() > 0) {
-			
-				// 4.1 무료배송비용 > (주문금액 - 취소금액)
-				if (obj.getMinOrdAmt() > (obj.getOrdAmt() - obj.getCnclRtnAmt())) {
-					
-					// 4.2 주문시 배송비가 존재하면 추가 배송비 없음
-					if (obj.getDelvFee() > 0) {
-						obj.setAddDelvFeeYn("N");
-						obj.setAddDelvFee(0);
-						
-						// 4.2.1 전체취소시 배송비 환불
-						if ((obj.getOrdAmt() - obj.getCnclRtnAmt()) == 0) {
-							if ("Y".equals(obj.getAllCanYn())) {
-								sumDeliveryFee += obj.getDelvFee(); // 전체취소시 배송금액도 같이 환불
-							}
-						}
-					} else {
-						// 4.3 주문금액 - 취소금액 == 0 이면 전체취소 이므로 배송비 발생 안함
-						// * 2020.12.28 
-						// * case : 배송정책 기준으로 1,2 상품 주문 후 1번 출고 후 1번반품 2번취소 할 경우 전체 취소 가 아니므로 배송비 부과 있을지 모르겠음 주문업체 단위로 배송되기 때문에 발생하지 않을것 같음
-						if ((obj.getOrdAmt() - obj.getCnclRtnAmt()) == 0) {
-							if ("N".equals(obj.getAllCanYn())) {
-								obj.setAddDelvFeeYn("Y");
-								obj.setAddDelvFee(obj.getOrgDelvFee());
-							} else {
-								// 4.4 전체취소의 경우에 해당
-								obj.setAddDelvFeeYn("N");
-								obj.setAddDelvFee(0);
-							}
-						} else {
-							// 4.5 추가배송비 발생 (취소신청화면에서 대부분 아래의 조건에 해당)
-							obj.setAddDelvFeeYn("Y");
-							obj.setAddDelvFee(obj.getOrgDelvFee());
-						}
-					}
-				} else {
-					obj.setAddDelvFeeYn("N");
-					obj.setAddDelvFee(0);
-				}
-			}
-				
-			spanSumDeliveryFee		+= obj.getDelvFee();
-			spanRtnSumDeliveryFee	+= obj.getRtnDelvFee();
-			spanExcSumDeliveryFee	+= obj.getExcDelvFee();
-			spanOrdAmt				+= obj.getOrdAmt();
-			spanCnclRtnAmt			+= obj.getCnclRtnAmt();
-			spanTotDeliveryFee  	+= obj.getAddDelvFee();
-			
-			cancelDelvRefundList.set(i, obj);
-		}
-		
-		// 5. FRONT 화면엣 필요한 금액 설정
-		// 2020.12.30 프론트에서 필요한 부분 작업 필여
-		// 관리자 화면에서 사용하는 환불 칼럼 정보
-		// 환불금액표시
-		spanPayAmt 			= spanSumRealOrdAmt + spanSumDeliveryFee;
-		spanTotPntDcAmt 	= spanPntDcAmt + spanPrePntDcAmt;
-		spanCpnDcAmt 		= spanCpn1DcAmt + spanGoodsCpnDcAmt + spanCartCpnDcAmt;
-		spanTmtbDcAmt 		= spanTmtb1DcAmt + spanTmtb2DcAmt;
-		spanRefundAmt 		= (spanRealCnclRtnAmt + sumDeliveryFee) - spanTotDeliveryFee;
-
-		mav.set("cancelReqList"			, cancelReqList);			//주문 취소 신청 목록
-		mav.set("cancelOrderRefundList"	, cancelOrderRefundList);	//주문 환불 금액 목록
-		mav.set("cancelDelvRefundList"	, cancelDelvRefundList);	//주문 환불 배송 금액 목록
-		mav.set("spanPayAmt"			, spanPayAmt);				//총 결제 금액
-		mav.set("spanSumRealOrdAmt"		, spanSumRealOrdAmt);		//상품 실결제 금액
-		mav.set("spanSumDeliveryFee"	, spanSumDeliveryFee);		//배송금액
-		mav.set("spanOrdAmt"			, spanOrdAmt);				//주문 상품 금액
-		mav.set("spanCnclRtnAmt"		, spanCnclRtnAmt);			//취소 상품 금액
-		mav.set("spanTotPntDcAmt"		, spanTotPntDcAmt);			//취소 사용 포인트
-		mav.set("spanPntDcAmt"			, spanPntDcAmt);			//고객 포인트
-		mav.set("spanPrePntDcAmt"		, spanPrePntDcAmt);			//상품 선포인트
-		mav.set("spanCpnDcAmt"			, spanCpnDcAmt);			//취소 사용 쿠폰금액
-		mav.set("spanCpn1DcAmt"			, spanCpn1DcAmt);			//즉시할인쿠폰
-		mav.set("spanGoodsCpnDcAmt"		, spanGoodsCpnDcAmt);		//상품쿠폰
-		mav.set("spanCartCpnDcAmt"		, spanCartCpnDcAmt);		//장바구니쿠폰
-		mav.set("spanTmtbDcAmt"			, spanTmtbDcAmt);			//취소 다다익선 금액
-		mav.set("spanTmtb1DcAmt"		, spanTmtb1DcAmt);			//수량할인
-		mav.set("spanTmtb2DcAmt"		, spanTmtb2DcAmt);			//금액할인
-		mav.set("spanGfcdUseAmt"		, spanGfcdUseAmt);			//취소 고객 상품권 금액
-		mav.set("spanRealCnclRtnAmt"	, spanRealCnclRtnAmt);		//취소 상품 실결제 금액
-		mav.set("sumDeliveryFee"		, sumDeliveryFee);			//배송비 합계 금액
-		mav.set("spanTotDeliveryFee"	, spanTotDeliveryFee);		//추가 배송 금액
-		mav.set("spanTotRtnDelvFee"		, spanRtnSumDeliveryFee);	//추가 반품 배송 금액
-		mav.set("spanTotExcDelvFee"		, spanExcSumDeliveryFee);	//추가 교환 배송 금액
-		mav.set("spanRefundAmt"			, spanRefundAmt);			//환불 금액 합계
-		
-		return mav;
-	}
-	
-	/**
-	 * 주문상세 > 주문취소신청 > 주문취소
-	 * @param Order
-	 * @return Order
-	 * @author jsh77b
-	 * @since 2020. 12. 30
-	 */
-	@Transactional("shopTxnManager")
-	public void orderCancel(GagaMap mav) {
-		
-		// 1. 세션회원조회
-		int userNo = TsaSession.getInfo().getUserNo();
-		
-		// 2. 취소요정정보목록
-		List<Order> cancelReqList		 	= (List<Order>) mav.get("cancelReqList");			//주문 취소 신청 목록
-		List<Order> cancelOrderRefundList 	= (List<Order>) mav.get("cancelOrderRefundList");	//주문 환불 금액 목록
-		List<Order> cancelDelvRefundList 	= (List<Order>) mav.get("cancelDelvRefundList");	//주문 환불 배송 금액 목록
-				
-		// 3. 취소신청정보
-		int ordNo 			= Integer.parseInt(mav.getString("ordNo").toString());
-		String chgReason 	= mav.getString("chgReason").toString();
-		String chgMemo 		= mav.getString("chgMemo").toString();
-		String allCanYn		= mav.getString("allCanYn").toString();
-		String isCustomer	= mav.getString("isCustomer").toString();
-		String chgGb		= "G680_20"; // 취소요청
-		
-		// 4.1 주문변경 기본정보 등록
-		OrderChange orderChange = new OrderChange();
-		orderChange.setOrdNo(ordNo);
-		orderChange.setChgGb(chgGb);
-		orderChange.setChgReason(chgReason);
-		orderChange.setChgMemo(chgMemo);
-		orderChange.setAddPayCost(0);
-		orderChange.setAddPayAmt(0);
-		orderChange.setRegNo(userNo);
-		orderChange.setUpdNo(userNo);
-		
-		// 4.2 주문변경 추가정조 등록하기
-		// 4.2 반품회수지 정보 등록
-		String chgerNm 			= mav.getString("chgerNm").toString();
-		String chgerPhnno 		= mav.getString("chgerPhnno").toString();
-		String chgerTelno 		= mav.getString("chgerTelno").toString();
-		String chgerEmail 		= mav.getString("chgerEmail").toString();
-		
-		orderChange.setChgerNm(chgerNm);
-		orderChange.setChgerPhnno(chgerPhnno);
-		orderChange.setChgerTelno(chgerTelno);
-		orderChange.setChgerEmail(chgerEmail);
-		orderChange.setChgerRtnMemo("");
-		
-		orderChangeDao.createOrderChange(orderChange);
-		
-		List<Order> cancelOrderDetailList = new ArrayList<Order>();
-		
-		// 4.2 주문변경 상세 단품 정보 등록 (단품단위)
-		for (int i=0 ; i<cancelOrderRefundList.size() ; i++) {
-			Order cancelOrderRefundPo = cancelOrderRefundList.get(i);
-			cancelOrderRefundPo.setRegNo(userNo);
-			cancelOrderRefundPo.setUpdNo(userNo);
-			
-			// 2020.01.05 추후 무통장입금전 전체 취소시 분기로직 추가 예정
-			if ("Y".equals(allCanYn)) {
-				cancelOrderRefundPo.setOrdDtlStat("G013_98"); // 결제전주문취소 : 공통코드로관리예정
-			} else {
-				cancelOrderRefundPo.setOrdDtlStat("G013_99"); // 결제후주문취소 : 공통코드로관리예정
-			}
-
-			// 4.2.1 취소수량이 존재하면 주문정보 수정 및 주문변경정보 등록
-			if (cancelOrderRefundPo.getOrdCanChgQty() > 0) {
-				// 4.2.3 주문상세단품정보 수정
-				orderChangeDao.updateOrderDetailItem(cancelOrderRefundPo);
-				
-				// 4.2.4 주문상세단품정보 이력 등록
-				orderChangeDao.createOrderDetailItemHst(cancelOrderRefundPo);
-				
-				// 4.3 주문변경 상세 단위로 데이타 등록 (ORD_DTL_NO)
-				Boolean temp = false;
-				
-				if (cancelOrderDetailList.size() > 0) {
-					for (int j=0 ; j<cancelOrderDetailList.size() ; j++) {
-						if (cancelOrderRefundPo.getOrdDtlNo() == cancelOrderDetailList.get(j).getOrdDtlNo()) {
-							temp = true;
-						}
-					}
-				}
-				
-				// 4.4 주문상세단위 데이타 저장
-				if (!temp) {
-					cancelOrderDetailList.add(cancelOrderRefundPo);
-				}
-				
-				// 4.5 상품옵션 재고 원복
-				orderChangeDao.updateOptionQty(cancelOrderRefundPo);
-			}
-		}
 		
-		// 5. 주문상세단위 취소 데이타 처리
-		for (int i=0 ; i<cancelOrderDetailList.size() ; i++) {			
-			Order vo = cancelOrderRefundList.get(i);
-			vo.setRegNo(userNo);
-			vo.setUpdNo(userNo);
-			
-			// 2020.01.05 추후 무통장입금전 전체 취소시 분기로직 추가 예정
-			if ("Y".equals(allCanYn)) {
-				vo.setOrdDtlStat("G013_98"); // 결제전주문취소 : 공통코드로관리예정
-			} else {
-				vo.setOrdDtlStat("G013_99"); // 결제후주문취소 : 공통코드로관리예정
-			}
-			
-			// 5.1 주문변경상세정보 이력 등록
-			orderChangeDao.createOrderDetailHstCnclRtn(vo);
-			
-			// 4.2 주문변경상세정보 수정
-			orderChangeDao.updateOrderDetail(vo);
-			
-			// * 주문상세단위가 아닌 주문상세단품단위로 데이타가 처리되고 있었음
-			// 5.3 주문변경상세정보 등록
-			OrderChange changeDetailPo = new OrderChange();
-			changeDetailPo.setOrdChgSq(orderChange.getOrdChgSq());
-			changeDetailPo.setOrdDtlNo(vo.getOrdDtlNo());
-			changeDetailPo.setChgQty(vo.getOrdCanChgQty());
-			changeDetailPo.setChgStat("G685_21"); // 취소완료 : 공통코드로관리예정
-			changeDetailPo.setRegNo(userNo);
-			changeDetailPo.setUpdNo(userNo);
-			
-			orderChangeDao.createOrderChangeDetail(changeDetailPo);
-		}
-		
-		// To Do List
-		// 취소, 반품 사유에 따른 추가배송비, 반품배송비를 환불금액에서 추가, 제외 할 수 있다.
-		int spanRealCnclRtnAmt 		= Integer.parseInt(mav.get("spanRealCnclRtnAmt").toString());		// 취소금액합계
-		int sumDeliveryFee 			= Integer.parseInt(mav.get("sumDeliveryFee").toString());			// 배송비합계
-		int spanTotDeliveryFee 		= Integer.parseInt(mav.get("spanTotDeliveryFee").toString());		// 추가배송비합계
-		int spanTotRtnDelvFee 		= Integer.parseInt(mav.get("spanTotRtnDelvFee").toString());		// 반품배송비합계
-		int spanRefundAmt			= 0;
-		
-		// 고객사유 : 환불금액계산 = (취소금액 + 배송비) - 추가배송비
-		if ("true".equals(isCustomer)) {
-			spanRefundAmt = (spanRealCnclRtnAmt + sumDeliveryFee) - spanTotDeliveryFee - spanTotRtnDelvFee;
-			//Integer.parseInt(mav.get("spanRefundAmt").toString());
-		}
-		// 회사사유 : 환불금액계산 = (취소금액 + 배송비)
-		else {
-			spanRefundAmt = (spanRealCnclRtnAmt + sumDeliveryFee);
-		}
-		mav.set("spanRefundAmt", spanRefundAmt);
-		
-		// 6. 환불결제 정보 등록
-		Order paymentOrder = new Order();
-		paymentOrder.setOrdNo(ordNo);
-		paymentOrder.setPayAmt(Integer.parseInt(mav.get("spanRefundAmt").toString()) * -1);
-		paymentOrder.setPayStat("G016_99");
-		paymentOrder.setOrdChgSq(orderChange.getOrdChgSq());
-		paymentOrder.setRegNo(userNo);
-		paymentOrder.setUpdNo(userNo);
-		
-		orderChangeDao.createPayment(paymentOrder);
-		
-		// 7. 환불금액 등록
-		Order refundOrder = new Order();
-		refundOrder.setOrdNo(ordNo);
-		refundOrder.setPaySq(paymentOrder.getPaySq());
-		refundOrder.setOrdChgSq(orderChange.getOrdChgSq());
-		refundOrder.setRegNo(userNo);
-		
-		refundOrder.setRefundAmt(Integer.parseInt(mav.get("spanRefundAmt").toString()));
-		refundOrder.setRfCpn1Amt(Integer.parseInt(mav.get("spanCpn1DcAmt").toString()));
-		refundOrder.setRfTmtb1Amt(Integer.parseInt(mav.get("spanTmtb1DcAmt").toString()));
-		refundOrder.setRfTmtb2Amt(Integer.parseInt(mav.get("spanTmtb2DcAmt").toString()));
-		refundOrder.setRfGoodsCpnAmt(Integer.parseInt(mav.get("spanGoodsCpnDcAmt").toString()));
-		refundOrder.setRfCartCpnAmt(Integer.parseInt(mav.get("spanCartCpnDcAmt").toString()));
-		refundOrder.setRfPntAmt(Integer.parseInt(mav.get("spanPntDcAmt").toString()));
-		refundOrder.setRfPrePntAmt(Integer.parseInt(mav.get("spanPrePntDcAmt").toString()));
-		refundOrder.setRfGfcdUseAmt(Integer.parseInt(mav.get("spanGfcdUseAmt").toString()));
-		
-		refundOrder.setRaNo(mav.get("accountNo").toString());
-		refundOrder.setRaNm(mav.get("accountNm").toString());
-		refundOrder.setRaBank(mav.get("bankCd").toString());
-		
-		orderChangeDao.createRefund(refundOrder);
-		
-		// 8. 결제금액이 무료배송금액보다 작으면 배송비 신규 등록
-		for (int i=0 ; i<cancelDelvRefundList.size() ; i++) {
-			Order vo = cancelDelvRefundList.get(i);
-			
-			if (vo.getAddDelvFee() > 0) {
-				Order delvFeeOrder = new Order();
-				
-				delvFeeOrder.setPaySq(paymentOrder.getPaySq());
-				delvFeeOrder.setOrdNo(ordNo);
-				delvFeeOrder.setDelvFeeGb("G018_10");
-				delvFeeOrder.setDelvFeeCd(vo.getDelvFeeCd());
-				delvFeeOrder.setDelvFee(vo.getAddDelvFee());
-				delvFeeOrder.setRealDelvAmt(vo.getDelvFee());
-				delvFeeOrder.setOrdChgSq(orderChange.getOrdChgSq());
-				delvFeeOrder.setSupplyCompCd(vo.getSupplyCompCd());
-				delvFeeOrder.setRegNo(userNo);
-				delvFeeOrder.setUpdNo(userNo);
-				
-				orderChangeDao.createDeliveryFee(delvFeeOrder);
-			}
-		}
-		
-		// To Do List
-		// 9. 포인트원복 (사용포인트, 주문상세단위)
-		
-		// To Do List
-		// 10. 쿠폰원복 (상품쿠폰, 주문상세단위) (전체취소시 장바구니쿠폰, 배송비쿠폰)
-		
-		// To Do List
-		// 11. 상품권원복
-		
-		// 12. 사은품 전체 취소 (전체취소시 적용) 추후 사은품 관련 취소 로직 개발 예정
-		Order freegiftOrder = new Order();
-		freegiftOrder.setOrdNo(ordNo);
-		freegiftOrder.setUpdNo(userNo);
-		orderChangeDao.updateOrdFreegiftDel(freegiftOrder);
-		
-		// To Do List
-		// 13. PG 연동
-		
-		// To Do List
-		// 14. 취소 완료 알림톡 발송 에정
-		
-		//int a = 100/0;
-	}
-	
-	/**
-	 * 주문상세 > 주문취소신청 > 주문반품신청
-	 * @param Order
-	 * @return Order
-	 * @author jsh77b
-	 * @since 2021. 01. 14
-	 */
-	@Transactional("shopTxnManager")
-	public void orderReturn(GagaMap mav) {
-		
-		// 1. 세션회원조회
-		int userNo = TsaSession.getInfo().getUserNo();
-		
-		// 2. 취소요정정보목록
-		List<Order> cancelReqList		 	= (List<Order>) mav.get("cancelReqList");			//주문 취소 신청 목록
-		List<Order> cancelOrderRefundList 	= (List<Order>) mav.get("cancelOrderRefundList");	//주문 환불 금액 목록
-		List<Order> cancelDelvRefundList 	= (List<Order>) mav.get("cancelDelvRefundList");	//주문 환불 배송 금액 목록
-				
-		// 3. 취소신청정보
-		int ordNo 			= Integer.parseInt(mav.getString("ordNo").toString());
-		String chgReason 	= mav.getString("chgReason").toString();
-		String chgMemo 		= mav.getString("chgMemo").toString();
-		String allCanYn		= mav.getString("allCanYn").toString();
-		String isCustomer	= mav.getString("isCustomer").toString();
-		String chgGb		= "G680_30"; //반품요청
-		
-		// 4.1 주문변경 기본정보 등록
-		OrderChange orderChange = new OrderChange();
-		orderChange.setOrdNo(ordNo);
-		orderChange.setChgGb(chgGb);
-		orderChange.setChgReason(chgReason);
-		orderChange.setChgMemo(chgMemo);
-		orderChange.setAddPayCost(0);
-		orderChange.setAddPayAmt(0);
-		orderChange.setRegNo(userNo);
-		orderChange.setUpdNo(userNo);
-		
-		// 4.2 반품추가정보, 반품회수지 정보 등록
-		String chgerNm 			= mav.getString("chgerNm").toString();
-		String chgerPhnno 		= mav.getString("chgerPhnno").toString();
-		String chgerTelno 		= mav.getString("chgerTelno").toString();
-		String chgerEmail 		= mav.getString("chgerEmail").toString();
-		String chgerZipNo 		= mav.getString("chgerZipNo").toString();
-		String chgerBaseAddr 	= mav.getString("chgerBaseAddr").toString();
-		String chgerDtlAddr 	= mav.getString("chgerDtlAddr").toString();
-		
-		orderChange.setChgerNm(chgerNm);
-		orderChange.setChgerPhnno(chgerPhnno);
-		orderChange.setChgerTelno(chgerTelno);
-		orderChange.setChgerEmail(chgerEmail);
-		orderChange.setChgerZipNo(chgerZipNo);
-		orderChange.setChgerBaseAddr(chgerBaseAddr);
-		orderChange.setChgerDtlAddr(chgerDtlAddr);
-		orderChange.setChgerRtnMemo("");
-		
-		orderChangeDao.createOrderChange(orderChange);
-		
-		List<Order> cancelOrderDetailList = new ArrayList<Order>();
-		
-		// 4.2 주문변경 상세 단품 정보 등록 (단품단위)
-		for (int i=0 ; i<cancelOrderRefundList.size() ; i++) {
-			Order cancelOrderRefundPo = cancelOrderRefundList.get(i);
-			cancelOrderRefundPo.setRegNo(userNo);
-			cancelOrderRefundPo.setUpdNo(userNo);
-			
-			// 2020.01.05 추후 무통장입금전 전체 취소시 분기로직 추가 예정
-			if ("Y".equals(allCanYn)) {
-				cancelOrderRefundPo.setOrdDtlStat("G013_98"); // 결제전주문취소 : 공통코드로관리예정
-			} else {
-				cancelOrderRefundPo.setOrdDtlStat("G013_99"); // 결제후주문취소 : 공통코드로관리예정
-			}
-
-			// 4.2.1 취소수량이 존재하면 주문정보 수정 및 주문변경정보 등록
-			if (cancelOrderRefundPo.getOrdCanChgQty() > 0) {
-				// 4.2.3 주문상세단품정보 수정
-				//orderChangeDao.updateOrderDetailItem(cancelOrderRefundPo);
-				
-				// 4.2.4 주문상세단품정보 이력 등록
-				//orderChangeDao.createOrderDetailItemHst(cancelOrderRefundPo);
-				
-				// 4.3 주문변경 상세 단위로 데이타 등록 (ORD_DTL_NO)
-				Boolean temp = false;
-				
-				if (cancelOrderDetailList.size() > 0) {
-					for (int j=0 ; j<cancelOrderDetailList.size() ; j++) {
-						if (cancelOrderRefundPo.getOrdDtlNo() == cancelOrderDetailList.get(j).getOrdDtlNo()) {
-							temp = true;
-						}
-					}
-				}
-				
-				// 4.4 주문상세단위 데이타 저장
-				if (!temp) {
-					cancelOrderDetailList.add(cancelOrderRefundPo);
-				}
-				
-				// 4.5 상품옵션 재고 원복
-				//orderChangeDao.updateOptionQty(cancelOrderRefundPo);
-			}
-		}
-		
-		// 5. 주문상세단위 취소 데이타 처리
-		for (int i=0 ; i<cancelOrderDetailList.size() ; i++) {			
-			Order vo = cancelOrderRefundList.get(i);
-			vo.setRegNo(userNo);
-			vo.setUpdNo(userNo);
-			
-			// 2020.01.05 추후 무통장입금전 전체 취소시 분기로직 추가 예정
-			if ("Y".equals(allCanYn)) {
-				vo.setOrdDtlStat("G013_98"); // 결제전주문취소 : 공통코드로관리예정
-			} else {
-				vo.setOrdDtlStat("G013_99"); // 결제후주문취소 : 공통코드로관리예정
-			}
-			
-			// 5.1 주문변경상세정보 이력 등록
-			orderChangeDao.createOrderDetailHstCnclRtn(vo);
-			
-			// 4.2 주문변경상세정보 수정
-			//orderChangeDao.updateOrderDetail(vo);
-			
-			// * 주문상세단위가 아닌 주문상세단품단위로 데이타가 처리되고 있었음
-			// 5.3 주문변경상세정보 등록
-			OrderChange changeDetailPo = new OrderChange();
-			changeDetailPo.setOrdChgSq(orderChange.getOrdChgSq());
-			changeDetailPo.setOrdDtlNo(vo.getOrdDtlNo());
-			changeDetailPo.setChgQty(vo.getOrdCanChgQty());
-			changeDetailPo.setChgStat("G685_40"); // 반품요청 : 공통코드로관리예정
-			changeDetailPo.setRegNo(userNo);
-			changeDetailPo.setUpdNo(userNo);
-			
-			orderChangeDao.createOrderChangeDetail(changeDetailPo);
-		}
-		
-		// To Do List
-		// 취소, 반품 사유에 따른 추가배송비, 반품배송비를 환불금액에서 추가, 제외 할 수 있다.
-		int spanRealCnclRtnAmt 		= Integer.parseInt(mav.get("spanRealCnclRtnAmt").toString());		// 취소금액합계
-		int sumDeliveryFee 			= Integer.parseInt(mav.get("sumDeliveryFee").toString());			// 배송비합계
-		int spanTotDeliveryFee 		= Integer.parseInt(mav.get("spanTotDeliveryFee").toString());		// 추가배송비합계
-		int spanTotRtnDelvFee 		= Integer.parseInt(mav.get("spanTotRtnDelvFee").toString());		// 반품배송비합계
-		int spanRefundAmt			= 0;
-		
-		// 고객사유 : 환불금액계산 = (취소금액 + 배송비) - 추가배송비
-		if ("true".equals(isCustomer)) {
-			spanRefundAmt = (spanRealCnclRtnAmt + sumDeliveryFee) - spanTotDeliveryFee - spanTotRtnDelvFee;
-			//Integer.parseInt(mav.get("spanRefundAmt").toString());
-		}
-		// 회사사유 : 환불금액계산 = (취소금액 + 배송비)
-		else {
-			spanRefundAmt = (spanRealCnclRtnAmt + sumDeliveryFee);
-		}
-		mav.set("spanRefundAmt", spanRefundAmt);
-		
-		// 6. 환불결제 정보 등록
-		Order paymentOrder = new Order();
-		paymentOrder.setOrdNo(ordNo);
-		paymentOrder.setPayAmt(Integer.parseInt(mav.get("spanRefundAmt").toString()) * -1);
-		paymentOrder.setPayStat("G016_99");
-		paymentOrder.setOrdChgSq(orderChange.getOrdChgSq());
-		paymentOrder.setRegNo(userNo);
-		paymentOrder.setUpdNo(userNo);
-		
-		//orderChangeDao.createPayment(paymentOrder);
-		
-		// 7. 환불금액 등록
-		Order refundOrder = new Order();
-		refundOrder.setOrdNo(ordNo);
-		refundOrder.setPaySq(paymentOrder.getPaySq());
-		refundOrder.setOrdChgSq(orderChange.getOrdChgSq());
-		refundOrder.setRegNo(userNo);
-		
-		refundOrder.setRefundAmt(Integer.parseInt(mav.get("spanRefundAmt").toString()));
-		refundOrder.setRfCpn1Amt(Integer.parseInt(mav.get("spanCpn1DcAmt").toString()));
-		refundOrder.setRfTmtb1Amt(Integer.parseInt(mav.get("spanTmtb1DcAmt").toString()));
-		refundOrder.setRfTmtb2Amt(Integer.parseInt(mav.get("spanTmtb2DcAmt").toString()));
-		refundOrder.setRfGoodsCpnAmt(Integer.parseInt(mav.get("spanGoodsCpnDcAmt").toString()));
-		refundOrder.setRfCartCpnAmt(Integer.parseInt(mav.get("spanCartCpnDcAmt").toString()));
-		refundOrder.setRfPntAmt(Integer.parseInt(mav.get("spanPntDcAmt").toString()));
-		refundOrder.setRfPrePntAmt(Integer.parseInt(mav.get("spanPrePntDcAmt").toString()));
-		refundOrder.setRfGfcdUseAmt(Integer.parseInt(mav.get("spanGfcdUseAmt").toString()));
-		
-		refundOrder.setRaNo(mav.get("accountNo").toString());
-		refundOrder.setRaNm(mav.get("accountNm").toString());
-		refundOrder.setRaBank(mav.get("bankCd").toString());
-		
-		//orderChangeDao.createRefund(refundOrder);
-		
-		// 8. 결제금액이 무료배송금액보다 작으면 배송비 신규 등록
-		for (int i=0 ; i<cancelDelvRefundList.size() ; i++) {
-			Order vo = cancelDelvRefundList.get(i);
-			
-			if (vo.getAddDelvFee() > 0) {
-				Order delvFeeOrder = new Order();
-				
-				delvFeeOrder.setPaySq(paymentOrder.getPaySq());
-				delvFeeOrder.setOrdNo(ordNo);
-				delvFeeOrder.setDelvFeeGb("G018_10");
-				delvFeeOrder.setDelvFeeCd(vo.getDelvFeeCd());
-				delvFeeOrder.setDelvFee(vo.getAddDelvFee());
-				delvFeeOrder.setRealDelvAmt(vo.getDelvFee());
-				delvFeeOrder.setOrdChgSq(orderChange.getOrdChgSq());
-				delvFeeOrder.setSupplyCompCd(vo.getSupplyCompCd());
-				delvFeeOrder.setRegNo(userNo);
-				delvFeeOrder.setUpdNo(userNo);
-				
-				//orderChangeDao.createDeliveryFee(delvFeeOrder);
-			}
-		}
-		
-		// To Do List
-		// 9. 포인트원복 (사용포인트, 주문상세단위)
-		
-		// To Do List
-		// 10. 쿠폰원복 (상품쿠폰, 주문상세단위) (전체취소시 장바구니쿠폰, 배송비쿠폰)
-		
-		// To Do List
-		// 11. 상품권원복
-		
-		// 12. 사은품 전체 취소 (전체취소시 적용) 추후 사은품 관련 취소 로직 개발 예정
-		Order freegiftOrder = new Order();
-		freegiftOrder.setOrdNo(ordNo);
-		freegiftOrder.setUpdNo(userNo);
-		//orderChangeDao.updateOrdFreegiftDel(freegiftOrder);
-		
-		// To Do List
-		// 13. PG 연동
-		
-		// To Do List
-		// 14. 취소 완료 알림톡 발송 에정
-		
-		//int a = 100/0;
-	}
-	
-	
-	
-	
-	
-	
 	/**
 	 * 주문 환불계좌
 	 *

+ 21 - 11
src/main/java/com/style24/admin/biz/service/TsaRendererService.java

@@ -508,17 +508,6 @@ public class TsaRendererService {
 		return rendererDao.getQnaAnswerPhaseList(ansClsf);
 	}
 
-//	/**
-//	 * 제휴링크 목록
-//	 * @param afChannel - 제휴채널
-//	 * @return
-//	 * @author gagamel
-//	 * @since 2020. 5. 4
-//	 */
-//	public Collection<CommonCode> getAflinkList(String afChannel) {
-//		return rendererDao.getAflinkList(afChannel);
-//	}
-
 	/**
 	 * 색상그룹코드 RGB 목록
 	 *
@@ -531,4 +520,25 @@ public class TsaRendererService {
 		return rendererDao.getColorGrpCdRgbList();
 	}
 
+	/**
+	 * 전체 제휴채널 목록
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 20
+	 */
+	public Collection<CommonCode> getAllAflinkList() {
+		return rendererDao.getAllAflinkList();
+	}
+
+	/**
+	 * 제휴채널 목록
+	 * @param afChannel - 상위제휴채널
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 20
+	 */
+	public Collection<CommonCode> getAflinkList(String afChannel) {
+		return rendererDao.getAflinkList(afChannel);
+	}
+
 }

+ 37 - 0
src/main/java/com/style24/admin/biz/service/TsaSettleService.java

@@ -0,0 +1,37 @@
+package com.style24.admin.biz.service;
+
+import java.util.Collection;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.style24.admin.biz.dao.TsaSettleDao;
+import com.style24.persistence.domain.AflinkFee;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * 정산 Service
+ *
+ * @author gagamel
+ * @since 2021. 1. 20
+ */
+@Service
+@Slf4j
+public class TsaSettleService {
+
+	@Autowired
+	private TsaSettleDao settleDao;
+
+	/**
+	 * 제휴채널정산 목록
+	 * @param afLinkFee - 제휴채널수수료 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 20
+	 */
+	public Collection<AflinkFee> getAfLinkFeeList(AflinkFee afLinkFee) {
+		return settleDao.getAfLinkFeeList(afLinkFee);
+	}
+
+}

+ 58 - 1
src/main/java/com/style24/admin/biz/web/TsaCustomerController.java

@@ -2,10 +2,14 @@ package com.style24.admin.biz.web;
 
 import java.util.Collection;
 
+import com.gagaframework.web.security.GagaPasswordEncoder;
 import com.style24.admin.biz.service.TsaCustomerService;
+import com.style24.admin.biz.service.TsaKakaoService;
+import com.style24.admin.biz.service.TsaSystemService;
 import com.style24.core.support.session.TscSession;
 import com.style24.persistence.domain.Customer;
 import com.style24.persistence.domain.CustomerSearch;
+import com.sun.xml.internal.bind.v2.TODO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -55,6 +59,15 @@ public class TsaCustomerController extends TsaBaseController {
 	@Autowired
 	private TsaCustomerService customerService;
 
+	@Autowired
+	private TsaSystemService systemService;
+
+	@Autowired
+	private GagaPasswordEncoder passwordEncoder;
+
+	@Autowired
+	private TsaKakaoService kakaoService;
+
 	/**
 	 * 1:1문의관리 화면
 	 * @return
@@ -363,7 +376,7 @@ public class TsaCustomerController extends TsaBaseController {
 	}
 
 	/**
-	 * 회원 정보
+	 * 회원정보
 	 * @param custNo - 고객번호
 	 * @return Customer
 	 * @author jsshin
@@ -376,6 +389,50 @@ public class TsaCustomerController extends TsaBaseController {
 		return customerService.getCustomerInfo(custNo);
 	}
 
+	/**
+	 * 회원정보 수정
+	 * @param customer - 고객정보
+	 * @return Customer
+	 * @author jsshin
+	 * @since 2020. 01. 20
+	 */
+	@PostMapping("/info/save")
+	@ResponseBody
+	public GagaResponse saveCustomerInfo(@RequestBody Customer customer) {
+		customerService.saveCustomerInfo(customer);
+		return ok(message.getMessage("SUCC_0002"));
+	}
+
+	/**
+	 * 회원비밀번호초기화
+	 *
+	 * @param customer -고객정보
+	 * @return GagaResponse
+	 * @throws Exception
+	 * @author jsshin
+	 * @since 2020. 01. 20
+	 */
+	@PostMapping("/password/reset")
+	@ResponseBody
+	public GagaResponse resetCustomerPassword(@RequestBody Customer customer) throws Exception {
+		String tempPasswd = systemService.getTemporaryPassword(10);
+		log.info("tempPasswd  ====> {}", tempPasswd);
+
+		customer.setPasswd(tempPasswd);
+		customer.setEncodedPasswd(passwordEncoder.encodeSha256(tempPasswd));
+		customer.setRegNo(TsaSession.getInfo().getRegNo());
+
+		// 비밀번호 수정
+		customerService.updateCustomerPassword(customer);
+
+		// 카카오 알림톡
+		kakaoService.sendCustomerTempPassword(customer);
+
+		// TODO: 2021.1.20 메일발송 서비스 붙여야함 - jsshin
+
+		return ok(message.getMessage("SUCC_0005"));
+	}
+
 	/**
 	 * 탈퇴회원
 	 * @return ModelAndView

+ 5 - 0
src/main/java/com/style24/admin/biz/web/TsaDisplayController.java

@@ -312,6 +312,11 @@ public class TsaDisplayController extends TsaBaseController {
 		mav.addObject("siteList", rendererService.getAvailCommonCodeList("G000"));
 		// 카테고리구분
 		mav.addObject("cateGbList", rendererService.getAvailCommonCodeList("G032"));
+
+		mav.addObject("cateTypeList", rendererService.getAvailCommonCodeList("G031"));
+		mav.addObject("formalGbList", rendererService.getAvailCommonCodeList("G009"));
+		mav.addObject("conentsLocList", rendererService.getAvailCommonCodeList("G028"));
+
 		mav.setViewName("display/CategoryGoodsForm");
 
 		return mav;

+ 17 - 12
src/main/java/com/style24/admin/biz/web/TsaGoodsController.java

@@ -7,12 +7,12 @@ import java.util.Collection;
 
 import javax.servlet.http.HttpServletRequest;
 
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.core.io.InputStreamResource;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
-import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -498,7 +498,7 @@ public class TsaGoodsController extends TsaBaseController {
 		}
 
 		// multi row 검색관련 처리
-		if (!StringUtils.isEmpty(goodsSearch.getCondition())) {
+		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
 			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
 
 			if ("searchExtendGoodsCd".equals(goodsSearch.getSearch())) {
@@ -512,6 +512,11 @@ public class TsaGoodsController extends TsaBaseController {
 		goodsSearch.setPageable(new TscPageRequest(goodsSearch.getPageNo() - 1, goodsSearch.getPageSize()));
 		goodsSearch.getPageable().setTotalCount(goodsService.getGoodsListCount(goodsSearch));
 
+		// 다다익선 업체+브랜드 상품조회시 사용
+		if("N".equals(goodsSearch.getPageingYn())){
+			goodsSearch.setPageable(null);
+		}
+
 		result.set("pageing", goodsSearch);
 		result.set("goodsList", goodsService.getGoodsList(goodsSearch));
 
@@ -539,7 +544,7 @@ public class TsaGoodsController extends TsaBaseController {
 		goodsSearch.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
 
 		// multi row 검색관련 처리
-		if (!StringUtils.isEmpty(goodsSearch.getCondition())) {
+		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
 			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
 
 			if ("searchExtendGoodsCd".equals(goodsSearch.getSearch())) {
@@ -624,7 +629,7 @@ public class TsaGoodsController extends TsaBaseController {
 					} else {
 						for (GoodsNotiInfo tmpGoodsNotiInfo : goodsNotiInfoList) {
 							if ("Y".equals(tmpGoodsNotiInfo.getReqYn()) || "Y".equals(tmpGoodsNotiInfo.getDispYn())) {
-								if (StringUtils.isEmpty(tmpGoodsNotiInfo.getNiContent())) {
+								if (StringUtils.isBlank(tmpGoodsNotiInfo.getNiContent())) {
 									returnGoods += tmpGoods.getGoodsCd() + ",";
 									break;
 								}
@@ -1475,7 +1480,7 @@ public class TsaGoodsController extends TsaBaseController {
 		}
 
 		// multi row 검색관련 처리
-		if (!StringUtils.isEmpty(goodsSearch.getCondition())) {
+		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
 			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
 		}
 
@@ -1676,7 +1681,7 @@ public class TsaGoodsController extends TsaBaseController {
 		}
 
 		// multi row 검색관련 처리
-		if (!StringUtils.isEmpty(goodsSearch.getCondition())) {
+		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
 			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
 		}
 
@@ -1948,7 +1953,7 @@ public class TsaGoodsController extends TsaBaseController {
 		}
 
 		// multi row 검색관련 처리
-		if (!StringUtils.isEmpty(goodsSearch.getCondition())) {
+		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
 			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
 		}
 
@@ -2071,7 +2076,7 @@ public class TsaGoodsController extends TsaBaseController {
 		}
 
 		// multi row 검색관련 처리
-		if (!StringUtils.isEmpty(goodsSearch.getCondition())) {
+		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
 			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
 
 			if ("searchExtendGoodsCd".equals(goodsSearch.getSearch())) {
@@ -2282,7 +2287,7 @@ public class TsaGoodsController extends TsaBaseController {
 		}
 
 		// multi row 검색관련 처리
-		if (!StringUtils.isEmpty(goodsSearch.getCondition())) {
+		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
 			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
 
 			if ("searchExtendGoodsCd".equals(goodsSearch.getSearch())) {
@@ -2307,7 +2312,7 @@ public class TsaGoodsController extends TsaBaseController {
 	public Collection<GoodsNaverLowestPrice> saveGoodsNaverPrice(@RequestBody GoodsSearch goodsSearch) {
 
 		// multi row 검색관련 처리
-		if (!StringUtils.isEmpty(goodsSearch.getCondition())) {
+		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
 			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
 		}
 
@@ -2458,7 +2463,7 @@ public class TsaGoodsController extends TsaBaseController {
 	public Collection<FreeGoods> getFreeGoodsList(@RequestBody GoodsSearch goodsSearch) {
 
 		// multi row 검색관련 처리
-		if (!StringUtils.isEmpty(goodsSearch.getCondition())) {
+		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
 			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
 		}
 		log.info("[getFreeGoodsList] goodsSearch={}", goodsSearch);
@@ -2478,7 +2483,7 @@ public class TsaGoodsController extends TsaBaseController {
 	public GagaResponse updateFreeGoods(@RequestBody FreeGoods freeGoods) {
 
 		if (freeGoods.getNewSysImgNm() != null && !"".equals(freeGoods.getNewSysImgNm())) {
-			String sysImgNm =  freeGoods.getProductNo() + "_" + GagaDateUtil.getTodayDateTime() + "." + StringUtils.getFilenameExtension(freeGoods.getNewSysImgNm());
+			String sysImgNm =  freeGoods.getProductNo() + "_" + GagaDateUtil.getTodayDateTime() + "." + org.springframework.util.StringUtils.getFilenameExtension(freeGoods.getNewSysImgNm());
 
 			String imgUploadPath = env.getProperty("upload.default.target.path");
 			imgUploadPath = GagaFileUtil.getConcatenationPath(imgUploadPath, "display", "freegoods");

+ 152 - 24
src/main/java/com/style24/admin/biz/web/TsaMarketingController.java

@@ -5,10 +5,12 @@ import java.util.Collection;
 import java.util.List;
 
 import com.style24.persistence.TscPageRequest;
+import com.style24.persistence.domain.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -27,13 +29,6 @@ import com.style24.admin.biz.service.TsaSystemService;
 import com.style24.admin.support.controller.TsaBaseController;
 import com.style24.admin.support.security.session.TsaSession;
 import com.style24.core.support.message.TscMessageByLocale;
-import com.style24.persistence.domain.CommonCode;
-import com.style24.persistence.domain.Coupon;
-import com.style24.persistence.domain.FreeGoodsPromotion;
-import com.style24.persistence.domain.MoreBetter;
-import com.style24.persistence.domain.MoreBetterBurden;
-import com.style24.persistence.domain.MoreBetterGoods;
-import com.style24.persistence.domain.MoreBetterSection;
 
 import lombok.extern.slf4j.Slf4j;
 
@@ -207,9 +202,11 @@ public class TsaMarketingController extends TsaBaseController {
 	 */
 	@GetMapping("/coupon/popup/form")
 	@ResponseBody
-	public ModelAndView couponCreatePopup() {
+	public ModelAndView couponCreatePopup(@RequestParam(value="cpnId") String cpnId ) {
 		ModelAndView mav = new ModelAndView();
 		String num = "";
+		String mode = "N";
+		int issueCnt = 0;
 
 		// 일시 시 리스트 세팅
 		Collection<CommonCode> hhList = new ArrayList<CommonCode>();
@@ -246,15 +243,28 @@ public class TsaMarketingController extends TsaBaseController {
 
 			mmList.add(temp);
 		}
-
+		// 시간 분 리스트 세팅
+		mav.addObject("mmList", mmList);
+		// 시간 시 리스트 세팅
+		mav.addObject("hhList", hhList);
+		// 입점업체 조회
+		mav.addObject("ibSupplyCompList", rendererService.getSupplyCompanyList("", "N"));
+		// 정상/이월 조회
+		mav.addObject("formalGbList" , rendererService.getCommonCodeList("G009"));
+		// 카테고리 구분 조회
+		mav.addObject("cateGbList" , rendererService.getCommonCodeList("G032"));
+		// 자사 브랜드 조회
+		mav.addObject("selfBrandList" , couponService.getSelfBrandList());
+		// 사이트코드 조회
+		mav.addObject("siteCdList", rendererService.getCommonCodeList("G000"));
+		// 쿠폰상태 조회
+		mav.addObject("cpnStatList", rendererService.getCommonCodeList("G232"));
 		// 쿠폰 유형 조회
-		mav.addObject("cpnTypeList", rendererService.getCommonCodeList("G230"));
+		mav.addObject("cpnTypeList", rendererService.getCommonCodeList("G230" , "Y"));
 		// 사용가능 고객구분 조회
 		mav.addObject("usableCustGbList", rendererService.getCommonCodeList("G100"));
 		// 사용가능 고객등급 조회
-		mav.addObject("usableCustGradeList", rendererService.getCommonCodeList("G101"));
-		// 사이트코드 조회
-		mav.addObject("siteCdList", rendererService.getCommonCodeList("G000"));
+		mav.addObject("usableCustGradeList", rendererService.getCommonCodeList("G110"));
 		// 재발급 여부 조회
 		mav.addObject("reissuanceList", rendererService.getCommonCodeList("G231"));
 		// 할인방식 조회
@@ -263,16 +273,35 @@ public class TsaMarketingController extends TsaBaseController {
 		mav.addObject("dnGbList", rendererService.getCommonCodeList("G058"));
 		// 결제수단 조회
 		mav.addObject("payTypeList", rendererService.getCommonCodeList("G015"));
-		// 쿠폰상태 조회
-		mav.addObject("cpnStatList", rendererService.getCommonCodeList("G232"));
-		// 시간 분 리스트 세팅
-		mav.addObject("mmList", mmList);
-		// 시간 시 리스트 세팅
-		mav.addObject("hhList", hhList);
-		// 입점업체 조회
-		mav.addObject("ibSupplyCompList", rendererService.getSupplyCompanyList("", "N"));
+		// 상위제휴채널 조회
+		mav.addObject("upperAfLinkCdList", rendererService.getCommonCodeList("G053"));
+
+		// 이미 쿠폰 아이디가 있으면 적용대상 조회
+		if(!StringUtils.isBlank(cpnId)) {
+			mode = "U";
+			issueCnt = couponService.getCouponIssueCnt(cpnId);
+			// 쿠폰상세조회
+			mav.addObject("cpnDetail" , couponService.getCouponDetail(cpnId));
+			// 쿠폰적용대상 - 공급업체 조회
+			mav.addObject("cpnDtlRefvalSupplyCompList" , couponService.getCouponRefvalSupplyCompList(cpnId));
+			// 쿠폰적용대상 - 적용상품 조회
+			mav.addObject("cpnDtlRefvalApplyGoodsList" , couponService.getCouponRefvalGoodsList(cpnId , "G260_10"));
+			// 쿠폰적용대상 - 카테고리 조회
+			mav.addObject("cpnDtlRefvalCateList" , couponService.getCouponRefvalCategoryList(cpnId));
+			// 쿠폰적용대상 - 브랜드 조회
+			mav.addObject("cpnDtlRefvalBrandList" , couponService.getCouponRefvalBrandList(cpnId));
+			// 쿠폰적용대상 - 제외상품 조회
+			mav.addObject("cpnDtlRefvalExceptGoodsList" , couponService.getCouponRefvalGoodsList(cpnId , "G260_14"));
+			// 쿠폰 입점업체분담율 조회
+			mav.addObject("cpnDtlBurdenList" , couponService.getCouponBurdenList(cpnId));
+		}
+
+		//issueCnt = 3;
+
+		mav.addObject("mode" , mode);
+		mav.addObject("issueCnt" , issueCnt);
 
-		mav.setViewName("marketing/CouponCreatePopupForm");
+		mav.setViewName("marketing/CouponPopupForm");
 		return mav;
 	}
 
@@ -285,13 +314,112 @@ public class TsaMarketingController extends TsaBaseController {
 	 */
 	@PostMapping("/coupon/save")
 	@ResponseBody
-	public GagaResponse couponSave(@RequestBody Coupon coupon) {
+	public GagaResponse saveCoupon(@RequestBody Coupon coupon) {
 		log.info("couponSave : {}", coupon);
 
-		couponService.couponSave(coupon);
+		couponService.saveCoupon(coupon);
 
 		return super.ok(message.getMessage("SUCC_0001"));
 	}
+
+	/**
+	 * 쿠폰 적용대상 삭제수정
+	 * @param CouponRefval
+	 * @return
+	 * @author xyzp1539
+	 * @since 2021-01-19
+	 */
+	@PostMapping("/coupon/refval/update")
+	@ResponseBody
+	public GagaResponse updateCouponRefval(@RequestBody CouponRefval CouponRefval) {
+		log.info("couponSave : {}", CouponRefval);
+
+		couponService.updateCouponRefval(CouponRefval);
+
+		return super.ok(message.getMessage("SUCC_0001"));
+	}
+
+
+	/**
+	 * 쿠폰발행팝업
+	 * @param
+	 * @return
+	 * @author xyzp1539
+	 * @since 2021-01-21
+	 */
+	@GetMapping("/coupon/cpnPubForCust/popup/form")
+	@ResponseBody
+	public ModelAndView couponPubForCustPopup() {
+		ModelAndView mav = new ModelAndView();
+		String num = "";
+		// 일시 시 리스트 세팅
+		Collection<CommonCode> hhList = new ArrayList<CommonCode>();
+		for (int i = 0; i < 24; i++) {
+			num = "";
+			CommonCode temp = new CommonCode();
+			if (i < 10) {
+				num = "0" + i;
+			} else {
+				num = String.valueOf(i);
+			}
+
+			// 상품상태
+			String[] exceptCds = {"G008_00"};
+			mav.addObject("goodsStatList", rendererService.getCommonCodeList("G008", "Y", exceptCds));
+
+			temp.setCd(num);
+			temp.setCdNm(num + "시");
+
+			hhList.add(temp);
+		}
+		// 일시 분 리스트 세팅
+		Collection<CommonCode> mmList = new ArrayList<CommonCode>();
+		for (int i = 0; i < 60; i++) {
+			num = "";
+			CommonCode temp = new CommonCode();
+			if (i < 10) {
+				num = "0" + i;
+			} else {
+				num = String.valueOf(i);
+			}
+			temp.setCd(num);
+			temp.setCdNm(num + "분");
+
+			mmList.add(temp);
+		}
+		// 시간 분 리스트 세팅
+		mav.addObject("mmList", mmList);
+		// 시간 시 리스트 세팅
+		mav.addObject("hhList", hhList);
+		// 사이트조회
+		mav.addObject("siteCdList" , rendererService.getCommonCodeList("G000"));
+		// 사용가능 고객구분 조회
+		mav.addObject("usableCustGbList", rendererService.getCommonCodeList("G100"));
+		// 사용가능 고객등급 조회
+		mav.addObject("usableCustGradeList", rendererService.getCommonCodeList("G110"));
+		// 쿠폰발행사유 조회
+		mav.addObject("cpnPubReasonList", rendererService.getCommonCodeList("G068"));
+		
+		mav.setViewName("marketing/CouponPubForCustPopupForm");
+
+		return mav;
+	}
+
+	/**
+	 * 고객 쿠폰 발행
+	 * @param  custCoupon
+	 * @return
+	 * @author xyzp1539
+	 * @since 2021-01-21
+	 */
+	@PostMapping("/coupon/insertCustPub")
+	@ResponseBody
+	public GagaResponse saveCouponCustPub(@RequestBody CustCoupon custCoupon ){
+		couponService.saveCouponCustPub(custCoupon);
+
+		return super.ok(message.getMessage("SUCC_0006"));
+
+	}
 	/* // JSM 진행 */
 
 	/* CSB 진행 */

+ 86 - 25
src/main/java/com/style24/admin/biz/web/TsaOrderChangeController.java

@@ -22,6 +22,7 @@ import com.style24.admin.biz.service.TsaOrderService;
 import com.style24.admin.biz.service.TsaRendererService;
 import com.style24.admin.support.controller.TsaBaseController;
 import com.style24.admin.support.security.session.TsaSession;
+import com.style24.core.biz.service.TscOrderChangeService;
 import com.style24.core.support.env.TscConstants;
 import com.style24.core.support.message.TscMessageByLocale;
 import com.style24.persistence.domain.Delivery;
@@ -57,10 +58,63 @@ public class TsaOrderChangeController extends TsaBaseController {
 	private TsaOrderChangeService orderChangeService;
 	
 	@Autowired
-	private TsaDeliveryService deliveryService;
+	private TscOrderChangeService coreOrderChangeService;
 	
 	/**
 	 * 취소요청 화면
+	 * 취소신청 (NAPY, 외부몰) (배치)
+	 * @param OrderChange - 주문취소신청정보
+	 * @return
+	 * @author jsh77b
+	 * @since 2021. 01. 20
+	 */
+	@PostMapping("/cnclReq")
+	@ResponseBody
+	public GagaResponse cnclReq(@RequestBody OrderChange cnclReq) {
+		
+		GagaMap mav = new GagaMap();
+		
+		if (cnclReq== null) {
+			throw new IllegalStateException(message.getMessage("FAIL_1001"));
+		}
+		
+		// * 필요 데이타
+		// 주문번호, 주문상세, 취소신청수량, 신청구분(취소신청, 취소완료), 몰구분(자사, NAPY, EXTMALL)
+
+		// 1. 주문변경정보등록
+		// TB_ORDER_CHANGE (등록)
+		// TB_ORDER_CHANGE_DTL (등록)
+		
+		return super.ok("성공");
+	}
+	
+	/**
+	 * 취소신청컨펌 (NAPY, 외부몰) (관리자)
+	 * @param OrderChange - 주문취소신청정보
+	 * @return
+	 * @author jsh77b
+	 * @since 2021. 01. 20
+	 */
+	@PostMapping("/cnclReqComplete")
+	@ResponseBody
+	public GagaResponse cnclReqComplete(@RequestBody OrderChange cnclReq) {
+		GagaMap mav = new GagaMap();
+		
+		if (cnclReq== null) {
+			throw new IllegalStateException(message.getMessage("FAIL_1001"));
+		}
+		
+		// * 필요 데이타
+		// 주문번호, 주문상세, 취소신청수량, 신청구분(취소신청, 취소완료), 몰구분(자사, NAPY, EXTMALL)
+		
+		// 1. 취소신청목록으로 변환
+		List<Order> cnclReqList = coreOrderChangeService.getCnclReqList(cnclReq);
+		
+		return super.ok("성공");
+	}
+	
+	/**
+	 * 취소요청 화면 (관리자)
 	 * 
 	 * @param ordNo - 주문번호
 	 * @param cncWait - 취소대기요청 구분
@@ -84,10 +138,10 @@ public class TsaOrderChangeController extends TsaBaseController {
 		ordDtlStatArr[3] = TscConstants.OrderDetailStat.DELIVERY_PREPARE.value();
 		order.setOrdDtlStatArr(ordDtlStatArr);
 
-		mav.addObject("chgReasonList"				, rendererService.getAvailCommonCodeList("G686"));			// 취소사유
-		mav.addObject("cancelRequestTargetList"		, orderChangeService.getCancelRequestTargetList(order));	// 취소요청대상 목록
-		mav.addObject("orderInfoList"				, orderService.getOrderInfoList(order));					// 주문정보
-		mav.addObject("ordNo"						, ordNo);													// 주문번호
+		mav.addObject("chgReasonList"				, rendererService.getAvailCommonCodeList("G686"));				// 취소사유
+		mav.addObject("cancelRequestTargetList"		, coreOrderChangeService.getCancelRequestTargetList(order));	// 취소요청대상목록
+		mav.addObject("orderInfoList"				, orderService.getOrderInfoList(order));						// 주문정보
+		mav.addObject("ordNo"						, ordNo);														// 주문번호
 
 		mav.setViewName("order/CancelRequestForm");
 		
@@ -95,7 +149,7 @@ public class TsaOrderChangeController extends TsaBaseController {
 	}
 	
 	/**
-	 * 주문취소신청
+	 * 주문취소완료 (관리자)
 	 * @param Collection<Order> - 주문취소신청목록
 	 * @return
 	 * @author jsh77b
@@ -110,16 +164,20 @@ public class TsaOrderChangeController extends TsaBaseController {
 		if (cancelReq== null) {
 			throw new IllegalStateException(message.getMessage("FAIL_1001"));
 		}
-
-		List<Order> cancelReqList = cancelReq.getCancelReqList(); // 취소요청정보
+		
+		List<Order> cnclReqList = cancelReq.getCancelReqList(); // 취소요청정보
 		
 		// To Do List
-		// @ 결품취소로직 현재는 일반취소로직만존재
-		// @ 주문취소 취소시 상태값 체크
-		// @ 취소, 반품시 배송비 체크 로직 
+		// @ 결품취소로직 추가
+		// @ 주문취소시 상태값 체크
+		// @ 취소, 반품시 배송비 체크 로직 (선결제 로직)
+		
+		// 1. 세션회원조회
+		int userNo = TsaSession.getInfo().getUserNo();
 		
 		// 1. 환불금액정보 계산 & 조회
-		mav = orderChangeService.orderCancelRefundAmt(cancelReqList);
+		// 2021.01.19 취소신청정보를 목록 (주문상세번호, 취소/반품수량) 으로 표현		
+		mav = coreOrderChangeService.cnclRtnRefundAmt(cnclReqList);
 		
 		// 2. 주문변경기본정보 설정
 		mav.set("ordNo"			, cancelReq.getOrdNo());
@@ -134,7 +192,7 @@ public class TsaOrderChangeController extends TsaBaseController {
 		mav.set("isCustomer"	, cancelReq.getIsCustomer());
 		
 		// 3. 주문변경 DB 등록 (주문정보, 배송정보)
-		orderChangeService.orderCancel(mav);
+		coreOrderChangeService.cnclComplete(mav, userNo);
 		
 		return super.ok("성공");
 	}
@@ -157,7 +215,7 @@ public class TsaOrderChangeController extends TsaBaseController {
 		}
 		
 		// 1. 환불금액정보 계산 & 조회
-		mav = orderChangeService.orderCancelRefundAmt(cancelReqList);
+		mav = coreOrderChangeService.cnclRtnRefundAmt(cancelReqList);
 		
 		return mav;
 	}
@@ -179,21 +237,21 @@ public class TsaOrderChangeController extends TsaBaseController {
 		
 		order.setOrdNo(ordNo);
 		
-		// 취소가능 주문상세상탭값 설정
+		// 반품가능 주문상세상탭값 설정
 		String[] ordDtlStatArr = new String[3];
 		ordDtlStatArr[0] = TscConstants.OrderDetailStat.SHIPPING.value();
 		ordDtlStatArr[1] = TscConstants.OrderDetailStat.SHIP_COMPLETE.value();
 		ordDtlStatArr[2] = TscConstants.OrderDetailStat.DELIVERY_COMPLETE.value();
 		order.setOrdDtlStatArr(ordDtlStatArr);
 		
-		mav.addObject("chgReasonList"				, rendererService.getAvailCommonCodeList("G688"));			// 취소사유
-		mav.addObject("cancelRequestTargetList"		, orderChangeService.getCancelRequestTargetList(order));	// 취소요청대상 목록
-		mav.addObject("orderInfoList"				, orderService.getOrderInfoList(order));					// 주문정보
-		mav.addObject("ordNo"						, ordNo);													// 주문번호
+		mav.addObject("chgReasonList"				, rendererService.getAvailCommonCodeList("G688"));				// 취소사유
+		mav.addObject("cancelRequestTargetList"		, coreOrderChangeService.getCancelRequestTargetList(order));	// 취소요청대상 목록
+		mav.addObject("orderInfoList"				, orderService.getOrderInfoList(order));						// 주문정보
+		mav.addObject("ordNo"						, ordNo);														// 주문번호
 		
-		mav.addObject("orderDelvRtnAddrInfo"		, orderService.getDeliveryAddrList(order));					// 배송정보
-		mav.addObject("TelExcNoList"				, rendererService.getAvailCommonCodeList("G095"));			// 전화번호국번
-		mav.addObject("PhnExcNoList"				, rendererService.getAvailCommonCodeList("G096"));			// (휴대전화)번호국번
+		mav.addObject("orderDelvRtnAddrInfo"		, orderService.getDeliveryAddrList(order));						// 배송정보
+		mav.addObject("TelExcNoList"				, rendererService.getAvailCommonCodeList("G095"));				// 전화번호국번
+		mav.addObject("PhnExcNoList"				, rendererService.getAvailCommonCodeList("G096"));				// (휴대전화)번호국번
 
 		mav.setViewName("order/ReturnRequestForm");
 		
@@ -224,8 +282,11 @@ public class TsaOrderChangeController extends TsaBaseController {
 		// @ 주문취소 취소시 상태값 체크
 		// @ 취소, 반품시 배송비 체크 로직 
 		
+		// 1. 세션회원조회
+		int userNo = TsaSession.getInfo().getUserNo();
+		
 		// 1. 환불금액정보 계산 & 조회
-		mav = orderChangeService.orderCancelRefundAmt(cancelReqList);
+		mav = coreOrderChangeService.cnclRtnRefundAmt(cancelReqList);
 		
 		// 2. 주문변경기본정보 설정
 		mav.set("ordNo"			, cancelReq.getOrdNo());
@@ -248,7 +309,7 @@ public class TsaOrderChangeController extends TsaBaseController {
 		mav.set("chgerTelno"	, cancelReq.getChgerTelno());
 		
 		// 4. 주문변경 DB 등록 (주문정보, 배송정보)
-		orderChangeService.orderReturn(mav);
+		coreOrderChangeService.rtnReq(mav, userNo);
 		
 		return super.ok("성공");
 	}
@@ -356,7 +417,7 @@ public class TsaOrderChangeController extends TsaBaseController {
 		ordDtlStatArr[2] = TscConstants.OrderDetailStat.DELIVERY_COMPLETE.value();
 		order.setOrdDtlStatArr(ordDtlStatArr);
 
-		Collection<Order> cancelRequestTargetList = orderChangeService.getCancelRequestTargetList(order);
+		Collection<Order> cancelRequestTargetList = coreOrderChangeService.getCancelRequestTargetList(order);
 
 		Collection<Order> orderInfoList = orderService.getOrderInfoList(order);
 

+ 13 - 13
src/main/java/com/style24/admin/biz/web/TsaRendererController.java

@@ -199,18 +199,18 @@ public class TsaRendererController extends TsaBaseController {
 //	public Collection<AdmCommonCode> getSellStoreList() {
 //		return rendererService.getSellStoreList();
 //	}
-//
-//	/**
-//	 * 제휴링크 목록
-//	 * @param afChannel - 제휴채널
-//	 * @return
-//	 * @author gagamel
-//	 * @since 2020. 5. 4
-//	 */
-//	@GetMapping("/aflink/list/{afChannel}")
-//	@ResponseBody
-//	public Collection<AdmCommonCode> getAflinkList(@PathVariable String afChannel) {
-//		return rendererService.getAflinkList(afChannel);
-//	}
+
+	/**
+	 * 제휴채널 목록
+	 * @param afChannel - 상위제휴채널
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 20
+	 */
+	@GetMapping("/aflink/list/{afChannel}")
+	@ResponseBody
+	public Collection<CommonCode> getAflinkList(@PathVariable String afChannel) {
+		return rendererService.getAflinkList(afChannel);
+	}
 
 }

+ 37 - 6
src/main/java/com/style24/admin/biz/web/TsaSettleController.java

@@ -1,16 +1,21 @@
 package com.style24.admin.biz.web;
 
+import java.util.Collection;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
+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 org.springframework.web.servlet.ModelAndView;
 
-import com.style24.admin.biz.service.TsaBusinessService;
 import com.style24.admin.biz.service.TsaRendererService;
+import com.style24.admin.biz.service.TsaSettleService;
 import com.style24.admin.support.controller.TsaBaseController;
 import com.style24.admin.support.security.session.TsaSession;
-import com.style24.core.support.message.TscMessageByLocale;
+import com.style24.persistence.domain.AflinkFee;
 
 import lombok.extern.slf4j.Slf4j;
 
@@ -26,10 +31,7 @@ import lombok.extern.slf4j.Slf4j;
 public class TsaSettleController extends TsaBaseController {
 
 	@Autowired
-	private TscMessageByLocale message;
-
-	@Autowired
-	private TsaBusinessService businessService;
+	private TsaSettleService settleService;
 
 	@Autowired
 	private TsaRendererService rendererService;
@@ -166,4 +168,33 @@ public class TsaSettleController extends TsaBaseController {
 		return mav;
 	}
 
+	/**
+	 * 제휴채널정산 화면
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 20
+	 */
+	@GetMapping("/aflink/fee/form")
+	public ModelAndView afLinkFeeForm() {
+		ModelAndView mav = new ModelAndView("settle/AfLinkSettleForm");
+
+		// 제휴채널 목록
+		mav.addObject("afChannelList", rendererService.getAvailCommonCodeList("G053"));
+
+		return mav;
+	}
+
+	/**
+	 * 제휴채널정산 목록
+	 * @param aflinkFee - 제휴채널수수료 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 20
+	 */
+	@PostMapping("/aflink/fee/list")
+	@ResponseBody
+	public Collection<AflinkFee> getAfLinkFeeList(@RequestBody AflinkFee aflinkFee) {
+		return settleService.getAfLinkFeeList(aflinkFee);
+	}
+
 }

+ 3 - 0
src/main/java/com/style24/admin/biz/web/TsaSystemController.java

@@ -142,6 +142,9 @@ public class TsaSystemController extends TsaBaseController {
 		// 외부몰벤더 콤보박스 목록
 		mav.addObject("vendorList", rendererService.getCommonCodeList("G003", "Y", TsaSession.getInfo().getSupplyCompCd()));
 
+		// 제휴채널 콤보박스 목록
+		mav.addObject("afLinkList", rendererService.getAllAflinkList());
+
 		if (mode.equals("U")) {
 			// 어드민사용자정보
 			mav.addObject("userInfo", systemService.getUser(userNo));

+ 35 - 0
src/main/java/com/style24/persistence/domain/AflinkFee.java

@@ -0,0 +1,35 @@
+package com.style24.persistence.domain;
+
+import com.style24.persistence.TscBaseDomain;
+
+import lombok.Data;
+
+/**
+ * 제휴채널수수료 Domain
+ *
+ * @author gagamel
+ * @since 2021. 1. 20
+ */
+@SuppressWarnings("serial")
+@Data
+public class AflinkFee extends TscBaseDomain {
+
+	private String afLinkCd;	// 제휴채널코드
+	private String afLinkNm;	// 제휴채널명
+	private String afChannel;	// 상위제휴채널
+	private String afChannelNm;	// 상위제휴채널명
+	private String occurDt;		// 발생(정산)일자
+	private String ordNo;		// 주문번호
+	private String ordDtlStat;	// 주문상세상태
+	private long sellAmt;		// 판매금액
+	private long cpnDcAmt;		// 쿠폰할인금액
+	private long pntDcAmt;		// 포인트사용금액
+	private long gfcdUseAmt;	// 상품권사용금액
+	private long payAmt;		// 결제액(VAT포함)
+	private long salesAmt;		// 매출액(VAT제외)
+
+	// 검색조건
+	private String startDt;
+	private String endDt;
+
+}

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

@@ -41,7 +41,7 @@ public class Category extends TscBaseDomain {
 	// 검색조건
 	private String siteCd;		// 사이트코드
 	private Integer selLvl;		// 선택레벨
-	private String callbackFn;	// 콜백함수
+	private String callBackFun;	// 콜백함수
 
 	// 품목카테고리매핑관리 화면에서 사용
 	private String fullCateNo;	// FULL카테고리번호

+ 13 - 22
src/main/java/com/style24/persistence/domain/Coupon.java

@@ -1,5 +1,6 @@
 package com.style24.persistence.domain;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.style24.persistence.TscBaseDomain;
 import com.style24.persistence.TscPageRequest;
 import lombok.Data;
@@ -15,7 +16,7 @@ import java.util.Collection;
 @SuppressWarnings("serial")
 @Data
 public class Coupon extends TscBaseDomain {
-
+    // TB_COUPON
     private String  cpnId;					// 쿠폰ID
     private String  cpnNm;					// 쿠폰명
     private String  siteCd;					// 사이트코드(공통코드G000)
@@ -52,30 +53,20 @@ public class Coupon extends TscBaseDomain {
     private String  buyEddt;				// 구매기간일자(TO)
     private Integer issueCnt;				// 쿠폰발급개수
     private Integer useCnt;					// 쿠폰사용개수
-    private String  payType;                 // 결제수단
+    private String  payType;                // 결제수단
     private String  custJoinYn;             // 신규회원여부
+    private String  afChannel;              // 제휴링크
 
-    private String  supplyCompCd;            // 공급업체코드
-    private int     burdenRate;                 // 업체분담율
-    private String  delYn;                   // 삭제여부
-    private String  supplyCompNm;            // 공급업체명
-
-    private String  brandCd;                 // 브랜드코드
-    private String  brandEnm;                // 브랜드영문명
-
-    private String  goodsGb;                 // 상품구분
-    private String  goodsCd;                 // 상품코드
-    private String  goodsNm;                 // 상품명
-
-    private String  cateNm;                  // 카테고리코드명
-    private String  cateNo;                  // 카테고리코드
+    // 그리드 파라미터
+    private String  supplyCompList;         // 공급업체 리스트
+    private String  brandList;              // 브랜드 리스트
+    private String  applyGoodsList;         // 적용상품 리스트
+    private String  exceptGoodsList;        // 제외상품 리스트
+    private String  cateList;               // 카테고리 리스트
+    private String  burdenList;             // 업체 분담율 리스트
 
-    private String  supplyCompList;          // 공급업체 리스트
-    private String  brandList;               // 브랜드 리스트
-    private String  applyGoodsList;          // 적용상품 리스트
-    private String  exceptGoodsList;         // 제외상품 리스트
-    private String  burdenList;              // 업체 분담율 리스트
-    private String  cateList;                // 카테고리 리스트
+    // TB_COUPON_BAN_GOODS
+    private Integer  cpnBanGoodsSq;         //  제외상품시퀀스
 
     // Pagination
     private TscPageRequest pageable;

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

@@ -0,0 +1,22 @@
+package com.style24.persistence.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.style24.persistence.TscBaseDomain;
+import lombok.Data;
+
+/**
+ * 쿠폰 적용대상 도메인
+ * @author xyzp1539
+ * @since 2021-01-20
+ */
+@SuppressWarnings("serial")
+@Data
+public class CouponBurden extends TscBaseDomain {
+    // TB_COUPON_REFVAL
+    private String  cpnId;					// 쿠폰ID
+    private String  supplyCompCd;           // 공급업체코드
+    private Integer burdenRate;             // 업체분담율
+    private String  delYn;                  // 삭제여부
+    private String  supplyCompNm;           // 공급업체명
+
+}

+ 43 - 0
src/main/java/com/style24/persistence/domain/CouponRefval.java

@@ -0,0 +1,43 @@
+package com.style24.persistence.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.style24.persistence.TscBaseDomain;
+import com.style24.persistence.TscPageRequest;
+import lombok.Data;
+
+/**
+ * 쿠폰 적용대상 도메인
+ * @author xyzp1539
+ * @since 2021-01-20
+ */
+@SuppressWarnings("serial")
+@Data
+public class CouponRefval extends TscBaseDomain {
+    // TB_COUPON_REFVAL
+    private String  cpnId;					// 쿠폰ID
+    private String  cpnTarget;              // 쿠폰대상구분(공통코드G260)
+    private String  refVal;                 // 관련값(쿠폰대상이 "10:상품"일 때는 상품코드, "20:브랜드"일 때는 브랜드코드, "30:카테고리"일 때는 카테고리코드, "40:제외상품"일 때는 상품코드)
+    private Integer cpnRefvalSq;            // 쿠폰대상일련번호
+    private String  refFormalGb;            // 정상/이월구분(G009). 쿠폰대상구분이 카테고리일 경우 사용
+    private String  refBrandCd;             // 브랜드코드. 쿠폰대상구분이 카테고리일 경우 사용
+    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+    private Integer[] cpnRefvalSqArr;       // 쿠폰적용대상시퀀스배열
+
+    // 그리드 컬럼들
+    private String  supplyCompCd;           // 공급업체코드
+    private Integer burdenRate;             // 업체분담율
+    private String  delYn;                  // 삭제여부
+    private String  supplyCompNm;           // 공급업체명
+    private String  brandCd;                // 브랜드코드
+    private String  brandEnm;               // 브랜드영문명
+    private String  goodsGb;                // 상품구분
+    private String  goodsCd;                // 상품코드
+    private String  goodsNm;                // 상품명
+    private String  cateNm;                 // 카테고리코드명
+    private String  cateNo;                 // 카테고리코드
+    private String  cateList;               // 카테고리 리스트
+    private String  formalGb;               // 이월정상구분
+    private String  siteCd;                 // 사이트코드
+    private String  cateGb;                 // 카테고리구분
+
+}

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

@@ -0,0 +1,28 @@
+package com.style24.persistence.domain;
+
+import com.style24.persistence.TscBaseDomain;
+import com.style24.persistence.TscPageRequest;
+import lombok.Data;
+import org.codehaus.groovy.runtime.dgmimpl.arrays.IntegerArrayGetAtMetaMethod;
+
+/**
+ * 고객쿠폰 도메인
+ * @author xyzp1539
+ * @since 2020-12-21
+ */
+@SuppressWarnings("serial")
+@Data
+public class CustCoupon extends TscBaseDomain {
+    private Integer custCpnSq;              // 고객쿠폰일련번호
+    private Integer custNo;                 // 고객번호
+    private String  cpnId;                  // 쿠폰아이디
+    private String  availStdt;              // 유효시작일시
+    private String  availEddt;              // 유효종료일시
+    private String  pubReason;              // 발행사유(공통코드G250)
+    private String  pubReasonDtl;           // 발행사유상세
+    private String  usedDt;                 // 사용된일시
+    private String  endAlimSendYn;          // 만료알림발송여부
+
+    // 그리드 컬럼
+    private String  custList;
+}

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

@@ -29,5 +29,8 @@ public class CustomerSearch extends TscBaseDomain {
 	private String emailAgreeYn;
 	private String appAgreeYn;
 	private String secedeRsn;
+	private String custNm;
+	private String email;
+	private String custId;
 
 }

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

@@ -79,6 +79,7 @@ public class Goods extends TscBaseDomain {
 	private int brandNo;			//브랜드번호
 	private String supplyVendorCd;	//벤더코드
 
+	private String goodsDesc;		//상품상세(as-is, 입점)
 	private String goodsPcTopDesc;
 	private String goodsPcDownDesc;
 	private String goodsMobileTopDesc;

+ 8 - 0
src/main/java/com/style24/persistence/domain/GoodsSearch.java

@@ -106,6 +106,14 @@ public class GoodsSearch extends TscBaseDomain {
 	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
 	private String[] conditionList;
 
+	/* 다다익선 Multi 추가 */
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiSupplyCompCd;
+
+	private String pageingYn;
+
+	/* 다다익선 Multi 추가 */
+
 	// Pagination
 	private TscPageRequest pageable;
 	private int pageNo = 1;

+ 1 - 4
src/main/java/com/style24/persistence/domain/MoreBetter.java

@@ -21,12 +21,9 @@ public class MoreBetter extends TscBaseDomain {
 	private String tmtbStat;		// 프로모션 상태
 	private String tmtbStdt;		// 프로모션 시작일
 	private String tmtbEddt;		// 프로모션 종료일
+	private String applyGb;			// 적용구분값 (G810_10|수량, G810_11|금액)
 	private String multiYn;			// 복수,단수설정
 	private String delYn;			// 삭제여부
-	//private Integer regNo;			// 등록자
-	//private String  regDt;			// 등록일시
-	private Integer udpNo;			// 수정자
-	private String  udtDt;			// 수정일시
 	private String searchGubun;		// 프로모션 조회 검색 구분
 	private String searchTxt;		// 프로모션 검색 조건
 	private String gbn;				// 팝업 구분 : C=등록, U=수정

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

@@ -19,11 +19,6 @@ public class MoreBetterBurden extends TscBaseDomain {
 	private String tmtbSupplyCd;	// 업체코드
 	private String tmtbBurdenRate;	// 업체분담율
 	private String useYn;			// 사용여부
-	//private Integer regNo;			// 등록자
-	//private String  regDt;			// 등록일시
-	private Integer udpNo;			// 수정자
-	private String  udtDt;			// 수정일시
-
 	//private String supplyCompCd;
 	private String burdenRate;
 

+ 2 - 6
src/main/java/com/style24/persistence/domain/MoreBetterGoods.java

@@ -15,17 +15,13 @@ import lombok.Data;
 @Data
 public class MoreBetterGoods extends TscBaseDomain {
 	// 다다익선 적용대상
-	private Integer tmtbGoodsSq;		// 업체분담율Sq
+	private Integer tmtbGoodsSq;		// 다다익선 적용대상 시퀀스
+	private Integer tmtbApplyGoodsSq;		// 다다익선 실제적용대상 시퀀스
 	private Integer tmtbSq;				// 프로모션Sq
 	private String goodsGb;			// 공통코드 (G800_10|기본상품, G800_20|적용상품, G800_30|제외상품, G800_40|ALL)
 	private String targetGb;		// 적용대상 (G260_10|상품, G260_12|브랜드, G260_13|공급처)
 	private String targetVal;		// 브랜드코드, 상품코드, 공급처코드
 	private String delYn;			// 삭제여부
-	//private Integer regNo;			// 등록자
-	//private String  regDt;			// 등록일시
-	private Integer udpNo;			// 수정자
-	private String  udtDt;			// 수정일시
-
 	private String supplyCompCd;
 	private String supplyCompNm;
 	private String brandCd;

+ 0 - 4
src/main/java/com/style24/persistence/domain/MoreBetterSection.java

@@ -25,10 +25,6 @@ public class MoreBetterSection extends TscBaseDomain {
 	private Integer dcVal;			// 할인값
 
 	private String  delYn;			// 삭제여부
-	//private Integer regNo;			// 등록자
-	//private String  regDt;			// 등록일시
-	private Integer udpNo;			// 수정자
-	private String  udtDt;			// 수정일시
 
 	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
 	private String[] arrSectionSq;

+ 0 - 84
src/main/java/com/style24/persistence/domain/OrderChange.java

@@ -1,84 +0,0 @@
-package com.style24.persistence.domain;
-
-import java.util.List;
-
-import com.style24.persistence.TscBaseDomain;
-
-import lombok.Data;
-
-/**
- * 주문 취소 Domain
- *
- * @author jsh77b
- * @since 2020. 11. 16
- */
-@SuppressWarnings("serial")
-@Data
-public class OrderChange extends TscBaseDomain {
-	
-	List<Order> cancelReqList;
-	private int ordNo;
-	
-	private int ordChgSq;
-	private String chgGb;
-	private String chgReason;
-	private String chgMemo;
-	private String chgerNm;
-	private String chgerPhnno;
-	private String chgerTelno;
-	private String chgerEmail;
-	private String chgerZipNo;
-	private String chgerBaseAddr;
-	private String chgerDtlAddr;
-	private String chgerRtnMemo;
-	private int addPayCost;
-	private int addPayAmt;
-	private String wdInvoiceNo;
-	private String wdInvoiceSendYn;
-	private String wdStdt;
-	private String wdEddt;
-	private String shipCompCd;
-	
-	private int ordDtlNo;
-	private int chgQty;
-	private String chgStat;
-	private String chgStatNm;
-	private String whMemo;
-	
-	private String accountNo;
-	private String accountNm;
-	private String bankCd;
-	private String bankNm;
-
-	private String allCanYn;
-
-	private String isCustomer;
-
-
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

+ 369 - 79
src/main/java/com/style24/persistence/mybatis/shop/TsaCoupon.xml

@@ -5,67 +5,67 @@
 	<select id="getCouponList" parameterType="Coupon" resultType="Coupon">
 		/* TsaCoupon.getCouponList */
 		SELECT T.*
-		, COUNT(CUST_CPN_SQ) AS ISSUE_CNT
-		, COUNT(USED_DT) AS USE_CNT
-		FROM (
-		SELECT SITE_CD
-		, CPN_ID
-		, CPN_NM
-		, USABLE_CUST_GB
-		, CPN_TYPE
-		, DC_WAY
-		, DC_PVAL
-		, DC_MVAL
-		, MAX_DC_AMT
-		, PD_GB
-		, AVAIL_STDT
-		, AVAIL_EDDT
-		, FN_GET_USER_NM(REG_NO) AS REG_NM
-		, REG_DT
-		FROM TB_COUPON
-		WHERE 1=1
-		<if test="siteCd != null and siteCd != ''">
-			AND SITE_CD = #{siteCd}
-		</if>
-		<if test="cpnId != null and cpnId != ''">
-			AND CPN_ID = #{cpnId}
-		</if>
-		<if test="cpnType != null and cpnType != ''">
-			AND CPN_TYPE = #{cpnType}
-		</if>
-		<if test="regNo != null and regNo != ''">
-			AND REG_NO = #{regNo}
-		</if>
-		<if test="dcWay != null and dcWay != ''">
-			AND DC_WAY = #{dcWay}
-		</if>
-		<if test="cpnNm != null and cpnNm != ''">
-			AND CPN_NM LIKE LOWER('%' || #{cpnNm} || '%')
-		</if>
-		<if test="pdGb != null and pdGb != ''">
-			AND PD_GB = #{pdGb}
-		</if>
-		<if test="availStdt != null and availStdt != '' and availEddt != null and availEddt != ''">
-			AND AVAIL_STDT >= DATE_FORMAT(#{availStdt} , '%Y-%m-%d')
-			AND AVAIL_EDDT <![CDATA[ <= ]]> DATE_FORMAT(#{availEddt} , '%Y-%m-%d')
-		</if>
-		) T
+			 , COUNT(CUST_CPN_SQ) AS ISSUE_CNT
+			 , COUNT(USED_DT) AS USE_CNT
+		 FROM (
+				SELECT SITE_CD
+					 , CPN_ID
+					 , CPN_NM
+					 , USABLE_CUST_GB
+					 , CPN_TYPE
+					 , DC_WAY
+					 , DC_PVAL
+					 , DC_MVAL
+					 , MAX_DC_AMT
+					 , PD_GB
+					 , AVAIL_STDT
+					 , AVAIL_EDDT
+					 , FN_GET_USER_NM(REG_NO) AS REG_NM
+					 , REG_DT
+				  FROM TB_COUPON
+				 WHERE 1=1
+				<if test="siteCd != null and siteCd != ''">
+				   AND SITE_CD = #{siteCd}
+				</if>
+				<if test="cpnId != null and cpnId != ''">
+				   AND CPN_ID = #{cpnId}
+				</if>
+				<if test="cpnType != null and cpnType != ''">
+				   AND CPN_TYPE = #{cpnType}
+				</if>
+				<if test="regNo != null and regNo != ''">
+				   AND REG_NO = #{regNo}
+				</if>
+				<if test="dcWay != null and dcWay != ''">
+				   AND DC_WAY = #{dcWay}
+				</if>
+				<if test="cpnNm != null and cpnNm != ''">
+				   AND CPN_NM LIKE LOWER('%' || #{cpnNm} || '%')
+				</if>
+				<if test="pdGb != null and pdGb != ''">
+				   AND PD_GB = #{pdGb}
+				</if>
+				<if test="availStdt != null and availStdt != '' and availEddt != null and availEddt != ''">
+				   AND AVAIL_STDT >= DATE_FORMAT(#{availStdt} , '%Y-%m-%d')
+				   AND AVAIL_EDDT <![CDATA[ <= ]]> DATE_FORMAT(#{availEddt} , '%Y-%m-%d')
+				</if>
+			) T
 		LEFT OUTER JOIN TB_CUST_COUPON CC
-		ON T.CPN_ID = CC.CPN_ID
+		             ON T.CPN_ID = CC.CPN_ID
 		GROUP BY  T.SITE_CD
-		, T.CPN_ID
-		, T.CPN_NM
-		, T.USABLE_CUST_GB
-		, T.CPN_TYPE
-		, T.DC_WAY
-		, T.DC_PVAL
-		, T.DC_MVAL
-		, T.MAX_DC_AMT
-		, T.PD_GB
-		, T.AVAIL_STDT
-		, T.AVAIL_EDDT
-		, T.REG_NM
-		, T.REG_DT
+				, T.CPN_ID
+				, T.CPN_NM
+				, T.USABLE_CUST_GB
+				, T.CPN_TYPE
+				, T.DC_WAY
+				, T.DC_PVAL
+				, T.DC_MVAL
+				, T.MAX_DC_AMT
+				, T.PD_GB
+				, T.AVAIL_STDT
+				, T.AVAIL_EDDT
+				, T.REG_NM
+				, T.REG_DT
 		ORDER BY  T.REG_DT DESC
 	</select>
 
@@ -73,32 +73,32 @@
 	<select id="getCouponListCnt" parameterType="Coupon" resultType="int">
 		/* TsaCoupon.getCouponListCnt */
 		SELECT COUNT(1)
-		FROM TB_COUPON
-		WHERE 1=1
+		  FROM TB_COUPON
+		 WHERE 1=1
 		<if test="siteCd != null and siteCd != ''">
-			AND SITE_CD = #{siteCd}
+		   AND SITE_CD = #{siteCd}
 		</if>
 		<if test="cpnId != null and cpnId != ''">
-			AND CPN_ID = #{cpnId}
+		   AND CPN_ID = #{cpnId}
 		</if>
 		<if test="cpnType != null and cpnType != ''">
-			AND CPN_TYPE = #{cpnType}
+		   AND CPN_TYPE = #{cpnType}
 		</if>
 		<if test="regNo != null and regNo != ''">
-			AND REG_NO = #{regNo}
+		   AND REG_NO = #{regNo}
 		</if>
 		<if test="dcWay != null and dcWay != ''">
-			AND DC_WAY = #{dcWay}
+		   AND DC_WAY = #{dcWay}
 		</if>
 		<if test="cpnNm != null and cpnNm != ''">
-			AND CPN_NM LIKE LOWER('%' || #{cpnNm} || '%')
+		   AND CPN_NM LIKE LOWER('%' || #{cpnNm} || '%')
 		</if>
 		<if test="pdGb != null and pdGb != ''">
-			AND PD_GB = #{pdGb}
+		   AND PD_GB = #{pdGb}
 		</if>
 		<if test="availStdt != null and availStdt != '' and availEddt != null and availEddt != ''">
-			AND AVAIL_STDT >= DATE_FORMAT(#{availStdt} , '%Y-%m-%d')
-			AND AVAIL_EDDT <![CDATA[ <= ]]> DATE_FORMAT(#{availEddt} , '%Y-%m-%d')
+		   AND AVAIL_STDT >= DATE_FORMAT(#{availStdt} , '%Y-%m-%d')
+		   AND AVAIL_EDDT <![CDATA[ <= ]]> DATE_FORMAT(#{availEddt} , '%Y-%m-%d')
 		</if>
 	</select>
 
@@ -109,9 +109,7 @@
 			CPN_ID
 		  , CPN_NM
 		  , SITE_CD
-		  <if test='afLinkCd != null and afLinkCd != ""'>
 		  , AF_LINK_CD
-	      </if>
 		  , USABLE_CUST_GB
 		  , USABLE_CUST_GRADE
 		  , CPN_TYPE
@@ -134,10 +132,8 @@
 		  , TOT_PUB_LIMIT_QTY
 		  , ONE_PUB_QTY
 		  , DN_GB
-		  <if test='dnGb != null and dnGb == "G058_20"'>
 		  , DOWN_STDT
 		  , DOWN_EDDT
-		  </if>
 		  , BUY_LIMIT_AMT
 		  , PLAN_SQ
 		  , REISSUANCE
@@ -165,9 +161,7 @@
 		    #{cpnId}
 		  , #{cpnNm}
 		  , #{siteCd}
-		  <if test='afLinkCd != null and afLinkCd != ""'>
 		  , #{afLinkCd}
-		  </if>
 		  , #{usableCustGb}
 		  , #{usableCustGrade}
 		  , #{cpnType}
@@ -190,10 +184,8 @@
 		  , #{totPubLimitQty}
 		  , #{onePubQty}
 		  , #{dnGb}
-		  <if test='dnGb != null and dnGb == "G058_20"'>
 		  , DATE_FORMAT(#{downStdt} , '%Y-%m-%d %H:%i:%s')
 		  , DATE_FORMAT(#{downEddt} , '%Y-%m-%d %H:%i:%s')
-		  </if>
 		  , #{buyLimitAmt}
 		  , #{planSq}
 		  , #{reissuance}
@@ -217,7 +209,43 @@
 		  , #{payType}
 		  </if>
 		  , #{custJoinYn}
-		)
+		) ON DUPLICATE KEY UPDATE
+			CPN_NM = #{cpnNm}
+		  , SITE_CD = #{siteCd}
+		  , AF_LINK_CD = #{afLinkCd}
+		  , USABLE_CUST_GB = #{usableCustGb}
+		  , USABLE_CUST_GRADE = #{usableCustGrade}
+		  , CPN_TYPE = #{cpnType}
+		  , APPLY_SCOPE = #{applyScope}
+		  , DC_WAY = #{dcWay}
+		  , DC_PVAL = #{dcPval}
+		  , DC_MVAL = #{dcMval}
+		  , DC_AVAL = #{dcAval}
+		  , MAX_DC_AMT = #{maxDcAmt}
+		  , PD_GB = #{pdGb}
+		  , AVAIL_STDT = #{availStdt}
+		  , AVAIL_EDDT = #{availEddt}
+		  , AVAIL_DAYS = #{availDays}
+		  , CUST_PUB_LIMIT_QTY = #{custPubLimitQty}
+		  , TOT_PUB_LIMIT_QTY = #{totPubLimitQty}
+		  , ONE_PUB_QTY = #{onePubQty}
+		  , DOWN_STDT = #{downStdt}
+		  , DOWN_EDDT = #{downEddt}
+		  , BUY_LIMIT_AMT = #{buyLimitAmt}
+		  , PLAN_SQ = #{planSq}
+		  , REISSUANCE = #{reissuance}
+		  , CPN_STAT = #{cpnStat}
+		  , END_ALIM_YN = #{endAlimYn}
+		  , UPD_NO = #{updNo}
+		  , UPD_DT = now()
+		  , FIRST_YN = #{firstYn}
+		  , DOWN_YN = #{downYn}
+		  , CUST_JOIN_STDT = #{custJoinStdt}
+		  , CUST_JOIN_EDDT = #{custJoinEddt}
+		  , BUY_STDT = #{buyStdt}
+		  , BUY_EDDT = #{buyEddt}
+		  , PAY_TYPE = #{payType}
+		  , CUST_JOIN_YN = #{custJoinYn}
 	</insert>
 
 	<!-- 쿠폰조회 목록 -->
@@ -254,4 +282,266 @@
 		</if>
 	</select>
 
+	<!-- 쿠폰 적용대상 등록 -->
+	<insert id="saveCouponRefVal" parameterType="Coupon">
+		/* TsaCoupon.saveCouponRefVal */
+		INSERT INTO TB_COUPON_REFVAL (
+		    CPN_ID
+		  <if test='cpnRefvalSq != null and cpnRefvalSq > 0'>
+		  , CPN_REFVAL_SQ
+		  </if>
+		  , CPN_TYPE
+		  , CPN_TARGET
+		  , REF_VAL
+		  <if test='refFormalGb != null and refFormalGb != ""'>
+		  , REF_FORMAL_GB
+		  </if>
+		  <if test='refBrandCd != null and refBrandCd != ""'>
+		  , REF_BRAND_CD
+		  </if>
+		  , REG_NO
+		  , REG_DT
+		  , UPD_NO
+		  , UPD_DT
+		)
+		SELECT CPN_ID
+		     <if test="cpnRefvalSq != null and cpnRefvalSq > 0">
+			 , #{cpnRefvalSq}
+			 </if>
+			 , CPN_TYPE
+			 , #{cpnTarget}
+			 , #{refVal}
+			 <if test='refFormalGb != null and refFormalGb != ""'>
+			 , #{refFormalGb}
+			 </if>
+			 <if test='refBrandCd != null and refBrandCd != ""'>
+			 , #{refBrandCd}
+			 </if>
+			 , REG_NO
+			 , now()
+			 , UPD_NO
+			 , now()
+		  FROM TB_COUPON
+		 WHERE CPN_ID = #{cpnId}
+		    ON DUPLICATE KEY UPDATE
+			REF_VAL = #{refVal}
+		  , REF_FORMAL_GB = #{refFormalGb}
+		  , REF_BRAND_CD = #{refBrandCd}
+		  , UPD_NO = #{updNo}
+		  , UPD_DT = now()
+	</insert>
+
+	<!-- 쿠폰 입점업체 분담율 등록 -->
+	<insert id="saveCouponBurden" parameterType="CouponBurden">
+		/* TsaCoupon.saveCouponBurden */
+		INSERT INTO TB_COUPON_BURDEN(
+		    CPN_ID
+		  , SUPPLY_COMP_CD
+		  , BURDEN_RATE
+		  , REG_NO
+		  , REG_DT
+		  , UPD_NO
+		  , UPD_DT
+		)
+		SELECT CPN_ID
+			 , #{supplyCompCd}
+			 , #{burdenRate}
+			 , REG_NO
+			 , now()
+			 , UPD_NO
+			 , now()
+		  FROM TB_COUPON
+		 WHERE CPN_ID = #{cpnId}
+			ON DUPLICATE KEY UPDATE
+			   BURDEN_RATE = #{burdenRate}
+			 , UPD_NO = #{updNo}
+			 , UPD_DT = now()
+	</insert>
+
+	<!-- 자사브랜드 조회-->
+	<select id="getSelfBrandList" resultType="CommonCode">
+		/* TsaCoupon.getSelfBrandList */
+		SELECT BRAND_CD  AS CD
+		     , BRAND_ENM AS CD_NM
+		  FROM TB_BRAND
+		 WHERE 1 = 1
+		   AND USE_YN = 'Y'
+		   AND SELF_YN = 'Y'
+		ORDER  BY SUPPLY_COMP_CD, DISP_ORD
+	</select>
+
+	<!-- 쿠폰 상세 조회-->
+	<select id="getCouponDetail" parameterType="String" resultType="Coupon">
+		/* TsaCoupon.getCouponDetail */
+		SELECT CPN_ID
+			 , CPN_NM
+			 , SITE_CD
+			 , AF_LINK_CD
+			 , USABLE_CUST_GB
+			 , USABLE_CUST_GRADE
+			 , CPN_TYPE
+			 , APPLY_SCOPE
+			 , DC_WAY
+			 , DC_PVAL
+			 , DC_MVAL
+			 , DC_AVAL
+			 , MAX_DC_AMT
+			 , PD_GB
+			 , AVAIL_STDT
+			 , AVAIL_EDDT
+			 , AVAIL_DAYS
+			 , CUST_PUB_LIMIT_QTY
+			 , TOT_PUB_LIMIT_QTY
+			 , ONE_PUB_QTY
+			 , DN_GB
+			 , DOWN_STDT
+			 , DOWN_EDDT
+			 , BUY_LIMIT_AMT
+			 , PLAN_SQ
+			 , REISSUANCE
+			 , CPN_STAT
+			 , END_ALIM_YN
+			 , FIRST_YN
+			 , DOWN_YN
+			 , CUST_JOIN_STDT
+			 , CUST_JOIN_EDDT
+			 , BUY_STDT
+			 , BUY_EDDT
+			 , PAY_TYPE
+			 , CUST_JOIN_YN
+			 , (SELECT AF_CHANNEL
+			      FROM TB_AF_LINK A
+			     WHERE A.AF_LINK_CD = B.AF_LINK_CD) AS AF_CHANNEL
+  		  FROM TB_COUPON B
+    	 WHERE CPN_ID = #{value}
+	</select>
+
+	<!-- 쿠폰 발급 개수 조회 -->
+	<select id="getCouponIssueCnt" parameterType="String" resultType="int">
+		/* TsaCoupon.getCouponIssueCnt*/
+		SELECT COUNT(1)
+		  FROM TB_CUST_COUPON
+		 WHERE CPN_ID = #{cpnId}
+	</select>
+
+	<!-- 쿠폰 적용대상 조회 - 제외/적용 상품 -->
+	<select id="getCouponRefvalGoodsList" parameterType="CouponRefval" resultType="CouponRefval">
+		/* TsaCoupon.getCouponRefvalGoodsList */
+		SELECT FN_GET_CODE_NM('G073',B.GOODS_GB) AS GOODS_GB
+			 , B.GOODS_CD
+			 , B.GOODS_NM
+			 , C.BRAND_ENM
+			 , A.CPN_REFVAL_SQ
+		  FROM TB_COUPON_REFVAL A
+		 INNER JOIN TB_GOODS B ON A.REF_VAL = B.GOODS_CD
+		 INNER JOIN TB_BRAND C ON B.BRAND_CD = C.BRAND_CD
+		 WHERE A.CPN_ID = #{cpnId}
+		   AND A.CPN_TARGET = #{cpnTarget}
+		   AND A.DEL_YN = 'N'
+		 ORDER BY A.CPN_REFVAL_SQ DESC
+	</select>
+
+	<!-- 쿠폰 적용대상 조회 - 브랜드 -->
+	<select id="getCouponRefvalBrandList" parameterType="CouponRefval" resultType="CouponRefval">
+		/* TsaCoupon.getCouponRefvalExceptGoodsList */
+		SELECT B.BRAND_CD
+			 , B.BRAND_ENM
+		     , C.SUPPLY_COMP_NM
+			 , A.CPN_REFVAL_SQ
+		  FROM TB_COUPON_REFVAL A
+		 INNER JOIN TB_BRAND B ON A.REF_VAL = B.BRAND_CD
+		 INNER JOIN TB_SUPPLY_COMPANY C ON B.SUPPLY_COMP_CD = C.SUPPLY_COMP_CD
+		 WHERE A.CPN_ID = #{cpnId}
+		   AND A.CPN_TARGET = #{cpnTarget}
+		   AND A.DEL_YN = 'N'
+		 ORDER BY A.CPN_REFVAL_SQ DESC
+	</select>
+
+	<!-- 쿠폰적용대상 - 카테고리 조회 -->
+	<select id="getCouponRefvalCategoryList" parameterType="CouponRefval" resultType="CouponRefval">
+		/* TsaCoupon.getCouponRefvalCategoryList */
+		SELECT B.CATE_GB
+			 , A.REF_VAL AS CATE_NO
+			 , B.FULL_CATE_NM 					AS CATE_NM
+			 , B.SITE_CD
+			 , A.REF_FORMAL_GB					AS FORMAL_GB
+		     , A.REF_BRAND_CD					AS BRAND_CD
+			 , A.CPN_REFVAL_SQ
+		  FROM TB_COUPON_REFVAL A
+		 INNER JOIN TB_CATE_4SRCH B ON A.REF_VAL = B.LEAF_CATE_NO
+		 WHERE A.CPN_ID = #{cpnId}
+		   AND A.CPN_TARGET = #{cpnTarget}
+		   AND A.DEL_YN = 'N'
+		 ORDER BY A.CPN_REFVAL_SQ DESC
+	</select>
+
+	<!-- 쿠폰 적용대상 - 공급처 조회 -->
+	<select id="getCouponRefvalSupplyCompList" parameterType="CouponRefval" resultType="CouponRefval">
+		/* TsaCoupon.getCouponRefvalSupplyCompList */
+		SELECT B.SUPPLY_COMP_CD
+			 , B.SUPPLY_COMP_NM
+			 , A.CPN_REFVAL_SQ
+		  FROM TB_COUPON_REFVAL A
+		 INNER JOIN TB_SUPPLY_COMPANY B ON A.REF_VAL = B.SUPPLY_COMP_CD
+		 WHERE A.CPN_ID = #{cpnId}
+		   AND A.CPN_TARGET = #{cpnTarget}
+		   AND A.DEL_YN = 'N'
+		 ORDER BY A.CPN_REFVAL_SQ DESC
+	</select>
+
+	<!-- 쿠폰 입점업체 분담율 조회-->
+	<select id="getCouponBurdenList" parameterType="String" resultType="CouponBurden">
+		/* TsaCoupon.getCouponBurdenList */
+		SELECT SUPPLY_COMP_CD
+			 , BURDEN_RATE
+			 , DEL_YN
+			 , CPN_ID
+		  FROM TB_COUPON_BURDEN
+		 WHERE CPN_ID = #{value}
+	</select>
+
+	<!-- 쿠폰 적용대상 수정-->
+	<update id="updateCouponRefval" parameterType="CouponRefval" >
+		/* TsaCoupon.updateCouponRefval */
+		UPDATE TB_COUPON_REFVAL
+		   SET DEL_YN = 'Y'
+			 , UPD_NO = #{updNo}
+			 , UPD_DT = now()
+		 WHERE CPN_ID = #{cpnId}
+		   AND CPN_REFVAL_SQ IN
+		  <foreach collection="cpnRefvalSqArr" item="item" open="(" separator="," close=")">
+			#{item}
+		  </foreach>
+	</update>
+
+	<!-- 고객 쿠폰 발행 -->
+	<insert id="saveCouponCustPub" parameterType="CustCoupon">
+		/* TsaCoupon.saveCouponCustPub */
+		INSERT INTO TB_CUST_COUPON (
+			CUST_NO
+		  , CPN_ID
+		  , AVAIL_STDT
+		  , AVAIL_EDDT
+		  , PUB_REASON
+		  , PUB_REASON_DTL
+          , END_ALIM_SEND_YN
+          , REG_NO
+          , REG_DT
+          , UPD_NO
+          , UPD_DT
+		) VALUES (
+		    #{custNo}
+		  , #{cpnId}
+		  , DATE_FORMAT(#{availStdt} , '%Y-%m-%d')
+		  , DATE_FORMAT(#{availEddt} , '%Y-%m-%d')
+		  , #{pubReason}
+		  , #{pubReasonDtl}
+		  , #{endAlimSendYn}
+		  , #{regNo}
+		  , now()
+		  , #{updNo}
+		  , now()
+		)
+	</insert>
+
 </mapper>

+ 78 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaCustomer.xml

@@ -103,6 +103,15 @@
 		AND   LOGIN_LDT <![CDATA[<]]> DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
 		     </if>
 		</if>
+		<if test="custNm != null and custNm != ''">
+		AND    LOWER(CUST_NM) LIKE CONCAT('%',LOWER(#{custNm}),'%')
+		</if>
+		<if test="email != null and email != ''">
+		AND    LOWER(EMAIL) LIKE CONCAT('%',LOWER(#{eamil}),'%')
+		</if>
+		<if test="custId != null and custId != ''">
+		AND    CUST_ID = #{custId}
+		</if>
 	</select>
 
 	<!-- 회원기본정보 -->
@@ -162,6 +171,69 @@
 		WHERE  CUST_NO = #{custNo}
 	</select>
 
+	<!--회원정보 수정-->
+	<update id="updateCustomerInfo" parameterType="Customer">
+		/* TsaCustomer.updateCustomerInfo */
+		UPDATE TB_CUSTOMER
+		<set>
+		    <if test="custGb != null and custGb != ''">
+		     CUST_GB = #{custGb},
+		    </if>
+		    <if test="custGrade != null and custGrade !=''">
+		     CUST_GRADE = #{custGrade},
+		    </if>
+		    <if test="emailAgreeYn != null and emailAgreeYn != ''">
+		     EMAIL_AGREE_DT = CASE WHEN EMAIL_AGREE_YN = #{emailAgreeYn}
+		                      THEN EMAIL_AGREE_DT
+		                      ELSE NOW()
+		                      END,
+		     EMAIL_AGREE_YN = #{emailAgreeYn},
+		    </if>
+		    <if test="smsAgreeYn != null and smsAgreeYn != ''">
+		     SMS_AGREE_DT = CASE WHEN SMS_AGREE_YN = #{smsAgreeYn}
+		                    THEN SMS_AGREE_DT
+		                    ELSE NOW()
+		                    END,
+		     SMS_AGREE_YN = #{smsAgreeYn},
+		    </if>
+		    <if test="homePostNo != null and homePostNo != ''">
+		     HOME_POST_NO = #{homePostNo},
+		    </if>
+		    <if test="homeBaseAddr != null and homeBaseAddr != ''">
+		     HOME_BASE_ADDR = #{homeBaseAddr},
+		    </if>
+		    <if test="homeDtlAddr != null and homeDtlAddr != ''">
+		     HOME_DTL_ADDR = #{homeDtlAddr},
+		    </if>
+		    <if test="birthYmd != null and birthYmd != ''">
+		     BIRTH_YMD = REPLACE(#{birthYmd}, '-', ''),
+		    </if>
+		    <if test="cellPhnno != null and cellPhnno != ''">
+		     CELL_PHNNO = #{cellPhnno},
+		    </if>
+		    <if test="email != null and email != ''">
+		     EMAIL = #{email},
+		    </if>
+		    <if test="managedRsn != null and managedRsn != ''">
+		     MANAGED_DT = CASE WHEN MANAGED_RSN = #{managedRsn}
+		                       AND  MANAGED_DTL_RSN = #{managedDtlRsn}
+		                  THEN MANAGED_DT
+		                  ELSE NOW()
+		                  END,
+		     MANAGED_RSN = #{managedRsn},
+		     MANAGED_DTL_RSN = #{managedDtlRsn},
+		    </if>
+		    <if test="managedRsn == null or managedRsn == ''">
+		     MANAGED_RSN = NULL,
+		     MANAGED_DTL_RSN =  NULL,
+		     MANAGED_DT = NULL,
+		    </if>
+		     UPD_NO = #{updNo},
+		     UPD_DT = NOW()
+		</set>
+		WHERE CUST_NO = #{custNo}
+	</update>
+
 	<!-- 탈퇴회원목록 -->
 	<select id="getCustomerSecedeList" parameterType="CustomerSearch" resultType="Customer">
 		/* TsaCustomer.getSecedeCustomerList */
@@ -328,4 +400,10 @@
 		</if>
 	</select>
 
+	<insert id="createException">
+		/* TsaCustomer.createException */
+		INSERT INTO TB_CUSTOMER (CUST_NO)
+		VALUES (NULL)
+	</insert>
+
 </mapper>

+ 6 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaGoods.xml

@@ -555,6 +555,12 @@
 		        <if test="supplyCompCd != null and supplyCompCd != ''">
 		        AND G.SUPPLY_COMP_CD = #{supplyCompCd}
 		        </if>
+				<if test="multiSupplyCompCd != null and multiSupplyCompCd != ''">
+					AND G.SUPPLY_COMP_CD IN
+					<foreach collection="multiSupplyCompCd" item="item" index="index"  open="(" close=")" separator=",">
+						#{item}
+					</foreach>
+				</if>
 		        <if test="brandCd != null and brandCd != ''">
 		        AND G.BRAND_CD = #{brandCd}
 		        </if>

+ 114 - 71
src/main/java/com/style24/persistence/mybatis/shop/TsaMorebetter.xml

@@ -12,8 +12,8 @@
 			 , DEL_YN
 			 , FN_GET_USER_NM(REG_NO) AS REG_NM
 			 , DATE_FORMAT(REG_DT, '%Y.%m.%d %H:%i:%S') AS REG_DT
-			 , FN_GET_USER_NM(UDP_NO) AS UPD_NM
-			 , DATE_FORMAT(UDT_DT, '%Y.%m.%d %H:%i:%S') AS UPD_DT
+			 , FN_GET_USER_NM(UPD_NO) AS UPD_NM
+			 , DATE_FORMAT(UPD_DT, '%Y.%m.%d %H:%i:%S') AS UPD_DT
 		FROM TB_TMTB
 		WHERE 1=1
 		<if test="tmtbStdt != null and tmtbStdt != '' and tmtbEddt != null and tmtbEddt != ''">
@@ -42,8 +42,8 @@
 					 , TT.DEL_YN
 					 , TT.REG_NO
 					 , TT.REG_DT
-					 , TT.UDP_NO
-					 , TT.UDT_DT
+					 , TT.UPD_NO
+					 , TT.UPD_DT
 					 , TS.SECTION_GB
 					 , TS.SECTION_VAL
 					 , TV.DC_WAY
@@ -71,8 +71,8 @@
 				 ,TS.DEL_YN
 				 ,TS.REG_NO
 				 ,TS.REG_DT
-				 ,TS.UDP_NO
-				 ,TS.UDT_DT
+				 ,TS.UPD_NO
+				 ,TS.UPD_DT
 		FROM	TB_TMTB_SECTION TS
 		INNER 	JOIN TB_TMTB_VAL TV
 		ON 		TS.TMTB_SQ = TV.TMTB_SQ
@@ -94,8 +94,8 @@
 				 , DEL_YN
 				 , REG_NO
 				 , REG_DT
-				 , UDP_NO
-				 , UDT_DT
+				 , UPD_NO
+				 , UPD_DT
 		FROM TB_TMTB_GOODS
 		WHERE 1=1
 		  AND TMTB_SQ = #{tmtbSq}
@@ -119,8 +119,8 @@
 				 , DEL_YN
 				 , REG_NO
 				 , REG_DT
-				 , UDP_NO
-				 , UDT_DT
+				 , UPD_NO
+				 , UPD_DT
 		FROM TB_TMTB_GOODS
 		WHERE 1=1
 		  AND TMTB_SQ = #{tmtbSq}
@@ -129,48 +129,58 @@
 
 	<select id="getMorebetterApplyGoodsList" parameterType="MoreBetterGoods" resultType="MoreBetterGoods">
 		/* TsaMarketing.getMorebetterApplyGoodsList */
-		SELECT 	 TMTB_GOODS_SQ
-				 , TMTB_SQ
-				 , GOODS_GB
-				 , TARGET_GB
-				 , TARGET_VAL
-				 , TARGET_VAL AS GOODS_CD
+		SELECT 	 A.TMTB_GOODS_SQ
+				 , A.TMTB_SQ
+				 , B.TMTB_APPLY_GOODS_SQ
+				 , A.GOODS_GB
+				 , A.TARGET_GB
+				 , A.TARGET_VAL
+				 , A.TARGET_VAL AS GOODS_CD
 				 , (SELECT  GOODS_NM
 					FROM  TB_GOODS
-					WHERE  GOODS_CD = TARGET_VAL) AS GOODS_NM
-				 , DEL_YN
-				 , REG_NO
-				 , REG_DT
-				 , UDP_NO
-				 , UDT_DT
-		FROM TB_TMTB_GOODS
+					WHERE  GOODS_CD = A.TARGET_VAL) AS GOODS_NM
+				 , A.DEL_YN
+				 , A.REG_NO
+				 , A.REG_DT
+				 , A.UPD_NO
+				 , A.UPD_DT
+		FROM 		TB_TMTB_GOODS A
+		INNER JOIN 	TB_TMTB_APPLY_GOODS B
+				ON 	A.TMTB_SQ = B.TMTB_SQ
+				AND A.GOODS_GB = B.GOODS_GB
+				AND A.TARGET_VAL = B.GOODS_CD
 		WHERE 1=1
-		  AND TMTB_SQ = #{tmtbSq}
-		  AND TARGET_GB = 'G260_10'
-		  AND GOODS_GB IN ('G800_10','G800_20')
+		  AND A.TMTB_SQ = #{tmtbSq}
+		  AND A.TARGET_GB = 'G260_10'
+		  AND A.GOODS_GB IN ('G800_10','G800_20')
 	</select>
 
 	<select id="getMorebetterExceptGoodsList" parameterType="MoreBetterGoods" resultType="MoreBetterGoods">
 		/* TsaMarketing.getMorebetterExceptGoodsList */
-		SELECT 	 TMTB_GOODS_SQ
-			 , TMTB_SQ
-			 , GOODS_GB
-			 , TARGET_GB
-			 , TARGET_VAL
-			 , TARGET_VAL AS GOODS_CD
-			 , (SELECT  GOODS_NM
-				FROM  TB_GOODS
-				WHERE  GOODS_CD = TARGET_VAL) AS GOODS_NM
-			 , DEL_YN
-			 , REG_NO
-			 , REG_DT
-			 , UDP_NO
-			 , UDT_DT
-		FROM TB_TMTB_GOODS
+		SELECT 	 A.TMTB_GOODS_SQ
+				 , A.TMTB_SQ
+				 , B.TMTB_APPLY_GOODS_SQ
+				 , A.GOODS_GB
+				 , A.TARGET_GB
+				 , A.TARGET_VAL
+				 , A.TARGET_VAL AS GOODS_CD
+				 , (SELECT  GOODS_NM
+					FROM  TB_GOODS
+					WHERE  GOODS_CD = A.TARGET_VAL) AS GOODS_NM
+				 , A.DEL_YN
+				 , A.REG_NO
+				 , A.REG_DT
+				 , A.UPD_NO
+				 , A.UPD_DT
+			FROM 	TB_TMTB_GOODS A
+		INNER JOIN 	TB_TMTB_APPLY_GOODS B
+			 ON 	A.TMTB_SQ = B.TMTB_SQ
+			AND 	A.GOODS_GB = B.GOODS_GB
+			AND 	A.TARGET_VAL = B.GOODS_CD
 		WHERE 1=1
-		  AND TMTB_SQ = #{tmtbSq}
-		  AND TARGET_GB = 'G260_10'
-		  AND GOODS_GB IN ('G800_30')
+		  AND A.TMTB_SQ = #{tmtbSq}
+		  AND A.TARGET_GB = 'G260_10'
+		  AND A.GOODS_GB IN ('G800_30')
 	</select>
 
 	<select id="getMorebetterBurdenList" parameterType="Integer" resultType="MoreBetterBurden">
@@ -182,8 +192,8 @@
 				   , USE_YN
 				   , REG_NO
 				   , REG_DT
-				   , UDP_NO
-				   , UDT_DT
+				   , UPD_NO
+				   , UPD_DT
 		FROM TB_TMTB_BURDEN
 		WHERE 1=1
 		  AND TMTB_SQ = #{tmtbSq}
@@ -197,12 +207,13 @@
 					,TMTB_STAT
 					,TMTB_ST_DT
 					,TMTB_ED_DT
+					,APPLY_GB
 					,MULTI_YN
 					,DEL_YN
 					,REG_NO
 					,REG_DT
-					,UDP_NO
-					,UDT_DT
+					,UPD_NO
+					,UPD_DT
 			)
 			VALUES (
 			         #{tmtbSq}
@@ -210,11 +221,12 @@
 				    ,#{tmtbStat}
 				    ,#{tmtbStdt}
 				    ,#{tmtbEddt}
+				    ,#{applyGb}
 				    ,#{multiYn}
 				    ,'N'
 				    ,#{regNo}
 				    ,NOW()
-				    ,#{udpNo}
+				    ,#{updNo}
 				    ,NOW()
 				   )
 			ON DUPLICATE KEY UPDATE
@@ -223,8 +235,8 @@
 						,TMTB_ST_DT = #{tmtbStdt}
 						,TMTB_ED_DT = #{tmtbEddt}
 						,MULTI_YN = #{multiYn}
-						,UDP_NO = #{udpNo}
-						,UDT_DT = NOW()
+						,UPD_NO = #{updNo}
+						,UPD_DT = NOW()
 	</insert>
 
 	<insert id="saveMorebetterGoods" parameterType="MoreBetterGoods" >
@@ -238,8 +250,8 @@
 					,DEL_YN
 					,REG_NO
 					,REG_DT
-					,UDP_NO
-					,UDT_DT
+					,UPD_NO
+					,UPD_DT
 			)
 			VALUES (
 			         #{tmtbGoodsSq}
@@ -250,15 +262,46 @@
 				    ,'N'
 				    ,#{regNo}
 				    ,NOW()
-				    ,#{udpNo}
+				    ,#{updNo}
 				    ,NOW()
 				   )
 			ON DUPLICATE KEY UPDATE
 						 GOODS_GB = #{goodsGb}
 						,TARGET_GB = #{targetGb}
 						,TARGET_VAL = #{targetVal}
-						,UDP_NO = #{udpNo}
-						,UDT_DT = NOW()
+						,UPD_NO = #{updNo}
+						,UPD_DT = NOW()
+	</insert>
+
+	<insert id="saveMorebetterApplyGoods" parameterType="MoreBetterGoods" >
+		/* TsaMarketing.saveMorebetterApplyGoods */
+		INSERT INTO TB_TMTB_APPLY_GOODS(
+					TMTB_APPLY_GOODS_SQ
+					,TMTB_SQ
+					,GOODS_GB
+					,GOODS_CD
+					,DEL_YN
+					,REG_NO
+					,REG_DT
+					,UPD_NO
+					,UPD_DT
+		)
+		VALUES (
+				#{tmtbApplyGoodsSq}
+			   ,#{tmtbSq}
+			   ,#{goodsGb}
+			   ,#{goodsCd}
+			   ,'N'
+			   ,#{regNo}
+			   ,NOW()
+			   ,#{updNo}
+			   ,NOW()
+			   )
+			ON DUPLICATE KEY UPDATE
+								 GOODS_GB = #{goodsGb}
+								 ,GOODS_CD = #{goodsCd}
+								 ,UPD_NO = #{updNo}
+								 ,UPD_DT = NOW()
 	</insert>
 
 	<insert id="saveMorebetterSection" parameterType="MoreBetterSection" >
@@ -271,8 +314,8 @@
 					,DEL_YN
 					,REG_NO
 					,REG_DT
-					,UDP_NO
-					,UDT_DT
+					,UPD_NO
+					,UPD_DT
 			)
 			VALUES (
 					 #{tmtbSectionSq}
@@ -282,14 +325,14 @@
 				    ,'N'
 				    ,#{regNo}
 				    ,NOW()
-				    ,#{udpNo}
+				    ,#{updNo}
 				    ,NOW()
 				   )
 			ON DUPLICATE KEY UPDATE
 						 SECTION_GB = #{sectionGb}
 						,SECTION_VAL = #{sectionVal}
-						,UDP_NO = #{udpNo}
-						,UDT_DT = NOW()
+						,UPD_NO = #{updNo}
+						,UPD_DT = NOW()
 	</insert>
 
 	<insert id="saveMorebetterVal" parameterType="MoreBetterSection" >
@@ -303,8 +346,8 @@
 					,DEL_YN
 					,REG_NO
 					,REG_DT
-					,UDP_NO
-					,UDT_DT
+					,UPD_NO
+					,UPD_DT
 			)
 			VALUES (
 					#{tmtbValSq}
@@ -315,14 +358,14 @@
 				   ,'N'
 				   ,#{regNo}
 				   ,NOW()
-				   ,#{udpNo}
+				   ,#{updNo}
 				   ,NOW()
 				   )
 			ON DUPLICATE KEY UPDATE
 						 DC_WAY = #{dcWay}
 						,DC_VAL = #{dcVal}
-						,UDP_NO = #{udpNo}
-						,UDT_DT = NOW()
+						,UPD_NO = #{updNo}
+						,UPD_DT = NOW()
 	</insert>
 
 	<insert id="saveMorebetterBurden" parameterType="MoreBetterBurden" >
@@ -335,8 +378,8 @@
 					,USE_YN
 					,REG_NO
 					,REG_DT
-					,UDP_NO
-					,UDT_DT
+					,UPD_NO
+					,UPD_DT
 			)
 			VALUES (
 			         #{tmtbBurdenSq}
@@ -346,15 +389,15 @@
 			        ,#{useYn}
 				    ,#{regNo}
 				    ,NOW()
-				    ,#{udpNo}
+				    ,#{updNo}
 				    ,NOW()
 				   )
 		ON DUPLICATE KEY UPDATE
 					 TMTB_SUPPLY_CD = #{tmtbSupplyCd}
 					,TMTB_BURDEN_RATE = #{tmtbBurdenRate}
 					,USE_YN = #{useYn}
-					,UDP_NO = #{udpNo}
-					,UDT_DT = NOW()
+					,UPD_NO = #{updNo}
+					,UPD_DT = NOW()
 	</insert>
 
 	<delete id="deleteTmtbSupplyCompanyList" parameterType="MoreBetterGoods">

+ 23 - 10
src/main/java/com/style24/persistence/mybatis/shop/TsaRenderer.xml

@@ -341,16 +341,6 @@
 		AND    USE_YN = 'Y'
 	</select>
 
-	<!-- 제휴링크 목록 -->
-	<select id="getAflinkList" parameterType="String" resultType="CommonCode">
-		/* TsaRenderer.getAflinkList */
-		SELECT AF_LINK_CD AS CD
-		     , AF_LINK_NM AS CD_NM
-		FROM   TB_AF_LINK
-		WHERE  AF_CHANNEL = #{afChannel}
-		AND    USE_YN = 'Y'
-	</select>
-	
 	<!-- 색상그룹코드 RGB 목록 -->
 	<select id="getColorGrpCdRgbList" resultType="CommonCode">
 		/* TsaRenderer.getColorGrpCdRgbList */
@@ -373,5 +363,28 @@
 		AND USE_YN = 'Y'
 		ORDER BY DELV_FEE_CD
 	</select>
+	
+	<!-- 전체 제휴채널 목록 -->
+	<select id="getAllAflinkList" resultType="CommonCode">
+		/* TsaRenderer.getAllAflinkList */
+		SELECT AL.AF_LINK_CD                      AS CD
+		     , CONCAT(CC.CD_NM,'-',AL.AF_LINK_NM) AS CD_NM
+		FROM   TB_AF_LINK AL
+		     , TB_COMMON_CODE CC
+		WHERE  AL.AF_CHANNEL = CC.CD
+		AND    AL.USE_YN = 'Y'
+		AND    CC.CD_GB = 'G053'
+		ORDER  BY AL.DISP_ORD
+	</select>
+	
+	<!-- 제휴채널 목록 -->
+	<select id="getAflinkList" parameterType="String" resultType="CommonCode">
+		/* TsaRenderer.getAflinkList */
+		SELECT AF_LINK_CD AS CD
+		     , AF_LINK_NM AS CD_NM
+		FROM   TB_AF_LINK
+		WHERE  AF_CHANNEL = #{afChannel}
+		AND    USE_YN = 'Y'
+	</select>
 
 </mapper>

+ 75 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaSettle.xml

@@ -0,0 +1,75 @@
+<?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.admin.biz.dao.TsaSettleDao">
+
+	<!-- 제휴채널정산 목록 -->
+	<select id="getAfLinkFeeList" parameterType="AfLinkFee" resultType="AfLinkFee">
+		/* TsaSettle.getAfLinkFeeList */
+		SELECT AF_CHANNEL                                         /*상위채널코드*/
+		     , FN_GET_CODE_NM('G053',AF_CHANNEL) AS AF_CHANNEL_NM /*상위채널명*/
+		     , AF_LINK_CD                                         /*채널코드*/
+		     , AF_LINK_NM                                         /*채널명*/
+		     , OCCUR_DT                                           /*발생일시*/
+		     , ORD_NO                                             /*주문번호*/
+		     , ORD_DTL_STAT                                       /*주문상세상태*/
+		     , SUM(SELL_AMT)                     AS SELL_AMT      /*판매금액(상품금액.배송비제외)*/
+		     , SUM(CPN1_DC_AMT +
+		           TMTB1_DC_AMT + TMTB2_DC_AMT +
+		           GOODS_CPN_DC_AMT +
+		           CART_CPN_DC_AMT)              AS CPN_DC_AMT     /*쿠폰할인금액*/
+		     , SUM(PNT_DC_AMT + PRE_PNT_DC_AMT)  AS PNT_DC_AMT     /*포인트할인금액*/
+		     , SUM(GFCD_USE_AMT)                 AS GFCD_USE_AMT   /*상품권사용금액*/
+		     , SUM(SELL_AMT - (CPN1_DC_AMT + TMTB1_DC_AMT + TMTB2_DC_AMT + GOODS_CPN_DC_AMT + CART_CPN_DC_AMT + PG_CPN_AMT)
+		                    - (PNT_DC_AMT + PRE_PNT_DC_AMT)
+		                    - GFCD_USE_AMT)      AS PAY_AMT        /*결제금액(VAT포함)*/
+		     , SUM(TRUNCATE((SELL_AMT - (CPN1_DC_AMT + TMTB1_DC_AMT + TMTB2_DC_AMT + GOODS_CPN_DC_AMT + CART_CPN_DC_AMT + PG_CPN_AMT)
+		                              - (PNT_DC_AMT + PRE_PNT_DC_AMT)
+		                              - GFCD_USE_AMT
+		                    ) / 1.1,0))          AS SALES_AMT      /*매출금액(VAT제외). 건별로 1.1로 나누고 소숫점을 절사하여 합계를 낸다.*/
+		FROM   (
+		        SELECT AL.AF_CHANNEL
+		             , ODH.AF_LINK_CD                                              /*제휴링크코드*/
+		             , AL.AF_LINK_NM
+		             , DATE_FORMAT(ODH.REG_DT,'%Y-%m-%d %m:%h:%s') AS OCCUR_DT     /*발생일자*/
+		             , ODH.ORD_NO
+		             , ODH.ORD_DTL_NO
+		             , CASE WHEN ODH.ORD_DTL_STAT = 'G013_20' THEN
+		                        FN_GET_CODE_NM('G013',ODH.ORD_DTL_STAT)
+		                    ELSE
+		                        IFNULL(FN_GET_CODE_NM('G685',OCD.CHG_STAT),'주문취소')
+		               END                                         AS ORD_DTL_STAT /*주문상세상태*/
+		             , (ODH.ORD_AMT - ODH.CNCL_RTN_AMT)            AS SELL_AMT     /*판매금액(상품금액.배송비제외)*/
+		             , ODH.CPN1_DC_AMT                                             /*1차쿠폰(즉시할인쿠폰)할인금액*/
+		             , ODH.TMTB1_DC_AMT                                            /*다다익선할인금액(수량)*/
+		             , ODH.TMTB2_DC_AMT                                            /*다다익선할인금액(금액)*/
+		             , ODH.GOODS_CPN_DC_AMT                                        /*상품쿠폰할인금액*/
+		             , ODH.CART_CPN_DC_AMT                                         /*장바구니할인금액*/
+		             , 0                                           AS PG_CPN_AMT   /*PG쿠폰금액.TODO:바로 아래 쿼리문으로 대체해야 함*/
+		             -- , ODH.PG_CPN_AMT                                              /*PG쿠폰금액*/
+		             , ODH.PNT_DC_AMT                                              /*포인트할인금액*/
+		             , ODH.PRE_PNT_DC_AMT                                          /*선포인트할인금액*/
+		             , ODH.GFCD_USE_AMT                                            /*상품권사용금액*/
+		        FROM   TB_ORDER_DETAIL_HST ODH
+		        INNER JOIN TB_AF_LINK AL
+		                ON ODH.AF_LINK_CD = AL.AF_LINK_CD
+		        LEFT OUTER JOIN TB_ORDER_CHANGE_DETAIL OCD
+		                     ON ODH.ORD_DTL_NO = OCD.ORD_DTL_NO
+		                    AND OCD.CHG_STAT IN ('G685_21','G685_32','G685_42')	/*취소완료,교환완료,반품완료*/
+		        WHERE  ODH.ORD_DTL_STAT IN ('G013_20','G013_99') /*결제완료,주문취소*/
+		        AND    ODH.REG_DT <![CDATA[>=]]> STR_TO_DATE(#{startDt},'%Y-%m-%d')
+		        AND    ODH.REG_DT <![CDATA[<]]> DATE_ADD(STR_TO_DATE(#{endDt},'%Y-%m-%d'),INTERVAL 1 DAY)
+		        <if test="ordNo != null and ordNo != ''">
+		        AND    ODH.ORD_NO = #{ordNo}
+		        </if>
+		        <if test="afLinkCd != null and afLinkCd != ''">
+		        AND    AL.AF_LINK_CD = #{afLinkCd}
+		        </if>
+		        <if test="afChannel != null and afChannel != ''">
+		        AND    AL.AF_CHANNEL = #{afChannel}
+		        </if>
+		       ) U
+		GROUP  BY AF_CHANNEL, AF_LINK_CD, AF_LINK_NM, OCCUR_DT, ORD_NO, ORD_DTL_STAT
+		ORDER  BY AF_CHANNEL, AF_LINK_CD, AF_LINK_NM, OCCUR_DT, ORD_NO, ORD_DTL_STAT
+	</select>
+
+</mapper>

+ 21 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaSystem.xml

@@ -25,6 +25,27 @@
 		     , CASE WHEN SUBSTRING(REPLACE(A.ROLE_CD,'G001_', ''),1,1) = 'C' THEN
 		                FN_GET_CODE_NM('G003',A.ROLE_REF_VAL)
 		       END                                         AS VENDOR_NM      /*벤더명*/
+		     , CASE WHEN SUBSTRING(REPLACE(A.ROLE_CD,'G001_', ''),1,1) = 'D' THEN
+		                A.ROLE_REF_VAL
+		       END                                         AS AF_LINK_CD     /*제휴링크코드*/
+		     , CASE WHEN SUBSTRING(REPLACE(A.ROLE_CD,'G001_', ''),1,1) = 'D' THEN
+		                (SELECT AF_LINK_NM
+		                 FROM   TB_AF_LINK
+		                 WHERE  AF_LINK_CD = A.ROLE_REF_VAL
+		                )
+		       END                                         AS AF_LINK_NM     /*제휴링크명*/
+		     , CASE WHEN SUBSTRING(REPLACE(A.ROLE_CD,'G001_', ''),1,1) = 'D' THEN
+		                (SELECT AF_CHANNEL
+		                 FROM   TB_AF_LINK
+		                 WHERE  AF_LINK_CD = A.ROLE_REF_VAL
+		                )
+		       END                                         AS AF_CHANNEL     /*제휴채널*/
+		     , CASE WHEN SUBSTRING(REPLACE(A.ROLE_CD,'G001_', ''),1,1) = 'D' THEN
+		                (SELECT FN_GET_CODE_NM('G053',AL.AF_CHANNEL)
+		                 FROM   TB_AF_LINK AL
+		                 WHERE  AL.AF_LINK_CD = A.ROLE_REF_VAL
+		                )
+		       END                                         AS AF_CHANNEL_NM  /*제휴채널명*/
 		     , A.EMAIL                                                       /*이메일*/
 		     , A.CELL_PHNNO                                                  /*휴대전화번호*/
 		     , A.PNT_ASSIGN_AMT                                              /*포인트부여가능금액*/

+ 89 - 0
src/main/resources/config/application-tsit.yml

@@ -0,0 +1,89 @@
+spring:
+    profiles:
+        active: tsit
+    cache.type: redis
+    redis:
+        lettuce:
+            pool:
+                max-active: 10
+                max-idle: 10
+                min-idle: 2
+        host: localhost
+        port: 6379
+        password:
+
+logging:
+    config: classpath:log/logback-tsit.xml
+
+domain:
+    admin: //ts5000.ipdisk.co.kr
+    pastel: //tdfront.pastelmall.com
+    image: //image.pastelmall.com
+    cdnimage: //img.pastelmall.com/pastelmall_images
+    uximage: //pt-office.pastelmall.com
+
+upload:
+    default:
+        target.path: /TSIT/servers/files/data
+        max.size: 10
+        allow.extension: jpg|gif|jpeg|png|bmp|txt|doc|docx|ppt|pptx|xls|xlsx|hwp|pdf
+        view: //image.pastelmall.com
+    goods:
+        target.path: /TSIT/servers/files/data/goods
+        max.size: 10
+        allow.extension: jpg|gif|jpeg|png
+        view: //img.pastelmall.com/goods
+    image:
+        target.path: /TSIT/servers/files/data
+        max.size: 10
+        allow.extension: jpg|gif|jpeg|png
+        view: //image.pastelmall.com
+    excel:
+        target.path: /TSIT/servers/files/data/excel
+        max.size: 10
+        allow.extension: xls|xlsx
+        view: //tdimage.pastelmall.com/excel
+    sample:
+        target.path: /WIDE/workspace/files/data
+        max.size: 10
+        allow.extension: txt|doc|docx|ppt|pptx|xls|xlsx|hwp|pdf
+        view: //tdimage.pastelmall.com/sample
+
+download.path: /TSIT/servers/files/data
+
+# Directsend API
+#mail:
+#    pastel.url: https://tdfront.pastelmall.com
+#    admin.url: https://tdadmin.pastelmall.com
+#    image.url: https://tdfront.pastelmall.com/image/web/mail
+#    template.path: /TSIT/servers/webapps/pastelmall.admin/WEB-INF/mail
+#    send.flag: N
+#    api :
+#        url: https://directsend.co.kr/index.php/api_v2/mail_change_word
+#        username : tribons1
+#        key : UQbDUz0TNwGt1Ay
+#        from : pastelmall@tribons.co.kr
+#        sender: 파스텔몰
+
+# EC모니터 API
+#ecmonitor:
+#    url: http://222.112.8.121:8085/
+        
+# juso.go.kr
+#juso:
+#    api:
+#        key: U01TX0FVVEgyMDIwMDUxMzEzMzUwOTEwOTc1NDc=
+#        url: http://www.juso.go.kr/addrlink/addrLinkApiJsonp.do
+
+# PG
+#pg:
+#    nicepay:
+#        merchantId: nictest00m
+#        merchantKey: 33F49GnCMS1mFYlGXisbUDzVf2ATWCl9k3R++d5hDd3Frmuos/XLx8XhXpe+LDYAbpGKZYSwtlyyLOtS/8aD7A==
+#        log.path: /TSIT/servers/logs/pastelmall/admin
+#        account.cert.url: https://webapi.nicepay.co.kr/api/checkBankAccountAPI.jsp
+
+# WMS
+#wms:
+#    api:
+#        cancelurl: http://dncs.8200.co.kr:8081/Service.asmx

+ 25 - 0
src/main/resources/log/logback-tsit.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration scan="true">
+	<property name="LOG_HOME" value="/TSIT/servers/logs/style24/admin"/>
+	<property name="LOG_LEVEL" value="INFO"/>
+	
+	<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+		<encoder>
+			<charset>utf-8</charset>
+			<pattern>[%d] [%thread] %-5level %logger{32} : %msg%n</pattern>
+		</encoder>
+	</appender>
+	
+	<logger name="org.springframework" level="ERROR"/>
+
+	<!-- SQL문과 해당 SQL을 실행시키는데 수행된 시간 정보(milliseconds)를 포함한다. -->
+	<logger name="jdbc.sqltiming" level="INFO" additivity="false">
+		<appender-ref ref="CONSOLE"/>
+	</logger>
+
+	<root level="${LOG_LEVEL}">
+		<appender-ref ref="CONSOLE"/>
+	</root>
+
+</configuration>

Datei-Diff unterdrückt, da er zu groß ist
+ 434 - 478
src/main/webapp/WEB-INF/views/customer/CustomerDetailForm.html


+ 326 - 59
src/main/webapp/WEB-INF/views/display/CategoryGoodsForm.html

@@ -1,6 +1,6 @@
 <!DOCTYPE html>
 <html lang="ko"
-	xmlns:th="http://www.thymeleaf.org">
+	  xmlns:th="http://www.thymeleaf.org">
 <!--
  *******************************************************************************
  * @source  : CategoryGoodsForm.html
@@ -11,71 +11,338 @@
  *============================================================================
  * VER  DATE         AUTHOR      DESCRIPTION
  * ===  ===========  ==========  =============================================
- * 1.0  2021.01.19   bin2107     최초 작성
+ * 1.0  2021.1.19    bin2107     최초 작성
  *******************************************************************************
  -->
-	<div id="main">
-		<!-- 메인타이틀 영역 -->
-		<div class="main-title">
-		</div>
-		<!-- //메인타이틀 영역 -->
-		
-		<!-- 메뉴 설명 -->
-		<div class="infoBox menu-desc">
-		</div>
-		<!-- //메뉴 설명 -->
-		
-		<!-- 검색조건 영역 -->
-		<div class="panelStyle">
-			<form id="searchForm" name="searchForm" action="#" th:action="@{'/display/category/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
-				<table class="frmStyle" aria-describedby="검색조건">
-					<colgroup>
-						<col width="10%"/>
-						<col/>
-					</colgroup>
-					<tr>
-						<th>카테고리</th>
-						<td>
-							<input type="hidden" name="selLvl"/>
-							<select name="siteCd">
-<!-- 								<option value="">[사이트]</option> -->
-								<option th:if="${siteList}" th:each="oneData, status : ${siteList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
-							</select>
-							<select name="cateGb" id="selCate1" onchange="fnChangeSearchCondition($(this).val(), 1);">
-								<option value="">[카테고리구분]</option>
-								<option th:if="${cateGbList}" th:each="oneData, status : ${cateGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
-							</select>
-							<select name="cate1No" id="selCate2" onchange="fnChangeSearchCondition($(this).val(), 2);">
-								<option value="">[카테고리1]</option>
-							</select>
-							<select name="cate2No" id="selCate3" onchange="fnChangeSearchCondition($(this).val(), 3);">
-								<option value="">[카테고리2]</option>
-							</select>
-							<select name="cate3No" id="selCate4" onchange="fnChangeSearchCondition($(this).val(), 4);">
-								<option value="">[카테고리3]</option>
-							</select>
-							<select name="cate4No" id="selCate5" onchange="fnChangeSearchCondition($(this).val(), 5);">
-								<option value="">[카테고리4]</option>
-							</select>
-						</td>
-					</tr>
-				</table>
-			</form>
-		</div>
-		<!-- 검색조건 영역 -->
-
-		<!-- 리스트 영역 -->
-		<div class="panelStyle">
-			<div id="gridList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
-		</div>
-		<!-- //리스트 영역 -->
+<div id="main">
+	<!-- 메인타이틀 영역 -->
+	<div class="main-title">
+	</div>
+	<!-- //메인타이틀 영역 -->
+
+	<!-- 메뉴 설명 -->
+	<div class="infoBox menu-desc">
+	</div>
+	<!-- //메뉴 설명 -->
+
+	<!-- 검색조건 영역 -->
+	<div class="panelStyle">
+		<form id="searchForm" name="searchForm" action="#" th:action="@{'/display/category/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
+			<table class="frmStyle" aria-describedby="검색조건">
+				<colgroup>
+					<col width="10%"/>
+					<col/>
+				</colgroup>
+				<tr>
+					<th>카테고리</th>
+					<td>
+						<input type="hidden" name="selLvl"/>
+						<select name="siteCd">
+							<!--<option value="">[사이트]</option> -->
+							<option th:if="${siteList}" th:each="oneData, status : ${siteList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+						</select>
+						<select name="cateGb" id="selCate1" onchange="fnChangeSearchCondition($(this).val(), 1);">
+							<option value="">[카테고리구분]</option>
+							<option th:if="${cateGbList}" th:each="oneData, status : ${cateGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+						</select>
+						<select name="cate1No" id="selCate2" onchange="fnChangeSearchCondition($(this).val(), 2);">
+							<option value="">[카테고리1]</option>
+						</select>
+						<select name="cate2No" id="selCate3" onchange="fnChangeSearchCondition($(this).val(), 3);">
+							<option value="">[카테고리2]</option>
+						</select>
+						<select name="cate3No" id="selCate4" onchange="fnChangeSearchCondition($(this).val(), 4);">
+							<option value="">[카테고리3]</option>
+						</select>
+						<select name="cate4No" id="selCate5" onchange="fnChangeSearchCondition($(this).val(), 5);">
+							<option value="">[카테고리4]</option>
+						</select>
+					</td>
+				</tr>
+			</table>
+		</form>
+	</div>
+	<!-- 검색조건 영역 -->
 
+	<!-- 리스트 영역 -->
+	<div class="panelStyle">
+		<div id="gridList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
 	</div>
+	<!-- //리스트 영역 -->
+
+	<!-- 등록/수정 -->
+	<div class="panelStyle">
+		<form id="detailForm" name="detailForm" action="#" th:action="@{'/display/category/save'}">
+
+		</form>
+
+		<!-- 버튼 배치 영역 -->
+		<ul class="panelBar">
+			<li class="right">
+				<button type="button" class="btn btn-info btn-lg" id="btnNew">신규</button>
+				<button type="button" class="btn btn-success btn-lg" id="btnSave">저장</button>
+				<!--<button type="button" class="btn btn-base btn-lg" id="btnRefresh4Srch" th:if="${sessionInfo.roleCd == 'G001_0000'}">4SRCH 갱신</button>-->
+			</li>
+		</ul>
+		<!-- //버튼 배치 영역 -->
+	</div>
+	<!-- 등록/수정 -->
+</div>
 
 <script th:inline="javascript">
-/*<![CDATA[*/
+	/*<![CDATA[*/
+	let siteList = gagajf.convertToArray([[${siteList}]]);
+	let cateGbList = gagajf.convertToArray([[${cateGbList}]]);
+	let cateTypeList = gagajf.convertToArray([[${cateTypeList}]]);
+	let formalGbList = gagajf.convertToArray([[${formalGbList}]]);
+	let conentsLocList = gagajf.convertToArray([[${conentsLocList}]]);
+
+	let columnDefs = [
+		{
+			headerName: "사이트", field: "siteCd", width: 150, cellClass: 'text-center',
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(siteList, params.value); }
+		},
+		{
+			headerName: "카테고리구분", field: "cateGb", width: 150, cellClass: 'text-center',
+			cellRenderer: function (params) { return gagaAgGrid.lookupValue(cateGbList, params.value); }
+		},
+		{headerName: "카테고리번호", field: "cateNo", width: 150, cellClass: 'text-center'},
+		{
+			headerName: "카테고리명", field: "cateNm", width: 150, cellClass: 'text-center',
+			cellRenderer: function(params) {
+				return '<a href="javascript:void(0);">' + params.value + '</a>';
+			}
+		},
+		{
+			headerName: "카테고리유형", field: "cateType", width: 150, cellClass: 'text-center',
+			cellRenderer: function (params) { return gagaAgGrid.lookupValue(cateTypeList, params.value); }
+		},
+		{headerName: "말단여부", field: "leafYn", width: 80, cellClass: 'text-center'},
+		{headerName: "노출순서", field: "dispOrd", width: 100, cellClass: 'text-center'},
+		{
+			headerName: "정상이월구분", field: "formalGb", width: 150, cellClass: 'text-center',
+			cellRenderer: function (params) { return gagaAgGrid.lookupValue(formalGbList, params.value); }
+		},
+		{
+			headerName: "컨텐츠위치", field: "contentsLoc", width: 200, cellClass: 'text-center',
+			cellRenderer: function (params) { return gagaAgGrid.lookupValue(conentsLocList, params.value); }
+		},
+		{headerName: "노출여부", field: "dispYn", width: 80, cellClass: 'text-center'},
+		{headerName: "사용여부", field: "useYn", width: 80, cellClass: 'text-center'}
+	];
+
+	let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+
+	// Cell click
+	gridOptions.onCellClicked = function(event) {
+		if (event.colDef.field != 'cateNm')
+			return;
+
+		$("#btnNew").click();
+		$('#detailForm input[name=siteCd]').val(event.data.siteCd);
+		$('#detailForm input[name=cateNo]').val(event.data.cateNo);
+		$('#detailForm input[name=cateNm]').val(event.data.cateNm);
+		$('#detailForm select[name=cateType]').val(event.data.cateType);
+
+		// 상위카테고리
+		var selLvl = $("#searchForm input[name=selLvl]").val();
+		for (let i = 1; i <= 5; i++) {
+			$("#cateLvl" + i).html($("#selCate" + i).html());
+			$("#cateLvl" + i).val($("#selCate" + i).val());
+			if (i >= selLvl) {
+				$("#cateLvl" + i).hide();
+			} else {
+				$("#cateLvl" + i).show();
+			}
+		}
+		$('#detailForm input[name=selLvl]').val(selLvl);
+
+		$('#detailForm input[name=dispOrd]').val(event.data.dispOrd);
+		$('#detailForm select[name=formalGb]').val(event.data.formalGb);
+		$('#detailForm select[name=contentsLoc]').val(event.data.contentsLoc);
+
+		// 카테고리유형에 따른 컨텐츠위치 설정 변경
+		if (event.data.cateType == 'G031_10') {
+			$('#detailForm select[name=contentsLoc]').prop('disabled', true);
+		} else if (event.data.cateType == 'G031_20') {
+			$('#detailForm select[name=contentsLoc]').prop('disabled', false);
+		}
+
+		$('#detailForm input:radio[name=dispYn]:input[value=' + event.data.dispYn + ']').click();
+		$('#detailForm input:radio[name=useYn]:input[value=' + event.data.useYn + ']').click();
+	}
+
+	/**
+	 * 검색폼의 카테고리 선택 시
+	 */
+	var fnChangeSearchCondition = function(val, selLvl) {
+		if (gagajf.isNull(val)) {
+			if (selLvl > 1) {
+				selLvl = selLvl - 1;
+			} else {
+				selLvl = 1;
+			}
+		}
+		$('#searchForm input[name=selLvl]').val(selLvl);
+
+		// Fetch data
+		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm', function(data) {
+			let selLvl = Number($('#searchForm input[name=selLvl]').val()) + 1;
+
+			for (let i = 2; i <= 5; i++) {
+				if (i >= selLvl) {
+					$('#selCate' + i).html('<option value="">[카테고리' + (i - 1) + ']</option>');
+				}
+			}
+
+			let tag = '';
+			for (let i = 0; i < data.length; i++) {
+				if (data[i].useYn == 'Y') {
+					tag += '<option value="' + data[i].cateNo + '">[' + data[i].cateNo + '] ' + data[i].cateNm + '</option>';
+				}
+			}
+
+			$("#selCate" + selLvl).append(tag);
+			//$("#btnNew").click();
+		});
+	}
+
+	// 카테고리유형 변경 시
+	$('#detailForm select[name=cateType]').on('change', function() {
+		if ($(this).val() == 'G031_10') { // 상품분류카테고리
+			$("#detailForm select[name=contentsLoc]").prop('disabled', true);
+		} else if ($(this).val() == 'G031_20') { // 컨텐츠카테고리
+			$("#detailForm select[name=contentsLoc]").prop('disabled', false);
+		}
+	});
+
+	// 등록/수정폼의 상위카테고리 선택 시
+	var fnChangeUpperCategory = function(val, selLvl) {
+		if (gagajf.isNull(val)) {
+			if (selLvl > 1) {
+				selLvl = selLvl - 1;
+			} else {
+				selLvl = 1;
+			}
+		}
+		$('#detailForm input[name=selLvl]').val(selLvl);
+
+		gagajf.ajaxFormSubmit($('#searchForm').prop('action'), "#detailForm", function(data) {
+			let selLvl = Number($('#detailForm input[name=selLvl]').val()) + 1;
+
+			for (let i = 2; i <= 5; i++) {
+				if (i >= selLvl) {
+					$('#cateLvl' + i).html('<option value="">[카테고리' + (i - 1) + ']</option>');
+				}
+			}
+
+			let tag = '';
+			for (let i = 0; i < data.length; i++) {
+				if (data[i].useYn == 'Y') {
+					tag += '<option value="' + data[i].cateNo + '">[' + data[i].cateNo + '] ' + data[i].cateNm + '</option>';
+				}
+			}
+
+			$("#cateLvl" + selLvl).append(tag);
+		});
+	}
+
+	// 신규
+	$('#btnNew').on('click', function(){
+		$("#detailForm")[0].reset();
+// 		$("#detailForm input[name=selLvl]").val('');
+		for (let i = 2; i <= 5; i++) {
+			$("#cateLvl" + i).show();
+		}
+	});
+
+	// 저장
+	$('#btnSave').on('click', function() {
+		// 입력 값 체크
+		if (!gagajf.validation('#detailForm'))
+			return false;
+
+		let selLvl = Number($('#detailForm input[name=selLvl]').val());
+		if (gagajf.isNull($('#detailForm select[name=cate1No]').val())) {
+			if (selLvl > 2) {
+				mcxDialog.alertC('카테고리1을 선택해 주세요.', {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#detailForm select[name=cate1No]').focus();
+					}
+				});
+				return;
+			}
+		}
+
+		if (gagajf.isNull($('#detailForm select[name=cate2No]').val())) {
+			if (selLvl > 3) {
+				mcxDialog.alertC('카테고리2를 선택해 주세요.', {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#detailForm select[name=cate2No]').focus();
+					}
+				});
+				return;
+			}
+		}
+
+		if (gagajf.isNull($('#detailForm select[name=cate3No]').val())) {
+			if (selLvl > 4) {
+				mcxDialog.alertC('카테고리3을 선택해 주세요.', {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#detailForm select[name=cate3No]').focus();
+					}
+				});
+				return;
+			}
+		}
+
+		if (gagajf.isNull($('#detailForm select[name=cate4No]').val())) {
+			if (selLvl > 5) {
+				mcxDialog.alertC('카테고리4를 선택해 주세요.', {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#detailForm select[name=cate4No]').focus();
+					}
+				});
+				return;
+			}
+		}
+
+		mcxDialog.confirm('저장하시겠습니까?', {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function() {
+				$("#detailForm select[name=contentsLoc]").prop('disabled', false);
+
+				var jsonData = JSON.stringify($('#detailForm').serializeObject());
+				gagajf.ajaxFormSubmit($('#detailForm').prop('action'), '#detailForm', function() {
+					$('#btnNew').trigger('click');
+				});
+			}
+		});
+	});
+
+	// 카테고리 갱신
+	$("#btnRefresh4Srch").on("click", function() {
+		mcxDialog.confirm('갱신하시겠습니까?', {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function() {
+				gagajf.ajaxJsonSubmit('/display/category/refresh', null);
+			}
+		});
+	});
+
+	$(document).ready(function() {
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
 
-/*]]>*/
+		$("#detailForm select[name=contentsLoc]").prop('disabled', false);
+	});
+	/*]]>*/
 </script>
 
 </html>

+ 5 - 5
src/main/webapp/WEB-INF/views/display/CategorySearchForm.html

@@ -14,7 +14,7 @@
  * 1.0  2021.01.11   xyzp1539    최초 작성
  *******************************************************************************
  -->
-<div class="modalPopup" data-width="900" id="popupCategory">
+<div class="modalPopup" data-width="1100" id="popupCategory">
 	<div class="panelStyle">
 		<!-- TITLE -->
 		<div class="panelTitle">
@@ -126,7 +126,7 @@
 			return false;
 		}
 		
-		var callbackFn = [[${params.callbackFn}]];
+		var callbackFn = [[${params.callBackFun}]];
 
 		var jsonData = JSON.stringify(selectedData);
 
@@ -162,11 +162,11 @@
 				selLvl = 1;
 			}
 		}
-		$('#searchForm input[name=selLvl]').val(selLvl);
+		$('#searchCategoryListForm input[name=selLvl]').val(selLvl);
 
 		// Fetch data
-		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm', function(data) {
-			let selLvl = Number($('#searchForm input[name=selLvl]').val()) + 1;
+		gagaAgGrid.fetch($('#searchCategoryListForm').prop('action'), categoryGridOptions, '#searchCategoryListForm', function(data) {
+			let selLvl = Number($('#searchCategoryListForm input[name=selLvl]').val()) + 1;
 
 			for (let i = 2; i <= 5; i++) {
 				if (i >= selLvl) {

+ 9 - 4
src/main/webapp/WEB-INF/views/goods/GoodsDetailForm.html

@@ -272,7 +272,7 @@
 											<label class="rdoBtn"><input type="radio" name="changeableYn" id="changeableYnN" value="N"/>N</label>
 											<input type="hidden" id="changeableYnOrg" name="changeableYnOrg"/>
 										</td>
-										<th>신규가입구매가여부<em class="required" title="필수"></em></th>
+										<th>신규가입구매가여부<em class="required" title="필수"></em></th>
 										<td>
 											<label class="rdoBtn"><input type="radio" name="newCustOrdYn" id="newCustOrdYnY" value="Y" />Y</label>
 											<label class="rdoBtn"><input type="radio" name="newCustOrdYn" id="newCustOrdYnN" value="N"/>N</label>
@@ -433,6 +433,13 @@
 												<col width="12%"/>
 												<col/>
 											</colgroup>
+											<tr>
+												<th>상품상세</th>
+												<td><div class="tabJrContArea">
+													<textarea class="textareaR4 summernote" name="goodsDesc" id="goodsDesc"></textarea>
+													</div>
+												</td>
+											</tr>
 											<tr>
 												<th>상위(PC)</th>
 												<td><div class="tabJrContArea">
@@ -939,8 +946,6 @@
 			$('#goodsDetailForm input[name=certNum]').val(result.certNum);
 			$('#goodsDetailForm input[name=certNumOrg]').val(result.certNum);
 			
-			
-			
 			//상품상세
 			$('#goodsDetailForm input[name=goodsTitlesDesc]').val(result.goodsTitlesDesc);
 			// Summernote에 값 세팅
@@ -950,7 +955,7 @@
 			gagaSn.setContents('#goodsMobileTopDesc', result.goodsMobileTopDesc); 
 			gagaSn.setContents('#goodsPcDownDesc', result.goodsPcDownDesc); 
 			gagaSn.setContents('#goodsMobileDownDesc', result.goodsMobileDownDesc); 
-			
+			gagaSn.setContents('#goodsDesc', result.goodsDesc);
 
 			if (!gagajf.isNull(result.niClsfNm)){
 				$('#goodsDetailForm').find('#itemkindNoti').html('품목기준 고시분류 : ' + result.niClsfNm);

+ 0 - 944
src/main/webapp/WEB-INF/views/marketing/CouponCreatePopupForm.html

@@ -1,944 +0,0 @@
-<!DOCTYPE html>
-<html lang="ko"
-	  xmlns:th="http://www.thymeleaf.org">
-<!--
- *******************************************************************************
- * @source  : CouponCreatePopupForm.html
- * @desc    : 쿠폰 등록 팝업 화면
- *============================================================================
- * ISTYLE24
- * Copyright(C) 2020 TSIT, All rights reserved.
- *============================================================================
- * VER  DATE         AUTHOR      DESCRIPTION
- * ===  ===========  ==========  =============================================
- * 1.0  2020.12.23   xyzp1539       최초 작성
- *******************************************************************************
- -->
-<div class="modalPopup" data-width="1200">
-	<div class="panelStyle" >
-		<div class="panelTitle">
-			<h2>쿠폰등록</h2>
-			<button type="button" class="close" onclick="uifnPopupClose('CouponCreatePopup')"><i class="fa fa-times"></i></button>
-		</div>
-		<div class="panelContent">
-			<form id="couponCreateForm" name="couponCreateForm" th:action="@{'/marketing/coupon/save'}" >
-				<input type="hidden" name="supplyCompList" id="supplyCompList">
-				<input type="hidden" name="brandList" id="brandList">
-				<input type="hidden" name="applyGoodsList" id="applyGoodsList">
-				<input type="hidden" name="exceptGoodsList" id="excepGoodsList">
-				<input type="hidden" name="burdenList" id="burdenList">
-				<input type="hidden" name="cateList" id="cateList">
-
-				<div class="tabs">
-					<div class="tabsNav">
-						<ul>
-							<li class="on"><a href="#coupontab1">기본정보</a></li>
-							<li><a href="#coupontab2">적용대상</a></li>
-							<li><a href="#coupontab3">입점업체분담율</a></li>
-						</ul>
-					</div>
-					<ul class="tabsCont">
-						<li class="tab on" id="coupontab1">
-							<div class="panelStyle">
-								<table class="frmStyle">
-									<colgroup>
-										<col style="width:10%">
-										<col style="width:40%;">
-										<col style="width:10%">
-										<col style="width:40%;">
-									</colgroup>
-									<tr>
-										<th>쿠폰번호<em class="required" title="필수"></em></th>
-										<td colspan="5">
-											<input type="hidden" name="copyCpnId" maxlength="50" value="">
-											<input type="hidden" name="mode" maxlength="50" value="">
-											<input type="text" name="cpnId" maxlength="50" value="" style="width:70%;" disabled="true" placeholder="자동생성" data-valid-name="쿠폰번호">
-											<label class="chkBox checked" onclick="clickCreateChk(this);" id="cpnCreateLab">
-												<input type="checkbox" name="cpnCreateType" id="cpnCreateType" value="true" class="type-check" checked />쿠폰번호 자동생성
-											</label>
-										</td>
-									</tr>
-									<tr>
-										<th>쿠폰명<em class="required" title="필수"></em></th>
-										<td colspan="5">
-											<input type="text" name="cpnNm" id="cpnNm" style="width: 70%;" required="required" data-valid-name="쿠폰명">
-										</td>
-									</tr>
-									<tr>
-										<th>쿠폰유형<em class="required" title="필수"></em></th>
-										<td colspan="5">
-											<input type="hidden" id="cpnType" name="cpnType" required="required" data-valid-name="쿠폰유형">
-											<label class="rdoBtn" th:if="${cpnTypeList}" th:each="oneData, status : ${cpnTypeList}"> <input type="radio" name="rdoCpnType"  th:text="${oneData.cdNm}" th:value="${oneData.cd}"/></label>
-										</td>
-									</tr>
-									<tr>
-										<th>사용가능고객구분<em class="required" title="필수"></em></th>
-										<td>
-											<select name="usableCustGb" id="usableCustGb" required="required" data-valid-name="사용가능고객구분">
-												<option th:if="${usableCustGbList}" th:each="oneData , status : ${usableCustGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
-											</select>
-										</td>
-										<th>사이트<em class="required" title="필수"></em></th>
-										<td>
-											<select name="siteCd" id="siteCd" required="required" data-valid-name="사이트">
-												<option th:if="${siteCdList}" th:each="oneData , status : ${siteCdList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
-											</select>
-										</td>
-									</tr>
-									<tr>
-										<th>사용고객등급구분<em class="required" title="필수"></em></th>
-										<td>
-											<select name="usableCustGrade" id="usableCustGrade" required="required" data-valid-name="사용고객등급구분">
-												<option value="ALL">[전체]</option>
-												<option th:if="${usableCustGradeList}" th:each="oneData , status : ${usableCustGradeList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
-											</select>
-										</td>
-										<th>만료알림여부<em class="required" title="필수"></em></th>
-										<td>
-											<select name="endAlimYn" id="endAlimYn" required="required" data-valid-name="만료알림여부">
-												<option value="Y">Y</option>
-												<option value="N" selected="selected">N</option>
-											</select>
-										</td>
-									</tr>
-									<tr>
-										<th>할인방식<em class="required" title="필수"></em></th>
-										<td>
-											<input type="hidden" name="dcWay" id="dcWay" required="required" data-valid-name="할인방식">
-											<label class="rdoBtn" th:if="${dcWayList}" th:each="oneData, status : ${dcWayList}"> <input type="radio" name="rdoDcWay"  th:text="${oneData.cdNm}" th:value="${oneData.cd}"/></label>
-										</td>
-										<th>구매제한금액<em class="required" title="필수"></em></th>
-										<td>
-											<input type="text" id="buyLimitAmt" name="buyLimitAmt" class="w200" required="required" value="0" style="text-align: right;" data-valid-name="구매제한금액">원
-										</td>
-									</tr>
-									<tr>
-										<th>할인값(PC)<em class="required" title="필수"></em></th>
-										<td>
-											<input type="text" class="w200" id="dcPval" name="dcPval" value="0" required="required" data-valid-name="할인값(PC)" data-valid-type="numeric" style="text-align: right"><span id="dcPvalSpan">원</span>
-										</td>
-										<th>할인값(모바일웹)<em class="required" title="필수"></em></th>
-										<td>
-											<input type="text" class="w200" id="dcMval" name="dcMval" value="0" required="required" data-valid-name="할인값(모바일웹)" data-valid-type="numeric" style="text-align: right"><span id="dcMvalSpan">원</span>
-										</td>
-									</tr>
-									<tr>
-										<th>할인값(모바일앱)<em class="required" title="필수"></em></th>
-										<td>
-											<input type="text" class="w200" id="dcAval" name="dcAval" value="0" required="required" data-valid-name="할인값(모바일앱)" data-valid-type="numeric" style="text-align: right"><span id="dcAvalSpan">원</span>
-										</td>
-										<th>최대할인금액<em class="required" title="필수"></em></th>
-										<td>
-											<input type="text" class="w200" id="maxDcAmt" name="maxDcAmt" value="0" required="required" data-valid-name="최대할인금액" data-valid-type="numeric" style="text-align: right;"><span id="maxDcAmtSpan">원</span>
-										</td>
-									</tr>
-									<tr>
-										<th>다운로드시작일시<em class="required" title="필수"></em></th>
-										<td>
-											<input type="hidden" name="downStdt" id="downStdt" required="required" data-valid-name="다운로드시작일시">
-											<input type="text" class="schDate w100" name="downStDay" id="downStDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
-											<select name="downStHH" id="downStHH">
-												<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
-											</select>
-											<select name="downStMM" id="downStMM">
-												<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
-											</select>
-										<th>다운로드종료일시<em class="required" title="필수"></em></th>
-										<td>
-											<input type="hidden" id="downEddt" name="downEddt" required="required" data-valid-name="다운로드종료일시">
-											<input type="text" class="schDate w100" name="downEdDay" id="downEdDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
-											<select name="downEdHH" id="downEdHH">
-												<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
-											</select>
-											<select name="downEdMM" id="downEdMM">
-												<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
-											</select>
-										</td>
-									</tr>
-									<tr>
-										<th>기간/일수구분<em class="required" title="필수"></em></th>
-										<td>
-											<select name="pdGb" id="pdGb" onchange="pdGbChange(this)" required="required" data-valid-name="기간/일수구분">
-												<option value="P">기간</option>
-												<option value="D">일수</option>
-											</select>
-										</td>
-										<th>적용범위<em class="required" title="필수"></em></th>
-										<td>
-											<input type="hidden" name="applyScope" id="applyScope" required="required" data-valid-name="적용범위">
-											<label class="rdoBtn"> <input type="radio" name="rdoApplyScope" value="A"/>전체</label>
-											<label class="rdoBtn"> <input type="radio" name="rdoApplyScope" value="I"/>개별</label>
-										</td>
-									</tr>
-									<tr class="availDayTr" style="display: none;">
-										<th>유효기간일수<em class="required" title="필수"></em></th>
-										<td>
-											<input type="text" name="availDays" id="availDays" class="w200" data-valid-name="유효기간일수">
-										</td>
-									</tr>
-									<tr>
-										<th class="availDateTr">유효기간시작일시<em class="required" title="필수"></em></th>
-										<td class="availDateTr">
-											<input type="hidden" name="availStdt" id="availStdt" data-valid-name="유효기간시작일시">
-											<input type="text" class="schDate w100" name="availStDay" id="availStDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
-											<select name="availStHH" id="availStHH">
-												<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
-											</select>
-											<select name="availStMM" id="availStMM">
-												<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
-											</select>
-										<th class="availDateTr">유효기간종료일시<em class="required" title="필수"></em></th>
-										<td class="availDateTr">
-											<input type="hidden" id="availEddt" name="availEddt" data-valid-name="유효기간종료일시">
-											<input type="text" class="schDate w100" name="availEdDay" id="availEdDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
-											<select name="availEdHH" id="availEdHH">
-												<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
-											</select>
-											<select name="availEdMM" id="availEdMM">
-												<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
-											</select>
-										</td>
-									</tr>
-									<tr>
-										<th>첫구매여부<em class="required" title="필수"></em></th>
-										<td>
-											<select name="firstYn" id="firstYn" onchange="firstYnChange(this)" required="required" data-valid-name="첫구매여부">
-												<option value="Y">Y</option>
-												<option value="N" selected="selected">N</option>
-											</select>
-										</td>
-										<th>다운로드가능여부<em class="required" title="필수"></em></th>
-										<td>
-											<select name="downYn" id="downYn" required="required" data-valid-name="다운로드가능여부">
-												<option value="Y">Y</option>
-												<option value="Y" selected="selected">N</option>
-											</select>
-										</td>
-									</tr>
-									<tr>
-										<th class="buyDateTr">첫구매기간시작일시<em class="required" title="필수"></em></th>
-										<td class="buyDateTr">
-											<input type="hidden" id="buyEddt" name="buyEddt" data-valid-name="첫구매기간종료일시">
-											<input type="text" class="schDate w100" name="buyStDay" id="buyStDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
-											<select name="buyStHH" id="buyStHH">
-												<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
-											</select>
-											<select name="buyStMM" id="buyStMM">
-												<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
-											</select>
-										<th class="buyDateTr">첫구매기간종료일시<em class="required" title="필수"></em></th>
-										<td class="buyDateTr">
-											<input type="hidden" name="buyStdt" id="buyStdt" data-valid-name="첫구매기간시작일시">
-											<input type="text" class="schDate w100" name="buyEdDay" id="buyEdDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
-											<select name="buyEdHH" id="buyEdHH">
-												<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
-											</select>
-											<select name="buyEdMM" id="buyEdMM">
-												<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
-											</select>
-										</td>
-									</tr>
-									<tr>
-										<th>신규회원여부<em class="required" title="필수"></em></th>
-										<td colspan="5">
-											<select name="custJoinYn" id="custJoinYn" onchange="custJoinYnChange(this)" required="required" data-valid-name="신규회원여부">
-												<option value="Y">Y</option>
-												<option value="N" selected="selected">N</option>
-											</select>
-										</td>
-									</tr>
-									<tr>
-										<th class="custJoinDateTr">신규회원기간시작일시<em class="required" title="필수"></em></th>
-										<td class="custJoinDateTr">
-											<input type="hidden" name="custJoinStdt" id="custJoinStdt" data-valid-name="신규회원기간시작일시">
-											<input type="text" class="schDate w100" name="custJoinStDay" id="custJoinStDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
-											<select name="custJoinStHH" id="custJoinStHH">
-												<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
-											</select>
-											<select name="custJoinStMM" id="custJoinStMM">
-												<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
-											</select>
-										<th class="custJoinDateTr">신규회원기간종료일시<em class="required" title="필수"></em></th>
-										<td class="custJoinDateTr">
-											<input type="hidden" id="custJoinEddt" name="custJoinEddt" data-valid-name="신규회원기간종료일시">
-											<input type="text" class="schDate w100" name="custJoinEdDay" id="custJoinEdDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
-											<select name="custJoinEdHH" id="custJoinEdHH">
-												<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
-											</select>
-											<select name="custJoinEdMM" id="custJoinEdMM">
-												<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
-											</select>
-										</td>
-									</tr>
-									<tr>
-										<th>총발행제한수량<em class="required" title="필수"></em></th>
-										<td>
-											<input type="text" class="w200" name="totPubLimitQty" id="totPubLimitQty" value="0" required="required" data-valid-name="총발행제한수량" data-valid-type="numeric" style="text-align: right;">개<span class="cRed" id="totPubLimitQtySpan"> *제한없음</span>
-										</td>
-										<th>1인당발행제한수량<em class="required" title="필수"></em></th>
-										<td>
-											<input type="text" class="w200" name="custPubLimitQty" id="custPubLimitQty" value="0" required="required" data-valid-name="1인당발행제한수량" data-valid-type="numeric" style="text-align: right;">개<span class="cRed" id="custPubLimitQtySpan"> *제한없음</span>
-										</td>
-									</tr>
-									<tr>
-										<th>최소주문금액<em class="required" title="필수"></em></th>
-										<td><input type="text" class="w200" name="minBuyAmt" id="minBuyAmt" value="0" required="required" data-valid-name="최소주문금액" data-valid-type="numeric" style="text-align: right;">원<span class="cRed" id="minBuyAmtSpan"> *제한없음</span></td>
-										<th>1회발행수량<em class="required" title="필수"></em></th>
-										<td><input type="text" class="w200" name="onePubQty" id="onePubQty" value="1" required="required" data-valid-name="1회발행수량" data-valid-type="numeric" style="text-align: right;">개</td>
-									</tr>
-									<tr>
-										<th>재발급여부<em class="required" title="필수"></em></th>
-										<td>
-											<select name="reissuance" id="reissuance" required="required" data-valid-name="재발급여부" >
-												<option th:if="${reissuanceList}" th:each="oneData , status : ${reissuanceList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
-											</select>
-										</td>
-										<th>다운로드구분<em class="required" title="필수"></em></th>
-										<td>
-											<select name="dnGb" id="dnGb" required="required" data-valid-name="다운로드구분">
-												<option th:if="${dnGbList}" th:each="oneData , status:${dnGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
-											</select>
-										</td>
-									</tr>
-									<tr>
-										<th>쿠폰상태<em class="required" title="필수"></em></th>
-										<td>
-											<select name="cpnStat" id="cpnStat" ata-valid-name="쿠폰상태" required="required">
-												<option th:if="${cpnStatList}" th:each="oneData , status : ${cpnStatList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
-											</select>
-										</td>
-									</tr>
-									<tr class="payTypeTr" style="display: none;">
-										<th>결제수단<em class="required" title="필수"></em></th>
-										<td>
-											<select name="payType" id="payType" data-valid-name="결제수단">
-												<option value="">[전체]</option>
-												<option th:if="${payTypeList}" th:each="oneData , status : ${payTypeList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
-											</select>
-										</td>
-									</tr>
-								</table>
-								<div class="mdPopBtnB aR">
-									<button type="button" class="btn btn-info btn-lg" onclick="fnCouponCreate();">등록</button>
-								</div>
-							</div>
-						</li>
-						<!-- 쿠폰적용대상-->
-						<li class="tab" id="coupontab2" >
-							<div class="panelStyle">
-								<div class="panelTitle">
-									<h2 style="position: relative">적용 대상 상품 등록</h2>
-								</div>
-								<div class="inner-panelContent">
-									<div class="panelContent">
-										<table class="frmStyle">
-											<colgroup>
-												<col style="width:15%;">
-												<col style="width:85%;">
-											</colgroup>
-											<tbody>
-												<tr>
-													<th>공급처</th>
-													<td>
-														<div class="padding10 inner-tb-solid">
-															<button type="button" class="btn btnRight btn-success btn-lg" id="btnSupplyAdd">공급처 추가</button>
-															<button type="button" class="btn btnRight btn-success btn-lg" id="btnSupplyDel">선택삭제</button>
-															<br/>
-															<div id="supplyGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
-														</div>
-													</td>
-												</tr>
-												<tr>
-													<th>브랜드</th>
-													<td>
-														<div class="padding10 inner-tb-solid">
-															<button type="button" class="btn btnRight btn-success btn-lg" id="btnBrandAdd">브랜드 추가</button>
-															<button type="button" class="btn btnRight btn-success btn-lg" id="btnBrandDel">선택삭제</button>
-															<br/>
-															<div id="brandGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
-														</div>
-													</td>
-												</tr>
-												<tr>
-													<th>카테고리</th>
-													<td>
-														<div class="padding10 inner-tb-solid">
-															<button type="button" class="btn btnRight btn-success btn-lg" id="btnCateAdd">카테고리 추가</button>
-															<button type="button" class="btn btnRight btn-success btn-lg" id="btnCateDel">선택삭제</button>
-															<br/>
-															<div id="cateGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
-														</div>
-													</td>
-												</tr>
-												<tr>
-													<th>적용상품</th>
-													<td>
-														<div class="padding10 inner-tb-solid">
-															<button type="button" class="btn btnRight btn-success btn-lg" id="btnGoodsAdd">상품 추가</button>
-															<button type="button" class="btn btnRight btn-success btn-lg" id="btnGoodsDel">선택삭제</button>
-															<br/>
-															<div id="goodsGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
-														</div>
-													</td>
-												</tr>
-											</tbody>
-										</table>
-									</div>
-								</div>
-								<div class="panelTitle">
-									<h2 style="position: relative">적용 제외 대상 상품 등록</h2>
-								</div>
-								<div class="inner-panelContent">
-									<div class="panelContent">
-										<table class="frmStyle">
-											<colgroup>
-												<col style="width:15%;">
-												<col style="width:85%;">
-											</colgroup>
-											<tbody>
-											<tr>
-												<th>제외상품</th>
-												<td>
-													<div class="padding10 inner-tb-solid">
-														<button type="button" class="btn btnRight btn-success btn-lg" id="btnExcepGoodsAdd">제외상품 추가</button>
-														<button type="button" class="btn btnRight btn-success btn-lg" id="btnExcepGoodsDel">선택삭제</button>
-														<br/>
-														<div id="excepGoodsGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
-													</div>
-												</td>
-											</tr>
-											</tbody>
-										</table>
-									</div>
-								</div>
-							</div>
-						</li>
-						<!-- 쿠폰적용대상끝-->
-						<!-- 입점업체분담율-->
-						<li class="tab" id="coupontab3">
-							<div class="panelStyle">
-								<ul class="panelBar">
-									<li class="left">
-										<button type="button" class="btn btn-warning btn-lg" id="btnAddRow">행추가</button>
-										<button type="button" class="btn btn-danger btn-lg" id="btnDeleteRow">행삭제</button>
-									</li>
-								</ul>
-
-								<div id="inComGridList" style="width: 100%; height: 570px" class="ag-theme-balham"></div>
-
-							</div>
-						</li>
-						<!-- 입점업체분담끝-->
-					</ul>
-				</div>
-			</form>
-		</div>
-	</div>
-</div>
-<script th:inline="javascript">
-	/*<![CDATA[*/
-	var ibSupplyComList = gagajf.convertToArray([[${ibSupplyCompList}]]);
-	var delYnList = { "Y":"Yes", "N":"No" };
-
-	// ag-grid 입점업체분담율 컬럼
-	var columnDefs = [
-		{ headerName: "입점업체" , field:"supplyCompCd" , width:150, cellClass:"text-center" ,
-			cellEditor: 'agRichSelectCellEditor',
-			cellEditorParams: { values: gagaAgGrid.extractValues(ibSupplyComList) },
-			valueFormatter: function (params) { return gagaAgGrid.lookupValue(ibSupplyComList, params.value); },
-			valueParser: function (params) { return gagaAgGrid.lookupKey(ibSupplyComList, params.newValue);}
-		} ,
-		{ headerName: "쿠폰분담율(%)", field:"burdenRate" , width:150, cellClass: "text-center" ,
-		  cellEditorParams: { maxlength: 10, required: true }
-		} ,
-		{ headerName: "삭제여부" , field: "delYn"  , width:150, cellClass: "text-center" ,
-			cellEditor: 'agRichSelectCellEditor',
-			cellEditorParams: { values: gagaAgGrid.extractValues(delYnList) },
-			valueFormatter: function (params) { return gagaAgGrid.lookupValue(delYnList, params.value); },
-			valueParser: function (params) { return gagaAgGrid.lookupKey(delYnList, params.newValue); }
-		}
-	];
-
-	// ag-grid 공급처 컬럼
-	var supplyColumnDefs = [
-		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
-		{ headerName : "공급업체코드" , field: "supplyCompCd" , width:150, cellClass: 'text-center'} ,
-		{ headerName: "공급업체명" , field: "supplyCompNm" , width:150, cellClass: 'text-center'}
-	];
-
-	// ag-grid 브랜드 컬럼
-	var brandSelColumnDefs = [
-		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
-		{ headerName : "브랜드ID" , field: "brandCd" , width: 120, cellClass : 'text-center'} ,
-		{ headerName : "브랜드명" , field: "brandEnm" , width: 120, cellClass: 'text-center'} ,
-		{ headerName : "공급업체명", field: "supplyCompNm" , width: 150, cellClass: 'text-center' } ,
-		//{ headerName: "적용대상" , field: "targetGb" , width: 150, cellClass: 'text-center'}
-	];
-
-	// ag-grid 적용상품 컬럼
-	var goodsSelColumnDefs = [
-		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
-		{ headerName: "상품구분" , field: "goodsGb" , width: 100, cellClass: 'text-center'} ,
-		{ headerName: "Product ID" , field: "goodsCd" , width: 120, cellClass: 'text-center'},
-		{ headerName: "상품명"  , field: "goodsNm" , width: 120 , cellClass: 'text-center'} ,
-		//{ headerName: "적용대상" , field: "targetGB" , width: 150, cellClass: 'text-center'}
-	];
-
-	// ag-grid 카테고리 컬럼
-	var cateSelColumnDefs = [
-		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
-		{ headerName: "카테고리코드" , field: "cateNo" , width: 100 , cellClass: 'text-center'} ,
-		{ headerName: "카테고리명" , field: "cateNm" , width: 120 , cellClass: 'text-center'},
-		//{ headerName: "적용대사"}
-	];
-
-	// ag-grid 제외상품 컬럼
-	var excepGoodsColumnDefs = [
-		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
-		{ headerName: "상품구분" , field: "goodsGb" , width: 100, cellClass: 'text-center'} ,
-		{ headerName: "Product ID" , field: "goodsCd" , width: 120, cellClass: 'text-center'},
-		{ headerName: "상품명"  , field: "goodsNm" , width: 120 , cellClass: 'text-center'} ,
-	];
-
-	var inComGridOptions = gagaAgGrid.getGridOptions(columnDefs);
-	var cateGridOptions = gagaAgGrid.getGridOptions(cateSelColumnDefs);
-	var goodsGridOptions = gagaAgGrid.getGridOptions(goodsSelColumnDefs);
-	var brandGridOptions = gagaAgGrid.getGridOptions(brandSelColumnDefs);
-	var supplyGridOptions = gagaAgGrid.getGridOptions(supplyColumnDefs);
-	var excepGoodsGridOptions = gagaAgGrid.getGridOptions(excepGoodsColumnDefs);
-
-	inComGridOptions.defaultColDef.editable = true;
-	inComGridOptions.rowSelection = "multiple";
-	goodsGridOptions.rowSelection = "multiple";
-	supplyGridOptions.rowSelection = "multiple";
-	excepGoodsGridOptions.rowSelection = "multiple";
-	cateGridOptions.rowSelection = "multiple";
-	brandGridOptions.rowSelection = "multiple";
-	inComGridOptions.stopEditingWhenGridLosesFocus = true;
-
-	// 쿠폰 등록 버튼 클릭시
-	function fnCouponCreate(){
-		// 필수값들 셋팅
-		setReqValue();
-
-		// 필수값 validation 체크
-		if (!gagajf.validation('#couponCreateForm')) {
-			return false;
-		}
-
-		//신규가입 지급한다면 validation 체크
-		if( $('#custJoinYn option:selected').val() == "Y" ){
-			var fromDate = $('#couponCreateForm input[name=custJoinStdt]').val();
-			var toDate = $('#couponCreateForm input[name=custJoinEddt]').val();
-
-			if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
-				mcxDialog.alertC("신규가입기간 시작일자와 종료일자를 입력하세요.", {
-					sureBtnText: "확인",
-					sureBtnClick: function() {
-						$('#couponCreateForm input[name=custJoinStdt]').focus();
-					}
-				});
-				return false;
-			}
-
-			if (fromDate > toDate) {
-				mcxDialog.alertC("등록 시작일자는 종료일자 보다 클 수 없습니다.", {
-					sureBtnText: "확인",
-					sureBtnClick: function() {
-						$('#couponCreateForm input[name=custJoinEddt]').focus();
-					}
-				});
-				return false;
-			}
-		}
-
-		// 첫구매 지급하면 validation 체크
-		if( $('#firstYn option:selected').val() == "Y" ){
-			var fromDate = $('#couponCreateForm input[name=buyStdt]').val();
-			var toDate = $('#couponCreateForm input[name=buyEddt]').val();
-
-			if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
-				mcxDialog.alertC("신규가입기간 시작일자와 종료일자를 입력하세요.", {
-					sureBtnText: "확인",
-					sureBtnClick: function() {
-						$('#couponCreateForm input[name=buyStdt]').focus();
-					}
-				});
-				return false;
-			}
-
-			if (fromDate > toDate) {
-				mcxDialog.alertC("등록 시작일자는 종료일자 보다 클 수 없습니다.", {
-					sureBtnText: "확인",
-					sureBtnClick: function() {
-						$('#couponCreateForm input[name=buyEddt]').focus();
-					}
-				});
-				return false;
-			}
-		}
-
-		// 할인율 validation 체크 (100을 넘길수없음)
-		if($('#dcWay').val() == 'G240_11') {
-			if($('#dcPval').val() > 100) {
-				mcxDialog.alert('PC할인율은 100을 초과할수없습니다.');
-				$('#dcPval').focus();
-				return false;
-			} else if( $('#dcMval').val() > 100) {
-				mcxDialog.alert('모바일(웹)할인율은 100을 초과할수없습니다.');
-				$('#dcMval').focus();
-				return false;
-			}  else if( $('#dcAval').val() > 100) {
-				mcxDialog.alert('모바일(앱)할인율은 100을 초과할수없습니다.');
-				$('#dcAval').focus();
-				return false;
-			}
-		}
-
-		mcxDialog.confirm('저장하시겠습니까?' , {
-			cancelBtnText:"취소",
-			sureBtnText:"확인",
-			sureBtnClick: function () {
-				gagajf.ajaxFormSubmit($('#couponCreateForm').prop('action'), '#couponCreateForm', function() {
-					uifnPopupClose('CouponCreatePopup');
-					$('#btnSearch').trigger('click');
-				});
-			}
-		});
-	}
-
-	// 할인방식 변경
-	$("#couponCreateForm input[name=rdoDcWay]").bind('click change', function () {
-		var radioValue = $(this).val();
-
-		if(radioValue == 'G240_10') {
-			$('#dcPvalSpan').text("원");
-			$('#dcMvalSpan').text("원");
-			$('#dcAvalSpan').text("원");
-		} else {
-			$('#dcPvalSpan').text("%");
-			$('#dcMvalSpan').text("%");
-			$('#dcAvalSpan').text("%");
-		}
-	});
-
-	// 쿠폰 상태 변경
-	$("#couponCreateForm input[name=rdoCpnType]").bind('click change', function () {
-		var radioValue = $(this).val();
-
-		// 상품쿠폰 선택시 적용범위 개별로 변경 나머진 전체
-		if(radioValue == 'G230_11') {
-			$("input:radio[name='rdoApplyScope']:radio[value='I']").prop('checked', true);
-		} else {
-			$("input:radio[name='rdoApplyScope']:radio[value='A']").prop('checked', true);
-		}
-
-		// 주문서 쿠폰 선택시 결제수단 노출
-		if(radioValue == 'G230_20') {
-			$('.payTypeTr').css('display' , '');
-			$('#couponCreateForm #payType').attr('required' , true);
-		} else {
-			$('.payTypeTr').css('display' , 'none');
-			$('#couponCreateForm #payType').attr('required' , false );
-		}
-
-		$('#couponCreateForm #cpnType').val(radioValue);
-	});
-
-	// 적용대상 - 브랜드 추가 버튼시
-	$('#btnBrandAdd').on('click' , function(){
-		cfnOpenBrandListPopup("fnSetPopupBrandInfo", "M");
-	});
-
-	// 브랜드 설정 / 브랜드 추가 콜백함수 (단수로 가져오므로 복수일 경우에 수정 확인 필요)
-	var fnSetPopupBrandInfo = function(result) {
-		for(let i = 0 ; i < result.length ; i++) {
-			let addChk = true, gridListValue = gagaAgGrid.getAllRowData(brandGridOptions);		// 받아온 모든 데이터
-
-			// 받아온 data for
-			for(let j = 0 ; j < gridListValue.length ; j++) {
-				if(gridListValue[j].brandCd == result[i].brandCd) {	addChk = false;	}					// 중복체크
-			}
-
-			// 중복되지 않은 데이터 리스트에 추가
-			if(addChk) {
-				gagaAgGrid.addRowData(brandGridOptions, {"brandCd" : result[i].brandCd, "brandEnm" : result[i].brandEnm, "supplyCompNm" : result[i].supplyCompNm});
-			}
-		}
-	};
-
-	// 적용대상 - 브랜드 삭제 버튼시
-	$('#btnBrandDel').on('click' , function(){
-		brandGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(brandGridOptions)});
-	});
-
-	// 적용대상 - 공급처 추가 버튼시
-	$('#btnSupplyAdd').on('click' , function (){
-		cfnOpenCompanyListPopup("fnSetPopupComapnyInfo");
-	});
-
-	// 공급업체 설정 / 업체 추가 콜백함수
-	var fnSetPopupComapnyInfo = function(result) {
-		// 기존 리스트 데이터 for
-		for(let i = 0 ; i < result.length ; i++) {
-			let addChk = true, gridListValue = gagaAgGrid.getAllRowData(supplyGridOptions);		// 받아온 모든 데이터
-
-			// 받아온 data for
-			for(let j = 0 ; j < gridListValue.length ; j++) {
-				// 동일한 data는 추가하지 않음
-				if(gridListValue[j].supplyCompCd == result[i].supplyCompCd) {	addChk = false;	}		// 중복체크
-			}
-
-			// 중복되지 않은 데이터 리스트에 추가
-			if(addChk) {
-				gagaAgGrid.addRowData(supplyGridOptions, {"supplyCompCd" : result[i].supplyCompCd, "supplyCompNm" : result[i].supplyCompNm});
-			}
-		}
-	};
-
-	// 적용대상 - 공급처 삭제시시
-	$('#btnSupplyDel').on('click' , function () {
-		supplyGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(supplyGridOptions)});
-	});
-
-	// 적용대상 - 카테고리 추가시
-	$('#btnCateAdd').on('click' , function () {
-		cfnOpenCategoryPopup("fnSetPopupCategoryInfo");
-	});
-
-	// 카테고리 추가 콜백 함수
-	var fnSetPopupCategoryInfo = function (result) {
-		// 기존 리스트 데이터 for
-		for(let i = 0 ; i < result.length ; i++) {
-			let addChk = true, gridListValue = gagaAgGrid.getAllRowData(cateGridOptions);		// 받아온 모든 데이터
-
-			// 받아온 data for
-			for(let j = 0 ; j < gridListValue.length ; j++) {
-				// 동일한 data는 추가하지 않음
-				if(gridListValue[j].supplyCompCd == result[i].supplyCompCd) {	addChk = false;	}		// 중복체크
-			}
-
-			// 중복되지 않은 데이터 리스트에 추가
-			if(addChk) {
-				gagaAgGrid.addRowData(cateGridOptions, {"supplyCompCd" : result[i].supplyCompCd, "supplyCompNm" : result[i].supplyCompNm});
-			}
-		}
-	}
-
-	// 적용대상 - 카테고리 삭제시
-	$('#btnCateDel').on('click' , function () {
-		cateGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(cateGridOptions)});
-	});
-
-	// 적용대상 - 상품 추가시
-	$('#btnGoodsAdd').on('click' , function () {
-		cfnOpenGoodsPopup("fnSetPopupApplyGoodsInfo");
-	});
-
-	// 적용 상품 리스트 콜백함수
-	var fnSetPopupApplyGoodsInfo = function(result) {
-		gridAddGoodsList(goodsGridOptions, result , "apply");
-	};
-
-	// 적용대상 - 상품 삭제 시
-	$('#btnGoodsDel').on('click' , function () {
-		goodsGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(goodsGridOptions)});
-	});
-
-	// 적용대상 - 제외상품 추가시
-	$('#btnExcepGoodsAdd').on('click' , function(){
-		gridAddGoodsList(excepGoodsGridOptions, result , "except");
-	});
-
-	$('#btnExcepGoodsDel').on('click' , function () {
-		excepGoodsGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(excepGoodsGridOptions)});
-	});
-
-	// ag-grid 상품관련 list 콜백함수
-	function gridAddGoodsList(OriginGridListOption, result, gubun) {
-		var goodsGbVal = "G800_10";
-		if(gubun == 'except'){
-			goodsGbVal = "G800_30";
-		}
-
-		for(let i = 0 ; i < result.length ; i++) {
-			let addChk = true, gridListValue = gagaAgGrid.getAllRowData(OriginGridListOption);		// 받아온 모든 데이터
-
-			// 받아온 data for
-			for(let j = 0 ; j < gridListValue.length ; j++) {
-				if(gridListValue[j].goodsCd == result[i].goodsCd) {	addChk = false;	}				// 중복체크
-			}
-
-			// 중복되지 않은 데이터 리스트에 추가
-			if(addChk) {
-				//gagaAgGrid.addRowData(OriginGridListOption, result[i], "goodsCd");
-				gagaAgGrid.addRowData(OriginGridListOption, {"goodsGb": goodsGbVal, "goodsCd" : result[i].goodsCd, "goodsNm" : result[i].goodsNm});
-			}
-		}
-	}
-
-	// 기간 일수 변경시
-	function pdGbChange(pThis){
-		var selectVal = $(pThis).val();
-
-		if(typeof selectVal == "undefined") {
-			selectVal = "P";
-		}
-
-		if(selectVal == "P") {
-			$('.availDateTr').css('display' , '');
-			$('.availDayTr').css('display' , 'none');
-			$('#couponCreateForm #availDays').attr('required' , false);
-			$('#couponCreateForm #availStDay').attr('required' , true);
-			$('#couponCreateForm #availEdDay').attr('required' , true);
-			$('#couponCreateForm #availStdt').attr('required' , true);
-			$('#couponCreateForm #availEddt').attr('required' , true);
-		} else {
-			$('.availDateTr').css('display' , 'none');
-			$('.availDayTr').css('display' , '');
-			$('#couponCreateForm #availDays').attr('required' , true);
-			$('#couponCreateForm #availStDay').attr('required' , false);
-			$('#couponCreateForm #availEdDay').attr('required' , false);
-			$('#couponCreateForm #availStdt').attr('required' , false);
-			$('#couponCreateForm #availEddt').attr('required' , false);
-		}
-	}
-
-	// 첫구매여부 변경시
-	function firstYnChange(pThis){
-		var selectVal = $(pThis).val();
-
-		if(typeof selectVal == "undefined") {
-			selectVal = "N";
-		}
-
-		if(selectVal == "Y" ) {
-			$('.buyDateTr').css('display' , '');
-			$('#buyStdt').attr('required' , true);
-			$('#buyEddt').attr('required' , true);
-		} else {
-			$('.buyDateTr').css('display' , 'none');
-			$('#buyStdt').attr('required' , false);
-			$('#buyEddt').attr('required' , false);
-		}
-	}
-
-	// 신규회원여부 변경시
-	function custJoinYnChange(pThis){
-		var selectVal = $(pThis).val();
-
-		if(typeof selectVal == "undefined") {
-			selectVal = "N";
-		}
-
-		if(selectVal == "Y" ) {
-			$('.custJoinDateTr').css('display' , '');
-			$('#custJoinStdt').attr('required' , true);
-			$('#custJoinEddt').attr('required' , true);
-		} else {
-			$('.custJoinDateTr').css('display' , 'none');
-			$('#custJoinStdt').attr('required' , false);
-			$('#custJoinEddt').attr('required' , false);
-		}
-	}
-
-	// 행추가시
-	$('#btnAddRow').on('click' , function(){
-		var data = { supplyCompCd: null , burdenRate : null , delYn : null};
-		gagaAgGrid.addRowData(inComGridOptions , data , "supplyCompCd" );
-	});
-
-	// 쿠폰번호 자동생성 클릭시
-	function clickCreateChk(){
-		var flag = $('#couponCreateForm input[name=cpnCreateType]').prop("checked");
-
-		if(!flag) {
-			$("#couponCreateForm input[name=cpnId]").prop("disabled", true);
-			$("#couponCreateForm input[name=cpnId]").attr("required", false);
-			$("#couponCreateForm input[name=cpnId]").attr("placeholder", "자동생성");
-			$('#couponCreateForm input[name=cpnCreateType]').prop("checked" , false);
-		} else{
-			$("#couponCreateForm input[name=cpnId]").prop("disabled", false);
-			$("#couponCreateForm input[name=cpnId]").attr("required", true);
-			$("#couponCreateForm input[name=cpnId]").attr("placeholder", "");
-			$('#couponCreateForm input[name=cpnCreateType]').prop("checked" , true);
-		}
-	}
-
-	// 전송시 값 세팅
-	function setReqValue(){
-		// 쿠폰유형값 세팅
-		$('#couponCreateForm #cpnType').val($('#couponCreateForm input:radio[name="rdoCpnType"]:checked').val());
-		// 할인방식값 세팅
-		$('#couponCreateForm #dcWay').val($('#couponCreateForm input:radio[name="rdoDcWay"]:checked').val());
-		// 적용범위값 세팅
-		$('#couponCreateForm #applyScope').val($('#couponCreateForm input:radio[name="rdoApplyScope"]:checked').val());
-		// 다운로드기간 세팅
-		$('#couponCreateForm #downStdt').val($('#couponCreateForm #downStDay').val() + " " + $('#couponCreateForm #downStHH').val() + ":" + $('#couponCreateForm #downStMM').val() + ":00");
-		$('#couponCreateForm #downEddt').val($('#couponCreateForm #downEdDay').val() + " " + $('#couponCreateForm #downEdHH').val() + ":" + $('#couponCreateForm #downEdMM').val() + ":59");
-		// 유효기간 세팅
-		$('#couponCreateForm #availStdt').val($('#couponCreateForm #availStDay').val() + " " + $('#couponCreateForm #availStHH').val() + ":" + $('#couponCreateForm #availStMM').val() + ":00");
-		$('#couponCreateForm #availEddt').val($('#couponCreateForm #availEdDay').val() + " " + $('#couponCreateForm #availEdHH').val() + ":" + $('#couponCreateForm #availEdMM').val() + ":59");
-		// 첫구매기간세팅
-		$('#couponCreateForm #buyStdt').val($('#couponCreateForm #buyStDay').val() + " " + $('#couponCreateForm #buyStHH').val() + ":" + $('#couponCreateForm #buyStMM').val() + ":00");
-		$('#couponCreateForm #buyEddt').val($('#couponCreateForm #buyEdDay').val() + " " + $('#couponCreateForm #buyEdHH').val() + ":" + $('#couponCreateForm #buyEdMM').val() + ":59");
-		// 신규회원기간 세팅
-		$('#couponCreateForm #custJoinStdt').val($('#couponCreateForm #custJoinStDay').val() + " " + $('#couponCreateForm #custJoinStHH').val() + ":" + $('#couponCreateForm #custJoinStMM').val() + ":00");
-		$('#couponCreateForm #custJoinEddt').val($('#couponCreateForm #custJoinEdDay').val() + " " + $('#couponCreateForm #custJoinEdHH').val() + ":" + $('#couponCreateForm #custJoinEdMM').val() + ":59");
-		// 적용대상 - 공급처 그리드 전체값 세팅
-		var supplyAllData = gagaAgGrid.getAllRowData(supplyGridOptions);
-		var jsonSupplyCompData = JSON.stringify(supplyAllData);
-		$('#couponCreateForm #supplyCompList').val(jsonSupplyCompData);
-		// 적용대상 - 브랜드 그리드 전체값 세팅
-		var brandAllData = gagaAgGrid.getAllRowData(brandGridOptions);
-		var jsonBrandData = JSON.stringify(brandAllData);
-		$('#couponCreateForm #brandList').val(jsonBrandData);
-		// // 적용대상 - 카테고리 그리드 전체값 세팅
-		var cateAllData = gagaAgGrid.getAllRowData(cateGridOptions);
-		var jsonCateData = JSON.stringify(cateAllData);
-		$('#couponCreateForm #cateList').val(jsonCateData);
-		// 적용대상 - 적용상품 그리드 전체값 세팅
-		var goodsAllData = gagaAgGrid.getAllRowData(goodsGridOptions);
-		var jsonGoodsData = JSON.stringify(goodsAllData);
-		$('#couponCreateForm #applyGoodsList').val(jsonGoodsData);
-		// 적용대상 - 제외상품 그리드 전체값 세팅
-		var exceptGoodsAllData = gagaAgGrid.getAllRowData(excepGoodsGridOptions);
-		var jsonExceptGoodsData = JSON.stringify(exceptGoodsAllData);
-		$('#couponCreateForm #excepGoodsList').val(jsonExceptGoodsData);
-		// 입점업체분담율 그리드 전체값 세팅
-		var inCompBurdenAllData = gagaAgGrid.getAllRowData(inComGridOptions);
-		var jsonInCompBurdenData = JSON.stringify(inCompBurdenAllData);
-		$('#couponCreateForm #burdenList').val(jsonInCompBurdenData);
-
-	}
-
-	$(document).ready(function() {
-		// 초기화시 데이터 세팅
-		$('input[name=rdoCpnType]').eq(0).attr("checked" , true);
-		$('input[name=rdoDcWay]').eq(0).attr("checked" , true);
-		$('input[name=rdoApplyScope]').eq(0).attr("checked" , true)
-		$('#couponCreateForm #availEdHH option:last').attr("selected" , "selected");
-		$('#couponCreateForm #availEdMM option:last').attr("selected" , "selected");
-		$('#downEdHH option:last').attr("selected" , "selected");
-		$('#downEdMM option:last').attr("selected" , "selected");
-		$('#custJoinEdHH option:last').attr("selected" , "selected");
-		$('#custJoinEdMM option:last').attr("selected" , "selected");
-		$('#buyEdHH option:last').attr("selected" , "selected");
-		$('#buyEdMM option:last').attr("selected" , "selected");
-
-		pdGbChange();
-		firstYnChange();
-		custJoinYnChange();
-
-		gagaAgGrid.createGrid('inComGridList', inComGridOptions);
-		gagaAgGrid.createGrid('brandGridList' , brandGridOptions);
-		gagaAgGrid.createGrid('cateGridList' , cateGridOptions);
-		gagaAgGrid.createGrid('supplyGridList' , supplyGridOptions);
-		gagaAgGrid.createGrid('goodsGridList' , goodsGridOptions);
-		gagaAgGrid.createGrid('excepGoodsGridList' , excepGoodsGridOptions);
-
-	});
-
-	/*]]>*/
-</script>
-</html>

+ 21 - 17
src/main/webapp/WEB-INF/views/marketing/CouponListForm.html

@@ -154,7 +154,9 @@
 				valueParser: function (params) { return gagaAgGrid.lookupKey(siteCdList, params.newValue); }
 			},
 			{headerName: "쿠폰ID", field: "cpnId", width: 130, cellClass: 'text-center'},
-			{headerName: "쿠폰명", field: "cpnNm", width: 140, cellClass: 'text-center'},
+			{headerName: "쿠폰명", field: "cpnNm", width: 140, cellClass: 'text-center' , cellRenderer: function (params) {
+				return "<a href=\"javascript:void(0);\" onclick=\"cfnCouponCreatePopup('" + params.data.cpnId + "');\">" + params.value + "</a>";
+			}},
 			{headerName: "사용가능고객구분", field: "usableCustGb", width: 140, cellClass: 'text-center' ,
 				cellEditor: 'agRichSelectCellEditor',
 				cellEditorParams: { values: gagaAgGrid.extractValues(usableCustGbList) },
@@ -173,12 +175,24 @@
 				valueFormatter: function (params) { return gagaAgGrid.lookupValue(dcWayList, params.value); },
 				valueParser: function (params) { return gagaAgGrid.lookupKey(dcWayList, params.newValue); }
 			},
-			{headerName: "할인값(PC)", field: "dcPval", width: 140, cellClass: 'text-center'},
-			{headerName: "할인값(MOBILE)", field: "dcMval", width: 140, cellClass: 'text-center'},
-			{headerName: "최고할인값", field: "maxDcAmt", width: 140, cellClass: 'text-center'},
+			{headerName: "할인값(PC)", field: "dcPval", width: 140, cellClass: 'text-center' ,
+				valueFormatter	: function(params) {
+					return params.value.addComma();
+				}
+			},
+			{headerName: "할인값(MOBILE)", field: "dcMval", width: 140, cellClass: 'text-center' ,
+				valueFormatter	: function(params) {
+					return params.value.addComma();
+				}
+			},
+			{headerName: "최고할인값", field: "maxDcAmt", width: 140, cellClass: 'text-center' ,
+				valueFormatter	: function(params) {
+					return params.value.addComma();
+				}
+			},
 			{headerName: "사용 수/발급 수 ", field: "useIssueCnt", width: 140, cellClass: 'text-center',
 				cellRenderer: function(params) {
-					return params.data.issueCnt + "/" + params.data.useCnt;
+					return params.data.issueCnt.addComma() + "/" + params.data.useCnt.addComma();
 				}
 			},
 			{headerName: "기간/일수구분", field: "pdGb", width: 140, cellClass: 'text-center' ,
@@ -197,6 +211,7 @@
 					return !gagajf.isNull(params.value) ? params.value.toDate("YYYY-MM-DD HH:mm:ss").format("YYYY-MM-DD HH:mm:ss") : '';
 				}
 			},
+			{headerName: "유효일수", field: "availDays", width: 140, cellClass: 'text-center'},
 			{headerName: "등록자", field: "regNm", width: 150, cellClass: 'text-center'},
 			{headerName: "등록일시", field: "regDt", width: 140, cellClass: 'text-center' ,
 				cellRenderer: function(params) {
@@ -210,20 +225,9 @@
 
 		// 쿠폰등록 팝업창
 		function fnCouponCreateForm(){
-			cfnCouponCreatePopup();
+			cfnCouponCreatePopup('');
 		}
 
-		// Row Click
-		/*
-        gridOptions.onCellClicked = function(event) {
-            var goodsCd = event.data.goodsCd;
-            if (event.colDef.field == "freeGiftName"){
-                // 수ㅜ정 필요
-                // cfnOpenGoodsDetailPopup('U',goodsCd);
-            }
-        }
-        */
-
 		// 초기화 클릭시
 		$('#btnInit').on('click', function() {
 			$('#searchForm')[0].reset();

+ 1432 - 0
src/main/webapp/WEB-INF/views/marketing/CouponPopupForm.html

@@ -0,0 +1,1432 @@
+<!DOCTYPE html>
+<html lang="ko"
+	  xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : CouponPopupForm.html
+ * @desc    : 쿠폰 등록 팝업 화면
+ *============================================================================
+ * ISTYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2020.12.23   xyzp1539       최초 작성
+ *******************************************************************************
+ -->
+<div class="modalPopup" data-width="1200">
+	<div class="panelStyle" >
+		<div class="panelTitle">
+			<h2 th:text="${'쿠폰 ' + (mode == 'N' ? '등록' : '수정')}">쿠폰등록</h2>
+			<button type="button" class="close" onclick="uifnPopupClose('CouponRegForm')"><i class="fa fa-times"></i></button>
+		</div>
+		<div class="panelContent">
+			<form id="CouponForm" name="CouponForm" action="#" th:action="@{'/marketing/coupon/save'}" >
+				<input type="hidden" name="supplyCompList" id="supplyCompList">
+				<input type="hidden" name="brandList" id="brandList">
+				<input type="hidden" name="applyGoodsList" id="applyGoodsList">
+				<input type="hidden" name="exceptGoodsList" id="excepGoodsList">
+				<input type="hidden" name="burdenList" id="burdenList">
+				<input type="hidden" name="cateList" id="cateList">
+				<input type="hidden" name="cpnId2" id="cpnId2" th:if="${cpnDetail}" th:value="${cpnDetail.cpnId}">
+
+				<div class="tabs">
+					<div class="tabsNav">
+						<ul>
+							<li class="on"><a href="#coupontab1">기본정보</a></li>
+							<li><a href="#coupontab2">적용대상</a></li>
+							<li><a href="#coupontab3">입점업체분담율</a></li>
+						</ul>
+					</div>
+					<ul class="tabsCont">
+						<li class="tab on" id="coupontab1">
+							<div class="panelStyle">
+								<table class="frmStyle">
+									<colgroup>
+										<col style="width:10%">
+										<col style="width:40%;">
+										<col style="width:10%">
+										<col style="width:40%;">
+									</colgroup>
+									<tbody>
+										<tr>
+											<th>쿠폰번호<em class="required" title="필수"></em></th>
+											<td colspan="5">
+												<input type="hidden" name="copyCpnId" maxlength="50" value="">
+												<input type="text" name="cpnId" id="cpnId" maxlength="50"  style="width:70%;" disabled="true" readonly="readonly" placeholder="자동생성" data-valid-name="쿠폰번호">
+												<label class="chkBox checked" onclick="clickCreateChk(this);">
+													<input type="checkbox" name="cpnCreateType" value="true" class="type-check" checked />쿠폰번호 자동생성
+												</label>
+											</td>
+										</tr>
+										<tr>
+											<th>쿠폰명<em class="required" title="필수"></em></th>
+											<td colspan="5">
+												<input type="text" name="cpnNm" id="cpnNm" style="width: 70%;" required="required" data-valid-name="쿠폰명">
+											</td>
+										</tr>
+										<tr>
+											<th>쿠폰유형<em class="required" title="필수"></em></th>
+											<td colspan="5">
+												<input type="hidden" id="cpnType" name="cpnType" required="required"  data-valid-name="쿠폰유형">
+												<label class="rdoBtn" th:if="${cpnTypeList}" th:each="oneData, status : ${cpnTypeList}"> <input type="radio" name="rdoCpnType"  th:text="${oneData.cdNm}" th:value="${oneData.cd}"/></label>
+											</td>
+										</tr>
+										<tr>
+											<th>사용가능고객구분<em class="required" title="필수"></em></th>
+											<td>
+												<select name="usableCustGb" id="usableCustGb" required="required" data-valid-name="사용가능고객구분">
+													<option th:if="${usableCustGbList}" th:each="oneData , status : ${usableCustGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+												</select>
+											</td>
+											<th>사이트<em class="required" title="필수"></em></th>
+											<td>
+												<select name="siteCd" id="siteCd" required="required" data-valid-name="사이트">
+													<option th:if="${siteCdList}" th:each="oneData , status : ${siteCdList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+												</select>
+											</td>
+										</tr>
+										<tr>
+											<th>사용고객등급구분<em class="required" title="필수"></em></th>
+											<td>
+												<select name="usableCustGrade" id="usableCustGrade" required="required" data-valid-name="사용고객등급구분">
+													<option value="ALL">[전체]</option>
+													<option th:if="${usableCustGradeList}" th:each="oneData , status : ${usableCustGradeList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+												</select>
+											</td>
+											<th>만료알림여부<em class="required" title="필수"></em></th>
+											<td>
+												<select name="endAlimYn" id="endAlimYn" required="required" data-valid-name="만료알림여부">
+													<option value="Y">Y</option>
+													<option value="N" selected="selected">N</option>
+												</select>
+											</td>
+										</tr>
+										<tr>
+											<th>할인방식<em class="required" title="필수"></em></th>
+											<td>
+												<input type="hidden" name="dcWay" id="dcWay" required="required" data-valid-name="할인방식">
+												<label class="rdoBtn" th:if="${dcWayList}" th:each="oneData, status : ${dcWayList}"> <input type="radio" name="rdoDcWay"  th:text="${oneData.cdNm}" th:value="${oneData.cd}"/></label>
+											</td>
+											<th>구매제한금액<em class="required" title="필수"></em></th>
+											<td>
+												<input type="text" id="buyLimitAmt" name="buyLimitAmt" class="w200" required="required" value="0" style="text-align: right;" data-valid-name="구매제한금액" data-valid-type="numeric">원
+											</td>
+										</tr>
+										<tr>
+											<th>할인값(PC)<em class="required" title="필수"></em></th>
+											<td>
+												<input type="text" class="w200" id="dcPval" name="dcPval" value="0" required="required" data-valid-name="할인값(PC)" data-valid-type="numeric" style="text-align: right"><span id="dcPvalSpan">원</span>
+											</td>
+											<th>할인값(모바일웹)<em class="required" title="필수"></em></th>
+											<td>
+												<input type="text" class="w200" id="dcMval" name="dcMval" value="0" required="required" data-valid-name="할인값(모바일웹)" data-valid-type="numeric" style="text-align: right"><span id="dcMvalSpan">원</span>
+											</td>
+										</tr>
+										<tr>
+											<th>할인값(모바일앱)<em class="required" title="필수"></em></th>
+											<td>
+												<input type="text" class="w200" id="dcAval" name="dcAval" value="0" required="required" data-valid-name="할인값(모바일앱)" data-valid-type="numeric" style="text-align: right"><span id="dcAvalSpan">원</span>
+											</td>
+											<th>최대할인금액<em class="required" title="필수"></em></th>
+											<td>
+												<input type="text" class="w200" id="maxDcAmt" name="maxDcAmt" value="0" required="required" data-valid-name="최대할인금액" data-valid-type="numeric" style="text-align: right;"><span id="maxDcAmtSpan">원</span>
+											</td>
+										</tr>
+										<tr>
+											<th>다운로드시작일시<em class="required" title="필수"></em></th>
+											<td>
+												<input type="hidden" name="downStdt" id="downStdt" required="required" data-valid-name="다운로드시작일시">
+												<input type="text" class="schDate w100" name="downStDay" id="downStDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
+												<select name="downStHH" id="downStHH">
+													<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+												<select name="downStMM" id="downStMM">
+													<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+											<th>다운로드종료일시<em class="required" title="필수"></em></th>
+											<td>
+												<input type="hidden" id="downEddt" name="downEddt" required="required" data-valid-name="다운로드종료일시">
+												<input type="text" class="schDate w100" name="downEdDay" id="downEdDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
+												<select name="downEdHH" id="downEdHH">
+													<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+												<select name="downEdMM" id="downEdMM">
+													<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+											</td>
+										</tr>
+										<tr>
+											<th>기간/일수구분<em class="required" title="필수"></em></th>
+											<td>
+												<select name="pdGb" id="pdGb" onchange="pdGbChange(this)" required="required" data-valid-name="기간/일수구분">
+													<option value="P">기간</option>
+													<option value="D">일수</option>
+												</select>
+											</td>
+											<th>적용범위<em class="required" title="필수"></em></th>
+											<td>
+												<input type="hidden" name="applyScope" id="applyScope" required="required" data-valid-name="적용범위">
+												<label class="rdoBtn"> <input type="radio" name="rdoApplyScope" value="A"/>전체</label>
+												<label class="rdoBtn"> <input type="radio" name="rdoApplyScope" value="I"/>개별</label>
+											</td>
+										</tr>
+										<tr class="availDayTr" style="display: none;">
+											<th>유효기간일수<em class="required" title="필수"></em></th>
+											<td>
+												<input type="text" name="availDays" id="availDays" class="w200" data-valid-name="유효기간일수">
+											</td>
+										</tr>
+										<tr>
+											<th class="availDateTr">유효기간시작일시<em class="required" title="필수"></em></th>
+											<td class="availDateTr">
+												<input type="hidden" name="availStdt" id="availStdt" data-valid-name="유효기간시작일시">
+												<input type="text" class="schDate w100" name="availStDay" id="availStDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
+												<select name="availStHH" id="availStHH">
+													<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+												<select name="availStMM" id="availStMM">
+													<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+											<th class="availDateTr">유효기간종료일시<em class="required" title="필수"></em></th>
+											<td class="availDateTr">
+												<input type="hidden" id="availEddt" name="availEddt" data-valid-name="유효기간종료일시">
+												<input type="text" class="schDate w100" name="availEdDay" id="availEdDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
+												<select name="availEdHH" id="availEdHH">
+													<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+												<select name="availEdMM" id="availEdMM">
+													<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+											</td>
+										</tr>
+										<tr>
+											<th>첫구매여부<em class="required" title="필수"></em></th>
+											<td>
+												<select name="firstYn" id="firstYn" onchange="firstYnChange(this)" required="required" data-valid-name="첫구매여부">
+													<option value="Y">Y</option>
+													<option value="N" selected="selected">N</option>
+												</select>
+											</td>
+											<th>다운로드가능여부<em class="required" title="필수"></em></th>
+											<td>
+												<select name="downYn" id="downYn" required="required" data-valid-name="다운로드가능여부">
+													<option value="Y">Y</option>
+													<option value="Y" selected="selected">N</option>
+												</select>
+											</td>
+										</tr>
+										<tr>
+											<th class="buyDateTr">첫구매기간시작일시<em class="required" title="필수"></em></th>
+											<td class="buyDateTr">
+												<input type="hidden" id="buyEddt" name="buyEddt" data-valid-name="첫구매기간종료일시">
+												<input type="text" class="schDate w100" name="buyStDay" id="buyStDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
+												<select name="buyStHH" id="buyStHH">
+													<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+												<select name="buyStMM" id="buyStMM">
+													<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+											<th class="buyDateTr">첫구매기간종료일시<em class="required" title="필수"></em></th>
+											<td class="buyDateTr">
+												<input type="hidden" name="buyStdt" id="buyStdt" data-valid-name="첫구매기간시작일시">
+												<input type="text" class="schDate w100" name="buyEdDay" id="buyEdDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
+												<select name="buyEdHH" id="buyEdHH">
+													<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+												<select name="buyEdMM" id="buyEdMM">
+													<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+											</td>
+										</tr>
+										<tr>
+											<th>신규회원여부<em class="required" title="필수"></em></th>
+											<td>
+												<select name="custJoinYn" id="custJoinYn" onchange="custJoinYnChange(this)" required="required" data-valid-name="신규회원여부">
+													<option value="Y">Y</option>
+													<option value="N" selected="selected">N</option>
+												</select>
+											</td>
+											<th>총발행제한수량<em class="required" title="필수"></em></th>
+											<td>
+												<input type="text" class="w200" name="totPubLimitQty" id="totPubLimitQty" value="0" required="required" data-valid-name="총발행제한수량" data-valid-type="numeric" style="text-align: right;">개<span class="cRed" id="totPubLimitQtySpan"> *제한없음</span>
+											</td>
+										</tr>
+										<tr>
+											<th class="custJoinDateTr">신규회원기간시작일시<em class="required" title="필수"></em></th>
+											<td class="custJoinDateTr">
+												<input type="hidden" name="custJoinStdt" id="custJoinStdt" data-valid-name="신규회원기간시작일시">
+												<input type="text" class="schDate w100" name="custJoinStDay" id="custJoinStDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
+												<select name="custJoinStHH" id="custJoinStHH">
+													<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+												<select name="custJoinStMM" id="custJoinStMM">
+													<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+											<th class="custJoinDateTr">신규회원기간종료일시<em class="required" title="필수"></em></th>
+											<td class="custJoinDateTr">
+												<input type="hidden" id="custJoinEddt" name="custJoinEddt" data-valid-name="신규회원기간종료일시">
+												<input type="text" class="schDate w100" name="custJoinEdDay" id="custJoinEdDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
+												<select name="custJoinEdHH" id="custJoinEdHH">
+													<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+												<select name="custJoinEdMM" id="custJoinEdMM">
+													<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+												</select>
+											</td>
+										</tr>
+										<tr>
+											<th>1인당발행제한수량<em class="required" title="필수"></em></th>
+											<td>
+												<input type="text" class="w200" name="custPubLimitQty" id="custPubLimitQty" value="0" required="required" data-valid-name="1인당발행제한수량" data-valid-type="numeric" style="text-align: right;">개<span class="cRed" id="custPubLimitQtySpan"> *제한없음</span>
+											</td>
+											<th>1회발행수량<em class="required" title="필수"></em></th>
+											<td><input type="text" class="w200" name="onePubQty" id="onePubQty" value="1" required="required" data-valid-name="1회발행수량" data-valid-type="numeric" style="text-align: right;">개</td>
+										</tr>
+										<tr>
+											<th>재발급여부<em class="required" title="필수"></em></th>
+											<td>
+												<select name="reissuance" id="reissuance" required="required" data-valid-name="재발급여부" >
+													<option th:if="${reissuanceList}" th:each="oneData , status : ${reissuanceList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+												</select>
+											</td>
+											<th>다운로드구분<em class="required" title="필수"></em></th>
+											<td>
+												<select name="dnGb" id="dnGb" required="required" data-valid-name="다운로드구분">
+													<option th:if="${dnGbList}" th:each="oneData , status:${dnGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+												</select>
+											</td>
+										</tr>
+										<tr class="payTypeTr" style="display: none;">
+											<th>결제수단<em class="required" title="필수"></em></th>
+											<td colspan="5">
+												<select name="payType" id="payType" data-valid-name="결제수단">
+													<option value="">[전체]</option>
+													<option th:if="${payTypeList}" th:each="oneData , status : ${payTypeList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+												</select>
+											</td>
+										</tr>
+										<tr>
+											<th>쿠폰상태<em class="required" title="필수"></em></th>
+											<td>
+												<select name="cpnStat" id="cpnStat" data-valid-name="쿠폰상태" required="required">
+													<option th:if="${cpnStatList}" th:each="oneData , status : ${cpnStatList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+												</select>
+											</td>
+											<th>제휴링크코드<em class="required" title="필수"></em></th>
+											<td>
+												<select name="afChannel" id="afChannel" onchange="fnChangeAfLinkCdList()" data-valid-name="제휴링크코드" required="required">
+													<option th:if="${upperAfLinkCdList}" th:each="oneData , status : ${upperAfLinkCdList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+												</select>
+												<select name="afLinkCd" id="afLinkCd">
+												</select>
+											</td>
+										</tr>
+									</tbody>
+								</table>
+								<div class="mdPopBtnB aR">
+									<button type="button" class="btn btn-info btn-lg" onclick="fnCustomerIssuePopUp();" th:if="${mode == 'U'}">쿠폰발행</button>
+									<button type="button" class="btn btn-info btn-lg" onclick="fnCouponCreate();" th:if="${mode == 'N'}">등록</button>
+									<button type="button" class="btn btn-info btn-lg" onclick="fnCouponUpdate();" th:if="${mode == 'U'}">수정</button>
+								</div>
+							</div>
+						</li>
+						<!-- 쿠폰적용대상-->
+						<li class="tab" id="coupontab2" >
+							<div class="panelStyle">
+								<div class="inner-panelContent">
+									<div class="panelContent">
+										<div class="panelBar">
+											<h4>적용 대상 상품 등록</h4>
+										</div>
+										<table class="frmStyle">
+											<colgroup>
+												<col style="width:15%;">
+												<col style="width:85%;">
+											</colgroup>
+											<tbody>
+												<tr>
+													<th>공급처</th>
+													<td>
+														<div class="padding10 inner-tb-solid">
+															<button type="button" class="btn btnRight btn-success btn-lg" id="btnSupplyAdd">공급처 추가</button>
+															<button type="button" class="btn btnRight btn-success btn-lg" id="btnSupplyDel">선택삭제</button>
+															<br/>
+															<div id="supplyGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
+														</div>
+													</td>
+												</tr>
+												<tr>
+													<th>브랜드</th>
+													<td>
+														<div class="padding10 inner-tb-solid">
+															<button type="button" class="btn btnRight btn-success btn-lg" id="btnBrandAdd">브랜드 추가</button>
+															<button type="button" class="btn btnRight btn-success btn-lg" id="btnBrandDel">선택삭제</button>
+															<br/>
+															<div id="brandGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
+														</div>
+													</td>
+												</tr>
+												<tr>
+													<th>카테고리</th>
+													<td>
+														<div class="padding10 inner-tb-solid">
+															<button type="button" class="btn btnRight btn-success btn-lg" id="btnCateAdd">카테고리 추가</button>
+															<button type="button" class="btn btnRight btn-success btn-lg" id="btnCateDel">선택삭제</button>
+															<br/>
+															<div id="cateGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
+														</div>
+													</td>
+												</tr>
+												<tr>
+													<th>적용상품</th>
+													<td>
+														<div class="padding10 inner-tb-solid">
+															<button type="button" class="btn btnRight btn-success btn-lg" id="btnGoodsAdd">상품 추가</button>
+															<button type="button" class="btn btnRight btn-success btn-lg" id="btnGoodsDel">선택삭제</button>
+															<br/>
+															<div id="goodsGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
+														</div>
+													</td>
+												</tr>
+											</tbody>
+										</table>
+									</div>
+								</div>
+								<div class="inner-panelContent">
+									<div class="panelContent">
+										<div class="panelBar">
+											<h4>적용 대상 상품 등록</h4>
+										</div>
+										<table class="frmStyle">
+											<colgroup>
+												<col style="width:15%;">
+												<col style="width:85%;">
+											</colgroup>
+											<tbody>
+											<tr>
+												<th>제외상품</th>
+												<td>
+													<div class="padding10 inner-tb-solid">
+														<button type="button" class="btn btnRight btn-success btn-lg" id="btnExcepGoodsAdd">제외상품 추가</button>
+														<button type="button" class="btn btnRight btn-success btn-lg" id="btnExcepGoodsDel">선택삭제</button>
+														<br/>
+														<div id="excepGoodsGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
+													</div>
+												</td>
+											</tr>
+											</tbody>
+										</table>
+									</div>
+								</div>
+							</div>
+						</li>
+						<!-- 쿠폰적용대상끝-->
+						<!-- 입점업체분담율-->
+						<li class="tab" id="coupontab3">
+							<div class="panelStyle">
+								<ul class="panelBar">
+									<li class="left">
+										<button type="button" class="btn btn-warning btn-lg" id="btnAddRow">행추가</button>
+										<button type="button" class="btn btn-danger btn-lg" id="btnDelRow">행삭제</button>
+									</li>
+								</ul>
+
+								<div id="inComGridList" style="width: 100%; height: 570px" class="ag-theme-balham"></div>
+
+							</div>
+						</li>
+						<!-- 입점업체분담끝-->
+					</ul>
+				</div>
+			</form>
+		</div>
+	</div>
+</div>
+<script th:inline="javascript">
+	/*<![CDATA[*/
+	// 상세조회 리스트
+	var mode = [[${mode}]];
+	var cpnDetail = [[${cpnDetail}]];
+	var cpnDtlRefvalSupplyCompList = [[${cpnDtlRefvalSupplyCompList}]];
+	var cpnDtlRefvalApplyGoodsList = [[${cpnDtlRefvalApplyGoodsList}]];
+	var cpnDtlRefvalCateList = [[${cpnDtlRefvalCateList}]];
+	var cpnDtlRefvalBrandList = [[${cpnDtlRefvalBrandList}]];
+	var cpnDtlRefvalExceptGoodsList = [[${cpnDtlRefvalExceptGoodsList}]];
+	var cpnDtlBurdenList = [[${cpnDtlBurdenList}]];
+	var issueCnt = [[${issueCnt}]];
+
+	// 공통코드 리스트
+	var ibSupplyComList = gagajf.convertToArray([[${ibSupplyCompList}]]);
+	var formalGbList = gagajf.convertToArray([[${formalGbList}]]);
+	var cateGbList = gagajf.convertToArray([[${cateGbList}]]);
+	var delYnList = { "Y":"Yes", "N":"No" };
+	var siteCdList = gagajf.convertToArray([[${siteCdList}]]);
+	var selfBrandList = gagajf.convertToArray([[${selfBrandList}]]);
+
+	// ag-grid 입점업체분담율 컬럼
+	var columnDefs = [
+		{ headerName: "입점업체" , field:"supplyCompCd" , width:150, cellClass:"text-center" ,
+			cellEditor: 'agRichSelectCellEditor',
+			cellEditorParams: { values: gagaAgGrid.extractValues(ibSupplyComList) },
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(ibSupplyComList, params.value); },
+			valueParser: function (params) { return gagaAgGrid.lookupKey(ibSupplyComList, params.newValue);}
+		} ,
+		{ headerName: "쿠폰분담율(%)", field:"burdenRate" , width:150, cellClass: "text-center" ,
+		  cellEditorParams: { maxlength: 10, required: true }
+		} ,
+		{ headerName: "삭제여부" , field: "delYn"  , width:150, cellClass: "text-center" ,
+			cellEditor: 'agRichSelectCellEditor',
+			cellEditorParams: { values: gagaAgGrid.extractValues(delYnList) },
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(delYnList, params.value); },
+			valueParser: function (params) { return gagaAgGrid.lookupKey(delYnList, params.newValue); }
+		} ,
+		{ headerName: "쿠폰번호"  , field: "cpnId" , width: 120 , cellClass: 'text-center' , hide:true}
+	];
+
+	// ag-grid 공급처 컬럼
+	var supplyColumnDefs = [
+		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
+		{ headerName : "공급업체코드" , field: "supplyCompCd" , width:150, cellClass: 'text-center'} ,
+		{ headerName: "공급업체명" , field: "supplyCompNm" , width:150, cellClass: 'text-center'},
+		{ headerName: "쿠폰대상일련번호"  , field: "cpnRefvalSq" , width: 120 , cellClass: 'text-center' , hide:true}
+	];
+
+	// ag-grid 브랜드 컬럼
+	var brandSelColumnDefs = [
+		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
+		{ headerName : "브랜드ID" , field: "brandCd" , width: 120, cellClass : 'text-center'} ,
+		{ headerName : "브랜드명" , field: "brandEnm" , width: 120, cellClass: 'text-center'} ,
+		{ headerName : "공급업체명", field: "supplyCompNm" , width: 150, cellClass: 'text-center' } ,
+		{ headerName: "쿠폰대상일련번호"  , field: "cpnRefvalSq" , width: 120 , cellClass: 'text-center' , hide:true}
+	];
+
+	// ag-grid 적용상품 컬럼
+	var goodsSelColumnDefs = [
+		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
+		{ headerName: "상품구분" , field: "goodsGb" , width: 100, cellClass: 'text-center'} ,
+		{ headerName: "Product ID" , field: "goodsCd" , width: 120, cellClass: 'text-center'},
+		{ headerName: "상품명"  , field: "goodsNm" , width: 250 , cellClass: 'text-center'} ,
+		{ headerName: "쿠폰대상일련번호"  , field: "cpnRefvalSq" , width: 120 , cellClass: 'text-center' , hide:true}
+	];
+
+	// ag-grid 카테고리 컬럼
+	var cateSelColumnDefs = [
+		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
+		{ headerName: "사이트" , field: "siteCd" , width: 100 , cellClass: 'text-center' ,
+			cellEditor: 'agRichSelectCellEditor',
+			cellEditorParams: { values: gagaAgGrid.extractValues(siteCdList) },
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(siteCdList, params.value); },
+			valueParser: function (params) { return gagaAgGrid.lookupKey(siteCdList, params.newValue); }
+		},
+		{ headerName: "카테고리구분" , field: "cateGb" , width: 100 , cellClass: 'text-center' ,
+			cellEditor: 'agRichSelectCellEditor',
+			cellEditorParams: { values: gagaAgGrid.extractValues(cateGbList) },
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(cateGbList, params.value); },
+			valueParser: function (params) { return gagaAgGrid.lookupKey(cateGbList, params.newValue); }
+		},
+		{ headerName: "카테고리코드" , field: "cateNo" , width: 100 , cellClass: 'text-center'} ,
+		{ headerName: "카테고리명" , field: "cateNm" , width: 120 , cellClass: 'text-center'},
+		{ headerName: "이월/정상구분" , field: "formalGb" , width: 120 , cellClass: 'text-center',
+			cellEditor: 'agRichSelectCellEditor',
+			cellEditorParams: { values: gagaAgGrid.extractValues(formalGbList) },
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(formalGbList, params.value); },
+			valueParser: function (params) { return gagaAgGrid.lookupKey(formalGbList, params.newValue); }
+		},
+		{ headerName: "브랜드명" , field:"brandCd" , width:150, cellClass: "text-center", required: true ,
+			editable: true, cellEditor: 'agRichSelectCellEditor',
+			cellEditorParams: { values: gagaAgGrid.extractValues(selfBrandList) },
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(selfBrandList, params.value); },
+			valueParser: function (params) { return gagaAgGrid.lookupKey(selfBrandList, params.newValue); }
+		},
+		{ headerName: "쿠폰대상일련번호"  , field: "cpnRefvalSq" , width: 120 , cellClass: 'text-center' , hide:true}
+	];
+
+	// ag-grid 제외상품 컬럼
+	var excepGoodsColumnDefs = [
+		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
+		{ headerName: "상품구분" , field: "goodsGb" , width: 100, cellClass: 'text-center'} ,
+		{ headerName: "Product ID" , field: "goodsCd" , width: 120, cellClass: 'text-center'},
+		{ headerName: "상품명"  , field: "goodsNm" , width: 250 , cellClass: 'text-center'} ,
+		{ headerName: "쿠폰대상일련번호"  , field: "cpnRefvalSq" , width: 120 , cellClass: 'text-center' , hide:true}
+	];
+
+	var inComGridOptions = gagaAgGrid.getGridOptions(columnDefs);
+	var cateGridOptions = gagaAgGrid.getGridOptions(cateSelColumnDefs);
+	var goodsGridOptions = gagaAgGrid.getGridOptions(goodsSelColumnDefs);
+	var brandGridOptions = gagaAgGrid.getGridOptions(brandSelColumnDefs);
+	var supplyGridOptions = gagaAgGrid.getGridOptions(supplyColumnDefs);
+	var excepGoodsGridOptions = gagaAgGrid.getGridOptions(excepGoodsColumnDefs);
+
+	inComGridOptions.defaultColDef.editable = true;
+	inComGridOptions.rowSelection = "multiple";
+	goodsGridOptions.rowSelection = "multiple";
+	supplyGridOptions.rowSelection = "multiple";
+	excepGoodsGridOptions.rowSelection = "multiple";
+	cateGridOptions.rowSelection = "multiple";
+	brandGridOptions.rowSelection = "multiple";
+	inComGridOptions.stopEditingWhenGridLosesFocus = true;
+
+	// 쿠폰 등록 버튼 클릭시
+	function fnCouponCreate(){
+		mcxDialog.confirm('저장하시겠습니까?' , {
+			cancelBtnText:"취소",
+			sureBtnText:"확인",
+			sureBtnClick: function () {
+				gagajf.removeCommaAtNumberFormattedInput('#CouponForm');
+				// 필수값들 셋팅
+				setReqValue();
+				// 필수값 validation 체크
+				if (!gagajf.validation('#CouponForm')) {
+					return false;
+				}
+				checkValidation();
+
+				gagajf.ajaxFormSubmit($('#CouponForm').prop('action'), '#CouponForm', function() {
+					uifnPopupClose('CouponRegForm');
+					$('#btnSearch').trigger('click');
+				});
+			}
+		});
+	}
+
+	// 쿠폰 수정 시
+	function fnCouponUpdate(){
+		mcxDialog.confirm('수정하시겠습니까?' , {
+			cancelBtnText:"취소",
+			sureBtnText:"확인",
+			sureBtnClick: function () {
+				gagajf.removeCommaAtNumberFormattedInput('#CouponForm');
+				// 필수값들 셋팅
+				setReqValue();
+				// 필수값 validation 체크
+				if (!gagajf.validation('#CouponForm')) {
+					return false;
+				}
+				checkValidation();
+
+				$("#CouponForm input[name=cpnId]").prop("disabled", false);
+				$("#CouponForm input[name=cpnId]").attr("required", true);
+				$("#CouponForm input[name=cpnId]").attr("placeholder", "");
+				$("#CouponForm input[name=cpnId]").attr("readonly", false);
+
+				gagajf.ajaxFormSubmit($('#CouponForm').prop('action'), '#CouponForm', function() {
+					uifnPopupClose('CouponRegForm');
+					$('#btnSearch').trigger('click');
+				});
+			}
+		});
+	}
+
+	function checkValidation(){
+		//신규가입 지급한다면 validation 체크
+		if( $('#custJoinYn option:selected').val() == "Y" ){
+			var fromDate = $('#CouponForm input[name=custJoinStdt]').val();
+			var toDate = $('#CouponForm input[name=custJoinEddt]').val();
+
+			if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
+				mcxDialog.alertC("신규가입기간 시작일자와 종료일자를 입력하세요.", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#CouponForm input[name=custJoinStdt]').focus();
+					}
+				});
+				return false;
+			}
+
+			if (fromDate > toDate) {
+				mcxDialog.alertC("등록 시작일자는 종료일자 보다 클 수 없습니다.", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#CouponForm input[name=custJoinEddt]').focus();
+					}
+				});
+				return false;
+			}
+		}
+
+		// 첫구매 지급하면 validation 체크
+		if( $('#firstYn option:selected').val() == "Y" ){
+			var fromDate = $('#CouponForm input[name=buyStdt]').val();
+			var toDate = $('#CouponForm input[name=buyEddt]').val();
+
+			if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
+				mcxDialog.alertC("신규가입기간 시작일자와 종료일자를 입력하세요.", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#CouponForm input[name=buyStdt]').focus();
+					}
+				});
+				return false;
+			}
+
+			if (fromDate > toDate) {
+				mcxDialog.alertC("등록 시작일자는 종료일자 보다 클 수 없습니다.", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#CouponForm input[name=buyEddt]').focus();
+					}
+				});
+				return false;
+			}
+		}
+
+		// 할인율 validation 체크 (100을 넘길수없음)
+		if($('#dcWay').val() == 'G240_11') {
+			if($('#dcPval').val() > 100) {
+				mcxDialog.alert('PC할인율은 100을 초과할수없습니다.');
+				$('#dcPval').focus();
+				return false;
+			} else if( $('#dcMval').val() > 100) {
+				mcxDialog.alert('모바일(웹)할인율은 100을 초과할수없습니다.');
+				$('#dcMval').focus();
+				return false;
+			}  else if( $('#dcAval').val() > 100) {
+				mcxDialog.alert('모바일(앱)할인율은 100을 초과할수없습니다.');
+				$('#dcAval').focus();
+				return false;
+			}
+		}
+	}
+
+	// 할인방식 변경
+	$("#CouponForm input[name=rdoDcWay]").bind('click change', function () {
+		var radioValue = $(this).val();
+		//발급이력이있으면 수정안됨
+		if(issueCnt > 0 ) {
+			return false;
+		}
+
+		if(radioValue == 'G240_10') {
+			$('#dcPvalSpan').text("원");
+			$('#dcMvalSpan').text("원");
+			$('#dcAvalSpan').text("원");
+		} else {
+			$('#dcPvalSpan').text("%");
+			$('#dcMvalSpan').text("%");
+			$('#dcAvalSpan').text("%");
+		}
+	});
+
+	// 쿠폰 상태 변경
+	$("#CouponForm input[name=rdoCpnType]").bind('click change', function () {
+		var radioValue = $(this).val();
+
+		if(mode == "U") {
+			radioValue = cpnDetail.cpnType;
+		}
+		// 상품쿠폰 선택시 적용범위 개별로 변경 나머진 전체
+		if(radioValue == 'G230_11') {
+			$("input:radio[name='rdoApplyScope']:radio[value='I']").prop('checked', true);
+		} else {
+			$("input:radio[name='rdoApplyScope']:radio[value='A']").prop('checked', true);
+		}
+
+		// 주문서 쿠폰 선택시 결제수단 노출
+		if(radioValue == 'G230_20') {
+			$('.payTypeTr').css('display' , '');
+			$('#CouponForm #payType').attr('required' , true);
+		} else {
+			$('.payTypeTr').css('display' , 'none');
+			$('#CouponForm #payType').attr('required' , false );
+		}
+
+		$('#CouponForm #cpnType').val(radioValue);
+	});
+
+	// 적용대상 - 브랜드 추가 버튼시
+	$('#btnBrandAdd').on('click' , function(){
+		cfnOpenBrandListPopup("fnSetPopupBrandInfo", "M");
+	});
+
+	// 브랜드 설정 / 브랜드 추가 콜백함수 (단수로 가져오므로 복수일 경우에 수정 확인 필요)
+	var fnSetPopupBrandInfo = function(result) {
+		for(let i = 0 ; i < result.length ; i++) {
+			let addChk = true, gridListValue = gagaAgGrid.getAllRowData(brandGridOptions);		// 받아온 모든 데이터
+
+			// 받아온 data for
+			for(let j = 0 ; j < gridListValue.length ; j++) {
+				if(gridListValue[j].brandCd == result[i].brandCd) {	addChk = false;	}					// 중복체크
+			}
+
+			// 중복되지 않은 데이터 리스트에 추가
+			if(addChk) {
+				gagaAgGrid.addRowData(brandGridOptions, {"brandCd" : result[i].brandCd, "brandEnm" : result[i].brandEnm, "supplyCompNm" : result[i].supplyCompNm});
+			}
+		}
+	};
+
+	// 적용대상 - 브랜드 삭제 버튼시
+	$('#btnBrandDel').on('click' , function(){
+		var selectVal = brandGridOptions.api.getSelectedRows();
+
+		if(selectVal.length == 0) {
+			mcxDialog.alert("선택된 행이 없습니다");
+			return;
+		}
+
+		if(cpnDetail != null ) {
+			mcxDialog.confirm('삭제하시겠습니까?', {
+				cancelBtnText: "취소",
+				sureBtnText: "확인",
+				sureBtnClick: function(){
+					gagaAgGrid.removeRowData(brandGridOptions , false);
+					var cpnRefvalSqArr = [];
+
+					$.each(selectVal , function(idx , item){
+						cpnRefvalSqArr.push(item.cpnRefvalSq);
+					});
+					var data = { cpnRefvalSqArr : cpnRefvalSqArr
+						,cpnId : cpnDetail.cpnId
+					};
+
+					var jsonData = JSON.stringify(data);
+					gagajf.ajaxJsonSubmit('/marketing/coupon/refval/update', jsonData);
+				}
+			});
+		} else {
+			// 신규화면이면 그리드상 삭제
+			brandGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(brandGridOptions)});
+		}
+	});
+
+	// 적용대상 - 공급처 추가 버튼시
+	$('#btnSupplyAdd').on('click' , function (){
+		cfnOpenCompanyListPopup("fnSetPopupComapnyInfo" , "M");
+	});
+
+	// 공급업체 설정 / 업체 추가 콜백함수
+	var fnSetPopupComapnyInfo = function(result) {
+		// 기존 리스트 데이터 for
+		for(let i = 0 ; i < result.length ; i++) {
+			let addChk = true, gridListValue = gagaAgGrid.getAllRowData(supplyGridOptions);		// 받아온 모든 데이터
+
+			// 받아온 data for
+			for(let j = 0 ; j < gridListValue.length ; j++) {
+				// 동일한 data는 추가하지 않음
+				if(gridListValue[j].supplyCompCd == result[i].supplyCompCd) {	addChk = false;	}		// 중복체크
+			}
+
+			// 중복되지 않은 데이터 리스트에 추가
+			if(addChk) {
+				gagaAgGrid.addRowData(supplyGridOptions, {"supplyCompCd" : result[i].supplyCompCd, "supplyCompNm" : result[i].supplyCompNm});
+			}
+		}
+	};
+
+	// 적용대상 - 공급처 삭제시시
+	$('#btnSupplyDel').on('click' , function () {
+		var selectVal = supplyGridOptions.api.getSelectedRows();
+
+		if(selectVal.length == 0) {
+			mcxDialog.alert("선택된 행이 없습니다");
+			return;
+		}
+
+		if(cpnDetail != null ) {
+			mcxDialog.confirm('삭제하시겠습니까?', {
+				cancelBtnText: "취소",
+				sureBtnText: "확인",
+				sureBtnClick: function(){
+					gagaAgGrid.removeRowData(supplyGridOptions , false);
+					var cpnRefvalSqArr = [];
+
+					$.each(selectVal , function(idx , item){
+						cpnRefvalSqArr.push(item.cpnRefvalSq);
+					});
+
+					var data = { cpnRefvalSqArr : cpnRefvalSqArr
+						,cpnId : $('#CouponForm #cpnId').val()
+					};
+
+					var jsonData = JSON.stringify(data);
+					gagajf.ajaxJsonSubmit('/marketing/coupon/refval/update', jsonData);
+				}
+			});
+		} else {
+			// 신규화면이면 그리드상 삭제
+			supplyGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(supplyGridOptions)});
+		}
+	});
+
+	// 적용대상 - 카테고리 추가시
+	$('#btnCateAdd').on('click' , function () {
+		cfnOpenCategoryPopup("fnSetPopupCategoryInfo");
+	});
+
+	// 카테고리 추가 콜백 함수
+	var fnSetPopupCategoryInfo = function (result) {
+		// 기존 리스트 데이터 for
+		for(let i = 0 ; i < result.length ; i++) {
+			let addChk = true, gridListValue = gagaAgGrid.getAllRowData(cateGridOptions);		// 받아온 모든 데이터
+
+			// 받아온 data for
+			for(let j = 0 ; j < gridListValue.length ; j++) {
+				// 동일한 data는 추가하지 않음
+				if(gridListValue[j].cateNo == result[i].cateNo) {	addChk = false;	}		// 중복체크
+			}
+
+			// 중복되지 않은 데이터 리스트에 추가
+			if(addChk) {
+				gagaAgGrid.addRowData(cateGridOptions, {"siteCd":result[i].siteCd , "cateGb":result[i].cateGb , "cateNo":result[i].cateNo, "cateNm":result[i].cateNm , "formalGb":result[i].formalGb , "brandEnm":null});
+			}
+		}
+	}
+
+	// 적용대상 - 카테고리 삭제시
+	$('#btnCateDel').on('click' , function () {
+		var selectVal = cateGridOptions.api.getSelectedRows();
+
+		if(selectVal.length == 0) {
+			mcxDialog.alert("선택된 행이 없습니다");
+			return;
+		}
+		if(cpnDetail != null) {
+			mcxDialog.confirm('삭제하시겠습니까?', {
+				cancelBtnText: "취소",
+				sureBtnText: "확인",
+				sureBtnClick: function(){
+					gagaAgGrid.removeRowData(cateGridOptions , false);
+
+					var cpnRefvalSqArr = [];
+
+					$.each(selectVal , function(idx , item){
+						cpnRefvalSqArr.push(item.cpnRefvalSq);
+					});
+
+					var data = { cpnRefvalSqArr : cpnRefvalSqArr
+						,cpnId : $('#CouponForm #cpnId').val()
+					};
+
+					var jsonData = JSON.stringify(data);
+					gagajf.ajaxJsonSubmit('/marketing/coupon/refval/update', jsonData);
+				}
+			});
+		} else {
+			cateGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(cateGridOptions)});
+		}
+	});
+
+	// 적용대상 - 상품 추가시
+	$('#btnGoodsAdd').on('click' , function () {
+		cfnOpenGoodsPopup("fnSetPopupApplyGoodsInfo");
+	});
+
+	// 적용 상품 리스트 콜백함수
+	var fnSetPopupApplyGoodsInfo = function(result) {
+		gridAddGoodsList(goodsGridOptions, result , "apply");
+	};
+
+	// 적용대상 - 상품 삭제 시
+	$('#btnGoodsDel').on('click' , function () {
+		var selectVal = goodsGridOptions.api.getSelectedRows();
+
+		if(selectVal.length == 0) {
+			mcxDialog.alert("선택된 행이 없습니다");
+			return;
+		}
+		if(cpnDetail != null ) {
+			mcxDialog.confirm('삭제하시겠습니까?', {
+				cancelBtnText: "취소",
+				sureBtnText: "확인",
+				sureBtnClick: function(){
+					gagaAgGrid.removeRowData(goodsGridOptions , false);
+					var cpnRefvalSqArr = [];
+
+					$.each(selectVal , function(idx , item){
+						cpnRefvalSqArr.push(item.cpnRefvalSq);
+					});
+					var data = { cpnRefvalSqArr : cpnRefvalSqArr
+						,cpnId : $('#CouponForm #cpnId').val()
+					};
+
+					var jsonData = JSON.stringify(data);
+					gagajf.ajaxJsonSubmit('/marketing/coupon/refval/update', jsonData);
+				}
+			});
+		} else {
+			goodsGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(goodsGridOptions)});
+		}
+	});
+
+	// 적용대상 - 제외상품 추가시
+	$('#btnExcepGoodsAdd').on('click' , function(){
+		cfnOpenGoodsPopup("fnSetPopupExceptGoodsInfo");
+	});
+	// 적용 상품 리스트 콜백함수
+	var fnSetPopupExceptGoodsInfo = function(result) {
+		gridAddGoodsList(excepGoodsGridOptions, result , "except");
+	};
+
+	// 적용대상 - 제외상품 삭제시
+	$('#btnExcepGoodsDel').on('click' , function () {
+		var selectVal = excepGoodsGridOptions.api.getSelectedRows();
+
+		if(selectVal.length == 0) {
+			mcxDialog.alert("선택된 행이 없습니다");
+			return;
+		}
+
+		if(cpnDetail != null ) {
+			mcxDialog.confirm('삭제하시겠습니까?', {
+				cancelBtnText: "취소",
+				sureBtnText: "확인",
+				sureBtnClick: function(){
+					gagaAgGrid.removeRowData(excepGoodsGridOptions , false);
+					var cpnRefvalSqArr = [];
+
+					$.each(selectVal , function(idx , item){
+						cpnRefvalSqArr.push(item.cpnRefvalSq);
+					});
+
+					var data = { cpnRefvalSqArr : cpnRefvalSqArr
+						,cpnId : $('#CouponForm #cpnId').val()
+					};
+
+					var jsonData = JSON.stringify(data);
+
+					gagajf.ajaxJsonSubmit('/marketing/coupon/refval/update', jsonData);
+				}
+			});
+		} else {
+			excepGoodsGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(excepGoodsGridOptions)});
+		}
+	});
+
+	// ag-grid 상품관련 list 콜백함수
+	function gridAddGoodsList(OriginGridListOption, result, gubun) {
+		var goodsGbVal = "G800_10";
+		if(gubun == 'except'){
+			goodsGbVal = "G800_30";
+		}
+
+		for(let i = 0 ; i < result.length ; i++) {
+			let addChk = true, gridListValue = gagaAgGrid.getAllRowData(OriginGridListOption);		// 받아온 모든 데이터
+
+			// 받아온 data for
+			for(let j = 0 ; j < gridListValue.length ; j++) {
+				if(gridListValue[j].goodsCd == result[i].goodsCd) {	addChk = false;	}				// 중복체크
+			}
+
+			// 중복되지 않은 데이터 리스트에 추가
+			if(addChk) {
+				gagaAgGrid.addRowData(OriginGridListOption, {"goodsGb": goodsGbVal, "goodsCd" : result[i].goodsCd, "goodsNm" : result[i].goodsNm});
+			}
+		}
+	}
+
+	// 기간 일수 변경시
+	function pdGbChange(pThis){
+		var selectVal = $(pThis).val();
+
+		if(typeof selectVal == "undefined") {
+			if(mode == "U") {
+				selectVal = cpnDetail.pdGb;
+			} else {
+				selectVal = "P";
+			}
+		}
+
+		if(selectVal == "P") {
+			$('.availDateTr').css('display' , '');
+			$('.availDayTr').css('display' , 'none');
+			$('#CouponForm #availDays').attr('required' , false);
+			$('#CouponForm #availStDay').attr('required' , true);
+			$('#CouponForm #availEdDay').attr('required' , true);
+			$('#CouponForm #availStdt').attr('required' , true);
+			$('#CouponForm #availEddt').attr('required' , true);
+		} else {
+			$('.availDateTr').css('display' , 'none');
+			$('.availDayTr').css('display' , '');
+			$('#CouponForm #availDays').attr('required' , true);
+			$('#CouponForm #availStDay').attr('required' , false);
+			$('#CouponForm #availEdDay').attr('required' , false);
+			$('#CouponForm #availStdt').attr('required' , false);
+			$('#CouponForm #availEddt').attr('required' , false);
+		}
+	}
+
+	// 첫구매여부 변경시
+	function firstYnChange(pThis){
+		var selectVal = $(pThis).val();
+
+		if(typeof selectVal == "undefined") {
+			if(mode == "U") {
+				selectVal = cpnDetail.firstYn;
+			} else {
+				selectVal = "N";
+			}
+		}
+
+		if(selectVal == "Y" ) {
+			$('.buyDateTr').css('display' , '');
+			$('#buyStdt').attr('required' , true);
+			$('#buyEddt').attr('required' , true);
+		} else {
+			$('.buyDateTr').css('display' , 'none');
+			$('#buyStdt').attr('required' , false);
+			$('#buyEddt').attr('required' , false);
+		}
+	}
+
+	// 신규회원여부 변경시
+	function custJoinYnChange(pThis){
+		var selectVal = $(pThis).val();
+
+		if(typeof selectVal == "undefined") {
+			if(mode == "U") {
+				selectVal = cpnDetail.custJoinYn;
+			} else {
+				selectVal = "N";
+			}
+		}
+
+		if(selectVal == "Y" ) {
+			$('.custJoinDateTr').css('display' , '');
+			$('#custJoinStdt').attr('required' , true);
+			$('#custJoinEddt').attr('required' , true);
+		} else {
+			$('.custJoinDateTr').css('display' , 'none');
+			$('#custJoinStdt').attr('required' , false);
+			$('#custJoinEddt').attr('required' , false);
+		}
+	}
+
+	// 행추가시
+	$('#btnAddRow').on('click' , function(){
+		var data = { supplyCompCd: null , burdenRate : null , delYn : null};
+		gagaAgGrid.addRowData(inComGridOptions , data , "supplyCompCd" );
+	});
+	// 행삭제시
+	$('#btnDelRow').on('click' , function(){
+		inComGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(inComGridOptions)});
+	});
+
+
+
+	// 쿠폰번호 자동생성 클릭시
+	function clickCreateChk(){
+		var flag = $('#CouponForm input[name=cpnCreateType]').prop("checked");
+		// 발급받은 이력이 있으면 수정 안됨
+		if(issueCnt > 0 ) {
+			return false;
+		}
+
+		if(!flag) {
+			$("#CouponForm input[name=cpnId]").prop("disabled", true);
+			$("#CouponForm input[name=cpnId]").attr("required", false);
+			$("#CouponForm input[name=cpnId]").attr("readonly", true);
+			$("#CouponForm input[name=cpnId]").attr("placeholder", "자동생성");
+			$('#CouponForm input[name=cpnCreateType]').prop("checked" , false);
+		} else{
+			$("#CouponForm input[name=cpnId]").prop("disabled", false);
+			$("#CouponForm input[name=cpnId]").attr("required", true);
+			$("#CouponForm input[name=cpnId]").attr("placeholder", "");
+			$("#CouponForm input[name=cpnId]").attr("readonly", false);
+			$('#CouponForm input[name=cpnCreateType]').prop("checked" , true);
+		}
+	}
+
+	// 제휴링크채널 수정 (제휴링크가 꼭필요한지 확인필요)
+	function fnChangeAfLinkCdList(){
+		var actionUrl = "/business/aflink/list" + '?' + $('#afChannel').serialize();
+		var tag = "";
+
+		$("#CouponForm #afLinkCd").children('option').remove();
+
+		gagajf.ajaxJsonSubmit(actionUrl, '', function(data) {
+			for (let i = 0; i < data.length; i++) {
+				if (data[i].useYn == 'Y') {
+					tag += '<option value="' + data[i].afLinkCd + '">[' + data[i].afLinkCd + '] ' + data[i].afLinkNm + '</option>';
+				}
+			}
+
+			$("#CouponForm #afLinkCd").append(tag);
+			$("#CouponForm #afLinkCd option:first").attr("selected" , "selected");
+
+		});
+	}
+	// 쿠폰발행팝업
+	function fnCustomerIssuePopUp(){
+		cfnCpnPubForCustPopup();
+	};
+
+	// 전송시 값 세팅
+	function setReqValue(){
+		// 쿠폰유형값 세팅
+		$('#CouponForm #cpnType').val($('#CouponForm input:radio[name="rdoCpnType"]:checked').val());
+		// 할인방식값 세팅
+		$('#CouponForm #dcWay').val($('#CouponForm input:radio[name="rdoDcWay"]:checked').val());
+		// 적용범위값 세팅
+		$('#CouponForm #applyScope').val($('#CouponForm input:radio[name="rdoApplyScope"]:checked').val());
+		// 다운로드기간 세팅
+		$('#CouponForm #downStdt').val($('#CouponForm #downStDay').val() + " " + $('#CouponForm #downStHH').val() + ":" + $('#CouponForm #downStMM').val() + ":00");
+		$('#CouponForm #downEddt').val($('#CouponForm #downEdDay').val() + " " + $('#CouponForm #downEdHH').val() + ":" + $('#CouponForm #downEdMM').val() + ":59");
+		// 유효기간 세팅
+		$('#CouponForm #availStdt').val($('#CouponForm #availStDay').val() + " " + $('#CouponForm #availStHH').val() + ":" + $('#CouponForm #availStMM').val() + ":00");
+		$('#CouponForm #availEddt').val($('#CouponForm #availEdDay').val() + " " + $('#CouponForm #availEdHH').val() + ":" + $('#CouponForm #availEdMM').val() + ":59");
+		// 첫구매기간세팅
+		$('#CouponForm #buyStdt').val($('#CouponForm #buyStDay').val() + " " + $('#CouponForm #buyStHH').val() + ":" + $('#CouponForm #buyStMM').val() + ":00");
+		$('#CouponForm #buyEddt').val($('#CouponForm #buyEdDay').val() + " " + $('#CouponForm #buyEdHH').val() + ":" + $('#CouponForm #buyEdMM').val() + ":59");
+		// 신규회원기간 세팅
+		$('#CouponForm #custJoinStdt').val($('#CouponForm #custJoinStDay').val() + " " + $('#CouponForm #custJoinStHH').val() + ":" + $('#CouponForm #custJoinStMM').val() + ":00");
+		$('#CouponForm #custJoinEddt').val($('#CouponForm #custJoinEdDay').val() + " " + $('#CouponForm #custJoinEdHH').val() + ":" + $('#CouponForm #custJoinEdMM').val() + ":59");
+		// 적용대상 - 공급처 그리드 전체값 세팅
+		var supplyAllData = gagaAgGrid.getAllRowData(supplyGridOptions);
+		var jsonSupplyCompData = JSON.stringify(supplyAllData);
+		$('#CouponForm #supplyCompList').val(jsonSupplyCompData);
+		// 적용대상 - 브랜드 그리드 전체값 세팅
+		var brandAllData = gagaAgGrid.getAllRowData(brandGridOptions);
+		var jsonBrandData = JSON.stringify(brandAllData);
+		$('#CouponForm #brandList').val(jsonBrandData);
+		// // 적용대상 - 카테고리 그리드 전체값 세팅
+		var cateAllData = gagaAgGrid.getAllRowData(cateGridOptions);
+		var jsonCateData = JSON.stringify(cateAllData);
+		$('#CouponForm #cateList').val(jsonCateData);
+		// 적용대상 - 적용상품 그리드 전체값 세팅
+		var goodsAllData = gagaAgGrid.getAllRowData(goodsGridOptions);
+		var jsonGoodsData = JSON.stringify(goodsAllData);
+		$('#CouponForm #applyGoodsList').val(jsonGoodsData);
+		// 적용대상 - 제외상품 그리드 전체값 세팅
+		var exceptGoodsAllData = gagaAgGrid.getAllRowData(excepGoodsGridOptions);
+		var jsonExceptGoodsData = JSON.stringify(exceptGoodsAllData);
+		$('#CouponForm #excepGoodsList').val(jsonExceptGoodsData);
+		// 입점업체분담율 그리드 전체값 세팅
+		var inCompBurdenAllData = gagaAgGrid.getAllRowData(inComGridOptions);
+		var jsonInCompBurdenData = JSON.stringify(inCompBurdenAllData);
+		$('#CouponForm #burdenList').val(jsonInCompBurdenData);
+
+	}
+
+	$(document).ready(function() {
+		gagaAgGrid.createGrid('inComGridList', inComGridOptions);
+		gagaAgGrid.createGrid('brandGridList', brandGridOptions);
+		gagaAgGrid.createGrid('cateGridList', cateGridOptions);
+		gagaAgGrid.createGrid('supplyGridList', supplyGridOptions);
+		gagaAgGrid.createGrid('goodsGridList', goodsGridOptions);
+		gagaAgGrid.createGrid('excepGoodsGridList', excepGoodsGridOptions);
+
+		// 초기화시 데이터 세팅
+		if (mode == "N") {
+			$('input[name=rdoCpnType]').eq(0).attr("checked", true);
+			$('input[name=rdoDcWay]').eq(0).attr("checked", true);
+			$('input[name=rdoApplyScope]').eq(0).attr("checked", true)
+			$('#CouponForm #availEdHH option:last').attr("selected", "selected");
+			$('#CouponForm #availEdMM option:last').attr("selected", "selected");
+			$('#downEdHH option:last').attr("selected", "selected");
+			$('#downEdMM option:last').attr("selected", "selected");
+			$('#custJoinEdHH option:last').attr("selected", "selected");
+			$('#custJoinEdMM option:last').attr("selected", "selected");
+			$('#buyEdHH option:last').attr("selected", "selected");
+			$('#buyEdMM option:last').attr("selected", "selected");
+			$("#CouponForm #afChannel option:first").attr("selected" , "selected");
+		} else {
+			// 수정모드시 그리드 세팅
+			inComGridOptions.api.setRowData(cpnDtlBurdenList);
+			supplyGridOptions.api.setRowData(cpnDtlRefvalSupplyCompList);
+			goodsGridOptions.api.setRowData(cpnDtlRefvalApplyGoodsList);
+			excepGoodsGridOptions.api.setRowData(cpnDtlRefvalExceptGoodsList);
+			brandGridOptions.api.setRowData(cpnDtlRefvalBrandList);
+			cateGridOptions.api.setRowData(cpnDtlRefvalCateList);
+			// 기본정보 세팅
+			$("#CouponForm input:radio[name='rdoDcWay']:radio[value=" + cpnDetail.dcWay + "]").prop('checked', true);
+			$("#CouponForm input:radio[name='rdoCpnType']:radio[value=" + cpnDetail.cpnType + "]").prop('checked', true);
+			$("#CouponForm input:radio[name='rdoApplyScope']:radio[value=" + cpnDetail.applyScope + "]").prop('checked', true);
+			$("#CouponForm #dcPval").val(cpnDetail.dcPval);
+			$("#CouponForm #dcMval").val(cpnDetail.dcMval);
+			$("#CouponForm #dcAval").val(cpnDetail.dcAval);
+			$("#CouponForm #maxDcAmt").val(cpnDetail.maxDcAmt);
+			$("#CouponForm #totPubLimitQty").val(cpnDetail.totPubLimitQty);
+			$("#CouponForm #custPubLimitQty").val(cpnDetail.custPubLimitQty);
+			$("#CouponForm #onePubQty").val(cpnDetail.onePubQty);
+			$("#CouponForm #usableCustGb").val(cpnDetail.usableCustGb).prop("selected", true);
+			$("#CouponForm #usableCustGrade").val(cpnDetail.usableCustGrade).prop("selected", true);
+			$("#CouponForm #endAlimYn").val(cpnDetail.endAlimYn).prop("selected", true);
+			$("#CouponForm #firstYn").val(cpnDetail.firstYn).prop("selected", true);
+			$("#CouponForm #reissuance").val(cpnDetail.reissuance).prop("selected", true);
+			$("#CouponForm #dnGb").val(cpnDetail.dnGb).prop("selected", true);
+			$("#CouponForm #cpnStat").val(cpnDetail.cpnStat).prop("selected", true);
+			$("#CouponForm #custJoinYn").val(cpnDetail.custJoinYn).prop("selected", true);
+			$("#CouponForm #pdGb").val(cpnDetail.pdGb).prop("selected", true);
+			$("#CouponForm #siteCd").val(cpnDetail.siteCd).prop("selected", true);
+			$("#CouponForm #afChannel").val(cpnDetail.afChannel).prop("selected", true);
+			$("#CouponForm #cpnNm").val(cpnDetail.cpnNm);
+			$("#CouponForm #downYn").val(cpnDetail.downYn);
+			$("#CouponForm #buyLimitAmt").val(cpnDetail.buyLimitAmt);
+			$("#CouponForm #cpnId").val(cpnDetail.cpnId);
+
+			/*
+			$("#CouponForm input:checkbox[name='cpnCreateType']").parent("label").addClass("formControl");
+			$("#CouponForm input:checkbox[name='cpnCreateType']").parent("label").prop('disabled', true);
+			$("#CouponForm input:checkbox[name='cpnCreateType']").addClass("formControl");
+			$("#CouponForm input:checkbox[name='cpnCreateType']").prop('disabled', true);
+			*/
+			// 만약 쿠폰 발급한 내역이 있으면 쿠폰수정못하게 readonly , disabled 속성 추가
+			if (issueCnt > 0) {
+				$("#CouponForm #usableCustGb").attr('readonly', true);
+				$("#CouponForm #usableCustGb").attr('disabled', true);
+				$("#CouponForm #afChannel").attr('readonly', true);
+				$("#CouponForm #afChannel").attr('disabled', true);
+				$("#CouponForm #usableCustGrade").attr('readonly', true);
+				$("#CouponForm #usableCustGrade").attr('disabled', true);
+				$("#CouponForm #endAlimYn").attr('readonly', true);
+				$("#CouponForm #endAlimYn").attr('disabled', true);
+				$("#CouponForm #firstYn").attr('readonly', true);
+				$("#CouponForm #firstYn").attr('disabled', true);
+				$("#CouponForm #reissuance").attr('readonly', true);
+				$("#CouponForm #reissuance").attr('disabled', true);
+				$("#CouponForm #dnGb").attr('readonly', true);
+				$("#CouponForm #dnGb").attr('disabled', true);
+				$("#CouponForm #custJoinYn").attr('readonly', true);
+				$("#CouponForm #custJoinYn").attr('disabled', true);
+				$("#CouponForm #pdGb").attr('readonly', true);
+				$("#CouponForm #pdGb").attr('disabled', true);
+				$("#CouponForm #downYn").attr('readonly', true);
+				$("#CouponForm #downYn").attr('disabled', true);
+				$("#CouponForm #siteCd").attr('readonly', true);
+				$("#CouponForm #siteCd").attr('disabled', true);
+				$("#CouponForm #cpnNm").attr('readonly', true);
+				$("#CouponForm #cpnNm").attr('disabled', true);
+				$("#CouponForm #dcPval").attr('readonly', true);
+				$("#CouponForm #dcPval").attr('disabled', true);
+				$("#CouponForm #dcMval").attr('readonly', true);
+				$("#CouponForm #dcMval").attr('disabled', true);
+				$("#CouponForm #dcAval").attr('readonly', true);
+				$("#CouponForm #dcAval").attr('disabled', true);
+				$("#CouponForm #maxDcAmt").attr('readonly', true);
+				$("#CouponForm #maxDcAmt").attr('disabled', true);
+				$("#CouponForm #totPubLimitQty").attr('readonly', true);
+				$("#CouponForm #totPubLimitQty").attr('disabled', true);
+				$("#CouponForm #custPubLimitQty").attr('readonly', true);
+				$("#CouponForm #custPubLimitQty").attr('disabled', true);
+				$("#CouponForm #onePubQty").attr('readonly', true);
+				$("#CouponForm #onePubQty").attr('disabled', true);
+				$("#CouponForm #downStDay").attr('readonly', true);
+				$("#CouponForm #downStDay").attr('disabled', true);
+				$("#CouponForm #downStHH").attr('readonly', true);
+				$("#CouponForm #downStHH").attr('disabled', true);
+				$("#CouponForm #downStMM").attr('readonly', true);
+				$("#CouponForm #downStMM").attr('disabled', true);
+				$("#CouponForm #buyLimitAmt").attr('readonly', true);
+				$("#CouponForm input:radio[name='rdoDcWay']").attr('readonly', true);
+				$("#CouponForm input:radio[name='rdoCpnType']").attr('readonly', true);
+				$("#CouponForm input:radio[name='rdoApplyScope']").attr('readonly', true);
+				$("#CouponForm .rdoBtn").css('cursor', 'auto');
+				$("#CouponForm #cpnId").attr('readonly', true);
+				$("#CouponForm #cpnId").attr('disabled', true);
+				$("#CouponForm input:checkbox[name='cpnCreateType']").attr('readonly', true);
+				$("#CouponForm input:checkbox[name='cpnCreateType']").attr('disabled', true);
+				$("#CouponForm input:checkbox[name=cpnCreateType]").attr('checked', true);
+				$("#CouponForm input:checkbox[name=cpnCreateType]").parent().addClass('checked');
+			}
+			// 다운로드기간 세팅
+			splitDate("start", cpnDetail.downStdt, "down");
+			splitDate("end", cpnDetail.downEddt, "down");
+			// 유효기간이 날짜인경우 날짜 세팅
+			if (cpnDetail.pdGb == "P") {
+				splitDate("start", cpnDetail.availStdt, "avail");
+				splitDate("end", cpnDetail.availEddt, "avail");
+				$("#CouponForm #availStDay").attr('readonly', true);
+				$("#CouponForm #availStDay").attr('disabled', true);
+				$("#CouponForm #availStHH").attr('readonly', true);
+				$("#CouponForm #availStHH").attr('disabled', true);
+				$("#CouponForm #availStMM").attr('readonly', true);
+				$("#CouponForm #availStMM").attr('disabled', true);
+			} else {
+				$("#CouponForm #availDays").val(cpnDetail.availDays);
+			}
+			// 첫구매여부 적용하는 경우 날짜 세팅
+			if (cpnDetail.firstYn == "Y") {
+				splitDate("start", cpnDetail.buyStdt, "buy");
+				splitDate("end", cpnDetail.buyEddt, "buy");
+				$("#CouponForm #buyStDay").attr('readonly', true);
+				$("#CouponForm #buyStDay").attr('disabled', true);
+				$("#CouponForm #buyStHH").attr('readonly', true);
+				$("#CouponForm #buyStHH").attr('disabled', true);
+				$("#CouponForm #buyStMM").attr('readonly', true);
+				$("#CouponForm #buyStMM").attr('disabled', true);
+			}
+			// 신규회원여부 적용하는 경우 날짜 세팅
+			if (cpnDetail.custJoinYn == "Y") {
+				splitDate("start", cpnDetail.custJoinStdt, "custJoin");
+				splitDate("end", cpnDetail.custJoinEddt, "custJoin");
+				$("#CouponForm #custJoinStDay").attr('readonly', true);
+				$("#CouponForm #custJoinStDay").attr('disabled', true);
+				$("#CouponForm #custJoinStHH").attr('readonly', true);
+				$("#CouponForm #custJoinStHH").attr('disabled', true);
+				$("#CouponForm #custJoinStMM").attr('readonly', true);
+				$("#CouponForm #custJoinStMM").attr('disabled', true);
+			}
+		}
+		// 기본세팅
+		pdGbChange();
+		firstYnChange();
+		custJoinYnChange();
+		fnChangeAfLinkCdList();
+
+		// 제휴채널2뎁스 기본세팅
+		if(cpnDetail != null ) {
+			$("#CouponForm #afLinkCd").val(cpnDetail.afLinkCd).prop("selected", true);
+			if(issueCnt > 0 ) {
+				$("#CouponForm #afLinkCd").attr('readonly', true);
+				$("#CouponForm #afLinkCd").attr('disabled', true);
+			}
+		}
+	});
+
+	// 날짜분리 ( 시작/종료날짜구분(start , end) , 날짜String , 적용타겟대상 )
+	function splitDate(stedGb , date , targetGb ){
+		var str = date;
+		var dateStr = str.split(' ');
+		var timeArr = dateStr[1].split(':');
+
+		if(stedGb == "start") {
+			$("#CouponForm #"+targetGb+"StDay").val(dateStr[0]);
+			$("#CouponForm #"+targetGb+"StHH").val(timeArr[0]);
+			$("#CouponForm #"+targetGb+"StMM").val(timeArr[1]);
+		} else {
+			$("#CouponForm #"+targetGb+"EdDay").val(dateStr[0]);
+			$("#CouponForm #"+targetGb+"EdHH").val(timeArr[0]);
+			$("#CouponForm #"+targetGb+"EdMM").val(timeArr[1]);
+		}
+	}
+	// 제한없음 문구 변경
+	$("input[name=totPubLimitQty],input[name=custPubLimitQty],input[name=buyLimitAmt],input[name=onePubQty]").change(function(){
+		if($(this).val() == "0"){
+			$("#"+$(this).attr("name")+"Span").html("*제한없음");
+		}else{
+			$("#"+$(this).attr("name")+"Span").html("");
+		}
+		$("#"+$(this).attr("name")+"Span").css("color", "red");
+	});
+	setTimeout(function(){
+		$("input[name=totPubLimitQty],input[name=custPubLimitQty],input[name=buyLimitAmt],input[name=onePubQty]").change();
+	}, 1);
+
+	// 콤마 찍어주기
+	$(function(){
+		setComma("CouponForm" , true);
+	});
+
+	function setComma(formId, pBoolean){
+		setTimeout(function(){
+			//숫자타입 콤마 찍어주기
+			$("#"+formId+" [data-valid-type=numeric]").each(function(){
+				$(this).change(function(){
+					if(pBoolean){
+						$(this).val($(this).val().addComma());
+					}else{
+						$(this).val($(this).val().removeComma());
+					}
+				});
+				if(pBoolean){
+					$(this).val($(this).val().addComma());
+				}else{
+					$(this).val($(this).val().removeComma());
+				}
+			});
+		}, 300);
+	}
+	/*]]>*/
+</script>
+</html>

+ 243 - 0
src/main/webapp/WEB-INF/views/marketing/CouponPubForCustPopupForm.html

@@ -0,0 +1,243 @@
+<!DOCTYPE html>
+<html lang="ko"
+	  xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : CouponPubForCustPopupForm.html
+ * @desc    : 고객 쿠폰 발행 팝업 화면
+ *============================================================================
+ * ISTYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.01.20   xyzp1539       최초 작성
+ *******************************************************************************
+ -->
+<div class="modalPopup" data-width="960" data-height="900">
+	<div class="panelStyle" >
+		<div class="panelTitle">
+			<h2>쿠폰발행</h2>
+			<button type="button" class="close" onclick="uifnPopupClose('CpnPubForCustPopup')"><i class="fa fa-times"></i></button>
+		</div>
+		<div class="panelContent">
+			<form id="custSearchForm" name="custSearchForm" action="#" th:action="@{'/customer/active/list'}" >
+				<table class="frmStyle">
+					<colgroup>
+						<col width="10%">
+						<col width="40%">
+						<col width="10%">
+						<col width="40%">
+					</colgroup>
+					<tbody>
+						<tr>
+							<th>사이트코드</th>
+							<td>
+								<select name="siteCd" id="siteCd">
+									<option th:if="${siteCdList}" th:each="oneData , status : ${siteCdList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+								</select>
+							</td>
+							<th>회원ID</th>
+							<td>
+								<input type="text" class="w200" id="custId" name="custId">
+							</td>
+						</tr>
+						<tr>
+							<th>회원구분</th>
+							<td>
+								<select name="custGb" id="custGb">
+									<option th:if="${usableCustGbList}" th:each="oneData , status : ${usableCustGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+								</select>
+							</td>
+							<th>회원등급</th>
+							<td>
+								<select name="custGrade" id="custGrade">
+									<option value="">전체</option>
+									<option th:if="${usableCustGradeList}" th:each="oneData , status : ${usableCustGradeList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+								</select>
+							</td>
+						</tr>
+						<tr>
+							<th>이메일</th>
+							<td>
+								<input type="text" class="w200"  id="email" name="email">
+							</td>
+							<th>회원명</th>
+							<td>
+								<input type="text" class="w200" id="custNm" name="custNm">
+							</td>
+						</tr>
+					</tbody>
+				</table>
+			</form>
+			<div class="aR">
+				<input type="button" value="조회" class="btn btn-info btn-lg" onclick="fnSearchPubCustList()">
+			</div>
+			<div id="pubCustgridList" style="width:100%; height:420px;" class="ag-theme-balham"></div>
+			<form id="pubRegForm" name="pubRegForm" th:action="@{'/marketing/coupon/insertCustPub'}">
+				<input type="hidden" name="custList" id="custList">
+				<input type="hidden" name="cpnId" id="cpnId">
+				<table class="frmStyle">
+					<colgroup>
+						<col width="10%">
+						<col width="40%">
+						<col width="10%">
+						<col width="40%">
+					</colgroup>
+					<tbody>
+					<tr>
+						<th class="availDateTr">유효기간시작일시<em class="required" title="필수"></em></th>
+						<td class="availDateTr">
+							<input type="hidden" name="availStdt" id="availStdt" data-valid-name="유효기간시작일시" required="required">
+							<input type="text" class="schDate w100" name="availStDay" id="availStDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
+							<select name="availStHH" id="availStHH">
+								<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+							</select>
+							<select name="availStMM" id="availStMM">
+								<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+							</select>
+						<th class="availDateTr">유효기간종료일시<em class="required" title="필수"></em></th>
+						<td class="availDateTr">
+							<input type="hidden" id="availEddt" name="availEddt" data-valid-name="유효기간종료일시" required="required">
+							<input type="text" class="schDate w100" name="availEdDay" id="availEdDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
+							<select name="availEdHH" id="availEdHH">
+								<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+							</select>
+							<select name="availEdMM" id="availEdMM">
+								<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+							</select>
+						</td>
+					</tr>
+					<tr>
+						<th>발급사유<em class="required" title="필수"></em></th>
+						<td>
+							<select name="pubReason" id="pubReason" required="required" data-valid-name="발급사유">
+								<option th:if="${cpnPubReasonList}" th:each="oneData , status : ${cpnPubReasonList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+							</select>
+						</td>
+						<th>만료알림발송여부<em class="required" title="필수"></em></th>
+						<td>
+							<select name="endAlimSendYn" id="endAlimSendYn" data-valid-name="만료알림발송여부" required="required">
+								<option value="Y">Y</option>
+								<option value="N" selected="selected">N</option>
+							</select>
+						</td>
+					</tr>
+					<tr>
+						<th>상세사유</th>
+						<td colspan="5">
+							<textarea name="pubReasonDtl" id="pubReasonDtl" cols="50" rows="5" style="height: 100px;"></textarea>
+						</td>
+					</tr>
+					</tbody>
+				</table>
+			</form>
+			<div class="aR">
+				<input type="button" value="발행" class="btn btn-info btn-lg" onclick="fnCpnPubCustomer()">
+			</div>
+		</div>
+	</div>
+</div>
+<script th:inline="javascript">
+	/*<![CDATA[*/
+	var siteCdList = gagajf.convertToArray([[${siteCdList}]]);
+	var usableCustGbList = gagajf.convertToArray([[${usableCustGbList}]]);
+	var usableCustGradeList = gagajf.convertToArray([[${usableCustGradeList}]]);
+
+	var columnDefs = [
+		{ headerName: "사이트" , field:"siteCd" , width:100, cellClass:"text-center" ,
+			cellEditor: 'agRichSelectCellEditor',
+			cellEditorParams: { values: gagaAgGrid.extractValues(siteCdList) },
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(siteCdList, params.value); },
+			valueParser: function (params) { return gagaAgGrid.lookupKey(siteCdList, params.newValue);}
+		} ,
+		{ headerName: "회원번호" , field:"custNo" , width:100, cellClass:"text-center"} ,
+		{ headerName: "회원명" , field:"custNm" , width:120, cellClass:"text-center" } ,
+		{ headerName: "이메일" , field:"email" , width:200, cellClass:"text-center"} ,
+		{ headerName: "회원구분" , field:"custGb" , width:120, cellClass:"text-center" ,
+			cellEditor: 'agRichSelectCellEditor',
+			cellEditorParams: { values: gagaAgGrid.extractValues(usableCustGbList) },
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(usableCustGbList, params.value); },
+			valueParser: function (params) { return gagaAgGrid.lookupKey(usableCustGbList, params.newValue);}
+		} ,
+		{ headerName: "회원등급" , field:"custGrade" , width:120, cellClass:"text-center" ,
+			cellEditor: 'agRichSelectCellEditor',
+			cellEditorParams: { values: gagaAgGrid.extractValues(usableCustGradeList) },
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(usableCustGradeList, params.value); },
+			valueParser: function (params) { return gagaAgGrid.lookupKey(usableCustGradeList, params.newValue);}
+		}
+	];
+
+	var pubCustGridOptions = gagaAgGrid.getGridOptions(columnDefs);
+
+	// 고객 조회
+	function fnSearchPubCustList(){
+		gagaAgGrid.fetch($("#custSearchForm").prop('action') , pubCustGridOptions , '#custSearchForm');
+	}
+
+	function fnCpnPubCustomer(){
+		setReqValue();
+		checkValidation();
+
+		var fromDate = $('#pubRegForm input[name=availStdt]').val();
+		var toDate = $('#pubRegForm input[name=availEddt]').val();
+
+		if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
+			mcxDialog.alertC("유효기간 시작일자와 종료일자를 입력하세요.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$('#pubRegForm input[name=availStdt]').focus();
+				}
+			});
+			return false;
+		}
+
+		if (fromDate > toDate) {
+			mcxDialog.alertC("등록 시작일자는 종료일자 보다 클 수 없습니다.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$('#pubRegForm input[name=availEddt]').focus();
+				}
+			});
+			return false;
+		}
+
+		var selectVal = gagaAgGrid.getAllRowData(pubCustGridOptions);
+		if(selectVal.length < 1) {
+			mcxDialog.alert("발행하고자 하는 회원이 없습니다.");
+			return false;
+		}
+
+		mcxDialog.confirm('발행하시겠습니까?' , {
+			cancelBtnText: "취소",
+			sureBtnText: "확인" ,
+			sureBtnClick: function(){
+				gagajf.ajaxFormSubmit($("#pubRegForm").prop('action') , "#pubRegForm" , function(){
+					uifnPopupClose('CpnPubForCustPopup');
+				});
+			}
+		});
+	}
+	
+	function setReqValue(){
+		// 유효기간 세팅
+		$('#pubRegForm #availStdt').val($('#pubRegForm #availStDay').val() + " " + $('#pubRegForm #availStHH').val() + ":" + $('#pubRegForm #availStMM').val() + ":00");
+		$('#pubRegForm #availEddt').val($('#pubRegForm #availEdDay').val() + " " + $('#pubRegForm #availEdHH').val() + ":" + $('#pubRegForm #availEdMM').val() + ":59");
+		// 회원 그리드값 세팅
+		var custAllData = gagaAgGrid.getAllRowData(pubCustGridOptions);
+		var jsonCustPubData = JSON.stringify(custAllData);
+		$("#pubRegForm #custList").val(jsonCustPubData);
+		$("#pubRegForm #cpnId").val($("#CouponForm #cpnId2").val());
+	}
+
+	$(document).ready(function(){
+		gagaAgGrid.createGrid('pubCustgridList', pubCustGridOptions);
+
+		$('#pubRegForm #availEdHH option:last').attr("selected", "selected");
+		$('#pubRegForm #availEdMM option:last').attr("selected", "selected");
+
+	});
+
+	/*]]>*/
+</script>
+</html>

+ 92 - 26
src/main/webapp/WEB-INF/views/marketing/MorebetterPopupForm.html

@@ -15,7 +15,7 @@
  *******************************************************************************
  -->
 <div class="modalPopup frGoodsPro" data-width="1100">
-	<div class="panelStyle" style="max-height:900px;overflow-y:scroll;">
+	<div class="panelStyle" style="max-height:700px;overflow-y:scroll;">
 		<div class="panelTitle">
 			<strong th:text="${'다다익선 ' + (mode == 'N' ? '등록' : '상세')}">다다익선 등록</strong>
 			<button type="button" class="close" onclick="fnMorebetterFormClose()"><i class="fa fa-times"></i></button>
@@ -76,6 +76,7 @@
 						<td>
 							<label class="rdoBtn"><input type="radio" name="sectionGb" id="sectionGbQty" value="G810_10" checked="checked"/>수량</label>
 							<label class="rdoBtn"><input type="radio" name="sectionGb" id="sectionGbAmt" value="G810_11"/>금액</label>
+							<input type="hidden" id="applyGb" name="applyGb"/>
 						</td>
 						<th>할인 구분<em class="required" title="필수"></em></th>
 						<td>
@@ -119,7 +120,7 @@
 								<th>공급업체/브랜드</th>
 								<td>
 									<!-- 수정시 프로모션명 입력 : before -->
-									<div class="padding10 wid45">
+									<div class="padding10" style="display:inline-block;width:49%;">
 										<span>공급업체 설정</span>
 										<div class="padding10 inner-tb-solid">
 											<button type="button" class="btn btnRight btn-success btn-lg" id="btnAddCompany">업체 추가</button>
@@ -128,7 +129,7 @@
 											<div id="gridFGPromotionCompanyList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
 										</div>
 									</div>
-									<div class="padding10 wid45">
+									<div class="padding10" style="display:inline-block;width:49%;">
 										<span>브랜드 설정</span>
 										<div class="padding10 inner-tb-solid">
 											<button type="button" class="btn btnRight btn-success btn-lg" id="btnAddBrand">브랜드 추가</button>
@@ -297,7 +298,7 @@
 	// 브랜드 리스트 설정
 	var columnBrandList = [
 		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
-		{headerName: "브랜드ID", field: "brandCd", width: 120, cellClass: 'text-center'},
+		{headerName: "브랜드ID", field: "brandCd", width: 110, cellClass: 'text-center'},
 		{headerName: "브랜드명", field: "brandEnm", width: 120, cellClass: 'text-center'},
 		{headerName: "공급업체명", field: "supplyCompNm", width: 150, cellClass: 'text-center'},
 		{headerName: "적용대상", field: "targetGb", width: 150, cellClass: 'text-center', hide: true},
@@ -315,7 +316,8 @@
 		{headerName: "상품코드", field: "goodsCd", width: 120, cellClass: 'text-center'},
 		{headerName: "상품명", field: "goodsNm", width: 120, cellClass: 'text-center'},
 		{headerName: "적용대상", field: "targetGb", width: 150, cellClass: 'text-center', hide: true},
-		{headerName: "시퀀스", field: "tmtbGoodsSq", width: 150, cellClass: 'text-center', hide: true}
+		{headerName: "시퀀스", field: "tmtbGoodsSq", width: 150, cellClass: 'text-center', hide: true},
+		{headerName: "실제적용대상 시퀀스", field: "tmtbApplyGoodsSq", width: 150, cellClass: 'text-center', hide: true}
 	];
 	// 제외상품 리스트 설정
 	var columnExceptGoodsList = [
@@ -329,7 +331,8 @@
 		{headerName: "상품코드", field: "goodsCd", width: 120, cellClass: 'text-center'},
 		{headerName: "상품명", field: "goodsNm", width: 120, cellClass: 'text-center'},
 		{headerName: "적용대상", field: "targetGb", width: 150, cellClass: 'text-center', hide: true},
-		{headerName: "시퀀스", field: "tmtbGoodsSq", width: 150, cellClass: 'text-center', hide: true}
+		{headerName: "시퀀스", field: "tmtbGoodsSq", width: 150, cellClass: 'text-center', hide: true},
+		{headerName: "실제적용대상 시퀀스", field: "tmtbApplyGoodsSq", width: 150, cellClass: 'text-center', hide: true}
 	];
 
 	// 업체분담율 리스트 설정
@@ -486,12 +489,12 @@
 			cancelBtnText: "취소",
 			sureBtnText: "확인",
 			sureBtnClick: function(){
-				var compAllData = gagaAgGrid.selectedRowData(gridOptionsFGCompanyList);
-				var brandAllData = gagaAgGrid.selectedRowData(gridOptionsFGBrandList);
-				var applyAllData = gagaAgGrid.selectedRowData(gridOptionsFGApplyGoodsList);
-				var exceptAllData = gagaAgGrid.selectedRowData(gridOptionsFGExceptGoodsList);
-				var burdenAllData = gagaAgGrid.selectedRowData(gridOptionsApplyBurdenList);
-				var sectionGbAllData = gagaAgGrid.selectedRowData(gridOptionsSectionGbList);
+				var compAllData = gagaAgGrid.getAllRowData(gridOptionsFGCompanyList);	//selectedRowData
+				var brandAllData = gagaAgGrid.getAllRowData(gridOptionsFGBrandList);
+				var applyAllData = gagaAgGrid.getAllRowData(gridOptionsFGApplyGoodsList);
+				var exceptAllData = gagaAgGrid.getAllRowData(gridOptionsFGExceptGoodsList);
+				var burdenAllData = gagaAgGrid.getAllRowData(gridOptionsApplyBurdenList);
+				var sectionGbAllData = gagaAgGrid.getAllRowData(gridOptionsSectionGbList);
 
 				var jsonSupplyCompData = JSON.stringify(compAllData);
 				$('#moreBetterForm input[name=supplyCompList]').val(jsonSupplyCompData);
@@ -537,21 +540,38 @@
 			$('#moreBetterForm input[name=tmtbStdt]').focus();
 			return false;
 		}
+		// 공급업체&&브랜드 체크
+		let allSupplyCompCnt = gagaAgGrid.getAllRowData(gridOptionsFGCompanyList).length;
+		let allBrandCnt = gagaAgGrid.getAllRowData(gridOptionsFGBrandList).length;
+		console.log('allSupplyCompCnt>>>>'+allSupplyCompCnt);
+		console.log('allBrandCnt>>>>'+allBrandCnt);
+		if(allSupplyCompCnt>0){
+			if(allBrandCnt<1){
+				mcxDialog.alert('브랜드를 추가해주세요.');
+				return;
+			}
+		}
+		if(allBrandCnt>0){
+			if(allSupplyCompCnt<1){
+				mcxDialog.alert('공급업체를 추가해주세요.');
+				return;
+			}
+		}
 
 		// 각 ag-grid list 수량
-		let supplyCompCnt = gagaAgGrid.selectedRowData(gridOptionsFGCompanyList).length;
-		let brandCnt = gagaAgGrid.selectedRowData(gridOptionsFGBrandList).length;
-		let applyGoodsCnt = gagaAgGrid.selectedRowData(gridOptionsFGApplyGoodsList).length;
-		let exceptGoodsCnt = gagaAgGrid.selectedRowData(gridOptionsFGExceptGoodsList).length;
-		let applyBurdenCnt = gagaAgGrid.selectedRowData(gridOptionsApplyBurdenList).length;
-		let sectionGbCnt = gagaAgGrid.selectedRowData(gridOptionsSectionGbList).length;
+		let supplyCompCnt = gagaAgGrid.getAllRowData(gridOptionsFGCompanyList).length;
+		let brandCnt = gagaAgGrid.getAllRowData(gridOptionsFGBrandList).length;
+		let applyGoodsCnt = gagaAgGrid.getAllRowData(gridOptionsFGApplyGoodsList).length;
+		let exceptGoodsCnt = gagaAgGrid.getAllRowData(gridOptionsFGExceptGoodsList).length;
+		let applyBurdenCnt = gagaAgGrid.getAllRowData(gridOptionsApplyBurdenList).length;
+		let sectionGbCnt = gagaAgGrid.getAllRowData(gridOptionsSectionGbList).length;
 
 		if(applyGoodsCnt < 1){
-			mcxDialog.alert("선택된 적용상품이 없습니다.");
+			mcxDialog.alert("적용상품이 없습니다.");
 			return false;
 		}
 		if(sectionGbCnt < 1){
-			mcxDialog.alert("선택된 할인구간이 없습니다.");
+			mcxDialog.alert("할인구간을 설정해주세요.");
 			return false;
 		}
 
@@ -563,12 +583,12 @@
 			cancelBtnText: "취소",
 			sureBtnText: "확인",
 			sureBtnClick: function(){
-				var compAllData = gagaAgGrid.selectedRowData(gridOptionsFGCompanyList);
-				var brandAllData = gagaAgGrid.selectedRowData(gridOptionsFGBrandList);
-				var applyAllData = gagaAgGrid.selectedRowData(gridOptionsFGApplyGoodsList);
-				var exceptAllData = gagaAgGrid.selectedRowData(gridOptionsFGExceptGoodsList);
-				var burdenAllData = gagaAgGrid.selectedRowData(gridOptionsApplyBurdenList);
-				var sectionGbAllData = gagaAgGrid.selectedRowData(gridOptionsSectionGbList);
+				var compAllData = gagaAgGrid.getAllRowData(gridOptionsFGCompanyList);
+				var brandAllData = gagaAgGrid.getAllRowData(gridOptionsFGBrandList);
+				var applyAllData = gagaAgGrid.getAllRowData(gridOptionsFGApplyGoodsList);
+				var exceptAllData = gagaAgGrid.getAllRowData(gridOptionsFGExceptGoodsList);
+				var burdenAllData = gagaAgGrid.getAllRowData(gridOptionsApplyBurdenList);
+				var sectionGbAllData = gagaAgGrid.getAllRowData(gridOptionsSectionGbList);
 
 				var jsonSupplyCompData = JSON.stringify(compAllData);
 				$('#moreBetterForm input[name=supplyCompList]').val(jsonSupplyCompData);
@@ -584,12 +604,16 @@
 				var jsonSectionGbData = JSON.stringify(sectionGbAllData);
 				$('#moreBetterForm input[name=sectionGbList]').val(jsonSectionGbData);
 
+				$('#moreBetterForm input[name=applyGb]').val($('input:radio[name="sectionGb"]:checked').val());
+
+
 				var jsonData = JSON.stringify($('#moreBetterForm').serializeObject());
 				gagajf.ajaxJsonSubmit($('#moreBetterForm').prop('action'), jsonData, function() {
 					fnMorebetterFormClose();
 					$('#btnInit').trigger('click');
 					$('#btnSearch').trigger('click');
 				});
+
 			}
 		});
 
@@ -612,6 +636,13 @@
 				gagaAgGrid.addRowData(gridOptionsFGCompanyList, {"supplyCompCd" : result[i].supplyCompCd, "supplyCompNm" : result[i].supplyCompNm, "targetGb" : "G260_13"});
 			}
 		}
+
+		// 브랜드 데이터 체크
+		let allBrandCnt = gagaAgGrid.getAllRowData(gridOptionsFGBrandList).length;
+		if(allBrandCnt<1){
+			mcxDialog.alert('브랜드를 추가해주세요.');
+			return;
+		}
 	};
 
 	// 브랜드 설정 / 브랜드 추가 콜백함수 (단수로 가져오므로 복수일 경우에 수정 확인 필요)
@@ -629,6 +660,41 @@
 				gagaAgGrid.addRowData(gridOptionsFGBrandList, {"brandCd" : result[i].brandCd, "brandEnm" : result[i].brandEnm, "supplyCompNm" : result[i].supplyCompNm, "targetGb" : "G260_12"});
 			}
 		}
+
+		// 공급업체 데이터 체크
+		var allSupplyCompData = gagaAgGrid.getAllRowData(gridOptionsFGCompanyList);
+		var allBrandData = gagaAgGrid.getAllRowData(gridOptionsFGBrandList);
+
+		console.log('allSupplyCompData cnt>>'+allSupplyCompData.length);
+		console.log('allBrandData cnt>>'+allBrandData.length);
+
+		if(allSupplyCompData.length < 1){
+			mcxDialog.alert('공급업체를 추가해주세요.');
+			return;
+		}
+
+		// 공급업체+브랜드 상품조회
+		var multiSupplyCompCd = [];
+		$.each(allSupplyCompData, function(idx, item) {
+			multiSupplyCompCd.push(item.supplyCompCd);
+		});
+
+		var multiBrand = [];
+		$.each(allBrandData, function(idx, item) {
+			multiBrand.push(item.brandCd);
+		});
+
+		var data = {multiSupplyCompCd : multiSupplyCompCd
+			,multiBrand : multiBrand
+			,pageingYn : "N"
+		};
+
+		var jsonData = JSON.stringify(data);
+		gagajf.ajaxJsonSubmit('/goods/list', jsonData, function(result) {
+			console.log('goodsList cnt>>'+result.goodsList.length);
+			console.log('goodsList >>'+result.goodsList);
+		});
+
 	};
 
 	// 분담업체율 설정 / 업체 추가 콜백함수

+ 200 - 0
src/main/webapp/WEB-INF/views/settle/AfLinkSettleForm.html

@@ -0,0 +1,200 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : AfLinkSettleForm.html
+ * @desc    : 제휴채널정산 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.01.20   gagamel     최초 작성
+ *******************************************************************************
+ -->
+	<div id="main">
+		<!-- 메인타이틀 영역 -->
+		<div class="main-title">
+		</div>
+		<!-- //메인타이틀 영역 -->
+		
+		<!-- 메뉴 설명 -->
+		<div class="infoBox menu-desc">
+		</div>
+		<!-- //메뉴 설명 -->
+		
+		<!-- 검색조건 영역 -->
+		<div class="panelStyle">
+			<form id="searchForm" name="searchForm" action="#" th:action="@{'/settle/aflink/fee/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
+				<table class="frmStyle" aria-describedby="검색조건">
+					<colgroup>
+						<col style="width:10%;"/>
+						<col style="width:60%;"/>
+						<col style="width:10%;"/>
+						<col/>
+					</colgroup>
+					<tr>
+						<th>발생(정산)기간<i class="required" title="필수" aria-hidden="true"></i></th>
+						<td id="terms">
+						</td>
+						<th>제휴채널</th>
+						<td>
+							<select name="afChannel">
+								<option value="">[전체]</option>
+								<option th:if="${afChannelList}" th:each="oneData, status : ${afChannelList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+							</select>
+							<select name="afLinkCd">
+								<option value="">[전체]</option>
+							</select>
+						</td>
+					</tr>
+				</table>
+				
+				<ul class="panelBar">
+					<li class="center">
+						<button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
+						<button type="button" class="btn btn-gray btn-lg" onclick="$('#searchForm')[0].reset();">초기화</button>
+					</li>
+				</ul>
+			</form>
+		</div>
+		<!-- 검색조건 영역 -->
+
+		<!-- 리스트 영역 -->
+		<div class="panelStyle">
+			<!-- 버튼 배치 영역 -->
+			<ul class="panelBar">
+				<li class="left">
+					<span class="infoTxt cBlue">
+						<i class="fa fa-info-circle" aria-hidden="true"></i><strong>발생(정산)일시</strong> : 결제/취소/반품이 실제 발생한 일시. <i class="fa fa-info-circle marL10" aria-hidden="true"></i><strong>판매금액</strong> : 정상 판매가로 배송비를 제외한 상품금액 합계<br/>
+						<i class="fa fa-info-circle" aria-hidden="true"></i><strong>쿠폰할인금액</strong> : 즉시할인 + 다다익선 + 상품쿠폰 + 장바구니쿠폰 + PG결제쿠폰 등의 합계. <i class="fa fa-info-circle marL10" aria-hidden="true"></i><strong>포인트사용금액</strong> : 포인트사용 + 선포인트사용 합계<br/>
+						<i class="fa fa-info-circle" aria-hidden="true"></i><strong>결제액</strong> : 판매금액 - 쿠폰할인금액 - 포인트사용금액 - 상품권사용금액. <i class="fa fa-info-circle marL10" aria-hidden="true"></i><strong>매출액</strong> : 결제액 / 1.1
+					</span>
+				</li>
+				<li class="right">
+					<button type="button" class="btn btn-default btn-lg" id="btnExcel">엑셀다운로드</button>
+				</li>
+			</ul>
+			<!-- //버튼 배치 영역 -->
+			
+			<div id="gridList" style="width: 100%; height: 670px" class="ag-theme-balham"></div>
+		</div>
+		<!-- //리스트 영역 -->
+	</div>
+
+<script th:inline="javascript">
+/*<![CDATA[*/
+	let columnDefs = [
+		{headerName: "상위제휴채널", field: "afChannelNm", width: 100, rowGroup: true, hide: true},
+		{headerName: "제휴채널", field: "afLinkNm", width: 100},
+		{headerName: "발생(정산)일시", field: "occurDt", width: 150, cellClass: 'text-center'},
+		{headerName: "주문번호", field: "ordNo", width: 80, cellClass: 'text-center'},
+		{headerName: "주문상태", field: "ordDtlStat", width: 100, cellClass: 'text-center'},
+		{
+			headerName: '판매금액', field: 'sellAmt', width: 120, cellClass: 'text-right',
+			aggFunc: 'sum', enableValue: true, cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+		},
+		{
+			headerName: '쿠폰할인금액', field: 'cpnDcAmt', width: 120, cellClass: 'text-right',
+			aggFunc: 'sum', enableValue: true, cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+		},
+		{
+			headerName: '포인트사용금액', field: 'pntDcAmt', width: 120, cellClass: 'text-right',
+			aggFunc: 'sum', enableValue: true, cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+		},
+		{
+			headerName: '상품권사용금액', field: 'gfcdUseAmt', width: 120, cellClass: 'text-right',
+			aggFunc: 'sum', enableValue: true, cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+		},
+		{
+			headerName: '결제액(VAT포함)', field: 'payAmt', width: 120, cellClass: 'text-right',
+			aggFunc: 'sum', enableValue: true, cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+		},
+		{
+			headerName: '매출액(VAT제외)', field: 'salesAmt', width: 120, cellClass: 'text-right',
+			aggFunc: 'sum', enableValue: true, cellRenderer: function (params) { return gagaAgGrid.toAddComma(params.value); }
+		}
+	];
+
+	let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+
+	gridOptions.autoGroupColumnDef = {
+			headerName: "상위제휴채널",
+			field: "grouping",
+			width: 200,
+			cellRendererParams: {
+				suppressCount: true
+			}
+		};
+	
+	// for expand everything
+	gridOptions.groupDefaultExpanded = -1;
+	
+	// 제휴채널 콤보박스 변경시
+	$('#searchForm select[name=afChannel]').on('change', function() {
+		if (gagajf.isNull($(this).val())) {
+			$("#searchForm select[name=afLinkCd] option:gt(0)").remove();
+		} else {
+			var actionUrl = '/renderer/aflink/list/' + $(this).val();
+			cfnCreateCombo(actionUrl, $('#searchForm select[name=afLinkCd]'), "[전체]");
+		}
+	});
+	
+	// 검색
+	$('#btnSearch').on('click', function() {
+		// 입력 값 체크
+		if (!gagajf.validation($('#searchForm')))
+			return false;
+		
+		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm', fnCreateTotal);
+	});
+	
+	// 합계 생성
+	let fnCreateTotal = function() {
+		let sellAmt = 0;
+		let cpnDcAmt = 0;
+		let pntDcAmt = 0;
+		let gfcdUseAmt = 0;
+		let payAmt = 0;
+		let salesAmt = 0;
+
+		gridOptions.api.forEachNode(function(rowNode, index) {
+			if (!rowNode.group) {
+				if (typeof rowNode.data.sellAmt == 'number') { sellAmt += rowNode.data.sellAmt; }
+				if (typeof rowNode.data.cpnDcAmt == 'number') { cpnDcAmt += rowNode.data.cpnDcAmt; }
+				if (typeof rowNode.data.pntDcAmt == 'number') { pntDcAmt += rowNode.data.pntDcAmt; }
+				if (typeof rowNode.data.gfcdUseAmt == 'number') { gfcdUseAmt += rowNode.data.gfcdUseAmt; }
+				if (typeof rowNode.data.payAmt == 'number') { payAmt += rowNode.data.payAmt; }
+				if (typeof rowNode.data.salesAmt == 'number') { salesAmt += rowNode.data.salesAmt; }
+			}
+		});
+
+		let data = {
+			grouping: '합계', afChannelNm: null, afLinkNm: null,
+			occurDt: null, ordNo: null, ordDtlStat: null,
+			sellAmt: sellAmt, cpnDcAmt: cpnDcAmt,
+			pntDcAmt: pntDcAmt, gfcdUseAmt: gfcdUseAmt,
+			payAmt: payAmt, salesAmt: salesAmt
+		};
+
+		gagaAgGrid.setPinnedRowData(gridOptions, data, 'top');
+	}
+	
+	// 엑셀다운로드
+	$('#btnExcel').on('click', function() {
+		gagaAgGrid.exportToExcel('제휴채널정산 목록', gridOptions);
+	});
+	
+	$(document).ready(function() {
+		cfnCreateCalendar('#terms', 'startDt', 'endDt', true, '발생(정산)');
+		$('.btnToday').trigger('click');
+		
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+	});
+/*]]>*/
+</script>
+
+</html>

+ 28 - 2
src/main/webapp/WEB-INF/views/system/UserDetailForm.html

@@ -75,6 +75,10 @@
 								<option th:if="${sessionInfo.vendorId == null}" value="">[선택]</option>
 								<option th:if="${vendorList}" th:each="oneData, status : ${vendorList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
 							</select>
+							<select name="afLinkCd" style="display: none">
+								<option th:if="${sessionInfo.afLinkCd == null}" value="">[선택]</option>
+								<option th:if="${afLinkList}" th:each="oneData, status : ${afLinkList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+							</select>
 						</td>
 					</tr>
 					<tr>
@@ -90,7 +94,7 @@
 					<tr>
 						<th>포인트부여가능금액</th>
 						<td>
-							<input type="text" name="pntAssignAmt" placeholder="" maxlength="6" data-valid-type="integer" data-valid-name="포인트부여가능금액"/>
+							<input type="text" name="pntAssignAmt" class="aR" placeholder="" maxlength="6" data-valid-type="integer" data-valid-name="포인트부여가능금액"/>
 						</td>
 						<th>IP주소</th>
 						<td>
@@ -183,6 +187,10 @@
 								<option th:if="${sessionInfo.vendorId == null}" value="">[선택]</option>
 								<option th:if="${vendorList}" th:each="oneData, status : ${vendorList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}" th:selected="${userInfo.roleRefVal == oneData.cd}"></option>
 							</select>
+							<select name="afLinkCd" style="display: none">
+								<option th:if="${sessionInfo.afLinkCd == null}" value="">[선택]</option>
+								<option th:if="${afLinkList}" th:each="oneData, status : ${afLinkList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+							</select>
 						</td>
 					</tr>
 					<tr>
@@ -288,14 +296,22 @@
 		if (abRoleCd == 'G001_A' || abRoleCd == 'G001_B') { // 입점업체
 			$('#userRegisterForm select[name=supplyCompCd]').show();
 			$('#userRegisterForm select[name=vendorId]').hide();
+			$('#userRegisterForm select[name=afLinkCd]').hide();
 			$('#registerRoleRefVal').text('업체');
 		} else if (abRoleCd == 'G001_C') { // 외부몰벤더
 			$('#userRegisterForm select[name=supplyCompCd]').hide();
 			$('#userRegisterForm select[name=vendorId]').show();
+			$('#userRegisterForm select[name=afLinkCd]').hide();
 			$('#registerRoleRefVal').text('외부몰벤더');
-		} else {
+		} else if (abRoleCd == 'G001_D') { // 제휴채널
 			$('#userRegisterForm select[name=supplyCompCd]').hide();
 			$('#userRegisterForm select[name=vendorId]').hide();
+			$('#userRegisterForm select[name=afLinkCd]').show();
+			$('#registerRoleRefVal').text('제휴채널');
+		} else { // 외부몰벤더
+			$('#userRegisterForm select[name=supplyCompCd]').hide();
+			$('#userRegisterForm select[name=vendorId]').hide();
+			$('#userRegisterForm select[name=afLinkCd]').hide();
 			$('#registerRoleRefVal').text('');
 		}
 	});
@@ -387,14 +403,22 @@
 		if (abRoleCd == 'G001_A' || abRoleCd == 'G001_B') { // 입점업체
 			$('#userDetailForm select[name=supplyCompCd]').show();
 			$('#userDetailForm select[name=vendorId]').hide();
+			$('#userDetailForm select[name=afLinkCd]').hide();
 			$('#detailRoleRefVal').text('업체');
 		} else if (abRoleCd == 'G001_C') { // 외부몰벤더
 			$('#userDetailForm select[name=supplyCompCd]').hide();
 			$('#userDetailForm select[name=vendorId]').show();
+			$('#userDetailForm select[name=afLinkCd]').hide();
 			$('#detailRoleRefVal').text('외부몰벤더');
+		} else if (abRoleCd == 'G001_D') { // 제휴채널
+			$('#userDetailForm select[name=supplyCompCd]').hide();
+			$('#userDetailForm select[name=vendorId]').hide();
+			$('#userDetailForm select[name=afLinkCd]').show();
+			$('#detailRoleRefVal').text('제휴채널');
 		} else {
 			$('#userDetailForm select[name=supplyCompCd]').hide();
 			$('#userDetailForm select[name=vendorId]').hide();
+			$('#userDetailForm select[name=afLinkCd]').hide();
 			$('#detailRoleRefVal').text('');
 		}
 	});
@@ -458,6 +482,8 @@
 					$(formId + ' input[name=roleRefVal]').val($(formId + ' select[name=supplyCompCd]').val());
 				} else if (abRoleCd == 'G001_C') { // 외부몰벤더
 					$(formId + ' input[name=roleRefVal]').val($(formId + ' select[name=vendorId]').val());
+				} else if (abRoleCd == 'G001_D') { // 제휴채널
+					$(formId + ' input[name=roleRefVal]').val($(formId + ' select[name=afLinkCd]').val());
 				} else {
 					$(formId + ' input[name=roleRefVal]').val('');
 				}

+ 6 - 0
src/main/webapp/WEB-INF/views/system/UserForm.html

@@ -130,6 +130,12 @@
 		{headerName: "권한관련값", field: "roleRefVal", width: 150, cellClass: 'text-center', hide: true},
 		{headerName: "업체", field: "supplyCompNm", width: 150, cellClass: 'text-center'},
 		{headerName: "외부몰벤더", field: "vendorNm", width: 150, cellClass: 'text-center'},
+		{
+			headerName: "제휴채널", field: "afLinkNm", width: 120, cellClass: 'text-center',
+			cellRenderer: function(params) {
+				return params.data.roleCd.indexOf('G001_D') > -1 ? params.data.afChannelNm + '-' + params.value : '';
+			}
+		},
 		{headerName: "이메일", field: "email", width: 200, cellClass: 'text-center'},
 		{headerName: "휴대전화번호", field: "cellPhnno", width: 150, cellClass: 'text-center'},
 		{headerName: "IP주소", field: "ipAddr", width: 100, cellClass: 'text-center'},

+ 3 - 3
src/main/webapp/ux/js/admin.popup.js

@@ -377,9 +377,9 @@ var cfnOpenPointDetailPopup = function(callbackfun, siteCd, custNo) {
  * @author : LMC
  */
 function cfnCouponCreatePopup(cpnId, callbackfun){
-	var actionUrl = "/marketing/coupon/popup/form";
-	if (typeof(callbackfun) != 'undefined') actionUrl += "?callBackFun=" + callbackfun;
-	cfnOpenModalPopup(actionUrl,'CouponCreatePopup');
+	var actionUrl = "/marketing/coupon/popup/form?cpnId=" + cpnId;
+	if (typeof(callbackfun) != 'undefined') actionUrl += "&callBackFun=" + callbackfun;
+	cfnOpenModalPopup(actionUrl,'CouponRegForm');
 }
 
 

+ 1 - 1
src/main/webapp/ux/js/admin.ui.js

@@ -3,7 +3,7 @@ function uifnAlertClose(id){
 	$("#"+id).css({display:'none'});
 	return true;
 };
-
+ 
 //차트 리사이징
 function chartResize(){
 	if ( $(document).find(".chartUnit").length > 0 ) {

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.