添加projectId,并修改bug
This commit is contained in:
@ -126,8 +126,8 @@ public class DeviceAlarmController extends BaseController {
|
||||
* 统计不同设备数量
|
||||
*/
|
||||
@GetMapping("/countByType")
|
||||
public AjaxResult getDeviceCountByType() {
|
||||
return AjaxResult.success(deviceInformationManager.getAllDeviceCount());
|
||||
public AjaxResult getDeviceCountByType(Long projectId) {
|
||||
return AjaxResult.success(deviceInformationManager.getAllDeviceCount(projectId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -44,13 +44,14 @@ public class DeviceInfoController extends BaseController {
|
||||
* 查询全部设备立杆列表
|
||||
*/
|
||||
@GetMapping("/allList")
|
||||
public AjaxResult getAllList() {
|
||||
public AjaxResult getAllList(Long projectId) {
|
||||
List<Map<String, Object>> result =new ArrayList<>();
|
||||
//气象
|
||||
LambdaQueryWrapper<DeviceInformationMeteorology> queryWrapper1 = new LambdaQueryWrapper<>();
|
||||
queryWrapper1.select(DeviceInformationMeteorology::getId,DeviceInformationMeteorology::getName,
|
||||
DeviceInformationMeteorology::getLongitude,DeviceInformationMeteorology::getLatitude,
|
||||
DeviceInformationMeteorology::getDeviceEncoding);
|
||||
DeviceInformationMeteorology::getDeviceEncoding)
|
||||
.eq(DeviceInformationMeteorology::getProjectId,projectId);
|
||||
List<DeviceInformationMeteorology> deviceInformationMeteorologies = deviceInformationMeteorologyMapper.selectList(queryWrapper1);
|
||||
Map<String,Object> obj1=new HashMap<>();
|
||||
obj1.put("type","气象");
|
||||
@ -60,7 +61,8 @@ public class DeviceInfoController extends BaseController {
|
||||
LambdaQueryWrapper<DeviceInformationWorms> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||
queryWrapper2.select(DeviceInformationWorms::getId,DeviceInformationWorms::getName,
|
||||
DeviceInformationWorms::getLongitude,DeviceInformationWorms::getLatitude,
|
||||
DeviceInformationWorms::getDeviceEncoding);
|
||||
DeviceInformationWorms::getDeviceEncoding)
|
||||
.eq(DeviceInformationWorms::getProjectId,projectId);
|
||||
List<DeviceInformationWorms> deviceInformationWorms = deviceInformationWormsMapper.selectList(queryWrapper2);
|
||||
Map<String,Object> obj2=new HashMap<>();
|
||||
obj2.put("type","虫情");
|
||||
@ -71,7 +73,8 @@ public class DeviceInfoController extends BaseController {
|
||||
LambdaQueryWrapper<DeviceInformationMoisture> queryWrapper3 = new LambdaQueryWrapper<>();
|
||||
queryWrapper3.select(DeviceInformationMoisture::getId,DeviceInformationMoisture::getName,
|
||||
DeviceInformationMoisture::getLongitude,DeviceInformationMoisture::getLatitude,
|
||||
DeviceInformationMoisture::getDeviceEncoding);
|
||||
DeviceInformationMoisture::getDeviceEncoding)
|
||||
.eq(DeviceInformationMoisture::getProjectId,projectId);
|
||||
List<DeviceInformationMoisture> deviceInformationMoistures = deviceInformationMoistureMapper.selectList(queryWrapper3);
|
||||
Map<String,Object> obj3=new HashMap<>();
|
||||
obj3.put("type","墒情");
|
||||
@ -82,7 +85,8 @@ public class DeviceInfoController extends BaseController {
|
||||
LambdaQueryWrapper<DeviceInformationTargetpests> queryWrapper4 = new LambdaQueryWrapper<>();
|
||||
queryWrapper4.select(DeviceInformationTargetpests::getId,DeviceInformationTargetpests::getName,
|
||||
DeviceInformationTargetpests::getLongitude,DeviceInformationTargetpests::getLatitude,
|
||||
DeviceInformationTargetpests::getDeviceEncoding);
|
||||
DeviceInformationTargetpests::getDeviceEncoding)
|
||||
.eq(DeviceInformationTargetpests::getProjectId,projectId);
|
||||
List<DeviceInformationTargetpests> deviceInformationTargetpests = deviceInformationTargetpestsMapper.selectList(queryWrapper4);
|
||||
Map<String,Object> obj4=new HashMap<>();
|
||||
obj4.put("type","杀虫灯");
|
||||
@ -93,7 +97,8 @@ public class DeviceInfoController extends BaseController {
|
||||
LambdaQueryWrapper<DeviceInformationMiaoqing> queryWrapper5 = new LambdaQueryWrapper<>();
|
||||
queryWrapper5.select(DeviceInformationMiaoqing::getId,DeviceInformationMiaoqing::getName,
|
||||
DeviceInformationMiaoqing::getLongitude,DeviceInformationMiaoqing::getLatitude,
|
||||
DeviceInformationMiaoqing::getDeviceEncoding);
|
||||
DeviceInformationMiaoqing::getDeviceEncoding)
|
||||
.eq(DeviceInformationMiaoqing::getProjectId,projectId);
|
||||
List<DeviceInformationMiaoqing> deviceInformationMiaoqings = deviceInformationMiaoqingMapper.selectList(queryWrapper5);
|
||||
Map<String,Object> obj5=new HashMap<>();
|
||||
obj5.put("type","苗情");
|
||||
@ -104,7 +109,8 @@ public class DeviceInfoController extends BaseController {
|
||||
LambdaQueryWrapper<DeviceInformationMonitor> queryWrapper6 = new LambdaQueryWrapper<>();
|
||||
queryWrapper6.select(DeviceInformationMonitor::getId,DeviceInformationMonitor::getName,
|
||||
DeviceInformationMonitor::getLongitude,DeviceInformationMonitor::getLatitude,
|
||||
DeviceInformationMonitor::getDeviceEncoding);
|
||||
DeviceInformationMonitor::getDeviceEncoding)
|
||||
.eq(DeviceInformationMonitor::getProjectId,projectId);
|
||||
List<DeviceInformationMonitor> deviceInformationMonitors = deviceInformationMonitorMapper.selectList(queryWrapper6);
|
||||
Map<String,Object> obj6=new HashMap<>();
|
||||
obj6.put("type","监控");
|
||||
|
@ -39,7 +39,7 @@ public class DeviceInformationMeteorologyController extends BaseController
|
||||
/**
|
||||
* 查询气象设备基础信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('deviceInfo:meteorology:list')")
|
||||
//@PreAuthorize("@ss.hasPermi('deviceInfo:meteorology:list')")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询气象设备基础信息列表")
|
||||
public TableDataInfo list(DeviceInformationMeteorology deviceInformationMeteorology)
|
||||
|
@ -21,8 +21,8 @@ public class DeviceRealtimedataMeteorologyController {
|
||||
* 获取最新的一条气象数据
|
||||
*/
|
||||
@GetMapping(value = "/weather/realtimedata")
|
||||
public AjaxResult getLatestWeatherRealtimedata() {
|
||||
return AjaxResult.success(deviceRealtimedataMeteorologyService.getLatestWeatherRealtimedata());
|
||||
public AjaxResult getLatestWeatherRealtimedata(String deviceEncoding) {
|
||||
return AjaxResult.success(deviceRealtimedataMeteorologyService.getLatestWeatherRealtimedata(deviceEncoding));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.fastbee.data.controller.aaScreenAgricultural.deviceRealTimeData;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.fastbee.common.core.domain.AjaxResult;
|
||||
import com.fastbee.common.holder.ProjectHolder;
|
||||
import com.fastbee.deviceData.api.yingshiyun.service.YingshiyunService;
|
||||
import com.fastbee.deviceInfo.domain.DeviceInformationMonitor;
|
||||
import com.fastbee.deviceInfo.mapper.DeviceInformationMonitorMapper;
|
||||
@ -30,14 +31,22 @@ public class DeviceRealtimedataSeedlingGrowthController {
|
||||
* 获取苗情监测监控设备列表
|
||||
*/
|
||||
@GetMapping("/monitorDeviceList")
|
||||
public AjaxResult getMonitorDeviceList() {
|
||||
public AjaxResult getMonitorDeviceList(Long projectId) {
|
||||
System.err.println("/monitorDeviceList");
|
||||
System.err.println("projectId:"+projectId);
|
||||
List<DeviceInformationMonitor> list = new LambdaQueryChainWrapper<>(monitorMapper)
|
||||
.select(DeviceInformationMonitor::getId,
|
||||
DeviceInformationMonitor::getName,
|
||||
DeviceInformationMonitor::getDeviceEncoding,
|
||||
DeviceInformationMonitor::getLatitude,
|
||||
DeviceInformationMonitor::getLongitude)
|
||||
.eq(DeviceInformationMonitor::getProjectId,projectId)
|
||||
//.eq(DeviceInformationMonitor::getDeviceEncoding,deviceEncoding)
|
||||
.list();
|
||||
for(int i=0;i<list.size();i++)
|
||||
{
|
||||
System.err.println("{"+list.get(i).getDeviceEncoding()+":"+list.get(i).getProjectId()+"}");
|
||||
}
|
||||
//获取监控播放地址
|
||||
list.forEach(this::setPlayUrl);
|
||||
return AjaxResult.success(list);
|
||||
|
Reference in New Issue
Block a user