LEIYI 6 月之前
父節點
當前提交
3bf3b5b11f
共有 1 個文件被更改,包括 16 次插入13 次删除
  1. 16 13
      OASystem/OASystem.Api/Controllers/ResourceController.cs

+ 16 - 13
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -1566,21 +1566,24 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
                 foreach (var item in _ivitiesViews)
                 {
                     string groupNameStr = "";
-                    int[] groupIds = item.Delegation.Split(',').Select(x =>
+                    if (!string.IsNullOrEmpty(item.Delegation))
                     {
-                        int id;
-                        if (int.TryParse(x, out id)) return id;
-                        else return id;
-                    }).ToArray();
+                        int[] groupIds = item.Delegation.Split(',').Select(x =>
+                        {
+                            int id;
+                            if (int.TryParse(x, out id)) return id;
+                            else return id;
+                        }).ToArray();
 
-                    var _DelegationInfos = _sqlSugar.Queryable<Grp_DelegationInfo>().Where(x => groupIds.Contains(x.Id)).ToList();
-                    foreach (var group in _DelegationInfos)
-                    {
-                        groupNameStr += $"{group.TeamName},";
-                    }
-                    if (groupNameStr.Length > 1)
-                    {
-                        groupNameStr = groupNameStr.Substring(0, groupNameStr.Length - 1);
+                        var _DelegationInfos = _sqlSugar.Queryable<Grp_DelegationInfo>().Where(x => groupIds.Contains(x.Id)).ToList();
+                        foreach (var group in _DelegationInfos)
+                        {
+                            groupNameStr += $"{group.TeamName},";
+                        }
+                        if (groupNameStr.Length > 1)
+                        {
+                            groupNameStr = groupNameStr.Substring(0, groupNameStr.Length - 1);
+                        }
                     }
                 }