记得上下班打卡 | git大法好,push需谨慎

Commit ef02988e authored by 张国柄's avatar 张国柄

~API:用户端获取商品活动优惠券+约束条件:根据是否开放领取来返回活动详情;

parent 0f6b0414
...@@ -42,8 +42,10 @@ public class GoblinCouponImpl implements GoblinCouponService { ...@@ -42,8 +42,10 @@ public class GoblinCouponImpl implements GoblinCouponService {
spuId = spuId.split(pre)[0]; spuId = spuId.split(pre)[0];
} }
List<GoblinStoreCouponVo> listVo = goblinRedisUtils.getGoodsMarketsForCoupon(spuId, storeId); List<GoblinStoreCouponVo> listVo = goblinRedisUtils.getGoodsMarketsForCoupon(spuId, storeId);
LocalDateTime now = LocalDateTime.now();
for (GoblinStoreCouponVo vo : listVo) { for (GoblinStoreCouponVo vo : listVo) {
if (!returnList.contains(vo.getType()) && LocalDateTime.now().isAfter(vo.getStartTime()) && LocalDateTime.now().isBefore(vo.getEndTime())) { if (!returnList.contains(vo.getType()) && "1".equals(vo.getReceiveCurb())
&& now.isAfter(vo.getStartTime()) && now.isBefore(vo.getEndTime())) {
returnList.add(vo.getType()); returnList.add(vo.getType());
} }
} }
...@@ -58,8 +60,10 @@ public class GoblinCouponImpl implements GoblinCouponService { ...@@ -58,8 +60,10 @@ public class GoblinCouponImpl implements GoblinCouponService {
spuId = spuId.split(pre)[0]; spuId = spuId.split(pre)[0];
} }
List<GoblinStoreCouponVo> listVo = goblinRedisUtils.getGoodsMarketsForCoupon(spuId, storeId); List<GoblinStoreCouponVo> listVo = goblinRedisUtils.getGoodsMarketsForCoupon(spuId, storeId);
LocalDateTime now = LocalDateTime.now();
for (GoblinStoreCouponVo vo : listVo) { for (GoblinStoreCouponVo vo : listVo) {
if (vo.getType().equals(type) && LocalDateTime.now().isAfter(vo.getStartTime()) && LocalDateTime.now().isBefore(vo.getEndTime())) { if (vo.getType().equals(type) && "1".equals(vo.getReceiveCurb())
&& now.isAfter(vo.getStartTime()) && now.isBefore(vo.getEndTime())) {
vo.setStock(null); vo.setStock(null);
returnList.add(vo); returnList.add(vo);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment