|
|
@@ -7,7 +7,6 @@ import com.xunmei.common.core.domain.iot.domain.IotAlarmDefenceArea;
|
|
|
import com.xunmei.common.core.domain.iot.domain.IotAlarmSubsystem;
|
|
|
import com.xunmei.common.core.domain.iot.domain.IotDvrDisk;
|
|
|
import com.xunmei.common.core.domain.iot.domain.IotServerInfo;
|
|
|
-import com.xunmei.common.core.utils.JacksonUtils;
|
|
|
import com.xunmei.common.core.utils.StringUtils;
|
|
|
import com.xunmei.common.redis.utils.RedisUtils;
|
|
|
import com.xunmei.mediator.api.protection.service.IotAlarmDefenceAreaService;
|
|
|
@@ -19,7 +18,6 @@ import com.xunmei.mediator.iot.service.IIotDeviceInfoService;
|
|
|
import com.xunmei.mediator.websocket.constant.WebSocketConstants;
|
|
|
import com.xunmei.mediator.websocket.dto.DeviceBaseInfo;
|
|
|
import com.xunmei.mediator.websocket.dto.WebsocketExecuteReq;
|
|
|
-import com.xunmei.mediator.websocket.dto.WebsocketResult;
|
|
|
import com.xunmei.mediator.websocket.dto.alarmHost.AlarmHostBaseInfo;
|
|
|
import com.xunmei.mediator.websocket.dto.alarmHost.AlarmInputInfo;
|
|
|
import com.xunmei.mediator.websocket.dto.alarmHost.CommunicationParameter;
|
|
|
@@ -30,7 +28,6 @@ import com.xunmei.mediator.websocket.dto.dvs.DvsBaseInfo;
|
|
|
import com.xunmei.mediator.websocket.dto.dvs.DvsInfo;
|
|
|
import com.xunmei.mediator.websocket.enums.DeviceTypeEnum;
|
|
|
import com.xunmei.mediator.websocket.enums.ProductEnums;
|
|
|
-import com.xunmei.mediator.websocket.holder.WebSocketSessionHolder;
|
|
|
import com.xunmei.mediator.websocket.redis.WebsocketPublisher;
|
|
|
import com.xunmei.mediator.websocket.service.RouterService;
|
|
|
import com.xunmei.mediator.websocket.service.WebsocketService;
|
|
|
@@ -88,7 +85,7 @@ public class WebsocketServiceImpl implements WebsocketService, RouterService {
|
|
|
JSONObject args = new JSONObject();
|
|
|
args.put("categories", categories);
|
|
|
|
|
|
- IotServerUtils.invokeIotServer(iotServerDeviceTopic,WebSocketConstants.GET_DEVICE_BASE_INFOS,args);
|
|
|
+ IotServerUtils.invokeIotServer(iotServerDeviceTopic, WebSocketConstants.GET_DEVICE_BASE_INFOS, args);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -97,7 +94,7 @@ public class WebsocketServiceImpl implements WebsocketService, RouterService {
|
|
|
JSONObject args = new JSONObject();
|
|
|
args.put("productNames", productNames);
|
|
|
|
|
|
- IotServerUtils.invokeIotServer(iotServerDeviceTopic,WebSocketConstants.GET_DVS_DEVICE_INFOS,args);
|
|
|
+ IotServerUtils.invokeIotServer(iotServerDeviceTopic, WebSocketConstants.GET_DVS_DEVICE_INFOS, args);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -106,7 +103,7 @@ public class WebsocketServiceImpl implements WebsocketService, RouterService {
|
|
|
JSONObject args = new JSONObject();
|
|
|
args.put("productNames", productNames);
|
|
|
|
|
|
- IotServerUtils.invokeIotServer(iotServerDeviceTopic,WebSocketConstants.GET_ALARM_HOST_DEVICE_INFOS,args);
|
|
|
+ IotServerUtils.invokeIotServer(iotServerDeviceTopic, WebSocketConstants.GET_ALARM_HOST_DEVICE_INFOS, args);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -168,6 +165,7 @@ public class WebsocketServiceImpl implements WebsocketService, RouterService {
|
|
|
|
|
|
/**
|
|
|
* dvs下通道、硬盘、dvs扩展信息基础信息
|
|
|
+ *
|
|
|
* @param dvsBaseInfo
|
|
|
* @param token
|
|
|
* @throws Exception
|
|
|
@@ -233,6 +231,7 @@ public class WebsocketServiceImpl implements WebsocketService, RouterService {
|
|
|
|
|
|
/**
|
|
|
* 报警主机和dvs基础信息
|
|
|
+ *
|
|
|
* @param deviceBaseInfos
|
|
|
* @param token
|
|
|
* @throws Exception
|
|
|
@@ -281,6 +280,7 @@ public class WebsocketServiceImpl implements WebsocketService, RouterService {
|
|
|
|
|
|
/**
|
|
|
* 报警主机下 子系统及防区基础数据和报警主机扩展信息
|
|
|
+ *
|
|
|
* @param alarmHostBaseInfo
|
|
|
* @param token
|
|
|
* @throws Exception
|
|
|
@@ -394,7 +394,7 @@ public class WebsocketServiceImpl implements WebsocketService, RouterService {
|
|
|
log.error("同步视频类基础信息,获取DVS扩展信息为空");
|
|
|
} else {
|
|
|
for (CommunicationParameter parameter : communicationParameterList) {
|
|
|
- IotDeviceInfo info = iIotDeviceInfoService.selectByTypeAndCode(token, DeviceTypeEnum.DVS.getCode(), parameter.getDeviceName());
|
|
|
+ IotDeviceInfo info = iIotDeviceInfoService.selectByTypeAndCode(token, DeviceTypeEnum.DVS.getCode(), parameter.getProductName(), parameter.getDeviceName());
|
|
|
IotDeviceInfoExtend extend = iIotDeviceInfoExtendService.selectByProductDeviceNameAndToken(token, DeviceTypeEnum.DVS.getCode(), parameter.getDeviceName());
|
|
|
if (info == null) {
|
|
|
continue;
|
|
|
@@ -502,7 +502,7 @@ public class WebsocketServiceImpl implements WebsocketService, RouterService {
|
|
|
log.error("同步视频类基础信息,获取通道信息为空");
|
|
|
} else {
|
|
|
for (ChannelInfo channelInfo : channelInfos) {
|
|
|
- IotDeviceInfo info = iIotDeviceInfoService.selectByTypeAndHostAndCode(token, channelInfo.getDeviceName(), channelInfo.getChannelIndex());
|
|
|
+ IotDeviceInfo info = iIotDeviceInfoService.selectByTypeAndHostAndCode(token, channelInfo.getDeviceName(), channelInfo.getProductName(), channelInfo.getChannelIndex());
|
|
|
if (info == null) {
|
|
|
info = createChannelInfo(channelInfo, serverInfo);
|
|
|
addList.add(info);
|
|
|
@@ -643,7 +643,7 @@ public class WebsocketServiceImpl implements WebsocketService, RouterService {
|
|
|
log.error("同步主机基础信息,获取主机信息为空");
|
|
|
} else {
|
|
|
for (DeviceBaseInfo deviceBaseInfo : deviceBaseInfos) {
|
|
|
- IotDeviceInfo info = iIotDeviceInfoService.selectByTypeAndCode(token, getDeviceType(deviceBaseInfo.getCategories()), deviceBaseInfo.getDeviceName());
|
|
|
+ IotDeviceInfo info = iIotDeviceInfoService.selectByTypeAndCode(token, getDeviceType(deviceBaseInfo.getCategories()), deviceBaseInfo.getProductName(), deviceBaseInfo.getDeviceName());
|
|
|
if (info == null) {
|
|
|
info = createHostInfo(deviceBaseInfo, serverInfo);
|
|
|
addList.add(info);
|
|
|
@@ -884,14 +884,14 @@ public class WebsocketServiceImpl implements WebsocketService, RouterService {
|
|
|
try {
|
|
|
if (WebSocketConstants.GET_DEVICE_BASE_INFOS.equals(req.getEvent())) {
|
|
|
JSONObject object = (JSONObject) req.getData();
|
|
|
- if (object != null){
|
|
|
+ if (object != null) {
|
|
|
List<DeviceBaseInfo> deviceBaseInfos = (List<DeviceBaseInfo>) object.get("deviceBaseInfos");
|
|
|
- dealBaseDeviceInfo(deviceBaseInfos,req.getToken());
|
|
|
+ dealBaseDeviceInfo(deviceBaseInfos, req.getToken());
|
|
|
}
|
|
|
} else if (WebSocketConstants.GET_ALARM_HOST_DEVICE_INFOS.equals(req.getEvent())) {
|
|
|
dealAlarmHostBaseInfo((AlarmHostBaseInfo) req.getData(), req.getToken());
|
|
|
- }else if(WebSocketConstants.GET_DVS_DEVICE_INFOS.equals(req.getEvent())){
|
|
|
- dealDvsBaseInfo((DvsBaseInfo) req.getData(),req.getToken());
|
|
|
+ } else if (WebSocketConstants.GET_DVS_DEVICE_INFOS.equals(req.getEvent())) {
|
|
|
+ dealDvsBaseInfo((DvsBaseInfo) req.getData(), req.getToken());
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|