Ver código fonte

쿠폰 중간 커밋

쿠폰 중간 커밋
xyzp1539 5 anos atrás
pai
commit
ad6e706e71

+ 42 - 0
style24.admin/src/main/java/com/style24/admin/biz/dao/TsaCouponDao.java

@@ -0,0 +1,42 @@
+package com.style24.admin.biz.dao;
+
+import com.style24.core.support.annotation.ShopDs;
+import com.style24.persistence.domain.*;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+/**
+ * 쿠폰 DAO
+ * @author xyzp1539
+ * @since  2021-01-11
+ */
+@ShopDs
+public interface TsaCouponDao {
+	/**
+	 * 쿠폰 리스트 조회
+	 * @param  Coupon
+	 * @return ArrayList<Coupon>
+	 * @author xyzp1539
+	 * @since 2020-12-22
+	 */
+	ArrayList<Coupon> getCouponList(Coupon param);
+
+	/**
+	 * 쿠폰 리스트 카운트 조회
+	 * @param  Coupon
+	 * @return int
+	 * @author xyzp1539
+	 * @since 2020-12-22
+	 */
+	int getCouponListCnt(Coupon param);
+
+	/**
+	 * 쿠폰 등록
+	 * @param params
+	 * @author xyzp1539
+	 * @since  2021-01-12
+	 */
+	void couponInsert(Coupon params);
+}

+ 62 - 21
style24.admin/src/main/java/com/style24/admin/biz/dao/TsaMarketingDao.java

@@ -1,10 +1,7 @@
 package com.style24.admin.biz.dao;
 
 import com.style24.core.support.annotation.ShopDs;
-import com.style24.persistence.domain.Coupon;
-import com.style24.persistence.domain.FreeGoodsPromotion;
-import com.style24.persistence.domain.Itemkind;
-import com.style24.persistence.domain.MoreBetter;
+import com.style24.persistence.domain.*;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
@@ -32,34 +29,78 @@ public interface TsaMarketingDao {
 
 	/* // xodud1202 진행 */
 
-	/* JSM 진행 */
+
+	/* CSB 진행 */
 	/**
-	 * 쿠폰 리스트 조회
-	 * @param  Coupon
-	 * @return ArrayList<Coupon>
-	 * @author xyzp1539
-	 * @since 2020-12-22
+	 * 다다익선 프로모션 리스트
+	 * @param MoreBetter
+	 * @return
+	 * @author bin2107
+	 * @since 2020. 12. 28
+	 */
+	Collection<MoreBetter> getMorebetterList(MoreBetter param);
+
+	/**
+	 * 다다익선 마스터(TB_TMTB) 저장
+	 * @param MoreBetter
+	 * @return
+	 * @author bin2107
+	 * @since 2020. 12. 28
 	 */
-	ArrayList<Coupon> getCouponList(Coupon param);
+	void saveMorebetterMst(MoreBetter tmtb);
 
 	/**
-	 * 쿠폰 리스트 카운트 조회
-	 * @param  Coupon
-	 * @return int
-	 * @author xyzp1539
-	 * @since 2020-12-22
+	 * 다다익선 적용대상 설정(TB_TMTB_GOODS) 저장
+	 * @param MoreBetter
+	 * @return
+	 * @author bin2107
+	 * @since 2021. 1. 7
 	 */
-	int getCouponListCnt(Coupon param);
-	/* // JSM 진행 */
+	void saveMorebetterGoods(MoreBetterGoods regSupplyComp);
 
-	/* CSB 진행 */
 	/**
-	 * 사은품 프로모션 리스트
+	 * 다다익선 할인구간설정 2차조건(TB_TMTB_SECTION) 저장
+	 * @param MoreBetter
+	 * @return
+	 * @author bin2107
+	 * @since 2021. 1. 6
+	 */
+	void saveMorebetterSection(MoreBetterSection regSection);
+
+	/**
+	 * 다다익선 조건에 따른 할인혜택(금액할인) 설정(TB_TMTB_VAL) 저장
+	 * @param MoreBetter
+	 * @return
+	 * @author bin2107
+	 * @since 2021. 1. 6
+	 */
+	void saveMorebetterVal(MoreBetterSection regSection);
+
+	/**
+	 * 다다익선 업체분담율(TB_TMTB_BURDEN) 저장
 	 * @param MoreBetter
 	 * @return
 	 * @author bin2107
 	 * @since 2020. 12. 28
 	 */
-	Collection<MoreBetter> getMorebetterList(MoreBetter param);
+	void saveMorebetterBurden(MoreBetterBurden regBurden);
+
+	/**
+	 * 다다익선 할인구간설정(TB_TMTB_SECTION) 삭제
+	 * @param MoreBetter
+	 * @return
+	 * @author bin2107
+	 * @since 2021. 1. 6
+	 */
+	void deleteTmtbSectionList(MoreBetterSection sectionVal);
+
+	/**
+	 * 다다익선 조건에 따른 할인혜택(금액할인) 설정(TB_TMTB_VAL) 삭제
+	 * @param MoreBetter
+	 * @return
+	 * @author bin2107
+	 * @since 2021. 1. 6
+	 */
+	void deleteTmtbValList(MoreBetterSection sectionVal);
 	/* // CSB 진행 */
 }

+ 166 - 0
style24.admin/src/main/java/com/style24/admin/biz/service/TsaCouponService.java

@@ -0,0 +1,166 @@
+package com.style24.admin.biz.service;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.style24.admin.biz.dao.TsaCouponDao;
+import com.style24.admin.biz.dao.TsaMarketingDao;
+import com.style24.admin.support.security.session.TsaSession;
+import com.style24.core.biz.thirdparty.NaverLowestPriceApi;
+import com.style24.core.biz.thirdparty.SafetyKoreaApi;
+import com.style24.core.support.message.TscMessageByLocale;
+import com.style24.persistence.domain.*;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+
+/**
+ * 쿠폰 Service
+ *
+ * @author xyzp1539
+ * @since 2021. 01. 11
+ */
+@Service
+@Slf4j
+public class TsaCouponService {
+
+	@Autowired
+	private TsaCouponDao couponDao;
+
+	@Autowired
+	private TsaCommonService commonService;
+
+
+
+
+	/**
+	 * 쿠폰 저장
+	 * @param params
+	 * @author xyzp1539
+	 * @since  2021-01-11
+	 */
+	@Transactional("shopTxnManager")
+	public void couponSave(Coupon params) {
+		String cpnId = "";		// 쿠폰ID
+
+		params.setRegNo(TsaSession.getInfo().getUserNo());
+		params.setUpdNo(TsaSession.getInfo().getUserNo());
+
+		// 자동생성이면 시퀀스 가져오기
+		if(params.getCpnId() == null || params.getCpnId().equals("")) {
+			int sequence = commonService.getNextSequence("SEQ_COUPON");
+			cpnId = "CPN"+sequence;
+		} else {
+			cpnId = params.getCpnId();
+		}
+
+		log.info(">>>> CPNID : {}" , cpnId );
+		params.setCpnId(cpnId);
+
+		couponDao.couponInsert(params);
+
+
+		//checkCpnValidation(params);
+
+	}
+
+	/**
+	 * 쿠폰 리스트 조회
+	 * @param  Coupon
+	 * @return ArrayList<Coupon>
+	 * @author xyzp1539
+	 * @since 2020-12-22
+	 */
+	public ArrayList<Coupon> getCouponList(Coupon param) {
+		return couponDao.getCouponList(param);
+	}
+
+	/**
+	 * 쿠폰리스트 카운트 조회
+	 * @param  Coupon
+	 * @return int
+	 * @author xyzp1539
+	 * @since 2020-12-22
+	 */
+	public int getCouponListCnt(Coupon param) {
+		return couponDao.getCouponListCnt(param);
+	}
+
+	/**
+	 * 쿠폰 벨리데이션 체크
+	 * @param Coupon
+	 * @author xyzp1539
+	 * @since  2021-01-12
+	 */
+	public void checkCpnValidation(Coupon params) {
+		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+		// 할인율이면  100% 초과 체크하기
+		if(params.getDcWay() != null && params.getDcWay().equals("G240_11")) {
+			if(params.getDcAval() > 100) {
+				throw new IllegalStateException("모바일 앱 할인율은 100을 초과할수 없습니다.");
+			} else if(params.getDcPval() > 100) {
+				throw new IllegalStateException("PC할인율은 100을 초과할수 없습니다.");
+			} else if(params.getDcMval() > 100) {
+				throw new IllegalStateException("모바일 웹 100을 초과할수 없습니다.");
+			}
+		}
+
+		// 기간/일수구분이 일수인 경우 날짜 체크
+		if(params.getPdGb() != null && params.getPdGb().equals("D")) {
+			try {
+				Date date1 = format.parse(params.getAvailStdt());
+				Date date2 = format.parse(params.getAvailEddt());
+
+				log.info("checkCpnValidation params.getAvailEddt() :  {}" , params.getAvailEddt());
+				log.info("checkCpnValidation params.getAvailStdt :  {}" , params.getAvailStdt());
+				if(date2.before(date1)) {
+					throw new IllegalStateException("유효기간 종료날짜가 시작날짜보다 작습니다.");
+				}
+			} catch (ParseException exception) {
+			}
+		}
+
+		// 직접다운로드인 경우 기간 체크
+		if(params.getDnGb() != null && params.getDnGb().equals("G058_20")) {
+			try {
+				Date date1 = format.parse(params.getDownStdt());
+				Date date2 = format.parse(params.getDownEddt());
+
+				log.info("checkCpnValidation params.getDownStdt() :  {}" , params.getDownStdt());
+				log.info("checkCpnValidation params.getDownEddt :  {}" , params.getDownEddt());
+				if(date2.before(date1)) {
+					throw new IllegalStateException("다운로드 종료날짜가 시작날짜보다 작습니다.");
+				}
+			} catch (ParseException exception) {
+			}
+		}
+
+		// 첫구매 적용하는 경우 날짜 체크
+		if(params.getFirstYn() != null && params.getFirstYn().equals("Y")) {
+			try {
+				Date date1 = format.parse(params.getBuyStdt());
+				Date date2 = format.parse(params.getBuyEddt());
+
+				log.info("checkCpnValidation params.getBuyStdt() :  {}" , params.getBuyStdt());
+				log.info("checkCpnValidation params.getBuyEddt :  {}" , params.getBuyEddt());
+				if(date2.before(date1)) {
+					throw new IllegalStateException("첫구매 종료날짜가 시작날짜보다 작습니다.");
+				}
+			} catch (ParseException exception) {
+			}
+		}
+
+		// 신규회원여부 적용하는 경우 날짜 체크
+		if(params.getCustJoinYn() != null && params.getCustJoinYn().equals("Y")) {
+
+		}
+
+	}
+
+}

+ 131 - 20
style24.admin/src/main/java/com/style24/admin/biz/service/TsaMarketingService.java

