Переглянути джерело

Merge branch 'develop' of http://112.172.147.34:4936/style24/STYLE24.git into develop

gagamel 5 роки тому
батько
коміт
372a5e2ed8

+ 1 - 0
style24.admin/.gitignore

@@ -2,3 +2,4 @@ target/
 .settings/
 .classpath
 /bin/
+/target/

+ 7 - 7
style24.admin/src/main/java/com/style24/admin/biz/web/TsaMarketingController.java

@@ -69,7 +69,7 @@ public class TsaMarketingController extends TsaBaseController {
 	/**
 	 * 사은품 프로모션 목록 조회
 	 * @author xodud1202
-	 * @since 2020. 10. 17
+	 * @since 2020. 12. 16
 	 */
 	@PostMapping("/freeGoodsPromotion/list")
 	@ResponseBody
@@ -90,12 +90,11 @@ public class TsaMarketingController extends TsaBaseController {
 
 
 	/**
-	 * 세트상품구성 화면
-	 *
-	 * @param
-	 * @return
-	 * @author eskim
-	 * @since 2020. 05. 26
+	 * 사은품 프로모션 등록 팝업창
+	 * @param param
+	 * @return ModelAndView
+	 * @author xodud1202
+	 * @since 2020. 12. 23
 	 */
 	@ResponseBody
 	@GetMapping("/freeGoodsRegiPopup/form")
@@ -107,6 +106,7 @@ public class TsaMarketingController extends TsaBaseController {
 		mav.addObject("goodsStatList", rendererService.getCommonCodeList("G008", "Y", exceptCds));
 
 		mav.addObject("param", param);
+		log.info("CHECK PARAM.GBN >> " + param.getGbn());
 		mav.setViewName("marketing/FreeGoodsPromotionRegiForm");
 		return mav;
 	}

+ 20 - 4
style24.admin/src/main/java/com/style24/admin/biz/web/TsaOcmController.java

@@ -2,6 +2,7 @@ package com.style24.admin.biz.web;
 
 import java.util.Collection;
 
+import com.style24.persistence.domain.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -16,10 +17,6 @@ import com.style24.admin.biz.service.TsaRendererService;
 import com.style24.admin.support.controller.TsaBaseController;
 import com.style24.admin.support.security.session.TsaSession;
 import com.style24.core.support.message.TscMessageByLocale;
-import com.style24.persistence.domain.Extmall;
-import com.style24.persistence.domain.ExtmallNoti;
-import com.style24.persistence.domain.ExtmallOrigin;
-import com.style24.persistence.domain.ExtmallPriceSync;
 
 import lombok.extern.slf4j.Slf4j;
 
@@ -79,6 +76,25 @@ public class TsaOcmController extends TsaBaseController {
 		return ocmService.getExtmallList(extmall);
 	}
 
+	/**
+	 * 제휴몰 목록 화면(팝업)
+	 * @param extmall - 제휴몰 정보
+	 * @return
+	 * @author xodud1202
+	 * @since 2020. 12. 28
+	 */
+	@GetMapping("/extmall/search/form")
+	public ModelAndView extmallSearchForm(Extmall extmall) {
+		ModelAndView mav = new ModelAndView();
+
+		// 상품상태
+		mav.addObject("extmallGbList", rendererService.getCommonCodeList("G003", "Y"));
+
+		mav.addObject("params", extmall);
+		mav.setViewName("ocm/ExtmallSearchForm");
+		return mav;
+	}
+
 	/**
 	 * 제휴몰 등록/수정 처리
 	 * @param extmall - 제휴몰 정보

+ 3 - 0
style24.admin/src/main/java/com/style24/persistence/domain/Extmall.java

@@ -25,4 +25,7 @@ public class Extmall extends TscBaseDomain {
 	private String dwdpYn;			// 직접회수여부(Y:제휴몰에서회수, N:자사몰에서회수)
 	private String useYn;			// 사용여부
 
+	// 검색조건
+	private String searchTxt;		// 검색어
+	private String callbackFn;		// 콜백함수
 }

+ 30 - 8
style24.admin/src/main/java/com/style24/persistence/domain/FreeGoodsPromotion.java

@@ -1,9 +1,12 @@
 package com.style24.persistence.domain;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.style24.persistence.TsaPageRequest;
 import com.style24.persistence.TscBaseDomain;
 import lombok.Data;
 
+import java.util.List;
+
 /**
  * 품목 Domain
  *
@@ -14,14 +17,33 @@ import lombok.Data;
 @Data
 public class FreeGoodsPromotion extends TscBaseDomain {
 	// 사은품 프로모션
-	private int freeGiftSq;			// 프로모션ID
-	private String freeGiftName;	// 프로모션명
-	private String freeGiftStat;	// 프로모션 상태
-	private String freeGiftStdt;	// 프로모션 시작일
-	private String freeGiftEddt;	// 프로모션 종료일
-	private String promotionGubun;	// 프로모션 조회 검색 구분
-	private String searchTxt;		// 프로모션 검색 조건
-	private String gbn;				// 팝업 구분 : C=등록, U=수정
+	private int freeGiftSq;				// 프로모션ID
+	private String freeGiftName;		// 프로모션명
+	private String freeGiftStat;		// 프로모션 상태
+	private String freeGiftStdt;		// 프로모션 시작일
+	private String freeGiftEddt;		// 프로모션 종료일
+	private String selfYn;				// 자사몰 적용 여부
+	private String allYn;				// 모두 지급 구분 (모두지급 일때는 포인트 금액을 설정 할 수 없음 Y(모두지급), N(선택사은품))
+
+	// 사은품 프로모션 제휴몰
+	private int freegiftExtmallSq;		// 프로모션 제휴몰 ID
+	private String extmallId;			// 외부몰ID
+	private String vendorId;			// 벤더ID
+
+	// 사은품 프로모션 적용 및 제외 상품
+	private String goodsGb;				// 상품 구분 (G800_10|기본상품, G800_20|적용상품, G800_30|제외상품, G800_40|ALL)
+	private String targetGb;			// 적용 구분 (G260_10|상품, G260_12|브랜드, G260_13|공급처)
+	private String targetVal;			// 적용 값 (브랜드코드, 상품코드, 공급처코드)
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)	private String[] applyGoodsCds;		// 적용 상품 번호
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)	private String[] exceptGoodsCds;	// 제외 상품 번호
+
+	// 사은품 조건
+	private List<FreeGoodsSectionVal> goodsListNew;		// 사은품 조건 리스트
+
+	// 기타 조건
+	private String promotionGubun;		// 프로모션 조회 검색 구분
+	private String searchTxt;			// 프로모션 검색 조건
+	private String gbn;					// 팝업 구분 : C=등록, U=수정
 
 	// Pagination
 	private TsaPageRequest pageable;

+ 31 - 0
style24.admin/src/main/java/com/style24/persistence/domain/FreeGoodsSectionVal.java

@@ -0,0 +1,31 @@
+package com.style24.persistence.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.style24.persistence.TsaPageRequest;
+import com.style24.persistence.TscBaseDomain;
+import lombok.Data;
+
+import java.util.Collection;
+
+/**
+ * 품목 Domain
+ *
+ * @author gagamel
+ * @since 2020. 10. 7
+ */
+@SuppressWarnings("serial")
+@Data
+public class FreeGoodsSectionVal {
+	// 사은품 조건
+	private int freegiftSectionSq;		// 사은품 조건 목록 ID
+	private int freegiftValSq;			// 사은품 조건 리스트 사은품ID
+	private int usePoint;				// 포인트액
+	private int itemQty;				// 지급 수량
+	private int limitQty;				// 한정 수량
+	private int leftQty;				// 잔여 수량
+	private String sectionGb;			// 사은품 조건 구분(G810_10|수량, G810_11|금액)
+	private String sectionVal;			// 구간 설정 값 | 구간 할인 시작 (수량이상, 금액이상)
+	private String itemCd;				// 사은품ID
+	private String itemOptCd1;			// ??
+	private String itemOptCd2;			// ??
+}

+ 2 - 2
style24.admin/src/main/webapp/WEB-INF/views/marketing/FreeGoodsPromotionForm.html

@@ -95,7 +95,7 @@
 				<div id="gridList" style="width: 100%; height: 700px;" class="ag-theme-balham lh60"></div>
 			</div>
 		</form>
-<script type="text/javascript" src="/ux/plugins/gaga/gaga.paging.js?v=2019072202"></script>
+<script type="text/javascript" src="/ux/plugins/gaga/gaga.paging.js"></script>
 <script th:inline="javascript">
 /*<![CDATA[*/
 	var columnDefs = [];
@@ -205,7 +205,7 @@
 
 	// 조회클릭시
 	$('#btnFreeGoodsRegi').on('click', function() {
-		cfnOpenFreeGoodsPromotionSetPopup();
+		cfnOpenFreeGoodsPromotionSetPopup('C');
 	});
 
 

+ 98 - 58
style24.admin/src/main/webapp/WEB-INF/views/marketing/FreeGoodsPromotionRegiForm.html

@@ -29,27 +29,9 @@
 				<input type="hidden" id="exceptGoodsCds" name="exceptGoodsCds"/>		<!-- 제외상품 리스트 -->
 				<input type="hidden" id="freeGoods1Cds" name="freeGoods1Cds"/>			<!-- 적용 사은품1 리스트 -->
 				<input type="hidden" id="freeGoods2Cds" name="freeGoods2Cds"/>			<!-- 적용 사은품2 리스트 -->
+				<input type="hidden" id="extmallIds" name="extmallIds" value=""/>			<!-- 적용 사은품2 리스트 -->
 
 				<div class="panelContent">
-					<ul class="notice">
-						<li>구성상품 등록시 기본값&nbsp;
-							<!-- 아이콘 툴팁 -->
-							<div class="iconTooltip">
-								<i class="fa fa-info" aria-hidden="true"></i>
-								<span class="left" style="width:400px; text-align:left;">
-									<!-- class="left" 또는 class="right" -->
-									- 상품상태 : 정보부족<br/>
-									- 정상가 : 구성상품의 정상가 합<br/>
-									- 판매가 : 구성상품 판매가 입력값의 합<br/>
-									- 브랜드코드 : 구성상품의 기준여부 'Y'상품의 브랜드코드<br/>
-									- 품목코드 : 구성상품의 기준여부 'Y'상품의 품목코드<br/>
-									- 포인트 : 구성상품의 기준여부 'Y'상품의 브랜드 포인트<br/>
-									- 배송비정책 : 구성상품의 기준여부 'Y'상품의 브랜드 배송비정책<br/>
-								</span>
-							</div>
-							<!-- //아이콘 툴팁 -->
-						</li>
-					</ul>
 					<table class="frmStyle">
 						<colgroup>
 							<col width="10%"/>
@@ -61,7 +43,7 @@
 							<th>프로모션명<em class="required" title="필수"></em></th>
 							<td>
 								<!-- 수정시 프로모션명 입력 : before -->
-								<input class="w50p" type="text" id="freegiftNm" name="freegiftNm" maxlength="30"/>
+								<input class="w50p" type="text" id="freegiftNm" name="freegiftNm" minlength="2" maxlength="30" required="required" data-valid-name="프로모션명"/>
 							</td>
 							<th>프로모션ID</th>
 							<td>
@@ -86,8 +68,9 @@
 						<tr>
 							<th>적용 몰 구분<em class="required" title="필수"></em></th>
 							<td colspan="3">
-								<!-- 적용 몰 구분 입력(공통 가져와야할듯?) : before -->
-								<input type="checkbox" id="jasa"/><label for="jasa">자사몰</label>
+								<label class="chkBox"><input type="checkbox" name="mallCds" value="G011_10"/>자사몰</label>
+								<label class="chkBox" id="G011_20"><input type="checkbox" name="mallCds" value="G011_20"/>제휴몰</label>
+								<button type="button" class="btn btnRight btn-success btn-lg" id="btnExtmallPopup">선택</button><span id="extmallCntArea"> 선택 : <span id="extmallCnt">00</span>개</span>
 							</td>
 						</tr>
 					</table>
@@ -122,7 +105,7 @@
 											<div class="padding10 inner-tb-solid">
 												<button type="button" class="btn btnRight btn-success btn-lg" id="btnAddCompany">업체 추가</button>
 												<button type="button" class="btn btnRight btn-success btn-lg" id="btnDeleteCompany">선택삭제</button>
-												<span>선택 : 00개</span>
+												<span>선택 : <span id="companyCnt">00</span>개</span>
 												<br/>
 												<div id="gridFGPromotionCompanyList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
 											</div>
@@ -132,7 +115,7 @@
 											<div class="padding10 inner-tb-solid">
 												<button type="button" class="btn btnRight btn-success btn-lg" id="btnAddBrand">브랜드 추가</button>
 												<button type="button" class="btn btnRight btn-success btn-lg" id="btnDeleteBrand">선택삭제</button>
-												<span>선택 : 00개</span>
+												<span>선택 : <span id="brandCnt">00</span>개</span>
 												<br/>
 												<!-- 브랜드 선택 팝업(단수 선택 팝업... 복수를 새로 만들어야하는지 ? 아니면 변수처리해야하는지 ? -->
 												<div id="gridFGBrandList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
@@ -146,7 +129,7 @@
 										<div class="padding10">
 											<button type="button" class="btn btnRight btn-success btn-lg" id="btnAddApplyGoods">상품 추가</button>
 											<button type="button" class="btn btnRight btn-success btn-lg" id="btnDeleteApplyGoods">선택삭제</button>
-											<span>선택 : 00개</span>
+											<span>선택 : <span id="applyGoodsCnt">00</span>개</span>
 											<br/>
 											<div id="gridFGApplyGoodsList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
 										</div>
@@ -179,7 +162,7 @@
 										<div class="padding10">
 											<button type="button" class="btn btnRight btn-success btn-lg" id="btnAddExceptGoods">상품 추가</button>
 											<button type="button" class="btn btnRight btn-success btn-lg" id="btnDeleteExtGoods">선택삭제</button>
-											<span>선택 : 00개</span>
+											<span>선택 : <span id="exceptGoodsCnt">00</span>개</span>
 											<br/>
 											<div id="gridFGExceptGoodsList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
 										</div>
@@ -210,8 +193,8 @@
 									<th>지급 방법<em class="required" title="필수"></em></th>
 									<td>
 										<div>
-											<span><label class="rdoBtn"><input type="radio" name="sendBox"/>모두 지급 (설정한 사은품을 모두 지급합니다)</label></span>
-											<span><label class="rdoBtn"><input type="radio" name="sendBox"/>선택 사은품 (목록 중 1개를 선택하게 합니다)</label></span>
+											<span><label class="rdoBtn"><input type="radio" name="allYn" value="Y" checked/>모두 지급 (설정한 사은품을 모두 지급합니다)</label></span>
+											<span><label class="rdoBtn"><input type="radio" name="allYn" value="N"/>선택 사은품 (목록 중 1개를 선택하게 합니다)</label></span>
 										</div>
 									</td>
 								</tr>
@@ -226,8 +209,6 @@
 											<span>사은품 목록</span>
 											<button type="button" class="btn btnRight btn-success btn-lg" id="btnAddFreeGoods1">+ 사은품 선택</button>
 											<button type="button" class="btn btnRight btn-success btn-lg" id="btnDeleteFreeGoods1">선택삭제</button>
-											<input type="button" value="+ 사은품 선택" id="goodsList" /> <!-- 선택 시 팝업 노출 -->
-											<input type="button" value="선택삭제" id="deleteGoodsList" />
 											<br/>
 											<div id="gridFreeGoods1List" style="width:100%; height:200px;" class="ag-theme-balham"></div>
 										</div>
@@ -250,8 +231,7 @@
 						</div>
 					</div>
 				</div>
-
-				<div class="panelStyle" style="margin:unset;">
+				<div class="panelStyle" th:if="${#strings.toString(param.gbn) == 'U'}" style="margin:unset;">
 					<!-- //TITLE -->
 					<div class="inner-panelContent">
 						<div class="panelContent">
@@ -362,15 +342,8 @@
 				cellEditorParams: { maxlength: 14, validType: 'numeric'}
 			},
 			{headerName: "한정수량", field: "limitQty" , width: 100, cellClass: 'text-center'
-				,valueFormatter: function(params) {
-					if(params.value && params.value > 0) {
-						return params.value.addComma();
-					} else {
-						return 0;
-					}
-				},
-				cellEditor: 'textCellEditor',
-				cellEditorParams: { maxlength: 14, validType: 'numeric'}
+				,cellEditor: 'textCellEditor'
+				,cellEditorParams: { maxlength: 14, validType: 'numeric'}
 			},
 			{headerName: "잔여수량", field: "leftQty", width: 120, cellClass: 'text-center'
 				,valueFormatter: function(params) {
@@ -460,20 +433,55 @@
 			cfnCreateCalendar('#promotionTerms', 'freegoodsStdt', 'freegoodsEddt', true, '행사기간', 'X');
 		});
 
+		// 제휴몰 체크 상태 확인
+		$("#G011_20").on("click", function() {
+			// 체크여부 확인 (선택되면 자동 checked 추가되는데, 추가되기 전 동작해서 반대로 지정)
+			if($("#G011_20").hasClass("checked")) {
+				$("#btnExtmallPopup").hide();
+				$("#extmallCntArea").hide();
+				$("#extmallCnt").text(0);
+				$("#extmallIds").val("");
+			} else {
+				$("#btnExtmallPopup").show();
+				$("#extmallCntArea").show();
+			}
+		});
+
+		$('#freeGoodsPromotionForm input[name=freegiftNm]').on('focusout', function() {
+			if($('#freeGoodsPromotionForm input[name=freegiftNm]').val().length < 2) {
+				mcxDialog.alert("2자~30자 이상 프로모션명을 입력하세요.");
+				return;
+			}
+		});
+
+		// list 데이터 세팅
+		function setSendGridListVal(gridListOption, key, inputId) {
+			let list = gagaAgGrid.getAllRowData(gridListOption);
+			let cds = [];
+			for(let k = 0 ; k < list.length ; k++) {
+				cds.push(eval("list[k]." + key));
+			}
+
+			var jsonData = JSON.stringify(cds);
+			$("#" + inputId).val(jsonData);
+		}
+
 		// 저장 버튼 클릭시
-		$('#freeGoodsPromotionForm #btnFreegoodsPromotionSave').on('click', function() {
+		$('#btnFreegoodsPromotionSave').on('click', function() {
 			// 각 ag-grid list 수량
 			let supplyCompCnt = gagaAgGrid.getAllRowData(gridOptionsFGCompanyList).length;
 			let brandCnt = gagaAgGrid.getAllRowData(gridOptionsFGBrandList).length;
 			let applyGoodsCnt = gagaAgGrid.getAllRowData(gridOptionsFGApplyGoodsList).length;
-			// let supplyCompCnt = gagaAgGrid.getAllRowData(gridOptionsFGExceptGoodsList).length;
+			let exceptGoodsCnt = gagaAgGrid.getAllRowData(gridOptionsFGExceptGoodsList).length;
 			let freeGoods1Cnt = gagaAgGrid.getAllRowData(gridOptionsFreeGoods1List).length;
 			let freeGoods2Cnt = gagaAgGrid.getAllRowData(gridOptionsFreeGoods2List).length;
 
-			// 프로모션명 확인
-			if(gagajf.isEmpty($("#freeGoodsPromotionForm #freegiftNm").val())) {
-				mcxDialog.alert("프로모션명을 입력해주세요");
-				$("#freeGoodsPromotionForm #freegiftNm").focus();
+			if (!gagajf.validation('#freeGoodsPromotionForm')) {
+				return false;
+			};
+
+			if($('#freeGoodsPromotionForm input[name=freegiftNm]').val().length < 2) {
+				mcxDialog.alert("2자~30자 이상 프로모션명을 입력하세요.");
 				return false;
 			}
 
@@ -481,14 +489,8 @@
 			let fromDate = $('#freeGoodsPromotionForm input[name=freegiftStdt]').val();
 			let toDate = $('#freeGoodsPromotionForm input[name=freegiftEddt]').val();
 
-			if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
-				mcxDialog.alert("행사 기간 시작일자와 종료일자를 입력하세요.");
-				$('#freeGoodsPromotionForm input[name=freegiftStdt]').focus();
-				return false;
-			}
-
 			if (fromDate > toDate) {
-				mcxDialog.alert("시작일자는 종료일자 보다  수 없습니다.");
+				mcxDialog.alert("시작일자는 종료일자 보다 늦을 수 없습니다.");
 				$('#freeGoodsPromotionForm input[name=freegiftStdt]').focus();
 				return false;
 			}
@@ -517,7 +519,12 @@
 				return false;
 			}
 
-
+			// 각 리스트 데이터 세팅
+			if(supplyCompCnt > 0) { setSendGridListVal(gridOptionsFGCompanyList, "supplyCompCd", "supplyCompCds"); }		// 공급업체 설정 데이터
+			if(brandCnt > 0) { setSendGridListVal(gridOptionsFGBrandList, "brandCd", "brandCds"); }							// 브랜드 설정 데이터
+			if(applyGoodsCnt > 0) { setSendGridListVal(gridOptionsFGApplyGoodsList, "goodsCd", "applyGoodsCds"); }			// 적용 상품 설정 데이터
+			if(exceptGoodsCnt > 0) { setSendGridListVal(gridOptionsFGExceptGoodsList, "goodsCd", "exceptGoodsCds"); }		// 제외 상품 설정 데이터
+			if(freeGoods1Cnt > 0) { setSendGridListVal(gridOptionsFreeGoods1List, "goodsCd", "freeGoods1Cds"); }			// 사은품 조건 1
 		});
 
 		// 공급업체 설정 / 업체 추가 콜백함수
@@ -535,6 +542,8 @@
 				// 중복되지 않은 데이터 리스트에 추가
 				if(addChk) {	gagaAgGrid.addRowData(gridOptionsFGCompanyList, result[i], "supplyCompCd");	}
 			}
+
+			$("#companyCnt").text(gridOptionsFGCompanyList.api.getDisplayedRowCount());
 		};
 
 		// 브랜드 설정 / 브랜드 추가 콜백함수 (단수로 가져오므로 복수일 경우에 수정 확인 필요)
@@ -550,16 +559,20 @@
 				// 중복되지 않은 데이터 리스트에 추가
 				if(addChk) {	gagaAgGrid.addRowData(gridOptionsFGBrandList, result[i], "brandCd");	}
 			}
