|
@@ -105,16 +105,30 @@ public class AppSceneService {
|
|
|
|
|
|
Page<AppSceneVo> page = scenePlusMapper.pageList(new Page<>(param.getPageNum(),param.getPageSize()),param);
|
|
Page<AppSceneVo> page = scenePlusMapper.pageList(new Page<>(param.getPageNum(),param.getPageSize()),param);
|
|
|
|
|
|
|
|
+// Set<Long> cameraIdSet = page.getRecords().stream().map(AppSceneVo::getCameraId).collect(Collectors.toSet());
|
|
|
|
+// List<Long> cameraIds = new ArrayList<>(cameraIdSet);
|
|
|
|
+// HashMap<Long, Camera> cameraHashMap = cameraService.getByIds(cameraIds);
|
|
|
|
+// HashMap<Long, CameraDetail> detailHashMap = cameraDetailService.getByCameraIds(cameraIds);
|
|
//账号密码登录 sceneSourceType 取值 1用户场景,2协作场景
|
|
//账号密码登录 sceneSourceType 取值 1用户场景,2协作场景
|
|
//相机登录 sceneSourceType 取值皆为0
|
|
//相机登录 sceneSourceType 取值皆为0
|
|
|
|
|
|
for (AppSceneVo record : page.getRecords()) {
|
|
for (AppSceneVo record : page.getRecords()) {
|
|
- record.setChildName(record.getSnCode());
|
|
|
|
if (record.getStatus() == -1) {
|
|
if (record.getStatus() == -1) {
|
|
record.setStatus(0);
|
|
record.setStatus(0);
|
|
} else if (record.getStatus() == 500) {
|
|
} else if (record.getStatus() == 500) {
|
|
record.setStatus(-1);
|
|
record.setStatus(-1);
|
|
}
|
|
}
|
|
|
|
+ //虚拟场景
|
|
|
|
+ if(record.getCameraId() == null && param.getUserId() != null){
|
|
|
|
+ record.setSceneSourceType(record.getUserId().equals(param.getUserId()) ? 1 :2);
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ //相机场景
|
|
|
|
+ if(param.getCameraId() !=null && record.getCameraId().equals(param.getCameraId())){
|
|
|
|
+ record.setSceneSourceType(0);
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ //用户场景
|
|
if(param.getUserId() != null && record.getUserId() != null){
|
|
if(param.getUserId() != null && record.getUserId() != null){
|
|
record.setSceneSourceType(record.getUserId().equals(param.getUserId()) ? 1 :2);
|
|
record.setSceneSourceType(record.getUserId().equals(param.getUserId()) ? 1 :2);
|
|
}
|
|
}
|