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

상품목록 품목 복수조회처리

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

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

@@ -558,6 +558,16 @@ public class TsaGoodsController extends TsaBaseController {
 				throw new IllegalStateException("업체코드 검색중 오류로 인해 조회되지 않았습니다.");
 			}
 		}
+		
+		if (!StringUtils.isBlank(goodsSearch.getItemkindList())) {
+			try {
+				String[] arrItemkind = mapper.readValue(goodsSearch.getItemkindList(), String[].class);
+				goodsSearch.setMultiItemkindCd(arrItemkind);
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new IllegalStateException("품목 검색중 오류로 인해 조회되지 않았습니다.");
+			}
+		}
 
 		goodsSearch.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
 		goodsSearch.setPageable(new TscPageRequest(goodsSearch.getPageNo() - 1, goodsSearch.getPageSize()));

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

@@ -88,6 +88,7 @@ public class GoodsSearch extends TscBaseDomain {
 	private String callbackFn;
 	private String brandList;
 	private String supplyCompList;
+	private String itemkindList;
 	private String goodsContentsType;
 
 	//@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)

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

@@ -58,19 +58,11 @@
 							<button type="button" class="btn icn" id="btnSearchSupplyComp"><i class="fa fa-search"></i></button>
 							<span id="supplyCompText"></span>
 							<input type="hidden" name="supplyCompList"/>
-							<!-- <label class="rdoBtn"><input type="radio" name="selfYn" id="selfYnY" value="Y"  checked/>자사</label>
-							<label class="rdoBtn"><input type="radio" name="selfYn" id="selfYnN" value="N"/>입점</label>
-							<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>
-							</select>
-							<span id="multiBrand"></span> -->
 						</td>
 						<th>브랜드<em class="required" title="필수"></em></th>
 						<td>
 							<input type="text" class="w100" name="searchTxt" id="searchTxt" maxlength="20" />
 							<button type="button" class="btn icn" id="btnSearchBrand"><i class="fa fa-search"></i></button>
-							<!-- <input type="text" class="w100" name="brandCd" readonly="readonly"/> -->
 							<span id="brandText"></span>
 							<input type="hidden" name="brandList"/>
 						</td>
@@ -95,13 +87,18 @@
 					<tr>
 						<th>품목</th>
 						<td>
-							<div class="multiCheckBox"  style="width:300px">
+							<!-- <div class="multiCheckBox"  style="width:300px">
 								<button type="button" class="sltBtn" data-name="[전체]">[전체]</button>
 								<ul style="overflow:auto; height:170px;" id="grpItemkind">
 									<li><label class="chkBox" onclick="uifnAllCheck(this,'grpItemkind')"><input type="checkbox" name="전체선택" >전체선택</label></li>
 									<li th:if="${itemkindList}" th:each="oneData, status : ${itemkindList}"><label class="chkBox" data-group="grpItemkind"><input type="checkbox" name="multiItemkindCd" th:id="${'itemkindCd' + oneData.cd}" th:value="${oneData.cd}" ><th:block th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></th:block></label></li>
 								</ul>
-							</div>
+							</div> -->
+							
+							<input type="text" class="w100" name="itemkindSearchTxt" id="itemkindSearchTxt" maxlength="20" />
+							<button type="button" class="btn icn" id="btnSearchItemkind"><i class="fa fa-search"></i></button>
+							<span id="itemkindText"></span>
+							<input type="hidden" name="itemkindList"/>
 						</td>
 						<th>상품상태</th>
 						<td>
@@ -124,14 +121,6 @@
 					<tr>
 						<th>년도/시즌</th>
 						<td>
-							<!-- <select  name="styleYear" id="styleYear">
-								<option value="">[전체]</option>
-								<option th:if="${styleYearList}" th:each="oneData, status : ${styleYearList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
-							</select>
-							<select  name="seasonCd" id="seasonCd">
-								<option value="">[전체]</option>
-								<option th:if="${seasonList}" th:each="oneData, status : ${seasonList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
-							</select> -->
 							<div class="multiCheckBox" style="width:140px;">
 								<button type="button" class="sltBtn" data-name="[전체]">[전체]</button>
 								<ul style="overflow:auto; height:140px" id="grpStyle">
@@ -192,10 +181,6 @@
 								<option value="">[전체]</option>
 								<option th:if="${useYnList}" th:each="oneData, status : ${useYnList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
 							</select>
-							<!-- <label class="chkBox"><input type="checkbox" name="returnableYn" value="Y"/>반품가능</label>
-							<label class="chkBox"><input type="checkbox" name="changeableYn" value="Y"/>교환가능</label>
-							<label class="chkBox"><input type="checkbox" name="returnFeeFreeYn" value="Y"/>무료반품</label>
-							<label class="chkBox"><input type="checkbox" name="changeFeeFreeYn" value="Y"/>무료교환</label> -->
 						</td>
 						<th>담당MD</th>
 						<td>
@@ -376,13 +361,6 @@
 							<td colspan="3">
 								<input type="text" class="w100" name="statSupplyCompCd" id="statSupplyCompCd" maxlength="20" />
 								<button type="button" class="btn icn" id="btnSearchSupplyCompStat"><i class="fa fa-search"></i></button>
-								
-							<!-- 	<label class="rdoBtn"><input type="radio" name="statSelfYn" id="statSelfYnY" value="Y"  checked/>자사</label>
-								<label class="rdoBtn"><input type="radio" name="statSelfYn" id="statSelfYnN" value="N"/>입점</label>
-								<select name="statSupplyCompCd" id="statSupplyCompCd">
-									<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>
-								</select> -->
 								<select name="delvFeeCdC" id="delvFeeCdC" >
 									<option value="">[선택]</option>
 								</select>
@@ -496,7 +474,6 @@
 			cellEditor: 'textCellEditor',
 			cellEditorParams: { maxlength: 14, validType: 'numeric'}
 		},
