Procházet zdrojové kódy

쿠폰관리 개발중

bin2107 před 5 roky
rodič
revize
3efa841780

+ 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미사용시 필요 없음)
+
+}

+ 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);
+	}
+
+}

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

@@ -681,11 +681,11 @@ public class TssMarketingController extends TssBaseController {
 		// 할인 쿠폰 코드 조회
 //		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"));
 		// 쿠폰상태 조회

+ 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>

+ 135 - 109
src/main/webapp/WEB-INF/views/marketing/CouponPopupForm.html

@@ -183,8 +183,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>
@@ -324,9 +324,117 @@
 	var issueCnt = [[${issueCnt}]];
 
 	// 공통코드 리스트
-	//var cateGbList = gagajf.convertToArray([[${cateGbList}]]);
+	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 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 cateGridOptions = gagaAgGrid.getGridOptions(cateSelColumnDefs);
+	var goodsGridOptions = gagaAgGrid.getGridOptions(goodsSelColumnDefs);
+	var brandGridOptions = gagaAgGrid.getGridOptions(brandSelColumnDefs);
+	var supplyGridOptions = gagaAgGrid.getGridOptions(supplyColumnDefs);
+	var excepGoodsGridOptions = gagaAgGrid.getGridOptions(excepGoodsColumnDefs);
+
+	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)});
+	});
 
 	// 종료시간 클릭시
 	var fnChangeEdHH = function (obj){
@@ -716,23 +824,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 +843,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 +878,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 +906,7 @@
 
 	// 적용대상 - 공급처 추가 버튼시
 	$('#btnSupplyAdd').on('click' , function (){
-		cfnOpenCompanyListPopup("fnSetPopupComapnyInfo" , "M");
+		cfnOpenCompanyListPopup("fnSetPopupComapnyInfo" , "M" ,"","","N");
 	});
 
 	// 공급업체 설정 / 업체 추가 콜백함수
@@ -1022,11 +1040,6 @@
 		cfnOpenModalPopup(actionUrl, 'CpnPubCustListPopup');
 	};
 
-	// 쿠폰발행팝업
-	function fnCustomerIssuePopUp(){
-		cfnCpnPubForCustPopup();
-	};
-
 	// 전송시 값 세팅
 	function setReqValue(){
 		// 쿠폰유형값 세팅
@@ -1073,6 +1086,12 @@
 	}
 
 	$(document).ready(function() {
+		gagaAgGrid.createGrid('brandGridList', brandGridOptions);
+		gagaAgGrid.createGrid('cateGridList', cateGridOptions);
+		gagaAgGrid.createGrid('supplyGridList', supplyGridOptions);
+		gagaAgGrid.createGrid('goodsGridList', goodsGridOptions);
+		gagaAgGrid.createGrid('excepGoodsGridList', excepGoodsGridOptions);
+
 		// 일단 버튼 숨김
 		$(".couponButton").hide();
 
@@ -1107,6 +1126,13 @@
 			$("#CouponForm .buttonSpan").show();
 
 		} else {
+			// 수정모드시 그리드 세팅
+			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();	// 진행버튼

+ 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');
+	}
+}