设备名称,编号模糊搜索
This commit is contained in:
parent
8b6616ae2b
commit
74f577ad3c
@ -1,9 +1,6 @@
|
||||
package com.fastbee.data.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@ -56,37 +53,50 @@ public class DeviceReportInfoController extends BaseController
|
||||
* 查询设备上电审核前上报的基础信息列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('iot:info:list')")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询设备上电审核前上报的基础信息列表")
|
||||
public TableDataInfo list(DeviceReportInfo deviceReportInfo)
|
||||
{
|
||||
startPage();
|
||||
List<DeviceReportInfo> list = deviceReportInfoService.selectDeviceReportInfoList(deviceReportInfo);
|
||||
System.err.println("查询条件:"+deviceReportInfo.getOnLine());
|
||||
System.err.println("设备总长度:"+list.size());
|
||||
//查询设备在线状态
|
||||
list.forEach(d->{
|
||||
if(d.getType()==1){
|
||||
Boolean hassed = stringRedisTemplate.hasKey("neixiang_device_online_status:" + 147 + ":" + d.getSerialNumber());
|
||||
if(hassed){
|
||||
d.setOnLine(1);
|
||||
}else{
|
||||
d.setOnLine(0);
|
||||
}
|
||||
} else if ( d.getType()==2) {
|
||||
//展连流量计设备在线状态判断
|
||||
d.setType(0);
|
||||
}
|
||||
});
|
||||
// //处理在线/离线筛选
|
||||
// if(deviceReportInfo.getOnLine()!=null){
|
||||
// //根据online状态的值过滤集合
|
||||
// list= list.stream().filter(d -> Objects.equals(d.getOnLine(), deviceReportInfo.getOnLine()))
|
||||
// .collect(Collectors.toList());
|
||||
// }
|
||||
System.err.println("过滤后总长度:"+list.size());
|
||||
return getDataTable(list);
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询设备上电审核前上报的基础信息列表")
|
||||
public TableDataInfo list(DeviceReportInfo deviceReportInfo)
|
||||
{
|
||||
System.err.println(deviceReportInfo.getSearchValue());
|
||||
List<DeviceReportInfo> list=new ArrayList<>();
|
||||
if(deviceReportInfo.getSearchValue()!=null){
|
||||
deviceReportInfo.setSerialNumber(deviceReportInfo.getSearchValue());
|
||||
}
|
||||
|
||||
startPage();
|
||||
list = deviceReportInfoService.selectDeviceReportInfoList(deviceReportInfo);
|
||||
|
||||
if (list.isEmpty()){
|
||||
deviceReportInfo.setSerialNumber(null);
|
||||
deviceReportInfo.setName(deviceReportInfo.getSearchValue());
|
||||
list = deviceReportInfoService.selectDeviceReportInfoList(deviceReportInfo);
|
||||
}
|
||||
|
||||
//查询设备在线状态
|
||||
list.forEach(d->{
|
||||
if(d.getType()==1){
|
||||
Boolean hassed = stringRedisTemplate.hasKey("neixiang_device_online_status:" + 147 + ":" + d.getSerialNumber());
|
||||
if(hassed){
|
||||
d.setOnLine(1);
|
||||
}else{
|
||||
d.setOnLine(0);
|
||||
}
|
||||
} else if ( d.getType()==2) {
|
||||
//展连流量计设备在线状态判断
|
||||
d.setType(0);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// //处理在线/离线筛选
|
||||
// if(deviceReportInfo.getOnLine()!=null){
|
||||
// //根据online状态的值过滤集合
|
||||
// list= list.stream().filter(d -> Objects.equals(d.getOnLine(), deviceReportInfo.getOnLine()))
|
||||
// .collect(Collectors.toList());
|
||||
// }
|
||||
System.err.println("过滤后总长度:"+list.size());
|
||||
return getDataTable(list);
|
||||
}
|
||||
//统计是设备相关信息
|
||||
@GetMapping("/list/count")
|
||||
@ApiOperation("统计是设备相关信息")
|
||||
|
Loading…
x
Reference in New Issue
Block a user