소스 검색

商邀资料查询
团组Id不是必填项添加验证

leiy 11 달 전
부모
커밋
6f70e21925
1개의 변경된 파일17개의 추가작업 그리고 7개의 파일을 삭제
  1. 17 7
      OASystem/OASystem.Api/Controllers/ResourceController.cs

+ 17 - 7
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -1467,14 +1467,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 delegationNameList = "";
-                    string[] DelegationName = item.Delegation.Split(',');
-                    for (int i = 0; i < DelegationName.Length; i++)
+                    if (!string.IsNullOrEmpty(item.Delegation))
                     {
-                        delegationNameList += _DelegationInfos.Find(it => it.Id == int.Parse(DelegationName[i]))?.TeamName ?? "Unknown" + ",";
-                    }
-                    if (!string.IsNullOrWhiteSpace(delegationNameList))
-                    {
-                        item.DelegationStr = delegationNameList.Substring(0, delegationNameList.Length - 1);
+                        string[] DelegationName = item.Delegation.Split(',');
+                        for (int i = 0; i < DelegationName.Length; i++)
+                        {
+                            string grpId = DelegationName[i];
+                            if (!string.IsNullOrEmpty(grpId))
+                            {
+                                if (grpId.IsNumeric())
+                                {
+                                    delegationNameList += _DelegationInfos.Find(it => it.Id == int.Parse(grpId))?.TeamName ?? "Unknown" + ",";
+                                }
+                            }
+                        }
+                        if (!string.IsNullOrWhiteSpace(delegationNameList))
+                        {
+                            item.DelegationStr = delegationNameList.Substring(0, delegationNameList.Length - 1);
+                        }
                     }
                 }