Ver Fonte

상품 타이틀 예약관리

eskim há 5 anos atrás
pai
commit
88b9905e30

+ 31 - 7
style24.admin/src/main/java/com/style24/admin/biz/web/TsaGoodsController.java

@@ -517,6 +517,30 @@ public class TsaGoodsController extends TsaBaseController {
 		return super.ok("");
 	}
 
+	/**
+	 * 엑셀 업로드 상품 조회
+	 *
+	 * @param
+	 * @return GagaMap
+	 * @author eskim
+	 * @since 2020. 11. 02
+	 */
+	@PostMapping("/excel/upload/goods/list")
+	@ResponseBody
+	public GagaMap getExcelUploadGoodsList() {
+		GagaMap result = new GagaMap();
+		GoodsSearch goodsSearch = new GoodsSearch();
+		goodsSearch.setSearchGb("EXCEL");
+		// 입점업체담당자는 업체코드 설정
+		if ("G001_B000".equals(TsaSession.getInfo().getRoleCd())) {
+			goodsSearch.setSupplyCompCd(TsaSession.getInfo().getSupplyCompCd());
+			goodsSearch.setMdId(Integer.toString(TsaSession.getInfo().getUserNo()));
+		}
+		goodsSearch.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
+		result.set("goodsExcelList", goodsService.getGoodsList(goodsSearch));
+		return result;
+	}
+
 	/**
 	 * 상품 상세 화면
 	 *
@@ -1021,7 +1045,7 @@ public class TsaGoodsController extends TsaBaseController {
 		// 입점업체담당자는 업체코드 설정
 		if ("G001_B000".equals(TsaSession.getInfo().getRoleCd())) {
 			goodsSearch.setSupplyCompCd(TsaSession.getInfo().getSupplyCompCd());
-			goodsSearch.setMdId(TsaSession.getInfo().getUserId());
+			goodsSearch.setMdId(Integer.toString(TsaSession.getInfo().getUserNo()));
 		}
 
 		// multi row 검색관련 처리
@@ -1044,14 +1068,14 @@ public class TsaGoodsController extends TsaBaseController {
 	 *
 	 * @return
 	 * @author eskim
-	 * @since 2019. 12. 23
+	 * @since 2020. 11. 02
 	 */
-	@GetMapping("/rsvt/tnm/list/form")
+	@GetMapping("/title/reserve/popup/form")
 	@ResponseBody
 	public ModelAndView goodsRsvtTnmListForm(GoodsTnmRes goodsTnmRes) {
 		ModelAndView mav = new ModelAndView();
 
-		mav.setViewName("goods/GoodsRsvtTnmListForm");
+		mav.setViewName("goods/GoodsTitleReservePopupForm");
 		return mav;
 	}
 
