xyzp1539 5 лет назад
Родитель
Сommit
849fba1d28

+ 12 - 6
src/main/java/com/style24/admin/biz/dao/TsaCouponDao.java

@@ -3,13 +3,10 @@ package com.style24.admin.biz.dao;
 import java.util.ArrayList;
 import java.util.Collection;
 
-import com.style24.persistence.domain.CouponBurden;
-import com.style24.persistence.domain.CouponRefval;
+import com.style24.persistence.domain.*;
 import org.springframework.stereotype.Component;
 
 import com.style24.core.support.annotation.ShopDs;
-import com.style24.persistence.domain.CommonCode;
-import com.style24.persistence.domain.Coupon;
 import org.springframework.stereotype.Component;
 
 /**
@@ -154,10 +151,19 @@ public interface TsaCouponDao {
 
 	/**
 	 * 쿠폰 적용대상 삭제
-	 * @param  coupon
+	 * @param  couponRefval
 	 * @return
 	 * @author xyzp1539
 	 * @since 2021-01-19
 	 */
-    void updateCouponRefval(Coupon coupon);
+    void updateCouponRefval(CouponRefval couponRefval);
+
+    /**
+     * 고객 쿠폰 발행
+     * @param  custPub
+     * @return
+     * @author xyzp1539
+     * @since 2021-01-21
+     */
+	void saveCouponCustPub(CustCoupon custPub);
 }

+ 37 - 18
src/main/java/com/style24/admin/biz/service/TsaCouponService.java

@@ -8,9 +8,7 @@ import java.util.Date;
 
 import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
-import com.style24.persistence.domain.CommonCode;
-import com.style24.persistence.domain.CouponBurden;
-import com.style24.persistence.domain.CouponRefval;
+import com.style24.persistence.domain.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -20,7 +18,6 @@ import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.style24.admin.biz.dao.TsaCouponDao;
 import com.style24.admin.support.security.session.TsaSession;
-import com.style24.persistence.domain.Coupon;
 
 import lombok.extern.slf4j.Slf4j;
 
