ソースを参照

菜单排序修改

master
WendyYang 1年前
コミット
e15ec02ce3
2個のファイルの変更4行の追加1行の削除
  1. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/App.java
  2. +2
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java

+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/App.java ファイルの表示

@@ -7,6 +7,7 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
@@ -21,6 +22,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@EnableScheduling
@EnableTransactionManagement
@EnableAspectJAutoProxy(exposeProxy = true)
@ComponentScan(basePackages = {"com.ningdatech.pmapi", "com.ningdatech.irs"})
public class App {

protected static final String MAPPER_PACKAGES = "com.ningdatech.pmapi.**.mapper";


+ 2
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/util/TreeUtil.java ファイルの表示

@@ -2,6 +2,7 @@ package com.ningdatech.pmapi.common.util;


import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import com.google.common.collect.Maps;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.basic.util.StrPool;
@@ -145,7 +146,7 @@ public final class TreeUtil {
} else {
menus = new ArrayList<>(currMenus);
}
menus.sort(Comparator.comparing(MenuRoleVO::getSort));
menus.sort(Comparator.comparing(w -> ObjectUtil.defaultIfNull(w.getSort(), 99)));
ListIterator<MenuRoleVO> currIter = menus.listIterator();
while (currIter.hasNext()) {
MenuRoleVO curr = currIter.next();


読み込み中…
キャンセル
保存