|
|
@@ -1,6 +1,8 @@
|
|
|
package com.style24.front.biz.web;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.Collection;
|
|
|
+import java.util.Date;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.core.env.Environment;
|
|
|
@@ -12,12 +14,16 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
+import org.thymeleaf.util.StringUtils;
|
|
|
|
|
|
import com.gagaframework.web.parameter.GagaMap;
|
|
|
+import com.style24.core.biz.service.TscOrderService;
|
|
|
import com.style24.core.support.message.TscMessageByLocale;
|
|
|
import com.style24.front.biz.service.TsfCartService;
|
|
|
+import com.style24.front.biz.service.TsfCouponService;
|
|
|
import com.style24.front.support.controller.TsfBaseController;
|
|
|
import com.style24.persistence.domain.Cart;
|
|
|
+import com.style24.persistence.domain.Coupon;
|
|
|
import com.style24.persistence.domain.Order;
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -39,6 +45,12 @@ public class TsfCartController extends TsfBaseController {
|
|
|
@Autowired
|
|
|
private TsfCartService cartService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TsfCouponService couponService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TscOrderService coreOrderService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private Environment env;
|
|
|
|
|
|
@@ -88,9 +100,25 @@ public class TsfCartController extends TsfBaseController {
|
|
|
|
|
|
// @ResponseBody
|
|
|
@PostMapping("/goods/list")
|
|
|
- public String selecCartGoodsList(Order param, Model model) {
|
|
|
+ public String selectCartGoodsList(Order param, Model model) {
|
|
|
+ // 장바구니 정보 조회
|
|
|
Order order = cartService.getCartGoodsList(param);
|
|
|
|
|
|
+ // 총알배송 가능 여부 체크
|
|
|
+ int shotCanYn = coreOrderService.getDailyDeliveryCheck(order);
|
|
|
+
|
|
|
+ // 10시 이전에만 총알 배송 가능 여부 체크
|
|
|
+ if(shotCanYn == 1) {
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat ( "MM/dd");
|
|
|
+ Date time = new Date();
|
|
|
+
|
|
|
+ order.setShotCanYn("Y");
|
|
|
+ order.setShotDelvDt(format.format(time));
|
|
|
+ } else {
|
|
|
+ order.setShotCanYn("N");
|
|
|
+ order.setShotDelvYn("N");
|
|
|
+ }
|
|
|
+
|
|
|
model.addAttribute("param", param);
|
|
|
model.addAttribute("order", order);
|
|
|
model.addAttribute("wmsCartList", order.getWmsCartList());
|
|
|
@@ -99,4 +127,36 @@ public class TsfCartController extends TsfBaseController {
|
|
|
|
|
|
return super.getDeviceViewName("cart/cartListAjaxForm");
|
|
|
}
|
|
|
+
|
|
|
+ @ResponseBody
|
|
|
+ @PostMapping("/list/serialCpnApply")
|
|
|
+ public GagaMap serialCpnApply(@RequestBody Cart param) {
|
|
|
+ // 시리얼 쿠폰 사용 정보 조회
|
|
|
+ Coupon cpn = new Coupon();
|
|
|
+ cpn.setRdCpnNm(param.getRdCpnNm());
|
|
|
+ cpn.setCartSqArr(param.getCartSqArr());
|
|
|
+ // TODO 로그인 정보 입력
|
|
|
+ cpn.setCustNo(1000006);
|
|
|
+
|
|
|
+ Coupon useSerial = couponService.getSerialCpnUseInfo(cpn);
|
|
|
+
|
|
|
+ // 시리얼 쿠폰 다운로드하지 않았다면
|
|
|
+ if(useSerial != null) {
|
|
|
+ // 해당 시리얼쿠폰을 사용한적이 있는 경우나, 받은것이 있는경우에 대한 처리(분기)
|
|
|
+
|
|
|
+ } else {
|
|
|
+ // 해당 쿠폰 저장
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ log.info("CHECK IN >> {}", param.getSerialCpnNm());
|
|
|
+ log.info("CHECK IN >> {}", param.getCartSqArr());
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ GagaMap result = new GagaMap();
|
|
|
+ result.put("testResult", "SUCCESS");
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|