|
@@ -756,7 +756,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
|
List<LessonRecord> records = new List<LessonRecord>();
|
|
|
StringBuilder sql = new StringBuilder($"select value(c) from c where c.school = '{code}' and c.periodId = '{periodId}'");
|
|
|
- if (request.TryGetProperty("tmdname", out JsonElement tmdname))
|
|
|
+ /*if (request.TryGetProperty("tmdname", out JsonElement tmdname))
|
|
|
{
|
|
|
sql.Append($" and c.tmdname='{tmdname}'");
|
|
|
}
|
|
@@ -771,8 +771,8 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
if (request.TryGetProperty("subjectId", out JsonElement subjectId))
|
|
|
{
|
|
|
sql.Append($" and c.subjectId='{subjectId}'");
|
|
|
- }
|
|
|
- string continuationToken = string.Empty;
|
|
|
+ }*/
|
|
|
+ /*string continuationToken = string.Empty;
|
|
|
string token = default;
|
|
|
//是否需要进行分页查询,默认不分页
|
|
|
bool iscontinuation = false;
|
|
@@ -789,9 +789,9 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
{
|
|
|
topcout = data;
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(
|
|
|
- queryText: sql.ToString(), continuationToken: token, requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"LessonRecord-{code}") }))
|
|
|
+ queryText: sql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonRecord-{code}") }))
|
|
|
{
|
|
|
using var json = await JsonDocument.ParseAsync(item.ContentStream);
|
|
|
if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
|
|
@@ -801,11 +801,11 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
records.Add(obj.ToObject<LessonRecord>());
|
|
|
}
|
|
|
}
|
|
|
- if (iscontinuation)
|
|
|
+ /*if (iscontinuation)
|
|
|
{
|
|
|
continuationToken = item.GetContinuationToken();
|
|
|
break;
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|
|
|
double total = records.Count;
|
|
|
double teachCount = records.Where((x, i) => records.FindIndex(z => z.tmdid == x.tmdid) == i).ToList().Count;
|
|
@@ -814,7 +814,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
double interactCount = records.Select(c => c.clientInteractionCount).Sum();
|
|
|
List<(string name, double count)> rc = await getRecordCount(client, records, stime.GetInt64(), etime.GetInt64(), code.GetString(), "", periodId.GetString());
|
|
|
double semester = rc.Where(r => r.name.Equals("semester")).FirstOrDefault().count;
|
|
|
- return Ok(new { records, total, teachCount, taskCount, workCount, interactCount, semester });
|
|
|
+ return Ok(new {total, teachCount, taskCount, workCount, interactCount, semester });
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|