增加操作日志功能

This commit is contained in:
weidong 2024-06-18 19:07:15 +08:00
parent 55a9417cf6
commit ee9737312f

View File

@ -39,6 +39,8 @@ public class DatasetCleaner {
@Autowired
GnssCalcDataMapper calcDataMapper;
@Autowired
OpLogMapper opLogMapper;
//cron表达式格式
//{秒数} {分钟} {小时} {日期} {月份} {星期} {年份(可为空)}
@ -51,6 +53,15 @@ public class DatasetCleaner {
checkFwdDataset();
checkStatusDataset();
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(){