增加用水数据接口
This commit is contained in:
@ -133,6 +133,9 @@ public class DeviceServiceImpl implements IDeviceService {
|
||||
@Override
|
||||
public Device selectDeviceByDeviceId(Long deviceId) {
|
||||
Device device = deviceMapper.selectDeviceByDeviceId(deviceId);
|
||||
if (device == null) {
|
||||
return null;
|
||||
}
|
||||
List<ValueItem> list = itslValueCache.getCacheDeviceStatus(device.getProductId(), device.getSerialNumber());
|
||||
if (list != null && list.size() > 0) {
|
||||
// redis中获取设备状态(物模型值)
|
||||
@ -1600,12 +1603,10 @@ public class DeviceServiceImpl implements IDeviceService {
|
||||
ArrayList<Map<String, Object>> resultList = new ArrayList<>();
|
||||
devices.setProductId(136L);
|
||||
List<Device> deviceList = selectDeviceList(devices);
|
||||
|
||||
for (Device device : deviceList) {
|
||||
HashMap<String, Object> itemMap = new HashMap<>();
|
||||
resultList.add(itemMap);
|
||||
Integer integer = 0;
|
||||
|
||||
itemMap.put("device",device);
|
||||
if (device.getStatus() != null) {
|
||||
if (device.getStatus().equals(4)) {
|
||||
@ -1613,7 +1614,6 @@ public class DeviceServiceImpl implements IDeviceService {
|
||||
}
|
||||
}
|
||||
itemMap.put("online",integer);
|
||||
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
Reference in New Issue
Block a user