Parcourir la source

상품가격예약개발중

eskim il y a 5 ans
Parent
commit
586715d998

+ 50 - 0
style24.admin/src/main/java/com/style24/admin/biz/dao/TsaGoodsDao.java

@@ -10,6 +10,7 @@ import com.style24.persistence.domain.GoodsDesc;
 import com.style24.persistence.domain.GoodsEpSkip;
 import com.style24.persistence.domain.GoodsHst;
 import com.style24.persistence.domain.GoodsNotiInfo;
+import com.style24.persistence.domain.GoodsPriceRes;
 import com.style24.persistence.domain.GoodsResSell;
 import com.style24.persistence.domain.GoodsSearch;
 import com.style24.persistence.domain.GoodsTnmRes;
@@ -655,4 +656,53 @@ public interface TsaGoodsDao {
 	 */
 	void deleteNoticeGoods(NoticeGoods noticeGoods);
 
+	/**
+	 * 상품 가격예약 목록 건수
+	 *
+	 * @param goodsSearch
+	 * @return Integer
+	 * @author eskim
+	 * @since 2020. 11. 13
+	 */
+	int getGoodsPriceResCount(GoodsSearch goodsSearch);
+
+	/**
+	 * 상품 가격예약 목록
+	 *
+	 * @param goodsSearch
+	 * @return Collection<GoodsPriceRes>
+	 * @author eskim
+	 * @since 2020. 11. 13
+	 */
+	Collection<GoodsPriceRes> getGoodsPriceResList(GoodsSearch goodsSearch);
+
+	/**
+	 * 상품 가격예약 조회(기간 체크용)
+	 *
+	 * @param goodsPriceRes
+	 * @return int
+	 * @author eskim
+	 * @since 2020. 11. 13
+	 */
+	int getGoodsPriceResDupChkCount(GoodsPriceRes goodsPriceRes);
+
+	/**
+	 * 상품 가격예약 등록
+	 *
+	 * @param goodsPriceRes
+	 * @return void
+	 * @author eskim
+	 * @since 2020. 11. 13
+	 */
+	void createGoodPriceRes(GoodsPriceRes goodsPriceRes);
+
+	/**
+	 * 상품 가격예약 삭제
+	 *
+	 * @param goodsPriceRes
+	 * @return void
+	 * @author eskim
+	 * @since 2020. 11. 13
+	 */
+	void deleteGoodPriceRes(GoodsPriceRes goodsPriceRes);
 }

+ 80 - 0
style24.admin/src/main/java/com/style24/admin/biz/service/TsaGoodsService.java

@@ -23,6 +23,7 @@ import com.style24.persistence.domain.GoodsDesc;
 import com.style24.persistence.domain.GoodsEpSkip;
 import com.style24.persistence.domain.GoodsHst;
 import com.style24.persistence.domain.GoodsNotiInfo;
+import com.style24.persistence.domain.GoodsPriceRes;
 import com.style24.persistence.domain.GoodsResSell;
 import com.style24.persistence.domain.GoodsSearch;
 import com.style24.persistence.domain.GoodsTnmRes;
@@ -1787,4 +1788,83 @@ public class TsaGoodsService {
 		}
 
 	}
+
+	/**
+	 * 상품 가격예약 목록 건수
+	 *
+	 * @param goodsSearch
+	 * @return Integer
+	 * @author eskim
+	 * @since 2020. 11. 13
+	 */
+	public int getGoodsPriceResCount(GoodsSearch goodsSearch) {
+		return goodsDao.getGoodsPriceResCount(goodsSearch);
+	}
+
+	/**
+	 * 상품 가격예약 목록
+	 *
+	 * @param goodsSearch
+	 * @return Collection<TsaGoodsResSell>
+	 * @author eskim
+	 * @since 2020. 11. 13
+	 */
+	public Collection<GoodsPriceRes> getGoodsPriceResList(GoodsSearch goodsSearch) {
+		return goodsDao.getGoodsPriceResList(goodsSearch);
+	}
+
+	/**
+	 * 상품 가격예약 등록
+	 *
+	 * @param goodsPriceRes
+	 * @return void
+	 * @author eskim
+	 * @since 2020. 11. 13
+	 */
+	@Transactional("shopTxnManager")
+	public void createGoodPriceRes(GoodsPriceRes goodsPriceRes) {
+		if (goodsPriceRes.getArrGoodsCd().length <= 0) {
+			throw new IllegalStateException(message.getMessage("FAIL_1001"));
+		}
+
+		for (String goodsCd : goodsPriceRes.getArrGoodsCd()) {
+
+			goodsPriceRes.setGoodsCd(goodsCd);
+			goodsPriceRes.setRegNo(TsaSession.getInfo().getUserNo());
+			goodsPriceRes.setUpdNo(TsaSession.getInfo().getUserNo());
+
+			if(goodsDao.getGoodsPriceResDupChkCount(goodsPriceRes) > 0 ) {
+				throw new IllegalStateException("이미 등록된 상품 가격예약이 존재합니다. \n(상품코드 : " + goodsCd + ")");
+			}
+
+			goodsDao.createGoodPriceRes(goodsPriceRes);
+
+			Goods goods = new Goods();
+			goods.setRegNo(TsaSession.getInfo().getUserNo());
+			goods.setUpdNo(TsaSession.getInfo().getUserNo());
+			goods.setGoodsCd(goodsPriceRes.getGoodsCd());
+
+		}
+	}
+
+	/**
+	 * 상품 가격예약 삭제
+	 *
+	 * @param goodsPriceRes
+	 * @return void
+	 * @author eskim
+	 * @since 2020. 11. 13
+	 */
+	@Transactional("shopTxnManager")
+	public void deleteGoodsPriceRes(GoodsPriceRes goodsPriceRes) {
+		if (goodsPriceRes.getArrGoodsCd().length <= 0) {
+			throw new IllegalStateException(message.getMessage("FAIL_1001"));
+		}
+		int idx = 0;
+		for (String goodsCd : goodsPriceRes.getArrGoodsCd()) {
+			goodsPriceRes.setGoodsPriceResSq(goodsPriceRes.getArrGoodsPriceResSq()[idx]);
+			goodsDao.deleteGoodPriceRes(goodsPriceRes);
+			idx++;
+		}
+	}
 }

+ 118 - 0
style24.admin/src/main/java/com/style24/admin/biz/web/TsaGoodsController.java

@@ -33,6 +33,7 @@ import com.style24.persistence.domain.GoodsCompose;
 import com.style24.persistence.domain.GoodsEpSkip;
 import com.style24.persistence.domain.GoodsHst;
 import com.style24.persistence.domain.GoodsNotiInfo;
+import com.style24.persistence.domain.GoodsPriceRes;
 import com.style24.persistence.domain.GoodsResSell;
 import com.style24.persistence.domain.GoodsSearch;
 import com.style24.persistence.domain.GoodsTnmRes;
