Просмотр исходного кода

Merge branch 'develop' into jsshin

jsshin 5 лет назад
Родитель
Сommit
0cc19449c3
25 измененных файлов с 643 добавлено и 380 удалено
  1. 1 1
      src/main/java/com/style24/admin/biz/dao/TsaDisplayDao.java
  2. 19 56
      src/main/java/com/style24/admin/biz/dao/TsaMorebetterDao.java
  3. 3 2
      src/main/java/com/style24/admin/biz/service/TsaDisplayService.java
  4. 50 51
      src/main/java/com/style24/admin/biz/service/TsaMorebetterService.java
  5. 110 11
      src/main/java/com/style24/admin/biz/service/TsaPlanService.java
  6. 8 6
      src/main/java/com/style24/admin/biz/web/TsaDisplayController.java
  7. 8 21
      src/main/java/com/style24/admin/biz/web/TsaMarketingController.java
  8. 1 0
      src/main/java/com/style24/persistence/domain/Goods.java
  9. 2 0
      src/main/java/com/style24/persistence/domain/MainDisplay.java
  10. 5 0
      src/main/java/com/style24/persistence/domain/MoreBetter.java
  11. 2 0
      src/main/java/com/style24/persistence/domain/MoreBetterGoods.java
  12. 73 8
      src/main/java/com/style24/persistence/mybatis/shop/TsaDsiplay.xml
  13. 2 2
      src/main/java/com/style24/persistence/mybatis/shop/TsaGoods.xml
  14. 111 104
      src/main/java/com/style24/persistence/mybatis/shop/TsaMorebetter.xml
  15. 3 3
      src/main/webapp/WEB-INF/views/display/GoodsDispOrdChangePopupForm.html
  16. 1 1
      src/main/webapp/WEB-INF/views/display/LookbookBannerPickerPopupForm.html
  17. 58 5
      src/main/webapp/WEB-INF/views/display/LookbookBannerPopupForm.html
  18. 13 33
      src/main/webapp/WEB-INF/views/display/LookbookListForm.html
  19. 53 36
      src/main/webapp/WEB-INF/views/display/MainContentsPopupForm.html
  20. 38 13
      src/main/webapp/WEB-INF/views/display/MainGnbContentsPopupForm.html
  21. 64 15
      src/main/webapp/WEB-INF/views/display/MainListForm.html
  22. 8 5
      src/main/webapp/WEB-INF/views/display/MainMultiContentsPopupForm.html
  23. 3 3
      src/main/webapp/WEB-INF/views/marketing/PlanDetailPopupForm.html
  24. 1 1
      src/main/webapp/WEB-INF/views/marketing/PlanTemplatePopupForm.html
  25. 6 3
      src/main/webapp/ux/js/admin.popup.js

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

@@ -352,7 +352,7 @@ public interface TsaDisplayDao {
 	 * @author bin2107
 	 * @since 2021. 2. 23
 	 */
-	String getContentsTitle(String cateNo, String contentsLoc);
+	String getContentsTitle(String cateNo, String contentsLoc, String brandGroupNo);
 
 	/**
 	 * 메인전시 컨텐츠 타이틀 변경

+ 19 - 56
src/main/java/com/style24/admin/biz/dao/TsaMorebetterDao.java

@@ -196,42 +196,6 @@ public interface TsaMorebetterDao {
      */
     void deleteTmtbBurdenList(MoreBetterBurden moreBetterBurden);
 
-    /**
-     * 다다익선 - 진행중인 다다익선 상품 조회
-     * @param moreBetterGoods
-     * @return
-     * @author bin2107
-     * @since 2021. 1. 22
-     */
-    Collection<MoreBetterGoods> getMorebetterUsingGoodsList(MoreBetterGoods moreBetterGoods);
-
-    /**
-     * 다다익선 - 진행중인 다다익선 상품 delete
-     * @param
-     * @return
-     * @author bin2107
-     * @since 2021. 1. 22
-     */
-    void deleteTmtbGoodsTemp(MoreBetterGoods moreBetterGoods);
-
-    /**
-     * 다다익선 - 진행중인 다다익선 상품 조회 insert
-     * @param
-     * @return
-     * @author bin2107
-     * @since 2021. 1. 22
-     */
-    void createTmtbGoodsTemp(MoreBetterGoods moreBetterGoods);
-
-    /**
-     * 다다익선 - 입력받은 다다익선 적용 상품 insert
-     * @param
-     * @return
-     * @author bin2107
-     * @since 2021. 1. 22
-     */
-    void createTmtbApplyGoodsTemp(MoreBetterGoods moreBetterGoods);
-
     /**
      * 다다익선 중복 상품 조회
      * @param moreBetterGoods
@@ -250,26 +214,6 @@ public interface TsaMorebetterDao {
      */
     void updateMorebetterStat(MoreBetter moreBetter);
 
-    /**
-     * 다다익선 - 중복제거 적용 상품 리스트 delete
-     * @param
-     * @return
-     * @author bin2107
-     * @since 2021. 1. 22
-     */
-    void deleteTmtbApplyGoodsTemp(MoreBetterGoods moreBetterGoods);
-
-    /**
-     * 다다익선 중복제거 적용 상품 리스트 조회
-     * @param
-     * @return
-     * @author bin2107
-     * @since 2021. 2. 1
-     */
-    List<MoreBetterGoods> getMorebetterRealApplyGoodsList(MoreBetter moreBetter);
-
-    List<MoreBetterGoods> getMorebetterCompBrandGoodsList(MoreBetterGoods moreBetterGoods);
-
     /**
      * 다다익선 업체,브랜드,상품 (TB_TMTB_GOODS) 삭제
      * @param moreBetter
@@ -314,5 +258,24 @@ public interface TsaMorebetterDao {
      * @since 2021. 2. 8
      */
     void deleteTmtbApplyGoods(MoreBetter moreBetter);
+
+    /**
+     * 다다익선 공급업체 & 브랜드 적용상품 (TB_TMTB_APPLY_GOODS) 저장
+     * @param moreBetter
+     * @return
+     * @author bin2107
+     * @since 2021. 3. 22
+     */
+    void insertMorebetterApplyGoods(MoreBetterGoods moreBetterGoods);
+
+    /**
+     * 다다익선 적용상품 temp
+     * @param
+     * @return
+     * @author bin2107
+     * @since 2021. 3. 23
+     */
+    void deleteMorebetterApplyGoodsTemp(MoreBetter moreBetter);
+    void insertMorebetterApplyGoodsTemp(MoreBetter moreBetter);
     /* // CSB 진행 */
 }

+ 3 - 2
src/main/java/com/style24/admin/biz/service/TsaDisplayService.java

@@ -578,6 +578,7 @@ public class TsaDisplayService {
 				Contents contentsTmp = new Contents();
 				contentsTmp.setCateNo(contents.getCateNo());
 				contentsTmp.setContentsLoc(contents.getContentsLoc());
+				contentsTmp.setBrandGroupNo(contents.getBrandGroupNo());
 				contentsTmp.setContentsTitle(contents.getContentsTitle());
 				contentsTmp.setRegNo(TsaSession.getInfo().getUserNo());
 				displayDao.deleteContentsTitle(contentsTmp);
@@ -726,8 +727,8 @@ public class TsaDisplayService {
 	 * @author bin2107
 	 * @since 2021. 2. 22
 	 */
-	public String getContentsTitle(String cateNo, String contentsLoc) {
-		return displayDao.getContentsTitle(cateNo,contentsLoc);
+	public String getContentsTitle(String cateNo, String contentsLoc, String brandGroupNo) {
+		return displayDao.getContentsTitle(cateNo,contentsLoc,brandGroupNo);
 	}
 
 	/**

+ 50 - 51
src/main/java/com/style24/admin/biz/service/TsaMorebetterService.java

@@ -188,21 +188,6 @@ public class TsaMorebetterService {
             morebetterDao.saveMorebetterGoods(regApplyGoods);
         }
 
-        // apply_goods
-        List<MoreBetterGoods> realApplyGoodsList = morebetterDao.getMorebetterRealApplyGoodsList(moreBetter);
-        for(MoreBetterGoods realApplyGoods : realApplyGoodsList){
-            for(MoreBetterGoods regApplyGoods : moreBetter.getApplyGoodsList()){
-                if(regApplyGoods.getGoodsCd().equals(realApplyGoods.getGoodsCd())){
-                    // 다다익선 적용대상 설정(TB_TMTB_GOODS) 저장
-                    regApplyGoods.setTmtbSq(moreBetter.getTmtbSq());
-                    regApplyGoods.setTargetVal(realApplyGoods.getGoodsCd());
-                    regApplyGoods.setRegNo(moreBetter.getRegNo());
-                    regApplyGoods.setUpdNo(moreBetter.getUpdNo());
-                    morebetterDao.saveMorebetterApplyGoods(regApplyGoods);
-                }
-            }
-        }
-
         // 제외상품
         for(MoreBetterGoods regExceptGoods : moreBetter.getExceptGoodsList()){
             // 다다익선 적용대상 설정(TB_TMTB_GOODS) 저장
@@ -236,6 +221,39 @@ public class TsaMorebetterService {
             morebetterDao.saveMorebetterBurden(regBurden);
         }
 
+        // 업체&브랜드 상품
+        MoreBetterGoods moreBetterGoods = new MoreBetterGoods();
+        StringBuilder sb = new StringBuilder();
+        //int i = 1;
+        if(moreBetter.getApplyGoodsList().size()>0){
+            for(int i=0; i<moreBetter.getApplyGoodsList().size(); i++){
+                sb.append("SELECT   '").append(moreBetter.getApplyGoodsList().get(i).getGoodsCd()).append("' AS GOODS_CD ");
+                if(i<moreBetter.getApplyGoodsList().size()-1){
+                    sb.append("\n UNION ALL \n");
+                }
+            }
+        }
+        moreBetterGoods.setApplySql(sb.toString());
+
+        StringBuilder sb2 = new StringBuilder();
+        if(moreBetter.getExceptGoodsList().size()>0){
+            for(int i=0; i<moreBetter.getExceptGoodsList().size(); i++){
+                sb2.append("SELECT   '").append(moreBetter.getExceptGoodsList().get(i).getGoodsCd()).append("' AS GOODS_CD ");
+                if(i<moreBetter.getExceptGoodsList().size()-1){
+                    sb2.append("\n UNION ALL \n");
+                }
+            }
+        }
+        moreBetterGoods.setExceptSql(sb2.toString());
+        moreBetterGoods.setTmtbSq(moreBetter.getTmtbSq());
+        moreBetterGoods.setRegNo(TsaSession.getInfo().getUserNo());
+        moreBetterGoods.setUpdNo(TsaSession.getInfo().getUserNo());
+        moreBetterGoods.setMultiSupplyCompCd(moreBetter.getMultiSupplyCompCd());
+        moreBetterGoods.setMultiBrand(moreBetter.getMultiBrand());
+        moreBetterGoods.setMultiApplyGoods(moreBetter.getMultiApplyGoods());
+        moreBetterGoods.setMultiExceptGoods(moreBetter.getMultiExceptGoods());
+        morebetterDao.insertMorebetterApplyGoods(moreBetterGoods);
+
         log.info("newBurdenSq = {}, newTmtbSq = {}, newSupplyCd = {}, newBurdenRate = {} , newUseYn = {}");
     }
 
@@ -348,42 +366,6 @@ public class TsaMorebetterService {
         }
     }
 
-    /**
-     * 다다익선 - 진행중인 다다익선 상품 TMEP 테이블 생성
-     * @param
-     * @return
-     * @author bin2107
-     * @since 2021. 1. 22
-     */
-    @Transactional("shopTxnManager")
-    public void createMorebetterGoodsTemp(MoreBetterGoods moreBetterGoods){
-        moreBetterGoods.setRegNo(TsaSession.getInfo().getUserNo());
-
-        morebetterDao.deleteTmtbApplyGoodsTemp(moreBetterGoods);
-
-        // 적용상품 그리드 데이터
-        List<MoreBetterGoods> applyGoodsList = moreBetterGoods.getGridApplyGoodsList();
-
-        if(moreBetterGoods.getMultiSupplyCompCd().length > 0 || moreBetterGoods.getMultiBrand().length > 0){
-            // 공급업체, 브랜드에 해당하는 상품
-            List<MoreBetterGoods> compBrandGoodsList = morebetterDao.getMorebetterCompBrandGoodsList(moreBetterGoods);
-            if(compBrandGoodsList.size() > 0){
-                for(int i=0; i<compBrandGoodsList.size(); i++){
-                    moreBetterGoods.setGoodsCd(compBrandGoodsList.get(i).getGoodsCd());
-                    morebetterDao.createTmtbApplyGoodsTemp(moreBetterGoods);
-                    applyGoodsList.add(compBrandGoodsList.get(i));
-                }
-            }
-        }
-
-        for(int i=0; i<moreBetterGoods.getMultiApplyGoods().length; i++){
-            moreBetterGoods.setGoodsCd(moreBetterGoods.getMultiApplyGoods()[i]);
-            morebetterDao.createTmtbApplyGoodsTemp(moreBetterGoods);
-        }
-        morebetterDao.deleteTmtbGoodsTemp(moreBetterGoods);
-        morebetterDao.createTmtbGoodsTemp(moreBetterGoods);
-    }
-
     /**
      * 다다익선 - 진행중인 다다익선 상품 조회
      * @param moreBetterGoods
@@ -408,5 +390,22 @@ public class TsaMorebetterService {
         morebetterDao.updateMorebetterStat(moreBetter);
     }
 
+    /**
+     * 다다익선 적용상품 temp
+     * @param
+     * @return
+     * @author bin2107
+     * @since 2021. 3. 23
+     */
+    @Transactional("shopTxnManager")
+    public void insertMorebetterApplyGoodsTemp(MoreBetter moreBetter) {
+        moreBetter.setRegNo(TsaSession.getInfo().getUserNo());
+        moreBetter.setUpdNo(TsaSession.getInfo().getUserNo());
+        if(moreBetter.getMultiApplyGoods().length > 0){
+            morebetterDao.deleteMorebetterApplyGoodsTemp(moreBetter);
+            morebetterDao.insertMorebetterApplyGoodsTemp(moreBetter);
+        }
+    }
+
     /* // CSB 진행 */
 }

+ 110 - 11
src/main/java/com/style24/admin/biz/service/TsaPlanService.java

@@ -1,11 +1,12 @@
 package com.style24.admin.biz.service;
 
+import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
 
-import org.apache.commons.lang3.StringUtils;
+import org.springframework.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Service;
@@ -13,6 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.gagaframework.web.parameter.GagaMap;
+import com.gagaframework.web.util.GagaDateUtil;
 import com.gagaframework.web.util.GagaFileUtil;
 import com.gagaframework.web.util.GagaStringUtil;
 import com.style24.admin.biz.dao.TsaPlanDao;
@@ -64,8 +66,49 @@ public class TsaPlanService {
 	@Transactional("shopTxnManager")
 	public void createPlanInfo(Plan param) {
 		Plan plan = new Plan();
+		int ind = 1;
 		param.setRegNo(TsaSession.getInfo().getUserNo());
 		param.setUpdNo(TsaSession.getInfo().getUserNo());
+		if(param.getMainPimg() != null && !"".equals(param.getMainPimg())){
+			String imgInd = String.valueOf(ind);
+			if (ind < 10) {
+				imgInd = "0" + imgInd;
+			}
+			String planUploadPath = env.getProperty("upload.default.target.path");
+			String yearMonth = GagaDateUtil.getToday().substring(0, 6);
+			planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, "/planning");
+			File newFile = new File(GagaFileUtil.getConcatenationPath(planUploadPath, param.getMainPimg()));
+			planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, yearMonth);
+			String newFilename = "PLANNING_" + GagaDateUtil.getTodayDateTime() + "_" + imgInd + "." + StringUtils.getFilenameExtension(param.getMainPimg());
+			File uniqueFile = GagaFileUtil.getUniqueFile(new File(GagaFileUtil.getConcatenationPath(planUploadPath, newFilename)));
+			// Rename a file
+			File path = new File(planUploadPath);
+			if (!path.exists()) {
+				path.mkdir();
+			}
+			newFile.renameTo(uniqueFile);
+			param.setMainPimg("/planning/" + yearMonth + "/" + newFilename);
+		}
+		if(param.getMainMimg() != null && !"".equals(param.getMainMimg())){
+			String imgInd = String.valueOf(ind);
+			if (ind < 10) {
+				imgInd = "0" + imgInd;
+			}
+			String planUploadPath = env.getProperty("upload.default.target.path");
+			String yearMonth = GagaDateUtil.getToday().substring(0, 6);
+			planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, "/planning");
+			File newFile = new File(GagaFileUtil.getConcatenationPath(planUploadPath, param.getMainMimg()));
+			planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, yearMonth);
+			String newFilename = "PLANNING_" + GagaDateUtil.getTodayDateTime() + "_" + imgInd + "." + StringUtils.getFilenameExtension(param.getMainMimg());
+			File uniqueFile = GagaFileUtil.getUniqueFile(new File(GagaFileUtil.getConcatenationPath(planUploadPath, newFilename)));
+			// Rename a file
+			File path = new File(planUploadPath);
+			if (!path.exists()) {
+				path.mkdir();
+			}
+			newFile.renameTo(uniqueFile);
+			param.setMainMimg("/planning/" + yearMonth + "/" + newFilename);
+		}
 		planDao.createPlanInfo(param);
 		
 		String[] brand = param.getMultiBrand();
