diff --git a/wfc-modules/wfc-modules-user/src/main/java/org/wfc/user/domain/vo/MetaVo.java b/wfc-modules/wfc-modules-user/src/main/java/org/wfc/user/domain/vo/MetaVo.java index 8391ae1..9237e27 100644 --- a/wfc-modules/wfc-modules-user/src/main/java/org/wfc/user/domain/vo/MetaVo.java +++ b/wfc-modules/wfc-modules-user/src/main/java/org/wfc/user/domain/vo/MetaVo.java @@ -29,35 +29,41 @@ public class MetaVo */ private String link; + /** 显示顺序 */ + private Integer order; + public MetaVo() { } - public MetaVo(String title, String icon) + public MetaVo(String title, String icon, Integer order) { this.title = title; this.icon = icon; } - public MetaVo(String title, String icon, boolean noCache) + public MetaVo(String title, String icon, boolean noCache, Integer order) { this.title = title; this.icon = icon; this.noCache = noCache; + this.order = order; } - public MetaVo(String title, String icon, String link) + public MetaVo(String title, String icon, String link, Integer order) { this.title = title; this.icon = icon; this.link = link; + this.order = order; } - public MetaVo(String title, String icon, boolean noCache, String link) + public MetaVo(String title, String icon, boolean noCache, String link, Integer order) { this.title = title; this.icon = icon; this.noCache = noCache; + this.order = order; if (StringUtils.ishttp(link)) { this.link = link; @@ -103,4 +109,12 @@ public class MetaVo { this.link = link; } + + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } } diff --git a/wfc-modules/wfc-modules-user/src/main/java/org/wfc/user/service/impl/UMenuServiceImpl.java b/wfc-modules/wfc-modules-user/src/main/java/org/wfc/user/service/impl/UMenuServiceImpl.java index 6f633c0..2d60dce 100644 --- a/wfc-modules/wfc-modules-user/src/main/java/org/wfc/user/service/impl/UMenuServiceImpl.java +++ b/wfc-modules/wfc-modules-user/src/main/java/org/wfc/user/service/impl/UMenuServiceImpl.java @@ -168,7 +168,7 @@ public class UMenuServiceImpl implements IUMenuService router.setPath(getRouterPath(menu)); router.setComponent(getComponent(menu)); router.setQuery(menu.getQuery()); - router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath())); + router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath(), menu.getOrderNum())); List cMenus = menu.getChildren(); if (StringUtils.isNotEmpty(cMenus) && UserConstants.TYPE_DIR.equals(menu.getMenuType())) { @@ -184,14 +184,14 @@ public class UMenuServiceImpl implements IUMenuService children.setPath(menu.getPath()); children.setComponent(menu.getComponent()); children.setName(menu.getName()); - children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath())); + children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath(), menu.getOrderNum())); children.setQuery(menu.getQuery()); childrenList.add(children); router.setChildren(childrenList); } else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) { - router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon())); + router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), menu.getOrderNum())); router.setPath("/"); List childrenList = new ArrayList(); RouterVo children = new RouterVo(); @@ -199,7 +199,7 @@ public class UMenuServiceImpl implements IUMenuService children.setPath(routerPath); children.setComponent(UserConstants.INNER_LINK); children.setName(menu.getName()); - children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), menu.getPath())); + children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), menu.getPath(), menu.getOrderNum())); childrenList.add(children); router.setChildren(childrenList); }