@@ -1683,4 +1684,121 @@ public class TsaGoodsController extends TsaBaseController {
 		return result;
 	}
 
+	/**
+	 * 상품 가격예약관리 화면
+	 *
+	 * @return
+	 * @author eskim
+	 * @since 2020. 11. 13
+	 */
+	@GetMapping("/price/reserve/form")
+	public ModelAndView priceReserveForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 사이트
+		mav.addObject("siteList", rendererService.getAvailCommonCodeList("G000"));
+		String supplyCompCd = "";
+		if ("G001_B000".equals(TsaSession.getInfo().getRoleCd())) {
+			supplyCompCd = TsaSession.getInfo().getSupplyCompCd();
+		}
+		// 공급업체
+		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(supplyCompCd));
+		// 상품상태
+		String[] exceptCds = {"G008_00"};
+		mav.addObject("goodsStatList", rendererService.getCommonCodeList("G008", "Y", exceptCds));
+		// 정상이월
+		mav.addObject("formalGbList", rendererService.getAvailCommonCodeList("G009"));
+		// 시즌
+		mav.addObject("seasonList", rendererService.getAvailCommonCodeList("G006"));
+		// 년도
+		int toYear = Integer.parseInt(GagaDateUtil.getToday("yyyy")) - 4;
+		mav.addObject("styleYearList", rendererService.getYearList(toYear,0,5));
+		// 사용여부
+		mav.addObject("useYnList", rendererService.getAvailCommonCodeList("G002"));
+		// 품목
+		mav.addObject("itemkindList", rendererService.getAllItemkindList());
+		// MD
+		mav.addObject("brandMdList", rendererService.getBrandMdList());
+
+		mav.setViewName("goods/GoodsPriceReserveForm");
+
+		return mav;
+	}
+
+	/**
+	 * 상품 가격예약 목록 조회
+	 *
+	 * @param goodsSearch
+	 * @return GagaMap
+	 * @author eskim
+	 * @since 2020. 11. 13
+	 */
+	@PostMapping("/price/reserve/list")
+	@ResponseBody
+	public GagaMap goodsPriceReserveList(@RequestBody GoodsSearch goodsSearch) {
+
+		GagaMap result = new GagaMap();
+
+		// 입점업체담당자는 업체코드 설정
+		if ("G001-B000".equals(TsaSession.getInfo().getRoleCd())) {
+			goodsSearch.setSupplyCompCd(TsaSession.getInfo().getSupplyCompCd());
+			goodsSearch.setMdNo(TsaSession.getInfo().getUserNo());
+		}
+
+		goodsSearch.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
+		goodsSearch.setPageable(new TsaPageRequest(goodsSearch.getPageNo() - 1, goodsSearch.getPageSize()));
+		goodsSearch.getPageable().setTotalCount(goodsService.getGoodsPriceResCount(goodsSearch));
+
+		result.set("pageing", goodsSearch);
+		result.set("goodsPriceResList", goodsService.getGoodsPriceResList(goodsSearch));
+
+		return result;
+	}
+
+	/**
+	 * 상품 가격예약 등록 화면
+	 *
+	 * @return
+	 * @author eskim
+	 * @since 2020. 11. 13
+	 */
+	@GetMapping("/price/reserve/regist/form")
+	@ResponseBody
+	public ModelAndView goodsPriceReserveRegistForm() {
+		ModelAndView mav = new ModelAndView();
+
+		mav.setViewName("goods/GoodsPriceReservePopupForm");
+		return mav;
+	}
+
+	/**
+	 * 상품 가격예약 저장
+	 *
+	 * @param goodsResSell
+	 * @return GagaResponse
+	 * @author eskim
+	 * @since 2020. 11. 13
+	 */
+	@PostMapping("/price/reserve/regist/save")
+	@ResponseBody
+	public GagaResponse saveGoodsPriceRes(@RequestBody GoodsPriceRes goodsPriceRes) {
+		goodsService.createGoodPriceRes(goodsPriceRes);
+		return super.ok(message.getMessage("SUCC_0001"));
+	}
+
+	/**
+	 * 상품 가격예약 삭제
+	 *
+	 * @param goodsResSell
+	 * @return GagaResponse
+	 * @author eskim
+	 * @since 2020. 11. 13
+	 */
+	@PostMapping("/price/reserve/delete")
+	@ResponseBody
+	public GagaResponse deleteGoodsPriceRes(@RequestBody GoodsPriceRes goodsPriceRes) {
+		goodsService.deleteGoodsPriceRes(goodsPriceRes);
+		return super.ok(message.getMessage("SUCC_0001"));
+	}
+
 }

+ 9 - 0
style24.admin/src/main/java/com/style24/persistence/domain/GoodsPriceRes.java

@@ -1,5 +1,6 @@
 package com.style24.persistence.domain;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.style24.persistence.TscBaseDomain;
 
 import lombok.Data;
@@ -24,4 +25,12 @@ public class GoodsPriceRes extends TscBaseDomain {
 	private String cfrmDt;
 	private String applyYn;
 
+	private String cfrmNm;
+
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] arrGoodsCd;
+
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private int[] arrGoodsPriceResSq;
+
 }

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

