添加监控设备在线状态;设备详情接口添加projectId

This commit is contained in:
2025-01-14 13:46:45 +08:00
parent 27737c0cb9
commit 2b9a21c063
11 changed files with 240 additions and 67 deletions

View File

@ -124,10 +124,11 @@ public class DeviceInfoController extends BaseController {
* 查询气象设备列表
*/
@GetMapping("/weatherList")
public AjaxResult getDeviceList() {
public AjaxResult getDeviceList(Long projectId) {
LambdaQueryWrapper<DeviceInformationMeteorology> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.select(DeviceInformationMeteorology::getId,DeviceInformationMeteorology::getName,
DeviceInformationMeteorology::getLongitude,DeviceInformationMeteorology::getLatitude);
DeviceInformationMeteorology::getLongitude,DeviceInformationMeteorology::getLatitude)
.eq(DeviceInformationMeteorology::getProjectId,projectId);
return success(deviceInformationMeteorologyMapper.selectList(queryWrapper));
}
@ -136,10 +137,11 @@ public class DeviceInfoController extends BaseController {
* 查询虫情设备列表
*/
@GetMapping("/wormList")
public AjaxResult getWeatherList() {
public AjaxResult getWeatherList(Long projectId) {
LambdaQueryWrapper<DeviceInformationWorms> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.select(DeviceInformationWorms::getId,DeviceInformationWorms::getName,
DeviceInformationWorms::getLongitude,DeviceInformationWorms::getLatitude);
DeviceInformationWorms::getLongitude,DeviceInformationWorms::getLatitude)
.eq(DeviceInformationWorms::getProjectId,projectId);
return success(deviceInformationWormsMapper.selectList(queryWrapper));
}
@ -147,40 +149,44 @@ public class DeviceInfoController extends BaseController {
* 查询墒情设备列表
*/
@GetMapping("/soilList")
public AjaxResult getSoilList() {
public AjaxResult getSoilList(Long projectId) {
LambdaQueryWrapper<DeviceInformationMoisture> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.select(DeviceInformationMoisture::getId,DeviceInformationMoisture::getName,
DeviceInformationMoisture::getLongitude,DeviceInformationMoisture::getLatitude);
DeviceInformationMoisture::getLongitude,DeviceInformationMoisture::getLatitude)
.eq(DeviceInformationMoisture::getProjectId,projectId);
return success(deviceInformationMoistureMapper.selectList(queryWrapper));
}
/**
* 查询杀虫灯设备列表
*/
@GetMapping("/lightList")
public AjaxResult getLightList() {
public AjaxResult getLightList(Long projectId) {
LambdaQueryWrapper<DeviceInformationTargetpests> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.select(DeviceInformationTargetpests::getId,DeviceInformationTargetpests::getName,
DeviceInformationTargetpests::getLongitude,DeviceInformationTargetpests::getLatitude);
DeviceInformationTargetpests::getLongitude,DeviceInformationTargetpests::getLatitude)
.eq(DeviceInformationTargetpests::getProjectId,projectId);
return success(deviceInformationTargetpestsMapper.selectList(queryWrapper));
}
/**
* 查询苗情设备列表
*/
@GetMapping("/miaoList")
public AjaxResult getmiaoList() {
public AjaxResult getmiaoList(Long projectId) {
LambdaQueryWrapper<DeviceInformationMiaoqing> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.select(DeviceInformationMiaoqing::getId,DeviceInformationMiaoqing::getName,
DeviceInformationMiaoqing::getLongitude,DeviceInformationMiaoqing::getLatitude);
DeviceInformationMiaoqing::getLongitude,DeviceInformationMiaoqing::getLatitude)
.eq(DeviceInformationMiaoqing::getProjectId,projectId);
return success(deviceInformationMiaoqingMapper.selectList(queryWrapper));
}
/**
* 查询监控站设备列表
*/
@GetMapping("/monitorList")
public AjaxResult getmonitorList() {
public AjaxResult getmonitorList(Long projectId) {
LambdaQueryWrapper<DeviceInformationMonitor> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.select(DeviceInformationMonitor::getId,DeviceInformationMonitor::getName,
DeviceInformationMonitor::getLongitude,DeviceInformationMonitor::getLatitude);
DeviceInformationMonitor::getLongitude,DeviceInformationMonitor::getLatitude)
.eq(DeviceInformationMonitor::getProjectId,projectId);
return success(deviceInformationMonitorMapper.selectList(queryWrapper));
}
}

View File

@ -3,6 +3,7 @@ package com.fastbee.data.controller.aaScreenAgricultural.deviceBaseInfo;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.fastbee.deviceInfo.mapper.DeviceInformationMeteorologyMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
@ -35,6 +36,8 @@ public class DeviceInformationMeteorologyController extends BaseController
{
@Autowired
private IDeviceInformationMeteorologyService deviceInformationMeteorologyService;
@Autowired
private DeviceInformationMeteorologyMapper deviceInformationMeteorologyMapper;
/**
* 查询气象设备基础信息列表
@ -75,7 +78,7 @@ public class DeviceInformationMeteorologyController extends BaseController
/**
* 新增气象设备基础信息
*/
@PreAuthorize("@ss.hasPermi('deviceInfo:meteorology:add')")
//@PreAuthorize("@ss.hasPermi('deviceInfo:meteorology:add')")
@PostMapping
@ApiOperation("新增气象设备基础信息")
public AjaxResult add(@RequestBody DeviceInformationMeteorology deviceInformationMeteorology)
@ -86,7 +89,7 @@ public class DeviceInformationMeteorologyController extends BaseController
/**
* 修改气象设备基础信息
*/
@PreAuthorize("@ss.hasPermi('deviceInfo:meteorology:edit')")
//@PreAuthorize("@ss.hasPermi('deviceInfo:meteorology:edit')")
@PutMapping
@ApiOperation("修改气象设备基础信息")
public AjaxResult edit(@RequestBody DeviceInformationMeteorology deviceInformationMeteorology)
@ -97,11 +100,13 @@ public class DeviceInformationMeteorologyController extends BaseController
/**
* 删除气象设备基础信息
*/
@PreAuthorize("@ss.hasPermi('deviceInfo:meteorology:remove')")
@DeleteMapping("/{ids}")
//@PreAuthorize("@ss.hasPermi('deviceInfo:meteorology:remove')")
@DeleteMapping("/{id}")
@ApiOperation("删除气象设备基础信息")
public AjaxResult remove(@PathVariable Long[] ids)
public AjaxResult remove(@PathVariable Long id)
{
return toAjax(deviceInformationMeteorologyService.deleteDeviceInformationMeteorologyByIds(ids));
int flag=deviceInformationMeteorologyMapper.deleteDeviceInformationMeteorologyById(id);
return toAjax(flag);
//return toAjax(deviceInformationMeteorologyService.deleteDeviceInformationMeteorologyByIds(ids));
}
}

View File

@ -3,6 +3,7 @@ package com.fastbee.data.controller.aaScreenAgricultural.deviceBaseInfo;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.fastbee.deviceInfo.mapper.DeviceInformationMonitorMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
@ -35,11 +36,13 @@ public class DeviceInformationMonitorController extends BaseController
{
@Autowired
private IDeviceInformationMonitorService deviceInformationMonitorService;
@Autowired
private DeviceInformationMonitorMapper deviceInformationMonitorMapper;
/**
* 查询监控站设备基础信息列表
*/
@PreAuthorize("@ss.hasPermi('deviceInfo:monitor:list')")
//@PreAuthorize("@ss.hasPermi('deviceInfo:monitor:list')")
@GetMapping("/list")
@ApiOperation("查询监控站设备基础信息列表")
public TableDataInfo list(DeviceInformationMonitor deviceInformationMonitor)
@ -53,7 +56,7 @@ public class DeviceInformationMonitorController extends BaseController
* 导出监控站设备基础信息列表
*/
@ApiOperation("导出监控站设备基础信息列表")
@PreAuthorize("@ss.hasPermi('deviceInfo:monitor:export')")
//@PreAuthorize("@ss.hasPermi('deviceInfo:monitor:export')")
@PostMapping("/export")
public void export(HttpServletResponse response, DeviceInformationMonitor deviceInformationMonitor)
{
@ -75,7 +78,7 @@ public class DeviceInformationMonitorController extends BaseController
/**
* 新增监控站设备基础信息
*/
@PreAuthorize("@ss.hasPermi('deviceInfo:monitor:add')")
//@PreAuthorize("@ss.hasPermi('deviceInfo:monitor:add')")
@PostMapping
@ApiOperation("新增监控站设备基础信息")
public AjaxResult add(@RequestBody DeviceInformationMonitor deviceInformationMonitor)
@ -86,7 +89,7 @@ public class DeviceInformationMonitorController extends BaseController
/**
* 修改监控站设备基础信息
*/
@PreAuthorize("@ss.hasPermi('deviceInfo:monitor:edit')")
//@PreAuthorize("@ss.hasPermi('deviceInfo:monitor:edit')")
@PutMapping
@ApiOperation("修改监控站设备基础信息")
public AjaxResult edit(@RequestBody DeviceInformationMonitor deviceInformationMonitor)
@ -97,11 +100,13 @@ public class DeviceInformationMonitorController extends BaseController
/**
* 删除监控站设备基础信息
*/
@PreAuthorize("@ss.hasPermi('deviceInfo:monitor:remove')")
@DeleteMapping("/{ids}")
//@PreAuthorize("@ss.hasPermi('deviceInfo:monitor:remove')")
@DeleteMapping("/{id}")
@ApiOperation("删除监控站设备基础信息")
public AjaxResult remove(@PathVariable Long[] ids)
public AjaxResult remove(@PathVariable Long id)
{
return toAjax(deviceInformationMonitorService.deleteDeviceInformationMonitorByIds(ids));
//return toAjax(deviceInformationMonitorService.deleteDeviceInformationMonitorByIds(ids));
int flag=deviceInformationMonitorMapper.deleteDeviceInformationMonitorById(id);
return toAjax(flag);
}
}

View File

@ -39,7 +39,9 @@ public class DeviceRealtimedataSeedlingGrowthController {
DeviceInformationMonitor::getName,
DeviceInformationMonitor::getDeviceEncoding,
DeviceInformationMonitor::getLatitude,
DeviceInformationMonitor::getLongitude)
DeviceInformationMonitor::getLongitude,
DeviceInformationMonitor::getRemarksInformation,
DeviceInformationMonitor::getProjectId)
.eq(DeviceInformationMonitor::getProjectId,projectId)
//.eq(DeviceInformationMonitor::getDeviceEncoding,deviceEncoding)
.list();
@ -61,10 +63,17 @@ public class DeviceRealtimedataSeedlingGrowthController {
if (videoPlayMap.containsKey("playUrl")) {
Object playUrl = videoPlayMap.get("playUrl");
monitor.setPlayUrl(playUrl.toString());
}
if( videoPlayMap.containsKey("accessToken")){
Object accessToken = videoPlayMap.get("accessToken");
monitor.setAccessToken(accessToken.toString());
}
if(videoPlayMap.containsKey("status")){
Object status=videoPlayMap.get("status");//设备在线状态0=离线1=在线
Object statusDesc=videoPlayMap.get("statusDesc");//设备在线状态描述
monitor.setStatusDesc(statusDesc.toString());
monitor.setStatus((Long) status);
}
}
}