|
|
|
|
@ -130,10 +130,12 @@ public class CameraService {
|
|
|
|
|
public class StatusThread extends Thread {
|
|
|
|
|
private Camera camera;
|
|
|
|
|
private CountDownLatch latch;
|
|
|
|
|
|
|
|
|
|
public StatusThread(Camera camera, CountDownLatch latch) {
|
|
|
|
|
this.camera = camera;
|
|
|
|
|
this.latch = latch;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
try {
|
|
|
|
|
@ -173,8 +175,10 @@ public class CameraService {
|
|
|
|
|
List<Camera> cameras = cameraMapper.selectList(new QueryWrapper<Camera>().last("limit " + (page - 1) * pageNum + "," + pageNum));
|
|
|
|
|
return cameras;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* HD01 - HD05
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public List<Camera> allCameras1() {
|
|
|
|
|
@ -216,6 +220,7 @@ public class CameraService {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 导入IO配置
|
|
|
|
|
*
|
|
|
|
|
* @param file
|
|
|
|
|
* @throws IOException
|
|
|
|
|
*/
|
|
|
|
|
@ -266,17 +271,37 @@ public class CameraService {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* io列表
|
|
|
|
|
*
|
|
|
|
|
* @param cameraId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public List<CameraIO> ioList(Integer cameraId) {
|
|
|
|
|
List<CameraIO> list = ioMapper.cameraIOs(cameraId);
|
|
|
|
|
List<CameraIOConfig> configs = configMapper.selectList(new QueryWrapper<CameraIOConfig>());
|
|
|
|
|
List<CameraIO> list = ioMapper.selectList(new QueryWrapper<CameraIO>().eq("camera_id", cameraId));
|
|
|
|
|
configs = configs.stream()
|
|
|
|
|
.filter(c -> {
|
|
|
|
|
for (CameraIO cameraIO : list) {
|
|
|
|
|
if (c.getCode().equals(cameraIO.getCode())) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
})
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
for (CameraIOConfig config : configs){
|
|
|
|
|
CameraIO cameraIo = new CameraIO();
|
|
|
|
|
cameraIo.setName(config.getName());
|
|
|
|
|
cameraIo.setCode(config.getCode());
|
|
|
|
|
list.add(cameraIo);
|
|
|
|
|
}
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 球机新增、或修改预置点
|
|
|
|
|
* synchronized 设置为同步方法,防止出现同一个ptzId在同一个球机上
|
|
|
|
|
*
|
|
|
|
|
* @param IOId 存在修改,不存在 新增
|
|
|
|
|
* @param cameraId
|
|
|
|
|
*/
|
|
|
|
|
@ -328,6 +353,7 @@ public class CameraService {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 所有的根据code和caameraId获取预置点都使用此方法,有缓存
|
|
|
|
|
*
|
|
|
|
|
* @param code
|
|
|
|
|
* @param cameraId
|
|
|
|
|
* @return
|
|
|
|
|
|