Commit dfa41020 by 杨林龙

新增权限控制

1 parent 905bec2b
...@@ -1099,7 +1099,14 @@ public class VehicleService { ...@@ -1099,7 +1099,14 @@ public class VehicleService {
} }
if (search.getDeviceState() != null) { if (search.getDeviceState() != null) {
vehicleInfoList.removeIf(vehicleInfoPageDTO -> !search.getDeviceState().equals(vehicleInfoPageDTO.getDeviceState())); vehicleInfoList.removeIf(vehicleInfoPageDTO -> {
Integer deviceState = vehicleInfoPageDTO.getDeviceState();
if (deviceState != null) {
return search.getDeviceState().intValue() != deviceState.intValue();
}
// deviceState 为null 的时候为删掉
return true;
});
} }
return new PageInfo<>(vehicleInfoList); return new PageInfo<>(vehicleInfoList);
} }
...@@ -1229,7 +1236,14 @@ public class VehicleService { ...@@ -1229,7 +1236,14 @@ public class VehicleService {
} }
if (search.getDeviceState() != null) { if (search.getDeviceState() != null) {
vehicleInfoReportExportList.removeIf(vehicleInfoReportExport -> !search.getDeviceState().equals(vehicleInfoReportExport.getDeviceState())); vehicleInfoReportExportList.removeIf(vehicleInfoReportExport -> {
Integer deviceState = vehicleInfoReportExport.getDeviceState();
if (deviceState != null) {
return search.getDeviceState().intValue() != deviceState.intValue();
}
// deviceState 为null 的时候为删掉
return true;
});
} }
return vehicleInfoReportExportList; return vehicleInfoReportExportList;
......
...@@ -2140,4 +2140,13 @@ public class VehicleServiceTest { ...@@ -2140,4 +2140,13 @@ public class VehicleServiceTest {
System.out.println("trackInfoBo = " + JSON.toJSONString(trackInfoBo)); System.out.println("trackInfoBo = " + JSON.toJSONString(trackInfoBo));
} }
@Test
public void test14() {
List<Integer> integers = new ArrayList<>();
integers.add(1);
integers.add(4);
integers.removeIf(a -> a != 4);
System.out.println("integers = " + JSON.toJSONString(integers));
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!