提交 15a2b48e authored 作者: zjm's avatar zjm

合并分支 'dev' 到 'master'

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