|
|
@@ -1,31 +1,39 @@
|
|
|
package com.style24.admin.biz.web;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Collection;
|
|
|
+import java.util.List;
|
|
|
+import java.io.InputStream;
|
|
|
+import java.lang.reflect.Array;
|
|
|
+import java.lang.reflect.Type;
|
|
|
+
|
|
|
+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.google.gson.Gson;
|
|
|
-import com.google.gson.JsonElement;
|
|
|
-import com.google.gson.reflect.TypeToken;
|
|
|
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.*;
|
|
|
+
|
|
|
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.io.InputStream;
|
|
|
-import java.lang.reflect.Array;
|
|
|
-import java.lang.reflect.Type;
|
|
|
-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;
|
|
|
+import com.google.gson.Gson;
|
|
|
+import com.google.gson.JsonElement;
|
|
|
+import com.google.gson.reflect.TypeToken;
|
|
|
/**
|
|
|
* 마케팅 Controller
|
|
|
* @author xodud1202
|
|
|
@@ -86,7 +94,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()));
|
|
|
@@ -98,7 +106,6 @@ public class TsaMarketingController extends TsaBaseController {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 사은품 프로모션 등록 팝업창
|
|
|
* @param param
|
|
|
@@ -119,7 +126,6 @@ public class TsaMarketingController extends TsaBaseController {
|
|
|
return mav;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/* // xodud1202 진행 */
|
|
|
|
|
|
/* JSM 진행 */
|
|
|
@@ -129,15 +135,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"));
|
|
|
|
|
|
@@ -155,8 +161,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);
|
|
|
@@ -165,9 +171,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;
|
|
|
}
|
|
|
@@ -186,10 +192,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);
|
|
|
@@ -200,50 +206,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;
|
|
|
@@ -259,7 +265,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);
|
|
|
|
|
|
@@ -291,7 +297,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()));
|
|
|
@@ -327,7 +333,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));
|
|
|
|
|
|
// 제외 상품구분 목록
|
|
|
@@ -343,16 +349,16 @@ public class TsaMarketingController extends TsaBaseController {
|
|
|
moreBetter.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());
|
|
|
@@ -475,4 +481,18 @@ public class TsaMarketingController extends TsaBaseController {
|
|
|
return super.ok(message.getMessage("SUCC_0003"));
|
|
|
}
|
|
|
/* // CSB 진행 */
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 쿠폰조회 목록
|
|
|
+ * @param coupon - 쿠폰 정보
|
|
|
+ * @return
|
|
|
+ * @author gagamel
|
|
|
+ * @since 2021. 1. 8
|
|
|
+ */
|
|
|
+ @PostMapping("/coupon/retrieve/list")
|
|
|
+ @ResponseBody
|
|
|
+ public Collection<Coupon> getCouponRetrieveList(@RequestBody Coupon coupon) {
|
|
|
+ return couponService.getCouponRetrieveList(coupon);
|
|
|
+ }
|
|
|
+
|
|
|
}
|