| | |
| | | |
| | | @Autowired |
| | | TaskingMapper taskingMapper; |
| | | @Autowired |
| | | TaskingLogService taskingLogService; |
| | | |
| | | @Scheduled(fixedDelay = 86400000) |
| | | public void deleteTasking() { |
| | | //创建Calendar实例 |
| | | Calendar cal = Calendar.getInstance(); |
| | | //设置当前时间 |
| | | cal.setTime(new Date()); |
| | | cal.add(Calendar.DATE, -5); |
| | | int deleteCount=taskingMapper.deleteJoin(new MPJLambdaWrapper<Tasking>() |
| | | .selectAll(Tasking.class) |
| | | .le(Tasking::getOperationRecordTime,cal.getTime())); |
| | | log.info("定时清除多余数据:{}",deleteCount); |
| | | try { |
| | | //创建Calendar实例 |
| | | Calendar cal = Calendar.getInstance(); |
| | | //设置当前时间 |
| | | cal.setTime(new Date()); |
| | | cal.add(Calendar.DATE, -5); |
| | | int deleteCount=taskingMapper.deleteJoin(new MPJLambdaWrapper<Tasking>() |
| | | .selectAll(Tasking.class) |
| | | .le(Tasking::getOperationRecordTime,cal.getTime())); |
| | | log.info("定时清除多余数据{}",deleteCount); |
| | | |
| | | }catch (Exception e){ |
| | | log.info("定时清除多余数据失败"); |
| | | } |
| | | } |
| | | @Scheduled(fixedDelay = 100000) |
| | | public void reportForWork() { |
| | | try { |
| | | taskingLogService.reportTaskingLog(); |
| | | }catch (Exception e){ |
| | | log.info("定时汇报任务失败!"); |
| | | } |
| | | } |
| | | //@Scheduled(fixedDelay = 1000) |
| | | public void notReceive() { |