Pārlūkot izejas kodu

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

card007 5 gadi atpakaļ
vecāks
revīzija
1a4eeb3d2b

+ 18 - 0
src/main/java/com/style24/front/biz/dao/TsfCustomerDao.java

@@ -29,4 +29,22 @@ public interface TsfCustomerDao {
 	 * @since 2021. 02. 18
 	 */
 	Customer getCustomerInfo(Customer customer);
+
+	/**
+	 * 고객 데이터 생성
+	 * @param customer - 고객정보
+	 * @return 성공여부 - 카운트
+	 * @author jsshin
+	 * @since 2021. 02. 19
+	 */
+	int createCustomer(Customer customer);
+
+	/**
+	 * 고객소셜 데이터 생성
+	 * @param customer - 고객정보
+	 * @return 성공여부 - 카운트
+	 * @author jsshin
+	 * @since 2021. 02. 22
+	 */
+	int createCustomerSns(Customer customer);
 }

+ 64 - 181
src/main/java/com/style24/front/biz/service/TsfCartService.java

@@ -244,52 +244,10 @@ public class TsfCartService {
 		// 장바구니 상품 조회
 		Collection<Order> cartGoodsList = cartDao.getCartGoodsList(order);
 
-		// 품절체크
+		// 품절 아닌 상품만 체크
 		for(Order goods : cartGoodsList) {
-			// 상품 재고 확인
-			GoodsStock checkParam = new GoodsStock();
-
-			String stockResult = "";
-			// 세트 상품일 경우
-			if(TscConstants.GoodsType.SET.value().equals(goods.getGoodsType())) {
-				Order tempItem = new Order();
-				// 세트 구성품이 여러개일 경우
-				if (goods.getItemCd().contains(",")) {
-					tempItem.setItemCdArr(goods.getItemCd().split(","));
-					tempItem.setOptCdArr(goods.getOptCd().split(","));
-					for(int i = 0 ; i < tempItem.getItemCdArr().length ; i++) {
-						checkParam.setGoodsCd(goods.getGoodsCd());
-						checkParam.setItemCd(tempItem.getItemCdArr()[i]);
-						checkParam.setOptCd(tempItem.getOptCdArr()[i]);
-						checkParam.setGoodsQty(goods.getGoodsQty());
-						checkParam.setGoodsType(goods.getGoodsType());
-						stockResult = goodsService.getCheckStock(checkParam);
-					}
-				} else {		// 세트 구성품이 하나일 경우
-					checkParam.setGoodsCd(goods.getGoodsCd());
-					checkParam.setItemCd(goods.getItemCd());
-					checkParam.setOptCd(goods.getOptCd());
-					checkParam.setGoodsQty(goods.getGoodsQty());
-					checkParam.setGoodsType(goods.getGoodsType());
-					stockResult = goodsService.getCheckStock(checkParam);
-				}
-			} else {
-				// 세트상품이 아닐 경우
-				checkParam.setGoodsCd(goods.getGoodsCd());
-				checkParam.setItemCd(goods.getItemCd());
-				checkParam.setOptCd(goods.getOptCd());
-				checkParam.setGoodsQty(goods.getGoodsQty());
-				checkParam.setGoodsType(goods.getGoodsType());
-				stockResult = goodsService.getCheckStock(checkParam);
-			}
-
-			//String stockResult = "SUCCESS";
-
-			if("SUCCESS".equals(stockResult)) {
-				goods.setSoldoutYn("N");
+			if("N".equals(goods.getSoldoutYn())) {
 				cartSqs.add(goods.getCartSq());
-			} else {
-				goods.setSoldoutYn("Y");
 			}
 		}
 
@@ -311,8 +269,12 @@ public class TsfCartService {
 					cart.setAmtTmtbSq(info.getAmtTmtbSq());
 				}
 			}
+			if(cart.getCartSq() == 8) {
+				log.info("CHECK CART >> {}, {}, {}",cart.getCurrPrice(),cart.getGoodsQty(), cart.getTmtbDcAmt());
+			}
+
 			if(cart.getTmtbDcAmt() == 0) {
-				cart.setTmtbDcAmt(cart.getCurrPrice());
+				cart.setTmtbDcAmt(cart.getCurrPrice() * cart.getGoodsQty());
 			}
 		}
 
