feat(ems): 添加看板查询物联网实时数据功能

- 新增 boardTWTempertureDataList 接口用于看板查询温度数据列表
- 优化 TWTempertureDataController 中的代码格式和注释
- 在 recordIOTInstant.js 中添加对应的前端 API 接口
IOT
zch 2 months ago
parent 7f3927ca60
commit 05d3dc76af

@ -68,7 +68,11 @@ public class TWTempertureDataController extends BaseController
@GetMapping("/iotInstantList") @GetMapping("/iotInstantList")
public AjaxResult iotInstantList(TWTempertureData tWTempertureData){ public AjaxResult iotInstantList(TWTempertureData tWTempertureData){
EmsIOTData emsIOTData = new EmsIOTData(); EmsIOTData emsIOTData = new EmsIOTData();
int energyTypeid = Integer.parseInt(emsBaseMonitorInfoService.selectEmsBaseMonitorTypeByMonitorCode(tWTempertureData.getMonitorId()));
//cql写的没看懂下面这行代码的mapper
int energyTypeid = Integer.parseInt(emsBaseMonitorInfoService
.selectEmsBaseMonitorTypeByMonitorCode(tWTempertureData.getMonitorId()));
String energyName = emsBaseEnergyTypeService.queryEnergyNameByEnergyTypeId(energyTypeid); String energyName = emsBaseEnergyTypeService.queryEnergyNameByEnergyTypeId(energyTypeid);
if("温湿度".equals(energyName) || "湿度".equals(energyName)){ if("温湿度".equals(energyName) || "湿度".equals(energyName)){
emsIOTData.monitorTypeArr.add("温度"); emsIOTData.monitorTypeArr.add("温度");
@ -213,7 +217,19 @@ public class TWTempertureDataController extends BaseController
* @return * @return
*/ */
@PostMapping("/selectLastTWTempertureData") @PostMapping("/selectLastTWTempertureData")
public List<TWTempertureData> selectLastTWTempertureData(@RequestBody TWTempertureData tWTempertureData){ public List<TWTempertureData> selectLastTWTempertureData(TWTempertureData tWTempertureData){
return tWTempertureDataService.selectLastTWTempertureData(tWTempertureData) ; return tWTempertureDataService.selectLastTWTempertureData(tWTempertureData);
} }
/**
*
*/
@PreAuthorize("@ss.hasPermi('ems/record:recordIOTInstant:list')")
@PostMapping("/boardTWTempertureDataList")
public AjaxResult boardTWTempertureDataList(TWTempertureData tWTempertureData)
{
List<TWTempertureData> list = tWTempertureDataService.selectTWTempertureDataList(tWTempertureData);
return success(list);
}
} }

@ -69,3 +69,11 @@ export function selectLastTWTempertureData(data) {
data: data data: data
}) })
} }
export function boardTWTempertureDataList(data) {
return request({
url: '/ems/record/recordIOTInstant/boardTWTempertureDataList',
method: 'post',
data: data
})
}

Loading…
Cancel
Save