|
|
@@ -193,27 +193,30 @@ public class TouristAnalysisTask {
|
|
|
@Scheduled(cron = "0 0 2 * * ?")
|
|
|
public synchronized void insertToday() {
|
|
|
|
|
|
- int m=8;
|
|
|
+ int m=1;
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
for (int i=-m; i<0; i++){
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.add(Calendar.DATE, i);
|
|
|
String date = simpleDateFormat.format(calendar.getTime());
|
|
|
List<TourDayt> ld = tourService.queryTourByDay(date);
|
|
|
- if (ld==null){
|
|
|
- TourDayt td = tourService.queryTotalTour(date);
|
|
|
- if (td==null || td.getDateTime()==null){
|
|
|
- td = new TourDayt();
|
|
|
- td.setNum("0");
|
|
|
- }
|
|
|
- td.setDateTime(date);
|
|
|
+ TourDayt td = tourService.queryTotalTour(date);
|
|
|
+ if (td==null || td.getDateTime()==null){
|
|
|
+ td = new TourDayt();
|
|
|
+ td.setNum("0");
|
|
|
+ }
|
|
|
+ td.setDateTime(date);
|
|
|
+ if (ld==null||ld.size()<1){
|
|
|
tourService.insertToday(td);
|
|
|
+ }else{
|
|
|
+ td.setId(ld.get(0).getId());
|
|
|
+ tourService.updateToday(td);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 月统计数据导入每月2号1点执行
|
|
|
- @Scheduled(cron = "0 0 3 2 * ? ")
|
|
|
+// @Scheduled(cron = "0 0 3 2 * ? ")
|
|
|
public synchronized void insertMonth(){
|
|
|
int m=8;
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM");
|
|
|
@@ -259,7 +262,7 @@ public class TouristAnalysisTask {
|
|
|
}
|
|
|
|
|
|
//1月2号1点
|
|
|
- @Scheduled(cron ="0 30 1 2 1 ?")
|
|
|
+// @Scheduled(cron ="0 30 1 2 1 ?")
|
|
|
public synchronized void insertYear(){
|
|
|
int m=2;
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy");
|