Bladeren bron

Merge branch 'develop' into jsshin

jsshin 5 jaren geleden
bovenliggende
commit
4a976db1d9

+ 10 - 4
src/main/java/com/style24/admin/biz/dao/TsaDisplayDao.java

@@ -3,10 +3,7 @@ package com.style24.admin.biz.dao;
 import java.util.Collection;
 
 import com.style24.core.support.annotation.ShopDs;
-import com.style24.persistence.domain.Category;
-import com.style24.persistence.domain.GoodsCategory;
-import com.style24.persistence.domain.GoodsSearch;
-import com.style24.persistence.domain.ItemkindCategory;
+import com.style24.persistence.domain.*;
 
 /**
  * 전시 Dao
@@ -146,4 +143,13 @@ public interface TsaDisplayDao {
 	 * @since 2021. 1. 15
 	 */
 	int getGoodsCategoryListCount(GoodsCategory goodsCategory);
+
+	/**
+	 * 상품별카테고리전시관리 목록 조회
+	 * @param goodsCategory
+	 * @return
+	 * @author bin2107
+	 * @since 2021. 1. 15
+	 */
+	Collection<Goods> getGoodsCategoryList(GoodsCategory goodsCategory);
 }

+ 12 - 4
src/main/java/com/style24/admin/biz/service/TsaDisplayService.java

@@ -2,8 +2,7 @@ package com.style24.admin.biz.service;
 
 import java.util.Collection;
 
-import com.style24.persistence.domain.GoodsCategory;
-import com.style24.persistence.domain.GoodsSearch;
+import com.style24.persistence.domain.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cache.annotation.CacheEvict;
 import org.springframework.stereotype.Service;
@@ -11,8 +10,6 @@ import org.springframework.transaction.annotation.Transactional;
 
 import com.style24.admin.biz.dao.TsaDisplayDao;
 import com.style24.admin.support.security.session.TsaSession;
-import com.style24.persistence.domain.Category;
-import com.style24.persistence.domain.ItemkindCategory;
 
 import lombok.extern.slf4j.Slf4j;
 
@@ -169,4 +166,15 @@ public class TsaDisplayService {
 	public int getGoodsCategoryListCount(GoodsCategory goodsCategory) {
 		return displayDao.getGoodsCategoryListCount(goodsCategory);
 	}
+
+	/**
+	 * 상품별카테고리전시관리 목록 조회
+	 * @param goodsCategory
+	 * @return
+	 * @author bin2107
+	 * @since 2021. 1. 15
+	 */
+	public Collection<Goods> getGoodsCategoryList(GoodsCategory goodsCategory) {
+		return displayDao.getGoodsCategoryList(goodsCategory);
+	}
 }

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

@@ -237,6 +237,9 @@ public class TsaDisplayController extends TsaBaseController {
 		// 시즌
 		mav.addObject("seasonList", rendererService.getAvailCommonCodeList("G006"));
 
+		// 카테고리 등록/수정
+		mav.addObject("cateGbList", rendererService.getAvailCommonCodeList("G032"));
+
 		mav.setViewName("display/GoodsCategoryForm");
 
 		return mav;
@@ -259,9 +262,9 @@ public class TsaDisplayController extends TsaBaseController {
 		goodsCategory.getPageable().setTotalCount(displayService.getGoodsCategoryListCount(goodsCategory));
 
 		result.set("pageing", goodsCategory);
-		//result.set("goodsList", goodsService.getGoodsList(goodsSearch));
+		result.set("goodsCategoryList", displayService.getGoodsCategoryList(goodsCategory));
 
-		return null;
+		return result;
 	}
 
 }

+ 188 - 1
src/main/java/com/style24/persistence/mybatis/shop/TsaDsiplay.xml

@@ -550,5 +550,192 @@
 		AND    IC.ITEMKIND_CD = #{itemkindCd}
 		ORDER  BY C4.CATE_GB, C4.LEAF_CATE_NO
 	</select>
