1、数据清理任务增加清理报表数据逻辑

2、删除前端无用的文件
This commit is contained in:
aoshiguchen
2022-11-24 13:50:48 +08:00
parent be00799276
commit 1bd8fabce6
41 changed files with 44 additions and 3098 deletions
@@ -42,4 +42,14 @@ public interface DataCleanMapper extends SqlMapper {
@Delete("delete from `client_connect_record` where create_time < ?")
void cleanClientConnectRecord(long date);
@Delete("delete from `flow_report_minute` where create_time < ?")
void cleanFlowMinuteReport(long date);
@Delete("delete from `flow_report_hour` where create_time < ?")
void cleanFlowHourReport(long date);
@Delete("delete from `flow_report_day` where create_time < ?")
void cleanFlowDayReport(long date);
}
@@ -64,6 +64,19 @@ public class DataCleanJob implements IJobHandler {
*/
private static final Integer CLIENT_CONNECT_RECORD_KEEP_DAYS = 30;
/**
* 流量统计分钟报表记录保留天数
*/
private static final Integer FLOW_MINUTE_REPORT_KEEP_DAYS = 2;
/**
* 流量统计小时报表记录保留天数
*/
private static final Integer FLOW_HOUR_REPORT_KEEP_DAYS = 90;
/**
* 流量统计天报表记录保留天数
*/
private static final Integer FLOW_DAY_REPORT_KEEP_DAYS = 400;
@Override
public void execute(String s) throws Exception {
JobParams jobParams = getParams(s);
@@ -85,6 +98,24 @@ public class DataCleanJob implements IJobHandler {
log.info("清理客户端连接日志 date:{}", sdf.format(date));
dataCleanMapper.cleanClientConnectRecord(date.getTime());
}
{
Date date = DateUtil.addDate(new Date(), Calendar.DATE, -1 * jobParams.getFlowMinuteReportKeepDays());
log.info("清理流通统计分钟报表日志 date:{}", sdf.format(date));
dataCleanMapper.cleanFlowMinuteReport(date.getTime());
}
{
Date date = DateUtil.addDate(new Date(), Calendar.DATE, -1 * jobParams.getFlowHourReportKeepDays());
log.info("清理流通统计小时报表日志 date:{}", sdf.format(date));
dataCleanMapper.cleanFlowHourReport(date.getTime());
}
{
Date date = DateUtil.addDate(new Date(), Calendar.DATE, -1 * jobParams.getFlowDayReportKeepDays());
log.info("清理流通统计日报表日志 date:{}", sdf.format(date));
dataCleanMapper.cleanFlowDayReport(date.getTime());
}
}
public static JobParams getParams(String s) {
@@ -107,5 +138,8 @@ public class DataCleanJob implements IJobHandler {
private Integer jobLogKeepDays;
private Integer userLoginRecordKeepDays;
private Integer clientConnectRecordKeepDays;
private Integer flowMinuteReportKeepDays;
private Integer flowHourReportKeepDays;
private Integer flowDayReportKeepDays;
}
}