jsh77b@naver.com 4 лет назад
Родитель
Сommit
0a25ed4a36

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

@@ -674,30 +674,30 @@
 		    SELECT T.GOODS_CD
 		         , T.GOODS_GB
 			FROM (
-		        SELECT 99999 AS GOODS_CD
+		        SELECT '99999' AS GOODS_CD
 				     , 'G800_99' AS GOODS_GB
 				FROM   TB_GOODS
 				WHERE  1=2
 				<if test="multiSupplyCompCd != null and multiSupplyCompCd.length > 0">
-				    UNION  ALL
-					SELECT GOODS_CD
-					     , 'G800_20' AS GOODS_GB
-					FROM TB_GOODS
-					WHERE SUPPLY_COMP_CD IN
+			    UNION  ALL
+				SELECT GOODS_CD
+				     , 'G800_20' AS GOODS_GB
+				FROM TB_GOODS
+				WHERE SUPPLY_COMP_CD IN
 					<foreach collection="multiSupplyCompCd" item="item" open="(" separator="," close=")">
 						#{item}
 					</foreach>
-					AND   BRAND_CD IN
+				AND   BRAND_CD IN
 					<foreach collection="multiBrand" item="item" open="(" separator="," close=")">
 						#{item}
 					</foreach>
 					<if test="multiDefaultGoods != null and multiDefaultGoods.length > 0">
-						AND GOODS_CD NOT IN ( ${applySql} )
+				AND GOODS_CD NOT IN ( ${applySql} )
 					</if>
 				</if>
 				<if test="multiApplyGoods != null and multiApplyGoods.length > 0">
-					UNION ALL
-					${applyGbSql}
+				UNION ALL
+				${applyGbSql}
 				</if>
 			) T
 			WHERE	1=1

+ 17 - 16
src/main/webapp/WEB-INF/views/marketing/MorebetterPopupForm.html

@@ -398,7 +398,7 @@
 		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
 		{headerName: "브랜드ID"		, field: "brandCd"			, width: 110, cellClass: 'text-center'},
 		{headerName: "브랜드명"		, field: "brandEnm"			, width: 120, cellClass: 'text-center'},
-		{headerName: "공급업체명"		, field: "supplyCompNm"		, width: 150, cellClass: 'text-center'},
+		{headerName: "공급업체명"		, field: "supplyCompNm"		, width: 150, cellClass: 'text-center', hide: true},
 		{headerName: "적용대상"		, field: "targetGb"			, width: 150, cellClass: 'text-center', hide: true},
 		{headerName: "시퀀스"			, field: "tmtbGoodsSq"		, width: 150, cellClass: 'text-center', hide: true},
 		{headerName: "삭제여부"		, field: "delYn"			, width: 150, cellClass: 'text-center', hide: true}
@@ -832,11 +832,14 @@
 		var multiApplyGoods = [];
 		$.each(allApplyGoodsData, function(agIdx, agItem) {
 			var dupCnt = 0;
+			// 2022.01.05 기본상품 중복체크 미적용
+			/*
 			$.each(allDefaultGoodsData, function(idx, item) {
 				if(agItem.goodsCd == item.goodsCd){
 					dupCnt++;
 				}
 			});
+			*/
 			if(dupCnt==0){
 				multiApplyGoods.push(agItem.goodsCd);
 			}
@@ -936,28 +939,23 @@
 					xhr.setRequestHeader('Accept'		, 'application/json');
 					xhr.setRequestHeader('Content-Type'	, 'application/json');
 				},
-				success 	: function(result) {
-						var data = result.returnList;
-						let modifyList = [];
-						$.each(data, function(idx, item) {
-							let brandEnm = item.brandEnm;
-							item.brandEnm = brandEnm.replaceXSS();
-							
-							modifyList.push(item);
-						});
-						gridOptionsFGBrandList.api.setRowData(modifyList);
+				success 	: function(result) {						
 					if (result != null) {
-						for(let i = 0 ; i < result.returnList.length ; i++) {
+						for (let i = 0 ; i < result.returnList.length ; i++) {
 							let addChk = true, gridListValue = gagaAgGrid.getAllRowData(gridOptionsFGBrandList);		// 받아온 모든 데이터
 
 							// 받아온 data for
-							for(let j = 0 ; j < gridListValue.length ; j++) {
-								if(gridListValue[j].brandCd == result.returnList[i].brandCd) {	addChk = false;	}					// 중복체크
+							for (let j = 0 ; j < gridListValue.length ; j++) {
+								if(gridListValue[j].brandCd == result.returnList[i].brandCd) {	addChk = false;	}		// 중복체크
 							}
 
 							// 중복되지 않은 데이터 리스트에 추가
-							if(addChk) {
-								gagaAgGrid.addRowData(gridOptionsFGBrandList, {"brandCd" : result.returnList[i].brandCd, "brandEnm" : result.returnList[i].brandEnm, "supplyCompNm" : result.returnList[i].supplyCompNm, "targetGb" : "G260_12"});
+							if (addChk) {
+								// 2022.01.05 replaceXSS 적용
+								let brandEnm = result.returnList[i].brandEnm;
+								brandEnm = brandEnm.replaceXSS();
+								
+								gagaAgGrid.addRowData(gridOptionsFGBrandList, {"brandCd" : result.returnList[i].brandCd, "brandEnm" : brandEnm, "supplyCompNm" : result.returnList[i].supplyCompNm, "targetGb" : "G260_12"});
 							}
 						}
 					}
@@ -1445,11 +1443,14 @@
 		var multiApplyGoods = [];
 		$.each(allApplyGoodsData, function(agIdx, agItem) {
 			var dupCnt = 0;
+			// 2022.01.05 기본상품 중복체크 미적용
+			/*
 			$.each(allDefaultGoodsData, function(idx, item) {
 				if(agItem.goodsCd == item.goodsCd){
 					dupCnt++;
 				}
 			});
+			*/
 			if(dupCnt==0){
 				multiApplyGoods.push(agItem.goodsCd);
 			}