@@ -70,10 +67,9 @@ public class TsaCouponService {
 		Collection<CouponRefval> supplyCompList = gson.fromJson(params.getSupplyCompList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
 		for(CouponRefval supplyComp : supplyCompList) {
 			sequence = null;
+
 			if(supplyComp.getCpnRefvalSq() != null && supplyComp.getCpnRefvalSq() > 0){
 				sequence = supplyComp.getCpnRefvalSq();
-			} else {
-				sequence = commonService.getNextSequence("SEQ_COUPON_REFVAL");
 			}
 
 			supplyComp.setCpnId(cpnId);
@@ -88,10 +84,9 @@ public class TsaCouponService {
 		Collection<CouponRefval> brandList = gson.fromJson(params.getBrandList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
 		for(CouponRefval brand : brandList) {
 			sequence = null;
+
 			if(brand.getCpnRefvalSq() != null && brand.getCpnRefvalSq() > 0){
 				sequence = brand.getCpnRefvalSq();
-			} else {
-				sequence = commonService.getNextSequence("SEQ_COUPON_REFVAL");
 			}
 
 			brand.setCpnId(cpnId);
@@ -107,10 +102,9 @@ public class TsaCouponService {
 		Collection<CouponRefval> applyGoodsList = gson.fromJson(params.getApplyGoodsList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
 		for(CouponRefval applyGoods : applyGoodsList ) {
 			sequence = null;
+
 			if(applyGoods.getCpnRefvalSq() != null && applyGoods.getCpnRefvalSq() > 0){
 				sequence = applyGoods.getCpnRefvalSq();
-			} else {
-				sequence = commonService.getNextSequence("SEQ_COUPON_REFVAL");
 			}
 			applyGoods.setCpnId(cpnId);
 			applyGoods.setCpnRefvalSq(sequence);
@@ -125,10 +119,9 @@ public class TsaCouponService {
 		Collection<CouponRefval> cateList = gson.fromJson(params.getCateList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
 		for(CouponRefval cate : cateList ) {
 			sequence = null;
+
 			if(cate.getCpnRefvalSq() != null && cate.getCpnRefvalSq() > 0){
 				sequence = cate.getCpnRefvalSq();
-			} else {
-				sequence = commonService.getNextSequence("SEQ_COUPON_REFVAL");
 			}
 			cate.setCpnId(cpnId);
 			cate.setCpnRefvalSq(sequence);
@@ -145,11 +138,11 @@ public class TsaCouponService {
 		Collection<CouponRefval> exceptGoodsList = gson.fromJson(params.getExceptGoodsList() , new TypeToken<Collection<CouponRefval>>(){}.getType());
 		for(CouponRefval exceptGoods: exceptGoodsList ) {
 			sequence = null;
+
 			if(exceptGoods.getCpnRefvalSq() != null && exceptGoods.getCpnRefvalSq() > 0){
 				sequence = exceptGoods.getCpnRefvalSq();
-			} else {
-				sequence = commonService.getNextSequence("SEQ_COUPON_REFVAL");
 			}
+
 			exceptGoods.setCpnId(cpnId);
 			exceptGoods.setCpnRefvalSq(sequence);
 			exceptGoods.setCpnTarget("G260_14");
@@ -317,14 +310,40 @@ public class TsaCouponService {
 
 	/**
 	 * 쿠폰 적용대상 삭제
-	 * @param   coupon
+	 * @param   couponRefval
 	 * @return
 	 * @author xyzp1539
 	 * @since 2021-01-19
 	 */
 	@Transactional("shopTxnManager")
-	public void updateCouponRefval(Coupon coupon) {
-		coupon.setUpdNo(TsaSession.getInfo().getUserNo());
-		couponDao.updateCouponRefval(coupon);
+	public void updateCouponRefval(CouponRefval couponRefval) {
+		couponRefval.setUpdNo(TsaSession.getInfo().getUserNo());
+		couponDao.updateCouponRefval(couponRefval);
+	}
+
+	/**
+	 * 고객 쿠폰
+	 * @param
+	 * @return
+	 * @author xyzp1539
+	 * @since 2021-01-21
+	 */
+	@Transactional("shopTxnManager")
+	public void saveCouponCustPub(CustCoupon custCoupon) {
+		Gson gson = new Gson();
+
+		Collection<CustCoupon> custPubList = gson.fromJson(custCoupon.getCustList() , new TypeToken<Collection<CustCoupon>>(){}.getType());
+		for(CustCoupon custPub : custPubList ) {
+			custPub.setCpnId(custCoupon.getCpnId());
+			custPub.setAvailStdt(custCoupon.getAvailStdt());
+			custPub.setAvailEddt(custCoupon.getAvailEddt());
+			custPub.setPubReason(custCoupon.getPubReason());
+			custPub.setPubReasonDtl(custCoupon.getPubReasonDtl());
+			custPub.setEndAlimSendYn(custCoupon.getEndAlimSendYn());
+			custPub.setRegNo(TsaSession.getInfo().getUserNo());
+			custPub.setUpdNo(TsaSession.getInfo().getUserNo());
+
+			couponDao.saveCouponCustPub(custPub);
+		}
 	}
 }

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

@@ -5,6 +5,7 @@ import java.util.Collection;
 import java.util.List;
 
 import com.style24.persistence.TscPageRequest;
+import com.style24.persistence.domain.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
@@ -28,13 +29,6 @@ import com.style24.admin.biz.service.TsaSystemService;
 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.CommonCode;
-import com.style24.persistence.domain.Coupon;
-import com.style24.persistence.domain.FreeGoodsPromotion;
-import com.style24.persistence.domain.MoreBetter;
-import com.style24.persistence.domain.MoreBetterBurden;
-import com.style24.persistence.domain.MoreBetterGoods;
-import com.style24.persistence.domain.MoreBetterSection;
 
 import lombok.extern.slf4j.Slf4j;
 
@@ -266,7 +260,7 @@ public class TsaMarketingController extends TsaBaseController {
 		// 쿠폰상태 조회
 		mav.addObject("cpnStatList", rendererService.getCommonCodeList("G232"));
 		// 쿠폰 유형 조회
-		mav.addObject("cpnTypeList", rendererService.getCommonCodeList("G230"));
+		mav.addObject("cpnTypeList", rendererService.getCommonCodeList("G230" , "Y"));
 		// 사용가능 고객구분 조회
 		mav.addObject("usableCustGbList", rendererService.getCommonCodeList("G100"));
 		// 사용가능 고객등급 조회
@@ -330,21 +324,29 @@ public class TsaMarketingController extends TsaBaseController {
 
 	/**
 	 * 쿠폰 적용대상 삭제수정
-	 * @param coupon
+	 * @param CouponRefval
 	 * @return
-	 * @author xyzp1539m
+	 * @author xyzp1539
 	 * @since 2021-01-19
 	 */
 	@PostMapping("/coupon/refval/update")
 	@ResponseBody
-	public GagaResponse updateCouponRefval(@RequestBody Coupon coupon) {
-		log.info("couponSave : {}", coupon);
+	public GagaResponse updateCouponRefval(@RequestBody CouponRefval CouponRefval) {
+		log.info("couponSave : {}", CouponRefval);
 
-		couponService.updateCouponRefval(coupon);
+		couponService.updateCouponRefval(CouponRefval);
 
 		return super.ok(message.getMessage("SUCC_0001"));
 	}
 
+
+	/**
+	 * 쿠폰발행팝업
+	 * @param
+	 * @return
+	 * @author xyzp1539
+	 * @since 2021-01-21
+	 */
 	@GetMapping("/coupon/cpnPubForCust/popup/form")
 	@ResponseBody
 	public ModelAndView couponPubForCustPopup() {
@@ -402,6 +404,22 @@ public class TsaMarketingController extends TsaBaseController {
 
 		return mav;
 	}
+
+	/**
+	 * 고객 쿠폰 발행
+	 * @param  custCoupon
+	 * @return
+	 * @author xyzp1539
+	 * @since 2021-01-21
+	 */
+	@PostMapping("/coupon/insertCustPub")
+	@ResponseBody
+	public GagaResponse saveCouponCustPub(@RequestBody CustCoupon custCoupon ){
+		couponService.saveCouponCustPub(custCoupon);
+
+		return super.ok(message.getMessage("SUCC_0006"));
+
+	}
 	/* // JSM 진행 */
 
 	/* CSB 진행 */

+ 2 - 2
src/main/java/com/style24/persistence/domain/CouponRefval.java

@@ -37,7 +37,7 @@ public class CouponRefval extends TscBaseDomain {
     private String  cateNo;                 // 카테고리코드
     private String  cateList;               // 카테고리 리스트
     private String  formalGb;               // 이월정상구분
-
-
+    private String  siteCd;                 // 사이트코드
+    private String  cateGb;                 // 카테고리구분
 
 }

+ 28 - 0
src/main/java/com/style24/persistence/domain/CustCoupon.java

@@ -0,0 +1,28 @@
+package com.style24.persistence.domain;
+
+import com.style24.persistence.TscBaseDomain;
+import com.style24.persistence.TscPageRequest;
+import lombok.Data;
+import org.codehaus.groovy.runtime.dgmimpl.arrays.IntegerArrayGetAtMetaMethod;
+
+/**
+ * 고객쿠폰 도메인
+ * @author xyzp1539
+ * @since 2020-12-21
+ */
+@SuppressWarnings("serial")
+@Data
+public class CustCoupon extends TscBaseDomain {
+    private Integer custCpnSq;              // 고객쿠폰일련번호
+    private Integer custNo;                 // 고객번호
+    private String  cpnId;                  // 쿠폰아이디
+    private String  availStdt;              // 유효시작일시
+    private String  availEddt;              // 유효종료일시
+    private String  pubReason;              // 발행사유(공통코드G250)
+    private String  pubReasonDtl;           // 발행사유상세
+    private String  usedDt;                 // 사용된일시
+    private String  endAlimSendYn;          // 만료알림발송여부
+
+    // 그리드 컬럼
+    private String  custList;
+}

+ 39 - 5
src/main/java/com/style24/persistence/mybatis/shop/TsaCoupon.xml

@@ -286,8 +286,10 @@
 	<insert id="saveCouponRefVal" parameterType="Coupon">
 		/* TsaCoupon.saveCouponRefVal */
 		INSERT INTO TB_COUPON_REFVAL (
-			CPN_REFVAL_SQ
-		  , CPN_ID
+		    CPN_ID
+		  <if test='cpnRefvalSq != null and cpnRefvalSq > 0'>
+		  , CPN_REFVAL_SQ
+		  </if>
 		  , CPN_TYPE
 		  , CPN_TARGET
 		  , REF_VAL
@@ -302,8 +304,10 @@
 		  , UPD_NO
 		  , UPD_DT
 		)
-		SELECT #{cpnRefvalSq}
-			 , CPN_ID
+		SELECT CPN_ID
+		     <if test="cpnRefvalSq != null and cpnRefvalSq > 0">
+			 , #{cpnRefvalSq}
+			 </if>
 			 , CPN_TYPE
 			 , #{cpnTarget}
 			 , #{refVal}
@@ -497,7 +501,7 @@
 	</select>
 
 	<!-- 쿠폰 적용대상 수정-->
-	<update id="updateCouponRefval" >
+	<update id="updateCouponRefval" parameterType="CouponRefval" >
 		/* TsaCoupon.updateCouponRefval */
 		UPDATE TB_COUPON_REFVAL
 		   SET DEL_YN = 'Y'
@@ -510,4 +514,34 @@
 		  </foreach>
 	</update>
 
+	<!-- 고객 쿠폰 발행 -->
+	<insert id="saveCouponCustPub" parameterType="CustCoupon">
+		/* TsaCoupon.saveCouponCustPub */
+		INSERT INTO TB_CUST_COUPON (
+			CUST_NO
+		  , CPN_ID
+		  , AVAIL_STDT
+		  , AVAIL_EDDT
+		  , PUB_REASON
+		  , PUB_REASON_DTL
+          , END_ALIM_SEND_YN
+          , REG_NO
+          , REG_DT
+          , UPD_NO
+          , UPD_DT
+		) VALUES (
+		    #{custNo}
+		  , #{cpnId}
+		  , DATE_FORMAT(#{availStdt} , '%Y-%m-%d')
+		  , DATE_FORMAT(#{availEddt} , '%Y-%m-%d')
+		  , #{pubReason}
+		  , #{pubReasonDtl}
+		  , #{endAlimSendYn}
+		  , #{regNo}
+		  , now()
+		  , #{updNo}
+		  , now()
+		)
+	</insert>
+
 </mapper>

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

@@ -211,6 +211,7 @@
 					return !gagajf.isNull(params.value) ? params.value.toDate("YYYY-MM-DD HH:mm:ss").format("YYYY-MM-DD HH:mm:ss") : '';
 				}
 			},
+			{headerName: "유효일수", field: "availDays", width: 140, cellClass: 'text-center'},
 			{headerName: "등록자", field: "regNm", width: 150, cellClass: 'text-center'},
 			{headerName: "등록일시", field: "regDt", width: 140, cellClass: 'text-center' ,
 				cellRenderer: function(params) {

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

@@ -28,6 +28,7 @@
 				<input type="hidden" name="exceptGoodsList" id="excepGoodsList">
 				<input type="hidden" name="burdenList" id="burdenList">
 				<input type="hidden" name="cateList" id="cateList">
+				<input type="hidden" name="cpnId2" id="cpnId2" th:if="${cpnDetail}" th:value="${cpnDetail.cpnId}">
 
 				<div class="tabs">
 					<div class="tabsNav">
@@ -333,11 +334,11 @@
 						<!-- 쿠폰적용대상-->
 						<li class="tab" id="coupontab2" >
 							<div class="panelStyle">
-								<div class="panelTitle">
-									<h2 style="position: relative">적용 대상 상품 등록</h2>
-								</div>
 								<div class="inner-panelContent">
 									<div class="panelContent">
+										<div class="panelBar">
+											<h4>적용 대상 상품 등록</h4>
+										</div>
 										<table class="frmStyle">
 											<colgroup>
 												<col style="width:15%;">
@@ -392,11 +393,11 @@
 										</table>
 									</div>
 								</div>
-								<div class="panelTitle">
-									<h2 style="position: relative">적용 제외 대상 상품 등록</h2>
-								</div>
 								<div class="inner-panelContent">
 									<div class="panelContent">
+										<div class="panelBar">
+											<h4>적용 대상 상품 등록</h4>
+										</div>
 										<table class="frmStyle">
 											<colgroup>
 												<col style="width:15%;">
@@ -427,6 +428,7 @@
 								<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>
 
@@ -504,7 +506,7 @@
 		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
 		{ headerName: "상품구분" , field: "goodsGb" , width: 100, cellClass: 'text-center'} ,
 		{ headerName: "Product ID" , field: "goodsCd" , width: 120, cellClass: 'text-center'},
-		{ headerName: "상품명"  , field: "goodsNm" , width: 120 , cellClass: 'text-center'} ,
+		{ headerName: "상품명"  , field: "goodsNm" , width: 250 , cellClass: 'text-center'} ,
 		{ headerName: "쿠폰대상일련번호"  , field: "cpnRefvalSq" , width: 120 , cellClass: 'text-center' , hide:true}
 	];
 
@@ -545,7 +547,7 @@
 		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
 		{ headerName: "상품구분" , field: "goodsGb" , width: 100, cellClass: 'text-center'} ,
 		{ headerName: "Product ID" , field: "goodsCd" , width: 120, cellClass: 'text-center'},
-		{ headerName: "상품명"  , field: "goodsNm" , width: 120 , cellClass: 'text-center'} ,
+		{ headerName: "상품명"  , field: "goodsNm" , width: 250 , cellClass: 'text-center'} ,
 		{ headerName: "쿠폰대상일련번호"  , field: "cpnRefvalSq" , width: 120 , cellClass: 'text-center' , hide:true}
 	];
 
@@ -762,29 +764,26 @@
 			mcxDialog.alert("선택된 행이 없습니다");
 			return;
 		}
-		// 상세조회면 데이터까지 삭제
-		if(cpnDetail != null ) {
-			var removeVal = gagaAgGrid.removeRowData(brandGridOptions , false);
-			var cpnRefvalSqArr = [];
 
-			$.each(selectVal , function(idx , item){
-				cpnRefvalSqArr.push(item.cpnRefvalSq);
-			});
+		if(cpnDetail != null ) {
+			mcxDialog.confirm('삭제하시겠습니까?', {
+				cancelBtnText: "취소",
+				sureBtnText: "확인",
+				sureBtnClick: function(){
+					gagaAgGrid.removeRowData(brandGridOptions , false);
+					var cpnRefvalSqArr = [];
 
-			if(removeVal.length > 0) {
-				mcxDialog.confirm('삭제하시겠습니까?', {
-					cancelBtnText: "취소",
-					sureBtnText: "확인",
-					sureBtnClick: function(){
-						var data = { cpnRefvalSqArr : cpnRefvalSqArr
-							,cpnId : cpnDetail.cpnId
-						};
+					$.each(selectVal , function(idx , item){
+						cpnRefvalSqArr.push(item.cpnRefvalSq);
+					});
+					var data = { cpnRefvalSqArr : cpnRefvalSqArr
+						,cpnId : cpnDetail.cpnId
+					};
 
-						var jsonData = JSON.stringify(data);
-						gagajf.ajaxJsonSubmit('/marketing/coupon/refval/update', jsonData);
-					}
-				});
-			}
+					var jsonData = JSON.stringify(data);
+					gagajf.ajaxJsonSubmit('/marketing/coupon/refval/update', jsonData);
+				}
+			});
 		} else {
 			// 신규화면이면 그리드상 삭제
 			brandGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(brandGridOptions)});
@@ -1098,6 +1097,12 @@
 		var data = { supplyCompCd: null , burdenRate : null , delYn : null};
 		gagaAgGrid.addRowData(inComGridOptions , data , "supplyCompCd" );
 	});
+	// 행삭제시
+	$('#btnDelRow').on('click' , function(){
+		inComGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(inComGridOptions)});
+	});
+
+
 
 	// 쿠폰번호 자동생성 클릭시
 	function clickCreateChk(){

+ 63 - 12
src/main/webapp/WEB-INF/views/marketing/CouponPubForCustPopupForm.html

@@ -4,7 +4,7 @@
 <!--
  *******************************************************************************
  * @source  : CouponPubForCustPopupForm.html
- * @desc    : 쿠폰 등록 팝업 화면
+ * @desc    : 고객 쿠폰 발행 팝업 화면
  *============================================================================
  * ISTYLE24
  * Copyright(C) 2020 TSIT, All rights reserved.
@@ -22,7 +22,6 @@
 		</div>
 		<div class="panelContent">
 			<form id="custSearchForm" name="custSearchForm" action="#" th:action="@{'/customer/active/list'}" >
-				<input type="hidden" name="custList" id="custList">
 				<table class="frmStyle">
 					<colgroup>
 						<col width="10%">
@@ -75,7 +74,9 @@
 				<input type="button" value="조회" class="btn btn-info btn-lg" onclick="fnSearchPubCustList()">
 			</div>
 			<div id="pubCustgridList" style="width:100%; height:420px;" class="ag-theme-balham"></div>
-			<form id="pubRegForm" name="pubRegForm">
+			<form id="pubRegForm" name="pubRegForm" th:action="@{'/marketing/coupon/insertCustPub'}">
+				<input type="hidden" name="custList" id="custList">
+				<input type="hidden" name="cpnId" id="cpnId">
 				<table class="frmStyle">
 					<colgroup>
 						<col width="10%">
@@ -87,7 +88,7 @@
 					<tr>
 						<th class="availDateTr">유효기간시작일시<em class="required" title="필수"></em></th>
 						<td class="availDateTr">
-							<input type="hidden" name="availStdt" id="availStdt" data-valid-name="유효기간시작일시">
+							<input type="hidden" name="availStdt" id="availStdt" data-valid-name="유효기간시작일시" required="required">
 							<input type="text" class="schDate w100" name="availStDay" id="availStDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
 							<select name="availStHH" id="availStHH">
 								<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
@@ -97,7 +98,7 @@
 							</select>
 						<th class="availDateTr">유효기간종료일시<em class="required" title="필수"></em></th>
 						<td class="availDateTr">
-							<input type="hidden" id="availEddt" name="availEddt" data-valid-name="유효기간종료일시">
+							<input type="hidden" id="availEddt" name="availEddt" data-valid-name="유효기간종료일시" required="required">
 							<input type="text" class="schDate w100" name="availEdDay" id="availEdDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
 							<select name="availEdHH" id="availEdHH">
 								<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
@@ -108,12 +109,19 @@
 						</td>
 					</tr>
 					<tr>
-						<th>발급사유</th>
-						<td colspan="5">
-							<select name="pubReason" id="pubReason">
+						<th>발급사유<em class="required" title="필수"></em></th>
+						<td>
+							<select name="pubReason" id="pubReason" required="required" data-valid-name="발급사유">
 								<option th:if="${cpnPubReasonList}" th:each="oneData , status : ${cpnPubReasonList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
 							</select>
 						</td>
+						<th>만료알림발송여부<em class="required" title="필수"></em></th>
+						<td>
+							<select name="endAlimSendYn" id="endAlimSendYn" data-valid-name="만료알림발송여부" required="required">
+								<option value="Y">Y</option>
+								<option value="N" selected="selected">N</option>
+							</select>
+						</td>
 					</tr>
 					<tr>
 						<th>상세사유</th>
@@ -135,10 +143,8 @@
 	var siteCdList = gagajf.convertToArray([[${siteCdList}]]);
 	var usableCustGbList = gagajf.convertToArray([[${usableCustGbList}]]);
 	var usableCustGradeList = gagajf.convertToArray([[${usableCustGradeList}]]);
-	var cpnPubReasonList = gagajf.convertToArray([[${cpnPubReasonList}]]);
 
 	var columnDefs = [
-		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
 		{ headerName: "사이트" , field:"siteCd" , width:100, cellClass:"text-center" ,
 			cellEditor: 'agRichSelectCellEditor',
 			cellEditorParams: { values: gagaAgGrid.extractValues(siteCdList) },
@@ -170,13 +176,58 @@
 	}
 
 	function fnCpnPubCustomer(){
-		
+		setReqValue();
+		checkValidation();
+
+		var fromDate = $('#pubRegForm input[name=availStdt]').val();
+		var toDate = $('#pubRegForm input[name=availEddt]').val();
+
+		if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
+			mcxDialog.alertC("유효기간 시작일자와 종료일자를 입력하세요.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$('#pubRegForm input[name=availStdt]').focus();
+				}
+			});
+			return false;
+		}
+
+		if (fromDate > toDate) {
+			mcxDialog.alertC("등록 시작일자는 종료일자 보다 클 수 없습니다.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$('#pubRegForm input[name=availEddt]').focus();
+				}
+			});
+			return false;
+		}
+
+		var selectVal = gagaAgGrid.getAllRowData(pubCustGridOptions);
+		if(selectVal.length < 1) {
+			mcxDialog.alert("발행하고자 하는 회원이 없습니다.");
+			return false;
+		}
+
+		mcxDialog.confirm('발행하시겠습니까?' , {
+			cancelBtnText: "취소",
+			sureBtnText: "확인" ,
+			sureBtnClick: function(){
+				gagajf.ajaxFormSubmit($("#pubRegForm").prop('action') , "#pubRegForm" , function(){
+					uifnPopupClose('CpnPubForCustPopup');
+				});
+			}
+		});
 	}
 	
-	function setReqVal(){
+	function setReqValue(){
 		// 유효기간 세팅
 		$('#pubRegForm #availStdt').val($('#pubRegForm #availStDay').val() + " " + $('#pubRegForm #availStHH').val() + ":" + $('#pubRegForm #availStMM').val() + ":00");
 		$('#pubRegForm #availEddt').val($('#pubRegForm #availEdDay').val() + " " + $('#pubRegForm #availEdHH').val() + ":" + $('#pubRegForm #availEdMM').val() + ":59");
+		// 회원 그리드값 세팅
+		var custAllData = gagaAgGrid.getAllRowData(pubCustGridOptions);
+		var jsonCustPubData = JSON.stringify(custAllData);
+		$("#pubRegForm #custList").val(jsonCustPubData);
+		$("#pubRegForm #cpnId").val($("#CouponForm #cpnId2").val());
 	}
 
 	$(document).ready(function(){