|
|
@@ -61,22 +61,24 @@ public class StationStatJob {
|
|
|
var startTime = LocalDateTime.of(statDay.toLocalDate(), LocalTime.MIN);
|
|
|
var endTime = LocalDateTime.of(statDay.toLocalDate(), LocalTime.MAX);
|
|
|
var chargeOrderList = getChargeOrders(startTime, endTime);
|
|
|
+ dayService.replaceBatch((Collection<StationStatDay>) getStationStat(chargeOrderList, true));
|
|
|
dayService.saveBatch((Collection<StationStatDay>) getStationStat(chargeOrderList, true));
|
|
|
log.info("执行站点日统计定时任务-结束");
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 月统计,每月第一天下午15:00启动,统计上月数据
|
|
|
+ * 月统计,每月5日天下午15:00启动,统计上月数据
|
|
|
*/
|
|
|
- @Scheduled(cron = "0 0 15 1 * ?")
|
|
|
+ @Scheduled(cron = "0 0 15 5 * ?")
|
|
|
private void monthStat() {
|
|
|
log.info("执行站点月统计定时任务-开始");
|
|
|
var statMonth = LocalDateTime.now().minusMonths(1);
|
|
|
var startTime = statMonth.with(TemporalAdjusters.firstDayOfMonth()).with(LocalTime.MIN);
|
|
|
var endTime = statMonth.with(TemporalAdjusters.lastDayOfMonth()).with(LocalTime.MAX);
|
|
|
var chargeOrderList = getChargeOrders(startTime, endTime);
|
|
|
- monthService.saveBatch((Collection<StationStatMonth>) getStationStat(chargeOrderList, false));
|
|
|
+ monthService.replaceBatch((Collection<StationStatMonth>) getStationStat(chargeOrderList, false));
|
|
|
+// monthService.saveBatch((Collection<StationStatMonth>) getStationStat(chargeOrderList, false));
|
|
|
log.info("执行站点月统计定时任务-结束");
|
|
|
}
|
|
|
|