-		/*{headerName: "할인율", field: "dcRate" , width: 90, cellClass: 'text-right'},*/
 		{headerName: "자사즉시할인가", field: "benefitPrice" , width: 120, cellClass: 'text-right'
 			,valueFormatter: function(params) {
 				if (params.value > 0) {
@@ -568,9 +545,11 @@
 		$("#searchForm input[type=radio][checked]").parent("label").addClass("checked");
 		$("#multiBrand").empty();
 		$('#searchForm input[name=brandList]').val('');
-		$('#searchForm input[name=supplyCompList]').val('');
 		$('#searchForm').find('#brandText').html('');
+		$('#searchForm input[name=supplyCompList]').val('');
 		$('#searchForm').find('#supplyCompText').html('');
+		$('#searchForm input[name=itemkindList]').val('');
+		$('#searchForm').find('#itemkindText').html('');
 		
 		$(document).find('#searchForm').find(".multiCheckBox").each(function(i, e){
 			let btnNm = $(this).find(".sltBtn").attr("data-name");
@@ -686,20 +665,7 @@
 				return false;
 			}
 		}
-
-/* 		if (!gagajf.isNull($('#searchForm input[name=supplyCompList]').val())){
-			var jsonData = JSON.parse($('#searchForm input[name=supplyCompList]').val()); 
-			if (jsonData.length > 500){
-				mcxDialog.alertC("키워드 조회값을 500 이하로 조회 하세요.", {
-					sureBtnText: "확인",
-					sureBtnClick: function() {
-						$('#searchForm textarea[name=condition]').focus();
-					}
-				});
-				return false;
-			}
-		}
- */		
+	
 		if (!gagajf.isNull($('#searchForm textarea[name=condition]').val())){
 			var arrData = $('#searchForm textarea[name=condition]').val().replace(/\r\n/g,"\n").split("\n"); 
 			if (arrData.length > 500){
@@ -1145,6 +1111,33 @@
 		cfnOpenBrandListPopup('fnSetBrandInfo', 'M');
 	});
 	
+	// 품목 조회 선택시
+	$('#btnSearchItemkind').on('click', function() {
+		cfnOpenItemkindListPopup('fnSetItemkindInfo', 'M');
+	});
+	
+	// 품목 조회 팝업에서 호출
+	var fnSetItemkindInfo = function(result) {
+		var arrItemkind = [];
+		var itemkindText = "";
+		var sIndex = 0;
+		$('#searchForm').find('#itemkindText').html('');
+		$('#searchForm input[name=itemkindSearchTxt]').val('');
+		result.forEach(function(itemkind){
+			sIndex++; 
+			arrItemkind.push(itemkind.itemkindCd);
+		});
+
+		// 조회값이 하나일 경우 화면에 코드 노출 그외는 갯수 처리 
+		if (sIndex == 1) {
+			$('#searchForm input[name=itemkindSearchTxt]').val(arrItemkind[0]);
+		}else{
+			itemkindText = sIndex + " 개";
+			$('#searchForm').find('#itemkindText').html(itemkindText);	
+		}
+		var jsonData = JSON.stringify(arrItemkind);
+		$("#searchForm input[name=itemkindList]").val(jsonData);
+	}
 	
 	// 상태일괄변경 - 배송정책 
 	$('#btnSearchSupplyCompStat').on('click', function() {