瀏覽代碼

쿠폰조회 로직 Marketing -> Coupon 으로 이동

gagamel 5 年之前
父節點
當前提交
1e0258b793

+ 14 - 4
src/main/java/com/style24/admin/biz/dao/TsaCouponDao.java

@@ -1,12 +1,11 @@
 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;
 
+import com.style24.core.support.annotation.ShopDs;
+import com.style24.persistence.domain.Coupon;
+
 /**
  * 쿠폰 DAO
  * @author xyzp1539
@@ -14,6 +13,7 @@ import java.util.Collection;
  */
 @ShopDs
 public interface TsaCouponDao {
+
 	/**
 	 * 쿠폰 리스트 조회
 	 * @param  Coupon
@@ -39,4 +39,14 @@ public interface TsaCouponDao {
 	 * @since  2021-01-12
 	 */
 	void couponInsert(Coupon params);
+
+	/**
+	 * 쿠폰조회 목록
+	 * @param coupon - 쿠폰 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 8
+	 */
+	Collection<Coupon> getCouponRetrieveList(Coupon coupon);
+
 }

+ 3 - 12
src/main/java/com/style24/admin/biz/dao/TsaMarketingDao.java

@@ -1,12 +1,11 @@
 package com.style24.admin.biz.dao;
 
+import java.util.Collection;
+
 import org.springframework.stereotype.Component;
 
 import com.style24.core.support.annotation.ShopDs;
-import com.style24.persistence.domain.*;
-
-import java.util.ArrayList;
-import java.util.Collection;
+import com.style24.persistence.domain.FreeGoodsPromotion;
 
 /**
  * 마케팅 Dao
@@ -30,12 +29,4 @@ public interface TsaMarketingDao {
 
 	/* // xodud1202 진행 */
 
-	/**
-	 * 쿠폰조회 목록
-	 * @param coupon - 쿠폰 정보
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 1. 8
-	 */
-	Collection<Coupon> getCouponRetrieveList(Coupon coupon);
 }

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

