Commit a6e50096 by 吕明尚

修改重新验卷自动任务

parent 2214de02
...@@ -37,6 +37,19 @@ public class CouponRetryTask { ...@@ -37,6 +37,19 @@ public class CouponRetryTask {
private static final Integer TRY_NUMBER = 3; private static final Integer TRY_NUMBER = 3;
public void AuToRetryCoupon() { public void AuToRetryCoupon() {
LambdaQueryWrapper<SConsumerCoupon> consumerCouponWrapper = new LambdaQueryWrapper<>();
consumerCouponWrapper.eq(SConsumerCoupon::getUseStatus, UserStatusEnum.UNUSED.getCode());
List<SConsumerCoupon> sConsumerCoupons = sConsumerCouponService.list(consumerCouponWrapper);
List<SConsumerCoupon> expiredSConsumerCounpons = Optional.ofNullable(sConsumerCoupons).orElse(new ArrayList<>()).stream().filter(item -> {
if (item.getEndDate().compareTo(new Date()) < 0) {
item.setUseStatus(UserStatusEnum.EXPIRED.getCode());
return true;
}
return false;
}).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(expiredSConsumerCounpons)) {
sConsumerCouponService.updateBatchById(expiredSConsumerCounpons);
}
LambdaQueryWrapper<CouponLog> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CouponLog> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CouponLog::getStatus, YesNoEnum.no.getDisplay_3()); queryWrapper.eq(CouponLog::getStatus, YesNoEnum.no.getDisplay_3());
queryWrapper.eq(CouponLog::getNumber, TRY_NUMBER); queryWrapper.eq(CouponLog::getNumber, TRY_NUMBER);
...@@ -77,18 +90,6 @@ public class CouponRetryTask { ...@@ -77,18 +90,6 @@ public class CouponRetryTask {
sConsumerCouponService.updateById(sConsumerCoupon); sConsumerCouponService.updateById(sConsumerCoupon);
} }
}); });
LambdaQueryWrapper<SConsumerCoupon> consumerCouponWrapper = new LambdaQueryWrapper<>();
consumerCouponWrapper.eq(SConsumerCoupon::getUseStatus,UserStatusEnum.UNUSED.getCode());
List<SConsumerCoupon> sConsumerCoupons = sConsumerCouponService.list(consumerCouponWrapper);
List<SConsumerCoupon> expiredSConsumerCounpons = Optional.ofNullable(sConsumerCoupons).orElse(new ArrayList<>()).stream().filter(item -> {
if(item.getEndDate().compareTo(new Date()) < 0){
item.setUseStatus(UserStatusEnum.EXPIRED.getCode());
return true;
}
return false;
}).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(expiredSConsumerCounpons)){
sConsumerCouponService.updateBatchById(expiredSConsumerCounpons);
}
} }
} }
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