|
|
@@ -30,10 +30,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Comparator;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Optional;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/*
|
|
|
*项目名: netflix
|
|
|
@@ -92,7 +89,18 @@ public class CouponFontServiceImpl implements CouponFontService {
|
|
|
@Transactional(rollbackFor = Throwable.class)
|
|
|
public void collectRecommendCoupon(CouponCollectReq couponCollectReq, Long userId) {
|
|
|
collectCommonCheck(couponCollectReq.getCouponId(), userId);
|
|
|
-
|
|
|
+ CouponRecommend couponRecommend = recommendMapper.selectOne(Wrappers.lambdaQuery(CouponRecommend.class).eq(CouponRecommend::getCouponId, couponCollectReq.getCouponId()).last("limit 1"));
|
|
|
+ if (couponRecommend == null || !couponRecommend.getDeleted() || !couponRecommend.getStatus()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Date upTime = couponRecommend.getUpTime();
|
|
|
+ Date downTime = couponRecommend.getDownTime();
|
|
|
+ if (upTime != null && upTime.after(DateTime.now())) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (downTime != null && downTime.before(DateTime.now())) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
receiveCouponUser(couponCollectReq.getCouponId(), userId, CouponUser.Channel.recommend);
|
|
|
}
|
|
|
|