提交 279685fd authored 作者: zhoushaopan's avatar zhoushaopan

[装备vo]新增存储位置,以及模糊字段

[装备controller]新增了所属所在单位的排序
上级 a380226e
...@@ -173,8 +173,15 @@ public class DeviceLibraryController { ...@@ -173,8 +173,15 @@ public class DeviceLibraryController {
.collect(Collectors.toList()); .collect(Collectors.toList());
deviceLibraries.removeAll(deviceLibraryEntities); deviceLibraries.removeAll(deviceLibraryEntities);
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("stockDevices",deviceLibraryEntities); // map.put("stockDevices",deviceLibraryEntities);
map.put("notInStockDevices",deviceLibraries); // map.put("notInStockDevices",deviceLibraries);
//在库排序
List<DeviceLibrary> stockDevices = deviceLibraries.stream().sorted(Comparator.comparing(DeviceLibrary::getModel)).collect(Collectors.toList());
// map.put("stockDevices",deviceLibraryEntities);
map.put("stockDevices",stockDevices);
//不在库排序
List<DeviceLibrary> notInStockDevices = deviceLibraries.stream().sorted(Comparator.comparing(DeviceLibrary::getModel)).collect(Collectors.toList());
map.put("notInStockDevices",notInStockDevices);
return ResultUtil.success(map); return ResultUtil.success(map);
} }
...@@ -221,8 +228,10 @@ public class DeviceLibraryController { ...@@ -221,8 +228,10 @@ public class DeviceLibraryController {
List<String> models = new ArrayList<>(); List<String> models = new ArrayList<>();
List<String> names = new ArrayList<>(); List<String> names = new ArrayList<>();
// Set<String> names = new HashSet<>(); // Set<String> names = new HashSet<>();
Set<String> ownUnits = new HashSet<>(); List<String> ownUnits = new ArrayList<>();
Set<String> locationUnits = new HashSet<>(); // Set<String> ownUnits = new HashSet<>();
List<String> locationUnits = new ArrayList<>();
// Set<String> locationUnits = new HashSet<>();
Set<String> storageLocation = new HashSet<>(); Set<String> storageLocation = new HashSet<>();
resultList.forEach(deviceVo -> { resultList.forEach(deviceVo -> {
deviceVo.setConfigName(); deviceVo.setConfigName();
...@@ -242,8 +251,12 @@ public class DeviceLibraryController { ...@@ -242,8 +251,12 @@ public class DeviceLibraryController {
map.put("models",modelToSort); map.put("models",modelToSort);
List<String> nameList = names.stream().distinct().sorted(Comparator.comparing(s -> s)).collect(Collectors.toList()); List<String> nameList = names.stream().distinct().sorted(Comparator.comparing(s -> s)).collect(Collectors.toList());
map.put("names",nameList); map.put("names",nameList);
map.put("ownUnits",ownUnits); // map.put("ownUnits",ownUnits);
map.put("locationUnits",locationUnits); // map.put("locationUnits",locationUnits);
List<String> finalOwnUnits = ownUnits.stream().distinct().sorted(Comparator.comparing(String::toString)).collect(Collectors.toList());
map.put("ownUnits",finalOwnUnits);
List<String> finalLocationUnits = locationUnits.stream().distinct().sorted(Comparator.comparing(String::toString)).collect(Collectors.toList());
map.put("locationUnits",finalLocationUnits);
map.put("lifeStatus",status.stream().map(integer -> new LifeStatusVo(integer,lifeStatusMap.get(integer))).collect(Collectors.toList())); map.put("lifeStatus",status.stream().map(integer -> new LifeStatusVo(integer,lifeStatusMap.get(integer))).collect(Collectors.toList()));
map.put("storageLocation",storageLocation); map.put("storageLocation",storageLocation);
// System.out.println("222"); // System.out.println("222");
...@@ -259,8 +272,11 @@ public class DeviceLibraryController { ...@@ -259,8 +272,11 @@ public class DeviceLibraryController {
Boolean hasLocationUnitDim = deviceLibrarySelectVo.getLocationUnitDim()!=null; Boolean hasLocationUnitDim = deviceLibrarySelectVo.getLocationUnitDim()!=null;
Boolean hasOwnUnitDim = deviceLibrarySelectVo.getOwnUnitDim()!=null; Boolean hasOwnUnitDim = deviceLibrarySelectVo.getOwnUnitDim()!=null;
Boolean hasLifeStatusDim = deviceLibrarySelectVo.getLifeStatusDim()!=null; Boolean hasLifeStatusDim = deviceLibrarySelectVo.getLifeStatusDim()!=null;
//添加存储位置的查询
Boolean hasStorageLocationDim = deviceLibrarySelectVo.getStorageLocationDim() != null;
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
List<DeviceLibrary> resultList = deviceLibraryService.getList(deviceLibrarySelectVo); List<DeviceLibrary> resultList = deviceLibraryService.getList(deviceLibrarySelectVo);
resultList.forEach(DeviceLibrary::setConfigName); resultList.forEach(DeviceLibrary::setConfigName);
if (hasModelDim||hasLifeStatusDim||hasLocationUnitDim||hasNameDim||hasOwnUnitDim||hasSeqDim) { if (hasModelDim||hasLifeStatusDim||hasLocationUnitDim||hasNameDim||hasOwnUnitDim||hasSeqDim) {
resultList = resultList.stream().filter(deviceLibrary -> { resultList = resultList.stream().filter(deviceLibrary -> {
...@@ -270,7 +286,9 @@ public class DeviceLibraryController { ...@@ -270,7 +286,9 @@ public class DeviceLibraryController {
Boolean containLocationUnitDim = !hasLocationUnitDim||deviceLibrary.getLocationUnit().contains(deviceLibrarySelectVo.getLocationUnitDim()); Boolean containLocationUnitDim = !hasLocationUnitDim||deviceLibrary.getLocationUnit().contains(deviceLibrarySelectVo.getLocationUnitDim());
Boolean containOwnUnitDim = !hasOwnUnitDim||deviceLibrary.getOwnUnit().contains(deviceLibrarySelectVo.getOwnUnitDim()); Boolean containOwnUnitDim = !hasOwnUnitDim||deviceLibrary.getOwnUnit().contains(deviceLibrarySelectVo.getOwnUnitDim());
Boolean containLifeStatusDim = !hasLifeStatusDim||deviceLibrary.getLifeStatusName().contains(deviceLibrarySelectVo.getLifeStatusDim()); Boolean containLifeStatusDim = !hasLifeStatusDim||deviceLibrary.getLifeStatusName().contains(deviceLibrarySelectVo.getLifeStatusDim());
return containModelDim&&containNameDim&&containSeqDim&&containLocationUnitDim&&containOwnUnitDim&&containLifeStatusDim; Boolean containStorageLocationDim = !hasStorageLocationDim||deviceLibrary.getStorageLocation().contains(deviceLibrarySelectVo.getStorageLocationDim());
return containModelDim&&containNameDim&&containSeqDim&&containLocationUnitDim&&containOwnUnitDim&&containLifeStatusDim&&containStorageLocationDim;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
Map<Integer, DeviceLibrary> nodeCollect = Map<Integer, DeviceLibrary> nodeCollect =
...@@ -318,8 +336,11 @@ public class DeviceLibraryController { ...@@ -318,8 +336,11 @@ public class DeviceLibraryController {
//排序 //排序
List<String> names = new ArrayList<>(); List<String> names = new ArrayList<>();
// Set<String> names = new HashSet<>(); // Set<String> names = new HashSet<>();
Set<String> ownUnits = new HashSet<>(); List<String> ownUnits = new ArrayList<>();
Set<String> locationUnits = new HashSet<>(); // Set<String> ownUnits = new HashSet<>();
List<String> locationUnits = new ArrayList<>();
// Set<String> locationUnits = new HashSet<>();
Set<Integer> matchingRanges = new HashSet<>(); Set<Integer> matchingRanges = new HashSet<>();
resultList.forEach(deviceVo -> { resultList.forEach(deviceVo -> {
deviceVo.setConfigName(); deviceVo.setConfigName();
...@@ -335,8 +356,10 @@ public class DeviceLibraryController { ...@@ -335,8 +356,10 @@ public class DeviceLibraryController {
map.put("models",modelToSort); map.put("models",modelToSort);
List<String> nameList = names.stream().distinct().sorted(Comparator.comparing(String::toString)).collect(Collectors.toList()); List<String> nameList = names.stream().distinct().sorted(Comparator.comparing(String::toString)).collect(Collectors.toList());
map.put("names",nameList); map.put("names",nameList);
map.put("ownUnits",ownUnits); List<String> finalOwnUnits = ownUnits.stream().distinct().sorted(Comparator.comparing(String::toString)).collect(Collectors.toList());
map.put("locationUnits",locationUnits); map.put("ownUnits",finalOwnUnits);
List<String> finalLocationUnits = locationUnits.stream().distinct().sorted(Comparator.comparing(String::toString)).collect(Collectors.toList());
map.put("locationUnits",finalLocationUnits);
map.put("lifeStatus",status.stream().map(integer -> new LifeStatusVo(integer,lifeStatusMap.get(integer))).collect(Collectors.toList())); map.put("lifeStatus",status.stream().map(integer -> new LifeStatusVo(integer,lifeStatusMap.get(integer))).collect(Collectors.toList()));
map.put("matchingRanges",matchingRanges.stream().map(integer -> new LifeStatusVo(integer,matchingRangeMap.get(integer))).collect(Collectors.toList())); map.put("matchingRanges",matchingRanges.stream().map(integer -> new LifeStatusVo(integer,matchingRangeMap.get(integer))).collect(Collectors.toList()));
Page<DeviceLibrary> deviceLibraryEntities = PageUtil.getPerPage(deviceLibrarySelectVo.getPage(), deviceLibrarySelectVo.getSize(), containList, deviceLibrarySelectVo.getPageable()); Page<DeviceLibrary> deviceLibraryEntities = PageUtil.getPerPage(deviceLibrarySelectVo.getPage(), deviceLibrarySelectVo.getSize(), containList, deviceLibrarySelectVo.getPageable());
......
...@@ -792,6 +792,8 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService { ...@@ -792,6 +792,8 @@ public class DeviceLibraryServiceImpl implements DeviceLibraryService {
if (deviceLibrarySelectVo.getSeqInterval()!=null&&DeviceSeqUtil.selectDeviceSeqs(deviceLibrarySelectVo.getSeqInterval()).size()>0){ if (deviceLibrarySelectVo.getSeqInterval()!=null&&DeviceSeqUtil.selectDeviceSeqs(deviceLibrarySelectVo.getSeqInterval()).size()>0){
predicateBuilder.in("seqNumber", DeviceSeqUtil.selectDeviceSeqs(deviceLibrarySelectVo.getSeqInterval())); predicateBuilder.in("seqNumber", DeviceSeqUtil.selectDeviceSeqs(deviceLibrarySelectVo.getSeqInterval()));
} }
//新增库房位置
predicateBuilder.eq(deviceLibrarySelectVo.getStorageLocation() != null,"storageLocation",deviceLibrarySelectVo.getStorageLocation());
} }
return predicateBuilder; return predicateBuilder;
} }
......
...@@ -116,4 +116,10 @@ public class DeviceLibrarySelectVo extends CustomPage { ...@@ -116,4 +116,10 @@ public class DeviceLibrarySelectVo extends CustomPage {
@ApiModelProperty(value = "查询是否打印标签(有没有表面号)装备") @ApiModelProperty(value = "查询是否打印标签(有没有表面号)装备")
private Integer isPrint; private Integer isPrint;
@ApiModelProperty(value = "存储位置")
private String storageLocation;
@ApiModelProperty(value = "存储位置的模糊查询字段")
private String storageLocationDim;
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论