|
@@ -1,5 +1,7 @@
|
|
|
package com.style24.front.biz.service;
|
|
package com.style24.front.biz.service;
|
|
|
|
|
|
|
|
|
|
+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.env.TscConstants;
|
|
|
import com.style24.core.support.session.TscSession;
|
|
import com.style24.core.support.session.TscSession;
|
|
|
import com.style24.front.biz.dao.TsfCartDao;
|
|
import com.style24.front.biz.dao.TsfCartDao;
|
|
@@ -8,12 +10,16 @@ import com.style24.front.support.security.session.TsfSession;
|
|
|
import com.style24.persistence.domain.Cart;
|
|
import com.style24.persistence.domain.Cart;
|
|
|
import com.style24.persistence.domain.Goods;
|
|
import com.style24.persistence.domain.Goods;
|
|
|
import com.style24.persistence.domain.GoodsStock;
|
|
import com.style24.persistence.domain.GoodsStock;
|
|
|
|
|
+import com.style24.persistence.domain.Order;
|
|
|
|
|
+
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Collection;
|
|
import java.util.Collection;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 장바구니 Service
|
|
* 장바구니 Service
|
|
@@ -31,13 +37,15 @@ public class TsfCartService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private TsfGoodsService goodsService;
|
|
private TsfGoodsService goodsService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private TscOrderService coreOrderService;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 장바구니 저장
|
|
* 장바구니 저장
|
|
|
* 단품 : goodsCd, optCd, optCd1, optCd2
|
|
* 단품 : goodsCd, optCd, optCd1, optCd2
|
|
|
* 세트 : goodsCd,
|
|
* 세트 : goodsCd,
|
|
|
* @param cart
|
|
* @param cart
|
|
|
*/
|
|
*/
|
|
|
- @Transactional("shopTxnManager")
|
|
|
|
|
public String saveCartInfo(Collection<Cart> params) {
|
|
public String saveCartInfo(Collection<Cart> params) {
|
|
|
Cart cart = new Cart();
|
|
Cart cart = new Cart();
|
|
|
// JSESSION_ID 저장
|
|
// JSESSION_ID 저장
|
|
@@ -208,4 +216,45 @@ public class TsfCartService {
|
|
|
cartDao.insertCartDetailHst(param); // 장바구니 수정 이력 저장
|
|
cartDao.insertCartDetailHst(param); // 장바구니 수정 이력 저장
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public GagaMap selecCartGoodsList() {
|
|
|
|
|
+ GagaMap result = new GagaMap();
|
|
|
|
|
+
|
|
|
|
|
+ Order order = new Order();
|
|
|
|
|
+
|
|
|
|
|
+ // TODO 로그인 체크
|
|
|
|
|
+ order.setJsessionId("aaec62cc-5f91-47bb-ba65-ebc9a61385cf");
|
|
|
|
|
+ //order.setJsessionId(TscSession.getSessionId());
|
|
|
|
|
+ order.setCustNo(0);
|
|
|
|
|
+ order.setRegNo(0);
|
|
|
|
|
+ order.setUpdNo(0);
|
|
|
|
|
+
|
|
|
|
|
+ // 장바구니 상품 조회
|
|
|
|
|
+ Collection<Order> cartGoodsList = coreOrderService.getCartGoodsList(order);
|
|
|
|
|
+
|
|
|
|
|
+ // 즉시할인쿠폰 적용가 조회
|
|
|
|
|
+ List<Integer> cartSqArr2 = new ArrayList<Integer>();
|
|
|
|
|
+ for(Order temp : cartGoodsList) {
|
|
|
|
|
+ cartSqArr2.add(temp.getCartSq());
|
|
|
|
|
+ }
|
|
|
|
|
+ order.setCartSqArr(cartSqArr2.stream().mapToInt(Integer::intValue).toArray());
|
|
|
|
|
+
|
|
|
|
|
+ Collection<Order> cpn1ApplyGoodsList = coreOrderService.getCpn1ApplyGoodsList(order);
|
|
|
|
|
+
|
|
|
|
|
+ // 즉시 할인가 적용 금액 // pcCurrPrice
|
|
|
|
|
+ for(Order goods : cartGoodsList) {
|
|
|
|
|
+ for(Order amt : cpn1ApplyGoodsList) {
|
|
|
|
|
+ if(goods.getGoodsCd().equals(amt.getGoodsCd())) {
|
|
|
|
|
+ goods.setPcCurrPrice(amt.getPcCurrPrice()); // 즉시할인금액
|
|
|
|
|
+ // TODO 모바일 금액 추가 필요
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ result.put("cartGoodsList", cartGoodsList);
|
|
|
|
|
+
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|