package com.iailab.module.data.job.task;
|
|
import com.iailab.module.data.video.controller.admin.camera.vo.CameraPageReqVO;
|
import com.iailab.module.data.video.config.VideoConfiguration;
|
import com.iailab.module.data.video.dto.CameraDTO;
|
import com.iailab.module.data.video.hikvision.utils.HIKDevice;
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Component;
|
import org.springframework.util.CollectionUtils;
|
|
import java.util.List;
|
|
@Component("devCameraHikvisionTask")
|
public class DevCameraHikvisionTask implements ITask {
|
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
|
@Autowired
|
private static HIKDevice hikDevice;
|
|
@Autowired
|
public void setHIKDevice(HIKDevice tHIKDevice) {
|
DevCameraHikvisionTask.hikDevice = tHIKDevice;
|
}
|
|
@Override
|
public void run(String params) {
|
logger.info("devCameraDahuaTask定时任务正在执行,参数为:{}", params);
|
CameraPageReqVO cameraPageReqVO = new CameraPageReqVO();
|
cameraPageReqVO.setType("1");
|
List<CameraDTO> list = VideoConfiguration.staticCameraService.list(cameraPageReqVO);
|
if (CollectionUtils.isEmpty(list)) {
|
logger.info("Alarm List 为空");
|
return;
|
}
|
list.stream().forEach(cameraDTO -> {
|
hikDevice.loginDevice(cameraDTO);
|
});
|
}
|
}
|