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

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

xodud lee 5 лет назад
Родитель
Сommit
f62fd5f296
20 измененных файлов с 1318 добавлено и 164 удалено
  1. 11 0
      src/main/java/com/style24/persistence/domain/Brand.java
  2. 51 0
      src/main/java/com/style24/persistence/domain/Category.java
  3. 46 4
      src/main/java/com/style24/persistence/domain/Coupon.java
  4. 11 0
      src/main/java/com/style24/persistence/domain/SupplyCompany.java
  5. 31 5
      src/main/java/com/style24/persistence/mybatis/shop/TssBusiness.xml
  6. 93 0
      src/main/java/com/style24/persistence/mybatis/shop/TssDisplay.xml
  7. 12 0
      src/main/java/com/style24/persistence/mybatis/shop/TssRenderer.xml
  8. 12 0
      src/main/java/com/style24/scm/biz/dao/TssDisplayDao.java
  9. 8 0
      src/main/java/com/style24/scm/biz/dao/TssRendererDao.java
  10. 13 0
      src/main/java/com/style24/scm/biz/service/TssDisplayService.java
  11. 11 0
      src/main/java/com/style24/scm/biz/service/TssRendererService.java
  12. 42 0
      src/main/java/com/style24/scm/biz/web/TssBusinessController.java
  13. 67 0
      src/main/java/com/style24/scm/biz/web/TssDisplayController.java
  14. 48 5
      src/main/java/com/style24/scm/biz/web/TssMarketingController.java
  15. 152 0
      src/main/webapp/WEB-INF/views/business/BrandPopupForm.html
  16. 152 0
      src/main/webapp/WEB-INF/views/business/SupplyCompanyPopupForm.html
  17. 193 0
      src/main/webapp/WEB-INF/views/display/CategorySearchForm.html
  18. 240 144
      src/main/webapp/WEB-INF/views/marketing/CouponPopupForm.html
  19. 72 0
      src/main/webapp/WEB-INF/views/marketing/CouponPubCustListPopupForm.html
  20. 53 6
      src/main/webapp/ux/js/admin.popup.js

+ 11 - 0
src/main/java/com/style24/persistence/domain/Brand.java

@@ -1,5 +1,6 @@
 package com.style24.persistence.domain;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.style24.persistence.TscBaseDomain;
 
 import lombok.Data;
@@ -46,5 +47,15 @@ public class Brand extends TscBaseDomain {
 	// 검색조건
 	private String searchTxt;		// 검색어
 	private String callbackFn;	// 콜백함수
+	private String multiGb;			// 멀티 셀렉트 구분
+	private String searchBrandCd;
+	private String searchBrandNm;
 
+	/* 브랜드검색 Multi CheckBox 항목*/
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiBrandCd;
+
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiBrandNm;
+	/* 브랜드검색 Multi CheckBox 항목*/
 }

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

@@ -0,0 +1,51 @@
+package com.style24.persistence.domain;
+
+import com.style24.persistence.TscBaseDomain;
+import lombok.Data;
+
+/**
+ * 카테고리 Domain
+ *
+ * @author
+ * @since 2021. 5. 21
+ */
+@SuppressWarnings("serial")
+@Data
+public class Category extends TscBaseDomain {
+    private Integer cateNo;		// 카테고리번호
+    private String cateNm;		// 카테고리명
+    private String cateGb;		// 카테고리구분
+    private String leafCateNo;	// 단말카테고리번호
+    private String cateType;	// 카테고리유형
+    private Integer cate1No;	// 카테고리1번호
+    private String cate1Nm;		// 카테고리1명
+    private Integer cate2No;	// 카테고리2번호
+    private String cate2Nm;		// 카테고리2명
+    private Integer cate3No;	// 카테고리3번호
+    private String cate3Nm;		// 카테고리3명
+    private Integer cate4No;	// 카테고리4번호
+    private String cate4Nm;		// 카테고리4명
+    private Integer cate5No;	// 카테고리5번호
+    private String cate5Nm;		// 카테고리5명
+    private String leafYn;		// 단말여부
+    private String formalGb;	// 정상이월구분
+    private String contentsLoc;	// 컨텐츠위치
+    private Integer dispOrd;	// 표시순서
+    private String dispYn;		// 노출여부
+    private String useYn;		// 사용여부
+
+    private String clocPrefix;      // 메인전시 컨텐츠 위치 프리픽스
+//	private String brandGrpNm;
+
+    // 검색조건
+    private String siteCd;		// 사이트코드
+    private Integer selLvl;		// 선택레벨
+    private String callBackFun;	// 콜백함수
+
+    // 품목카테고리매핑관리 화면에서 사용
+    private String fullCateNo;	// FULL카테고리번호
+    private String fullCateNm;	// FULL카테고리명
+    private Integer clsLvl;		// 분류레벨
+    private String treePath;	// AG-GRID트리패스(ag-Grid미사용시 필요 없음)
+
+}

+ 46 - 4
src/main/java/com/style24/persistence/domain/Coupon.java

@@ -1,22 +1,24 @@
 package com.style24.persistence.domain;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.style24.core.support.util.CryptoUtils;
 import com.style24.persistence.TscBaseDomain;
 import com.style24.persistence.TscPageRequest;
 import lombok.Data;
 
