dengjunjie
2025-06-11 2ae5aa151f7b40a082e34aa7ed22b4b64edd1d3c
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_SystemRepository/Sys_MenuRepository.cs
@@ -27,11 +27,30 @@
        public List<MenuDTO> GetAllMenu()
        {
            List<Sys_Menu> menus = base.QueryData(x => x.Enable == 1 || x.Enable == 2).OrderByDescending(a => a.OrderNo).ThenByDescending(q => q.ParentId).ToList();
            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 =>
            {
                x.MenuType ??= 0;
                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;
        }
        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 =>
            {
                if (!string.IsNullOrEmpty(x.Auth) && x.Auth.Length > 10)
                {
                    try
@@ -99,7 +118,7 @@
                        ParentId = a.ParentId,
                        TableName = (a.TableName ?? "").ToLower(),
                        UserAuth = a.Auth,
                        MenuType = a.MenuType ?? 0
                        MenuType = a.MenuType
                    }).ToList();
                return MenuActionToArray(permissions);
            }
@@ -111,7 +130,7 @@
            {
                //没有redis/memory缓存角色的版本号或与当前服务器的角色版本号不同时,刷新缓存
                List<Permissions> _permissions = QueryTabs<Sys_Menu, Sys_RoleAuth, Permissions>((a, b) => new object[] { JoinType.Inner, a.MenuId == b.MenuId }, (a, b) => new Permissions { MenuId = a.MenuId, ParentId = a.ParentId, TableName = (a.TableName ?? "").ToLower(), MenuAuth = a.Auth, UserAuth = b.AuthValue ?? "", MenuType = a.MenuType ?? 0 }, (a, b) => b.RoleId == roleId, x => true);
                List<Permissions> _permissions = QueryTabs<Sys_Menu, Sys_RoleAuth, Permissions>((a, b) => new object[] { JoinType.Inner, a.MenuId == b.MenuId }, (a, b) => new Permissions { MenuId = a.MenuId, ParentId = a.ParentId, TableName = (a.TableName ?? "").ToLower(), MenuAuth = a.Auth, UserAuth = b.AuthValue ?? "", MenuType = a.MenuType }, (a, b) => b.RoleId == roleId, x => true);
                ActionToArray(_permissions);
@@ -194,7 +213,7 @@
                    p.Icon,
                    p.Enable,
                    // 2022.03.26增移动端加菜单类型
                    MenuType = p.MenuType ?? 0,
                    p.MenuType,
                    p.CreateDate,
                    p.Creater,
                    p.TableName,