Parcourir la source

完善安卓菜单数据

yuanrf il y a 1 an
Parent
commit
7000fb09d7

+ 7 - 14
OASystem/OASystem.Infrastructure/Repositories/System/SystemMenuPermissionRepository.cs

@@ -79,12 +79,12 @@ namespace OASystem.Infrastructure.Repositories.System
                       d.IosUrl
                       from Sys_UserAuthority a inner join Sys_PageFunctionPermission b on a.FId = b.Id 
                       inner join Sys_SystemMenuPermission d on a.SmId = d.Id inner join Sys_SetData c on c.Id = d.Mid
-                      where uid = {uid} and b.Id = 1 and a.IsDel= 0  and b.IsDel = 0 
+                      where uid = {uid} and a.IsDel= 0  and b.IsDel = 0 
                       and b.IsEnable = 1 and c.IsDel = 0 and d.IsDel = 0   ";
 
                 if (PortType == 1)
                 {
-                    sql += $@"   and d.IsEnable = 1  group by 
+                    sql += $@" and b.Id = 1 and d.IsEnable = 1  group by 
                       a.UId,a.SmId,b.Id,b.FunctionName,b.FunctionCode,c.Id,
                       c.Name,c.STid,d.Id,d.Name,d.SystemMenuCode,d.webUrl,d.AndroidUrl,d.icon,
                       d.IosUrl";
@@ -92,7 +92,7 @@ namespace OASystem.Infrastructure.Repositories.System
                 }
                 else if (PortType == 2)
                 {
-                    sql += $@"  and d.phoneIsEnable = 1 group by 
+                    sql += $@" and d.phoneIsEnable = 1 group by 
                       a.UId,a.SmId,b.Id,b.FunctionName,b.FunctionCode,c.Id,
                       c.Name,c.STid,d.Id,d.Name,d.SystemMenuCode,d.webUrl,d.AndroidUrl,d.icon,
                       d.IosUrl ";
@@ -140,21 +140,14 @@ namespace OASystem.Infrastructure.Repositories.System
                     }
                     else if (PortType == 2)
                     {
-                        var pages = DBData.Select(x => x.pageid).ToArray();
+                        var AndMenu = DBData.GroupBy(x => x.SmId).ToList();
 
-                        //获取页面所有的操作
-                        var PageFunList = _sqlSugar.SqlQueryable<Sys_SystemMenuAndFunction>(@$"
-                              select * from Sys_SystemMenuAndFunction where SmId in ({string.Join(",", pages).TrimEnd(',')})
-                                and IsEnable = 1 and isdel = 0
-                        ").ToList();
-
-                        foreach (var item in pages)
+                        foreach (var item in AndMenu)
                         {
-
                             arr.Add(new
                             {
-                                pageid = item,
-                                opList = PageFunList.FindAll(x=>x.SmId == item),
+                                pageid = item.Key,
+                                opList = item.Select(x=>x.Funid).ToList(),
                             });
                         }           
                     }