|
|
@@ -1,14 +1,18 @@
|
|
|
package com.style24.admin.biz.web;
|
|
|
|
|
|
import com.gagaframework.web.parameter.GagaMap;
|
|
|
-import com.gagaframework.web.util.GagaDateUtil;
|
|
|
-import com.style24.admin.biz.service.*;
|
|
|
+import com.style24.admin.biz.service.TsaCommonService;
|
|
|
+import com.style24.admin.biz.service.TsaMarketingService;
|
|
|
+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.CommonCode;
|
|
|
+import com.style24.persistence.domain.Coupon;
|
|
|
import com.style24.persistence.domain.FreeGoodsPromotion;
|
|
|
-import com.style24.persistence.domain.SupplyCompany;
|
|
|
+
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.core.env.Environment;
|
|
|
@@ -16,7 +20,9 @@ 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;
|
|
|
|
|
|
/**
|
|
|
@@ -38,9 +44,6 @@ public class TsaMarketingController extends TsaBaseController {
|
|
|
@Autowired
|
|
|
private TsaMarketingService marketingService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private TsaBusinessService businessService;
|
|
|
-
|
|
|
@Autowired
|
|
|
private TsaRendererService rendererService;
|
|
|
|
|
|
@@ -53,6 +56,7 @@ public class TsaMarketingController extends TsaBaseController {
|
|
|
/* xodud1202 진행 */
|
|
|
/**
|
|
|
* 사은품 프로모션 관리 화면
|
|
|
+ * @return
|
|
|
* @author xodud1202
|
|
|
* @since 2020. 12. 16
|
|
|
*/
|
|
|
@@ -65,53 +69,148 @@ public class TsaMarketingController extends TsaBaseController {
|
|
|
|
|
|
/**
|
|
|
* 사은품 프로모션 목록 조회
|
|
|
+ *
|
|
|
+ * @return
|
|
|
* @author xodud1202
|
|
|
* @since 2020. 10. 17
|
|
|
*/
|
|
|
@PostMapping("/freeGoodsPromotion/list")
|
|
|
@ResponseBody
|
|
|
- public GagaMap getFreeGoodsPromotionList(@RequestBody FreeGoodsPromotion param) {
|
|
|
+ public GagaMap getFreeGoodsPromotionList(@RequestBody FreeGoodsPromotion marketing) {
|
|
|
GagaMap result = new GagaMap();
|
|
|
|
|
|
- List<FreeGoodsPromotion> marketingList = (ArrayList<FreeGoodsPromotion>) marketingService.getFreeGoodsPromotionList(param);
|
|
|
+ List<FreeGoodsPromotion> marketingList = (ArrayList<FreeGoodsPromotion>) marketingService.getFreeGoodsPromotionList(marketing);
|
|
|
|
|
|
- param.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
|
|
|
- param.setPageable(new TsaPageRequest(param.getPageNo() - 1, param.getPageSize()));
|
|
|
- param.getPageable().setTotalCount(marketingList.size());
|
|
|
+ marketing.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
|
|
|
+ marketing.setPageable(new TsaPageRequest(marketing.getPageNo() - 1, marketing.getPageSize()));
|
|
|
+ marketing.getPageable().setTotalCount(marketingList.size());
|
|
|
|
|
|
- result.set("pageing", param);
|
|
|
+ result.set("pageing", marketing);
|
|
|
result.set("freeGoodsList", marketingList);
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /* // xodud1202 진행 */
|
|
|
+
|
|
|
+ /* JSM 진행 */
|
|
|
/**
|
|
|
- * 세트상품구성 화면
|
|
|
- *
|
|
|
- * @param
|
|
|
- * @return
|
|
|
- * @author eskim
|
|
|
- * @since 2020. 05. 26
|
|
|
+ * 쿠폰 리스트 목록 화면
|
|
|
+ * @author xyzp1539
|
|
|
+ * @since 2020-12-21
|
|
|
*/
|
|
|
- @ResponseBody
|
|
|
- @GetMapping("/freeGoodsRegiPopup/form")
|
|
|
- public ModelAndView freeGoodsRegiForm(FreeGoodsPromotion param) {
|
|
|
+ @GetMapping("/coupon/form")
|
|
|
+ public ModelAndView couponListForm(){
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
|
|
|
- // 상품상태
|
|
|
- String[] exceptCds = {"G008_00"};
|
|
|
- mav.addObject("goodsStatList", rendererService.getCommonCodeList("G008", "Y", exceptCds));
|
|
|
+ // 쿠폰 유형 조회
|
|
|
+ mav.addObject("cpnTypeList" , rendererService.getCommonCodeList("G230"));
|
|
|
+ // 할인 유형 조회
|
|
|
+ mav.addObject("dcWayList" , rendererService.getCommonCodeList("G240"));
|
|
|
+ // 사이트 조회
|
|
|
+ mav.addObject("siteCdList" , rendererService.getCommonCodeList("G000"));
|
|
|
+
|
|
|
+ mav.setViewName("marketing/CouponListForm");
|
|
|
|
|
|
- mav.addObject("param", param);
|
|
|
- mav.setViewName("marketing/FreeGoodsPromotionRegiForm");
|
|
|
return mav;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 쿠폰 리스트 조회
|
|
|
+ * @param Coupon
|
|
|
+ * @return GagaMap
|
|
|
+ * @author xyzp1539
|
|
|
+ * @since 2020-12-22
|
|
|
+ */
|
|
|
+ @PostMapping("/coupon/list")
|
|
|
+ @ResponseBody
|
|
|
+ public GagaMap getCouponList(@RequestBody Coupon param){
|
|
|
+ GagaMap result = new GagaMap();
|
|
|
+
|
|
|
+ ArrayList<Coupon> cpnList = marketingService.getCouponList(param);
|
|
|
+ int cpnTotCnt = marketingService.getCouponListCnt(param);
|
|
|
|
|
|
- /* // xodud1202 진행 */
|
|
|
+ param.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
|
|
|
+ param.setPageable(new TsaPageRequest(param.getPageNo() - 1, param.getPageSize()));
|
|
|
+ param.getPageable().setTotalCount(cpnTotCnt);
|
|
|
|
|
|
- /* JSM 진행 */
|
|
|
+ result.set("pageing" , param);
|
|
|
+ result.set("cpnTotCnt" , cpnTotCnt);
|
|
|
+ result.set("cpnList" , cpnList);
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 쿠폰 등록 팝업 화면
|
|
|
+ * @return ModelAndView
|
|
|
+ * @author xyzp1539
|
|
|
+ * @since 2020-12-23
|
|
|
+ */
|
|
|
+ @GetMapping("/coupon/popup/form")
|
|
|
+ @ResponseBody
|
|
|
+ public ModelAndView couponCreatePopup() {
|
|
|
+ ModelAndView mav = new ModelAndView();
|
|
|
+ String num = "";
|
|
|
+
|
|
|
+ // 일시 시 리스트 세팅
|
|
|
+ Collection<CommonCode> hhList = new ArrayList<CommonCode>();
|
|
|
+ for(int i = 0; i < 24; i++) {
|
|
|
+ num = "";
|
|
|
+ CommonCode temp = new CommonCode();
|
|
|
+ if(i < 10) {
|
|
|
+ num = "0" + i;
|
|
|
+ } else {
|
|
|
+ num = String.valueOf(i);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 상품상태
|
|
|
+ String[] exceptCds = {"G008_00"};
|
|
|
+ mav.addObject("goodsStatList", rendererService.getCommonCodeList("G008", "Y", exceptCds));
|
|
|
|
|
|
+ temp.setCd(num);
|
|
|
+ temp.setCdNm(num+"시");
|
|
|
+
|
|
|
+ hhList.add(temp);
|
|
|
+ }
|
|
|
+ // 일시 분 리스트 세팅
|
|
|
+ Collection<CommonCode> mmList = new ArrayList<CommonCode>();
|
|
|
+ for(int i = 0 ; i < 60; i++) {
|
|
|
+ num = "";
|
|
|
+ CommonCode temp = new CommonCode();
|
|
|
+ if(i < 10) {
|
|
|
+ num = "0" + i;
|
|
|
+ } else {
|
|
|
+ num = String.valueOf(i);
|
|
|
+ }
|
|
|
+ temp.setCd(num);
|
|
|
+ temp.setCdNm(num+"분");
|
|
|
+
|
|
|
+ mmList.add(temp);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 쿠폰 유형 조회
|
|
|
+ mav.addObject("cpnTypeList" , rendererService.getCommonCodeList("G230"));
|
|
|
+ // 사용가능 고객구분 조회
|
|
|
+ mav.addObject("usableCustGbList", rendererService.getCommonCodeList("G100"));
|
|
|
+ // 사용가능 고객등급 조회
|
|
|
+ mav.addObject("usableCustGradeList", rendererService.getCommonCodeList("G110"));
|
|
|
+ // 사이트코드 조회
|
|
|
+ mav.addObject("siteCdList" , rendererService.getCommonCodeList("G000"));
|
|
|
+ // 재발급 여부 조회
|
|
|
+ mav.addObject("reissuanceList" , rendererService.getCommonCodeList("G231"));
|
|
|
+ // 할인방식 조회
|
|
|
+ mav.addObject("dcWayList" , rendererService.getCommonCodeList("G240"));
|
|
|
+ // 쿠폰다운로드 방식 조회
|
|
|
+ mav.addObject("dnGbList" , rendererService.getCommonCodeList("G058"));
|
|
|
+ // 시간 분 리스트 세팅
|
|
|
+ mav.addObject("mmList" , mmList);
|
|
|
+ // 시간 시 리스트 세팅
|
|
|
+ mav.addObject("hhList" , hhList);
|
|
|
+
|
|
|
+ mav.setViewName("marketing/CouponCreatePopupForm");
|
|
|
+ return mav;
|
|
|
+ }
|
|
|
/* // JSM 진행 */
|
|
|
}
|