| | |
| | | import org.springblade.mdm.program.vo.*; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | ncNodeVO.setFlowStatus(programFlowStatusQueryService.queryFlowStatus(ncNodeVO.getProcessInstanceId())); |
| | | } |
| | | } |
| | | //文件,按照先程序,后其他排序 |
| | | if(list.get(0).getNodeType().equals(NcNode.TYPE_PROGRAM_FILE)){ |
| | | NcNode parentNode = ncNodeService.getById(parentId); |
| | | //list.sort(Comparator.comparing().thenComparing(NcNodeVO::getName)); |
| | | Comparator<NcNodeVO> cp = new Comparator<NcNodeVO>() { |
| | | @Override |
| | | public int compare(NcNodeVO n1, NcNodeVO n2) { |
| | | if (n1.getName().startsWith(parentNode.getName()) && !n2.getName().startsWith(parentNode.getName())) { |
| | | return -1; |
| | | } else { |
| | | return 1; |
| | | } |
| | | } |
| | | }; |
| | | list.sort(cp.thenComparing(NcNodeVO::getName)); |
| | | /* |
| | | list.sort((n1, n2) -> { |
| | | |
| | | if(n1.getName().startsWith(parentNode.getName())){ |
| | | return 1; |
| | | }else{ |
| | | return n1.getName().compareTo(n2.getName()); |
| | | } |
| | | |
| | | });*/ |
| | | /* |
| | | Collections.sort(userList, new Comparator<User>() { |
| | | @Override |
| | | public int compare(User u1, User u2) { |
| | | return u1.getName().compareTo(u2.getName()); |
| | | } |
| | | });*/ |
| | | } |
| | | } |
| | | return R.data(list); |
| | | } |