...
|
...
|
@@ -5,6 +5,7 @@ import com.google.common.collect.Range; |
|
|
import com.yoho.core.redis.cluster.operations.serializer.RedisKeyBuilder;
|
|
|
import com.yoho.error.ServiceError;
|
|
|
import com.yoho.error.exception.ServiceException;
|
|
|
import com.yohobuy.ufo.model.promotion.CouponSimpleBo;
|
|
|
import com.yohobuy.ufo.model.promotion.UserCouponsBo;
|
|
|
import com.yohobuy.ufo.model.promotion.UserCouponsListBo;
|
|
|
import com.yohobuy.ufo.model.promotion.constant.CouponProductLimitTypeEnum;
|
...
|
...
|
@@ -65,6 +66,10 @@ public class CouponServiceImpl implements ICouponService { |
|
|
private final Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
SingleCentCouponService singleCentCouponService;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 领取优惠券(支持批量)
|
|
|
* @param uid
|
...
|
...
|
@@ -583,6 +588,41 @@ public class CouponServiceImpl implements ICouponService { |
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 查询优惠券信息
|
|
|
* @param couponTokens
|
|
|
* @return
|
|
|
*/
|
|
|
public List<CouponSimpleBo> queryInnerCoupon(List<String> couponTokens){
|
|
|
List<Coupon> couponList = couponCacheService.getCouponsWithCache(couponTokens);
|
|
|
|
|
|
List<CouponSimpleBo> couponSimpleBoList = couponList.stream().map(coupon -> {
|
|
|
CouponSimpleBo couponSimpleBo = new CouponSimpleBo();
|
|
|
couponSimpleBo.setCouponName(coupon.getCouponName());
|
|
|
couponSimpleBo.setCouponAmount(coupon.getCouponAmount());
|
|
|
couponSimpleBo.setUseLimitType(coupon.getUseLimitType().intValue());
|
|
|
couponSimpleBo.setUseLimitValue(String.valueOf(coupon.getUseLimitValue()));
|
|
|
|
|
|
couponSimpleBo.setCouponToken(coupon.getCouponToken());
|
|
|
|
|
|
Integer sendNum = singleCentCouponService.getImmediateCouponSendNum(coupon.getCouponToken());
|
|
|
if (sendNum == null){
|
|
|
sendNum = coupon.getSendNum();
|
|
|
}
|
|
|
|
|
|
couponSimpleBo.setSendFinished(coupon.getCouponNum()==sendNum?1:0);
|
|
|
|
|
|
return couponSimpleBo;
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
return couponSimpleBoList;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
public CouponInfoListBo queryCouponList(UserCouponListReq req) {
|
|
|
CouponInfoListBo.CouponInfoListBoBuilder boBuilder = CouponInfoListBo.builder();
|
...
|
...
|
|