@@ -34,9 +34,6 @@ public class TsaCouponService {
 	@Autowired
 	private TsaCommonService commonService;
 
-
-
-
 	/**
 	 * 쿠폰 저장
 	 * @param params
@@ -53,19 +50,18 @@ public class TsaCouponService {
 		params.setUpdNo(TsaSession.getInfo().getUserNo());
 
 		// 자동생성이면 시퀀스 가져오기
-		if(params.getCpnId() == null || params.getCpnId().equals("")) {
+		if (params.getCpnId() == null || params.getCpnId().equals("")) {
 			int sequence = commonService.getNextSequence("SEQ_COUPON");
-			cpnId = "CPN"+sequence;
+			cpnId = "CPN" + sequence;
 		} else {
 			cpnId = params.getCpnId();
 		}
 
-		log.info(">>>> CPNID : {}" , cpnId );
+		log.info(">>>> CPNID : {}", cpnId);
 		params.setCpnId(cpnId);
 
 		couponDao.couponInsert(params);
 
-
 		//checkCpnValidation(params);
 
 	}
@@ -81,27 +77,27 @@ public class TsaCouponService {
 		ObjectMapper mapper = new ObjectMapper();
 
 		try {
-			if(params.getSupplyCompList() != null) {
+			if (params.getSupplyCompList() != null) {
 				cpnSupplyCompList = mapper.readValue(params.getSupplyCompList(), new TypeReference<Collection<Coupon>>() {
 				});
 			}
-			if(params.getBrandList() != null) {
+			if (params.getBrandList() != null) {
 				cpnBrandList = mapper.readValue(params.getBrandList(), new TypeReference<Collection<Coupon>>() {
 				});
 			}
-			if(params.getApplyGoodsList() != null) {
+			if (params.getApplyGoodsList() != null) {
 				cpnApplyGoodsList = mapper.readValue(params.getApplyGoodsList(), new TypeReference<Collection<Coupon>>() {
 				});
 			}
-			if(params.getCateList() != null) {
+			if (params.getCateList() != null) {
 				cpnCateList = mapper.readValue(params.getCateList(), new TypeReference<Collection<Coupon>>() {
 				});
 			}
-			if(params.getBurdenList() != null) {
+			if (params.getBurdenList() != null) {
 				cpnBurdenList = mapper.readValue(params.getBurdenList(), new TypeReference<Collection<Coupon>>() {
 				});
 			}
-			if(params.getCateList() != null) {
+			if (params.getCateList() != null) {
 				cpnExcepGoodsList = mapper.readValue(params.getExceptGoodsList(), new TypeReference<Collection<Coupon>>() {
 				});
 			}
@@ -109,7 +105,6 @@ public class TsaCouponService {
 			e.printStackTrace();
 		}
 
-
 		return params;
 	}
 
@@ -144,25 +139,25 @@ public class TsaCouponService {
 	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) {
+		if (params.getDcWay() != null && params.getDcWay().equals("G240_11")) {
+			if (params.getDcAval() > 100) {
 				throw new IllegalStateException("모바일 앱 할인율은 100을 초과할수 없습니다.");
-			} else if(params.getDcPval() > 100) {
+			} else if (params.getDcPval() > 100) {
 				throw new IllegalStateException("PC할인율은 100을 초과할수 없습니다.");
-			} else if(params.getDcMval() > 100) {
+			} else if (params.getDcMval() > 100) {
 				throw new IllegalStateException("모바일 웹 100을 초과할수 없습니다.");
 			}
 		}
 
 		// 기간/일수구분이 일수인 경우 날짜 체크
-		if(params.getPdGb() != null && params.getPdGb().equals("D")) {
+		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)) {
+				log.info("checkCpnValidation params.getAvailEddt() :  {}", params.getAvailEddt());
+				log.info("checkCpnValidation params.getAvailStdt :  {}", params.getAvailStdt());
+				if (date2.before(date1)) {
 					throw new IllegalStateException("유효기간 종료날짜가 시작날짜보다 작습니다.");
 				}
 			} catch (ParseException exception) {
@@ -170,14 +165,14 @@ public class TsaCouponService {
 		}
 
 		// 직접다운로드인 경우 기간 체크
-		if(params.getDnGb() != null && params.getDnGb().equals("G058_20")) {
+		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)) {
+				log.info("checkCpnValidation params.getDownStdt() :  {}", params.getDownStdt());
+				log.info("checkCpnValidation params.getDownEddt :  {}", params.getDownEddt());
+				if (date2.before(date1)) {
 					throw new IllegalStateException("다운로드 종료날짜가 시작날짜보다 작습니다.");
 				}
 			} catch (ParseException exception) {
@@ -185,14 +180,14 @@ public class TsaCouponService {
 		}
 
 		// 첫구매 적용하는 경우 날짜 체크
-		if(params.getFirstYn() != null && params.getFirstYn().equals("Y")) {
+		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)) {
+				log.info("checkCpnValidation params.getBuyStdt() :  {}", params.getBuyStdt());
+				log.info("checkCpnValidation params.getBuyEddt :  {}", params.getBuyEddt());
+				if (date2.before(date1)) {
 					throw new IllegalStateException("첫구매 종료날짜가 시작날짜보다 작습니다.");
 				}
 			} catch (ParseException exception) {
@@ -200,10 +195,21 @@ public class TsaCouponService {
 		}
 
 		// 신규회원여부 적용하는 경우 날짜 체크
-		if(params.getCustJoinYn() != null && params.getCustJoinYn().equals("Y")) {
+		if (params.getCustJoinYn() != null && params.getCustJoinYn().equals("Y")) {
 
 		}
 
 	}
 
+	/**
+	 * 쿠폰조회 목록
+	 * @param coupon - 쿠폰 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 1. 8
+	 */
+	public Collection<Coupon> getCouponRetrieveList(Coupon coupon) {
+		return couponDao.getCouponRetrieveList(coupon);
+	}
+
 }

+ 8 - 32
src/main/java/com/style24/admin/biz/service/TsaMarketingService.java

@@ -1,33 +1,19 @@
 package com.style24.admin.biz.service;
 
-import com.fasterxml.jackson.core.type.TypeReference;
+import java.util.Collection;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Service;
+
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.gagaframework.excel.GagaExcelUtil;
-import com.gagaframework.excel.env.GagaExcelConstants;
-import com.gagaframework.web.parameter.GagaMap;
-import com.gagaframework.web.util.GagaDateUtil;
-import com.gagaframework.web.util.GagaFileUtil;
-import com.gagaframework.web.util.GagaStringUtil;
-import com.style24.admin.biz.dao.TsaGoodsDao;
 import com.style24.admin.biz.dao.TsaMarketingDao;
-import com.style24.admin.support.env.TsaConstants;
-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 io.netty.util.internal.StringUtil;
-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 org.springframework.util.StringUtils;
+import com.style24.persistence.domain.FreeGoodsPromotion;
 
-import java.io.IOException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Collection;
+import lombok.extern.slf4j.Slf4j;
 
 /**
  *상품관리 Service
@@ -88,14 +74,4 @@ public class TsaMarketingService {
 
 	/* // xodud1202 진행 */
 
-	/**
-	 * 쿠폰조회 목록
-	 * @param coupon - 쿠폰 정보
-	 * @return
-	 * @author gagamel
-	 * @since 2021. 1. 8
-	 */
-	public Collection<Coupon> getCouponRetrieveList(Coupon coupon) {
-		return marketingDao.getCouponRetrieveList(coupon);
-	}
 }

+ 74 - 54
src/main/java/com/style24/admin/biz/web/TsaMarketingController.java

@@ -1,26 +1,46 @@
 package com.style24.admin.biz.web;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
 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.biz.service.TsaBusinessService;
+import com.style24.admin.biz.service.TsaCommonService;
+import com.style24.admin.biz.service.TsaCouponService;
+import com.style24.admin.biz.service.TsaMarketingService;
+import com.style24.admin.biz.service.TsaMorebetterService;
+import com.style24.admin.biz.service.TsaRendererService;
+import com.style24.admin.biz.service.TsaSystemService;
 import com.style24.admin.support.controller.TsaBaseController;
 import com.style24.admin.support.security.session.TsaSession;
 import com.style24.core.support.message.TscMessageByLocale;
 import com.style24.persistence.TsaPageRequest;
-import com.style24.persistence.domain.*;
+import com.style24.persistence.domain.CommonCode;
+import com.style24.persistence.domain.Coupon;
+import com.style24.persistence.domain.FreeGoodsPromotion;
+import com.style24.persistence.domain.MoreBetter;
+import com.style24.persistence.domain.MoreBetterBurden;
+import com.style24.persistence.domain.MoreBetterGoods;
+import com.style24.persistence.domain.MoreBetterSection;
+
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.env.Environment;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.ModelAndView;
 
-import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
+import com.gagaframework.web.parameter.GagaMap;
+import com.gagaframework.web.rest.server.GagaResponse;
+
 /**
  * 마케팅 Controller
  * @author xodud1202
@@ -81,7 +101,7 @@ public class TsaMarketingController extends TsaBaseController {
 	public GagaMap getFreeGoodsPromotionList(@RequestBody FreeGoodsPromotion param) {
 		GagaMap result = new GagaMap();
 
-		List<FreeGoodsPromotion> marketingList = (ArrayList<FreeGoodsPromotion>) marketingService.getFreeGoodsPromotionList(param);
+		List<FreeGoodsPromotion> marketingList = (ArrayList<FreeGoodsPromotion>)marketingService.getFreeGoodsPromotionList(param);
 
 		param.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
 		param.setPageable(new TsaPageRequest(param.getPageNo() - 1, param.getPageSize()));
@@ -93,7 +113,6 @@ public class TsaMarketingController extends TsaBaseController {
 		return result;
 	}
 
-
 	/**
 	 * 사은품 프로모션 등록 팝업창
 	 * @param param
@@ -114,7 +133,6 @@ public class TsaMarketingController extends TsaBaseController {
 		return mav;
 	}
 
-
 	/* // xodud1202 진행 */
 
 	/* JSM 진행 */
