提交 0f70c845 authored 作者: zhoushaopan's avatar zhoushaopan

fix(列装模块): 补充笔记

补充笔记
上级 8f0a9d77
......@@ -369,8 +369,8 @@ public class PackingController {
// Page<PackingLibrary> packingLibraries = PageUtil.getPerPage(selectPack.getPage(), selectPack.getSize(), resultList, selectPack.getPageable());
Page<PackingLibrary> packingLibraries = PageUtil.getPerPage(selectPack.getPage(), selectPack.getSize(), orderNumbers, selectPack.getPageable());
map.put("pages",packingLibraries);
List<String> models = new ArrayList<>(resultList.stream().filter(packingLibrary ->
packingLibrary.getIsRoot() == 1).map(PackingLibrary::getModel).collect(Collectors.toList()));
List<String> models = resultList.stream().filter(packingLibrary ->
packingLibrary.getIsRoot() == 1).map(PackingLibrary::getModel).collect(Collectors.toList());
//去重
models = models.stream().distinct().collect(Collectors.toList());
map.put("models",models);
......@@ -1277,14 +1277,16 @@ public class PackingController {
List<PackingLibrary> childs = resultList.stream().filter(packingLibrary -> packingLibrary.getChilds() == null || packingLibrary.getChilds().size() == 0).collect(Collectors.toList());
//取出不为空的
resultList.removeAll(childs);
//判断是不是第一次添加的
childs.forEach(packingLibrary -> {
List<PackingLibrary> in = packingLibraryDao.findAllByPartParentIdAndPackingStatusIn(packingLibrary.getId(), statuses);
if (in == null || in.size() == 0) {
resultList.add(packingLibrary);
}
});
resultList.sort(Comparator.comparing(PackingLibrary::getShowOrder,Comparator.nullsLast(Integer::compareTo))
.thenComparing(Comparator.comparing(PackingLibrary::getModel)));
.thenComparing(PackingLibrary::getModel));
return resultList;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论