修改设备getRealTimeDataByDevicerId实时数据接口

This commit is contained in:
wyw 2024-09-10 18:22:44 +08:00
parent 54958fe14c
commit a2b1bf583f
2 changed files with 23 additions and 14 deletions

View File

@ -10,10 +10,7 @@ import com.fastbee.common.core.domain.CommonResult;
import com.fastbee.common.core.page.TableDataInfo;
import com.fastbee.common.model.vo.TreeItemVo;
import com.fastbee.common.model.vo.iot.GisDeviceListVo;
import com.fastbee.common.utils.DateUtils;
import com.fastbee.common.utils.DevParamsUtils;
import com.fastbee.common.utils.SecurityUtils;
import com.fastbee.common.utils.StringUtils;
import com.fastbee.common.utils.*;
import com.fastbee.data.service.gis.IGisDeviceService;
import com.fastbee.iot.domain.Device;
import com.fastbee.iot.domain.DeviceLog;
@ -302,10 +299,12 @@ public class GisDeviceServiceImpl implements IGisDeviceService {
}};
List<DeviceLog> deviceLogs1 = liuliangCollect.get(thingsModel.getIdentifier());
if(deviceLogs1.size() > 0){
if(Float.parseFloat(deviceLogs1.get(0).getLogValue()) == 1f){
hashMap1.put("value", "启动");
}else{
hashMap1.put("value", "停止");
if(NumberUtils.isNumeric(deviceLogs1.get(0).getLogValue())){
if(Float.parseFloat(deviceLogs1.get(0).getLogValue()) == 1f){
hashMap1.put("value", "启动");
}else{
hashMap1.put("value", "停止");
}
}
}
rMap.put("水泵状态", hashMap1);
@ -319,11 +318,16 @@ public class GisDeviceServiceImpl implements IGisDeviceService {
}};
List<DeviceLog> deviceLogs1 = liuliangCollect.get(thingsModel.getIdentifier());
if(deviceLogs1.size() > 0){
if(Float.parseFloat(deviceLogs1.get(0).getLogValue()) == 1f){
hashMap1.put("value", "关闭");
if(NumberUtils.isNumeric(deviceLogs1.get(0).getLogValue())){
if(Float.parseFloat(deviceLogs1.get(0).getLogValue()) == 1f){
hashMap1.put("value", "关闭");
}else{
hashMap1.put("value", "开启");
}
}else{
hashMap1.put("value", "开启");
hashMap1.put("value", "关闭");
}
}
rMap.put("阀门状态", hashMap1);
}else if(thingsModel.getIdentifier().equals("三菱FX2N_1_FlowDown")){
@ -336,11 +340,16 @@ public class GisDeviceServiceImpl implements IGisDeviceService {
}};
List<DeviceLog> deviceLogs1 = liuliangCollect.get(thingsModel.getIdentifier());
if(deviceLogs1.size() > 0){
if(Float.parseFloat(deviceLogs1.get(0).getLogValue()) == 1f){
hashMap1.put("value", "断线");
if(NumberUtils.isNumeric(deviceLogs1.get(0).getLogValue())){
if(Float.parseFloat(deviceLogs1.get(0).getLogValue()) == 1f){
hashMap1.put("value", "断线");
}else{
hashMap1.put("value", "正常");
}
}else{
hashMap1.put("value", "正常");
}
}
rMap.put("阀门状态", hashMap1);
}else{

View File

@ -61,7 +61,7 @@ public class UploadedPhotos extends BaseEntity
/** CPU温度 */
@Excel(name = "CPU温度")
private Double cpuTemp;
/** 事件类型1=振动2=箱门打开,3=箱门持续打开 */
/** 事件类型1=箱体振动2=箱门打开,3=箱门持续打开 */
@Excel(name = "事件类型")
private String eventType;
@Excel(name = "安防状态:1=布防, 0=撤防")