xyzp1539 пре 5 година
родитељ
комит
6962a2f801

+ 9 - 7
src/main/java/com/style24/admin/biz/dao/TsaCouponDao.java

@@ -3,6 +3,8 @@ 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 org.springframework.stereotype.Component;
 
 import com.style24.core.support.annotation.ShopDs;
@@ -60,7 +62,7 @@ public interface TsaCouponDao {
 	 * @author xyzp1539
 	 * @since  2021-01-14
 	 */
-	void saveCouponRefVal(Coupon supplyComp);
+	void saveCouponRefVal(CouponRefval supplyComp);
 
 	/**
 	 * 쿠폰 입점업체 분담 등록
@@ -68,7 +70,7 @@ public interface TsaCouponDao {
 	 * @author xyzp1539
 	 * @since  2021-01-14
 	 */
-	void saveCouponBurden(Coupon burden);
+	void saveCouponBurden(CouponBurden burden);
 
 	/**
 	 * 자사브랜드 조회
@@ -103,7 +105,7 @@ public interface TsaCouponDao {
 	 * @author xyzp1539
 	 * @since 2021-01-18
 	 */
-	ArrayList<Coupon> getCouponRefvalExceptGoodsList(Coupon cpnRefval);
+	ArrayList<CouponRefval> getCouponRefvalExceptGoodsList(CouponRefval cpnRefval);
 
 	/**
 	 * 쿠폰 적용 대상 - 브랜드
@@ -112,7 +114,7 @@ public interface TsaCouponDao {
 	 * @author xyzp1539
 	 * @since 2021-01-18
 	 */
-	ArrayList<Coupon> getCouponRefvalBrandList(Coupon cpnRefval);
+	ArrayList<CouponRefval> getCouponRefvalBrandList(CouponRefval cpnRefval);
 
 	/**
 	 * 쿠폰 적용 대상 - 카테고리
@@ -121,7 +123,7 @@ public interface TsaCouponDao {
 	 * @author xyzp1539
 	 * @since 2021-01-18
 	 */
-	ArrayList<Coupon> getCouponRefvalCategoryList(Coupon cpnRefval);
+	ArrayList<CouponRefval> getCouponRefvalCategoryList(CouponRefval cpnRefval);
 
 	/**
 	 * 쿠폰 적용 대상 - 적용/제외상품
@@ -130,7 +132,7 @@ public interface TsaCouponDao {
 	 * @author xyzp1539
 	 * @since 2021-01-18
 	 */
-	ArrayList<Coupon> getCouponRefvalGoodsList(Coupon cpnRefval);
+	ArrayList<CouponRefval> getCouponRefvalGoodsList(CouponRefval cpnRefval);
 
 	/**
 	 * 쿠폰 적용 대상 - 공급처
@@ -139,7 +141,7 @@ public interface TsaCouponDao {
 	 * @author xyzp1539
 	 * @since 2021-01-18
 	 */
-	ArrayList<Coupon> getCouponRefvalSupplyCompList(Coupon cpnRefval);
+	ArrayList<CouponRefval> getCouponRefvalSupplyCompList(CouponRefval cpnRefval);
 
 	/**
 	 * 쿠폰 입점업쳅 분담율 조회

+ 25 - 23
src/main/java/com/style24/admin/biz/service/TsaCouponService.java

@@ -9,6 +9,8 @@ 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 org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -65,8 +67,8 @@ public class TsaCouponService {
 		Gson gson = new Gson();
 		Integer sequence;
 		// 적용대상 - 공급업체
-		Collection<Coupon>	supplyCompList = gson.fromJson(params.getSupplyCompList() , new TypeToken<Collection<Coupon>>(){}.getType());
-		for(Coupon supplyComp : supplyCompList) {
+		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();
@@ -83,8 +85,8 @@ public class TsaCouponService {
 			couponDao.saveCouponRefVal(supplyComp);
 		}
 		// 적용대상 - 브랜드
-		Collection<Coupon> brandList = gson.fromJson(params.getBrandList() , new TypeToken<Collection<Coupon>>(){}.getType());
-		for(Coupon brand : brandList) {
+		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();
@@ -102,8 +104,8 @@ public class TsaCouponService {
 			couponDao.saveCouponRefVal(brand);
 		}
 		// 적용대상 - 적용상품
-		Collection<Coupon> applyGoodsList = gson.fromJson(params.getApplyGoodsList() , new TypeToken<Collection<Coupon>>(){}.getType());
-		for(Coupon applyGoods : applyGoodsList ) {
+		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();
@@ -120,8 +122,8 @@ public class TsaCouponService {
 			couponDao.saveCouponRefVal(applyGoods);
 		}
 		// 적용대상 - 카테고리
-		Collection<Coupon> cateList = gson.fromJson(params.getCateList() , new TypeToken<Collection<Coupon>>(){}.getType());
-		for(Coupon cate : cateList ) {
+		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();
@@ -140,8 +142,8 @@ public class TsaCouponService {
 			couponDao.saveCouponRefVal(cate);
 		}
 		// 적용대상 - 제외상품
-		Collection<Coupon> exceptGoodsList = gson.fromJson(params.getExceptGoodsList() , new TypeToken<Collection<Coupon>>(){}.getType());
-		for(Coupon exceptGoods: exceptGoodsList ) {
+		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();
@@ -158,8 +160,8 @@ public class TsaCouponService {
 			couponDao.saveCouponRefVal(exceptGoods);
 		}
 		// 입점업체분담율
-		Collection<Coupon> burdenList = gson.fromJson(params.getBurdenList() , new TypeToken<Collection<Coupon>>(){}.getType());
-		for(Coupon burden: burdenList ) {
+		Collection<CouponBurden> burdenList = gson.fromJson(params.getBurdenList() , new TypeToken<Collection<CouponBurden>>(){}.getType());
+		for(CouponBurden burden: burdenList ) {
 			burden.setCpnId(cpnId);
 			burden.setRegNo(TsaSession.getInfo().getUserNo());
 			burden.setUpdNo(TsaSession.getInfo().getUserNo());
@@ -239,8 +241,8 @@ public class TsaCouponService {
 	 * @author xyzp1539
 	 * @since 2021-01-18
 	 */
-	public ArrayList<Coupon> getCouponRefvalExceptGoodsList(String cpnId ) {
-		Coupon cpnRefval = new Coupon();
+	public ArrayList<CouponRefval> getCouponRefvalExceptGoodsList(String cpnId ) {
+		CouponRefval cpnRefval = new CouponRefval();
 		cpnRefval.setCpnId(cpnId);
 		cpnRefval.setCpnTarget("G260_14");
 		return couponDao.getCouponRefvalExceptGoodsList(cpnRefval);
@@ -253,8 +255,8 @@ public class TsaCouponService {
 	 * @author xyzp1539
 	 * @since 2021-01-18
 	 */
-	public ArrayList<Coupon> getCouponRefvalBrandList(String cpnId ) {
-		Coupon cpnRefval = new Coupon();
+	public ArrayList<CouponRefval> getCouponRefvalBrandList(String cpnId ) {
+		CouponRefval cpnRefval = new CouponRefval();
 		cpnRefval.setCpnId(cpnId);
 		cpnRefval.setCpnTarget("G260_12");
 		return couponDao.getCouponRefvalBrandList(cpnRefval);
@@ -267,8 +269,8 @@ public class TsaCouponService {
 	 * @author xyzp1539
 	 * @since 2021-01-18
 	 */
-	public ArrayList<Coupon> getCouponRefvalCategoryList(String cpnId) {
-		Coupon cpnRefval = new Coupon();
+	public ArrayList<CouponRefval> getCouponRefvalCategoryList(String cpnId) {
+		CouponRefval cpnRefval = new CouponRefval();
 		cpnRefval.setCpnId(cpnId);
 		cpnRefval.setCpnTarget("G260_11");
 		return couponDao.getCouponRefvalCategoryList(cpnRefval);
@@ -281,8 +283,8 @@ public class TsaCouponService {
 	 * @author xyzp1539
 	 * @since 2021-01-18
 	 */
-	public ArrayList<Coupon> getCouponRefvalGoodsList(String cpnId , String cpnTarget) {
-		Coupon cpnRefval = new Coupon();
+	public ArrayList<CouponRefval> getCouponRefvalGoodsList(String cpnId , String cpnTarget) {
+		CouponRefval cpnRefval = new CouponRefval();
 		cpnRefval.setCpnId(cpnId);
 		cpnRefval.setCpnTarget(cpnTarget);
 		return couponDao.getCouponRefvalGoodsList(cpnRefval);
@@ -295,10 +297,10 @@ public class TsaCouponService {
 	 * @author xyzp1539
 	 * @since 2021-01-18
 	 */
-	public ArrayList<Coupon> getCouponRefvalSupplyCompList(String cpnId) {
-		Coupon cpnRefval = new Coupon();
+	public ArrayList<CouponRefval> getCouponRefvalSupplyCompList(String cpnId) {
+		CouponRefval cpnRefval = new CouponRefval();
 		cpnRefval.setCpnId(cpnId);
-		cpnRefval.setCpnTarget("G260_30");
+		cpnRefval.setCpnTarget("G260_13");
 		return couponDao.getCouponRefvalSupplyCompList(cpnRefval);
 	}
 

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

@@ -9,6 +9,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -269,7 +270,7 @@ public class TsaMarketingController extends TsaBaseController {
 		// 사용가능 고객구분 조회
 		mav.addObject("usableCustGbList", rendererService.getCommonCodeList("G100"));
 		// 사용가능 고객등급 조회
-		mav.addObject("usableCustGradeList", rendererService.getCommonCodeList("G101"));
+		mav.addObject("usableCustGradeList", rendererService.getCommonCodeList("G110"));
 		// 재발급 여부 조회
 		mav.addObject("reissuanceList", rendererService.getCommonCodeList("G231"));
 		// 할인방식 조회
@@ -331,7 +332,7 @@ public class TsaMarketingController extends TsaBaseController {
 	 * 쿠폰 적용대상 삭제수정
 	 * @param coupon
 	 * @return
-	 * @author xyzp1539
+	 * @author xyzp1539m
 	 * @since 2021-01-19
 	 */
 	@PostMapping("/coupon/refval/update")
@@ -344,7 +345,63 @@ public class TsaMarketingController extends TsaBaseController {
 		return super.ok(message.getMessage("SUCC_0001"));
 	}
 
+	@GetMapping("/coupon/cpnPubForCust/popup/form")
+	@ResponseBody
+	public ModelAndView couponPubForCustPopup() {
+		ModelAndView mav = new ModelAndView();
+		String num = "";
+		// 일시 시 리스트 세팅
+		Collection<CommonCode> hhList = new ArrayList<CommonCode>();
+		for (int i = 0; i < 24; i++) {
+			num = "";
+			CommonCode temp = new CommonCode();
+			if (i < 10) {
+				num = "0" + i;
+			} else {
+				num = String.valueOf(i);
+			}
+
+			// 상품상태
+			String[] exceptCds = {"G008_00"};
+			mav.addObject("goodsStatList", rendererService.getCommonCodeList("G008", "Y", exceptCds));
+
+			temp.setCd(num);
+			temp.setCdNm(num + "시");
+
+			hhList.add(temp);
+		}
+		// 일시 분 리스트 세팅
+		Collection<CommonCode> mmList = new ArrayList<CommonCode>();
+		for (int i = 0; i < 60; i++) {
+			num = "";
+			CommonCode temp = new CommonCode();
+			if (i < 10) {
+				num = "0" + i;
+			} else {
+				num = String.valueOf(i);
+			}
+			temp.setCd(num);
+			temp.setCdNm(num + "분");
+
+			mmList.add(temp);
+		}
+		// 시간 분 리스트 세팅
+		mav.addObject("mmList", mmList);
+		// 시간 시 리스트 세팅
+		mav.addObject("hhList", hhList);
+		// 사이트조회
+		mav.addObject("siteCdList" , rendererService.getCommonCodeList("G000"));
+		// 사용가능 고객구분 조회
+		mav.addObject("usableCustGbList", rendererService.getCommonCodeList("G100"));
+		// 사용가능 고객등급 조회
+		mav.addObject("usableCustGradeList", rendererService.getCommonCodeList("G110"));
+		// 쿠폰발행사유 조회
+		mav.addObject("cpnPubReasonList", rendererService.getCommonCodeList("G068"));
+		
+		mav.setViewName("marketing/CouponPubForCustPopupForm");
 
+		return mav;
+	}
 	/* // JSM 진행 */
 
 	/* CSB 진행 */

+ 10 - 30
src/main/java/com/style24/persistence/domain/Coupon.java

@@ -53,40 +53,20 @@ public class Coupon extends TscBaseDomain {
     private String  buyEddt;				// 구매기간일자(TO)
     private Integer issueCnt;				// 쿠폰발급개수
     private Integer useCnt;					// 쿠폰사용개수
-    private String  payType;                 // 결제수단
+    private String  payType;                // 결제수단
     private String  custJoinYn;             // 신규회원여부
+    private String  afChannel;              // 제휴링크
 
-    // 그리드 컬럼
-    private String  supplyCompCd;            // 공급업체코드
-    private Integer burdenRate;              // 업체분담율
-    private String  delYn;                   // 삭제여부
-    private String  supplyCompNm;            // 공급업체명
-    private String  brandCd;                 // 브랜드코드
-    private String  brandEnm;                // 브랜드영문명
-    private String  goodsGb;                 // 상품구분
-    private String  goodsCd;                 // 상품코드
-    private String  goodsNm;                 // 상품명
-    private String  cateNm;                  // 카테고리코드명
-    private String  cateNo;                  // 카테고리코드
-    private String  supplyCompList;          // 공급업체 리스트
-    private String  brandList;               // 브랜드 리스트
-    private String  applyGoodsList;          // 적용상품 리스트
-    private String  exceptGoodsList;         // 제외상품 리스트
-    private String  burdenList;              // 업체 분담율 리스트
-    private String  cateList;                // 카테고리 리스트
-    private String  formalGb;                // 이월정상구분
-
-    // TB_COUPON_REFVAL
-    private String  cpnTarget;               // 쿠폰대상구분(공통코드G260)
-    private String  refVal;                  // 관련값(쿠폰대상이 "10:상품"일 때는 상품코드, "20:브랜드"일 때는 브랜드코드, "30:카테고리"일 때는 카테고리코드, "40:제외상품"일 때는 상품코드)
-    private Integer cpnRefvalSq;             // 쿠폰대상일련번호
-    private String  refFormalGb;             // 정상/이월구분(G009). 쿠폰대상구분이 카테고리일 경우 사용
-    private String  refBrandCd;              // 브랜드코드. 쿠폰대상구분이 카테고리일 경우 사용
-    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
-    private Integer[] cpnRefvalSqArr;        // 쿠폰적용대상시퀀스배열
+    // 그리드 파라미터
+    private String  supplyCompList;         // 공급업체 리스트
+    private String  brandList;              // 브랜드 리스트
+    private String  applyGoodsList;         // 적용상품 리스트
+    private String  exceptGoodsList;        // 제외상품 리스트
+    private String  cateList;               // 카테고리 리스트
+    private String  burdenList;             // 업체 분담율 리스트
 
     // TB_COUPON_BAN_GOODS
-    private Integer  cpnBanGoodsSq;          //
+    private Integer  cpnBanGoodsSq;         //  제외상품시퀀스
 
     // Pagination
     private TscPageRequest pageable;

+ 22 - 0
src/main/java/com/style24/persistence/domain/CouponBurden.java

@@ -0,0 +1,22 @@
+package com.style24.persistence.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.style24.persistence.TscBaseDomain;
+import lombok.Data;
+
+/**
+ * 쿠폰 적용대상 도메인
+ * @author xyzp1539
+ * @since 2021-01-20
+ */
+@SuppressWarnings("serial")
+@Data
+public class CouponBurden extends TscBaseDomain {
+    // TB_COUPON_REFVAL
+    private String  cpnId;					// 쿠폰ID
+    private String  supplyCompCd;           // 공급업체코드
+    private Integer burdenRate;             // 업체분담율
+    private String  delYn;                  // 삭제여부
+    private String  supplyCompNm;           // 공급업체명
+
+}

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

@@ -0,0 +1,43 @@
+package com.style24.persistence.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.style24.persistence.TscBaseDomain;
+import com.style24.persistence.TscPageRequest;
+import lombok.Data;
+
+/**
+ * 쿠폰 적용대상 도메인
+ * @author xyzp1539
+ * @since 2021-01-20
+ */
+@SuppressWarnings("serial")
+@Data
+public class CouponRefval extends TscBaseDomain {
+    // TB_COUPON_REFVAL
+    private String  cpnId;					// 쿠폰ID
+    private String  cpnTarget;              // 쿠폰대상구분(공통코드G260)
+    private String  refVal;                 // 관련값(쿠폰대상이 "10:상품"일 때는 상품코드, "20:브랜드"일 때는 브랜드코드, "30:카테고리"일 때는 카테고리코드, "40:제외상품"일 때는 상품코드)
+    private Integer cpnRefvalSq;            // 쿠폰대상일련번호
+    private String  refFormalGb;            // 정상/이월구분(G009). 쿠폰대상구분이 카테고리일 경우 사용
+    private String  refBrandCd;             // 브랜드코드. 쿠폰대상구분이 카테고리일 경우 사용
+    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+    private Integer[] cpnRefvalSqArr;       // 쿠폰적용대상시퀀스배열
+
+    // 그리드 컬럼들
+    private String  supplyCompCd;           // 공급업체코드
+    private Integer burdenRate;             // 업체분담율
+    private String  delYn;                  // 삭제여부
+    private String  supplyCompNm;           // 공급업체명
+    private String  brandCd;                // 브랜드코드
+    private String  brandEnm;               // 브랜드영문명
+    private String  goodsGb;                // 상품구분
+    private String  goodsCd;                // 상품코드
+    private String  goodsNm;                // 상품명
+    private String  cateNm;                 // 카테고리코드명
+    private String  cateNo;                 // 카테고리코드
+    private String  cateList;               // 카테고리 리스트
+    private String  formalGb;               // 이월정상구분
+
+
+
+}

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

@@ -29,5 +29,8 @@ public class CustomerSearch extends TscBaseDomain {
 	private String emailAgreeYn;
 	private String appAgreeYn;
 	private String secedeRsn;
+	private String custNm;
+	private String email;
+	private String custId;
 
 }

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

@@ -328,7 +328,7 @@
 	</insert>
 
 	<!-- 쿠폰 입점업체 분담율 등록 -->
-	<insert id="saveCouponBurden" parameterType="Coupon">
+	<insert id="saveCouponBurden" parameterType="CouponBurden">
 		/* TsaCoupon.saveCouponBurden */
 		INSERT INTO TB_COUPON_BURDEN(
 		    CPN_ID
@@ -349,8 +349,7 @@
 		  FROM TB_COUPON
 		 WHERE CPN_ID = #{cpnId}
 			ON DUPLICATE KEY UPDATE
-			   SUPPLY_COMP_CD = #{supplyCompCd}
-			 , BURDEN_RATE = #{burdenRate}
+			   BURDEN_RATE = #{burdenRate}
 			 , UPD_NO = #{updNo}
 			 , UPD_DT = now()
 	</insert>
@@ -406,7 +405,10 @@
 			 , BUY_EDDT
 			 , PAY_TYPE
 			 , CUST_JOIN_YN
-  		  FROM TB_COUPON
+			 , (SELECT AF_CHANNEL
+			      FROM TB_AF_LINK A
+			     WHERE A.AF_LINK_CD = B.AF_LINK_CD) AS AF_CHANNEL
+  		  FROM TB_COUPON B
     	 WHERE CPN_ID = #{value}
 	</select>
 
@@ -419,7 +421,7 @@
 	</select>
 
 	<!-- 쿠폰 적용대상 조회 - 제외/적용 상품 -->
-	<select id="getCouponRefvalGoodsList" parameterType="Coupon" resultType="Coupon">
+	<select id="getCouponRefvalGoodsList" parameterType="CouponRefval" resultType="CouponRefval">
 		/* TsaCoupon.getCouponRefvalGoodsList */
 		SELECT FN_GET_CODE_NM('G073',B.GOODS_GB) AS GOODS_GB
 			 , B.GOODS_CD
@@ -431,11 +433,12 @@
 		 INNER JOIN TB_BRAND C ON B.BRAND_CD = C.BRAND_CD
 		 WHERE A.CPN_ID = #{cpnId}
 		   AND A.CPN_TARGET = #{cpnTarget}
+		   AND A.DEL_YN = 'N'
 		 ORDER BY A.CPN_REFVAL_SQ DESC
 	</select>
 
 	<!-- 쿠폰 적용대상 조회 - 브랜드 -->
-	<select id="getCouponRefvalBrandList" parameterType="Coupon" resultType="Coupon">
+	<select id="getCouponRefvalBrandList" parameterType="CouponRefval" resultType="CouponRefval">
 		/* TsaCoupon.getCouponRefvalExceptGoodsList */
 		SELECT B.BRAND_CD
 			 , B.BRAND_ENM
@@ -446,14 +449,15 @@
 		 INNER JOIN TB_SUPPLY_COMPANY C ON B.SUPPLY_COMP_CD = C.SUPPLY_COMP_CD
 		 WHERE A.CPN_ID = #{cpnId}
 		   AND A.CPN_TARGET = #{cpnTarget}
+		   AND A.DEL_YN = 'N'
 		 ORDER BY A.CPN_REFVAL_SQ DESC
 	</select>
 
 	<!-- 쿠폰적용대상 - 카테고리 조회 -->
-	<select id="getCouponRefvalCategoryList" parameterType="Coupon" resultType="Coupon">
+	<select id="getCouponRefvalCategoryList" parameterType="CouponRefval" resultType="CouponRefval">
 		/* TsaCoupon.getCouponRefvalCategoryList */
 		SELECT B.CATE_GB
-			 , A.REF_VAL AS CATE_CD
+			 , A.REF_VAL AS CATE_NO
 			 , B.FULL_CATE_NM 					AS CATE_NM
 			 , B.SITE_CD
 			 , A.REF_FORMAL_GB					AS FORMAL_GB
@@ -463,11 +467,12 @@
 		 INNER JOIN TB_CATE_4SRCH B ON A.REF_VAL = B.LEAF_CATE_NO
 		 WHERE A.CPN_ID = #{cpnId}
 		   AND A.CPN_TARGET = #{cpnTarget}
+		   AND A.DEL_YN = 'N'
 		 ORDER BY A.CPN_REFVAL_SQ DESC
 	</select>
 
 	<!-- 쿠폰 적용대상 - 공급처 조회 -->
-	<select id="getCouponRefvalSupplyCompList" parameterType="Coupon" resultType="Coupon">
+	<select id="getCouponRefvalSupplyCompList" parameterType="CouponRefval" resultType="CouponRefval">
 		/* TsaCoupon.getCouponRefvalSupplyCompList */
 		SELECT B.SUPPLY_COMP_CD
 			 , B.SUPPLY_COMP_NM
@@ -476,11 +481,12 @@
 		 INNER JOIN TB_SUPPLY_COMPANY B ON A.REF_VAL = B.SUPPLY_COMP_CD
 		 WHERE A.CPN_ID = #{cpnId}
 		   AND A.CPN_TARGET = #{cpnTarget}
+		   AND A.DEL_YN = 'N'
 		 ORDER BY A.CPN_REFVAL_SQ DESC
 	</select>
 
 	<!-- 쿠폰 입점업체 분담율 조회-->
-	<select id="getCouponBurdenList" parameterType="String" resultType="Coupon">
+	<select id="getCouponBurdenList" parameterType="String" resultType="CouponBurden">
 		/* TsaCoupon.getCouponBurdenList */
 		SELECT SUPPLY_COMP_CD
 			 , BURDEN_RATE

+ 9 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaCustomer.xml

@@ -103,6 +103,15 @@
 		AND   LOGIN_LDT <![CDATA[<]]> DATE_FORMAT(DATE_ADD(#{edDate}, INTERVAL 1 DAY), '%Y-%m-%d %H:%i:%S')
 		     </if>
 		</if>
+		<if test="custNm != null and custNm != ''">
+		AND    LOWER(CUST_NM) LIKE CONCAT('%',LOWER(#{custNm}),'%')
+		</if>
+		<if test="email != null and email != ''">
+		AND    LOWER(EMAIL) LIKE CONCAT('%',LOWER(#{eamil}),'%')
+		</if>
+		<if test="custId != null and custId != ''">
+		AND    CUST_ID = #{custId}
+		</if>
 	</select>
 
 	<!-- 회원기본정보 -->

+ 16 - 4
src/main/webapp/WEB-INF/views/marketing/CouponListForm.html

@@ -175,12 +175,24 @@
 				valueFormatter: function (params) { return gagaAgGrid.lookupValue(dcWayList, params.value); },
 				valueParser: function (params) { return gagaAgGrid.lookupKey(dcWayList, params.newValue); }
 			},
-			{headerName: "할인값(PC)", field: "dcPval", width: 140, cellClass: 'text-center'},
-			{headerName: "할인값(MOBILE)", field: "dcMval", width: 140, cellClass: 'text-center'},
-			{headerName: "최고할인값", field: "maxDcAmt", width: 140, cellClass: 'text-center'},
+			{headerName: "할인값(PC)", field: "dcPval", width: 140, cellClass: 'text-center' ,
+				valueFormatter	: function(params) {
+					return params.value.addComma();
+				}
+			},
+			{headerName: "할인값(MOBILE)", field: "dcMval", width: 140, cellClass: 'text-center' ,
+				valueFormatter	: function(params) {
+					return params.value.addComma();
+				}
+			},
+			{headerName: "최고할인값", field: "maxDcAmt", width: 140, cellClass: 'text-center' ,
+				valueFormatter	: function(params) {
+					return params.value.addComma();
+				}
+			},
 			{headerName: "사용 수/발급 수 ", field: "useIssueCnt", width: 140, cellClass: 'text-center',
 				cellRenderer: function(params) {
-					return params.data.issueCnt + "/" + params.data.useCnt;
+					return params.data.issueCnt.addComma() + "/" + params.data.useCnt.addComma();
 				}
 			},
 			{headerName: "기간/일수구분", field: "pdGb", width: 140, cellClass: 'text-center' ,

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

@@ -324,6 +324,7 @@
 									</tbody>
 								</table>
 								<div class="mdPopBtnB aR">
+									<button type="button" class="btn btn-info btn-lg" onclick="fnCustomerIssuePopUp();" th:if="${mode == 'U'}">쿠폰발행</button>
 									<button type="button" class="btn btn-info btn-lg" onclick="fnCouponCreate();" th:if="${mode == 'N'}">등록</button>
 									<button type="button" class="btn btn-info btn-lg" onclick="fnCouponUpdate();" th:if="${mode == 'U'}">수정</button>
 								</div>
@@ -426,7 +427,6 @@
 								<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="btnDeleteRow">행삭제</button>
 									</li>
 								</ul>
 
@@ -567,20 +567,19 @@
 
 	// 쿠폰 등록 버튼 클릭시
 	function fnCouponCreate(){
-		// 필수값들 셋팅
-		setReqValue();
-
-		// 필수값 validation 체크
-		if (!gagajf.validation('#CouponForm')) {
-			return false;
-		}
-
-		checkValidation();
-
 		mcxDialog.confirm('저장하시겠습니까?' , {
 			cancelBtnText:"취소",
 			sureBtnText:"확인",
 			sureBtnClick: function () {
+				gagajf.removeCommaAtNumberFormattedInput('#CouponForm');
+				// 필수값들 셋팅
+				setReqValue();
+				// 필수값 validation 체크
+				if (!gagajf.validation('#CouponForm')) {
+					return false;
+				}
+				checkValidation();
+
 				gagajf.ajaxFormSubmit($('#CouponForm').prop('action'), '#CouponForm', function() {
 					uifnPopupClose('CouponRegForm');
 					$('#btnSearch').trigger('click');
@@ -591,20 +590,19 @@
 
 	// 쿠폰 수정 시
 	function fnCouponUpdate(){
-		// 필수값들 셋팅
-		setReqValue();
-		gagajf.removeCommaAtNumberFormattedInput('#CouponForm');
-		// 필수값 validation 체크
-		if (!gagajf.validation('#CouponForm')) {
-			return false;
-		}
-
-		checkValidation();
-
 		mcxDialog.confirm('수정하시겠습니까?' , {
 			cancelBtnText:"취소",
 			sureBtnText:"확인",
 			sureBtnClick: function () {
+				gagajf.removeCommaAtNumberFormattedInput('#CouponForm');
+				// 필수값들 셋팅
+				setReqValue();
+				// 필수값 validation 체크
+				if (!gagajf.validation('#CouponForm')) {
+					return false;
+				}
+				checkValidation();
+
 				$("#CouponForm input[name=cpnId]").prop("disabled", false);
 				$("#CouponForm input[name=cpnId]").attr("required", true);
 				$("#CouponForm input[name=cpnId]").attr("placeholder", "");
@@ -758,7 +756,39 @@
 
 	// 적용대상 - 브랜드 삭제 버튼시
 	$('#btnBrandDel').on('click' , function(){
-		brandGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(brandGridOptions)});
+		var selectVal = brandGridOptions.api.getSelectedRows();
+
+		if(selectVal.length == 0) {
+			mcxDialog.alert("선택된 행이 없습니다");
+			return;
+		}
+		// 상세조회면 데이터까지 삭제
+		if(cpnDetail != null ) {
+			var removeVal = gagaAgGrid.removeRowData(brandGridOptions , false);
+			var cpnRefvalSqArr = [];
+
+			$.each(selectVal , function(idx , item){
+				cpnRefvalSqArr.push(item.cpnRefvalSq);
+			});
+
+			if(removeVal.length > 0) {
+				mcxDialog.confirm('삭제하시겠습니까?', {
+					cancelBtnText: "취소",
+					sureBtnText: "확인",
+					sureBtnClick: function(){
+						var data = { cpnRefvalSqArr : cpnRefvalSqArr
+							,cpnId : cpnDetail.cpnId
+						};
+
+						var jsonData = JSON.stringify(data);
+						gagajf.ajaxJsonSubmit('/marketing/coupon/refval/update', jsonData);
+					}
+				});
+			}
+		} else {
+			// 신규화면이면 그리드상 삭제
+			brandGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(brandGridOptions)});
+		}
 	});
 
 	// 적용대상 - 공급처 추가 버튼시
@@ -787,7 +817,37 @@
 
 	// 적용대상 - 공급처 삭제시시
 	$('#btnSupplyDel').on('click' , function () {
-		supplyGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(supplyGridOptions)});
+		var selectVal = supplyGridOptions.api.getSelectedRows();
+
+		if(selectVal.length == 0) {
+			mcxDialog.alert("선택된 행이 없습니다");
+			return;
+		}
+
+		if(cpnDetail != null ) {
+			mcxDialog.confirm('삭제하시겠습니까?', {
+				cancelBtnText: "취소",
+				sureBtnText: "확인",
+				sureBtnClick: function(){
+					gagaAgGrid.removeRowData(supplyGridOptions , false);
+					var cpnRefvalSqArr = [];
+
+					$.each(selectVal , function(idx , item){
+						cpnRefvalSqArr.push(item.cpnRefvalSq);
+					});
+
+					var data = { cpnRefvalSqArr : cpnRefvalSqArr
+						,cpnId : $('#CouponForm #cpnId').val()
+					};
+
+					var jsonData = JSON.stringify(data);
+					gagajf.ajaxJsonSubmit('/marketing/coupon/refval/update', jsonData);
+				}
+			});
+		} else {
+			// 신규화면이면 그리드상 삭제
+			supplyGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(supplyGridOptions)});
+		}
 	});
 
 	// 적용대상 - 카테고리 추가시
@@ -816,7 +876,36 @@
 
 	// 적용대상 - 카테고리 삭제시
 	$('#btnCateDel').on('click' , function () {
-		cateGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(cateGridOptions)});
+		var selectVal = cateGridOptions.api.getSelectedRows();
+
+		if(selectVal.length == 0) {
+			mcxDialog.alert("선택된 행이 없습니다");
+			return;
+		}
+		if(cpnDetail != null) {
+			mcxDialog.confirm('삭제하시겠습니까?', {
+				cancelBtnText: "취소",
+				sureBtnText: "확인",
+				sureBtnClick: function(){
+					gagaAgGrid.removeRowData(cateGridOptions , false);
+
+					var cpnRefvalSqArr = [];
+
+					$.each(selectVal , function(idx , item){
+						cpnRefvalSqArr.push(item.cpnRefvalSq);
+					});
+
+					var data = { cpnRefvalSqArr : cpnRefvalSqArr
+						,cpnId : $('#CouponForm #cpnId').val()
+					};
+
+					var jsonData = JSON.stringify(data);
+					gagajf.ajaxJsonSubmit('/marketing/coupon/refval/update', jsonData);
+				}
+			});
+		} else {
+			cateGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(cateGridOptions)});
+		}
 	});
 
 	// 적용대상 - 상품 추가시
@@ -831,42 +920,77 @@
 
 	// 적용대상 - 상품 삭제 시
 	$('#btnGoodsDel').on('click' , function () {
-		goodsGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(goodsGridOptions)});
+		var selectVal = goodsGridOptions.api.getSelectedRows();
+
+		if(selectVal.length == 0) {
+			mcxDialog.alert("선택된 행이 없습니다");
+			return;
+		}
+		if(cpnDetail != null ) {
+			mcxDialog.confirm('삭제하시겠습니까?', {
+				cancelBtnText: "취소",
+				sureBtnText: "확인",
+				sureBtnClick: function(){
+					gagaAgGrid.removeRowData(goodsGridOptions , false);
+					var cpnRefvalSqArr = [];
+
+					$.each(selectVal , function(idx , item){
+						cpnRefvalSqArr.push(item.cpnRefvalSq);
+					});
+					var data = { cpnRefvalSqArr : cpnRefvalSqArr
+						,cpnId : $('#CouponForm #cpnId').val()
+					};
+
+					var jsonData = JSON.stringify(data);
+					gagajf.ajaxJsonSubmit('/marketing/coupon/refval/update', jsonData);
+				}
+			});
+		} else {
+			goodsGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(goodsGridOptions)});
+		}
 	});
 
 	// 적용대상 - 제외상품 추가시
-	$('#btnExcepGoodsAdd').on('click' , function(result){
-		gridAddGoodsList(excepGoodsGridOptions, result , "except");
+	$('#btnExcepGoodsAdd').on('click' , function(){
+		cfnOpenGoodsPopup("fnSetPopupExceptGoodsInfo");
 	});
+	// 적용 상품 리스트 콜백함수
+	var fnSetPopupExceptGoodsInfo = function(result) {
+		gridAddGoodsList(excepGoodsGridOptions, result , "except");
+	};
 
+	// 적용대상 - 제외상품 삭제시
 	$('#btnExcepGoodsDel').on('click' , function () {
-		var selectVal = exceptGoodsGbList.api.getSelectedRows();
+		var selectVal = excepGoodsGridOptions.api.getSelectedRows();
 
 		if(selectVal.length == 0) {
 			mcxDialog.alert("선택된 행이 없습니다");
 			return;
 		}
 
-		var removeVal = gagaAgGrid.removeRowData(exceptGoodsGbList , false);
-		var cpnRefvalSqArr = [];
-
-		$.each(selectVal , function(idx , item){
-			cpnRefvalSqArr.push(item.cpnRefvalSq);
-		});
-
-		if(removeVal.length > 0) {
+		if(cpnDetail != null ) {
 			mcxDialog.confirm('삭제하시겠습니까?', {
 				cancelBtnText: "취소",
 				sureBtnText: "확인",
 				sureBtnClick: function(){
+					gagaAgGrid.removeRowData(excepGoodsGridOptions , false);
+					var cpnRefvalSqArr = [];
+
+					$.each(selectVal , function(idx , item){
+						cpnRefvalSqArr.push(item.cpnRefvalSq);
+					});
+
 					var data = { cpnRefvalSqArr : cpnRefvalSqArr
-						,cpnId : $('#CouponForm #cpnId').val();
+						,cpnId : $('#CouponForm #cpnId').val()
 					};
 
 					var jsonData = JSON.stringify(data);
+
 					gagajf.ajaxJsonSubmit('/marketing/coupon/refval/update', jsonData);
 				}
 			});
+		} else {
+			excepGoodsGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(excepGoodsGridOptions)});
 		}
 	});
 
@@ -887,7 +1011,6 @@
 
 			// 중복되지 않은 데이터 리스트에 추가
 			if(addChk) {
-				//gagaAgGrid.addRowData(OriginGridListOption, result[i], "goodsCd");
 				gagaAgGrid.addRowData(OriginGridListOption, {"goodsGb": goodsGbVal, "goodsCd" : result[i].goodsCd, "goodsNm" : result[i].goodsNm});
 			}
 		}
@@ -1018,6 +1141,10 @@
 
 		});
 	}
+	// 쿠폰발행팝업
+	function fnCustomerIssuePopUp(){
+		cfnCpnPubForCustPopup();
+	};
 
 	// 전송시 값 세팅
 	function setReqValue(){
@@ -1100,13 +1227,13 @@
 			$("#CouponForm input:radio[name='rdoDcWay']:radio[value=" + cpnDetail.dcWay + "]").prop('checked', true);
 			$("#CouponForm input:radio[name='rdoCpnType']:radio[value=" + cpnDetail.cpnType + "]").prop('checked', true);
 			$("#CouponForm input:radio[name='rdoApplyScope']:radio[value=" + cpnDetail.applyScope + "]").prop('checked', true);
-			$("#CouponForm #dcPval").val(cpnDetail.dcPval.addComma());
-			$("#CouponForm #dcMval").val(cpnDetail.dcMval.addComma());
-			$("#CouponForm #dcAval").val(cpnDetail.dcAval.addComma());
-			$("#CouponForm #maxDcAmt").val(cpnDetail.maxDcAmt.addComma());
-			$("#CouponForm #totPubLimitQty").val(cpnDetail.totPubLimitQty.addComma());
-			$("#CouponForm #custPubLimitQty").val(cpnDetail.custPubLimitQty.addComma());
-			$("#CouponForm #onePubQty").val(cpnDetail.onePubQty.addComma());
+			$("#CouponForm #dcPval").val(cpnDetail.dcPval);
+			$("#CouponForm #dcMval").val(cpnDetail.dcMval);
+			$("#CouponForm #dcAval").val(cpnDetail.dcAval);
+			$("#CouponForm #maxDcAmt").val(cpnDetail.maxDcAmt);
+			$("#CouponForm #totPubLimitQty").val(cpnDetail.totPubLimitQty);
+			$("#CouponForm #custPubLimitQty").val(cpnDetail.custPubLimitQty);
+			$("#CouponForm #onePubQty").val(cpnDetail.onePubQty);
 			$("#CouponForm #usableCustGb").val(cpnDetail.usableCustGb).prop("selected", true);
 			$("#CouponForm #usableCustGrade").val(cpnDetail.usableCustGrade).prop("selected", true);
 			$("#CouponForm #endAlimYn").val(cpnDetail.endAlimYn).prop("selected", true);
@@ -1117,14 +1244,24 @@
 			$("#CouponForm #custJoinYn").val(cpnDetail.custJoinYn).prop("selected", true);
 			$("#CouponForm #pdGb").val(cpnDetail.pdGb).prop("selected", true);
 			$("#CouponForm #siteCd").val(cpnDetail.siteCd).prop("selected", true);
+			$("#CouponForm #afChannel").val(cpnDetail.afChannel).prop("selected", true);
 			$("#CouponForm #cpnNm").val(cpnDetail.cpnNm);
 			$("#CouponForm #downYn").val(cpnDetail.downYn);
-			$("#CouponForm #buyLimitAmt").val(cpnDetail.buyLimitAmt.addComma());
+			$("#CouponForm #buyLimitAmt").val(cpnDetail.buyLimitAmt);
 			$("#CouponForm #cpnId").val(cpnDetail.cpnId);
+
+			/*
+			$("#CouponForm input:checkbox[name='cpnCreateType']").parent("label").addClass("formControl");
+			$("#CouponForm input:checkbox[name='cpnCreateType']").parent("label").prop('disabled', true);
+			$("#CouponForm input:checkbox[name='cpnCreateType']").addClass("formControl");
+			$("#CouponForm input:checkbox[name='cpnCreateType']").prop('disabled', true);
+			*/
 			// 만약 쿠폰 발급한 내역이 있으면 쿠폰수정못하게 readonly , disabled 속성 추가
 			if (issueCnt > 0) {
 				$("#CouponForm #usableCustGb").attr('readonly', true);
 				$("#CouponForm #usableCustGb").attr('disabled', true);
+				$("#CouponForm #afChannel").attr('readonly', true);
+				$("#CouponForm #afChannel").attr('disabled', true);
 				$("#CouponForm #usableCustGrade").attr('readonly', true);
 				$("#CouponForm #usableCustGrade").attr('disabled', true);
 				$("#CouponForm #endAlimYn").attr('readonly', true);
@@ -1216,10 +1353,20 @@
 				$("#CouponForm #custJoinStMM").attr('disabled', true);
 			}
 		}
+		// 기본세팅
 		pdGbChange();
 		firstYnChange();
 		custJoinYnChange();
 		fnChangeAfLinkCdList();
+
+		// 제휴채널2뎁스 기본세팅
+		if(cpnDetail != null ) {
+			$("#CouponForm #afLinkCd").val(cpnDetail.afLinkCd).prop("selected", true);
+			if(issueCnt > 0 ) {
+				$("#CouponForm #afLinkCd").attr('readonly', true);
+				$("#CouponForm #afLinkCd").attr('disabled', true);
+			}
+		}
 	});
 
 	// 날짜분리 ( 시작/종료날짜구분(start , end) , 날짜String , 적용타겟대상 )
@@ -1238,7 +1385,7 @@
 			$("#CouponForm #"+targetGb+"EdMM").val(timeArr[1]);
 		}
 	}
-
+	// 제한없음 문구 변경
 	$("input[name=totPubLimitQty],input[name=custPubLimitQty],input[name=buyLimitAmt],input[name=onePubQty]").change(function(){
 		if($(this).val() == "0"){
 			$("#"+$(this).attr("name")+"Span").html("*제한없음");
@@ -1251,6 +1398,11 @@
 		$("input[name=totPubLimitQty],input[name=custPubLimitQty],input[name=buyLimitAmt],input[name=onePubQty]").change();
 	}, 1);
 
+	// 콤마 찍어주기
+	$(function(){
+		setComma("CouponForm" , true);
+	});
+
 	function setComma(formId, pBoolean){
 		setTimeout(function(){
 			//숫자타입 콤마 찍어주기
@@ -1270,7 +1422,6 @@
 			});
 		}, 300);
 	}
-
 	/*]]>*/
 </script>
 </html>

+ 192 - 0
src/main/webapp/WEB-INF/views/marketing/CouponPubForCustPopupForm.html

@@ -0,0 +1,192 @@
+<!DOCTYPE html>
+<html lang="ko"
+	  xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : CouponPubForCustPopupForm.html
+ * @desc    : 쿠폰 등록 팝업 화면
+ *============================================================================
+ * ISTYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.01.20   xyzp1539       최초 작성
+ *******************************************************************************
+ -->
+<div class="modalPopup" data-width="960" data-height="900">
+	<div class="panelStyle" >
+		<div class="panelTitle">
+			<h2>쿠폰발행</h2>
+			<button type="button" class="close" onclick="uifnPopupClose('CpnPubForCustPopup')"><i class="fa fa-times"></i></button>
+		</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%">
+						<col width="40%">
+						<col width="10%">
+						<col width="40%">
+					</colgroup>
+					<tbody>
+						<tr>
+							<th>사이트코드</th>
+							<td>
+								<select name="siteCd" id="siteCd">
+									<option th:if="${siteCdList}" th:each="oneData , status : ${siteCdList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+								</select>
+							</td>
+							<th>회원ID</th>
+							<td>
+								<input type="text" class="w200" id="custId" name="custId">
+							</td>
+						</tr>
+						<tr>
+							<th>회원구분</th>
+							<td>
+								<select name="custGb" id="custGb">
+									<option th:if="${usableCustGbList}" th:each="oneData , status : ${usableCustGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+								</select>
+							</td>
+							<th>회원등급</th>
+							<td>
+								<select name="custGrade" id="custGrade">
+									<option value="">전체</option>
+									<option th:if="${usableCustGradeList}" th:each="oneData , status : ${usableCustGradeList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+								</select>
+							</td>
+						</tr>
+						<tr>
+							<th>이메일</th>
+							<td>
+								<input type="text" class="w200"  id="email" name="email">
+							</td>
+							<th>회원명</th>
+							<td>
+								<input type="text" class="w200" id="custNm" name="custNm">
+							</td>
+						</tr>
+					</tbody>
+				</table>
+			</form>
+			<div class="aR">
+				<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">
+				<table class="frmStyle">
+					<colgroup>
+						<col width="10%">
+						<col width="40%">
+						<col width="10%">
+						<col width="40%">
+					</colgroup>
+					<tbody>
+					<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="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>
+							</select>
+							<select name="availStMM" id="availStMM">
+								<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+							</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="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>
+							</select>
+							<select name="availEdMM" id="availEdMM">
+								<option th:if="${mmList}" th:each="oneData , status : ${mmList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+							</select>
+						</td>
+					</tr>
+					<tr>
+						<th>발급사유</th>
+						<td colspan="5">
+							<select name="pubReason" id="pubReason">
+								<option th:if="${cpnPubReasonList}" th:each="oneData , status : ${cpnPubReasonList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
+							</select>
+						</td>
+					</tr>
+					<tr>
+						<th>상세사유</th>
+						<td colspan="5">
+							<textarea name="pubReasonDtl" id="pubReasonDtl" cols="50" rows="5" style="height: 100px;"></textarea>
+						</td>
+					</tr>
+					</tbody>
+				</table>
+			</form>
+			<div class="aR">
+				<input type="button" value="발행" class="btn btn-info btn-lg" onclick="fnCpnPubCustomer()">
+			</div>
+		</div>
+	</div>
+</div>
+<script th:inline="javascript">
+	/*<![CDATA[*/
+	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) },
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(siteCdList, params.value); },
+			valueParser: function (params) { return gagaAgGrid.lookupKey(siteCdList, params.newValue);}
+		} ,
+		{ headerName: "회원번호" , field:"custNo" , width:100, cellClass:"text-center"} ,
+		{ headerName: "회원명" , field:"custNm" , width:120, cellClass:"text-center" } ,
+		{ headerName: "이메일" , field:"email" , width:200, cellClass:"text-center"} ,
+		{ headerName: "회원구분" , field:"custGb" , width:120, cellClass:"text-center" ,
+			cellEditor: 'agRichSelectCellEditor',
+			cellEditorParams: { values: gagaAgGrid.extractValues(usableCustGbList) },
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(usableCustGbList, params.value); },
+			valueParser: function (params) { return gagaAgGrid.lookupKey(usableCustGbList, params.newValue);}
+		} ,
+		{ headerName: "회원등급" , field:"custGrade" , width:120, cellClass:"text-center" ,
+			cellEditor: 'agRichSelectCellEditor',
+			cellEditorParams: { values: gagaAgGrid.extractValues(usableCustGradeList) },
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(usableCustGradeList, params.value); },
+			valueParser: function (params) { return gagaAgGrid.lookupKey(usableCustGradeList, params.newValue);}
+		}
+	];
+
+	var pubCustGridOptions = gagaAgGrid.getGridOptions(columnDefs);
+
+	// 고객 조회
+	function fnSearchPubCustList(){
+		gagaAgGrid.fetch($("#custSearchForm").prop('action') , pubCustGridOptions , '#custSearchForm');
+	}
+
+	function fnCpnPubCustomer(){
+		
+	}
+	
+	function setReqVal(){
+		// 유효기간 세팅
+		$('#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");
+	}
+
+	$(document).ready(function(){
+		gagaAgGrid.createGrid('pubCustgridList', pubCustGridOptions);
+
+		$('#pubRegForm #availEdHH option:last').attr("selected", "selected");
+		$('#pubRegForm #availEdMM option:last').attr("selected", "selected");
+
+	});
+
+	/*]]>*/
+</script>
+</html>