Sfoglia il codice sorgente

Merge branch 'develop' into bin2107

bin2107 4 anni fa
parent
commit
8747f2f4b5

+ 9 - 0
src/main/java/com/style24/admin/biz/dao/TsaSystemDao.java

@@ -109,6 +109,15 @@ public interface TsaSystemDao {
 	 */
 	Collection<Menu> getMenuList(Menu menu);
 
+	/**
+	 * 메뉴ID 건수 조회
+	 * @param menuId - 메뉴ID
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 7. 16
+	 */
+	int getMenuIdCount(String menuId);
+
 	/**
 	 * 메뉴 등록/수정
 	 * @param menu - 메뉴 정보

+ 11 - 0
src/main/java/com/style24/admin/biz/service/TsaSystemService.java

@@ -289,6 +289,17 @@ public class TsaSystemService {
 		}
 	}
 
+	/**
+	 * 메뉴ID 건수 조회
+	 * @param menuId - 메뉴ID
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 7. 16
+	 */
+	public int getMenuIdCount(String menuId) {
+		return systemDao.getMenuIdCount(menuId);
+	}
+
 	/**
 	 * 메뉴 등록/수정 및 메뉴권한 생성
 	 * @param menu - 메뉴 정보

+ 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));
 

+ 13 - 0
src/main/java/com/style24/admin/biz/web/TsaSystemController.java

@@ -310,6 +310,19 @@ public class TsaSystemController extends TsaBaseController {
 		return super.ok(message.getMessage("SUCC_0001"));
 	}
 
+	/**
+	 * 메뉴ID 조회
+	 * @param menuId - 메뉴ID
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 7. 16
+	 */
+	@GetMapping("/menu/id/{menuId}")
+	@ResponseBody
+	public int getMenuIdCount(@PathVariable("menuId") String menuId) {
+		return systemService.getMenuIdCount(menuId);
+	}
+
 	/**
 	 * 메뉴 등록/수정 처리
 	 * @return

+ 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"'>

+ 8 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaSystem.xml

@@ -330,6 +330,14 @@
 		ORDER  BY ORDBY
 	</select>
 
+	<!-- 메뉴ID 건수 -->
+	<select id="getMenuIdCount" parameterType="String" resultType="int">
+		/* TsaSystem.getMenuIdCount */
+		SELECT COUNT(*) AS CNT
+		FROM   TB_MENU
+		WHERE  MENU_ID = #{menuId}
+	</select>
+	
 	<!-- 메뉴 등록/수정 -->
 	<insert id="saveMenu" parameterType="Menu">
 		/* TsaSystem.saveMenu */

+ 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>';
 			}
 		}

+ 61 - 3
src/main/webapp/WEB-INF/views/system/MenuForm.html

@@ -91,7 +91,8 @@
 								<tr>
 									<th>메뉴ID<i class="required" title="필수" aria-hidden="true"></i></th>
 									<td>
-										<input type="text" name="menuId" placeholder="" maxlength="20" required="required" data-valid-type="alphaNumeric" data-valid-name="메뉴ID" onkeyup="$(this).val($(this).val().toUpperCase());"/>
+										<input type="text" name="menuId" class="w150" placeholder="" maxlength="20" required="required" data-valid-type="alphaNumeric" data-valid-name="메뉴ID" onkeyup="$(this).val($(this).val().toUpperCase());"/>
+										<button type="button" class="btn btn-default btn-sm" id="menuIdDupCheck">중복체크</button>
 									</td>
 									<th>메뉴명<i class="required" title="필수" aria-hidden="true"></i></th>
 									<td>
@@ -101,7 +102,7 @@
 								<tr>
 									<th>메뉴구분<i class="required" title="필수" aria-hidden="true"></i></th>
 									<td>
-										<label class="rdoBtn"><input type="radio" name="menuGb" value="M"/>메뉴</label>
+										<label class="rdoBtn"><input type="radio" name="menuGb" value="M" checked="checked"/>메뉴</label>
 										<label class="rdoBtn"><input type="radio" name="menuGb" value="P"/>프로그램</label>
 									</td>
 									<th>상위메뉴</th>
@@ -378,16 +379,73 @@
 		$('#detailForm input[name=menuNm]').focus();
 	}
 	
+	// 메뉴ID 중복 체크
+	var isUnique = true;
+	$('#menuIdDupCheck').on('click', function() {
+		var $e = $('#registerForm input[name=menuId]');
+		if (gagajf.isNull($e.val())) {
+			mcxDialog.alertC('메뉴ID를 입력해 주세요.', {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$e.focus();
+				}
+			});
+			return;
+		}
+		
+		$.get('/system/menu/id/' + $e.val()
+			, function(data) {
+				if (data > 0) {
+					mcxDialog.alertC('이 ID는 이미 사용중입니다. 다른 ID를 입력해 주세요.', {
+						sureBtnText: "확인",
+						sureBtnClick: function() {
+							isUnique = false;
+							$e.val('');
+							$e.focus();
+						}
+					});
+				} else {
+					mcxDialog.alert('이 ID는 사용 가능합니다.');
+					isUnique = true;
+				}
+			});
+	});
+	
 	// 저장 처리
 	var fnSave = function(formId) {
 		// 입력 값 체크
 		if (!gagajf.validation(formId))
 			return false;
 		
+		if (formId == '#registerForm') {
+			if (!isUnique) {
+				mcxDialog.alert('메뉴ID를 중복체크해 주세요.');
+				return;
+			}
+		}
+		
 		$(formId + ' input[name=useYn]').val($(formId + ' input:checkbox[name=chkUseYn]').is(":checked") ? 'Y' : 'N');
 		$(formId + ' input[name=roleCds]').val($(formId + ' select[name=roleCd]').val());
 		
-		gagajf.ajaxFormSubmit($(formId).prop('action'), formId, fnSaveCallback);
+		if ($(formId + " input:radio[name=menuGb]").eq(1).is(':checked')) {
+			if (gagajf.isNull($(formId + ' input[name=menuUrl]').val())) {
+				mcxDialog.alertC('메뉴URL을 입력해 주세요.', {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$(formId + ' input[name=menuUrl]').focus();
+					}
+				});
+				return;
+			}
+		}
+		
+		mcxDialog.confirm("저장하시겠습니까?", {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function() {
+				gagajf.ajaxFormSubmit($(formId).prop('action'), formId, fnSaveCallback);
+			}
+		});
 	}
 	
 	// 등록/수정 처리 후 콜백함수