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

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

eskim 5 лет назад
Родитель
Сommit
5b67f97680

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

@@ -434,6 +434,8 @@ public class TsaMarketingController extends TsaBaseController {
 	public ModelAndView couponListForm() {
 		ModelAndView mav = new ModelAndView();
 
+		// 쿠폰상태 목록
+		mav.addObject("cpnStatList", rendererService.getAvailCommonCodeList("G232"));
 		// 쿠폰 유형 조회
 		mav.addObject("cpnTypeList", rendererService.getCommonCodeList("G230", "Y"));
 		// 할인 유형 조회
@@ -460,16 +462,16 @@ public class TsaMarketingController extends TsaBaseController {
 	public GagaMap getCouponList(@RequestBody Coupon param) {
 		GagaMap result = new GagaMap();
 
-		ArrayList<Coupon> cpnList = coreCouponService.getCouponList(param);
-		int cpnTotCnt = coreCouponService.getCouponListCnt(param);
+//		ArrayList<Coupon> cpnList = coreCouponService.getCouponList(param);
+//		int cpnTotCnt = coreCouponService.getCouponListCnt(param);
 
-		param.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
+//		param.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
 		param.setPageable(new TscPageRequest(param.getPageNo() - 1, param.getPageSize()));
-		param.getPageable().setTotalCount(cpnTotCnt);
+		param.getPageable().setTotalCount(coreCouponService.getCouponListCnt(param));
 
 		result.set("pageing", param);
-		result.set("cpnTotCnt", cpnTotCnt);
-		result.set("cpnList", cpnList);
+//		result.set("cpnTotCnt", cpnTotCnt);
+		result.set("cpnList", coreCouponService.getCouponList(param));
 
 		return result;
 	}

+ 4 - 4
src/main/webapp/WEB-INF/views/business/SupplyCompanyPopupForm.html

@@ -102,10 +102,10 @@
 		// 조회
 		$('#btnSearchCompanyList').on('click', function() {
 			
-			if (gagajf.isNull($('#searchCompanyListForm textarea[name=searchSupplyCompCd]').val())  && gagajf.isNull($('#searchCompanyListForm textarea[name=searchSupplyCompNm]').val())){
-				mcxDialog.alert('검색조건을 입력하세요.');
-				return false;
-			}
+			// if (gagajf.isNull($('#searchCompanyListForm textarea[name=searchSupplyCompCd]').val())  && gagajf.isNull($('#searchCompanyListForm textarea[name=searchSupplyCompNm]').val())){
+			// 	mcxDialog.alert('검색조건을 입력하세요.');
+			// 	return false;
+			// }
 			
 			// Fetch data
 			gagaAgGrid.fetch($('#searchCompanyListForm').prop('action'), gridOptionsCompanyPopupList, '#searchCompanyListForm');

+ 14 - 0
src/main/webapp/WEB-INF/views/marketing/CouponListForm.html

@@ -134,12 +134,18 @@
 
 			<!-- 검색결과 영역 -->
 			<div id="gridList" style="width: 100%; height: 570px;" class="ag-theme-balham"></div>
+			<ul class="panelBar">
+				<li class="center">
+					<div class="tablePaging" id="couponListPagination"></div>
+				</li>
+			</ul>
 		</div>
 	</form>
 	<script type="text/javascript" src="/ux/plugins/gaga/gaga.paging.js?v=2019072202"></script>
 	<script th:inline="javascript">
 		/*<![CDATA[*/
 		var cpnTypeList = gagajf.convertToArray([[${cpnTypeList}]]);
+		var cpnStatList = gagajf.convertToArray([[${cpnStatList}]]);
 		var siteCdList = gagajf.convertToArray([[${siteCdList}]]);
 		var dcWayList = gagajf.convertToArray([[${dcWayList}]]);
 		//var usableCustGbList = gagajf.convertToArray([[${usableCustGbList}]]);
@@ -163,6 +169,12 @@
 				valueFormatter: function (params) { return gagaAgGrid.lookupValue(usableCustGbList, params.value); },
 				valueParser: function (params) { return gagaAgGrid.lookupKey(usableCustGbList, params.newValue);}
 			},*/
+			{headerName: "쿠폰상태", field: "cpnStat", width: 140, cellClass: 'text-center' ,
+				cellEditor: 'agRichSelectCellEditor',
+				cellEditorParams: { values: gagaAgGrid.extractValues(cpnStatList) },
+				valueFormatter: function (params) { return gagaAgGrid.lookupValue(cpnStatList, params.value); },
+				valueParser: function (params) { return gagaAgGrid.lookupKey(cpnStatList, params.newValue); }
+			},
 			{headerName: "쿠폰유형", field: "cpnType", width: 140, cellClass: 'text-center' ,
 				cellEditor: 'agRichSelectCellEditor',
 				cellEditorParams: { values: gagaAgGrid.extractValues(cpnTypeList) },
@@ -240,6 +252,7 @@
 
 		// 조회클릭시
 		$('#btnSearch').on('click', function() {
+			// if(!fnConditionCheck()) return;
 			$("#cpnSearchForm input[name=pageNo]").val('1');
 			fnCouponListSearch();
 		});
@@ -249,6 +262,7 @@
 			if(!fnConditionCheck()) return;
 
 			gagaPaging.init('cpnSearchForm', fnSearchCallBack, 'couponListPagination', $('#cpnSearchForm').find('#pageSize').val());
+			// gagaPaging.load(1);
 			gagaPaging.load($("#cpnSearchForm input[name=pageNo]").val());
 		}
 

+ 69 - 17
src/main/webapp/WEB-INF/views/marketing/CouponPopupForm.html

@@ -107,7 +107,7 @@
 											<th>사용가능고객구분<em class="required" title="필수"></em></th>
 											<td>
 												<label class="chkBox" th:if="${usableCustGbList}" th:each="oneData, status : ${usableCustGbList}">
-													<input type="checkbox" name="usableCustGbArr" th:value="${oneData.cd}" th:text="${oneData.cdNm}"/>
+													<input type="checkbox" name="usableCustGbArr" th:value="${oneData.cd}" th:text="${oneData.cdNm}" checked="checked"/>
 												</label>
 											</td>
 											<th>사이트<em class="required" title="필수"></em></th>
@@ -121,7 +121,7 @@
 											<th>사용고객등급구분<em class="required" title="필수"></em></th>
 											<td>
 												<label class="chkBox" th:if="${usableCustGradeList}" th:each="oneData, status : ${usableCustGradeList}">
-													<input type="checkbox" name="usableCustGradeArr" th:value="${oneData.cd}" th:text="${oneData.cdNm}"/>
+													<input type="checkbox" name="usableCustGradeArr" th:value="${oneData.cd}" th:text="${oneData.cdNm}" checked="checked"/>
 												</label>
 											</td>
 											<th>만료알림여부<em class="required" title="필수"></em></th>
@@ -483,13 +483,32 @@
 						<!-- 입점업체분담율-->
 						<li class="tab" id="coupontab3">
 							<div class="panelStyle">
-								<ul class="panelBar">
-									<li class="left">
-										<button type="button" class="btn btn-warning btn-lg" id="btnAddRow">행추가</button>
-										<button type="button" class="btn btn-danger btn-lg" id="btnDelRow">행삭제</button>
-									</li>
-								</ul>
-								<div id="inComGridList" style="width: 100%; height: 570px" class="ag-theme-balham"></div>
+								<div class="inner-panelContent">
+									<div class="panelContent">
+										<div class="panelBar">
+											<h4>업체 분담율</h4>
+										</div>
+										<table class="frmStyle">
+											<colgroup>
+												<col style="width:15%;">
+												<col style="width:85%;">
+											</colgroup>
+											<tbody>
+											<tr>
+												<th>업체 분담율</th>
+												<td>
+													<div class="padding10 inner-tb-solid">
+														<button type="button" class="btn btnRight btn-success btn-lg" id="btnAddApplyBurden">업체추가</button>
+														<button type="button" class="btn btnRight btn-success btn-lg" id="btnDelApplyBurden">선택삭제</button>
+														<br/>
+														<div id="inComGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
+													</div>
+												</td>
+											</tr>
+											</tbody>
+										</table>
+									</div>
+								</div>
 							</div>
 						</li>
 						<!-- 입점업체분담끝-->
@@ -561,12 +580,13 @@
 
 	// ag-grid 입점업체분담율 컬럼
 	var columnDefs = [
-		{ headerName: "입점업체" , field:"supplyCompCd" , width:150, cellClass:"text-center" ,
-			cellEditor: 'agRichSelectCellEditor',
-			cellEditorParams: { values: gagaAgGrid.extractValues(ibSupplyComList) },
-			valueFormatter: function (params) { return gagaAgGrid.lookupValue(ibSupplyComList, params.value); },
-			valueParser: function (params) { return gagaAgGrid.lookupKey(ibSupplyComList, params.newValue);}
+		{ headerName: "입점업체코드" , field:"supplyCompCd" , width:150, cellClass:"text-center"
+			// cellEditor: 'agRichSelectCellEditor',
+			// cellEditorParams: { values: gagaAgGrid.extractValues(ibSupplyComList) },
+			// valueFormatter: function (params) { return gagaAgGrid.lookupValue(ibSupplyComList, params.value); },
+			// valueParser: function (params) { return gagaAgGrid.lookupKey(ibSupplyComList, params.newValue);}
 		} ,
+		{ headerName: "입점업체명"  , field: "supplyCompNm" , width: 120 , cellClass: 'text-center'},
 		{ headerName: "쿠폰분담율(%)", field:"burdenRate" , width:150, cellClass: "text-center" ,
 		  cellEditorParams: { maxlength: 10, required: true }
 		} ,
@@ -760,8 +780,8 @@
 	$('#btnExcepGoodsDel').on('click', function() {
 		excepGoodsGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(excepGoodsGridOptions)});
 	});
-	// 6.입점업체
-	$('#btnDelRow').on('click', function() {
+	// 업체분담율 선택삭제 버튼 클릭시
+	$('#CouponForm #btnDelApplyBurden').on('click', function() {
 		inComGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(inComGridOptions)});
 	});
 	// 7.선착순
@@ -779,6 +799,10 @@
 		var data = { cpnId: 1 ,limitCpnNm: null, downStDate: _today, downStTime: '00:00:00', downEdDate: _today, downEdTime: '23:59:59', downLimitQty: null, limitCpnId: null  };
 		gagaAgGrid.addRowData(limitedTimeCpnGridOptions, data, "limitCpnNm");
 	});
+	// 업체분담율 추가 버튼 클릭시
+	$('#CouponForm #btnAddApplyBurden').on('click', function() {
+		cfnOpenCompanyListPopup("fnSetPopupApplyBurdenInfo" ,"M");
+	});
 
 	// 선착순 쿠폰 행삭제
 	/*$('#btnDelLimitedTimeCpnRow').on('click', function() {
@@ -811,6 +835,25 @@
 	});
 	*/
 
+	// 분담업체율 설정 / 업체 추가 콜백함수
+	var fnSetPopupApplyBurdenInfo = function(result) {
+		// 기존 리스트 데이터 for
+		for(let i = 0 ; i < result.length ; i++) {
+			let addChk = true, gridListValue = gagaAgGrid.getAllRowData(inComGridOptions);		// 받아온 모든 데이터
+
+			// 받아온 data for
+			for(let j = 0 ; j < gridListValue.length ; j++) {
+				// 동일한 data는 추가하지 않음
+				if(gridListValue[j].supplyCompCd == result[i].supplyCompCd) {	addChk = false;	}		// 중복체크
+			}
+
+			// 중복되지 않은 데이터 리스트에 추가
+			if(addChk) {
+				gagaAgGrid.addRowData(inComGridOptions, {"supplyCompCd" : result[i].supplyCompCd, "supplyCompNm" : result[i].supplyCompNm, "delYn" : result[i].delYn});
+			}
+		}
+	};
+
 	// 선착순 쿠폰 체크박스 클릭시
 	$("#CouponForm #limitedTimeCpnBox").bind('click', function (){
 		var chkBox= document.getElementById('limitedTimeCpnYn').checked;
@@ -1597,19 +1640,27 @@ console.log('jsonData::'+jsonData);
 			goodsGbVal = "G800_30";
 		}
 
+		let addCnt = 0;
+		let failCnt = 0;
+		let dupliCnt = 0;
+
 		for(let i = 0 ; i < result.length ; i++) {
 			let addChk = true, gridListValue = gagaAgGrid.getAllRowData(OriginGridListOption);		// 받아온 모든 데이터
 
 			// 받아온 data for
 			for(let j = 0 ; j < gridListValue.length ; j++) {
-				if(gridListValue[j].goodsCd == result[i].goodsCd) {	addChk = false;	}				// 중복체크
+				if(gridListValue[j].goodsCd == result[i].goodsCd) {	addChk = false;	dupliCnt++;}				// 중복체크
 			}
 
 			// 중복되지 않은 데이터 리스트에 추가
 			if(addChk) {
 				gagaAgGrid.addRowData(OriginGridListOption, {"goodsGb": goodsGbVal, "goodsCd" : result[i].goodsCd, "goodsNm" : result[i].goodsNm});
+				addCnt++;
 			}
 		}
+		uifnPopupClose('popupGoods');
+		failCnt = result.length - addCnt - dupliCnt;
+		mcxDialog.alert("데이터가 적용되었습니다.<br/>" + addCnt + "건 성공, "+ dupliCnt + "건 중복, " + failCnt + "건 실패");
 	}
 
 	// 기간 일수 변경시
@@ -1964,6 +2015,7 @@ console.log('jsonData::'+jsonData);
 			randomCouponGridOptions.api.setRowData(randomCpnList);
 			limitedTimeCpnGridOptions.api.setRowData(limitedTimeCpnList);
 			afLinkOptions.api.setRowData(afChannelList);
+
 			// 기본정보 세팅
 			$("#CouponForm input:radio[name='rdoDcWay']:radio[value=" + cpnDetail.dcWay + "]").prop('checked', true);
 			$("#CouponForm input:radio[name='rdoCpnType']:radio[value=" + cpnDetail.cpnType + "]").prop('checked', true);