+
+			$("#brandCnt").text(gridOptionsFGBrandList.api.getDisplayedRowCount());
 		};
 
 		// 적용 상품 리스트 콜백함수
 		var fnSetPopupApplyGoodsInfo = function(result) {
 			gridAddGoodsList(gridOptionsFGApplyGoodsList, result);
+			$("#applyGoodsCnt").text(gridOptionsFGApplyGoodsList.api.getDisplayedRowCount());
 		};
 
 		// 제외 상품 리스트 콜백함수
 		var fnSetPopupExceptGoodsInfo = function(result) {
 			gridAddGoodsList(gridOptionsFGExceptGoodsList, result);
+			$("#exceptGoodsCnt").text(gridOptionsFGExceptGoodsList.api.getDisplayedRowCount());
 		};
 
 		// 사은품 조건1 상품 리스트 콜백함수
@@ -567,7 +580,7 @@
 			gridAddGoodsList(gridOptionsFreeGoods1List, result);
 		};
 
-		// 사은품 조건1 상품 리스트 콜백함수
+		// 사은품 조건2 상품 리스트 콜백함수
 		var fnSetPopupFreeGoods2Info = function(result) {
 			gridAddGoodsList(gridOptionsFreeGoods2List, result);
 		};
@@ -587,16 +600,39 @@
 			}
 		}
 
