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

재입고알림 - 복수상품코드조회

eskim 4 лет назад
Родитель
Сommit
e95faa9652

+ 10 - 0
src/main/java/com/style24/admin/biz/web/TsaGoodsController.java

@@ -1991,6 +1991,16 @@ public class TsaGoodsController extends TsaBaseController {
 
 		GagaMap result = new GagaMap();
 
+		// multi row 검색관련 처리
+		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
+			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").trim().split("\n"));
+
+			if ("searchExtendGoodsCd".equals(goodsSearch.getSearch())) {
+				goodsSearch.setSearchGb("EXTEND");
+			} else if ("searchMasterGoodsCd".equals(goodsSearch.getSearch())) {
+				goodsSearch.setSearchGb("MASTER");
+			}
+		}
 		goodsSearch.setPageable(new TscPageRequest(goodsSearch.getPageNo() - 1, goodsSearch.getPageSize()));
 		goodsSearch.getPageable().setTotalCount(goodsService.getReinboundInformCount(goodsSearch));
 

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

@@ -3608,6 +3608,24 @@
 				</when>
 		    </choose>
 		</if>
+		<if test='conditionList != null and conditionList.length>0'>
+		    <choose>
+		      <when test='search != null and search == "searchGoodsCd"'>
+		AND (
+		      <foreach collection="conditionList" item="item" index="index" separator="or">
+		       G.GOODS_CD LIKE CONCAT(UPPER(#{item}),'%') 
+		      </foreach>
+		     )
+		      </when>
+		      <otherwise>
+		AND (
+		      <foreach collection="conditionList" item="item" index="index" separator="or">
+		       UPPER(G.GOODS_NM) LIKE CONCAT(UPPER(#{item}),'%') 
+		      </foreach>
+		     )
+		      </otherwise>
+		    </choose>
+		</if>
 		<if test='dateGbn != null and dateGbn == "reqDt"'>
 		    <if test="stDate != null and stDate != ''">
 		AND IA.REQ_DT >= DATE_FORMAT(#{stDate}, '%Y-%m-%d %H:%i:%S')
@@ -3687,14 +3705,22 @@
 		              <if test='alarmYn != null and alarmYn == "N"'>
 		              AND IA.INFORM_DT IS NULL
 		              </if>
-		              <if test='condition != null and condition != "" '>
+		              <if test='conditionList != null and conditionList.length>0'>
 		                  <choose>
-		                      <when test='search != null and search == "searchGoodsNm"'>
-		              AND UPPER(G.GOODS_NM) LIKE  CONCAT(UPPER(#{condition}),'%')
-		                      </when>
-		                      <when test='search != null and search == "searchGoodsCd"'>
-		              AND G.GOODS_CD LIKE  CONCAT(UPPER(#{condition}),'%')
-		                      </when>
+		                    <when test='search != null and search == "searchGoodsCd"'>
+		              AND (
+		                    <foreach collection="conditionList" item="item" index="index" separator="or">
+		                     G.GOODS_CD LIKE CONCAT(UPPER(#{item}),'%') 
+		                    </foreach>
+		                   )
+		                    </when>
+		                    <otherwise>
+		              AND (
+		                    <foreach collection="conditionList" item="item" index="index" separator="or">
+		                     UPPER(G.GOODS_NM) LIKE CONCAT(UPPER(#{item}),'%') 
+		                    </foreach>
+		                   )
+		                    </otherwise>
 		                  </choose>
 		              </if>
 		              <if test='dateGbn != null and dateGbn == "reqDt"'>

+ 23 - 42
src/main/webapp/WEB-INF/views/goods/GoodsReinboundInformForm.html

@@ -33,15 +33,15 @@
 				<table class="frmStyle">
 					<colgroup>
 						<col width="10%"/>
-						<col width="30%"/>
+						<col width="28%"/>
 						<col width="10%"/>
-						<col width="20%"/>
+						<col width="25%"/>
 						<col width="10%"/>
 						<col/>
 					</colgroup>
 					<tr>
 						<th>업체/브랜드</th>
-						<td>
+						<td colspan="3">
 							<select name="supplyCompCd" id="supplyCompCd">
 								<option value="" th:if="${sessionInfo.roleCd} != 'G001_B000'">[전체]</option>
 								<option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
@@ -50,18 +50,19 @@
 								<option value="">[전체]</option>
 							</select>
 						</td>
-						<th>키워드</th>
-						<td>
+						<th rowspan="3">키워드</th>
+						<td rowspan="3">
 							<select name="search" id="search">
 								<option value="searchGoodsCd">상품코드</option>
 								<option value="searchGoodsNm">상품명</option>
-<!-- 								<option value="searchColorNm">색상명</option>
-								<option value="searchSizeNm">사이즈명명</option>
- -->							</select>
-							<input type="text" class="w50p" name="condition" id="condition" maxlength="50"/>
+ 							</select>
+							<textarea class="textareaR3 w60p" name="condition" id="condition"></textarea>
 						</td>
+						
+					</tr>
+					<tr>
 						<th>발송여부</th>
-						<td>
+						<td colspan="3">
 							<select id="alarmYn" name="alarmYn">
 								<option value="">[전체]</option>
 								<option value="N">미발송</option>
@@ -71,28 +72,28 @@
 					</tr>
 					<tr>
 						<th>카테고리</th>
-						<td colspan="5">
+						<td colspan="3">
 							<input name="siteCd" id="siteCd" type="hidden" value="G000_10"/>
 							<input name="selLvl" id="selLvl" type="hidden"/>
 							<input name="cateNo" id="cateNo" type="hidden"/>
 							<input name="cateType" id="cateType" type="hidden"/>
-							<select name="cateGb" id="selCate1" onchange="fnChangeSelect($(this).val(), 2);">
+							<select name="cateGb" id="cateGb" onchange="fnChangeSelect($(this).val(), 1);">
 								<option value="">[카테고리구분]</option>
 								<option th:if="${cateGbList}" th:each="oneData, status : ${cateGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
 							</select>
-							<select id="selCate2" name="cate1No" onchange="fnChangeSelect($(this).val(), 3);">
+							<select id="selCate1" name="cate1No" onchange="fnChangeSelect($(this).val(), 2);">
 								<option value="">[카테고리1]</option>
 							</select>
-							<select id="selCate3" name="cate2No" onchange="fnChangeSelect($(this).val(), 4);">
+							<select id="selCate2" name="cate2No" onchange="fnChangeSelect($(this).val(), 3);">
 								<option value="">[카테고리2]</option>
 							</select>
-							<select id="selCate4" name="cate3No" onchange="fnChangeSelect($(this).val(), 5);">
+							<select id="selCate3" name="cate3No" onchange="fnChangeSelect($(this).val(), 4);">
 								<option value="">[카테고리3]</option>
 							</select>
-							<select id="selCate5" name="cate4No" onchange="fnChangeSelect($(this).val(), 6);">
+							<select id="selCate4" name="cate4No" onchange="fnChangeSelect($(this).val(), 5);">
 								<option value="">[카테고리4]</option>
 							</select>
-							<select id="selCate6" name="cate5No" onchange="fnChangeSelect($(this).val(), 7);">
+							<select id="selCate5" name="cate5No" >
 								<option value="">[카테고리5]</option>
 							</select>
 						</td>
@@ -300,26 +301,9 @@
 
 	var fnChangeSelect = function(val, selLvl){
 		$("#cateNo").val('');
-		/* $('#cate1No').val('');
-		$('#cate2No').val('');
-		$('#cate3No').val('');
-		$('#cate4No').val('');
-		$('#cate5No').val(''); */
-		if(val==''){
-			if(selLvl>1){
-				selLvl = selLvl - 1;
-				if(selLvl>2){
-					$("#cateNo").val($("#selCate"+(selLvl-1)).val());
-				}
-			}else{
-				selLvl = '';
-			}
-		}else{
-			if(selLvl>2){
-				$("#cateNo").val(val);
-			}
+		if (1 < selLvl){ //상품검색용 카테고리 설정
+			$("#cateNo").val(val);
 		}
-		
 		$("#searchForm input[name=selLvl]").val(selLvl);
 		$("#searchForm input[name=searchGb]").val("BASIC");
 		gagajf.ajaxFormSubmit('/display/category/list', "#searchForm", fnChangeCategory);
@@ -328,7 +312,7 @@
 	var fnChangeCategory = function(data){
 		var selLvl = $("#searchForm input[name=selLvl]").val();
 		var html = '<option value="">[선택]</option>';
-		for(var i=1; i<7; i++){
+		for(var i=1; i<6; i++){
 			if(i>selLvl){
 				$("#selCate"+i).html(html);
 			}
@@ -337,14 +321,11 @@
 			var cd = '';
 			var nm = '';
 			if(data[i].useYn=='Y'){
-				if(selLvl=='1'){
-					cd = data[i].cateGb;
-					nm = gagaAgGrid.lookupValue(cateGbList, cd);
-				}else{
+				
 					cd = data[i].cateNo;
 					nm = data[i].cateNm;
 					$("#cateType").val(data[i].cateType);
-				}
+				
 				html += '<option value="'+cd+'">['+cd+'] '+nm+'</option>';
 			}
 		}