Explorar o código

쿠폰 수정

bin2107 %!s(int64=5) %!d(string=hai) anos
pai
achega
90142ff896

+ 4 - 1
src/main/java/com/style24/persistence/domain/Brand.java

@@ -21,6 +21,7 @@ public class Brand extends TscBaseDomain {
 	private String brandKnm;		// 브랜드한글명
 	private String dispNmLang;		// 노출명언어
 	private String rgbCd;			// RGB코드(front 브랜드메인 GNB 색상)
+	private int brandGroupNo;		// 브랜드그룹번호
 	private String brandGrpNm;		// 브랜드그룹명
 	private String supplyCompCd;	// 공급업체코드
 	private String supplyCompNm;	// 공급업체명
@@ -44,9 +45,11 @@ public class Brand extends TscBaseDomain {
 
 	private String newSysFileNm;	//신규이미지파일명
 
+	private String brandSupplyListInfo;	//브래드의 업체정보
+
 	// 검색조건
 	private String searchTxt;		// 검색어
-	private String callbackFn;	// 콜백함수
+	private String callbackFn;		// 콜백함수
 	private String multiGb;			// 멀티 셀렉트 구분
 	private String searchBrandCd;
 	private String searchBrandNm;

+ 3 - 9
src/main/java/com/style24/scm/biz/web/TssBusinessController.java

@@ -194,14 +194,6 @@ public class TssBusinessController extends TssBaseController {
 	@PostMapping("/brand/list")
 	@ResponseBody
 	public Collection<Brand> getBrandList(Brand brand) {
-		log.info("getBrandList>>>>{}",brand);
-		// multi row 검색관련 처리
-		if (!StringUtils.isBlank(brand.getSearchBrandCd())) {
-			brand.setMultiBrandCd(brand.getSearchBrandCd().replaceAll("\r", "").trim().split("\n"));
-		}
-		if (!StringUtils.isBlank(brand.getSearchBrandNm())) {
-			brand.setMultiBrandNm(brand.getSearchBrandNm().replaceAll("\r", "").trim().split("\n"));
-		}
 
 		return businessService.getBrandList(brand);
 	}
@@ -232,7 +224,9 @@ public class TssBusinessController extends TssBaseController {
 	@GetMapping("/brand/search/form")
 	public ModelAndView brandSearchForm(Brand brand) {
 		ModelAndView mav = new ModelAndView();
-
+		if ("G001_B000".equals(TssSession.getInfo().getRoleCd())) {
+			brand.setSupplyCompCd(TssSession.getInfo().getSupplyCompCd());
+		}
 		mav.addObject("params", brand);
 		mav.setViewName("business/BrandPopupForm");
 		return mav;

+ 38 - 4
src/main/java/com/style24/scm/biz/web/TssMarketingController.java

@@ -9,6 +9,9 @@ import java.util.Iterator;
 
 import com.style24.core.biz.service.TscCouponService;
 import com.style24.persistence.domain.CommonCode;
+import com.style24.persistence.domain.Plan;
+import com.style24.persistence.domain.Coupon;
+import com.style24.scm.biz.service.TssBusinessService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -30,8 +33,6 @@ import com.gagaframework.web.util.GagaFileUtil;
 import com.style24.core.support.env.TscConstants;
 import com.style24.core.support.message.TscMessageByLocale;
 import com.style24.persistence.TscPageRequest;
-import com.style24.persistence.domain.Plan;
-import com.style24.persistence.domain.Coupon;
 import com.style24.scm.biz.service.TssPlanService;
 import com.style24.scm.biz.service.TssRendererService;
 import com.style24.scm.support.controller.TssBaseController;
@@ -64,6 +65,9 @@ public class TssMarketingController extends TssBaseController {
 
 	@Autowired
 	private TscCouponService coreCouponService;
+
+	@Autowired
+	private TssBusinessService businessService;
 	
 	@Value("${upload.default.target.path}")
 	private String uploadTargetPath;
@@ -585,7 +589,9 @@ public class TssMarketingController extends TssBaseController {
     @GetMapping("/coupon/form")
     public ModelAndView couponListForm() {
         ModelAndView mav = new ModelAndView();
-        log.info("form getSupplyCompCd ::::",TssSession.getInfo().getSupplyCompCd());
+		if ("G001_B000".equals(TssSession.getInfo().getRoleCd())) {
+			log.info("couponListForm getSupplyCompCd::::{}",TssSession.getInfo().getSupplyCompCd());
+		}
         // 쿠폰상태 목록
         String[] exceptCds = {"G232_14"};
         mav.addObject("cpnStatList", rendererService.getCommonCodeList("G232", "Y", exceptCds));
@@ -612,6 +618,7 @@ public class TssMarketingController extends TssBaseController {
 
         // 입점업체담당자는 업체코드 설정
 		if ("G001_B000".equals(TssSession.getInfo().getRoleCd())) {
+			log.info("getCouponList getSupplyCompCd::::{}",TssSession.getInfo().getSupplyCompCd());
 			param.setRegNo(TssSession.getInfo().getUserNo());
 		}
 
@@ -796,5 +803,32 @@ public class TssMarketingController extends TssBaseController {
 		mav.setViewName("marketing/CouponPubCustListPopupForm");
 		return mav;
 	}
-   
+
+	/**
+	 * 브랜드 팝업
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @since 2021-05-21
+	 */
+	@PostMapping("/brand/popup")
+	@ResponseBody
+	public Collection<Brand> getBrandListPop(@RequestBody Brand param) {
+		// 입점업체담당자는 업체코드 설정
+		if ("G001_B000".equals(TssSession.getInfo().getRoleCd())) {
+			param.setRegNo(TssSession.getInfo().getUserNo());
+		}
+
+		// multi row 검색관련 처리
+		if (!StringUtils.isBlank(param.getSearchBrandCd())) {
+			param.setMultiBrandCd(param.getSearchBrandCd().replaceAll("\r", "").split("\n"));
+		}
+
+		if (!StringUtils.isBlank(param.getSearchBrandNm())) {
+			param.setMultiBrandNm(param.getSearchBrandNm().replaceAll("\r", "").split("\n"));
+		}
+
+		Collection<Brand> brandList = businessService.getBrandList(param);
+		return brandList;
+	}
 }

+ 83 - 88
src/main/webapp/WEB-INF/views/business/BrandPopupForm.html

@@ -1,30 +1,32 @@
 <!DOCTYPE html>
-<html lang="ko"
-	  xmlns:th="http://www.thymeleaf.org">
+<html lang="ko" xmlns:th="http://www.thymeleaf.org">
 <!--
  *******************************************************************************
  * @source  : BrandPopupForm.html
  * @desc    : 브랜드 팝업 Page
  *============================================================================
- * STYLE24
+ * SISUN
  * Copyright(C) 2020 TSIT, All rights reserved.
  *============================================================================
  * VER  DATE         AUTHOR      DESCRIPTION
  * ===  ===========  ==========  =============================================
- * 1.0  2020.12.15   eskim       최초 작성
+ * 1.0  2021.5.21    bin2107       최초 작성
  *******************************************************************************
  -->
-<div class="modalPopup" data-width="650" id="popupBrandList">
-	<div class="panelStyle"  style="max-height:700px;overflow-y:scroll;">
-		<!-- TITLE -->
+
+<div class="modalPopup" data-width="650" id="popupBrand">
+
+	<div class="panelStyle" style="height: 750px;">
 		<div class="panelTitle">
 			<strong>브랜드 목록</strong>
-			<button type="button" class="close" onclick="uifnPopupClose('popupBrandList');"><em class="fa fa-times"></em></button>
+			<button type="button" class="close" onclick="uifnPopupClose('popupBrand')">
+				<i class="fa fa-times"></i>
+			</button>
 		</div>
-		<!-- //TITLE -->
-		<!-- 검색 조건 -->
+
 		<div class="panelContent">
-			<form id="searchBrandListForm" name="searchBrandListForm" action="#" th:action="@{'/business/brand/list'}" onsubmit="$('#btnSearchBrandList').trigger('click'); return false;">
+			<form id="popupBrandSearchForm" name="popupBrandSearchForm" action="#" th:action="@{'/marketing/brand/popup'}" onsubmit="$('#btnSearchBrandList').trigger('click'); return false;">
+				<input type="hidden" name="supplyCompCd" th:value="${params.supplyCompCd}">
 				<table class="frmStyle" aria-describedby="검색조건">
 					<colgroup>
 						<col style="width:15%;"/>
@@ -61,92 +63,85 @@
 					</li>
 				</ul>
 			</form>
-			<!-- 리스트 영역 -->
-			<div class="panelContent">
-				<div id="gridBrandList" style="width: 100%; height: 380px" class="ag-theme-balham"></div>
-			</div>
-			<!-- //리스트 영역 -->
-
-			<!-- 버튼 배치 영역 -->
-			<ul class="panelBar">
-				<li class="right">
-					<button type="button" class="btn btn-info btn-lg" id="btnConfirmBrand">확인</button>
-				</li>
-			</ul>
 		</div>
-		<!-- //검색 조건 -->
-	</div>
-
-	<script th:inline="javascript">
-		/*<![CDATA[*/
-		let headerSelection = false;
-		if([[${params.multiGb}]] == "M") headerSelection = true;
-		let columnDefsMdList = [
-			{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: headerSelection, checkboxSelection: true, filter: false},
-			{headerName: "브랜드번호", field: "brandCd", width: 100, cellClass: 'text-center'},
-			{headerName: "브랜드국문명", field: "brandEnm", width: 150, cellClass: 'text-center'},
-			{headerName: "브랜드영문명", field: "brandKnm", width: 150, cellClass: 'text-center'},
-			{headerName: "브랜드그룹명", field: "brandGroupNm", width: 150, cellClass: 'text-center'}
-		];
-
-		let gridOptionsBrandList = gagaAgGrid.getGridOptions(columnDefsMdList);
-		if(headerSelection) {	gridOptionsBrandList.rowSelection = "multiple";	}
-
-		// Row double click
-		gridOptionsBrandList.onRowDoubleClicked = function(event) {
-			$('#btnConfirmBrand').trigger('click');
-		}
-
-		// 조회
-		$('#btnSearchBrandList').on('click', function() {
-
-			if (gagajf.isNull($('#searchBrandListForm textarea[name=searchBrandCd]').val())  && gagajf.isNull($('#searchBrandListForm textarea[name=searchBrandNm]').val())){
-				mcxDialog.alert('검색조건을 입력하세요.');
-				return false;
-			}
-
-			// Fetch data
-			gagaAgGrid.fetch($('#searchBrandListForm').prop('action'), gridOptionsBrandList, '#searchBrandListForm');
-		});
+		<!-- 리스트 영역 -->
+		<div class="panelContent">
+			<div id="gridBrandList" style="width: 100%; height: 380px" class="ag-theme-balham"></div>
+		</div>
+		<!-- //리스트 영역 -->
 
-		// 확인
-		$('#btnConfirmBrand').on('click', function() {
-			var selectedData = gagaAgGrid.selectedRowData(gridOptionsBrandList);
+		<!-- 버튼 배치 영역 -->
+		<ul class="panelBar">
+			<li class="right">
+				<button type="button" class="btn btn-info btn-lg" id="btnConfirmBrand">확인</button>
+			</li>
+		</ul>
 
-			if (selectedData.length == 0) {
-				mcxDialog.alert('선택된 브랜드가 없습니다.');
-				return false;
-			}
+	</div>
+</div>
+<script th:inline="javascript">
+/*<![CDATA[*/
+
+	let headerSelection = false;
+	if([[${params.multiGb}]] == "M") headerSelection = true;
+	let columnDefsMdList = [
+		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: headerSelection, checkboxSelection: true, filter: false},
+		{headerName: "브랜드번호", field: "brandCd", width: 100, cellClass: 'text-center'},
+		{headerName: "브랜드국문명", field: "brandEnm", width: 150, cellClass: 'text-center'},
+		{headerName: "브랜드영문명", field: "brandKnm", width: 150, cellClass: 'text-center'},
+		{headerName: "브랜드그룹명", field: "brandGroupNm", width: 150, cellClass: 'text-center'}
+	];
+
+	let gridOptionsBrandList = gagaAgGrid.getGridOptions(columnDefsMdList);
+	if(headerSelection) {	gridOptionsBrandList.rowSelection = "multiple";	}
+
+	// Row double click
+	gridOptionsBrandList.onRowDoubleClicked = function(event) {
+		$('#btnConfirmBrand').trigger('click');
+	}
+
+	$('#btnSearchBrandList').on('click', function() {
+		var formId = '#popupBrandSearchForm';
+		// Fetch data
+		gagaAgGrid.fetch($(formId).prop('action'), gridOptionsBrandList, formId);
+	});
+
+	// 확인
+	$('#btnConfirmBrand').on('click', function() {
+		var selectedData = gagaAgGrid.selectedRowData(gridOptionsBrandList);
+
+		if (selectedData.length == 0) {
+			mcxDialog.alert('선택된 브랜드가 없습니다.');
+			return false;
+		}
 
-			var callbackFn = [[${params.callbackFn}]];
+		var callbackFn = [[${params.callbackFn}]];
 
-			var jsonData = JSON.stringify(selectedData);
+		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));
-						}
+		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('popupBrandList');
 			}
-		});
-
-		$(document).ready(function() {
-			// Create a agGrid
-			gagaAgGrid.createGrid('gridBrandList', gridOptionsBrandList);
+			uifnPopupClose('popupBrandList');
+		}
+	});
 
-			//$('#btnSearchBrandList').trigger('click');
-		});
-		/*]]>*/
-	</script>
+	$(document).ready(function() {
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridBrandList', gridOptionsBrandList);
 
-</div>
+		//$('#btnSearchBrandList').trigger('click');
+	});
+/*]]>*/
+</script>
 
-</html>
+</html>

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

@@ -14,17 +14,17 @@
  * 1.0  2020.12.23   xodud1202   최초 작성
  *******************************************************************************
  -->
-<div class="modalPopup" data-width="530" id="popupCompanyList">
+<div class="modalPopup" data-width="530" id="CompanyListpopup">
 	<div class="panelStyle"  style="max-height:700px;overflow-y:scroll;">
 		<!-- TITLE -->
 		<div class="panelTitle">
 			<strong>공급업체 목록</strong>
-			<button type="button" class="close" onclick="uifnPopupClose('popupCompanyList');"><em class="fa fa-times"></em></button>
+			<button type="button" class="close" onclick="uifnPopupClose('CompanyListpopup');"><em class="fa fa-times"></em></button>
 		</div>
 		<!-- //TITLE -->
 		<!-- 검색 조건 -->
 		<div class="panelContent">
-			<form id="searchCompanyListForm" name="searchCompanyListForm" action="#" th:action="@{'/business/supply/company/list'}" onsubmit="$('#btnSearchCompanyList').trigger('click'); return false;">
+			<form id="searchCompanyListForm" name="searchCompanyListForm" action="#" th:action="@{'/marketing/supply/company/list'}" onsubmit="$('#btnSearchCompanyList').trigger('click'); return false;">
 				<input type="hidden" name="searchGb" value="NAME" />		<!-- 공급업체 목록 검색 조건은 업체명으로만 -->
 				<table class="frmStyle" aria-describedby="검색조건">
 					<colgroup>

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

@@ -497,7 +497,7 @@
 
 	// 업체분담율 추가 버튼 클릭시
 	$('#CouponForm #btnAddApplyBurden').on('click', function() {
-		cfnOpenCompanyListPopup("fnSetPopupApplyBurdenInfo" ,"M");
+		cfnOpenCompanyListPopup("fnSetPopupApplyBurdenInfo" , "M" ,"","","N");
 	});
 
 	// 분담업체율 설정 / 업체 추가 콜백함수