Procházet zdrojové kódy

Merge remote-tracking branch 'origin/develop' into xodud1202

xodud lee před 5 roky
rodič
revize
0b126ed921

+ 9 - 0
src/main/java/com/style24/front/biz/dao/TsfDisplayDao.java

@@ -64,6 +64,15 @@ public interface TsfDisplayDao {
 	 */
 	Collection<Contents> getContentsList(Contents contents);
 
+	/**
+	 * 전체 카테고리 목록
+	 * @param cate - 카테고리 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2021. 6. 3
+	 */
+	Collection<Cate4Srch> getAllCategoryList(Cate4Srch cate);
+
 	/**
 	 * 카테고리1 목록
 	 * @param cate - 카테고리 정보

+ 191 - 110
src/main/java/com/style24/front/biz/service/TsfDisplayService.java

@@ -20,6 +20,7 @@ import com.style24.persistence.domain.Cate2;
 import com.style24.persistence.domain.Cate3;
 import com.style24.persistence.domain.Cate4;
 import com.style24.persistence.domain.Cate4Srch;
+import com.style24.persistence.domain.Cate5;
 import com.style24.persistence.domain.Contents;
 import com.style24.persistence.domain.GnbTab;
 import com.style24.persistence.domain.Goods;
@@ -209,64 +210,203 @@ public class TsfDisplayService {
 	 * @since 2021. 3. 11
 	 */
 	public Collection<Cate1> getAllCategoryList(Cate4Srch cate) {
-		// 카테고리1 목록
-		Collection<Cate1> cate1List = displayDao.getCategory1List(cate);
-
-		if (cate1List != null && !cate1List.isEmpty()) {
-			for (Cate1 cate1 : cate1List) {
-				if (cate1.getLeafYn().equals("N")) {
-					cate.setCate1No(cate1.getCate1No());
-
-					// 카테고리2 목록
-					Collection<Cate2> cate2List = displayDao.getCategory2List(cate);
-
-					if (cate2List != null && !cate2List.isEmpty()) {
-						for (Cate2 cate2 : cate2List) {
-							if (cate2.getLeafYn().equals("N")) {
-								cate.setCate2No(cate2.getCate2No());
-
-								// 카테고리3 목록
-								Collection<Cate3> cate3List = displayDao.getCategory3List(cate);
-
-								if (cate3List != null && !cate3List.isEmpty()) {
-									for (Cate3 cate3 : cate3List) {
-										if (cate3.getLeafYn().equals("N")) {
-											cate.setCate3No(cate3.getCate3No());
-
-											// 카테고리4 목록
-											Collection<Cate4> cate4List = displayDao.getCategory4List(cate);
-
-											if (cate4List != null && !cate4List.isEmpty()) {
-												for (Cate4 cate4 : cate4List) {
-													if (cate4.getLeafYn().equals("N")) {
-														cate.setCate4No(cate4.getCate4No());
+//		// 카테고리1 목록
+//		Collection<Cate1> cate1List = displayDao.getCategory1List(cate);
+//
+//		if (cate1List != null && !cate1List.isEmpty()) {
+//			for (Cate1 cate1 : cate1List) {
+//				if (cate1.getLeafYn().equals("N")) {
+//					cate.setCate1No(cate1.getCate1No());
+//
+//					// 카테고리2 목록
+//					Collection<Cate2> cate2List = displayDao.getCategory2List(cate);
+//
+//					if (cate2List != null && !cate2List.isEmpty()) {
+//						for (Cate2 cate2 : cate2List) {
+//							if (cate2.getLeafYn().equals("N")) {
+//								cate.setCate2No(cate2.getCate2No());
+//
+//								// 카테고리3 목록
+//								Collection<Cate3> cate3List = displayDao.getCategory3List(cate);
+//
+//								if (cate3List != null && !cate3List.isEmpty()) {
+//									for (Cate3 cate3 : cate3List) {
+//										if (cate3.getLeafYn().equals("N")) {
+//											cate.setCate3No(cate3.getCate3No());
+//
+//											// 카테고리4 목록
+//											Collection<Cate4> cate4List = displayDao.getCategory4List(cate);
+//
+//											if (cate4List != null && !cate4List.isEmpty()) {
+//												for (Cate4 cate4 : cate4List) {
+//													if (cate4.getLeafYn().equals("N")) {
+//														cate.setCate4No(cate4.getCate4No());
+//
+//														// 카테고리5 목록 담기
+//														cate4.setCate5List(displayDao.getCategory5List(cate));
+//													}
+//												}
+//
+//												log.info("cate4List: {}", cate4List);
+//
+//												// 카테고리4 목록 담기
+//												cate3.setCate4List(cate4List);
+//											}
+//										}
+//									}
+//
+//									// 카테고리3 목록 담기
+//									cate2.setCate3List(cate3List);
+//								}
+//							}
+//						}
+//
+//						// 카테고리2 목록 담기
+//						cate1.setCate2List(cate2List);
+//					}
+//				}
+//			}
+//		}
 
-														// 카테고리5 목록 담기
-														cate4.setCate5List(displayDao.getCategory5List(cate));
+		Collection<Cate1> cate1List = new ArrayList<Cate1>();
+
+		// 전체 카테고리 목록
+		Collection<Cate4Srch> cateList = displayDao.getAllCategoryList(cate);
+
+		if (cateList != null && !cateList.isEmpty()) {
+			Integer prevCate1No = 0;
+			Integer prevCate2No = 0;
+			Integer prevCate3No = 0;
+			Integer prevCate4No = 0;
+			Integer prevCate5No = 0;
+
+			for (Cate4Srch cate4srch1 : cateList) {
+				if (cate4srch1.getCate1No() != null && !cate4srch1.getCate1No().equals(prevCate1No)) {
+					Cate1 cate1 = new Cate1();
+					cate1.setSiteCd(cate4srch1.getSiteCd());
+					cate1.setCateGb(cate4srch1.getCateGb());
+					cate1.setCateType(cate4srch1.getCateType());
+					cate1.setCate1No(cate4srch1.getCate1No());
+					cate1.setCate1Nm(cate4srch1.getCate1Nm());
+					cate1.setFormalGb(cate4srch1.getFormalGb());
+
+					Collection<Cate2> cate2List = new ArrayList<Cate2>();
+					for (Cate4Srch cate4srch2 : cateList) {
+						if (cate4srch2.getCate1No() != null && cate4srch1.getCate1No().equals(cate4srch2.getCate1No())) {
+							if (cate4srch2.getCate2No() != null && !cate4srch2.getCate2No().equals(prevCate2No)) {
+								Cate2 cate2 = new Cate2();
+								cate2.setSiteCd(cate4srch2.getSiteCd());
+								cate2.setCateGb(cate4srch2.getCateGb());
+								cate2.setCateType(cate4srch2.getCateType());
+								cate2.setCate2No(cate4srch2.getCate2No());
+								cate2.setCate2Nm(cate4srch2.getCate2Nm());
+								cate2.setCate1No(cate4srch2.getCate1No());
+								cate2.setFormalGb(cate4srch2.getFormalGb());
+
+								Collection<Cate3> cate3List = new ArrayList<Cate3>();
+								for (Cate4Srch cate4srch3 : cateList) {
+									if (cate4srch3.getCate2No() != null && cate4srch2.getCate2No().equals(cate4srch3.getCate2No())) {
+										if (cate4srch3.getCate3No() != null && !cate4srch3.getCate3No().equals(prevCate3No)) {
+											Cate3 cate3 = new Cate3();
+											cate3.setSiteCd(cate4srch3.getSiteCd());
+											cate3.setCateGb(cate4srch3.getCateGb());
+											cate3.setCateType(cate4srch3.getCateType());
+											cate3.setCate3No(cate4srch3.getCate3No());
+											cate3.setCate3Nm(cate4srch3.getCate3Nm());
+											cate3.setCate1No(cate4srch3.getCate1No());
+											cate3.setCate2No(cate4srch3.getCate2No());
+											cate3.setFormalGb(cate4srch3.getFormalGb());
+
+											Collection<Cate4> cate4List = new ArrayList<Cate4>();
+											for (Cate4Srch cate4srch4 : cateList) {
+												if (cate4srch4.getCate3No() != null && cate4srch3.getCate3No().equals(cate4srch4.getCate3No())) {
+													if (cate4srch4.getCate4No() != null && !cate4srch4.getCate4No().equals(prevCate4No)) {
+														Cate4 cate4 = new Cate4();
+														cate4.setSiteCd(cate4srch4.getSiteCd());
+														cate4.setCateGb(cate4srch4.getCateGb());
+														cate4.setCateType(cate4srch4.getCateType());
+														cate4.setCate4No(cate4srch4.getCate4No());
+														cate4.setCate4Nm(cate4srch4.getCate4Nm());
+														cate4.setCate1No(cate4srch4.getCate1No());
+														cate4.setCate2No(cate4srch4.getCate2No());
+														cate4.setCate3No(cate4srch4.getCate3No());
+														cate4.setFormalGb(cate4srch4.getFormalGb());
+
+														Collection<Cate5> cate5List = new ArrayList<Cate5>();
+														for (Cate4Srch cate4srch5 : cateList) {
+															if (cate4srch5.getCate4No() != null && cate4srch4.getCate4No().equals(cate4srch5.getCate4No())) {
+																if (cate4srch5.getCate5No() != null && !cate4srch5.getCate5No().equals(prevCate5No)) {
+																	Cate5 cate5 = new Cate5();
+																	cate5.setSiteCd(cate4srch5.getSiteCd());
+																	cate5.setCateGb(cate4srch5.getCateGb());
+																	cate5.setCateType(cate4srch5.getCateType());
+																	cate5.setCate5No(cate4srch5.getCate5No());
+																	cate5.setCate5Nm(cate4srch5.getCate5Nm());
+																	cate5.setCate1No(cate4srch5.getCate1No());
+																	cate5.setCate2No(cate4srch5.getCate2No());
+																	cate5.setCate3No(cate4srch5.getCate3No());
+																	cate5.setCate4No(cate4srch5.getCate4No());
+																	cate5.setFormalGb(cate4srch5.getFormalGb());
+																	cate5.setLeafYn("Y");
+																	cate5List.add(cate5);
+																}
+															}
+
+															prevCate5No = cate4srch5.getCate5No();
+														}
+
+														cate4.setLeafYn(cate5List.size() > 0 ? "N" : "Y");
+														cate4.setCate5List(cate5List);
+														cate4List.add(cate4);
 													}
 												}
 
-												log.info("cate4List: {}", cate4List);
-
-												// 카테고리4 목록 담기
-												cate3.setCate4List(cate4List);
+												prevCate4No = cate4srch4.getCate4No();
 											}
+
+											cate3.setLeafYn(cate4List.size() > 0 ? "N" : "Y");
+											cate3.setCate4List(cate4List);
+											cate3List.add(cate3);
 										}
 									}
 
-									// 카테고리3 목록 담기
-									cate2.setCate3List(cate3List);
+									prevCate3No = cate4srch3.getCate3No();
 								}
+
+								cate2.setLeafYn(cate3List.size() > 0 ? "N" : "Y");
+								cate2.setCate3List(cate3List);
+								cate2List.add(cate2);
 							}
 						}
 
-						// 카테고리2 목록 담기
-						cate1.setCate2List(cate2List);
+						prevCate2No = cate4srch2.getCate2No();
 					}
+
+					cate1.setLeafYn(cate2List.size() > 0 ? "N" : "Y");
+					cate1.setCate2List(cate2List);
+					cate1List.add(cate1);
 				}
+
+				prevCate1No = cate4srch1.getCate1No();
 			}
 		}
 
+//				Map<Integer, List<Cate4Srch>> cate4srch1 = cateList.stream().collect(Collectors.groupingBy(Cate4Srch::getCate1No, LinkedHashMap::new, Collectors.toList()));
+//				cate4srch1.forEach((key1, value1) -> {
+//					log.info("{}:{}", key1, value1);
+//					Cate1 cate1 = new Cate1();
+//					cate1.setCate1No(key1);
+//					Iterator<Cate4Srch> aaa = value1.iterator();
+//					while (aaa.hasNext()) {
+//						aaa.next();
+//					}
+//
+//					Map<Integer, List<Cate4Srch>> cate4srch2 = value1.stream().collect(Collectors.groupingBy(Cate4Srch::getCate2No, LinkedHashMap::new, Collectors.toList()));
+//					cate4srch2.forEach((key2, value2) -> {
+//						log.info("{}:{}", key2, value2);
+//					});
+//				});
+
 		return cate1List;
 	}
 
@@ -372,10 +512,10 @@ public class TsfDisplayService {
 		GagaMap result = new GagaMap();
 		Collection<Popup> popupList = new ArrayList<Popup>();
 		popup.setSiteCd(TscConstants.Site.STYLE24.value());
-		
+
 		if ("P".equals(popup.getFrontGb())) {
 			result.set("dataList", displayDao.getPopupList(popup));
-		}else {
+		} else {
 			//우선순위 full 팝
 			popup.setPopupGb("F");
 			popupList = displayDao.getPopupList(popup);
@@ -389,9 +529,9 @@ public class TsfDisplayService {
 			result.set("popupGb", "H");
 			result.set("dataList", popupList);
 		}
-		
+
 		// Collection<Popup>
-		
+
 		return result;
 	}
 
@@ -487,7 +627,7 @@ public class TsfDisplayService {
 		cate4Srch.setSiteCd(TscConstants.Site.STYLE24.value());
 		cate4Srch.setCateGb("G032_101");
 
-		log.info("getBestItemCategoryGoodsList cate4Srch:::::::::{}",cate4Srch);
+		log.info("getBestItemCategoryGoodsList cate4Srch:::::::::{}", cate4Srch);
 
 		Collection<Goods> goodsList = goodsDao.getContentsCategoryGoodsList(cate4Srch);
 
@@ -539,11 +679,11 @@ public class TsfDisplayService {
 		Collection<Filter> resultList = new ArrayList<Filter>();
 		for (Filter filter : filterList) {
 			if (filter.getFilterGb().equals(filterGb)) {
-				if("BENEFIT".equals(filterGb)){
-					if(!filter.getFilterCd().equals("40")){
+				if ("BENEFIT".equals(filterGb)) {
+					if (!filter.getFilterCd().equals("40")) {
 						resultList.add(filter);
 					}
-				}else{
+				} else {
 					resultList.add(filter);
 				}
 			}
@@ -609,7 +749,7 @@ public class TsfDisplayService {
 	}
 
 	/**
-	 * 상품검색키워드 카테고리 목록
+	 * 키워드를 이용한 전체 카테고리 목록
 	 * @param keyword - 상품검색키워드
 	 * @return
 	 * @author gagamel
@@ -622,66 +762,7 @@ public class TsfDisplayService {
 		cate.setCateType(TsfConstants.CateType.GOODS.value()); // 상품분류카테고리
 		cate.setSoldoutGoodsDispYn(envsetService.getSoldoutGoodsDisplayYn(TscConstants.Site.STYLE24.value()));
 		cate.setKeyword(keyword);
-
-		// 카테고리1 목록
-		Collection<Cate1> cate1List = displayDao.getCategory1List(cate);
-
-		if (cate1List != null && !cate1List.isEmpty()) {
-			for (Cate1 cate1 : cate1List) {
-				if (cate1.getLeafYn().equals("N")) {
-					cate.setCate1No(cate1.getCate1No());
-
-					// 카테고리2 목록
-					Collection<Cate2> cate2List = displayDao.getCategory2List(cate);
-
-					if (cate2List != null && !cate2List.isEmpty()) {
-						for (Cate2 cate2 : cate2List) {
-							if (cate2.getLeafYn().equals("N")) {
-								cate.setCate2No(cate2.getCate2No());
-
-								// 카테고리3 목록
-								Collection<Cate3> cate3List = displayDao.getCategory3List(cate);
-
-								if (cate3List != null && !cate3List.isEmpty()) {
-									for (Cate3 cate3 : cate3List) {
-										if (cate3.getLeafYn().equals("N")) {
-											cate.setCate3No(cate3.getCate3No());
-
-											// 카테고리4 목록
-											Collection<Cate4> cate4List = displayDao.getCategory4List(cate);
-
-											if (cate4List != null && !cate4List.isEmpty()) {
-												for (Cate4 cate4 : cate4List) {
-													if (cate4.getLeafYn().equals("N")) {
-														cate.setCate4No(cate4.getCate4No());
-
-														// 카테고리5 목록 담기
-														cate4.setCate5List(displayDao.getCategory5List(cate));
-													}
-												}
-
-												log.info("cate4List: {}", cate4List);
-
-												// 카테고리4 목록 담기
-												cate3.setCate4List(cate4List);
-											}
-										}
-									}
-
-									// 카테고리3 목록 담기
-									cate2.setCate3List(cate3List);
-								}
-							}
-						}
-
-						// 카테고리2 목록 담기
-						cate1.setCate2List(cate2List);
-					}
-				}
-			}
-		}
-
-		return cate1List;
+		return this.getAllCategoryList(cate);
 	}
 
 	public int getContentsCategoryGoodsCount(Contents contents) {

+ 37 - 9
src/main/java/com/style24/front/biz/web/TsfMypageController.java

@@ -5,7 +5,12 @@ import java.util.Collection;
 import java.util.List;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 
+import com.gagaframework.web.util.GagaCookieUtil;
+import com.style24.core.biz.service.TscMailService;
+import com.style24.front.biz.service.TsfLoginService;
+import com.style24.front.support.env.TsfConstants;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
@@ -154,6 +159,12 @@ public class TsfMypageController extends TsfBaseController {
 	@Autowired
 	private TscKakaotalkService coreKakaotalkService;
 
+	@Autowired
+	private TscMailService mailService;
+
+	@Autowired
+	private TsfLoginService loginService;
+
 	/**
 	 * 마이페이지 메인 화면
 	 *
@@ -2158,7 +2169,7 @@ public class TsfMypageController extends TsfBaseController {
 	 * @since 2021. 03. 16
 	 */
 	@PostMapping("/customer/secede/complete/form")
-	public ModelAndView getCustomerSecedeCompleteForm() {
+	public ModelAndView getCustomerSecedeCompleteForm(HttpServletRequest request, HttpServletResponse response) {
 		ModelAndView mav = new ModelAndView();
 		Integer custNo = TsfSession.getInfo().getCustNo();
 
@@ -2183,6 +2194,8 @@ public class TsfMypageController extends TsfBaseController {
 		mav.addObject("custNm", TsfSession.getInfo().getCustNm());
 
 		Customer customer = new Customer();
+		customer.setCustId(TsfSession.getInfo().getCustId());
+		customer.setCustNm(TsfSession.getInfo().getCustNm());
 		customer.setCustNo(custNo);
 		customer.setRegNo(custNo);
 		customer.setUpdNo(custNo);
@@ -2191,18 +2204,33 @@ public class TsfMypageController extends TsfBaseController {
 		GagaMap result = customerService.saveCustomerSecede(customer);
 
 		boolean isSuccess = result.getBoolean("isSuccess");
-		if (isSuccess) {
-			try {
-				// TODO:회원탈퇴 메일 발송 2020-03-24
-			} catch (Exception e) {
-
-			}
-			TsfSession.invalidate(TsfSession.getHttpServletRequest());
-		} else {
+		if (!isSuccess) {
 			mav.setViewName("redirect:/mypage/customer/secede/form");
 			return mav;
 		}
 
+		try {
+			customer.setRejoinRejectDay(result.getInt("rejoinRejectDay"));
+			customer.setSecedeDt(result.getString("secedeDt"));
+			customer.setSnsType(result.getString("snsType"));
+			mailService.sendSecedComplete(customer, TsfSession.getInfo().getCustNo());
+		} catch (Exception e) {
+			log.error(e.getMessage());
+		}
+
+		TsfSession.invalidate(request);
+
+		// RememberMe 쿠키가 있으면
+		String ckRememberMe = GagaCookieUtil.getCookie(request, TsfConstants.CK_PREFIX + "_remember-me");
+
+		if (StringUtils.isNotBlank(ckRememberMe)) {
+			// 로그인유지토큰 삭제
+			loginService.deletePersistentToken(ckRememberMe);
+
+			// RememberMe 쿠키 삭제
+			GagaCookieUtil.deleteCookie(response, TsfConstants.CK_PREFIX + "_remember-me");
+		}
+
 		mav.setViewName(super.getDeviceViewName("mypage/MypageCustSecedeCompleteForm"));
 
 		return mav;

+ 2 - 1
src/main/java/com/style24/front/support/interceptor/TsfLoginCheckInterceptor.java

@@ -40,7 +40,8 @@ public class TsfLoginCheckInterceptor extends HandlerInterceptorAdapter {
 				boolean isSslServer = Boolean.parseBoolean(hasSsl);
 				log.info("isSslServer: [{}]", isSslServer);
 
-				String loginUrl = isSslServer ? "https://" + request.getServerName() + "/signin" : "/signin";
+//				String loginUrl = isSslServer ? "https://" + request.getServerName() + "/signin" : "/signin";
+				String loginUrl = "/signin";
 				log.info("loginUrl: [{}]", loginUrl);
 
 				response.sendRedirect(loginUrl);

+ 57 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsfDisplay.xml

@@ -266,6 +266,63 @@
 		</if>
 	</select>
 
+	<!-- 전체 카테고리 목록 -->
+	<select id="getAllCategoryList" parameterType="Cate4Srch" resultType="Cate4Srch">
+		/* TsfDisplay.getAllCategoryList */
+		SELECT SITE_CD
+		     , CATE_GB
+		     , CATE1_NO
+		     , CATE1_NM
+		     , CATE2_NO
+		     , CATE2_NM
+		     , CATE3_NO
+		     , CATE3_NM
+		     , CATE4_NO
+		     , CATE4_NM
+		     , CATE5_NO
+		     , CATE5_NM
+		     , DISP_ORD
+		FROM   TB_CATE_4SRCH C4
+		WHERE  SITE_CD = #{siteCd}
+		AND    CATE_GB = #{cateGb}
+		AND    CATE_TYPE = #{cateType} /*카테고리유형*/
+		<if test="cate1No != null and cate1No != ''">
+		AND    CATE1_NO = #{cate1No}
+		</if>
+		<if test='defaultCateYn != null and defaultCateYn != "" and defaultCateYn == "N"'> <!-- 별도카테고리이면 -->
+		AND    CATE1_NO = (SELECT BRAND_CATE_NO
+		                   FROM   TB_BRAND_GROUP
+		                   WHERE  BRAND_GROUP_NO = #{brandGroupNo}
+		                  )
+		</if>
+		<if test="keyword != null and keyword != ''"> <!-- 상품검색키워드 -->
+		AND    LEAF_CATE_NO IN (SELECT CG.CATE_NO
+		                        FROM   TB_CATE_GOODS CG
+		                             , TB_GOODS G
+		                             , TB_GOODS_STOCK S
+		                             , TB_BRAND B
+		                        WHERE  CG.GOODS_CD = G.GOODS_CD
+		                        AND    CG.GOODS_CD = S.GOODS_CD
+		                        AND    G.BRAND_CD = B.BRAND_CD
+		                        AND    (
+		                                G.GOODS_NUM LIKE CONCAT('%',UPPER(#{keyword}),'%')
+		                                OR
+		                                G.GOODS_CD LIKE CONCAT('%',UPPER(#{keyword}),'%')
+		                                OR
+		                                UPPER(G.GOODS_NM) LIKE CONCAT('%',UPPER(#{keyword}),'%')
+		                                OR
+		                                UPPER(B.BRAND_ENM) LIKE CONCAT('%',UPPER(#{keyword}),'%')
+		                                OR
+		                                UPPER(B.BRAND_KNM) LIKE CONCAT('%',UPPER(#{keyword}),'%')
+		                               )
+		                        AND    G.GOODS_STAT = 'G008_90' /*승인완료상품*/
+		                        AND    G.SELF_MALL_YN = 'Y' /*몰노출상품*/
+		                        AND    NOW() BETWEEN G.SELL_STDT AND G.SELL_EDDT /*유효한 판매기간*/
+		                       )
+		</if>
+		ORDER  BY DISP_ORD
+	</select>
+	
 	<!-- 카테고리1 목록 -->
 	<select id="getCategory1List" parameterType="Cate4Srch" resultType="Cate1">
 		/* TsfDisplay.getCategory1List */

+ 144 - 231
src/main/java/com/style24/persistence/mybatis/shop/TsfReview.xml

@@ -366,96 +366,49 @@
 	<select id="getCompleteReviewList" parameterType="Review" resultType="Review">
 		/* TsfReivew.getCompleteReviewList */
 		<include refid="selectForPagingHeader"/>
-		SELECT GROUP_CONCAT(Z.ITEM_NM ORDER BY Z.ORD_DTL_ITEM_SQ SEPARATOR '!@!') AS ITEM_NM
+		SELECT  GROUP_CONCAT(Z.ITEM_NM ORDER BY Z.ORD_DTL_ITEM_SQ SEPARATOR '!@!') AS ITEM_NM
 		     -- , GROUP_CONCAT(Z.COLOR_NM ORDER BY Z.ORD_DTL_ITEM_SQ) AS COLOR_NM
-		     , GROUP_CONCAT(' ',CONCAT(OPT_CD1_NM,' / ', OPT_CD2) ORDER BY Z.ORD_DTL_ITEM_SQ) AS COLOR_NM
-		     , GROUP_CONCAT(Z.OPT_CD1 ORDER BY Z.ORD_DTL_ITEM_SQ) AS OPT_CD1
-		     , GROUP_CONCAT(Z.OPT_CD2 ORDER BY Z.ORD_DTL_ITEM_SQ) AS OPT_CD2
-		     , GROUP_CONCAT(Z.OPT_CD1_NM ORDER BY Z.ORD_DTL_ITEM_SQ) AS OPT_CD1_NM
-		     , Z.ORD_NO
-		     , Z.ORD_DT
-		     , Z.PAY_DT
-		     , Z.DELV_EDDT
-		     , Z.ORD_DTL_NO
-		     , Z.ORD_EXCH_GB
-		     , Z.GOODS_CD
-		     , Z.GOODS_NM
-		     , Z.LIST_PRICE
-		     , Z.GOODS_TYPE
-		     , Z.SYS_IMG_NM
-		     , Z.ORD_DTL_STAT
-		     , Z.ORD_QTY
-		     , Z.CNCL_RTN_QTY
-		     , Z.ORD_AMT
-		     , Z.REAL_ORD_AMT
-		     , Z.SAVE_PNT_AMT
-		     , Z.CNCL_RTN_AMT
-		     , Z.PNT_DC_AMT
-		     , Z.GFCD_USE_AMT
-		     , Z.INVOICE_NO
-		     , Z.SUPPLY_COMP_CD
-		     , Z.DELV_FEE_CD
-		     , Z.SHOT_DELV_YN
-		     , Z.CHANGEABLE_YN
-		     , Z.RETURNABLE_YN
-		     , Z.SELF_GOODS_YN
-		     , Z.BRAND_NM
-		     , Z.BRAND_ENM
-		     , Z.ORD_DTL_STAT_NM
-		     , Z.ORD_REQ_CHG_QTY
-		     , Z.ORD_CAN_CHG_QTY
-		     , Z.ITEMKIND_NM 
-		   	 , Z.ITEMKIND_CD 
-             , Z.SIZE_GB 
-             , Z.REMAIN_DT
-             , ROW_NUMBER() OVER(ORDER BY Z.REG_DT DESC) AS RNUM
-		  FROM (SELECT O.ORD_NO
+		        , GROUP_CONCAT(' ',CONCAT(OPT_CD1_NM,' / ', OPT_CD2) ORDER BY Z.ORD_DTL_ITEM_SQ) AS COLOR_NM
+		        , GROUP_CONCAT(Z.OPT_CD1 ORDER BY Z.ORD_DTL_ITEM_SQ) AS OPT_CD1
+		        , GROUP_CONCAT(Z.OPT_CD2 ORDER BY Z.ORD_DTL_ITEM_SQ) AS OPT_CD2
+		        , GROUP_CONCAT(Z.OPT_CD1_NM ORDER BY Z.ORD_DTL_ITEM_SQ) AS OPT_CD1_NM
+		        , Z.ORD_NO
+		        , Z.ORD_DT
+		        , Z.PAY_DT
+		        , Z.ORD_DTL_NO
+		        , Z.GOODS_CD
+		        , Z.GOODS_NM
+		        , Z.LIST_PRICE
+		        , Z.GOODS_TYPE
+		        , Z.SYS_IMG_NM
+		        , Z.BRAND_NM
+		        , Z.BRAND_ENM
+		        , Z.REMAIN_DT
+		        , ROW_NUMBER() OVER(ORDER BY Z.REG_DT DESC) AS RNUM
+		  FROM (
+		        SELECT O.ORD_NO
 		             , O.REG_DT 
-					 , DATE_FORMAT(O.ORD_DT, '%Y.%m.%d') AS ORD_DT
-					 , DATE_FORMAT(O.PAY_DT, '%Y.%m.%d') AS PAY_DT 
-					 , DATE_FORMAT(OD.DELV_EDDT, '%m/%d')								AS DELV_EDDT
-					 , OD.ORD_DTL_NO
-					 , OD.ORD_EXCH_GB
-					 , OD.GOODS_CD
-		             , OD.GIFT_ADDR_INP_YN
-					 , G.GOODS_NM
-					 , IFNULL((SELECT COLOR_KNM FROM TB_COLOR C WHERE COLOR_CD = IFNULL(NULLIF(ODI.OPT_CD1,'') , G.MAIN_COLOR_CD ) AND USE_YN  = 'Y'), ODI.OPT_CD1) AS COLOR_NM
-					 , (SELECT GOODS_NM FROM TB_GOODS WHERE GOODS_CD = ODI.ITEM_CD)		AS ITEM_NM
+		             , DATE_FORMAT(O.ORD_DT, '%Y.%m.%d') AS ORD_DT
+		             , DATE_FORMAT(O.PAY_DT, '%Y.%m.%d') AS PAY_DT 
+		             , DATE_FORMAT(OD.DELV_EDDT, '%m/%d')								AS DELV_EDDT
+		             , OD.ORD_DTL_NO
+		             , OD.GOODS_CD
+		             , G.GOODS_NM
+		             , IFNULL((SELECT COLOR_KNM FROM TB_COLOR C WHERE COLOR_CD = IFNULL(NULLIF(ODI.OPT_CD1,'') , G.MAIN_COLOR_CD ) AND USE_YN  = 'Y'), ODI.OPT_CD1) AS COLOR_NM
+		             , (SELECT GOODS_NM FROM TB_GOODS WHERE GOODS_CD = ODI.ITEM_CD)		AS ITEM_NM
 		             , ODI.ORD_DTL_ITEM_SQ
-					 , ODI.OPT_CD1
-					 , ODI.OPT_CD2
-					 , IFNULL(C.COLOR_KNM, ODI.OPT_CD1) AS OPT_CD1_NM
-					 , G.LIST_PRICE
+		             , ODI.OPT_CD1
+		             , ODI.OPT_CD2
+		             , IFNULL(C.COLOR_KNM, ODI.OPT_CD1) AS OPT_CD1_NM
+		             , G.LIST_PRICE
 		             , G.GOODS_TYPE
 		             , CASE WHEN G.GOODS_TYPE != 'G056_S' AND G.SELF_GOODS_YN = 'Y' THEN (SELECT MAX(SYS_IMG_NM) FROM TB_GOODS_IMG WHERE GOODS_CD = G.GOODS_CD AND COLOR_CD = ODI.OPT_CD1 AND DEFAULT_IMG_YN = 'Y')
 		                    ELSE (SELECT MAX(SYS_IMG_NM) FROM TB_GOODS_IMG WHERE GOODS_CD = G.GOODS_CD AND COLOR_CD = IFNULL(G.MAIN_COLOR_CD,'XX') AND DEFAULT_IMG_YN = 'Y') END AS SYS_IMG_NM
-					 , OD.ORD_DTL_STAT
-					 , OD.ORD_QTY
-					 , OD.CNCL_RTN_QTY
-					 , OD.ORD_AMT
-					 , OD.REAL_ORD_AMT
-					 , OD.SAVE_PNT_AMT
-					 , OD.CNCL_RTN_AMT
-					 , OD.PNT_DC_AMT
-					 , OD.GFCD_USE_AMT
-					 , OD.INVOICE_NO
-					 , OD.SUPPLY_COMP_CD
-					 , OD.DELV_FEE_CD
-					 , OD.SHOT_DELV_YN
-					 , OD.CHANGEABLE_YN
-					 , OD.RETURNABLE_YN
-					 , G.SELF_GOODS_YN
-			         , CASE BG.DISP_NM_LANG WHEN 'EN' THEN BG.BRAND_GROUP_ENM
+		             , CASE BG.DISP_NM_LANG WHEN 'EN' THEN BG.BRAND_GROUP_ENM
 		                       ELSE BG.BRAND_GROUP_KNM
 		               END                                                             AS BRAND_NM
-			         , B.BRAND_ENM
-					 , FN_GET_CODE_NM('G013', OD.ORD_DTL_STAT)							AS ORD_DTL_STAT_NM
-					 , IFNULL(OCD.ORD_REQ_CHG_QTY, 0) AS ORD_REQ_CHG_QTY
-					 , OD.ORD_QTY - OD.CNCL_RTN_QTY - IFNULL(OCD.ORD_REQ_CHG_QTY, 0)    AS ORD_CAN_CHG_QTY
-					 , I.ITEMKIND_NM 
-		   	         , I.ITEMKIND_CD 
-			         , I.SIZE_GB 
-			         ,DATEDIFF(DATE_ADD(O.ORD_DT,INTERVAL #{reviewExpireDay} DAY),NOW()) AS REMAIN_DT -- 남은시간
+		             , B.BRAND_ENM
+		             ,DATEDIFF(DATE_ADD(O.ORD_DT,INTERVAL  90 /**P*/ DAY),NOW()) AS REMAIN_DT -- 남은시간
 				  FROM TB_ORDER O
 				 INNER JOIN TB_ORDER_DETAIL OD
 				    ON O.ORD_NO = OD.ORD_NO
@@ -469,17 +422,6 @@
 				    ON B.BRAND_CD = G.BRAND_CD
 				 INNER JOIN TB_BRAND_GROUP BG
 		            ON B.BRAND_GROUP_NO = BG.BRAND_GROUP_NO
-				 LEFT JOIN TB_ITEMKIND I 
-				    ON G.ITEMKIND_CD = I.ITEMKIND_CD 
-				  LEFT OUTER JOIN (SELECT OD.ORD_DTL_NO
-										, SUM(OCD.CHG_QTY) AS ORD_REQ_CHG_QTY
-									 FROM TB_ORDER_CHANGE_DETAIL OCD
-									INNER JOIN TB_ORDER_DETAIL OD
-									   ON OCD.ORD_DTL_NO = OD.ORD_DTL_NO
-									WHERE OCD.DEL_YN = 'N'
-									GROUP BY OCD.ORD_DTL_NO
-								  ) OCD
-				    ON OD.ORD_DTL_NO = OCD.ORD_DTL_NO
 				LEFT OUTER JOIN TB_COLOR C ON ODI.OPT_CD1 = C.COLOR_CD
 		                                   AND C.USE_YN = 'Y'
 				  WHERE 1=1
@@ -490,12 +432,19 @@
 			 	AND O.SITE_CD = #{siteCd}
 				) Z		 
 		 WHERE Z.REMAIN_DT > 0
-		 GROUP BY Z.ORD_NO, Z.ORD_DT, Z.DELV_EDDT, Z.ORD_DTL_NO, Z.ORD_EXCH_GB
-				, Z.GOODS_CD, Z.GOODS_NM, Z.LIST_PRICE, Z.SYS_IMG_NM, Z.ORD_DTL_STAT, Z.ORD_QTY, Z.CNCL_RTN_QTY, Z.ORD_AMT, Z.REAL_ORD_AMT
-				, Z.SAVE_PNT_AMT, Z.CNCL_RTN_AMT, Z.PNT_DC_AMT, Z.GFCD_USE_AMT, Z.INVOICE_NO
-				, Z.SUPPLY_COMP_CD, Z.DELV_FEE_CD, Z.SHOT_DELV_YN, Z.CHANGEABLE_YN, Z.SELF_GOODS_YN, Z.BRAND_NM, Z.BRAND_ENM, Z.ORD_DTL_STAT_NM
-				, Z.ORD_REQ_CHG_QTY, Z.ORD_CAN_CHG_QTY
-		ORDER BY Z.ORD_NO DESC, Z.ORD_DTL_STAT, Z.SELF_GOODS_YN DESC, Z.SHOT_DELV_YN DESC, Z.SUPPLY_COMP_CD
+		 GROUP BY   Z.ORD_NO
+		          , Z.ORD_DT
+		          , Z.PAY_DT
+		          , Z.ORD_DTL_NO
+		          , Z.GOODS_CD
+		          , Z.GOODS_NM
+		          , Z.LIST_PRICE
+		          , Z.GOODS_TYPE
+		          , Z.SYS_IMG_NM
+		          , Z.BRAND_NM
+		          , Z.BRAND_ENM
+                  , Z.REMAIN_DT
+		ORDER BY Z.ORD_NO DESC
 		<include refid="selectForPagingFooter"/>
 	</select>
 	
@@ -946,89 +895,58 @@
 	<select id="getAlreadyReviewList" parameterType="Review" resultType="Review">
 		/* TsfReivew.getAlreadyReviewList */
 		<include refid="selectForPagingHeader"/>
-		        SELECT GROUP_CONCAT(Z.ITEM_NM ORDER BY Z.ORD_DTL_ITEM_SQ SEPARATOR '!@!') AS ITEM_NM
-		          -- , GROUP_CONCAT(Z.COLOR_NM ORDER BY Z.ORD_DTL_ITEM_SQ) AS COLOR_NM
-		             , GROUP_CONCAT(' ',CONCAT(OPT_CD1_NM,' / ', OPT_CD2) ORDER BY Z.ORD_DTL_ITEM_SQ) AS COLOR_NM
-		             , GROUP_CONCAT(Z.OPT_CD1 ORDER BY Z.ORD_DTL_ITEM_SQ) AS OPT_CD1
-		             , GROUP_CONCAT(Z.OPT_CD2 ORDER BY Z.ORD_DTL_ITEM_SQ) AS OPT_CD2
-		             , GROUP_CONCAT(Z.OPT_CD1_NM ORDER BY Z.ORD_DTL_ITEM_SQ) AS OPT_CD1_NM
-		             , Z.ORD_NO
-		             , Z.ORD_DT
-		             , Z.PAY_DT
-		             , Z.DELV_EDDT
-		             , Z.ORD_DTL_NO
-		             , Z.ORD_EXCH_GB
-		             , Z.GOODS_CD
-		             , Z.GOODS_NM
-		             , Z.LIST_PRICE
-		             , Z.GOODS_TYPE
-		             , Z.SYS_IMG_NM
-		             , Z.ORD_DTL_STAT
-		             , Z.ORD_QTY
-		             , Z.CNCL_RTN_QTY
-		             , Z.ORD_AMT
-		             , Z.REAL_ORD_AMT
-		             , Z.SAVE_PNT_AMT
-		             , Z.CNCL_RTN_AMT
-		             , Z.PNT_DC_AMT
-		             , Z.GFCD_USE_AMT
-		             , Z.INVOICE_NO
-		             , Z.SUPPLY_COMP_CD
-		             , Z.DELV_FEE_CD
-		             , Z.SHOT_DELV_YN
-		             , Z.CHANGEABLE_YN
-		             , Z.RETURNABLE_YN
-		             , Z.SELF_GOODS_YN
-		             , Z.BRAND_NM
-		             , Z.BRAND_ENM
-		             , Z.ORD_DTL_STAT_NM
-		             , Z.ORD_REQ_CHG_QTY
-		             , Z.ORD_CAN_CHG_QTY
-		             , Z.ITEMKIND_NM 
-		             , Z.ITEMKIND_CD 
-		             , Z.SIZE_GB 
-		             , Z.REMAIN_DT
-		             , Z.REVIEW_SQ
-		             , Z.REVIEW_GB
-		             , Z.REVIEW_CONTENT
-		             , Z.SCORE
-		             , Z.HEIGHT
-		             , Z.WEIGHT
-		             , Z.SCORE_SIZE
-		             , Z.SCORE_COLOR
-		             , Z.SCORE_FIT
-		             , Z.SCORE_THICK
-		             , Z.SCORE_WEIGHT
-		             , Z.SCORE_BALL
-		             , Z.GIVE_DUE_PNT
-		             , Z.PNT_GIVE_STAT
-		             , Z.BEST_YN
-		             , Z.GIVE_DUE_BPNT
-		             , Z.BPNT_GIVE_YN
-		             , Z.DISP_YN
-		             , Z.DEL_YN
-		             , Z.CONFIRM_YN
-		             , Z.CONFIRM_UNO
-		             , Z.CONFIRM_DT
-		             , Z.REG_NO
-		             , Z.REG_DT
-		             , Z.UPD_NO
-		             , Z.UPD_DT
-		             , Z.ADM_RPL
-		             , Z.ADM_RPL_REG_NO
-		             , Z.ADM_RPL_DT
-		             , ROW_NUMBER() OVER(ORDER BY Z.ORD_DT DESC) AS RNUM
-		       FROM (SELECT O.ORD_NO
+		SELECT GROUP_CONCAT(Z.ITEM_NM ORDER BY Z.ORD_DTL_ITEM_SQ SEPARATOR '!@!') AS ITEM_NM
+		     , GROUP_CONCAT(' ',CONCAT(OPT_CD1_NM,' / ', OPT_CD2) ORDER BY Z.ORD_DTL_ITEM_SQ) AS COLOR_NM
+		     , GROUP_CONCAT(Z.OPT_CD1 ORDER BY Z.ORD_DTL_ITEM_SQ) AS OPT_CD1
+		     , GROUP_CONCAT(Z.OPT_CD2 ORDER BY Z.ORD_DTL_ITEM_SQ) AS OPT_CD2
+		     , GROUP_CONCAT(Z.OPT_CD1_NM ORDER BY Z.ORD_DTL_ITEM_SQ) AS OPT_CD1_NM
+		     , Z.ORD_NO
+		     , Z.ORD_DT
+		     , Z.PAY_DT
+		     , Z.ORD_DTL_NO
+		     , Z.GOODS_CD
+		     , Z.GOODS_NM
+		     , Z.LIST_PRICE
+		     , Z.GOODS_TYPE
+		     , Z.SYS_IMG_NM
+		     , Z.BRAND_NM
+		     , Z.BRAND_ENM
+		     , Z.REMAIN_DT
+		     , Z.REVIEW_SQ
+		     , Z.REVIEW_GB
+		     , Z.REVIEW_CONTENT
+		     , Z.SCORE
+		     , Z.HEIGHT
+		     , Z.WEIGHT
+		     , Z.SCORE_SIZE
+		     , Z.SCORE_COLOR
+		     , Z.SCORE_FIT
+		     , Z.SCORE_THICK
+		     , Z.SCORE_WEIGHT
+		     , Z.SCORE_BALL
+		     , Z.BEST_YN
+		     , Z.DISP_YN
+		     , Z.DEL_YN
+		     , Z.CONFIRM_YN
+		     , Z.CONFIRM_UNO
+		     , Z.CONFIRM_DT
+		     , Z.REG_NO
+		     , Z.REG_DT
+		     , Z.UPD_NO
+		     , Z.UPD_DT
+		     , Z.ADM_RPL
+		     , Z.ADM_RPL_REG_NO
+		     , Z.ADM_RPL_DT
+		     , ROW_NUMBER() OVER(ORDER BY Z.ORD_DT DESC) AS RNUM
+		       FROM (    
+		             SELECT O.ORD_NO
 		                  , DATE_FORMAT(O.ORD_DT, '%Y.%m.%d') AS ORD_DT
-		                  , DATE_FORMAT(O.PAY_DT, '%Y.%m.%d') AS PAY_DT 
-		                  , DATE_FORMAT(OD.DELV_EDDT, '%m/%d')								AS DELV_EDDT
+		                  , DATE_FORMAT(O.PAY_DT, '%Y.%m.%d') AS PAY_DT
+		                  , DATE_FORMAT(OD.DELV_EDDT, '%m/%d')                                                          AS DELV_EDDT
 		                  , OD.ORD_DTL_NO
-		                  , OD.ORD_EXCH_GB
 		                  , OD.GOODS_CD
-		                  , OD.GIFT_ADDR_INP_YN
 		                  , G.GOODS_NM
-		                  , IFNULL((SELECT COLOR_KNM FROM TB_COLOR C WHERE COLOR_CD = IFNULL(NULLIF(ODI.OPT_CD1,'') , G.MAIN_COLOR_CD ) AND USE_YN  = 'Y'), ODI.OPT_CD1) AS COLOR_NM
-		                  , (SELECT GOODS_NM FROM TB_GOODS WHERE GOODS_CD = ODI.ITEM_CD)		AS ITEM_NM
+		                  , (SELECT GOODS_NM FROM TB_GOODS WHERE GOODS_CD = ODI.ITEM_CD)                AS ITEM_NM
 		                  , ODI.ORD_DTL_ITEM_SQ
 		                  , ODI.OPT_CD1
 		                  , ODI.OPT_CD2
@@ -1037,67 +955,41 @@
 		                  , G.GOODS_TYPE
 		                  , CASE WHEN G.GOODS_TYPE != 'G056_S' AND G.SELF_GOODS_YN = 'Y' THEN (SELECT MAX(SYS_IMG_NM) FROM TB_GOODS_IMG WHERE GOODS_CD = G.GOODS_CD AND COLOR_CD = ODI.OPT_CD1 AND DEFAULT_IMG_YN = 'Y')
 		                         ELSE (SELECT MAX(SYS_IMG_NM) FROM TB_GOODS_IMG WHERE GOODS_CD = G.GOODS_CD AND COLOR_CD = IFNULL(G.MAIN_COLOR_CD,'XX') AND DEFAULT_IMG_YN = 'Y') END AS SYS_IMG_NM
-		                  , OD.ORD_DTL_STAT
-		                  , OD.ORD_QTY
-		                  , OD.CNCL_RTN_QTY
-		                  , OD.ORD_AMT
-		                  , OD.REAL_ORD_AMT
-		                  , OD.SAVE_PNT_AMT
-		                  , OD.CNCL_RTN_AMT
-		                  , OD.PNT_DC_AMT
-		                  , OD.GFCD_USE_AMT
-		                  , OD.INVOICE_NO
-		                  , OD.SUPPLY_COMP_CD
-		                  , OD.DELV_FEE_CD
-		                  , OD.SHOT_DELV_YN
-		                  , OD.CHANGEABLE_YN
-		                  , OD.RETURNABLE_YN
-		                  , G.SELF_GOODS_YN
 		                  , CASE BG.DISP_NM_LANG WHEN 'EN' THEN BG.BRAND_GROUP_ENM
 		                       ELSE BG.BRAND_GROUP_KNM
 		                        END                                                             AS BRAND_NM
 		                  , B.BRAND_ENM
-		                  , FN_GET_CODE_NM('G013', OD.ORD_DTL_STAT)							AS ORD_DTL_STAT_NM
-		                  , IFNULL(OCD.ORD_REQ_CHG_QTY, 0) AS ORD_REQ_CHG_QTY
-		                  , OD.ORD_QTY - OD.CNCL_RTN_QTY - IFNULL(OCD.ORD_REQ_CHG_QTY, 0)    AS ORD_CAN_CHG_QTY
-		                  , I.ITEMKIND_NM 
-		                  , I.ITEMKIND_CD 
-		                  , I.SIZE_GB 
 		                  , R.REVIEW_SQ
 		                  , R.REVIEW_GB
 		                  , R.REVIEW_CONTENT
 		                  , R.SCORE
 		                  , R.HEIGHT
 		                  , R.WEIGHT
-		                  , (CASE R.SCORE_SIZE   WHEN 1 THEN '작음' 
+		                  , (CASE R.SCORE_SIZE   WHEN 1 THEN '작음'
 		                                          WHEN 2 THEN '딱맞음'
 		                                         WHEN 3 THEN '큼'
 		                                                            END) AS SCORE_SIZE
-		                  , (CASE R.SCORE_COLOR  WHEN 1 THEN '밝음' 
+		                  , (CASE R.SCORE_COLOR  WHEN 1 THEN '밝음'
 		                                         WHEN 2 THEN '똑같음'
-		                                         WHEN 3 THEN '어두움'   
+		                                         WHEN 3 THEN '어두움'
 		                                                            END) AS SCORE_COLOR
-		                  , (CASE R.SCORE_FIT    WHEN 1 THEN '슬림' 
-		                                         WHEN 2 THEN '레귤러' 
-		                                         WHEN 3 THEN '오버' 
+		                  , (CASE R.SCORE_FIT    WHEN 1 THEN '슬림'
+		                                         WHEN 2 THEN '레귤러'
+		                                         WHEN 3 THEN '오버'
 		                                                            END) AS SCORE_FIT
-		                  , (CASE R.SCORE_THICK  WHEN 1 THEN '얇음' 
-		                                         WHEN 2 THEN '적당함' 
+		                  , (CASE R.SCORE_THICK  WHEN 1 THEN '얇음'
+		                                         WHEN 2 THEN '적당함'
 		                                         WHEN 3 THEN '도톰함'
 		                                                            END) AS SCORE_THICK
-		                   , (CASE R.SCORE_WEIGHT WHEN 1 THEN '가벼움' 
+		                   , (CASE R.SCORE_WEIGHT WHEN 1 THEN '가벼움'
 		                                         WHEN 2 THEN '적당함'
 		                                         WHEN 3 THEN '무거움'
 		                                                            END) AS SCORE_WEIGHT
 		                   , (CASE R.SCORE_BALL   WHEN 1 THEN '작음'
 		                                          WHEN 2 THEN '딱맞음'
-		                                          WHEN 3 THEN '큼' 
+		                                          WHEN 3 THEN '큼'
 		                                                            END) AS SCORE_BALL
-		                   , R.GIVE_DUE_PNT
-		                   , R.PNT_GIVE_STAT
 		                   , R.BEST_YN
-		                   , R.GIVE_DUE_BPNT
-		                   , R.BPNT_GIVE_YN
 		                   , R.DISP_YN
 		                   , R.DEL_YN
 		                   , R.CONFIRM_YN
@@ -1110,7 +1002,7 @@
 		                   , R.ADM_RPL
 		                   , R.ADM_RPL_REG_NO
 		                   , DATE_FORMAT(R.ADM_RPL_DT , '%Y.%m.%d') AS ADM_RPL_DT
-		                   , DATEDIFF( DATE_ADD(O.PAY_DT,INTERVAL  #{reviewExpireDay} DAY),NOW()) AS REMAIN_DT -- 남은시간
+		                   , DATEDIFF( DATE_ADD(O.PAY_DT,INTERVAL   365 /**P*/ DAY),NOW()) AS REMAIN_DT -- 남은시간
 		    FROM TB_ORDER O
 		   INNER JOIN TB_ORDER_DETAIL OD
 		      ON O.ORD_NO = OD.ORD_NO
@@ -1129,17 +1021,6 @@
 		  	AND R.ORD_DTL_NO = OD.ORD_DTL_NO 
 		  	AND R.DEL_YN = 'N'
 		  	AND R.DISP_YN = 'Y'
-		   LEFT JOIN TB_ITEMKIND I 
-		      ON G.ITEMKIND_CD = I.ITEMKIND_CD 
-		    LEFT OUTER JOIN (SELECT OD.ORD_DTL_NO
-		                      	, SUM(OCD.CHG_QTY) AS ORD_REQ_CHG_QTY
-		                       FROM TB_ORDER_CHANGE_DETAIL OCD
-		                      INNER JOIN TB_ORDER_DETAIL OD
-		                         ON OCD.ORD_DTL_NO = OD.ORD_DTL_NO
-		                      WHERE OCD.DEL_YN = 'N'
-		                      GROUP BY OCD.ORD_DTL_NO
-		            ) OCD
-		      ON OD.ORD_DTL_NO = OCD.ORD_DTL_NO
 		  LEFT OUTER JOIN TB_COLOR C ON ODI.OPT_CD1 = C.COLOR_CD
 		                               AND C.USE_YN = 'Y'
 		     WHERE 1=1
@@ -1149,11 +1030,43 @@
 		   AND OD.ORD_DTL_NO IN (SELECT R.ORD_DTL_NO FROM TB_REVIEW R WHERE R.DEL_YN = 'N' AND DISP_YN = 'Y' AND R.ORD_NO = O.ORD_NO AND R.ORD_DTL_NO = OD.ORD_DTL_NO AND R.CUST_NO = #{custNo})
 		   AND O.SITE_CD =  #{siteCd}
 		   	) Z
-		 GROUP BY Z.ORD_NO, Z.ORD_DT, Z.DELV_EDDT, Z.ORD_DTL_NO, Z.ORD_EXCH_GB
-		        , Z.GOODS_CD, Z.GOODS_NM, Z.LIST_PRICE, Z.SYS_IMG_NM, Z.ORD_DTL_STAT, Z.ORD_QTY, Z.CNCL_RTN_QTY, Z.ORD_AMT, Z.REAL_ORD_AMT
-		        , Z.SAVE_PNT_AMT, Z.CNCL_RTN_AMT, Z.PNT_DC_AMT, Z.GFCD_USE_AMT, Z.INVOICE_NO
-		        , Z.SUPPLY_COMP_CD, Z.DELV_FEE_CD, Z.SHOT_DELV_YN, Z.CHANGEABLE_YN, Z.SELF_GOODS_YN, Z.BRAND_NM, Z.BRAND_ENM, Z.ORD_DTL_STAT_NM
-		        , Z.ORD_REQ_CHG_QTY, Z.ORD_CAN_CHG_QTY, Z.REVIEW_SQ 
+		 GROUP BY     Z.ORD_NO
+		            , Z.ORD_DT
+		            , Z.PAY_DT
+		            , Z.ORD_DTL_NO
+		            , Z.GOODS_CD
+		            , Z.GOODS_NM
+		            , Z.LIST_PRICE
+		            , Z.GOODS_TYPE
+		            , Z.SYS_IMG_NM
+		            , Z.BRAND_NM
+		            , Z.BRAND_ENM
+		            , Z.REMAIN_DT
+		            , Z.REVIEW_SQ
+		            , Z.REVIEW_GB
+		            , Z.REVIEW_CONTENT
+		            , Z.SCORE
+		            , Z.HEIGHT
+		            , Z.WEIGHT
+		            , Z.SCORE_SIZE
+		            , Z.SCORE_COLOR
+		            , Z.SCORE_FIT
+		            , Z.SCORE_THICK
+		            , Z.SCORE_WEIGHT
+		            , Z.SCORE_BALL
+		            , Z.BEST_YN
+		            , Z.DISP_YN
+		            , Z.DEL_YN
+		            , Z.CONFIRM_YN
+		            , Z.CONFIRM_UNO
+		            , Z.CONFIRM_DT
+		            , Z.REG_NO
+		            , Z.REG_DT
+		            , Z.UPD_NO
+		            , Z.UPD_DT
+		            , Z.ADM_RPL
+		            , Z.ADM_RPL_REG_NO
+		            , Z.ADM_RPL_DT
 		ORDER BY Z.ORD_NO DESC
 		<include refid="selectForPagingFooter"/>
 		</select>

+ 1 - 2
src/main/java/com/style24/persistence/mybatis/shop/TsfWishlist.xml

@@ -170,7 +170,7 @@
 	
 	<select id="getQuickWishList" parameterType="WishList" resultType="Goods">
 		/* TsfWishlist.getQuickWishList*/
-SELECT Z.*
+		SELECT Z.*
 		FROM
 		(
 		WITH TAB_GOODS AS (
@@ -197,7 +197,6 @@ SELECT Z.*
 		         , G.MIN_ORD_QTY                                            /*최소주문수량*/  				
 		    FROM   TB_WISHlIST W
 		         , TB_GOODS G 
-		         , TB_GOODS_STOCK GS
 		         , TB_BRAND B
 		         , TB_BRAND_GROUP BG
 		    WHERE  W.GOODS_CD = G.GOODS_CD 

+ 7 - 6
src/main/webapp/WEB-INF/views/mob/order/OrderFormMob.html

@@ -579,9 +579,6 @@ var orderGiftInfoSet = function() {
 					
 					// 2021.06.03
 					window.style24.getContact();
-					// 데이타테스트
-					//var obj = {"contact" : {"name" : "홍길동", "phnno" : "010-1234-0000"}}
-					//contactInfo(obj);
 				}
 			});
 			
@@ -592,9 +589,13 @@ var orderGiftInfoSet = function() {
 }
 
 // 2021.06.03 어플 callback 함수 호출
-var contactInfo = function(jsonString) {
-	$("#orderForm #orderGiftInfo input[name=recipNm]").val(jsonString.contact.name);
-	$("#orderForm #orderGiftInfo input[name=recipPhnno]").val(jsonString.contact.phnno);
+function contactInfo(jsonString) {
+	let jsonObj = JSON.parse(jsonString);
+	var phnno = jsonObj.contact.phnno;
+	phnno = phnno.replace(/[^0-9]/g, "").replace(/(^02|^0505|^1[0-9]{3}|^0[0-9]{2})([0-9]+)?([0-9]{4})$/,"$1-$2-$3").replace("--", "-");
+	
+	$("#orderForm #orderGiftInfo input[name=recipNm]").val(jsonObj.contact.name);
+	$("#orderForm #orderGiftInfo input[name=recipPhnno]").val(phnno);
 }
 
 // 1.4.2 배송정보로드

+ 5 - 2
src/main/webapp/WEB-INF/views/mob/order/OrderGiftInfoMob.html

@@ -87,6 +87,7 @@
 
 <script th:inline="javascript">
 var dispYn = [[${order.dispYn}]]; // 노출여부
+var frontGb = [[${frontGb}]];
 
 //화면노출
 var orderGiftInfoDispYn = function(temp) {
@@ -101,12 +102,14 @@ var orderGiftInfoDispYn = function(temp) {
 
 //컨텐츠 호출
 $(document).ready( function() {
-	
+	//alert(frontGb);
+	//var userAgent=navigator.userAgent.toLowerCase();
+	//alert("userAgent ::: " + userAgent);
 });
 
 //2021.04.09 하이픈처리
 $(document).on("keyup", "#orderGiftInfo input[name=recipPhnno]", function() { 
-	$(this).val( $(this).val().replace(/[^0-9]/g, "").replace(/(^02|^0505|^1[0-9]{3}|^0[0-9]{2})([0-9]+)?([0-9]{4})$/,"$1-$2-$3").replace("--", "-") ); 
+	$(this).val($(this).val().replace(/[^0-9]/g, "").replace(/(^02|^0505|^1[0-9]{3}|^0[0-9]{2})([0-9]+)?([0-9]{4})$/,"$1-$2-$3").replace("--", "-") ); 
 });
 
 //선물 받으실 분 직접입력 글자 제한

+ 250 - 228
src/main/webapp/WEB-INF/views/mob/planning/PlanningDetailFormMob.html

@@ -36,23 +36,23 @@
 				</div>
 				<th:block th:each="a, template : ${templateOrd}">
 					<th:block th:if="${a.tmplType == 'G082_10'}">
-		                <div class="inner bg_gray" th:id="${a.tmplType}">
+		                <div class="inner bg_gray" th:id="${a.tmplType}" style="display: none">
 						</div>
 					</th:block>
 					<th:block th:if="${a.tmplType == 'G082_20'}">
-		                <div class="inner" th:id="${a.tmplType}">
+		                <div class="inner" th:id="${a.tmplType}" style="display: none">
 						</div>
 					</th:block>
 					<th:block th:if="${a.tmplType == 'G082_30'}"><!-- 이미지 -->
-						 <div class="inner wide" th:id="${a.tmplType}"> 
+						 <div class="inner wide" th:id="${a.tmplType}" style="display: none"> 
 						</div>
 					</th:block>
 					<th:block th:if="${a.tmplType == 'G082_50'}">
-						<div class="inner wide" th:id="${a.tmplType + a.planContSq}">
+						<div class="inner wide" th:id="${a.tmplType + a.planContSq}" style="display: none">
                 		</div>
 					</th:block>
 					<th:block th:if="${a.tmplType == 'G082_51'}">
-						<div class="inner" th:id="${a.tmplType + a.planContSq}">
+						<div class="inner" th:id="${a.tmplType + a.planContSq}" style="display: none">
 							<div class="dp_listItems_wrap">
 								<h2 class="dp_subtitle">
 									<a th:if="${a.linkUrl!=null && a.linkUrl!=''}" th:href="${a.linkUrl}" th:text="${a.title}"></a>
@@ -66,11 +66,11 @@
 						</div>
 					</th:block>
 					<th:block th:if="${a.tmplType == 'G082_52'}">
-						<div class="inner" th:id="${a.tmplType + a.planContSq}">
+						<div class="inner" th:id="${a.tmplType + a.planContSq}" style="display: none">
                     	</div>
 					</th:block>
 					<th:block th:if="${a.tmplType == 'G082_60'}">
-						<div class="inner" th:id="${a.tmplType}">
+						<div class="inner" th:id="${a.tmplType}" style="display: none">
 						</div>
 					</th:block>
 				</th:block>
@@ -122,22 +122,7 @@
 							</div>
 							<!-- 댓글 -->
 							<div class="cmt_group" id="replyList">
-							<!-- 	<div class="paging_wrap">
-									<ul class="pageNav">
-										<li class="prev"><a href="#"><span class="sr-only">이전</span></a></li>
-										<li class="active">01</li>
-										<li>/</li>
-										<li>10</li>
-										<li class="next"><a href="#"><span class="sr-only">다음</span></a></li>
-									</ul>
-								</div> -->
-								<!-- 임시 -->
-								<!-- <div class="paging_wrap">
-									<ul class="pageNav" id="paging">
 
-									</ul>
-								</div> -->
-								<!-- 임시 -->
 							</div>
 						</div>
 					</form>
@@ -270,13 +255,18 @@
 <script src="/ux/plugins/gaga/gaga.paging.js"></script>
 <script th:inline="javascript">
 let review = [[${reviewInfo}]];
+let reviewContent = [[${reviewContent}]];
 let coupon = [[${couponInfo}]];
+let couponContent = [[${couponContent}]];
 let plan = [[${planInfo}]];
 let image = [[${imageInfo}]];
 let notice = [[${noticeInfo}]];
 let goods1 = [[${goods1Info}]];
+let goods1Content = [[${goods1Content}]];
 let goods2 = [[${goods2Info}]];
+let goods2Content = [[${goods2Content}]];
 let goods4 = [[${goods4Info}]];
+let goods4Content = [[${goods4Content}]];
 let template =[[${templateOrd}]];
 let replyList = [[${replyList}]];
 let replyCount = [[${replyCount}]];
@@ -458,6 +448,8 @@ var fnReplySave = function() {
 }
 
 if (notice.length>0) {
+	$("#G082_60").show();
+	
 	var html = '';
 	
 	html += '<div class="announce_txt">';
@@ -560,7 +552,7 @@ if(planCornerList.length>0){
 	
 }
 
-if(goods1.length>0){
+if(template.length>0){
 	var array = [];
 
 	for (var j = 0; j < template.length; j++) {
@@ -571,6 +563,9 @@ if(goods1.length>0){
 	for (var i = 0; i < template.length; i++) {
 		var html = '';
 		if(template[i].tmplType == 'G082_50' && array[0] == template[i].planContSq && typeof array[0] != 'undefined') {
+			if(template[i].title != null && template[i].title != ''){
+				$("#G082_50" +template[i].planContSq).show();
+			}
 			html += '<div class="dp_listItems_cont type1">\n';
 			html += '	<h2 class="dp_subtitle">\n';
 			if (template[i].linkUrl != null && template[i].linkUrl != '') { /* 링크 변경 예정 */
@@ -587,6 +582,7 @@ if(goods1.length>0){
 			html += '		<div class="swiper-wrapper">\n';
 			$.each(goods1, function(idx, item)  {
 				if (item.planContSq == template[i].planContSq) {
+					$("#G082_50" + item.planContSq).show();
 					html += '			<div class="swiper-slide">\n';
 					html += '				<div class="item_prod">\n';
 					html += '					<div class="item_state">\n';
@@ -630,50 +626,53 @@ if(goods1.length>0){
 var fnCompleteList = function () {
 	$.each(template, function(idx, item)  {
 		if(item.tmplType == "G082_51"){
+			if(item.title != null && item.title != ''){
+				$("#G082_51" +item.planContSq).show();
+			}
 			var form = '#searchForm1_G082_51'+item.planContSq;
 			gagajf.ajaxFormSubmit('/planning/goods/list', form, fnGetCompleteCallback);
 		}
-		
 	});
-	
 }
 
 var fnGetCompleteCallback = function (result) {
-	if (result.dataList != null && result.dataList.length > 0) {
-		var html = '';
-		$.each(result.dataList, function(idx, item) {
-			html += '		<div class="item_prod">\n';
-			html += '			<div class="item_state">\n';
-			html += '				<a onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')" class="itemLink">\n';
-			html += '					<div class="itemPic">\n';
-			html += '						<img class="vLHTC pd_img" src="'+ _uploadGoodsUrl +'/'+item.sysImgNm +'">\n';
-			html += '					</div>\n';
-			html += '					<p class="itemBrand">'+item.brandGroupNm+'</p>\n';
-			html += '					<div class="itemName">'+item.goodsNm+'</div>\n';
-			html += '					<p class="itemPrice">\n';
-			if (item.currPrice != item.listPrice) {
-				html += '						<span class="itemPrice_original">'+item.listPrice.addComma()+'</span>\n';
-			}
-			html += 						item.currPrice.addComma();
-			if (item.currPrice != item.listPrice) {
-				html += '						<span class="itemPercent">'+Math.floor(item.dcRate)+'%</span>\n';
-			}
-			html += '					</p>\n';
-			if(item.goodsTnm != null){
-				html += '					<div class="itemComment">'+item.goodsTnm+'</div>\n';
+	if(template.length>0){
+		if (result.dataList != null && result.dataList.length > 0) {
+			var html = '';
+			$.each(result.dataList, function(idx, item) {
+				html += '		<div class="item_prod">\n';
+				html += '			<div class="item_state">\n';
+				html += '				<a onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')" class="itemLink">\n';
+				html += '					<div class="itemPic">\n';
+				html += '						<img class="vLHTC pd_img" src="'+ _uploadGoodsUrl +'/'+item.sysImgNm +'">\n';
+				html += '					</div>\n';
+				html += '					<p class="itemBrand">'+item.brandGroupNm+'</p>\n';
+				html += '					<div class="itemName">'+item.goodsNm+'</div>\n';
+				html += '					<p class="itemPrice">\n';
+				if (item.currPrice != item.listPrice) {
+					html += '						<span class="itemPrice_original">'+item.listPrice.addComma()+'</span>\n';
+				}
+				html += 						item.currPrice.addComma();
+				if (item.currPrice != item.listPrice) {
+					html += '						<span class="itemPercent">'+Math.floor(item.dcRate)+'%</span>\n';
+				}
+				html += '					</p>\n';
+				if(item.goodsTnm != null){
+					html += '					<div class="itemComment">'+item.goodsTnm+'</div>\n';
+				}
+				html += '				</a>\n';
+				html += '			</div>\n';
+				html += '		</div>\n';
+		});
+			$('#group_'+result.dataList[0].planContSq).append(html);
+			if (result.paging1.pageable2.totalPage > result.paging1.pageable2.pageNo) {
+				
+				$('#moreBtn_' + result.dataList[0].planContSq).show();
+				$('#searchForm1_G082_51'+result.dataList[0].planContSq +' input[name=pageNo2]').val(result.paging1.pageable2.pageNo + 1);
+				
+			}else{
+				$('#moreBtn_' + result.dataList[0].planContSq).hide();
 			}
-			html += '				</a>\n';
-			html += '			</div>\n';
-			html += '		</div>\n';
-	});
-		$('#group_'+result.dataList[0].planContSq).append(html);
-		if (result.paging1.pageable2.totalPage > result.paging1.pageable2.pageNo) {
-			
-			$('#moreBtn_' + result.dataList[0].planContSq).show();
-			$('#searchForm1_G082_51'+result.dataList[0].planContSq +' input[name=pageNo2]').val(result.paging1.pageable2.pageNo + 1);
-			
-		}else{
-			$('#moreBtn_' + result.dataList[0].planContSq).hide();
 		}
 	}
 }
@@ -685,7 +684,7 @@ var moreBtn = function (obj) {
 
 
 
-if(goods4.length>0){
+if(template.length>0){
 	var array = [];
 	var html = '';
 	for (var j = 0; j < template.length; j++) {
@@ -696,6 +695,9 @@ if(goods4.length>0){
 	
 	for (var i = 0; i < template.length; i++) {
 		if(template[i].tmplType == 'G082_52' && array[0] == template[i].planContSq && typeof array[0] != 'undefined'){
+			if(template[i].title != null && template[i].title != ''){
+				$("#G082_52" +template[i].planContSq).show();
+			}
 			html += '<div class="dp_listItems_cont type2">\n';
 			if (template[i].linkUrl != null && template[i].linkUrl != '') { /* 링크 변경 예정 */
 				if (template[i].linkOpenGb == "M") { //본창
@@ -710,6 +712,7 @@ if(goods4.length>0){
 			html += '	<div class="swiper-container item02">\n';
 			html += '		<div class="swiper-wrapper">\n';
 			$.each(goods4, function(idx, item) {
+				$("#G082_52" + item.planContSq).show();
 				html += '			<div class="swiper-slide">\n';
 				html += '				<div class="item_prod">\n';
 				html += '					<div class="item_state">\n';
@@ -751,185 +754,204 @@ if(goods4.length>0){
 	}
 }
 
-if(review.length>0){
-	
-	var html = '';
-	
-	html += '<div class="dp_review_cont">\n';
-	html += '	<div class="dp_review">\n';
-	html += '		<h2 class="dp_subtitle">'+review[0].title+'</h2>\n';
-	html += '		<div class="review">\n';
-	html += '			<div class="swiper-container review_list">\n';
-	html += '				<div class="swiper-wrapper">\n';
-	$.each(review, function(idx, item)  {
-		html += '					<div class="swiper-slide">\n';
-		html += '						<div>\n';
-		html += '							<div class="best_review">\n';
-		if(item.reviewSysImg!= null){
-			html += '								<a href="javascript:void();" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'\', \'Y\',\''+item.reviewSq+'\');">\n';
-		}else{
-			html += '								<a href="javascript:void();" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'\', \'N\',\''+item.reviewSq+'\');">\n';
-		}
-		html += '									<div class="lap">\n';
-		html += '										<div class="pic">\n';
-		if(item.reviewSysImg!= null){
-			if (item.fileGb == 'M') { 
-				html += '											<span class="thumb mov" style="background-image:url('+ _uploadImageUrl+item.reviewSysImg +');"></span>\n';
+if(template.length>0){
+	if(review.length>0 || reviewContent[0].title != ''){
+		$("#G082_10").show();
+		var html = '';
+		
+		html += '<div class="dp_review_cont">\n';
+		html += '	<div class="dp_review">\n';
+		html += '		<h2 class="dp_subtitle">'+reviewContent[0].title+'</h2>\n';
+		html += '		<div class="review">\n';
+		html += '			<div class="swiper-container review_list">\n';
+		html += '				<div class="swiper-wrapper">\n';
+		$.each(review, function(idx, item)  {
+			html += '					<div class="swiper-slide">\n';
+			html += '						<div>\n';
+			html += '							<div class="best_review">\n';
+			if(item.reviewSysImg!= null){
+				if (item.bestYn == 'Y') {
+					html += '								<a href="javascript:void();" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'Y\', \'Y\',\''+item.reviewSq+'\');">\n';
+				}else{
+					html += '								<a href="javascript:void();" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'N\', \'Y\',\''+item.reviewSq+'\');">\n';
+				}
 			}else{
-				html += '											<span class="thumb" style="background-image:url('+ _uploadImageUrl +item.reviewSysImg +');"></span>\n';
+				if (item.bestYn == 'Y') {
+					html += '								<a href="javascript:void();" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'Y\', \'N\',\''+item.reviewSq+'\');">\n';
+				}else{
+					html += '								<a href="javascript:void();" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'N\', \'N\',\''+item.reviewSq+'\');">\n';
+				}
 			}
-		}else{
-			html += '											<span class="thumb" style="background-image:url('+ _uploadGoodsUrl+'/'+item.sysImgNm +');"></span>\n';
-		}
-		html += '										</div>\n';
-		html += '										<div class="info">\n';
-		html += '											<div>\n';
-		html += '												<div class="star_score">\n';
-		html += '													<span class="star">\n';
-		html += '														<em class="progbar" style="width:'+(item.score*20)+'%;"></em>\n';
-		html += '													</span>\n';
-		if(item.bestYn == 'Y'){
-			html += '													<em class="ico ico_besttag"></em>\n';
-		}
-		html += '												</div>\n';
-		html += '												<div class="txt_best_review">\n';
-		html += '													<p>'+item.reviewContent+'</p>';
-		html += '												</div>\n';
-		html += '												<div class="writer">\n';
-		html += '													<span class="wr_id">'+item.maskingCustId+'</span>\n';
-		html += '													<span class="wr_date">'+item.regDt+'</span>\n';
-		html += '												</div>\n';
-		html += '											</div>\n';
-		html += '										</div>\n';
-		html += '									</div>\n';
-		html += '								</a>\n';
-		html += '							</div>\n';
-		html += '							<div class="product_view">\n';
-		html += '								<div class="item_prod">\n';
-		html += '									<div class="item_state">\n';
-		html += '										<a href="javascript:void(0)" onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')" class="itemLink">\n';
-		html += '											<div class="itemPic">\n';
-		html += '												<img alt="" class="vLHTC pd_img" src="'+ _uploadGoodsUrl +'/'+item.sysImgNm +'">\n';
-		html += '											</div>\n';
-		html += '											<div class="itemName">'+item.goodsNm+'</div>\n';
-		html += '											<p class="itemPrice">\n';
-		html += '												<span class="itemPrice_sale">'+item.currPrice.addComma()+'</span>\n';
-		html += '											</p>\n';
-		html += '										</a>\n';
-		html += '									</div>\n';
-		html += '								</div>\n';
-		html += '							</div>\n';
-		html += '						</div>\n';
-		html += '					</div>\n';
-	});
-	html += '				</div>\n';
-	html += '				<div class="swiper-pagination"></div>\n';
-	html += '			</div>\n';
-	html += '		</div>\n';
-	html += '	</div>\n';
-	html += '</div>\n';
-
+			html += '									<div class="lap">\n';
+			html += '										<div class="pic">\n';
+			if(item.reviewSysImg!= null){
+				if (item.fileGb == 'M') { 
+					html += '											<span class="thumb mov" style="background-image:url('+ _uploadImageUrl+item.reviewSysImg +');"></span>\n';
+				}else{
+					html += '											<span class="thumb" style="background-image:url('+ _uploadImageUrl +item.reviewSysImg +');"></span>\n';
+				}
+			}else{
+				html += '											<span class="thumb" style="background-image:url('+ _uploadGoodsUrl+'/'+item.sysImgNm +');"></span>\n';
+			}
+			html += '										</div>\n';
+			html += '										<div class="info">\n';
+			html += '											<div>\n';
+			html += '												<div class="star_score">\n';
+			html += '													<span class="star">\n';
+			html += '														<em class="progbar" style="width:'+(item.score*20)+'%;"></em>\n';
+			html += '													</span>\n';
+			if(item.bestYn == 'Y'){
+				html += '													<em class="ico ico_besttag"></em>\n';
+			}
+			html += '												</div>\n';
+			html += '												<div class="txt_best_review">\n';
+			html += '													<p>'+item.reviewContent+'</p>';
+			html += '												</div>\n';
+			html += '												<div class="writer">\n';
+			html += '													<span class="wr_id">'+item.maskingCustId+'</span>\n';
+			html += '													<span class="wr_date">'+item.regDt+'</span>\n';
+			html += '												</div>\n';
+			html += '											</div>\n';
+			html += '										</div>\n';
+			html += '									</div>\n';
+			html += '								</a>\n';
+			html += '							</div>\n';
+			html += '							<div class="product_view">\n';
+			html += '								<div class="item_prod">\n';
+			html += '									<div class="item_state">\n';
+			html += '										<a href="javascript:void(0)" onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')" class="itemLink">\n';
+			html += '											<div class="itemPic">\n';
+			html += '												<img alt="" class="vLHTC pd_img" src="'+ _uploadGoodsUrl +'/'+item.sysImgNm +'">\n';
+			html += '											</div>\n';
+			html += '											<div class="itemName">'+item.goodsNm+'</div>\n';
+			html += '											<p class="itemPrice">\n';
+			html += '												<span class="itemPrice_sale">'+item.currPrice.addComma()+'</span>\n';
+			html += '											</p>\n';
+			html += '										</a>\n';
+			html += '									</div>\n';
+			html += '								</div>\n';
+			html += '							</div>\n';
+			html += '						</div>\n';
+			html += '					</div>\n';
+		});
+		html += '				</div>\n';
+		html += '				<div class="swiper-pagination"></div>\n';
+		html += '			</div>\n';
+		html += '		</div>\n';
+		html += '	</div>\n';
+		html += '</div>\n';
 
-	$("#G082_10").append(html);
+		$("#G082_10").append(html);
+	}
 }
+
 /* 이미지 */
 if(image.length>0){
-	var html = '';
-	
-	html += '<div class="promotion_visual type2">\n';
-	html += '	<div class="big_banner_slide">\n';
-	html += '		<div class="swiper-container">\n';
-	html += '			<div class="swiper-wrapper">\n';
-	$.each(image, function(idx, item)  {
-		html += '				<div class="swiper-slide">\n';
-		if (item.linkOpenGb == 'M') {
-			html += '					<a href="'+item.linkUrl+'" target="_self"><img src="'+ _uploadImageUrl + item.itemVal +'?RS=1206" ></a>\n';
-		}else{
-			html += '					<a href="'+item.linkUrl+'" target="_blank"><img src="'+ _uploadImageUrl + item.itemVal +'?RS=1206" ></a>\n';
-		}
-		html += '				</div>\n';
-	});
-	
-	html += '			</div>\n';
-	html += '			<div class="swiper-pagination"></div>\n';
-	html += '		</div>\n';
-	html += '	</div>\n';
-	html += '</div>\n';
-	
-	$("#G082_30").append(html);
-}
-
-if(coupon.length>0){
-	var html = '';
-	 
-	html += '<div class="dp_coupon">\n';
-	html += '	<h2 class="dp_subtitle">'+coupon[0].title+'</h2>\n';
-	html += '	<div class="coupon_list">\n';
-	html += '		<ul class="clear">\n';
-	$.each(coupon, function(idx, item) {
-		if (item.couponStat == '쿠폰받기') {
-			html += '			<li>\n';
-		}else{
-			html += '			<li class="off">\n';
-		}
+	if (image[0].itemVal != null && image[0].itemVal != '') {
+		$("#G082_30").show();
 		
-		html += '				<div class="cp_top">\n';
-		html += '					<div class="cp_detail">\n';
-		html += '						<p class="tit">'+item.cpnNm+'</p>\n';
-		html += '						<strong class="sale_t won_t"><span>'+item.dcVal.addComma()+'</span>'+item.dcWay+'</strong>\n';
-		html += '						<p class="cp_cont">'+item.useCondition+'</p>\n';
-		html += '						<span class="cp_cnt">'+item.issueCondition+'</span>\n';
-		html += '					</div>\n';
-		html += '					<span class="cp_shape"></span>\n';
-		html += '				</div>\n';
-		html += '				<div class="cp_date" id="dp_coupon1">\n';
-		if (item.couponStat == '쿠폰받기') {
-			html += '					<button type="button" id="coupon_'+item.cpnId+'" onclick="fnPlanCouponDown('+item.cpnId+')"><span>쿠폰 받기</span></button>\n';
-		}else{
-			html += '					<button type="button" id="coupon_'+item.cpnId+'" onclick="fnPlanCouponDown('+item.cpnId+')"><span>받기 완료</span></button>\n';
-		}
-		html += '				</div>\n';
-		html += '				<div class="cp_info">\n';
-		html += '					<button type="button" id="modalBasic" class="btn_couponInfo_pop" onclick="usePlanInfoCoupon('+item.cpnId+')"><span>사용안내</span></button>\n';
-		html += '				</div>\n';
-		html += '			</li>\n';
-	});
-	html += '		</ul>\n';
-	html += '	</div>\n';
-	if (coupon[0].cpnNote0 != null && coupon[0].cpnNote0 != '') {
-		html += '	<div class="announce_txt">\n';
-		html += '		<div class="note_txt">\n';
-		html += '			<img src="/images/mo/ico_content_find.png" alt="유의사항">\n';
-		html += '			<p>유의사항</p>\n';
-		html += '		</div>\n';
-		html += '		<div class="announce_list">\n';
-		html += '			<ul>\n';
-		html += '                  <li>' + coupon[0].cpnNote0 +'</li>\n';
-		if(coupon[0].cpnNote1 != null && coupon[0].cpnNote1 != '')
-			html += '                  <li>' + coupon[0].cpnNote1 +'</li>\n';
-		if(coupon[0].cpnNote2 != null && coupon[0].cpnNote2 != '')
-			html += '                  <li>' + coupon[0].cpnNote2 +'</li>\n';
-		if(coupon[0].cpnNote3 != null && coupon[0].cpnNote3 != '')
-			html += '                  <li>' + coupon[0].cpnNote3 +'</li>\n';	
-		if(coupon[0].cpnNote4 != null && coupon[0].cpnNote4 != '')
-			html += '                  <li>' + coupon[0].cpnNote4 +'</li>\n';
-		if(coupon[0].cpnNote5 != null && coupon[0].cpnNote5 != '')
-			html += '                  <li>' + coupon[0].cpnNote5 +'</li>\n';
-		if(coupon[0].cpnNote6 != null && coupon[0].cpnNote6 != '')
-			html += '                  <li>' + coupon[0].cpnNote6 +'</li>\n';
-		if(coupon[0].cpnNote7 != null && coupon[0].cpnNote7 != '')
-			html += '                  <li>' + coupon[0].cpnNote7 +'</li>\n';
-		if(coupon[0].cpnNote8 != null && coupon[0].cpnNote8 != '')
-			html += '                  <li>' + coupon[0].cpnNote8 +'</li>\n';
-		if(coupon[0].cpnNote9 != null && coupon[0].cpnNote9 != '')
-			html += '                  <li>' + coupon[0].cpnNote9 +'</li>\n';
-		html += '			</ul>\n';
+		var html = '';
+		
+		html += '<div class="promotion_visual type2">\n';
+		html += '	<div class="big_banner_slide">\n';
+		html += '		<div class="swiper-container">\n';
+		html += '			<div class="swiper-wrapper">\n';
+		$.each(image, function(idx, item)  {
+			html += '				<div class="swiper-slide">\n';
+			if (item.linkOpenGb == 'M') {
+				html += '					<a href="'+item.linkUrl+'" target="_self"><img src="'+ _uploadImageUrl + item.itemVal +'?RS=1206" ></a>\n';
+			}else{
+				html += '					<a href="'+item.linkUrl+'" target="_blank"><img src="'+ _uploadImageUrl + item.itemVal +'?RS=1206" ></a>\n';
+			}
+			html += '				</div>\n';
+		});
+		
+		html += '			</div>\n';
+		html += '			<div class="swiper-pagination"></div>\n';
 		html += '		</div>\n';
 		html += '	</div>\n';
+		html += '</div>\n';
+		
+		$("#G082_30").append(html);
 	}
-	html += '</div>\n';
+}
+
+
+if(template.length>0){
+	if(coupon.length>0 || (couponContent[0].title != '' && couponContent[0].title != null) || (couponContent[0].cpnNote0 != '' && couponContent[0].cpnNote0 != null)){
+		$("#G082_20").show();
 		
-	$("#G082_20").append(html);
+		var html = '';
+		 
+		html += '<div class="dp_coupon">\n';
+		html += '	<h2 class="dp_subtitle">'+couponContent[0].title+'</h2>\n';
+		html += '	<div class="coupon_list">\n';
+		html += '		<ul class="clear">\n';
+		$.each(coupon, function(idx, item) {
+			if (item.couponStat == '쿠폰받기') {
+				html += '			<li>\n';
+			}else{
+				html += '			<li class="off">\n';
+			}
+			
+			html += '				<div class="cp_top">\n';
+			html += '					<div class="cp_detail">\n';
+			html += '						<p class="tit">'+item.cpnNm+'</p>\n';
+			html += '						<strong class="sale_t won_t"><span>'+item.dcVal.addComma()+'</span>'+item.dcWay+'</strong>\n';
+			html += '						<p class="cp_cont">'+item.useCondition+'</p>\n';
+			html += '						<span class="cp_cnt">'+item.issueCondition+'</span>\n';
+			html += '					</div>\n';
+			html += '					<span class="cp_shape"></span>\n';
+			html += '				</div>\n';
+			html += '				<div class="cp_date" id="dp_coupon1">\n';
+			if (item.couponStat == '쿠폰받기') {
+				html += '					<button type="button" id="coupon_'+item.cpnId+'" onclick="fnPlanCouponDown('+item.cpnId+')"><span>쿠폰 받기</span></button>\n';
+			}else{
+				html += '					<button type="button" id="coupon_'+item.cpnId+'" onclick="fnPlanCouponDown('+item.cpnId+')"><span>받기 완료</span></button>\n';
+			}
+			html += '				</div>\n';
+			html += '				<div class="cp_info">\n';
+			html += '					<button type="button" id="modalBasic" class="btn_couponInfo_pop" onclick="usePlanInfoCoupon('+item.cpnId+')"><span>사용안내</span></button>\n';
+			html += '				</div>\n';
+			html += '			</li>\n';
+		});
+		html += '		</ul>\n';
+		html += '	</div>\n';
+		if (couponContent[0].cpnNote0 != null && couponContent[0].cpnNote0 != '') {
+			html += '	<div class="announce_txt">\n';
+			html += '		<div class="note_txt">\n';
+			html += '			<img src="/images/mo/ico_content_find.png" alt="유의사항">\n';
+			html += '			<p>유의사항</p>\n';
+			html += '		</div>\n';
+			html += '		<div class="announce_list">\n';
+			html += '			<ul>\n';
+			html += '                  <li>' + couponContent[0].cpnNote0 +'</li>\n';
+			if(couponContent[0].cpnNote1 != null && couponContent[0].cpnNote1 != '')
+				html += '                  <li>' + couponContent[0].cpnNote1 +'</li>\n';
+			if(couponContent[0].cpnNote2 != null && couponContent[0].cpnNote2 != '')
+				html += '                  <li>' + couponContent[0].cpnNote2 +'</li>\n';
+			if(couponContent[0].cpnNote3 != null && couponContent[0].cpnNote3 != '')
+				html += '                  <li>' + couponContent[0].cpnNote3 +'</li>\n';	
+			if(couponContent[0].cpnNote4 != null && couponContent[0].cpnNote4 != '')
+				html += '                  <li>' + couponContent[0].cpnNote4 +'</li>\n';
+			if(couponContent[0].cpnNote5 != null && couponContent[0].cpnNote5 != '')
+				html += '                  <li>' + couponContent[0].cpnNote5 +'</li>\n';
+			if(couponContent[0].cpnNote6 != null && couponContent[0].cpnNote6 != '')
+				html += '                  <li>' + couponContent[0].cpnNote6 +'</li>\n';
+			if(couponContent[0].cpnNote7 != null && couponContent[0].cpnNote7 != '')
+				html += '                  <li>' + couponContent[0].cpnNote7 +'</li>\n';
+			if(couponContent[0].cpnNote8 != null && couponContent[0].cpnNote8 != '')
+				html += '                  <li>' + couponContent[0].cpnNote8 +'</li>\n';
+			if(couponContent[0].cpnNote9 != null && couponContent[0].cpnNote9 != '')
+				html += '                  <li>' + couponContent[0].cpnNote9 +'</li>\n';
+			html += '			</ul>\n';
+			html += '		</div>\n';
+			html += '	</div>\n';
+		}
+		html += '</div>\n';
+			
+		$("#G082_20").append(html);
+	}
 }
 
 

+ 157 - 156
src/main/webapp/WEB-INF/views/web/planning/PlanningDetailFormWeb.html

@@ -400,86 +400,86 @@ if(planCornerList.length>0){
 	
 }
 
-if(review.length>0 || reviewContent[0].title != ''){
-	$("#G082_10").show();
-	var html = '';
-	
-	html += ' <div class="cont_head">\n';
-	html += ' 	<div>\n';
-	html += '		<h4>'+reviewContent[0].title+'</h4>\n';
-	html += ' 	</div>\n';
-	html += '	<div class="cont_body">\n';
-	html += ' 		<div class="review_list">\n';
-	$.each(review, function(idx, item)  {
-		html += '		<div class="reviw_box">\n'
-		html += '			<div class="best_review">\n';
-		if(item.reviewSysImg!= null){
-			if (item.bestYn == 'Y') {
-				html += '				<a href="javascript:void();" id="btn_pdBestReview_pop" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'Y\', \'Y\',\''+item.reviewSq+'\');">\n';
+if(template.length>0){
+	if(review.length>0 || reviewContent[0].title != ''){
+		$("#G082_10").show();
+		var html = '';
+		
+		html += ' <div class="cont_head">\n';
+		html += ' 	<div>\n';
+		html += '		<h4>'+reviewContent[0].title+'</h4>\n';
+		html += ' 	</div>\n';
+		html += '	<div class="cont_body">\n';
+		html += ' 		<div class="review_list">\n';
+		$.each(review, function(idx, item)  {
+			html += '		<div class="reviw_box">\n'
+			html += '			<div class="best_review">\n';
+			if(item.reviewSysImg!= null){
+				if (item.bestYn == 'Y') {
+					html += '				<a href="javascript:void();" id="btn_pdBestReview_pop" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'Y\', \'Y\',\''+item.reviewSq+'\');">\n';
+				}else{
+					html += '				<a href="javascript:void();" id="btn_pdBestReview_pop" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'N\', \'Y\',\''+item.reviewSq+'\');">\n';
+				}
+				
 			}else{
-				html += '				<a href="javascript:void();" id="btn_pdBestReview_pop" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'N\', \'Y\',\''+item.reviewSq+'\');">\n';
+				if (item.bestYn == 'Y') {
+					html += '				<a href="javascript:void();" id="btn_pdBestReview_pop" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'Y\', \'N\',\''+item.reviewSq+'\');">\n';
+				}else{
+					html += '				<a href="javascript:void();" id="btn_pdBestReview_pop" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'N\', \'N\',\''+item.reviewSq+'\');">\n';
+				}
+				
 			}
 			
-		}else{
-			if (item.bestYn == 'Y') {
-				html += '				<a href="javascript:void();" id="btn_pdBestReview_pop" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'Y\', \'N\',\''+item.reviewSq+'\');">\n';
+			html += '					<div class="pic">\n';
+			if(item.reviewSysImg!= null){
+				if (item.fileGb == 'M') { 
+					html += '								<span class="thumb mov" style="background-image: url('+ _uploadImageUrl+item.reviewSysImg +');"></span>\n';	
+				}else{
+					html += '								<span class="thumb" style="background-image: url('+ _uploadImageUrl +item.reviewSysImg +');"></span>\n';			
+				}
 			}else{
-				html += '				<a href="javascript:void();" id="btn_pdBestReview_pop" onclick="cfGoodsReviewDetail(\''+item.goodsCd+'\',\'N\', \'N\',\''+item.reviewSq+'\');">\n';
+				html += '								<span class="thumb" style="background-image: url('+ _uploadGoodsUrl+'/'+item.sysImgNm +');"></span>\n';	
 			}
 			
-		}
-		
-		html += '					<div class="pic">\n';
-		if(item.reviewSysImg!= null){
-			if (item.fileGb == 'M') { 
-				html += '								<span class="thumb mov" style="background-image: url('+ _uploadImageUrl+item.reviewSysImg +');"></span>\n';	
-			}else{
-				html += '								<span class="thumb" style="background-image: url('+ _uploadImageUrl +item.reviewSysImg +');"></span>\n';			
+			html += '                   </div>\n';
+			html += '                  <div class="star_score">\n';
+			html += '                      <span class="star">\n';
+			html += '                          <em class="progbar" style="width:'+(item.score*20)+'%;"></em>\n';
+			html += '                      </span>\n';
+			if(item.bestYn == 'Y'){
+				html += '<em class="ico ico_besttag"></em>\n';	
 			}
-		}else{
-			html += '								<span class="thumb" style="background-image: url('+ _uploadGoodsUrl+'/'+item.sysImgNm +');"></span>\n';	
-		}
-		
-		html += '                   </div>\n';
-		html += '                  <div class="star_score">\n';
-		html += '                      <span class="star">\n';
-		html += '                          <em class="progbar" style="width:'+(item.score*20)+'%;"></em>\n';
-		html += '                      </span>\n';
-		if(item.bestYn == 'Y'){
-			html += '<em class="ico ico_besttag"></em>\n';	
-		}
-		html += '                  </div>\n';
-		html += '                  <div class="txt_best_review">\n';
-		html += '                      <p>'+item.reviewContent+'</p>\n';
-		html += '                  </div>\n';
-		html += '                  <div class="info_writer">\n';
-		html += '                      <span class="wr_id">'+item.maskingCustId+'</span>\n';
-		html += '                      <span class="wr_date">'+item.regDt+'</span>\n';
-		html += '                  </div>\n';
-		html += '              </a>\n';
-		html += '          </div>\n';
-		html += '          <div class="review_item">\n';
-		html += '              <div class="item_prod">\n';
-		html += '                  <div class="item_state">\n';
-		html += '                      <a href="javascript:void(0)" onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')" class="itemLink">\n';
-		html += '                          <div class="itemPic">\n';
-		html += '                            	<img alt="" class="vLHTC pd_img" src="'+ _uploadGoodsUrl +'/'+item.sysImgNm +'">\n';
-		html += '                          </div>\n';
-		html += '                          <div class="itemName">'+item.goodsNm+'</div>\n';
-		html += '                          <p class="itemPrice">'+item.currPrice.addComma()+'</p>\n';
-		html += '                      </a>\n';
-		html += '                  </div>\n';
-		html += '              </div>\n';
-		html += '          </div>\n';
-		html += '      </div>\n';
-	});
-	html += '       </div>\n                    ';
-	html += '	 </div>\n';
-	html += '</div>\n';
-
-	$("#G082_10").append(html);
+			html += '                  </div>\n';
+			html += '                  <div class="txt_best_review">\n';
+			html += '                      <p>'+item.reviewContent+'</p>\n';
+			html += '                  </div>\n';
+			html += '                  <div class="info_writer">\n';
+			html += '                      <span class="wr_id">'+item.maskingCustId+'</span>\n';
+			html += '                      <span class="wr_date">'+item.regDt+'</span>\n';
+			html += '                  </div>\n';
+			html += '              </a>\n';
+			html += '          </div>\n';
+			html += '          <div class="review_item">\n';
+			html += '              <div class="item_prod">\n';
+			html += '                  <div class="item_state">\n';
+			html += '                      <a href="javascript:void(0)" onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')" class="itemLink">\n';
+			html += '                          <div class="itemPic">\n';
+			html += '                            	<img alt="" class="vLHTC pd_img" src="'+ _uploadGoodsUrl +'/'+item.sysImgNm +'">\n';
+			html += '                          </div>\n';
+			html += '                          <div class="itemName">'+item.goodsNm+'</div>\n';
+			html += '                          <p class="itemPrice">'+item.currPrice.addComma()+'</p>\n';
+			html += '                      </a>\n';
+			html += '                  </div>\n';
+			html += '              </div>\n';
+			html += '          </div>\n';
+			html += '      </div>\n';
+		});
+		html += '       </div>\n                    ';
+		html += '	 </div>\n';
+		html += '</div>\n';
 
-	
+		$("#G082_10").append(html);
+	}
 }
 
 if(image.length>0){
@@ -739,94 +739,95 @@ if(template.length>0){
 	}
 }
 
-if(coupon.length>0 || (couponContent[0].title != '' && couponContent[0].title != null) || (couponContent[0].cpnNote0 != '' && couponContent[0].cpnNote0 != null)){
-	$("#G082_20").show();
-	var html = '';
-	 
-	html += '<div class="cont_head">\n';
-	html += '	<div>\n';
-	html += '		<h4>'+couponContent[0].title+'</h4>\n';
-	html += '	</div>\n';
-	html += '</div>\n';
-	html += '<div class="cont_body">\n';
-	html += '	<div class="coupon_list">\n';
-	html += '		<ul>\n';
-	$.each(coupon, function(idx, item) {
-		html += '			<li>\n';
-		html += '				<div class="coupon">\n';
-		html += '					<div>\n';
-		html += '						<p class="cp_name">'+item.cpnNm+'</p>\n';
-		html += '						<p class="cp_cont">\n';
-		html += '							<span><em>'+item.dcVal.addComma()+'</em>'+item.dcWay+'</span>\n';
-		html += '						</p>\n';
-		html += '						<p class="cp_condition">'+item.useCondition;
-		html += '								<span>'+item.issueCondition+'</span>\n';	
-		html += '						</p>\n';
-		html += '					</div>\n';
-		if (item.couponStat == '쿠폰받기') {
-			html += '					<button type="button" id="coupon_'+item.cpnId+'" class="btn btn_dark btn_block btn_coupon_down" onclick="fnPlanCouponDown('+item.cpnId+')">\n'; 
-			html += '						<span>쿠폰받기</span>\n';								
-			html += '					</button>\n';			
-		}else{
-			html += '					<button type="button"';
-			html += '						class="btn btn_dark btn_block btn_coupon_done" disabled>\n';  
-			html += '						<span>받기완료</span>\n';								
-			html += '					</button>\n';			
+if(template.length>0){
+	if(coupon.length>0 || (couponContent[0].title != '' && couponContent[0].title != null) || (couponContent[0].cpnNote0 != '' && couponContent[0].cpnNote0 != null)){
+		$("#G082_20").show();
+		var html = '';
+		 
+		html += '<div class="cont_head">\n';
+		html += '	<div>\n';
+		html += '		<h4>'+couponContent[0].title+'</h4>\n';
+		html += '	</div>\n';
+		html += '</div>\n';
+		html += '<div class="cont_body">\n';
+		html += '	<div class="coupon_list">\n';
+		html += '		<ul>\n';
+		$.each(coupon, function(idx, item) {
+			html += '			<li>\n';
+			html += '				<div class="coupon">\n';
+			html += '					<div>\n';
+			html += '						<p class="cp_name">'+item.cpnNm+'</p>\n';
+			html += '						<p class="cp_cont">\n';
+			html += '							<span><em>'+item.dcVal.addComma()+'</em>'+item.dcWay+'</span>\n';
+			html += '						</p>\n';
+			html += '						<p class="cp_condition">'+item.useCondition;
+			html += '								<span>'+item.issueCondition+'</span>\n';	
+			html += '						</p>\n';
+			html += '					</div>\n';
+			if (item.couponStat == '쿠폰받기') {
+				html += '					<button type="button" id="coupon_'+item.cpnId+'" class="btn btn_dark btn_block btn_coupon_down" onclick="fnPlanCouponDown('+item.cpnId+')">\n'; 
+				html += '						<span>쿠폰받기</span>\n';								
+				html += '					</button>\n';			
+			}else{
+				html += '					<button type="button"';
+				html += '						class="btn btn_dark btn_block btn_coupon_done" disabled>\n';  
+				html += '						<span>받기완료</span>\n';								
+				html += '					</button>\n';			
+			}
+			html += '				</div>\n';
+			html += '				<button type="button" class="btn_underline"	id="btn_couponInfo_pop" onclick="usePlanInfoCoupon('+item.cpnId+')">\n';
+			html += '					<span>사용안내</span>\n';
+			html += '				</button>\n';
+			html += '			</li>\n';
+		});
+		html += '		</ul>\n';
+		html += '	</div>\n';
+		html += '</div>\n';
+		if(couponContent[0].cpnNote0 != null && couponContent[0].cpnNote0 != ''){
+			html += '<div class="content dp_announce line">\n                                                 ';
+			html += '    <div class="cont_head">\n                                                       ';
+			html += '        <div>\n                                                                     ';
+			html += '            <h4>유의사항</h4>\n                                                         ';
+			html += '        </div>\n                                                                    ';
+			html += '    </div>\n                                                                        ';
+			html += '    <div class="cont_body">\n                                                       ';
+			html += '        <div class="announce_txt">\n                                                ';
+			html += '            <div class="note_txt">\n                                                ';
+			html += '                <img src="/images/pc/ico_content_find.png" alt="유의사항">\n            ';
+			html += '                <p>유의사항</p>\n                                                       ';
+			html += '            </div>\n                                                                ';
+			html += '            <div class="announce_list">\n                                           ';
+			html += '               <ul>\n';
+			html += '                  <li>' + couponContent[0].cpnNote0 +'</li>\n';
+			if(couponContent[0].cpnNote1 != null && couponContent[0].cpnNote1 != '')
+				html += '                  <li>' + couponContent[0].cpnNote1 +'</li>\n';
+			if(couponContent[0].cpnNote2 != null && couponContent[0].cpnNote2 != '')
+				html += '                  <li>' + couponContent[0].cpnNote2 +'</li>\n';
+			if(couponContent[0].cpnNote3 != null && couponContent[0].cpnNote3 != '')
+				html += '                  <li>' + couponContent[0].cpnNote3 +'</li>\n';	
+			if(couponContent[0].cpnNote4 != null && couponContent[0].cpnNote4 != '')
+				html += '                  <li>' + couponContent[0].cpnNote4 +'</li>\n';
+			if(couponContent[0].cpnNote5 != null && couponContent[0].cpnNote5 != '')
+				html += '                  <li>' + couponContent[0].cpnNote5 +'</li>\n';
+			if(couponContent[0].cpnNote6 != null && couponContent[0].cpnNote6 != '')
+				html += '                  <li>' + couponContent[0].cpnNote6 +'</li>\n';
+			if(couponContent[0].cpnNote7 != null && couponContent[0].cpnNote7 != '')
+				html += '                  <li>' + couponContent[0].cpnNote7 +'</li>\n';
+			if(couponContent[0].cpnNote8 != null && couponContent[0].cpnNote8 != '')
+				html += '                  <li>' + couponContent[0].cpnNote8 +'</li>\n';
+			if(couponContent[0].cpnNote9 != null && couponContent[0].cpnNote9 != '')
+				html += '                  <li>' + couponContent[0].cpnNote9 +'</li>\n';
+			html += '               </ul>\n';
+			html += '            </div>                                                                '; 
+			html += '        </div>                                                                    '; 
+			html += '    </div>                                                                        '; 
+			html += '</div>                                                                            ';
 		}
-		html += '				</div>\n';
-		html += '				<button type="button" class="btn_underline"	id="btn_couponInfo_pop" onclick="usePlanInfoCoupon('+item.cpnId+')">\n';
-		html += '					<span>사용안내</span>\n';
-		html += '				</button>\n';
-		html += '			</li>\n';
-	});
-	html += '		</ul>\n';
-	html += '	</div>\n';
-	html += '</div>\n';
-	if(couponContent[0].cpnNote0 != null && couponContent[0].cpnNote0 != ''){
-		html += '<div class="content dp_announce line">\n                                                 ';
-		html += '    <div class="cont_head">\n                                                       ';
-		html += '        <div>\n                                                                     ';
-		html += '            <h4>유의사항</h4>\n                                                         ';
-		html += '        </div>\n                                                                    ';
-		html += '    </div>\n                                                                        ';
-		html += '    <div class="cont_body">\n                                                       ';
-		html += '        <div class="announce_txt">\n                                                ';
-		html += '            <div class="note_txt">\n                                                ';
-		html += '                <img src="/images/pc/ico_content_find.png" alt="유의사항">\n            ';
-		html += '                <p>유의사항</p>\n                                                       ';
-		html += '            </div>\n                                                                ';
-		html += '            <div class="announce_list">\n                                           ';
-		html += '               <ul>\n';
-		html += '                  <li>' + couponContent[0].cpnNote0 +'</li>\n';
-		if(couponContent[0].cpnNote1 != null && couponContent[0].cpnNote1 != '')
-			html += '                  <li>' + couponContent[0].cpnNote1 +'</li>\n';
-		if(couponContent[0].cpnNote2 != null && couponContent[0].cpnNote2 != '')
-			html += '                  <li>' + couponContent[0].cpnNote2 +'</li>\n';
-		if(couponContent[0].cpnNote3 != null && couponContent[0].cpnNote3 != '')
-			html += '                  <li>' + couponContent[0].cpnNote3 +'</li>\n';	
-		if(couponContent[0].cpnNote4 != null && couponContent[0].cpnNote4 != '')
-			html += '                  <li>' + couponContent[0].cpnNote4 +'</li>\n';
-		if(couponContent[0].cpnNote5 != null && couponContent[0].cpnNote5 != '')
-			html += '                  <li>' + couponContent[0].cpnNote5 +'</li>\n';
-		if(couponContent[0].cpnNote6 != null && couponContent[0].cpnNote6 != '')
-			html += '                  <li>' + couponContent[0].cpnNote6 +'</li>\n';
-		if(couponContent[0].cpnNote7 != null && couponContent[0].cpnNote7 != '')
-			html += '                  <li>' + couponContent[0].cpnNote7 +'</li>\n';
-		if(couponContent[0].cpnNote8 != null && couponContent[0].cpnNote8 != '')
-			html += '                  <li>' + couponContent[0].cpnNote8 +'</li>\n';
-		if(couponContent[0].cpnNote9 != null && couponContent[0].cpnNote9 != '')
-			html += '                  <li>' + couponContent[0].cpnNote9 +'</li>\n';
-		html += '               </ul>\n';
-		html += '            </div>                                                                '; 
-		html += '        </div>                                                                    '; 
-		html += '    </div>                                                                        '; 
-		html += '</div>                                                                            ';
+		$("#G082_20").append(html);
 	}
-	
-		
-	$("#G082_20").append(html);
 }
 
+
 //사용안내 모달
 var usePlanInfoCoupon = function (id) {
 	var data = {cpnId : id