|
@@ -54,6 +54,8 @@ public class Scheduler {
|
|
|
|
|
|
|
|
private final GoodsDonMapper donMapper;
|
|
private final GoodsDonMapper donMapper;
|
|
|
|
|
|
|
|
|
|
+ private final GoodsDonSkuMapper skuMapper;
|
|
|
|
|
+
|
|
|
private final GroupsMapper groupsMapper;
|
|
private final GroupsMapper groupsMapper;
|
|
|
|
|
|
|
|
private final OrderDonService orderDonService;
|
|
private final OrderDonService orderDonService;
|
|
@@ -103,7 +105,6 @@ public class Scheduler {
|
|
|
* 每5分钟清理过期账号
|
|
* 每5分钟清理过期账号
|
|
|
*/
|
|
*/
|
|
|
@Scheduled(cron = "0 0/5 * * * ?")
|
|
@Scheduled(cron = "0 0/5 * * * ?")
|
|
|
- @Transactional(rollbackFor = Throwable.class)
|
|
|
|
|
public void clearExpiry() {
|
|
public void clearExpiry() {
|
|
|
DateTime now = new DateTime();
|
|
DateTime now = new DateTime();
|
|
|
//List<GroupsRelation> expiryList = groupsRelationMapper.selectList(Wrappers.lambdaQuery(GroupsRelation.class).le(GroupsRelation::getExpiryTime, now));
|
|
//List<GroupsRelation> expiryList = groupsRelationMapper.selectList(Wrappers.lambdaQuery(GroupsRelation.class).le(GroupsRelation::getExpiryTime, now));
|
|
@@ -113,6 +114,21 @@ public class Scheduler {
|
|
|
expiryList.forEach(relation -> groupRelationClearService.clearTicket(relation, UserTicketClearedRecord.Source.self));
|
|
expiryList.forEach(relation -> groupRelationClearService.clearTicket(relation, UserTicketClearedRecord.Source.self));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 每天凌晨清除当天过期的ChatGPT PLUS车票
|
|
|
|
|
+ */
|
|
|
|
|
+ @Scheduled(cron = "0 1 0 * * ?")
|
|
|
|
|
+ public void clearChatGPTPlusTicket() {
|
|
|
|
|
+ DateTime now = new DateTime();
|
|
|
|
|
+ DateTime nextBeginDay = DateUtil.offsetDay(DateUtil.beginOfDay(now), 1);
|
|
|
|
|
+ List<Long> gptSkuIds = skuMapper.selectList(Wrappers.lambdaQuery(GoodsDonSku.class)
|
|
|
|
|
+ .eq(GoodsDonSku::getGoodsId, 18)).stream().filter((sku) -> !filter_skuIds.contains(sku.getId())).map(GoodsDonSku::getId).collect(Collectors.toList());
|
|
|
|
|
+ List<GroupsRelation> expiryGPTListToday = groupsRelationMapper.selectExpiredChatGPTRelation(nextBeginDay, gptSkuIds);
|
|
|
|
|
+ log.info("每日凌晨清除当日过期GPT账号start ===> 数量:{}", expiryGPTListToday.size());
|
|
|
|
|
+ //过期账号清楚有效期
|
|
|
|
|
+ expiryGPTListToday.forEach(relation -> groupRelationClearService.clearTicket(relation, UserTicketClearedRecord.Source.self));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Scheduled(cron = "0 0 9 * * ?")
|
|
@Scheduled(cron = "0 0 9 * * ?")
|
|
|
public void expiryWxMsg() throws Exception {
|
|
public void expiryWxMsg() throws Exception {
|
|
|
if (envCommonService.isPrdEnv()) {
|
|
if (envCommonService.isPrdEnv()) {
|