| | |
| | | tempList.add(funcNode); |
| | | }); |
| | | // 排序 |
| | | List<FuncNode> sortList = tempList.stream().sorted(Comparator.comparing(X -> X.getUnitName())).collect(Collectors.toList()); |
| | | sortUnit(tempList,list); |
| | | // List<FuncNode> sortList = tempList.stream().sorted(Comparator.comparing(X -> X.getUnitName())).collect(Collectors.toList()); |
| | | // list.addAll(sortList); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 单元排序 |
| | | * @param tempList |
| | | * @param list |
| | | */ |
| | | private void sortUnit(List<FuncNode> tempList,List<FuncNode> list) { |
| | | // 遍历 |
| | | if(tempList.size()>1){ |
| | | for (FuncNode funcNode : tempList) { |
| | | if (funcNode.getUnitName().contains("一")){ |
| | | funcNode.setSort(1); |
| | | } |
| | | if (funcNode.getUnitName().contains("二")){ |
| | | funcNode.setSort(2); |
| | | } |
| | | if (funcNode.getUnitName().contains("三")){ |
| | | funcNode.setSort(3); |
| | | } |
| | | if (funcNode.getUnitName().contains("四")){ |
| | | funcNode.setSort(4); |
| | | } |
| | | if (funcNode.getUnitName().contains("五")){ |
| | | funcNode.setSort(5); |
| | | } |
| | | if (funcNode.getUnitName().contains("六")){ |
| | | funcNode.setSort(6); |
| | | } |
| | | } |
| | | // 排序 |
| | | List<FuncNode> sortList = tempList.stream().sorted(Comparator.comparing(X -> X.getSort())).collect(Collectors.toList()); |
| | | list.addAll(sortList); |
| | | } |
| | | } |