From 3c7658b4fff5cfba50105357eb3723dcbcea5c6a Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期五, 27 十二月 2024 18:38:24 +0800
Subject: [PATCH] AGV接口逻辑

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_SystemRepository/Sys_MenuRepository.cs |   34 +++++++++++++++++++---------------
 1 files changed, 19 insertions(+), 15 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_SystemRepository/Sys_MenuRepository.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_SystemRepository/Sys_MenuRepository.cs"
index da9c152..139ac7f 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_SystemRepository/Sys_MenuRepository.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_SystemRepository/Sys_MenuRepository.cs"
@@ -47,22 +47,26 @@
 
         public List<MenuDTO> GetAllMenuPDA()
         {
-            List<Sys_Menu> menus = base.QueryData(x => (x.Enable == 1 || x.Enable == 2) && x.MenuType == 1).OrderByDescending(a => a.OrderNo).ThenByDescending(q => q.ParentId).ToList();
-            List<MenuDTO> _menus = _mapper.Map<List<MenuDTO>>(menus);
-            _menus.ForEach(x =>
+            //List<Sys_Menu> menus = base.QueryData(x => (x.Enable == 1 || x.Enable == 2) && x.MenuType == App.User.MenuType).OrderByDescending(a => a.OrderNo).ThenByDescending(q => q.ParentId).ToList();
+            //List<MenuDTO> _menus = _mapper.Map<List<MenuDTO>>(menus);
+            //_menus.ForEach(x =>
+            //{
+            //    if (!string.IsNullOrEmpty(x.Auth) && x.Auth.Length > 10)
+            //    {
+            //        try
+            //        {
+            //            x.Actions = x.Auth.DeserializeObject<List<ActionDTO>>();
+            //        }
+            //        catch { }
+            //    }
+            //    x.Actions ??= new List<ActionDTO>();
+            //});
+            if (App.User.IsRoleIdSuperAdmin(App.User.RoleId))
             {
-                if (!string.IsNullOrEmpty(x.Auth) && x.Auth.Length > 10)
-                {
-                    try
-                    {
-                        x.Actions = x.Auth.DeserializeObject<List<ActionDTO>>();
-                    }
-                    catch { }
-                }
-                x.Actions ??= new List<ActionDTO>();
-            });
-            string test = _menus.Serialize();
-            return _menus;
+                return GetAllMenu();
+            }
+            List<int> menuIds = GetPermissions(App.User.RoleId).Select(x => x.MenuId).ToList();
+            return GetAllMenu().Where(x => menuIds.Contains(x.MenuId)).ToList();
         }
 
         public object GetSuperAdminMenu()

--
Gitblit v1.9.3