Browse Source

把设置菜单放到最后。

lighter 4 years ago
parent
commit
9b96b9d5db

+ 3 - 0
src/main/java/thyyxxk/webserver/entity/examinations/inspections/detail/InspectionDetail.java

@@ -4,6 +4,9 @@ import lombok.Data;
 
 import java.util.List;
 
+/**
+ * @author dj
+ */
 @Data
 public class InspectionDetail {
     private InspectionHeader inspectionHeader;

+ 10 - 2
src/main/java/thyyxxk/webserver/service/LoginService.java

@@ -25,6 +25,7 @@ public class LoginService {
     private final LoginDao dao;
     private final TokenService tokenService;
     private static final int DOUBLE_LEVEL_MAX = 10;
+    private static final int SETTINGS_CODE = 9;
 
     @Autowired
     public LoginService(LoginDao dao, TokenService tokenService) {
@@ -78,7 +79,6 @@ public class LoginService {
                 doubleLevelMenus.add(item);
             }
         });
-
         if (!doubleLevelMenus.isEmpty()) {
             Map<Integer, List<MenuItem>> doubleLevelMap = new HashMap<>(Capacity.DEFAULT);
             doubleLevelMenus.forEach(item -> {
@@ -118,8 +118,16 @@ public class LoginService {
             }
         }
         List<MenuItem> list = new ArrayList<>();
+        MenuItem settings = null;
         for (Map.Entry<Integer, MenuItem> entry : finalMap.entrySet()) {
-            list.add(entry.getValue());
+            if (entry.getValue().getCode() == SETTINGS_CODE) {
+                settings = entry.getValue();
+            } else {
+                list.add(entry.getValue());
+            }
+        }
+        if (null != settings) {
+            list.add(settings);
         }
         return ResultVoUtil.success(list);
     }