|
@@ -18,6 +18,7 @@ using TEAMModelOS.SDK.Models;
|
|
using System.Net.Http;
|
|
using System.Net.Http;
|
|
using DocumentFormat.OpenXml.Wordprocessing;
|
|
using DocumentFormat.OpenXml.Wordprocessing;
|
|
using static TEAMModelOS.SDK.GroupListService;
|
|
using static TEAMModelOS.SDK.GroupListService;
|
|
|
|
+using DocumentFormat.OpenXml.Drawing.Charts;
|
|
|
|
|
|
namespace TEAMModelOS.SDK
|
|
namespace TEAMModelOS.SDK
|
|
{
|
|
{
|
|
@@ -1088,6 +1089,58 @@ namespace TEAMModelOS.SDK
|
|
return (members, groupLists);
|
|
return (members, groupLists);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 根据名单类型获取名单及成员信息。
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="_coreAPIHttpService"></param>
|
|
|
|
+ /// <param name="client"></param>
|
|
|
|
+ /// <param name="type"></param>
|
|
|
|
+ /// <param name="scopes"></param>
|
|
|
|
+ /// <param name="school"></param>
|
|
|
|
+ /// <param name="_dingDing"></param>
|
|
|
|
+ /// <param name="graduate">毕业类型0在校,1毕业 , -1查全部。</param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ public static async Task<List<GroupListDto>> GetGroupListByType(CosmosClient client, string type, School school, Models.Period period, int graduate = -1)
|
|
|
|
+ {
|
|
|
|
+ List<GroupListDto> classes = new List<GroupListDto>();
|
|
|
|
+ List<int> grd = new List<int> ();
|
|
|
|
+ int index = 0;
|
|
|
|
+ period.grades.ForEach(z => { grd.Add(index); index+=1; });
|
|
|
|
+ var yearsdata = SchoolService.GetYears(school, period.id, grd);
|
|
|
|
+ List<int> years = yearsdata.years.ToList();
|
|
|
|
+
|
|
|
|
+ if (years.IsNotEmpty()) {
|
|
|
|
+ StringBuilder sql = new StringBuilder($"select 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.teacher.id as leader ,c.graduate from c where c.year in ({string.Join(",", years)}) and c.periodId='{period.id}' ");
|
|
|
|
+ if (graduate!=-1) {
|
|
|
|
+ sql.Append($" and c.graduate={graduate} ");
|
|
|
|
+ }
|
|
|
|
+ var result = await client.GetContainer(Constant.TEAMModelOS, Constant.School).GetList<RGroupList>(sql.ToString(), $"Class-{school}");
|
|
|
|
+
|
|
|
|
+ foreach (var item in result.list)
|
|
|
|
+ {
|
|
|
|
+ GroupListDto group = new GroupListDto
|
|
|
|
+ {
|
|
|
|
+ id = item.id,
|
|
|
|
+ code = $"GroupList-{school}",
|
|
|
|
+ name = item.name,
|
|
|
|
+ periodId = item.periodId,
|
|
|
|
+ scope = "school",
|
|
|
|
+ school = school.id,
|
|
|
|
+ type = "class",
|
|
|
|
+ expire= item.expire,
|
|
|
|
+ year = item.year,
|
|
|
|
+ no = item.no,
|
|
|
|
+ leader = item.leader,
|
|
|
|
+ pk = "GroupList",
|
|
|
|
+ graduate = item.graduate,
|
|
|
|
+ grades= new HashSet<int> { item.year }
|
|
|
|
+ };
|
|
|
|
+ classes.Add(group);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return classes;
|
|
|
|
+ }
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 根据名单类型获取名单及成员信息。
|
|
/// 根据名单类型获取名单及成员信息。
|
|
/// </summary>
|
|
/// </summary>
|