+		// 제휴몰 list 콜백함수
+		function fnSetPopupExtmallInfo(result) {
+			let extmallIds = [];
+			if($("#extmallIds").val() != null && $("#extmallIds").val() != "") {
+				extmallIds = JSON.parse($("#extmallIds").val());
+			}
+
+			for(let i = 0 ; i < result.length ; i++) {
+				let addChk = true;
+				for(let j = 0 ; j < extmallIds.length ; j++) {
+					if(result[i].extmallId == extmallIds[j]) {	addChk = false;	}
+				}
+
+				if(addChk) {	extmallIds.push(result[i].extmallId)	};
+			}
+
+			var jsonData = JSON.stringify(extmallIds);
+			$("#extmallIds").val(jsonData);
+			$("#extmallCnt").text(extmallIds.length);
+		}
+
+		// 제휴몰 선택 버튼 클릭시
+		$('#freeGoodsPromotionForm #btnExtmallPopup').on('click', function() {
+			cfnOpenExtmallListPopup("fnSetPopupExtmallInfo");
+		});
 		// 공급업체 설정 업체 추가 버튼 클릭시
 		$('#freeGoodsPromotionForm #btnAddCompany').on('click', function() {
 			cfnOpenCompanyListPopup("fnSetPopupComapnyInfo");
 		});