@@ -342,56 +304,58 @@ public class TsfCartService {
 		Collection<Order> cartGoodsList = coreOrderService.getCartGoodsList(param);
 
 		// 장바구니 내 수량 다다익선 적용 가능 리스트 조회 (등록된 기본,적용 상품 정보 전체 조회)
-		param.setApplyGb(TscConstants.ApplyGb.QTY.value());
-		Collection<Order> tmtbQtyApplyList = cartDao.selectMoreBetterApplyCartList(param);
+		Collection<Order> tmtbApplyList = cartDao.selectMoreBetterApplyCartList(param);
 
-		// 장바구니에 담긴 상품 금액 즉시할인가를 tmtbApplyList 에 저장 (추후 계산식을 위함)
-		for(Order cart : cartGoodsList) {
-			for(Order apply : tmtbQtyApplyList) {
-				if(cart.getCartSq() == apply.getCartSq()) {
-					apply.setCurrPrice(cart.getCurrPrice() + cart.getOptAddPrice());        /* 즉시할인 적용가 */
-				}
-			}
-		}
-
-		// 장바구니 등록 수량 다다익선 일련번호 지정
+		// 장바구니 등록 다다익선 일련번호 지정
+		List<Integer> applySq = new ArrayList<Integer>();
 		List<Integer> qtyApplySq = new ArrayList<Integer>();
-		for(Order tmtbApply : tmtbQtyApplyList) {
-			if(TscConstants.GoodsGb.BASE.value().equals(tmtbApply.getGoodsGb())) {
-				qtyApplySq.add(tmtbApply.getTmtbSq());
-			}
-		}
-		param.setTmtbSqs(qtyApplySq.stream().mapToInt(Integer::intValue).toArray());
-
-		// 장바구니 등록 다다익선 총합 금액
-		Collection<Order> tmtbQtySumDataList = cartDao.selectApplyMoreBetterCartInfoList(param);
-		// 기본상품 목록에 총합 데이터 등록
-		for(Order applyInfo : tmtbQtyApplyList) {
-			for(Order tmtbSumInfo : tmtbQtySumDataList) {
-				if(applyInfo.getTmtbSq() == tmtbSumInfo.getTmtbSq()) {
-					applyInfo.setTmtbSumAmt(tmtbSumInfo.getTmtbSumAmt());
-					applyInfo.setTmtbSumQty(tmtbSumInfo.getTmtbSumQty());
+		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())) {
+				if(tmtbApply.getQtyTmtbSq() > 0) {
+					applySq.add(tmtbApply.getQtyTmtbSq());
+				}
+				if(tmtbApply.getAmtTmtbSq() > 0) {
+					applySq.add(tmtbApply.getAmtTmtbSq());
 				}
 			}
 		}
+		param.setTmtbSqs(applySq.stream().mapToInt(Integer::intValue).toArray());
 
 		// 섹션 정보 조회 후 할인 여부 판단
-		Collection<Order> tmtbQtySectionList = cartDao.selectTmtbSectionValList(qtyApplySq);
-		for(Order applyInfo : tmtbQtyApplyList) {						// 기준 상품 및 다다익선 정보 조회
-			for(Order section : tmtbQtySectionList) {						// 다다익선 할인 조건 조회
-				if(applyInfo.getTmtbSq() == section.getTmtbSq()) {
-					if(TscConstants.ApplyGb.QTY.value().equals(applyInfo.getApplyGb())) {		// 수량 적용
-						if(section.getSectionVal() <= applyInfo.getTmtbSumQty()) {				// 장바구니 수량 할인 기준 달성시
-							if(applyInfo.getSectionVal() <= section.getSectionVal()) {			// 기존 달성된 기준치보다 할인폭이 클 경우 기준할인 수정
-								applyInfo.setSectionVal(section.getSectionVal());
-								applyInfo.setApplyQtySectionYn("Y");
-								applyInfo.setDcWay(section.getDcWay());
-								applyInfo.setDcVal(section.getDcVal());
-							}
-						} else {
-							if(applyInfo.getSectionVal() < 1 && applyInfo.getGoodsGb().equals(TscConstants.GoodsGb.BASE.value())) {
-								applyInfo.setApplyQtySectionYn("N");
-							}
+		Collection<Order> tmtbQtySectionList = cartDao.selectTmtbSectionValList(applySq);
+		for(Order applyInfo : tmtbApplyList) {								// 기준 상품 및 다다익선 정보 조회
+			// 다다익선 할인 조건 조회
+			for(Order section : tmtbQtySectionList) {
+				if(applyInfo.getQtyTmtbSq() == section.getTmtbSq()) {
+
+					// 수량 적용 다다익선
+					if (section.getSectionVal() <= applyInfo.getQtyTmtbSumQty()) {                // 장바구니 수량 할인 기준 달성시
+						if (applyInfo.getSectionVal() <= section.getSectionVal()) {            // 기존 달성된 기준치보다 할인폭이 클 경우 기준할인 수정
+							applyInfo.setSectionVal(section.getSectionVal());
+							applyInfo.setApplyQtySectionYn("Y");
+							applyInfo.setDcWay(section.getDcWay());
+							applyInfo.setDcVal(section.getDcVal());
+						}
+					} else {
+						if (applyInfo.getSectionVal() < 1 && applyInfo.getQtyGoodsGb().equals(TscConstants.GoodsGb.BASE.value())) {
+							applyInfo.setApplyQtySectionYn("N");
+						}
+					}
+				}
+
+				if(applyInfo.getAmtTmtbSq() == section.getTmtbSq()) {
+					// 금액 적용 다다익선
+					if(section.getSectionVal() <= applyInfo.getAmtTmtbSumAmt()) {				// 장바구니 수량 할인 기준 달성시
+						if(applyInfo.getSectionVal() <= section.getSectionVal()) {			// 기존 달성된 기준치보다 할인폭이 클 경우 기준할인 수정
+							applyInfo.setSectionVal(section.getSectionVal());
+							applyInfo.setApplyAmtSectionYn("Y");
+							applyInfo.setDcWay(section.getDcWay());
+							applyInfo.setDcVal(section.getDcVal());
+						}
+					} else {
+						if(applyInfo.getSectionVal() < 1 && applyInfo.getAmtGoodsGb().equals(TscConstants.GoodsGb.BASE.value())) {
+							applyInfo.setApplyAmtSectionYn("N");
 						}
 					}
 				}
@@ -401,11 +365,11 @@ public class TsfCartService {
 		// 수량 다다익선 적용 상품 할인 금액 계산
 		int leftAmt = 0;
 		int i = 0;
-		for(Order resultAmt : tmtbQtyApplyList) {
+		for(Order resultAmt : tmtbApplyList) {
 			if("Y".equals(resultAmt.getApplyQtySectionYn())) {
 				if (TscConstants.DcWay.AMT.value().equals(resultAmt.getDcWay())) {        // 할인 방식 금액일경우
 					i++;
-					int tempAmt = resultAmt.getCurrPrice() * resultAmt.getGoodsQty();
+					int tempAmt = resultAmt.getCurrPrice();
 					if (i == 1) {
 						leftAmt = resultAmt.getDcVal();
 					}
@@ -420,105 +384,23 @@ public class TsfCartService {
 						resultAmt.setTmtbDcAmt(tempAmt - (int)tempDcAmt);
 					}
 				} else {                                                                // 할인 방식 할인율일 경우
-					int tempAmt = resultAmt.getCurrPrice() * resultAmt.getGoodsQty();
+					int tempAmt = resultAmt.getCurrPrice();
 					tempAmt = (int) (tempAmt - (tempAmt * (resultAmt.getDcVal() / 100.0)));
 					resultAmt.setTmtbDcAmt(tempAmt);
 				}
 			}
-		}
 
-		// 장바구니 정보에 수량 다다익선 정보 입력
-		for(Order cart : cartGoodsList) {
-			for(Order apply : tmtbQtyApplyList) {
-				if(cart.getCartSq() == apply.getCartSq()) {
-					cart.setTmtbDcAmt(apply.getTmtbDcAmt());
-					cart.setApplyQtySectionYn(apply.getApplyQtySectionYn());
-					cart.setQtyTmtbNm(apply.getTmtbNm());
-					cart.setQtyTmtbSq(apply.getTmtbSq());
-				}
-			}
-		}
-
-		// 장바구니 내 금액 다다익선 적용 가능 리스트 조회 (등록된 기본,적용 상품 정보 전체 조회)
-		param.setApplyGb(TscConstants.ApplyGb.AMT.value());
-		Collection<Order> tmtbAmtApplyList = cartDao.selectMoreBetterApplyCartList(param);
-
-		// 장바구니에 담긴 상품 금액 즉시할인가를 tmtbAmtApplyList 에 저장 (추후 계산식을 위함)
-		for(Order cart : cartGoodsList) {
-			for(Order apply : tmtbAmtApplyList) {
-				if(cart.getCartSq() == apply.getCartSq()) {
-					if (StringUtils.isEmpty(cart.getQtyTmtbNm())) {
-						apply.setCurrPrice((cart.getCurrPrice() + cart.getOptAddPrice()) * cart.getGoodsQty());
-					} else {
-						apply.setCurrPrice(cart.getTmtbDcAmt());                                                    /* 수량 다다익선 할인된 금액 적용 */
-					}
-				}
-			}
-		}
-
-		// 장바구니 등록 수량 다다익선 일련번호 지정
-		List<Integer> amtApplySq = new ArrayList<Integer>();
-		for(Order tmtbApply : tmtbAmtApplyList) {
-			if(TscConstants.GoodsGb.BASE.value().equals(tmtbApply.getGoodsGb())) {
-				amtApplySq.add(tmtbApply.getTmtbSq());
-			}
-		}
-		param.setTmtbSqs(amtApplySq.stream().mapToInt(Integer::intValue).toArray());
-
-		// 장바구니 등록 금액 다다익선 총합 금액
-		Collection<Order> tmtbAmtSumDataList = cartDao.selectApplyMoreBetterCartInfoList(param);
-
-		Map<Integer, Integer> tmtbAmtSumData = new HashMap<Integer, Integer>();		// 각 상품별 할인 금액을 다다익선별 SUM하기 위한 MAP
-		for(Order applyInfo : tmtbAmtApplyList) {
-			// SUM AMT는 할인된 금액으로 묶어야함.
-			if(tmtbAmtSumData.get(applyInfo.getTmtbSq()) != null && tmtbAmtSumData.get(applyInfo.getTmtbSq()) > 0) {
-				tmtbAmtSumData.put(applyInfo.getTmtbSq(), tmtbAmtSumData.get(applyInfo.getTmtbSq()) + applyInfo.getCurrPrice());
+			if(resultAmt.getTmtbDcAmt() > 0) {
+				resultAmt.setCurrPrice(resultAmt.getTmtbDcAmt());
 			} else {
-				tmtbAmtSumData.put(applyInfo.getTmtbSq(), applyInfo.getCurrPrice());
-			}
-		}
-
-		// 기본상품 목록에 총합 데이터 등록
-		for(Order applyInfo : tmtbAmtApplyList) {
-			for(Order tmtbSumInfo : tmtbAmtSumDataList) {
-				if(applyInfo.getTmtbSq() == tmtbSumInfo.getTmtbSq()) {
-					applyInfo.setTmtbSumQty(tmtbSumInfo.getTmtbSumQty());
-
-					if(tmtbAmtSumData.get(applyInfo.getTmtbSq()) != null && tmtbAmtSumData.get(applyInfo.getTmtbSq()) > 0) {
-						applyInfo.setTmtbSumAmt(tmtbAmtSumData.get(applyInfo.getTmtbSq()));
-					}
-				}
-			}
-		}
-
-
-		// 섹션 정보 조회 후 할인 여부 판단
-		Collection<Order> tmtbAmtSectionList = cartDao.selectTmtbSectionValList(amtApplySq);
-		for(Order applyInfo : tmtbAmtApplyList) {					// 기준 상품 및 다다익선 정보 조회
-			for(Order section : tmtbAmtSectionList) {					// 다다익선 할인 조건 조회
-				if(applyInfo.getTmtbSq() == section.getTmtbSq()) {
-					if (TscConstants.ApplyGb.AMT.value().equals(applyInfo.getApplyGb())) {
-						if(section.getSectionVal() <= applyInfo.getTmtbSumAmt()) {				// 장바구니 수량 할인 기준 달성시
-							if(applyInfo.getSectionVal() <= section.getSectionVal()) {			// 기존 달성된 기준치보다 할인폭이 클 경우 기준할인 수정
-								applyInfo.setSectionVal(section.getSectionVal());
-								applyInfo.setApplyAmtSectionYn("Y");
-								applyInfo.setDcWay(section.getDcWay());
-								applyInfo.setDcVal(section.getDcVal());
-							}
-						} else {
-							if(applyInfo.getSectionVal() < 1 && applyInfo.getGoodsGb().equals(TscConstants.GoodsGb.BASE.value())) {
-								applyInfo.setApplyAmtSectionYn("N");
-							}
-						}
-					}
-				}
+				resultAmt.setCurrPrice(resultAmt.getCurrPrice());
 			}
 		}
 
 		// 금액 다다익선 할인 계산
 		leftAmt = 0;
 		i = 0;
-		for(Order resultAmt : tmtbAmtApplyList) {
+		for(Order resultAmt : tmtbApplyList) {
 			if("Y".equals(resultAmt.getApplyAmtSectionYn())) {
 				if (TscConstants.DcWay.AMT.value().equals(resultAmt.getDcWay())) {        // 할인 방식 금액일경우
 					i++;
@@ -546,11 +428,12 @@ public class TsfCartService {
 
 		// 장바구니 정보에 수량 다다익선 정보 입력
 		for(Order cart : cartGoodsList) {
-			for(Order apply : tmtbAmtApplyList) {
+			for(Order apply : tmtbApplyList) {
 				if(cart.getCartSq() == apply.getCartSq()) {
-					if(apply.getTmtbDcAmt() > 0) {
-						cart.setTmtbDcAmt(apply.getTmtbDcAmt());
-					}
+					cart.setTmtbDcAmt(apply.getTmtbDcAmt());
+					cart.setApplyQtySectionYn(apply.getApplyQtySectionYn());
+					cart.setQtyTmtbNm(apply.getQtyTmtbNm());
+					cart.setQtyTmtbSq(apply.getQtyTmtbSq());
 					cart.setApplyAmtSectionYn(apply.getApplyAmtSectionYn());
 					cart.setAmtTmtbNm(apply.getTmtbNm());
 					cart.setAmtTmtbSq(apply.getTmtbSq());

+ 7 - 0
src/main/java/com/style24/front/biz/service/TsfCouponService.java

@@ -123,6 +123,13 @@ public class TsfCouponService {
 		int buyLimitAmt = 0;
 
 		Collection<Order> serialGoodsList = coreOrderService.getSerialCpnApplyGoodsList(order);
+		for(int i = 0 ; i < param.getCartSqArr().length ; i++) {
+			for(Order cpnInfo : serialGoodsList) {
+				if(param.getCartSqArr()[i] == cpnInfo.getCartSq()) {
+					cpnInfo.setCurrPrice(param.getCurrPrices()[i]);
+				}
+			}
+		}
 
 		// 각 필요 데이터 세팅
 		for(Order info : serialGoodsList) {

+ 56 - 2
src/main/java/com/style24/front/biz/service/TsfCustomerService.java

@@ -1,10 +1,13 @@
 package com.style24.front.biz.service;
 
 import com.gagaframework.web.parameter.GagaMap;
+import com.gagaframework.web.security.GagaPasswordEncoder;
 import com.style24.core.biz.service.TscCustomerService;
 import com.style24.core.support.env.TscConstants;
 import com.style24.core.support.session.TscSession;
+import com.style24.persistence.domain.Coupon;
 import com.style24.persistence.domain.Customer;
+import com.style24.persistence.domain.Point;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -30,6 +33,8 @@ public class TsfCustomerService {
 	@Autowired
 	private TscCustomerService coreCustomerService;
 
+	@Autowired
+	private GagaPasswordEncoder passwordEncoder;
 
 	/**
 	 * 고객아이디 찾기
@@ -65,6 +70,7 @@ public class TsfCustomerService {
 	 */
 	@Transactional("shopTxnManager")
 	public void saveCustomerPassword(Customer customer) {
+		customer.setEncodedPasswd(passwordEncoder.encode(customer.getPasswd()));
 		coreCustomerService.saveCustomerPassword(customer);
 	}
 
@@ -183,14 +189,62 @@ public class TsfCustomerService {
 	}
 
 	/**
-	 * 회원가입
+	 * 회원가입 처리
 	 * @param customer - 일반가입, SNS 가입
 	 * @author jsshin
 	 * @since 2021. 02. 19
 	 */
 	@Transactional("shopTxnManager")
 	public void saveJoinCustomer(Customer customer) {
-		//
+		boolean isSnsJoin = isSnsJoin(customer);
+		if (isSnsJoin) {
+			customer.setEncodedPasswd(" ");
+		} else {
+			customer.setEncodedPasswd(passwordEncoder.encode(customer.getPasswd()));
+		}
+		customer.encryptData();
+		customerDao.createCustomer(customer);
+		saveJoinPostProcessing(customer);
+	}
+
+	/**
+	 * 가입 후 처리 혜택(쿠폰,포인트)
+	 * @param customer - 일반가입, SNS 가입
+	 * @author jsshin
+	 * @since 2021. 02. 19
+	 */
+	@Transactional("shopTxnManager")
+	public void saveJoinPostProcessing(Customer customer) {
+		// 1. 쿠폰
+		// 어드민 > 회원등급정책 관리 > 신규회원등급으로 설정된 쿠폰
+
+
+		// 2. 포인트
+		// 어드민 > 포인트 정책설정 > 신규회원 등록된 포인트
+
+
+	}
+	/**
+	 * SNS 가입인지 확인
+	 * @param customer - 일반가입, SNS 가입
+	 * @return boolean - sns 가입이면 true 아니면 false
+	 * @author jsshin
+	 * @since 2021. 02. 19
+	 */
+	public boolean isSnsJoin(Customer customer) {
+		boolean result = false;
+
+		if (StringUtils.isNotBlank(customer.getKkJoinId())) {
+			result = true;
+		}
+		if (StringUtils.isNotBlank(customer.getNvJoinId())) {
+			result = true;
+		}
+		if (StringUtils.isNotBlank(customer.getYsJoinId())) {
+			result = true;
+		}
+
+		return result;
 	}
 
 }

+ 21 - 8
src/main/java/com/style24/front/biz/web/TsfCustomerController.java

@@ -52,9 +52,6 @@ public class TsfCustomerController extends TsfBaseController {
 	@Autowired
 	private NiceCertify niceCertify;
 
-	@Autowired
-	private GagaPasswordEncoder passwordEncoder;
-
 	/**
 	 * 아이디 찾기 화면
 	 *
@@ -195,7 +192,6 @@ public class TsfCustomerController extends TsfBaseController {
 			log.info("tempPasswd  ====> {}", tempPasswd);
 			customer.setTempPasswdYn("Y"); // 임시비밀번호여부
 			customer.setPasswd(tempPasswd);
-			customer.setEncodedPasswd(passwordEncoder.encode(tempPasswd));
 			customer.setRegNo(custInfo.getCustNo());
 			customer.setUpdNo(custInfo.getCustNo());
 			customer.setCustNo(custInfo.getCustNo());
@@ -309,7 +305,6 @@ public class TsfCustomerController extends TsfBaseController {
 		Customer custInfo = customerService.getCustomerFindId(params);
 		if (custInfo != null) {
 			customer.setTempPasswdYn("N"); // 임시비밀번호여부
-			customer.setEncodedPasswd(passwordEncoder.encode(customer.getPasswd()));
 			customer.setRegNo(custInfo.getCustNo());
 			customer.setUpdNo(custInfo.getCustNo());
 			customer.setCustNo(custInfo.getCustNo());
@@ -570,27 +565,45 @@ public class TsfCustomerController extends TsfBaseController {
 		return result;
 	}
 
-
+	/**
+	 * 가입
+	 *
+	 * @param customer - 고객정보
+	 * @return GagaMap - 결과정보
+	 * @author jsshin
+	 * @since 2021. 02. 18
+	 */
 	@PostMapping("/join/save")
 	@ResponseBody
 	public GagaMap saveJoinCustomer(@RequestBody Customer customer) {
+		GagaMap result = new GagaMap();
 		String encData = TscSession.getAttribute("encData");
 		customer.setEncData(encData);
 		GagaMap authInfo = niceCertify.getCertifyCellPhoneResultInfo(customer);
+		customer.setCustNm(authInfo.getString("sName"));
+		customer.setBirthYmd(authInfo.getString("sBirthDate"));
+		customer.setForeignerYn(authInfo.getString("sforeignerYn"));
 		customer.setCi(authInfo.getString("sCi"));
+		String gender = "G007_"+authInfo.getString("sGender");
+		customer.setSexGb(gender);
+		customer.setSiteCd(TscConstants.Site.STYLE24.value());
+		customer.setFrontGb(TsfSession.getFrontGb());
+		customer.setAfLinkCd(TsfSession.getAttribute("afLinkCd"));
 
 		// 1.입력 받은 데이터 검증
 
 		// 2.고객정보 생성 및 혜택 처리
+		customerService.saveJoinCustomer(customer);
 
 		// 3.알림톡 및 메일 발송
 		try {
-
+			kakaoService.sendJoinCongrat(customer);
 		} catch (Exception e) {
 			log.error("error", e);
 		}
+		result.setBoolean("isJoin", true);
 
-		return new GagaMap();
+		return result;
 	}
 
 }

+ 2 - 0
src/main/java/com/style24/persistence/domain/Coupon.java

@@ -17,6 +17,8 @@ public class Coupon extends TscBaseDomain {
 	// 쿠폰 정보
 	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
 	private int[] cartSqArr;		// 장바구니 일련번호 배열
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private int[] currPrices;		// 상품가격 배열
 	private int cpnId;				// 쿠폰번호
 	private int custNo;				// 회원번호
 	private int availDays;			// 쿠폰 다운로드 후 유효기간일

+ 187 - 53
src/main/java/com/style24/persistence/mybatis/shop/TsfCart.xml

@@ -242,58 +242,135 @@
 	<!-- 다다익선 기본 상품 조회 -->
 	<select id="selectMoreBetterApplyCartList" parameterType="Order" resultType="Order">
 		/* TsfCart.selectMoreBetterApplyCartList : 다다익선 기본 상품 조회 */
-		SELECT C.CART_SQ
-			 , T.TMTB_SQ
-			 , T.APPLY_GB
-		     , TAG.GOODS_CD
-		     , TAG.GOODS_GB
-		     , TAG2.TMTB_CNT
-			 , T.TMTB_NM
-			 , C.GOODS_QTY
-		FROM   TB_CART C
-		INNER  JOIN TB_TMTB_APPLY_GOODS TAG
-		ON	   C.GOODS_CD = TAG.GOODS_CD
-		AND	   TAG.DEL_YN = 'N'
-		INNER  JOIN (SELECT TAG.TMTB_SQ
-						  , COUNT(1) AS TMTB_CNT
-					 FROM   TB_TMTB_APPLY_GOODS TAG
-					 INNER  JOIN TB_CART C
-					 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
-						<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
-		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
-		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'
+		SELECT A.CART_SQ
+			 , MAX(A.QTY_TMTB_SQ) AS QTY_TMTB_SQ
+			 , MAX(A.AMT_TMTB_SQ) AS AMT_TMTB_SQ
+			 , MAX(A.QTY_TMTB_NM) AS QTY_TMTB_NM
+			 , MAX(A.AMT_TMTB_NM) AS AMT_TMTB_NM
+			 , MAX(A.QTY_GOODS_GB) AS QTY_GOODS_GB
+			 , MAX(A.AMT_GOODS_GB) AS AMT_GOODS_GB
+			 , MAX(A.QTY_TMTB_SUM_QTY) AS QTY_TMTB_SUM_QTY
+			 , MAX(A.QTY_TMTB_SUM_AMT) AS QTY_TMTB_SUM_AMT
+			 , MAX(A.AMT_TMTB_SUM_QTY) AS AMT_TMTB_SUM_QTY
+			 , MAX(A.AMT_TMTB_SUM_AMT) AS AMT_TMTB_SUM_AMT
+			 , MAX(A.AMT_TMTB_CNT) AS AMT_TMTB_CNT
+			 , MAX(A.QTY_TMTB_CNT) AS QTY_TMTB_CNT
+			 , A.GOODS_CD
+			 , A.GOODS_QTY
+			 , (A.CURR_PRICE + A.OPT_ADD_PRICE) * A.GOODS_QTY AS CURR_PRICE
+		FROM   (SELECT C.CART_SQ
+					 , CASE WHEN T.APPLY_GB = 'G810_10' THEN T.TMTB_SQ END QTY_TMTB_SQ
+					 , CASE WHEN T.APPLY_GB = 'G810_11' THEN T.TMTB_SQ END AMT_TMTB_SQ
+					 , CASE WHEN T.APPLY_GB = 'G810_10' THEN T.TMTB_NM END QTY_TMTB_NM
+					 , CASE WHEN T.APPLY_GB = 'G810_11' THEN T.TMTB_NM END AMT_TMTB_NM
+					 , CASE WHEN T.APPLY_GB = 'G810_10' THEN TAG.GOODS_GB END QTY_GOODS_GB
+					 , CASE WHEN T.APPLY_GB = 'G810_11' THEN TAG.GOODS_GB END AMT_GOODS_GB
+					 , CASE WHEN T.APPLY_GB = 'G810_10' THEN SUM_DATA.TMTB_SUM_QTY END QTY_TMTB_SUM_QTY
+					 , CASE WHEN T.APPLY_GB = 'G810_10' THEN SUM_DATA.TMTB_SUM_AMT END QTY_TMTB_SUM_AMT
+					 , CASE WHEN T.APPLY_GB = 'G810_11' THEN SUM_DATA.TMTB_SUM_QTY END AMT_TMTB_SUM_QTY
+					 , CASE WHEN T.APPLY_GB = 'G810_11' THEN SUM_DATA.TMTB_SUM_AMT END AMT_TMTB_SUM_AMT
+					 , CASE WHEN T.APPLY_GB = 'G810_10' THEN TAG2.TMTB_CNT END QTY_TMTB_CNT
+					 , CASE WHEN T.APPLY_GB = 'G810_11' THEN TAG2.TMTB_CNT END AMT_TMTB_CNT
+					, TAG.GOODS_CD
+					, C.GOODS_QTY
+					, FN_GET_APPLY_CPN1_PRICE(C.GOODS_CD, #{frontGb}) AS CURR_PRICE
+					, IFNULL(OP.ADD_PRICE, 0) AS OPT_ADD_PRICE
+				FROM   TB_CART C
+				INNER  JOIN TB_TMTB_APPLY_GOODS TAG
+				ON	   C.GOODS_CD = TAG.GOODS_CD
+				AND	   TAG.DEL_YN = 'N'
+				INNER  JOIN (SELECT TAG.TMTB_SQ
+								  , COUNT(1) AS TMTB_CNT
+							 FROM   TB_TMTB_APPLY_GOODS TAG
+							 INNER  JOIN TB_CART C
+							 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
+								<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
+				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
+				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
+							 INNER  JOIN TB_GOODS G
+							 ON     C.GOODS_CD = G.GOODS_CD
+							 INNER  JOIN TB_TMTB T
+							 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'   /* 제외상품 */
+							 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
+												 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
+							 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'
+							 <if test="cartSqArr != null and cartSqArr.length > 0">
+							 	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
+				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
+				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'
+				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'
+				<if test="cartSqArr != null and cartSqArr.length > 0">
+				AND    C.CART_SQ IN
+					<foreach collection="cartSqArr" item="item" index="index"  open="(" close=")" separator=",">
+						#{item}
+					</foreach>
+				</if>
+			   ) A
 		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    T.APPLY_GB = #{applyGb}
-		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
-			<foreach collection="cartSqArr" item="item" index="index"  open="(" close=")" separator=",">
-				#{item}
-			</foreach>
-		</if>
-		ORDER BY TAG.TMTB_SQ, TAG.GOODS_GB
+		GROUP  BY A.CART_SQ
+			 , A.GOODS_CD
+			 , A.GOODS_QTY
+			 , A.CURR_PRICE
+			 , A.OPT_ADD_PRICE
+		ORDER BY A.CART_SQ
 	</select>
 
 	<!-- 다다익선 적용 상품 SUM DATA 조회 -->
@@ -378,6 +455,7 @@
 			 , GROUP_CONCAT(Z.OPT_CD1 ORDER BY Z.CART_DTL_SQ) AS OPT_CD1
 			 , GROUP_CONCAT(Z.OPT_CD2 ORDER BY Z.CART_DTL_SQ) AS OPT_CD2
 			 , GROUP_CONCAT(Z.ITEM_QTY ORDER BY Z.CART_DTL_SQ) AS ITEM_QTYR
+			 , (SELECT COUNT(1) CNT FROM TB_WISHLIST WHERE CUST_NO = ${custNo} AND CUST_NO != 0 AND GOODS_CD = Z.GOODS_CD) AS WISH_CNT
 			 , Z.CART_SQ
 			 , Z.GOODS_CD
 			 , Z.GOODS_NM
@@ -388,6 +466,7 @@
 			 , Z.SUPPLY_COMP_CD
 			 , Z.DELV_FEE_CD
 		     , Z.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
@@ -406,6 +485,7 @@
 		             , G.BRAND_CD
 		             , G.PNT_PRATE
 					 , G.PNT_MRATE
+		             , STOCK.SOLDOUT_YN
 		             , FN_GET_APPLY_CPN1_PRICE(C.GOODS_CD, #{frontGb}) AS CURR_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
@@ -422,6 +502,60 @@
 				INNER  JOIN TB_OPTION O
 				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'
+													ELSE 'Y' END AS SOLDOUT_YN
+										FROM   TB_CART C
+										INNER  JOIN TB_CART_DETAIL CD
+										ON     C.CART_SQ = CD.CART_SQ
+										INNER  JOIN TB_GOODS G
+										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
+										INNER  JOIN VW_STOCK VS
+										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'
+										<if test="custNo == 0">
+											AND    C.CUST_NO = 0
+											AND    C.JSESSION_ID = #{jsessionId}
+										</if>
+										<if test="custNo != 0">
+											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'
+													ELSE 'Y' END AS SOLDOUT_YN
+										FROM   TB_CART C
+										INNER  JOIN TB_CART_DETAIL CD
+										ON     C.CART_SQ = CD.CART_SQ
+										INNER  JOIN TB_GOODS G
+										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
+										WHERE  1=1
+										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}
+										</if>
+										<if test="custNo != 0">
+											AND    C.CUST_NO = #{custNo}
+										</if>
+								       ) A
+								GROUP  BY  A.CART_SQ
+					   ) STOCK
+				ON     C.CART_SQ = STOCK.CART_SQ
 				WHERE  G.SELF_MALL_YN = 'Y'
 				AND    G.GOODS_STAT = 'G008_90'
 				<if test="custNo == 0">
@@ -455,8 +589,8 @@
 		     , Z.PNT_PRATE
 			 , Z.PNT_MRATE
 			 , GI.SYS_IMG_NM
-		ORDER  BY Z.SUPPLY_COMP_CD
-			 , Z.GOODS_CD
+		ORDER  BY Z.DELV_FEE_CD
+			 , Z.CART_SQ
 	</select>
 
 	<!-- 장바구니 업체별 배송비 -->

+ 107 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsfCustomer.xml

@@ -147,4 +147,111 @@
 		     ) A
 	</select>
 
+	<!--고객정보 생성-->
+	<insert id="createCustomer" parameterType="Customer" keyProperty="custNo">
+		/* TsfCustomer.createCustomer */
+		INSERT INTO TB_CUSTOMER (
+		       CUST_NO
+		     , CUST_ID
+		     , CUST_NM
+		     , PASSWD
+		     , BIRTH_YMD
+		     , BIRTH_SM
+		     , SEX_GB
+		     , CELL_PHNNO
+		     , APP_AGREE_YN
+		     , APP_AGREE_DT
+		     , SMS_AGREE_YN
+		     , SMS_AGREE_DT
+		     , EMAIL
+		     , EMAIL_AGREE_YN
+		     , EMAIL_AGREE_DT
+		     , HOME_ZIPCODE
+		     , HOME_BASE_ADDR
+		     , HOME_DTL_ADDR
+		     , SITE_CD
+		     , FRONT_GB
+		     , AF_LINK_CD
+		     , CUST_GB
+		     , CUST_GRADE
+		     , JOIN_DT
+		     , FOREIGNER_YN
+		     , CUST_STAT
+		     , PASSWD_CHG_DT
+		     , TEMP_PASSWD_YN
+		     , LOGIN_LDT
+		     , CI
+		     , AUTH_DT
+		     , MANAGED_RSN
+		     , MANAGED_DTL_RSN
+		     , MANAGED_DT
+		     , SECEDE_RSN
+		     , SECEDE_DTL_RSN
+		     , SECEDE_DT
+		     , REG_NO
+		     , REG_DT
+		     , UPD_NO
+		     , UPD_DT
+		)
+		SELECT #{custNo}                           AS CUST_NO
+		     , #{custId}                           AS CUST_ID
+		     , #{encodedCustNm}                    AS CUST_NM
+		     , #{encodedPasswd}                    AS PASSWD
+		     , #{encodedBirthYmd}                  AS BIRTH_YMD
+		     , #{birthSm}                          AS BIRTH_SM
+		     , #{encodedSexGb}                     AS SEX_GB
+		     , #{encodedCellPhnno}                 AS CELL_PHNNO
+		     , #{appAgreeYn}                       AS APP_AGREE_YN
+		     , #{appAgreeDt}                       AS APP_AGREE_DT
+		     , #{smsAgreeYn}                       AS SMS_AGREE_YN
+		     , #{smsAgreeDt}                       AS SMS_AGREE_DT
+		     , #{encodedEmail}                     AS EMAIL
+		     , #{emailAgreeYn}                     AS EMAIL_AGREE_YN
+		     , #{emailAgreeDt}                     AS EMAIL_AGREE_DT
+		     , #{homeZipcode}                      AS HOME_ZIPCODE
+		     , #{encodedHomeBaseAddr}              AS HOME_BASE_ADDR
+		     , #{encodedHomeDtlAddr}               AS HOME_DTL_ADDR
+		     , #{siteCd}                           AS SITE_CD
+		     , #{frontGb}                          AS FRONT_GB
+		     , #{afLinkCd}                         AS AF_LINK_CD
+		     , #{custGb}                           AS CUST_GB
+		     , #{custGrade}                        AS CUST_GRADE
+		     , NOW()                               AS JOIN_DT
+		     , #{foreignerYn}                      AS FOREIGNER_YN
+		     , #{custStat}                         AS CUST_STAT
+		     , #{passwdChgDt}                      AS PASSWD_CHG_DT
+		     , 'N'                                 AS TEMP_PASSWD_YN
+		     , NOW()                               AS LOGIN_LDT
+		     , #{ci}                               AS CI
+		     , NOW()                               AS AUTH_DT
+		     , #{managedRsn}                       AS MANAGED_RSN
+		     , #{managedDtlRsn}                    AS MANAGED_DTL_RSN
+		     , #{managedDt}                        AS MANAGED_DT
+		     , #{secedeRsn}                        AS SECEDE_RSN
+		     , #{secedeDtlRsn}                     AS SECEDE_DTL_RSN
+		     , #{secedeDt}                         AS SECEDE_DT
+		     , #{custNo}                           AS REG_NO
+		     , NOW()                               AS REG_DT
+		     , #{custNo}                           AS UPD_NO
+		     , NOW()                               AS UPD_DT
+	</insert>
+
+	<!--고객소셜정보 생성-->
+	<insert id="createCustomerSns" parameterType="Customer">
+		/* TsfCustomer.createCustomerSns */
+		INSERT INTO TB_CUSTOMER_SNS (
+		       CUST_NO
+		     , SNS_TYPE
+		     , SNS_ID
+		     , REG_NO
+		     , REG_DT
+		) VALUES (
+		       #{custNo}
+		     , #{snsType}
+		     , #{snsId}
+		     , #{custNo}
+		     , NOW()
+		)
+	</insert>
+
 </mapper>

+ 35 - 15
src/main/webapp/WEB-INF/views/web/cart/cartListAjaxFormWeb.html

@@ -52,7 +52,7 @@
                     </colgroup>
                     <tbody>
                     <th:block th:each="cart, status : ${wmsCartList}">
-                    <tr>
+                    <tr class="cartInfo">
                         <input type="hidden" name="applyQtySectionYn" th:value="${cart.applyQtySectionYn}" />
                         <input type="hidden" name="applyAmtSectionYn" th:value="${cart.applyAmtSectionYn}" />
                         <input type="hidden" name="qtyTmtbSq" th:value="${cart.qtyTmtbSq}" />
@@ -60,6 +60,9 @@
                         <input type="hidden" name="amtTmtbSq" th:value="${cart.amtTmtbSq}" />
                         <input type="hidden" name="amtTmtbNm" th:value="${cart.amtTmtbNm}" />
                         <input type="hidden" name="currPrice" th:value="${cart.currPrice}" />
+                        <input type="hidden" neme="soldoutYn" th:value="${cart.soldoutYn}" />
+                        <input type="hidden" neme="tmtbDcAmt" th:value="${cart.tmtbDcAmt}" />
+                        <input type="hidden" neme="cartSq" th:value="${cart.cartSq}" />
 
                         <td style="border-left:none;">
                             <!-- 주문가능 상품 -->
@@ -87,8 +90,11 @@
                                     </p>
                                     <p class="od_opt" th:each="opt, index : ${cart.itemNmArr}">
                                         <span class="option"><em th:text="${cart.itemNmArr[index.index]} + '_' + ${cart.optCdArr[index.index]}"></em></span>
-                                        <span class="count">수량:<em th:text="${cart.itemQtyArr[index.index]} * ${cart.goodsQty}"></em>개</span>
                                     </p>
+                                    <p class="od_opt">
+                                        <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>
                                     </p>
@@ -123,11 +129,11 @@
                                     <!-- //주문불가시 안내추가 -->
                                 </div>
                                 <div class="info_calc">
-                                    <p class="price" th:if="${cart.tmtbDcAmt > 0}">
+                                    <p class="price" th:if="${cart.tmtbDcAmt < cart.currPrice}">
                                         <span class="selling_price" th:text="|${#numbers.formatInteger(cart.tmtbDcAmt, 1, 'COMMA')} 원|"></span>
                                         <del th:text="|${#numbers.formatInteger(cart.currPrice, 1, 'COMMA')} 원|"></del>
                                     </p>
-                                    <p class="price" th:if="${cart.tmtbDcAmt == 0}">
+                                    <p class="price" th:if="${cart.tmtbDcAmt == cart.currPrice}">
                                         <span class="selling_price" th:text="|${#numbers.formatInteger(cart.currPrice, 1, 'COMMA')} 원|"></span>
                                     </p>
                                     <p class="point"><span th:text="${#numbers.formatInteger(cart.savePntAmt, 1, 'COMMA')}"></span>p 적립예정</p>
@@ -137,7 +143,7 @@
                                     </p>
                                     <p class="util">
                                         <span>
-                                            <button type="button" class="btn_favorite"><span><i class="ico ico_like2"></i><em class="sr-only">관심상품 추가</em></span></button>
+                                            <button type="button" class="btn_favorite" th:classappend="${cart.wishCnt > 0} ? active"><span><i class="ico ico_like2"></i><em class="sr-only">관심상품 추가</em></span></button>
                                         </span>
                                         <span>
                                             <button type="button" class="btn_delete"><span><i class="ico ico_trash"></i><em class="sr-only">상품삭제</em></span></button>
@@ -179,7 +185,7 @@
                     </colgroup>
                     <tbody>
                     <th:block th:each="cart, status : ${delvCartList}">
-                    <tr>
+                    <tr class="cartInfo">
                         <input type="hidden" name="applyQtySectionYn" th:value="${cart.applyQtySectionYn}" />
                         <input type="hidden" name="applyAmtSectionYn" th:value="${cart.applyAmtSectionYn}" />
                         <input type="hidden" name="qtyTmtbSq" th:value="${cart.qtyTmtbSq}" />
@@ -187,12 +193,16 @@
                         <input type="hidden" name="amtTmtbSq" th:value="${cart.amtTmtbSq}" />
                         <input type="hidden" name="amtTmtbNm" th:value="${cart.amtTmtbNm}" />
                         <input type="hidden" name="currPrice" th:value="${cart.currPrice}" />
+                        <input type="hidden" neme="soldoutYn" th:value="${cart.soldoutYn}" />
+                        <input type="hidden" neme="tmtbDcAmt" th:value="${cart.tmtbDcAmt}" />
+                        <input type="hidden" neme="cartSq" th:value="${cart.cartSq}" />
+
                         <td style="border-left:none;">
-                            <div class="info_item">
+                            <div class="info_item" th:classappend="${cart.soldoutYn.equals('Y')} ? unable">
                                 <div class="form_box">
                                     <p class="form_field">
-                                        <input id="od_item_21" name="cartSqArr" type="checkbox" th:value="${cart.cartSq}" th:checked="${cart.soldoutYn.equals('N')}">
-                                        <label for="od_item_21">
+                                        <input th:id="|od_item_${cart.cartSq}|" name="cartSqArr" type="checkbox" th:value="${cart.cartSq}" th:checked="${cart.soldoutYn.equals('N')}" th:disabled="${cart.soldoutYn.equals('Y')}"/>
+                                        <label th:for="|od_item_${cart.cartSq}|">
                                             <span class="sr-only">상품선택</span>
                                         </label>
                                     </p>
@@ -211,7 +221,9 @@
                                     </p>
                                     <p class="od_opt" th:each="opt, index : ${cart.itemNmArr}">
                                         <span class="option"><em th:text="${cart.itemNmArr[index.index]} + '_' + ${cart.optCdArr[index.index]}"></em></span>
-                                        <span class="count">수량:<em th:text="${cart.itemQtyArr[index.index]} * ${cart.goodsQty}"></em>개</span>
+                                    </p>
+                                    <p class="od_opt">
+                                        <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>
@@ -247,11 +259,11 @@
                                     <!-- //주문불가시 안내추가 -->
                                 </div>
                                 <div class="info_calc">
-                                    <p class="price" th:if="${cart.tmtbDcAmt > 0}">
+                                    <p class="price" th:if="${cart.tmtbDcAmt < cart.currPrice}">
                                         <span class="selling_price" th:text="|${#numbers.formatInteger(cart.tmtbDcAmt, 1, 'COMMA')} 원|"></span>
                                         <del th:text="|${#numbers.formatInteger(cart.currPrice, 1, 'COMMA')} 원|"></del>
                                     </p>
-                                    <p class="price" th:if="${cart.tmtbDcAmt == 0}">
+                                    <p class="price" th:if="${cart.tmtbDcAmt == cart.currPrice}">
                                         <span class="selling_price" th:text="|${#numbers.formatInteger(cart.currPrice, 1, 'COMMA')} 원|"></span>
                                     </p>
                                     <p class="point"><span th:text="${#numbers.formatInteger(cart.savePntAmt, 1, 'COMMA')}"></span>p 적립예정</p>
@@ -545,14 +557,17 @@
     }
 
     function serialCpnApply() {
-        let testArr = [];
+        let cartArr = [];
+        let currPrices = [];
         $("#cartListForm input[name=cartSqArr]").each(function(index, item) {
-            testArr.push($(this).val());
+            cartArr.push($(this).val());
+            currPrices.push($(this).parent(".cartInfo").find("input[name=tmtbDcAmt]").val());
         });
 
         let data = {
             rdCpnNm : $("#serialCpnNm").val(),
-            cartSqArr : testArr
+            cartSqArr : cartArr,
+            currPrices : currPrices
         }
 
         let jsonData = JSON.stringify(data);
@@ -603,6 +618,11 @@
         return false;
     });
 
+    $("input[name=cartSqArr]").on("change", function(e) {
+       /*alert($("input[name=cartSqArr]").length + " / " + $("input[name=cartSqArr]:checked").length);
+       alert($("#od_item_15").prop("checked"));*/
+    });
+
     //옵션변경 팝업열기
     $(document).on('click','.btn_opt_pop',function(e){
         $("#optModifyPop").modal("show");