|
|
|
@ -40,6 +40,7 @@ import org.springframework.util.Assert;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.function.Function; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -244,8 +245,9 @@ public class StationVideoTypeServiceImpl extends BaseServiceImpl<StationVideoTyp
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Map getVideoPointByRegion(Long refDept, String regionCode) { |
|
|
|
|
LambdaQueryWrapper<StationVideoTypeEntity> queryWrapper = Wrappers.<StationVideoTypeEntity>lambdaQuery().select(StationVideoTypeEntity::getPointCode).eq(StationVideoTypeEntity::getDeptId, refDept); |
|
|
|
|
List<String> pointCodes = this.listObjs(queryWrapper, String::valueOf); |
|
|
|
|
LambdaQueryWrapper<StationVideoTypeEntity> queryWrapper = Wrappers.<StationVideoTypeEntity>lambdaQuery().select(StationVideoTypeEntity::getPointCode,StationVideoTypeEntity::getCreateDept).eq(StationVideoTypeEntity::getDeptId, refDept); |
|
|
|
|
List<Map<String, Object>> pointCodeList = this.listMaps(queryWrapper); |
|
|
|
|
List<String> pointCodes = pointCodeList.stream().map(m -> m.get("point_code")).map(String::valueOf).collect(Collectors.toList()); |
|
|
|
|
List<JSONObject> cameras = hikVideoService.cameras(regionCode); |
|
|
|
|
cameras.stream().forEach(camera -> { |
|
|
|
|
if(pointCodes.contains(camera.getString("cameraIndexCode"))) { |
|
|
|
@ -255,7 +257,13 @@ public class StationVideoTypeServiceImpl extends BaseServiceImpl<StationVideoTyp
|
|
|
|
|
camera.put("disabled",false); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return cameras.stream().collect(Collectors.groupingBy(c -> c.getString("cameraName"))); |
|
|
|
|
List<String> devIndexCodes = cameras.stream().map(obj -> obj.get("encodeDevIndexCode")).map(String::valueOf).distinct().collect(Collectors.toList()); |
|
|
|
|
Map<String,String> deviceMap = new HashMap<>(); |
|
|
|
|
devIndexCodes.forEach(devIndexCode -> { |
|
|
|
|
String deviceName = Optional.ofNullable(hikVideoService.getDeviceSingle(devIndexCode)).map(o -> o.getString("name")).orElse(null); |
|
|
|
|
deviceMap.put(devIndexCode,deviceName); |
|
|
|
|
}); |
|
|
|
|
return cameras.stream().collect(Collectors.groupingBy(c -> deviceMap.get(c.getString("encodeDevIndexCode")))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private HikVideoAreaTreeVO generateAreaTree(Map<String, List<HikVideoAreaVO>> videoAreaMapByParent,HikVideoAreaVO area) { |
|
|
|
|