@@ -124,15 +142,15 @@ public class TsaMarketingController extends TsaBaseController {
 	 * @since 2020-12-21
 	 */
 	@GetMapping("/coupon/form")
-	public ModelAndView couponListForm(){
+	public ModelAndView couponListForm() {
 		ModelAndView mav = new ModelAndView();
 
 		// 쿠폰 유형 조회
-		mav.addObject("cpnTypeList" ,  rendererService.getCommonCodeList("G230"));
+		mav.addObject("cpnTypeList", rendererService.getCommonCodeList("G230"));
 		// 할인 유형 조회
-		mav.addObject("dcWayList" , rendererService.getCommonCodeList("G240"));
+		mav.addObject("dcWayList", rendererService.getCommonCodeList("G240"));
 		// 사이트 조회
-		mav.addObject("siteCdList" , rendererService.getCommonCodeList("G000"));
+		mav.addObject("siteCdList", rendererService.getCommonCodeList("G000"));
 		// 사용가능 고객구분 조회
 		mav.addObject("usableCustGbList", rendererService.getCommonCodeList("G100"));
 
@@ -150,8 +168,8 @@ public class TsaMarketingController extends TsaBaseController {
 	 */
 	@PostMapping("/coupon/list")
 	@ResponseBody
-	public GagaMap getCouponList(@RequestBody Coupon param){
-		GagaMap result =  new GagaMap();
+	public GagaMap getCouponList(@RequestBody Coupon param) {
+		GagaMap result = new GagaMap();
 
 		ArrayList<Coupon> cpnList = couponService.getCouponList(param);
 		int cpnTotCnt = couponService.getCouponListCnt(param);
@@ -160,9 +178,9 @@ public class TsaMarketingController extends TsaBaseController {
 		param.setPageable(new TsaPageRequest(param.getPageNo() - 1, param.getPageSize()));
 		param.getPageable().setTotalCount(cpnTotCnt);
 
-		result.set("pageing" , param);
-		result.set("cpnTotCnt" , cpnTotCnt);
-		result.set("cpnList" , cpnList);
+		result.set("pageing", param);
+		result.set("cpnTotCnt", cpnTotCnt);
+		result.set("cpnList", cpnList);
 
 		return result;
 	}
@@ -181,10 +199,10 @@ public class TsaMarketingController extends TsaBaseController {
 
 		// 일시 시 리스트 세팅
 		Collection<CommonCode> hhList = new ArrayList<CommonCode>();
-		for(int i = 0; i < 24; i++) {
+		for (int i = 0; i < 24; i++) {
 			num = "";
 			CommonCode temp = new CommonCode();
-			if(i < 10) {
+			if (i < 10) {
 				num = "0" + i;
 			} else {
 				num = String.valueOf(i);
@@ -195,50 +213,50 @@ public class TsaMarketingController extends TsaBaseController {
 			mav.addObject("goodsStatList", rendererService.getCommonCodeList("G008", "Y", exceptCds));
 
 			temp.setCd(num);
-			temp.setCdNm(num+"시");
+			temp.setCdNm(num + "시");
 
 			hhList.add(temp);
 		}
 		// 일시 분 리스트 세팅
 		Collection<CommonCode> mmList = new ArrayList<CommonCode>();
-		for(int i = 0 ; i < 60; i++) {
+		for (int i = 0; i < 60; i++) {
 			num = "";
 			CommonCode temp = new CommonCode();
-			if(i < 10) {
+			if (i < 10) {
 				num = "0" + i;
 			} else {
 				num = String.valueOf(i);
 			}
 			temp.setCd(num);
-			temp.setCdNm(num+"분");
+			temp.setCdNm(num + "분");
 
 			mmList.add(temp);
 		}
 
 		// 쿠폰 유형 조회
-		mav.addObject("cpnTypeList" ,  rendererService.getCommonCodeList("G230"));
+		mav.addObject("cpnTypeList", rendererService.getCommonCodeList("G230"));
 		// 사용가능 고객구분 조회
 		mav.addObject("usableCustGbList", rendererService.getCommonCodeList("G100"));
 		// 사용가능 고객등급 조회
 		mav.addObject("usableCustGradeList", rendererService.getCommonCodeList("G101"));
 		// 사이트코드 조회
-		mav.addObject("siteCdList" , rendererService.getCommonCodeList("G000"));
+		mav.addObject("siteCdList", rendererService.getCommonCodeList("G000"));
 		// 재발급 여부 조회
-		mav.addObject("reissuanceList" , rendererService.getCommonCodeList("G231"));
+		mav.addObject("reissuanceList", rendererService.getCommonCodeList("G231"));
 		// 할인방식 조회
-		mav.addObject("dcWayList" , rendererService.getCommonCodeList("G240"));
+		mav.addObject("dcWayList", rendererService.getCommonCodeList("G240"));
 		// 쿠폰다운로드 방식 조회
-		mav.addObject("dnGbList" , rendererService.getCommonCodeList("G058"));
+		mav.addObject("dnGbList", rendererService.getCommonCodeList("G058"));
 		// 결제수단 조회
-		mav.addObject("payTypeList" , rendererService.getCommonCodeList("G015"));
+		mav.addObject("payTypeList", rendererService.getCommonCodeList("G015"));
 		// 쿠폰상태 조회
-		mav.addObject("cpnStatList" , rendererService.getCommonCodeList("G232"));
+		mav.addObject("cpnStatList", rendererService.getCommonCodeList("G232"));
 		// 시간 분 리스트 세팅
-		mav.addObject("mmList" , mmList);
+		mav.addObject("mmList", mmList);
 		// 시간 시 리스트 세팅
-		mav.addObject("hhList" , hhList);
+		mav.addObject("hhList", hhList);
 		// 입점업체 조회
-		mav.addObject("ibSupplyCompList" , rendererService.getSupplyCompanyList("","N"));
+		mav.addObject("ibSupplyCompList", rendererService.getSupplyCompanyList("", "N"));
 
 		mav.setViewName("marketing/CouponCreatePopupForm");
 		return mav;
@@ -254,7 +272,7 @@ public class TsaMarketingController extends TsaBaseController {
 	@PostMapping("/coupon/save")
 	@ResponseBody
 	public GagaResponse couponSave(@RequestBody Coupon coupon) {
-		log.info("couponSave : {}" , coupon);
+		log.info("couponSave : {}", coupon);
 
 		couponService.couponSave(coupon);
 
@@ -286,7 +304,7 @@ public class TsaMarketingController extends TsaBaseController {
 	public GagaMap getMorebetterList(@RequestBody MoreBetter param) {
 		GagaMap result = new GagaMap();
 
-		List<MoreBetter> tmtbList = (ArrayList<MoreBetter>) morebetterService.getMorebetterList(param);
+		List<MoreBetter> tmtbList = (ArrayList<MoreBetter>)morebetterService.getMorebetterList(param);
 
 		param.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
 		param.setPageable(new TsaPageRequest(param.getPageNo() - 1, param.getPageSize()));
@@ -308,7 +326,7 @@ public class TsaMarketingController extends TsaBaseController {
 	 */
 	@ResponseBody
 	@GetMapping("/morebetterRegPopup/form")
-	public ModelAndView morebetterRegForm(@RequestParam(value = "mode") String mode, @RequestParam(value = "tmtbSeq", required = false) Integer tmtbSeq,MoreBetter tmtb) {
+	public ModelAndView morebetterRegForm(@RequestParam(value = "mode") String mode, @RequestParam(value = "tmtbSeq", required = false) Integer tmtbSeq, MoreBetter tmtb) {
 		ModelAndView mav = new ModelAndView();
 
 		// 상품상태 : 등록일때는 '대기'
@@ -322,7 +340,7 @@ public class TsaMarketingController extends TsaBaseController {
 		mav.addObject("dcWayList", rendererService.getAvailCommonCodeList("G240"));
 
 		// 적용 상품구분 목록
-		String[] exceptGoodsCds = {"G800_30","G800_40"};
+		String[] exceptGoodsCds = {"G800_30", "G800_40"};
 		mav.addObject("applyGoodsGbList", rendererService.getCommonCodeList("G800", "Y", exceptGoodsCds));
 
 		// 제외 상품구분 목록
@@ -333,21 +351,21 @@ public class TsaMarketingController extends TsaBaseController {
 
 		//tmtb sq 자동생성
 		Integer tmtbSq;
-		if("N".equals(mode)){
-			tmtbSq =  commonService.getNextSequence("SEQ_TMTB");
+		if ("N".equals(mode)) {
+			tmtbSq = commonService.getNextSequence("SEQ_TMTB");
 			tmtb.setTmtbSq(tmtbSq);
 		}
 
-		if("U".equals(mode)){
+		if ("U".equals(mode)) {
 			// 다다익선 정보
 			mav.addObject("tmtbMstInfo", morebetterService.getMorebetterMstInfo(tmtbSeq));
-			mav.addObject("tmtbSupplyCompList", morebetterService.getMorebetterSupplyCompList(tmtbSeq,"G260_13"));
-			mav.addObject("tmtbBrandList", morebetterService.getMorebetterBrandList(tmtbSeq,"G260_12"));
-			mav.addObject("tmtbApplyGoodsList", morebetterService.getMorebetterApplyGoodsList(tmtbSeq,"G260_10"));
-			mav.addObject("tmtbExceptGoodsList", morebetterService.getMorebetterExceptGoodsList(tmtbSeq,"G260_10"));
+			mav.addObject("tmtbSupplyCompList", morebetterService.getMorebetterSupplyCompList(tmtbSeq, "G260_13"));
+			mav.addObject("tmtbBrandList", morebetterService.getMorebetterBrandList(tmtbSeq, "G260_12"));
+			mav.addObject("tmtbApplyGoodsList", morebetterService.getMorebetterApplyGoodsList(tmtbSeq, "G260_10"));
+			mav.addObject("tmtbExceptGoodsList", morebetterService.getMorebetterExceptGoodsList(tmtbSeq, "G260_10"));
 			mav.addObject("tmtbSectionValList", morebetterService.getMorebetterSectionValList(tmtbSeq));
 			mav.addObject("tmtbBurdenList", morebetterService.getMorebetterBurdenList(tmtbSeq));
-		}else{
+		} else {
 			mav.addObject("tmtbMstInfo", new MoreBetter());
 			mav.addObject("tmtbSupplyCompList", new MoreBetterGoods());
 			mav.addObject("tmtbBrandList", new MoreBetterGoods());
@@ -456,6 +474,7 @@ public class TsaMarketingController extends TsaBaseController {
 
 		return super.ok(message.getMessage("SUCC_0001"));
 	}
+
 	/**
 	 * 다다익선 공급업체 삭제
 	 *
@@ -557,6 +576,7 @@ public class TsaMarketingController extends TsaBaseController {
 	@PostMapping("/coupon/retrieve/list")
 	@ResponseBody
 	public Collection<Coupon> getCouponRetrieveList(@RequestBody Coupon coupon) {
-		return marketingService.getCouponRetrieveList(coupon);
+		return couponService.getCouponRetrieveList(coupon);
 	}
+
 }

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

@@ -220,5 +220,38 @@
 		)
 	</insert>
 
+	<!-- 쿠폰조회 목록 -->
+	<select id="getCouponRetrieveList" parameterType="Coupon" resultType="Coupon">
+		/* TsaCoupon.getCouponRetrieveList */
+		SELECT A.CPN_ID                                               /*쿠폰ID*/
+		     , A.CPN_NM                                               /*쿠폰명*/
+		     , A.SITE_CD                                              /*사이트코드(공통코드G000)*/
+		     , A.USABLE_CUST_GB                                       /*사용가능고객구분(공통코드G100)*/
+		     , A.CPN_TYPE                                             /*쿠폰유형(공통코드G230)*/
+		     , A.DC_WAY                                               /*할인방식(공통코드G240)*/
+		     , A.DC_PVAL                                              /*할인값(PC). 할인방식이 금액이면 할인금액, 율이면 할인율*/
+		     , A.DC_MVAL                                              /*할인값(모바일). 할인방식이 금액이면 할인금액, 율이면 할인율*/
+		     , A.MAX_DC_AMT                                           /*최고할인값. 할인방식이 금액이면 최고할인금액, 율이면 최고할인율*/
+		     , A.PD_GB                                                /*기간/일수구분(P 기간, D 일수)*/
+		     , DATE_FORMAT(A.AVAIL_STDT,'%Y%m%d%H%i%S') AS AVAIL_STDT /*유효시작일시(기간/일수구분 "P 기간"일 때 사용됨)*/
+		     , DATE_FORMAT(A.AVAIL_EDDT,'%Y%m%d%H%i%S') AS AVAIL_EDDT /*유효종료일시(기간/일수구분 "P 기간"일 때 사용됨)*/
+		     , A.AVAIL_DAYS                                           /*유효일수(기간/일수구분 "D 일수"일 때 사용됨)*/
+		     , A.CUST_PUB_LIMIT_QTY                                   /*고객당발행제한수량(0은 무제한)*/
+		     , A.TOT_PUB_LIMIT_QTY                                    /*총발행제한수량(0은 무제한)*/
+		     , A.ONE_PUB_QTY                                          /*1회발행수량*/
+		     , A.DN_GB                                                /*다운로드구분(A:자동다운로드, D:직접다운로드). 다운로드가능여부가 "Y 다운로드가능"일 때만 사용됨*/
+		     , A.BUY_LIMIT_AMT                                        /*구매제한금액(0은 제한없음)*/
+		FROM   TB_COUPON A
+		WHERE  A.SITE_CD = #{siteCd}
+		<if test="cpnId !=null and cpnId !=''">
+			AND	   A.CPN_ID = #{cpnId}
+		</if>
+		<if test="cpnNm !=null and cpnNm !=''">
+			AND	   A.CPN_NM LIKE '%'||#{cpnNm}||'%'
+		</if>
+		<if test="cpnType !=null and cpnType !=''">
+			AND	   A.CPN_TYPE = #{cpnType}
+		</if>
+	</select>
 
 </mapper>

+ 0 - 34
src/main/java/com/style24/persistence/mybatis/shop/TsaMarketing.xml

@@ -30,38 +30,4 @@
 
 	<!-- // xodud1202 진행 -->
 
-	<!-- 쿠폰조회 목록 -->
-	<select id="getCouponRetrieveList" parameterType="Coupon" resultType="Coupon">
-		/* TsaMarketing.getCouponRetrieveList */
-		SELECT A.CPN_ID                                               /*쿠폰ID*/
-		     , A.CPN_NM                                               /*쿠폰명*/
-		     , A.SITE_CD                                              /*사이트코드(공통코드G000)*/
-		     , A.USABLE_CUST_GB                                       /*사용가능고객구분(공통코드G100)*/
-		     , A.CPN_TYPE                                             /*쿠폰유형(공통코드G230)*/
-		     , A.DC_WAY                                               /*할인방식(공통코드G240)*/
-		     , A.DC_PVAL                                              /*할인값(PC). 할인방식이 금액이면 할인금액, 율이면 할인율*/
-		     , A.DC_MVAL                                              /*할인값(모바일). 할인방식이 금액이면 할인금액, 율이면 할인율*/
-		     , A.MAX_DC_AMT                                           /*최고할인값. 할인방식이 금액이면 최고할인금액, 율이면 최고할인율*/
-		     , A.PD_GB                                                /*기간/일수구분(P 기간, D 일수)*/
-		     , DATE_FORMAT(A.AVAIL_STDT,'%Y%m%d%H%i%S') AS AVAIL_STDT /*유효시작일시(기간/일수구분 "P 기간"일 때 사용됨)*/
-		     , DATE_FORMAT(A.AVAIL_EDDT,'%Y%m%d%H%i%S') AS AVAIL_EDDT /*유효종료일시(기간/일수구분 "P 기간"일 때 사용됨)*/
-		     , A.AVAIL_DAYS                                           /*유효일수(기간/일수구분 "D 일수"일 때 사용됨)*/
-		     , A.CUST_PUB_LIMIT_QTY                                   /*고객당발행제한수량(0은 무제한)*/
-		     , A.TOT_PUB_LIMIT_QTY                                    /*총발행제한수량(0은 무제한)*/
-		     , A.ONE_PUB_QTY                                          /*1회발행수량*/
-		     , A.DN_GB                                                /*다운로드구분(A:자동다운로드, D:직접다운로드). 다운로드가능여부가 "Y 다운로드가능"일 때만 사용됨*/
-		     , A.BUY_LIMIT_AMT                                        /*구매제한금액(0은 제한없음)*/
-		FROM   TB_COUPON A
-		WHERE  A.SITE_CD = #{siteCd}
-		<if test="cpnId !=null and cpnId !=''">
-			AND	   A.CPN_ID = #{cpnId}
-		</if>
-		<if test="cpnNm !=null and cpnNm !=''">
-			AND	   A.CPN_NM LIKE '%'||#{cpnNm}||'%'
-		</if>
-		<if test="cpnType !=null and cpnType !=''">
-			AND	   A.CPN_TYPE = #{cpnType}
-		</if>
-	</select>
-
 </mapper>