Jelajahi Sumber

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

card007 5 tahun lalu
induk
melakukan
505965e9ad

+ 84 - 3
src/main/java/com/style24/front/biz/dao/TsfCartDao.java

@@ -5,6 +5,7 @@ import java.util.List;
 
 import com.style24.core.support.annotation.ShopDs;
 import com.style24.persistence.domain.Cart;
+import com.style24.persistence.domain.GoodsImg;
 import com.style24.persistence.domain.Order;
 
 /**
@@ -32,7 +33,7 @@ public interface TsfCartDao {
 	 * @author xodud1202
 	 * @since 2021. 02. 01
 	 */
-	Collection<Integer> selectHasSetItemCartList(Cart param);
+	Collection<Cart> selectHasSetItemCartList(Cart param);
 
 	/**
 	 * 장바구니 등록 상품 확인
@@ -62,7 +63,7 @@ public interface TsfCartDao {
 	void insertCartDetailInfo(Cart param);
 
 	/**
-	 * 장바구니 상세 신규 등록
+	 * 장바구니 수정
 	 * @param Cart
 	 * @return void
 	 * @author xodud1202
@@ -70,9 +71,27 @@ public interface TsfCartDao {
 	 */
 	void updateCartInfo(Cart param);
 
+	/**
+	 * 장바구니 수정
+	 * @param param
+	 * @return void
+	 * @author xodud1202
+	 * @since 2021. 03. 01
+	 */
+	void updateCart(Cart param);
+
+	/**
+	 * 장바구니 상세 수정
+	 * @param param
+	 * @return void
+	 * @author xodud1202
+	 * @since 2021. 03. 01
+	 */
+	void updateCartDetail(Cart param);
+
 	/**
 	 * 장바구니 이력 정보 저장
-	 * @param Cart
+	 * @param param
 	 * @return void
 	 * @author xodud1202
 	 * @since 2021. 02. 02
@@ -190,4 +209,66 @@ public interface TsfCartDao {
 	 * @date 2021. 2. 24
 	 */
 	void deleteCart(Cart param);
+
+	/**
+	 * 장바구니 삭제
+	 * @param param - 장바구니 정보
+	 * @author xodud1202
+	 * @date 2021. 03. 01
+	 */
+	void deleteCartDetail(Cart param);
+
+	/**
+	 * 장바구니 상품 마스터 정보 조회
+	 * @param param
+	 * @return
+	 * @author xodud1202
+	 * @date 2021. 2. 25
+	 */
+	Cart selectCartGoodsInfo(Cart param);
+
+	/**
+	 * 장바구니 세트 구성 상품 정보 조회
+	 * @param param
+	 * @return
+	 * @author xodud1202
+	 * @date 2021. 2. 25
+	 */
+	Collection<Cart> selectCartSetGoodsInfo(Cart param);
+
+	/**
+	 * 장바구니 상품 컬러 옵션 정보 조회
+	 * @param param
+	 * @return
+	 * @author xodud1202
+	 * @date 2021. 2. 26
+	 */
+	Collection<Cart> selectCartGoodsColorList(Cart param);
+
+	/**
+	 * 장바구니 상품 사이즈 옵션 정보 조회
+	 * @param param
+	 * @return
+	 * @author xodud1202
+	 * @date 2021. 2. 26
+	 */
+	Collection<Cart> selectCartGoodsSizeList(Cart param);
+
+	/**
+	 * 장바구니 자사 상품 이미지 리스트 조회
+	 * @param param
+	 * @return
+	 * @author xodud1202
+	 * @date 2021. 2. 25
+	 */
+	Collection<GoodsImg> selectCartSelfGoodsOptionImgList(Cart param);
+
+	/**
+	 * 장바구니 입점업체 상품 이미지 리스트 조회
+	 * @param param
+	 * @return
+	 * @author xodud1202
+	 * @date 2021. 2. 25
+	 */
+	Collection<GoodsImg> selectCartDelvGoodsOptionImgList(Cart param);
 }

+ 184 - 9
src/main/java/com/style24/front/biz/service/TsfCartService.java

@@ -8,6 +8,7 @@ import java.util.HashMap;
 import java.util.List;
 
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -15,6 +16,7 @@ import com.style24.core.biz.service.TscOrderService;
 import com.style24.core.support.env.TscConstants;
 import com.style24.core.support.session.TscSession;
 import com.style24.front.biz.dao.TsfCartDao;
+import com.style24.front.support.env.TsfConstants;
 import com.style24.front.support.security.session.TsfSession;
 import com.style24.persistence.domain.Cart;
 import com.style24.persistence.domain.Goods;
