Преглед на файлове

> 회원/마케팅 /회원관리 : 쿠폰내역 > 등급 쿠폰 발급시 오류 문구변경 --WELCOME 등급의 경우 해당 메세지 출력(G110_50)
받을 쿠폰이 없습니다. 1건 구매 하시고 다음달 등급 쿠폰을 받아보세요!

LMC преди 4 години
родител
ревизия
d9b328b50a
променени са 1 файла, в които са добавени 82 реда и са изтрити 73 реда
  1. 82 73
      src/main/java/com/style24/front/biz/web/TsfPlanningController.java

+ 82 - 73
src/main/java/com/style24/front/biz/web/TsfPlanningController.java

@@ -50,7 +50,7 @@ import lombok.extern.slf4j.Slf4j;
 
 /**
  * 기획전 Controller
- * 
+ *
  * @author gagamel
  * @since 2020. 12. 29
  */
@@ -67,7 +67,7 @@ public class TsfPlanningController extends TsfBaseController {
 
 	@Autowired
 	private TscCustomerService coreCustomerService;
-	
+
 	@Autowired
 	private TsfCouponService couponService;
 
@@ -79,10 +79,10 @@ public class TsfPlanningController extends TsfBaseController {
 
 	@Autowired
 	private TsfDisplayService displayService;
-	
+
 	@Autowired
 	private TscPointService corePointService;
-	
+
 	@Autowired
 	private TsfReviewService reviewService;
 
@@ -191,7 +191,7 @@ public class TsfPlanningController extends TsfBaseController {
 		mav.addObject("planCount", planningService.getPlanAllCount(plan));
 		// 템플릿 순서
 		mav.addObject("templateOrd", planningService.templateDispOrdInfo(plan));
-		
+
 		// 상단소스
 		plan.setFrontGb("T");
 		mav.addObject("fsrcInfoTop", planningService.getPlanFsrcInfo(plan));
@@ -210,13 +210,13 @@ public class TsfPlanningController extends TsfBaseController {
 		plan.setAfLinkCd(TsfSession.getAttribute("afLinkCd"));
 		mav.addObject("couponInfo", planningService.getPlanCouponInfo(coupon));
 		mav.addObject("couponContent", planningService.getPlanContentInfo(plan));
-		
+
 		// 이미지
 		mav.addObject("imageInfo", planningService.getPlanImageInfo(plan));
-		
+
 		// 유의사항
 		mav.addObject("noticeInfo", planningService.getPlanNoticeInfo(plan));
-		
+
 		plan.setFrontGb(TsfSession.getFrontGb());
 		// 상품1열 전시
 		plan.setTmplType("G082_50");
@@ -232,7 +232,7 @@ public class TsfPlanningController extends TsfBaseController {
 		plan.setTmplType("G082_52");
 		mav.addObject("goods4Info", planningService.getPlanGoodsDisplayList(plan));
 		mav.addObject("goods4Content", planningService.getPlanContentInfo(plan));
-		
+
 		// 코너 목록
 		mav.addObject("planCornerList", planningService.getPlanCornerList(plan));
 		// 코너 상품
@@ -243,9 +243,9 @@ public class TsfPlanningController extends TsfBaseController {
 		mav.addObject("viewDt", plan.getViewDt());
 		mav.addObject("viewPage", "G037_40");
 		mav.addObject("popupPlanSq", plan.getPlanSq());
-		
+
 		if (planGb.equals("P")) {
-			// 다른기획전 보기 
+			// 다른기획전 보기
 			mav.addObject("planList", planningService.getPlanningList(plan));
 			mav.addObject("listSize", planningService.getPlanningList(plan).size());
 		}
@@ -254,12 +254,12 @@ public class TsfPlanningController extends TsfBaseController {
 			mav.addObject("planList", planningService.getPlanEventList(plan));
 			mav.addObject("listSize", planningService.getPlanEventList(plan).size());
 		}else if(planGb.equals("C")) {
-			// 출석체크 
+			// 출석체크
 			mav.addObject("planList", planningService.getPlanEventList(plan));
 			mav.addObject("listSize", planningService.getPlanEventList(plan).size());
 			mav.addObject("month", planningService.getAttendMonth(planInfo));
 			mav.addObject("benefitList", planningService.getAttendBenefitList(plan));
-			
+
 			if (TsfSession.isLogin()) {
 				mav.addObject("custAttendList",planningService.getCustAttendEntryList(plan));
 			}
@@ -273,7 +273,7 @@ public class TsfPlanningController extends TsfBaseController {
 		mav.setViewName(super.getDeviceViewName("planning/PlanningDetailForm"));
 		return mav;
 	}
-	
+
 	/**
 	 * 모바일 상품 2열 전시 더보기
 	 * @param plan
@@ -284,7 +284,7 @@ public class TsfPlanningController extends TsfBaseController {
 	@PostMapping("/goods/list")
 	@ResponseBody
 	public GagaMap getPlanningGoodsList(@RequestBody Plan plan) {
-		
+
 		plan.setSiteCd(TscConstants.Site.STYLE24.value());
 		if (TsfSession.isLogin()) {
 			plan.setCustNo(TsfSession.getInfo().getCustNo());
@@ -294,10 +294,10 @@ public class TsfPlanningController extends TsfBaseController {
 		plan.setTmplType("G082_51");
 		plan.setPlanStat("Y");
 		result.set("planGoods2List", planningService.getPlanGoodsDisplayList(plan).size());
-		
+
 		TscPageRequest pageable = new TscPageRequest((plan.getPageNo2() > 0 ? plan.getPageNo2() - 1 : 0), plan.getPageSize2(), plan.getPageUnit2());
 		int totalCnt = planningService.getPlanGoodsDisplayList(plan).size();
-		
+
 		pageable.setTotalCount(totalCnt);
 		plan.setPageable2(pageable);
 		result.set("paging1", plan);
@@ -308,12 +308,12 @@ public class TsfPlanningController extends TsfBaseController {
 		return result;
 	}
 
-	
+
 	/**
 	 * 기획전 쿠폰 상세보기 팝업
 	 *
 	 * @return
-	 * @author sowon	
+	 * @author sowon
 	 * @since 2021. 04. 14
 	 */
 	@PostMapping(value = "/coupon/detailpop")
@@ -322,11 +322,11 @@ public class TsfPlanningController extends TsfBaseController {
 
 		// 쿠폰 - 기본정보
 		mav.addObject("couponDetailInfo", couponService.getPlanCouponDetailInfo(coupon));
-		
+
 		mav.setViewName(super.getDeviceViewName("planning/PlanningCouponDetailForm"));
 		return mav;
 	}
-	
+
 	/**
 	 * 댓글이미지상세 -  댓글 상세 레이어
 	 * @return
@@ -345,12 +345,12 @@ public class TsfPlanningController extends TsfBaseController {
 		mav.setViewName(super.getDeviceViewName("planning/PlanningReplyPhotoForm"));
 		return mav;
 	}
-	
+
 	/**
 	 * 기획전/이벤트 댓글 리스트
 	 *
 	 * @return
-	 * @author sowon	
+	 * @author sowon
 	 * @since 2021. 04. 08
 	 */
 	@PostMapping("/reply/list")
@@ -371,12 +371,12 @@ public class TsfPlanningController extends TsfBaseController {
 		result.set("replyAttachList",planningService.getEntryReplyAttachList(plan));
 		return result;
 	}
-	
+
 	/**
 	 * 기획전/이벤트 댓글 저장
 	 *
 	 * @return
-	 * @author sowon	
+	 * @author sowon
 	 * @since 2021. 04. 13
 	 */
 	@PostMapping("/reply/save")
@@ -386,12 +386,12 @@ public class TsfPlanningController extends TsfBaseController {
 		planningService.saveEntryReply(plan);
 		return result;
 	}
-	
+
 	/**
 	 * 기획전/이벤트 댓글 삭제
 	 *
 	 * @return
-	 * @author sowon	
+	 * @author sowon
 	 * @since 2021. 04. 13
 	 */
 	@PostMapping("/reply/delete")
@@ -402,12 +402,12 @@ public class TsfPlanningController extends TsfBaseController {
 		return result;
 	}
 
-	
+
 	/**
 	 * 기획전 쿠폰 상세보기 모달
 	 *
 	 * @return
-	 * @author sowon	
+	 * @author sowon
 	 * @since 2021. 04. 01
 	 */
 	@GetMapping(value = "/coupon/detail")
@@ -463,14 +463,14 @@ public class TsfPlanningController extends TsfBaseController {
 		}else {
 			result.set("message", "쿠폰이 발급되었습니다.");
 		}
-		
+
 		result.set("couponList", planningService.getPlanCouponInfo(coupon));
 		return result;
 	}
 
 	/**
 	 * 이벤트 메인 화면
-	 * 
+	 *
 	 * @return
 	 * @author sowon
 	 * @since 2021. 3. 8
@@ -503,10 +503,10 @@ public class TsfPlanningController extends TsfBaseController {
 
 		return planningService.getPlanEventList(plan);
 	}
-	
+
 	/**
 	 * 이벤트 설문조사 화면
-	 * @param 
+	 * @param
 	 * @return
 	 * @author sowon
 	 * @since 2021. 4. 2
@@ -520,34 +520,34 @@ public class TsfPlanningController extends TsfBaseController {
 			mav.setViewName(super.getDeviceViewName("error/Inaccess"));
 			return mav;
 		}
-		
+
 		Poll poll = new Poll();
 		plan.setSiteCd(TscConstants.Site.STYLE24.value());
 		plan.setCustNo(TsfSession.getInfo().getCustNo());
 		plan.setFrontGb(TsfSession.getFrontGb());
-		poll = planningService.getPollQuestionInfo(plan);                 
-		String partYn = poll.getDupPartiYn();                             
-		String comYn = poll.getFstComYn();                                
-		int partiCnt = poll.getPartiCnt();  
-		
-		// 중복참여가 아닌경우                                                     
-		if(partYn.equals("N")) {                                          
+		poll = planningService.getPollQuestionInfo(plan);
+		String partYn = poll.getDupPartiYn();
+		String comYn = poll.getFstComYn();
+		int partiCnt = poll.getPartiCnt();
+
+		// 중복참여가 아닌경우
+		if(partYn.equals("N")) {
 			int count = planningService.getCustAnswerCount(plan);
-			if (count>0) {                                                
+			if (count>0) {
 				mav.addObject("inaccessibleMsg", "이미 응모하셨습니다.");
 				mav.setViewName(super.getDeviceViewName("error/Inaccess"));
 				return mav;
-			}                                                             
-		}                                                                 
-		if (comYn.equals("Y")) {                                     
-			int count = planningService.getCustAnswerPartiCount(poll);   
-			if (count>=partiCnt) {                                        
+			}
+		}
+		if (comYn.equals("Y")) {
+			int count = planningService.getCustAnswerPartiCount(poll);
+			if (count>=partiCnt) {
 				mav.addObject("inaccessibleMsg", "선착순 응모가 마감되었습니다.");
 				mav.setViewName(super.getDeviceViewName("error/Inaccess"));
-				return mav;                                 
-			}                                                             
-		}                                                                 
-		
+				return mav;
+			}
+		}
+
 		mav.addObject("pollInfo", planningService.getPollQuestionInfo(plan));
 		mav.addObject("pollList", planningService.getPollQuestionList(plan));
 		mav.setViewName(super.getDeviceViewName("planning/PlanningEventPollForm"));
@@ -555,10 +555,10 @@ public class TsfPlanningController extends TsfBaseController {
 	}
 
 
-	
+
 	/**
 	 * 이벤트 설문조사 저장
-	 * @param 
+	 * @param
 	 * @return
 	 * @author sowon
 	 * @since 2021. 4. 2
@@ -570,11 +570,11 @@ public class TsfPlanningController extends TsfBaseController {
 		planningService.savePollCustAnswer(poll);
 		return result;
 	}
-	
-	
+
+
 	/**
 	 * 총알배송 메인 화면
-	 * 
+	 *
 	 * @return
 	 * @author sowon
 	 * @since 2021. 3. 30
@@ -584,7 +584,7 @@ public class TsfPlanningController extends TsfBaseController {
 		ModelAndView mav = new ModelAndView();
 		Integer planSq = planningService.getShotPlanSq(plan);
 		plan.setPlanSq(planSq);
-		
+
 		CustDeliveryAddr addr = new CustDeliveryAddr();
 		Integer custNo = null;
 		if (TsfSession.isLogin()) {
@@ -607,8 +607,8 @@ public class TsfPlanningController extends TsfBaseController {
 		mav.addObject("shotBrandGoodsList", planningService.getShotDeliveryGoodsList(plan));
 
 		addr.setCustNo(custNo);
-		
-		
+
+
 		mav.addObject("custAddr", planningService.getCustAddrInfo(addr));
 		mav.addObject("shotHtmlTop", planningService.getShotDeliveryHtmlTop(plan));
 		mav.addObject("shotHtmlBtm", planningService.getShotDeliveryHtmlBtm(plan));
@@ -616,10 +616,10 @@ public class TsfPlanningController extends TsfBaseController {
 		return mav;
 	}
 
-	
+
 	/**
 	 * 총알배송 / 일반배송 확인
-	 * 
+	 *
 	 * @return
 	 * @author sowon
 	 * @since 2021. 4. 5
@@ -687,17 +687,26 @@ public class TsfPlanningController extends TsfBaseController {
 	@ResponseBody
 	public GagaMap downCustGradeCoupon() {
 		GagaMap result = new GagaMap();
-		int downloadCnt = couponService.downloadCustGradeCoupon(TsfSession.getInfo().getCustNo());
+		Integer custNo = TsfSession.getInfo().getCustNo();
+
+		int downloadCnt = couponService.downloadCustGradeCoupon(custNo);
+
+		//2021-09-10 금 시작  추가 요청자:CS요청 받을 쿠폰이 없습니다. 1건 구매 하시고 다음달 등급 쿠폰을 받아보세요! --WELCOME 등급의 경우 해당 메세지 출력(G110_50)
+		if(downloadCnt == 0 && "G110_50".equals(TsfSession.getInfo().getCustGrade())) {
+			throw new IllegalStateException("받을 쿠폰이 없습니다. 1건 구매 하시고 다음달 등급 쿠폰을 받아보세요!");
+		}
+		//2021-09-10 금  끝
+
 		boolean isDownload = downloadCnt > 0;
 		result.setBoolean("isDownload", isDownload);
 		result.setInt("downloadCnt", downloadCnt);
 		return result;
 	}
 
-	
+
 	/**
 	 * 출석체크
-	 * 
+	 *
 	 * @return
 	 * @author sowon
 	 * @since 2021. 4. 7
@@ -712,8 +721,8 @@ public class TsfPlanningController extends TsfBaseController {
 			result.set("msg", "이미 출석체크 되었습니다.");
 		}else {
 			planningService.saveAttendEntry(plan);
-			
-			// 총 출석일 수 구해보장.. 
+
+			// 총 출석일 수 구해보장..
 			Collection<Plan> benefitList = planningService.getAttendBenefitList(plan);
 			plan.setEntryAllYn("Y");
 			count = planningService.getAttendEntryCount(plan);
@@ -780,7 +789,7 @@ public class TsfPlanningController extends TsfBaseController {
 				        point.setExpBeDt(df.format(cal.getTime()));
 				        point.setSignGb("+");
 						corePointService.saveCustomerPoint(point);
-						
+
 						CustCoupon coupon = new CustCoupon();
 						coupon.setCpnId(tPlan.getCpnId());
 						coupon = couponService.getAttendCouponInfo(coupon);
@@ -803,11 +812,11 @@ public class TsfPlanningController extends TsfBaseController {
 				}
 			}
 		}
-		
+
 		result.set("custAttendList",planningService.getCustAttendEntryList(plan));
 		return result;
 	}
-	
+
 	/**
 	 * 기획전 리뷰 상세 -  리뷰 상세 레이어
 	 * @return
@@ -831,7 +840,7 @@ public class TsfPlanningController extends TsfBaseController {
 		mav.setViewName(super.getDeviceViewName("planning/PlanningReviewDetailForm"));
 		return mav;
 	}
-	
+
 
 	/**
 	 * 기획전 리뷰 상세 -  리뷰 상세 레이어
@@ -847,12 +856,12 @@ public class TsfPlanningController extends TsfBaseController {
 		return result;
 	}
 
-	
+
 	// 컴마
 	 public static String toNumFormat(int num) {
 		  DecimalFormat df = new DecimalFormat("#,###");
 		  return df.format(num);
 	 }
-	 
-	 
+
+
 }