|
|
@@ -14,21 +14,21 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import com.gagaframework.web.parameter.GagaMap;
|
|
|
-import com.gagaframework.web.rest.server.GagaResponse;
|
|
|
+import com.gagaframework.web.rest.server.GagaResponseStatus;
|
|
|
+import com.style24.core.biz.service.TscCustomerService;
|
|
|
import com.style24.core.support.env.TscConstants;
|
|
|
import com.style24.core.support.message.TscMessageByLocale;
|
|
|
+import com.style24.front.biz.service.TsfCouponService;
|
|
|
import com.style24.front.biz.service.TsfPlanningService;
|
|
|
import com.style24.front.support.controller.TsfBaseController;
|
|
|
-import com.style24.front.support.env.TsfConstants;
|
|
|
import com.style24.front.support.security.session.TsfSession;
|
|
|
import com.style24.persistence.domain.Cate4Srch;
|
|
|
import com.style24.persistence.domain.Coupon;
|
|
|
import com.style24.persistence.domain.Customer;
|
|
|
-import com.style24.persistence.domain.Order;
|
|
|
+import com.style24.persistence.domain.Goods;
|
|
|
import com.style24.persistence.domain.Plan;
|
|
|
import com.style24.persistence.domain.Review;
|
|
|
|
|
|
@@ -51,6 +51,9 @@ public class TsfPlanningController extends TsfBaseController {
|
|
|
@Autowired
|
|
|
private TsfPlanningService planningService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TscCustomerService coreCustomerService;
|
|
|
+
|
|
|
/**
|
|
|
* 기획전 메인 화면
|
|
|
*
|
|
|
@@ -186,6 +189,48 @@ public class TsfPlanningController extends TsfBaseController {
|
|
|
mav.setViewName(super.getDeviceViewName("planning/PlanningDetailForm"));
|
|
|
return mav;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 기획전 쿠폰 다운로드. 고객이 상품쿠폰 다운로드 시 발급됨.
|
|
|
+ *
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ * @author sowon
|
|
|
+ * @since 2021. 3. 24.
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/coupon/download")
|
|
|
+ @ResponseBody
|
|
|
+ public GagaMap createPlanCoupon(@RequestBody Coupon coupon) throws Exception {
|
|
|
+
|
|
|
+ GagaMap result = new GagaMap();
|
|
|
+
|
|
|
+ // 고객정보 조회
|
|
|
+ Customer customer = new Customer();
|
|
|
+ customer.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
+ customer.setCustNo(TsfSession.getInfo().getCustNo());
|
|
|
+ customer.setCustStat(TscConstants.CustStat.ACTIVE.value());
|
|
|
+ customer = coreCustomerService.getCustomerInfo(customer);
|
|
|
+
|
|
|
+ // 고객정보 설정
|
|
|
+ coupon.setCustGb(customer.getCustGb());
|
|
|
+ coupon.setCustGrade(customer.getCustGrade());
|
|
|
+ coupon.setCustNo(customer.getCustNo());
|
|
|
+ // 등급쿠폰 다운 처리
|
|
|
+ int count = planningService.getPlanCouponDownInfo(coupon);
|
|
|
+
|
|
|
+ result.set("status", GagaResponseStatus.SUCCESS.getCode());
|
|
|
+
|
|
|
+ if (count == 0) {
|
|
|
+ result.set("message", message.getMessage("COUPON_0002"));
|
|
|
+ } else {
|
|
|
+ result.set("message", message.getMessage("COUPON_0001", new Object[] {count}));
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 이벤트 메인 화면
|
|
|
*
|