eskim 5 лет назад
Родитель
Сommit
4747fac2ce

+ 2 - 1
src/main/java/com/style24/admin/biz/service/TsaBusinessService.java

@@ -449,7 +449,7 @@ public class TsaBusinessService {
 			String brandImgName = "BRAND_" + brandGroup.getBrandGroupNo() + "_" + GagaDateUtil.getTodayDateTime() + "." + StringUtils.getFilenameExtension(brandGroup.getNewSysFileNm());
 
 			String brandUploadPath = env.getProperty("upload.default.target.path");
-			brandUploadPath = GagaFileUtil.getConcatenationPath(brandUploadPath, "display");
+			brandUploadPath = GagaFileUtil.getConcatenationPath(brandUploadPath, "contents", "brand");
 
 			//기존이미지 삭제
 			try {
@@ -467,6 +467,7 @@ public class TsaBusinessService {
 			// Rename a file
 			file.renameTo(uniqueFile);
 
+			brandImgName = "/contents/brand/" + brandImgName;
 			brandGroup.setLogoFileNm(brandImgName);
 
 		}

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

@@ -1088,7 +1088,7 @@
 		     , #{brandGroupEnm}
 		     , #{brandGroupKnm}
 		     , #{dispNmLang}
-		     , #{rgbCd}
+		     , IFNULL(NULLIF(#{rgbCd},''),'222222')
 		     , #{logoFileNm}
 		     , #{regNo}
 		     , NOW()
@@ -1104,7 +1104,7 @@
 		SET    BRAND_GROUP_ENM = #{brandGroupEnm}
 		     , BRAND_GROUP_KNM = #{brandGroupKnm}
 		     , DISP_NM_LANG = #{dispNmLang}
-		     , RGB_CD = #{rgbCd}
+		     , RGB_CD = IFNULL(NULLIF(#{rgbCd},''),'222222')
 		     , LOGO_FILE_NM = #{logoFileNm}
 		     , UPD_NO = #{updNo}
 		     , UPD_DT = NOW()

+ 19 - 15
src/main/webapp/WEB-INF/views/business/BrandGroupPopupForm.html

@@ -25,7 +25,7 @@
 		
 		<!-- 검색 조건 -->
 		<div class="panelContent" >
-		<form id="searchBrandGroupForm" name="searchBrandGroupForm" action="#" th:action="@{'/business/brand/group/list'}" onsubmit="$('#btnSearchBrandGroup').trigger('click'); return false;">
+		<form id="searchBrandGroupForm" name="searchBrandGroupForm" action="#" th:action="@{'/business/brand/group/list'}" >
 			
 			<table class="frmStyle" aria-describedby="검색조건">
 				<colgroup>
@@ -96,10 +96,10 @@
 					</td>
 				</tr>
 				<tr>
-					<th>RGB코드<i class="required" title="필수"></i></th>
+					<th>RGB코드</th>
 					<td  colspan="3">
-						<input type="text" class="w100 aR" name="rgbCd" maxlength="6" data-valid-name="REG코드" />
-						<!-- <span class="marL10 cRed"><i class="fa fa-info-circle" aria-hidden="true"></i> 브랜드메인 GBN 배경색으로 적용, 미 입력시 기본색상으로 설정됩니다.</span> -->
+						<input type="text" class="w100 aR" name="rgbCd" maxlength="6" data-valid-name="REG코드" value="222222"/>
+						<span class="marL10 cRed"><i class="fa fa-info-circle" aria-hidden="true"></i> 브랜드메인 GBN 배경색으로 적용, 미 입력시 기본색상(222222)으로 설정됩니다.</span>
 					</td>
 				</tr>
 				<tr style="height:100px">
@@ -112,9 +112,9 @@
 							<input type="hidden" name="sysFileNm" id="sysFileNm"/>
 							<input type="hidden" name="newSysFileNm" id="newSysFileNm"/>
 						</div>
-						<input type="hidden" name="uploadDefaultUrl" id="uploadDefaultUrl" th:value="${@environment.getProperty('upload.default.view') + '/display/'}"/>
+						<input type="hidden" name="uploadDefaultUrl" id="uploadDefaultUrl" th:value="${@environment.getProperty('upload.default.view')}"/>
 						<span id="imgView" class="off">
-							<img id="bannerPreViewUrl" src="" style="height:100px"/>
+							<img id="bannerPreViewUrl" src="" style="width:100px"/>
 						</span>
 					</td>
 				</tr>
@@ -178,6 +178,8 @@
 			$("#logoFileNm").val('');
 			$("#orgFileNm").val('');
 			$("#bannerPreViewUrl").attr('src', '');
+			$("#imgView").removeClass("on").addClass("off");
+			
 		}
 		$('#brandGroupForm input[name=file]').closest('div').find('label').text('파일선택'); 
 		
@@ -186,10 +188,10 @@
 	// 조회
 	$('#btnSearchBrandGroup').on('click', function() {
 		
-		if (gagajf.isNull($('#searchBrandGroupForm textarea[name=searchBrandGroupNo]').val())  && gagajf.isNull($('#searchBrandGroupForm textarea[name=searchBrandGroupNm]').val())){
-			mcxDialog.alert('검색조건을 입력하세요.');
-			return false;
-		}
+		//if (gagajf.isNull($('#searchBrandGroupForm textarea[name=searchBrandGroupNo]').val())  && gagajf.isNull($('#searchBrandGroupForm textarea[name=searchBrandGroupNm]').val())){
+		//	mcxDialog.alert('검색조건을 입력하세요.');
+		//	return false;
+		//}
 		
 		// Fetch data
 		gagaAgGrid.fetch($('#searchBrandGroupForm').prop('action'), gridOptionsBrandGroupList, '#searchBrandGroupForm');
@@ -237,12 +239,12 @@
 			return;
 		}
 		
-		gagajf.ajaxFileUpload('/common/file/upload?subDir=/display'
+		gagajf.ajaxFileUpload('/common/file/upload?subDir=/contents'
 				, file
 				, function(result) {
 					$('#brandGroupForm input[name=newSysFileNm]').val(result.newFileName);
 					$('#brandGroupForm input[name=sysFileNm]').val(result.newFileName);
-					$("#bannerPreViewUrl").attr('src', $("#uploadDefaultUrl").val()+result.newFileName);
+					$("#bannerPreViewUrl").attr('src', $("#uploadDefaultUrl").val()+"/contents/brand/"+result.newFileName);
 					$("#imgView").removeClass("off").addClass("on");
 				}
 				, 'image'
@@ -256,7 +258,7 @@
 			return false;
 		
 		// RGB 체크
-		if (!gagajf.isNull($('#brandGroupForm input[name=rgbCd]')) ){
+		if (!gagajf.isNull($('#brandGroupForm input[name=rgbCd]').val()) ){debugger;
 			
 			var rgbCd = $('#brandGroupForm input[name=rgbCd]').val();
 			if (rgbCd.indexOf('#') >= 0){
@@ -297,9 +299,11 @@
 	$("#btnBrandGroupNew").on("click", function() {
 		$("#brandGroupForm")[0].reset();
 		$("#brandGroupForm input[name=mode]").val("N");
-		$("#orgFileNm").val('');
 		$("#bannerPreViewUrl").attr('src', '');
-		$("#logoFileNm").val('');
+		$('#brandGroupForm input[name=newSysFileNm]').val('');
+		$('#brandGroupForm input[name=sysFileNm]').val('');
+		$('#brandGroupForm input[name=logoFileNm]').val('');
+		$("#imgView").removeClass("on").addClass("off");
 	});
 	
 	$(document).ready(function() {