@@ -1061,9 +1085,9 @@ public class TsaGoodsController extends TsaBaseController {
 	 * @param goodsTnmRes
 	 * @return
 	 * @author eskim
-	 * @since 2020. 02. 02
+	 * @since 2020. 11. 02
 	 */
-	@PostMapping("/rsvt/tnm/save")
+	@PostMapping("/title/reserve/save")
 	@ResponseBody
 	public GagaResponse saveGoodsRsvtTnm(@RequestBody GoodsTnmRes goodsTnmRes) {
 		goodsService.saveGoodsRsvtTnm(goodsTnmRes);
@@ -1078,7 +1102,7 @@ public class TsaGoodsController extends TsaBaseController {
 	 * @author eskim
 	 * @since 2020. 02. 02
 	 */
-	@PostMapping("/rsvt/tnm/delete")
+	@PostMapping("/title/reserve/delete")
 	@ResponseBody
 	public GagaResponse deleteGoodsRsvtTnm(@RequestBody GoodsTnmRes goodsTnmRes) {
 		goodsService.deleteGoodsRsvtTnm(goodsTnmRes);

+ 108 - 239
style24.admin/src/main/java/com/style24/persistence/mybatis/shop/TsaGoods.xml

@@ -242,7 +242,7 @@
 		        LEFT OUTER JOIN TB_GOODS_IMG GI ON G.GOODS_CD = GI.GOODS_CD
 		        WHERE 1=1
 		        <if test="searchGb == null or searchGb =='BASIC' or searchGb =='EXTEND' or searchGb =='MASTER'" >
-		        <include refid="getGoodsListContion_sql"/>
+		        <include refid="getGoodsListCondition_sql"/>
 		        </if>
 	</select>
 
@@ -351,17 +351,17 @@
 		        LEFT OUTER JOIN TB_GOODS_IMG GI ON G.GOODS_CD = GI.GOODS_CD
 		        WHERE 1=1
 		        <if test="searchGb == null or searchGb =='BASIC' or searchGb =='EXTEND' or searchGb =='MASTER'" >
-		        <include refid="getGoodsListContion_sql"/>
+		        <include refid="getGoodsListCondition_sql"/>
 		        ORDER BY G.REG_DT DESC, G.GOODS_CD
 		        </if>
 		        <if test="searchGb != null and searchGb =='EXCEL'">
 		        ORDER BY SD.TMP_DISP_ORD
 		        </if>
-		<include refid="getListPagingContion_sql"/>
+		<include refid="getListPagingCondition_sql"/>
 	</select>
 	
 	<!-- 상품 목록 조건 정보 -->
-	<sql id="getGoodsListContion_sql">
+	<sql id="getGoodsListCondition_sql">
 		        <if test='conditionList != null and conditionList.length>0'>
 		            <choose>
 		              <when test='search != null and search == "searchGoodsCd"'>
@@ -574,7 +574,7 @@
 	</sql>
 	
 	<!-- 목록 페이징 정보 -->
-	<sql id="getListPagingContion_sql">
+	<sql id="getListPagingCondition_sql">
 		<choose>
 		<when test="pageable != null">
 		    ) A
@@ -673,7 +673,7 @@
 		LEFT OUTER JOIN TB_GOODS_IMG GI ON G.GOODS_CD = GI.GOODS_CD
 		WHERE 1=1
 		<if test="searchGb == null or searchGb =='BASIC' or searchGb =='EXTEND' or searchGb =='MASTER'" >
-		<include refid="getGoodsListContion_sql"/>
+		<include refid="getGoodsListCondition_sql"/>
 		ORDER BY G.REG_DT DESC
 		</if>
 		<if test="searchGb == null or searchGb =='EXCEL'">
@@ -1604,119 +1604,49 @@
 	<select id="getGoodsTitleReserveCount" parameterType="GoodsSearch" resultType="int">
 		/* TsaGoods.getGoodsTitleReserveCount */
 		SELECT COUNT(*) AS TOTCNT
-		FROM TB_BRAND B
-		   , TB_SUPPLY_COMPANY S
-		   <if test="searchGb == null or searchGb =='BASIC'">
-		   , TB_GOODS G
-		       <if test="siteCd != null and siteCd != ''">
-		   , (SELECT DISTINCT B.GOODS_CD, A.SITE_CD  
-		      FROM TB_CATEGORY_4SRCH A
-		         , TB_CATEGORY_GOODS B
-		      WHERE A.LEAF_CATE_CD = B.CATE_CD
-		      AND A.CATE_GB = B.CATE_GB
-		      AND A.SITE_CD IN 
-		      <foreach collection="siteCd" item="item" index="index"  open="(" close=")" separator=",">
-		       #{item}
-		      </foreach>
-		      ) D
-		       </if>
-		   </if>
-		   <if test="searchGb != null and searchGb =='EXCEL'">
-		   , (SELECT P.* 
-		           , TMP_DISP_ORD
-		      FROM TB_GOODS P
-		         , (SELECT SEARCH_CD, MIN(DISP_ORD) AS TMP_DISP_ORD
-		            FROM TB_SEARCH_DATA
-		            WHERE REG_ID = #{regId}
-		            GROUP BY SEARCH_CD) T
-		      WHERE P.GOODS_CD LIKE T.SEARCH_CD||'%'
-		      OR P.SUPPLY_GOODS_CD LIKE T.SEARCH_CD||'%'
-		      <if test="mdId != null and mdId != ''">
-		      AND P.BRAND_CD IN (
-		                         SELECT DISTINCT BRAND_CD
-		                         FROM TB_BRAND_MD
-		                         WHERE  MD_ID = #{mdId}
-		                         )
-		      </if>
-		      ) G
-		   </if>
-		   , TB_GOODS_TNM_RES GR
-		WHERE 1=1
-		AND G.BRAND_CD = B.BRAND_CD
-		AND G.SUPPLY_COMP_CD = S.SUPPLY_COMP_CD
-		AND G.GOODS_CD = GR.GOODS_CD
-		<if test="searchGb == null or searchGb =='BASIC'">
-		    <if test="siteCd != null and siteCd != ''">
-		AND G.GOODS_CD = D.GOODS_CD
-		    </if>
+		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_TNM_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 >= TO_DATE(#{applyStdt}, 'YYYY-MM-DD')
+		                               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 <= TO_DATE(#{applyEddt}, 'YYYY-MM-DD')  + 0.99999
-		]]>
+		    <![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 SYSDATE <![CDATA[<=]]> GR.APPLY_EDDT
-		    </if>
-		    <if test='goodsTnm != null and goodsTnm != ""'>
-		AND UPPER(GR.GOODS_TNM) LIKE UPPER('%'|| #{goodsTnm} || '%')
-		    </if>
-		    <if test="supplyCompCd != null and supplyCompCd != ''">
-		AND G.SUPPLY_COMP_CD = #{supplyCompCd}
-		    </if>
-		    <if test="brandCd != null and brandCd != ''">
-		AND G.BRAND_CD = UPPER(#{brandCd})
-		    </if>
-		    <if test="multiBrand != null and multiBrand != ''">
-		AND G.BRAND_CD IN
-		        <foreach collection="multiBrand" item="item" index="index"  open="(" close=")" separator=",">
-		#{item}
-		        </foreach>
-		    </if>
-		    <if test='conditionList != null and conditionList.length>0'>
-		        <choose>
-		              <when test='search != null and search == "searchGoodsCd"'>
-		        AND (
-		              <foreach collection="conditionList" item="item" index="index" separator="or">
-		               REGEXP_LIKE(UPPER(G.GOODS_CD), UPPER(#{item}))
-		              </foreach>
-		             )
-		              </when>
-		              <when test='search != null and search == "searchGoodsNum"'>
-		        AND (
-		              <foreach collection="conditionList" item="item" index="index" separator="or">
-		               REGEXP_LIKE(UPPER(G.GOODS_NUM), UPPER(#{item}))
-		              </foreach>
-		             )
-		              </when>
-		              <when test='search != null and search == "searchSupplyGoodsCd"'>
-		        AND (
-		              <foreach collection="conditionList" item="item" index="index" separator="or">
-		               REGEXP_LIKE(UPPER(G.SUPPLY_GOODS_CD), UPPER(#{item}))
-		              </foreach>
-		             )
-		              </when>
-		        </choose>
-		    </if>
-		    <if test="multiStyleYear != null and multiStyleYear != ''">
-		AND G.STYLE_YEAR IN (SELECT CD_NM
-		                     FROM TB_COMMON_CODE
-		                     WHERE CD_GB='G023'
-		                     AND CD IN
-		        <foreach collection="multiStyleYear" item="item" index="index"  open="(" close=")" separator=",">
-		                     #{item}
-		        </foreach>
-		                    )
-		    </if>
-		    <if test="multiSeasonCd != null and multiSeasonCd != ''">
-		AND G.SEASON_CD IN
-		        <foreach collection="multiSeasonCd" item="item" index="index"  open="(" close=")" separator=",">
-		#{item}
-		        </foreach>
+		                               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="mdId != null and mdId != ''">
+		               AND G.BRAND_CD IN (
+		                                  SELECT DISTINCT BRAND_CD
+		                                  FROM TB_BRAND_MD
+		                                  WHERE MD_ID = #{mdId}
+		                                  )
+		              </if>
+		           )
+		</if>
+		WHERE 1=1
+		<if test="searchGb == null or searchGb =='BASIC'" >
+		<include refid="getGoodsListCondition_sql"/>
+		</if>
 	</select>
 
 	<!-- 상품 타이틀 예약관리 목록 -->
@@ -1724,7 +1654,7 @@
 		/* TsaGoods.getGoodsTitleReserveList */
 		SELECT Z.*
 		FROM (
-		    SELECT A.*, ROWNUM RNUM FROM (
+		    SELECT A.*, @rownum := @rownum + 1 AS RNUM FROM (
 		        SELECT
 		                G.GOODS_CD
 		              , B.BRAND_ENM
@@ -1738,130 +1668,68 @@
 		              , G.GOODS_STAT
 		              , GR.GOODS_TNM_RES_SQ
 		              , GR.GOODS_TNM AS REG_GOODS_TNM
-		              , TO_CHAR(GR.APPLY_STDT,'YYYYMMDDHH24MISS') AS APPLY_STDT
-		              , TO_CHAR(GR.APPLY_EDDT,'YYYYMMDDHH24MISS') AS APPLY_EDDT
-		              , GR.REG_ID
-		              , TO_CHAR(GR.REG_DT,'YYYYMMDDHH24MISS') AS REG_DT
-		        FROM TB_BRAND B
-		           , TB_SUPPLY_COMPANY S
-		           <if test="searchGb == null or searchGb =='BASIC'">
-		           , TB_GOODS G
-		               <if test="siteCd != null and siteCd != ''">
-		           , (SELECT DISTINCT B.GOODS_CD, A.SITE_CD  
-		              FROM TB_CATEGORY_4SRCH A
-		                 , TB_CATEGORY_GOODS B
-		              WHERE A.LEAF_CATE_CD = B.CATE_CD
-		              AND A.CATE_GB = B.CATE_GB
-		              AND A.SITE_CD IN 
-		              <foreach collection="siteCd" item="item" index="index"  open="(" close=")" separator=",">
-		               #{item}
-		              </foreach>
-		              ) D
-		               </if>
-		           </if>
-		           <if test="searchGb != null and searchGb =='EXCEL'">
-		           , (SELECT P.* 
-		                   , TMP_DISP_ORD
-		              FROM TB_GOODS P
-		                 , (SELECT SEARCH_CD, MIN(DISP_ORD) AS TMP_DISP_ORD
-		                    FROM TB_SEARCH_DATA
-		                    WHERE REG_ID = #{regId}
-		                    GROUP BY SEARCH_CD) T
-		              WHERE P.GOODS_CD LIKE T.SEARCH_CD||'%'
-		              OR P.SUPPLY_GOODS_CD LIKE T.SEARCH_CD||'%'
-		              <if test="mdId != null and mdId != ''">
-		              AND P.BRAND_CD IN (
-		                                 SELECT DISTINCT BRAND_CD
-		                                 FROM TB_BRAND_MD
-		                                 WHERE  MD_ID = #{mdId}
-		                                )
-		              </if>
-		              ) G
-		           </if>
-		           , TB_GOODS_TNM_RES GR
-		        WHERE 1=1
-		        AND G.BRAND_CD = B.BRAND_CD
-		        AND G.SUPPLY_COMP_CD = S.SUPPLY_COMP_CD
-		        AND G.GOODS_CD = GR.GOODS_CD
-		        <if test="searchGb == null or searchGb =='BASIC'">
-		            <if test="siteCd != null and siteCd != ''">
-		        AND G.GOODS_CD = D.GOODS_CD
-		            </if>
+		              , 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.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_TNM_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 >= TO_DATE(#{applyStdt}, 'YYYY-MM-DD')
+		                                       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 <= TO_DATE(#{applyEddt}, 'YYYY-MM-DD')  + 0.99999
+		                                       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 SYSDATE <![CDATA[<=]]> GR.APPLY_EDDT(+)
-		            </if>
-		            <if test='goodsTnm != null and goodsTnm != ""'>
-		        AND UPPER(GR.GOODS_TNM) LIKE UPPER('%'|| #{goodsTnm} || '%')
+		                                       AND GR.APPLY_EDDT >= NOW() 
 		            </if>
-		            <if test="supplyCompCd != null and supplyCompCd != ''">
-		        AND G.SUPPLY_COMP_CD = #{supplyCompCd}
-		            </if>
-		            <if test="multiBrand != null and multiBrand != ''">
-		        AND G.BRAND_CD IN
-		            <foreach collection="multiBrand" item="item" index="index"  open="(" close=")" separator=",">
-		        #{item}
-		            </foreach>
-		            </if>
-		            <if test='conditionList != null and conditionList.length>0'>
-		            <choose>
-		              <when test='search != null and search == "searchGoodsCd"'>
-		        AND (
-		              <foreach collection="conditionList" item="item" index="index" separator="or">
-		               REGEXP_LIKE(UPPER(G.GOODS_CD), UPPER(#{item}))
-		              </foreach>
-		             )
-		              </when>
-		              <when test='search != null and search == "searchGoodsNum"'>
-		        AND (
-		              <foreach collection="conditionList" item="item" index="index" separator="or">
-		               REGEXP_LIKE(UPPER(G.GOODS_NUM), UPPER(#{item}))
-		              </foreach>
-		             )
-		              </when>
-		              <when test='search != null and search == "searchSupplyGoodsCd"'>
-		        AND (
-		              <foreach collection="conditionList" item="item" index="index" separator="or">
-		               REGEXP_LIKE(UPPER(G.SUPPLY_GOODS_CD), UPPER(#{item}))
-		              </foreach>
-		             )
-		              </when>
-		            </choose>
-		            </if>
-		            <if test="multiStyleYear != null and multiStyleYear != ''">
-		        AND G.STYLE_YEAR IN (SELECT CD_NM
-		                             FROM TB_COMMON_CODE
-		                             WHERE CD_GB='G023'
-		                             AND CD IN
-		                <foreach collection="multiStyleYear" item="item" index="index"  open="(" close=")" separator=",">
-		                             #{item}
-		                </foreach>
-		                            )
-		            </if>
-		            <if test="multiSeasonCd != null and multiSeasonCd != ''">
-		        AND G.SEASON_CD IN
-		                <foreach collection="multiSeasonCd" item="item" index="index"  open="(" close=")" separator=",">
-		        #{item}
-		            </foreach>
-		            </if>
-		        ORDER BY GR.APPLY_STDT DESC, GR.APPLY_EDDT DESC, G.GOODS_CD, GR.GOODS_TNM_RES_SQ
 		        </if>
-		<include refid="getListPagingContion_sql"/>
+		        <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="mdId != null and mdId != ''">
+		                      AND G.BRAND_CD IN (
+		                                          SELECT DISTINCT BRAND_CD
+		                                          FROM TB_BRAND_MD
+		                                          WHERE MD_ID = #{mdId}
+		                                          )
+		                      </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="getGoodsTnm" parameterType="GoodsTnmRes" resultType="GoodsTnmRes">
 		/* TsaGoods.getGoodsTnm */
 		SELECT GOODS_CD
-		, TO_CHAR(APPLY_STDT, 'YYYYMMDDHH24MISS') AS APPLY_STDT
-		, TO_CHAR(APPLY_EDDT, 'YYYYMMDDHH24MISS') AS APPLY_EDDT
+		     , DATE_FORMAT(APPLY_STDT,'%Y%m%d%H%i%S') AS APPLY_STDT
+		     , DATE_FORMAT(APPLY_EDDT, '%Y%m%d%H%i%S') AS APPLY_EDDT
 		FROM TB_GOODS_TNM_RES
 		WHERE 1=1
 		AND GOODS_CD = #{goodsCd}
@@ -1876,21 +1744,21 @@
 		  , GOODS_TNM
 		  , APPLY_STDT
 		  , APPLY_EDDT
-		  , REG_ID
+		  , REG_NO
 		  , REG_DT
-		  , UPD_ID
+		  , UPD_NO
 		  , UPD_DT
 		)
 		VALUES(
-		    SEQ_GOODS_TNM_RES.NEXTVAL
+		    NULL
 		  , #{goodsCd}
 		  , #{goodsTnm}
-		  , TO_DATE(#{applyStdt},'YYYYMMDDHH24MISS')
-		  , TO_DATE(#{applyEddt},'YYYYMMDDHH24MISS')
-		  , #{regId}
-		  , SYSDATE
-		  , #{updId}
-		  , SYSDATE
+		  , STR_TO_DATE(#{applyStdt},'%Y%m%d%H%i%S')
+		  , STR_TO_DATE(#{applyEddt},'%Y%m%d%H%i%S')
+		  , #{regNo}
+		  , NOW()
+		  , #{updNo}
+		  , NOW()
 		)
 	</insert>
 	
@@ -1899,15 +1767,15 @@
 		/* TsaGoods.updateGoodTnm */
 		UPDATE TB_GOODS
 		SET GOODS_TNM = #{goodsTnm}
-		  , UPD_ID = #{updId} 
-		  , UPD_DT = SYSDATE
+		  , UPD_NO = #{updNo} 
+		  , UPD_DT = NOW()
 		WHERE GOODS_CD = #{goodsCd}
 	</update >
 	
 	<!-- 상품 타이틀 예약 삭제 -->
 	<delete id="deleteGoodTnmRes" parameterType="GoodsTnmRes">
 		/* TsaGoods.deleteGoodTnmRes */
-		DELETE TB_GOODS_TNM_RES 
+		DELETE FROM TB_GOODS_TNM_RES 
 		WHERE GOODS_TNM_RES_SQ = #{goodsTnmResSq}
 	</delete>
 	
@@ -1915,8 +1783,8 @@
 	<update id="updateGoodTnmInit" parameterType="Goods">
 		/* TsaGoods.updateGoodTnmInit */
 		UPDATE TB_GOODS
-		SET UPD_ID = #{updId} 
-		  , UPD_DT = SYSDATE
+		SET UPD_NO = #{updNo} 
+		  , UPD_DT = NOW()
 		  , GOODS_TNM = (SELECT S.GOODS_TNM
 		                 FROM (
 		                       SELECT GT.GOODS_CD
@@ -1924,7 +1792,7 @@
 		                            , RANK() OVER(PARTITION BY GT.GOODS_CD ORDER BY GT.GOODS_TNM_RES_SQ DESC) RANK 
 		                       FROM TB_GOODS_TNM_RES GT
 		                       WHERE GT.APPLYC_YN = 'N'
-		                       AND SYSDATE BETWEEN GT.APPLY_STDT AND GT.APPLY_EDDT
+		                       AND NOW() BETWEEN GT.APPLY_STDT AND GT.APPLY_EDDT
 		                       AND GT.GOODS_CD  = #{goodsCd}
 		                      ) S
 		                 WHERE S.RANK = 1
@@ -1944,12 +1812,13 @@
 		                   , RANK() OVER(PARTITION BY GT.GOODS_CD ORDER BY GT.GOODS_TNM_RES_SQ DESC) RANK 
 		              FROM TB_GOODS_TNM_RES GT
 		              WHERE GT.APPLYC_YN = 'N'
-		              AND SYSDATE BETWEEN GT.APPLY_STDT AND GT.APPLY_EDDT
+		              AND NOW() BETWEEN GT.APPLY_STDT AND GT.APPLY_EDDT
 		              AND GT.GOODS_CD  = #{goodsCd}
 		             ) S
 		        WHERE S.RANK = 1
 		        ) AS GOOD_TNM_INIT
 		FROM TB_GOODS
 		WHERE GOODS_CD = #{goodsCd}
-	</select >
+	</select>
+	
 </mapper>

+ 3 - 1
style24.admin/src/main/webapp/WEB-INF/views/goods/GoodsPopupListForm.html

@@ -184,7 +184,8 @@
 					<button type="button" class="btn btn-info btn-lg" id="btnPopupGoodsSearch" >조회</button>
 				</li>
 			</ul>
-			</form>
+		</div>	
+			
 			<ul class="panelBar">
 				<li>검색 결과 : <em><span id="gridRowTotalCount">0</span></em>개가 검색되었습니다.
 				<input type="hidden" name="pageNo" id="pageNo" value ="1"/>
@@ -210,6 +211,7 @@
 					<button type="button" class="btnRight btn btn-base btn-lg" id="btnPopupGoodsApply">적용</button>
 				</li>
 			</ul>
+			</form>
 			<!-- //버튼 배치 영역 -->
 		</div>
 	</div>

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

@@ -111,6 +111,7 @@
 				</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>
@@ -169,18 +170,13 @@
 			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',
+		{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: "regId", width: 100, cellClass: 'text-center'},
+		{headerName: "등록자", field: "regNm", width: 100, cellClass: 'text-center'},
 		{headerName: "상품타이틀예약순번", field: "goodsTnmResSq", hide: true}
-		/* {headerName: "사이트", field: "siteCd" , width: 120, cellClass: 'text-center',
-			cellEditorParams: { values: gagaAgGrid.extractValues(siteList) },
-			valueFormatter: function (params) { return gagaAgGrid.lookupValue(siteList, params.value); },
-			valueParser: function (params) { return gagaAgGrid.lookupKey(siteList, params.newValue); }
-		} */
 	];
 	
 	// Get GridOptions
@@ -271,11 +267,7 @@
 		}else{ */
 			for (i = 0; i < form.elements.length; i++ ) {
 				var el = form.elements[i];
-				console.log("TEST DATA1 : " + $(el).prop("type"));
-				console.log("TEST DATA2 : " + el.name);
-				if ($(el).prop("type") == "text" || $(el).prop("type") == "textarea" || ($(el).prop("type") == "select-one" && el.name != "search" && el.name != "pageSize") || ($(el).prop("type") == "checkbox" && el.name != "multiStyleYear" && el.name != "multiSeasonCd")) {
-					console.log("::IN TEST DATA1 : " + $(el).prop("type"));
-					console.log("::IN TEST DATA2 : " + el.name);
+				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++;
 					}
@@ -363,10 +355,10 @@
 		fnGoodsTnmListSearch("EXCEL");
 	}
 	
-	//예약등록
+	//예약등록 팝업
 	$('#btnGoodsTnmResSave').click(function(e) {
-		var actionUrl = "/goods/rsvt/tnm/list/form";
-		cfnOpenModalPopup(actionUrl, 'popupGoodsRsvtList');
+		var actionUrl = "/goods/title/reserve/popup/form";
+		cfnOpenModalPopup(actionUrl, 'popupGoodsTitleReserve'); 
 	});
 	
 	//예약삭제
@@ -420,7 +412,7 @@
 			};
 			
 			var jsonData = JSON.stringify(data);
-			gagajf.ajaxJsonSubmit('/goods/rsvt/tnm/delete', jsonData, fnGoodsTnmResDeleteCollBack);
+			gagajf.ajaxJsonSubmit('/goods/title/reserve/delete', jsonData, fnGoodsTnmResDeleteCollBack);
 			}
 		});
 	});

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

@@ -0,0 +1,305 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : GoodsTitleReservePopupForm.html
+ * @desc    : 상품등록 타이틀 예약등록 화면
+ *============================================================================
+ * PASTEL
+ * Copyright(C) 2019 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2020.11.02   eskim       최초 작성
+ *******************************************************************************
+ -->	
+	<div class="modalPopup" data-width="850" >
+		<div class="panelStyle">
+			<div class="panelTitle">
+				<h2>상품타이틀예약</h2>
+				<button type="button" class="close" onclick="uifnPopupClose('popupGoodsTitleReserve')"><i class="fa fa-times"></i></button>
+			</div>
+			<form id="goodsRsvtTnmForm" name="goodsRsvtTnmForm" >
+			<div class="panelContent">
+				<table class="frmStyle">
+					<colgroup>
+						<col style="width:10%;"/>
+						<col/>
+					</colgroup>
+					<tr>
+						<th>상품타이틀<i class="star"></i></th>
+						<td><input type="text" class="w100p" id="goodsTnm" name="goodsTnm"  maxlength="50" /></td>
+					</tr>
+					<tr>
+						<th>예약일시<i class="star"></i></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($("#goodsRsvtTnmForm input[name=goodsTnm]").val())) {
+			mcxDialog.alertC("상품 타이틀을 입력하세요.",{
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$("#goodsRsvtTnmForm input[name=goodsTnm]").focus();
+				}
+			});
+			return false;
+		}
+
+		var fromDate = $('#goodsRsvtTnmForm input[name=applyStYMD]').val();
+		var toDate = $('#goodsRsvtTnmForm input[name=applyEdYMD]').val();
+
+		if (gagajf.isNull(fromDate)) {
+			mcxDialog.alertC("예약  시작일자를 입력하세요.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$('#goodsRsvtTnmForm input[name=applyStYMD]').focus();
+				}
+			});
+			return false;
+		}
+
+		if (gagajf.isNull(toDate)) {
+			mcxDialog.alertC("예약  종료일자를 입력하세요.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$('#goodsRsvtTnmForm input[name=applyEdYMD]').focus();
+				}
+			});
+			return false;
+		}
+
+		if (fromDate > toDate) {
+			mcxDialog.alertC("예약 시작일자는 종료일자 보다 클 수 없습니다.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$('#goodsRsvtTnmForm input[name=applyEdYMD]').focus();
+				}
+			});
+			return false;
+		}
+
+		var applyStdt = $('#goodsRsvtTnmForm input[name=applyStYMD]').val().replaceAll("-","") +
+		$('#goodsRsvtTnmForm select[name=applyStHH]').val() + "0000";
+
+		var applyEddt = $('#goodsRsvtTnmForm input[name=applyEdYMD]').val().replaceAll("-","") +
+		$('#goodsRsvtTnmForm select[name=applyEdHH]').val() +"5959";
+
+		$('#goodsRsvtTnmForm input[name=applyStdt]').val(applyStdt);
+		$('#goodsRsvtTnmForm input[name=applyEddt]').val(applyEddt);
+
+		if ($('#goodsRsvtTnmForm input[name=applyStdt]').val() > $('#goodsRsvtTnmForm input[name=applyEddt]').val()) {
+			mcxDialog.alertC("예약 시작일자는 종료일자 보다 클 수 없습니다.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$('#goodsRsvtTnmForm input[name=applyEdYMD]').focus();
+				}
+			});
+			return false;
+		}
+
+		var toDateStr = new Date().format("YYYYMMDDHHmmss");
+
+		if (toDateStr >= applyStdt){
+			mcxDialog.alertC("예약 시작일시는 현재일시 보다 작거나 같을 수 없습니다.",  {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$('#goodsRsvtTnmForm input[name=applyStYMD]').focus();
+				}
+			});
+			return false;
+		}
+
+		if (toDateStr >= applyEddt){
+			mcxDialog.alertC("예약 종료일시는 현재일시 보다 작거나 같을 수 없습니다.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$('#goodsRsvtTnmForm 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 : $('#goodsRsvtTnmForm input[name=goodsTnm]').val()
+							, applyStdt : $('#goodsRsvtTnmForm input[name=applyStdt]').val()
+							, applyEddt : $('#goodsRsvtTnmForm 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>