소스 검색

SCM TB_GOODS_IMG 변경관련 수정

eskim 5 년 전
부모
커밋
6ba112d73a

+ 1 - 4
style24.admin/src/main/java/com/style24/persistence/mybatis/shop/TsaGoods.xml

@@ -3506,8 +3506,7 @@
 		SELECT GOODS_CD
 		     , COLOR_CD
 		     , DISP_ORD
-		     , ORG_IMG_NM /* S0001/20201221/14505664_L.jpg */
-		     , SUBSTRING_INDEX(SYS_IMG_NM , '/', -1) AS SYS_IMG_NM
+		     , SUBSTRING_INDEX(SYS_IMG_NM , '/', -1) AS SYS_IMG_NM  /* S0001/20201221/14505664_L.jpg */
 		     , SUBSTRING_INDEX(SYS_IMG_NM , '/', 2) AS SYS_IMG_URL
 		     , DEFAULT_IMG_YN
 		FROM   TB_GOODS_IMG
@@ -3542,7 +3541,6 @@
 		       GOODS_CD
 		     , COLOR_CD
 		     , DISP_ORD
-		     , ORG_IMG_NM
 		     , SYS_IMG_NM
 		     , DEFAULT_IMG_YN
 		     , REG_NO
@@ -3552,7 +3550,6 @@
 		       #{goodsCd}
 		     , #{colorCd}
 		     , #{dispOrd}
-		     , #{orgImgNm}
 		     , #{sysImgNm}
 		     , #{defaultImgYn}
 		     , #{regNo}

+ 6 - 3
style24.scm/src/main/java/com/style24/persistence/domain/Goods.java

