Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
ty 10 months ago
parent
commit
96bfc49418
  1. 14
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationVideoTypeServiceImpl.java
  2. 12
      pom.xml

14
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationVideoTypeServiceImpl.java

@ -247,20 +247,28 @@ public class StationVideoTypeServiceImpl extends BaseServiceImpl<StationVideoTyp
public Map getVideoPointByRegion(Long refDept, String regionCode) {
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<String> pointCodes = pointCodeList.stream().map(m -> (String) m.get("point_code")).collect(Collectors.toList());
List<JSONObject> cameras = hikVideoService.cameras(regionCode);
cameras.stream().forEach(camera -> {
if(pointCodes.contains(camera.getString("cameraIndexCode"))) {
camera.put("disabled",true);
camera.put("cameraName",Optional.ofNullable(camera.getString("cameraName")).orElse("")+"(已接入)");
}
else {
camera.put("disabled",false);
}
});
List<String> devIndexCodes = cameras.stream().map(obj -> obj.get("encodeDevIndexCode")).map(String::valueOf).distinct().collect(Collectors.toList());
List<String> devIndexCodes = cameras.stream().map(obj -> obj.getString("encodeDevIndexCode")).distinct().collect(Collectors.toList());
Map<String,String> deviceMap = new HashMap<>();
devIndexCodes.forEach(devIndexCode -> {
String deviceName = Optional.ofNullable(hikVideoService.getDeviceSingle(devIndexCode)).map(o -> Optional.ofNullable(o.getString("name")).orElse("其他")).orElse(null);
String deviceName;
// 级联的下级平台无设备编码 统计为其他
if(StringUtil.isBlank(devIndexCode) || Func.isEmpty(devIndexCode)) {
deviceName = "其他";
}
else {
deviceName = Optional.ofNullable(hikVideoService.getDeviceSingle(devIndexCode)).map(o -> o.getString("name")).orElse("其他");
}
deviceMap.put(devIndexCode,deviceName);
});
return cameras.stream().collect(Collectors.groupingBy(c -> deviceMap.get(c.getString("encodeDevIndexCode"))));

12
pom.xml

@ -14,10 +14,10 @@
<packaging>pom</packaging>
<properties>
<bladex.project.version>5.0.1.RELEASE</bladex.project.version>
<bladex.flow.version>5.0.3-SNAPSHOT</bladex.flow.version>
<!--数据平台接口版本-->
<hzinfo.data.sdk.version>5.1.0.RELEASE</hzinfo.data.sdk.version>
<bladex.project.version>5.1.1.RELEASE</bladex.project.version>
<!-- <bladex.flow.version>5.0.3-SNAPSHOT</bladex.flow.version>-->
<!-- &lt;!&ndash;数据平台接口版本&ndash;&gt;-->
<!-- <hzinfo.data.sdk.version>5.1.0.RELEASE</hzinfo.data.sdk.version>-->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
@ -63,7 +63,7 @@
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-flow-api</artifactId>
<version>${bladex.flow.version}</version>
<version>${bladex.project.version}</version>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
@ -73,7 +73,7 @@
<dependency>
<groupId>com.hnac.hzinfo.data</groupId>
<artifactId>hzinfo-data-sdk</artifactId>
<version>${hzinfo.data.sdk.version}</version>
<version>${bladex.project.version}</version>
</dependency>
<dependency>
<groupId>com.xuxueli</groupId>

Loading…
Cancel
Save