公会月结算定时任务改为东三区
This commit is contained in:
@@ -29,13 +29,19 @@ public class GuildSettleTask {
|
||||
@Autowired
|
||||
private PartitionInfoService partitionInfoService;
|
||||
private static final DateTimeFormatter dateFormatters = DateTimeFormatter.ofPattern(DateTimeUtil.DEFAULT_DATETIME_PATTERN);
|
||||
|
||||
//zone = "Asia/Riyadh zone = "Etc/GMT-3" 两种方式都支持
|
||||
|
||||
/**
|
||||
* 公会月结算
|
||||
* 每月16号凌晨0点10分执行
|
||||
*/
|
||||
@Scheduled(cron = "0 10 0 16 * ?", zone = "GMT-3")
|
||||
@Scheduled(cron = "0 10 0 16 * ?", zone = "Etc/GMT-3")
|
||||
public void monthRankTaskAll1() {
|
||||
Date date = new Date();
|
||||
PartitionInfo byId = partitionInfoService.getById(PartitionEnum.ARAB.getId());
|
||||
ZonedDateTime zonedDateTime = DateTimeUtil.convertWithZoneId(new Date(), byId.getZoneId());
|
||||
log.info("=-=monthRankTaskAll=-=:东三区时间:{}", zonedDateTime.format(dateFormatters));
|
||||
DateTime beginTime = DateUtil.beginOfMonth(date);
|
||||
DateTime endTime = DateUtil.beginOfDay(date);
|
||||
log.info("=-=monthRankTaskAll1=-=:beginTime:{},endTime:{}", DateUtil.formatDateTime(beginTime) , DateUtil.formatDateTime(endTime));
|
||||
@@ -50,9 +56,12 @@ public class GuildSettleTask {
|
||||
* 公户月结算,用户明细
|
||||
* 每月1号凌晨0点10分执行
|
||||
*/
|
||||
@Scheduled(cron = "0 10 0 1 * ?", zone = "GMT-3")
|
||||
@Scheduled(cron = "0 10 0 1 * ?", zone = "Etc/GMT-3")
|
||||
public void monthRankTaskAll2() {
|
||||
Date date = new Date();
|
||||
PartitionInfo byId = partitionInfoService.getById(PartitionEnum.ARAB.getId());
|
||||
ZonedDateTime zonedDateTime = DateTimeUtil.convertWithZoneId(new Date(), byId.getZoneId());
|
||||
log.info("=-=monthRankTaskAll2=-=:东三区时间:{}", zonedDateTime.format(dateFormatters));
|
||||
DateTime lastMonth = DateUtil.offsetMonth(date, -1);
|
||||
DateTime beginTime = DateUtil.offsetDay(lastMonth, 15);
|
||||
DateTime endTime = DateUtil.beginOfDay(date);
|
||||
@@ -67,7 +76,7 @@ public class GuildSettleTask {
|
||||
/**
|
||||
* 主播薪资操作记录结算
|
||||
*/
|
||||
@Scheduled(cron = "0 10 0 * * ?", zone = "GMT-3")
|
||||
@Scheduled(cron = "0 10 0 * * ?", zone = "Etc/GMT-3")
|
||||
public void settleAnchorBill() {
|
||||
//发放奖励逻辑:每月1号/16号为结算日沙特时间00:10(次月1号结算上月16号-月结束的奖励,每月16号结算本月1-15号的奖励)
|
||||
Date date = new Date();
|
||||
@@ -79,26 +88,6 @@ public class GuildSettleTask {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* test
|
||||
*/
|
||||
@Scheduled(cron = "0 50 12 28 * ?", zone = "Asia/Riyadh")
|
||||
public void test2() {
|
||||
PartitionInfo byId = partitionInfoService.getById(PartitionEnum.ARAB.getId());
|
||||
ZonedDateTime zonedDateTime = DateTimeUtil.convertWithZoneId(new Date(), byId.getZoneId());
|
||||
log.info("=======东三区时间执行test2=======,date:" + zonedDateTime.format(dateFormatters));
|
||||
}
|
||||
|
||||
/**
|
||||
* test
|
||||
*/
|
||||
@Scheduled(cron = "0 50 12 28 * ?", zone = "Etc/GMT-3")
|
||||
public void test3() {
|
||||
PartitionInfo byId = partitionInfoService.getById(PartitionEnum.ARAB.getId());
|
||||
ZonedDateTime zonedDateTime = DateTimeUtil.convertWithZoneId(new Date(), byId.getZoneId());
|
||||
log.info("=======东三区时间执行test3=======,date:" + zonedDateTime.format(dateFormatters));
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
// public static void main(String[] args) {
|
||||
|
Reference in New Issue
Block a user