|
|
@@ -86,7 +86,7 @@ public class IotDeviceStatusServiceImpl extends ServiceImpl<IotDeviceStatusMappe
|
|
|
.map(IotAlarmSystemField::getName)
|
|
|
.findFirst()
|
|
|
.orElse(StringUtil.EMPTY_STRING);
|
|
|
- String val = DeviceTypeEnum.getStatusText(jsb.get("args"));
|
|
|
+ String val = DeviceTypeEnum.getStatusText(jsb.get("propertyValue"));
|
|
|
if (ObjectUtil.hasEmpty(name, val)) {
|
|
|
continue;
|
|
|
}
|
|
|
@@ -143,7 +143,7 @@ public class IotDeviceStatusServiceImpl extends ServiceImpl<IotDeviceStatusMappe
|
|
|
|
|
|
@Override
|
|
|
public ProductEnums product() {
|
|
|
- return ProductEnums.DETECTION_HOST;
|
|
|
+ return ProductEnums.FSU_GATEWAY;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -191,10 +191,10 @@ public class IotDeviceStatusServiceImpl extends ServiceImpl<IotDeviceStatusMappe
|
|
|
iotAlarmData.setDeviceId(String.valueOf(deviceInfo.getId()));
|
|
|
final String sourceType = SensorType.getCodeByProduct(dataReq.getProductType());
|
|
|
fieldList.stream()
|
|
|
- .filter(r->ObjectUtil.equal(r.getSourceType(),sourceType))
|
|
|
- .filter(r->ObjectUtil.equal(r.getPropertyName(),dataReq.getProductProperty()))
|
|
|
+ .filter(r -> ObjectUtil.equal(r.getSourceType(), sourceType))
|
|
|
+ .filter(r -> ObjectUtil.equal(r.getPropertyName(), dataReq.getProductProperty()))
|
|
|
.findAny()
|
|
|
- .ifPresent(r->{
|
|
|
+ .ifPresent(r -> {
|
|
|
iotAlarmData.setSourceType(r.getSourceType());
|
|
|
iotAlarmData.setSourceTypeDes(r.getSourceTypeDes());
|
|
|
iotAlarmData.setFieldCode(r.getSysFieldCode());
|
|
|
@@ -206,19 +206,24 @@ public class IotDeviceStatusServiceImpl extends ServiceImpl<IotDeviceStatusMappe
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
private WebsocketResult dealDeviceStatus(WebsocketExecuteReq req) {
|
|
|
- final JSONArray data = (JSONArray) req.getData();
|
|
|
+
|
|
|
+ final JSONObject reqDataObj = (JSONObject) req.getData();
|
|
|
+ final Object reqStatus = reqDataObj.get(WebSocketConstants.STATUS);
|
|
|
+ if (ObjectUtil.isNull(reqStatus)) {
|
|
|
+ LogUtils.SOCKET_DEVICE_STATUS_INFO.error("设备状态同步时,参数异常,status为空,token:{}", req.getToken());
|
|
|
+ return new WebsocketResult();
|
|
|
+ }
|
|
|
+ final JSONArray data = (JSONArray) reqStatus;
|
|
|
final String productName = req.getProductName();
|
|
|
final BaseDeviceTypeEnum deviceTypeEnum = BaseDeviceTypeEnum.valueOf(productName);
|
|
|
|
|
|
final IotDeviceInfo code = iotDeviceInfoService.selectByTypeAndCode(req.getToken(), deviceTypeEnum.getCode(), req.getProductName(), req.getDeviceName());
|
|
|
if (code == null) {
|
|
|
- log.error("动环设备状态同步时,未能找到对应设备,token:{},productName:{},deviceNane:{}", req.getToken(), req.getProductName(), req.getDeviceName());
|
|
|
+ LogUtils.SOCKET_DEVICE_STATUS_INFO.error("设备状态同步时,未能找到对应设备,token:{},productName:{},deviceNane:{}", req.getToken(), req.getProductName(), req.getDeviceName());
|
|
|
return new WebsocketResult();
|
|
|
}
|
|
|
String deviceType = SensorType.getCodeByProduct(productName);
|