|
@@ -17,11 +17,12 @@ namespace TEAMModelOS.SDK.Models.Service
|
|
|
{
|
|
|
public class GroupListService
|
|
|
{
|
|
|
- public static async Task<(int status, GroupList stuList)> CodeJoinList(CosmosClient client, string _stuListNo, string userid, string name, string no, int type, string picture, string school)
|
|
|
+ public static async Task<(int status, GroupList stuList)> CodeJoinList(CosmosClient client, string _stuListNo, string userid, string name, string no, int type, string picture, string school)
|
|
|
{
|
|
|
var queryNo = $"SELECT value(c) FROM c where c.no ='{_stuListNo}'";
|
|
|
- (int status, GroupList stuList) data = (-1,null);
|
|
|
- if (!string.IsNullOrEmpty(school)) {
|
|
|
+ (int status, GroupList stuList) data = (-1, null);
|
|
|
+ if (!string.IsNullOrEmpty(school))
|
|
|
+ {
|
|
|
await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<GroupList>(queryText: queryNo,
|
|
|
requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"GroupList-{school}") }))
|
|
|
{
|
|
@@ -32,7 +33,7 @@ namespace TEAMModelOS.SDK.Models.Service
|
|
|
await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<GroupList>(queryText: queryNo,
|
|
|
requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"GroupList") }))
|
|
|
{
|
|
|
- data= JoinList(item, userid, name, no, type, picture, school);
|
|
|
+ data = JoinList(item, userid, name, no, type, picture, school);
|
|
|
break;
|
|
|
}
|
|
|
return data;
|
|
@@ -202,7 +203,7 @@ namespace TEAMModelOS.SDK.Models.Service
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
- public static async Task<GroupList> CheckListNo(GroupList list, AzureCosmosFactory _azureCosmos, DingDing _dingDing, Option _option)
|
|
|
+ public static async Task<GroupList> CheckListNo(GroupList list, AzureCosmosFactory _azureCosmos, DingDing _dingDing, Option _option)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
@@ -435,7 +436,8 @@ namespace TEAMModelOS.SDK.Models.Service
|
|
|
{
|
|
|
//取差集,减少二次搜寻
|
|
|
var tmdidexp = tmids.Select(x => x.id).Except(tmdsData.Select(y => y.id)).ToList();
|
|
|
- if (tmdidexp.IsNotEmpty()) {
|
|
|
+ if (tmdidexp.IsNotEmpty())
|
|
|
+ {
|
|
|
StringBuilder tmdidSql = new StringBuilder($"SELECT distinct c.name,c.id,c.picture FROM c ");
|
|
|
string insql = string.Join(",", tmdidexp.Select(x => $"'{x}'"));
|
|
|
tmdidSql.Append($" where c.id in ({insql})");
|