|
@@ -83,45 +83,6 @@ namespace TEAMModelFunction
|
|
|
}
|
|
|
break;
|
|
|
case "going":
|
|
|
- //if (survey.scope == "school")
|
|
|
- //{
|
|
|
- // data = new ActivityData
|
|
|
- // {
|
|
|
- // id = survey.id,
|
|
|
- // code = $"Activity-{survey.school}",
|
|
|
- // type = "survey",
|
|
|
- // name = survey.name,
|
|
|
- // startTime = survey.startTime,
|
|
|
- // endTime = survey.endTime,
|
|
|
- // scode = survey.code,
|
|
|
- // scope = survey.scope,
|
|
|
- // classes = survey.classes.IsNotEmpty() ? survey.classes : new List<string> { "" },
|
|
|
- // tmdids = survey.tmdids.IsNotEmpty() ? survey.tmdids : new List<string> { "" },
|
|
|
- // progress = "going",
|
|
|
- // subjects = new List<string> { "" }
|
|
|
- // };
|
|
|
- // await client.GetContainer("TEAMModelOS", "School").UpsertItemAsync<ActivityData>(data, new Azure.Cosmos.PartitionKey(data.code));
|
|
|
- //}
|
|
|
- //else if (survey.scope == "private")
|
|
|
- //{
|
|
|
- // data = new ActivityData
|
|
|
- // {
|
|
|
- // id = survey.id,
|
|
|
- // code = $"Activity-Common",
|
|
|
- // type = "survey",
|
|
|
- // name = survey.name,
|
|
|
- // startTime = survey.startTime,
|
|
|
- // endTime = survey.endTime,
|
|
|
- // scode = survey.code,
|
|
|
- // scope = survey.scope,
|
|
|
- // progress = "going",
|
|
|
- // classes = survey.classes.IsNotEmpty() ? survey.classes : new List<string> { "" },
|
|
|
- // tmdids = new List<string> { "" },
|
|
|
- // subjects = new List<string> { "" }
|
|
|
- // };
|
|
|
- // await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync<ActivityData>(data, new Azure.Cosmos.PartitionKey(data.code));
|
|
|
- //}
|
|
|
-
|
|
|
(List<string> tmdids,List<Students> students) = await TriggerStuActivity. GetStuList(client, survey.classes, survey.school);
|
|
|
await _dingDing.SendBotMsg($"问卷调查{tdata.id}写入学生表作为活动列表!", GroupNames.成都开发測試群組);
|
|
|
List<StuActivity> stuActivities = new List<StuActivity>();
|
|
@@ -208,12 +169,11 @@ namespace TEAMModelFunction
|
|
|
var value = submit.ToString();
|
|
|
userids.Add(value);
|
|
|
}
|
|
|
- var cods = new { records = recs, userids };
|
|
|
- //问卷整体情况
|
|
|
- await _azureStorage.UploadFileByContainer(blobcntr, cods.ToJsonString(), "survey", $"{survey.id}/record.json");
|
|
|
+
|
|
|
+ List<QuestionRecord> questionRecords = new List<QuestionRecord>();
|
|
|
//结算每道题的答题情况
|
|
|
var ContainerClient = _azureStorage.GetBlobContainerClient(blobcntr);
|
|
|
- List<Task<string>> tasks = new List<Task<string>>();
|
|
|
+ //List<Task<string>> tasks = new List<Task<string>>();
|
|
|
//获取
|
|
|
try {
|
|
|
List<string> items = await ContainerClient.List($"survey/{survey.id}/urecord");
|
|
@@ -264,12 +224,16 @@ namespace TEAMModelFunction
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- tasks.Add( _azureStorage.UploadFileByContainer(blobcntr, question.ToJsonString(), "survey", url));
|
|
|
+ questionRecords.Add(question);
|
|
|
+ //tasks.Add( _azureStorage.UploadFileByContainer(blobcntr, question.ToJsonString(), "survey", url));
|
|
|
}
|
|
|
- await Task.WhenAll(tasks);
|
|
|
+ // await Task.WhenAll(tasks);
|
|
|
} catch (Exception ex) {
|
|
|
await _dingDing.SendBotMsg($"问卷调查问题结算异常{ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
|
|
|
}
|
|
|
+ var cods = new { records = recs, userids, question= questionRecords };
|
|
|
+ //问卷整体情况
|
|
|
+ await _azureStorage.UploadFileByContainer(blobcntr, cods.ToJsonString(), "survey", $"{survey.id}/record.json");
|
|
|
if (string.IsNullOrEmpty(survey.recordUrl))
|
|
|
{
|
|
|
survey.recordUrl = $"/survey/{survey.id}/record.json";
|