@@ -90,27 +90,7 @@ public class TsaMarketingService {
 	/* // xodud1202 진행 */
 
 	/* JSM 진행 */
-	/**
-	 * 쿠폰 리스트 조회
-	 * @param  Coupon
-	 * @return ArrayList<Coupon>
-	 * @author xyzp1539
-	 * @since 2020-12-22
-	 */
-	public ArrayList<Coupon> getCouponList(Coupon param) {
-		return marketingDao.getCouponList(param);
-	}
 
-	/**
-	 * 쿠폰리스트 카운트 조회
-	 * @param  Coupon
-	 * @return int
-	 * @author xyzp1539
-	 * @since 2020-12-22
-	 */
-	public int getCouponListCnt(Coupon param) {
-		return marketingDao.getCouponListCnt(param);
-	}
 	/* // JSM 진행 */
 
 	/* CSB 진행 */
@@ -124,5 +104,136 @@ public class TsaMarketingService {
 	public Collection<MoreBetter> getMorebetterList(MoreBetter param) {
 		return marketingDao.getMorebetterList(param);
 	}
+
+	/**
+	 * 다다익선 저장
+	 * @param tmtb
+	 * @return
+	 * @author bin2107
+	 * @since 2021. 1. 5
+	 */
+	@Transactional("shopTxnManager")
+	public void saveMoreBetterDetail(MoreBetter tmtb) {
+		// <,> replace 처리
+		tmtb.setRegNo(TsaSession.getInfo().getUserNo());
+		tmtb.setUdpNo(TsaSession.getInfo().getUserNo());
+
+		// TMTB 마스터(TB_TMTB) 저장
+		marketingDao.saveMorebetterMst(tmtb);
+
+		// 다다익선 적용대상 설정
+		// 공급업체
+		Collection<MoreBetterGoods> supplyCompList = tmtb.getSupplyCompListNew();
+		for(MoreBetterGoods regSupplyComp : supplyCompList){
+			// 다다익선 적용대상 설정(TB_TMTB_GOODS) 저장
+			// tmtbGoodsSq 생성
+			Integer tmtbGoodsSq =  commonService.getNextSequence("SEQ_TMTB_GOODS");
+			regSupplyComp.setTmtbGoodsSq(tmtbGoodsSq);
+			regSupplyComp.setTmtbSq(tmtb.getTmtbSq());
+			regSupplyComp.setGoodsGb("G800_20");
+			regSupplyComp.setTargetVal(regSupplyComp.getSupplyCompCd());
+			regSupplyComp.setRegNo(tmtb.getRegNo());
+			regSupplyComp.setUdpNo(tmtb.getUdpNo());
+
+			marketingDao.saveMorebetterGoods(regSupplyComp);
+		}
+
+		// 브랜드
+		Collection<MoreBetterGoods> brandList = tmtb.getBrandListNew();
+		for(MoreBetterGoods regBrand : brandList){
+			// 다다익선 적용대상 설정(TB_TMTB_GOODS) 저장
+			// tmtbGoodsSq 생성
+			Integer tmtbGoodsSq =  commonService.getNextSequence("SEQ_TMTB_GOODS");
+			regBrand.setTmtbGoodsSq(tmtbGoodsSq);
+			regBrand.setTmtbSq(tmtb.getTmtbSq());
+			regBrand.setGoodsGb("G800_20");
+			regBrand.setTargetVal(regBrand.getBrandCd());
+			regBrand.setRegNo(tmtb.getRegNo());
+			regBrand.setUdpNo(tmtb.getUdpNo());
+
+			marketingDao.saveMorebetterGoods(regBrand);
+		}
+
+		// 적용상품
+		Collection<MoreBetterGoods> applyGoodsList = tmtb.getApplyGoodsListNew();
+		for(MoreBetterGoods regApplyGoods : applyGoodsList){
+			// 다다익선 적용대상 설정(TB_TMTB_GOODS) 저장
+			// tmtbGoodsSq 생성
+			Integer tmtbGoodsSq =  commonService.getNextSequence("SEQ_TMTB_GOODS");
+			regApplyGoods.setTmtbGoodsSq(tmtbGoodsSq);
+			regApplyGoods.setTmtbSq(tmtb.getTmtbSq());
+			regApplyGoods.setTargetVal(regApplyGoods.getGoodsCd());
+			regApplyGoods.setRegNo(tmtb.getRegNo());
+			regApplyGoods.setUdpNo(tmtb.getUdpNo());
+
+			marketingDao.saveMorebetterGoods(regApplyGoods);
+		}
+
+		// 제외상품
+		Collection<MoreBetterGoods> exceptGoodsList = tmtb.getExceptGoodsListNew();
+		for(MoreBetterGoods regExceptGoods : exceptGoodsList){
+			// 다다익선 적용대상 설정(TB_TMTB_GOODS) 저장
+			// tmtbGoodsSq 생성
+			Integer tmtbGoodsSq =  commonService.getNextSequence("SEQ_TMTB_GOODS");
+			regExceptGoods.setTmtbGoodsSq(tmtbGoodsSq);
+			regExceptGoods.setTmtbSq(tmtb.getTmtbSq());
+			regExceptGoods.setTargetVal(regExceptGoods.getGoodsCd());
+			regExceptGoods.setRegNo(tmtb.getRegNo());
+			regExceptGoods.setUdpNo(tmtb.getUdpNo());
+
+			marketingDao.saveMorebetterGoods(regExceptGoods);
+		}
+
+		// 다다익선 할인구간 저장
+		Collection<MoreBetterSection> sectionGbList = tmtb.getSectionGbListNew();
+		for(MoreBetterSection regSection : sectionGbList){
+			// 다다익선 할인구간설정 2차조건(TB_TMTB_SECTION) 저장
+			// tmtbSectionSq 생성
+			Integer tmtbSectionSq =  commonService.getNextSequence("SEQ_TMTB_SECTION");
+			regSection.setTmtbSectionSq(tmtbSectionSq);
+
+			// 다다익선 조건에 따른 할인혜택(금액할인) 설정(TB_TMTB_VAL) 저장
+			// tmtbValSq 생성
+			Integer tmtbValSq =  commonService.getNextSequence("SEQ_TMTB_VAL");
+			regSection.setTmtbValSq(tmtbValSq);
+			regSection.setTmtbSq(tmtb.getTmtbSq());
+			regSection.setRegNo(tmtb.getRegNo());
+			regSection.setUdpNo(tmtb.getUdpNo());
+
+			marketingDao.saveMorebetterSection(regSection);
+			marketingDao.saveMorebetterVal(regSection);
+		}
+
+		// 다다익선 업체분담율(TB_TMTB_BURDEN) 저장
+		Collection<MoreBetterBurden> burdenList = tmtb.getBurdenListNew();
+		for (MoreBetterBurden regBurden : burdenList) {
+			// tmtbBurdenSq 생성
+			Integer tmtbBurdenSq =  commonService.getNextSequence("SEQ_TMTB_BURDEN");
+			regBurden.setTmtbBurdenSq(tmtbBurdenSq);
+			regBurden.setTmtbSq(tmtb.getTmtbSq());
+			regBurden.setRegNo(tmtb.getRegNo());
+			regBurden.setUdpNo(tmtb.getUdpNo());
+
+			marketingDao.saveMorebetterBurden(regBurden);
+		}
+
+		log.info("newBurdenSq = {}, newTmtbSq = {}, newSupplyCd = {}, newBurdenRate = {} , newUseYn = {}");
+
+	}
+
+	/**
+	 * 다다익선 다다익선 할인구간 삭제
+	 * @param tmtb
+	 * @return
+	 * @author bin2107
+	 * @since 2021. 1. 5
+	 */
+	@Transactional("shopTxnManager")
+	public void deleteSectionValList(Collection<MoreBetterSection> sectionValList) {
+		for (MoreBetterSection sectionVal : sectionValList) {
+			marketingDao.deleteTmtbSectionList(sectionVal);
+			marketingDao.deleteTmtbValList(sectionVal);
+		}
+	}
 	/* // CSB 진행 */
 }

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

@@ -1,16 +1,16 @@
 package com.style24.admin.biz.web;
 
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.gagaframework.web.parameter.GagaMap;
+import com.gagaframework.web.rest.server.GagaResponse;
 import com.style24.admin.biz.service.*;
 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.TsaPageRequest;
-import com.style24.persistence.domain.CommonCode;
-import com.style24.persistence.domain.Coupon;
-import com.style24.persistence.domain.FreeGoodsPromotion;
+import com.style24.persistence.domain.*;
 
-import com.style24.persistence.domain.MoreBetter;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
@@ -53,6 +53,9 @@ public class TsaMarketingController extends TsaBaseController {
 	@Autowired
 	private TsaSystemService systemService;
 
+	@Autowired
+	private TsaCouponService couponService;
+
 	/* xodud1202 진행 */
 	/**
 	 * 사은품 프로모션 관리 화면
@@ -148,8 +151,8 @@ public class TsaMarketingController extends TsaBaseController {
 	public GagaMap getCouponList(@RequestBody Coupon param){
 		GagaMap result =  new GagaMap();
 
-		ArrayList<Coupon> cpnList = marketingService.getCouponList(param);
-		int cpnTotCnt = marketingService.getCouponListCnt(param);
+		ArrayList<Coupon> cpnList = couponService.getCouponList(param);
+		int cpnTotCnt = couponService.getCouponListCnt(param);
 
 		param.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
 		param.setPageable(new TsaPageRequest(param.getPageNo() - 1, param.getPageSize()));
@@ -232,10 +235,29 @@ public class TsaMarketingController extends TsaBaseController {
 		mav.addObject("mmList" , mmList);
 		// 시간 시 리스트 세팅
 		mav.addObject("hhList" , hhList);
+		// 입점업체 조회
+		mav.addObject("ibSupplyCompList" , rendererService.getSupplyCompanyList("","N"));
 
 		mav.setViewName("marketing/CouponCreatePopupForm");
 		return mav;
 	}
+
+	/**
+	 * 쿠폰 저장
+	 * @param Coupon - 쿠폰 정보
+	 * @return
+	 * @author xyzp1539
+	 * @since 2021. 1. 11
+	 */
+	@PostMapping("/coupon/save")
+	@ResponseBody
+	public GagaResponse couponSave(@RequestBody Coupon coupon) {
+		log.info("couponSave : {}" , coupon);
+
+		couponService.couponSave(coupon);
+
+		return super.ok(message.getMessage("SUCC_0001"));
+	}
 	/* // JSM 진행 */
 
 	/* CSB 진행 */
@@ -247,6 +269,7 @@ public class TsaMarketingController extends TsaBaseController {
 	@GetMapping("/morebetter/form")
 	public ModelAndView morebetterForm() {
 		ModelAndView mav = new ModelAndView();
+
 		mav.setViewName("marketing/MorebetterListForm");
 		return mav;
 	}
@@ -272,5 +295,163 @@ public class TsaMarketingController extends TsaBaseController {
 
 		return result;
 	}
+
+	/**
+	 * 다다익선 등록 화면
+	 *
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @since 2020. 12. 29
+	 */
+	@ResponseBody
+	@GetMapping("/morebetterRegPopup/form")
+	public ModelAndView morebetterRegForm(MoreBetter tmtb) {
+		ModelAndView mav = new ModelAndView();
+
+		// 상품상태 : 등록일때는 '대기'
+		String[] exceptCds = {"G008_00"};
+		mav.addObject("goodsStatList", rendererService.getCommonCodeList("G008", "Y", exceptCds));
+		log.info("CHECK param goodsStatList>>"+rendererService.getCommonCodeList("G008", "Y", exceptCds));
+
+		// 할인구간 목록
+		mav.addObject("sectionGbList", rendererService.getAvailCommonCodeList("G810"));
+		log.info("CHECK param sectionGbList>>"+rendererService.getAvailCommonCodeList("G810"));
+		// 할인구분 목록
+		mav.addObject("dcWayList", rendererService.getAvailCommonCodeList("G240"));
+		log.info("CHECK param dcWayList>>"+rendererService.getAvailCommonCodeList("G240"));
+
+		// 적용 상품구분 목록
+		String[] exceptGoodsCds = {"G800_30","G800_40"};
+		mav.addObject("applyGoodsGbList", rendererService.getCommonCodeList("G800", "Y", exceptGoodsCds));
+		log.info("CHECK param applyGoodsGbList>>"+rendererService.getCommonCodeList("G800", "Y", exceptGoodsCds));
+
+		// 제외 상품구분 목록
+		mav.addObject("exceptGoodsGbList", rendererService.getAvailCommonCodeList("G800"));
+		log.info("CHECK param exceptGoodsGbList>>"+rendererService.getAvailCommonCodeList("G800"));
+
+		// 이것도 리스트 받아와서 바꿔야함 ㅠㅠ
+		String tmtbStat = "G232_10";
+		tmtb.setTmtbStat(tmtbStat);
+
+		//tmtb sq 자동생성 추가해야함
+		Integer tmtbSq;
+		tmtbSq =  commonService.getNextSequence("SEQ_TMTB");
+		tmtb.setTmtbSq(tmtbSq);
+
+		mav.addObject("params", tmtb);
+		log.info("CHECK param tmtbSq>>"+tmtb.getTmtbSq());
+		mav.setViewName("marketing/MorebetterRegForm");
+		return mav;
+	}
+
+	/**
+	 * 다다익선 등록
+	 *
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @since 2021. 1. 5
+	 */
+	@PostMapping("/morebetter/save")
+	@ResponseBody
+	public GagaResponse saveMorebetterDetail(@RequestBody MoreBetter tmtb) {
+		Collection<MoreBetterGoods> tmtbSupplyCompList = null;
+		Collection<MoreBetterGoods> tmtbBrandList = null;
+		Collection<MoreBetterGoods> tmtbApplyGoodsList = null;
+		Collection<MoreBetterGoods> tmtbExceptGoodsList = null;
+		Collection<MoreBetterBurden> tmtbBurdenList = null;
+		Collection<MoreBetterSection> tmtbSectionGbList = null;
+		ObjectMapper mapper = new ObjectMapper();
+
+		// 공급업체
+		try {
+			if (tmtb.getSupplyCompList() != null) {
+				tmtbSupplyCompList = mapper.readValue(tmtb.getSupplyCompList(), new TypeReference<Collection<MoreBetterGoods>>() {
+				});
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		// 브랜드
+		try {
+			if (tmtb.getBrandList() != null) {
+				tmtbBrandList = mapper.readValue(tmtb.getBrandList(), new TypeReference<Collection<MoreBetterGoods>>() {
+				});
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		// 적용상품
+		try {
+			if (tmtb.getApplyGoodsList() != null) {
+				tmtbApplyGoodsList = mapper.readValue(tmtb.getApplyGoodsList(), new TypeReference<Collection<MoreBetterGoods>>() {
+				});
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		// 적용상품
+		try {
+			if (tmtb.getExceptGoodsList() != null) {
+				tmtbExceptGoodsList = mapper.readValue(tmtb.getExceptGoodsList(), new TypeReference<Collection<MoreBetterGoods>>() {
+				});
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		// 할인구간
+		try {
+			if (tmtb.getSectionGbList() != null) {
+				tmtbSectionGbList = mapper.readValue(tmtb.getSectionGbList(), new TypeReference<Collection<MoreBetterSection>>() {
+				});
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		// 업체분담율
+		try {
+			if (tmtb.getBurdenList() != null) {
+				tmtbBurdenList = mapper.readValue(tmtb.getBurdenList(), new TypeReference<Collection<MoreBetterBurden>>() {
+				});
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		log.info("tmtb::"+tmtb);
+
+		tmtb.setSupplyCompListNew(tmtbSupplyCompList);
+		tmtb.setBrandListNew(tmtbBrandList);
+		tmtb.setApplyGoodsListNew(tmtbApplyGoodsList);
+		tmtb.setExceptGoodsListNew(tmtbExceptGoodsList);
+		tmtb.setSectionGbListNew(tmtbSectionGbList);
+		tmtb.setBurdenListNew(tmtbBurdenList);
+
+		marketingService.saveMoreBetterDetail(tmtb);
+
+		return super.ok(message.getMessage("SUCC_0001"));
+	}
+	/**
+	 * 다다익선 할인구간 삭제
+	 *
+	 * @param
+	 * @return
+	 * @author bin2107
+	 * @since 2021. 1. 5
+	 */
+	@PostMapping("/morebetter/sectionVal/delete")
+	@ResponseBody
+	public GagaResponse deleteSectionValList(@RequestBody Collection<MoreBetterSection> sectionValList) {
+		// 추후에 더 개발 ㅠㅠ
+		log.info("[deleteSectionValList]");
+		marketingService.deleteSectionValList(sectionValList);
+		return super.ok(message.getMessage("SUCC_0003"));
+	}
+
 	/* // CSB 진행 */
 }

+ 1 - 0
style24.admin/src/main/java/com/style24/persistence/domain/Category.java

@@ -41,6 +41,7 @@ public class Category extends TscBaseDomain {
 	// 검색조건
 	private String siteCd;		// 사이트코드
 	private Integer selLvl;		// 선택레벨
+	private String callbackFn;	// 콜백함수
 
 	// 품목카테고리매핑관리 화면에서 사용
 	private String fullCateNo;	// FULL카테고리번호

+ 27 - 4
style24.admin/src/main/java/com/style24/persistence/domain/Coupon.java

@@ -18,7 +18,7 @@ public class Coupon extends TscBaseDomain {
     private String  siteCd;					// 사이트코드(공통코드G000)
     private String  afLinkCd;				// 제휴링크코드
     private String  usableCustGb;			// 사용가능고객구분(공통코드G100)
-    private String  useableCustGrade;		// 사용가능고객등급(공통코드G110)
+    private String  usableCustGrade;		// 사용가능고객등급(공통코드G110)
     private String  cpnType;				// 쿠폰유형(공통코드G230)
     private String  applyScope;				// 적용범위(A:전체, I:개별). "I:개별"이고 쿠폰유형이 "20:장바구니쿠폰" 외 이면 TB_COUPON_REFVAL 참조
     private String  dcWay;					// 할인방식(공통코드G240)
@@ -32,7 +32,7 @@ public class Coupon extends TscBaseDomain {
     private Integer availDays;				// 유효일수(기간/일수구분 "D:일수"일 때 사용됨)
     private Integer custPubLimitQty;		// 고객당발행제한수량(0은 무제한)
     private Integer totPubLimitQty;			// 총발행제한수량(0은 무제한)
-    private Integer onePubQTy;				// 1회발행수량(기본은 1)
+    private Integer onePubQty;				// 1회발행수량(기본은 1)
     private String  dnGb;					// 다운로드구분(공통코드G058)
     private String  downStdt;				// 다운로드시작일시
     private String  downEddt;				// 다운로드종료일시
@@ -46,14 +46,37 @@ public class Coupon extends TscBaseDomain {
     private Integer updNo;					// 수정자번호
     private String  updDt;					// 수정일시
     private String  firstYn;				// 첫구매여부 (Y:구매이력이없음 | N:구매이력있음)
-    private String  downYN;					// 다운로드가능여부(마이페이지, 상품상세) --> EP쿠폰, 난수쿠폰
+    private String  downYn;					// 다운로드가능여부(마이페이지, 상품상세) --> EP쿠폰, 난수쿠폰
     private String  custJoinStdt;			// 회원가입일자(FROM) 20200101 (신규회원여부의 판단을 가입일자로 설정함)
     private String  custJoinEddt;			// 회원가입일자(FROM) 20200101 (신규회원여부의 판단을 가입일자로 설정함)
     private String  buyStdt;				// 회원가입일자(FROM) 20200101 (구매기간일자(FROM) (해당기간에 구매이력이 없으면 다운로드 가능))
     private String  buyEddt;				// 구매기간일자(TO)
-
     private Integer issueCnt;				// 쿠폰발급개수
     private Integer useCnt;					// 쿠폰사용개수
+    private String  payType;                 // 결제수단
+    private String  custJoinYn;             // 신규회원여부
+
+    private String  supplyCompCd;            // 공급업체코드
+    private int     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;                // 카테고리 리스트
 
     // Pagination
     private TsaPageRequest pageable;

+ 224 - 0
style24.admin/src/main/java/com/style24/persistence/mybatis/shop/TsaCoupon.xml

@@ -0,0 +1,224 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.style24.admin.biz.dao.TsaCouponDao">
+	<!-- 쿠폰리스트 조회 -->
+	<select id="getCouponList" parameterType="Coupon" resultType="Coupon">
+		/* TsaCoupon.getCouponList */
+		SELECT T.*
+		, COUNT(CUST_CPN_SQ) AS ISSUE_CNT
+		, COUNT(USED_DT) AS USE_CNT
+		FROM (
+		SELECT SITE_CD
+		, CPN_ID
+		, CPN_NM
+		, USABLE_CUST_GB
+		, CPN_TYPE
+		, DC_WAY
+		, DC_PVAL
+		, DC_MVAL
+		, MAX_DC_AMT
+		, PD_GB
+		, AVAIL_STDT
+		, AVAIL_EDDT
+		, REG_NO
+		, REG_DT
+		FROM TB_COUPON
+		WHERE 1=1
+		<if test="siteCd != null and siteCd != ''">
+			AND SITE_CD = #{siteCd}
+		</if>
+		<if test="cpnId != null and cpnId != ''">
+			AND CPN_ID = #{cpnId}
+		</if>
+		<if test="cpnType != null and cpnType != ''">
+			AND CPN_TYPE = #{cpnType}
+		</if>
+		<if test="regNo != null and regNo != ''">
+			AND REG_NO = #{regNo}
+		</if>
+		<if test="dcWay != null and dcWay != ''">
+			AND DC_WAY = #{dcWay}
+		</if>
+		<if test="cpnNm != null and cpnNm != ''">
+			AND CPN_NM LIKE LOWER('%' || #{cpnNm} || '%')
+		</if>
+		<if test="pdGb != null and pdGb != ''">
+			AND PD_GB = #{pdGb}
+		</if>
+		<if test="availStdt != null and availStdt != '' and availEddt != null and availEddt != ''">
+			AND AVAIL_STDT >= DATE_FORMAT(#{availStdt} , '%Y-%m-%d')
+			AND AVAIL_EDDT <![CDATA[ <= ]]> DATE_FORMAT(#{availEddt} , '%Y-%m-%d')
+		</if>
+		) T
+		LEFT OUTER JOIN TB_CUST_COUPON CC
+		ON T.CPN_ID = CC.CPN_ID
+		GROUP BY  T.SITE_CD
+		, T.CPN_ID
+		, T.CPN_NM
+		, T.USABLE_CUST_GB
+		, T.CPN_TYPE
+		, T.DC_WAY
+		, T.DC_PVAL
+		, T.DC_MVAL
+		, T.MAX_DC_AMT
+		, T.PD_GB
+		, T.AVAIL_STDT
+		, T.AVAIL_EDDT
+		, T.REG_NO
+		, T.REG_DT
+		ORDER BY  T.REG_DT DESC
+	</select>
+
+	<!-- 쿠폰 리스트 카운트 조회-->
+	<select id="getCouponListCnt" parameterType="Coupon" resultType="int">
+		/* TsaCoupon.getCouponListCnt */
+		SELECT COUNT(1)
+		FROM TB_COUPON
+		WHERE 1=1
+		<if test="siteCd != null and siteCd != ''">
+			AND SITE_CD = #{siteCd}
+		</if>
+		<if test="cpnId != null and cpnId != ''">
+			AND CPN_ID = #{cpnId}
+		</if>
+		<if test="cpnType != null and cpnType != ''">
+			AND CPN_TYPE = #{cpnType}
+		</if>
+		<if test="regNo != null and regNo != ''">
+			AND REG_NO = #{regNo}
+		</if>
+		<if test="dcWay != null and dcWay != ''">
+			AND DC_WAY = #{dcWay}
+		</if>
+		<if test="cpnNm != null and cpnNm != ''">
+			AND CPN_NM LIKE LOWER('%' || #{cpnNm} || '%')
+		</if>
+		<if test="pdGb != null and pdGb != ''">
+			AND PD_GB = #{pdGb}
+		</if>
+		<if test="availStdt != null and availStdt != '' and availEddt != null and availEddt != ''">
+			AND AVAIL_STDT >= DATE_FORMAT(#{availStdt} , '%Y-%m-%d')
+			AND AVAIL_EDDT <![CDATA[ <= ]]> DATE_FORMAT(#{availEddt} , '%Y-%m-%d')
+		</if>
+	</select>
+
+	<!-- 쿠폰 등록 -->
+	<insert id="couponInsert" parameterType="Coupon">
+		/* TsaCoupon.couponInsert*/
+		INSERT INTO TB_COUPON (
+			CPN_ID
+		  , CPN_NM
+		  , SITE_CD
+		  <if test='afLinkCd != null and afLinkCd != ""'>
+		  , AF_LINK_CD
+	      </if>
+		  , USABLE_CUST_GB
+		  , USABLE_CUST_GRADE
+		  , CPN_TYPE
+		  , APPLY_SCOPE
+		  , DC_WAY
+		  , DC_PVAL
+		  , DC_MVAL
+		  , DC_AVAL
+		  , PD_GB
+		  <choose>
+			  <when test='pdGb != null and pdGb == "P"'>
+		  , AVAIL_STDT
+		  , AVAIL_EDDT
+			  </when>
+			  <when test='pdGb != null and pdGb == "D"'>
+		  , AVAIL_DAYS
+			  </when>
+		  </choose>
+		  , CUST_PUB_LIMIT_QTY
+		  , TOT_PUB_LIMIT_QTY
+		  , ONE_PUB_QTY
+		  , DN_GB
+		  <if test='dnGb != null and dnGb == "G058_20"'>
+		  , DOWN_STDT
+		  , DOWN_EDDT
+		  </if>
+		  , BUY_LIMIT_AMT
+		  , PLAN_SQ
+		  , REISSUANCE
+		  , CPN_STAT
+		  , END_ALIM_YN
+		  , REG_NO
+		  , REG_DT
+		  , UPD_NO
+		  , UPD_DT
+		  , FIRST_YN
+		  , DOWN_YN
+		  <if test='custJoinYn != null and custJoinYn == "Y"'>
+		  , CUST_JOIN_STDT
+		  , CUST_JOIN_EDDT
+		  </if>
+		  <if test='firstYn != null and firstYn == "Y"'>
+		  , BUY_STDT
+		  , BUY_EDDT
+		  </if>
+		  <if test='cpnType != null and cpnType == "G230_20"'>
+		  , PAY_TYPE
+		  </if>
+		  , CUST_JOIN_YN
+		) VALUES (
+		    #{cpnId}
+		  , #{cpnNm}
+		  , #{siteCd}
+		  <if test='afLinkCd != null and afLinkCd != ""'>
+		  , #{afLinkCd}
+		  </if>
+		  , #{usableCustGb}
+		  , #{usableCustGrade}
+		  , #{cpnType}
+		  , #{applyScope}
+		  , #{dcWay}
+		  , #{dcPval}
+		  , #{dcMval}
+		  , #{dcAval}
+		  , #{pdGb}
+		  <choose>
+			  <when test='pdGb != null and pdGb == "P"'>
+		  , DATE_FORMAT(#{availStdt} , '%Y-%m-%d %h:%i:%s')
+		  , DATE_FORMAT(#{availEddt} , '%Y-%m-%d %h:%i:%s')
+			  </when>
+			  <when test='pdGb != null and pdGb == "D"' >
+		  , #{availDays}
+			  </when>
+		  </choose>
+		  , #{custPubLimitQty}
+		  , #{totPubLimitQty}
+		  , #{onePubQty}
+		  , #{dnGb}
+		  <if test='dnGb != null and dnGb == "G058_20"'>
+		  , DATE_FORMAT(#{downStdt} , '%Y-%m-%d %h:%i:%s')
+		  , DATE_FORMAT(#{downEddt} , '%Y-%m-%d %h:%i:%s')
+		  </if>
+		  , #{buyLimitAmt}
+		  , #{planSq}
+		  , #{reissuance}
+		  , #{cpnStat}
+		  , #{endAlimYn}
+		  , #{regNo}
+		  , now()
+		  , #{updNo}
+		  , now()
+		  , #{firstYn}
+		  , #{downYn}
+		  <if test='custJoinYn != null and custJoinYn == "Y"'>
+		  , DATE_FORMAT(#{custJoinStdt} , '%Y-%m-%d %h:%i:%s')
+		  , DATE_FORMAT(#{custJoinEddt} , '%Y-%m-%d %h:%i:%s')
+		  </if>
+		  <if test='firstYn != null and firstYn == "Y"'>
+		  , DATE_FORMAT(#{buyStdt} , '%Y-%m-%d %h:%i:%s')
+		  , DATE_FORMAT(#{buyEddt} , '%Y-%m-%d %h:%i:%s')
+		  </if>
+		  <if test='cpnType != null and cpnType == "G230_20"'>
+		  , #{payType}
+		  </if>
+		  , #{custJoinYn}
+		)
+	</insert>
+
+
+</mapper>

+ 147 - 107
style24.admin/src/main/java/com/style24/persistence/mybatis/shop/TsaMarketing.xml

@@ -27,116 +27,12 @@
 		</if>
 		ORDER BY REG_DT DESC
 	</select>
-
-
-
 	<!-- // xodud1202 진행 -->
 
-	<!-- JSM 진행 -->
-	<!-- 쿠폰리스트 조회 -->
-	<select id="getCouponList" parameterType="Coupon" resultType="Coupon">
-		/* marketing.getCouponList */
-		SELECT T.*
-		, COUNT(CUST_CPN_SQ) AS ISSUE_CNT
-		, COUNT(USED_DT) AS USE_CNT
-		FROM (
-		SELECT SITE_CD
-		, CPN_ID
-		, CPN_NM
-		, USABLE_CUST_GB
-		, CPN_TYPE
-		, DC_WAY
-		, DC_PVAL
-		, DC_MVAL
-		, MAX_DC_AMT
-		, PD_GB
-		, AVAIL_STDT
-		, AVAIL_EDDT
-		, REG_NO
-		, REG_DT
-		FROM TB_COUPON
-		WHERE 1=1
-		<if test="siteCd != null and siteCd != ''">
-			AND SITE_CD = #{siteCd}
-		</if>
-		<if test="cpnId != null and cpnId != ''">
-			AND CPN_ID = #{cpnId}
-		</if>
-		<if test="cpnType != null and cpnType != ''">
-			AND CPN_TYPE = #{cpnType}
-		</if>
-		<if test="regNo != null and regNo != ''">
-			AND REG_NO = #{regNo}
-		</if>
-		<if test="dcWay != null and dcWay != ''">
-			AND DC_WAY = #{dcWay}
-		</if>
-		<if test="cpnNm != null and cpnNm != ''">
-			AND CPN_NM LIKE LOWER('%' || #{cpnNm} || '%')
-		</if>
-		<if test="pdGb != null and pdGb != ''">
-			AND PD_GB = #{pdGb}
-		</if>
-		<if test="availStdt != null and availStdt != '' and availEddt != null and availEddt != ''">
-			AND AVAIL_STDT >= DATE_FORMAT(#{availStdt} , '%Y-%m-%d')
-			AND AVAIL_EDDT <![CDATA[ <= ]]> DATE_FORMAT(#{availEddt} , '%Y-%m-%d')
-		</if>
-		) T
-		LEFT OUTER JOIN TB_CUST_COUPON CC
-		ON T.CPN_ID = CC.CPN_ID
-		GROUP BY  T.SITE_CD
-		, T.CPN_ID
-		, T.CPN_NM
-		, T.USABLE_CUST_GB
-		, T.CPN_TYPE
-		, T.DC_WAY
-		, T.DC_PVAL
-		, T.DC_MVAL
-		, T.MAX_DC_AMT
-		, T.PD_GB
-		, T.AVAIL_STDT
-		, T.AVAIL_EDDT
-		, T.REG_NO
-		, T.REG_DT
-		ORDER BY  T.REG_DT DESC
-	</select>
-
-	<!-- 쿠폰 리스트 카운트 조회-->
-	<select id="getCouponListCnt" parameterType="Coupon" resultType="int">
-		/* marketing.getCouponListCnt */
-		SELECT COUNT(1)
-		FROM TB_COUPON
-		WHERE 1=1
-		<if test="siteCd != null and siteCd != ''">
-			AND SITE_CD = #{siteCd}
-		</if>
-		<if test="cpnId != null and cpnId != ''">
-			AND CPN_ID = #{cpnId}
-		</if>
-		<if test="cpnType != null and cpnType != ''">
-			AND CPN_TYPE = #{cpnType}
-		</if>
-		<if test="regNo != null and regNo != ''">
-			AND REG_NO = #{regNo}
-		</if>
-		<if test="dcWay != null and dcWay != ''">
-			AND DC_WAY = #{dcWay}
-		</if>
-		<if test="cpnNm != null and cpnNm != ''">
-			AND CPN_NM LIKE LOWER('%' || #{cpnNm} || '%')
-		</if>
-		<if test="pdGb != null and pdGb != ''">
-			AND PD_GB = #{pdGb}
-		</if>
-		<if test="availStdt != null and availStdt != '' and availEddt != null and availEddt != ''">
-			AND AVAIL_STDT >= DATE_FORMAT(#{availStdt} , '%Y-%m-%d')
-			AND AVAIL_EDDT <![CDATA[ <= ]]> DATE_FORMAT(#{availEddt} , '%Y-%m-%d')
-		</if>
-	</select>
-	<!-- // JSM 진행 -->
 
 	<!-- // CSB 진행 -->
 	<select id="getMorebetterList" parameterType="MoreBetter" resultType="MoreBetter">
+		/* TsaMarketing.getMorebetterList */
 		SELECT TMTB_SQ
 			 , TMTB_NM
 			 , FN_GET_CODE_NM('G232',TMTB_STAT) as TMTB_STAT
@@ -150,8 +46,8 @@
 		FROM TB_TMTB
 		WHERE 1=1
 		<if test="tmtbStdt != null and tmtbStdt != '' and tmtbEddt != null and tmtbEddt != ''">
-			AND TMTB_ST_DT >= DATE_FORMAT(#{tmtbStdt} , '%Y-%m-%d')
-			AND TMTB_ED_DT <![CDATA[ <= ]]> DATE_FORMAT(#{tmtbEddt} , '%Y-%m-%d')
+			AND DATE_FORMAT(TMTB_ST_DT,'%Y%m%d%H%i%S') >= DATE_FORMAT(#{tmtbStdt} , '%Y%m%d%H%i%S')
+			AND DATE_FORMAT(TMTB_ED_DT,'%Y%m%d%H%i%S') <![CDATA[ <= ]]> DATE_FORMAT(#{tmtbEddt} , '%Y%m%d%H%i%S')
 		</if>
 		<if test="searchTxt != null and searchTxt != ''">
 			<if test="searchGubun != null and searchGubun == 'tmtbSq'">
@@ -163,5 +59,149 @@
 		</if>
 		ORDER BY REG_DT DESC
 	</select>
+
+	<insert id="saveMorebetterMst" parameterType="MoreBetter" >
+		/* TsaMarketing.saveMorebetterMst */
+		INSERT INTO TB_TMTB(
+					 TMTB_SQ
+					,TMTB_NM
+					,TMTB_STAT
+					,TMTB_ST_DT
+					,TMTB_ED_DT
+					,MULTI_YN
+					,DEL_YN
+					,REG_NO
+					,REG_DT
+					,UDP_NO
+					,UDT_DT
+			)
+			VALUES (
+			         #{tmtbSq}
+					,#{tmtbNm}
+				    ,#{tmtbStat}
+				    ,#{tmtbStdt}
+				    ,#{tmtbEddt}
+				    ,#{multiYn}
+				    ,'N'
+				    ,#{regNo}
+				    ,NOW()
+				    ,#{udpNo}
+				    ,NOW()
+				   )
+	</insert>
+
+	<insert id="saveMorebetterGoods" parameterType="MoreBetterGoods" >
+		/* TsaMarketing.saveMorebetterGoods */
+		INSERT INTO TB_TMTB_GOODS(
+		         	 TMTB_GOODS_SQ
+		        	,TMTB_SQ
+					,GOODS_GB
+					,TARGET_GB
+					,TARGET_VAL
+					,DEL_YN
+					,REG_NO
+					,REG_DT
+					,UDP_NO
+					,UDT_DT
+			)
+			VALUES (
+			         #{tmtbGoodsSq}
+			        ,#{tmtbSq}
+				    ,#{goodsGb}
+				    ,#{targetGb}
+				    ,#{targetVal}
+				    ,'N'
+				    ,#{regNo}
+				    ,NOW()
+				    ,#{udpNo}
+				    ,NOW()
+				   )
+	</insert>
+
+	<insert id="saveMorebetterSection" parameterType="MoreBetterSection" >
+		/* TsaMarketing.saveMorebetterSection */
+		INSERT INTO TB_TMTB_SECTION(
+					 TMTB_SECTION_SQ
+					,TMTB_SQ
+					,SECTION_GB
+					,SECTION_VAL
+					,DEL_YN
+					,REG_NO
+					,REG_DT
+					,UDP_NO
+					,UDT_DT
+			)
+			VALUES (
+					 #{tmtbSectionSq}
+					,#{tmtbSq}
+					,#{sectionGb}
+				    ,#{sectionVal}
+				    ,'N'
+				    ,#{regNo}
+				    ,NOW()
+				    ,#{udpNo}
+				    ,NOW()
+				   )
+	</insert>
+
+	<insert id="saveMorebetterVal" parameterType="MoreBetterSection" >
+		/* TsaMarketing.saveMorebetterVal */
+		INSERT INTO TB_TMTB_VAL(
+					 TMTB_VAL_SQ
+					,TMTB_SQ
+					,TMTB_SECTION_SQ
+					,DC_WAY
+					,DC_VAL
+					,DEL_YN
+					,REG_NO
+					,REG_DT
+					,UDP_NO
+					,UDT_DT
+			)
+			VALUES (
+					#{tmtbValSq}
+				   ,#{tmtbSq}
+				   ,#{tmtbSectionSq}
+				   ,#{dcWay}
+				   ,#{dcVal}
+				   ,'N'
+				   ,#{regNo}
+				   ,NOW()
+				   ,#{udpNo}
+				   ,NOW()
+				   )
+	</insert>
+
+	<insert id="saveMorebetterBurden" parameterType="MoreBetterBurden" >
+		/* TsaMarketing.saveMorebetterBurden */
+		INSERT INTO TB_TMTB_BURDEN(
+					 TB_TMTB_BURDEN_SQ
+					,TMTB_SQ
+					,TMTB_SUPPLY_CD
+					,TMTB_BURDEN_RATE
+					,USE_YN
+					,REG_NO
+					,REG_DT
+					,UDP_NO
+					,UDT_DT
+			)
+			VALUES (
+			         #{tmtbBurdenSq}
+			        ,#{tmtbSq}
+			        ,#{tmtbSupplyCd}
+			        ,#{tmtbBurdenRate}
+			        ,#{useYn}
+				    ,#{regNo}
+				    ,NOW()
+				    ,#{udpNo}
+				    ,NOW()
+				   )
+		ON DUPLICATE KEY UPDATE
+					 TMTB_SUPPLY_CD = #{tmtbSupplyCd}
+					,TMTB_BURDEN_RATE = #{tmtbBurdenRate}
+					,USE_YN = #{useYn}
+					,UDP_NO = #{udpNo}
+					,UDT_DT = NOW()
+	</insert>
 	<!--// CSB 진행 -->
 </mapper>

+ 193 - 0
style24.admin/src/main/webapp/WEB-INF/views/display/CategorySearchForm.html

@@ -0,0 +1,193 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : CategorySearchForm.html
+ * @desc    : 카테고리 팝업 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.01.11   xyzp1539    최초 작성
+ *******************************************************************************
+ -->
+<div class="modalPopup" data-width="900" id="popupCategory">
+	<div class="panelStyle">
+		<!-- TITLE -->
+		<div class="panelTitle">
+			<strong>카테고리 목록</strong>
+			<button type="button" class="close" onclick="uifnPopupClose('popupCategory');"><em class="fa fa-times"></em></button>
+		</div>
+		<!-- //TITLE -->
+		
+		<!-- 검색 조건 -->
+		<div class="panelContent">
+			<form id="searchCategoryListForm" name="searchCategoryListForm" action="#" th:action="@{'/display/category/list'}" onsubmit="$('#btnSearchCategoryList').trigger('click'); return false;">
+				<table class="frmStyle" aria-describedby="검색조건">
+					<colgroup>
+						<col width="10%"/>
+						<col/>
+					</colgroup>
+					<tr>
+						<th>카테고리</th>
+						<td>
+							<input type="hidden" name="selLvl"/>
+							<select name="siteCd">
+								<!-- 								<option value="">[사이트]</option> -->
+								<option th:if="${siteList}" th:each="oneData, status : ${siteList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+							</select>
+							<select name="cateGb" id="selCate1" onchange="fnChangeSearchCondition($(this).val(), 1);">
+								<option value="">[카테고리구분]</option>
+								<option th:if="${cateGbList}" th:each="oneData, status : ${cateGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+							</select>
+							<select name="cate1No" id="selCate2" onchange="fnChangeSearchCondition($(this).val(), 2);">
+								<option value="">[카테고리1]</option>
+							</select>
+							<select name="cate2No" id="selCate3" onchange="fnChangeSearchCondition($(this).val(), 3);">
+								<option value="">[카테고리2]</option>
+							</select>
+							<select name="cate3No" id="selCate4" onchange="fnChangeSearchCondition($(this).val(), 4);">
+								<option value="">[카테고리3]</option>
+							</select>
+							<select name="cate4No" id="selCate5" onchange="fnChangeSearchCondition($(this).val(), 5);">
+								<option value="">[카테고리4]</option>
+							</select>
+						</td>
+					</tr>
+				</table>
+				<ul class="panelBar">
+					<li class="center">
+						<button type="button" class="btn btn-base btn-lg" id="btnSearchCategoryList">조회</button>
+					</li>
+				</ul>
+			</form>
+		</div>
+		<!-- //검색 조건 -->
+		
+		<!-- 리스트 영역 -->
+		<div class="panelContent">
+			<div id="gridCategoryList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
+		</div>
+		<!-- //리스트 영역 -->
+		
+		<!-- 버튼 배치 영역 -->
+		<ul class="panelBar">
+			<li class="right">
+				<button type="button" class="btn btn-info btn-lg" id="btnConfirmCategory">확인</button>
+			</li>
+		</ul>
+	</div>
+
+<script th:inline="javascript">
+/*<![CDATA[*/
+	let siteList = gagajf.convertToArray([[${siteList}]]);
+	let cateGbList = gagajf.convertToArray([[${cateGbList}]]);
+	let formalGbList = gagajf.convertToArray([[${formalGbList}]]);
+	let conentsLocList = gagajf.convertToArray([[${conentsLocList}]]);
+
+	let columnDefs = [
+		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
+		{
+			headerName: "사이트", field: "siteCd", width: 150, cellClass: 'text-center',
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(siteList, params.value); }
+		},
+		{
+			headerName: "카테고리구분", field: "cateGb", width: 150, cellClass: 'text-center',
+			cellRenderer: function (params) { return gagaAgGrid.lookupValue(cateGbList, params.value); }
+		},
+		{headerName: "카테고리번호", field: "cateNo", width: 150, cellClass: 'text-center'},
+		{headerName: "카테고리명", field: "cateNm", width: 150, cellClass: 'text-center'},
+		{
+			headerName: "정상이월구분", field: "formalGb", width: 150, cellClass: 'text-center',
+			cellRenderer: function (params) { return gagaAgGrid.lookupValue(formalGbList, params.value); }
+		},
+		{headerName: "노출여부", field: "dispYn", width: 80, cellClass: 'text-center'},
+		{headerName: "사용여부", field: "useYn", width: 80, cellClass: 'text-center'}
+	];
+
+	let categoryGridOptions = gagaAgGrid.getGridOptions(columnDefs);
+	categoryGridOptions.rowSelection = "multiple";
+
+	// 조회
+	$('#btnSearchCategoryList').on('click', function() {
+		// Fetch data
+		gagaAgGrid.fetch($('#searchCategoryListForm').prop('action'), categoryGridOptions, '#searchCategoryListForm');
+	});
+	
+	// 확인
+	$('#btnConfirmCategory').on('click', function() {
+		var selectedData = gagaAgGrid.selectedRowData(categoryGridOptions);
+		
+		if (selectedData.length == 0) {
+			mcxDialog.alert('선택된 카테고리가 없습니다.');
+			return false;
+		}
+		
+		var callbackFn = [[${params.callbackFn}]];
+
+		var jsonData = JSON.stringify(selectedData);
+
+		if (typeof callbackFn != 'undefined' && callbackFn) {
+			if (typeof callbackFn == 'function') {
+				callbackFn(jsonData);
+			} else {
+				if (callbackFn) {
+					if (callbackFn.indexOf("(") == -1) {
+						eval(callbackFn + "(" + jsonData + ")");
+					} else {
+						eval(callbackFn(jsonData));
+					}
+				}
+			}
+			uifnPopupClose('popupCategory');
+		}
+	});
+	
+	$(document).ready(function() {
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridCategoryList', categoryGridOptions);
+	});
+
+	/**
+	 * 검색폼의 카테고리 선택 시
+	 */
+	var fnChangeSearchCondition = function(val, selLvl) {
+		if (gagajf.isNull(val)) {
+			if (selLvl > 1) {
+				selLvl = selLvl - 1;
+			} else {
+				selLvl = 1;
+			}
+		}
+		$('#searchForm input[name=selLvl]').val(selLvl);
+
+		// Fetch data
+		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm', function(data) {
+			let selLvl = Number($('#searchForm input[name=selLvl]').val()) + 1;
+
+			for (let i = 2; i <= 5; i++) {
+				if (i >= selLvl) {
+					$('#selCate' + i).html('<option value="">[카테고리' + (i - 1) + ']</option>');
+				}
+			}
+
+			let tag = '';
+			for (let i = 0; i < data.length; i++) {
+				if (data[i].useYn == 'Y') {
+					tag += '<option value="' + data[i].cateNo + '">[' + data[i].cateNo + '] ' + data[i].cateNm + '</option>';
+				}
+			}
+
+			$("#selCate" + selLvl).append(tag);
+			$("#btnNew").click();
+		});
+	}
+/*]]>*/
+</script>
+
+</div>
+
+</html>

+ 507 - 57
style24.admin/src/main/webapp/WEB-INF/views/marketing/CouponCreatePopupForm.html

@@ -1,6 +1,6 @@
 <!DOCTYPE html>
 <html lang="ko"
-	xmlns:th="http://www.thymeleaf.org">
+	  xmlns:th="http://www.thymeleaf.org">
 <!--
  *******************************************************************************
  * @source  : CouponCreatePopupForm.html
@@ -13,15 +13,22 @@
  * ===  ===========  ==========  =============================================
  * 1.0  2020.12.23   xyzp1539       최초 작성
  *******************************************************************************
- -->	
-	<div class="modalPopup" data-width="1250" data-height="850">
-		<div class="panelStyle" >
-			<div class="panelTitle">
-				<h2>쿠폰등록</h2>
-				<button type="button" class="close" onclick="uifnPopupClose('CouponCreatePopup')"><i class="fa fa-times"></i></button>
-			</div>
-			<div class="panelContent">
-			<form id="couponCreateForm" name="couponCreateForm">
+ -->
+<div class="modalPopup" data-width="1200">
+	<div class="panelStyle" >
+		<div class="panelTitle">
+			<h2>쿠폰등록</h2>
+			<button type="button" class="close" onclick="uifnPopupClose('CouponCreatePopup')"><i class="fa fa-times"></i></button>
+		</div>
+		<div class="panelContent">
+			<form id="couponCreateForm" name="couponCreateForm" th:action="@{'/marketing/coupon/save'}" >
+				<input type="hidden" name="supplyCompList" id="supplyCompList">
+				<input type="hidden" name="brandList" id="brandList">
+				<input type="hidden" name="applyGoodsList" id="applyGoodsList">
+				<input type="hidden" name="exceptGoodsList" id="excepGoodsList">
+				<input type="hidden" name="burdenList" id="burdenList">
+				<input type="hidden" name="cateList" id="cateList">
+
 				<div class="tabs">
 					<div class="tabsNav">
 						<ul>
@@ -45,9 +52,9 @@
 										<td colspan="5">
 											<input type="hidden" name="copyCpnId" maxlength="50" value="">
 											<input type="hidden" name="mode" maxlength="50" value="">
-											<input type="text" name="cpnId" maxlength="50" value="" style="width:70%;" disabled="true" placeholder="자동생성" required="required" data-valid-name="쿠폰번호">
+											<input type="text" name="cpnId" maxlength="50" value="" style="width:70%;" disabled="true" placeholder="자동생성" data-valid-name="쿠폰번호">
 											<label class="chkBox checked" onclick="clickCreateChk(this);" id="cpnCreateLab">
-												<input type="checkbox" name="cpnCreateType"  value="true" class="type-check" checked />쿠폰번호 자동생성
+												<input type="checkbox" name="cpnCreateType" id="cpnCreateType" value="true" class="type-check" checked />쿠폰번호 자동생성
 											</label>
 										</td>
 									</tr>
@@ -81,8 +88,8 @@
 									<tr>
 										<th>사용고객등급구분<em class="required" title="필수"></em></th>
 										<td>
-											<select name="usableCustGradeList" id="usableCustGradeList" required="required" data-valid-name="사용고객등급구분">
-												<option value="">[전체]</option>
+											<select name="usableCustGrade" id="usableCustGrade" required="required" data-valid-name="사용고객등급구분">
+												<option value="ALL">[전체]</option>
 												<option th:if="${usableCustGradeList}" th:each="oneData , status : ${usableCustGradeList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
 											</select>
 										</td>
@@ -96,10 +103,14 @@
 									</tr>
 									<tr>
 										<th>할인방식<em class="required" title="필수"></em></th>
-										<td colspan="5">
+										<td>
 											<input type="hidden" name="dcWay" id="dcWay" required="required" data-valid-name="할인방식">
 											<label class="rdoBtn" th:if="${dcWayList}" th:each="oneData, status : ${dcWayList}"> <input type="radio" name="rdoDcWay"  th:text="${oneData.cdNm}" th:value="${oneData.cd}"/></label>
 										</td>
+										<th>구매제한금액<em class="required" title="필수"></em></th>
+										<td>
+											<input type="text" id="buyLimitAmt" name="buyLimitAmt" class="w200" required="required" value="0" style="text-align: right;" data-valid-name="구매제한금액">원
+										</td>
 									</tr>
 									<tr>
 										<th>할인값(PC)<em class="required" title="필수"></em></th>
@@ -125,7 +136,7 @@
 										<th>다운로드시작일시<em class="required" title="필수"></em></th>
 										<td>
 											<input type="hidden" name="downStdt" id="downStdt" required="required" data-valid-name="다운로드시작일시">
-											<input type="text" class="schDate w100" name="" id="downStDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
+											<input type="text" class="schDate w100" name="downStDay" id="downStDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
 											<select name="downStHH" id="downStHH">
 												<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
 											</select>
@@ -190,17 +201,24 @@
 									</tr>
 									<tr>
 										<th>첫구매여부<em class="required" title="필수"></em></th>
-										<td colspan="5">
+										<td>
 											<select name="firstYn" id="firstYn" onchange="firstYnChange(this)" required="required" data-valid-name="첫구매여부">
 												<option value="Y">Y</option>
 												<option value="N" selected="selected">N</option>
 											</select>
 										</td>
+										<th>다운로드가능여부<em class="required" title="필수"></em></th>
+										<td>
+											<select name="downYn" id="downYn" required="required" data-valid-name="다운로드가능여부">
+												<option value="Y">Y</option>
+												<option value="Y" selected="selected">N</option>
+											</select>
+										</td>
 									</tr>
 									<tr>
 										<th class="buyDateTr">첫구매기간시작일시<em class="required" title="필수"></em></th>
 										<td class="buyDateTr">
-											<input type="hidden" name="buyStdt" id="buyStdt" data-valid-name="유효기간시작일시">
+											<input type="hidden" id="buyEddt" name="buyEddt" data-valid-name="첫구매기간종료일시">
 											<input type="text" class="schDate w100" name="buyStDay" id="buyStDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
 											<select name="buyStHH" id="buyStHH">
 												<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
@@ -210,7 +228,7 @@
 											</select>
 										<th class="buyDateTr">첫구매기간종료일시<em class="required" title="필수"></em></th>
 										<td class="buyDateTr">
-											<input type="hidden" id="buyEddt" name="buyEddt" data-valid-name="유효기간종료일시">
+											<input type="hidden" name="buyStdt" id="buyStdt" data-valid-name="첫구매기간시작일시">
 											<input type="text" class="schDate w100" name="buyEdDay" id="buyEdDay" maxlength="10" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
 											<select name="buyEdHH" id="buyEdHH">
 												<option th:if="${hhList}" th:each="oneData , status : ${hhList}" th:text="${oneData.cdNm}" th:value="${oneData.cd}"></option>
@@ -223,7 +241,7 @@
 									<tr>
 										<th>신규회원여부<em class="required" title="필수"></em></th>
 										<td colspan="5">
-											<select name="custJoinYN" id="custJoinYn" onchange="custJoinYnChange(this)" required="required" data-valid-name="신규회원여부">
+											<select name="custJoinYn" id="custJoinYn" onchange="custJoinYnChange(this)" required="required" data-valid-name="신규회원여부">
 												<option value="Y">Y</option>
 												<option value="N" selected="selected">N</option>
 											</select>
@@ -300,44 +318,267 @@
 										</td>
 									</tr>
 								</table>
+								<div class="mdPopBtnB aR">
+									<button type="button" class="btn btn-info btn-lg" onclick="fnCouponCreate();">등록</button>
+								</div>
+							</div>
+						</li>
+						<!-- 쿠폰적용대상-->
+						<li class="tab" id="coupontab2" >
+							<div class="panelStyle">
+								<div class="panelTitle">
+									<h2 style="position: relative">적용 대상 상품 등록</h2>
+								</div>
+								<div class="inner-panelContent">
+									<div class="panelContent">
+										<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="btnSupplyAdd">공급처 추가</button>
+															<button type="button" class="btn btnRight btn-success btn-lg" id="btnSupplyDel">선택삭제</button>
+															<br/>
+															<div id="supplyGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
+														</div>
+													</td>
+												</tr>
+												<tr>
+													<th>브랜드</th>
+													<td>
+														<div class="padding10 inner-tb-solid">
+															<button type="button" class="btn btnRight btn-success btn-lg" id="btnBrandAdd">브랜드 추가</button>
+															<button type="button" class="btn btnRight btn-success btn-lg" id="btnBrandDel">선택삭제</button>
+															<br/>
+															<div id="brandGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
+														</div>
+													</td>
+												</tr>
+												<tr>
+													<th>카테고리</th>
+													<td>
+														<div class="padding10 inner-tb-solid">
+															<button type="button" class="btn btnRight btn-success btn-lg" id="btnCateAdd">카테고리 추가</button>
+															<button type="button" class="btn btnRight btn-success btn-lg" id="btnCateDel">선택삭제</button>
+															<br/>
+															<div id="cateGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
+														</div>
+													</td>
+												</tr>
+												<tr>
+													<th>적용상품</th>
+													<td>
+														<div class="padding10 inner-tb-solid">
+															<button type="button" class="btn btnRight btn-success btn-lg" id="btnGoodsAdd">상품 추가</button>
+															<button type="button" class="btn btnRight btn-success btn-lg" id="btnGoodsDel">선택삭제</button>
+															<br/>
+															<div id="goodsGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
+														</div>
+													</td>
+												</tr>
+											</tbody>
+										</table>
+									</div>
+								</div>
+								<div class="panelTitle">
+									<h2 style="position: relative">적용 제외 대상 상품 등록</h2>
+								</div>
+								<div class="inner-panelContent">
+									<div class="panelContent">
+										<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="btnExcepGoodsAdd">제외상품 추가</button>
+														<button type="button" class="btn btnRight btn-success btn-lg" id="btnExcepGoodsDel">선택삭제</button>
+														<br/>
+														<div id="excepGoodsGridList" style="width:100%; height:200px;" class="ag-theme-balham"></div>
+													</div>
+												</td>
+											</tr>
+											</tbody>
+										</table>
+									</div>
+								</div>
+							</div>
+						</li>
+						<!-- 쿠폰적용대상끝-->
+						<!-- 입점업체분담율-->
+						<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="btnDeleteRow">행삭제</button>
+									</li>
+								</ul>
+
+								<div id="inComGridList" style="width: 100%; height: 570px" class="ag-theme-balham"></div>
+
 							</div>
 						</li>
+						<!-- 입점업체분담끝-->
 					</ul>
 				</div>
 			</form>
-			</div>
 		</div>
 	</div>
+</div>
 <script th:inline="javascript">
-/*<![CDATA[*/
+	/*<![CDATA[*/
+	var ibSupplyComList = gagajf.convertToArray([[${ibSupplyCompList}]]);
+	var delYnList = { "Y":"Yes", "N":"No" };
 
-	$(function(){
-		// 초기화시 데이터 세팅
-		$('input[name=rdoCpnType]').eq(0).attr("checked" , true);
-		$('input[name=rdoDcWay]').eq(0).attr("checked" , true);
-		$('input[name=rdoApplyScope]').eq(0).attr("checked" , true)
-		$('#availEdHH option:last').attr("selected" , "selected");
-		$('#availEdMM option:last').attr("selected" , "selected");
-		$('#downEdHH option:last').attr("selected" , "selected");
-		$('#downEdMM option:last').attr("selected" , "selected");
-		$('#custJoinEdHH option:last').attr("selected" , "selected");
-		$('#custJoinEdMM option:last').attr("selected" , "selected");
-		$('#buyEdHH option:last').attr("selected" , "selected");
-		$('#buyEdMM option:last').attr("selected" , "selected");
-		pdGbChange();
-		firstYnChange();
-		custJoinYnChange();
-	})
+	// 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:"burdenRate" , width:150, cellClass: "text-center" ,
+		  cellEditorParams: { maxlength: 10, required: true }
+		} ,
+		{ headerName: "삭제여부" , field: "delYn"  , width:150, cellClass: "text-center" ,
+			cellEditor: 'agRichSelectCellEditor',
+			cellEditorParams: { values: gagaAgGrid.extractValues(delYnList) },
+			valueFormatter: function (params) { return gagaAgGrid.lookupValue(delYnList, params.value); },
+			valueParser: function (params) { return gagaAgGrid.lookupKey(delYnList, params.newValue); }
+		}
+	];
+
+	// ag-grid 공급처 컬럼
+	var supplyColumnDefs = [
+		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
+		{ headerName : "공급업체코드" , field: "supplyCompCd" , width:150, cellClass: 'text-center'} ,
+		{ headerName: "공급업체명" , field: "supplyCompNm" , width:150, cellClass: 'text-center'}
+	];
+
+	// ag-grid 브랜드 컬럼
+	var brandSelColumnDefs = [
+		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
+		{ headerName : "브랜드ID" , field: "brandCd" , width: 120, cellClass : 'text-center'} ,
+		{ headerName : "브랜드명" , field: "brandEnm" , width: 120, cellClass: 'text-center'} ,
+		{ headerName : "공급업체명", field: "supplyCompNm" , width: 150, cellClass: 'text-center' } ,
+		//{ headerName: "적용대상" , field: "targetGb" , width: 150, cellClass: 'text-center'}
+	];
+
+	// ag-grid 적용상품 컬럼
+	var goodsSelColumnDefs = [
+		{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: "targetGB" , width: 150, cellClass: 'text-center'}
+	];
+
+	// ag-grid 카테고리 컬럼
+	var cateSelColumnDefs = [
+		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
+		{ headerName: "카테고리코드" , field: "cateNo" , width: 100 , cellClass: 'text-center'} ,
+		{ headerName: "카테고리명" , field: "cateNm" , width: 120 , cellClass: 'text-center'},
+		//{ headerName: "적용대사"}
+	];
+
+	// ag-grid 제외상품 컬럼
+	var excepGoodsColumnDefs = [
+		{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'} ,
+	];
+
+	var inComGridOptions = gagaAgGrid.getGridOptions(columnDefs);
+	var cateGridOptions = gagaAgGrid.getGridOptions(cateSelColumnDefs);
+	var goodsGridOptions = gagaAgGrid.getGridOptions(goodsSelColumnDefs);
+	var brandGridOptions = gagaAgGrid.getGridOptions(brandSelColumnDefs);
+	var supplyGridOptions = gagaAgGrid.getGridOptions(supplyColumnDefs);
+	var excepGoodsGridOptions = gagaAgGrid.getGridOptions(excepGoodsColumnDefs);
+
+	inComGridOptions.defaultColDef.editable = true;
+	inComGridOptions.rowSelection = "multiple";
+	goodsGridOptions.rowSelection = "multiple";
+	supplyGridOptions.rowSelection = "multiple";
+	excepGoodsGridOptions.rowSelection = "multiple";
+	cateGridOptions.rowSelection = "multiple";
+	brandGridOptions.rowSelection = "multiple";
+	inComGridOptions.stopEditingWhenGridLosesFocus = true;
 
 	// 쿠폰 등록 버튼 클릭시
 	function fnCouponCreate(){
 		// 필수값들 셋팅
 		setReqValue();
 
+		// 필수값 validation 체크
 		if (!gagajf.validation('#couponCreateForm')) {
 			return false;
 		}
 
+		//신규가입 지급한다면 validation 체크
+		if( $('#custJoinYn option:selected').val() == "Y" ){
+			var fromDate = $('#couponCreateForm input[name=custJoinStdt]').val();
+			var toDate = $('#couponCreateForm input[name=custJoinEddt]').val();
+
+			if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
+				mcxDialog.alertC("신규가입기간 시작일자와 종료일자를 입력하세요.", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#couponCreateForm input[name=custJoinStdt]').focus();
+					}
+				});
+				return false;
+			}
+
+			if (fromDate > toDate) {
+				mcxDialog.alertC("등록 시작일자는 종료일자 보다 클 수 없습니다.", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#couponCreateForm input[name=custJoinEddt]').focus();
+					}
+				});
+				return false;
+			}
+		}
+
+		// 첫구매 지급하면 validation 체크
+		if( $('#firstYn option:selected').val() == "Y" ){
+			var fromDate = $('#couponCreateForm input[name=buyStdt]').val();
+			var toDate = $('#couponCreateForm input[name=buyEddt]').val();
+
+			if (gagajf.isNull(fromDate) || gagajf.isNull(toDate)) {
+				mcxDialog.alertC("신규가입기간 시작일자와 종료일자를 입력하세요.", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#couponCreateForm input[name=buyStdt]').focus();
+					}
+				});
+				return false;
+			}
+
+			if (fromDate > toDate) {
+				mcxDialog.alertC("등록 시작일자는 종료일자 보다 클 수 없습니다.", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$('#couponCreateForm input[name=buyEddt]').focus();
+					}
+				});
+				return false;
+			}
+		}
+
+		// 할인율 validation 체크 (100을 넘길수없음)
 		if($('#dcWay').val() == 'G240_11') {
 			if($('#dcPval').val() > 100) {
 				mcxDialog.alert('PC할인율은 100을 초과할수없습니다.');
@@ -353,6 +594,17 @@
 				return false;
 			}
 		}
+
+		mcxDialog.confirm('저장하시겠습니까?' , {
+			cancelBtnText:"취소",
+			sureBtnText:"확인",
+			sureBtnClick: function () {
+				gagajf.ajaxFormSubmit($('#couponCreateForm').prop('action'), '#couponCreateForm', function() {
+					uifnPopupClose('CouponCreatePopup');
+					$('#btnSearch').trigger('click');
+				});
+			}
+		});
 	}
 
 	// 할인방식 변경
@@ -384,13 +636,147 @@
 		// 주문서 쿠폰 선택시 결제수단 노출
 		if(radioValue == 'G230_20') {
 			$('.payTypeTr').css('display' , '');
-			$('#payType').attr('required' , true);
+			$('#couponCreateForm #payType').attr('required' , true);
 		} else {
 			$('.payTypeTr').css('display' , 'none');
-			$('#payType').attr('required' , false );
+			$('#couponCreateForm #payType').attr('required' , false );
 		}
+
+		$('#couponCreateForm #cpnType').val(radioValue);
+	});
+
+	// 적용대상 - 브랜드 추가 버튼시
+	$('#btnBrandAdd').on('click' , function(){
+		cfnOpenBrandListPopup("fnSetPopupBrandInfo", "M");
 	});
 
+	// 브랜드 설정 / 브랜드 추가 콜백함수 (단수로 가져오므로 복수일 경우에 수정 확인 필요)
+	var fnSetPopupBrandInfo = function(result) {
+		for(let i = 0 ; i < result.length ; i++) {
+			let addChk = true, gridListValue = gagaAgGrid.getAllRowData(brandGridOptions);		// 받아온 모든 데이터
+
+			// 받아온 data for
+			for(let j = 0 ; j < gridListValue.length ; j++) {
+				if(gridListValue[j].brandCd == result[i].brandCd) {	addChk = false;	}					// 중복체크
+			}
+
+			// 중복되지 않은 데이터 리스트에 추가
+			if(addChk) {
+				gagaAgGrid.addRowData(brandGridOptions, {"brandCd" : result[i].brandCd, "brandEnm" : result[i].brandEnm, "supplyCompNm" : result[i].supplyCompNm, "targetGb" : "G260_12"});
+			}
+		}
+	};
+
+	// 적용대상 - 브랜드 삭제 버튼시
+	$('#btnBrandDel').on('click' , function(){
+		brandGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(brandGridOptions)});
+	});
+
+	// 적용대상 - 공급처 추가 버튼시
+	$('#btnSupplyAdd').on('click' , function (){
+		cfnOpenCompanyListPopup("fnSetPopupComapnyInfo");
+	});
+
+	// 공급업체 설정 / 업체 추가 콜백함수
+	var fnSetPopupComapnyInfo = function(result) {
+		// 기존 리스트 데이터 for
+		for(let i = 0 ; i < result.length ; i++) {
+			let addChk = true, gridListValue = gagaAgGrid.getAllRowData(supplyGridOptions);		// 받아온 모든 데이터
+
+			// 받아온 data for
+			for(let j = 0 ; j < gridListValue.length ; j++) {
+				// 동일한 data는 추가하지 않음
+				if(gridListValue[j].supplyCompCd == result[i].supplyCompCd) {	addChk = false;	}		// 중복체크
+			}
+
+			// 중복되지 않은 데이터 리스트에 추가
+			if(addChk) {
+				gagaAgGrid.addRowData(supplyGridOptions, {"supplyCompCd" : result[i].supplyCompCd, "supplyCompNm" : result[i].supplyCompNm, "targetGb" : "G260_13"});
+			}
+		}
+	};
+
+	// 적용대상 - 공급처 삭제시시
+	$('#btnSupplyDel').on('click' , function () {
+		supplyGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(supplyGridOptions)});
+	});
+
+	// 적용대상 - 카테고리 추가시
+	$('#btnCateAdd').on('click' , function () {
+		cfnOpenCategoryPopup("fnSetPopupCategoryInfo");
+	});
+
+	// 카테고리 추가 콜백 함수
+	var fnSetPopupCategoryInfo = function (result) {
+		// 기존 리스트 데이터 for
+		for(let i = 0 ; i < result.length ; i++) {
+			let addChk = true, gridListValue = gagaAgGrid.getAllRowData(cateGridOptions);		// 받아온 모든 데이터
+
+			// 받아온 data for
+			for(let j = 0 ; j < gridListValue.length ; j++) {
+				// 동일한 data는 추가하지 않음
+				if(gridListValue[j].supplyCompCd == result[i].supplyCompCd) {	addChk = false;	}		// 중복체크
+			}
+
+			// 중복되지 않은 데이터 리스트에 추가
+			if(addChk) {
+				gagaAgGrid.addRowData(cateGridOptions, {"supplyCompCd" : result[i].supplyCompCd, "supplyCompNm" : result[i].supplyCompNm, "targetGb" : "G260_13"});
+			}
+		}
+	}
+
+	// 적용대상 - 카테고리 삭제시
+	$('#btnCateDel').on('click' , function () {
+		cateGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(cateGridOptions)});
+	});
+
+	// 적용대상 - 상품 추가시
+	$('#btnGoodsAdd').on('click' , function () {
+		cfnOpenGoodsPopup("fnSetPopupApplyGoodsInfo");
+	});
+
+	// 적용 상품 리스트 콜백함수
+	var fnSetPopupApplyGoodsInfo = function(result) {
+		gridAddGoodsList(goodsGridOptions, result , "apply");
+	};
+
+	// 적용대상 - 상품 삭제 시
+	$('#btnGoodsDel').on('click' , function () {
+		goodsGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(goodsGridOptions)});
+	});
+
+	// 적용대상 - 제외상품 추가시
+	$('#btnExcepGoodsAdd').on('click' , function(){
+		gridAddGoodsList(excepGoodsGridOptions, result , "except");
+	});
+
+	$('#btnExcepGoodsDel').on('click' , function () {
+		excepGoodsGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(excepGoodsGridOptions)});
+	});
+
+	// ag-grid 상품관련 list 콜백함수
+	function gridAddGoodsList(OriginGridListOption, result, gubun) {
+		var goodsGbVal = "G800_10";
+		if(gubun == 'except'){
+			goodsGbVal = "G800_30";
+		}
+
+		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(addChk) {
+				//gagaAgGrid.addRowData(OriginGridListOption, result[i], "goodsCd");
+				gagaAgGrid.addRowData(OriginGridListOption, {"goodsGb": goodsGbVal, "goodsCd" : result[i].goodsCd, "goodsNm" : result[i].goodsNm, "targetGb" : "G260_10"});
+			}
+		}
+	}
+
 	// 기간 일수 변경시
 	function pdGbChange(pThis){
 		var selectVal = $(pThis).val();
@@ -402,13 +788,19 @@
 		if(selectVal == "P") {
 			$('.availDateTr').css('display' , '');
 			$('.availDayTr').css('display' , 'none');
-			$('#availDays').attr('required' , false);
-			$('#availStDay').attr('required' , true);
+			$('#couponCreateForm #availDays').attr('required' , false);
+			$('#couponCreateForm #availStDay').attr('required' , true);
+			$('#couponCreateForm #availEdDay').attr('required' , true);
+			$('#couponCreateForm #availStdt').attr('required' , true);
+			$('#couponCreateForm #availEddt').attr('required' , true);
 		} else {
 			$('.availDateTr').css('display' , 'none');
 			$('.availDayTr').css('display' , '');
-			$('#availDays').attr('required' , true);
-			$('#availStDay').attr('required' , false);
+			$('#couponCreateForm #availDays').attr('required' , true);
+			$('#couponCreateForm #availStDay').attr('required' , false);
+			$('#couponCreateForm #availEdDay').attr('required' , false);
+			$('#couponCreateForm #availStdt').attr('required' , false);
+			$('#couponCreateForm #availEddt').attr('required' , false);
 		}
 	}
 
@@ -450,15 +842,24 @@
 		}
 	}
 
+	// 행추가시
+	$('#btnAddRow').on('click' , function(){
+		var data = { supplyCompCd: null , burdenRate : null , delYn : null};
+		gagaAgGrid.addRowData(inComGridOptions , data , "supplyCompCd" );
+	});
+
 	// 쿠폰번호 자동생성 클릭시
 	function clickCreateChk(){
 		var flag = $('#couponCreateForm input[name=cpnCreateType]').prop("checked");
+
 		if(!flag) {
 			$("#couponCreateForm input[name=cpnId]").prop("disabled", true);
+			$("#couponCreateForm input[name=cpnId]").attr("required", false);
 			$("#couponCreateForm input[name=cpnId]").attr("placeholder", "자동생성");
 			$('#couponCreateForm input[name=cpnCreateType]').prop("checked" , false);
 		} else{
 			$("#couponCreateForm input[name=cpnId]").prop("disabled", false);
+			$("#couponCreateForm input[name=cpnId]").attr("required", true);
 			$("#couponCreateForm input[name=cpnId]").attr("placeholder", "");
 			$('#couponCreateForm input[name=cpnCreateType]').prop("checked" , true);
 		}
@@ -467,24 +868,73 @@
 	// 전송시 값 세팅
 	function setReqValue(){
 		// 쿠폰유형값 세팅
-		$('#cpnType').val($('input [name=cpnTypeList]:checked').val());
+		$('#couponCreateForm #cpnType').val($('#couponCreateForm input:radio[name="rdoCpnType"]:checked').val());
 		// 할인방식값 세팅
-		$('#dcWay').val($('input [name=dcWayList]:checked').val());
+		$('#couponCreateForm #dcWay').val($('#couponCreateForm input:radio[name="rdoDcWay"]:checked').val());
 		// 적용범위값 세팅
-		$('#applyScope').val($('input [name=rdoApplyScope]:checked').val());
+		$('#couponCreateForm #applyScope').val($('#couponCreateForm input:radio[name="rdoApplyScope"]:checked').val());
 		// 다운로드기간 세팅
-		$('#downStdt').val($('#downStDay').val() + " " + $('#downStHH').val() + ":" + $('#downStMM').val() + "00");
-		$('#downEddt').val($('#downEdDay').val() + " " + $('#downEdHH').val() + ":" + $('#downEdMM').val() + "59");
+		$('#couponCreateForm #downStdt').val($('#couponCreateForm #downStDay').val() + " " + $('#couponCreateForm #downStHH').val() + ":" + $('#couponCreateForm #downStMM').val() + ":00");
+		$('#couponCreateForm #downEddt').val($('#couponCreateForm #downEdDay').val() + " " + $('#couponCreateForm #downEdHH').val() + ":" + $('#couponCreateForm #downEdMM').val() + ":59");
 		// 유효기간 세팅
-		$('#availStdt').val($('#availStDay').val() + " " + $('#availStHH').val() + ":" + $('#availStMM').val() + "00");
-		$('#availEddt').val($('#availEdDay').val() + " " + $('#availEdHH').val() + ":" + $('#availEdMM').val() + "59");
+		$('#couponCreateForm #availStdt').val($('#couponCreateForm #availStDay').val() + " " + $('#couponCreateForm #availStHH').val() + ":" + $('#couponCreateForm #availStMM').val() + ":00");
+		$('#couponCreateForm #availEddt').val($('#couponCreateForm #availEdDay').val() + " " + $('#couponCreateForm #availEdHH').val() + ":" + $('#couponCreateForm #availEdMM').val() + ":59");
 		// 첫구매기간세팅
-		$('#buyStdt').val($('#buyStDay').val() + " " + $('#buyStHH').val() + ":" + $('#buyStMM').val() + "00");
-		$('#buyEddt').val($('#buyEdDay').val() + " " + $('#buyEdHH').val() + ":" + $('#buyEdMM').val() + "59");
+		$('#couponCreateForm #buyStdt').val($('#couponCreateForm #buyStDay').val() + " " + $('#couponCreateForm #buyStHH').val() + ":" + $('#couponCreateForm #buyStMM').val() + ":00");
+		$('#couponCreateForm #buyEddt').val($('#couponCreateForm #buyEdDay').val() + " " + $('#couponCreateForm #buyEdHH').val() + ":" + $('#couponCreateForm #buyEdMM').val() + ":59");
 		// 신규회원기간 세팅
-		$('#custJoinStdt').val($('#custJoinStDay').val() + " " + $('#custJoinStHH').val() + ":" + $('#custJoinStMM').val() + "00");
-		$('#custJoinEddt').val($('#custJoinEdDay').val() + " " + $('#custJoinEdHH').val() + ":" + $('#custJoinEdMM').val() + "59");
+		$('#couponCreateForm #custJoinStdt').val($('#couponCreateForm #custJoinStDay').val() + " " + $('#couponCreateForm #custJoinStHH').val() + ":" + $('#couponCreateForm #custJoinStMM').val() + ":00");
+		$('#couponCreateForm #custJoinEddt').val($('#couponCreateForm #custJoinEdDay').val() + " " + $('#couponCreateForm #custJoinEdHH').val() + ":" + $('#couponCreateForm #custJoinEdMM').val() + ":59");
+		// 적용대상 - 공급처 그리드 전체값 세팅
+		var supplyAllData = gagaAgGrid.getAllRowData(supplyGridOptions);
+		var jsonSupplyCompData = JSON.stringify(supplyAllData);
+		$('#couponCreateForm #supplyCompList').val(jsonSupplyCompData);
+		// 적용대상 - 브랜드 그리드 전체값 세팅
+		var brandAllData = gagaAgGrid.getAllRowData(brandGridOptions);
+		var jsonBrandData = JSON.stringify(brandAllData);
+		$('#couponCreateForm #brandlist').val(jsonBrandData);
+		// // 적용대상 - 카테고리 그리드 전체값 세팅
+		var cateAllData = gagaAgGrid.getAllRowData(cateGridOptions);
+		var jsonCateData = JSON.stringify(cateAllData);
+		$('#couponCreateForm #cateList').val(jsonCateData);
+		// 적용대상 - 적용상품 그리드 전체값 세팅
+		var goodsAllData = gagaAgGrid.getAllRowData(goodsGridOptions);
+		var jsonGoodsData = JSON.stringify(goodsAllData);
+		$('#couponCreateForm #applyGoodsList').val(jsonGoodsData);
+		// 적용대상 - 제외상품 그리드 전체값 세팅
+		var exceptGoodsAllData = gagaAgGrid.getAllRowData(excepGoodsGridOptions);
+		var jsonExceptGoodsData = JSON.stringify(exceptGoodsAllData);
+		$('#couponCreateForm #excepGoodsList').val(jsonExceptGoodsData);
+
 	}
-/*]]>*/
+
+	$(document).ready(function() {
+		// 초기화시 데이터 세팅
+		$('input[name=rdoCpnType]').eq(0).attr("checked" , true);
+		$('input[name=rdoDcWay]').eq(0).attr("checked" , true);
+		$('input[name=rdoApplyScope]').eq(0).attr("checked" , true)
+		$('#couponCreateForm #availEdHH option:last').attr("selected" , "selected");
+		$('#couponCreateForm #availEdMM option:last').attr("selected" , "selected");
+		$('#downEdHH option:last').attr("selected" , "selected");
+		$('#downEdMM option:last').attr("selected" , "selected");
+		$('#custJoinEdHH option:last').attr("selected" , "selected");
+		$('#custJoinEdMM option:last').attr("selected" , "selected");
+		$('#buyEdHH option:last').attr("selected" , "selected");
+		$('#buyEdMM option:last').attr("selected" , "selected");
+
+		pdGbChange();
+		firstYnChange();
+		custJoinYnChange();
+
+		gagaAgGrid.createGrid('inComGridList', inComGridOptions);
+		gagaAgGrid.createGrid('brandGridList' , brandGridOptions);
+		gagaAgGrid.createGrid('cateGridList' , cateGridOptions);
+		gagaAgGrid.createGrid('supplyGridList' , supplyGridOptions);
+		gagaAgGrid.createGrid('goodsGridList' , goodsGridOptions);
+		gagaAgGrid.createGrid('excepGoodsGridList' , excepGoodsGridOptions);
+
+	});
+
+	/*]]>*/
 </script>
 </html>

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

@@ -141,10 +141,10 @@
 		/*<![CDATA[*/
 		var columnDefs = [];
 		columnDefs = [
-			{headerName: "사이트", field: "siteCD", width: 80, cellClass: 'text-center'},
+			{headerName: "사이트", field: "siteCd", width: 80, cellClass: 'text-center'},
 			{headerName: "쿠폰ID", field: "cpnId", width: 130, cellClass: 'text-center'},
 			{headerName: "쿠폰명", field: "cpnNm", width: 140, cellClass: 'text-center'},
-			{headerName: "사용가능고객구분", field: "useableCustGb", width: 140, cellClass: 'text-center'},
+			{headerName: "사용가능고객구분", field: "usableCustGb", width: 140, cellClass: 'text-center'},
 			{headerName: "쿠폰유형", field: "cpnType", width: 140, cellClass: 'text-center'},
 			{headerName: "할인방식", field: "dcWay", width: 140, cellClass: 'text-center'},
 			{headerName: "할인값(PC)", field: "dcPval", width: 140, cellClass: 'text-center'},
@@ -263,5 +263,4 @@
 		/*]]>*/
 	</script>
 </div>
-
 </html>