| | |
| | | /** |
| | | * 排序比较器 |
| | | */ |
| | | private Comparator<PLPageDefination> pageDefinationComparator = new Comparator<PLPageDefination>() { |
| | | private Comparator<PLDefinationVO> pageDefinationComparator = new Comparator<PLDefinationVO>() { |
| | | @Override |
| | | public int compare(PLPageDefination o1, PLPageDefination o2) { |
| | | return new Integer(o1.seq).compareTo(new Integer(o2.seq)); |
| | | public int compare(PLDefinationVO o1, PLDefinationVO o2) { |
| | | return new Integer(o1.getSeq()).compareTo(new Integer(o2.getSeq())); |
| | | } |
| | | }; |
| | | |
| | |
| | | |
| | | /** |
| | | * 查询页面设计定义 |
| | | * @param plPageContextOId |
| | | * @param pageContextOId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public DataGrid getPLPageDefinations(String plPageContextOId) throws PLException { |
| | | public DataGrid getPLPageDefinations(String pageContextOId) throws PLException { |
| | | DataGrid dataGrid = new DataGrid(); |
| | | if(Func.isBlank(plPageContextOId)) return dataGrid; |
| | | PLPageDefination[] plPageDefinations = platformClientUtil.getUIService().getPLPageDefinationsByPageContextOId(plPageContextOId); |
| | | |
| | | dataGrid.setTotal(plPageDefinations.length); |
| | | Arrays.sort(plPageDefinations, pageDefinationComparator); |
| | | dataGrid.setData(Arrays.asList(plPageDefinations)); |
| | | if(Func.isBlank(pageContextOId)) return dataGrid; |
| | | PLPageDefination[] plPageDefinations = platformClientUtil.getUIService().getPLPageDefinationsByPageContextOId(pageContextOId); |
| | | if(Func.isEmpty(plPageDefinations)){ |
| | | return dataGrid; |
| | | } |
| | | //DO2VO |
| | | List<PLDefinationVO> plDefinationVOS = this.pageDefinations2PLDefinationVO(Arrays.asList(plPageDefinations)); |
| | | dataGrid.setTotal(plDefinationVOS.size()); |
| | | Collections.sort(plDefinationVOS, Comparator.comparing(PLDefinationVO::getSeq)); |
| | | //Arrays.sort(plDefinationVOS, pageDefinationComparator); |
| | | dataGrid.setData(plDefinationVOS); |
| | | return dataGrid; |
| | | } |
| | | |
| | | /** |
| | | * 页面定义的DO2VO对象 |
| | | * @param plPageDefinations |
| | | * @return |
| | | */ |
| | | private List<PLDefinationVO> pageDefinations2PLDefinationVO(List<PLPageDefination> plPageDefinations){ |
| | | List<PLDefinationVO> plDefinationVOList = new ArrayList<>(); |
| | | plPageDefinations.stream().forEach(item->{ |
| | | try { |
| | | PLDefinationVO plDefinationVO = new PLDefinationVO(); |
| | | PLDefination plDefination = UITools.getPLDefination(item.plDefination); |
| | | BeanUtil.copy(plDefination,plDefinationVO); |
| | | plDefinationVOList.add(plDefinationVO); |
| | | } catch (Throwable e) { |
| | | e.printStackTrace(); |
| | | logger.error(e.getMessage()); |
| | | throw new VciBaseException("页面定义DO对象转VO对象时出现错误,原因:"+e.getMessage()); |
| | | } |
| | | }); |
| | | return plDefinationVOList; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加页面定义 |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * UI角色对象转换 |
| | | * @param infos |