@@ -365,7 +408,47 @@ public class TsaPlanService {
 			plan.setRegNo(TsaSession.getInfo().getUserNo());
 			planDao.createPlanCustGrade(plan);
 		}
-		
+		int ind = 1;
+		if(param.getMainPimg() != null && !"".equals(param.getMainPimg())){
+			String imgInd = String.valueOf(ind);
+			if (ind < 10) {
+				imgInd = "0" + imgInd;
+			}
+			String planUploadPath = env.getProperty("upload.default.target.path");
+			String yearMonth = GagaDateUtil.getToday().substring(0, 6);
+			planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, "/planning");
+			File newFile = new File(GagaFileUtil.getConcatenationPath(planUploadPath, param.getMainPimg()));
+			planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, yearMonth);
+			String newFilename = "PLANNING_" + GagaDateUtil.getTodayDateTime() + "_" + imgInd + "." + StringUtils.getFilenameExtension(param.getMainPimg());
+			File uniqueFile = GagaFileUtil.getUniqueFile(new File(GagaFileUtil.getConcatenationPath(planUploadPath, newFilename)));
+			// Rename a file
+			File path = new File(planUploadPath);
+			if (!path.exists()) {
+				path.mkdir();
+			}
+			newFile.renameTo(uniqueFile);
+			param.setMainPimg("/planning/" + yearMonth + "/" + newFilename);
+		}
+		if(param.getMainMimg() != null && !"".equals(param.getMainMimg())){
+			String imgInd = String.valueOf(ind);
+			if (ind < 10) {
+				imgInd = "0" + imgInd;
+			}
+			String planUploadPath = env.getProperty("upload.default.target.path");
+			String yearMonth = GagaDateUtil.getToday().substring(0, 6);
+			planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, "/planning");
+			File newFile = new File(GagaFileUtil.getConcatenationPath(planUploadPath, param.getMainMimg()));
+			planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, yearMonth);
+			String newFilename = "PLANNING_" + GagaDateUtil.getTodayDateTime() + "_" + imgInd + "." + StringUtils.getFilenameExtension(param.getMainMimg());
+			File uniqueFile = GagaFileUtil.getUniqueFile(new File(GagaFileUtil.getConcatenationPath(planUploadPath, newFilename)));
+			// Rename a file
+			File path = new File(planUploadPath);
+			if (!path.exists()) {
+				path.mkdir();
+			}
+			newFile.renameTo(uniqueFile);
+			param.setMainMimg("/planning/" + yearMonth + "/" + newFilename);
+		}
 		// 최종업데이트 
 		planDao.updatePlanInfo(param);
 
