|
|
|
|
@ -0,0 +1,124 @@
|
|
|
|
|
package com.ruoyi.web.controller.api;
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
|
import com.ruoyi.system.domain.T_CollectDeviceInfo;
|
|
|
|
|
import com.ruoyi.system.domain.T_Monitor;
|
|
|
|
|
import com.ruoyi.system.domain.dto.MonitorRealtimeDataDTO;
|
|
|
|
|
import com.ruoyi.system.service.IT_CollectDeviceInfoService;
|
|
|
|
|
import com.ruoyi.system.service.IT_MonitorService;
|
|
|
|
|
import com.ruoyi.system.service.IMonitorRealtimeDataService;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 小程序API接口Controller
|
|
|
|
|
*
|
|
|
|
|
* @author yinq
|
|
|
|
|
*/
|
|
|
|
|
@Api("小程序接口")
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/miniProgramApi")
|
|
|
|
|
public class MiniProgramApiController extends BaseController {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IT_CollectDeviceInfoService t_CollectDeviceInfoService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IT_MonitorService t_MonitorService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMonitorRealtimeDataService monitorRealtimeDataService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询集中器信息列表
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation("查询集中器信息列表")
|
|
|
|
|
@PostMapping("/collectDevice/list")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public AjaxResult getCollectDeviceList(@RequestBody(required = false) T_CollectDeviceInfo t_CollectDeviceInfo)
|
|
|
|
|
{
|
|
|
|
|
if (t_CollectDeviceInfo == null) {
|
|
|
|
|
t_CollectDeviceInfo = new T_CollectDeviceInfo();
|
|
|
|
|
}
|
|
|
|
|
List<T_CollectDeviceInfo> list = t_CollectDeviceInfoService.selectT_CollectDeviceInfoList(t_CollectDeviceInfo);
|
|
|
|
|
return AjaxResult.success(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据ID查询集中器信息详情
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation("根据ID查询集中器信息详情")
|
|
|
|
|
@GetMapping("/collectDevice/{objid}")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public AjaxResult getCollectDeviceById(@ApiParam("集中器ID") @PathVariable Long objid)
|
|
|
|
|
{
|
|
|
|
|
T_CollectDeviceInfo t_CollectDeviceInfo = t_CollectDeviceInfoService.selectT_CollectDeviceInfoById(objid);
|
|
|
|
|
if (t_CollectDeviceInfo == null) {
|
|
|
|
|
return AjaxResult.error("集中器信息不存在");
|
|
|
|
|
}
|
|
|
|
|
return AjaxResult.success(t_CollectDeviceInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询测控点信息列表
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation("查询测控点信息列表")
|
|
|
|
|
@PostMapping("/monitor/list")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public AjaxResult getMonitorList(@RequestBody(required = false) T_Monitor t_Monitor)
|
|
|
|
|
{
|
|
|
|
|
if (t_Monitor == null) {
|
|
|
|
|
t_Monitor = new T_Monitor();
|
|
|
|
|
}
|
|
|
|
|
List<T_Monitor> list = t_MonitorService.selectT_MonitorList(t_Monitor);
|
|
|
|
|
return AjaxResult.success(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据ID查询测控点信息详情
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation("根据ID查询测控点信息详情")
|
|
|
|
|
@GetMapping("/monitor/{objid}")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public AjaxResult getMonitorById(@ApiParam("测控点ID") @PathVariable Integer objid)
|
|
|
|
|
{
|
|
|
|
|
T_Monitor t_Monitor = t_MonitorService.selectT_MonitorById(objid);
|
|
|
|
|
if (t_Monitor == null) {
|
|
|
|
|
return AjaxResult.error("测控点信息不存在");
|
|
|
|
|
}
|
|
|
|
|
return AjaxResult.success(t_Monitor);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据集中器编号查询测控点列表
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation("根据集中器编号查询测控点列表")
|
|
|
|
|
@GetMapping("/monitor/collectDevice/{collectDeviceId}")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public AjaxResult getMonitorByCollectDeviceId(@ApiParam("集中器编号") @PathVariable String collectDeviceId)
|
|
|
|
|
{
|
|
|
|
|
T_Monitor t_Monitor = new T_Monitor();
|
|
|
|
|
t_Monitor.setCollectDeviceId(collectDeviceId);
|
|
|
|
|
List<T_Monitor> list = t_MonitorService.selectT_MonitorList(t_Monitor);
|
|
|
|
|
return AjaxResult.success(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据集中器编号查询测控点列表及对应的能源实时数据
|
|
|
|
|
* 能源类型:16-物联网环境,20-振动,30-温度阵列
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation("根据集中器编号查询测控点及实时数据")
|
|
|
|
|
@GetMapping("/monitor/realtimeData/{collectDeviceId}")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public AjaxResult getMonitorRealtimeDataByCollectDeviceId(@ApiParam("集中器编号") @PathVariable String collectDeviceId)
|
|
|
|
|
{
|
|
|
|
|
List<MonitorRealtimeDataDTO> list = monitorRealtimeDataService.selectMonitorRealtimeDataByCollectDeviceId(collectDeviceId);
|
|
|
|
|
return AjaxResult.success(list);
|
|
|
|
|
}
|
|
|
|
|
}
|