|
|
@@ -193,14 +193,13 @@ public class IotCommonSensorServiceImpl extends ServiceImpl<IotCommonSensorMappe
|
|
|
if (ObjectUtil.isNull(deviceStatus)) {
|
|
|
throw new ServiceException("未获取到设备状态");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+ final BaseDeviceTypeEnum deviceTypeEnum = BaseDeviceTypeEnum.getEnumByCode(deviceInfo.getDeviceType());
|
|
|
SensorAppVo vo = new SensorAppVo();
|
|
|
BeanUtils.copyProperties(deviceInfo, vo);
|
|
|
BeanUtils.copyProperties(deviceStatus, vo);
|
|
|
vo.setDeviceType(deviceStatus.getDeviceType());
|
|
|
vo.setInfos(deviceStatus.getInfo());
|
|
|
- vo.setDeviceTypeText(DictUtils.getDictLabel(DictConstants.APP_SENSOR_DEVICE_TYPE, Integer.parseInt(vo.getDeviceType())));
|
|
|
+ vo.setDeviceTypeText(deviceTypeEnum.getDesc());
|
|
|
vo.setStateText(DictUtils.getDictLabel(DictConstants.SENSOR_ALARM_STATUS, vo.getState()));
|
|
|
vo.setOrgName(orgService.concatOrgName(deviceInfo.getOrgId(), SecurityConstants.INNER));
|
|
|
return vo;
|
|
|
@@ -209,11 +208,12 @@ public class IotCommonSensorServiceImpl extends ServiceImpl<IotCommonSensorMappe
|
|
|
if (defenceArea == null) {
|
|
|
throw new ServiceException("该传感器数据不存在!");
|
|
|
}
|
|
|
+ final BaseDeviceTypeEnum deviceTypeEnum = BaseDeviceTypeEnum.getEnumByCode(defenceArea.getSensorType());
|
|
|
SensorAppVo vo = new SensorAppVo();
|
|
|
BeanUtils.copyProperties(defenceArea, vo);
|
|
|
vo.setState("alarm".equals(defenceArea.getState()) ? 1 : 0);
|
|
|
vo.setDeviceType(defenceArea.getSensorType());
|
|
|
- vo.setDeviceTypeText(defenceArea.getSensorTypeName());
|
|
|
+ vo.setDeviceTypeText(deviceTypeEnum.getDesc());
|
|
|
vo.setDeviceName(defenceArea.getDefenceAreaName());
|
|
|
return vo;
|
|
|
}
|