家族-定时任务-钻石结算

This commit is contained in:
khalil
2024-10-11 20:57:03 +08:00
parent f4b3443e2e
commit c953edaf9b
12 changed files with 306 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
package com.accompany.scheduler.task;
import com.accompany.business.service.clan.FamilyDiamondSettlementService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class FamilyDiamondSettlementTask {
@Autowired
private FamilyDiamondSettlementService service;
/**
* 公会钻石结算
* 周一凌晨0点
* */
@Scheduled(cron = "0 0 0 1,16 * *")
public void familyDiamondSettlement() throws InterruptedException {
long now = System.currentTimeMillis();
log.info("familyGoldSettlement() start..........");
service.settlement(null);
long finish = System.currentTimeMillis();
log.info("familyGoldSettlement() cost {}ms finish..........", finish-now);
}
}