增加操作日志功能
This commit is contained in:
parent
55a9417cf6
commit
ee9737312f
@ -39,6 +39,8 @@ public class DatasetCleaner {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
GnssCalcDataMapper calcDataMapper;
|
GnssCalcDataMapper calcDataMapper;
|
||||||
|
@Autowired
|
||||||
|
OpLogMapper opLogMapper;
|
||||||
|
|
||||||
//cron表达式格式:
|
//cron表达式格式:
|
||||||
//{秒数} {分钟} {小时} {日期} {月份} {星期} {年份(可为空)}
|
//{秒数} {分钟} {小时} {日期} {月份} {星期} {年份(可为空)}
|
||||||
@ -51,6 +53,15 @@ public class DatasetCleaner {
|
|||||||
checkFwdDataset();
|
checkFwdDataset();
|
||||||
checkStatusDataset();
|
checkStatusDataset();
|
||||||
checkGnssDataDataset();
|
checkGnssDataDataset();
|
||||||
|
checkLogDataset();
|
||||||
|
}
|
||||||
|
|
||||||
|
void checkLogDataset(){
|
||||||
|
long before = 180;
|
||||||
|
QueryWrapper<OperationLog> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.le("op_time", LocalDateTime.now().minusDays(before).format(dateFormatter));
|
||||||
|
int count = opLogMapper.delete(queryWrapper);
|
||||||
|
log.info("clean operation dataset num: "+count);
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkMsgDataset(){
|
void checkMsgDataset(){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user