|
|
@ -27,30 +27,30 @@ public class MarriageInformationContactApplyTask { |
|
|
@Resource |
|
|
@Resource |
|
|
private MarriageInformationContactApplyAggregate marriageInformationContactApplyAggregate; |
|
|
private MarriageInformationContactApplyAggregate marriageInformationContactApplyAggregate; |
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 0 0 1 * *") |
|
|
|
|
|
public void handle() { |
|
|
|
|
|
try { |
|
|
|
|
|
log.error("联系申请任务开始"); |
|
|
|
|
|
//一个月整前的资料赠送权益 |
|
|
|
|
|
LocalDateTime time = LocalDate.now().minusDays(7).atStartOfDay(); |
|
|
|
|
|
while (true) { |
|
|
|
|
|
List<MarriageInformationContactApply> list = marriageInformationContactApplyDao.selectList(new LambdaQueryWrapper<MarriageInformationContactApply>() |
|
|
|
|
|
.eq(MarriageInformationContactApply::getStatus, MarriageInformationContactApplyStatusEnum.PENDING) |
|
|
|
|
|
.ge(MarriageInformationContactApply::getCreateTime, time) |
|
|
|
|
|
.last("limit 100")); |
|
|
|
|
|
if (CollUtil.isNotEmpty(list)) { |
|
|
|
|
|
for (MarriageInformationContactApply apply : list) { |
|
|
|
|
|
apply.setStatus(MarriageInformationContactApplyStatusEnum.REJECTED); |
|
|
|
|
|
marriageInformationContactApplyAggregate.edit(apply); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
log.error("联系申请任务结束"); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
log.error("联系申请任务异常", e); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// @Scheduled(cron = "0 0 0 1 * *") |
|
|
|
|
|
// public void handle() { |
|
|
|
|
|
// try { |
|
|
|
|
|
// log.error("联系申请任务开始"); |
|
|
|
|
|
// //一个月整前的资料赠送权益 |
|
|
|
|
|
// LocalDateTime time = LocalDate.now().minusDays(7).atStartOfDay(); |
|
|
|
|
|
// while (true) { |
|
|
|
|
|
// List<MarriageInformationContactApply> list = marriageInformationContactApplyDao.selectList(new LambdaQueryWrapper<MarriageInformationContactApply>() |
|
|
|
|
|
// .eq(MarriageInformationContactApply::getStatus, MarriageInformationContactApplyStatusEnum.PENDING) |
|
|
|
|
|
// .ge(MarriageInformationContactApply::getCreateTime, time) |
|
|
|
|
|
// .last("limit 100")); |
|
|
|
|
|
// if (CollUtil.isNotEmpty(list)) { |
|
|
|
|
|
// for (MarriageInformationContactApply apply : list) { |
|
|
|
|
|
// apply.setStatus(MarriageInformationContactApplyStatusEnum.REJECTED); |
|
|
|
|
|
// marriageInformationContactApplyAggregate.edit(apply); |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// break; |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// log.error("联系申请任务结束"); |
|
|
|
|
|
// } catch (Exception e) { |
|
|
|
|
|
// log.error("联系申请任务异常", e); |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
} |
|
|
} |
|
|
|
|
|
|