|
@@ -193,7 +193,7 @@ namespace TEAMModelOS.Controllers.Common
|
|
|
{
|
|
|
if (!string.IsNullOrWhiteSpace(tmid))
|
|
|
{
|
|
|
- StringBuilder stringBuilderSelectM = new($"SELECT DISTINCT VALUE c.id FROM c JOIN s IN c.schedule JOIN g IN c.groups WHERE s.startTime <= {now} AND s.endTime > {now} AND s.type = 'exam' AND array_contains(g.assistants,'{tmid}') ");
|
|
|
+ StringBuilder stringBuilderSelectM = new($"SELECT DISTINCT VALUE c.id FROM c JOIN s IN c.schedule JOIN g IN c.groups WHERE s.startTime <= {now} AND (s.endTime + 345600000) > {now} AND s.type = 'exam' AND array_contains(g.assistants,'{tmid}') "); //閱卷結束時間為行程結束+4天
|
|
|
StringBuilder sqlM = stringBuilderSelectM.Append(stringBuilderWhere);
|
|
|
await foreach (string item in client.GetContainer(Constant.TEAMModelOS, Constant.Teacher).GetItemQueryIteratorSql<string>(queryText: sqlM.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"JointEvent") }))
|
|
|
{
|
|
@@ -1352,7 +1352,7 @@ namespace TEAMModelOS.Controllers.Common
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ //生成決賽名單
|
|
|
[ProducesDefaultResponseType]
|
|
|
#if !DEBUG
|
|
|
[Authorize(Roles = "IES")]
|
|
@@ -1364,7 +1364,7 @@ namespace TEAMModelOS.Controllers.Common
|
|
|
List<JointEventGroupDb> result = new List<JointEventGroupDb>();
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
|
string jointEventId = (request.TryGetProperty("jointEventId", out JsonElement _jointEventId)) ? _jointEventId.ToString() : string.Empty;
|
|
|
- string jointScheduleId = (request.TryGetProperty("jointScheduleId", out JsonElement _jointScheduleId)) ? _jointScheduleId.ToString() : string.Empty; //要計算的行程
|
|
|
+ string jointScheduleId = (request.TryGetProperty("jointScheduleId", out JsonElement _jointScheduleId)) ? _jointScheduleId.ToString() : string.Empty; //要計算的熱身賽行程
|
|
|
string scope = "private";
|
|
|
JointEvent jointEvent = await client.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemAsync<JointEvent>(jointEventId, new PartitionKey("JointEvent"));
|
|
|
if (jointEvent == null)
|
|
@@ -1491,6 +1491,7 @@ namespace TEAMModelOS.Controllers.Common
|
|
|
string jointEventId = (request.TryGetProperty("jointEventId", out JsonElement _jointEventId)) ? _jointEventId.ToString() : string.Empty;
|
|
|
string jointScheduleId = (request.TryGetProperty("jointScheduleId", out JsonElement _jointScheduleId)) ? _jointScheduleId.ToString() : string.Empty;
|
|
|
string jointExamId = (request.TryGetProperty("jointExamId", out JsonElement _jointExamId)) ? _jointExamId.ToString() : string.Empty;
|
|
|
+ string tmid = (request.TryGetProperty("tmid", out JsonElement _tmid)) ? _tmid.ToString() : string.Empty;
|
|
|
if (string.IsNullOrWhiteSpace(jointEventId) || string.IsNullOrWhiteSpace(jointScheduleId))
|
|
|
{
|
|
|
return BadRequest();
|
|
@@ -1541,7 +1542,7 @@ namespace TEAMModelOS.Controllers.Common
|
|
|
foreach (var info in jointExams)
|
|
|
{
|
|
|
//生成統測活動所有的個人評量
|
|
|
- await JointService.GenerateExamFromJointExamAsync(client, _azureStorage, _serviceBus, _coreAPIHttpService, _azureRedis, _configuration, _dingDing, info, string.Empty);
|
|
|
+ await JointService.GenerateExamFromJointExamAsync(client, _azureStorage, _serviceBus, _coreAPIHttpService, _azureRedis, _configuration, _dingDing, info, tmid);
|
|
|
}
|
|
|
}
|
|
|
|