Explorar o código

브랜드그룹관리에서 카테고리 설정관련 추가

eskim %!s(int64=5) %!d(string=hai) anos
pai
achega
9b7a57ba3d

+ 33 - 0
src/main/java/com/style24/admin/biz/service/TsaBusinessService.java

@@ -14,12 +14,14 @@ import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.style24.admin.biz.dao.TsaBusinessDao;
 import com.style24.admin.support.security.session.TsaSession;
+import com.style24.core.support.env.TscConstants;
 import com.style24.core.support.message.TscMessageByLocale;
 import com.style24.persistence.domain.Aflink;
 import com.style24.persistence.domain.Bizday;
 import com.style24.persistence.domain.Brand;
 import com.style24.persistence.domain.BrandGroup;
 import com.style24.persistence.domain.BrandMd;
+import com.style24.persistence.domain.Category;
 import com.style24.persistence.domain.DeliveryLoc;
 import com.style24.persistence.domain.DelvFeePolicy;
 import com.style24.persistence.domain.SellStore;
@@ -51,6 +53,14 @@ public class TsaBusinessService {
 
 	@Autowired
 	private TsaBusinessDao businessDao;
+	
+	@Autowired
+	private TsaCommonService commonService;
+	
+	@Autowired
+	private TsaDisplayService displayService;
+	
+	
 
 	/**
 	 * 공급벤더 목록
@@ -471,12 +481,35 @@ public class TsaBusinessService {
 			brandGroup.setLogoFileNm(brandImgName);
 
 		}
+		
+		// 별도 카테고리 선택시 카테고리 생성
+		if ("N".equals(brandGroup.getDefaultCateYn()) && brandGroup.getBrandCateNo() <= 0) {
+			
+			
+			Category category = new Category();
+			
+			category.setSiteCd(TscConstants.Site.STYLE24.value());
+			category.setCateGb("G032_102");  //by brand
+			category.setCate1No(commonService.getNextSequence("SEQ_CATE"));
+			category.setCate1Nm(brandGroup.getBrandGroupKnm());
+			category.setCateType("G031_10");  // 상품분류카테고리
+			category.setLeafYn("Y");
+			category.setDispOrd(1);
+			category.setFormalGb("G009_10");	// 정상
+			category.setDispYn("Y");
+			category.setUseYn("Y");
+			displayService.saveCategory1(category);
+			
+			brandGroup.setBrandCateNo(category.getCate1No());
+		}
 
 		if (brandGroup.getMode().equals("N")) { // 신규
 			businessDao.createBrandGroup(brandGroup);
 		} else { // 수정
 			businessDao.updateBrandGroup(brandGroup);
 		}
+		
+
 	}
 
 	/**

+ 34 - 11
src/main/java/com/style24/admin/biz/service/TsaDisplayService.java

@@ -1,22 +1,31 @@
 package com.style24.admin.biz.service;
 
-import com.gagaframework.web.util.GagaDateUtil;
-import com.gagaframework.web.util.GagaFileUtil;
-import com.style24.admin.biz.dao.TsaDisplayDao;
-import com.style24.admin.support.security.session.TsaSession;
-import com.style24.persistence.domain.*;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.util.StringUtils;
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cache.annotation.CacheEvict;
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
+import com.style24.admin.biz.dao.TsaDisplayDao;
+import com.style24.admin.support.security.session.TsaSession;
+import com.style24.persistence.domain.Category;
+import com.style24.persistence.domain.CategoryGoods;
+import com.style24.persistence.domain.Contents;
+import com.style24.persistence.domain.GnbTab;
+import com.style24.persistence.domain.Goods;
+import com.style24.persistence.domain.GoodsCategory;
+import com.style24.persistence.domain.ItemkindCategory;
+import com.style24.persistence.domain.MainDisplay;
+
+import lombok.extern.slf4j.Slf4j;
+
+import com.gagaframework.web.util.GagaDateUtil;
+import com.gagaframework.web.util.GagaFileUtil;
 
 /**
  * 전시 Service
@@ -94,6 +103,20 @@ public class TsaDisplayService {
 		}
 	}
 
+	/**
+	 * 카테고리  1뎁스 저장(브랜드그룹관리에서 사용)
+	 * @param category - 카테고리 정보
+	 * @author eskim
+	 * @since 2021. 4. 13
+	 */
+	@Transactional("shopTxnManager")
+	public void saveCategory1(Category category) {
+		category.setRegNo(TsaSession.getInfo().getUserNo());
+		category.setUpdNo(TsaSession.getInfo().getUserNo());
+		displayDao.saveCategory1(category);
+	}
+		
+	
 	/**
 	 * 카테고리 갱신
 	 * @author gagamel

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

@@ -24,6 +24,8 @@ public class BrandGroup extends TscBaseDomain {
 	private String logoFileNm;		// 로고파일명
 	private int dispOrd;			// 표시순서
 	private String useYn;			// 사용여부(Y:사용)
+	private String defaultCateYn;	// 기본전시카테고리사용여부(N:별도카테고리)
+	private int brandCateNo;		// 카테고리번호
 
 	private String newSysFileNm;	//신규이미지파일명
 

+ 10 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaBusiness.xml

@@ -1042,6 +1042,8 @@
 		     , A.LOGO_FILE_NM
 		     , A.RGB_CD
 		     , A.DISP_ORD
+		     , A.DEFAULT_CATE_YN
+		     , A.BRAND_CATE_NO
 		     , (CASE WHEN DISP_NM_LANG = 'EN' THEN BRAND_GROUP_ENM ELSE BRAND_GROUP_KNM END) AS BRAND_GROUP_NM
 		FROM   TB_BRAND_GROUP A
 		WHERE 1 = 1
@@ -1075,6 +1077,8 @@
 		     , DISP_NM_LANG
 		     , RGB_CD
 		     , LOGO_FILE_NM
+		     , DEFAULT_CATE_YN
+		     , BRAND_CATE_NO
 		     , REG_NO
 		     , REG_DT
 		     , UPD_NO
@@ -1092,6 +1096,8 @@
 		     , #{dispNmLang}
 		     , IFNULL(NULLIF(#{rgbCd},''),'222222')
 		     , #{logoFileNm}
+		     , #{defaultCateYn}
+		     , #{brandCateNo}
 		     , #{regNo}
 		     , NOW()
 		     , #{updNo}
@@ -1108,6 +1114,10 @@
 		     , DISP_NM_LANG = #{dispNmLang}
 		     , RGB_CD = IFNULL(NULLIF(#{rgbCd},''),'222222')
 		     , LOGO_FILE_NM = #{logoFileNm}
+		     , DEFAULT_CATE_YN = IFNULL(#{defaultCateYn},'Y')
+		     <if test="brandCateNo != null and brandCateNo > 0">
+		     , BRAND_CATE_NO =  #{brandCateNo}
+		     </if>
 		     , UPD_NO = #{updNo}
 		     , UPD_DT = NOW()
 		WHERE  BRAND_GROUP_NO = #{brandGroupNo}

+ 14 - 7
src/main/webapp/WEB-INF/views/business/BrandGroupPopupForm.html

@@ -14,7 +14,7 @@
  * 1.0  2021.02.19   eskim       최초 작성
  *******************************************************************************
  -->
-<div class="modalPopup" data-width="900" id="popupBrandGroup">
+<div class="modalPopup" data-width="900" data-height="870" id="popupBrandGroup">
 	<div class="panelStyle">
 		<!-- TITLE -->
 		<div class="panelTitle">
@@ -102,6 +102,13 @@
 						<span class="marL10 cRed"><i class="fa fa-info-circle" aria-hidden="true"></i> 브랜드메인 GBN 배경색으로 적용, 미 입력시 기본색상(222222)으로 설정됩니다.</span>
 					</td>
 				</tr>
+				<tr>
+					<th>카테고리사용</th>
+					<td  colspan="3">
+						<label class="rdoBtn"><input type="radio" name="defaultCateYn" value="Y" checked="checked">기본카테고리(BY ITEM)</label>
+						<label class="rdoBtn"><input type="radio" name="defaultCateYn" value="N">별도카테고리</label><input type="text" class="w100 aL"  name="brandCateNo" disabled="disabled"/><span class="marL10 cRed"><i class="fa fa-info-circle" aria-hidden="true"></i> [전시>카테고리관리] 에서 수동 설정할수 있습니다</span>
+					</td>
+				</tr>
 				<tr style="height:100px">
 					<th>브랜드이미지</th>
 					<td colspan="3">
@@ -142,10 +149,10 @@
 				return '<a href="javascript:void(0);">' + params.value + '</a>';
 			}
 		},
-		{headerName: "브랜드그룹국문명", field: "brandGroupKnm", width: 150, cellClass: 'text-center'},
-		{headerName: "브랜드그룹영문명", field: "brandGroupEnm", width: 150, cellClass: 'text-center'},
-		{headerName: "전시브랜드그룹명", field: "brandGroupNm", width: 150, cellClass: 'text-center'},
-		{headerName: "브랜드로고파일명", field: "logoFileNm", width: 150, cellClass: 'text-center', hide:true}
+		{headerName: "브랜드그룹국문명", field: "brandGroupKnm", width: 200, cellClass: 'text-center'},
+		{headerName: "브랜드그룹영문명", field: "brandGroupEnm", width: 200, cellClass: 'text-center'},
+		{headerName: "전시브랜드그룹명", field: "brandGroupNm", width: 200, cellClass: 'text-center'},
+		{headerName: "브랜드로고파일명", field: "logoFileNm", width: 200, cellClass: 'text-center', hide:true}
 	];
 
 	let gridOptionsBrandGroupList = gagaAgGrid.getGridOptions(columnDefsMdList);
@@ -167,8 +174,8 @@
 		$("#brandGroupForm input[name=brandGroupKnm]").val(event.data.brandGroupKnm);
 		$("#brandGroupForm input:radio[name=dispNmLang]:input[value=" + event.data.dispNmLang + "]").click();
 		$("#brandGroupForm input[name=rgbCd]").val(event.data.rgbCd);
-		//$("#brandGroupForm input:radio[name=useYn]:input[value=" + event.data.useYn + "]").click();
-		//$("#brandGroupForm input[name=dispOrd]").val(event.data.dispOrd);
+		$("#brandGroupForm input:radio[name=defaultCateYn]:input[value=" + event.data.defaultCateYn + "]").click();
+		$("#brandGroupForm input[name=brandCateNo]").val(event.data.brandCateNo);
 		
 		 var brandImg = event.data.logoFileNm;
 		if(!gagajf.isNull(brandImg)){