|
|
@@ -86,7 +86,7 @@ public class WebsocketServiceImpl implements WebsocketService, RouterService {
|
|
|
|
|
|
@Override
|
|
|
public void invokeBaseDeviceInfoForSchedule() {
|
|
|
- List<String> categories = Arrays.asList(WebSocketConstants.DVS, WebSocketConstants.ALARM_HOST);
|
|
|
+ List<String> categories = Arrays.asList(WebSocketConstants.FSU);
|
|
|
JSONObject args = new JSONObject();
|
|
|
args.put("categories", categories);
|
|
|
WebsocketResult websocketResult = IotServerUtils.invokeIotServer(iotServerDeviceTopic, new JSONObject(), WebSocketConstants.GET_DEVICE_BASE_INFOS, args);
|
|
|
@@ -653,7 +653,7 @@ public class WebsocketServiceImpl implements WebsocketService, RouterService {
|
|
|
log.error("同步主机基础信息,获取主机信息为空");
|
|
|
} else {
|
|
|
for (DeviceBaseInfo deviceBaseInfo : deviceBaseInfos) {
|
|
|
- IotDeviceInfo info = iIotDeviceInfoService.selectByTypeAndCode(token, getDeviceType(deviceBaseInfo.getCategories()), deviceBaseInfo.getProductName(), deviceBaseInfo.getDeviceName());
|
|
|
+ IotDeviceInfo info = iIotDeviceInfoService.selectByTypeAndCode(token, getDeviceType(deviceBaseInfo), deviceBaseInfo.getProductName(), deviceBaseInfo.getDeviceName());
|
|
|
if (info == null) {
|
|
|
info = createHostInfo(deviceBaseInfo, serverInfo);
|
|
|
addList.add(info);
|
|
|
@@ -678,8 +678,9 @@ public class WebsocketServiceImpl implements WebsocketService, RouterService {
|
|
|
info.setDeleted(0);
|
|
|
info.setDeviceCode(baseInfo.getDeviceName());
|
|
|
info.setDeviceProduct(baseInfo.getProductName());
|
|
|
+ info.setHostCode(baseInfo.getParentName());
|
|
|
//info.setDeviceModel(alarmHostInfos.getModel());
|
|
|
- info.setDeviceType(getDeviceType(baseInfo.getCategories()));
|
|
|
+ info.setDeviceType(getDeviceType(baseInfo));
|
|
|
info.setNetStatus("0");
|
|
|
info.setIotToken(serverInfo.getIotCode());
|
|
|
info.setDeviceName(baseInfo.getDisplayName());
|
|
|
@@ -695,16 +696,14 @@ public class WebsocketServiceImpl implements WebsocketService, RouterService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- private String getDeviceType(String categories) {
|
|
|
- if (ObjectUtil.isEmpty(categories)) {
|
|
|
+ private String getDeviceType(DeviceBaseInfo baseInfo) {
|
|
|
+ if (ObjectUtil.isEmpty(baseInfo.getCategories())) {
|
|
|
return null;
|
|
|
}
|
|
|
+ String categories = baseInfo.getCategories();
|
|
|
String[] split = categories.split(";");
|
|
|
- if (categories.contains(WebSocketConstants.FSU_GATEWAY)) {
|
|
|
- if (split.length == 1) {
|
|
|
- return DeviceTypeEnum.FSU_GATEWAY.getCode();
|
|
|
- }
|
|
|
- DeviceTypeEnum typeEnum = DeviceTypeEnum.valueOf(split[1]);
|
|
|
+ if (categories.contains(WebSocketConstants.FSU)) {
|
|
|
+ DeviceTypeEnum typeEnum = DeviceTypeEnum.valueOf(baseInfo.getProductName());
|
|
|
return typeEnum.getCode();
|
|
|
}
|
|
|
|
|
|
@@ -727,6 +726,7 @@ public class WebsocketServiceImpl implements WebsocketService, RouterService {
|
|
|
private void dealHostInfo(DeviceBaseInfo baseInfo, IotDeviceInfo info, IotServerInfo serverInfo) {
|
|
|
info.setDeleted(0);
|
|
|
info.setDeviceName(baseInfo.getDisplayName());
|
|
|
+ info.setHostCode(baseInfo.getParentName());
|
|
|
//info.setDeviceModel(alarmHostInfos.getModel());
|
|
|
info.setOrgId(serverInfo.getOrgId());
|
|
|
info.setOrgName(serverInfo.getOrgName());
|