@@ -74,6 +74,7 @@ public class Goods extends TscBaseDomain {
 
 	private String brandEnm;		//브랜드영문명
 	private String brandGrpNm;		//브랜드그룹명
+	private int brandNo;			// 브랜드번호
 
 	private String goodsDesc;
 	private String goodsPcTopDesc;
@@ -100,9 +101,11 @@ public class Goods extends TscBaseDomain {
 	private String formalGbOrg;
 	private float sellFeeRateOrg;
 
-	private String imgType;
-	private String imgPath1;
-	private String imgPath6;
+	//private String imgType;
+	//private String imgPath1;
+	//private String imgPath6;
+	private String sysImgNm;
+
 	private String niClsfNm;
 	private String goodsTypeNm;
 	private String goodTnmInit;

+ 9 - 21
style24.scm/src/main/java/com/style24/persistence/domain/GoodsImg.java

@@ -15,27 +15,15 @@ public class GoodsImg extends TscBaseDomain {
 
 	private String goodsCd;
 	private String colorCd;
-	private String imgType;
-	private String imgPath1;
-	private String imgPath2;
-	private String imgPath3;
-	private String imgPath4;
-	private String imgPath5;
-	private String imgPath6;
-	private String imgPath7;
-	private String imgPath8;
-	private String imgPath9;
-	private String imgPath10;
-	private String imgPath11;
-	private String imgPath12;
-	private String imgPath13;
-	private String imgPath14;
-	private String imgPath15;
-	private String imgPath16;
-	private String imgPath17;
-	private String imgPath18;
-	private String imgPath19;
-	private String imgPath20;
+	private int dispOrd;
+	private String orgImgNm;
+	private String sysImgNm;
+	private String defaultImgYn;
+	private String colorNm;
+	private String mode;
+	private int defaultImgOrd;
+	private String sysImgUrl;
+	private int brandNo;
 
 	private String goodsImgPath;
 	private String col;

+ 1 - 0
style24.scm/src/main/java/com/style24/persistence/domain/GoodsPriceRes.java

@@ -43,6 +43,7 @@ public class GoodsPriceRes extends TscBaseDomain {
 	private String edDate;
 	private String confirmY;
 	private Float goodsSellFeeRate;
+	private String goodsPriceYn;
 
 	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
 	private String[] arrGoodsCd;

+ 3 - 2
style24.scm/src/main/java/com/style24/persistence/domain/GoodsSearch.java

@@ -73,10 +73,11 @@ public class GoodsSearch extends TscBaseDomain {
 	private int goodsPriceResSt;
 	private int goodsPriceResEd;
 	private String selfGoodsYn;
-
+	private String goodsPriceYn;
 	private String goodsType;
 	private String selfMallYn;
-
+	private String searchBrandCd;
+	private String alarmYn;
 	private String useYn;
 	private String noticeTitle;
 

+ 109 - 56
style24.scm/src/main/java/com/style24/persistence/mybatis/shop/TssGoods.xml

@@ -47,8 +47,6 @@
 		                       </if>
 		                   )
 		        </if>
-		        LEFT OUTER JOIN TB_GOODS_IMG GI ON G.GOODS_CD = GI.GOODS_CD
-		                                        AND G.MAIN_COLOR_CD = GI.COLOR_CD
 		        WHERE 1=1
 		        <if test="searchGb == null or searchGb =='BASIC' or searchGb =='EXTEND' or searchGb =='MASTER'" >
 		        <include refid="getGoodsListCondition_sql"/>
@@ -58,16 +56,22 @@
 	<!-- 상품 목록 -->
 	<select id="getGoodsList" parameterType="GoodsSearch" resultType="Goods">
 		/* TssGoods.getGoodsList */
-		SELECT Z.*
-		    , (CASE WHEN Z.GOODS_TYPE = 'G056_N' THEN (SELECT NVL(SUM(CURR_STOCK_QTY - BASE_STOCK_QTY),0) FROM VW_STOCK WHERE GOODS_CD = Z.GOODS_CD) 
-		            ELSE (SELECT NVL(SUM(CURR_STOCK_QTY - BASE_STOCK_QTY),0) FROM VW_STOCK_COMPOSE WHERE GOODS_CD = Z.GOODS_CD) 
+		SELECT Q.*
+		    , (CASE WHEN Q.GOODS_TYPE = 'G056_N' THEN (SELECT NVL(SUM(CURR_STOCK_QTY - BASE_STOCK_QTY),0) FROM VW_STOCK WHERE GOODS_CD = Q.GOODS_CD) 
+		            ELSE (SELECT NVL(SUM(CURR_STOCK_QTY - BASE_STOCK_QTY),0) FROM VW_STOCK_COMPOSE WHERE GOODS_CD = Q.GOODS_CD) 
 		            END) AS STOCK_QTY_SUM
-		    , 0 AS STOCK_QTY_SUM
-		    , (SELECT ITEMKIND_NM FROM TB_ITEMKIND WHERE ITEMKIND_CD = Z.ITEMKIND_CD ) AS ITEMKIND_NM
+		    , (SELECT ITEMKIND_NM FROM TB_ITEMKIND WHERE ITEMKIND_CD = Q.ITEMKIND_CD ) AS ITEMKIND_NM
 		    , FN_GET_USER_NM(REG_NO) AS REG_NM
 		    , FN_GET_USER_NM(UPD_NO) AS UPD_NM
+		    , (SELECT MAX(SYS_IMG_NM) FROM TB_GOODS_IMG  WHERE GOODS_CD = Q.GOODS_CD AND COLOR_CD = Q.MAIN_COLOR_CD AND DEFAULT_IMG_YN = 'Y' ) AS SYS_IMG_NM
+		    , CASE IFNULL((SELECT COUNT(SYS_IMG_NM) FROM TB_GOODS_IMG  WHERE GOODS_CD = Q.GOODS_CD AND COLOR_CD = Q.MAIN_COLOR_CD AND DEFAULT_IMG_YN = 'Y' ),0) 
+		            WHEN 0 THEN 'N'
+		            ELSE 'Y' END AS GOODS_IMAGE_YN
+		FROM (     
+		SELECT Z.*
 		FROM (
-		    SELECT A.*, @rownum := @rownum + 1 AS RNUM FROM (
+		    SELECT A.*, @rownum := @rownum + 1 AS RNUM 
+		    FROM (
 		        SELECT
 		                G.GOODS_CD
 		              , G.GOODS_TYPE
@@ -92,18 +96,13 @@
 		              , G.ERP_PRICE_LINK_YN
 		              , G.CHANGEABLE_YN
 		              , G.RETURNABLE_YN
+		              , G.NEW_CUST_ORD_YN
 		              , G.GIFT_PACK_YN
+		              , G.DELV_FEE_CD
+		              , G.MAIN_COLOR_CD
 		              , DATE_FORMAT(G.FRST_CFRM_DT, '%Y%m%d%H%i%S') AS FRST_CFRM_DT
 		              , G.SELL_FEE_RATE
 		              , DATE_FORMAT(G.PRICE_UPD_DT,'%Y%m%d%H%i%S') AS PRICE_UPD_DT
-		              , CASE WHEN IMG_PATH1 IS NULL THEN
-		                     'N'
-		                ELSE
-		                     'Y'
-		                END AS GOODS_IMAGE_YN
-		              , GI.IMG_PATH1
-		              , GI.IMG_PATH6
-		              , GI.IMG_TYPE
 		              , G.REG_NO
 		              , DATE_FORMAT(G.REG_DT,'%Y%m%d%H%i%S') AS REG_DT
 		              , G.UPD_NO
@@ -158,8 +157,6 @@
 		                       </if>
 		                   )
 		        </if>
-		        LEFT OUTER JOIN TB_GOODS_IMG GI ON G.GOODS_CD = GI.GOODS_CD
-		                                        AND G.MAIN_COLOR_CD = GI.COLOR_CD
 		        WHERE 1=1
 		        <if test="searchGb == null or searchGb =='BASIC' or searchGb =='EXTEND' or searchGb =='MASTER'" >
 		        <include refid="getGoodsListCondition_sql"/>
@@ -389,11 +386,20 @@
 		<choose>
 		<when test="pageable != null">
 		    ) A
-		)Z WHERE RNUM BETWEEN  #{pageable.startRow} AND #{pageable.endRow}
+		)Z
+		WHERE RNUM BETWEEN  #{pageable.startRow} AND #{pageable.endRow}
+		) Q
+		<if test='goodsPriceYn != null and goodsPriceYn == "Y"'>
+		LEFT OUTER JOIN TB_GOODS_BENEFIT_PRICE GB ON Q.GOODS_CD = GB.GOODS_CD AND GB.CUST_GB = 'G100_00'
+		</if> 
 		</when>
 		<otherwise>
 		    ) A
 		)Z
+		)Q
+		<if test='goodsPriceYn != null and goodsPriceYn == "Y"'>
+		LEFT OUTER JOIN TB_GOODS_BENEFIT_PRICE GB ON Q.GOODS_CD = GB.GOODS_CD AND GB.CUST_GB = 'G100_00'
+		</if> 
 		</otherwise>
 		</choose>
 	</sql>
@@ -425,18 +431,14 @@
 		     , G.SELL_FEE_RATE
 		     , DATE_FORMAT(G.PRICE_UPD_DT, '%Y-%m-%d %H:%i:%S') AS PRICE_UPD_DT
 		     , DATE_FORMAT(G.FRST_CFRM_DT, '%Y-%m-%d %H:%i:%S') AS FRST_CFRM_DT
-		     , CASE WHEN IMG_PATH1 IS NULL THEN
-		           'N'
-		       ELSE
-		           'Y'
-		       END AS GOODS_IMAGE_YN
-		     /*, (CASE WHEN G.GOODS_TYPE = 'N' THEN (SELECT NVL(SUM(CURR_STOCK_QTY - BASE_STOCK_QTY),0) FROM VW_STOCK WHERE GOODS_CD = G.GOODS_CD) 
-		             ELSE (SELECT NVL(SUM(CURR_STOCK_QTY - BASE_STOCK_QTY),0) FROM VW_STOCK_EXTEND WHERE GOODS_CD = G.GOODS_CD) 
-		             END) AS STOCK_QTY_SUM*/
+		     , CASE IFNULL((SELECT COUNT(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' ),0) 
+		            WHEN 0 THEN 'N'
+		            ELSE 'Y' END AS GOODS_IMAGE_YN
+		     , (CASE WHEN G.GOODS_TYPE = 'G056_N' THEN (SELECT NVL(SUM(CURR_STOCK_QTY - BASE_STOCK_QTY),0) FROM VW_STOCK WHERE GOODS_CD = G.GOODS_CD) 
+		            ELSE (SELECT NVL(SUM(CURR_STOCK_QTY - BASE_STOCK_QTY),0) FROM VW_STOCK_COMPOSE WHERE GOODS_CD = G.GOODS_CD) 
+		            END) AS STOCK_QTY_SUM
 		     , (SELECT ITEMKIND_NM FROM TB_ITEMKIND WHERE ITEMKIND_CD = G.ITEMKIND_CD) AS ITEMKIND_NM
-		     , GI.IMG_PATH1
-		     , GI.IMG_PATH6
-		     , GI.IMG_TYPE
+		     , (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
 		     , G.REG_NO
 		     , DATE_FORMAT(G.REG_DT, '%Y-%m-%d %H:%i:%S') AS REG_DT
 		     , G.UPD_NO
@@ -481,8 +483,6 @@
 		               </if>
 		              )
 		</if>
-		LEFT OUTER JOIN TB_GOODS_IMG GI ON G.GOODS_CD = GI.GOODS_CD
-		                                AND G.MAIN_COLOR_CD = GI.COLOR_CD
 		WHERE 1=1
 		<if test="searchGb == null or searchGb =='BASIC' or searchGb =='EXTEND' or searchGb =='MASTER'" >
 		<include refid="getGoodsListCondition_sql"/>
@@ -503,6 +503,7 @@
 		     , G.GOODS_SNM1
 		     , G.BRAND_CD
 		     , B.BRAND_GRP_NM
+		     , B.BRAND_NO
 		     , G.ITEMKIND_CD
 		     , G.STYLE_YEAR
 		     , G.SEASON_CD
@@ -532,8 +533,10 @@
 		     , G.SELL_FEE_RATE
 		     , G.FORMAL_GB
 		     , G.RETURNABLE_YN
+		     , G.CHANGEABLE_YN
 		     , G.PRE_PPNT_USABLE_YN
 		     , G.PRE_MPNT_USABLE_YN
+		     , G.NEW_CUST_ORD_YN
 		     , G.MIN_ORD_QTY
 		     , G.MAX_ORD_QTY
 		     , G.DAY_MAX_ORD_QTY
@@ -550,27 +553,25 @@
 		     , FN_GET_CODE_NM('G056', G.GOODS_TYPE) AS GOODS_TYPE_NM
 		     , DATE_FORMAT(G.FRST_CFRM_DT, '%Y%m%d%H%i%S') AS FRST_CFRM_DT
 		     , (SELECT I.NI_CLSF_CD FROM TB_ITEMKIND I WHERE I.ITEMKIND_CD = G.ITEMKIND_CD) AS NI_CLSF_CD
-		     , GI.IMG_TYPE
-		     , GI.IMG_PATH1
-		     , GI.IMG_PATH6
-		     , CASE WHEN IMG_PATH1 IS NULL THEN
-		           'N'
-		       ELSE
-		           'Y'
-		       END AS GOODS_IMAGE_YN
+		     , (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
+		     , CASE IFNULL((SELECT COUNT(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' ),0) 
+		            WHEN 0 THEN 'N'
+		            ELSE 'Y' END AS GOODS_IMAGE_YN
 		     , (SELECT B.CD_NM 
 		       FROM TB_ITEMKIND A
 		          , TB_COMMON_CODE B 
 		       WHERE A.ITEMKIND_CD = G.ITEMKIND_CD 
 		       AND A.NI_CLSF_CD = B.CD 
 		       AND B.CD_GB = 'G004') AS  NI_CLSF_NM
-		     , FN_GET_USER_NM(G.UPD_NO) AS UPD_NM  
+		     , FN_GET_USER_NM(G.UPD_NO) AS UPD_NM
+		     , E.CERT_NUM
+		     , E.CERT_DT
 		FROM TB_GOODS G
 		INNER JOIN TB_BRAND B ON G.BRAND_CD = B.BRAND_CD
-		LEFT OUTER JOIN TB_GOODS_IMG GI ON G.GOODS_CD = GI.GOODS_CD
-		                                AND G.MAIN_COLOR_CD = GI.COLOR_CD
 		LEFT OUTER JOIN TB_DELV_FEE_POLICY D ON G.SUPPLY_COMP_CD = D.SUPPLY_COMP_CD
 		                                     AND G.DELV_FEE_CD =  D.DELV_FEE_CD
+		LEFT OUTER JOIN TB_GOODS_SAFE_NO E ON G.GOODS_CD = E.GOODS_CD
+
 		WHERE 1 = 1 
 		<choose>
 		<when test="goodsCd != null and goodsCd != ''">
@@ -855,14 +856,10 @@
 		SELECT A.GOODS_CD
 		     , A.SUPPLY_COMP_CD
 		     , (SELECT I.NI_CLSF_CD FROM TB_ITEMKIND I WHERE I.ITEMKIND_CD = A.ITEMKIND_CD) AS NI_CLSF_CD
-		     , CASE WHEN B.IMG_PATH1 IS NULL THEN
-		            'N'
-		       ELSE
-		            'Y'
-		       END AS GOODS_IMAGE_YN
+		     , CASE IFNULL((SELECT COUNT(SYS_IMG_NM) FROM TB_GOODS_IMG  WHERE GOODS_CD = A.GOODS_CD AND COLOR_CD = A.MAIN_COLOR_CD AND DEFAULT_IMG_YN = 'Y' ),0) 
+		            WHEN 0 THEN 'N'
+		            ELSE 'Y' END AS GOODS_IMAGE_YN
 		FROM TB_GOODS A
-		LEFT OUTER JOIN TB_GOODS_IMG B ON A.GOODS_CD = B.GOODS_CD
-		                               AND A.MAIN_COLOR_CD = B.COLOR_CD
 		WHERE 1 = 1
 		<choose>
 		<when test="goodsCd != null and goodsCd != ''">
@@ -1087,10 +1084,8 @@
 		SELECT A.GOODS_CD 
 		     , NVL(A.OPT_CD1, A.MAIN_COLOR_CD) AS OPT_CD1
 		     , A.MAIN_COLOR_CD
-		     , IF(A.MAIN_COLOR_CD = NVL(A.OPT_CD1, A.MAIN_COLOR_CD), 'Y','N') AS  MAIN_COLOR_YN 
-		     , GI.IMG_PATH1
-		     , GI.IMG_PATH6
-		     , NVL(GI.IMG_TYPE,'G030_A') AS IMG_TYPE
+		     , IF(A.MAIN_COLOR_CD = NVL(A.OPT_CD1, A.MAIN_COLOR_CD), 'Y','N') AS  MAIN_COLOR_YN
+		     , (SELECT MAX(SYS_IMG_NM) FROM TB_GOODS_IMG  WHERE GOODS_CD = A.GOODS_CD AND COLOR_CD = A.OPT_CD1 AND DEFAULT_IMG_YN = 'Y' ) AS SYS_IMG_NM 
 		     , C.COLOR_ENM 
 		FROM (
 		      SELECT A.GOODS_CD 
@@ -1102,8 +1097,6 @@
 		      GROUP BY A.GOODS_CD , B.OPT_CD1
 		     ) A 
 		LEFT OUTER JOIN TB_COLOR C ON A.OPT_CD1 = C.COLOR_CD 
-		LEFT OUTER JOIN TB_GOODS_IMG GI ON A.GOODS_CD  = GI.GOODS_CD 
-		                                AND A.OPT_CD1 = GI.COLOR_CD
 	</select>
 	
 	<!-- 상품 기본 정보 등록 -->
@@ -1445,6 +1438,8 @@
 	<!-- 상품 가격 승인 목록 -->
 	<select id="getGoodsSupplyPriceList"  parameterType="GoodsPriceRes" resultType="GoodsPriceRes">
 		/* TsaGoods.getGoodsSupplyPriceList */
+		SELECT Q.*
+		FROM (
 		SELECT Z.*
 		FROM (
 		    SELECT A.*, @rownum := @rownum + 1 AS RNUM FROM (
@@ -1744,4 +1739,62 @@
 		  , NOW()
 		)
 	</insert>
+	
+	<!-- 상품이미지 목록 -->
+	<select id="getGoodsImageList" parameterType="GoodsImg" resultType="GoodsImg">
+		/* TsaGoods.getGoodsImageList */
+		SELECT GOODS_CD
+		     , COLOR_CD
+		     , DISP_ORD
+		     , SUBSTRING_INDEX(SYS_IMG_NM , '/', -1) AS SYS_IMG_NM  /* S0001/20201221/14505664_L.jpg */
+		     , SUBSTRING_INDEX(SYS_IMG_NM , '/', 2) AS SYS_IMG_URL
+		     , DEFAULT_IMG_YN
+		FROM   TB_GOODS_IMG
+		WHERE  GOODS_CD = #{goodsCd}
+		AND    COLOR_CD = #{colorCd}
+		ORDER  BY DISP_ORD
+	</select>
+	
+	<!-- 상품이미지 전체 삭제 -->
+	<delete id="deleteGoodsImageTotal" parameterType="GoodsImg">
+		/* TsaGoods.deleteGoodsImageTotal */
+		DELETE
+		FROM TB_GOODS_IMG
+		WHERE GOODS_CD = #{goodsCd}
+		AND COLOR_CD = #{colorCd}
+	</delete>
+
+	<!-- 상품이미지 삭제 -->
+	<delete id="deleteGoodsImage" parameterType="GoodsImg">
+		/* TsaGoods.deleteGoodsImage */
+		DELETE
+		FROM TB_GOODS_IMG
+		WHERE GOODS_CD = #{goodsCd}
+		AND COLOR_CD = #{colorCd}
+		AND DISP_ORD = #{dispOrd}
+	</delete>
+
+	<!-- 상품이미지 등록 -->
+	<insert id="createGoodsImage" parameterType="GoodsImg">
+		/* TsaGoods.createGoodsImage */
+		INSERT INTO TB_GOODS_IMG (
+		       GOODS_CD
+		     , COLOR_CD
+		     , DISP_ORD
+		     , SYS_IMG_NM
+		     , DEFAULT_IMG_YN
+		     , REG_NO
+		     , REG_DT
+		)
+		VALUES (
+		       #{goodsCd}
+		     , #{colorCd}
+		     , #{dispOrd}
+		     , #{sysImgNm}
+		     , #{defaultImgYn}
+		     , #{regNo}
+		     , NOW()
+		)
+	</insert>
+	
 </mapper>

+ 40 - 0
style24.scm/src/main/java/com/style24/scm/biz/dao/TssGoodsDao.java

@@ -2,6 +2,8 @@ package com.style24.scm.biz.dao;
 
 import java.util.Collection;
 
+import org.springframework.dao.DataAccessException;
+
 import com.style24.core.support.annotation.ShopDs;
 import com.style24.persistence.domain.Goods;
 import com.style24.persistence.domain.GoodsDesc;
@@ -356,4 +358,42 @@ public interface TssGoodsDao {
 	 * @since 2020. 12. 11
 	 */
 	void createGoodsCustGrade(Goods goods);
+
+	/**
+	 * 상품이미지 목록
+	 *
+	 * @param goodsImg
+	 * @return Collection<GoodsImg>
+	 * @author eskim
+	 * @since 2020. 12. 23
+	 */
+	Collection<GoodsImg> getGoodsImageList(GoodsImg goodsImg);
+
+	/**
+	 * 상품이미지 전체 삭제
+	 * @param goodsImg - 상품이미지 정보
+	 * @throws DataAccessException
+	 * @author eskim
+	 * @since 2020. 12. 23
+	 */
+	public void deleteGoodsImageTotal(GoodsImg goodsImg);
+
+	/**
+	 * 상품이미지 삭제
+	 * @param goodsImg - 상품이미지 정보
+	 * @throws DataAccessException
+	 * @author eskim
+	 * @since 2020. 12. 23
+	 */
+	public void deleteGoodsImage(GoodsImg goodsImg);
+
+	/**
+	 * 상품이미지 등록
+	 * @param goodsImg - 상품이미지 정보
+	 * @throws DataAccessException
+	 * @author eskim
+	 * @since 2020. 12. 23
+	 */
+	public void createGoodsImage(GoodsImg goodsImg);
+
 }

+ 39 - 11
style24.scm/src/main/java/com/style24/scm/biz/service/TssGoodsService.java

@@ -110,7 +110,7 @@ public class TssGoodsService {
 				"정상가", "판매가", "할인율", "가격변경일", "ERP재고연동여부", "정상이월구분", "반품가능 여부", "승인일시"};
 
 			// DB 처리 시 사용되는 파라미터명(셀명) 설정
-			String[] cellNames = {"IMG_PATH1", "GOODS_CD", "SUPPLY_COMP_CD", "BRAND_GRP_NM", "GOODS_NM", "ITEMKIND_NM",
+			String[] cellNames = {"SYS_IMG_NM", "GOODS_CD", "SUPPLY_COMP_CD", "BRAND_GRP_NM", "GOODS_NM", "ITEMKIND_NM",
 				"STOCK_QTY_SUM", "GOODS_STAT", "STYLE_YEAR", "SEASON_CD", "LIST_PRICE", "CURR_PRICE",
 				"DC_RATE", "PRICE_UPD_DT", "ERP_STOCK_LINK_YN", "FORMAL_GB", "RETURNABLE_YN", "FRST_CFRM_DT"};
 
@@ -129,16 +129,8 @@ public class TssGoodsService {
 			Collection<GagaMap> dataList = goodsDao.getGoodsInfoExcelList(goodsSearch); // map형식으로 조회
 			if (dataList != null && !dataList.isEmpty()) {
 				for (GagaMap gagaMap : dataList) {
-					if ("A".equals(gagaMap.get("IMG_TYPE").toString())) {
-						gagaMap.set("IMG_PATH1", gagaMap.get("IMG_PATH1").toString());
-					} else {
-
-						if (!StringUtils.isEmpty(gagaMap.get("IMG_PATH6"))) {
-							gagaMap.set("IMG_PATH1", targetPath + gagaMap.get("IMG_PATH6").toString());
-
-						} else {
-							gagaMap.set("IMG_PATH1", targetPath + gagaMap.get("IMG_PATH1").toString());
-						}
+					if (!StringUtils.isEmpty(gagaMap.get("SYS_IMG_NM").toString()) ) {
+						gagaMap.set("SYS_IMG_NM", targetPath + '/' +  gagaMap.get("SYS_IMG_NM").toString());
 					}
 				}
 			}
@@ -1008,6 +1000,42 @@ public class TssGoodsService {
 				goodsDao.deleteNoticeGoods(noticeGoods);
 			}
 		}
+	}
+
+	/**
+	 * 상품이미지 목록
+	 *
+	 * @param goodsImg
+	 * @return Collection<GoodsImg>
+	 * @author eskim
+	 * @since 2020. 12. 23
+	 */
+	public Collection<GoodsImg> getGoodsImgList(GoodsImg goodsImg) {
+		return goodsDao.getGoodsImageList(goodsImg);
+	}
 
+	/**
+	 * 상품이미지 저장 처리
+	 * @param goodsImgList - 상품이미지 목록
+	 * @throws
+	 * @author eskim
+	 * @since 2020. 12. 23
+	 */
+	@Transactional("shopTxnManager")
+	public void saveGoodsImageList(Collection<GoodsImg> goodsImgList){
+		int index = 0;
+		for (GoodsImg goodsImg : goodsImgList) {
+			// 상품이미지 전체 삭제
+			if (index++ == 0) {
+				goodsDao.deleteGoodsImageTotal(goodsImg);
+			}
+
+			if (!goodsImg.getMode().equals("D")) {
+				// 상품이미지 등록
+				goodsImg.setRegNo(TssSession.getInfo().getUserNo());
+				goodsDao.createGoodsImage(goodsImg);
+			}
+		}
 	}
+
 }

+ 125 - 8
style24.scm/src/main/java/com/style24/scm/biz/web/TssGoodsController.java

@@ -1,5 +1,6 @@
 package com.style24.scm.biz.web;
 
+import java.io.File;
 import java.util.ArrayList;
 import java.util.Collection;
 
@@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
@@ -25,6 +27,7 @@ import com.style24.core.support.message.TscMessageByLocale;
 import com.style24.persistence.TssPageRequest;
 import com.style24.persistence.domain.Goods;
 import com.style24.persistence.domain.GoodsHst;
+import com.style24.persistence.domain.GoodsImg;
 import com.style24.persistence.domain.GoodsNotiInfo;
 import com.style24.persistence.domain.GoodsPriceRes;
 import com.style24.persistence.domain.GoodsSearch;
@@ -48,6 +51,7 @@ import com.gagaframework.web.rest.server.GagaResponse;
 import com.gagaframework.web.rest.server.GagaResponseStatus;
 import com.gagaframework.web.util.GagaDateUtil;
 import com.gagaframework.web.util.GagaFileUtil;
+import com.gagaframework.web.util.GagaStringUtil;
 
 /**
  * 상품관리 Controller
@@ -582,27 +586,140 @@ public class TssGoodsController extends TssBaseController {
 	}
 
 	/**
-	 * 상품 이미지 관리 화면(입점)
+	 * 상품 이미지 보기 화면
 	 *
 	 * @param goodsCode - 상품코드
 	 * @return
 	 * @author eskim
-	 * @since 2020. 11. 09
+	 * @since 2020. 12. 23
 	 */
 	@GetMapping("/image/form")
 	@ResponseBody
-	public ModelAndView imageForm(Goods goods) {
+	public ModelAndView imageMassForm(GoodsImg goodsImg) {
 		ModelAndView mav = new ModelAndView();
 
-//		goods = goodsService.getGoods(goods);
-//		// mav.addObject("goodsImgList", goodsService.getGoodsImgList(goods)); //이미지 - 행
-//		mav.addObject("goodsImgInfo", goodsService.getGoodsImg(goods)); // 이미지 - 열
-//
-		mav.addObject("params", goods);
+		Collection<GoodsImg> goodsImgList = goodsService.getGoodsImgList(goodsImg);
+
+		if (goodsImgList != null && !goodsImgList.isEmpty()) {
+
+			mav.addObject("goodsImgList", goodsImgList);
+
+			for (GoodsImg goodsImgInfo : goodsImgList) {
+				if (goodsImgInfo.getDefaultImgYn().equals("Y")) {
+					mav.addObject("defaultImgOrd", goodsImgInfo.getDispOrd());
+				}
+			}
+		} else { // 대표이미지와 마우스오버이미지가 없으면
+			mav.addObject("goodsImgList", new ArrayList<GoodsImg>());
+			mav.addObject("defaultImgOrd", "1");
+		}
+
+		mav.addObject("goodsImg", goodsImg);
 		mav.setViewName("goods/GoodsImageForm");
 		return mav;
 	}
 
+	/**
+	 * 상품 썸네일 이미지 저장 처리
+	 * @param goodsImgList - 상품이미지 목록
+	 * @return
+	 * @throws Exception
+	 * @author eskim
+	 * @since 2020. 112. 23
+	 */
+	@RequestMapping(value = "/thumbnail/image/save", method = RequestMethod.POST)
+	@ResponseBody
+	public GagaResponse saveGoodsThumbnailImageList(@RequestBody Collection<GoodsImg> goodsImgList) throws Exception {
+		if (goodsImgList == null || goodsImgList.isEmpty())
+			throw new IllegalStateException(message.getMessage("FAIL_1001"));
+
+		String dextUploadPath = env.getProperty("upload.dext.target.path");
+		String goodsTargetPath = env.getProperty("upload.goods.target.path");
+
+		int index = 1;
+		String strBrandNo = "";
+
+		// 오류 파일 목록
+		Collection<File> errorFileList = new ArrayList<File>();
+
+		// 1.업로드된 파일 rename 및 순서 재정렬
+		for (GoodsImg goodsImg : goodsImgList) {
+			// dx5에서 삭제한 파일은 skip
+			if (goodsImg.getMode().equals("D")) {
+				continue;
+			}
+
+			// 상품의 브랜드 번호 추출
+			if (strBrandNo.isEmpty()) {
+				Goods goods = new Goods();
+				goods.setGoodsCd(goodsImg.getGoodsCd());
+				Goods goodsInfo = goodsService.getGoods(goods);
+				if (goodsInfo == null || goodsInfo.getGoodsCd().isEmpty())
+					throw new IllegalStateException(message.getMessage("FAIL_1001"));
+
+				strBrandNo = String.valueOf(goodsInfo.getBrandNo());
+			}
+
+			if (goodsImg.getMode().equals("C")) { // 업로드 된 파일 rename 처리
+//				String newFilename = goodsImg.getGoodsCd()
+//						+ "_" + goodsImg.getColorCd()
+//						+ "_" + String.valueOf(index)
+//						+ "(" + GagaDateUtil.getTodayTime() + ")"
+//						+ "." + StringUtils.getFilenameExtension(goodsImg.getSysImgNm());
+				String newFilename = goodsImg.getSysImgNm();
+
+				String brandDir = GagaFileUtil.getConcatenationPath(GagaStringUtil.getLPadding(strBrandNo, 10, "0"),GagaDateUtil.getToday()); // 브랜드/UPLOAD 일 YYYYMMDD
+				String goodsUploadPath = GagaFileUtil.getConcatenationPath(goodsTargetPath, brandDir);		//저장경로 생성
+
+				File uniqueFile = GagaFileUtil.getUniqueFile(new File(GagaFileUtil.getConcatenationPath(goodsUploadPath, newFilename)));
+				File newFile = new File(GagaFileUtil.getConcatenationPath(goodsUploadPath,  uniqueFile.getName()));
+				//log.info("newFile.getPath(): {}", newFile.getPath());
+
+				// resizing 처리 시 오류가 발생할 경우 삭제하기 위해 설정
+				errorFileList.add(newFile);
+
+				File oldFile = new File(GagaFileUtil.getConcatenationPath(dextUploadPath, goodsImg.getSysImgNm()));
+				//log.info("oldFile.getPath(): {}", oldFile.getPath());
+
+				File path = new File(goodsUploadPath);
+				if (!path.exists()) {
+					//log.info("mkdir ={}", goodsUploadPath);
+					path.mkdir();
+				}
+
+				boolean copyFlag = GagaFileUtil.copyFile(oldFile, newFile);
+				if (copyFlag) {
+					//기존이미지 삭제
+					GagaFileUtil.deleteFile(oldFile.getPath());
+				}
+
+				goodsImg.setDispOrd(index++);
+				goodsImg.setOrgImgNm(GagaFileUtil.getConcatenationPath(brandDir,newFile.getName()));
+				goodsImg.setSysImgNm(GagaFileUtil.getConcatenationPath(brandDir,newFile.getName()));
+			} else {
+				goodsImg.setOrgImgNm(GagaFileUtil.getConcatenationPath(goodsImg.getSysImgUrl() ,goodsImg.getSysImgNm()));
+				goodsImg.setSysImgNm(GagaFileUtil.getConcatenationPath(goodsImg.getSysImgUrl() ,goodsImg.getSysImgNm()));
+				goodsImg.setDispOrd(index++);
+			}
+		}
+
+		// 2.dx5에서 삭제한 파일 실제 삭제 처리
+		for (GoodsImg goodsImg : goodsImgList) {
+			if (goodsImg.getMode().equals("D")) {
+				log.info("Original file to delete: {}", GagaFileUtil.getConcatenationPath(goodsTargetPath, goodsImg.getSysImgUrl(), goodsImg.getSysImgNm()));
+
+				// 상품이미지 삭제
+				GagaFileUtil.deleteFile(GagaFileUtil.getConcatenationPath(goodsTargetPath, goodsImg.getSysImgUrl(), goodsImg.getSysImgNm()));
+
+			}
+		}
+
+		// 상품이미지 저장 처리
+		goodsService.saveGoodsImageList(goodsImgList);
+
+		return super.ok(message.getMessage("SUCC_0007"));
+	}
+
 	/**
 	 * 상품 이미지 대량관리 화면(자사)
 	 *

+ 1 - 0
style24.scm/src/main/webapp/WEB-INF/views/common/fragments/variables.html

@@ -24,6 +24,7 @@ var _uximgUrl = [[${@environment.getProperty('domain.uximage')}]];
 var _imgUrl = [[${@environment.getProperty('domain.image')}]];
 var _sampleUrl = [[${@environment.getProperty('upload.sample.view')}]];
 var _uploadDefaultUrl = [[${@environment.getProperty('upload.default.view')}]];
+var _goodsUrl = [[${@environment.getProperty('upload.goods.view')}]];
 
 var _today = [[${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}]];
 var _thisYear = [[${#calendars.format(#calendars.createNow(), 'yyyy')}]];

+ 3 - 23
style24.scm/src/main/webapp/WEB-INF/views/goods/GoodsDetailForm.html

@@ -103,7 +103,7 @@
 									<tr>
 										<td rowspan="4" style="text-align:center" th:with="uploadGoodsUrl=${@environment.getProperty('upload.goods.view')}">
 										<img id="goodsImgUrl" src="" width="100px"/>
-										<input type="hidden" name="imgPath1" id="imgPath1" />
+										<input type="hidden" name="sysImgNm" id="sysImgNm" />
 										</td>
 										<th>상품타이틀</th>
 										<td colspan="5">
@@ -756,28 +756,8 @@
 				}
 			}
 
-			var goodsImg = "";
-			var goodsImgPath1 = "";
-			if (result.imgType == "G030_A"){
-				if (!gagajf.isNull(result.imgPath6)){
-					goodsImg = result.imgPath6;
-					goodsImgPath1 = result.imgPath6;
-				}else{
-					goodsImg = result.imgPath1;
-					goodsImgPath1 = result.imgPath1;
-				}
-				
-			}else{
-				if (!gagajf.isNull(result.imgPath6)){
-					goodsImg = uploadGoodsUrl+result.imgPath6;
-					goodsImgPath1 = result.imgPath6;
-				}else{
-					goodsImg = uploadGoodsUrl+result.imgPath1;
-					goodsImgPath1 = result.imgPath1;
-				}
-			}
-			$('#goodsDetailForm').find('#goodsImgUrl').attr('src',goodsImg);
-			$('#goodsDetailForm input[name=imgPath1]').val(goodsImgPath1);
+			$('#goodsDetailForm').find('#goodsImgUrl').attr('src',  _goodsUrl + '/'+ result.sysImgNm);
+			$('#goodsDetailForm input[name=sysImgNm]').val(result.sysImgNm);
 			$("#goodsDetailForm input[type=checkbox][checked]").parent("label").addClass("checked");
 
 			//품목변경 권한 관련 처리

+ 19 - 17
style24.scm/src/main/webapp/WEB-INF/views/goods/GoodsDetailSizeStockForm.html

@@ -37,18 +37,16 @@
 			<td class="aC" th:text="${sizeStatus.count}">1</td>
 			<td class="aC"><label class="rdoBtn"><input type="radio" name="basicColor" th:value="${goodsColor.optCd1}"  th:checked="${goodsColor.mainColorYn =='Y'}" /></label></td>
 			<td class="aC">
-				<th:block th:if="${goodsColor.imgType == 'G030_A'}">
-					<img width="60" th:if="${goodsColor.imgPath6}" th:src="${goodsColor.imgPath6}" th:onerror="'this.src=\''+@{${uxImgUrl}+ '/image/no.gif'}+'\';'" alt="">
-					<img width="60" th:unless="${goodsColor.imgPath6}" th:src="${goodsColor.imgPath1}" th:onerror="'this.src=\''+@{${uxImgUrl}+ '/image/no.gif'}+'\';'" alt="">
-				</th:block>
-				<th:block th:unless="${goodsColor.imgType == 'G030_A'}">
-					<img width="60" th:if="${goodsColor.imgPath6}" th:src="${uploadGoodsUrl+goodsColor.imgPath6}" th:onerror="'this.src=\''+@{${uxImgUrl}+ '/image/no.gif'}+'\';'" alt="">
-					<img width="60" th:unless="${goodsColor.imgPath6}" th:src="${uploadGoodsUrl+goodsColor.imgPath1}" th:onerror="'this.src=\''+@{${uxImgUrl}+ '/image/no.gif'}+'\';'" alt="">
-				</th:block>
+				<img width="60" th:src="${uploadGoodsUrl+'/'+goodsColor.sysImgNm}" th:onerror="'this.src=\''+@{${uxImgUrl}+ '/image/no.gif'}+'\';'" alt="">
+				<input type="hidden" name="sysImgNmOrg" id="sysImgNmOrg" th:value="${goodsColor.sysImgNm}"/>
 			</td>	
-			<td class="aC" th:text="${goodsColor.optCd1}">BK</td>
-			<td class="aC" th:text="${goodsColor.colorEnm}">BLACK</td>
-			<td><button type="button" class="btn btn-base btn-lg" th:onclick="fnGoodsDetailImg([[${goodsColor.optCd1}]])" th:text="${#strings.isEmpty(goodsColor.imgPath1) ?'등록':'수정'}">등록</button></td>
+			<td class="aC" ><th:block th:text="${goodsColor.optCd1}">BK</th:block> 
+				<input type="hidden" name="colorCd" id="colorCd" th:value="${goodsColor.optCd1}"/>
+			</td>
+			<td class="aC" ><th:block th:text="${goodsColor.colorEnm}">BLACK</th:block>  
+				<input type="hidden" name="colorNm" id="colorNm" th:value="${goodsColor.colorEnm}"/>
+			</td>
+			<td><button type="button" class="btn btn-base btn-lg" onclick="fnGoodsDetailImg(this)" th:text="${#strings.isEmpty(goodsColor.sysImgNm) ?'등록':'수정'}">등록</button></td>
 		</tr>
 		</th:block>
 		</tbody>
@@ -137,15 +135,19 @@
 <script th:inline="javascript">
 /*<![CDATA[*/
 	
-	var fnGoodsDetailImg = function(colorCd){
-		if ("Y" == $('#goodsDetailForm input[name=selfGoodsYn]').val()){
-			cfnOpenGoodsImageMassPopup($('#goodsDetailForm input[name=goodsCd]').val(), colorCd);
-		}else{
-			cfnOpenGoodsImagePopup($('#goodsDetailForm input[name=goodsCd]').val());	
+	var fnGoodsDetailImg = function(obj){
+		var mode= 'U';
+		var goodsCd = $('#goodsDetailForm input[name=goodsCd]').val();
+		var colorCd = $(obj).parent().parent().find("input[name=colorCd]").val();
+		var colorNm = $(obj).parent().parent().find("input[name=colorNm]").val();
+		
+		if (gagajf.isNull($(obj).parent().parent().find("input[name=sysImgNmOrg]").val())){
+			mode = "C";
 		}
 		
+		cfnOpenGoodsImagePopup(goodsCd, colorCd, colorNm, mode);
+		
 	}
-	
 	$(document).ready(function() {
 		
 		//옵션/재곡 변경여부

+ 226 - 150
style24.scm/src/main/webapp/WEB-INF/views/goods/GoodsImageForm.html

@@ -3,8 +3,8 @@
 	xmlns:th="http://www.thymeleaf.org">
 <!--
  *******************************************************************************
- * @source  : GoodsImageForm.html
- * @desc    : 상품 이미지 관리 화면(입점)
+ * @source  : GoodsImageMassForm.html
+ * @desc    : 상품 이미지 보기 화면(대량등록)
  *============================================================================
  * SISUN
  * Copyright(C) 2019 TSIT, All rights reserved.
@@ -12,186 +12,262 @@
  * VER  DATE         AUTHOR      DESCRIPTION
  * ===  ===========  ==========  =============================================
  * 1.0  2020.11.27   eskim       최초 작성
-  *******************************************************************************
+ *******************************************************************************
  -->
-	<div class="modalPopup"  data-width="650">
+	<div class="modalPopup" data-width="1280">
 		<!-- PANELSTYLE -->
-		<div class="panelStyle">
-			<div class="panelTitle">
-				<strong>상품 이미지 보기&nbsp;<button type="button" class="btn icn" onclick="fnOpenCommentPopup('comment')" ><i class="fa fa-cog" aria-hidden="true"></i></button></strong>
-				<button type="button" class="close" onclick="fnGoodsImgFormClose()"><i class="fa fa-times"></i></button>
-			</div>
-			<div class="panelContent">
-			<form id="goodsImgForm" name="goodsImgForm" th:method="post">
-			<input type="hidden" id="goodsCd" name="goodsCd" th:value="${params.goodsCd}"/>
-				<table class="frmStyle" th:with="uploadGoodsUrl=${@environment.getProperty('upload.goods.view')},uxImgUrl=${@environment.getProperty('domain.uximage')}">
-					<colgroup>
-						<col width="75%"/>
-						<col width="25%"/>
-					</colgroup>
-					<tbody id="goodsImgList">
+			<div class="panelStyle">
+				<!-- TITLE -->
+				<div class="panelTitle">
+					<h2>상품 이미지 <th:block th:text="${goodsImg.mode =='U'}? '상세':'등록'"></th:block>&nbsp;<button type="button" class="btn icn" onclick="fnOpenCommentPopup('comment')" ><i class="fa fa-cog" aria-hidden="true"></i></button></h2>
+					<button type="button" class="close" onclick="fnGoodsImgFormClose()"><i class="fa fa-times"></i></button>
+				</div>
+				<!-- //TITLE -->
+				<!-- CONTENT -->
+				<div class="panelContent">
+				<form id="goodsImgForm" name="goodsImgForm" action="#" th:method="post">
+				<input type="hidden" name="goodsCd" th:value="${goodsImg.goodsCd}"/>
+				<input type="hidden" name="colorCd" th:value="${goodsImg.colorCd}"/>
+<!-- 				<input type="hidden" name="goodsCd" th:value="14373767"/>
+				<input type="hidden" name="colorCd" th:value="IV"/>
+ -->				
+					<ul class="notice">
+						<li>[업로드/수정] 버튼 클릭 하면 프론트에 바로 적용되므로 최종 확인 후 전송을 권장합니다.</li>
+						<li>이미지 미리보기 리스트는 <em>업로드 후</em> 확인 할 수 있습니다.</li>
+						<li>이미지보기 버튼은 이미지 파일 <em>등록 후</em> 확인 할 수 있습니다. 이미 <em>업로드 된</em> 파일은 확인 할 수 없습니다.(파일 크기 옆 화살표로 구분 가능합니다.)</li>
+					</ul>
+					<table class="frmStyle">
+						<colgroup>
+							<col width="7%"/>
+							<col width="25%"/>
+							<col width="8%"/>
+							<col width="10%"/>
+							<col width="8%"/>
+							<col width="10%"/>
+							<col width="8%"/>
+							<col/>
+						</colgroup>
 						<tr>
-							<th class="aL vaT">imgPath1 : <th:block th:utext="${'필수: 상품코드_01.jpg<i class=star></i>'}"></th:block>
-								<hr/>
-								<input type="text" class="w100p" id="imgPath1" name="imgPath1" />
-							</th>
-							<td>
-								<img  src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" th:onerror="'this.src=\''+@{${uxImgUrl}+ '/image/no.gif'}+'\';'" width="200px"/>
+							<th>상품코드</th>
+							<td th:text="${goodsImg.goodsCd}">14373767</td>
+							<th>컬러명</th>
+							<td th:text="${goodsImg.colorNm}">PINK</td>
+							<th>대표 이미지순번</th>
+							<td><input type="text" class="text-right" name="defaultImgOrd" maxlength="3" th:value="${defaultImgOrd}" required="required" data-valid-type="number" data-valid-name="대표이미지순번"/></td>
+							<td colspan="2"></td>
+						</tr>
+						<tr>
+							<th>이미지등록</th>
+							<td class="dexterArea">
+
+								<!-- 덱스터 테이블 영역 -->
+								<ul class="dexterTable">
+									<li class="dexterNo" id="dx5Index">
+										<!-- 덱스터 테이블 번호 -->
+										<!-- //덱스터 테이블 번호 -->
+									</li>
+									<li>
+									<!-- 덱스터 테이블 삽입 -->
+										<!-- 덱스터 테이블 삽입<br/>공간은 테이블 넓이에 따라 자동으로 넓어집니다.<br/>
+										(최소 넓이 : 350px로 설정됨)<br/> -->
+										<div id="dext5-container" style="width: 100%; height: 450px;"></div>
+									<!-- //덱스터 테이블 -->
+									<li>
+								</ul>
+								<!-- //덱스터 테이블 영역 -->
+
+							</td>
+							<td colspan="6" class="verticalTop">
+
+								<!-- 이미지 카드 영역 -->
+								<div class="cardArea" id="dx5CardArea">
+									<!-- 이미지 카드 -->
+								</div>
+								<!-- //이미지 카드 영역 -->
 							</td>
 						</tr>
-					</tbody>
-				</table>
-			</form>
+					</table>
+				</form>	
+				</div>
+				<!-- 버튼 배치 영역 -->
+				<ul class="panelBar marT10">
+					<li class="center">
+						<button type="button" class="btn btn-base btn-sm" id="btnAddFiles">파일 추가</button>
+						<button type="button" class="btn btn-default btn-sm" onclick="gagaDx5.deleteChooseFile();">선택 삭제</button>
+						<button type="button" class="btn btn-default btn-sm" onclick="gagaDx5.deleteAllFiles();">전체 삭제</button>
+						<button type="button" class="btn btn-info btn-sm" onclick="gagaDx5.moveFile(true);">위로 이동</button>
+						<button type="button" class="btn btn-info btn-sm" onclick="gagaDx5.moveFile(false);">아래로 이동</button>
+						<!-- <button type="button" class="btn btn-base btn-sm" onclick="gagaDx5.previewImage();">이미지 보기</button> -->
+						<button type="button" class="btn btn-base btn-sm" onclick="gagaDx5.uploadFiles();">업로드/수정</button>
+					</li>
+				</ul>
+				<!-- //버튼 배치 영역 -->
 			</div>
-			<ul class="panelBar">
-				<li class="right">
-				<th:block th:if="${sessionInfo.roleCd == 'G001_B000'}">
-				<button type="button" class="btn btnRight btn-success btn-lg" id="btnGoodsDetailImgSave">저장</button>
-				</th:block>
-				</li>
-			</ul>
-		</div>
 	</div>
+<script type="text/javascript" src="/dx5/dextuploadx5-configuration.js?v=2020122101"></script>
+<script type="text/javascript" src="/dx5/dextuploadx5.js?v=2020122101"></script>
+<script type="text/javascript" src="/ux/plugins/gaga/gaga.dx5.js?2020122101"></script>
 <script th:inline="javascript">
 /*<![CDATA[*/
-	var fileExtension = [[${@environment.getProperty('upload.goods.allow.extension')}]];
+	
+	var goodsImgList = [[${goodsImgList}]];
+	
+	//--------------------------------------------------------------------------
+	// Dextupload X5 이벤트 Start
+	//--------------------------------------------------------------------------
+	// Dextupload X5 생성
+	gagaDx5.createDX5("dext5", "btnAddFiles", _goodsUrl, "goods");
+
+	// Dextupload X5 생성 후 호출되는 이벤트
+	var onDX5Created = function(id) {
+		var actionUrl = '/dext/files/upload/goods';
+		gagaDx5.onDX5Created(actionUrl, goodsImgList);
+	}
+
+	// Dextupload X5 에러 시 호출되는 이벤트
+	var onDX5Error = function(id, code, msg) {
+		mcxDialog.alert(id + " => " +  code + "\n" + msg);
+	}
+
+	// Dextupload X5 업로드 성공 시 호출되는 이벤트
+	var onDX5UploadCompleted = function(id) {
+		gagaDx5.uploadAfterProcess();
+	}
+
+	// Dextupload X5 이미지 등록이 완료된 후 호출되는 이벤트
+	var onDX5ItemsAdded = function(id, count) {
+		gagaDx5.resortDX5FileList();
+	}
+	//--------------------------------------------------------------------------
+	// Dextupload X5 이벤트 End
+	//--------------------------------------------------------------------------
+	
+	// 업로드 후처리. 반드시 구현해야 함. (gaga.dx5.js 파일에서 호출됨)
+	var fnUploadAfterProcess = function(id, result) {
+// 		if (typeof(result) != 'undefined') {
+// 			if (!gagajf.isNull(result.error.message)) {
+// 				gagaAlert.alert(result.error.message);
+// 				return;
+// 			}
+// 		}
+
+		console.log(result);
+
+		var dx = dx5.get(id);
 
-	//상품이미지 저정버튼 클릭 시
-	$('#btnGoodsDetailImgSave').click(function(e) {
-		if ($("#goodsImgForm").find("#goodsImgList tr").length == 0){
-			/* mcxDialog.alert('', function(){
+		var updatedData = [];
 
+		// 삭제한 파일 설정
+		var deleteFiles = dx.getRemovedFiles();
+		if (deleteFiles.length > 0) {
+			$.each(deleteFiles, function(idx, item) {
+				var params = new Object();
+				params.mode = 'D';
+				params.goodsCd = $('#goodsImgForm input[name=goodsCd]').val();
+				params.colorCd = $('#goodsImgForm input[name=colorCd]').val();
+				params.dispOrd = idx + 1;
+				params.orgImgNm = item.name;
+				params.sysImgNm = item.name;
+				params.sysImgUrl = item.url;
+				params.defaultImgYn = 'N';
+				updatedData.push(params);
 			});
-			return false; */
 		}
-		var optCheck = false;
-		var imgType = $('#goodsImgForm input[name=imgType]').val();
-		
-		$("#goodsImgForm").find("#goodsImgList tr").each(function() {
-			var size = 30;
-
-			for(i=0;i<size;i++){
-				var imgVal = $("#goodsImgForm").find("#goodsImgList tr").find("input[name=imgPath"+ (i+1) +"]").val();
-				
-				if(!gagajf.isNull(imgVal)){
-					var reg = "\.("+fileExtension+")$";
-					if(!(new RegExp(reg, "i")).test(imgVal)) {
-						optCheck = true;
-						mcxDialog.alertC('이미지는 ['+ fileExtension + '] 파일만 가능합니다.', {
-							sureBtnText: "확인",
-							sureBtnClick: function() {
-								$("#goodsImgForm").find("#goodsImgList tr").find("input[name=imgPath"+ (i+1)+"]").focus();
-							}
-						});
-						return false;
-					}
-
-					if (imgVal.indexOf('\\"') > -1){
-							optCheck = true;
-							mcxDialog.alertC('["]는 입력할 수 없습니다.', {
-								sureBtnText: "확인",
-								sureBtnClick: function() {
-									$("#goodsImgForm").find("#goodsImgList tr").find("input[name=imgPath"+ (i+1)+"]").focus();
-								}
-							});
-							return false;
-					}
-					if (imgVal.indexOf("\\'") > -1){
-							optCheck = true;
-							mcxDialog.alertC("[\\']는 입력할 수 없습니다.", {
-								sureBtnText: "확인",
-								sureBtnClick: function() {
-									$("#goodsImgForm").find("#goodsImgList tr").find("input[name=imgPath"+ (i+1)+"]").focus();
-								}
-
-							});
-							return false;
-					}
-					if (imgType == "A"){
-						if (imgVal.indexOf("http") > -1){
-							optCheck = true;
-							mcxDialog.alertC("이미지 도메인은 입력할 수 없습니다.", {
-								sureBtnText: "확인",
-								sureBtnClick: function() {
-									$("#goodsImgForm").find("#goodsImgList tr").find("input[name=imgPath"+ (i+1)+"]").focus();
-								}
-
-							});
-							return false;
-						}
-					}else{
-						if (imgVal.indexOf("https") <= -1){
-							optCheck = true;
-							mcxDialog.alertC("이미지 도메인을 입력해 주세요.", {
-								sureBtnText: "확인",
-								sureBtnClick: function() {
-									$("#goodsImgForm").find("#goodsImgList tr").find("input[name=imgPath"+ (i+1)+"]").focus();
-								}
-
-							});
-							return false;
-						}
-					}
-				}else{
-					if(i == 0){
-						optCheck = true;
-						mcxDialog.alertC("필수 상품이미지 입니다.", {
-							sureBtnText: "확인",
-							sureBtnClick: function() {
-								$("#goodsImgForm").find("#goodsImgList tr").find("input[name=imgPath"+ (i+1)+"]").focus();
-							}
-
-						});
-						return false;
-					}
-				}
-			}
-		});
 
-		if(optCheck) {
-			return false;
-		}
+		// 업로드한 파일 및 순서 변경한 파일 설정
+		var totCnt = dx.getTotalItemCount();
+		if (totCnt > 0) {
+			for (var i = 0; i < totCnt; i++) {
+				var item = dx.getItemByIndex(i);
 
-		mcxDialog.confirm('저장하시겠습니까?', {
-			cancelBtnText: "취소",
-			sureBtnText: "확인",
-			sureBtnClick: function(){
-				gagajf.ajaxFormSubmit("/goods/img/save", "#goodsImgForm", fnGoodsImgFormClose);
+				var params = new Object();
+				params.mode = (item.type == 'FILE') ? 'C' : '';
+				params.goodsCd = $('#goodsImgForm input[name=goodsCd]').val();
+				params.colorCd = $('#goodsImgForm input[name=colorCd]').val();
+				params.dispOrd = i + 1;
+				params.orgImgNm = item.name;
+				params.sysImgNm = item.name;
+				params.sysImgUrl = item.url;
+				params.defaultImgYn = ($('#goodsImgForm input[name=defaultImgOrd]').val() == (i + 1)) ? 'Y' : 'N';
+				updatedData.push(params);
 			}
+		}
+
+		var jsonData = JSON.stringify(updatedData);
+		console.log(jsonData);
+
+		gagajf.ajaxJsonSubmit('/goods/thumbnail/image/save', jsonData, fnUploadCallback);
+	}
+
+	// 콜백함수
+	var fnUploadCallback = function(result) {
+		// 기본이미지명 조회
+		//var actionUrl = '/goods/default/image/url'
+		//		+ '?goodsCd=' + $('#goodsImgForm input[name=goodsCd]').val()
+		//		+ '&colorCd=' + $('#goodsImgForm input[name=colorCd]').val();
+
+		//$.get(actionUrl
+		//	, function(url) {
+		//		console.log(url);
+		//		//opener.setImg($('#goodsImgForm input[name=defaultImgOrd]').val(), result.defaultImgNm);
+		//		fnGoodsImgFormClose();
+		//	});
+		fnGoodsImgFormClose();
+	}
+
+	// 더블클릭시 썸네일 지정 후 첫번째로 이동
+	function onDX5ItemDoubleClick(id, itemIndex, itemId, itemType) {
+		var dx = dx5.get(id);
+		var gubun = $("#gubun").val();
+
+		gagaAlert.confirm('선택하신 이미지를 대표이미지로 선택하시겠습니까?', function() {
+			firstMoveUp(itemIndex);
+			return false;
 		});
-	});
+	}
+
+	// 선택 항목을 첫번째로 이동
+	function firstMoveUp(selIndex){
+		ti = parseInt(selIndex, 10);
+		for(var i = ti; i > 0; i--) {
+			dx5.get("dext5").moveItemUp(i);
+		}
+	}
 
 	//창종료
 	var fnGoodsImgFormClose = function(){
+		$('.dx5-pop-up').remove();
+		$('.dx5-pop-dn').remove();
+		$('.dx5-pop-pv').remove();
+		$('.dx5-pop-cp').remove();
+		$('.dx5-pop-ud').remove();
 		uifnPopupClose('popupGoodsImage');
 	}
 
 	//안내팝업
 	var fnOpenCommentPopup = function(id) {
-		var str = '<div class="popupWrap" id="'+id+'" style="z-index:30">';
-		str = str + '<div class="popup modeless ui-widget-content ui-draggable ui-draggable-handle" style="display: block;  position: relative;">';
-		str = str + '<button type="button" class="close" onclick="uifnPopClose(\''+id+'\')"><i class="fa fa-times"></i></button>';
-		str = str + '<div class="mdPopContent">';
+		var str = '<div class="popupWrap"  id="'+id+'" style="z-index:30">';
+		str = str + '<div class="modalPopup" data-width="500">';
+		str = str + '<div class="panelStyle">';
+		str = str + '<div class="panelTitle"><button type="button" class="close" onclick="uifnPopupClose(\''+id+'\')"><i class="fa fa-times"></i></button></div>';
+		str = str + '<div class="panelContent">';
 		str = str + '<ul class="notice ">';
-		str = str + '<em><b>* 이미지 타입</b></em>';
-		str = str + '<li> <b>A</b> : <b>자사전용</b>(이미지 도메인명 없음)</li>';
-		str = str + '  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ex) /P/PQS/PQS11TM24M_BU/1000/PQS11TM24M_BU_01.jpg';
-		str = str + '<li> <b>B</b> : <b>입점전용</b>(https를 포함한 이미지 전체 경로)</li>';
-		str = str + '  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ex) <em>https:</em>//pastel.jpg2.kr/goods/LCCAJ334_IV_1.jpg';
-		str = str + '<li><b>IMG_PATH1 (<em>필수</em>)</b> : 상품코드_<b>01.jpg</li>';
-		str = str + '<li><b>IMG_PATH2 ~ IMG_PATH5</b> (선택) : 상품코드_<b>02</b>.jpg ~ 상품코드_<b>05</b>.jpg</li>';
-		str = str + '<li><b>IMG_PATH6 ~ IMG_PATH10</b> (선택, 화보컷) : 상품코드_<b>M1</b>.jpg ~ 상품코드_<b>M5</b>.jpg</li>';
-		str = str + '<li><b>IMG_PATH11 ~ IMG_PATH25</b> (선택, 상세컷) : 상품코드_<b>D1</b>.jpg ~ 상품코드_<b>D15</b>.jpg</li>';
-		str = str + '<li><b>IMG_PATH26 ~ IMG_PATH27</b> (선택, 라벨컷) : 상품코드_<b>R1</b>.jpg ~ 상품코드_<b>R2</b>.jpg</li>';
-		str = str + '<li><b>IMG_PATH28 ~ IMG_PATH30</b> (선택, 기타컷) : 상품코드_<b>E1</b>.jpg ~ 상품코드_<b>E3</b>.jpg</li>';
+		str = str + '<em><b>* 상품 이미지 파일명</b></em>';
+		str = str + '<li><b>상품메인컷</b> : 상품코드_<b>01</b>.jpg<em>(앞)</em>,상품코드_<b>02</b>.jpg<em>(뒤)</em></li>';
+		str = str + '<li><b>상품모델컷</b> : 상품코드_<b>M1</b>.jpg ~ 상품코드_<b>M5</b>.jpg</li>';
+		str = str + '<li><b>상품상세컷</b> : 상품코드_<b>D1</b>.jpg ~ 상품코드_<b>D5</b>.jpg</li>';
+		str = str + '<li><b>상품소재컷</b> : 상품코드_<b>S1</b>.jpg</li>';
+		str = str + '<li><b>상품라벨컷</b> : 상품코드_<b>L1</b>.jpg, (상품코드_<b>L2</b>.jpg)</li>';
 		str = str + '</ul>';
-		str = str + '</div></div></div>';
+		str = str + '</div></div></div></div>';
 
 		if ($('#'+ id).length == 0) {
 			$('body').append(str);
 		}
-		$("#"+id).css({display:"block"});
+		uifnPopupOpen(id);
+		//$("#"+id).css({display:"block"});
 	}
+	
 /*]]>*/
 </script>
 </html>

+ 0 - 591
style24.scm/src/main/webapp/WEB-INF/views/goods/GoodsImageMassForm.html

@@ -1,591 +0,0 @@
-<!DOCTYPE html>
-<html lang="ko"
-	xmlns:th="http://www.thymeleaf.org">
-<!--
- *******************************************************************************
- * @source  : GoodsImageMassForm.html
- * @desc    : 상품 이미지 대량 관리 화면(자사)
- *============================================================================
- * SISUN
- * Copyright(C) 2019 TSIT, All rights reserved.
- *============================================================================
- * VER  DATE         AUTHOR      DESCRIPTION
- * ===  ===========  ==========  =============================================
- * 1.0  2020.11.27   eskim       최초 작성
-  *******************************************************************************
- -->
-	<div class="modalPopup" >
-		<!-- PANELSTYLE -->
-			<div class="panelStyle">
-				<!-- TITLE -->
-				<div class="panelTitle">
-					<h2>상품 이미지 수정</h2>
-					<button type="button" class="close" onclick="fnGoodsImgFormClose()"><i class="fa fa-times"></i></button>
-				</div>
-				<!-- //TITLE -->
-				<!-- CONTENT -->
-				<div class="panelContent">
-
-					<ul class="notice">
-						<li>[업로드/수정] 버튼 클릭 하면 프론트에 바로 적용되므로 최종 확인 후 전송을 권장합니다.</li>
-						<li>이미지 미리보기 리스트는 <em>업로드 후</em> 확인 할 수 있습니다.</li>
-						<li>이미지보기 버튼은 이미지 파일 <em>등록 후</em> 확인 할 수 있습니다. 이미 <em>업로드 된</em> 파일은 확인 할 수 없습니다.(파일 크기 옆 화살표로 구분 가능합니다.)</li>
-					</ul>
-
-					<table class="frmStyle">
-						<colgroup>
-							<col width="100px"/>
-							<col/>
-							<col width="100px"/>
-							<col/>
-							<col width="100px"/>
-							<col/>
-						</colgroup>
-						<tr>
-							<th>컬러명</th>
-							<td>PINK</td>
-							<td colspan="4"></td>
-							<!-- <th>대표 이미지순번</th>
-							<td><input type="text" value="1"/></td>
-							<th>마우스오버 이미지순번</th>
-							<td><input type="text" value="2"/></td> -->
-						</tr>
-						<tr>
-							<th>이미지등록</th>
-							<td class="dexterArea">
-
-								<!-- 덱스터 테이블 영역 -->
-								<ul class="dexterTable">
-									<li class="dexterNo">
-										<!-- 덱스터 테이블 번호 -->
-										<div>1</div><div>2</div><div>3</div><div>4</div>
-										<!-- //덱스터 테이블 번호 -->
-									</li>
-									<li>
-									<!-- 덱스터 테이블 삽입 -->
-										덱스터 테이블 삽입<br/>공간은 테이블 넓이에 따라 자동으로 넓어집니다.<br/>
-										(최소 넓이 : 350px로 설정됨)<br/>
-									<!-- //덱스터 테이블 -->
-									<li>
-								</ul>
-								<!-- //덱스터 테이블 영역 -->
-
-							</td>
-							<td colspan="4" class="verticalTop">
-
-								<!-- 이미지 카드 영역 -->
-								<div class="cardArea">
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-									<!-- 이미지 카드 -->
-									<div class="imgCard">
-										<button type="button" class="cardClose">닫기</button>
-										<ul>
-											<li>
-												<img src="http://image.istyle24.com/Upload/ProductImage/0000004766/20200826/14505664_L.jpg?RS=560" widht="70" height="70">
-											</li>
-											<li>이미지1</li>
-										</ul>
-										<p>G2019052800040_023_4(170330).jpg</p>
-									</div>
-									<!-- //이미지 카드 -->
-								</div>
-								<!-- //이미지 카드 영역 -->
-
-							</td>
-						</tr>
-					</table>
-				</div>
-				<!-- 버튼 배치 영역 -->
-				<ul class="panelBar marT10">
-					<li class="center">
-						<button type="button" class="btn btn-base btn-lg">파일 추가</button>
-						<button type="button" class="btn btn-default btn-lg">선택 삭제</button>
-						<button type="button" class="btn btn-default btn-lg">전체 삭제</button>
-						<button type="button" class="btn btn-info btn-lg">뒤로 이동</button>
-						<button type="button" class="btn btn-info btn-lg">아래로 이동</button>
-						<button type="button" class="btn btn-base btn-lg">이미지 보기</button>
-						<button type="button" class="btn btn-base btn-lg">업로드/수정</button>
-						<button type="button" class="btn btn-base btn-lg">저장하기</button>
-					</li>
-				</ul>
-				<!-- //버튼 배치 영역 -->
-			</div>
-	</div>
-<script th:inline="javascript">
-/*<![CDATA[*/
-	var fileExtension = [[${@environment.getProperty('upload.goods.allow.extension')}]];
-
-	//상품이미지 저정버튼 클릭 시
-	$('#btnGoodsDetailImgSave').click(function(e) {
-		if ($("#goodsImgForm").find("#goodsImgList tr").length == 0){
-			/* mcxDialog.alert('', function(){
-
-			});
-			return false; */
-		}
-		var optCheck = false;
-		var imgType = $('#goodsImgForm input[name=imgType]').val();
-		
-		$("#goodsImgForm").find("#goodsImgList tr").each(function() {
-			var size = 30;
-
-			for(i=0;i<size;i++){
-				var imgVal = $("#goodsImgForm").find("#goodsImgList tr").find("input[name=imgPath"+ (i+1) +"]").val();
-				
-				if(!gagajf.isNull(imgVal)){
-					var reg = "\.("+fileExtension+")$";
-					if(!(new RegExp(reg, "i")).test(imgVal)) {
-						optCheck = true;
-						mcxDialog.alertC('이미지는 ['+ fileExtension + '] 파일만 가능합니다.', {
-							sureBtnText: "확인",
-							sureBtnClick: function() {
-								$("#goodsImgForm").find("#goodsImgList tr").find("input[name=imgPath"+ (i+1)+"]").focus();
-							}
-						});
-						return false;
-					}
-
-					if (imgVal.indexOf('\\"') > -1){
-							optCheck = true;
-							mcxDialog.alertC('["]는 입력할 수 없습니다.', {
-								sureBtnText: "확인",
-								sureBtnClick: function() {
-									$("#goodsImgForm").find("#goodsImgList tr").find("input[name=imgPath"+ (i+1)+"]").focus();
-								}
-							});
-							return false;
-					}
-					if (imgVal.indexOf("\\'") > -1){
-							optCheck = true;
-							mcxDialog.alertC("[\\']는 입력할 수 없습니다.", {
-								sureBtnText: "확인",
-								sureBtnClick: function() {
-									$("#goodsImgForm").find("#goodsImgList tr").find("input[name=imgPath"+ (i+1)+"]").focus();
-								}
-
-							});
-							return false;
-					}
-					if (imgType == "A"){
-						if (imgVal.indexOf("http") > -1){
-							optCheck = true;
-							mcxDialog.alertC("이미지 도메인은 입력할 수 없습니다.", {
-								sureBtnText: "확인",
-								sureBtnClick: function() {
-									$("#goodsImgForm").find("#goodsImgList tr").find("input[name=imgPath"+ (i+1)+"]").focus();
-								}
-
-							});
-							return false;
-						}
-					}else{
-						if (imgVal.indexOf("https") <= -1){
-							optCheck = true;
-							mcxDialog.alertC("이미지 도메인을 입력해 주세요.", {
-								sureBtnText: "확인",
-								sureBtnClick: function() {
-									$("#goodsImgForm").find("#goodsImgList tr").find("input[name=imgPath"+ (i+1)+"]").focus();
-								}
-
-							});
-							return false;
-						}
-					}
-				}else{
-					if(i == 0){
-						optCheck = true;
-						mcxDialog.alertC("필수 상품이미지 입니다.", {
-							sureBtnText: "확인",
-							sureBtnClick: function() {
-								$("#goodsImgForm").find("#goodsImgList tr").find("input[name=imgPath"+ (i+1)+"]").focus();
-							}
-
-						});
-						return false;
-					}
-				}
-			}
-		});
-
-		if(optCheck) {
-			return false;
-		}
-
-		mcxDialog.confirm('저장하시겠습니까?', {
-			cancelBtnText: "취소",
-			sureBtnText: "확인",
-			sureBtnClick: function(){
-				gagajf.ajaxFormSubmit("/goods/img/save", "#goodsImgForm", fnGoodsImgFormClose);
-			}
-		});
-	});
-
-	//창종료
-	var fnGoodsImgFormClose = function(){
-		uifnPopupClose('popupGoodsImageMass');
-	}
-
-	//안내팝업
-	var fnOpenCommentPopup = function(id) {
-		var str = '<div class="popupWrap" id="'+id+'" style="z-index:30">';
-		str = str + '<div class="popup modeless ui-widget-content ui-draggable ui-draggable-handle" style="display: block;  position: relative;">';
-		str = str + '<button type="button" class="close" onclick="uifnPopClose(\''+id+'\')"><i class="fa fa-times"></i></button>';
-		str = str + '<div class="mdPopContent">';
-		str = str + '<ul class="notice ">';
-		str = str + '<em><b>* 이미지 타입</b></em>';
-		str = str + '<li> <b>A</b> : <b>자사전용</b>(이미지 도메인명 없음)</li>';
-		str = str + '  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ex) /P/PQS/PQS11TM24M_BU/1000/PQS11TM24M_BU_01.jpg';
-		str = str + '<li> <b>B</b> : <b>입점전용</b>(https를 포함한 이미지 전체 경로)</li>';
-		str = str + '  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ex) <em>https:</em>//pastel.jpg2.kr/goods/LCCAJ334_IV_1.jpg';
-		str = str + '<li><b>IMG_PATH1 (<em>필수</em>)</b> : 상품코드_<b>01.jpg</li>';
-		str = str + '<li><b>IMG_PATH2 ~ IMG_PATH5</b> (선택) : 상품코드_<b>02</b>.jpg ~ 상품코드_<b>05</b>.jpg</li>';
-		str = str + '<li><b>IMG_PATH6 ~ IMG_PATH10</b> (선택, 화보컷) : 상품코드_<b>M1</b>.jpg ~ 상품코드_<b>M5</b>.jpg</li>';
-		str = str + '<li><b>IMG_PATH11 ~ IMG_PATH25</b> (선택, 상세컷) : 상품코드_<b>D1</b>.jpg ~ 상품코드_<b>D15</b>.jpg</li>';
-		str = str + '<li><b>IMG_PATH26 ~ IMG_PATH27</b> (선택, 라벨컷) : 상품코드_<b>R1</b>.jpg ~ 상품코드_<b>R2</b>.jpg</li>';
-		str = str + '<li><b>IMG_PATH28 ~ IMG_PATH30</b> (선택, 기타컷) : 상품코드_<b>E1</b>.jpg ~ 상품코드_<b>E3</b>.jpg</li>';
-		str = str + '</ul>';
-		str = str + '</div></div></div>';
-
-		if ($('#'+ id).length == 0) {
-			$('body').append(str);
-		}
-		$("#"+id).css({display:"block"});
-	}
-/*]]>*/
-</script>
-</html>

+ 3 - 15
style24.scm/src/main/webapp/WEB-INF/views/goods/GoodsListForm.html

@@ -26,6 +26,7 @@
 		<form id="searchForm" name="searchForm" action="#" th:action="@{'/goods/list'}">
 		<input type="hidden" id="searchGb" name="searchGb" />
 		<input type="hidden" id="imageViewYn" name="imageViewYn" />
+		<input type="hidden" id="goodsPriceYn" name="goodsPriceYn" value="Y"/> <!-- 즉시할인판매가 조회 -->
 	 		<!-- 패널 영역1 -->
 		<div class="panelStyle" >
 			<!-- 검색조건 영역 -->
@@ -379,22 +380,9 @@
 		{headerName: 'No', width: 60, cellClass: 'text-center',
 			valueGetter: function(params) { return cfnGridNumner('searchForm',params.node.rowIndex, 'A');}
 		},
-		{headerName: "이미지", field: "imgPath1", width: 100, height: 60, cellClass: 'text-center'
+		{headerName: "이미지", field: "sysImgNm", width: 100, height: 60, cellClass: 'text-center'
 			,cellRenderer: function(params) {
-				if (params.data.imgType == "G030_A"){
-					if (gagajf.isNull(params.value)) {
-						return '<img width="60" src="'+ params.data.imgPath6 + '" alt="" onclick="cfnOpenImagePreViewPopup(\'goodsImgView\', \''+ params.data.imgPath6 +'\')" onerror="this.src=\'/image/no.gif\';"/>';
-					} else {
-						return '<img width="60" src="'+ params.value + '" alt="" onclick="cfnOpenImagePreViewPopup(\'goodsImgView\', \''+ params.value +'\')" onerror="this.src=\'/image/no.gif\';"/>';
-					}
-					
-				}else{
-					if(!gagajf.isNull(params.data.imgPath6)){
-						return '<img width="60" src="'+ uploadGoodsUrl+params.data.imgPath6 + '" alt="" onclick="cfnOpenImagePreViewPopup(\'goodsImgView\', \''+ uploadGoodsUrl+params.data.imgPath6 +'\')" onerror="this.src=\'/image/no.gif\';"/>';
-					}else{
-						return '<img width="60" src="'+ uploadGoodsUrl+params.value + '" alt="" onclick="cfnOpenImagePreViewPopup(\'goodsImgView\', \''+ uploadGoodsUrl+params.value +'\')" onerror="this.src=\'/image/no.gif\';"/>';
-					}	
-				}
+				return '<img width="60" src="'+ _goodsUrl+ "/" + params.value + '" alt="" onclick="cfnOpenImagePreViewPopup(\'goodsImgView\', \''+ _goodsUrl+ "/" + params.value +'\')" onerror="this.src=\'/image/no.gif\';"/>';
 			}
 		},
 		{headerName: "브랜드", field: "brandCd", width: 80, cellClass: 'text-center'},

+ 2 - 14
style24.scm/src/main/webapp/WEB-INF/views/goods/GoodsPopupListForm.html

@@ -244,21 +244,9 @@
 		{headerName: 'No', width: 60, cellClass: 'text-center',
 			valueGetter: function(params) { return cfnGridNumner('goodsPopupForm',params.node.rowIndex, 'A');}
 		},
-		{headerName: "이미지", field: "imgPath1", width: 100, height: 60, cellClass: 'text-center'
+		{headerName: "이미지", field: "sysImgNm", width: 100, height: 60, cellClass: 'text-center'
 			,cellRenderer: function(params) {
-				if (params.data.imgType == "G030_A"){
-					if(!gagajf.isNull(params.data.imgPath6)){
-						return '<img width="60" src="'+ params.data.imgPath1 + '" alt="" onerror="this.src=\'/image/no.gif\';"/>';
-					}else{
-						return '<img width="60" src="'+ params.value + '" alt="" onerror="this.src=\'/image/no.gif\';"/>';
-					}
-				}else{
-					if(!gagajf.isNull(params.data.imgPath6)){
-						return '<img width="60" src="'+ uploadGoodsUrl+params.data.imgPath6 + '" alt=""  onerror="this.src=\'/image/no.gif\';"/>';
-					}else{
-						return '<img width="60" src="'+ uploadGoodsUrl+params.value + '" alt=""  onerror="this.src=\'/image/no.gif\';"/>';
-					}	
-				}
+				return '<img width="60" src="'+ _goodsUrl+ "/" + params.value + '" alt="" onerror="this.src=\'/image/no.gif\';"/>';
 			}
 		},
 		{headerName: "브랜드", field: "brandCd", width: 100, cellClass: 'text-center'},