Bladeren bron

유효한 기획전 여부 조회 추가

gagamel 4 jaren geleden
bovenliggende
commit
5a08fc0dda

+ 41 - 34
src/main/java/com/style24/front/biz/dao/TsfPlanningDao.java

@@ -1,7 +1,6 @@
 package com.style24.front.biz.dao;
 
 import java.util.Collection;
-import java.util.Map;
 
 import com.style24.core.support.annotation.ShopDs;
 import com.style24.persistence.domain.Coupon;
@@ -56,6 +55,15 @@ public interface TsfPlanningDao {
 	 */
 	Collection<Plan> getPlanningGoodsList(Plan plan);
 
+	/**
+	 * 유효한 기획전 여부 조회
+	 * @param plan - 기획전 정보
+	 * @return Y:유효한 기획전
+	 * @author gagamel
+	 * @since 2021. 7. 6
+	 */
+	String getAvailPlanningYn(Plan plan);
+
 	/**
 	 * 디바이스접근가능여부 조회
 	 * @param plan - 기획전 정보
@@ -170,7 +178,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 3. 22
 	 */
 	Collection<Plan> getPlanImageInfo(Plan plan);
-	
+
 	/**
 	 * 기획전 템플릿 유의사항
 	 *
@@ -190,7 +198,6 @@ public interface TsfPlanningDao {
 	 * @date 2021. 3. 23
 	 */
 	Collection<Plan> getPlanGoodsDisplayList(Plan plan);
-	
 
 	/**
 	 * 기획전 코너 리스트
@@ -201,7 +208,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 3. 30
 	 */
 	Collection<Plan> getPlanCornerList(Plan plan);
-	
+
 	/**
 	 * 기획전 코너 상품 리스트
 	 *
@@ -241,7 +248,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 3. 30
 	 */
 	Plan getShotDeliveryHtmlTop(Plan plan);
-	
+
 	/**
 	 * 총알배송 하단 html 소스 
 	 *
@@ -251,7 +258,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 3. 30
 	 */
 	Plan getShotDeliveryHtmlBtm(Plan plan);
-	
+
 	/**
 	 * 설문조사 정보
 	 *
@@ -261,7 +268,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 3
 	 */
 	Poll getPollQuestionInfo(Plan plan);
-	
+
 	/**
 	 * 설문조사 질문내용
 	 *
@@ -271,7 +278,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 3
 	 */
 	Collection<Poll> getPollQuestionList(Plan plan);
-	
+
 	/**
 	 * 설문조사 등록
 	 *
@@ -281,7 +288,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 3
 	 */
 	void savePollCustAnswer(Poll poll);
-	
+
 	/**
 	 * 설문조사 중복 인덱스
 	 *
@@ -291,7 +298,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 6. 18
 	 */
 	int getPollCustAnswerIndex();
-	
+
 	/**
 	 * 설문조사 중복카운트
 	 *
@@ -301,7 +308,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 4
 	 */
 	int getCustAnswerCount(Plan plan);
-	
+
 	/**
 	 * 설문조사 선착순 카운트
 	 *
@@ -311,7 +318,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 5
 	 */
 	int getCustAnswerPartiCount(Poll poll);
-	
+
 	/**
 	 * 총알배송 조회할 기본 주소
 	 *
@@ -321,7 +328,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 5
 	 */
 	CustDeliveryAddr getCustAddrInfo(CustDeliveryAddr addr);
-	
+
 	/**
 	 * 총알배송 가능여부
 	 *
@@ -331,7 +338,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 5
 	 */
 	CustDeliveryAddr getCustAddrShotConfirm(String recipZipcode);
-	
+
 	/**
 	 * 출석체크 달력
 	 *
@@ -341,7 +348,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 6
 	 */
 	Collection<Plan> getAttendMonth(Plan plan);
-	
+
 	/**
 	 * 출석체크 
 	 *
@@ -351,7 +358,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 7
 	 */
 	void saveAttendEntry(Plan plan);
-	
+
 	/**
 	 * 출석체크 확인
 	 *
@@ -361,7 +368,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 7
 	 */
 	int getAttendEntryCount(Plan plan);
-	
+
 	/**
 	 * 출석체크 혜택 리스트
 	 *
@@ -371,7 +378,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 14
 	 */
 	Collection<Plan> getAttendBenefitList(Plan plan);
-	
+
 	/**
 	 * 고객이 출석한 일 리스트
 	 *
@@ -381,7 +388,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 7
 	 */
 	Collection<Plan> getCustAttendEntryList(Plan plan);
-	
+
 	/**
 	 * 기획전/이벤트 댓글
 	 *
@@ -391,7 +398,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 8
 	 */
 	Collection<Plan> getReplyList(Plan plan);
-	
+
 	/**
 	 * 기획전/이벤트 댓글 저장
 	 *
@@ -401,7 +408,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 13
 	 */
 	void saveEntryReply(Plan plan);
-	
+
 	/**
 	 * 기획전/이벤트 댓글 카운트
 	 *
@@ -411,7 +418,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 13
 	 */
 	int getEntryReplyCount(Plan plan);
-	
+
 	/**
 	 * 기획전/이벤트 댓글 삭제
 	 *
@@ -421,7 +428,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 13
 	 */
 	void deleteEntryReply(Plan plan);
-	
+
 	/**
 	 * 기획전/이벤트 댓글 이미지 저장
 	 *
@@ -431,7 +438,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 13
 	 */
 	void saveEntryReplyAttach(Plan plan);
-	
+
 	/**
 	 * 기획전/이벤트 댓글 이미지 리스트
 	 *
@@ -441,7 +448,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 8
 	 */
 	Collection<Plan> getEntryReplyAttachList(Plan plan);
-	
+
 	/**
 	 * 기획전/이벤트 댓글 이미지 삭제
 	 *
@@ -451,7 +458,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 13
 	 */
 	void deleteEntryReplyAttach(Plan plan);
-	
+
 	/**
 	 * 기획전/이벤트 접근 고객 리스트
 	 *
@@ -461,7 +468,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 22
 	 */
 	Plan getCustomerGubunAccessibleList(Plan plan);
-	
+
 	/**
 	 * 기획전/이벤트 접근 고객 리스트
 	 *
@@ -471,7 +478,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 22
 	 */
 	Collection<Plan> getCustomerGradeAccessibleList(Plan plan);
-	
+
 	/**
 	 * 기획전/이벤트 비회원 접근 조회
 	 *
@@ -481,7 +488,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 5. 4
 	 */
 	int getNonmemberGradeAccessible(Plan plan);
-	
+
 	/**
 	 * 기획전/이벤트 접근 프론트 구분
 	 *
@@ -491,7 +498,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 4. 22
 	 */
 	String getFrontAccessibleList(Plan plan);
-	
+
 	/**
 	 * 총알배송 planSq 
 	 *
@@ -501,7 +508,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 5. 10
 	 */
 	Integer getShotPlanSq(Plan plan);
-	
+
 	/**
 	 * 기획전 컨텐츠 정보 
 	 *
@@ -511,7 +518,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 6. 3
 	 */
 	Collection<Plan> getPlanContentInfo(Plan plan);
-	
+
 	/**
 	 * 총알배송 브랜드 리스트 
 	 *
@@ -521,7 +528,7 @@ public interface TsfPlanningDao {
 	 * @date 2021. 6. 29
 	 */
 	Collection<Plan> getShotBrandList();
-	
+
 	/**
 	 * 총알배송 브랜드 리스트 
 	 *
@@ -531,5 +538,5 @@ public interface TsfPlanningDao {
 	 * @date 2021. 6. 29
 	 */
 	Collection<Plan> getShotDeliveryGoodsList(Plan plan);
-	
+
 }

