|
@@ -72,6 +72,8 @@ namespace TEAMModelOS.FunctionV4
|
|
|
{
|
|
|
sub.Add(subject.id);
|
|
|
}
|
|
|
+ //整合名单
|
|
|
+ List<string> classes = ExamService.getClasses(info.classes, info.stuLists);
|
|
|
//ChangeRecord record = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemAsync<ChangeRecord>(input.Id, new Azure.Cosmos.PartitionKey($"{info.progress}"));
|
|
|
switch (info.progress)
|
|
|
{
|
|
@@ -105,8 +107,7 @@ namespace TEAMModelOS.FunctionV4
|
|
|
|
|
|
try
|
|
|
{
|
|
|
- //处理活动中间件
|
|
|
- (List<string> classes, List<RGroupList> members) = await Activity(_coreAPIHttpService, info, client, _dingDing, sub);
|
|
|
+
|
|
|
//向学生或醍摩豆账号发起通知
|
|
|
#region
|
|
|
//Notice notice = new Notice()
|
|
@@ -129,9 +130,11 @@ namespace TEAMModelOS.FunctionV4
|
|
|
//messageBlob.ApplicationProperties.Add("name", "Notice");
|
|
|
//await _serviceBus.GetServiceBusClient().SendMessageAsync(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), messageBlob);
|
|
|
#endregion
|
|
|
+ //List<string> classes = new List<string>();
|
|
|
if (examClassResults.Count == 0)
|
|
|
{
|
|
|
-
|
|
|
+ //处理活动中间件
|
|
|
+ List<RGroupList> members = await Activity(_coreAPIHttpService,info, classes, client, _dingDing, sub);
|
|
|
foreach (string cla in classes)
|
|
|
{
|
|
|
int m = 0;
|
|
@@ -295,6 +298,20 @@ namespace TEAMModelOS.FunctionV4
|
|
|
}
|
|
|
gno++;
|
|
|
}
|
|
|
+ if (gno == info.subjects.Count) {
|
|
|
+ var isScore = examClassResults.SelectMany(e => e.studentScores).ToList().Exists(c => c.Contains(-1));
|
|
|
+ int newStatus = 0;
|
|
|
+ if (!isScore)
|
|
|
+ {
|
|
|
+ newStatus = 1;
|
|
|
+ }
|
|
|
+ //判断评分状态是否发生变化,便于实时的更新评测基本信息
|
|
|
+ if (info.sStatus != newStatus)
|
|
|
+ {
|
|
|
+ info.sStatus = newStatus;
|
|
|
+ await client.GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync<ExamInfo>(info, info.id, new PartitionKey(info.code));
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
catch (Exception e)
|
|
@@ -344,7 +361,7 @@ namespace TEAMModelOS.FunctionV4
|
|
|
}
|
|
|
//处理活动中间件
|
|
|
if (info.source.Equals("1")) {
|
|
|
- await Activity(_coreAPIHttpService, info, client, _dingDing, sub);
|
|
|
+ await Activity(_coreAPIHttpService,info, classes,client, _dingDing, sub);
|
|
|
}
|
|
|
foreach (ExamSubject subject in info.subjects)
|
|
|
{
|
|
@@ -549,7 +566,7 @@ namespace TEAMModelOS.FunctionV4
|
|
|
await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-{info.id}-评测作答记录结算异常{ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
|
|
|
}
|
|
|
}
|
|
|
- public static async Task<(List<string> classes,List<RGroupList> members)> Activity(CoreAPIHttpService _coreAPIHttpService, ExamInfo info, CosmosClient client, DingDing _dingDing, List<string> sub) {
|
|
|
+ public static async Task<List<RGroupList>> Activity(CoreAPIHttpService _coreAPIHttpService, ExamInfo info, List<string> classes,CosmosClient client, DingDing _dingDing, List<string> sub) {
|
|
|
List<(string pId, List<string> gid)> ps = new List<(string pId, List<string> gid)>();
|
|
|
if (info.groupLists.Count > 0)
|
|
|
{
|
|
@@ -562,8 +579,7 @@ namespace TEAMModelOS.FunctionV4
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- List<string> classes = ExamService.getClasses(info.classes, info.stuLists);
|
|
|
- (List<RMember> tchList, List<RGroupList> classLists) = await GroupListService.GetStutmdidListids(_coreAPIHttpService, client, _dingDing, classes, info.school, ps);
|
|
|
+ (List<RMember> tchList, List<RGroupList> classLists) = await GroupListService.GetStutmdidListids(_coreAPIHttpService,client, _dingDing, classes, info.school, ps);
|
|
|
var addStudentsCls = tchList.FindAll(x => x.type == 2);
|
|
|
var addTmdidsCls = tchList.FindAll(x => x.type == 1);
|
|
|
List<StuActivity> stuActivities = new List<StuActivity>();
|
|
@@ -600,7 +616,7 @@ namespace TEAMModelOS.FunctionV4
|
|
|
owner = info.owner,
|
|
|
createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
|
|
|
taskStatus = -1,
|
|
|
- //ext = new Dictionary<string, JsonElement>() { { "name",new JsonElement()} },
|
|
|
+ ext = new Dictionary<string, JsonElement>() { { "type",info.type.ToJsonString().ToObject<JsonElement>() },{ "subjects", info.subjects.ToJsonString().ToObject<JsonElement>() } },
|
|
|
//sStatus = info.sStatus,
|
|
|
classIds = classIds.ToList()
|
|
|
|
|
@@ -639,13 +655,14 @@ namespace TEAMModelOS.FunctionV4
|
|
|
owner = info.owner,
|
|
|
classIds = classIds.ToList(),
|
|
|
createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
|
|
|
+ ext = new Dictionary<string, JsonElement>() { { "type", info.type.ToJsonString().ToObject<JsonElement>() }, { "subjects", info.subjects.ToJsonString().ToObject<JsonElement>() } },
|
|
|
taskStatus = -1
|
|
|
//sStatus = info.sStatus,
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
await ActivityService.SaveStuActivity(client, _dingDing, stuActivities, tmdActivities, null);
|
|
|
- return (classes, classLists);
|
|
|
+ return classLists;
|
|
|
}
|
|
|
|
|
|
public static async Task knowledgeCount(ExamInfo info, ExamSubject subject, DingDing _dingDing, int no, List<ExamClassResult> classResults,
|