@@ -45,11 +47,14 @@ public class TsfCartService {
 	@Autowired
 	private TscOrderService coreOrderService;
 
+	@Autowired
+	private Environment env;
+
 	/**
 	 * 장바구니 저장
 	 * 단품 : goodsCd, optCd, optCd1, optCd2
 	 * 세트 : goodsCd,
-	 * @param cart
+	 * @param params
 	 */
 	public void saveCartInfo(Collection<Cart> params) {
 		Cart cart = new Cart();
@@ -72,7 +77,10 @@ public class TsfCartService {
 			// 상품 마스터 정보 확인
 			Goods goods = new Goods();
 			goods.setGoodsCd(param.getGoodsCd());
+			goods.setFrontGb(TsfSession.getFrontGb());
+
 			goods = goodsService.getGoodsInfo(goods);
+
 			if (goods == null) {
 				throw new IllegalArgumentException("상품 정보가 존재하지 않습니다.");
 			}
@@ -94,6 +102,8 @@ public class TsfCartService {
 			}
 
 			cart.setGoodsCd(param.getGoodsCd());
+
+			// 장바구니에 있는 같은 상품(옵션이 상이해도 같은 상품이므로 상품 전체 조회)
 			int goodsCartCnt = cartDao.getHasGoodsCartCnt(param);
 			if (param.getGoodsQty() + goodsCartCnt > goods.getDayMaxOrdQty()) {
 				throw new IllegalArgumentException("1일 구매한도 수량이 초과되었습니다.");
@@ -171,13 +181,13 @@ public class TsfCartService {
 		}
 
 		// 같은 장바구니 상품 확인
-		Collection<Integer> cartSqList = cartDao.selectHasSetItemCartList(cart);
+		Collection<Cart> cartSqList = cartDao.selectHasSetItemCartList(cart);
 
 		if (cartSqList != null && cartSqList.size() > 0) {		// 장바구니 기존재
-			if (cartSqList.size() > 1) {							// 장바구니 조회 결과 이상시 insert or select 수정 필요
+			if (cartSqList.size() > 1) {						// 장바구니 조회 결과 이상시 insert or select 수정 필요
 				throw new IllegalArgumentException("장바구니 조회에 실패하였습니다. 관리자에게 문의해주세요.");
 			} else {
-				cart.setCartSq(cartSqList.iterator().next());
+				cart.setCartSq(cartSqList.iterator().next().getCartSq());
 				cartDao.updateCartInfo(cart);               // 장바구니 정보 수정
 				cartDao.insertCartHst(cart);                // 장바구니 수정 이력 저장
 			}
@@ -310,7 +320,7 @@ public class TsfCartService {
 
 	/**
 	 * 다다익선 할인 금액 조회
-	 * @param Order
+	 * @param param
 	 * param.cartSqArr[] : 필수
 	 * @return String
 	 * @author xodud1202
@@ -326,8 +336,6 @@ public class TsfCartService {
 
 		// 장바구니 등록 다다익선 일련번호 지정
 		List<Integer> applySq 		= new ArrayList<Integer>();
-		List<Integer> qtyApplySq	= new ArrayList<Integer>();
-		List<Integer> amtApplySq 	= new ArrayList<Integer>();
 		
 		for(Order tmtbApply : tmtbApplyList) {
 			if(TscConstants.GoodsGb.BASE.value().equals(tmtbApply.getQtyGoodsGb()) || TscConstants.GoodsGb.BASE.value().equals(tmtbApply.getAmtGoodsGb())) {
@@ -503,7 +511,7 @@ public class TsfCartService {
 	/**
 	 * 장바구니 배송단위별 상품 정보 조회
 	 *
-	 * @param Order
+	 * @param cartGoodsList
 	 * @author jsh77b
 	 * @since 2021. 02. 02
 	 */
@@ -563,7 +571,7 @@ public class TsfCartService {
 				if (param.getDelvFeeCd().equals(delv.getDelvFeeCd())) {
 					compCnt++;
 					if("N".equals(param.getSoldoutYn())) {
-						delv.setCompSumPrice(delv.getCompSumPrice() + param.getCurrPrice());
+						delv.setCompSumPrice(delv.getCompSumPrice() + param.getTmtbDcAmt());
 					}
 
 					if (compCnt == 1) {
@@ -645,6 +653,7 @@ public class TsfCartService {
 	public void deleteCart(Cart param) {
 		cartDao.deleteCart(param);
 	}
+
 	/**
 	 * 로그인 후 장바구니 Update
 	 * 		회원 로그인 후 호출됨으로 세션 정보 있음
@@ -688,4 +697,170 @@ public class TsfCartService {
 		}
 	}
 
+	public Cart getCartGoodsInfo(Cart param) {
+		// Collection<Cart> result = new ArrayList<Cart>();
+		/* cart.add(cartDao.selectCartGoodsInfo(param)); */
+
+		// 장바구니 상품 마스터 정보 조회
+		Cart cart = cartDao.selectCartGoodsInfo(param);
+
+		// 세트 상품일 경우
+		if(TscConstants.GoodsType.SET.value().equals(cart.getGoodsType())) {
+			cart.setCartCompsList(cartDao.selectCartSetGoodsInfo(cart));
+			for(Cart comp : cart.getCartCompsList()) {
+				comp.setCartSq(cart.getCartSq());
+				comp.setCartColorList(cartDao.selectCartGoodsColorList(comp));
+				for(Cart color : comp.getCartColorList()) {
+					color.setCartSq(comp.getCartSq());
+					color.setCartSizeList(cartDao.selectCartGoodsSizeList(color));
+				}
+			}
+			cart.setCartImgList(cartDao.selectCartDelvGoodsOptionImgList(cart));		// TB_GOODS.MAIN_COLOR_CD의 이미지를 가져옴.
+		} else {	// 일반, DEAL 상품일 경우
+			cart.setCartCompsList(new ArrayList<Cart>());
+			cart.getCartCompsList().add(new Cart());
+
+			for(Cart comp : cart.getCartCompsList()) {
+				if("Y".equals(cart.getSelfGoodsYn())) {
+					comp.setCartColorList(cartDao.selectCartGoodsColorList(cart));
+
+					if("Y".equals(cart.getSelfGoodsYn())) {		// 자사 상품은 TB_GOODS_IMG.COLOR_CD = TB_OPTION.OPT_CD1
+						for(Cart color : comp.getCartColorList()) {
+							color.setCartSq(cart.getCartSq());
+							color.setCartImgList(cartDao.selectCartSelfGoodsOptionImgList(color));
+							color.setCartSizeList(cartDao.selectCartGoodsSizeList(color));
+						}
+					}
+				} else {
+					comp.setCartColorList(cartDao.selectCartGoodsSizeList(cart));
+				}
+			}
+
+			if(!"Y".equals(cart.getSelfGoodsYn())) {			// 입점 상품은 TB_GOODS_IMG.COLOR_CD = TB_GOODS.MAIN_COLOR_CD
+				cart.setCartImgList(cartDao.selectCartDelvGoodsOptionImgList(cart));
+			}
+		}
+
+		cart.setImgPath(env.getProperty("upload.goods.view"));
+
+		return cart;
+	}
+
+	@Transactional("shopTxnManager")
+	public void updateCartOption(Cart param) {
+		param.setJsessionId(TsfSession.getSessionId());
+		param.setFrontGb(TsfSession.getFrontGb());
+
+		if(TsfSession.isLogin()) {
+			param.setCustNo(TsfSession.getInfo().getCustNo());
+			param.setRegNo(param.getCustNo());
+			param.setUpdNo(param.getCustNo());
+		} else {
+			param.setCustNo(0);
+			param.setRegNo(0);
+			param.setUpdNo(0);
+		}
+
+		// 재고 체크
+		Goods goods = new Goods();
+		goods.setGoodsCd(param.getGoodsCd());
+		goods.setFrontGb(TsfSession.getFrontGb());
+
+		goods = goodsService.getGoodsInfo(goods);
+
+		if (goods == null) {
+			throw new IllegalArgumentException("상품 정보가 존재하지 않습니다.");
+		}
+		if (TscConstants.GoodsStat.SOLDOUT.value().equals(goods.getGoodsStat())) {
+			throw new IllegalArgumentException("품절입니다.");
+		}
+		
+		// 현재 장바구니 수량
+		int goodsCartCnt = cartDao.getHasGoodsCartCnt(param);
+
+		if (param.getGoodsQty() + goodsCartCnt > goods.getDayMaxOrdQty()) {
+			throw new IllegalArgumentException("1일 구매한도 수량이 초과되었습니다.");
+		}
+
+		// 구성 상품 재고 확인
+		for(int i = 0 ; i < param.getCartDtlSqArr().length ; i++) {
+			// 상품 재고 확인
+			GoodsStock checkParam = new GoodsStock();
+			checkParam.setGoodsCd(param.getGoodsCd());
+			checkParam.setItemCd(param.getItemCds()[i]);
+			checkParam.setOptCd(param.getOptCds()[i]);
+			checkParam.setGoodsQty(param.getGoodsQty());
+			checkParam.setGoodsType(param.getGoodsType());
+			String stockResult = goodsService.getCheckStock(checkParam);
+
+			if (!"SUCCESS".equals(stockResult)) {
+				throw new IllegalArgumentException(stockResult);
+			}
+		}
+
+		StringBuilder sb = new StringBuilder();
+		if(TscConstants.GoodsType.SET.value().equals(param.getGoodsType())) {
+			// 장바구니 보유 CART_SQ 쿼리
+			for(int i = 0 ; i < param.getCartDtlSqArr().length ; i++) {
+				sb.append("SELECT CD.CART_SQ \n FROM TB_CART C \n INNER JOIN TB_CART_DETAIL CD \n ON C.CART_SQ = CD.CART_SQ \n WHERE C.CUST_NO = ");
+				// TODO 로그인 정보 확인
+				if (param.getCustNo() == 0) {
+					sb.append(param.getCustNo()).append("\n AND JSESSION_ID = '").append(param.getJsessionId()).append("'");
+				} else {
+					sb.append(param.getCustNo());
+				}
+				sb.append("\n AND CD.ITEM_CD = '").append(param.getItemCds()[i]).append("' \n AND CD.OPT_CD = '").append(param.getOptCds()[i]).append("'");
+				if (i < param.getCartDtlSqArr().length - 1) {
+					sb.append("\n UNION ALL \n");
+				}
+			}
+
+			param.setItemCdSql(sb.toString());
+			param.setCartGb(TscConstants.CartGb.CART.value());
+
+			// 장바구니내 같은 상품 확인
+			param.setNotCartSq(param.getCartSq());				// 수정 장바구니 번호 제외
+			Collection<Cart> cartList = cartDao.selectHasSetItemCartList(param);
+
+			// 동일 상품 존재시
+			if (cartList != null && cartList.size() > 0) {		// 장바구니 기존재
+				if (cartList.size() > 1) {						// 장바구니 조회 결과 이상시 insert or select 수정 필요
+					throw new IllegalArgumentException("장바구니 조회에 실패하였습니다. 관리자에게 문의해주세요.");
+				} else {
+					// 기존 존재 장바구니 UPDATE
+					Cart cart = new Cart();
+					cart.setCartSq(cartList.iterator().next().getCartSq());
+					cart.setGoodsQty(param.getGoodsQty());
+					cart.setAfLinkCd(param.getAfLinkCd());
+					cart.setIthrCd(param.getIthrCd());
+					cart.setContentsLoc(param.getContentsLoc());
+					cart.setPlanDtlSq(param.getPlanDtlSq());
+					cart.setUpdNo(param.getUpdNo());
+					cart.setGoodsCd(param.getGoodsCd());
+					cart.setCustNo(param.getCustNo());
+					cart.setRegNo(param.getRegNo());
+
+					cartDao.updateCartInfo(cart);               // 장바구니 정보 수정
+					cartDao.insertCartHst(cart);                // 장바구니 수정 이력 저장
+
+					// 장바구니 삭제
+					int[] cartSqArr = {param.getCartSq()};
+					param.setCartSqArr(cartSqArr);
+					cartDao.deleteCart(param);
+					cartDao.deleteCartDetail(param);
+				}
+			} else {		// 동일 상품 없을 시 UPDATE
+				cartDao.updateCart(param);						// 장바구니 마스터 정보 저장
+				cartDao.insertCartHst(param);                   // 장바구니 이력 정보 저장
+				for(int i = 0 ; i < param.getCartDtlSqArr().length ; i++) {
+					param.setItemCd(param.getItemCds()[i]);
+					param.setCartDtlSq(param.getCartDtlSqArr()[i]);
+					param.setOptCd(param.getOptCds()[i]);
+
+					cartDao.updateCartDetail(param);		// 장바구니 상세 저장
+					cartDao.insertCartDetailHst(param);         // 장바구니 상세 이력 저장
+				}
+			}
+		}
+	}
 }

+ 3 - 3
src/main/java/com/style24/front/biz/service/TsfGoodsService.java

@@ -221,7 +221,7 @@ public class TsfGoodsService {
 
 	/**
 	 * 상품 재고 체크
-	 * @param goodsStock
+	 * @param param
 	 * goodsCd   (원상품코드) 필수
 	 * goodsType (상품타입) 필수
 	 * optCd     (옵션코드) 필수
@@ -242,7 +242,7 @@ public class TsfGoodsService {
 		}
 
 		if(param.getGoodsType().equals(TscConstants.GoodsType.SET.value())) {		// 세트상품이면 구성 상품코드로 조회
-			GoodsStock stockCheck = new GoodsStock();		// 재고 조회 결과
+			GoodsStock stockCheck = new GoodsStock();								// 재고 조회 결과
 			stockCheck.setGoodsCd(param.getItemCd());
 			stockCheck.setOptCd(param.getOptCd());
 
@@ -260,7 +260,7 @@ public class TsfGoodsService {
 				return param.getItemCd() + "의 재고가 충분하지 않습니다.";
 			}
 		} else {
-			GoodsStock stockCheck = new GoodsStock();		// 재고 조회 결과
+			GoodsStock stockCheck = new GoodsStock();								// 재고 조회 결과
 			stockCheck.setGoodsCd(param.getGoodsCd());
 			stockCheck.setOptCd(param.getOptCd());
 

+ 34 - 2
src/main/java/com/style24/front/biz/web/TsfCartController.java

@@ -4,6 +4,7 @@ import java.text.SimpleDateFormat;
 import java.util.Collection;
 import java.util.Date;
 
+import com.gagaframework.web.rest.server.GagaResponse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Controller;
@@ -17,6 +18,7 @@ import org.springframework.web.servlet.ModelAndView;
 
 import com.gagaframework.web.parameter.GagaMap;
 import com.style24.core.biz.service.TscOrderService;
+import com.style24.core.support.env.TscConstants;
 import com.style24.core.support.message.TscMessageByLocale;
 import com.style24.front.biz.service.TsfCartService;
 import com.style24.front.biz.service.TsfCouponService;
@@ -161,8 +163,6 @@ public class TsfCartController extends TsfBaseController {
 	/**
 	 * 장바구니 삭제
 	 * @param param
-	 * rdCpnNm : 시리얼쿠폰명
-	 * cartSqArr[] : 장바구니 번호 배열
 	 * @return GagaMap
 	 * @author xodud1202
 	 * @since 2021. 02. 23
@@ -173,4 +173,36 @@ public class TsfCartController extends TsfBaseController {
 		cartService.deleteCart(param);
 		return new GagaMap();
 	}
+
+	/**
+	 * 장바구니 삭제
+	 * @param param
+	 * @return String
+	 * @author xodud1202
+	 * @since 2021. 02. 23
+	 */
+	// @ResponseBody
+	@PostMapping("/goods/info")
+	public String getCartGoodsInfo(Cart param, Model model) {
+		Cart cart = cartService.getCartGoodsInfo(param);
+
+		model.addAttribute("cart", cart);
+		model.addAttribute("setType", TscConstants.GoodsType.SET.value());
+		return super.getDeviceViewName("cart/cartChangeOptionPopup");
+	}
+
+	/**
+	 * 장바구니 옵션 변경
+	 * @param param
+	 * @return GagaMap
+	 * @author xodud1202
+	 * @since 2021. 02. 23
+	 */
+	@ResponseBody
+	@PostMapping("/change/option")
+	public GagaResponse updateCartOption(@RequestBody Cart param) {
+		log.info("CHECK INFO >> {} / {} / {} / {}", param.getCartSq(), param.getCartDtlSqArr().toString(), param.getOptCds().toString(), param.getGoodsQty());
+		cartService.updateCartOption(param);
+		return super.ok(message.getMessage("SUCC_0001"));
+	}
 }

+ 29 - 5
src/main/java/com/style24/persistence/domain/Cart.java

@@ -1,5 +1,7 @@
 package com.style24.persistence.domain;
 
+import java.util.Collection;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.style24.persistence.TscBaseDomain;
 
@@ -15,7 +17,10 @@ import lombok.Data;
 @Data
 public class Cart extends TscBaseDomain {
 	// 장바구니 정보
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private int[] cartSqArr;		// 장바구니 일련번호 배열 (일시품절제외 조회)
 	private int cartSq;				// 장바구니 번호
+	private int notCartSq;			// 제외 장바구니 번호
 	private int cartDtlSq;			// 장바구니 상세 번호
 	private int custNo;				// 고객번호
 	private int planDtlSq;			// 기획전상세번호
@@ -30,8 +35,17 @@ public class Cart extends TscBaseDomain {
 	private String ithrCd;			// 유입경로(공통코드 G027)
 	private String contentsLoc;		// 컨텐츠위치(공통코드G028)
 	private String dealGoodsCd;		// 딜상품코드
+	private String cartOptCd1;		// 장바구니 컬러 옵션
+	private String cartOptCd;		// 장바구니 옵션
+	private String cartColorNm;		// 장바구니 컬러명
 
 	// 장바구니 상세 정보
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private int[] cartDtlSqArr;		// 장바구니 일련번호 배열 (일시품절제외 조회)
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] optCds;		// 옵션코드
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] itemCds;		// 장바구니 단품코드
 	private String itemCd;			// 단품코드(상품). 일반상품과 딜상품은 상품코드와 동일
 	private String optCd;			// 옵션코드
 	private String optCd1;			// 옵션코드1
@@ -45,14 +59,24 @@ public class Cart extends TscBaseDomain {
 	private String goodsType;		// 상품 타입
 	private String compsGoodsCd;	// 세트 구성상품 코드
 	private String itemCdSql;		// 상품 조회 쿼리문
+	private String selfGoodsYn;		// 자사상품여부
+	private String mainColorCd;		// 상품 메인 컬러
+	private String brandEnm;		// 브랜드 영문명
+	private String brandKnm;		// 브랜드 국문명
+	private String goodsNm;			// 상품명
+	private String sysImgNm;		// 이미지명
+	private String colorNm;			// 컬러명
+	private String imgPath;			// 상품 이미지 경로
+	private String soldoutYn;		// 옵션
+	private String frontGb;			// 접속 디바이스 정보
 
-	// 다다익선 정보
-
-	// 즉시할인쿠폰 정보
+	// 장바구니 상품 정보 리스트
+	Collection<Cart> cartCompsList;		// 장바구니 상품 구성 상품리스트
+	Collection<Cart> cartColorList;		// 장바구니 상품 컬러리스트
+	Collection<Cart> cartSizeList;		// 장바구니 상품 사이즈리스트
+	Collection<GoodsImg> cartImgList;	// 장바구니 상품 이미지 리스트
 
 	// 시리얼쿠폰 정보
-	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
-	private int[] cartSqArr;		// 장바구니 일련번호 배열 (일시품절제외 조회)
 	private String cpnNm;
 	private String rdCpnNm;
 	private String usedDt;

+ 5 - 5
src/main/java/com/style24/persistence/domain/GoodsStock.java

@@ -14,22 +14,22 @@ import lombok.Data;
 @Data
 public class GoodsStock extends TscBaseDomain {
 	// 재고 정보
+	private Integer productNo;		// ProductNo(WMS)
 	private String goodsCd;			// 상품번호
 	private String optCd;			// 옵션코드
 	private String optCd1;			// 옵션코드1(자사 : 컬러, 입점 : 옵션명1)
 	private String optCd2;			// 옵션코드1(자사 : 사이즈, 입점 : 옵션명2)
-	private Integer skuModelNo;		// SKUModelNo(WMS)
-	private Integer productNo;		// ProductNo(WMS)
-	private Integer productCode;	// ProductCode(WMS)
+	private String skuModelNo;		// SKUModelNo(WMS)
+	private String productCode;		// ProductCode(WMS)
+	private String soldoutYn;		// 품절여부
 	private int currStockQty;		// 가용재고
 	private int addPrice;			// 추가금액
-	private String soldoutYn;		// 품절여부
 	private int dispOrd;			// 표시순서
 
 	private String itemCd;			// 구성상품코드
 	private String goodsType;		// 상품구분
+	private String sysImgNm;		// 상품이미지 명
 	private int goodsQty;			// 안전재고
-	private String sysImgNm;		// 상품이미지
 	private int stockQty;			// 상품 재고
 
 }

+ 464 - 269
src/main/java/com/style24/persistence/mybatis/shop/TsfCart.xml

@@ -10,7 +10,7 @@
 
 	<!-- 페이징을 위한 select절 하단 -->
 	<sql id="selectForPagingFooter">
-		       ) ORIGINAL
+			   ) ORIGINAL
 		WHERE  NUMB BETWEEN #{pageable.startRow} AND #{pageable.endRow}
 	</sql>
 	
@@ -31,28 +31,35 @@
 		   AND C.CUST_NO = #{custNo}
 			</otherwise>
 		</choose>
+		<if test="cartSq != null and cartSq != 0">
+			AND C.CART_SQ <![CDATA[ <> ]]> #{cartSq}
+		</if>
 	</select>
 
 	<!-- 장바구니 등록 세트 상품 확인 -->
-	<select id="selectHasSetItemCartList" parameterType="Cart" resultType="int">
+	<select id="selectHasSetItemCartList" parameterType="Cart" resultType="Cart">
 		/* TsfCart.selectHasSetItemCartList : 장바구니 등록 세트 상품 확인 */
 		SELECT CART_SQ
-		  FROM (SELECT COUNT(1) AS CNT
+		FROM   (SELECT COUNT(1) AS CNT
 					 , CART_SQ
 					 , #{goodsCd} AS GOODS_CD
-				  FROM (
-					  ${itemCdSql}
-				       ) A
-				 WHERE 1=1
-				 GROUP BY CART_SQ ) AS A
-		  INNER JOIN (SELECT GC.GOODS_CD
+				FROM   (
+						${itemCdSql}
+					   ) A
+				WHERE  1=1
+				GROUP  BY CART_SQ ) AS A
+		INNER  JOIN ( SELECT GC.GOODS_CD
 						   , COUNT(1) AS CNT
-						FROM TB_GOODS_COMPOSE GC
-					   WHERE GC.GOODS_CD = #{goodsCd}
-						 AND GC.USE_YN = 'Y'
-					   GROUP BY GC.GOODS_CD ) B
-			 ON A.GOODS_CD = B.GOODS_CD
-			AND A.CNT = B.CNT
+					  FROM   TB_GOODS_COMPOSE GC
+					  WHERE  GC.GOODS_CD = #{goodsCd}
+					  AND    GC.USE_YN = 'Y'
+					  GROUP  BY GC.GOODS_CD ) B
+		ON     A.GOODS_CD = B.GOODS_CD
+		AND    A.CNT = B.CNT
+		WHERE  1=1
+		<if test="notCartSq != null and notCartSq > 0">
+		AND    A.CART_SQ <![CDATA[ <> ]]> #{notCartSq}
+		</if>
 	</select>
 
 	<!-- 장바구니 등록 일반 or 딜 상품 확인 -->
@@ -70,24 +77,24 @@
 	<insert id="insertCartInfo" parameterType="Cart" keyProperty="cartSq">
 		/* TsfCart.insertCartInfo : 장바구니 신규 등록 */
 		INSERT INTO TB_CART (
-		          CART_GB
-		        , GOODS_CD
-		        , GOODS_QTY
-		        , DEAL_GOODS_CD
-		        , JSESSION_ID
-		        , CUST_NO
-		        , AF_LINK_CD
-		        , ITHR_CD
-		        , CONTENTS_LOC
-		        , PLAN_DTL_SQ
-		        , REG_NO
-		        , REG_DT
-		        , UPD_NO
-		        , UPD_DT)
+				  CART_GB
+				, GOODS_CD
+				, GOODS_QTY
+				, DEAL_GOODS_CD
+				, JSESSION_ID
+				, CUST_NO
+				, AF_LINK_CD
+				, ITHR_CD
+				, CONTENTS_LOC
+				, PLAN_DTL_SQ
+				, REG_NO
+				, REG_DT
+				, UPD_NO
+				, UPD_DT)
 		SELECT #{cartGb}
 			 , GOODS_CD
-		     , #{goodsQty}
-		     , #{dealGoodsCd}
+			 , #{goodsQty}
+			 , #{dealGoodsCd}
 			 , #{jsessionId}
 			 , #{custNo}
 			 , #{afLinkCd}
@@ -95,7 +102,7 @@
 			 , #{contentsLoc}
 			 , #{planDtlSq}
 			 , #{regNo}
-		     , CURRENT_TIMESTAMP
+			 , CURRENT_TIMESTAMP
 			 , #{updNo}
 			 , CURRENT_TIMESTAMP
 		  FROM TB_GOODS
@@ -106,30 +113,30 @@
 	<insert id="insertCartDetailInfo" parameterType="Cart" keyProperty="cartDtlSq">
 		/* TsfCart.insertCartDetailInfo : 장바구니 상세 신규 등록 */
 		INSERT INTO TB_CART_DETAIL (
-		          CART_SQ
-		        , ITEM_CD
-		        , OPT_CD
-		        , OPT_CD1
-		        , OPT_CD2
-		        , SKU_MODEL_NO
-		        , PRODUCT_NO
-		        , PRODUCT_CODE
-		        , ITEM_QTY
-		        , DISP_ORD
-		        , REG_NO
-		        , REG_DT
-		        , UPD_NO
-		        , UPD_DT
+				  CART_SQ
+				, ITEM_CD
+				, OPT_CD
+				, OPT_CD1
+				, OPT_CD2
+				, SKU_MODEL_NO
+				, PRODUCT_NO
+				, PRODUCT_CODE
+				, ITEM_QTY
+				, DISP_ORD
+				, REG_NO
+				, REG_DT
+				, UPD_NO
+				, UPD_DT
 		)
 		SELECT #{cartSq}
 			 , IFNULL(GC.COMPS_GOODS_CD, G.GOODS_CD)		 <!-- 세트 상품이 아니면 원상품코드 -->
-		     , O.OPT_CD
-		     , O.OPT_CD1
-		     , O.OPT_CD2
-		     , O.SKU_MODEL_NO
-		     , O.PRODUCT_NO
-		     , O.PRODUCT_CODE
-		     , IFNULL(GC.QTY, 1)
+			 , O.OPT_CD
+			 , O.OPT_CD1
+			 , O.OPT_CD2
+			 , O.SKU_MODEL_NO
+			 , O.PRODUCT_NO
+			 , O.PRODUCT_CODE
+			 , IFNULL(GC.QTY, 1)
 			 , IFNULL(GC.DISP_ORD, 1)						<!-- TB_GOODS_COMPOSE DISP_ORD 따라 CART_DETAIL도 동일하게 진행 -->
 			 , #{regNo}
 			 , CURRENT_TIMESTAMP
@@ -137,9 +144,9 @@
 			 , CURRENT_TIMESTAMP
 		  FROM TB_GOODS G
 		 INNER JOIN TB_OPTION O
-		    ON G.GOODS_CD = O.GOODS_CD
+			ON G.GOODS_CD = O.GOODS_CD
 		  LEFT OUTER JOIN TB_GOODS_COMPOSE GC		<!-- 일반 상품 제외 확인 필요하여 join -->
-		    ON GC.COMPS_GOODS_CD = G.GOODS_CD
+			ON GC.COMPS_GOODS_CD = G.GOODS_CD
 		   AND GC.GOODS_CD = #{goodsCd}
 		   AND GC.COMPS_GOODS_CD = #{itemCd}
 		   AND GC.GOODS_TYPE = 'G056_S'				<!-- 세트 상품만 구성 상품 코드로 올림. deal 상품은 원상품코드로 올려야함 -->
@@ -156,21 +163,54 @@
 		 ORDER BY GC.DISP_ORD
 	</insert>
 
-	<!-- 장바구니 상세 UPDATE -->
+	<!-- 장바구니 UPDATE -->
 	<update id="updateCartInfo" parameterType="Cart">
-		/* TsfCart.updateCartInfo : 장바구니 상세 UPDATE */
+		/* TsfCart.updateCartInfo : 장바구니 UPDATE */
 		UPDATE TB_CART SET
 			  GOODS_QTY = GOODS_QTY + #{goodsQty}
-		    , DEAL_GOODS_CD = #{dealGoodsCd}
-		    , AF_LINK_CD = #{afLinkCd}
-		    , ITHR_CD = #{ithrCd}
-		    , CONTENTS_LOC = #{contentsLoc}
-		    , PLAN_DTL_SQ = #{planDtlSq}
+			, DEAL_GOODS_CD = #{dealGoodsCd}
+			, AF_LINK_CD = #{afLinkCd}
+			, ITHR_CD = #{ithrCd}
+			, CONTENTS_LOC = #{contentsLoc}
+			, PLAN_DTL_SQ = #{planDtlSq}
 			, UPD_NO = #{updNo}
 			, UPD_DT = CURRENT_TIMESTAMP
 		WHERE CART_SQ = #{cartSq}
-		  AND GOODS_CD = #{goodsCd}
-		  AND CUST_NO = #{custNo}
+		AND   GOODS_CD = #{goodsCd}
+		AND   CUST_NO = #{custNo}
+	</update>
+
+	<!-- 장바구니 UPDATE -->
+	<update id="updateCart" parameterType="Cart">
+		/* TsfCart.updateCart : 장바구니 UPDATE */
+		UPDATE TB_CART SET
+			  GOODS_QTY = #{goodsQty}
+			, DEAL_GOODS_CD = #{dealGoodsCd}
+			, AF_LINK_CD = #{afLinkCd}
+			, ITHR_CD = #{ithrCd}
+			, CONTENTS_LOC = #{contentsLoc}
+			, PLAN_DTL_SQ = #{planDtlSq}
+			, UPD_NO = #{updNo}
+			, UPD_DT = CURRENT_TIMESTAMP
+		WHERE CART_SQ = #{cartSq}
+		AND   GOODS_CD = #{goodsCd}
+		AND   CUST_NO = #{custNo}
+	</update>
+
+	<!-- 장바구니 상세 UPDATE -->
+	<update id="updateCartDetail" parameterType="Cart">
+		/* TsfCart.updateCartDetail : 장바구니 상세 UPDATE */
+		UPDATE TB_CART_DETAIL A, (SELECT GOODS_CD, OPT_CD1, OPT_CD2, SKU_MODEL_NO, PRODUCT_NO, PRODUCT_CODE FROM TB_OPTION WHERE GOODS_CD = #{itemCd} AND OPT_CD = #{optCd}) B SET
+			  A.OPT_CD = #{optCd}
+			, A.OPT_CD1 = B.OPT_CD1
+			, A.OPT_CD2 = B.OPT_CD2
+			, A.SKU_MODEL_NO = B.SKU_MODEL_NO
+			, A.PRODUCT_NO = B.PRODUCT_NO
+			, A.PRODUCT_CODE = B.PRODUCT_CODE
+			, A.UPD_NO = #{updNo}
+			, A.UPD_DT = CURRENT_TIMESTAMP
+		WHERE A.CART_DTL_SQ = #{cartDtlSq}
+		  AND A.ITEM_CD = B.GOODS_CD
 	</update>
 
 	<!-- 장바구니 이력 정보 저장 -->
@@ -193,7 +233,7 @@
 		SELECT C.CART_SQ
 			 , C.CART_GB
 			 , C.GOODS_CD
-		     , C.GOODS_QTY
+			 , C.GOODS_QTY
 			 , C.DEAL_GOODS_CD
 			 , IFNULL(#{ordNo}, 0) AS ORD_NO
 			 , C.CUST_NO
@@ -283,82 +323,82 @@
 								  , COUNT(1) AS TMTB_CNT
 							 FROM   TB_TMTB_APPLY_GOODS TAG
 							 INNER  JOIN TB_CART C
-							 ON     TAG.GOODS_CD = C.GOODS_CD
+							 ON	 TAG.GOODS_CD = C.GOODS_CD
 							 WHERE  TAG.DEL_YN = 'N'
 							<if test="cartSqArr != null and cartSqArr.length > 0">
-							 AND    C.CART_SQ IN
+							 AND	C.CART_SQ IN
 								<foreach collection="cartSqArr" item="item" index="index"  open="(" close=")" separator=",">
 										#{item}
 								</foreach>
 							</if>
 							 GROUP  BY TAG.TMTB_SQ) AS TAG2
-				ON     TAG.TMTB_SQ = TAG2.TMTB_SQ
+				ON	 TAG.TMTB_SQ = TAG2.TMTB_SQ
 				INNER  JOIN TB_TMTB T
 				ON	   T.TMTB_SQ = TAG.TMTB_SQ
 				AND	   T.TMTB_STAT = 'G232_11' /*진행*/
 				INNER  JOIN TB_GOODS G
 				ON	   C.GOODS_CD = G.GOODS_CD
 				INNER  JOIN TB_CART_DETAIL CD
-				ON     C.CART_SQ = CD.CART_SQ
+				ON	 C.CART_SQ = CD.CART_SQ
 				INNER  JOIN (SELECT TAG.TMTB_SQ
 								  , SUM((FN_GET_APPLY_CPN1_PRICE(C.GOODS_CD, #{frontGb}) + IFNULL(OP.ADD_PRICE, 0)) * C.GOODS_QTY) AS TMTB_SUM_AMT
 								  , SUM(C.GOODS_QTY) AS TMTB_SUM_QTY
 							 FROM   TB_TMTB_APPLY_GOODS TAG
 							 INNER  JOIN TB_CART C
-							 ON     TAG.GOODS_CD = C.GOODS_CD
+							 ON	 TAG.GOODS_CD = C.GOODS_CD
 							 INNER  JOIN TB_GOODS G
-							 ON     C.GOODS_CD = G.GOODS_CD
+							 ON	 C.GOODS_CD = G.GOODS_CD
 							 INNER  JOIN TB_TMTB T
-							 ON     TAG.TMTB_SQ = T.TMTB_SQ
+							 ON	 TAG.TMTB_SQ = T.TMTB_SQ
 							 LEFT   OUTER JOIN TB_TMTB_APPLY_GOODS NOT_APPLY
-							 ON     TAG.GOODS_CD = NOT_APPLY.GOODS_CD
-							 AND    TAG.TMTB_SQ = NOT_APPLY.TMTB_SQ
-							 AND    NOT_APPLY.GOODS_GB = 'G800_30'   /* 제외상품 */
+							 ON	 TAG.GOODS_CD = NOT_APPLY.GOODS_CD
+							 AND	TAG.TMTB_SQ = NOT_APPLY.TMTB_SQ
+							 AND	NOT_APPLY.GOODS_GB = 'G800_30'   /* 제외상품 */
 							 LEFT   OUTER JOIN (SELECT OP.ADD_PRICE
 							 						 , C.CART_SQ
 							 					FROM   TB_CART C
 							 					INNER  JOIN TB_CART_DETAIL CD
-							 					ON     C.CART_SQ = CD.CART_SQ
+							 					ON	 C.CART_SQ = CD.CART_SQ
 												 INNER  JOIN TB_OPTION OP
-												 ON     C.GOODS_CD = OP.GOODS_CD
-												 AND    CD.OPT_CD = OP.OPT_CD
+												 ON	 C.GOODS_CD = OP.GOODS_CD
+												 AND	CD.OPT_CD = OP.OPT_CD
 												 WHERE  1=1) OP
-							 ON     C.CART_SQ = OP.CART_SQ
+							 ON	 C.CART_SQ = OP.CART_SQ
 							 WHERE  1=1
-							 AND    NOT_APPLY.TMTB_SQ IS NULL
-							 AND    T.DEL_YN = 'N'
-							 AND    TAG.DEL_YN = 'N'
-							 AND    C.CART_GB = 'G026_BC'
-							 AND    G.GOODS_STAT = 'G008_90'
-							 AND    G.SELF_MALL_YN = 'Y'
+							 AND	NOT_APPLY.TMTB_SQ IS NULL
+							 AND	T.DEL_YN = 'N'
+							 AND	TAG.DEL_YN = 'N'
+							 AND	C.CART_GB = 'G026_BC'
+							 AND	G.GOODS_STAT = 'G008_90'
+							 AND	G.SELF_MALL_YN = 'Y'
 							 <if test="cartSqArr != null and cartSqArr.length > 0">
-							 	AND    C.CART_SQ IN
+							 	AND	C.CART_SQ IN
 							 	<foreach collection="cartSqArr" item="item" index="index"  open="(" close=")" separator=",">
 							 		#{item}
 							 	</foreach>
 							 </if>
 							 GROUP BY TAG.TMTB_SQ
 					   ) SUM_DATA
-				ON     T.TMTB_SQ = SUM_DATA.TMTB_SQ
+				ON	 T.TMTB_SQ = SUM_DATA.TMTB_SQ
 				LEFT   JOIN TB_OPTION OP
-				ON     CD.ITEM_CD = OP.GOODS_CD
-				AND    CD.OPT_CD1 = OP.OPT_CD1
-				AND    CD.OPT_CD2 = OP.OPT_CD2
+				ON	 CD.ITEM_CD = OP.GOODS_CD
+				AND	CD.OPT_CD1 = OP.OPT_CD1
+				AND	CD.OPT_CD2 = OP.OPT_CD2
 				LEFT   OUTER JOIN TB_TMTB_APPLY_GOODS NOT_APPLY
-				ON     T.TMTB_SQ = NOT_APPLY.TMTB_SQ
-				AND    C.GOODS_CD = NOT_APPLY.GOODS_CD
-				AND    NOT_APPLY.GOODS_GB = 'G800_30'   /* 제외상품 */
-				AND    NOT_APPLY.DEL_YN = 'N'
+				ON	 T.TMTB_SQ = NOT_APPLY.TMTB_SQ
+				AND	C.GOODS_CD = NOT_APPLY.GOODS_CD
+				AND	NOT_APPLY.GOODS_GB = 'G800_30'   /* 제외상품 */
+				AND	NOT_APPLY.DEL_YN = 'N'
 				WHERE  1=1
-				AND    NOT_APPLY.TMTB_SQ IS NULL
-				AND    T.DEL_YN = 'N'
-				AND    T.TMTB_ST_DT <![CDATA[<=]]> NOW()
-				AND    T.TMTB_ED_DT >= NOW()
-				AND    C.CART_GB = 'G026_BC'
-				AND    G.GOODS_STAT = 'G008_90'
-				AND    G.SELF_MALL_YN = 'Y'
+				AND	NOT_APPLY.TMTB_SQ IS NULL
+				AND	T.DEL_YN = 'N'
+				AND	T.TMTB_ST_DT <![CDATA[<=]]> NOW()
+				AND	T.TMTB_ED_DT >= NOW()
+				AND	C.CART_GB = 'G026_BC'
+				AND	G.GOODS_STAT = 'G008_90'
+				AND	G.SELF_MALL_YN = 'Y'
 				<if test="cartSqArr != null and cartSqArr.length > 0">
-				AND    C.CART_SQ IN
+				AND	C.CART_SQ IN
 					<foreach collection="cartSqArr" item="item" index="index"  open="(" close=")" separator=",">
 						#{item}
 					</foreach>
@@ -381,41 +421,41 @@
 			 , SUM(C.GOODS_QTY) AS TMTB_SUM_QTY
 		FROM   TB_TMTB_APPLY_GOODS TAG
 		INNER  JOIN TB_CART C
-		ON     TAG.GOODS_CD = C.GOODS_CD
+		ON	 TAG.GOODS_CD = C.GOODS_CD
 		INNER  JOIN TB_GOODS G
-		ON     C.GOODS_CD = G.GOODS_CD
+		ON	 C.GOODS_CD = G.GOODS_CD
 		INNER  JOIN TB_TMTB T
-		ON     TAG.TMTB_SQ = T.TMTB_SQ
+		ON	 TAG.TMTB_SQ = T.TMTB_SQ
 		LEFT   OUTER JOIN TB_TMTB_APPLY_GOODS NOT_APPLY
-		ON     TAG.GOODS_CD = NOT_APPLY.GOODS_CD
-		AND    TAG.TMTB_SQ = NOT_APPLY.TMTB_SQ
-		AND    NOT_APPLY.GOODS_GB = 'G800_30'   /* 제외상품 */
+		ON	 TAG.GOODS_CD = NOT_APPLY.GOODS_CD
+		AND	TAG.TMTB_SQ = NOT_APPLY.TMTB_SQ
+		AND	NOT_APPLY.GOODS_GB = 'G800_30'   /* 제외상품 */
 		LEFT   OUTER JOIN (SELECT OP.ADD_PRICE
 								, C.CART_SQ
-		                   FROM   TB_CART C
+						   FROM   TB_CART C
 						   INNER  JOIN TB_CART_DETAIL CD
-		                   ON     C.CART_SQ = CD.CART_SQ
+						   ON	 C.CART_SQ = CD.CART_SQ
 						   INNER  JOIN TB_OPTION OP
-						   ON     C.GOODS_CD = OP.GOODS_CD
-						   AND    CD.OPT_CD = OP.OPT_CD
-		                   WHERE  1=1
-		       ) OP
-		ON     C.CART_SQ = OP.CART_SQ
+						   ON	 C.GOODS_CD = OP.GOODS_CD
+						   AND	CD.OPT_CD = OP.OPT_CD
+						   WHERE  1=1
+			   ) OP
+		ON	 C.CART_SQ = OP.CART_SQ
 		WHERE  1=1
-		AND    NOT_APPLY.TMTB_SQ IS NULL
-		AND    T.DEL_YN = 'N'
-		AND    TAG.DEL_YN = 'N'
-		AND    C.CART_GB = 'G026_BC'
-		AND    G.GOODS_STAT = 'G008_90'
-		AND    G.SELF_MALL_YN = 'Y'
+		AND	NOT_APPLY.TMTB_SQ IS NULL
+		AND	T.DEL_YN = 'N'
+		AND	TAG.DEL_YN = 'N'
+		AND	C.CART_GB = 'G026_BC'
+		AND	G.GOODS_STAT = 'G008_90'
+		AND	G.SELF_MALL_YN = 'Y'
 		<if test="tmtbSqs != null and tmtbSqs.length > 0">
-		AND    TAG.TMTB_SQ IN
+		AND	TAG.TMTB_SQ IN
 			<foreach collection="tmtbSqs" item="item" index="index"  open="(" close=")" separator=",">
 				#{item}
 			</foreach>
 		</if>
 		<if test="cartSqArr != null and cartSqArr.length > 0">
-		AND    C.CART_SQ IN
+		AND	C.CART_SQ IN
 			<foreach collection="cartSqArr" item="item" index="index"  open="(" close=")" separator=",">
 				#{item}
 			</foreach>
@@ -433,12 +473,12 @@
 			 , TV.DC_VAL
 		FROM   TB_TMTB_SECTION TC
 		INNER  JOIN TB_TMTB_VAL TV
-		ON     TC.TMTB_SECTION_SQ = TV.TMTB_SECTION_SQ
+		ON	 TC.TMTB_SECTION_SQ = TV.TMTB_SECTION_SQ
 		WHERE  1=1
-		AND    TC.DEL_YN = 'N'
-		AND    TV.DEL_YN = 'N'
+		AND	TC.DEL_YN = 'N'
+		AND	TV.DEL_YN = 'N'
 		<if test="list != null and list.size() > 0">
-		AND    TC.TMTB_SQ IN
+		AND	TC.TMTB_SQ IN
 			<foreach collection="list" item="item" index="index"  open="(" close=")" separator=",">
 				#{item}
 			</foreach>
@@ -459,140 +499,143 @@
 			 , Z.CART_SQ
 			 , Z.GOODS_CD
 			 , Z.GOODS_NM
-		     , Z.BRAND_NM
-		     , Z.SUPPLY_COMP_NM
+			 , Z.BRAND_ENM
+		     , Z.BRAND_KNM
+			 , Z.SUPPLY_COMP_NM
 			 , Z.GOODS_QTY
 			 , Z.GOODS_TYPE
 			 , Z.SUPPLY_COMP_CD
 			 , Z.DELV_FEE_CD
-		     , (Z.CURR_PRICE + Z.OPT_ADD_PRICE) * Z.GOODS_QTY AS CURR_PRICE
-		     , Z.SOLDOUT_YN
+			 , (Z.CURR_PRICE + Z.OPT_ADD_PRICE) * Z.GOODS_QTY AS CURR_PRICE
+			 , Z.SOLDOUT_YN
 			 , CASE WHEN #{frontGb} = 'P' THEN (Z.CURR_PRICE * Z.GOODS_QTY) * (Z.PNT_PRATE/100)
 					ELSE (Z.CURR_PRICE * Z.GOODS_QTY) * (Z.PNT_MRATE/100) END AS SAVE_PNT_AMT
-			 , GI.SYS_IMG_NM
+			 , SYS_IMG_NM
 		FROM   (SELECT C.CART_SQ
 					 , C.GOODS_CD
 					 , C.GOODS_QTY
 					 , CD.ITEM_CD
 					 , CD.OPT_CD
-		             , CD.ITEM_QTY
-		             , CD.CART_DTL_SQ
-		             , O.OPT_CD1
-		             , O.OPT_CD2
+					 , CD.ITEM_QTY
+					 , CD.CART_DTL_SQ
+					 , O.OPT_CD1
+					 , O.OPT_CD2
 					 , G.GOODS_TYPE
 					 , G.SUPPLY_COMP_CD
-		             , G.GOODS_NM
-		             , G.BRAND_CD
-		             , G.PNT_PRATE
+					 , G.GOODS_NM
+					 , G.BRAND_CD
+					 , G.PNT_PRATE
 					 , G.PNT_MRATE
-		             , STOCK.SOLDOUT_YN
-		             , FN_GET_APPLY_CPN1_PRICE(C.GOODS_CD, #{frontGb}) AS CURR_PRICE
-		             , IFNULL(O.ADD_PRICE, 0) AS OPT_ADD_PRICE
-		             , (SELECT BRAND_KNM FROM TB_BRAND WHERE BRAND_CD = G.BRAND_CD) AS BRAND_NM
-		             , (SELECT SUPPLY_COMP_NM FROM TB_SUPPLY_COMPANY WHERE SUPPLY_COMP_CD = G.SUPPLY_COMP_CD) AS SUPPLY_COMP_NM
+					 , STOCK.SOLDOUT_YN
+					 , FN_GET_APPLY_CPN1_PRICE(C.GOODS_CD, #{frontGb}) AS CURR_PRICE
+					 , IFNULL(O.ADD_PRICE, 0) AS OPT_ADD_PRICE
+					 , BR.BRAND_ENM
+		             , BR.BRAND_KNM
+					 , (SELECT SUPPLY_COMP_NM FROM TB_SUPPLY_COMPANY WHERE SUPPLY_COMP_CD = G.SUPPLY_COMP_CD) AS SUPPLY_COMP_NM
 					 , (SELECT GOODS_NM FROM TB_GOODS WHERE GOODS_CD = CD.ITEM_CD) AS ITEM_NM
 					 , CASE WHEN G.SELF_GOODS_YN = 'Y' THEN 'WMS'
 							ELSE DFP.DELV_FEE_CD END AS DELV_FEE_CD
+					 , CASE WHEN G.GOODS_TYPE != 'G056_S' AND G.SELF_GOODS_YN = 'Y' THEN (SELECT SYS_IMG_NM FROM TB_GOODS_IMG WHERE GOODS_CD = G.GOODS_CD AND COLOR_CD = CD.OPT_CD1 AND DEFAULT_IMG_YN = 'Y' LIMIT 1)
+							ELSE (SELECT SYS_IMG_NM FROM TB_GOODS_IMG WHERE GOODS_CD = G.GOODS_CD AND COLOR_CD = G.MAIN_COLOR_CD AND DEFAULT_IMG_YN = 'Y' LIMIT 1) END AS SYS_IMG_NM
 				FROM   TB_CART C
 				INNER  JOIN TB_CART_DETAIL CD
-				ON     C.CART_SQ = CD.CART_SQ
+				ON	 C.CART_SQ = CD.CART_SQ
 				INNER  JOIN TB_GOODS G
-				ON     C.GOODS_CD = G.GOODS_CD
+				ON	 C.GOODS_CD = G.GOODS_CD
+				INNER  JOIN TB_BRAND BR 
+				ON	 G.BRAND_CD = BR.BRAND_CD
 				INNER  JOIN TB_DELV_FEE_POLICY DFP
-				ON     G.DELV_FEE_CD = DFP.DELV_FEE_CD
+				ON	 G.DELV_FEE_CD = DFP.DELV_FEE_CD
 				INNER  JOIN TB_OPTION O
-				ON     CD.ITEM_CD = O.GOODS_CD
-				AND    CD.OPT_CD = O.OPT_CD
+				ON	 CD.ITEM_CD = O.GOODS_CD
+				AND	CD.OPT_CD = O.OPT_CD
 				INNER  JOIN (   SELECT A.CART_SQ
 									 , MIN(A.SOLDOUT_YN) AS SOLDOUT_YN
 								FROM   (SELECT C.CART_SQ
-											 , CASE WHEN VS.SOLDOUT_YN = 'N' AND VS.CURR_STOCK_QTY > C.GOODS_QTY * GC.QTY THEN 'N'
+											 , CASE WHEN VS.SOLDOUT_YN = 'N' AND VS.CURR_STOCK_QTY >= C.GOODS_QTY * GC.QTY THEN 'N'
 													ELSE 'Y' END AS SOLDOUT_YN
 										FROM   TB_CART C
 										INNER  JOIN TB_CART_DETAIL CD
-										ON     C.CART_SQ = CD.CART_SQ
+										ON	 C.CART_SQ = CD.CART_SQ
 										INNER  JOIN TB_GOODS G
-										ON     C.GOODS_CD = G.GOODS_CD
+										ON	 C.GOODS_CD = G.GOODS_CD
 										INNER  JOIN TB_GOODS_COMPOSE GC
-										ON     C.GOODS_CD = GC.GOODS_CD
-										AND    CD.ITEM_CD = GC.COMPS_GOODS_CD
+										ON	 C.GOODS_CD = GC.GOODS_CD
+										AND	CD.ITEM_CD = GC.COMPS_GOODS_CD
 										INNER  JOIN VW_STOCK VS
-										ON     CD.ITEM_CD = VS.GOODS_CD
-										AND    CD.OPT_CD = VS.OPT_CD
+										ON	 CD.ITEM_CD = VS.GOODS_CD
+										AND	CD.OPT_CD = VS.OPT_CD
 										WHERE  1=1
-										AND    C.CART_GB = 'G026_BC'
-										AND    G.GOODS_STAT = 'G008_90'
-										AND    G.SELF_MALL_YN = 'Y'
+										AND	C.CART_GB = 'G026_BC'
+										AND	G.GOODS_STAT = 'G008_90'
+										AND	G.SELF_MALL_YN = 'Y'
 										<if test="custNo == 0">
-											AND    C.CUST_NO = 0
-											AND    C.JSESSION_ID = #{jsessionId}
+											AND	C.CUST_NO = 0
+											AND	C.JSESSION_ID = #{jsessionId}
 										</if>
 										<if test="custNo != 0">
-											AND    C.CUST_NO = #{custNo}
+											AND	C.CUST_NO = #{custNo}
 										</if>
 										UNION ALL
 										SELECT C.CART_SQ
-											 , CASE WHEN VS.SOLDOUT_YN = 'N' AND VS.CURR_STOCK_QTY > C.GOODS_QTY THEN 'N'
+											 , CASE WHEN VS.SOLDOUT_YN = 'N' AND VS.CURR_STOCK_QTY >= C.GOODS_QTY THEN 'N'
 													ELSE 'Y' END AS SOLDOUT_YN
 										FROM   TB_CART C
 										INNER  JOIN TB_CART_DETAIL CD
-										ON     C.CART_SQ = CD.CART_SQ
+										ON	 C.CART_SQ = CD.CART_SQ
 										INNER  JOIN TB_GOODS G
-										ON     C.GOODS_CD = G.GOODS_CD
+										ON	 C.GOODS_CD = G.GOODS_CD
 										INNER  JOIN VW_STOCK VS
-										ON     C.GOODS_CD = VS.GOODS_CD
-										AND    CD.OPT_CD = VS.OPT_CD
+										ON	 C.GOODS_CD = VS.GOODS_CD
+										AND	CD.OPT_CD = VS.OPT_CD
 										WHERE  1=1
-										AND    C.CART_GB = 'G026_BC'
-										AND    G.GOODS_STAT = 'G008_90'
-										AND    G.SELF_MALL_YN = 'Y'
+										AND	C.CART_GB = 'G026_BC'
+										AND	G.GOODS_STAT = 'G008_90'
+										AND	G.SELF_MALL_YN = 'Y'
 										<if test="custNo == 0">
-											AND    C.CUST_NO = 0
-											AND    C.JSESSION_ID = #{jsessionId}
+											AND	C.CUST_NO = 0
+											AND	C.JSESSION_ID = #{jsessionId}
 										</if>
 										<if test="custNo != 0">
-											AND    C.CUST_NO = #{custNo}
+											AND	C.CUST_NO = #{custNo}
 										</if>
-								       ) A
+									   ) A
 								GROUP  BY  A.CART_SQ
 					   ) STOCK
-				ON     C.CART_SQ = STOCK.CART_SQ
+				ON	 C.CART_SQ = STOCK.CART_SQ
 				WHERE  G.SELF_MALL_YN = 'Y'
-				AND    G.GOODS_STAT = 'G008_90'
+				AND	G.GOODS_STAT = 'G008_90'
 				<if test="custNo == 0">
-				AND    C.CUST_NO = 0
-				AND    C.JSESSION_ID = #{jsessionId}
+				AND	C.CUST_NO = 0
+				AND	C.JSESSION_ID = #{jsessionId}
 				</if>
 				<if test="custNo != 0">
-				AND    C.CUST_NO = #{custNo}
+				AND	C.CUST_NO = #{custNo}
 				</if>
 				<if test="cartSqArr != null and cartSqArr.length > 0">
-				AND    C.CART_SQ IN
+				AND	C.CART_SQ IN
 					<foreach collection="cartSqArr" item="item" index="index"  open="(" close=")" separator=",">
 						#{item}
 					</foreach>
 				</if>
 				ORDER BY G.SUPPLY_COMP_CD ) Z
-		LEFT   OUTER JOIN TB_GOODS_IMG GI
-		ON	   Z.GOODS_CD = GI.GOODS_CD
-		AND	   Z.OPT_CD1 = GI.COLOR_CD
-		AND    GI.DEFAULT_IMG_YN = 'Y'
 		GROUP  BY Z.CART_SQ
 			 , Z.GOODS_CD
 			 , Z.GOODS_QTY
 			 , Z.GOODS_TYPE
 			 , Z.SUPPLY_COMP_CD
 			 , Z.GOODS_NM
-		     , Z.BRAND_NM
+			 , Z.BRAND_ENM
+			 , Z.BRAND_KNM
 			 , Z.SUPPLY_COMP_NM
 			 , Z.DELV_FEE_CD
-		     , Z.CURR_PRICE
-		     , Z.PNT_PRATE
+			 , Z.CURR_PRICE
+			 , Z.PNT_PRATE
 			 , Z.PNT_MRATE
-		     , Z.OPT_ADD_PRICE
-			 , GI.SYS_IMG_NM
+			 , Z.OPT_ADD_PRICE
+			 , SYS_IMG_NM
 		ORDER  BY Z.DELV_FEE_CD
-			 , Z.CART_SQ
+			 , Z.CART_SQ DESC
 	</select>
 
 	<!-- 장바구니 업체별 배송비 -->
@@ -601,17 +644,17 @@
 		SELECT DFP.MIN_ORD_AMT
 			 , DFP.DELV_FEE
 			 , DFP.DELV_FEE_CRITE
-		     , DFP.DELV_FEE_CD
+			 , DFP.DELV_FEE_CD
 			 , COUNT(G.SUPPLY_COMP_CD) AS COMP_CNT
 		FROM   TB_CART C
 		INNER  JOIN TB_GOODS G
-		ON     C.GOODS_CD = G.GOODS_CD
+		ON	 C.GOODS_CD = G.GOODS_CD
 		INNER  JOIN TB_DELV_FEE_POLICY DFP
-		ON     G.DELV_FEE_CD = DFP.DELV_FEE_CD
-		AND    DFP.USE_YN = 'Y'
+		ON	 G.DELV_FEE_CD = DFP.DELV_FEE_CD
+		AND	DFP.USE_YN = 'Y'
 		WHERE  1=1
-		AND    G.SELF_MALL_YN = 'Y'
-		AND    C.CART_SQ IN
+		AND	G.SELF_MALL_YN = 'Y'
+		AND	C.CART_SQ IN
 		<foreach collection="cartSqArr" item="item" index="index"  open="(" close=")" separator=",">
 			#{item}
 		</foreach>
@@ -630,14 +673,24 @@
 			#{item}
 		</foreach>
 	</delete>
+
+	<!-- 장바구니 삭제 -->
+	<delete id="deleteCartDetail" parameterType="Cart">
+		<!-- TsfCart.deleteCartDetail : 장바구니 삭제 -->
+		DELETE FROM TB_CART_DETAIL
+		WHERE  CART_SQ IN
+		<foreach collection="cartSqArr" item="item" index="index"  open="(" close=")" separator=",">
+			#{item}
+		</foreach>
+	</delete>
 	
 	<!-- 장바구니담긴상품 고객번호 Update -->
 	<update id="updateCartOfCustNo" parameterType="Cart">
 		/* TsfCart.updateCartOfCustNo */
 		UPDATE TB_CART
-		SET    CUST_NO = #{custNo}
-		     , UPD_NO = #{updNo}
-		     , UPD_DT = NOW()
+		SET	CUST_NO = #{custNo}
+			 , UPD_NO = #{updNo}
+			 , UPD_DT = NOW()
 		WHERE  JSESSION_ID = #{jsessionId}
 	</update>
 	
@@ -645,57 +698,57 @@
 	<select id="getCartListAfterLogin" parameterType="Cart" resultType="Cart">
 		/* TsfCart.getCartListAfterLogin */
 		SELECT A.CART_GB
-		     , A.GOODS_CD
-		     , A.ITEM_OPTS
-		     , IFNULL(B.CART_SQ,A.CART_SQ) AS UPD_CART_SQ /*업데이트할 장바구니번호*/
-		     , CASE WHEN B.CART_SQ IS NOT NULL THEN
-		                A.CART_SQ
-		            ELSE
-		                0
-		       END                         AS DEL_CART_SQ /*삭제할 장바구니번호(0이면 삭제할 장바구니번호 없음)*/
+			 , A.GOODS_CD
+			 , A.ITEM_OPTS
+			 , IFNULL(B.CART_SQ,A.CART_SQ) AS UPD_CART_SQ /*업데이트할 장바구니번호*/
+			 , CASE WHEN B.CART_SQ IS NOT NULL THEN
+						A.CART_SQ
+					ELSE
+						0
+			   END						 AS DEL_CART_SQ /*삭제할 장바구니번호(0이면 삭제할 장바구니번호 없음)*/
 		FROM   (
-		        /*장바구니에 담을 상품 목록*/
-		        SELECT C.CART_SQ
-		             , C.CART_GB
-		             , C.GOODS_CD
-		             , GROUP_CONCAT(CONCAT(CD.ITEM_CD,':',CD.OPT_CD1,':',CD.OPT_CD2) ORDER BY CD.ITEM_CD, CD.OPT_CD1, CD.OPT_CD2 SEPARATOR ';') AS ITEM_OPTS
-		        FROM   TB_CART C
-		             , TB_CART_DETAIL CD
-		        WHERE  C.CART_SQ = CD.CART_SQ
-		        AND    C.CUST_NO = #{custNo}
-		        AND    C.JSESSION_ID = #{jsessionId}
-		        GROUP  BY C.CART_SQ, C.CART_GB, C.GOODS_CD
-		       ) A
+				/*장바구니에 담을 상품 목록*/
+				SELECT C.CART_SQ
+					 , C.CART_GB
+					 , C.GOODS_CD
+					 , GROUP_CONCAT(CONCAT(CD.ITEM_CD,':',CD.OPT_CD1,':',CD.OPT_CD2) ORDER BY CD.ITEM_CD, CD.OPT_CD1, CD.OPT_CD2 SEPARATOR ';') AS ITEM_OPTS
+				FROM   TB_CART C
+					 , TB_CART_DETAIL CD
+				WHERE  C.CART_SQ = CD.CART_SQ
+				AND	C.CUST_NO = #{custNo}
+				AND	C.JSESSION_ID = #{jsessionId}
+				GROUP  BY C.CART_SQ, C.CART_GB, C.GOODS_CD
+			   ) A
 		LEFT OUTER JOIN (
-		        /*장바구니에 담긴 기존 상품 목록*/
-		        SELECT C.CART_SQ
-		             , C.CART_GB
-		             , C.GOODS_CD
-		             , GROUP_CONCAT(CONCAT(CD.ITEM_CD,':',CD.OPT_CD1,':',CD.OPT_CD2) ORDER BY CD.ITEM_CD, CD.OPT_CD1, CD.OPT_CD2 SEPARATOR ';') AS ITEM_OPTS
-		        FROM   TB_CART C
-		             , TB_CART_DETAIL CD
-		        WHERE  C.CART_SQ = CD.CART_SQ
-		        AND    C.CUST_NO = #{custNo}
-		        AND    C.JSESSION_ID <![CDATA[<>]]> #{jsessionId}
-		        GROUP  BY C.CART_SQ, C.CART_GB, C.GOODS_CD
-		       ) B
-		ON     A.CART_GB = B.CART_GB
-		AND    A.GOODS_CD = B.GOODS_CD
-		AND    A.ITEM_OPTS = B.ITEM_OPTS
+				/*장바구니에 담긴 기존 상품 목록*/
+				SELECT C.CART_SQ
+					 , C.CART_GB
+					 , C.GOODS_CD
+					 , GROUP_CONCAT(CONCAT(CD.ITEM_CD,':',CD.OPT_CD1,':',CD.OPT_CD2) ORDER BY CD.ITEM_CD, CD.OPT_CD1, CD.OPT_CD2 SEPARATOR ';') AS ITEM_OPTS
+				FROM   TB_CART C
+					 , TB_CART_DETAIL CD
+				WHERE  C.CART_SQ = CD.CART_SQ
+				AND	C.CUST_NO = #{custNo}
+				AND	C.JSESSION_ID <![CDATA[<>]]> #{jsessionId}
+				GROUP  BY C.CART_SQ, C.CART_GB, C.GOODS_CD
+			   ) B
+		ON	 A.CART_GB = B.CART_GB
+		AND	A.GOODS_CD = B.GOODS_CD
+		AND	A.ITEM_OPTS = B.ITEM_OPTS
 	</select>
 
 	<!-- 로그인 후 장바구니 수정 -->
 	<update id="updateCartAfterLogin" parameterType="Cart">
 		/* TsfCart.updateCartAfterLogin */
 		UPDATE TB_CART
-		SET    GOODS_QTY = GOODS_QTY + IFNULL((SELECT A.GOODS_QTY
-		    									 FROM ( SELECT GOODS_QTY
+		SET	GOODS_QTY = GOODS_QTY + IFNULL((SELECT A.GOODS_QTY
+												 FROM ( SELECT GOODS_QTY
 														  FROM TB_CART
 														 WHERE CART_SQ = #{delCartSq}
 														   AND CUST_NO = #{custNo} ) A
-		                                        ),0)
+												),0)
 		WHERE  CART_SQ = #{updCartSq}
-		AND    CUST_NO = #{custNo}
+		AND	CUST_NO = #{custNo}
 	</update>
 
 	<!-- 로그인 후 장바구니단품 삭제 -->
@@ -703,10 +756,10 @@
 		/* TsfCart.deleteCartItemAfterLogin */
 		DELETE FROM TB_CART_DETAIL
 		WHERE  CART_SQ IN (SELECT CART_SQ
-		                   FROM   TB_CART
-		                   WHERE  CART_SQ = #{delCartSq}
-		                   AND    CUST_NO = #{custNo}
-		                  )
+						   FROM   TB_CART
+						   WHERE  CART_SQ = #{delCartSq}
+						   AND	CUST_NO = #{custNo}
+						  )
 	</delete>
 
 	<!-- 로그인 후 장바구니 삭제 -->
@@ -714,42 +767,184 @@
 		/* TsfCart.deleteCartAfterLogin */
 		DELETE FROM TB_CART
 		WHERE  CART_SQ = #{delCartSq}
-		AND    CUST_NO = #{custNo}
+		AND	CUST_NO = #{custNo}
 	</delete>
 	
 	<!-- 로그인 후 장바구니이력 생성 -->
 	<update id="createCartHistoryAfterLogin" parameterType="Cart">
 		/* TsfCart.createCartHistoryAfterLogin */
 		INSERT INTO TB_CART_HST (
-		       CART_SQ
-		     , CART_GB
-		     , GOODS_CD
-		     , GOODS_QTY
-		     , DEAL_GOODS_CD
-		     , ORD_NO
-		     , CUST_NO
-		     , AF_LINK_CD
-		     , ITHR_CD
-		     , CONTENTS_LOC
-		     , PLAN_DTL_SQ
-		     , REG_NO
-		     , REG_DT
+			   CART_SQ
+			 , CART_GB
+			 , GOODS_CD
+			 , GOODS_QTY
+			 , DEAL_GOODS_CD
+			 , ORD_NO
+			 , CUST_NO
+			 , AF_LINK_CD
+			 , ITHR_CD
+			 , CONTENTS_LOC
+			 , PLAN_DTL_SQ
+			 , REG_NO
+			 , REG_DT
 		)
 		SELECT CART_SQ
-		     , CART_GB
-		     , GOODS_CD
-		     , GOODS_QTY
-		     , DEAL_GOODS_CD
-		     , 0
-		     , CUST_NO
-		     , AF_LINK_CD
-		     , ITHR_CD
-		     , CONTENTS_LOC
-		     , PLAN_DTL_SQ
-		     , #{regNo}
-		     , NOW()
+			 , CART_GB
+			 , GOODS_CD
+			 , GOODS_QTY
+			 , DEAL_GOODS_CD
+			 , 0
+			 , CUST_NO
+			 , AF_LINK_CD
+			 , ITHR_CD
+			 , CONTENTS_LOC
+			 , PLAN_DTL_SQ
+			 , #{regNo}
+			 , NOW()
 		FROM   TB_CART C
 		WHERE  CART_SQ = #{updCartSq}
 	</update>
-	
+
+	<!-- 장바구니 상품 정보 조회 -->
+	<select id="selectCartGoodsInfo" parameterType="Cart" resultType="Cart">
+		/* TsfCart.selectCartGoodsInfo : 장바구니 상품 마스터 정보 조회 */
+		SELECT G.GOODS_CD
+			 , G.GOODS_TYPE
+		     , G.GOODS_NM
+			 , BR.BRAND_ENM
+			 , BR.BRAND_KNM
+			 , CA.CART_SQ
+			 , CA.GOODS_QTY
+			 , G.SELF_GOODS_YN
+		FROM   TB_CART CA
+		INNER  JOIN TB_GOODS G
+		ON     CA.GOODS_CD = G.GOODS_CD
+		INNER  JOIN TB_BRAND BR
+		ON     G.BRAND_CD = BR.BRAND_CD
+		WHERE  CA.CART_SQ = #{cartSq}
+		AND    G.SELF_MALL_YN = 'Y'
+		AND    G.GOODS_STAT = 'G008_90'
+	</select>
+
+	<!-- 장바구니 세트 구성 상품 정보 조회 -->
+	<select id="selectCartSetGoodsInfo" parameterType="Cart" resultType="Cart">
+		/* TsfCart.selectCartSetGoodsInfo : 장바구니 세트 구성 상품 정보 조회 */
+		SELECT GC.COMPS_GOODS_CD AS GOODS_CD
+			 , GC.DISP_ORD
+			 , GC.QTY
+			 , CD.CART_DTL_SQ
+			 , CD.ITEM_CD
+			 , CD.OPT_CD
+			 , CD.OPT_CD1
+			 , CD.OPT_CD2
+			 , G.SELF_GOODS_YN
+			 , G.GOODS_NM
+		FROM   TB_CART CA
+		INNER  JOIN TB_CART_DETAIL CD
+		ON     CA.CART_SQ = CD.CART_SQ
+		INNER  JOIN TB_GOODS_COMPOSE GC
+		ON     CA.GOODS_CD = GC.GOODS_CD
+		AND    CD.ITEM_CD = GC.COMPS_GOODS_CD
+		INNER  JOIN TB_GOODS G
+		ON     GC.COMPS_GOODS_CD = G.GOODS_CD
+		WHERE  1=1
+		AND    G.SELF_MALL_YN = 'Y'
+		AND    G.GOODS_STAT = 'G008_90'
+		AND    GC.USE_YN = 'Y'
+		AND    GC.GOODS_CD = #{goodsCd}
+		AND    CA.CART_SQ = #{cartSq}
+		ORDER  BY CA.GOODS_CD, GC.COMPS_GOODS_CD, GC.DISP_ORD
+	</select>
+
+	<!-- 장바구니 상품 컬러 정보 조회 -->
+	<select id="selectCartGoodsColorList" parameterType="Cart" resultType="Cart">
+		/* TsfCart.selectCartGoodsColorList : 장바구니 상품 컬러 정보 조회 */
+		SELECT ST.GOODS_CD
+			 , CASE WHEN SELF_GOODS_YN = 'Y' THEN (SELECT COLOR_KNM FROM TB_COLOR WHERE COLOR_CD = ST.OPT_CD1)
+					ELSE ST.OPT_CD1 END AS COLOR_NM
+			 , CASE WHEN SELF_GOODS_YN = 'Y' AND GOODS_TYPE != 'G056_S' THEN (SELECT SYS_IMG_NM FROM TB_GOODS_IMG WHERE GOODS_CD = ST.GOODS_CD AND COLOR_CD = ST.OPT_CD1 AND DEFAULT_IMG_YN = 'Y' LIMIT 1)
+					ELSE (SELECT SYS_IMG_NM FROM TB_GOODS_IMG WHERE GOODS_CD = G.GOODS_CD AND COLOR_CD = G.MAIN_COLOR_CD AND DEFAULT_IMG_YN = 'Y' LIMIT 1) END AS SYS_IMG_NM
+			 , ST.OPT_CD1
+			 , G.MAIN_COLOR_CD
+			 , MAX(CD.CART_DTL_SQ) AS CART_DTL_SQ
+			 , MAX(ST.DISP_ORD) AS DISP_ORD
+			 , MAX(CD.OPT_CD1) AS CART_OPT_CD1
+			 , IFNULL(MAX( CASE WHEN SELF_GOODS_YN = 'Y' THEN (SELECT COLOR_KNM FROM TB_COLOR WHERE COLOR_CD = CD.OPT_CD1)
+								ELSE CD.OPT_CD1 END), MAX(CD.OPT_CD1)) AS CART_COLOR_NM
+		FROM   TB_GOODS G
+		INNER  JOIN VW_STOCK ST
+		ON     G.GOODS_CD = ST.GOODS_CD
+		LEFT   OUTER JOIN TB_CART_DETAIL CD
+		ON     G.GOODS_CD = CD.ITEM_CD
+		AND    ST.OPT_CD = CD.OPT_CD
+		AND    CD.CART_SQ = #{cartSq}
+		WHERE  ST.DISP_YN = 'Y'
+		AND    G.SELF_MALL_YN = 'Y'
+		AND    G.GOODS_STAT = 'G008_90'
+		AND    G.GOODS_CD = #{goodsCd}
+		GROUP  BY ST.GOODS_CD
+			 , ST.OPT_CD1
+			 , G.MAIN_COLOR_CD
+		ORDER  BY DISP_ORD
+	</select>
+
+	<!-- 장바구니 상품 사이즈 정보 조회 -->
+	<select id="selectCartGoodsSizeList" parameterType="Cart" resultType="Cart">
+		/* TsfCart.selectCartGoodsSizeList : 장바구니 상품 사이즈 정보 조회 */
+		SELECT ST.GOODS_CD
+			 , ST.OPT_CD
+		     , ST.OPT_CD1
+			 , ST.OPT_CD2
+			 , ST.CURR_STOCK_QTY
+			 , ST.SOLDOUT_YN
+			 , CD.OPT_CD AS CART_OPT_CD
+		FROM   TB_GOODS G
+		INNER  JOIN VW_STOCK ST
+		ON     G.GOODS_CD = ST.GOODS_CD
+		LEFT   OUTER JOIN TB_CART_DETAIL CD
+		ON     G.GOODS_CD = CD.ITEM_CD
+		AND    ST.OPT_CD = CD.OPT_CD
+		AND    CD.CART_SQ = #{cartSq}
+		WHERE  1=1
+		AND    G.GOODS_CD = #{goodsCd}
+		<if test="optCd1 != null and optCd1 != ''">
+		AND    ST.OPT_CD1 = #{optCd1}
+		</if>
+		AND    ST.DISP_YN = 'Y'
+		AND    G.SELF_MALL_YN = 'Y'
+		AND    G.GOODS_STAT = 'G008_90'
+		ORDER  BY ST.DISP_ORD
+	</select>
+
+	<!-- 장바구니 자사 일반 및 딜 상품 이미지 리스트 조회 -->
+	<select id="selectCartSelfGoodsOptionImgList" parameterType="Cart" resultType="GoodsImg">
+		/* TsfCart.selectCartSelfGoodsOptionImgList : 장바구니 자사 상품 이미지 리스트 조회 */
+		SELECT GI.GOODS_CD
+			 , GI.COLOR_CD
+			 , GI.SYS_IMG_NM
+		FROM   TB_GOODS G
+		INNER  JOIN TB_GOODS_IMG GI
+		ON     G.GOODS_CD = GI.GOODS_CD
+		WHERE  G.SELF_MALL_YN = 'Y'
+		AND    G.GOODS_STAT = 'G008_90'
+		AND    GI.GOODS_CD = #{goodsCd}
+		AND    GI.COLOR_CD = #{optCd1}
+		ORDER  BY GI.DISP_ORD
+	</select>
+
+	<!-- 장바구니 세트 & 입점업체 상품 이미지 리스트 조회 -->
+	<select id="selectCartDelvGoodsOptionImgList" parameterType="Cart" resultType="GoodsImg">
+		/* TsfCart.selectCartDelvGoodsOptionImgList : 장바구니 입점업체 상품 이미지 리스트 조회 */
+		SELECT GI.GOODS_CD
+			 , GI.COLOR_CD
+			 , GI.SYS_IMG_NM
+		FROM   TB_GOODS G
+		INNER  JOIN TB_GOODS_IMG GI
+		ON     G.GOODS_CD = GI.GOODS_CD
+		AND    G.MAIN_COLOR_CD = GI.COLOR_CD
+		WHERE  G.SELF_MALL_YN = 'Y'
+		AND    G.GOODS_STAT = 'G008_90'
+		AND    GI.GOODS_CD = #{goodsCd}
+		ORDER  BY GI.DISP_ORD
+	</select>
 </mapper>

+ 246 - 0
src/main/webapp/WEB-INF/views/web/cart/cartChangeOptionPopupWeb.html

@@ -0,0 +1,246 @@
+<html lang="ko"
+	  xmlns:th="http://www.thymeleaf.org">
+<!-- 옵션변경 팝업 -->
+<div class="modal-dialog cartOptionModal" role="document">
+	<div class="modal-content">
+		<div class="modal-header">
+			<h5 class="modal-title" id="optModifyLabel">옵션변경</h5>
+			<div class="prod_title">
+				<span class="brand" th:text="|${cart.brandEnm + ' ' + cart.brandKnm}|"></span>
+				<span class="name" th:text="${cart.goodsNm}"></span>
+			</div>
+		</div>
+
+		<div class="modal-body">
+			<div class="pop_cont">
+				<div class="prod_info">
+					<div class="prod_preview">
+						<div class="area_pic">
+							<ul class="pic_list">
+								<th:block th:if="${setType.equals(cart.goodsType) or cart.selfGoodsYn.equals('N')}">
+									<li th:each="img, index : ${cart.cartImgList}">
+										<span class="thumb"><img th:src="${cart.imgPath + '/' + img.sysImgNm}" src="#" alt="" /></span>
+									</li>
+								</th:block>
+								<th:block th:if="${!setType.equals(cart.goodsType) and cart.selfGoodsYn.equals('Y')}">
+									<th:block th:each="comp, status : ${cart.cartCompsList}">
+										<th:block th:each="color, index : ${comp.cartColorList}">
+											<th:block th:if="${color.cartOptCd1 != null and color.cartOptCd1.equals(color.optCd1)}">
+												<li th:each="img, index : ${color.cartImgList}">
+													<span class="thumb"><img th:src="${cart.imgPath + '/' + img.sysImgNm}" src="#" alt="" /></span>
+												</li>
+											</th:block>
+										</th:block>
+									</th:block>
+								</th:block>
+							</ul>
+						</div>
+						<div class="area_order">
+							<th:block th:each="comp, status : ${cart.cartCompsList}">
+								<!-- 세트상품 옵션 -->
+								<th:block th:if="${setType.equals(cart.goodsType)}">
+									<div class="opt_select setOption">
+										<div class="opt_header">
+											<span class="title" th:text="${comp.goodsNm}"></span>
+										</div>
+
+										<!-- 컬러 변경시 만들어줄 size option -->
+										<th:block th:each="color, index : ${comp.cartColorList}">
+											<span style="display:none;">
+												<select th:classappend="|color_${color.goodsCd}_${color.optCd1}|">
+													<th:block th:each="size, i : ${color.cartSizeList}">
+														<th:block th:if="${color.optCd1.equals(size.optCd1)}">
+															<option th:value="${size.optCd}" th:text="${size.optCd2}"></option>
+														</th:block>
+													</th:block>
+												</select>
+											</span>
+										</th:block>
+
+										<div class="form_field">
+											<select class="setColorSelect">
+												<option th:data="${comp.goodsCd}" value="aa">TEST</option>
+												<th:block th:each="color, index : ${comp.cartColorList}">
+													<option th:data="${comp.goodsCd}" th:value="${color.optCd1}" rel="icon-temperature" th:text="${color.colorNm}" th:selected="${color.cartColorNm != null}"></option>
+												</th:block>
+											</select>
+										</div>
+										<div class="form_field">
+											<th:block th:each="color, index : ${comp.cartColorList}">
+											<select th:data="${color.goodsCd}" th:class="|size_${comp.goodsCd} setSizeSelect|">
+												<th:block th:each="size, i : ${color.cartSizeList}">
+													<th:block th:if="${color.optCd1.equals(size.optCd1)}">
+														<option th:data="${comp.cartDtlSq}" th:value="${size.optCd}" th:text="${size.optCd2}" th:selected="${size.cartOptCd != null}"></option>
+													</th:block>
+												</th:block>
+											</select>
+											</th:block>
+										</div>
+									</div>
+								</th:block>
+
+								<!-- 자사 일반 상품 옵션 -->
+								<th:block th:if="${!setType.equals(cart.goodsType) and 'Y'.equals(cart.selfGoodsYn)}">
+									<div class="opt_color">
+										<div class="opt_header">
+											<span class="title">컬러</span>
+											<th:block th:each="color, index : ${comp.cartColorList}">
+												<th:block th:if="${color.cartColorNm != null}">
+													<span class="color" th:text="${color.cartColorNm}"></span>
+												</th:block>
+											</th:block>
+										</div>
+										<ul>
+											<li th:each="color, index : ${comp.cartColorList}" class="selfGoodsColor">
+												<a href="" th:classappend="${color.cartColorNm != null} ? 'on'" class="selfGoodsColorSelect" th:data="${color.optCd1}">
+													<img th:src="${cart.imgPath + '/' + color.sysImgNm}" src="#" th:alt="${color.colorNm}" alt="" />
+												</a>
+											</li>
+										</ul>
+									</div>
+
+									<div class="opt_size">
+										<div class="opt_header">
+											<span class="title">사이즈</span>
+										</div>
+										<div class="form_field selfGoodsSize">
+											<th:block th:each="color, index : ${comp.cartColorList}">
+												<th:block th:if="${color.cartColorNm != null}">
+													<th:block th:each="size, index : ${color.cartSizeList}">
+														<div>
+															<input type="radio" name="rdi-optsize" th:id="|${'rdi-optsize' + size.goodsCd + '-' + size.optCd}|" th:value="${size.optCd}" th:checked="${size.cartOptCd != null}" th:disabled="${size.soldoutYn == 'Y' or cart.goodsQty < size.currStockQty}">
+															<label th:for="|${'rdi-optsize' + size.goodsCd + '-' + size.optCd}|"><span th:text="${size.optCd2}"></span></label>
+														</div>
+													</th:block>
+												</th:block>
+											</th:block>
+										</div>
+									</div>
+								</th:block>
+
+								<!-- 입점업체 상품 옵션 -->
+								<th:block th:if="${!setType.equals(cart.goodsType) and !'Y'.equals(cart.selfGoodsYn)}">
+									<div class="opt_select">
+										<div class="opt_header">
+											<span class="title">옵션선택</span>
+										</div>
+										<div class="form_field">
+											<select id="">
+												<th:block th:each="color, index : ${comp.cartColorList}">
+												<option th:value="${color.optCd}" th:text="${color.optCd1 + '/' + color.optCd2}" th:selected="${color.cartOptCd != null}"></option>
+												</th:block>
+											</select>
+										</div>
+									</div>
+								</th:block>
+							</th:block>
+							<div class="opt_count">
+								<div class="opt_header">
+									<span class="title">수량</span>
+								</div>
+								<div class="number_count">
+									<span class="minus"><span class="sr-only">감소</span></span>
+									<input type="text" name="goodsQty" maxlength="3" style='ime-mode:disabled' th:value="${cart.goodsQty}" />
+									<!-- <input type="text" name="goodsQty" maxlength="3" style='ime-mode:disabled' th:value="2" /> -->
+									<span class="plus"><span class="sr-only">추가</span></span>
+								</div>
+							</div>
+							<div class="btn_group_block">
+								<button class="btn btn_dark btn_block" th:onclick="|fnChangeCartOption(${cart.cartSq})|"><span>옵션변경</span></button>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+<!-- //옵션변경 팝업 -->
+
+
+<script th:inline="javascript">
+	$(document).ready(function() {
+
+	})
+
+	// 세트상품 컬러 변경시
+	$(".setColorSelect").on("change", function(e) {
+		let goodsCd = $(this).find("option:checked").attr("data");
+		$(".setOption .size_" + goodsCd).html("");
+		$(".setOption .size_" + goodsCd).html($(".color_" + goodsCd + "_" + $(this).val()).html());
+	});
+
+	// 자사 일반 상품 컬러 선택시
+	$(".selfGoodsColorSelect").on("click", function(e) {
+		let html = "";
+		let cart = [[${cart}]];
+		let color =  [[${cart.cartCompsList[0].cartColorList}]];
+		let optCd1 = $(this).attr("data");
+
+		for(let i = 0 ; i < color.length ; i++) {
+			let size = color[i].cartSizeList;
+			for(let j = 0 ; j < size.length ; j++) {
+				if(optCd1 == size[j].optCd1) {
+					html += "<div>";
+					html += "<input type='radio' name='rdi-optsize' id='" + size[j].goodsCd + "-" + size[j].optCd + "' value='" + size[j].optCd + "' ";
+					if(size[j].soldoutYn == "Y" || cart.goodsQty < size[j].currStockQty) {
+						html += "disabled = 'disabled'";
+					}
+					html += " />\n";
+					html += "<label for='" + size[j].goodsCd + "-" + size[j].optCd + "'><span>" + size[j].optCd2 + "</span></label>\n"
+					html += "</div>\n";
+				}
+			}
+		}
+
+		$(".selfGoodsSize").html(html);
+	});
+
+	function fnChangeCartOption(cartSq) {
+		let cart = [[${cart}]];
+		let cartDtlSqArr = [], itemCds = [], optCds = [];
+		let data;
+
+		if(cart.goodsType == "G056_S") {
+			$(".setSizeSelect").each(function() {
+				optCds.push($(this).val());
+				itemCds.push($(this).attr("data"));
+				cartDtlSqArr.push($(this).find("option:checked").attr("data"));
+			});
+
+			data = {
+				  cartSq : cart.cartSq
+				, goodsCd : cart.goodsCd
+				, goodsType : cart.goodsType
+				, cartDtlSqArr : cartDtlSqArr
+				, itemCds : itemCds
+				, optCds : optCds
+				, goodsQty : $("input[name=goodsQty]").val()
+			}
+		} else if(cart.goodsType != "G056_S" && cart.selfGoodsYn == "Y") {
+			alert("자사 일반");
+		} else {
+			alert("입점업체");
+		}
+
+		$.ajax( {
+			type: "POST",
+			url : '/cart/change/option',
+			contentType: 'application/json',
+			dataType : 'json',
+			data : JSON.stringify(data),
+			success : function(result) {
+				alert(result.message);
+				$(".closeCartOptionModal").trigger("click");
+				getCartList();
+			}
+		});
+	}
+
+	$(".closeCartOptionModal").on("click", function() {
+		$(".cartOptionModal").html("");
+	});
+</script>
+
+</div>
+<a href="#close-modal" rel="modal:close" class="close-modal closeCartOptionModal">Close</a>
+</html>

+ 64 - 34
src/main/webapp/WEB-INF/views/web/cart/cartListAjaxFormWeb.html

@@ -83,7 +83,7 @@
 										<div class="info_box">
 											<p class="od_name">
 												<a href="">
-													<span class="brand" th:text="${cart.brandNm}"></span>
+													<span class="brand" th:text="|${cart.brandEnm} ${cart.brandKnm}|"></span>
 													<span th:if="${!#strings.isEmpty(cart.delvResDt)}" class="reserv_date" th:text="|${cart.delvResDt} 배송예정|"></span>
 													<span class="name" th:text="${cart.goodsNm}"></span>
 												</a>
@@ -96,7 +96,7 @@
 											</p>
 
 											<p class="od_modify">
-												<button type="button" class="btn_opt_pop"><span>옵션/수량변경</span></button>
+												<button type="button" class="btn_opt_pop" th:onclick="|changeCartOptCd(${cart.cartSq})|"><span>옵션/수량변경</span></button>
 											</p>
 											<!-- 다다익선 적용 -->
 											<div class="od_moresale applyTmtb" th:if="${(cart.qtyTmtbSq > 0 and cart.applyQtySectionYn == 'Y') or (cart.amtTmtbSq > 0 and cart.applyAmtSectionYn == 'Y')}">
@@ -215,7 +215,7 @@
 										<div class="info_box">
 											<p class="od_name">
 												<a href="">
-													<span class="brand" th:text="${cart.brandNm}"></span>
+													<span class="brand" th:text="|${cart.brandEnm} ${cart.brandKnm}|"></span>
 													<span class="name" th:text="${cart.goodsNm}"></span>
 												</a>
 											</p>
@@ -226,7 +226,7 @@
 												<span class="count">수량:<em th:text="${cart.goodsQty}"></em>개</span>
 											</p>
 											<p class="od_modify">
-												<button type="button" class="btn_opt_pop"><span>옵션/수량변경</span></button>
+												<button type="button" class="btn_opt_pop" th:onclick="|changeCartOptCd(${cart.cartSq})|"><span>옵션/수량변경</span></button>
 											</p>
 											<!-- 다다익선 적용 -->
 											<div class="od_moresale applyTmtb" th:if="${(cart.qtyTmtbSq > 0 and cart.applyQtySectionYn == 'Y') or (cart.amtTmtbSq > 0 and cart.applyAmtSectionYn == 'Y')}">
@@ -385,6 +385,10 @@
 	<!-- // CONT-BODY -->
 </form>
 
+<!-- 옵션변경 팝업 -->
+<div class="modal fade od_pop opt_modify_pop" id="optModifyPop" tabindex="-1" role="dialog" aria-labelledby="optModifyLabel" aria-hidden="true"></div>
+<!-- //옵션변경 팝업 -->
+
 <script th:inline="javascript">
 	let sumRealPayAmt = [[${order.sumRealPayAmt + order.totDelvFee}]];
 	let totDcAmt = [[${order.totDcAmt}]];
@@ -410,6 +414,47 @@
 
 		// 다다익선 할인 대상(미적용) 리스트
 		notApplyTmtbAreaList();
+
+		/* 세트상품 장바구니 */
+		/* let compsList = [];
+		let temp = new Object;
+		temp.goodsCd = "STYS00000042";
+		temp.itemCd = "14373746";
+		temp.optCd = "베이지110";
+		temp.goodsQty = 1;
+		temp.goodsType = "G056_S";
+		temp.cartGb = "C";
+		temp.afLinkCd = "afLinkCd";
+		temp.ithrCd = "G027_ZZZ";
+		temp.contentsLoc = "G028_YYY";
+		temp.planDtlSq = "123";
+		compsList.push(temp);
+
+		temp.goodsCd = "STYS00000042";
+		temp.itemCd = "14373769";
+		temp.optCd = "블루110";
+		temp.goodsQty = 1;
+		temp.goodsType = "G056_S";
+		temp.cartGb = "C";
+		temp.afLinkCd = "afLinkCd";
+		temp.ithrCd = "G027_ZZZ";
+		temp.contentsLoc = "G028_YYY";
+		temp.planDtlSq = "123";
+		compsList.push(temp);
+
+		temp.goodsCd = "STYS00000042";
+		temp.itemCd = "14373770";
+		temp.optCd = "아이보리110";
+		temp.goodsQty = 1;
+		temp.goodsType = "G056_S";
+		temp.cartGb = "C";
+		temp.afLinkCd = "afLinkCd";
+		temp.ithrCd = "G027_ZZZ";
+		temp.contentsLoc = "G028_YYY";
+		temp.planDtlSq = "123";
+		compsList.push(temp);
+
+		cfnAddCart(compsList); */
 	});
 
 	function notApplyTmtbAreaList() {
@@ -607,7 +652,7 @@
 				}
 			}
 		});
-	};
+	}
 
 	//다다익선 적용내역 보기
 	$(document).on('click','.shopping_bag .part_deliver .btn_moresale',function(e){
@@ -850,7 +895,7 @@
 				obj.tmtbNm = cart.qtyTmtbNm;
 				obj.currPrice = cart.currPrice;
 				obj.goodsNm = cart.goodsNm;
-				obj.brandNm = cart.brandNm;
+				obj.brandNm = cart.brandEnm + " " + cart.brandKnm;
 				obj.imgPath = order.imgPath1 + "/" + cart.sysImgNm;
 
 				notApplyQtyTmtbList.push(obj);
@@ -882,33 +927,18 @@
 	}
 
 	//옵션변경 팝업열기
-	$(document).on('click','.btn_opt_pop',function(e){
-		$("#optModifyPop").modal("show");
-		return false;
-	});
-
-	//상품옵션변경 팝업 > 수량조절
-	$(document).on('click','.opt_modify_pop .number_count .minus',function(e){
-		var $input = $(this).parent().find('input');
-		var count = parseInt($input.val()) - 1;
-		count = count < 1 ? 1 : count;
-		$input.val(count);
-		$input.change();
-		return false;
-	}).on('click','.opt_modify_pop .number_count .plus',function(e){
-		var $input = $(this).parent().find('input');
-		$input.val(parseInt($input.val()) + 1);
-		$input.change();
-		return false;
-	});
-
-	//상품옵션변경 팝업 > 컬러선택 표기
-	$(document).on('click','.opt_modify_pop .opt_color ul li a',function(e){
-		$(this).parents('.opt_color').find('li a').removeClass('on');
-		$(this).addClass('on');
-		var optColor = $('.opt_modify_pop .opt_color ul li a.on img').attr('alt');
-		$('.opt_modify_pop .opt_color .opt_header .color').text(optColor);
-		return false;
-	});
+	function changeCartOptCd(cartSq) {
+		$.ajax( {
+			type: "POST",
+			url : '/cart/goods/info',
+			dataType : 'html',
+			data : {cartSq : cartSq},
+			success : function(result) {
+				//fnChangeCartListInfo(result);
+				$("#optModifyPop").html(result);
+				$("#optModifyPop").modal("show");
+			}
+		});
+	}
 </script>
 </html>

+ 22 - 143
src/main/webapp/WEB-INF/views/web/cart/cartListFormWeb.html

@@ -253,144 +253,6 @@
 </div>
 <!-- // container -->
 
-<!-- 옵션변경 팝업 -->
-<div class="modal fade od_pop opt_modify_pop" id="optModifyPop" tabindex="-1" role="dialog" aria-labelledby="optModifyLabel" aria-hidden="true">
-    <div class="modal-dialog" role="document">
-        <div class="modal-content">
-            <div class="modal-header">
-                <h5 class="modal-title" id="optModifyLabel">옵션변경</h5>
-                <div class="prod_title">
-                    <span class="brand">버카루 BUCKROO</span>
-                    <span class="name">남성 제기장 스웨이드 자켓</span>
-                </div>
-            </div>
-            <div class="modal-body">
-                <div class="pop_cont">
-                    <div class="prod_info">
-                        <div class="prod_preview">
-                            <div class="area_pic">
-                                <ul class="pic_list">
-                                    <li><span class="thumb"><img src="/images/pc/thumb/tmp_pdDetail1.jpg" alt=""></span></li>
-                                    <li><span class="thumb"><img src="/images/pc/thumb/tmp_pdDetail2.jpg" alt=""></span></li>
-                                    <li><span class="thumb"><img src="/images/pc/thumb/tmp_pdDetail3.jpg" alt=""></span></li>
-                                    <li><span class="thumb"><img src="/images/pc/thumb/tmp_pdDetail4.jpg" alt=""></span></li>
-                                    <li><span class="thumb"><img src="/images/pc/thumb/tmp_pdDetail5.jpg" alt=""></span></li>
-                                    <li><span class="thumb"><img src="/images/pc/thumb/tmp_pdDetail6.jpg" alt=""></span></li>
-                                </ul>
-                            </div>
-                            <div class="area_order">
-                                <div class="opt_color">
-                                    <div class="opt_header">
-                                        <span class="title">컬러</span>
-                                        <span class="color">그레이</span>
-                                    </div>
-                                    <ul>
-                                        <li>
-                                            <a href="" class="on">
-                                                <img src="/images/pc/thumb/tmp_cartColor1.jpg" alt="그레이">
-                                            </a>
-                                        </li>
-                                        <li>
-                                            <a href="">
-                                                <img src="/images/pc/thumb/tmp_cartColor1.jpg" alt="베이지">
-                                            </a>
-                                        </li>
-                                        <li>
-                                            <a href="">
-                                                <img src="/images/pc/thumb/tmp_cartColor1.jpg" alt="그린">
-                                            </a>
-                                        </li>
-                                        <li>
-                                            <a href="">
-                                                <img src="/images/pc/thumb/tmp_cartColor1.jpg" alt="핑크">
-                                            </a>
-                                        </li>
-                                        <li>
-                                            <a href="">
-                                                <img src="/images/pc/thumb/tmp_cartColor1.jpg" alt="민트">
-                                            </a>
-                                        </li>
-                                        <li>
-                                            <a href="">
-                                                <img src="/images/pc/thumb/tmp_cartColor1.jpg" alt="블랙">
-                                            </a>
-                                        </li>
-                                    </ul>
-                                </div>
-                                <div class="opt_size">
-                                    <div class="opt_header">
-                                        <span class="title">사이즈</span>
-                                    </div>
-                                    <div class="form_field">
-                                        <div>
-                                            <input type="radio" name="rdi-optsize" id="rdi-optsize1" value="" checked="">
-                                            <label for="rdi-optsize1"><span>90</span></label>
-                                        </div>
-                                        <div>
-                                            <input type="radio" name="rdi-optsize" id="rdi-optsize2" value="" disabled>
-                                            <label for="rdi-optsize2"><span>95</span></label>
-                                        </div>
-                                        <div>
-                                            <input type="radio" name="rdi-optsize" id="rdi-optsize3" value="">
-                                            <label for="rdi-optsize3"><span>100</span></label>
-                                        </div>
-                                        <div>
-                                            <input type="radio" name="rdi-optsize" id="rdi-optsize4" value="">
-                                            <label for="rdi-optsize4"><span>105</span></label>
-                                        </div>
-                                        <div>
-                                            <input type="radio" name="rdi-optsize" id="rdi-optsize5" value="">
-                                            <label for="rdi-optsize5"><span>110</span></label>
-                                        </div>
-                                        <div>
-                                            <input type="radio" name="rdi-optsize" id="rdi-optsize6" value="">
-                                            <label for="rdi-optsize6"><span>115</span></label>
-                                        </div>
-                                        <div>
-                                            <input type="radio" name="rdi-optsize" id="rdi-optsize7" value="">
-                                            <label for="rdi-optsize7"><span>free</span></label>
-                                        </div>
-                                    </div>
-                                </div>
-                                <div class="opt_select">
-                                    <div class="opt_header">
-                                        <span class="title">옵션선택</span>
-                                    </div>
-                                    <div class="form_field">
-                                        <select id="">
-                                            <option value="" rel="icon-temperature">카키/95</option>
-                                            <option value="">카키/100</option>
-                                            <option value="">카키/105</option>
-                                            <option value="">카키/110</option>
-                                            <option value="">옐로우/95</option>
-                                            <option value="">옐로우/100</option>
-                                            <option value="">옐로우/105</option>
-                                            <option value="">옐로우/110</option>
-                                        </select>
-                                    </div>
-                                </div>
-                                <div class="opt_count">
-                                    <div class="opt_header">
-                                        <span class="title">수량</span>
-                                    </div>
-                                    <div class="number_count">
-                                        <span class="minus"><span class="sr-only">감소</span></span>
-                                        <input type="text" name="" maxlength="3" style='ime-mode:disabled' value="1" />
-                                        <span class="plus"><span class="sr-only">추가</span></span>
-                                    </div>
-                                </div>
-                                <div class="btn_group_block">
-                                    <button class="btn btn_dark btn_block" id=""><span>옵션변경</span></button>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-</div>
-<!-- //옵션변경 팝업 -->
 <!-- 쿠폰사용안내 팝업 -->
 <div class="modal fade od_pop cpinfo_pop" id="cpinfoPop" tabindex="-1" role="dialog" aria-labelledby="cpinfoLabel" aria-hidden="true">
     <div class="modal-dialog" role="document">
@@ -413,8 +275,6 @@
 <link rel="stylesheet" type="text/css" href="/ux/pc/css/swiper.min.css" />
 
 <script type="text/javascript">
-    /* xodud1202 수정 */
-
     $(document).ready(function() {
         // 장바구니 상품 정보 select
         getCartList();
@@ -434,10 +294,29 @@
         });
     }
 
-    /* // xodud1202 수정 */
-
-
+    //상품옵션변경 팝업 > 수량조절
+    $(document).on('click','.opt_modify_pop .number_count .minus',function(e){
+        var $input = $(this).parent().find('input');
+        var count = parseInt($input.val()) - 1;
+        count = count < 1 ? 1 : count;
+        $input.val(count);
+        $input.change();
+        return false;
+    }).on('click','.opt_modify_pop .number_count .plus',function(e){
+        var $input = $(this).parent().find('input');
+        $input.val(parseInt($input.val()) + 1);
+        $input.change();
+        return false;
+    });
 
+    //상품옵션변경 팝업 > 컬러선택 표기
+    $(document).on('click','.opt_modify_pop .opt_color ul li a',function(e){
+        $(this).parents('.opt_color').find('li a').removeClass('on');
+        $(this).addClass('on');
+        var optColor = $(this).find("img").attr('alt');
+        $(this).parent().parent().parent().find(".color").text(optColor);
+        return false;
+    });
 
     $(function(){
         //추천상품 슬라이드