|
@@ -127,10 +127,10 @@ namespace TEAMModelOS.Controllers
|
|
|
|
|
|
schools.Add(item);
|
|
|
}
|
|
|
- List<Task<List<TeacherTrain>>> trains = new List<Task<List<TeacherTrain>>>();
|
|
|
+ List<Task<(List<TeacherTrain> trains, List<RGroupList> yxtrain)>> trains = new List<Task<(List<TeacherTrain> trains, List<RGroupList> yxtrain)>>();
|
|
|
int countArea = 0;
|
|
|
int appraiseArea = 0;
|
|
|
- List<dynamic> schoolInfos= new List<dynamic>();
|
|
|
+ List<SchoolInfos> schoolInfos= new List<SchoolInfos>();
|
|
|
foreach (var school in schools) {
|
|
|
int count = 0;
|
|
|
int appraise = 0;
|
|
@@ -145,13 +145,19 @@ namespace TEAMModelOS.Controllers
|
|
|
countArea += 1;
|
|
|
count += 1;
|
|
|
}
|
|
|
- schoolInfos.Add(new {schoolId=school.id,schoolName =school.name, picture = school.picture, teacherCount = count, appraiseCount = appraise });
|
|
|
+ schoolInfos.Add(new SchoolInfos { schoolId=school.id,schoolName =school.name, picture = school.picture, teacherCount = count, appraiseCount = appraise });
|
|
|
//增加评审人员总人数,学习总人数。
|
|
|
- trains.Add( StatisticsService.StatisticsSchool(school.id, setting, area, client, _dingDing, null));
|
|
|
+ trains.Add(StatisticsService.StatisticsSchool(school.id, setting, area, client, _dingDing, null));
|
|
|
}
|
|
|
- List<TeacherTrain> [] tasks = await Task.WhenAll(trains);
|
|
|
+ (List<TeacherTrain> trains, List<RGroupList> yxtrain)[] tasks = await Task.WhenAll(trains);
|
|
|
tasks.ToList().ForEach(x => {
|
|
|
- teacherTrains.AddRange(x);
|
|
|
+ teacherTrains.AddRange(x.trains);
|
|
|
+ schoolInfos.ForEach(y => {
|
|
|
+ var list = x.yxtrain.Find(z => z.school.Equals(y.schoolId));
|
|
|
+ if (list != null) {
|
|
|
+ y.trainCount = list.members.Count;
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
long totalTime=teacherTrains.Select(x => x.totalTime).Sum();
|
|
|
int hgcount = teacherTrains.Where(x => x.finalScore==1||x.finalScore==2).Count();
|
|
@@ -165,6 +171,15 @@ namespace TEAMModelOS.Controllers
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+ public class SchoolInfos {
|
|
|
+ public string schoolId{ get; set; }
|
|
|
+ public string schoolName { get; set; }
|
|
|
+ public string picture { get; set; }
|
|
|
+ public int teacherCount { get; set; }
|
|
|
+ public int appraiseCount { get; set; }
|
|
|
+ public int trainCount { get; set; }
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 对某个订阅的能力点进行操作
|
|
|
/// </summary>
|
|
@@ -236,7 +251,7 @@ namespace TEAMModelOS.Controllers
|
|
|
count += 1;
|
|
|
}
|
|
|
//增加评审人员总人数,学习总人数。
|
|
|
- List<TeacherTrain> teacherTrains = await StatisticsService.StatisticsSchool(school, setting, area, client, _dingDing,update) ;
|
|
|
+ (List<TeacherTrain> teacherTrains, List<RGroupList> yxtrain) = await StatisticsService.StatisticsSchool(school, setting, area, client, _dingDing,update) ;
|
|
|
//try
|
|
|
//{
|
|
|
// teacherTrain = await client.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemAsync<TeacherTrain>(userid, new PartitionKey($"TeacherTrain-{school}"));
|
|
@@ -246,7 +261,7 @@ namespace TEAMModelOS.Controllers
|
|
|
|
|
|
// await client.GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<TeacherTrain>(teacherTrain, new PartitionKey($"TeacherTrain-{school}"));
|
|
|
//}
|
|
|
- return Ok(new { teacherTrains, setting, teacherCount=count, appraiseCount=appraise });
|
|
|
+ return Ok(new { teacherTrains, setting, teacherCount=count, appraiseCount=appraise, yxtrain });
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|