设备名称,编号模糊搜索

This commit is contained in:
mi9688
2025-01-08 17:46:25 +08:00
parent 8b6616ae2b
commit 74f577ad3c

View File

@ -1,9 +1,6 @@
package com.fastbee.data.controller; package com.fastbee.data.controller;
import java.util.HashMap; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -60,10 +57,21 @@ public class DeviceReportInfoController extends BaseController
@ApiOperation("查询设备上电审核前上报的基础信息列表") @ApiOperation("查询设备上电审核前上报的基础信息列表")
public TableDataInfo list(DeviceReportInfo deviceReportInfo) public TableDataInfo list(DeviceReportInfo deviceReportInfo)
{ {
System.err.println(deviceReportInfo.getSearchValue());
List<DeviceReportInfo> list=new ArrayList<>();
if(deviceReportInfo.getSearchValue()!=null){
deviceReportInfo.setSerialNumber(deviceReportInfo.getSearchValue());
}
startPage(); startPage();
List<DeviceReportInfo> list = deviceReportInfoService.selectDeviceReportInfoList(deviceReportInfo); list = deviceReportInfoService.selectDeviceReportInfoList(deviceReportInfo);
System.err.println("查询条件:"+deviceReportInfo.getOnLine());
System.err.println("设备总长度:"+list.size()); if (list.isEmpty()){
deviceReportInfo.setSerialNumber(null);
deviceReportInfo.setName(deviceReportInfo.getSearchValue());
list = deviceReportInfoService.selectDeviceReportInfoList(deviceReportInfo);
}
//查询设备在线状态 //查询设备在线状态
list.forEach(d->{ list.forEach(d->{
if(d.getType()==1){ if(d.getType()==1){
@ -78,6 +86,8 @@ public class DeviceReportInfoController extends BaseController
d.setType(0); d.setType(0);
} }
}); });
// //处理在线/离线筛选 // //处理在线/离线筛选
// if(deviceReportInfo.getOnLine()!=null){ // if(deviceReportInfo.getOnLine()!=null){
// //根据online状态的值过滤集合 // //根据online状态的值过滤集合