task edit for docker

master
yixian 6 years ago
parent b55f8e3f9d
commit 3034bf99fd

@ -2,17 +2,15 @@ package au.com.royalpay.payment.manage.task;
import au.com.royalpay.payment.manage.mappers.bill.BillOrderMapper; import au.com.royalpay.payment.manage.mappers.bill.BillOrderMapper;
import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
/** /**
* Created by wangning on 2018/1/2. * Created by wangning on 2018/1/2.
@ -25,9 +23,12 @@ public class BillOrderCheckTask {
@Resource @Resource
private OrderMapper orderMapper; private OrderMapper orderMapper;
@Resource
private SynchronizedScheduler synchronizedScheduler;
@Scheduled(cron = "0 0/3 * * * ?") @Scheduled(cron = "0 0/3 * * * ?")
public void checkGreenChannel() { public void checkGreenChannel() {
synchronizedScheduler.executeProcess("manage_task:checkGreenChannel", 120_000, () -> {
List<String> orderIds = billOrderMapper.findOrderIdByStatus("0"); List<String> orderIds = billOrderMapper.findOrderIdByStatus("0");
if (CollectionUtils.isEmpty(orderIds)) { if (CollectionUtils.isEmpty(orderIds)) {
return; return;
@ -45,5 +46,7 @@ public class BillOrderCheckTask {
billOrderMapper.updateStatusByOrderId(p, "1"); billOrderMapper.updateStatusByOrderId(p, "1");
} }
} }
});
} }
} }

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.task;
import au.com.royalpay.payment.manage.application.core.SimpleClientService; import au.com.royalpay.payment.manage.application.core.SimpleClientService;
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -16,13 +17,16 @@ import javax.annotation.Resource;
public class CheckPartnerAuthStatusAndSendMessageTask { public class CheckPartnerAuthStatusAndSendMessageTask {
@Resource @Resource
private SimpleClientService simpleClientService; private SimpleClientService simpleClientService;
@Resource
private SynchronizedScheduler synchronizedScheduler;
// @Scheduled(cron = "0 0 9 * * ?") // @Scheduled(cron = "0 0 9 * * ?")
// public void checkAuthAndSendMessage(){ // public void checkAuthAndSendMessage(){
// simpleClientService.checkAuthAndSendMessage(); // simpleClientService.checkAuthAndSendMessage();
// } // }
@Scheduled(cron = "0 0 9 * * ?") @Scheduled(cron = "0 0 9 * * ?")
public void checkGreenChannel() { public void checkGreenChannel() {
simpleClientService.checkGreenChannelClients(); synchronizedScheduler.executeProcess("manage_task:CheckPartnerAuthStatus", 120_000, () -> simpleClientService.checkGreenChannelClients());
} }
} }

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.task;
import au.com.royalpay.payment.manage.apps.core.CustomerImpressionService; import au.com.royalpay.payment.manage.apps.core.CustomerImpressionService;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@ -27,11 +28,14 @@ public class CustomerImpressionTask {
private ClientMapper clientMapper; private ClientMapper clientMapper;
@Resource @Resource
private CustomerImpressionService customerImpressionService; private CustomerImpressionService customerImpressionService;
@Resource
private SynchronizedScheduler synchronizedScheduler;
private ThreadPoolExecutor generatePool = new ThreadPoolExecutor(10, 30, 5, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>()); private ThreadPoolExecutor generatePool = new ThreadPoolExecutor(10, 30, 5, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
@Scheduled(cron = "0 30 3 * * ?") @Scheduled(cron = "0 30 3 * * ?")
public void generateTags() { public void generateTags() {
synchronizedScheduler.executeProcess("manage_task:CustomerImpression", 120_000, () -> {
List<JSONObject> clients = clientMapper.listValidClient(); List<JSONObject> clients = clientMapper.listValidClient();
List<List<JSONObject>> splitList = new ArrayList<>(); List<List<JSONObject>> splitList = new ArrayList<>();
for (int i = 0; i < clients.size(); i += 200) { for (int i = 0; i < clients.size(); i += 200) {
@ -49,10 +53,11 @@ public class CustomerImpressionTask {
}); });
generatePool.execute(task); generatePool.execute(task);
} }
});
} }
@Scheduled(cron = "0/1 * * * * ?") @Scheduled(cron = "0/1 * * * * ?")
public void generateInfo() { public void generateInfo() {
customerImpressionService.generateInfo(); synchronizedScheduler.executeProcess("manage_task:CustomerImpression", 1_000, () -> customerImpressionService.generateInfo());
} }
} }

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.task;
import au.com.royalpay.payment.manage.analysis.core.DailyReport; import au.com.royalpay.payment.manage.analysis.core.DailyReport;
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@ -21,10 +22,14 @@ public class DailyReportGenerationTask {
@Resource @Resource
private DailyReport dailyReport; private DailyReport dailyReport;
@Resource
private SynchronizedScheduler synchronizedScheduler;
@Scheduled(cron = "0 0 10 * * ?") @Scheduled(cron = "0 0 10 * * ?")
public void autoGenerateReport() { public void autoGenerateReport() {
synchronizedScheduler.executeProcess("manage_task:autoGenerateDailyReport", 120_000, () -> {
Date yesterday = DateUtils.addDays(new Date(), -1); Date yesterday = DateUtils.addDays(new Date(), -1);
dailyReport.generateReport(DateFormatUtils.format(yesterday, "yyyy-MM-dd"), true); dailyReport.generateReport(DateFormatUtils.format(yesterday, "yyyy-MM-dd"), true);
});
} }
} }

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.task;
import au.com.royalpay.payment.manage.analysis.core.DashboardService; import au.com.royalpay.payment.manage.analysis.core.DashboardService;
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
@ -19,8 +20,12 @@ import javax.annotation.Resource;
public class DashboardTaskManager { public class DashboardTaskManager {
@Resource @Resource
private DashboardService dashboardService; private DashboardService dashboardService;
@Resource
private SynchronizedScheduler synchronizedScheduler;
@Scheduled(cron = "0 0 2 * * ?") @Scheduled(cron = "0 0 2 * * ?")
public void analysisDashboard() { public void analysisDashboard() {
dashboardService.generateCustomersAndOrdersStatistics(DateUtils.addDays(new Date(), -1)); synchronizedScheduler.executeProcess("manage_task:dashboardTask", 120_000,
() -> dashboardService.generateCustomersAndOrdersStatistics(DateUtils.addDays(new Date(), -1)));
} }
} }

@ -1,6 +1,7 @@
package au.com.royalpay.payment.manage.task; package au.com.royalpay.payment.manage.task;
import au.com.royalpay.payment.manage.billqrcode.core.PartnerBillService; import au.com.royalpay.payment.manage.billqrcode.core.PartnerBillService;
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -15,9 +16,12 @@ import javax.annotation.Resource;
public class DirectedBillCodeStatusDailyCheck { public class DirectedBillCodeStatusDailyCheck {
@Resource @Resource
private PartnerBillService partnerBillService; private PartnerBillService partnerBillService;
@Resource
private SynchronizedScheduler synchronizedScheduler;
@Scheduled(cron = "0 30 5 * * ?") @Scheduled(cron = "0 30 5 * * ?")
public void statusDailyCheck() { public void statusDailyCheck() {
partnerBillService.dailyCheckDirectedBillCode(); synchronizedScheduler.executeProcess("manage_task:dailyCheckDirected", 120_000,
() -> partnerBillService.dailyCheckDirectedBillCode());
} }
} }

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.task;
import au.com.royalpay.payment.manage.mappers.ofei.TopUpOrderMapper; import au.com.royalpay.payment.manage.mappers.ofei.TopUpOrderMapper;
import au.com.royalpay.payment.manage.ofei.core.OfeiServer; import au.com.royalpay.payment.manage.ofei.core.OfeiServer;
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -22,8 +23,12 @@ public class OfeiOrderCheckTask {
private OfeiServer ofeiServer; private OfeiServer ofeiServer;
@Resource @Resource
private TopUpOrderMapper topUpOrderMapper; private TopUpOrderMapper topUpOrderMapper;
@Resource
private SynchronizedScheduler synchronizedScheduler;
@Scheduled(cron = "0 0/20 * * * ?") @Scheduled(cron = "0 0/20 * * * ?")
public void checkGreenChannel() { public void checkGreenChannel() {
synchronizedScheduler.executeProcess("manage_task:ofeiOrderCheck", 120_000, () -> {
List<String> orderIds = topUpOrderMapper.findOrderIdByStatus("10"); List<String> orderIds = topUpOrderMapper.findOrderIdByStatus("10");
if (CollectionUtils.isEmpty(orderIds)) { if (CollectionUtils.isEmpty(orderIds)) {
return; return;
@ -31,5 +36,6 @@ public class OfeiOrderCheckTask {
for (String orderId : orderIds) { for (String orderId : orderIds) {
ofeiServer.checkOrder(orderId); ofeiServer.checkOrder(orderId);
} }
});
} }
} }

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.task;
import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.tools.env.PlatformEnvironment; import au.com.royalpay.payment.tools.env.PlatformEnvironment;
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -18,10 +19,14 @@ public class PartnerInitEmailChecker {
@Resource @Resource
private ClientManager clientManager; private ClientManager clientManager;
@Resource
private SynchronizedScheduler synchronizedScheduler;
@Scheduled(cron = "0 0/5 * * * *") @Scheduled(cron = "0 0/5 * * * *")
public void checkEmailStatus() { public void checkEmailStatus() {
if (PlatformEnvironment.getEnv().taskEnabled()) { if (PlatformEnvironment.getEnv().taskEnabled()) {
clientManager.checkEmailStatus(); synchronizedScheduler.executeProcess("manage_task:emailStatusCheck", 120_000,
() -> clientManager.checkEmailStatus());
} }
} }
} }

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.task;
import au.com.royalpay.payment.manage.analysis.core.CustomersAnalysisService; import au.com.royalpay.payment.manage.analysis.core.CustomersAnalysisService;
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
@ -19,8 +20,12 @@ import javax.annotation.Resource;
public class PartnerTransactionsDailyMsgTaskManager { public class PartnerTransactionsDailyMsgTaskManager {
@Resource @Resource
private CustomersAnalysisService customersAnalysisService; private CustomersAnalysisService customersAnalysisService;
@Resource
private SynchronizedScheduler synchronizedScheduler;
@Scheduled(cron = "0 0 8 * * ?") @Scheduled(cron = "0 0 8 * * ?")
public void analysisDashboard() { public void analysisDashboard() {
customersAnalysisService.sendPartnerTransactionDaily(DateUtils.addDays(new Date(), -1)); synchronizedScheduler.executeProcess("manage_task:partnerDailyMsg", 120_000,
() -> customersAnalysisService.sendPartnerTransactionDaily(DateUtils.addDays(new Date(), -1)));
} }
} }

@ -8,6 +8,7 @@ import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi;
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider;
import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage;
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
@ -44,9 +45,13 @@ public class PostponeClientTask {
private ClientAccountMapper clientAccountMapper; private ClientAccountMapper clientAccountMapper;
@Resource @Resource
private ManagerMapper managerMapper; private ManagerMapper managerMapper;
@Resource
private SynchronizedScheduler synchronizedScheduler;
@Scheduled(cron = "0 30 8 * * ?") @Scheduled(cron = "0 30 8 * * ?")
public void checkGreenChannel() { public void checkGreenChannel() {
synchronizedScheduler.executeProcess("manage_task:postPoneClient", 120_000, () -> {
Date now = new Date(); Date now = new Date();
Date tomorrow = DateUtils.addDays(now, 1); Date tomorrow = DateUtils.addDays(now, 1);
Date yearTomorrow = DateUtils.addYears(tomorrow, 1); Date yearTomorrow = DateUtils.addYears(tomorrow, 1);
@ -91,6 +96,7 @@ public class PostponeClientTask {
}); });
}); });
sendComplianceNotify(expiryClients, expireDate); sendComplianceNotify(expiryClients, expireDate);
});
} }
private void sendClientPostponeNotify(JSONObject account, String newExpireDate) { private void sendClientPostponeNotify(JSONObject account, String newExpireDate) {

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.task;
import au.com.royalpay.payment.manage.redpack.core.ActRedPackService; import au.com.royalpay.payment.manage.redpack.core.ActRedPackService;
import au.com.royalpay.payment.manage.redpack.core.RedpackService; import au.com.royalpay.payment.manage.redpack.core.RedpackService;
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@ -23,20 +24,22 @@ public class RedPackTaskManager {
private RedpackService redpackService; private RedpackService redpackService;
@Resource @Resource
private ActRedPackService actRedPackService; private ActRedPackService actRedPackService;
@Resource
private SynchronizedScheduler synchronizedScheduler;
@Scheduled(cron = "0 0/10 * * * ?") @Scheduled(cron = "0 0/10 * * * ?")
public void updateRedPackStatus() { public void updateRedPackStatus() {
redpackService.updateRedPacketsStatus("3"); synchronizedScheduler.executeProcess("manage_task:updateRedpackStatus", 120_000, () -> redpackService.updateRedPacketsStatus("3"));
} }
@Scheduled(cron = "0 0/10 * * * ?") @Scheduled(cron = "0 0/10 * * * ?")
public void updateAlipayRedPackStatus() { public void updateAlipayRedPackStatus() {
redpackService.updateAlipayRedPacketsStatus("3"); synchronizedScheduler.executeProcess("manage_task:updateAlipayRedpackStatus", 120_000, () -> redpackService.updateAlipayRedPacketsStatus("3"));
} }
@Scheduled(cron = "0 0/3 * * * *") @Scheduled(cron = "0 0/3 * * * *")
public void resendFailedRedpack() { public void resendFailedRedpack() {
actRedPackService.resendFailed(); synchronizedScheduler.executeProcess("manage_task:resendFailedRedpack", 120_000, () -> actRedPackService.resendFailed());
} }
} }

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.task;
import au.com.royalpay.payment.manage.analysis.core.EstimateAnalysisService; import au.com.royalpay.payment.manage.analysis.core.EstimateAnalysisService;
import au.com.royalpay.payment.manage.analysis.core.PlatformClearService; import au.com.royalpay.payment.manage.analysis.core.PlatformClearService;
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -19,26 +20,28 @@ public class SettleEstimateTaskManger {
@Resource @Resource
private PlatformClearService platformClearService; private PlatformClearService platformClearService;
@Resource
private SynchronizedScheduler synchronizedScheduler;
// 3:15 am at every work days // 3:15 am at every work days
@Scheduled(cron = "0 20 3 * * ?") @Scheduled(cron = "0 20 3 * * ?")
public void generateSettleAmount() { public void generateSettleAmount() {
estimateAnalysisService.generateSettleAmount(); synchronizedScheduler.executeProcess("manage_task:genSettleAmount", 120_000, () -> estimateAnalysisService.generateSettleAmount());
} }
// 2:15 every day // 2:15 every day
@Scheduled(cron = "0 0 3 * * ?") @Scheduled(cron = "0 0 3 * * ?")
public void generateTransactionAmount() { public void generateTransactionAmount() {
estimateAnalysisService.generateTransactionData(); synchronizedScheduler.executeProcess("manage_task:genTransAmount", 120_000, () -> estimateAnalysisService.generateTransactionData());
} }
@Scheduled(cron = "0 0 13 * * ?") @Scheduled(cron = "0 0 13 * * ?")
public void generateSettleLogs() { public void generateSettleLogs() {
platformClearService.generateSettleLogs(); synchronizedScheduler.executeProcess("manage_task:genSettleLog", 120_000, () -> platformClearService.generateSettleLogs());
} }
@Scheduled(cron = "0 0 10 * * ?") @Scheduled(cron = "0 0 10 * * ?")
public void generateSettleLogs2() { public void generateSettleLogs2() {
platformClearService.generateSettleLogs(); synchronizedScheduler.executeProcess("manage_task:genSettleLog", 120_000, () -> platformClearService.generateSettleLogs());
} }
} }

@ -1,6 +1,7 @@
package au.com.royalpay.payment.manage.task; package au.com.royalpay.payment.manage.task;
import au.com.royalpay.payment.manage.merchantid.core.MerchantIdManageService; import au.com.royalpay.payment.manage.merchantid.core.MerchantIdManageService;
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -12,8 +13,11 @@ import javax.annotation.Resource;
public class SubMerchantIdTaskManager { public class SubMerchantIdTaskManager {
@Resource @Resource
private MerchantIdManageService merchantIdManageService; private MerchantIdManageService merchantIdManageService;
@Resource
private SynchronizedScheduler synchronizedScheduler;
@Scheduled(cron = "0 0 4 * * ?") @Scheduled(cron = "0 0 4 * * ?")
public void analysisDashboard() { public void analysisDashboard() {
merchantIdManageService.generateClientsSunMerchantId(); synchronizedScheduler.executeProcess("manage_task:checkSubMchId", 120_000, () -> merchantIdManageService.generateClientsSunMerchantId());
} }
} }

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.task;
import au.com.royalpay.payment.manage.analysis.core.WeekReporter; import au.com.royalpay.payment.manage.analysis.core.WeekReporter;
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@ -21,11 +22,15 @@ public class WeekReportGenerationTask {
@Resource @Resource
private WeekReporter weekReporter; private WeekReporter weekReporter;
@Resource
private SynchronizedScheduler synchronizedScheduler;
@Scheduled(cron = "0 0 2 * * 1") @Scheduled(cron = "0 0 2 * * 1")
public void autoGenerateReport() { public void autoGenerateReport() {
synchronizedScheduler.executeProcess("manage_task:genWeekReport", 120_000, () -> {
Date lastweek = new Date(); Date lastweek = new Date();
lastweek = DateUtils.addDays(lastweek, -7); lastweek = DateUtils.addDays(lastweek, -7);
weekReporter.generateReport(DateFormatUtils.format(lastweek, "yyyy-MM-dd"), true); weekReporter.generateReport(DateFormatUtils.format(lastweek, "yyyy-MM-dd"), true);
});
} }
} }

Loading…
Cancel
Save