Commit 757cac98 by 吕明尚

验卷增加判断条件

parent a046d5ea
......@@ -155,7 +155,13 @@ public class QPServiceImplAspect {
lambdaQueryWrapper.in(SConsumerCoupon::getUseStatus, UserStatusEnum.UNUSED.getCode(), UserStatusEnum.USED.getCode());
List<SConsumerCoupon> list = sConsumerCouponService.list(lambdaQueryWrapper);
//过滤只有已使用
SConsumerCoupon one = list.stream().filter(sConsumerCoupon -> sConsumerCoupon.getUseStatus().equals(UserStatusEnum.USED.getCode())).findFirst().orElse(null);
SConsumerCoupon one = null;
//判断是否存在已使用的券
if (list.stream().anyMatch(sConsumerCoupon -> sConsumerCoupon.getUseStatus().equals(UserStatusEnum.USED.getCode()))) {
one = list.stream().filter(sConsumerCoupon -> sConsumerCoupon.getUseStatus().equals(UserStatusEnum.USED.getCode())).findFirst().orElse(null);
} else {
one = list.stream().filter(sConsumerCoupon -> sConsumerCoupon.getUseStatus().equals(UserStatusEnum.UNUSED.getCode())).findFirst().orElse(null);
}
couponLog.setConsumerId(one.getConsumerId());
couponLog.setCouponId(one.getId());
LambdaQueryWrapper<SStore> sStoreLambdaQueryWrapper = new LambdaQueryWrapper<>();
......
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