|
|
@@ -2,10 +2,12 @@ package com.style24.front.biz.service;
|
|
|
|
|
|
import java.util.Collection;
|
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import com.style24.front.biz.dao.TsfCommonDao;
|
|
|
import com.style24.front.biz.dao.TsfPlanningDao;
|
|
|
import com.style24.front.support.security.session.TsfSession;
|
|
|
import com.style24.persistence.domain.Coupon;
|
|
|
@@ -30,6 +32,9 @@ public class TsfPlanningService {
|
|
|
@Autowired
|
|
|
private TsfCouponService couponService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TsfCommonDao commonDao;
|
|
|
+
|
|
|
/**
|
|
|
* 기획전 카테고리 목록
|
|
|
* @param plan - 기획전 정보
|
|
|
@@ -110,6 +115,57 @@ public class TsfPlanningService {
|
|
|
// return planningDao.getPlanGoodsList(plan);
|
|
|
// }
|
|
|
|
|
|
+ /**
|
|
|
+ * 기획전에 대해 접근여부 체크
|
|
|
+ * @param planSq - 기획전번호
|
|
|
+ * @author gagamel
|
|
|
+ * @since 2021. 3. 30
|
|
|
+ */
|
|
|
+ public void checkAccessablePlanning(Integer planSq) {
|
|
|
+ Plan plan = new Plan();
|
|
|
+ plan.setPlanSq(planSq);
|
|
|
+
|
|
|
+ // 디바이스접근가능여부 조회
|
|
|
+ plan.setFrontGb(TsfSession.getFrontGb());
|
|
|
+ if ("N".equals(planningDao.getDeviceAccessibleYn(plan))) {
|
|
|
+ String msg = "PC웹에서만 접근이 가능합니다.";
|
|
|
+ if ("M".equals(TsfSession.getFrontGb())) {
|
|
|
+ msg = "모바일웹에서만 접근이 가능합니다.";
|
|
|
+ } else if ("A".equals(TsfSession.getFrontGb())) {
|
|
|
+ msg = "앱에서만 접근이 가능합니다.";
|
|
|
+ }
|
|
|
+
|
|
|
+ throw new IllegalArgumentException(msg);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 신규회원접근가능여부 조회
|
|
|
+ if ("N".equals(planningDao.getNewCustomerAccessibleYn(plan))) {
|
|
|
+ throw new IllegalArgumentException("신규회원만 접근 가능합니다.");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (TsfSession.isLogin()) {
|
|
|
+ // 고객구분접근가능여부 조회
|
|
|
+ plan.setCustGb(TsfSession.getCustGb());
|
|
|
+ if ("N".equals(planningDao.getCustomerGubunAccessibleYn(plan))) {
|
|
|
+ throw new IllegalArgumentException(TsfSession.getInfo().getCustGbNm() + "만 접근이 가능합니다.");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 고객등급접근가능여부 조회
|
|
|
+ plan.setCustGrade(TsfSession.getInfo().getCustGrade());
|
|
|
+ if ("N".equals(planningDao.getCustomerGradeAccessibleYn(plan))) {
|
|
|
+ throw new IllegalArgumentException(TsfSession.getInfo().getCustGradeNm() + "만 접근 가능합니다.");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(TsfSession.getAttribute("afLinkCd"))) {
|
|
|
+ // 웹제휴채널접근가능여부 조회
|
|
|
+ plan.setAfLinkCd(TsfSession.getAttribute("afLinkCd"));
|
|
|
+ if ("N".equals(planningDao.getAfLinkAccessibleYn(plan))) {
|
|
|
+ throw new IllegalArgumentException(commonDao.getAfLinkName(TsfSession.getAttribute("afLinkCd")) + " 채널만 접근 가능합니다.");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 기획전 고객등급 목록
|
|
|
*
|