|
|
@@ -563,6 +563,10 @@ public class TsfCouponService {
|
|
|
*/
|
|
|
@Transactional("shopTxnManager")
|
|
|
public String getPlanCouponInfo(Coupon coupon) {
|
|
|
+ int downloadCnt = 1; // 쿠폰당 다운 받을수
|
|
|
+ int custPubLimitQty = 1;
|
|
|
+ int onePubQty = 1;
|
|
|
+
|
|
|
coupon.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
coupon.setFrontGb(TsfSession.getFrontGb());
|
|
|
coupon.setCustGb(TsfSession.getCustGb());
|
|
|
@@ -578,14 +582,39 @@ public class TsfCouponService {
|
|
|
}
|
|
|
Coupon temp = couponList.iterator().next();
|
|
|
temp.setCustNo(TsfSession.getInfo().getCustNo());
|
|
|
-
|
|
|
-
|
|
|
+ onePubQty = temp.getOnePubQty(); // 1회 발급당 발행수량 설정
|
|
|
+
|
|
|
+ log.info("기획전 쿠폰정보 temp {}", temp);
|
|
|
+
|
|
|
+ // 고객당 발급수량 확인
|
|
|
+ if (temp.getCustPubLimitQty() > 0) {
|
|
|
+ int tempCustCouponCnt = temp.getCustPubLimitQty() * onePubQty;
|
|
|
+ //if (coupon.getCustPubLimitQty() <= coupon.getCustCouponCnt()) {
|
|
|
+ log.info("기획전쿠폰 다운 skip: tempCustCouponCnt : {}, temp.getCustPubLimitQty() : {} , onePubQty : {}", tempCustCouponCnt, temp.getCustPubLimitQty(), onePubQty);
|
|
|
+ if (tempCustCouponCnt <= temp.getCustCouponCnt()) {
|
|
|
+ log.info("기획전쿠폰 다운 skip: 쿠폰발급수 : {}, 회원발급수 : {}", temp.getCustPubLimitQty(), temp.getCustCouponCnt());
|
|
|
+ result = "ERROR_30";
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ log.info("기획전쿠폰 다운 쿠폰총발급제한수 skip: temp.getTotPubLimitQty() : {}, temp.getTotCouponCnt() : {} ", temp.getTotPubLimitQty(), temp.getTotCouponCnt());
|
|
|
+ // 발급수 확인
|
|
|
if (temp.getTotPubLimitQty() > 0) {
|
|
|
- if (temp.getCustPubLimitQty() <= temp.getCustCouponCnt()) {
|
|
|
+ if (temp.getTotPubLimitQty() <= temp.getTotCouponCnt()) {
|
|
|
+ log.info("기획전쿠폰 다운 skip: 쿠폰총발급제한수 : {}, 전체발급수 : {}", temp.getTotPubLimitQty(), temp.getTotCouponCnt());
|
|
|
result = "ERROR_30";
|
|
|
return result;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// if (temp.getTotPubLimitQty() > 0) {
|
|
|
+// if (temp.getCustPubLimitQty() <= temp.getCustCouponCnt()) {
|
|
|
+// result = "ERROR_30";
|
|
|
+// return result;
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
// 첫구매여부 (Y:구매이력이없음 | N:구매이력있음) - 구매기간일자 해당기간에 구매이력이 없으면 다운로드 가능
|
|
|
if ("Y".equals(temp.getFirstOrdYn())) {
|
|
|
int firstOrdcnt = orderService.getCustFirstOrderCount(temp);
|