@@ -730,11 +813,11 @@ public class TsaPlanService {
 			planGoods.setPlanSq(param.getPlanSq());
 
 			String planDtlSq = String.valueOf(planGoods.getPlanDtlSq());
-			if (StringUtils.isBlank(planDtlSq)) {
+			if (org.apache.commons.lang3.StringUtils.isBlank(planDtlSq)) {
 				throw new IllegalStateException("상품코드 : " + planGoods.getGoodsCd() + " 기획전 코너 번호가 없습니다.");
 			}
 
-			if (StringUtils.isBlank(planGoods.getGoodsCd())) {
+			if (org.apache.commons.lang3.StringUtils.isBlank(planGoods.getGoodsCd())) {
 				throw new IllegalStateException("비어 있는 상품코드가 존재합니다.");
 			}
 
@@ -806,7 +889,7 @@ public class TsaPlanService {
 		// 리뷰 등록
 		Plan rePlan = new Plan();
 		//리뷰 등록 - tb_plan_contents
-		if(param.getReTitle() != "" || !StringUtils.isAllEmpty(param.getMultiPlanReview())) {
+		if(param.getReTitle() != "" || !org.apache.commons.lang3.StringUtils.isAllEmpty(param.getMultiPlanReview())) {
 			rePlan.setRegNo(regNo);
 			rePlan.setUpdNo(regNo);
 			rePlan.setTmplType("G082_10");
@@ -867,7 +950,7 @@ public class TsaPlanService {
 		
 		//이미지등록
 		Plan filePlan = new Plan();
-		if(!StringUtils.isAllEmpty(param.getMultiPlanFile()) || param.getFileDispOrd() >=0) {
+		if(!org.apache.commons.lang3.StringUtils.isAllEmpty(param.getMultiPlanFile()) || param.getFileDispOrd() >=0) {
 			filePlan.setRegNo(regNo);
 			filePlan.setUpdNo(regNo);
 			filePlan.setTmplType("G082_30");
@@ -883,10 +966,26 @@ public class TsaPlanService {
 			
 			//파일아이템 등록
 			String[] fileItemVal = param.getMultiPlanFile();
-			
-			// 기획전 브랜드 insert
+			int ind = 1;
 			for (int j = 0; j < fileItemVal.length; j++) {
-				filePlan.setItemVal(fileItemVal[j]);
+				String imgInd = String.valueOf(ind);
+				if (ind < 10) {
+					imgInd = "0" + imgInd;
+				}
+				String planUploadPath = env.getProperty("upload.default.target.path");
+				String yearMonth = GagaDateUtil.getToday().substring(0, 6);
+				planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, "/planning");
+				File newFile = new File(GagaFileUtil.getConcatenationPath(planUploadPath, fileItemVal[j]));
+				planUploadPath = GagaFileUtil.getConcatenationPath(planUploadPath, yearMonth);
+				String newFilename = "PLANNING_" + GagaDateUtil.getTodayDateTime() + "_" + imgInd + "." + StringUtils.getFilenameExtension(fileItemVal[j]);
+				File uniqueFile = GagaFileUtil.getUniqueFile(new File(GagaFileUtil.getConcatenationPath(planUploadPath, newFilename)));
+				// Rename a file
+				File path = new File(planUploadPath);
+				if (!path.exists()) {
+					path.mkdir();
+				}
+				newFile.renameTo(uniqueFile);
+				filePlan.setItemVal("/planning/" + yearMonth + "/" + newFilename);
 				planDao.createPlanContentsItem(filePlan);
 			}
 		}
@@ -896,7 +995,7 @@ public class TsaPlanService {
 
 			
 			// 웹용 상단PC 등록
-			if (StringUtils.isNotBlank(param.getFsrcPcTop())) {
+			if (org.apache.commons.lang3.StringUtils.isNotBlank(param.getFsrcPcTop())) {
 				
 				createPlanFsrcPcTop(param);
 			}
@@ -906,7 +1005,7 @@ public class TsaPlanService {
 			
 			
 			// 웹용 상단PC 등록
-			if (StringUtils.isNotBlank(param.getFsrcPcBtm())) {
+			if (org.apache.commons.lang3.StringUtils.isNotBlank(param.getFsrcPcBtm())) {
 				createPlanFsrcPcBtm(param);
 			}
 

+ 8 - 6
src/main/java/com/style24/admin/biz/web/TsaDisplayController.java

@@ -562,13 +562,14 @@ public class TsaDisplayController extends TsaBaseController {
 	 * @since 2021. 2. 22
 	 */
 	@GetMapping("/main/contents/popup/form")
-	public ModelAndView mainContentsPopupForm(@RequestParam(value = "cateNo") String cateNo, @RequestParam(value = "contentsLoc") String contentsLoc) {
+	public ModelAndView mainContentsPopupForm(@RequestParam(value = "cateNo") String cateNo, @RequestParam(value = "contentsLoc") String contentsLoc , @RequestParam(value = "brandGroupNo", required = false) String brandGroupNo) {
 		ModelAndView mav = new ModelAndView();
 		mav.addObject("cateNo", cateNo);
 		mav.addObject("contentsLoc", contentsLoc);
+		mav.addObject("brandGroupNo", brandGroupNo);
 		mav.addObject("contentsDesc", displayService.getContentsDesc(contentsLoc));
 		mav.addObject("contentsLocList", rendererService.getAvailCommonCodeList("G028"));
-		mav.addObject("contentsTitle", displayService.getContentsTitle(cateNo,contentsLoc));
+		mav.addObject("contentsTitle", displayService.getContentsTitle(cateNo,contentsLoc,brandGroupNo));
 
 		mav.setViewName("display/MainContentsPopupForm");
 		return mav;
@@ -685,13 +686,13 @@ public class TsaDisplayController extends TsaBaseController {
 	 * @since 2021. 2. 24
 	 */
 	@GetMapping("/main/multicontents/popup/form")
-	public ModelAndView mainMultiContentsPopupForm(@RequestParam(value = "cateNo") String cateNo, @RequestParam(value = "contentsLoc") String contentsLoc) {
+	public ModelAndView mainMultiContentsPopupForm(@RequestParam(value = "cateNo") String cateNo, @RequestParam(value = "contentsLoc") String contentsLoc, @RequestParam(value = "brandGroupNo", required = false) String brandGroupNo) {
 		ModelAndView mav = new ModelAndView();
 		mav.addObject("cateNo", cateNo);
 		mav.addObject("contentsLoc", contentsLoc);
 		mav.addObject("contentsDesc", displayService.getContentsDesc(contentsLoc));
 		mav.addObject("contentsLocList", rendererService.getAvailCommonCodeList("G028"));
-		mav.addObject("contentsTitle", displayService.getContentsTitle(cateNo,contentsLoc));
+		mav.addObject("contentsTitle", displayService.getContentsTitle(cateNo,contentsLoc,brandGroupNo));
 		mav.setViewName("display/MainMultiContentsPopupForm");
 		return mav;
 	}
@@ -925,13 +926,14 @@ public class TsaDisplayController extends TsaBaseController {
 	 * @since 2021. 3. 10
 	 */
 	@GetMapping("/main/gnbcontents/popup/form")
-	public ModelAndView mainGnbContentsPopupForm(@RequestParam(value = "cateNo") String cateNo, @RequestParam(value = "contentsLoc") String contentsLoc) {
+	public ModelAndView mainGnbContentsPopupForm(@RequestParam(value = "cateNo") String cateNo, @RequestParam(value = "contentsLoc") String contentsLoc, @RequestParam(value = "brandGroupNo", required = false) String brandGroupNo) {
 		ModelAndView mav = new ModelAndView();
 		mav.addObject("cateNo", cateNo);
 		mav.addObject("contentsLoc", contentsLoc);
+		mav.addObject("brandGroupNo", brandGroupNo);
 		mav.addObject("contentsDesc", displayService.getContentsDesc(contentsLoc));
 		mav.addObject("contentsLocList", rendererService.getAvailCommonCodeList("G028"));
-		mav.addObject("contentsTitle", displayService.getContentsTitle(cateNo,contentsLoc));
+		mav.addObject("contentsTitle", displayService.getContentsTitle(cateNo,contentsLoc,brandGroupNo));
 		mav.addObject("cate1List", rendererService.getCate1List());
 
 		mav.setViewName("display/MainGnbContentsPopupForm");

+ 8 - 21
src/main/java/com/style24/admin/biz/web/TsaMarketingController.java

@@ -740,19 +740,12 @@ public class TsaMarketingController extends TsaBaseController {
 
 		try{
 			MoreBetterGoods moreBetterGoods = new MoreBetterGoods();
-			moreBetterGoods.setMultiSupplyCompCd(moreBetter.getMultiSupplyCompCd());
-			moreBetterGoods.setMultiBrand(moreBetter.getMultiBrand());
-			moreBetterGoods.setMultiApplyGoods(moreBetter.getMultiApplyGoods());
-			moreBetterGoods.setMultiExceptGoods(moreBetter.getMultiExceptGoods());
-
-			// TMTB_GOODS_TEMP TABLE TRUNCATE -> 다른 다다에서 사용중인 상품 조회 -> INSERT
-			moreBetterGoods.setApplyGoodsList(moreBetter.getApplyGoodsList());
-			moreBetterGoods.setGridApplyGoodsList(moreBetter.getApplyGoodsList());
-			moreBetterGoods.setSectionGb(moreBetter.getSectionGb());
-
-			morebetterService.createMorebetterGoodsTemp(moreBetterGoods);
+			// 적용상품 으로 tb_goods 조회해서 temp 테이블 insert
+			morebetterService.insertMorebetterApplyGoodsTemp(moreBetter);
 			morebetterService.saveMoreBetterDetail(moreBetter);
 
+			moreBetterGoods.setTmtbSq(moreBetter.getTmtbSq());
+			moreBetterGoods.setRegNo(TsaSession.getInfo().getUserNo());
 			// 다른 다다에서 사용중인 상품 조회
 			Collection<MoreBetterGoods> duplicateGoodsList = morebetterService.getMorebetterDuplicateList(moreBetterGoods);
 			// SELECT -> 지금 내가 선택한 업체&브랜드 + 적용상품에 해당하는 상품 조회 MINUS TMTB_GOODS_TEMP 상품
@@ -881,18 +874,12 @@ public class TsaMarketingController extends TsaBaseController {
 			MoreBetterGoods moreBetterGoods = new MoreBetterGoods();
 
 			if("G232_11".equals(moreBetter.getTmtbStat())){
-				moreBetterGoods.setMultiSupplyCompCd(moreBetter.getMultiSupplyCompCd());
-				moreBetterGoods.setMultiBrand(moreBetter.getMultiBrand());
-				moreBetterGoods.setMultiApplyGoods(moreBetter.getMultiApplyGoods());
-				moreBetterGoods.setMultiExceptGoods(moreBetter.getMultiExceptGoods());
-
-				// TMTB_GOODS_TEMP TABLE TRUNCATE -> 다른 다다에서 사용중인 상품 조회 -> INSERT
-				moreBetterGoods.setApplyGoodsList(moreBetter.getApplyGoodsList());
-				moreBetterGoods.setGridApplyGoodsList(moreBetter.getApplyGoodsList());
-				moreBetterGoods.setSectionGb(moreBetter.getSectionGb());
-				morebetterService.createMorebetterGoodsTemp(moreBetterGoods);
+				// 적용상품 으로 tb_goods 조회해서 temp 테이블 insert
+				morebetterService.insertMorebetterApplyGoodsTemp(moreBetter);
 
 				// 다른 다다에서 사용중인 상품 조회
+				moreBetterGoods.setTmtbSq(moreBetter.getTmtbSq());
+				moreBetterGoods.setRegNo(TsaSession.getInfo().getUserNo());
 				Collection<MoreBetterGoods> duplicateGoodsList = morebetterService.getMorebetterDuplicateList(moreBetterGoods);
 
 				// 조회 건수 있으면 -> 해당 상품코드 엑셀로 던져주기

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

@@ -137,6 +137,7 @@ public class Goods extends TscBaseDomain {
 	private int sellDay15Qty;
 
 	private int goodsSq;
+	private String sizeGb;
 
 	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
 	private String[] arrGoodsCd;

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

@@ -12,6 +12,7 @@ import java.util.List;
 public class MainDisplay extends TscBaseDomain {
     private Integer cateNo;
     private String contentsLoc;
+    private String brandGroupNo;	// 브랜드그룹코드
     private Integer dispOrd;
     private String contentsYn;
     private Integer colCnt;
@@ -19,4 +20,5 @@ public class MainDisplay extends TscBaseDomain {
     private String orgFileNm;
     private String sysFileNm;
     private String newSysFileNm;
+    private String contentsTitle;
 }

+ 5 - 0
src/main/java/com/style24/persistence/domain/MoreBetter.java

@@ -89,6 +89,11 @@ public class MoreBetter extends TscBaseDomain {
 	private String eventEdHH;				// 다다익선종료일시
 	private String eventEdMM;				// 다다익선종료일시
 
+	private String multiGb;
+	private String compSql;		// 공급업체, 브랜드 쿼리문
+	private String applySql;	// 적용 상품 쿼리문
+	private String exceptSql;	// 적용 상품 쿼리문
+
 	// Pagination
 	private TscPageRequest pageable;
 	private int pageNo = 1;

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

@@ -33,6 +33,8 @@ public class MoreBetterGoods extends TscBaseDomain {
 	private String goodsNm;
 
 	private String sectionGb;		// 구간설정 구분값(G810_10:수량,G810_11:금액)
+	private String applySql;	// 적용 상품 쿼리문
+	private String exceptSql;	// 적용 상품 쿼리문
 
 	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
 	private String[] arrCompanySq;

+ 73 - 8
src/main/java/com/style24/persistence/mybatis/shop/TsaDsiplay.xml

@@ -787,7 +787,7 @@
 					,REG_DT
 				)
 				VALUES (
-					IFNULL(#{brandGroupNo},0)
+		            IFNULL(NULLIF(#{brandGroupNo},''),0)
 				    ,#{cateCd}
 				    ,#{goodsCd}
 				    ,(SELECT	IFNULL((MAX(DISP_ORD) + 1), 1) AS DISP_ORD
@@ -1213,6 +1213,7 @@
 		/* TsaDisplay.getMainLayoutList */
 		SELECT	CATE_NO
 				,CONTENTS_LOC
+		     	,BRAND_GROUP_NO
 				,DISP_ORD
 				,CONTENTS_YN
 				,COL_CNT
@@ -1221,6 +1222,16 @@
 				,SYS_FILE_NM
 		FROM	TB_MAIN_LAYOUT
 		WHERE	CATE_NO = #{cateNo}
+		<if test='cateNo == "1711" or cateNo == "1721"'>
+			<choose>
+				<when test='brandGroupNo != null and brandGroupNo != ""'>
+					AND BRAND_GROUP_NO = #{brandGroupNo}
+				</when>
+		  		<otherwise>
+					AND BRAND_GROUP_NO = '0'
+				</otherwise>
+			</choose>
+		</if>
 		ORDER BY DISP_ORD, COL_NO
 	</select>
 
@@ -1229,6 +1240,9 @@
 		/* TsaDisplay.deleteMainLayout */
 		DELETE FROM TB_MAIN_LAYOUT
 		WHERE CATE_NO = #{cateNo}
+		<if test='brandGroupNo!=null and brandGroupNo!=""'>
+			AND 	BRAND_GROUP_NO = #{brandGroupNo}
+		</if>
 		<if test='contentsLoc!=null and contentsLoc!=""'>
 			AND SUBSTR(CONTENTS_LOC, 0, 4) = SUBSTR(#{contentsLoc}, 0, 4)
 		</if>
@@ -1241,10 +1255,12 @@
 		(
 			CATE_NO
 			,CONTENTS_LOC
+			,BRAND_GROUP_NO
 			,DISP_ORD
 			,CONTENTS_YN
 			,COL_CNT
 			,COL_NO
+			,CONTENTS_TITLE
 			,ORG_FILE_NM
 			,SYS_FILE_NM
 			,REG_NO
@@ -1256,10 +1272,18 @@
 		(
 		 	#{cateNo}
 		 	,#{contentsLoc}
+		 	,IFNULL(NULLIF(#{brandGroupNo},''),0)
 		 	,#{dispOrd}
 			,#{contentsYn}
 			,#{colCnt}
 			,#{colNo}
+			,(SELECT CONTENTS_TITLE
+			    FROM TMP_MAIN_LAYOUT_TITLE
+			    WHERE CATE_NO = #{cateNo} AND CONTENTS_LOC = #{contentsLoc}
+		        <if test='brandGroupNo != null and brandGroupNo != ""'>
+			      AND BRAND_GROUP_NO = #{brandGroupNo}
+				</if>
+			)
 			,#{orgFileNm}
 			,#{sysFileNm}
 			,#{regNo}
@@ -1343,6 +1367,11 @@
 		FROM TB_CONTENTS_PREVIEW A
 		WHERE A.CATE_NO = #{cateNo}
 		  AND A.CONTENTS_LOC = #{contentsLoc}
+		<if test='cateNo == "1711" or cateNo == "1721"'>
+			<if test='brandGroupNo != null and brandGroupNo != ""'>
+				AND A.BRAND_GROUP_NO = #{brandGroupNo}
+		  	</if>
+		</if>
 		<if test='contentsLoc != null and contentsLoc != ""'>
 		  <if test='contentsLoc != "SCM002" and contentsLoc != "SCM003"'>
 			  AND A.USE_YN = 'Y'
@@ -1357,6 +1386,9 @@
 		DELETE FROM TB_CONTENTS_PREVIEW
 		WHERE 	CATE_NO = #{cateNo}
 		AND 	CONTENTS_LOC = #{contentsLoc}
+		<if test="brandGroupNo != null and brandGroupNo !=''">
+			AND BRAND_GROUP_NO = #{brandGroupNo}
+		</if>
 	</delete>
 
 	<!-- 메인전시 컨텐츠 미리보기 저장 -->
@@ -1454,6 +1486,9 @@
 		DELETE FROM TB_CONTENTS
 		WHERE 	CATE_NO = #{cateNo}
 		  AND 	CONTENTS_LOC = #{contentsLoc}
+		<if test="brandGroupNo != null and brandGroupNo !=''">
+			AND BRAND_GROUP_NO = #{brandGroupNo}
+		</if>
 	</delete>
 
 	<!-- 메인전시 컨텐츠 저장 -->
@@ -1545,6 +1580,9 @@
 		FROM	TB_CONTENTS_PREVIEW
 		WHERE	CONTENTS_LOC = #{contentsLoc}
 		AND 	CATE_NO = #{cateNo}
+		<if test="brandGroupNo != null and brandGroupNo !=''">
+			AND BRAND_GROUP_NO = #{brandGroupNo}
+		</if>
 	</insert>
 
 	<!-- 메인전시 컨텐츠 타이틀 임시테이블 삭제 -->
@@ -1553,6 +1591,9 @@
 		DELETE FROM TMP_MAIN_LAYOUT_TITLE
 		WHERE 	CATE_NO = #{cateNo}
 		  AND 	CONTENTS_LOC = #{contentsLoc}
+		<if test="brandGroupNo != null and brandGroupNo !=''">
+			AND BRAND_GROUP_NO = #{brandGroupNo}
+		</if>
 	</delete>
 
 	<!-- 메인전시 컨텐츠 타이틀 임시테이블 저장 -->
@@ -1562,6 +1603,7 @@
 		(
 			CATE_NO
 			,CONTENTS_LOC
+			,BRAND_GROUP_NO
 			,CONTENTS_TITLE
 			,REG_NO
 			,REG_DT
@@ -1570,6 +1612,7 @@
 		(
 		 	#{cateNo}
 		 	,#{contentsLoc}
+		 	,IFNULL(NULLIF(#{brandGroupNo},''),0)
 			,#{contentsTitle}
 			,#{regNo}
 			,NOW()
@@ -1583,15 +1626,21 @@
 		FROM	TMP_MAIN_LAYOUT_TITLE
 		WHERE	CATE_NO = #{cateNo}
 		AND		CONTENTS_LOC = #{contentsLoc}
+		<if test="brandGroupNo != null and brandGroupNo !=''">
+			AND BRAND_GROUP_NO = #{brandGroupNo}
+		</if>
 	</select>
 
 	<!-- 메인전시 컨텐츠 타이틀 변경 -->
 	<update id="updateContentsTitle" parameterType="Contents">
 		/* TsaDisplay.updateContentsTitle */
 		UPDATE	TB_MAIN_LAYOUT
-		SET CONTENTS_TITLE = (SELECT CONTENTS_TITLE FROM TMP_MAIN_LAYOUT_TITLE WHERE CATE_NO = #{cateNo} AND CONTENTS_LOC = #{contentsLoc})
+		SET CONTENTS_TITLE = (SELECT CONTENTS_TITLE FROM TMP_MAIN_LAYOUT_TITLE WHERE CATE_NO = #{cateNo} AND CONTENTS_LOC = #{contentsLoc} AND BRAND_GROUP_NO = #{brandGroupNo})
 		WHERE CATE_NO = #{cateNo}
 		AND CONTENTS_LOC = #{contentsLoc}
+		<if test="brandGroupNo != null and brandGroupNo !=''">
+			AND BRAND_GROUP_NO = #{brandGroupNo}
+		</if>
 	</update>
 
 	<!-- CATEGORY4SRCH 조회 -->
@@ -1656,7 +1705,7 @@
 		)
 		VALUES
 		(
-			IFNULL(#{brandGroupNo},0)
+			 IFNULL(NULLIF(#{brandGroupNo},''),0)
 		 	,#{cateNo}
 		 	,(SELECT LEAF_CATE_NO FROM (SELECT	LEAF_CATE_NO
 					   					FROM	TB_CATE_4SRCH
@@ -1672,7 +1721,7 @@
 		 							FROM	TMP_CONTENTS_GOODS
 		 							WHERE CATE_NO = #{cateNo}
 		 							  AND CONTENTS_LOC = #{contentsLoc}
-		 	    					  AND PRE_CONTENTS_SQ = #{preContentsSq}
+		 	    					  AND CONTENTS_SQ = #{contentsSq}
 		 	    					) TMP)
 		 	,#{regNo}
 		 	,NOW()
@@ -1697,8 +1746,6 @@
 			 BRAND_GROUP_NO
 		    ,CATE_NO
 			,GOODS_CD
-			,CONTENTS_LOC
-			,CONTENTS_SQ
 			,DISP_ORD
 			,REG_NO
 			,REG_DT
@@ -1707,8 +1754,6 @@
 		     BRAND_GROUP_NO
 			 ,LEAF_CATE_NO
 			 ,GOODS_CD
-		     ,CONTENTS_LOC
-			 ,PRE_CONTENTS_SQ
 			 ,DISP_ORD
 			 ,#{regNo}
 			 ,NOW()
@@ -1783,6 +1828,11 @@
 		/* TsaDisplay.deleteGnbTabPreview */
 		DELETE FROM  TB_GNB_TAB_PREVIEW
 		WHERE 	GTAB_GB = #{gtabGb}
+		<if test='gtabGb != null and gtabGb !="" and gtabGb=="B"'>
+			<if test='brandGroupNo != null and brandGroupNo !=""'>
+				AND	BRAND_GROUP_NO = #{brandGroupNo}
+			</if>
+		</if>
 	</delete>
 
 	<!-- 메인전시 GnbTab 미리보기 저장 -->
@@ -1841,6 +1891,11 @@
 				, DISP_ORD
 		FROM 	TB_GNB_TAB_PREVIEW
 		WHERE	GTAB_GB = #{gtabGb}
+		  <if test='gtabGb != null and gtabGb !="" and gtabGb=="B"'>
+			  <if test='brandGroupNo != null and brandGroupNo !=""'>
+				  AND	BRAND_GROUP_NO = #{brandGroupNo}
+			  </if>
+		  </if>
 		  AND    DISP_STDT <![CDATA[<=]]> NOW()
 		  AND    DISP_EDDT <![CDATA[>=]]> NOW()
 		;
@@ -1851,6 +1906,11 @@
 		/* TsaDisplay.deleteGnbTabContents */
 		DELETE FROM TB_GNB_TAB
 		WHERE 	GTAB_GB = #{gtabGb}
+		<if test='gtabGb != null and gtabGb !="" and gtabGb=="B"'>
+			<if test='brandGroupNo != null and brandGroupNo !=""'>
+				AND	BRAND_GROUP_NO = #{brandGroupNo}
+			</if>
+		</if>
 	</delete>
 
 	<!-- 메인전시 컨텐츠 카테고리 탭영역 저장 -->
@@ -1895,5 +1955,10 @@
 			, NOW()
 		FROM	TB_GNB_TAB_PREVIEW
 		WHERE	GTAB_GB = #{gtabGb}
+		<if test='gtabGb != null and gtabGb !="" and gtabGb=="B"'>
+			<if test='brandGroupNo != null and brandGroupNo !=""'>
+				AND	BRAND_GROUP_NO = #{brandGroupNo}
+			</if>
+		</if>
 	</insert>
 </mapper>

+ 2 - 2
src/main/java/com/style24/persistence/mybatis/shop/TsaGoods.xml

@@ -1436,7 +1436,7 @@
 		SELECT #{goodsCd} AS GOODS_CD
 		     , A.GOODS_CD AS COMPS_GOODS_CD
 		     , A.OPT_CD
-		     , CONCAT(A.OPT_CD1,  COALESCE(A.OPT_CD2, '', CONCAT('/', A.OPT_CD2))) AS OPT_NM 
+		     --  , CONCAT(A.OPT_CD1,  COALESCE(A.OPT_CD2, '', CONCAT('/', A.OPT_CD2))) AS OPT_NM 
 		     , A.OPT_CD1
 		     , A.OPT_CD2
 		     , A.ADD_PRICE
@@ -1449,7 +1449,7 @@
 		     , A.DISP_YN
 		     , C.DISP_ORD AS GOODS_ORD
 		     , COUNT(*) OVER(PARTITION BY A.GOODS_CD ) AS RCOUNT
-		     , ROW_NUMBER() OVER(PARTITION BY A.GOODS_CD ORDER BY A.DISP_ORD, A.OPT_CD1, A.OPT_CD2) AS RNUM
+		     , ROW_NUMBER() OVER(PARTITION BY A.GOODS_CD ORDER BY C.DISP_ORD, A.OPT_CD1, A.OPT_CD2) AS RNUM
 		FROM  TMP_GOODS C 
 		INNER JOIN TB_OPTION A ON C.COMPS_GOODS_CD = A.GOODS_CD 
 		LEFT OUTER JOIN (

+ 111 - 104
src/main/java/com/style24/persistence/mybatis/shop/TsaMorebetter.xml

@@ -537,59 +537,19 @@
 		</if>
 	</delete>
 
-	<delete id="deleteTmtbGoodsTemp" parameterType="MoreBetterGoods">
-		/* TsaMorebetter.deleteTmtbGoodsTemp */
-		DELETE FROM TB_TMTB_USING_GOODS_TEMP
-		WHERE	REG_NO = #{regNo}
-	</delete>
-
-	<insert id="createTmtbGoodsTemp" parameterType="MoreBetterGoods">
-		/* TsaMorebetter.createTmtbGoodsTemp */
-		INSERT INTO TB_TMTB_USING_GOODS_TEMP
-			SELECT Z.REG_NO
-				, Z.GOODS_CD
-				, Z.GOODS_NM
-			FROM (
-					SELECT 	#{regNo} AS REG_NO
-							, B.GOODS_CD
-							, G.GOODS_NM
-							, (SELECT SECTION_GB FROM TB_TMTB_SECTION WHERE A.TMTB_SQ = TMTB_SQ GROUP BY SECTION_GB) AS SECTION_GB
-					  FROM 	TB_TMTB A
-				INNER JOIN  TB_TMTB_APPLY_GOODS B
-						ON  A.TMTB_SQ = B.TMTB_SQ
-				INNER JOIN  TB_GOODS G
-						ON  B.GOODS_CD = G.GOODS_CD
-					WHERE 1=1
-					  AND NOW() BETWEEN DATE_FORMAT(A.TMTB_ST_DT, '%Y-%m-%d %H:%i:%S') AND DATE_FORMAT(A.TMTB_ED_DT, '%Y-%m-%d %H:%i:%S')
-					  AND A.TMTB_STAT = 'G232_11'
-					  AND A.DEL_YN = 'N'
-					  AND B.GOODS_GB IN ('G800_10','G800_20')
-					  AND B.DEL_YN = 'N'
-					  AND B.GOODS_CD NOT IN (
-											SELECT	GOODS_CD
-											FROM	TB_TMTB_APPLY_GOODS C
-											WHERE	1=1
-											  AND		B.TMTB_SQ = C.TMTB_SQ
-											  AND		C.GOODS_GB = 'G800_30'
-					      					  AND 		C.DEL_YN = 'N'
-										)
-			) Z
-			WHERE 1=1
-			AND Z.SECTION_GB = #{sectionGb}
-	</insert>
-
 	<select id="getMorebetterDuplicateList" parameterType="MoreBetterGoods" resultType="MoreBetterGoods">
 		/* TsaMorebetter.getMorebetterDuplicateList */
-		SELECT 	B.REG_NO
-				, B.GOODS_CD
-				, B.GOODS_NM
-		FROM 	TB_TMTB_APPLY_GOODS_TEMP A
-		JOIN 	TB_TMTB_USING_GOODS_TEMP B
-			ON 	A.REG_NO = B.REG_NO
-			AND A.GOODS_CD = B.GOODS_CD
-		WHERE 1=1
-		  AND A.REG_NO = #{regNo}
-		;
+		SELECT 	REG_NO
+				, GOODS_CD
+				, GOODS_NM
+		 FROM	TB_TMTB_APPLY_GOODS_TEMP
+		WHERE	1=1
+		  AND	REG_NO = #{regNo}
+		  AND	GOODS_CD NOT IN (
+							SELECT	GOODS_CD
+							FROM	TB_TMTB_APPLY_GOODS
+							WHERE	TMTB_SQ = #{tmtbSq}
+							)
 	</select>
 
 	<update id="updateMorebetterStat" parameterType="MoreBetter">
@@ -604,59 +564,6 @@
 		WHERE TMTB_SQ = #{tmtbSq}
 	</update>
 
-	<delete id="deleteTmtbApplyGoodsTemp" parameterType="MoreBetterGoods">
-		/* TsaMorebetter.deleteTmtbApplyGoodsTemp */
-		DELETE FROM TB_TMTB_APPLY_GOODS_TEMP
-		WHERE	REG_NO = #{regNo}
-	</delete>
-
-	<insert id="createTmtbApplyGoodsTemp" parameterType="MoreBetterGoods">
-		/* TsaMorebetter.createTmtbApplyGoodsTemp */
-		INSERT INTO TB_TMTB_APPLY_GOODS_TEMP(
-											 REG_NO
-											,GOODS_CD
-		)
-		VALUES (
-				   #{regNo}
-			   ,#{goodsCd}
-			   )
-	</insert>
-
-	<select id="getMorebetterRealApplyGoodsList" parameterType="MoreBetter" resultType="MoreBetterGoods">
-		/* TsaMorebetter.getMorebetterRealApplyGoodsList */
-		SELECT	GOODS_CD
-		  FROM	TB_TMTB_APPLY_GOODS_TEMP
-		 WHERE	1=1
-		   AND	REG_NO = #{regNo}
-		   AND	GOODS_CD NOT IN (
-							SELECT	GOODS_CD
-							FROM	TB_TMTB_USING_GOODS_TEMP
-							WHERE	1=1
-							  AND	REG_NO = #{regNo}
-							)
-	</select>
-
-	<select id="getMorebetterCompBrandGoodsList" parameterType="MoreBetterGoods" resultType="MoreBetterGoods">
-		/* TsaMorebetter.getMorebetterCompBrandGoodsList */
-		SELECT  G.GOODS_CD
-				,'G800_20' AS GOODS_GB
-				,'G260_10' AS TARGET_GB
-		FROM  TB_GOODS G
-		WHERE  1=1
-		<if test="multiSupplyCompCd != null and multiSupplyCompCd.length>0">
-			AND G.SUPPLY_COMP_CD IN
-			<foreach collection="multiSupplyCompCd" item="item" index="index"  open="(" close=")" separator=",">
-				#{item}
-			</foreach>
-		</if>
-		<if test="multiBrand != null and multiBrand.length>0">
-			OR G.BRAND_CD IN
-			<foreach collection="multiBrand" item="item" index="index"  open="(" close=")" separator=",">
-				#{item}
-			</foreach>
-		</if>
-	</select>
-
 	<update id="deleteTmtbGoods" parameterType="MoreBetter">
 		/* TsaMorebetter.deleteTmtbGoods */
 		UPDATE TB_TMTB_GOODS SET
@@ -703,5 +610,105 @@
 		WHERE	TMTB_SQ = #{tmtbSq}
 	</delete>
 
+	<insert id="insertMorebetterApplyGoods" parameterType="MoreBetterGoods">
+		/* TsaMarketing.insertMorebetterApplyGoods */
+		<selectKey keyProperty="tmtbApplyGoodsSq" resultType="int" order="AFTER">
+			SELECT LAST_INSERT_ID()
+		</selectKey>
+		INSERT INTO TB_TMTB_APPLY_GOODS(
+			  TMTB_SQ
+			, GOODS_GB
+			, GOODS_CD
+			, DEL_YN
+			, REG_NO
+			, REG_DT
+			, UPD_NO
+			, UPD_DT
+		)
+		SELECT #{tmtbSq} AS TMTB_SQ
+				, 'G800_10' AS GOODS_GB
+				, Z.GOODS_CD AS GOODS_CD
+				, 'N' AS DEL_YN
+				, #{regNo} AS REG_NO
+				, NOW() AS REG_DT
+				, #{updNo} AS UPD_NO
+				, NOW() AS UPD_DT
+		FROM	(
+			SELECT T.GOODS_CD
+			FROM (
+				<if test="multiSupplyCompCd!= null and multiSupplyCompCd.length>0">
+					SELECT GOODS_CD
+					FROM TB_GOODS
+					WHERE SUPPLY_COMP_CD IN
+					<foreach collection="multiSupplyCompCd" item="item" open="(" separator="," close=")">
+						#{item}
+					</foreach>
+					UNION ALL
+				</if>
+				<if test="multiBrand!= null and multiBrand.length>0">
+					SELECT	GOODS_CD
+					FROM	TB_GOODS
+					WHERE 	BRAND_CD IN
+					<foreach collection="multiBrand" item="item" open="(" separator="," close=")">
+						#{item}
+					</foreach>
+					UNION ALL
+				</if>
+				${applySql}
+			) T
+			WHERE	1=1
+			<if test="multiExceptGoods!= null and multiExceptGoods.length>0">
+			AND 	T.GOODS_CD NOT IN ( ${exceptSql} )
+			</if>
+		) Z
+		WHERE	1=1
+		AND 	Z.GOODS_CD NOT IN (
+									SELECT	b.TARGET_VAL
+									FROM 	TB_TMTB A
+									LEFT OUTER JOIN TB_TMTB_GOODS B
+									ON A.TMTB_SQ = B.TMTB_SQ
+									WHERE	A.TMTB_ST_DT <![CDATA[<=]]> NOW()
+									AND 	A.TMTB_ED_DT <![CDATA[>=]]> NOW()
+									AND 	A.TMTB_STAT = 'G232_11'
+									AND 	B.GOODS_GB <![CDATA[<>]]> 'G800_30'
+								)
+	</insert>
+
+	<delete id="deleteMorebetterApplyGoodsTemp" parameterType="MoreBetter">
+		/* TsaMorebetter.deleteMorebetterApplyGoodsTemp */
+		DELETE FROM TB_TMTB_APPLY_GOODS_TEMP
+		WHERE	REG_NO = #{regNo}
+	</delete>
+
+	<insert id="insertMorebetterApplyGoodsTemp" parameterType="MoreBetter">
+		/* TsaMorebetter.insertMorebetterApplyGoodsTemp */
+		INSERT INTO TB_TMTB_APPLY_GOODS_TEMP
+		SELECT	T.*
+		FROM (
+			SELECT	#{regNo} AS REG_NO
+					, GOODS_CD
+					, GOODS_NM
+			FROM	TB_GOODS
+			WHERE	1=1
+			<if test="multiApplyGoods != null and multiApplyGoods.length>0">
+				AND GOODS_CD IN
+				<foreach collection="multiApplyGoods" item="item" open="(" separator="," close=")">
+					#{item}
+				</foreach>
+			</if>
+		) T
+		WHERE	1=1
+		<if test="multiExceptGoods != null and multiExceptGoods.length>0">
+		AND 	T.GOODS_CD NOT IN (
+		    						SELECT	GOODS_CD
+		    						FROM	TB_GOODS
+		    						WHERE	1=1
+		    						AND 	GOODS_CD IN
+									<foreach collection="multiExceptGoods" item="item" open="(" separator="," close=")">
+										#{item}
+									</foreach>
+								)
+		</if>
+	</insert>
 	<!--// CSB 진행 -->
 </mapper>

+ 3 - 3
src/main/webapp/WEB-INF/views/display/GoodsDispOrdChangePopupForm.html

@@ -80,7 +80,7 @@
 <script type="text/javascript" src="/ux/plugins/gaga/gaga.paging.js?v=2019072202"></script>
 <script th:inline="javascript">
 	var params = [[${params}]];
-	var uploadGoodsUrl = "image.istyle24.com/Upload/ProductImage";//[[${@environment.getProperty('upload.goods.view')}]];
+	var uploadGoodsUrl = [[${@environment.getProperty('upload.goods.view')}]];
 
 	$("#btnSearch").on('click', function(){
 		$("#goodsDispOrdChangeForm input[name=searchGb]").val("BASIC");
@@ -116,9 +116,9 @@
 				html += '">';
 				html += '<li class="img">';
 				var imgPath = '';
-				if(resultList[i].imgType=='A'){
+				//if(resultList[i].imgType=='A'){
 					imgPath = uploadGoodsUrl;
-				}
+				//}
 				html += '<img src="'+imgPath+ "/" +resultList[i].imgPath1+'" onerror="this.src=\'/image/no.gif\';"/>';
 				html += '<div class="btnArea">';
 				html += '<button type="button" class="icnSm" title="맨위로" onclick="fnUpdownBtn(\''+resultList[i].goodsCd+'\', \''+resultList[i].dispOrd+'\', \'up\');"><i class="fa fa-play-circle fa-rotate-270" aria-hidden="true"></i></button>';

+ 1 - 1
src/main/webapp/WEB-INF/views/display/LookbookBannerPickerPopupForm.html

@@ -28,7 +28,7 @@
 				</li>
 			</ul>
 			<div id="pickerDiv">
-				<input type="hidden" name="uploadBannerUrl" id="uploadBannerUrl" th:value="${@environment.getProperty('upload.image.view') + '/display/lookbook/banner/'}"/>
+				<input type="hidden" name="uploadBannerUrl" id="uploadBannerUrl" th:value="${@environment.getProperty('upload.image.view') + '/lookbook/banner/'}"/>
 				<!-- posistion picker -->
 				<ul class="panelBar" id="pictureOffset"> <!--style="border-color: #dbdbdb;border-style: solid;border-width: 1px;"-->
 					<li>

+ 58 - 5
src/main/webapp/WEB-INF/views/display/LookbookBannerPopupForm.html

@@ -19,7 +19,7 @@
 		<form id="lbBannerForm" name="lbBannerForm" action="#" th:action="@{'/display/lookbook/save'}" onsubmit="$('#btnSearch').trigger('click'); return false;">
 			<input type="hidden" id="siteCd" name="siteCd" value="G00_10"/>
 			<input type="hidden" id="lookbookSq" name="lookbookSq" th:value="${lookbookSq}"/>
-			<input type="hidden" name="uploadDefaultBannerUrlPop" id="uploadDefaultBannerUrlPop" th:value="${@environment.getProperty('upload.image.view') + '/display/lookbook/banner/'}"/>
+			<input type="hidden" name="uploadDefaultBannerUrlPop" id="uploadDefaultBannerUrlPop" th:value="${@environment.getProperty('upload.image.view') + '/lookbook/banner/'}"/>
 			<div class="panelTitle">
 				<h2 th:text="${'룩북 ' + (mode == 'N' ? '등록' : '상세')}"></h2>
 				<button type="button" class="close" onclick="uifnPopupClose('popupLookbookBanner');"><i class="fa fa-times"></i></button>
@@ -31,6 +31,7 @@
 						<span class="cBlue">* 배너 PICKER는 저장 후 배너 상세 팝업에서 등록할 수 있습니다.</span>
 					</li>
 					<li class="aR">
+						<button type="button" class="btn btn-success btn-lg" id="btnMain">메인룩북설정</button>
 						<button type="button" class="btn btn-success btn-lg" id="btnAddBanner">배너추가</button>
 						<button type="button" class="btn btnRight btn-success btn-lg" id="btnSave">저장</button>
 					</li>
@@ -56,11 +57,15 @@
 						</td>
 						<th>브랜드<i class="required" title="필수"></i></th>
 						<td>
+							<input type="text" class="w200" name="brandCd" value="" />
+							<button type="button" class="btn btnRight btn-success btn-lg" onclick="fnSearchLbpBrandGroup();">브랜드조회</button>
+						</td>
+						<!--<td>
 							<select name="brandCd">
 								<option value="">[선택]</option>
 								<option th:if="${brandGroupList}" th:each="oneData, status : ${brandGroupList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
 							</select>
-						</td>
+						</td>-->
 					</tr>
 					<tr>
 						<th>노출기간<i class="required" title="필수"></i></th>
@@ -242,7 +247,7 @@
 				var data = {
 					lookbookSq : $('#lbBannerForm input[name=lookbookSq]').val()
 					,title : $('#lbBannerForm input[name=title]').val()
-					,brandCd : $('#lbBannerForm select[name=brandCd]').val()
+					,brandCd : $('#lbBannerForm input[name=brandCd]').val()
 					,dispStdt : fromDate
 					,dispEddt : toDate
 					,dispYn : $('#lbBannerForm input[name=dispYn]:checked').val()
@@ -320,7 +325,7 @@
 		$("#lbBannerForm #lbEdTimeHour").val(dispEdTime.substr(0,2));
 		$("#lbBannerForm #lbEdTimeMin").val(dispEdTime.substr(2,2));
 		$("#lbBannerForm input[name=title]").val(lookbookMstInfo.title);
-		$("#lbBannerForm select[name=brandCd]").val(lookbookMstInfo.brandCd);
+		$("#lbBannerForm input[name=brandCd]").val(lookbookMstInfo.brandCd);
 		$('input:radio[name="dispYn"]:radio[value='+lookbookMstInfo.dispYn+']').prop('checked', true);
 		var tnImgPath = lookbookMstInfo.sysTnfileNm;
 		var tnSrc = $("#uploadDefaultUrl").val().replace('/lookbook/thumbnail/', '');
@@ -404,7 +409,9 @@
 		html += '			<th>이미지설명</th>';
 		html += '			<td><textarea class="textareaR4" name="imgDesc" id="imgDesc'+bannerImgRow+'">'+desc+'</textarea></td>';
 		html += '			<td><input name="dispOrd" type="text" class="w80" placeholder="전시순서" style="margin-left:5px; text-align:center" value="'+dispord+'"/>';
-		html += '				<button type="button" class="btn btn-success btn-lg" onclick="fnAddPicker(this,\''+imgPath+'\');">피커추가</button>';
+		if(imgPath!=''){
+			html += '				<button type="button" class="btn btn-success btn-lg" onclick="fnAddPicker(this,\''+imgPath+'\');">피커추가</button>';
+		}
 		html += '				<button type="button" class="btn btn-danger btn-lg" onclick="fnDeleteBanner(this);">삭제</button></td>';
 		html += '		</tr>';
 		if(typeof param == 'object'){
@@ -429,10 +436,56 @@
 		});
 	}
 
+	var fnSearchLbpBrandGroup = function (){
+		cfnOpenBrandGroupListPopup("fnCallBackLbpBrandGroup", "S", "S");
+	}
+
+	var fnCallBackLbpBrandGroup = function (result){
+		$("#lbBannerForm").find("input[name=brandCd]").val(result[0].brandGroupNo);
+	}
+
+	// 메인룩북설정
+	$("#btnMain").on('click', function(){
+		var lookbookSq ='';
+		var brandCd = '';
+		if(gagajf.isNull($("#lbBannerForm").find("input[name=lookbookSq]").val())){
+			mcxDialog.alert('룩북 일련번호가 없습니다.');
+			return false;
+		}
+
+		if(gagajf.isNull($("#lbBannerForm").find("input[name=brandCd]").val())){
+			mcxDialog.alert('브랜드코드가 없습니다.');
+			return false;
+		}
+		lookbookSq = $("#lbBannerForm").find("input[name=lookbookSq]").val();
+		brandCd = $("#lbBannerForm").find("input[name=brandCd]").val();
+
+		mcxDialog.confirm('메인룩북으로 설정하시겠습니까?', {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function(){
+				var data = {
+					lookbookSq : lookbookSq
+					,brandCd : brandCd
+				};
+
+				var jsonData = JSON.stringify(data);
+				gagajf.ajaxJsonSubmit('/display/mainlookbook/save', jsonData, fnSaveCollback);
+			}
+		});
+	});
+
+	var fnSaveCollback = function (){
+
+	}
+
 	$(document).ready(function() {
 		// 상세/수정일때
 		if(mode != 'N'){
 			fnCreateLookbookLayout();
+			$("#btnMain").show();
+		}else{
+			$("#btnMain").hide();
 		}
 		//sortable Item List
 		$("#bannerDiv").sortable({

+ 13 - 33
src/main/webapp/WEB-INF/views/display/LookbookListForm.html

@@ -46,11 +46,15 @@
 						</td>
 						<th>브랜드</th>
 						<td>
+							<input type="text" class="w100" name="brandCd" value="" />
+							<button type="button" class="btn btnRight btn-success btn-lg" onclick="fnSearchLbBrandGroup();">브랜드조회</button>
+						</td>
+						<!--<td>
 							<select name="brandCd">
 								<option value="">[선택]</option>
 								<option th:if="${brandGroupList}" th:each="oneData, status : ${brandGroupList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
 							</select>
-						</td>
+						</td>-->
 						<th>전시기간</th>
 						<td colspan="5" id="sellTerms">
 							<span class="nowrap">
@@ -99,7 +103,6 @@
 				<li class="left">
 					<span class="btnLeft">
 						<button type="button" class="btn btn-danger btn-lg" id="btnDel">노출안함</button>
-						<button type="button" class="btn btn-success btn-lg" id="btnMain">메인룩북설정</button>
 					</span>
 				</li>
 				<li class="right">
@@ -197,37 +200,6 @@
 		gagaPaging.createPagination(result.pageing.pageable);
 	}
 
-	// 메인룩북설정
-	$("#btnMain").on('click', function(){
-		var selectRowData = gagaAgGrid.selectedRowData(gridOptions);
-
-		if(selectRowData.length < 1){
-			mcxDialog.alert('선택된 행이 없습니다.');
-			return;
-		}else if(selectRowData.length > 1){
-			mcxDialog.alert('메인룩북은 1개만 설정 가능합니다.');
-			return;
-		}else{
-			mcxDialog.confirm('메인룩북으로 설정하시겠습니까?', {
-				cancelBtnText: "취소",
-				sureBtnText: "확인",
-				sureBtnClick: function(){
-					var selectDataArr = [];
-					$.each(selectRowData, function(idx, item) {
-						selectDataArr.push(item.lookbookSq);
-					});
-
-					var data = {
-						selectDataArr : selectDataArr
-					};
-
-					var jsonData = JSON.stringify(data);
-					gagajf.ajaxJsonSubmit('/display/mainlookbook/save', jsonData, fnSaveCollback);
-				}
-			});
-		}
-	});
-
 	// 노출안함
 	$("#btnDel").on('click', function (){
 		var selectRowData = gagaAgGrid.selectedRowData(gridOptions);
@@ -260,6 +232,14 @@
 		$('#btnSearch').trigger('click');
 	}
 
+	var fnSearchLbBrandGroup = function (){
+		cfnOpenBrandGroupListPopup("fnCallBackLbBrandGroup", "S", "S");
+	}
+
+	var fnCallBackLbBrandGroup = function (result){
+		$("#searchForm").find("input[name=brandCd]").val(result[0].brandGroupNo);
+	}
+
 	$(document).ready(function() {
 		// Create a agGrid
 		gagaAgGrid.createGrid('gridList', gridOptions);

+ 53 - 36
src/main/webapp/WEB-INF/views/display/MainContentsPopupForm.html

@@ -55,6 +55,7 @@
 	/*<![CDATA[*/
 	var cateNo = [[${cateNo}]];
 	var contentsLoc = [[${contentsLoc}]];
+	var brandGroupNo = [[${brandGroupNo}]];
 	var contentsTitle = [[${contentsTitle}]];
 	var contentsLocArr = gagajf.convertToArray([[${contentsLocList}]]);
 	var tdWidth = $("#sortable").find("td").width();
@@ -68,6 +69,7 @@
 		$("#popSortable").html('');
 		var data = {cateNo : cateNo
 			,contentsLoc : contentsLoc
+			,brandGroupNo : brandGroupNo
 		};
 		var jsonData = JSON.stringify(data);
 		gagajf.ajaxJsonSubmit('/display/contents/preview/list', jsonData, fnCreatePopLayout);
@@ -168,9 +170,7 @@
 				if(contentsLoc!='SMM005' && contentsLoc!='SBM005' && contentsLoc!='SBMM005'){
 					html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddImgPopRow(this);">이미지추가</button>';
 				}
-				if(contentsLoc!='SMM005') {
 					html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddLinkPopRow(this);">링크추가</button>';
-				}
 				html += '<button type="button" class="btn btn-danger btn-lg" onclick="fnDeleteContentsRow(this);">삭제</button></td>';
 			}
 			html += '</tr>';
@@ -240,15 +240,19 @@
 				html += '</tr>';
 			}
 			if(contentsLoc=='SMM005'){
-				if(contentsLoc=='SMM005'){
 					html += '<tr>';
 					html += '	<th>배너유형</th>';
 					html += '	<td class="bannerArea" id="bannerArea'+i+'">';
-					html += '		<label class="rdoBtn"><input type="radio" name="bannerType'+i+'" value="1" onclick="fnChangeBannerType(this,1);">1단</label>';
-					html += '		<label class="rdoBtn"><input type="radio" name="bannerType'+i+'" value="2" onclick="fnChangeBannerType(this,2);">2단</label>';
+					if(result[i].contentsType=='1'){
+						html += '		<label class="rdoBtn"><input type="radio" name="bannerType'+i+'" value="1" checked="checked">1단</label>';
+						html += '		<label class="rdoBtn"><input type="radio" name="bannerType'+i+'" value="2" >2단</label>';
+					}else{
+						html += '		<label class="rdoBtn"><input type="radio" name="bannerType'+i+'" value="1" >1단</label>';
+						html += '		<label class="rdoBtn"><input type="radio" name="bannerType'+i+'" value="2" checked="checked">2단</label>';
+					}
 					html += '	</td>';
 					html += '</tr>';
-					html += '<tr id="bannerImgTr1" name="imgPopRow">';
+					/*html += '<tr id="bannerImgTr1" name="imgPopRow">';
 					html += '	<th>이미지1</th>';
 					html += '	<td>';
 					html += '		<div id="ImageArea1" style="height:33px;">';
@@ -285,8 +289,7 @@
 						html += '	<th>링크2</th>';
 						html += '	<td><input type="text" class="w400" name="linkUrl" maxlength="300" required="required" data-valid-name="LINK" value="'+result[i].strVar2+'"/></td>';
 						html += '</tr>';
-					}
-				}
+					}*/
 			}
 			html += '</thead><tbody>';
 			if(contentsLoc!='SCM002' && contentsLoc!='SCM003'){
@@ -372,12 +375,10 @@
 			if(contentsLoc=='SBM005' || contentsLoc=='SBMM005'){
 				html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddBrandDescRow(this);">브랜드소개추가</button>';
 			}
-			if(contentsLoc!='SMM005' && contentsLoc!='SBM005' && contentsLoc!='SBMM005') {
+			if(contentsLoc!='SBM005' && contentsLoc!='SBMM005') {
 				html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddImgPopRow(this);">이미지추가</button>';
 			}
-			if(contentsLoc!='SMM005') {
 				html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddLinkPopRow(this);">링크추가</button>';
-			}
 		}
 		html += '<button type="button" class="btn btn-danger btn-lg" onclick="fnDeleteContentsRow(this);">삭제</button></td>';
 		html += '</tr>';
@@ -420,11 +421,11 @@
 			html += '<tr>';
 			html += '	<th>배너유형</th>';
 			html += '	<td class="bannerArea" id="bannerArea'+dataIdx+'">';
-			html += '		<label class="rdoBtn"><input type="radio" name="bannerType'+dataIdx+'" value="1" onclick="fnChangeBannerType(this,1);">1단</label>';
-			html += '		<label class="rdoBtn"><input type="radio" name="bannerType'+dataIdx+'" value="2" onclick="fnChangeBannerType(this,2);">2단</label>';
+			html += '		<label class="rdoBtn"><input type="radio" name="bannerType'+dataIdx+'" value="1" checked="checked">1단</label>';	/*onclick="fnChangeBannerType(this,1);"*/
+			html += '		<label class="rdoBtn"><input type="radio" name="bannerType'+dataIdx+'" value="2" >2단</label>';
 			html += '	</td>';
 			html += '</tr>';
-			html += '<tr id="bannerImgTr1" name="imgPopRow" style="display: none;">';
+			/*html += '<tr id="bannerImgTr1" name="imgPopRow" style="display: none;">';
 			html += '	<th>이미지1</th>';
 			html += '	<td>';
 			html += '		<div id="ImageArea1" style="height:33px;">';
@@ -459,7 +460,7 @@
 			html += '<tr id="bannerLinkTr2" name="linkRow" style="display: none;">';
 			html += '	<th>링크2</th>';
 			html += '	<td><input type="text" class="w400" name="linkUrl" maxlength="300" required="required" data-valid-name="LINK" value="#"/></td>';
-			html += '</tr>';
+			html += '</tr>';*/
 		}
 		html += '</thead><tbody>';
 		html += '</tbody></table>';
@@ -503,11 +504,6 @@
 		}
 	}
 
-	// SMM005 배너유형 이미지/링크
-	var fnAddSmm005ImgRow = function (param , idx){
-
-	}
-
 	// 몰메인>메인롤링배너 기획전 조회
 	var tableDataId = 0;
 	var fnSearchPlan = function (idx){
@@ -520,7 +516,7 @@
 	}
 
 	// SMM005 데이터 validation 체크
-	function smm005DataValidation(){
+	/*function smm005DataValidation(){
 		$(".mcTable").each(function(i){
 			var thisIdx = $(this).find("input[name=tableIdx]").val();
 			var contentsType = $(this).find("input:radio[name=bannerType"+thisIdx+"]:checked").val();
@@ -551,7 +547,7 @@
 			}
 		});
 		return true;
-	}
+	}*/
 
 	// SMM001 데이터 validation 체크
 	function smm001DataValidation(){
@@ -590,7 +586,8 @@
 
 		if(contentsLoc=='SMM002'||contentsLoc=='SMM003'||contentsLoc=='SMM004'||contentsLoc=='SMM006'||contentsLoc=='SMM007'
 				||contentsLoc=='SMM009' ||contentsLoc=='SMM010'||contentsLoc=='SMM011'||contentsLoc=='SBM005' || contentsLoc=='SBMM005'
-				|| contentsLoc=='SCM002' || contentsLoc=='SCM003'){
+				|| contentsLoc=='SCM002' || contentsLoc=='SCM003' || contentsLoc=='SBM010' || contentsLoc=='SBM009'|| contentsLoc=='SBM008'
+				|| contentsLoc=='SBM007' || contentsLoc=='SBM013'){
 			if(!gagajf.checkRequired("#contentsTitleForm")){
 				return;
 			}
@@ -602,11 +599,11 @@
 			}
 		}
 
-		if(contentsLoc=='SMM005'){
+		/*if(contentsLoc=='SMM005'){
 			if(!smm005DataValidation()){
 				return false;
 			}
-		}
+		}*/
 
 		var titleBool = true;
 		$("#popSortable").find('input[name=title]').each(function(idx, title) {
@@ -690,11 +687,11 @@
 
 			if(contentsLoc=='SMM005'){
 				var thisIdx = $(this).find("input[name=tableIdx]").val();
-				contentsType = $(this).find("input:radio[name=bannerType1"+thisIdx+"]:checked").val();
-				imgPath1 = $(this).find("#ImageArea1").find("input[name=imgPath]").val();
+				contentsType = $(this).find("input:radio[name=bannerType"+thisIdx+"]:checked").val();
+				/*imgPath1 = $(this).find("#ImageArea1").find("input[name=imgPath]").val();
 				strVar1 = $(this).find("#bannerLinkTr1").find("input[name=linkUrl]").val();
 				imgPath2 = $(this).find("#ImageArea2").find("input[name=imgPath]").val();
-				strVar2 = $(this).find("#bannerLinkTr2").find("input[name=linkUrl]").val();
+				strVar2 = $(this).find("#bannerLinkTr2").find("input[name=linkUrl]").val();*/
 			}
 
 			if(contentsLoc=='SCM002' || contentsLoc=='SCM003'){
@@ -732,6 +729,7 @@
 				, subText4 : subText4
 				, useYn : useYn
 				, dispOrd : dispOrd
+				, brandGroupNo : brandGroupNo
 			};
 
 			dataArr.push(data);
@@ -740,6 +738,7 @@
 		if(dataArr.length==0){
 			var data = {cateNo : cateNo
 				, contentsLoc : contentsLoc
+				, brandGroupNo : brandGroupNo
 			};
 			dataArr.push(data);
 		}else{
@@ -780,11 +779,13 @@
 
 		if(contentsLoc=='SMM002'||contentsLoc=='SMM003'||contentsLoc=='SMM004'||contentsLoc=='SMM006'||contentsLoc=='SMM007'
 				||contentsLoc=='SMM009' ||contentsLoc=='SMM010'||contentsLoc=='SMM011'||contentsLoc=='SBM005' || contentsLoc=='SBMM005'
-				|| contentsLoc=='SCM002' || contentsLoc=='SCM003'){
+				|| contentsLoc=='SCM002' || contentsLoc=='SCM003' || contentsLoc=='SBM010' || contentsLoc=='SBM009'|| contentsLoc=='SBM008'
+				|| contentsLoc=='SBM007' || contentsLoc=='SBM013'){
 			var data = {
 				cateNo : cateNo
 				, contentsLoc : contentsLoc
 				, contentsTitle : $("#contentsTitleForm input[name=contentsTitle]").val()
+				, brandGroupNo : brandGroupNo
 			}
 			dataArr.push(data);
 		}
@@ -831,10 +832,18 @@
 		html += '<td class="aL"><button type="button" class="btn icn" onclick="fnDeleteTrRow(this);"><i class="fa fa-times" aria-hidden="true"></i></button></td>';
 		html += '</tr>';
 		if(typeof param == 'object'){
-			if($(param).closest("table").find("tbody").find("tr[name=linkPopRow]").length>3){
-				mcxDialog.alert("링크는 4개까지 등록 가능합니다");
-				return;
+			if(contentsLoc=='SMM005'){
+				if($(param).closest("table").find("tbody").find("tr[name=linkPopRow]").length>1){
+					mcxDialog.alert("링크는 최대 2개까지 등록 가능합니다");
+					return;
+				}
+			}else{
+				if($(param).closest("table").find("tbody").find("tr[name=linkPopRow]").length>3){
+					mcxDialog.alert("링크는 4개까지 등록 가능합니다");
+					return;
+				}
 			}
+
 			$(param).closest("table").find("tbody").append(html);
 		}else{
 			return html;
@@ -914,9 +923,16 @@
 		html += '<td class="aL"><button type="button" class="btn icn" onclick="fnDeleteTrRow(this);"><i class="fa fa-times" aria-hidden="true"></i></button></td>';
 		html += '</tr>';
 		if(typeof param == 'object'){
-			if($(param).closest("table").find("tbody").find("tr[name=imgPopRow]").length>3){
-				mcxDialog.alert("이미지는 4개까지 등록 가능합니다");
-				return;
+			if(contentsLoc=='SMM005'){
+				if($(param).closest("table").find("tbody").find("tr[name=imgPopRow]").length>1){
+					mcxDialog.alert("이미지는 최대 2개까지 등록 가능합니다");
+					return;
+				}
+			}else{
+				if($(param).closest("table").find("tbody").find("tr[name=imgPopRow]").length>3){
+					mcxDialog.alert("이미지는 4개까지 등록 가능합니다");
+					return;
+				}
 			}
 			imgIndex++;
 			$(param).closest("table").find("tbody").append(html);
@@ -995,7 +1011,8 @@
 
 		if(contentsLoc=='SMM002'||contentsLoc=='SMM003'||contentsLoc=='SMM004'||contentsLoc=='SMM006'||contentsLoc=='SMM007'
 				||contentsLoc=='SMM009' ||contentsLoc=='SMM010'||contentsLoc=='SMM011'||contentsLoc=='SBM005' || contentsLoc=='SBMM005'
-				|| contentsLoc=='SCM002' || contentsLoc=='SCM003'){
+				|| contentsLoc=='SCM002' || contentsLoc=='SCM003' || contentsLoc=='SBM010' || contentsLoc=='SBM009' || contentsLoc=='SBM008'
+				|| contentsLoc=='SBM007' || contentsLoc=='SBM013'){
 			$("#contentsTitleForm").show();
 		}else{
 			$("#contentsTitleForm").hide();

+ 38 - 13
src/main/webapp/WEB-INF/views/display/MainGnbContentsPopupForm.html

@@ -40,6 +40,7 @@
 /*<![CDATA[*/
 	var cateNo = [[${cateNo}]];
 	var contentsLoc = [[${contentsLoc}]];
+	var brandGroupNo = [[${brandGroupNo}]];
 	var contentsTitle = [[${contentsTitle}]];
 	var contentsLocArr = gagajf.convertToArray([[${contentsLocList}]]);
 	var tdWidth = $("#gnbTabList").find("td").width();
@@ -98,6 +99,13 @@
 			html += '		<label class="rdoBtn"><input type="radio" name="cateType'+addIdx+'" value="L" onclick="fnChangeCateType(this,'+addIdx+');"/>이벤트링크</label>';
 			html += '	</td>';
 			html += '</tr>';
+		}else if(contentsLoc=='SBM002'){
+			html += '<tr class="cateTypeTr">';
+			html += '	<th>유형선택</th>';
+			html += '	<td colspan="3">';
+			html += '		<label class="rdoBtn"><input type="radio" name="cateType'+addIdx+'" value="L" checked="checked"/>이벤트링크</label>';
+			html += '	</td>';
+			html += '</tr>';
 		}
 		html += '	<tr>';
 		html += '		<th>전시일시</th>';
@@ -136,6 +144,15 @@
 				html += '		</td>';
 				html += '	</tr>';
 			}
+		}else if(contentsLoc=='SBM002'){
+			html += '	<tr name="tabLinkTitleRow">';
+			html += '		<th>타이틀</th>';
+			html += '		<td><input name="title" type="text" maxlength="200" data-valid-name="타이틀" value=""/></td>';
+			html += '	</tr>';
+			html += '	<tr name="tabLinkRow">';
+			html += '		<th>링크 (없으면 #)</th>';
+			html += '		<td><input name="link" type="text" maxlength="200" data-valid-name="링크" value=""/></td>';
+			html += '	</tr>';
 		}else{
 			html += '	<tr name="tabCateRow" style="display:none;">';
 			html += '		<th>카테고리</th>';
@@ -369,6 +386,7 @@
 					, cate1No : cate1No
 					, linkUrl : linkUrl
 					, useYn : 'Y'
+					, brandGroupNo : brandGroupNo
 				}
 				dataArr.push(data);
 			}
@@ -558,6 +576,7 @@
 		$("#gnbTabList").html('');
 		var data = {
 			gtabGb : gtabGb
+			,brandGroupNo : brandGroupNo
 		};
 		var jsonData = JSON.stringify(data);
 		gagajf.ajaxJsonSubmit('/display/contents/gnbtab/category/preview/list', jsonData, fnCreateCategoryLayout);
@@ -580,20 +599,26 @@
 			html += '		<tr class="cateTypeTr">';
 			html += '			<th>유형선택</th>';
 			html += '			<td colspan="3">';
-			if(result[i].contentsType=='C'){
-				html += '<label class="rdoBtn"><input type="radio" name="cateType'+i+'" value="C" onclick="fnChangeCateType(this,'+i+');" checked="checked"/>대카테고리</label>';
-			}else{
-				html += '<label class="rdoBtn"><input type="radio" name="cateType'+i+'" value="C" onclick="fnChangeCateType(this,'+i+');"/>대카테고리</label>';
-			}
-			if(result[i].contentsType=='O'){
-				html += '<label class="rdoBtn"><input type="radio" name="cateType'+i+'" value="O" onclick="fnChangeCateType(this,'+i+');" checked="checked"/>아울렛</label>';
-			}else{
-				html += '<label class="rdoBtn"><input type="radio" name="cateType'+i+'" value="O" onclick="fnChangeCateType(this,'+i+');"/>아울렛</label>';
-			}
-			if(result[i].contentsType=='L'){
-				html += '<label class="rdoBtn"><input type="radio" name="cateType'+i+'" value="L" onclick="fnChangeCateType(this,'+i+');" checked="checked"/>이벤트링크</label>';
+			if(result[i].brandGroupNo!='' && result[i].brandGroupNo!=null){
+				if(result[i].contentsType=='L'){
+					html += '<label class="rdoBtn"><input type="radio" name="cateType'+i+'" value="L" checked="checked"/>이벤트링크</label>';
+				}
 			}else{
-				html += '<label class="rdoBtn"><input type="radio" name="cateType'+i+'" value="L" onclick="fnChangeCateType(this,'+i+');"/>이벤트링크</label>';
+				if(result[i].contentsType=='C'){
+					html += '<label class="rdoBtn"><input type="radio" name="cateType'+i+'" value="C" onclick="fnChangeCateType(this,'+i+');" checked="checked"/>대카테고리</label>';
+				}else{
+					html += '<label class="rdoBtn"><input type="radio" name="cateType'+i+'" value="C" onclick="fnChangeCateType(this,'+i+');"/>대카테고리</label>';
+				}
+				if(result[i].contentsType=='O'){
+					html += '<label class="rdoBtn"><input type="radio" name="cateType'+i+'" value="O" onclick="fnChangeCateType(this,'+i+');" checked="checked"/>아울렛</label>';
+				}else{
+					html += '<label class="rdoBtn"><input type="radio" name="cateType'+i+'" value="O" onclick="fnChangeCateType(this,'+i+');"/>아울렛</label>';
+				}
+				if(result[i].contentsType=='L'){
+					html += '<label class="rdoBtn"><input type="radio" name="cateType'+i+'" value="L" onclick="fnChangeCateType(this,'+i+');" checked="checked"/>이벤트링크</label>';
+				}else{
+					html += '<label class="rdoBtn"><input type="radio" name="cateType'+i+'" value="L" onclick="fnChangeCateType(this,'+i+');"/>이벤트링크</label>';
+				}
 			}
 			html += '			</td>';
 			html += '		</tr>';

+ 64 - 15
src/main/webapp/WEB-INF/views/display/MainListForm.html

@@ -179,20 +179,36 @@
 			}else{
 				$("#viewUl").removeClass("off");
 				var cateNo = "";
+				var brandGroupNo = "";
 				var cate1Val = $("#searchForm select[name=cate1No] option:selected").val().split(',')[0];		//1700,Y
-				if((!gagajf.isNull(cate1Val)&&cate1Val=='1711') || (!gagajf.isNull(cate1Val)&&cate1Val=='1721')){
+				/*if((!gagajf.isNull(cate1Val)&&cate1Val=='1711') || (!gagajf.isNull(cate1Val)&&cate1Val=='1721')){
 					cateNo = $("#searchForm").find("td[name=cate2Search]").find("input[name=brandGroupNo]").val();
 				}else{
 					cateNo = val.split(',')[0];
 					if(!gagajf.isNull($("#searchForm select[name=cate2No]").val())){
 						cateNo = $("#searchForm select[name=cate2No]").val().split(',')[0];
 					}
+				}*/
+				cateNo = val.split(',')[0];
+				if(!gagajf.isNull($("#searchForm select[name=cate2No]").val())){
+					cateNo = $("#searchForm select[name=cate2No]").val().split(',')[0];
 				}
-
-				console.log('cateNo::'+cateNo);
+				if((!gagajf.isNull(cate1Val)&&cate1Val=='1711') || (!gagajf.isNull(cate1Val)&&cate1Val=='1721')){
+					brandGroupNo = $("#searchForm").find("td[name=cate2Search]").find("input[name=brandGroupNo]").val();
+				}
+				/*else{
+					var data = {
+						cateNo : cateNo
+					};
+				}*/
 				var data = {
 					cateNo : cateNo
+					, brandGroupNo : brandGroupNo
 				};
+
+				console.log('cateNo::'+cateNo);
+				console.log('brandGroupNo::'+brandGroupNo);
+
 				var jsonData = JSON.stringify(data);
 				// 레이아웃 조회 로직
 				gagajf.ajaxJsonSubmit('/display/main/layout/list', jsonData, fnLayoutCallBack);
@@ -520,17 +536,20 @@
 		}
 		var cateNo = '';
 		var cateNm = '';
+		var brandGroupNo = '';
 		if(val.split(',')[1]=='Y'){
 			cateNo = val.split(',')[0];
-			if(cateNo == '1711' || cateNo == '1721'){
-				if(!fnCate2BrandCheck()){
-					return false;
-				}
-				cateNo = $("#searchForm").find("td[name=cate2Search]").find("input[name=brandGroupNo]").val();
-			}
 		}else{
 			cateNo = $("#searchForm select[name=cate2No]").val().split(',')[0];
 		}
+
+		if(cateNo == '1711' || cateNo == '1721'){
+			if(!fnCate2BrandCheck()){
+				return false;
+			}
+			brandGroupNo = $("#searchForm").find("td[name=cate2Search]").find("input[name=brandGroupNo]").val();
+		}
+
 		var dataArr = [];
 		var contentLocArr = [];
 		var contentLocCheck = true;
@@ -570,6 +589,7 @@
 						, orgFileNm : orgFileNm
 						, sysFileNm : sysFileNm
 						, newSysFileNm : newSysFileNm
+						, brandGroupNo : brandGroupNo
 					};
 					dataArr.push(data);
 				}
@@ -604,24 +624,25 @@
 	var fnChangeContents = function (obj){
 		var val = $("#searchForm select[name=cate1No]").val();
 		var cateNo = '';
+		var brandGroupNo = '';
 		if(val.split(',')[1]=='Y'){
 			cateNo = val.split(',')[0];
 		}else{
 			cateNo = $("#searchForm select[name=cate2No]").val().split(',')[0];
 		}
 		if(cateNo=='1711' || cateNo=='1721'){
-			cateNo = $("#searchForm").find("input[name=brandGroupNo]").val();
+			brandGroupNo = $("#searchForm").find("input[name=brandGroupNo]").val();
 		}
 
 		var contentsLoc = $(obj).closest("td").find('input:hidden[name="contentsLoc"]').val();
 
 		// 브랜드픽, MD추천 다른 팝업 사용
 		if(contentsLoc=='SMM007'||contentsLoc=='SMM009'){
-			cfnOpenMainMultiContentsPopup(cateNo, contentsLoc);
+			cfnOpenMainMultiContentsPopup(cateNo, contentsLoc, brandGroupNo);
 		}else if(contentsLoc=='STAB001' || contentsLoc=='STAB002' || contentsLoc=='SBM002'){
-			cfnOpenMainGnbContentsPopup(cateNo, contentsLoc);
+			cfnOpenMainGnbContentsPopup(cateNo, contentsLoc, brandGroupNo);
 		}else{
-			cfnOpenMainContentsPopup(cateNo, contentsLoc);
+			cfnOpenMainContentsPopup(cateNo, contentsLoc, brandGroupNo);
 		}
 	}
 
@@ -655,22 +676,45 @@
 			cancelBtnText: "취소",
 			sureBtnText: "확인",
 			sureBtnClick: function(){
-				if(contentsLoc=='STAB002'){
+				if(contentsLoc=='STAB002') {
 					var data = {
-						gtabGb : 'C'
+						gtabGb: 'C'
+					};
+					var jsonData = JSON.stringify(data);
+					gagajf.ajaxJsonSubmit('/display/contents/gnbtab/save', jsonData);
+				}else if(contentsLoc=='SBM002'){
+					var val = $("#searchForm select[name=cate1No]").val();
+					var cateNo = '';
+					var brandGroupNo = '';
+					if(val.split(',')[1]=='Y'){
+						cateNo = val.split(',')[0];
+					}else{
+						cateNo = $("#searchForm select[name=cate2No]").val().split(',')[0];
+					}
+					if(cateNo=='1711' || cateNo=='1721'){
+						brandGroupNo = $("#searchForm").find("input[name=brandGroupNo]").val();
+					}
+					var data = {
+						gtabGb: 'B'
+						,brandGroupNo : brandGroupNo
 					};
 					var jsonData = JSON.stringify(data);
 					gagajf.ajaxJsonSubmit('/display/contents/gnbtab/save', jsonData);
 				}else{
 					var val = $("#searchForm select[name=cate1No]").val();
 					var cateNo = '';
+					var brandGroupNo = '';
 					if(val.split(',')[1]=='Y'){
 						cateNo = val.split(',')[0];
 					}else{
 						cateNo = $("#searchForm select[name=cate2No]").val().split(',')[0];
 					}
+					if(cateNo=='1711' || cateNo=='1721'){
+						brandGroupNo = $("#searchForm").find("input[name=brandGroupNo]").val();
+					}
 					var data = { contentsLocArr : [contentsLoc]
 						,cateNo : cateNo
+						,brandGroupNo : brandGroupNo
 					};
 					var jsonData = JSON.stringify(data);
 					gagajf.ajaxJsonSubmit('/display/contents/save', jsonData);
@@ -689,11 +733,15 @@
 			sureBtnClick: function(){
 				var val = $("#searchForm select[name=cate1No]").val();
 				var cateNo = '';
+				var brandGroupNo = '';
 				if(val.split(',')[1]=='Y'){
 					cateNo = val.split(',')[0];
 				}else{
 					cateNo = $("#searchForm select[name=cate2No]").val().split(',')[0];
 				}
+				if(cateNo=='1711' || cateNo=='1721'){
+					brandGroupNo = $("#searchForm").find("input[name=brandGroupNo]").val();
+				}
 				var contentsLocArr = [];
 				$("input:hidden[name=contentsLoc]").each(function(){
 					contentsLocArr.push($(this).val());
@@ -701,6 +749,7 @@
 
 				var data = { contentsLocArr : contentsLocArr
 					,cateNo : cateNo
+					,brandGroupNo : brandGroupNo
 				};
 				var jsonData = JSON.stringify(data);
 				gagajf.ajaxJsonSubmit('/display/contents/save', jsonData);

+ 8 - 5
src/main/webapp/WEB-INF/views/display/MainMultiContentsPopupForm.html

@@ -123,7 +123,7 @@
 				html += '<tr>';
 				html += '<th>브랜드코드</th>';
 				html += '<td colspan="3"><input type="text" name="brandGroupNo" style="width:30%;" value="' + result[i].brandGroupNo + '">';
-				html += '<button type="button" class="btn btnRight btn-success btn-lg" onclick="fnGetBrandGroup();">브랜드조회</button>';
+				html += '<button type="button" class="btn btnRight btn-success btn-lg" onclick="fnGetBrandGroup(this);">브랜드조회</button>';
 				html += '</td>';
 				html += '</tr>';
 				html += fnAddBrandImgRow(result[i].brandGroupImg);
@@ -145,6 +145,7 @@
 		}
 		$("#multiPopSortable").append(html);
 		$("#multiPopSortable").sortable();
+		$(".itemWrap").sortable();
 		$('.schDate').datepicker("destroy");
 		$('.schDate').datepicker({
 			changeMonth: true,
@@ -239,7 +240,7 @@
 			html += '<tr>';
 			html += '<th>브랜드코드</th>';
 			html += '<td colspan="3"><input type="text" name="brandGroupNo" style="width:30%;">';
-			html += '<button type="button" class="btn btnRight btn-success btn-lg" onclick="fnGetBrandGroup();">브랜드조회</button>';
+			html += '<button type="button" class="btn btnRight btn-success btn-lg" onclick="fnGetBrandGroup(this);">브랜드조회</button>';
 			html += '</td>';
 			html += '</tr>';
 			html += '<tr name="brandImgRow">';
@@ -317,13 +318,15 @@
 	/**
 	 * 브랜드그룹 조회
 	 */
-	var fnGetBrandGroup = function (){
-		console.log('fnGetBrandGroup');
+	var tblNm;
+	var fnGetBrandGroup = function (obj){
+		tblNm = $(obj).closest("table").attr('id');
+		//console.log('tblNm:::::'+tblNm);
 		cfnOpenBrandGroupListPopup("callBackBrandGroup", "S", "S");
 	}
 
 	var callBackBrandGroup = function (result){
-		$("#multiPopSortable input[name=brandGroupNo]").val(result[0].brandGroupNo);
+		$("#"+tblNm).find("input[name=brandGroupNo]").val(result[0].brandGroupNo);
 	}
 
 	/**

+ 3 - 3
src/main/webapp/WEB-INF/views/marketing/PlanDetailPopupForm.html

@@ -158,7 +158,7 @@
 						<th>PC 메인 이미지<i id="pMimgStar"></i><br/>[삭제여부<label class="chkBox"><input type="checkbox" name="orgMainPimgDelYn" value="Y"/></label>]</th>
 						<td>
 							<div th:if=*{mainPimg} id="mainPimgView" style="float:left;">
-								<img id="PreMainPimgUrl" th:src="${@environment.getProperty('upload.image.view') + '/planning/'} + *{mainPimg}" style="max-width:720px;"/>
+								<img id="PreMainPimgUrl" th:src="${@environment.getProperty('upload.image.view')} + *{mainPimg}" style="max-width:720px;"/>
 							</div>
 						</td>
 						<td colspan="4">
@@ -174,7 +174,7 @@
 						<th>모바일 메인 이미지<i id="mMimgStar"></i><br/>[삭제여부<label class="chkBox"><input type="checkbox" name="orgMainMimgDelYn" value="Y"/></label>]</th>
 						<td>
 							<div th:if=*{mainMimg} id="imgFileView" style="float:left;">
-								<img id="PreMainMimgUrl" th:src="${@environment.getProperty('upload.image.view') + '/planning/'} + *{mainMimg}" style="max-width:720px;"/>
+								<img id="PreMainMimgUrl" th:src="${@environment.getProperty('upload.image.view')} + *{mainMimg}" style="max-width:720px;"/>
 							</div>
 						</td>
 						<td colspan="4">
@@ -223,7 +223,7 @@
 						<th>댓글이미지<br/>[삭제여부<label class="chkBox"><input type="checkbox" name="orgReplyImgDelYn" value="Y"/></label>]</th>
 						<td>
 							<div th:if=*{replyImg} id="replyImgView" style="float:left;">
-								<img id="replyImgUrl" th:src="${@environment.getProperty('upload.image.view') + '/planning/'} + *{replyImg}" style="max-width:720px;"/>
+								<img id="replyImgUrl" th:src="${@environment.getProperty('upload.image.view')} + *{replyImg}" style="max-width:720px;"/>
 							</div>
 						</td>
 						<td colspan="5">

+ 1 - 1
src/main/webapp/WEB-INF/views/marketing/PlanTemplatePopupForm.html

@@ -2146,7 +2146,7 @@ $(document).ready(function() {
 					$('#planTemplateForm input[name=goodsPlanContSq'+(i+1)+']').val(goodsList[i].planContSq);
 					$('#planTemplateForm input[name=goodsPlanContItemSq'+(i+1)+']').val(goodsList[i].planContItemSq);
 					
-					if (goodsList[0].dispYn == 'Y') {
+					if (goodsList[i].dispYn == 'Y') {
 						$('#planTemplateForm input:checkbox[name=goodsDispYn'+(i+1)+']').prop('checked', true);
 					}
 					

+ 6 - 3
src/main/webapp/ux/js/admin.popup.js

@@ -472,8 +472,9 @@ var cfnOpenGoodsQnaDetailPopup = function(counselSq) {
  * @since  : 2020/02/25
  * @author : sasa004
  */
-var cfnOpenMainContentsPopup = function(cateNo, contentsLoc) {
+var cfnOpenMainContentsPopup = function(cateNo, contentsLoc, brandGroupNo) {
 	var actionUrl = "/display/main/contents/popup/form?cateNo="+cateNo+"&contentsLoc=" + contentsLoc;
+	if (typeof(brandGroupNo) != 'undefined') actionUrl += "&brandGroupNo=" + brandGroupNo;
 	uifnPopupClose('popupMainContents');
 	cfnOpenModalPopup(actionUrl, 'popupMainContents');
 }
@@ -887,8 +888,9 @@ var cfnOpenGoodsDispOrdChangePopup = function(callbackfun, params) {
  * @since  : 2021/02/24
  * @author : bin2107
  */
-var cfnOpenMainMultiContentsPopup = function(cateNo, contentsLoc) {
+var cfnOpenMainMultiContentsPopup = function(cateNo, contentsLoc, brandGroupNo) {
 	var actionUrl = "/display/main/multicontents/popup/form?cateNo="+cateNo+"&contentsLoc=" + contentsLoc;
+	if (typeof(brandGroupNo) != 'undefined') actionUrl += "&brandGroupNo=" + brandGroupNo;
 	//uifnPopClose('popupMainMultiContents');
 	cfnOpenModalPopup(actionUrl, 'popupMainMultiContents');
 }
@@ -943,7 +945,8 @@ var cfnOpenLookbookBannerPickerPopup = function(lookbookbSq, imgNm) {
  * @since  : 2021/03/10
  * @author : bin2107
  */
-var cfnOpenMainGnbContentsPopup = function(cateNo, contentsLoc) {
+var cfnOpenMainGnbContentsPopup = function(cateNo, contentsLoc, brandGroupNo) {
 	var actionUrl = "/display/main/gnbcontents/popup/form?cateNo="+cateNo+"&contentsLoc=" + contentsLoc;
+	if (typeof(brandGroupNo) != 'undefined') actionUrl += "&brandGroupNo=" + brandGroupNo;
 	cfnOpenModalPopup(actionUrl, 'popupMainGnbContents');
 }