查询已激活设备列表接口
This commit is contained in:
@ -58,7 +58,6 @@ public class ProjectDataIsolationInterceptor implements HandlerInterceptor {
|
|||||||
for (Cookie cookie : requestCookies){
|
for (Cookie cookie : requestCookies){
|
||||||
//获取cookie中的projectIds
|
//获取cookie中的projectIds
|
||||||
if ("projectIds".equals(cookie.getName())) {
|
if ("projectIds".equals(cookie.getName())) {
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(cookie.getValue())) {
|
if (StringUtils.isNotBlank(cookie.getValue())) {
|
||||||
JSONArray objects = JSONUtil.parseArray(cookie.getValue());
|
JSONArray objects = JSONUtil.parseArray(cookie.getValue());
|
||||||
projectInfo.setProjectIdList(objects.toList(Long.class));
|
projectInfo.setProjectIdList(objects.toList(Long.class));
|
||||||
@ -67,7 +66,7 @@ public class ProjectDataIsolationInterceptor implements HandlerInterceptor {
|
|||||||
//获取cookie中的projectId
|
//获取cookie中的projectId
|
||||||
if ("projectId".equals(cookie.getName())) {
|
if ("projectId".equals(cookie.getName())) {
|
||||||
projectInfo.setProjectId(cookie.getValue());
|
projectInfo.setProjectId(cookie.getValue());
|
||||||
System.err.println("获取cooke的项目id:"+cookie.getValue());
|
// System.err.println("获取cooke的项目id:"+cookie.getValue());
|
||||||
}
|
}
|
||||||
//获取cookie中的userId
|
//获取cookie中的userId
|
||||||
if ("userId".equals(cookie.getName())) {
|
if ("userId".equals(cookie.getName())) {
|
||||||
|
@ -496,4 +496,13 @@ public class DeviceController extends BaseController {
|
|||||||
return AjaxResult.success(deviceService.getvideourl(baseGet));
|
return AjaxResult.success(deviceService.getvideourl(baseGet));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询已激活设备列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/getActivationList")
|
||||||
|
@ApiOperation("查询已激活设备列表")
|
||||||
|
public AjaxResult getDeviceActivationList() {
|
||||||
|
return AjaxResult.success(deviceService.getDeviceActivationList());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ public class DeviceRealtimedataMoistureServiceImpl extends ServiceImpl<DeviceRea
|
|||||||
devicePropertiesList.add(DeviceProperties.builder().name("电池电流").value(moisture.getBatteryCur().toString()).unit("A").build());
|
devicePropertiesList.add(DeviceProperties.builder().name("电池电流").value(moisture.getBatteryCur().toString()).unit("A").build());
|
||||||
devicePropertiesList.add(DeviceProperties.builder().name("电池功率").value(moisture.getBatteryPower().toString()).unit("W").build());
|
devicePropertiesList.add(DeviceProperties.builder().name("电池功率").value(moisture.getBatteryPower().toString()).unit("W").build());
|
||||||
devicePropertiesList.add(DeviceProperties.builder().name("负载电压").value(moisture.getLoadVolt().toString()).unit("V").build());
|
devicePropertiesList.add(DeviceProperties.builder().name("负载电压").value(moisture.getLoadVolt().toString()).unit("V").build());
|
||||||
devicePropertiesList.add(DeviceProperties.builder().name("负载电流").value(moisture.getLoadCur().toString()).unit("I").build());
|
devicePropertiesList.add(DeviceProperties.builder().name("负载电流").value(moisture.getLoadCur().toString()).unit("A").build());
|
||||||
devicePropertiesList.add(DeviceProperties.builder().name("负载功率").value(moisture.getLoadPower().toString()).unit("W").build());
|
devicePropertiesList.add(DeviceProperties.builder().name("负载功率").value(moisture.getLoadPower().toString()).unit("W").build());
|
||||||
|
|
||||||
return devicePropertiesList;
|
return devicePropertiesList;
|
||||||
|
@ -339,6 +339,9 @@ public interface IDeviceService
|
|||||||
Map<String, Object> getvideourl(JiankongDeviceParam jiankongDeviceParam);
|
Map<String, Object> getvideourl(JiankongDeviceParam jiankongDeviceParam);
|
||||||
|
|
||||||
|
|
||||||
|
List<Device> getDeviceActivationList();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -3,6 +3,7 @@ package com.fastbee.iot.service.impl;
|
|||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.alibaba.fastjson2.JSONArray;
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||||
import com.fastbee.common.constant.Constants;
|
import com.fastbee.common.constant.Constants;
|
||||||
import com.fastbee.common.constant.ProductAuthConstant;
|
import com.fastbee.common.constant.ProductAuthConstant;
|
||||||
import com.fastbee.common.core.device.DeviceAndProtocol;
|
import com.fastbee.common.core.device.DeviceAndProtocol;
|
||||||
@ -1762,7 +1763,14 @@ public class DeviceServiceImpl implements IDeviceService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Device> getDeviceActivationList() {
|
||||||
|
//TODO 按项目机构区分数据
|
||||||
|
return new LambdaQueryChainWrapper<>(deviceMapper)
|
||||||
|
.select(Device::getDeviceId,Device::getDeviceName,Device::getSerialNumber)
|
||||||
|
.in(Device::getStatus, 3,4)
|
||||||
|
.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user