@@ -69,6 +69,8 @@ public class GoodsSearch extends TscBaseDomain {
 	private String applyFlag;
 	private String barcode;
 	private String dateGbn;
+	private String goodsTnmRes;
+	private int goodsPriceRes;
 
 	private String goodsType;
 	private String selfMallYn;

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

@@ -1712,6 +1712,9 @@
 		    <if test='beforSkipFlag != null and beforSkipFlag == "Y"'>
 		                               AND GR.APPLY_EDDT >= NOW() 
 		    </if>
+		    <if test="goodsTnmRes != null and goodsTnmRes != ''">
+		                               AND UPPER(GR.GOODS_TNM) LIKE CONCAT('%',UPPER(#{goodsTnmRes}),'%')
+		    </if>
 		</if>
 		<if test="searchGb != null and searchGb =='EXCEL'">
 		INNER JOIN (
@@ -1782,6 +1785,9 @@
 		            <if test='beforSkipFlag != null and beforSkipFlag == "Y"'>
 		                                       AND GR.APPLY_EDDT >= NOW() 
 		            </if>
+		            <if test="goodsTnmRes != null and goodsTnmRes != ''">
+		                                       AND UPPER(GR.GOODS_TNM) LIKE CONCAT('%',UPPER(#{goodsTnmRes}),'%')
+		            </if>
 		        </if>
 		        <if test="searchGb != null and searchGb =='EXCEL'">
 		        INNER JOIN (
@@ -2382,5 +2388,190 @@
 		AND GOODS_CD = #{goodsCd}
 	</delete>
 	
+	<!-- 상품 가격예약 목록 건수 -->
+	<select id="getGoodsPriceResCount" parameterType="GoodsSearch" resultType="int">
+		/* TsaGoods.getGoodsPriceResCount */
+		SELECT COUNT(*) AS TOTCNT
+		FROM TB_GOODS G
+		INNER JOIN TB_BRAND B ON G.BRAND_CD = B.BRAND_CD
+		INNER JOIN TB_SUPPLY_COMPANY S ON G.SUPPLY_COMP_CD = S.SUPPLY_COMP_CD
+		INNER JOIN TB_GOODS_PRICE_RES GR ON G.GOODS_CD = GR.GOODS_CD
+		<if test="searchGb == null or searchGb =='BASIC'" >
+		    <if test="applyStdt != null and applyStdt != ''">
+		                               AND GR.APPLY_EDDT >= DATE_FORMAT(#{applyStdt}, '%Y-%m-%d %H:%i:%S')
+		    </if>
+		    <if test="applyEddt != null and applyEddt != ''">
+		    <![CDATA[
+		                               AND GR.APPLY_STDT < DATE_FORMAT(DATE_ADD(#{applyEddt}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
+		    ]]>
+		    </if>
+		    <if test='beforSkipFlag != null and beforSkipFlag == "Y"'>
+		                               AND GR.APPLY_EDDT >= NOW() 
+		    </if>
+		</if>
+		<if test="searchGb != null and searchGb =='EXCEL'">
+		INNER JOIN (
+		            SELECT SEARCH_CD
+		                 , TMP_DISP_ORD
+		            FROM (
+		                  SELECT SEARCH_CD
+		                       , MIN(DISP_ORD) AS TMP_DISP_ORD
+		                  FROM TB_SEARCH_DATA
+		                  WHERE REG_NO = #{regNo}
+		                  GROUP BY SEARCH_CD) T
+		          ) SD
+		          ON ( (G.GOODS_CD LIKE CONCAT(SD.SEARCH_CD,'%')
+		               OR G.SUPPLY_GOODS_CD LIKE CONCAT(SD.SEARCH_CD,'%')) 
+		               <if test="mdNo != null and mdNo > 0">
+		               AND G.BRAND_CD IN (
+		                                  SELECT DISTINCT BRAND_CD
+		                                  FROM TB_BRAND_MD
+		                                  WHERE MD_NO = #{mdNo}
+		                                  )
+		              </if>
+		           )
+		</if>
+		WHERE 1=1
+		<if test="searchGb == null or searchGb =='BASIC'" >
+		<include refid="getGoodsListCondition_sql"/>
+		</if>
+	</select>
+
+	<!-- 상품 가격예약 목록 -->
+	<select id="getGoodsPriceResList" parameterType="GoodsSearch" resultType="GoodsPriceRes">
+		/* TsaGoods.getGoodsPriceResList */
+		SELECT Z.*
+		FROM (
+		    SELECT A.*, @rownum := @rownum + 1 AS RNUM FROM (
+		        SELECT
+		                G.GOODS_CD
+		              , B.BRAND_ENM
+		              , B.BRAND_GRP_NM
+		              , G.BRAND_CD
+		              , G.SUPPLY_COMP_CD
+		              , G.SUPPLY_GOODS_CD
+		              , G.GOODS_NM
+		              , G.GOODS_TNM
+		              , G.SELF_GOODS_YN
+		              , G.GOODS_STAT
+		              , GR.GOODS_PRICE_RES_SQ
+		              , GR.RES_GOODS_PRICE
+		              , GR.END_GOODS_PRICE
+		              , DATE_FORMAT(GR.APPLY_STDT,'%Y%m%d%H%i%S') AS APPLY_STDT
+		              , DATE_FORMAT(GR.APPLY_EDDT,'%Y%m%d%H%i%S') AS APPLY_EDDT
+		              , GR.CFRM_YN
+		              , GR.CFRM_NO
+		              , FN_GET_USER_NM(GR.REG_NO) AS CFRM_NM
+		              , DATE_FORMAT(GR.CFRM_DT,'%Y%m%d%H%i%S') AS CFRM_DT
+		              , GR.APPLY_YN
+		              , GR.REG_NO
+		              , FN_GET_USER_NM(GR.REG_NO) AS REG_NM
+		              , DATE_FORMAT(GR.REG_DT,'%Y%m%d%H%i%S') AS REG_DT
+		        FROM TB_GOODS G
+		        JOIN ( SELECT @rownum := 0) R
+		        INNER JOIN TB_BRAND B ON G.BRAND_CD = B.BRAND_CD
+		        INNER JOIN TB_SUPPLY_COMPANY S ON G.SUPPLY_COMP_CD = S.SUPPLY_COMP_CD
+		        INNER JOIN TB_GOODS_PRICE_RES GR ON G.GOODS_CD = GR.GOODS_CD
+		        <if test="searchGb == null or searchGb =='BASIC'" >
+		            <if test="applyStdt != null and applyStdt != ''">
+		                                       AND GR.APPLY_EDDT >= DATE_FORMAT(#{applyStdt}, '%Y-%m-%d %H:%i:%S')
+		            </if>
+		            <if test="applyEddt != null and applyEddt != ''">
+		            <![CDATA[
+		                                       AND GR.APPLY_STDT < DATE_FORMAT(DATE_ADD(#{applyEddt}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
+		            ]]>
+		            </if>
+		            <if test='beforSkipFlag != null and beforSkipFlag == "Y"'>
+		                                       AND GR.APPLY_EDDT >= NOW() 
+		            </if>
+		        </if>
+		        <if test="searchGb != null and searchGb =='EXCEL'">
+		        INNER JOIN (
+		                    SELECT SEARCH_CD
+		                         , TMP_DISP_ORD
+		                    FROM (
+		                          SELECT SEARCH_CD
+		                               , MIN(DISP_ORD) AS TMP_DISP_ORD
+		                          FROM TB_SEARCH_DATA
+		                          WHERE REG_NO = #{regNo}
+		                          GROUP BY SEARCH_CD) T
+		                  ) SD
+		                  ON ( (G.GOODS_CD LIKE CONCAT(SD.SEARCH_CD,'%')
+		                       OR G.SUPPLY_GOODS_CD LIKE CONCAT(SD.SEARCH_CD,'%')) 
+		                       <if test="mdNo != null and mdNo > 0">
+		                      AND G.BRAND_CD IN (
+		                                          SELECT DISTINCT BRAND_CD
+		                                          FROM TB_BRAND_MD
+		                                          WHERE MD_NO = #{mdNo}
+		                                          )
+		                      </if>
+		                   )
+		        </if>
+		        WHERE 1=1
+		        <if test="searchGb == null or searchGb =='BASIC'" >
+		        <include refid="getGoodsListCondition_sql"/>
+		        ORDER BY  GR.APPLY_STDT DESC, GR.APPLY_EDDT DESC, G.GOODS_CD, GR.GOODS_TNM_RES_SQ
+		        </if>
+		        <if test="searchGb != null and searchGb =='EXCEL'">
+		        ORDER BY SD.TMP_DISP_ORD
+		        </if>
+		<include refid="getListPagingCondition_sql"/>
+	</select>
+
+	<!-- 상품 가격예약 조회(기간 체크용) -->
+	<select id="getGoodsPriceResDupChkCount" parameterType="GoodsPriceRes" resultType="int">
+		/* TsaGoods.getGoodsPriceResDupChkCount */
+		SELECT COUNT(GOODS_CD)
+		FROM TB_GOODS_PRICE_RES
+		WHERE 1=1
+		<![CDATA[
+		AND APPLY_STDT <= DATE_FORMAT(#{applyStdt}, '%Y%m%d%H%i%S')
+		]]>
+		AND APPLY_EDDT >= DATE_FORMAT(#{applyEddt},'%Y%m%d%H%i%S')
+	</select>
+
+	<!-- 상품 가격예약 등록 -->
+	<insert id="createGoodPriceRes" parameterType="GoodsPriceRes">
+		/* TsaGoods.createGoodPriceRes */
+		INSERT INTO TB_GOODS_PRICE_RES (
+		  GOODS_PRICE_RES_SQ
+		, GOODS_CD
+		, RES_GOODS_PRICE
+		, END_GOODS_PRICE
+		, APPLY_STDT
+		, APPLY_EDDT
+		, CFRM_YN
+		, CFRM_NO
+		, CFRM_DT
+		, APPLY_YN
+		, REG_NO
+		, REG_DT
+		, UPD_NO
+		, UPD_DT
+		)
+		VALUES(
+		  NULL
+		, #{goodsCd}
+		, #{resGoodsPrice}
+		, #{endGoodsPrice}
+		, STR_TO_DATE(#{applyStdt},'%Y%m%d%H%i%S')
+		, STR_TO_DATE(#{applyEddt},'%Y%m%d%H%i%S')
+		, #{cfrmYn}
+		, #{cfrmNo}
+		, #{cfrmDt}
+		, #{applyYn}
+		, #{regNo}
+		, NOW()
+		, #{updNo}
+		, NOW()
+		)
+	</insert>
+
+	<!-- 상품 가격예약 삭제 -->
+	<delete id="deleteGoodPriceRes" parameterType="GoodsPriceRes">
+		/* TsaGoods.deleteGoodPriceRes */
+		DELETE FROM TB_GOODS_PRICE_RES
+		WHERE GOODS_PRICE_RES_SQ = #{goodsPriceResSq}
+	</delete>
 
 </mapper>

+ 2 - 2
style24.admin/src/main/webapp/WEB-INF/views/goods/GoodsDetailForm.html

@@ -208,7 +208,7 @@
 											<input type="hidden" id="listPrice" name="listPrice"/>
 										</td>
 										<th>판매가<em class="required" title="필수"></em></th>
-										<td><input type="text" class="w80p aR" id="currPrice" name="currPrice" maxlength="10" data-valid-type="integer"/> 원
+										<td><input type="text" class="w80p aR" id="currPrice" name="currPrice" maxlength="10" data-valid-type="numeric"/> 원
 											<input type="hidden" id="currPriceOrg" name="currPriceOrg"/>
 										</td>
 										<th>할인율</th>
@@ -263,7 +263,7 @@
 										</td>
 										<th>무료배송비기준<em class="required" title="필수"></em></th>
 										<td>
-											<input type="text" class="w100 aR" id="minOrdAmt" name="minOrdAmt" data-valid-type="real" maxlength="10"/> 원
+											<input type="text" class="w100 aR" id="minOrdAmt" name="minOrdAmt" data-valid-type="numeric" maxlength="10"/> 원
 											<input type="hidden" id="minOrdAmtOrg" name="minOrdAmtOrg"/>
 										</td>
 									</tr>

+ 438 - 0
style24.admin/src/main/webapp/WEB-INF/views/goods/GoodsPriceReserveForm.html

@@ -0,0 +1,438 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : GoodsPriceReserveForm.html
+ * @desc    : 상품 가격 예약관리
+ *============================================================================
+ * PASTEL
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2020.11.13   eskim       최초 작성
+ *******************************************************************************
+ -->
+	<div id="main">
+		<!-- 메인타이틀 영역 -->
+		<div class="main-title">
+		</div>
+		<!-- //메인타이틀 영역 -->
+		<!-- 메뉴 설명 -->
+		<div class="infoBox menu-desc">
+		</div>
+		<form id="goodsPriceResForm" name="goodsPriceResForm" action="#" th:action="@{'/goods/price/reserve/list'}">
+		<input type="hidden" id="searchGb" name="searchGb" />
+		<input type="hidden" id="arrGoodsCd" name="arrGoodsCd" />
+ 		<!-- 패널 영역1 -->
+		<div class="panelStyle" >
+			<!-- TITLE -->
+			<div class="panelTitle">
+				<h3><i class="fa fa-info-circle"></i>아래 검색조건 중 하나를 꼭 입력해 주세요.</h3>
+			</div>
+			<!-- //TITLE -->
+			<div class="panelContent">
+				<table class="frmStyle">
+					<colgroup>
+						<col width="8%"/>
+						<col width="10%"/>
+						<col width="8%"/>
+						<col width="10%"/>
+						<col width="8%"/>
+						<col width="20%"/>
+						<col width="8%"/>
+						<col/>
+					</colgroup>
+					<tr>
+						<th>업체/브랜드</th>
+						<td colspan="5">
+							<select name="supplyCompCd" id="supplyCompCd">
+								<option value="" th:if="${sessionInfo.roleCd} != 'G001_B000'">[전체]</option>
+								<option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+							</select>
+							<span id="multiBrand"></span>
+						</td>
+						<th rowspan="2">키워드</th>
+						<td rowspan="2">
+							<select name="search" id="search">
+								<option value="searchGoodsCd">상품코드</option>
+								<option value="searchGoodsNum">품번</option>
+								<option value="searchSupplyGoodsCd">업체상품코드</option>
+							</select>
+							<textarea class="textareaR2 w50p" name="condition" id="condition"></textarea>
+						</td>
+					</tr>
+					<tr>
+						<th>상품명</th>
+						<td>
+							<input type="text" class="w200" name="goodsNm" id="goodsNm" maxlength="50"/>
+						</td>
+						<th>예약가격</th>
+						<td>
+							<input type="text" class="w200" name="goodsPriceRes" id="goodsPriceRes" maxlength="10" data-valid-type="integer"/>
+						</td>
+						<th>시즌/년도</th>
+						<td>
+							<select  name="styleYear" id="styleYear">
+								<option value="">[전체]</option>
+								<option th:if="${styleYearList}" th:each="oneData, status : ${styleYearList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+							</select>
+							<select  name="seasonCd" id="seasonCd">
+								<option value="">[전체]</option>
+								<option th:if="${seasonList}" th:each="oneData, status : ${seasonList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+							</select>
+						</td>
+					</tr>
+					<tr>
+						<th>예약일</th>
+						<td colspan="7" id="sellTerms"></td>
+					</tr>
+				</table>
+				<ul class="panelBar">
+					<li class="center">
+						<button type="button" class="btn btn-gray btn-lg" id="btnInit" >초기화</button>
+						<button type="button" class="btn btn-info btn-lg" id="btnSearch" >조회</button>
+					</li>
+				</ul>	
+			</div>
+			<!-- //검색조건 영역 -->
+		</div>
+		<!-- 패널 영역1 -->
+		<div class="panelStyle">
+			<!-- 검색결과 영역 -->
+			<!-- 상단버튼 영역  -->
+			<ul class="panelBar">
+				<li>
+					<button type="button" class="btn btn-default btn-lg" onclick="cfnDownloadSampleFile('SF003');">상품엑셀조회 양식 다운로드</button>
+					<button type="button" class="btn btn-base btn-lg" id="btnGoodsExcelUpLoad">엑셀조회</button>
+					<button type="button" class="btn btn-success  btn-lg" id="btnGoodsPriceResSave">예약등록</button>
+					<button type="button" class="btn btn-danger btn-lg" id="btnGoodsPriceResDelete">예약삭제</button>
+				</li>
+				<li class="right">
+					검색결과 : <strong><span id="gridRowTotalCount">0</span> 건</strong>&nbsp;
+					
+					쪽번호 <span id="pgNo">0</span>/ <strong id="endPgNo">0</strong>&nbsp;&nbsp;
+					<select id="pageSize" name="pageSize">
+						<option value="50" selected="selected">50개씩 보기</option>
+						<option value="100">100개씩 보기</option>
+						<option value="500">500개씩 보기</option>
+						<option value="1000">1000개씩 보기</option>
+					</select>
+					<input type="hidden" name="pageNo" id="pageNo" value ="1"/>
+				</li>
+			</ul>
+			<!-- //상단버튼 영역  -->
+			<div id="gridList" style="width: 100%; height: 550px;" class="ag-theme-balham"></div>
+			<ul class="panelBar">
+				<li class="center">
+					<div class="tablePaging" id="goodsListPagination"></div>
+				</li>
+			</ul>
+			<!-- 검색결과 영역 -->
+		</div>
+		</form>
+		<!-- //패널 영역2 -->
+	</div>
+<script type="text/javascript" src="/ux/plugins/gaga/gaga.paging.js?v=2019072202"></script>
+<script th:inline="javascript">
+/*<![CDATA[*/
+	var sessRoleCd = [[${sessionInfo.roleCd}]];
+	var goodsStatList = gagajf.convertToArray([[${goodsStatList}]]);
+	var formalGbList = gagajf.convertToArray([[${formalGbList}]]);
+
+	var 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('goodsPriceResForm',params.node.rowIndex, 'A');}
+		},
+		{headerName: "브랜드명", field: "brandGrpNm", width: 130, cellClass: 'text-center'},
+		{headerName: "상품코드", field: "goodsCd", width: 140, cellClass: 'text-center'},
+		{headerName: "상품명", field: "goodsNm", width: 180, cellClass: 'text-left'
+			,cellRenderer: function(params) {
+				return '<a href="javascript:void(0);">' + params.value + '</a>';
+			}
+		},
+		{headerName: "상품타이틀", field: "goodsTnm", width: 200, cellClass: 'text-left'},
+		{headerName: "예약상품타이틀", field: "regGoodsTnm", width: 200, cellClass: 'text-left'},
+		{headerName: "예약시작일시", field: "applyStdt", width: 150, cellClass: 'text-center',
+			cellRenderer: function(params) {
+				return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss") : '';
+			}
+		},
+		{headerName: "예약종료일시", field: "applyEddt", width: 150, cellClass: 'text-center',
+			cellRenderer: function(params) {
+				return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss") : '';
+			}
+		},
+		{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: "regDt", width: 150, cellClass: 'text-center',
+			cellRenderer: function(params) {
+				return !gagajf.isNull(params.value) ? params.value.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss") : '';
+			}
+		},
+		{headerName: "등록자", field: "regNm", width: 100, cellClass: 'text-center'},
+		{headerName: "상품타이틀예약순번", field: "goodsPriceResSq", hide: true}
+	];
+	
+	// Get GridOptions
+	var gridOptions = gagaAgGrid.getGridOptions(columnDefs);
+
+	// 중복 선택 가능
+	gridOptions.rowSelection = 'multiple';
+	gridOptions.suppressRowClickSelection = true;
+	//gridOptions.rowHeight = 60; //이미지가 있을경우 높이 지정해야함.
+
+	// Row Click
+	gridOptions.onCellClicked = function(event) {
+		var goodsCd = event.data.goodsCd;
+		if (event.colDef.field == "goodsNm"){
+			cfnOpenGoodsDetailPopup('U',goodsCd);
+		}else if (event.colDef.field == "goodsCd"){
+			
+		}
+	}
+
+	// 초기화 클릭시
+	$('#btnInit').on('click', function() {
+		fnInit();
+	});
+	
+	var fnInit = function(){
+		$("#goodsPriceResForm input[name=siteCd]").prop("disabled", true);
+		$("#goodsPriceResForm input[name=siteCd]").addClass("formControl");
+		
+		$('#goodsPriceResForm')[0].reset();
+		//$("#goodsPriceResForm input[type=radio]").removeClass("checked");
+		$("#goodsPriceResForm input[type=checkbox]").removeClass("checked");
+		//$("#goodsPriceResForm input[type=radio]").parent("label").removeClass("checked");
+		$("#goodsPriceResForm input[type=checkbox]").parent("label").removeClass("checked");
+		$("#goodsPriceResForm input[type=radio][checked]").parent("label").addClass("checked");
+		$("#multiBrand").empty();
+	}
+	
+	// 조회클릭시
+	$('#btnSearch').on('click', function() {
+		$("#goodsPriceResForm input[name=pageNo]").val('1');
+		fnGoodsPriceSearch('BASIC');
+	});
+
+	// 조회
+	var fnGoodsPriceSearch = function(gbn) {
+		
+		if (typeof(gbn) != 'undefined' &&  gbn == 'EXCEL'){
+			$("#goodsPriceResForm input[name=searchGb]").val("EXCEL");
+		}else{
+			$("#goodsPriceResForm input[name=searchGb]").val("BASIC");
+		}
+		
+		if(!fnConditionCheck()) return;
+		
+		gagaPaging.init('goodsPriceResForm', fnSearchCallBack, 'goodsListPagination', $('#goodsPriceResForm').find('#pageSize').val());
+		gagaPaging.load($("#goodsPriceResForm input[name=pageNo]").val());
+	}
+
+	// 조회 (등록 창 닫을 때)
+	var fnGoodsRsvtTnmListSearch = function(gbn) {
+
+		if (typeof(gbn) != 'undefined' &&  gbn == 'EXCEL'){
+			$("#goodsPriceResForm input[name=searchGb]").val("EXCEL");
+		}else{
+			$("#goodsPriceResForm input[name=searchGb]").val("BASIC");
+		}
+
+		gagaPaging.init('goodsPriceResForm', fnSearchCallBack, 'goodsListPagination', $('#goodsPriceResForm').find('#pageSize').val());
+		gagaPaging.load($("#goodsPriceResForm input[name=pageNo]").val());
+	}
+
+	//검색 조건 확인
+	var fnConditionCheck = function(){
+		var formId = '#goodsPriceResForm';
+		var form = document.goodsPriceResForm;
+
+		if($("#goodsPriceResForm input[name=searchGb]").val() == "EXCEL") return true;
+		
+		var searchFlag = false;
+		var cnt = 0;
+
+		/* if( !gagajf.isNull($("#goodsPriceResForm select[name=supplyCompCd]").val())
+				|| !gagajf.isNull($("#goodsPriceResForm input[name=condition]").val())
+				|| (!gagajf.isNull($("#goodsPriceResForm input[name=stDate]").val()) && !gagajf.isNull($("#goodsPriceResForm input[name=edDate]").val()))
+			){
+			searchFlag = true;
+		}else{ */
+			for (i = 0; i < form.elements.length; i++ ) {
+				var el = form.elements[i];
+				if ($(el).prop("type") == "text" || $(el).prop("type") == "textarea" || ($(el).prop("type") == "select-one" && el.name != "search" && el.name != "pageSize")) {
+					if (!(el.value == null || el.value == "")) {
+						cnt++;
+					}
+				}
+			}
+			
+			if(cnt > 0) searchFlag = true;
+			
+		/* } */
+		
+		if(searchFlag == false){
+			mcxDialog.alert("검색조건을 입력하세요.");
+			return false;
+		}
+		
+		var fromDate = $('#goodsPriceResForm input[name=stDate]').val();
+		var toDate = $('#goodsPriceResForm input[name=edDate]').val();
+		
+		if (!gagajf.isNull(fromDate) || !gagajf.isNull(toDate)) {
+			
+			if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
+				mcxDialog.alertC("등록일 조회시 시작일자와 종료일자를 입력하세요.", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#goodsPriceResForm input[name=stDate]').focus();
+					}
+				});
+				return false;
+			}
+
+			if (fromDate > toDate) {
+				mcxDialog.alert("노출기간 시작일자는 종료일자 보다 클 수 없습니다.", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#goodsPriceResForm input[name=stDate]').focus();
+					}
+				});
+				return false;
+			} 
+		}
+
+		return true;
+	}
+	
+	var fnSearchCallBack = function(result){
+
+		$('#goodsPriceResForm').find('#gridRowTotalCount').html(result.pageing.pageable.totalCount.addComma());
+		$('#goodsPriceResForm').find('#pageNo').val(result.pageing.pageable.pageNo.addComma());
+		$('#goodsPriceResForm').find('#pgNo').html(result.pageing.pageable.pageNo.addComma());
+		$('#goodsPriceResForm').find('#endPgNo').html(result.pageing.pageable.totalPage.addComma());
+		gridOptions.api.setRowData(result.goodsPriceResList);
+		gagaPaging.createPagination(result.pageing.pageable);
+	}
+	
+	//페이징 
+	$('#goodsPriceResForm select[name=pageSize]').on('change', function() {
+		$("#goodsPriceResForm input[name=pageNo]").val('1');
+		fnGoodsPriceSearch($("#goodsPriceResForm input[name=searchGb]").val());
+	});
+	
+	//업체변경시
+	$('#goodsPriceResForm select[name=supplyCompCd]').on('change', function() {
+		var actionUrl = '/renderer/supplyCompany/brand/list/' + $(this).val();
+
+		if(sessRoleCd == "G001_B000"){
+			actionUrl = '/renderer/brand/AuthBrandlist';
+		}
+		cfnCreateMultiCombo(actionUrl,"multiBrand",  "[전체]",null, 'Y');
+	});
+	
+	//엑셀 상품 조회
+	$('#btnGoodsExcelUpLoad').on('click', function() {
+		cfnExcelUploadPopup('goodsPriceExcelUpload', 'goodsPriceExcelUpload');
+	});
+	
+	var goodsPriceExcelUpload = function(result){
+		var data = {procJob : result.procJob
+					,excelFileNm : result.excelFileNm
+					};
+		var jsonData = JSON.stringify(data);
+		gagajf.ajaxJsonSubmit('/goods/search/excelupload/save', jsonData, fnGoodsPriceExcelUploadCallBack);
+	}
+	
+	var fnGoodsPriceExcelUploadCallBack = function(result){
+		fnGoodsPriceSearch("EXCEL");
+	}
+	
+	//예약등록 팝업
+	$('#btnGoodsPriceResSave').click(function(e) {
+		var actionUrl = "/goods/price/reserve/popup/form";
+		cfnOpenModalPopup(actionUrl, 'popupGoodsPriceReserve'); 
+	});
+	
+	//예약삭제
+	$('#btnGoodsPriceResDelete').click(function(e) {
+		//상품선택여부 확인처리 추가
+		var selectedData = gridOptions.api.getSelectedRows();
+
+		if (selectedData.length == 0) {
+			mcxDialog.alert('선택된 행이 없습니다.');
+			return false;
+		}
+		
+		var arrGoodsCd = [];
+		var arrGoodsPriceResSq = [];
+		var chkFlag = false;
+		//selectedData = gagaAgGrid.getAllRowData(gridOptions);
+		$.each(selectedData, function(idx, item) {
+			
+			if (gagajf.isNull(item.goodsPriceResSq) || item.goodsPriceResSq == "0"){
+				chkFlag = true;
+				mcxDialog.alert(item.goodsCd +"상품은 가격이 예약된 상품이 아닙니다.");
+				return false;
+			}
+			
+			var toDateStr = new Date().format("YYYYMMDDHHmmss");
+			if (toDateStr > item.applyEddt){
+				chkFlag = true;
+				mcxDialog.alertC("종료된 예약 상품은 삭제할 수 없습니다.", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#goodsRsvtTnmForm input[name=applyEdYMD]').focus();
+					}
+				});
+				return false;
+			}
+		
+			arrGoodsCd.push(item.goodsCd);
+			arrGoodsPriceResSq.push(item.goodsPriceResSq);
+		});
+
+		if (chkFlag){
+			return;
+		}
+		
+		mcxDialog.confirm('삭제하시겠습니까?',  {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function(){
+				var data = {arrGoodsCd : arrGoodsCd
+						,arrGoodsPriceResSq : arrGoodsPriceResSq
+			};
+			
+			var jsonData = JSON.stringify(data);
+			gagajf.ajaxJsonSubmit('/goods/title/reserve/delete', jsonData, fnGoodsPriceResDeleteCollBack);
+			}
+		});
+	});
+	
+	var fnGoodsPriceResDeleteCollBack = function(){
+		//fnGoodsRsvtTnmListSearch($("#goodsPriceResForm input[name=searchGb]").val());
+	}
+	
+	$(document).ready(function() {
+
+		cfnCreateCalendar('#sellTerms', 'applyStdt', 'applyEddt', true, '예약일', 'X');
+		var chkBeforSkipFlag = '&nbsp;&nbsp;<label class="chkBox"><input type="checkbox" name="beforSkipFlag" value="Y" >이전데이터 제외</label>';
+		$("#goodsPriceResForm").find('#sellTerms').append(chkBeforSkipFlag);
+		
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridList', gridOptions);
+
+	});
+
+/*]]>*/
+</script>
+ 	
+</html>

+ 305 - 0
style24.admin/src/main/webapp/WEB-INF/views/goods/GoodsPriceReservePopupForm.html

@@ -0,0 +1,305 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : GoodsPriceReservePopupForm.html
+ * @desc    : 상품 가격 예약등록 화면
+ *============================================================================
+ * PASTEL
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2020.11.13   eskim       최초 작성
+ *******************************************************************************
+ -->	
+	<div class="modalPopup" data-width="850" >
+		<div class="panelStyle">
+			<div class="panelTitle">
+				<h2>상품가격예약</h2>
+				<button type="button" class="close" onclick="uifnPopupClose('popupGoodsPriceReserve')"><i class="fa fa-times"></i></button>
+			</div>
+			<form id="goodsPriceRsvtForm" name="goodsPriceRsvtForm" >
+			<div class="panelContent">
+				<table class="frmStyle">
+					<colgroup>
+						<col style="width:10%;"/>
+						<col/>
+					</colgroup>
+					<tr>
+						<th>상품가격<em class="required" title="필수"></em></th>
+						<td><input type="text" class="w100p" id="goodsPrice" name="goodsPrice"  maxlength="10" /></td>
+					</tr>
+					<tr>
+						<th>예약일시<em class="required" title="필수"></em></th>
+						<td>
+							<input name="applyStYMD" id="applyStYMD" type="text" class="w80 schDate" maxlength="10" required="required" data-valid-name="예약시작일" />
+							<select name="applyStHH" id="applyStHH" required="required" data-valid-name="예약 시작시간">
+								<th:block th:each="num, index  : ${#numbers.sequence(0,23)}">
+								<option  th:value="${#numbers.formatInteger(num,2)}" th:text="|${#numbers.formatInteger(num,2)}시|" >시간</option>
+								</th:block>
+							</select>
+							<input name="applyStdt" id="applyStdt" type="hidden" />
+							~
+							<input name="applyEdYMD" id="applyEdYMD" type="text" class="w80 schDate" maxlength="10" required="required" data-valid-name="예약 종료일" />
+							<select name="applyEdHH" id="applyEdHH" required="required" data-valid-name="예약 종료시간">
+								<th:block th:each="num: ${#numbers.sequence(0,23)}">
+								<option  th:value="${#numbers.formatInteger(num,2)}"  th:text="|${#numbers.formatInteger(num,2)}시|" th:selected="${#numbers.formatInteger(num,2)}==23 ? 'true'">시간</option>
+								</th:block>
+							</select>
+							<input name="applyEddt" id="applyEddt" type="hidden" />
+						</td>
+					</tr>
+				</table>
+			</div>
+			<ul class="panelBar">
+				<li class="left">
+					<button type="button" class="btn btn-danger btn-lg" id="btnDeleteGoodsRsvtTnm">상품삭제</button>
+				</li>
+				<li class="right">
+					<button type="button" class="btn btn-base btn-lg" id="btnSearchExcel">엑셀조회</button>
+					<button type="button" class="btn btn-info btn-lg" id="btnSearchGoods">상품조회</button>
+				</li>
+			</ul>
+			<div id="gridGoodsRsvtTnmList" style="width: 100%; height: 400px;" class="ag-theme-balham"></div>
+			<ul class="panelBar">
+				<li class="right">
+					<button type="button" class="btnRight btn btn-base btn-lg" id="btnSaveGoodsRsvtTnm">적용</button>
+				</li>
+			</ul>
+			</form>	
+		</div>
+	</div>
+<script th:inline="javascript">
+/*<![CDATA[*/
+	
+	var rsvtGoodsTnmColumnDefs = [
+		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
+		{headerName: 'No', width: 50, cellClass: 'text-center',valueGetter: function(params) { return params.node.rowIndex+1}},
+		{headerName: "상품코드", field: "goodsCd", width: 140, cellClass: 'text-center'},
+		{headerName: "상품명", field: "goodsNm", width: 330, cellClass: 'text-left'},
+		{headerName: "현재상품타이틀", field: "goodsTnm", width: 250, cellClass: 'text-left'}
+	];
+	
+	// Get GridOptions
+	var rsvtGoodsTnmGridOptions = gagaAgGrid.getGridOptions(rsvtGoodsTnmColumnDefs);
+	rsvtGoodsTnmGridOptions.enableBrowserTooltips = true;
+	
+	// 중복 선택 가능
+	rsvtGoodsTnmGridOptions.rowSelection = 'multiple';
+	rsvtGoodsTnmGridOptions.suppressRowClickSelection = true;
+	//rsvtGoodsTnmGridOptions.rowHeight = 60; //이미지가 있을경우 높이 지정해야함.
+
+	// 상품 조회 클릭 시
+	$('#btnSearchGoods').on('click', function() {
+		cfnOpenGoodsPopup('fnSearchGoods');
+	});
+
+	// 상품 조회 콜백함수
+	var fnSearchGoods = function(result) {
+		if (result.length < 1) return;
+		var oldData = gagaAgGrid.getAllRowData(rsvtGoodsTnmGridOptions);
+		$.each(result, function(idx, item) {
+			var isInvalid = false;
+			if (oldData != null && oldData.length != 0){
+				oldData.forEach(function(oneData){
+					if(oneData.goodsCd == item.goodsCd){
+						isInvalid = true;
+						return true;
+					}
+				});
+				if(isInvalid){
+					return isInvalid;
+				}
+			}
+			gagaAgGrid.addRowData(rsvtGoodsTnmGridOptions, {"goodsCd" : item.goodsCd, "goodsNm" : item.goodsNm, "goodsTnm" : item.goodsTnm});
+		});
+		uifnPopupClose('popupGoods');
+		return false;
+	};
+
+	// 저장 클릭 시
+	$('#btnSaveGoodsRsvtTnm').on('click', function() {
+
+		var allRowData = gagaAgGrid.getAllRowData(rsvtGoodsTnmGridOptions);
+
+		if(allRowData.length == 0){
+			mcxDialog.alertC("상품을 조회한 후 추가해주세요.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+				}
+			});
+			return;
+		}
+
+		if(gagajf.isNull($("#goodsPriceRsvtForm input[name=goodsTnm]").val())) {
+			mcxDialog.alertC("상품 타이틀을 입력하세요.",{
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$("#goodsPriceRsvtForm input[name=goodsTnm]").focus();
+				}
+			});
+			return false;
+		}
+
+		var fromDate = $('#goodsPriceRsvtForm input[name=applyStYMD]').val();
+		var toDate = $('#goodsPriceRsvtForm input[name=applyEdYMD]').val();
+
+		if (gagajf.isNull(fromDate)) {
+			mcxDialog.alertC("예약  시작일자를 입력하세요.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$('#goodsPriceRsvtForm input[name=applyStYMD]').focus();
+				}
+			});
+			return false;
+		}
+
+		if (gagajf.isNull(toDate)) {
+			mcxDialog.alertC("예약  종료일자를 입력하세요.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$('#goodsPriceRsvtForm input[name=applyEdYMD]').focus();
+				}
+			});
+			return false;
+		}
+
+		if (fromDate > toDate) {
+			mcxDialog.alertC("예약 시작일자는 종료일자 보다 클 수 없습니다.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$('#goodsPriceRsvtForm input[name=applyEdYMD]').focus();
+				}
+			});
+			return false;
+		}
+
+		var applyStdt = $('#goodsPriceRsvtForm input[name=applyStYMD]').val().replaceAll("-","") +
+		$('#goodsPriceRsvtForm select[name=applyStHH]').val() + "0000";
+
+		var applyEddt = $('#goodsPriceRsvtForm input[name=applyEdYMD]').val().replaceAll("-","") +
+		$('#goodsPriceRsvtForm select[name=applyEdHH]').val() +"5959";
+
+		$('#goodsPriceRsvtForm input[name=applyStdt]').val(applyStdt);
+		$('#goodsPriceRsvtForm input[name=applyEddt]').val(applyEddt);
+
+		if ($('#goodsPriceRsvtForm input[name=applyStdt]').val() > $('#goodsPriceRsvtForm input[name=applyEddt]').val()) {
+			mcxDialog.alertC("예약 시작일자는 종료일자 보다 클 수 없습니다.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$('#goodsPriceRsvtForm input[name=applyEdYMD]').focus();
+				}
+			});
+			return false;
+		}
+
+		var toDateStr = new Date().format("YYYYMMDDHHmmss");
+
+		if (toDateStr >= applyStdt){
+			mcxDialog.alertC("예약 시작일시는 현재일시 보다 작거나 같을 수 없습니다.",  {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$('#goodsPriceRsvtForm input[name=applyStYMD]').focus();
+				}
+			});
+			return false;
+		}
+
+		if (toDateStr >= applyEddt){
+			mcxDialog.alertC("예약 종료일시는 현재일시 보다 작거나 같을 수 없습니다.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$('#goodsPriceRsvtForm input[name=applyEdYMD]').focus();
+				}
+			});
+			return false;
+		}
+
+		mcxDialog.confirm('저장하시겠습니까?',  {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function(){
+				var arrGoodsCd = [];
+				allRowData.forEach(function(item, index) {
+					arrGoodsCd.push(item.goodsCd);
+				});
+
+				var data = {goodsTnm : $('#goodsPriceRsvtForm input[name=goodsTnm]').val()
+							, applyStdt : $('#goodsPriceRsvtForm input[name=applyStdt]').val()
+							, applyEddt : $('#goodsPriceRsvtForm input[name=applyEddt]').val()
+							, arrGoodsCd : arrGoodsCd
+				};
+
+				var jsonData = JSON.stringify(data);
+				gagajf.ajaxJsonSubmit('/goods/title/reserve/save', jsonData, fnGoodsRsvtTnmListFormClose);
+
+			}
+		});
+	});
+
+	// 조회상품 삭제
+	$('#btnDeleteGoodsRsvtTnm').on('click', function() {
+		var selectedData = rsvtGoodsTnmGridOptions.api.getSelectedRows();
+		if (selectedData.length == 0) {
+			mcxDialog.alert('선택된 행이 없습니다.');
+			return;
+		}
+
+		//화면에서 삭제
+		var removedData = gagaAgGrid.removeRowData(rsvtGoodsTnmGridOptions, false);
+	});
+	
+	//엑셀 상품 조회
+	$('#btnSearchExcel').on('click', function() {
+		cfnExcelUploadPopup('goodsRsvtTnmExcelUpload', 'goodsRsvtTnmExcelUpload');
+	});
+
+	var goodsRsvtTnmExcelUpload = function(result){
+		var data = {procJob : result.procJob
+			,excelFileNm : result.excelFileNm
+		};
+		var jsonData = JSON.stringify(data);
+		gagajf.ajaxJsonSubmit('/goods/search/excelupload/save', jsonData, fnRsvtGoodsTnmExcelUploadCallBack);
+	}
+
+	var fnRsvtGoodsTnmExcelUploadCallBack = function(result){
+		gagajf.ajaxJsonSubmit('/goods/excel/upload/goods/list', '', fnExcelSearchCallBack);
+	}
+
+	var fnExcelSearchCallBack = function(result){
+		if (result.goodsExcelList.length < 1) return;
+		var oldData = gagaAgGrid.getAllRowData(rsvtGoodsTnmGridOptions);
+		$.each(result.goodsExcelList, function(idx, item) {
+			var isInvalid = false;
+			if (oldData != null && oldData.length != 0){
+				oldData.forEach(function(oneData){
+					if(oneData.goodsCd == item.goodsCd){
+						isInvalid = true;
+						return true;
+					}
+				});
+				if(isInvalid){
+					return isInvalid;
+				}
+			}
+			gagaAgGrid.addRowData(rsvtGoodsTnmGridOptions, {"goodsCd" : item.goodsCd, "goodsNm" : item.goodsNm, "goodsTnm" : item.goodsTnm});
+		});
+		return;
+	}
+
+	//창종료
+	var fnGoodsRsvtTnmListFormClose = function(){
+		uifnPopupClose('popupGoodsTitleReserve');
+		fnGoodsTnmResDeleteCollBack();
+	}
+
+	$(document).ready(function() {
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridGoodsRsvtTnmList', rsvtGoodsTnmGridOptions);
+	});
+
+/*]]>*/
+</script>
+</html>

+ 2 - 2
style24.admin/src/main/webapp/WEB-INF/views/goods/GoodsTitleReserveForm.html

@@ -66,11 +66,11 @@
 					<tr>
 						<th>상품명</th>
 						<td>
-							<input type="text" class="w200" name="goodsTnm11" id="goodsTnm111" maxlength="50"/>
+							<input type="text" class="w200" name="goodsnm" id="goodsnm" maxlength="50"/>
 						</td>
 						<th>예약타이틀</th>
 						<td>
-							<input type="text" class="w200" name="goodsTnm" id="goodsTnm" maxlength="50"/>
+							<input type="text" class="w200" name="goodsTnmRes" id="goodsTnmRes" maxlength="50"/>
 						</td>
 						<th>시즌/년도</th>
 						<td>