-
 		// 브랜드 추가 버튼 클릭시 (복수 브랜드때 수정 필요)
 		$('#freeGoodsPromotionForm #btnAddBrand').on('click', function() {
 			cfnOpenBrandListPopup("fnSetPopupBrandInfo", "M");
 		});
-
 		// 적용 상품 추가 버튼 클릭시
 		$('#freeGoodsPromotionForm #btnAddApplyGoods').on('click', function() {
 			cfnOpenGoodsPopup("fnSetPopupApplyGoodsInfo");
@@ -617,18 +653,22 @@
 		// 공급업체 설정 선택삭제 버튼 클릭시
 		$('#freeGoodsPromotionForm #btnDeleteCompany').on('click', function() {
 			gridOptionsFGCompanyList.api.updateRowData({remove:gagaAgGrid.selectedRowData(gridOptionsFGCompanyList)});
+			$("#companyCnt").text(gridOptionsFGCompanyList.api.getDisplayedRowCount());
 		});
 		// 브랜드 설정 선택삭제 버튼 클릭시
 		$('#freeGoodsPromotionForm #btnDeleteBrand').on('click', function() {
 			gridOptionsFGBrandList.api.updateRowData({remove:gagaAgGrid.selectedRowData(gridOptionsFGBrandList)});
+			$("#brandCnt").text(gridOptionsFGBrandList.api.getDisplayedRowCount());
 		});
 		// 적용상품 선택삭제 버튼 클릭시
 		$('#freeGoodsPromotionForm #btnDeleteApplyGoods').on('click', function() {
 			gridOptionsFGApplyGoodsList.api.updateRowData({remove:gagaAgGrid.selectedRowData(gridOptionsFGApplyGoodsList)});
+			$("#applyGoodsCnt").text(gridOptionsFGApplyGoodsList.api.getDisplayedRowCount());
 		});
 		// 제외상품 선택삭제 버튼 클릭시
 		$('#freeGoodsPromotionForm #btnDeleteExtGoods').on('click', function() {
 			gridOptionsFGExceptGoodsList.api.updateRowData({remove:gagaAgGrid.selectedRowData(gridOptionsFGExceptGoodsList)});
+			$("#exceptGoodsCnt").text(gridOptionsFGExceptGoodsList.api.getDisplayedRowCount());
 		});
 		// 사은품조건1 선택삭제 버튼 클릭시
 		$('#freeGoodsPromotionForm #btnDeleteFreeGoods1').on('click', function() {

+ 133 - 0
style24.admin/src/main/webapp/WEB-INF/views/ocm/ExtmallSearchForm.html

@@ -0,0 +1,133 @@
+<!DOCTYPE html>
+<html lang="ko"
+	  xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : ExtmallSearchForm.html
+ * @desc    : 제휴몰 리스트 팝업
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2020.12.28   xodud1202   최초 작성
+ *******************************************************************************
+ -->
+<div class="modalPopup" data-width="500" id="popupExtmallList">
+	<div class="panelStyle">
+		<!-- TITLE -->
+		<div class="panelTitle">
+			<strong>공급업체 목록</strong>
+			<button type="button" class="close" onclick="uifnPopupClose('popupExtmallList');"><em class="fa fa-times"></em></button>
+		</div>
+		<!-- //TITLE -->
+
+		<!-- 검색 조건 -->
+		<div class="panelContent">
+			<form id="searchExtmallListForm" name="searchExtmallListForm" action="#" th:action="@{'/ocm/extmall/list'}" onsubmit="$('#btnSearchExtmallList').trigger('click'); return false;">
+
+				<table class="frmStyle" aria-describedby="검색조건">
+					<colgroup>
+						<col style="width:15%;"/>
+						<col/>
+					</colgroup>
+					<tbody>
+					<tr>
+						<th>제휴몰 명</th>
+						<td>
+							<input type="text" name="searchTxt" th:value="${params.searchTxt}" maxlength="20" onkeypress="if (event.keyCode == 13) { $('#btnSearchExtmallList').trigger('click'); }"/>
+						</td>
+					</tr>
+					</tbody>
+				</table>
+				<ul class="panelBar">
+					<li class="center">
+						<button type="button" class="btn btn-base btn-lg" id="btnSearchExtmallList">조회</button>
+					</li>
+				</ul>
+			</form>
+		</div>
+		<!-- //검색 조건 -->
+
+		<!-- 리스트 영역 -->
+		<div class="panelContent">
+			<div id="gridComapanyPopupList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
+		</div>
+		<!-- //리스트 영역 -->
+
+		<!-- 버튼 배치 영역 -->
+		<ul class="panelBar">
+			<li class="right">
+				<button type="button" class="btn btn-info btn-lg" id="btnConfirmExtmall">확인</button>
+			</li>
+		</ul>
+	</div>
+
+	<script th:inline="javascript">
+		/*<![CDATA[*/
+		let extmallGbList = gagajf.convertToArray([[${extmallGbList}]]);		// 상품 상태 리스트
+		let columnExtmallPopupDefList = [
+			{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
+			{headerName: "제휴몰구분", field: "vendorId" , width: 120, cellClass: 'text-center',
+				cellEditorParams: { values: gagaAgGrid.extractValues(extmallGbList) },
+				valueFormatter: function (params) { return gagaAgGrid.lookupValue(extmallGbList, params.value); },
+				valueParser: function (params) { return gagaAgGrid.lookupKey(extmallGbList, params.newValue); }
+			},
+			{headerName: "제휴몰ID", field: "extmallId", width: 150, cellClass: 'text-center'},
+			{headerName: "제휴몰명", field: "extmallNm", width: 150, cellClass: 'text-center'}
+		];
+
+		let gridOptionsExtmallPopupList = gagaAgGrid.getGridOptions(columnExtmallPopupDefList);
+		gridOptionsExtmallPopupList.rowSelection = "multiple";
+
+		// Row double click
+		gridOptionsExtmallPopupList.onRowDoubleClicked = function(event) {
+			$('#btnConfirmExtmall').trigger('click');
+		}
+
+		// 조회
+		$('#btnSearchExtmallList').on('click', function() {
+			// Fetch data
+			gagaAgGrid.fetch($('#searchExtmallListForm').prop('action'), gridOptionsExtmallPopupList, '#searchExtmallListForm');
+		});
+
+		// 확인
+		$('#btnConfirmExtmall').on('click', function() {
+			var selectedData = gagaAgGrid.selectedRowData(gridOptionsExtmallPopupList);
+
+			if (selectedData.length == 0) {
+				mcxDialog.alert('선택된 공급업체가 없습니다.');
+				return false;
+			}
+
+			var callbackFn = [[${params.callbackFn}]];
+
+			var jsonData = JSON.stringify(selectedData);
+
+			if (typeof callbackFn != 'undefined' && callbackFn) {
+				if (typeof callbackFn == 'function') {
+					callbackFn(jsonData);
+				} else {
+					if (callbackFn) {
+						if (callbackFn.indexOf("(") == -1) {
+							eval(callbackFn + "(" + jsonData + ")");
+						} else {
+							eval(callbackFn(jsonData));
+						}
+					}
+				}
+				uifnPopupClose('popupExtmallList');
+			}
+		});
+
+		$(document).ready(function() {
+			// Create a agGrid
+			gagaAgGrid.createGrid('gridComapanyPopupList', gridOptionsExtmallPopupList);
+		});
+		/*]]>*/
+	</script>
+
+</div>
+
+</html>

+ 19 - 2
style24.admin/src/main/webapp/ux/js/admin.popup.js

@@ -698,8 +698,8 @@ var cfnOpenBrandListPopup = function(callbackfn, multiGb, searchTxt) {
  * @since  : 2020/12/21
  * @author : xodud1202
  */
-var cfnOpenFreeGoodsPromotionSetPopup = function() {
-	var actionUrl = "/marketing/freeGoodsRegiPopup/form?gbn=C";
+var cfnOpenFreeGoodsPromotionSetPopup = function(gbn) {
+	var actionUrl = "/marketing/freeGoodsRegiPopup/form?gbn=" + gbn;
 
 	uifnPopupClose('popupFreeGoodsPromotionRegi');
 	cfnOpenModalPopup(actionUrl, 'popupFreeGoodsPromotionRegi');
@@ -720,4 +720,21 @@ var cfnOpenCompanyListPopup = function(callbackfn) {
 	if (typeof(callbackfn) != 'undefined') actionUrl += "?callbackFn=" + callbackfn;
 	uifnPopupClose('popupCompanyList');
 	cfnOpenModalPopup(actionUrl, 'popupCompanyList');
+}
+
+/**
+ * @type   : function
+ * @access : public
+ * @desc   : 공급업체 조회 팝업
+ * <pre>
+ *     cfnOpenCompanyListPopup();
+ * </pre>
+ * @since  : 2020/12/23
+ * @author : xodud1202
+ */
+var cfnOpenExtmallListPopup = function(callbackfn) {
+	var actionUrl = "/ocm/extmall/search/form";
+	if (typeof(callbackfn) != 'undefined') actionUrl += "?callbackFn=" + callbackfn;
+	uifnPopupClose('popupExtmallList');
+	cfnOpenModalPopup(actionUrl, 'popupExtmallList');
 }