+import java.util.List;
+
 @SuppressWarnings("serial")
 @Data
 public class Coupon extends TscBaseDomain {
     // TB_COUPON
-    private int    cpnId;					// 쿠폰ID
+    private Integer cpnId;					// 쿠폰ID
     private String cpnNm;					// 쿠폰명
     private String siteCd;					// 사이트코드(공통코드G000)
     private String afLinkCd;				// 제휴링크코드
     private String usableCustGb;			// 사용가능고객구분(공통코드G100)
     private String usableCustGrade;		    // 사용가능고객등급(공통코드G110)
     private String cpnType;				    // 쿠폰유형(공통코드G230)
-    private String cpnTarget;               // 쿠폰대상(공통코드G260)
     private String applyScope;				// 적용범위(A:전체, I:개별). "I:개별"이고 쿠폰유형이 "20:장바구니쿠폰" 외 이면 TB_COUPON_REFVAL 참조
     private String dcWay;					// 할인방식(공통코드G240)
     private int    dcPval;					// 할인값(PC). 할인방식이 금액이면 할인금액, 율이면 할인율
@@ -26,8 +28,6 @@ public class Coupon extends TscBaseDomain {
     private String pdGb;					// 기간/일수구분(P:기간, D:일수)
     private String availStdt;				// 유효시작일시(기간/일수구분 "P:기간"일 때 사용됨)
     private String availEddt;				// 유효종료일시(기간/일수구분 "P:기간"일 때 사용됨)
-    private String availStdtTime;			// 유효시작일시(시분초까지)
-    private String availEddtTime;			// 유효종료일시(시분초까지)
     private int    availDays;				// 유효일수(기간/일수구분 "D:일수"일 때 사용됨)
     private int    custPubLimitQty;		    // 고객당발행제한수량(0은 무제한)
     private int    totPubLimitQty;			// 총발행제한수량(0은 무제한)
@@ -57,7 +57,49 @@ public class Coupon extends TscBaseDomain {
 
     private String supplyCompCd;
     private String mdNo;
+
+    private int custNo;
     private String custNm;
+    private String custGbNm;
+    private String custGradeNm;
+    private String useYn;
+    private String usedDt;
+    private String pubReason;
+    private String pubReasonNm;
+    private String pubReasonDtl;
+    private String refVal;
+    private String secondRefVal;
+    private String useCondition;
+    private String issueCondition;
+    private String expireYn;
+    private int cpnCnt;
+    private String tgtCondition;
+    private String quickYn;
+
+    List<CouponRefval> supplyCompList;          // 공급업체 리스트
+    List<CouponRefval> brandList;               // 브랜드 리스트
+    List<CouponRefval> applyGoodsList;          // 적용상품 리스트
+    List<CouponRefval> exceptGoodsList;         // 제외상품 리스트
+    List<CouponRefval> cateList;                // 카테고리 리스트
+    List<CouponBurden> burdenList;              // 업체 분담율 리스트
+
+    // TB_COUPON_BAN_GOODS
+    private int    cpnBanGoodsSq;           //  제외상품시퀀스
+    private String cpnDesc;             // 쿠폰설명
+
+    private String scmYn;
+
+    // 사용가능고객구분
+    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+    private String[] usableCustGbArr;
+
+    // 사용가능고객등급
+    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+    private String[] usableCustGradeArr;
+
+    // 결제수단
+    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+    private String[] payTypeArr;
 
     // Pagination
     private TscPageRequest pageable;

+ 11 - 0
src/main/java/com/style24/persistence/domain/SupplyCompany.java

@@ -1,5 +1,6 @@
 package com.style24.persistence.domain;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.style24.persistence.TscBaseDomain;
 
 import lombok.Data;
@@ -57,5 +58,15 @@ public class SupplyCompany extends TscBaseDomain {
 	private String searchGb;			// 검색구분
 	private String searchTxt;			// 검색어
 	private String multiGb;
+	private String callbackFn;			// 콜백함수
+	private String searchSupplyCompCd;
+	private String searchSupplyCompNm;
 
+	/* 업체검색 Multi CheckBox 항목*/
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiSupplyCompCd;
+
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiSupplyCompNm;
+	/* 업체검색 Multi CheckBox 항목*/
 }

+ 31 - 5
src/main/java/com/style24/persistence/mybatis/shop/TssBusiness.xml

@@ -257,7 +257,11 @@
 		     , A.PNT_MRATE20                 /*포인트적립율(모바일)*/
 		     , A.LOGO_FILE_NM                 /*로고파일명*/
 		     , A.DISP_ORD                    /*표시순서*/
+		     , (CASE WHEN D.DISP_NM_LANG = 'EN' THEN D.BRAND_GROUP_ENM ELSE D.BRAND_GROUP_KNM END) AS BRAND_GROUP_NM
+		     , A.BRAND_GROUP_NO
 		FROM   TB_BRAND A
+		INNER JOIN TB_BRAND_GROUP D ON A.BRAND_GROUP_NO = D.BRAND_GROUP_NO
+		                            AND D.USE_YN = 'Y'
 		<if test='supplyCompCd != null and supplyCompCd != ""'>
 		INNER JOIN TB_BRAND_SUPPLY C ON A.BRAND_CD = C.BRAND_CD
 		INNER JOIN TB_SUPPLY_COMPANY B ON C.SUPPLY_COMP_CD = B.SUPPLY_COMP_CD
@@ -275,20 +279,42 @@
 		<if test='brandCd != null and brandCd != ""'>
 		AND    A.BRAND_CD = #{brandCd}
 		</if>
-		<if test='searchTxt != null and searchTxt != ""'>
+		<if test="searchTxt != null and searchTxt != ''">
 		AND    (
-		        A.BRAND_CD LIKE CONCAT('%',#{searchTxt},'%')
-		        OR
 		        UPPER(A.BRAND_ENM) LIKE CONCAT('%',UPPER(#{searchTxt}),'%')
 		        OR
 		        UPPER(A.BRAND_KNM) LIKE CONCAT('%',UPPER(#{searchTxt}),'%')
 		        OR
-		        UPPER(A.BRAND_GRP_NM) LIKE CONCAT('%',UPPER(#{searchTxt}),'%')
-		       )
+		        UPPER(A.BRAND_CD) LIKE CONCAT('%',UPPER(#{searchTxt}),'%')
+		        OR
+		        UPPER(D.BRAND_GROUP_KNM) LIKE CONCAT('%',UPPER(#{searchTxt}),'%')
+		        OR
+		        UPPER(D.BRAND_GROUP_ENM) LIKE CONCAT('%',UPPER(#{searchTxt}),'%')
+		)
+		</if>
+		<if test="multiBrandCd != null and multiBrandCd.length > 0">
+		    AND    A.BRAND_CD IN
+		    <foreach collection="multiBrandCd" item="item" index="index"  open="(" close=")" separator=",">
+		        UPPER(#{item})
+		    </foreach>
+		</if>
+		<if test="multiBrandNm != null and multiBrandNm.length > 0">
+		    AND (
+		    <foreach collection="multiBrandNm" item="item" index="index" separator="or">
+		        (
+		        UPPER(A.BRAND_ENM) LIKE CONCAT('%',UPPER(#{item}),'%')
+		        OR
+		        UPPER(A.BRAND_KNM) LIKE CONCAT('%',UPPER(#{item}),'%')
+		        )
+		    </foreach>
+		    )
 		</if>
 		<if test='useYn != null and useYn != ""'>
 		AND    A.USE_YN = #{useYn}
 		</if>
+		<if test='selfYn != null and selfYn != ""'>
+		AND    A.SELF_YN = #{selfYn}
+		</if>
 		ORDER  BY A.SELF_YN DESC,  A.DISP_ORD
 	</select>
 	

+ 93 - 0
src/main/java/com/style24/persistence/mybatis/shop/TssDisplay.xml

@@ -121,5 +121,98 @@
 		</otherwise>
 		</choose>
 	</delete>
+
+	<!-- 카테고리 목록 -->
+	<select id="getCategoryList" parameterType="Category" resultType="Category">
+		/* TsaDisplay.getCategoryList */
+		<if test='selLvl != null and selLvl != ""'>
+			SELECT SITE_CD                 /*사이트코드*/
+			, CATE_GB                 /*카테고리구분*/
+			<if test='selLvl == 1'>
+				, CATE1_NO
+				, NULL     AS CATE2_NO
+				, NULL     AS CATE3_NO
+				, NULL     AS CATE4_NO
+				, NULL     AS CATE5_NO
+				, CATE1_NO AS CATE_NO     /*카테고리번호*/
+				, CATE1_NM AS CATE_NM     /*카테고리명*/
+			</if>
+			<if test='selLvl == 2'>
+				, CATE2_NO
+				, NULL     AS CATE3_NO
+				, NULL     AS CATE4_NO
+				, NULL     AS CATE5_NO
+				, CATE2_NO AS CATE_NO     /*카테고리번호*/
+				, CATE2_NM AS CATE_NM     /*카테고리명*/
+			</if>
+			<if test='selLvl == 3'>
+				, CATE2_NO
+				, CATE3_NO
+				, NULL     AS CATE4_NO
+				, NULL     AS CATE5_NO
+				, CATE3_NO AS CATE_NO     /*카테고리번호*/
+				, CATE3_NM AS CATE_NM     /*카테고리명*/
+			</if>
+			<if test='selLvl == 4'>
+				, CATE2_NO
+				, CATE3_NO
+				, CATE4_NO
+				, NULL     AS CATE5_NO
+				, CATE4_NO AS CATE_NO     /*카테고리번호*/
+				, CATE4_NM AS CATE_NM     /*카테고리명*/
+			</if>
+			<if test='selLvl == 5'>
+				, CATE2_NO
+				, CATE3_NO
+				, CATE4_NO
+				, CATE5_NO
+				, CATE5_NO AS CATE_NO     /*카테고리번호*/
+				, CATE5_NM AS CATE_NM     /*카테고리명*/
+			</if>
+			, CATE_TYPE               /*카테고리유형*/
+			, LEAF_YN                 /*단말여부*/
+			, DISP_ORD                /*노출순서*/
+			, FORMAL_GB               /*정상이월구분*/
+			, CONTENTS_LOC            /*컨텐츠위치*/
+			, DISP_YN                 /*전시여부*/
+			, USE_YN                  /*사용여부*/
+			<if test='selLvl == 1'>
+				FROM   TB_CATE1
+				WHERE  SITE_CD = #{siteCd}
+				AND    CATE_GB = #{cateGb}
+			</if>
+			<if test='selLvl == 2'>
+				FROM   TB_CATE2
+				WHERE  SITE_CD = #{siteCd}
+				AND    CATE_GB = #{cateGb}
+				AND    CATE1_NO = #{cate1No}
+			</if>
+			<if test='selLvl == 3'>
+				FROM   TB_CATE3
+				WHERE  SITE_CD = #{siteCd}
+				AND    CATE_GB = #{cateGb}
+				AND    CATE1_NO = #{cate1No}
+				AND    CATE2_NO = #{cate2No}
+			</if>
+			<if test='selLvl == 4'>
+				FROM   TB_CATE4
+				WHERE  SITE_CD = #{siteCd}
+				AND    CATE_GB = #{cateGb}
+				AND    CATE1_NO = #{cate1No}
+				AND    CATE2_NO = #{cate2No}
+				AND    CATE3_NO = #{cate3No}
+			</if>
+			<if test='selLvl == 5'>
+				FROM   TB_CATE5
+				WHERE  SITE_CD = #{siteCd}
+				AND    CATE_GB = #{cateGb}
+				AND    CATE1_NO = #{cate1No}
+				AND    CATE2_NO = #{cate2No}
+				AND    CATE3_NO = #{cate3No}
+				AND    CATE4_NO = #{cate4No}
+			</if>
+			ORDER  BY DISP_ORD
+		</if>
+	</select>
 	
 </mapper>

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

@@ -369,4 +369,16 @@
 		AND    USE_YN = 'Y'
 	</select>
 
+	<!-- 자사브랜드 조회-->
+	<select id="getSelfBrandList" resultType="CommonCode">
+		/* TsaRenderer.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>
+
 </mapper>

+ 12 - 0
src/main/java/com/style24/scm/biz/dao/TssDisplayDao.java

@@ -1,8 +1,11 @@
 package com.style24.scm.biz.dao;
 
 import com.style24.core.support.annotation.ShopDs;
+import com.style24.persistence.domain.Category;
 import com.style24.persistence.domain.GoodsCategory;
 
+import java.util.Collection;
+
 /**
  * 전시 Dao
  *
@@ -19,4 +22,13 @@ public interface TssDisplayDao {
 	 * @since 2021. 1. 18
 	 */
 	void deleteGoodsCategory(GoodsCategory goodsCategory);
+
+	/**
+	 * 카테고리 목록
+	 * @param category - 카테고리 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 4
+	 */
+	Collection<Category> getCategoryList(Category category);
 }

+ 8 - 0
src/main/java/com/style24/scm/biz/dao/TssRendererDao.java

@@ -224,4 +224,12 @@ public interface TssRendererDao {
 	 */
 	Collection<CommonCode> getAflinkList(AflinkFee aflinkFee);
 
+	/**
+	 * 자사브랜드 조회
+	 * @param
+	 * @author xyzp1539
+	 * @since  2021-01-14
+	 */
+	Collection<CommonCode> getSelfBrandList();
+
 }

+ 13 - 0
src/main/java/com/style24/scm/biz/service/TssDisplayService.java

@@ -1,5 +1,6 @@
 package com.style24.scm.biz.service;
 
+import com.style24.persistence.domain.Category;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -9,6 +10,8 @@ import com.style24.scm.biz.dao.TssDisplayDao;
 
 import lombok.extern.slf4j.Slf4j;
 
+import java.util.Collection;
+
 /**
  * 전시 Service
  *
@@ -27,4 +30,14 @@ public class TssDisplayService {
 		displayDao.deleteGoodsCategory(goodsCategory);
 	}
 
+	/**
+	 * 카테고리 목록
+	 * @param category - 카테고리 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 4
+	 */
+	public Collection<Category> getCategoryList(Category category) {
+		return displayDao.getCategoryList(category);
+	}
 }

+ 11 - 0
src/main/java/com/style24/scm/biz/service/TssRendererService.java

@@ -502,4 +502,15 @@ public class TssRendererService {
 		return rendererDao.getAflinkList(aflinkFee);
 	}
 
+	/**
+	 * 자사브랜드 조회
+	 * @param
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 8
+	 */
+	public Collection<CommonCode> getSelfBrandList() {
+		return rendererDao.getSelfBrandList();
+	}
+
 }

+ 42 - 0
src/main/java/com/style24/scm/biz/web/TssBusinessController.java

@@ -2,6 +2,7 @@ package com.style24.scm.biz.web;
 
 import java.util.Collection;
 
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -193,7 +194,48 @@ public class TssBusinessController extends TssBaseController {
 	@PostMapping("/brand/list")
 	@ResponseBody
 	public Collection<Brand> getBrandList(Brand brand) {
+		log.info("getBrandList>>>>{}",brand);
+		// multi row 검색관련 처리
+		if (!StringUtils.isBlank(brand.getSearchBrandCd())) {
+			brand.setMultiBrandCd(brand.getSearchBrandCd().replaceAll("\r", "").trim().split("\n"));
+		}
+		if (!StringUtils.isBlank(brand.getSearchBrandNm())) {
+			brand.setMultiBrandNm(brand.getSearchBrandNm().replaceAll("\r", "").trim().split("\n"));
+		}
+
 		return businessService.getBrandList(brand);
 	}
 
+	/**
+	 * 공급업체 목록 화면(팝업)
+	 * @param brandMd - 담당MD 정보
+	 * @return
+	 * @author xodud1202
+	 * @since 2020. 12. 23
+	 */
+	@GetMapping("/comapny/search/form")
+	public ModelAndView companySearchForm(SupplyCompany company) {
+		ModelAndView mav = new ModelAndView();
+		log.info("company={}", company);
+		mav.addObject("params", company);
+		mav.setViewName("business/SupplyCompanyPopupForm");
+		return mav;
+	}
+
+	/**
+	 * 브랜드 목록 화면(팝업)
+	 * @param brand - 담당MD 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 11. 4
+	 */
+	@GetMapping("/brand/search/form")
+	public ModelAndView brandSearchForm(Brand brand) {
+		ModelAndView mav = new ModelAndView();
+
+		mav.addObject("params", brand);
+		mav.setViewName("business/BrandPopupForm");
+		return mav;
+	}
+
 }

+ 67 - 0
src/main/java/com/style24/scm/biz/web/TssDisplayController.java

@@ -0,0 +1,67 @@
+package com.style24.scm.biz.web;
+
+import com.style24.scm.biz.service.TssDisplayService;
+import com.style24.scm.biz.service.TssRendererService;
+import com.style24.scm.support.controller.TssBaseController;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+import com.style24.persistence.domain.Category;
+
+import java.util.Collection;
+
+
+/**
+ * 전시 Controller
+ *
+ * @author
+ * @since 2021. 5. 21
+ */
+@Controller
+@RequestMapping("/display")
+@Slf4j
+public class TssDisplayController extends TssBaseController {
+	@Autowired
+	private TssRendererService rendererService;
+
+	@Autowired
+	private TssDisplayService displayService;
+
+	/**
+	 * 카테고리 목록 화면(팝업)
+	 * @param category
+	 * @return
+	 * @author xyzp1539
+	 * @since 2021. 01. 11
+	 */
+	@GetMapping("/category/popup/form")
+	public ModelAndView categorySearchForm(Category category) {
+		ModelAndView mav = new ModelAndView();
+
+		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.addObject("params", category);
+
+		mav.setViewName("display/CategorySearchForm");
+		return mav;
+	}
+
+	/**
+	 * 카테고리 목록
+	 * @param category - 카테고리 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 4
+	 */
+	@PostMapping("/category/list")
+	@ResponseBody
+	public Collection<Category> getCategoryList(@RequestBody Category category) {
+		return displayService.getCategoryList(category);
+	}
+
+}

+ 48 - 5
src/main/java/com/style24/scm/biz/web/TssMarketingController.java

@@ -635,6 +635,10 @@ public class TssMarketingController extends TssBaseController {
 	public ModelAndView couponCreatePopup(@RequestParam(value = "mode") String mode, @RequestParam(value = "cpnId", required = false) Integer cpnId) {
 		ModelAndView mav = new ModelAndView();
 		log.info("[couponCreatePopup]",cpnId);
+		// 입점업체담당자는 업체코드 설정
+		if ("G001_B000".equals(TssSession.getInfo().getRoleCd())) {
+//			param.setRegNo(TssSession.getInfo().getUserNo());
+		}
 		String num = "";
 		int issueCnt = 0;
 
@@ -677,15 +681,15 @@ public class TssMarketingController extends TssBaseController {
 		String[] exceptCds = {"G008_00"};
 		mav.addObject("goodsStatList", rendererService.getCommonCodeList("G008", "Y", exceptCds));
 		// 입점업체 조회
-//		mav.addObject("ibSupplyCompList", rendererService.getSupplyCompanyList("", "N"));
+		mav.addObject("ibSupplyCompList", rendererService.getSupplyCompanyList(TssSession.getInfo().getSupplyCompCd()));
 		// 할인 쿠폰 코드 조회
 //		mav.addObject("dcCdList", rendererService.getCommonCodeList("G233", "Y"));
 		// 정상/이월 조회
-//		mav.addObject("formalGbList", rendererService.getCommonCodeList("G009"));
+		mav.addObject("formalGbList", rendererService.getCommonCodeList("G009"));
 		// 카테고리 구분 조회
 		mav.addObject("cateGbList", rendererService.getCommonCodeList("G032"));
 		// 자사 브랜드 조회
-		mav.addObject("selfBrandList", null); //rendererService.getSelfBrandList()
+		mav.addObject("selfBrandList", rendererService.getSelfBrandList());
 		// 사이트코드 조회
 		mav.addObject("siteCdList", rendererService.getCommonCodeList("G000"));
 		// 쿠폰상태 조회
@@ -720,7 +724,7 @@ public class TssMarketingController extends TssBaseController {
 			// 쿠폰상세조회
 			mav.addObject("cpnDetail", coreCouponService.getCouponDetail(cpnId));
 			// 쿠폰적용대상 - 공급업체 조회
-//			mav.addObject("cpnDtlRefvalSupplyCompList", coreCouponService.getCouponRefvalSupplyCompList(cpnId));
+			mav.addObject("cpnDtlRefvalSupplyCompList", coreCouponService.getCouponRefvalSupplyCompList(cpnId));
 			// 쿠폰적용대상 - 적용상품 조회
 			mav.addObject("cpnDtlRefvalApplyGoodsList", coreCouponService.getCouponRefvalGoodsList(cpnId, "G260_10"));
 			// 쿠폰적용대상 - 카테고리 조회
@@ -730,7 +734,7 @@ public class TssMarketingController extends TssBaseController {
 			// 쿠폰적용대상 - 제외상품 조회
 			mav.addObject("cpnDtlRefvalExceptGoodsList", coreCouponService.getCouponRefvalGoodsList(cpnId, "G260_14"));
 			// 쿠폰 입점업체분담율 조회
-//			mav.addObject("cpnDtlBurdenList", coreCouponService.getCouponBurdenList(cpnId));
+			mav.addObject("cpnDtlBurdenList", coreCouponService.getCouponBurdenList(cpnId));
 			// 시리얼 및 난수 쿠폰 조회
 //			mav.addObject("randomCpnList", coreCouponService.getRandomCouponInfo(cpnId));
 			// 쿠폰사용가능고객구분 조회
@@ -753,5 +757,44 @@ public class TssMarketingController extends TssBaseController {
 		mav.setViewName("marketing/CouponPopupForm");
 		return mav;
 	}
+
+	/**
+	 * 쿠폰 저장
+	 * @param coupon - 쿠폰 정보
+	 * @return
+	 * @author xyzp1539
+	 * @since 2021. 1. 11
+	 */
+	@PostMapping("/coupon/save")
+	@ResponseBody
+	public GagaResponse saveCoupon(@RequestBody Coupon coupon) {
+		log.info("couponSave : {}", coupon);
+		coupon.setRegNo(TssSession.getInfo().getUserNo());
+		coupon.setUpdNo(TssSession.getInfo().getUserNo());
+		String result = coreCouponService.saveCoupon(coupon);
+		if (!"SUCCESS".equals(result)) {
+			return super.error(message.getMessage(result));
+		}
+
+		return super.ok(message.getMessage("SUCC_0001"));
+	}
+
+	/**
+	 * 쿠폰발급받은 회원리스트 팝업
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @since 2021-02-03
+	 */
+	@GetMapping("/coupon/pubCust/popup/form")
+	@ResponseBody
+	public ModelAndView couponPubCustListPopup(@RequestParam(value = "cpnId", required = true) Integer cpnId) {
+		ModelAndView mav = new ModelAndView();
+
+		mav.addObject("cpnPubCustList", coreCouponService.getCpnPubCustList(cpnId));
+
+		mav.setViewName("marketing/CouponPubCustListPopupForm");
+		return mav;
+	}
    
 }

+ 152 - 0
src/main/webapp/WEB-INF/views/business/BrandPopupForm.html

@@ -0,0 +1,152 @@
+<!DOCTYPE html>
+<html lang="ko"
+	  xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : BrandPopupForm.html
+ * @desc    : 브랜드 팝업 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2020.12.15   eskim       최초 작성
+ *******************************************************************************
+ -->
+<div class="modalPopup" data-width="650" id="popupBrandList">
+	<div class="panelStyle"  style="max-height:700px;overflow-y:scroll;">
+		<!-- TITLE -->
+		<div class="panelTitle">
+			<strong>브랜드 목록</strong>
+			<button type="button" class="close" onclick="uifnPopupClose('popupBrandList');"><em class="fa fa-times"></em></button>
+		</div>
+		<!-- //TITLE -->
+		<!-- 검색 조건 -->
+		<div class="panelContent">
+			<form id="searchBrandListForm" name="searchBrandListForm" action="#" th:action="@{'/business/brand/list'}" onsubmit="$('#btnSearchBrandList').trigger('click'); return false;">
+				<table class="frmStyle" aria-describedby="검색조건">
+					<colgroup>
+						<col style="width:15%;"/>
+						<col style="width:35%;"/>
+						<col style="width:15%;"/>
+						<col/>
+					</colgroup>
+					<tbody>
+					<tr>
+						<th>자사/입점</th>
+						<td colspan="3">
+							<select name="selfYn" id="selfYn">
+								<option value="">전체</option>
+								<option value="Y">자사</option>
+								<option value="N">입점</option>
+							</select>
+						</td>
+					</tr>
+					<tr>
+						<th>브랜드코드<i class="required" title="필수"></i></th>
+						<td>
+							<textarea class="textareaR2" name="searchBrandCd" id="searchBrandCd"></textarea>
+						</td>
+						<th>브랜드명<i class="required" title="필수"></i></th>
+						<td>
+							<textarea class="textareaR2" name="searchBrandNm" id="searchBrandNm"></textarea>
+						</td>
+					</tr>
+					</tbody>
+				</table>
+				<ul class="panelBar">
+					<li class="center">
+						<button type="button" class="btn btn-base btn-lg" id="btnSearchBrandList">조회</button>
+					</li>
+				</ul>
+			</form>
+			<!-- 리스트 영역 -->
+			<div class="panelContent">
+				<div id="gridBrandList" style="width: 100%; height: 380px" class="ag-theme-balham"></div>
+			</div>
+			<!-- //리스트 영역 -->
+
+			<!-- 버튼 배치 영역 -->
+			<ul class="panelBar">
+				<li class="right">
+					<button type="button" class="btn btn-info btn-lg" id="btnConfirmBrand">확인</button>
+				</li>
+			</ul>
+		</div>
+		<!-- //검색 조건 -->
+	</div>
+
+	<script th:inline="javascript">
+		/*<![CDATA[*/
+		let headerSelection = false;
+		if([[${params.multiGb}]] == "M") headerSelection = true;
+		let columnDefsMdList = [
+			{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: headerSelection, checkboxSelection: true, filter: false},
+			{headerName: "브랜드번호", field: "brandCd", width: 100, cellClass: 'text-center'},
+			{headerName: "브랜드국문명", field: "brandEnm", width: 150, cellClass: 'text-center'},
+			{headerName: "브랜드영문명", field: "brandKnm", width: 150, cellClass: 'text-center'},
+			{headerName: "브랜드그룹명", field: "brandGroupNm", width: 150, cellClass: 'text-center'}
+		];
+
+		let gridOptionsBrandList = gagaAgGrid.getGridOptions(columnDefsMdList);
+		if(headerSelection) {	gridOptionsBrandList.rowSelection = "multiple";	}
+
+		// Row double click
+		gridOptionsBrandList.onRowDoubleClicked = function(event) {
+			$('#btnConfirmBrand').trigger('click');
+		}
+
+		// 조회
+		$('#btnSearchBrandList').on('click', function() {
+
+			if (gagajf.isNull($('#searchBrandListForm textarea[name=searchBrandCd]').val())  && gagajf.isNull($('#searchBrandListForm textarea[name=searchBrandNm]').val())){
+				mcxDialog.alert('검색조건을 입력하세요.');
+				return false;
+			}
+
+			// Fetch data
+			gagaAgGrid.fetch($('#searchBrandListForm').prop('action'), gridOptionsBrandList, '#searchBrandListForm');
+		});
+
+		// 확인
+		$('#btnConfirmBrand').on('click', function() {
+			var selectedData = gagaAgGrid.selectedRowData(gridOptionsBrandList);
+
+			if (selectedData.length == 0) {
+				mcxDialog.alert('선택된 브랜드가 없습니다.');
+				return false;
+			}
+
+			var callbackFn = [[${params.callbackFn}]];
+
+			var jsonData = JSON.stringify(selectedData);
+
+			if (typeof callbackFn != 'undefined' && callbackFn) {
+				if (typeof callbackFn == 'function') {
+					callbackFn(jsonData);
+				} else {
+					if (callbackFn) {
+						if (callbackFn.indexOf("(") == -1) {
+							eval(callbackFn + "(" + jsonData + ")");
+						} else {
+							eval(callbackFn(jsonData));
+						}
+					}
+				}
+				uifnPopupClose('popupBrandList');
+			}
+		});
+
+		$(document).ready(function() {
+			// Create a agGrid
+			gagaAgGrid.createGrid('gridBrandList', gridOptionsBrandList);
+
+			//$('#btnSearchBrandList').trigger('click');
+		});
+		/*]]>*/
+	</script>
+
+</div>
+
+</html>

+ 152 - 0
src/main/webapp/WEB-INF/views/business/SupplyCompanyPopupForm.html

@@ -0,0 +1,152 @@
+<!DOCTYPE html>
+<html lang="ko"
+	  xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : SupplyCompanySearchForm.html
+ * @desc    : 공급업체 목록 페이지
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2020.12.23   xodud1202   최초 작성
+ *******************************************************************************
+ -->
+<div class="modalPopup" data-width="530" id="popupCompanyList">
+	<div class="panelStyle"  style="max-height:700px;overflow-y:scroll;">
+		<!-- TITLE -->
+		<div class="panelTitle">
+			<strong>공급업체 목록</strong>
+			<button type="button" class="close" onclick="uifnPopupClose('popupCompanyList');"><em class="fa fa-times"></em></button>
+		</div>
+		<!-- //TITLE -->
+		<!-- 검색 조건 -->
+		<div class="panelContent">
+			<form id="searchCompanyListForm" name="searchCompanyListForm" action="#" th:action="@{'/business/supply/company/list'}" onsubmit="$('#btnSearchCompanyList').trigger('click'); return false;">
+				<input type="hidden" name="searchGb" value="NAME" />		<!-- 공급업체 목록 검색 조건은 업체명으로만 -->
+				<table class="frmStyle" aria-describedby="검색조건">
+					<colgroup>
+						<col style="width:15%;"/>
+						<col style="width:35%;"/>
+						<col style="width:15%;"/>
+						<col/>
+					</colgroup>
+					<tbody>
+					<tr>
+						<th>자사/입점</th>
+						<td colspan="3">
+							<select name="selfYn" id="selfYn">
+								<option value="">전체</option>
+								<option value="Y">자사</option>
+								<option value="N">입점</option>
+							</select>
+						</td>
+					</tr>
+					<tr>
+						<th>업체코드<i class="required" title="필수"></i></th>
+						<td>
+							<textarea class="textareaR2" name="searchSupplyCompCd" id="searchSupplyCompCd"></textarea>
+						</td>
+						<th>업체명<i class="required" title="필수"></i></th>
+						<td>
+							<textarea class="textareaR2" name="searchSupplyCompNm" id="searchSupplyCompNm"></textarea>
+						</td>
+					</tr>
+					</tbody>
+				</table>
+				<ul class="panelBar">
+					<li class="center">
+						<button type="button" class="btn btn-base btn-lg" id="btnSearchCompanyList">조회</button>
+					</li>
+				</ul>
+			</form>
+			<!-- 리스트 영역 -->
+			<div class="panelContent">
+				<div id="gridComapanyPopupList" style="width: 100%; height: 380px" class="ag-theme-balham"></div>
+			</div>
+			<!-- //리스트 영역 -->
+
+			<!-- 버튼 배치 영역 -->
+			<ul class="panelBar">
+				<li class="right">
+					<button type="button" class="btn btn-info btn-lg" id="btnConfirmCompany">확인</button>
+				</li>
+			</ul>
+		</div>
+		<!-- //검색 조건 -->
+	</div>
+	<script th:inline="javascript">
+		/*<![CDATA[*/
+		let headerSelection = false;
+		if([[${params.multiGb}]] == "M") headerSelection = true;
+		let columnCompanyPopupDefList = [
+			{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: headerSelection, checkboxSelection: true, filter: false},
+			{headerName: "공급업체번호", field: "supplyCompCd", width: 120, cellClass: 'text-center'},
+			{headerName: "공급업체국문명", field: "supplyCompNm", width: 150, cellClass: 'text-center'},
+			{headerName: "입점상태", field: "supplyStatNm", width: 150, cellClass: 'text-center'}
+		];
+
+		let gridOptionsCompanyPopupList = gagaAgGrid.getGridOptions(columnCompanyPopupDefList);
+		if(headerSelection) {	gridOptionsCompanyPopupList.rowSelection = "multiple";	}
+
+		// Row double click
+		gridOptionsCompanyPopupList.onRowDoubleClicked = function(event) {
+			$('#btnConfirmCompany').trigger('click');
+		}
+
+		// 조회
+		$('#btnSearchCompanyList').on('click', function() {
+
+			// if (gagajf.isNull($('#searchCompanyListForm textarea[name=searchSupplyCompCd]').val())  && gagajf.isNull($('#searchCompanyListForm textarea[name=searchSupplyCompNm]').val())){
+			// 	mcxDialog.alert('검색조건을 입력하세요.');
+			// 	return false;
+			// }
+
+			// Fetch data
+			gagaAgGrid.fetch($('#searchCompanyListForm').prop('action'), gridOptionsCompanyPopupList, '#searchCompanyListForm');
+		});
+
+		// 확인
+		$('#btnConfirmCompany').on('click', function() {
+			var selectedData = gagaAgGrid.selectedRowData(gridOptionsCompanyPopupList);
+
+			if (selectedData.length == 0) {
+				mcxDialog.alert('선택된 공급업체가 없습니다.');
+				return false;
+			}
+
+			var callbackFn = [[${params.callbackFn}]];
+
+			var jsonData = JSON.stringify(selectedData);
+
+			if (typeof callbackFn != 'undefined' && callbackFn) {
+				if (typeof callbackFn == 'function') {
+					callbackFn(jsonData);
+				} else {
+					if (callbackFn) {
+						if (callbackFn.indexOf("(") == -1) {
+							eval(callbackFn + "(" + jsonData + ")");
+						} else {
+							eval(callbackFn(jsonData));
+						}
+					}
+				}
+				uifnPopupClose('popupCompanyList');
+			}
+		});
+
+		$(document).ready(function() {
+			// Create a agGrid
+			gagaAgGrid.createGrid('gridComapanyPopupList', gridOptionsCompanyPopupList);
+
+			//  조회
+			//$('#btnSearchCompanyList').trigger('click');
+		});
+		/*]]>*/
+	</script>
+
+</div>
+
+</html>

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

@@ -0,0 +1,193 @@
+<!DOCTYPE html>
+<html lang="ko"
+	  xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : CategorySearchForm.html
+ * @desc    : 카테고리 팝업 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.01.11   xyzp1539    최초 작성
+ *******************************************************************************
+ -->
+<div class="modalPopup" data-width="1100" id="popupCategory">
+	<div class="panelStyle">
+		<!-- TITLE -->
+		<div class="panelTitle">
+			<strong>카테고리 목록</strong>
+			<button type="button" class="close" onclick="uifnPopupClose('popupCategory');"><em class="fa fa-times"></em></button>
+		</div>
+		<!-- //TITLE -->
+
+		<!-- 검색 조건 -->
+		<div class="panelContent">
+			<form id="searchCategoryListForm" name="searchCategoryListForm" action="#" th:action="@{'/display/category/list'}" onsubmit="$('#btnSearchCategoryList').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>
+				<ul class="panelBar">
+					<li class="center">
+						<button type="button" class="btn btn-base btn-lg" id="btnSearchCategoryList">조회</button>
+					</li>
+				</ul>
+			</form>
+		</div>
+		<!-- //검색 조건 -->
+
+		<!-- 리스트 영역 -->
+		<div class="panelContent">
+			<div id="gridCategoryList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
+		</div>
+		<!-- //리스트 영역 -->
+
+		<!-- 버튼 배치 영역 -->
+		<ul class="panelBar">
+			<li class="right">
+				<button type="button" class="btn btn-info btn-lg" id="btnConfirmCategory">확인</button>
+			</li>
+		</ul>
+	</div>
+
+	<script th:inline="javascript">
+		/*<![CDATA[*/
+		let siteList = gagajf.convertToArray([[${siteList}]]);
+		let cateGbList = gagajf.convertToArray([[${cateGbList}]]);
+		let formalGbList = gagajf.convertToArray([[${formalGbList}]]);
+		let conentsLocList = gagajf.convertToArray([[${conentsLocList}]]);
+
+		let columnDefs = [
+			{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
+			{
+				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'},
+			{
+				headerName: "정상이월구분", field: "formalGb", width: 150, cellClass: 'text-center',
+				cellRenderer: function (params) { return gagaAgGrid.lookupValue(formalGbList, params.value); }
+			},
+			{headerName: "노출여부", field: "dispYn", width: 80, cellClass: 'text-center'},
+			{headerName: "사용여부", field: "useYn", width: 80, cellClass: 'text-center'}
+		];
+
+		let categoryGridOptions = gagaAgGrid.getGridOptions(columnDefs);
+		categoryGridOptions.rowSelection = "multiple";
+
+		// 조회
+		$('#btnSearchCategoryList').on('click', function() {
+			// Fetch data
+			gagaAgGrid.fetch($('#searchCategoryListForm').prop('action'), categoryGridOptions, '#searchCategoryListForm');
+		});
+
+		// 확인
+		$('#btnConfirmCategory').on('click', function() {
+			var selectedData = gagaAgGrid.selectedRowData(categoryGridOptions);
+
+			if (selectedData.length == 0) {
+				mcxDialog.alert('선택된 카테고리가 없습니다.');
+				return false;
+			}
+
+			var callbackFn = [[${params.callBackFun}]];
+
+			var jsonData = JSON.stringify(selectedData);
+
+			if (typeof callbackFn != 'undefined' && callbackFn) {
+				if (typeof callbackFn == 'function') {
+					callbackFn(jsonData);
+				} else {
+					if (callbackFn) {
+						if (callbackFn.indexOf("(") == -1) {
+							eval(callbackFn + "(" + jsonData + ")");
+						} else {
+							eval(callbackFn(jsonData));
+						}
+					}
+				}
+				uifnPopupClose('popupCategory');
+			}
+		});
+
+		$(document).ready(function() {
+			// Create a agGrid
+			gagaAgGrid.createGrid('gridCategoryList', categoryGridOptions);
+		});
+
+		/**
+		 * 검색폼의 카테고리 선택 시
+		 */
+		var fnChangeSearchCondition = function(val, selLvl) {
+			if (gagajf.isNull(val)) {
+				if (selLvl > 1) {
+					selLvl = selLvl - 1;
+				} else {
+					selLvl = 1;
+				}
+			}
+			$('#searchCategoryListForm input[name=selLvl]').val(selLvl);
+
+			// Fetch data
+			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) {
+						$('#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();
+			});
+		}
+		/*]]>*/
+	</script>
+
+</div>
+
+</html>

+ 240 - 144
src/main/webapp/WEB-INF/views/marketing/CouponPopupForm.html

@@ -29,6 +29,7 @@
 					<div class="tabsNav">
 						<li class="on"><a href="#coupontab1">기본정보</a></li>
 						<li><a href="#coupontab2">적용대상</a></li>
+						<li><a href="#coupontab3">입점업체분담율</a></li>
 					</div>
 					<ul class="tabsCont">
 						<li class="tab on" id="coupontab1">
@@ -183,8 +184,8 @@
 											<th class="downAblArea">다운로드가능여부<em class="required" title="필수"></em></th>
 											<td class="downAblArea">
 												<select name="downAblYn" id="downAblYn" required="required" data-valid-name="다운로드가능여부">
-													<option value="Y">Y</option>
-													<option value="N" selected="selected">N</option>
+													<option value="Y" selected="selected">Y</option>
+<!--													<option value="N" >N</option>-->
 												</select>
 											</td>
 										</tr>
@@ -298,6 +299,36 @@
 								</div>
 							</div>
 						</li>
+						<li class="tab" id="coupontab3">
+							<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="btnAddApplyBurden">업체추가</button>
+														<button type="button" class="btn btnRight btn-success btn-lg" id="btnDelApplyBurden">선택삭제</button>
+														<br/>
+														<div id="inComGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
+													</div>
+												</td>
+											</tr>
+											</tbody>
+										</table>
+									</div>
+								</div>
+							</div>
+						</li>
 					</ul>
 				</div>
 				<div class="mdPopBtnB aR">
@@ -320,13 +351,173 @@
 	var cpnDtlRefvalCateList = [[${cpnDtlRefvalCateList}]];
 	var cpnDtlRefvalBrandList = [[${cpnDtlRefvalBrandList}]];
 	var cpnDtlRefvalExceptGoodsList = [[${cpnDtlRefvalExceptGoodsList}]];
+	var cpnDtlBurdenList = [[${cpnDtlBurdenList}]];
 
 	var issueCnt = [[${issueCnt}]];
 
 	// 공통코드 리스트
-	//var cateGbList = gagajf.convertToArray([[${cateGbList}]]);
+	var ibSupplyComList = gagajf.convertToArray([[${ibSupplyCompList}]]);
+	var formalGbList = gagajf.convertToArray([[${formalGbList}]]);
+	var cateGbList = gagajf.convertToArray([[${cateGbList}]]);
 	var delYnList = { "Y":"Yes", "N":"No" };
-	//var selfBrandList = gagajf.convertToArray([[${selfBrandList}]]);
+	var selfBrandList = gagajf.convertToArray([[${selfBrandList}]]);
+	var siteCdList = gagajf.convertToArray([[${siteCdList}]]);
+
+	// ag-grid 입점업체분담율 컬럼
+	var columnDefs = [
+		{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: 120 , cellClass: 'text-center'},
+		{ headerName: "쿠폰분담율(%)", field:"burdenRate" , width:150, cellClass: "text-center" , required: true
+			,valueFormatter: function(params) {
+				if(params.value && params.value > 0) {
+					if(params.value > 100){
+						mcxDialog.alert('할인율은 100이하로 설정해주세요.');
+						params.data.burdenRate = '0';
+						return '0';
+					}
+					return params.value.addComma();
+				} else {
+					return '0';
+				}
+			},
+			cellEditorParams: { maxlength: 4, validType: 'numeric'}
+		} ,
+		{ headerName: "쿠폰번호"  , field: "cpnId" , width: 120 , cellClass: 'text-center' , hide:true},
+		{ headerName: "삭제여부"  , field: "delYn" , 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},
+		{ headerName: "삭제여부"  , field: "delYn" , 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},
+		{ headerName: "삭제여부"  , field: "delYn" , 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},
+		{ headerName: "삭제여부"  , field: "delYn" , 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},
+		{ headerName: "삭제여부"  , field: "delYn" , 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},
+		{ headerName: "삭제여부"  , field: "delYn" , 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.rowSelection = "multiple";
+	goodsGridOptions.rowSelection = "multiple";
+	supplyGridOptions.rowSelection = "multiple";
+	excepGoodsGridOptions.rowSelection = "multiple";
+	cateGridOptions.rowSelection = "multiple";
+	brandGridOptions.rowSelection = "multiple";
+
+	// 삭제버튼 클릭시
+	// 1.공급업체
+	$('#btnSupplyDel').on('click', function() {
+		supplyGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(supplyGridOptions)});
+	});
+	// 2.브랜드
+	$('#btnBrandDel').on('click', function() {
+		brandGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(brandGridOptions)});
+	});
+	// 3.카테고리
+	$('#btnCateDel').on('click', function() {
+		cateGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(cateGridOptions)});
+	});
+	// 4.적용상품
+	$('#btnGoodsDel').on('click', function() {
+		goodsGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(goodsGridOptions)});
+	});
+	// 5.제외상품
+	$('#btnExcepGoodsDel').on('click', function() {
+		excepGoodsGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(excepGoodsGridOptions)});
+	});
+
+	// 업체분담율 추가 버튼 클릭시
+	$('#CouponForm #btnAddApplyBurden').on('click', function() {
+		cfnOpenCompanyListPopup("fnSetPopupApplyBurdenInfo" ,"M");
+	});
+
+	// 분담업체율 설정 / 업체 추가 콜백함수
+	var fnSetPopupApplyBurdenInfo = function(result) {
+		// 기존 리스트 데이터 for
+		for(let i = 0 ; i < result.length ; i++) {
+			let addChk = true, gridListValue = gagaAgGrid.getAllRowData(inComGridOptions);		// 받아온 모든 데이터
+
+			// 받아온 data for
+			for(let j = 0 ; j < gridListValue.length ; j++) {
+				// 동일한 data는 추가하지 않음
+				if(gridListValue[j].supplyCompCd == result[i].supplyCompCd) {	addChk = false;	}		// 중복체크
+			}
+
+			// 중복되지 않은 데이터 리스트에 추가
+			if(addChk) {
+				gagaAgGrid.addRowData(inComGridOptions, {"supplyCompCd" : result[i].supplyCompCd, "supplyCompNm" : result[i].supplyCompNm, "burdenRate"  : 100, "delYn" : result[i].delYn});
+			}
+		}
+	};
 
 	// 종료시간 클릭시
 	var fnChangeEdHH = function (obj){
@@ -523,35 +714,19 @@
 				return false;
 			}
 		}
+		var usableCustGbArr = [];
+		var usableCustGradeArr = [];
+		var payTypeArr = [];
 
 		mcxDialog.confirm('저장하시겠습니까?' , {
 			cancelBtnText: "취소",
 			sureBtnText: "확인",
 			sureBtnClick: function () {
-				var usableCustGbArr = [];
-				var chkCustGb  = $('#CouponForm input:checkbox[name=usableCustGbArr]:checked');
-				for(let i=0; i< chkCustGb.length; i++){
-					usableCustGbArr.push(chkCustGb.eq(i).val());
-				}
-
-				var usableCustGradeArr = [];
-				var chkCustGrade = $('#CouponForm input:checkbox[name=usableCustGradeArr]:checked');
-				for(let i=0; i< chkCustGrade.length; i++){
-					usableCustGradeArr.push(chkCustGrade.eq(i).val());
-				}
-
-				var payTypeArr = [];
-				var chkPayType = $('#CouponForm input:checkbox[name=payTypeArr]:checked');
-				for(let i=0; i< chkPayType.length; i++){
-					payTypeArr.push(chkPayType.eq(i).val());
-				}
-
 				var data = {
 					cpnId : $('#CouponForm input[name=cpnId]').val()
 					,cpnNm : $('#CouponForm input[name=cpnNm]').val()
 					,cpnDesc : $('#CouponForm input[name=cpnDesc]').val()
 					,siteCd : $('#CouponForm select[name=siteCd]').val()
-					// ,afLinkCd : $('#CouponForm select[name=afLinkCd]').val()
 					,cpnType : $('input:radio[name="rdoCpnType"]:checked').val()
 					,applyScope : $('input:radio[name="rdoApplyScope"]:checked').val()
 					,dcWay : $('input:radio[name="rdoDcWay"]:checked').val()
@@ -570,31 +745,32 @@
 					,downEddt : $('#CouponForm input[name=downEddt]').val()
 					,buyLimitAmt : $('#CouponForm input[name=buyLimitAmt]').val().replaceAll(',','')
 					,cpnStat : $('input:radio[name="disCpnStat"]:checked').val()
-					,endAlimYn : $('#CouponForm select[name=endAlimYn]').val()
-					,firstOrdYn : $('#CouponForm select[name=firstOrdYn]').val()
-					,downAblYn : $('#CouponForm select[name=downAblYn]').val()
-					,custJoinStdt : $('#CouponForm input[name=custJoinStdt]').val()
-					,custJoinEddt : $('#CouponForm input[name=custJoinEddt]').val()
-					,buyStdt : $('#CouponForm input[name=buyStdt]').val()
-					,buyEddt : $('#CouponForm input[name=buyEddt]').val()
-					,newCustYn : $('#CouponForm select[name=newCustYn]').val()
-					// ,afChannel : $('#CouponForm select[name=afChannel]').val()
-					,dcCdGb : $('input:radio[name="dcCdGb"]:checked').val()
-					,rdCpnNm : $('input[name="serialCpnNm"]').val()
+					,endAlimYn : 'N'
+					,firstOrdYn : 'N'
+					,downAblYn : 'Y'
+					,custJoinStdt : null
+					,custJoinEddt : null
+					,buyStdt : null
+					,buyEddt : null
+					,newCustYn : 'N'
+					,dcCdGb : 'G233_00'
+					,rdCpnNm : null
+					,usableCustGbArr : usableCustGbArr
+					,usableCustGradeArr : usableCustGradeArr
+					,payTypeArr : payTypeArr
 					,supplyCompList : gagaAgGrid.getAllRowData(supplyGridOptions)
 					,brandList : gagaAgGrid.getAllRowData(brandGridOptions)
 					,applyGoodsList : gagaAgGrid.getAllRowData(goodsGridOptions)
 					,exceptGoodsList : gagaAgGrid.getAllRowData(excepGoodsGridOptions)
 					,cateList : gagaAgGrid.getAllRowData(cateGridOptions)
 					,burdenList : gagaAgGrid.getAllRowData(inComGridOptions)
-					,usableCustGbArr : usableCustGbArr
-					,usableCustGradeArr : usableCustGradeArr
-					,payTypeArr : payTypeArr
-					,limitedTimeCpnList : gagaAgGrid.getAllRowData(limitedTimeCpnGridOptions)
-					,afChannelList : gagaAgGrid.getAllRowData(afLinkOptions)
 					,mode : $('#CouponForm input[name=mode]').val()
+					,limitedTimeCpnList : null
+					,afChannelList : null
+					,scmYn : 'Y'
 				};
 				var jsonData = JSON.stringify(data);
+				console.log('jsonData::>>'+jsonData);
 				gagajf.ajaxJsonSubmit($('#CouponForm').prop('action'), jsonData, fnCouponSaveCollback);
 			}
 		});
@@ -716,23 +892,14 @@
 
 		// 즉시할인 쿠폰일때
 		if(radioValue == 'G230_10'){
-			$('#CouponForm .custJoinTr').hide();
-			$('#CouponForm .custJoinDateTr').hide();
-			$('#CouponForm .firstBuyTr').hide();
-			$('#CouponForm .buyDateTr').hide();
 			$('#CouponForm .dcCdCheck1').hide();
-			$('#CouponForm .limitedTimeCpnArea').hide();
-			$('#CouponForm .pdGbArea').hide();
 			$('#CouponForm .availDaysArea').hide();
 			// 다운로드 시작,종료 , 기간/일수 , 제휴채널, 고객 등급, 구매제한 , 할인율일때 구매제한한도, 1회발행수량, 다운로드 가능여부 숨기기
 			$('#CouponForm .downStdtArea').hide();
 			$('#CouponForm .downEddtArea').hide();
 			$('#CouponForm .pdGbArea').hide();
 			$('#CouponForm .buyLimitAmtArea').hide();
-			$('#CouponForm .usableCustGbArea').hide();
-			$('#CouponForm .usableCustGradeArea').hide();
 			$('#CouponForm .downAblArea').hide();
-			$('#CouponForm .linkAfArea').hide();
 			$('#CouponForm .dcCdCheck2').hide();
 			$('#CouponForm .maxDcAmtArea').hide();
 			$('#CouponForm .availDateTr').show();
@@ -744,47 +911,24 @@
 			$("#CouponForm").find("input:radio[name='rdoApplyScope']").attr('disabled', false);
 			$("#CouponForm").find("input:radio[name='rdoApplyScope']").attr('readonly', false);
 
-			if(radioValue == 'G230_11'){ // 상품쿠폰일때 선착순쿠폰 등록 가능
-				$('#CouponForm .limitedTimeCpnArea').show();
-			}else{
-				$('#CouponForm .limitedTimeCpnArea').hide();
-			}
 
-			if(radioValue == 'G230_30'){	// 배송비쿠폰일때 할인금액만 적용
-				$("#CouponForm input:radio[name='rdoDcWay']:radio[value=G240_10]").prop('checked', true);
-				$("#CouponForm").find("input:radio[name='rdoDcWay']").attr('disabled', true);
-				$("#CouponForm").find("input:radio[name='rdoDcWay']").attr('readonly', true);
-				$('#CouponForm .maxDcAmtArea').hide();
-				// 적용대상 탭
-				$("#CouponForm .supplyTrArea").show();
-				$("#CouponForm .brandTrArea").hide();
-				$("#CouponForm .categoryTrArea").hide();
-				$("#CouponForm .goodsTrArea").hide();
-				$("#CouponForm .exceptArea").hide();
-			}else{
-				$("#CouponForm").find("input:radio[name='rdoDcWay']").attr('disabled', false);
-				$("#CouponForm").find("input:radio[name='rdoDcWay']").attr('readonly', false);
-				$('#CouponForm .maxDcAmtArea').show();
-				// 적용대상 탭
-				$("#CouponForm .supplyTrArea").show();
-				$("#CouponForm .brandTrArea").show();
-				$("#CouponForm .categoryTrArea").show();
-				$("#CouponForm .goodsTrArea").show();
-				$("#CouponForm .exceptArea").show();
-			}
+			$("#CouponForm").find("input:radio[name='rdoDcWay']").attr('disabled', false);
+			$("#CouponForm").find("input:radio[name='rdoDcWay']").attr('readonly', false);
+			$('#CouponForm .maxDcAmtArea').show();
+			// 적용대상 탭
+			$("#CouponForm .supplyTrArea").show();
+			$("#CouponForm .brandTrArea").show();
+			$("#CouponForm .categoryTrArea").show();
+			$("#CouponForm .goodsTrArea").show();
+			$("#CouponForm .exceptArea").show();
 
-			$('#CouponForm .custJoinTr').show();
-			$('#CouponForm .firstBuyTr').show();
 			$('#CouponForm .dcCdCheck1').show();
 			$('#CouponForm .pdGbArea').show();
 			// 다운로드 시작,종료 , 기간/일수 , 제휴채널, 고객 등급, 구매제한 , 할인율일때 구매제한한도, 1회발행수량, 다운로드 가능여부 숨기기
 			$('#CouponForm .downStdtArea').show();
 			$('#CouponForm .downEddtArea').show();
 			$('#CouponForm .buyLimitAmtArea').show();
-			$('#CouponForm .usableCustGbArea').show();
-			$('#CouponForm .usableCustGradeArea').show();
 			$('#CouponForm .downAblArea').show();
-			$('#CouponForm .linkAfArea').show();
 			$('#CouponForm .dcCdCheck2').show();
 
 			// 즉시할인아닌 쿠폰들 할인금액체크시 최대할인금액 숨김
@@ -802,67 +946,9 @@
 			$("input:radio[name='rdoApplyScope']:radio[value='A']").prop('checked', true);
 		}
 
-		// 주문서 쿠폰 선택시 결제수단 노출
-		if(radioValue == 'G230_20') {
-			$('#CouponForm .payTypeTr').show();
-			$('#CouponForm #payType').attr('required' , true);
-			$("#CouponForm .dcCdGb").show();		// 할인쿠폰유형 노출
-		} else {
-			$('#CouponForm .payTypeTr').hide();
-			$('#CouponForm #payType').attr('required' , false );
-			$("#CouponForm .dcCdGb").hide();		// 할인쿠폰유형 숨김
-			$("#CouponForm input:radio[name='dcCdGb']:radio[value='G233_00']").prop('checked', true);		// 주문서 쿠폰이 아닐 경우 일반 쿠폰으로 설정
-		}
-
-		// 선착순 쿠폰 비노출
-		$("#CouponForm .limitedTimeCpnTab").hide();
-		$('#CouponForm input:checkbox[name=limitedTimeCpnYn]').prop('checked', false);
-		$("#limitedTimeCpnYn").val("N");
-		$("#CouponForm #totPubLimitQty").val(0);
-		$("#CouponForm input[id=chkBoxTotPubQty]").prop("disabled", false);
-		$("#CouponForm input[id=totPubLimitQty]").prop("disabled", false);
-		$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").parent("label").removeClass("checked");
-		$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").attr('readonly', false);
-		$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").prop('disabled', false);
-		$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").parent().prop('disabled', false);
-
 		$('#CouponForm #cpnType').val(radioValue);
 	});
 
-	// 할인 쿠폰 유형 변경
-	$("#CouponForm input[name=dcCdGb]").bind('click change', function () {
-		if(this.value == "G233_00") {			// 일반 유형
-			$("#CouponForm .dcCdCheck1").show();
-			$("#CouponForm .dcCdCheck2").show();
-			$("#CouponForm .serialCpnArea").hide();
-			$("#CouponForm .randomCpnArea").hide();
-			$("#CouponForm #newCustYn").parent().attr("colspan", "");
-			$("#CouponForm .normalCol").attr("colspan", "5");
-			$('#CouponForm input[name="serialCpnNm"]').attr('required' , false);
-			$('#CouponForm input[name="serialCpnQty"]').attr('required' , false);
-			$('#CouponForm input[name="randomCpnQty"]').attr('required' , false);
-		} else {
-			if(this.value == "G233_10") {		// 시리얼 유형
-				$("#CouponForm .serialCpnArea").show();
-				$("#CouponForm .randomCpnArea").hide();
-				$("#CouponForm .normalCol").attr("colspan", "5");
-				$('#CouponForm input[name="serialCpnNm"]').attr('required' , true);
-				$('#CouponForm input[name="serialCpnQty"]').attr('required' , true);
-				$('#CouponForm input[name="randomCpnQty"]').attr('required' , false);
-			} else {							// 난수 유형
-				$("#CouponForm .serialCpnArea").hide();
-				$("#CouponForm .randomCpnArea").show();
-				$("#CouponForm .normalCol").attr("colspan", "");
-				$('#CouponForm input[name="serialCpnNm"]').attr('required' , false);
-				$('#CouponForm input[name="serialCpnQty"]').attr('required' , false);
-				$('#CouponForm input[name="randomCpnQty"]').attr('required' , true);
-			}
-			$("#CouponForm .dcCdCheck1").hide();								// 총발행제한수량, 1회발행수량, 1인당발행제한수량 숨김
-			$("#CouponForm .dcCdCheck2").hide();								// 총발행제한수량, 1회발행수량, 1인당발행제한수량 숨김
-			$("#CouponForm #newCustYn").parent().attr("colspan", "5");		// 총발행제한 수량을 없애면서 신규회원여부 colspan 수정
-		}
-	});
-
 	// 적용대상 - 브랜드 추가 버튼시
 	$('#btnBrandAdd').on('click' , function(){
 		cfnOpenBrandListPopup("fnSetPopupBrandInfo", "M");
@@ -888,7 +974,7 @@
 
 	// 적용대상 - 공급처 추가 버튼시
 	$('#btnSupplyAdd').on('click' , function (){
-		cfnOpenCompanyListPopup("fnSetPopupComapnyInfo" , "M");
+		cfnOpenCompanyListPopup("fnSetPopupComapnyInfo" , "M" ,"","","N");
 	});
 
 	// 공급업체 설정 / 업체 추가 콜백함수
@@ -1022,11 +1108,6 @@
 		cfnOpenModalPopup(actionUrl, 'CpnPubCustListPopup');
 	};
 
-	// 쿠폰발행팝업
-	function fnCustomerIssuePopUp(){
-		cfnCpnPubForCustPopup();
-	};
-
 	// 전송시 값 세팅
 	function setReqValue(){
 		// 쿠폰유형값 세팅
@@ -1073,6 +1154,13 @@
 	}
 
 	$(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);
+
 		// 일단 버튼 숨김
 		$(".couponButton").hide();
 
@@ -1107,6 +1195,14 @@
 			$("#CouponForm .buttonSpan").show();
 
 		} 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);
+
 			if(cpnDetail.cpnStat == "G232_10"){
 				$("#btnCouponSave").show();		// 저장버튼
 				$("#btnChangeStatIng").show();	// 진행버튼

+ 72 - 0
src/main/webapp/WEB-INF/views/marketing/CouponPubCustListPopupForm.html

@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<html lang="ko"
+	  xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : CouponPubCustListPopupForm.html
+ * @desc    : 쿠폰 발급받은 회원리스트 팝업 화면
+ *============================================================================
+ * ISTYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.02.03   bin2107       최초 작성
+ *******************************************************************************
+ -->
+<div class="modalPopup" data-width="960" data-height="500" >
+	<div class="panelStyle" >
+		<div class="panelTitle">
+			<h2>쿠폰 발급받은 회원</h2>
+			<button type="button" class="close" onclick="uifnPopupClose('CpnPubCustListPopup')"><i class="fa fa-times"></i></button>
+		</div>
+		<div class="panelContent">
+			<div id="pubCustgridList" style="width:100%; height:420px;" class="ag-theme-balham"></div>
+		</div>
+	</div>
+</div>
+<script th:inline="javascript">
+	/*<![CDATA[*/
+	var cpnPubCustList = [[${cpnPubCustList}]]; //gagajf.convertToArray([[${cpnPubCustList}]]);
+
+	var columnDefs = [
+		{ headerName: "회원번호" , field:"custNo" , width:100, cellClass:"text-center"} ,
+		{ headerName: "회원명" , field:"custNm" , width:120, cellClass:"text-center" } ,
+		{ headerName: "회원구분" , field:"custGbNm" , width:120, cellClass:"text-center" } ,
+		{ headerName: "회원등급" , field:"custGradeNm" , width:120, cellClass:"text-center" } ,
+		{ headerName: "시작유효기간" , field:"availStdt" , width:150, cellClass:"text-center"
+			,valueGetter	: function (params) {
+				return gagaAgGrid.toDateTimeFormat(params.data.availStdt);
+			}
+		} ,
+		{ headerName: "종료유효기간" , field:"availEddt" , width:150, cellClass:"text-center"
+			,valueGetter	: function (params) {
+				return gagaAgGrid.toDateTimeFormat(params.data.availEddt);
+			}
+		} ,
+		{ headerName: "사용여부" , field:"useYn" , width:120, cellClass:"text-center" } ,
+		/*{ headerName: "사용일" , field:"usedDt" , width:150, cellClass:"text-center"
+			,valueGetter	: function (params) {
+				return gagaAgGrid.toDateTimeFormat(params.data.usedDt);
+			}
+		} ,*/
+		{ headerName: "발급사유" , field:"pubReasonNm" , width:200, cellClass:"text-center"} ,
+		{ headerName: "발급상세사유" , field:"pubReasonDtl" , width:200, cellClass:"text-center"} ,
+		{ headerName: "발급인ID" , field:"regNo" , width:100, cellClass:"text-center"} ,
+		{ headerName: "발급시간" , field:"regDt" , width:150, cellClass:"text-center"
+			,valueGetter	: function (params) {
+				return gagaAgGrid.toDateTimeFormat(params.data.regDt);
+			}
+		}
+	];
+
+	let pubCustGridOptions = gagaAgGrid.getGridOptions(columnDefs);
+
+	$(document).ready(function(){
+		gagaAgGrid.createGrid('pubCustgridList', pubCustGridOptions);
+		pubCustGridOptions.api.setRowData(cpnPubCustList);
+	});
+
+	/*]]>*/
+</script>
+</html>

+ 53 - 6
src/main/webapp/ux/js/admin.popup.js

@@ -660,18 +660,65 @@ var cfnOpenFrontGoodsPopup = function(goodsCd) {
  * @access : public
  * @desc   : 브랜드 목록 팝업
  * <pre>
- *     cfnOpenBrandListPopup();
- *     or
  *     cfnOpenBrandListPopup('fnResult');
  *     or
- *     cfnOpenBrandListPopup('fnResult', 'TBJ');
+ *     cfnOpenBrandListPopup('fnResult', 'S');
+ *     or
+ *     cfnOpenBrandListPopup('fnResult', 'S', 'TBJ');
  * </pre>
  * @since  : 2020/12/15
  * @author : eskim
  */
-var cfnOpenBrandListPopup = function(callbackfn, searchTxt) {
-	var actionUrl = '/business/brand/search/form';
-	if (typeof(callbackfn) != 'undefined') actionUrl += "?callbackFn=" + callbackfn;
+var cfnOpenBrandListPopup = function(callbackfn, multiGb, searchTxt) {
+	var actionUrl = '/business/brand/search/form?callbackFn=' + callbackfn;
+	if (typeof(multiGb) != 'undefined' && multiGb != null && multiGb == "M") actionUrl += "&multiGb=" + multiGb; else actionUrl += "&multiGb=S";
 	if (typeof(searchTxt) != 'undefined') actionUrl += "&searchTxt=" + encodeURIComponent(searchTxt);
 	cfnOpenModalPopup(actionUrl, "popupBrandList");
 }
+
+/**
+ * @type   : function
+ * @access : public
+ * @desc   : 공급업체 조회 팝업
+ * <pre>
+ *     cfnOpenCompanyListPopup('fnResult');										// callBack 함수만 나타내고, 싱글 선택 팝업
+ *     or
+ *     cfnOpenCompanyListPopup('fnResult', 'S');								// 1번 파라미터 : callBack 함수, 2번 파라미터 : S면 싱글 선택 팝업, M이면 멀티 선택 팝업
+ *     or
+ *     cfnOpenCompanyListPopup('fnResult', 'S', 'TBJ');							// 1번 파라미터 : callBack 함수, 2번 파라미터 : 선택구분, 3번 파라미터 : 팝업 default 검색어
+ *     or
+ *     cfnOpenCompanyListPopup('fnResult', 'S', 'TBJ', 'inputId');				// 문자열은 멀티구분 S이고, 결과가 하나일때 supplyCompCd값을 넣어줄 html tag id, S가 아니고, inputId가 존재하지 않으면 무조건 팝업이 열림.
+ *     or
+ *     cfnOpenCompanyListPopup('fnResult', 'S', 'TBJ', 'inputId', 'Y');			// '': 전체 공급업체(기본값), Y: 자사공급업체, N:입점공급업체
+ *
+ * </pre>
+ * @since  : 2020/12/23
+ * @author : xodud1202
+ */
+var cfnOpenCompanyListPopup = function(callbackfn, multiGb, searchTxt, inputId, selfYn) {
+	var actionUrl = "/business/comapny/search/form?callbackFn=" + callbackfn;
+	if (typeof(multiGb) != 'undefined' && multiGb != null && multiGb == "M") actionUrl += "&multiGb=" + multiGb; else actionUrl += "&multiGb=S";
+	if (typeof(searchTxt) != 'undefined') actionUrl += "&searchTxt=" + encodeURIComponent(searchTxt);
+	if (typeof(selfYn) != 'undefined') actionUrl += "&selfYn="+ selfYn ; else actionUrl += "&selfYn=" ;
+	if(multiGb == "S") {
+		if(searchTxt && searchTxt != "" && inputId && inputId != "") {
+			var data = {  searchTxt : searchTxt, searchGb : "NAME"};
+			var jsonData = JSON.stringify(data);
+
+			gagajf.ajaxJsonSubmit('/business/supply/company/list', jsonData, function(result) {
+				if(result && result.length == 1) {
+					$("#" + inputId).val(result[0].supplyCompCd);
+				} else {
+					uifnPopupClose('popupCompanyList');
+					cfnOpenModalPopup(actionUrl, 'popupCompanyList');
+				}
+			});
+		} else {
+			uifnPopupClose('popupCompanyList');
+			cfnOpenModalPopup(actionUrl, 'popupCompanyList');
+		}
+	} else {
+		uifnPopupClose('popupCompanyList');
+		cfnOpenModalPopup(actionUrl, 'popupCompanyList');
+	}
+}