+ 92 - 94
src/main/java/com/style24/front/biz/service/TsfPlanningService.java

@@ -3,7 +3,6 @@ package com.style24.front.biz.service;
 import java.io.File;
 import java.util.Collection;
 import java.util.Iterator;
-import java.util.Map;
 
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -11,8 +10,6 @@ import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import com.gagaframework.web.util.GagaDateUtil;
-import com.gagaframework.web.util.GagaFileUtil;
 import com.style24.front.biz.dao.TsfCommonDao;
 import com.style24.front.biz.dao.TsfPlanningDao;
 import com.style24.front.support.security.session.TsfSession;
@@ -24,6 +21,9 @@ import com.style24.persistence.domain.Review;
 
 import lombok.extern.slf4j.Slf4j;
 
+import com.gagaframework.web.util.GagaDateUtil;
+import com.gagaframework.web.util.GagaFileUtil;
+
 /**
  * 기획전 Service
  *
@@ -42,7 +42,7 @@ public class TsfPlanningService {
 
 	@Autowired
 	private TsfCommonDao commonDao;
-	
+
 	@Autowired
 	private Environment env;
 
@@ -99,7 +99,7 @@ public class TsfPlanningService {
 	public Collection<Plan> getPlanningList(Plan plan) {
 		return planningDao.getPlanningList(plan);
 	}
-	
+
 	/**
 	 * 기획전 코너 상품 목록
 	 * @param plan - 기획전 정보
@@ -111,7 +111,6 @@ public class TsfPlanningService {
 		return planningDao.getPlanningCornerGoodsList(plan);
 	}
 
-
 	/**
 	 * 접근 불가능한 기획전 메시지 조회
 	 * @param planSq - 기획전번호
@@ -120,42 +119,45 @@ public class TsfPlanningService {
 	 * @since 2021. 3. 30
 	 */
 	public String getInaccessiblePlanningMessage(Integer planSq) {
-		String msg = "";
+//		String msg = "";
 
 		Plan plan = new Plan();
 		plan.setPlanSq(planSq);
 
+		// 유효한 기획전 여부 조회
+		if ("N".equals(planningDao.getAvailPlanningYn(plan))) {
+			return "진행중인 기획전/이벤트가 아닙니다.";
+		}
+
 		// 디바이스접근가능여부 조회
 		plan.setFrontGb(TsfSession.getFrontGb());
 		if ("N".equals(planningDao.getDeviceAccessibleYn(plan))) {
 			String frontGb = planningDao.getFrontAccessibleList(plan);
-			msg = frontGb + "에서만 접근이 가능합니다.";
 			if ("M".equals(TsfSession.getFrontGb())) {
-				msg =  frontGb + "에서만 접근이 가능합니다.";
+				return frontGb + "에서만 접근이 가능합니다.";
 			} else if ("A".equals(TsfSession.getFrontGb())) {
-				msg =  frontGb + "에서만 접근이 가능합니다.";
+				return frontGb + "에서만 접근이 가능합니다.";
 			}
 		}
 
 		if (!TsfSession.isLogin()) {
 			plan.setCustGrade("G110_60");
 			if ("N".equals(planningDao.getCustomerGradeAccessibleYn(plan))) {
-				msg = "로그인 후 이용 가능합니다.";
+				return "로그인 후 이용 가능합니다.";
 			}
 		}
-		
+
 		if (TsfSession.isLogin()) {
 			// 신규회원접근가능여부 조회
 			plan.setCustNo(TsfSession.getInfo().getCustNo());
 			if ("N".equals(planningDao.getNewCustomerAccessibleYn(plan))) {
-				msg = "신규회원만 접근 가능합니다.";
+				return "신규회원만 접근 가능합니다.";
 			}
-			
-			
+
 			// 고객구분접근가능여부 조회
 			plan.setCustGb(TsfSession.getCustGb());
 			if ("N".equals(planningDao.getCustomerGubunAccessibleYn(plan))) {
-				msg = planningDao.getCustomerGubunAccessibleList(plan).getCustGb() + "만 접근이 가능합니다.";
+				return planningDao.getCustomerGubunAccessibleList(plan).getCustGb() + "만 접근이 가능합니다.";
 			}
 
 			String custGrade = "";
@@ -165,12 +167,12 @@ public class TsfPlanningService {
 				Iterator<Plan> iter = planningDao.getCustomerGradeAccessibleList(plan).iterator();
 				while (iter.hasNext()) {
 					custGrade += iter.next().getCustGrade();
-					
+
 					if (iter.hasNext()) {
 						custGrade += ", ";
 					}
 				}
-				msg = custGrade+ " 회원만 접근 가능합니다.";
+				return custGrade + " 회원만 접근 가능합니다.";
 			}
 		}
 
@@ -178,15 +180,14 @@ public class TsfPlanningService {
 			// 웹제휴채널접근가능여부 조회
 			plan.setAfLinkCd(TsfSession.getAttribute("afLinkCd"));
 			if ("N".equals(planningDao.getAfLinkAccessibleYn(plan))) {
-				//msg = commonDao.getAfLinkName(TsfSession.getAttribute("afLinkCd")) + " 채널만 접근 가능합니다.";
-				msg = "제휴 채널을 통해서만 접근 가능합니다. ";
+//				return commonDao.getAfLinkName(TsfSession.getAttribute("afLinkCd")) + " 채널만 접근 가능합니다.";
+				return "제휴 채널을 통해서만 접근 가능합니다.";
 			}
 		}
 
-		return msg;
+		return "";
 	}
 
