//去重和排序 List<SysResource> sortList = new ArrayList<SysResource>(); sortList.addAll(list); sortList = new ArrayList<SysResource>(new HashSet<SysResource>(sortList));// 去重 Collections.sort(sortList, new Comparator<SysResource>() {// 排序 @Override public int compare(SysResource o1, SysResource o2) { if (o1.getSeq() == null) { o1.setSeq(1000); } if (o2.getSeq() == null) { o2.setSeq(1000); } return o1.getSeq().compareTo(o2.getSeq()); } });
时间: 2024-11-10 11:35:51