소스 검색

Merge branch 'develop' into bin2107

bin2107 5 년 전
부모
커밋
21c4d95e9f

+ 1 - 0
pom.xml

@@ -17,6 +17,7 @@
 		<dependency>
 			<groupId>com.style24.core</groupId>
 			<artifactId>style24-core</artifactId>
+			<version>0.0.1</version>
 		</dependency>
 		<!--// Maven module core -->
 		

+ 6 - 1
src/main/java/com/style24/admin/biz/web/TsaBusinessController.java

@@ -309,6 +309,11 @@ public class TsaBusinessController extends TsaBaseController {
 	@PostMapping("/brand/list")
 	@ResponseBody
 	public Collection<Brand> getBrandList(@RequestBody Brand brand) {
+
+		// multi row 검색관련 처리
+		if (!StringUtils.isBlank(brand.getSearchBrandCd())) brand.setMultiBrandCd(brand.getSearchBrandCd().replaceAll("\r", "").split("\n"));
+		if (!StringUtils.isBlank(brand.getSearchBrandNm())) brand.setMultiBrandNm(brand.getSearchBrandNm().replaceAll("\r", "").split("\n"));
+
 		return businessService.getBrandList(brand);
 	}
 
@@ -698,7 +703,7 @@ public class TsaBusinessController extends TsaBaseController {
 		ModelAndView mav = new ModelAndView();
 
 		mav.addObject("params", brand);
-		mav.setViewName("business/BrandSearchPopupForm");
+		mav.setViewName("business/BrandPopupForm");
 		return mav;
 	}
 

+ 12 - 0
src/main/java/com/style24/persistence/domain/Brand.java

@@ -2,6 +2,7 @@ package com.style24.persistence.domain;
 
 import java.util.Collection;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.style24.persistence.TscBaseDomain;
 
 import lombok.Data;
@@ -52,4 +53,15 @@ public class Brand extends TscBaseDomain {
 	private String searchTxt;		// 검색어
 	private String callbackFn;		// 콜백함수
 	private String multiGb;			// 멀티 셀렉트 구분
+	private String searchBrandCd;
+	private String searchBrandNm;
+
+	/* 브랜드검색 Multi CheckBox 항목*/
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiBrandCd;
+
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiBrandNm;
+	/* 브랜드검색 Multi CheckBox 항목*/
+
 }

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

@@ -505,16 +505,24 @@
 		<if test='brandCd != null and brandCd != ""'>
 		AND    A.BRAND_CD = #{brandCd}
 		</if>
-		<if test='searchTxt != null and searchTxt != ""'>
-		AND    (
-		        A.BRAND_CD LIKE CONCAT('%',#{searchTxt},'%')
-		        OR
-		        UPPER(A.BRAND_ENM) LIKE CONCAT('%',UPPER(#{searchTxt}),'%')
-		        OR
-		        UPPER(A.BRAND_KNM) LIKE CONCAT('%',UPPER(#{searchTxt}),'%')
-		        OR
-		        UPPER(A.BRAND_GRP_NM) LIKE CONCAT('%',UPPER(#{searchTxt}),'%')
-		       )
+		<if test="multiBrandCd != null and multiBrandCd.length > 0">
+		AND    A.BRAND_CD IN
+		    <foreach collection="multiBrandCd" item="item" index="index"  open="(" close=")" separator=",">
+		UPPER(#{item})
+		    </foreach>
+		</if>
+		<if test="multiBrandNm != null and multiBrandNm.length > 0">
+		AND (
+		    <foreach collection="multiBrandNm" item="item" index="index" separator="or">
+		    (
+		    UPPER(A.BRAND_ENM) LIKE CONCAT('%',UPPER(#{item}),'%')
+		    OR
+		    UPPER(A.BRAND_KNM) LIKE CONCAT('%',UPPER(#{item}),'%')
+		    OR
+		    UPPER(A.BRAND_GRP_NM) LIKE CONCAT('%',UPPER(#{item}),'%')
+		    )
+		  </foreach>
+		 )
 		</if>
 		<if test='useYn != null and useYn != ""'>
 		AND    A.USE_YN = #{useYn}

+ 18 - 5
src/main/webapp/WEB-INF/views/business/BrandSearchPopupForm.html → src/main/webapp/WEB-INF/views/business/BrandPopupForm.html

@@ -3,7 +3,7 @@
 	xmlns:th="http://www.thymeleaf.org">
 <!--
  *******************************************************************************
- * @source  : BrandSearchPopupForm.html
+ * @source  : BrandPopupForm.html
  * @desc    : 브랜드 팝업 Page
  *============================================================================
  * STYLE24
@@ -14,7 +14,7 @@
  * 1.0  2020.12.15   eskim       최초 작성
  *******************************************************************************
  -->
-<div class="modalPopup" data-width="500" id="popupBrandList">
+<div class="modalPopup" data-width="700" id="popupBrandList">
 	<div class="panelStyle">
 		<!-- TITLE -->
 		<div class="panelTitle">
@@ -28,14 +28,20 @@
 			<form id="searchBrandListForm" name="searchBrandListForm" action="#" th:action="@{'/business/brand/list'}" onsubmit="$('#btnSearchBrandList').trigger('click'); return false;">
 				<table class="frmStyle" aria-describedby="검색조건">
 					<colgroup>
+						<col style="width:15%;"/>
+						<col style="width:35%;"/>
 						<col style="width:15%;"/>
 						<col/>
 					</colgroup>
 					<tbody>
 						<tr>
+							<th>브랜드코드</th>
+							<td>
+								<textarea class="textareaR3" name="searchBrandCd" id="searchBrandCd"></textarea>
+							</td>
 							<th>브랜드명</th>
 							<td>
-								<input type="text" name="searchTxt" th:value="${params.searchTxt}" maxlength="20" onkeypress="if (event.keyCode == 13) { $('#btnSearchBrandList').trigger('click'); }"/>
+								<textarea class="textareaR3" name="searchBrandNm" id="searchBrandNm"></textarea>
 							</td>
 						</tr>
 					</tbody>
@@ -71,7 +77,8 @@
 		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: headerSelection, checkboxSelection: true, filter: false},
 		{headerName: "브랜드번호", field: "brandCd", width: 120, cellClass: 'text-center'},
 		{headerName: "브랜드국문명", field: "brandEnm", width: 150, cellClass: 'text-center'},
-		{headerName: "브랜드영문명", field: "brandKnm", width: 150, cellClass: 'text-center'}
+		{headerName: "브랜드영문명", field: "brandKnm", width: 150, cellClass: 'text-center'},
+		{headerName: "브랜드그룹명", field: "brandGrpNm", width: 150, cellClass: 'text-center'}
 	];
 
 	let gridOptionsBrandList = gagaAgGrid.getGridOptions(columnDefsMdList);
@@ -84,6 +91,12 @@
 
 	// 조회
 	$('#btnSearchBrandList').on('click', function() {
+		
+		if (gagajf.isNull($('#searchBrandListForm textarea[name=searchBrandCd]').val())  && gagajf.isNull($('#searchBrandListForm textarea[name=searchBrandNm]').val())){
+			mcxDialog.alert('검색조건을 입력하세요.');
+			return false;
+		}
+		
 		// Fetch data
 		gagaAgGrid.fetch($('#searchBrandListForm').prop('action'), gridOptionsBrandList, '#searchBrandListForm');
 	});
@@ -121,7 +134,7 @@
 		// Create a agGrid
 		gagaAgGrid.createGrid('gridBrandList', gridOptionsBrandList);
 		
-		$('#btnSearchBrandList').trigger('click');
+		//$('#btnSearchBrandList').trigger('click');
 	});
 /*]]>*/
 </script>

+ 5 - 5
src/main/webapp/WEB-INF/views/goods/GoodsListForm.html

@@ -23,12 +23,12 @@
 		<!-- 메뉴 설명 -->
 		<div class="infoBox menu-desc">
 		</div>
-		<form id="searchForm" name="searchForm" action="#" th:action="@{'/goods/list'}">
+		<form id="searchForm" name="searchForm" action="#" th:action="@{'/goods/list'}" >
 		<input type="hidden" id="searchGb" name="searchGb" />
 		<input type="hidden" id="imageViewYn" name="imageViewYn" />
 		<input type="hidden" id="goodsPriceYn" name="goodsPriceYn" value="Y"/> <!-- 즉시할인판매가 조회 -->
 		
-	 		<!-- 패널 영역1 -->
+			<!-- 패널 영역1 -->
 		<div class="panelStyle" >
 			<!-- 검색조건 영역 -->
 			<!-- TITLE -->
@@ -76,7 +76,6 @@
 								<option value="searchGoodsNum">품번</option>
 								<option value="searchSupplyGoodsCd">업체상품코드</option>
 							</select>
-							<!-- <input type="text" class="w40p" name="condition" id="condition" maxlength="50"/> -->
 							<textarea class="textareaR3 w70p" name="condition" id="condition"></textarea>
 						</td>
 					</tr>
@@ -577,6 +576,8 @@
 	var fnConditionCheck = function(){
 		var formId = '#searchForm';
 		var form = document.searchForm;
+		
+		if (event.keyCode === 13) return false;
 
 		if($("#searchForm input[name=searchGb]").val() == "EXCEL") return true;
 
@@ -1086,7 +1087,7 @@
 			return false;
 		} */
 		
-		cfnOpenBrandListPopup('fnSetBrandInfo', 'S', $("#searchForm input[name=searchTxt]").val());
+		cfnOpenBrandListPopup('fnSetBrandInfo', 'M', $("#searchForm input[name=searchTxt]").val());
 		
 	});
 	
@@ -1115,5 +1116,4 @@
 /*]]>*/
 </script>
 	</div>
-
 </html>