| | |
| | | @Autowired |
| | | private VideoUtil videoUtil; |
| | | |
| | | @Scheduled(cron = "0/1 * * * * ?") // 每秒执行 |
| | | // @Scheduled(cron = "0/9 * * * * ?") // 每秒执行 |
| | | // @Scheduled(cron = "0 0/1 * ?") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void scheduledTask() { |
| | | try { |
| | | System.out.println("海康:开始执行"); |
| | | |
| | | findVideoList(1, 20); |
| | | } catch (Exception ex) { |
| | | |
| | | } |
| | | } |
| | | |
| | | private void findVideoList(Integer pageNo, Integer pageSize) throws Exception { |
| | | private void findVideoList(Integer pageNo, Integer pageSize) { |
| | | try { |
| | | PageResult<Camera> pageResult = videoUtil.callPostCameras(pageNo, pageSize, "0"); |
| | | if (pageResult.getTotal() > 0) { |
| | | if (pageResult.getList().size() > 0) { |
| | |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception ex) { |
| | | System.out.println("海康:" + ex.getMessage()); |
| | | } |
| | | } |
| | | |
| | | private void saveVideoFromCamera(List<Camera> list) { |