-
 	/**
 	 * 기획전 상세 정보
 	 *
@@ -247,7 +248,7 @@ public class TsfPlanningService {
 		if (TsfSession.isLogin()) {
 			coupon.setCustNo(TsfSession.getInfo().getCustNo());
 		}
-		
+
 		return planningDao.getPlanCouponInfo(coupon);
 	}
 
@@ -262,7 +263,7 @@ public class TsfPlanningService {
 	public Collection<Plan> getPlanImageInfo(Plan plan) {
 		return planningDao.getPlanImageInfo(plan);
 	}
-	
+
 	/**
 	 * 기획전 템플릿 유의사항
 	 *
@@ -286,7 +287,7 @@ public class TsfPlanningService {
 	public Collection<Plan> getPlanGoodsDisplayList(Plan plan) {
 		return planningDao.getPlanGoodsDisplayList(plan);
 	}
-	
+
 	/**
 	 * 기획전 코너 리스트
 	 *
@@ -295,7 +296,7 @@ public class TsfPlanningService {
 	 * @author sowon
 	 * @date 2021. 3. 30
 	 */
-	public Collection<Plan> getPlanCornerList(Plan plan){
+	public Collection<Plan> getPlanCornerList(Plan plan) {
 		return planningDao.getPlanCornerList(plan);
 	}
 
@@ -334,7 +335,7 @@ public class TsfPlanningService {
 	public Collection<Plan> getPlanEventList(Plan plan) {
 		return planningDao.getPlanEventList(plan);
 	}
-	
+
 	/**
 	 * 총알배송 상단 html 소스 
 	 *
@@ -346,7 +347,7 @@ public class TsfPlanningService {
 	public Plan getShotDeliveryHtmlTop(Plan plan) {
 		return planningDao.getShotDeliveryHtmlTop(plan);
 	}
-	
+
 	/**
 	 * 총알배송 하단 html 소스 
 	 *
@@ -358,8 +359,7 @@ public class TsfPlanningService {
 	public Plan getShotDeliveryHtmlBtm(Plan plan) {
 		return planningDao.getShotDeliveryHtmlBtm(plan);
 	}
-	
-	
+
 	/**
 	 * 설문조사 정보
 	 *
@@ -371,7 +371,7 @@ public class TsfPlanningService {
 	public Poll getPollQuestionInfo(Plan plan) {
 		return planningDao.getPollQuestionInfo(plan);
 	}
-	
+
 	/**
 	 * 설문조사 질문내용
 	 *
@@ -383,7 +383,7 @@ public class TsfPlanningService {
 	public Collection<Poll> getPollQuestionList(Plan plan) {
 		return planningDao.getPollQuestionList(plan);
 	}
-	
+
 	/**
 	 * 설문조사 등록
 	 *
@@ -397,67 +397,67 @@ public class TsfPlanningService {
 		poll.setCustNo(TsfSession.getInfo().getCustNo());
 		// 단수형
 		int ansIndex = planningDao.getPollCustAnswerIndex();
-		if(poll.getPollQsq_10()!=null && poll.getPollQsq_10()!="") {
-			String[] pollQsq_10 =poll.getPollQsq_10().split("/");
+		if (poll.getPollQsq_10() != null && poll.getPollQsq_10() != "") {
+			String[] pollQsq_10 = poll.getPollQsq_10().split("/");
 			for (int i = 0; i < pollQsq_10.length; i++) {
 				String[] temp = pollQsq_10[i].split("-");
 				for (int j = 0; j < temp.length; j++) {
-					String pollQsq=temp[j].toString();
-					poll.setPollQsq(Integer.parseInt(pollQsq)); 
-					String dummy = temp[j+1].toString();        
-					poll.setDummy(dummy);                      
+					String pollQsq = temp[j].toString();
+					poll.setPollQsq(Integer.parseInt(pollQsq));
+					String dummy = temp[j + 1].toString();
+					poll.setDummy(dummy);
 					poll.setAnsIndex(ansIndex);
 					planningDao.savePollCustAnswer(poll);
 					j++;
 				}
 			}
 		}
-		
+
 		//복수형
-		if(poll.getPollQsq_20()!=null && poll.getPollQsq_20()!="") {
-			String[] pollQsq_20 =poll.getPollQsq_20().split("/");
+		if (poll.getPollQsq_20() != null && poll.getPollQsq_20() != "") {
+			String[] pollQsq_20 = poll.getPollQsq_20().split("/");
 			for (int i = 0; i < pollQsq_20.length; i++) {
 				String[] temp = pollQsq_20[i].split("-");
 				for (int j = 0; j < temp.length; j++) {
-					String pollQsq=temp[j].toString();
+					String pollQsq = temp[j].toString();
 					poll.setPollQsq(Integer.parseInt(pollQsq));
-					String dummy = temp[j+1].toString().replaceAll("[,]", "|");        
-					poll.setDummy(dummy);           
+					String dummy = temp[j + 1].toString().replaceAll("[,]", "|");
+					poll.setDummy(dummy);
 					poll.setAnsIndex(ansIndex);
 					planningDao.savePollCustAnswer(poll);
-					
+
 					j++;
 				}
 			}
 		}
-		
+
 		//단답형
-		if(poll.getPollQsq_30()!=null && poll.getPollQsq_30()!="") {
-			String[] pollQsq_30 =poll.getPollQsq_30().split("/");
+		if (poll.getPollQsq_30() != null && poll.getPollQsq_30() != "") {
+			String[] pollQsq_30 = poll.getPollQsq_30().split("/");
 			for (int i = 0; i < pollQsq_30.length; i++) {
 				String[] temp = pollQsq_30[i].split("-");
 				for (int j = 0; j < temp.length; j++) {
-					String pollQsq=temp[j].toString();
-					poll.setPollQsq(Integer.parseInt(pollQsq)); 
-					String dummy = temp[j+1].toString();        
-					poll.setDummy(dummy);   
+					String pollQsq = temp[j].toString();
+					poll.setPollQsq(Integer.parseInt(pollQsq));
+					String dummy = temp[j + 1].toString();
+					poll.setDummy(dummy);
 					poll.setAnsIndex(ansIndex);
 					planningDao.savePollCustAnswer(poll);
 					j++;
 				}
 			}
 		}
-		
+
 		//서룰형
-		if(poll.getPollQsq_40()!=null && poll.getPollQsq_40()!="") {
-			String[] pollQsq_40 =poll.getPollQsq_40().split("/");
+		if (poll.getPollQsq_40() != null && poll.getPollQsq_40() != "") {
+			String[] pollQsq_40 = poll.getPollQsq_40().split("/");
 			for (int i = 0; i < pollQsq_40.length; i++) {
 				String[] temp = pollQsq_40[i].split("-");
 				for (int j = 0; j < temp.length; j++) {
-					String pollQsq=temp[j].toString();
-					poll.setPollQsq(Integer.parseInt(pollQsq)); 
-					String dummy = temp[j+1].toString();        
-					poll.setDummy(dummy);       
+					String pollQsq = temp[j].toString();
+					poll.setPollQsq(Integer.parseInt(pollQsq));
+					String dummy = temp[j + 1].toString();
+					poll.setDummy(dummy);
 					poll.setAnsIndex(ansIndex);
 					planningDao.savePollCustAnswer(poll);
 					j++;
@@ -465,7 +465,7 @@ public class TsfPlanningService {
 			}
 		}
 	}
-	
+
 	/**
 	 * 설문조사 중복카운트
 	 *
@@ -477,7 +477,7 @@ public class TsfPlanningService {
 	public int getCustAnswerCount(Plan plan) {
 		return planningDao.getCustAnswerCount(plan);
 	}
-	
+
 	/**
 	 * 설문조사 중복카운트
 	 *
@@ -501,7 +501,7 @@ public class TsfPlanningService {
 	public CustDeliveryAddr getCustAddrInfo(CustDeliveryAddr addr) {
 		return planningDao.getCustAddrInfo(addr);
 	}
-	
+
 	/**
 	 * 총알배송 가능여부
 	 *
@@ -513,7 +513,7 @@ public class TsfPlanningService {
 	public CustDeliveryAddr getCustAddrShotConfirm(String recipZipcode) {
 		return planningDao.getCustAddrShotConfirm(recipZipcode);
 	}
-	
+
 	/**
 	 * 출석체크 달력 출력
 	 *
@@ -525,7 +525,7 @@ public class TsfPlanningService {
 	public Collection<Plan> getAttendMonth(Plan plan) {
 		return planningDao.getAttendMonth(plan);
 	}
-	
+
 	/**
 	 * 출석체크 
 	 *
@@ -555,7 +555,7 @@ public class TsfPlanningService {
 		plan.setCustNo(TsfSession.getInfo().getCustNo());
 		return planningDao.getAttendEntryCount(plan);
 	}
-	
+
 	/**
 	 * 고객이 출석한 일 리스트
 	 *
@@ -564,11 +564,11 @@ public class TsfPlanningService {
 	 * @author sowon
 	 * @date 2021. 4. 7
 	 */
-	public Collection<Plan> getCustAttendEntryList(Plan plan){
+	public Collection<Plan> getCustAttendEntryList(Plan plan) {
 		plan.setCustNo(TsfSession.getInfo().getCustNo());
 		return planningDao.getCustAttendEntryList(plan);
 	}
-	
+
 	/**
 	 * 출석체크 혜택 리스트
 	 *
@@ -577,7 +577,7 @@ public class TsfPlanningService {
 	 * @author sowon
 	 * @date 2021. 4. 14
 	 */
-	public Collection<Plan> getAttendBenefitList(Plan plan){
+	public Collection<Plan> getAttendBenefitList(Plan plan) {
 		plan.setFrontGb(TsfSession.getFrontGb());
 		return planningDao.getAttendBenefitList(plan);
 	}
@@ -590,11 +590,10 @@ public class TsfPlanningService {
 	 * @author sowon
 	 * @date 2021. 4. 8
 	 */
-	public Collection<Plan> getReplyList(Plan plan){
+	public Collection<Plan> getReplyList(Plan plan) {
 		return planningDao.getReplyList(plan);
 	}
 
-
 	/**
 	 * 기획전/이벤트 댓글,이미지 저장
 	 *
@@ -608,10 +607,10 @@ public class TsfPlanningService {
 		int custNo = TsfSession.getInfo().getCustNo();
 		plan.setCustNo(custNo);
 		planningDao.saveEntryReply(plan);
-		
+
 		//이미지등록
 		Plan filePlan = new Plan();
-		if(!StringUtils.isAllEmpty(plan.getMultiReplySysFile())) {
+		if (!StringUtils.isAllEmpty(plan.getMultiReplySysFile())) {
 			filePlan.setRegNo(custNo);
 			filePlan.setPlanEntrySq(plan.getPlanEntrySq());
 			//파일아이템 등록
@@ -642,7 +641,7 @@ public class TsfPlanningService {
 			}
 		}
 	}
-	
+
 	/**
 	 * 기획전/이벤트 댓글 카운트
 	 *
@@ -654,7 +653,7 @@ public class TsfPlanningService {
 	public int getEntryReplyCount(Plan plan) {
 		return planningDao.getEntryReplyCount(plan);
 	}
-	
+
 	/**
 	 * 기획전/이벤트 댓글, 이미지 삭제
 	 *
@@ -668,7 +667,7 @@ public class TsfPlanningService {
 		planningDao.deleteEntryReply(plan);
 		planningDao.deleteEntryReplyAttach(plan);
 	}
-	
+
 	/**
 	 * 기획전/이벤트 댓글 이미지 리스트
 	 *
@@ -677,10 +676,9 @@ public class TsfPlanningService {
 	 * @author sowon
 	 * @date 2021. 4. 8
 	 */
-	public Collection<Plan> getEntryReplyAttachList(Plan plan){
+	public Collection<Plan> getEntryReplyAttachList(Plan plan) {
 		return planningDao.getEntryReplyAttachList(plan);
 	}
-	
 
 	/**
 	 * 총알배송 planSq 
@@ -693,7 +691,7 @@ public class TsfPlanningService {
 	public Integer getShotPlanSq(Plan plan) {
 		return planningDao.getShotPlanSq(plan);
 	}
-	
+
 	/**
 	 * 기획전 컨텐츠 정보 
 	 *
@@ -702,22 +700,22 @@ public class TsfPlanningService {
 	 * @author sowon
 	 * @date 2021. 6. 3
 	 */
-	 public Collection<Plan> getPlanContentInfo(Plan plan) {
-		 return planningDao.getPlanContentInfo(plan);
-	 }
-	 
-	 /**
-	 * 총알배송 브랜드 리스트 
-	 *
-	 * @param 
-	 * @return
-	 * @author sowon
-	 * @date 2021. 6. 29
-	 */
-	public Collection<Plan> getShotBrandList(){
+	public Collection<Plan> getPlanContentInfo(Plan plan) {
+		return planningDao.getPlanContentInfo(plan);
+	}
+
+	/**
+	* 총알배송 브랜드 리스트 
+	*
+	* @param 
+	* @return
+	* @author sowon
+	* @date 2021. 6. 29
+	*/
+	public Collection<Plan> getShotBrandList() {
 		return planningDao.getShotBrandList();
 	}
-	
+
 	/**
 	 * 총알배송 브랜드 상품 리스트 
 	 *
@@ -726,8 +724,8 @@ public class TsfPlanningService {
 	 * @author sowon
 	 * @date 2021. 6. 29
 	 */
-	public Collection<Plan> getShotDeliveryGoodsList(Plan plan){
+	public Collection<Plan> getShotDeliveryGoodsList(Plan plan) {
 		return planningDao.getShotDeliveryGoodsList(plan);
 	}
-	
+
 }

+ 15 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsfPlanning.xml

@@ -353,6 +353,21 @@
 		</if>
 	</select>
 	
+	<!-- 유효한 기획전 여부 조회 -->
+	<select id="getAvailPlanningYn" parameterType="Plan" resultType="String">
+		/* TsfPlanning.getDeviceAccessibleYn */
+		SELECT CASE WHEN IFNULL((SELECT COUNT(*)
+		                         FROM   TB_PLAN
+		                         WHERE  PLAN_SQ = #{planSq}
+		                         AND    NOW() BETWEEN DISP_STDT AND DISP_EDDT
+		                         AND    DEL_YN = 'N'
+		                         AND    OPEN_YN = 'Y'
+		                        ),0) > 0 THEN 'Y'
+		            ELSE 'N'
+		       END
+		FROM   DUAL
+	</select>
+	
 	<!-- 디바이스접근가능여부 조회 -->
 	<select id="getDeviceAccessibleYn" parameterType="Plan" resultType="String">
 		/* TsfPlanning.getDeviceAccessibleYn */