|
|
|
|
@ -24,7 +24,11 @@ public class EnterprisePowerTaskJob { |
|
|
|
|
//统计前一天的数据
|
|
|
|
|
Date now = new Date(); |
|
|
|
|
String currentDay = DateFormatUtils.format(DateUtils.addDays(now,-1),"yyyy-MM-dd"); |
|
|
|
|
String currentMonth = DateFormatUtils.format(DateUtils.addDays(now,-1),"yyyyMM"); |
|
|
|
|
enterprisePowerService.insertData(currentDay); |
|
|
|
|
//保存昨天数据
|
|
|
|
|
String tableName = "t_instrument_data_"+currentMonth; |
|
|
|
|
enterprisePowerService.insertCurrentDayData(currentDay,tableName); |
|
|
|
|
//删除7天前的数据,数据表里只保留7天数据
|
|
|
|
|
String days = DateFormatUtils.format(DateUtils.addDays(now,-6),"yyyy-MM-dd") + " 00:00:00"; |
|
|
|
|
enterprisePowerService.deleteData(days); |
|
|
|
|
|