-	
+
+	<!-- 상품별카테고리전시관리 목록 건수 조회 -->
+	<select id="getGoodsCategoryListCount" parameterType="GoodsCategory" resultType="int">
+		/* TsaDisplay.getGoodsCategoryListCount */
+		SELECT  COUNT(*) AS TOTCNT
+		FROM	TB_GOODS G
+		WHERE	1=1
+		<if test="searchGb == null or searchGb =='BASIC' or searchGb =='EXTEND' or searchGb =='MASTER'" >
+			<include refid="getGoodsCategoryListCondition_sql"/>
+		</if>
+	</select>
+
+	<!-- 상품별카테고리전시관리 목록 조회 -->
+	<select id="getGoodsCategoryList" parameterType="GoodsCategory" resultType="Goods">
+		SELECT	Z.*
+		FROM	(
+			SELECT	@rownum := @rownum + 1 AS RNUM
+					,A.*
+					, CASE WHEN A.GOODS_TYPE = 'G056_S' THEN (SELECT NVL(SUM(CURR_STOCK_QTY), 0) - NVL(SUM(BASE_STOCK_QTY), 0) AS CURR_STOCK_QTY FROM VW_STOCK_COMPOSE WHERE GOODS_CD = A.GOODS_CD)
+					ELSE (SELECT NVL(SUM(CURR_STOCK_QTY), 0) - NVL(SUM(BASE_STOCK_QTY), 0) AS CURR_STOCK_QTY FROM VW_STOCK WHERE GOODS_CD = A.GOODS_CD)
+					END AS CURR_STOCK_QTY
+			FROM	(
+				SELECT	G.GOODS_CD
+						, G.GOODS_NM
+						, G.DC_RATE
+						, G.TAG_PRICE
+						, G.LIST_PRICE
+						, G.CURR_PRICE
+						, G.GOODS_TYPE
+						, G.PNT_PRATE
+						, G.PRE_PPNT_USABLE_YN
+						, G.PNT_MRATE
+						, G.PRE_MPNT_USABLE_YN
+						, G.ERP_STOCK_LINK_YN
+						, G.ERP_PRICE_LINK_YN
+						, G.FORMAL_GB
+						, G.SELF_GOODS_YN
+						, G.REG_DT
+						, G.SUPPLY_GOODS_CD
+						, G.SUPPLY_COMP_CD
+						, G.BRAND_CD
+						, G.ITEMKIND_CD
+						, G.GOODS_STAT
+						, G.STYLE_YEAR
+						, G.SEASON_CD
+						, (SELECT BRAND_GRP_NM FROM TB_BRAND WHERE BRAND_CD = G.BRAND_CD) AS BRAND_GRP_NM
+						, (SELECT MAX(SYS_IMG_NM) FROM TB_GOODS_IMG  WHERE GOODS_CD = G.GOODS_CD AND COLOR_CD = G.MAIN_COLOR_CD AND DEFAULT_IMG_YN = 'Y' ) AS SYS_IMG_NM
+				FROM	TB_GOODS G
+				JOIN ( SELECT @rownum := 0) R
+				WHERE 1=1
+				<include refid="getGoodsCategoryListCondition_sql"/>
+				ORDER BY G.REG_DT DESC, G.GOODS_CD
+			<include refid="getListPagingCondition_sql"/>
+	</select>
+
+	<sql id="getListPagingCondition_sql">
+		<choose>
+			<when test="pageable != null">
+				) A
+				)Z
+				WHERE RNUM BETWEEN  #{pageable.startRow} AND #{pageable.endRow}
+			</when>
+			<otherwise>
+				) A
+				)Z
+			</otherwise>
+		</choose>
+	</sql>
+
+	<sql id="getGoodsCategoryListCondition_sql">
+		<if test='goodsCd != null and goodsCd != ""'>
+			AND UPPER(G.GOODS_CD) LIKE CONCAT('%',UPPER(#{goodsCd}),'%')
+		</if>
+		<if test='supplyGoodsCd != null and supplyGoodsCd != ""'>
+			AND G.SUPPLY_GOODS_CD = #{supplyGoodsCd}
+		</if>
+		<if test='goodsNm != null and goodsNm != ""'>
+			AND UPPER(G.GOODS_NM) LIKE CONCAT('%',UPPER(#{goodsNm}),'%')
+		</if>
+		<if test='goodsStat != null and goodsStat != ""'>
+			AND G.GOODS_STAT = #{goodsStat}
+		</if>
+		<if test="supplyCompCd != null and supplyCompCd != ''">
+			AND G.SUPPLY_COMP_CD = #{supplyCompCd}
+		</if>
+		<if test="mdId != null and mdId != ''">
+			AND EXISTS (
+			SELECT BRAND_CD
+			FROM TB_BRAND_MD
+			WHERE MD_NO = #{mdId}
+			AND BRAND_CD = G.BRAND_CD
+			)
+		</if>
+		<if test="brandCd != null and brandCd != ''">
+			AND G.BRAND_CD = #{brandCd}
+		</if>
+		<if test="itemkindCd != null and itemkindCd != ''">
+			AND G.ITEMKIND_CD = #{itemkindCd}
+		</if>
+		<if test="formalGb != null and formalGb != ''">
+			AND G.FORMAL_GB = #{formalGb}
+		</if>
+		<!--<if test="currStockQty != null and currStockQty != ''">
+			AND EXISTS (
+			SELECT 1 FROM(
+			SELECT NVL(SUM(CURR_STOCK_QTY), 0) - NVL(SUM(BASE_STOCK_QTY), 0) AS CURR_STOCK_QTY
+			FROM VW_STOCK WHERE GOODS_CD = A.GOODS_CD
+			)
+			WHERE CURR_STOCK_QTY >= #{currStockQty}
+			)
+		</if>--> <!-- 자사/입점일때 따로 테이블 찾아야함..일단 패스 -->
+		<if test="styleYear != null and styleYear != ''">
+			AND G.STYLE_YEAR = #{styleYear}
+		</if>
+		<if test="seasonCd != null and seasonCd != ''">
+			AND G.SEASON_CD = #{seasonCd}
+		</if>
+		<if test="currPriceSt != null and currPriceSt != ''">
+			AND G.CURR_PRICE >= #{currPriceSt}
+		</if>
+		<if test="currPriceEd != null and currPriceEd != ''">
+			<![CDATA[
+			AND G.CURR_PRICE <= #{currPriceEd}
+			]]>
+		</if>
+		<if test='soldoutYn != null and soldoutYn == "Y"'>
+			AND EXISTS (
+			SELECT GOODS_CD
+			FROM VW_STOCK
+			WHERE SOLDOUT_YN = 'Y'
+			AND GOODS_CD = G.GOODS_CD
+			)
+		</if>
+		<if test='soldoutYn != null and soldoutYn == "N"'>
+			AND NOT EXISTS (
+			SELECT GOODS_CD
+			FROM VW_STOCK
+			WHERE SOLDOUT_YN = 'Y'
+			AND GOODS_CD = G.GOODS_CD
+			)
+		</if>
+		<if test="changeableYn != null and changeableYn != ''">
+			AND G.CHANGEABLE_YN = #{changeableYn}
+		</if>
+		<if test="returnableYn != null and returnableYn != ''">
+			AND G.RETURNABLE_YN = #{returnableYn}
+		</if>
+		<if test="returnFeeFreeYn != null and returnFeeFreeYn != ''">
+			AND G.RETURN_FEE_FREE_YN = #{returnFeeFreeYn}
+		</if>
+		<if test="changeFeeFreeYn != null and changeFeeFreeYn != ''">
+			AND G.CHANGE_FEE_FREE_YN = #{changeFeeFreeYn}
+		</if>
+		<if test="dcRateSt != null and dcRateSt != ''">
+			AND G.DC_RATE >= #{dcRateSt}
+		</if>
+		<if test="dcRateEd != null and dcRateEd != ''">
+			<![CDATA[
+			AND G.DC_RATE <= #{dcRateEd}
+			]]>
+		</if>
+		<if test="stDate != null and stDate != ''">
+			AND G.REG_DT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
+		</if>
+		<if test="edDate != null and edDate != ''">
+			<![CDATA[
+			AND G.REG_DT < DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
+			]]>
+		</if>
+		<if test="dispYn != null and dispYn != ''">
+			<choose>
+				<when test='dispYn == "Y"'>
+					AND EXISTS
+					( SELECT 1
+					FROM TB_CATE_GOODS
+					WHERE GOODS_CD = G.GOODS_CD
+					)
+				</when>
+				<when test='dispYn == "N"'>
+					AND NOT EXISTS
+					( SELECT 1
+					FROM TB_CATE_GOODS
+					WHERE GOODS_CD = G.GOODS_CD
+					)
+				</when>
+			</choose>
+		</if>
+	</sql>
 </mapper>

+ 257 - 91
src/main/webapp/WEB-INF/views/display/GoodsCategoryForm.html

@@ -1,6 +1,6 @@
 <!DOCTYPE html>
 <html lang="ko"
-	xmlns:th="http://www.thymeleaf.org">
+	  xmlns:th="http://www.thymeleaf.org">
 <!--
  *******************************************************************************
  * @source  : GoodsCategoryForm.html
@@ -14,22 +14,26 @@
  * 1.0  2021.01.13   bin2107     최초 작성
  *******************************************************************************
  -->
-	<div id="main">
-		<!-- 메인타이틀 영역 -->
-		<div class="main-title">
-		</div>
-		<!-- //메인타이틀 영역 -->
-		
-		<!-- 메뉴 설명 -->
-		<div class="infoBox menu-desc">
-		</div>
-		<!-- //메뉴 설명 -->
-		
-		<!-- 검색조건 영역 -->
-		<div class="panelStyle">
-			<form id="goodsCateForm" name="goodsCateForm" action="#" th:action="@{'/display/goods/category/list'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
-				<input type="hidden" id="searchGb" name="searchGb" />
-				<table class="frmStyle" aria-describedby="검색조건">
+<div id="main">
+	<!-- 메인타이틀 영역 -->
+	<div class="main-title">
+	</div>
+	<!-- //메인타이틀 영역 -->
+
+	<!-- 메뉴 설명 -->
+	<div class="infoBox menu-desc">
+	</div>
+	<form id="goodsSearchForm" name="goodsSearchForm" action="#" th:action="@{'/display/goods/category/list'}">
+		<input type="hidden" id="searchGb" name="searchGb" />
+		<!-- 패널 영역1 -->
+		<div class="panelStyle" >
+			<!-- TITLE -->
+			<div class="panelTitle">
+				<h3><i class="fa fa-info-circle"></i>아래 검색조건 중 <font color="red">상품코드, 업체, 기간</font>중 하나를 꼭 입력해 주세요.</h3>
+			</div>
+			<!-- //TITLE -->
+			<div class="panelContent">
+				<table class="frmStyle">
 					<colgroup>
 						<col width="7%"/>
 						<col width="18%"/>
@@ -154,16 +158,16 @@
 				</table>
 				<ul class="panelBar">
 					<li class="center">
-						<button type="button" class="btn btn-base btn-lg" id="btnSearch">조회</button>
-						<button type="button" class="btn btn-gray btn-lg" onclick="$('#goodsCateForm')[0].reset();">초기화</button>
+						<button type="button" class="btn btn-gray btn-lg" onclick="$('#goodsSearchForm')[0].reset();" >초기화</button>
+						<button type="button" class="btn btn-info btn-lg" id="btnSearch" >조회</button>
 					</li>
 				</ul>
-			</form>
+			</div>
+			<!-- //검색조건 영역 -->
 		</div>
-		<!-- 검색조건 영역 -->
-
-		<!-- 리스트 영역 -->
+		<!-- 패널 영역1 -->
 		<div class="panelStyle">
+			<!-- 검색결과 영역 -->
 			<!-- 상단버튼 영역  -->
 			<ul class="panelBar">
 				<li>
@@ -186,94 +190,256 @@
 			<div id="gridList" style="width: 100%; height: 500px;" class="ag-theme-balham lh60"></div>
 			<ul class="panelBar">
 				<li class="center">
-					<div class="tablePaging" id="goodsCateListPagination"></div>
+					<div class="tablePaging" id="goodsCategoryListPagination"></div>
 				</li>
 			</ul>
 		</div>
-		<!-- //리스트 영역 -->
-
+	</form>
+	<!-- //패널 영역2 등록/수정 -->
+	<div class="panelStyle">
+		<form id="goodsCateForm" name="goodsCateForm" action="#" th:action="@{'/display/goods/category/save'}">
+			<table class="frmStyle">
+				<colgroup>
+					<col style="width:20%;"/>
+					<col style="width:20%;"/>
+					<col style="width:20%;"/>
+					<col style="width:20%;"/>
+					<col style="width:20%;"/>
+				</colgroup>
+				<tr>
+					<th>카테고리구분</th>
+					<th>카테고리1</th>
+					<th>카테고리2</th>
+					<th>카테고리3</th>
+					<th>카테고리4</th>
+				</tr>
+				<th:block th:each="num, index  : ${#numbers.sequence(1,4)}">
+					<tr>
+						<input type="hidden" name="selLvl" th:id="selLvl_+${num}"/>
+						<td>
+							<select name="cateGb" th:id="selCate1_+${num}" th:idx="${num}" th:onchange="|fnChangeSelect($(this).val(), ${num}, 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>
+						</td>
+						<td>
+							<select name="cate1No" th:id="selCate2_+${num}" th:onchange="|fnChangeSelect($(this).val(), ${num}, 2);|">
+								<option value="">[선택]</option>
+							</select>
+						</td>
+						<td>
+							<select name="cate2No" th:id="selCate3_+${num}" th:onchange="|fnChangeSelect($(this).val(), ${num}, 3);|">
+								<option value="">[선택]</option>
+							</select>
+						</td>
+						<td>
+							<select name="cate3No" th:id="selCate4_+${num}" th:onchange="|fnChangeSelect($(this).val(), ${num}, 4);|">
+								<option value="">[선택]</option>
+							</select>
+						</td>
+						<td>
+							<select name="cate4No" th:id="selCate5_+${num}" th:onchange="|fnChangeSelect($(this).val(), ${num}, 5);|">
+								<option value="">[선택]</option>
+							</select>
+							<input type="hidden" th:id='cateCd+${num}' name='cateCdArr' value='' />
+							<input type="hidden" th:id='cateGb+${num}' name='cateGbArr' value='' />
+							<input type="hidden" th:id='leafYn+${num}' value='' />
+							<input type="hidden" th:id='cateType+${num}' name='cateTypeArr' value='' />
+						</td>
+					</tr>
+				</th:block>
+			</table>
+		</form>
 	</div>
 
-<script th:inline="javascript">
-/*<![CDATA[*/
-	var columnDefs = [];
-	columnDefs = [
-		{width: 40, minWidth: 40, cellClass: 'text-right', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
-		{headerName: 'No', width: 60, cellClass: 'text-center',
-			valueGetter: function(params) { return cfnGridNumner('goodsCateForm',params.node.rowIndex, 'A');}
-		},
-		{headerName: "이미지", field: "sysImgNm", width: 100, height: 60, cellClass: 'text-center'
-			,cellRenderer: function(params) {
-				return '<img width="60" src="'+ _goodsUrl+ "/" + params.value + '" alt=""  onerror="this.src=\'/image/no.gif\';"/>';
-			}
-		},
-		{headerName: "상품코드", field: "goodsCd", width: 140, cellClass: 'text-center'
-			,cellRenderer: function(params) {
-				return '<a href="javascript:void(0);">' + params.value + '</a>';
-			}
-		},
-		{headerName: "상품명", field: "goodsNm", width: 200, cellClass: 'text-left'},
-		{headerName: "기존품목코드", field: "itemkindCd", width: 150, cellClass: 'text-center' }
-		/*{headerName: "품목명", field: "itemkindNm", width: 250, cellClass: 'text-left'},
-		{headerName: "기존품목코드", field: "itemkindCd", width: 150, cellClass: 'text-center' },
-		{headerName: "변경품목코드", field: "itemkindCdNew", width: 150, cellClass: 'text-center', editable : true,
-			cellEditor: 'textCellEditor',
-			cellEditorParams: { maxlength: 5, required: true, onblur: '$(this).val($(this).val().toUpperCase())' }
-		}*/
-	];
 
-	// Get GridOptions
-	var gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+	<script type="text/javascript" src="/ux/plugins/gaga/gaga.paging.js?v=2019072202"></script>
+	<script th:inline="javascript">
+		/*<![CDATA[*/
+		var goodsStatList = gagajf.convertToArray([[${goodsStatList}]]);
+		var columnDefs = [];
+		columnDefs = [
+			{width: 40, minWidth: 40, cellClass: 'text-right', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
+			{headerName: 'No', width: 60, cellClass: 'text-center',
+				valueGetter: function(params) { return cfnGridNumner('goodsSearchForm',params.node.rowIndex, 'A');}
+			},
+			{headerName: "이미지", field: "sysImgNm", width: 100, height: 60, cellClass: 'text-center'
+				,cellRenderer: function(params) {
+					return '<img width="60" src="'+ _goodsUrl+ "/" + params.value + '" alt=""  onerror="this.src=\'/image/no.gif\';"/>';
+				}
+			},
+			{headerName: "상품코드", field: "goodsCd", width: 140, cellClass: 'text-center'},
+			{headerName: "상품명", field: "goodsNm", width: 350, cellClass: 'text-left'
+				,cellRenderer: function(params) {
+					return '<a href="javascript:void(0);">' + params.value + '</a>';
+				}
+			},
+			{headerName: "할인율", field: "dcRate", width: 80, cellClass: 'text-right'},
+			{
+				headerName: "판매가", field: "currPrice", width: 100, cellClass: 'text-right',
+				valueFormatter: function(params) {
+					return Number(params.value).addComma();
+				}
+			},
+			{headerName: "상품상태", field: "goodsStat" , width: 100, cellClass: 'text-center',
+				cellEditorParams: { values: gagaAgGrid.extractValues(goodsStatList) },
+				valueFormatter: function (params) { return gagaAgGrid.lookupValue(goodsStatList, params.value); },
+				valueParser: function (params) { return gagaAgGrid.lookupKey(goodsStatList, params.newValue); }
+			},
+			//{headerName: "판매가능재고", field: "currStockQty", width: 100, cellClass: 'text-right'}, // 추후 추가해야함 ㅠㅠ
+			//{headerName: "품절여부", field: "soldoutYn", width: 80, cellClass: 'text-center'}, // 추후 추가해야함 ㅠㅠ
+			{headerName: "기존품목코드", field: "itemkindCd", width: 150, cellClass: 'text-center' }
+			/*{headerName: "품목명", field: "itemkindNm", width: 250, cellClass: 'text-left'},
+            {headerName: "기존품목코드", field: "itemkindCd", width: 150, cellClass: 'text-center' },
+            {headerName: "변경품목코드", field: "itemkindCdNew", width: 150, cellClass: 'text-center', editable : true,
+                cellEditor: 'textCellEditor',
+                cellEditorParams: { maxlength: 5, required: true, onblur: '$(this).val($(this).val().toUpperCase())' }
+            }*/
+		];
 
-	// 중복 선택 가능
-	gridOptions.rowSelection = 'multiple';
-	gridOptions.suppressRowClickSelection = true;
-	gridOptions.rowHeight = 60; //이미지가 있을경우 높이 지정해야함.
+		// Get GridOptions
+		var gridOptions = gagaAgGrid.getGridOptions(columnDefs);
 
-	gridOptions.stopEditingWhenGridLosesFocus = true;
+		// 중복 선택 가능
+		gridOptions.rowSelection = 'multiple';
+		gridOptions.suppressRowClickSelection = true;
+		gridOptions.rowHeight = 60; //이미지가 있을경우 높이 지정해야함.
 
-	// 조회
-	$('#btnSearch').on('click', function() {
-		// 검색조건 추가해야함 ㅠㅠ
+		gridOptions.stopEditingWhenGridLosesFocus = true;
 
-		$("#goodsCateForm input[name=searchGb]").val("BASIC");
-		fnSearch();
-	});
+		// 조회
+		$('#btnSearch').on('click', function() {
+			if(gagajf.isNull($("#goodsSearchForm select[name=supplyCompCd]").val())
+					&& gagajf.isNull($("#goodsSearchForm input[name=goodsCd]").val())
+					&& (gagajf.isNull($("#goodsSearchForm input[name=stDate]").val()) && gagajf.isNull($("#goodsSearchForm input[name=edDate]").val()))){
+				mcxDialog.alert('검색조건을 입력해 주세요.');
+				return;
+			}
 
-	$("#pageSize").on("change", function(){
-		var rowCnt = gridOptions.api.getDisplayedRowCount();
-		if(rowCnt > 0){
+			$('#goodsSearchForm input[name=changeableYn]').val($("#changeableYn").prop('checked')? 'N':'');
+			$('#goodsSearchForm input[name=returnableYn]').val($("#returnableYn").prop('checked')? 'N':'');
+			$('#goodsSearchForm input[name=returnFeeFreeYn]').val($("#returnFeeFreeYn").prop('checked')? 'Y':'');
+			$('#goodsSearchForm input[name=changeFeeFreeYn]').val($("#changeFeeFreeYn").prop('checked')? 'Y':'');
+			$("#goodsSearchForm input[name=searchGb]").val("BASIC");
 			fnSearch();
-		}
-	});
+		});
 
-	var fnSearch = function(){
-		gagaPaging.init('goodsCateForm', fnSearchCallBack, 'goodsCateListPagination', $('#goodsCateForm').find('#pageSize').val());
-		gagaPaging.load(1);
-	};
+		$("#pageSize").on("change", function(){
+			var rowCnt = gridOptions.api.getDisplayedRowCount();
+			if(rowCnt > 0){
+				fnSearch();
+			}
+		});
 
-	// 업체변경시
-	$('#goodsCateForm select[name=supplyCompCd]').on('change', function() {
-		var actionUrl = '/renderer/supplyCompany/brand/list/' + $(this).val();
+		var fnSearch = function(){
+			gagaPaging.init('goodsSearchForm', fnSearchCallBack, 'goodsCategoryListPagination', $('#goodsSearchForm').find('#pageSize').val());
+			gagaPaging.load(1);
+		};
 
-		if(sessRoleCd == "G001_B000"){
-			actionUrl = '/renderer/brand/AuthBrandlist';
+		var fnSearchCallBack = function(result){
+
+			$('#goodsSearchForm').find('#gridRowTotalCount').html(result.pageing.pageable.totalCount.addComma());
+			$('#goodsSearchForm').find('#pageNo').val(result.pageing.pageable.pageNo.addComma());
+			$('#goodsSearchForm').find('#pgNo').html(result.pageing.pageable.pageNo.addComma());
+			$('#goodsSearchForm').find('#endPgNo').html(result.pageing.pageable.totalPage.addComma());
+			gridOptions.api.setRowData(result.goodsCategoryList);
+			gagaPaging.createPagination(result.pageing.pageable);
 		}
-		$("#goodsCateForm select[name=brandCd] option:gt(0)").remove();
 
-		cfnCreateCombo(actionUrl, $('#goodsCateForm select[name=brandCd]'), "[전체]", "");
-	});
+		// 카테고리 selectBox 변경
+		var fnChangeSelect = function(val, cateIndex, selLvl){
+			console.log('val:::'+val);
+			console.log('cateIndex:::'+cateIndex);
+			console.log('selLvl:::'+selLvl);
+			$("#cateCd"+cateIndex).val('');
+			$("#cateGb"+cateIndex).val('');
+			$("#leafYn"+cateIndex).val('');
 
-$(document).ready(function() {
+			if (gagajf.isNull(val)) {
+				if (selLvl > 1) {
+					selLvl = selLvl - 1;
+					if(selLvl>1){
+						$("#cateCd"+cateIndex).val($("#selCate"+cateIndex+''+(selLvl-1)).val().split(',')[0]);
+						$("#leafYn"+cateIndex).val($("#selCate"+cateIndex+''+(selLvl-1)).val().split(',')[1]);
+					}
+				} else {
+					//selLvl = 1;
+					var html = '<option value="">[선택]</option>';
+					for(var i=1; i<5; i++){
+						$("#selCate"+i+'_'+cateIndex).html(html);
+					}
+					return;
+				}
+			}else if(selLvl>1){
+				$("#cateCd"+cateIndex).val(val.split(',')[0]);
+				$("#leafYn"+cateIndex).val(val.split(',')[1]);
+			}
+			$("#goodsCateForm input[name=selLvl]").val(selLvl);
+			$("#goodsCateForm input[name=cateIndex]").val(cateIndex);
 
-	cfnCreateCalendar('#sellTerms', 'searchStdt', 'searchEddt', true, '기간', 'X');
+			var cateGb = $('#selCate1_'+cateIndex).val();
+			var cate1No = $('#selCate2_'+cateIndex).val().split(',')[0];
+			var cate2No = $('#selCate3_'+cateIndex).val().split(',')[0];
+			var cate3No = $('#selCate4_'+cateIndex).val().split(',')[0];
+			var cate4No = $('#selCate5_'+cateIndex).val().split(',')[0];
+			$("#cateGb"+cateIndex).val(cateGb);
+			if(selLvl==5 || (val=='' && selLvl==4)){
+				return;
+			}
 
-	// Create a agGrid
-	gagaAgGrid.createGrid('gridList', gridOptions);
+			var data = { siteCd : 'G000_10'
+				, selLvl : selLvl
+				,cateGb : cateGb
+				,cate1No : cate1No
+				,cate2No : cate2No
+				,cate3No : cate3No
+				,cate4No : cate4No
+			};
+
+			var jsonData = JSON.stringify(data);
+			gagajf.ajaxJsonSubmit('/display/category/list', jsonData, fnChangeCate);
+		}
+
+		var fnChangeCate = function(data){
+			console.log('hereeeeeeeeeeeee');
+			/*
+			var selLvl = $("#saveForm input[name=selLvl]").val();
+			var cateIndex = $("#saveForm input[name=cateIndex]").val();
+			var html = '<option value="">[선택]</option>';
+			for(var i=1; i<6; i++){
+				if(i>selLvl){
+					$("#selCate"+cateIndex+''+i).html(html);
+				}
+			}
+			for(var i=0; i<data.length; i++){
+				var cd = '';
+				var nm = '';
+				var leafYn = '';
+				if(data[i].useYn=='Y'){
+					if(selLvl=='1'){
+						cd = data[i].cateGb;
+						nm = gagaAgGrid.lookupValue(cateGbList, cd);
+					}else{
+						cd = data[i].cateCd;
+						nm = data[i].cateNm;
+						leafYn = ','+data[i].leafYn;
+						$("#cateType"+cateIndex).val(data[i].cateType);
+					}
+					html += '<option value="'+cd+leafYn+'">['+cd+'] '+nm+'</option>';
+				}
+			}
+			$("#selCate"+cateIndex+''+selLvl).html(html);
+			*/
+		}
 
-});
+		$(document).ready(function() {
+			cfnCreateCalendar('#sellTerms', 'stDate', 'edDate', true, '기간', 'X');
+			// Create a agGrid
+			gagaAgGrid.createGrid('gridList', gridOptions);
+		});
 
-/*]]>*/
-</script>
+		/*]]>*/
+	</script>
+</div>
 
-</html>
+</html>