|
|
|
@ -76,31 +76,32 @@ public class CleanLogTask implements SchedulingConfigurer {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void process() {
|
|
|
|
|
//查询删除日志时间配置
|
|
|
|
|
String value = systemParamConfigDao.selectValueByParamKey("clean_log_days");
|
|
|
|
|
if (StrUtil.isBlank(value)) {
|
|
|
|
|
log.info("删除日志天数参数未配置,结束任务");
|
|
|
|
|
} else {
|
|
|
|
|
int days = Integer.parseInt(value);
|
|
|
|
|
if (days > 0) {
|
|
|
|
|
String date = DateUtil.offsetDay(new Date(), -days).toString("yyyy-MM-dd");
|
|
|
|
|
//查询系统日志删除是否开启
|
|
|
|
|
String cleanSystemLogValue = systemParamConfigDao.selectValueByParamKey("clean_system_log");
|
|
|
|
|
if ("1".equals(cleanSystemLogValue)) {
|
|
|
|
|
cleanSystemLog(date);
|
|
|
|
|
}
|
|
|
|
|
String cleanThrLogValue = systemParamConfigDao.selectValueByParamKey("clean_thr_log");
|
|
|
|
|
if ("1".equals(cleanThrLogValue)) {
|
|
|
|
|
cleanThrLog(date);
|
|
|
|
|
}
|
|
|
|
|
String cleanSyncLogValue = systemParamConfigDao.selectValueByParamKey("clean_sync_log");
|
|
|
|
|
if ("1".equals(cleanSyncLogValue)) {
|
|
|
|
|
cleanSyncLog(date);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
log.info("配置删除日志天数为0,不进行删除");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//查询系统日志删除是否开启
|
|
|
|
|
String cleanSystemLog = systemParamConfigDao.selectValueByParamKey("clean_system_log");
|
|
|
|
|
Integer cleanSystemLogValue = Integer.parseInt(cleanSystemLog);
|
|
|
|
|
if (cleanSystemLogValue > 0) {
|
|
|
|
|
String date = DateUtil.offsetDay(new Date(), -cleanSystemLogValue).toString("yyyy-MM-dd");
|
|
|
|
|
cleanSystemLog(date);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String cleanThrLogValue = systemParamConfigDao.selectValueByParamKey("clean_thr_log");
|
|
|
|
|
Integer cleanThrLogValueInt = Integer.parseInt(cleanThrLogValue);
|
|
|
|
|
if (cleanThrLogValueInt > 0) {
|
|
|
|
|
String date = DateUtil.offsetDay(new Date(), -cleanThrLogValueInt).toString("yyyy-MM-dd");
|
|
|
|
|
cleanThrLog(date);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String cleanSyncLogValue = systemParamConfigDao.selectValueByParamKey("clean_sync_log");
|
|
|
|
|
Integer cleanSyncLogValueInt = Integer.parseInt(cleanSyncLogValue);
|
|
|
|
|
if (cleanSyncLogValueInt > 0) {
|
|
|
|
|
String date = DateUtil.offsetDay(new Date(), -cleanSyncLogValueInt).toString("yyyy-MM-dd");
|
|
|
|
|
cleanSyncLog(date);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|