瀏覽代碼

调整返回接口

zhouj1203@hotmail.com 3 年之前
父節點
當前提交
97aedd9f74
共有 1 個文件被更改,包括 13 次插入7 次删除
  1. 13 7
      TEAMModelOS.SDK/Models/Service/Common/ActivityStudentService.cs

+ 13 - 7
TEAMModelOS.SDK/Models/Service/Common/ActivityStudentService.cs

@@ -474,21 +474,27 @@ namespace TEAMModelOS.SDK.Services
                     }
                 }
             }
-            List<string> cIds = (List<string>)datas.Select(item => item.classIds);
-            HashSet<string> name = new HashSet<string>();
-            if (cIds.Count > 0) {
-                List<GroupListDto> groups = await GroupListService.GetGroupListListids(client, _dingDing, cIds, school);               
-                foreach (GroupListDto dto in groups)
+            List<(string id, HashSet<string> name)> cn = new(); 
+            foreach (StuActivity activity in datas) {
+                var cIds = activity.classIds;
+                HashSet<string> name = new HashSet<string>();
+                if (cIds.ToList().Count > 0)
                 {
-                    name.Add(dto.name);
+                    List<GroupListDto> groups = await GroupListService.GetGroupListListids(client, _dingDing, cIds.ToList(), school);
+                    foreach (GroupListDto dto in groups)
+                    {
+                        name.Add(dto.name);
+                    }
+                    cn.Add((activity.id, name));
                 }
             }
+            
             //string SummarySql = " c.id,c.code,c.name,c.no,c.periodId,c.scope,c.school,c.creatorId,c.type,c.year,c.tcount,c.scount,c.leader ";
            
             datas.Select(item => new {
                 item.name,
                 item.classIds,
-                cName = name,
+                cName = cn.Where(c =>c.id.Equals(item.id)).FirstOrDefault().name,
                 item.code,
                 item.createTime,
                 item.creatorId,