|
@@ -47,7 +47,7 @@ namespace TEAMModelBI.Controllers.Census
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
- /// 依据区级ID分析该去所有学校课例 //后端有
|
|
|
|
|
|
+ /// 依据区级ID分析该去所有学校课例 //已对接
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="jsonElement"></param>
|
|
/// <param name="jsonElement"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
@@ -57,7 +57,7 @@ namespace TEAMModelBI.Controllers.Census
|
|
{
|
|
{
|
|
if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
|
|
if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
|
|
jsonElement.TryGetProperty("site", out JsonElement site);
|
|
jsonElement.TryGetProperty("site", out JsonElement site);
|
|
- var (lWeekS, lWeekE) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "lastterm");
|
|
|
|
|
|
+ var (lWeekS, lWeekE) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "week");
|
|
var (monthS, monthE) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "month");
|
|
var (monthS, monthE) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "month");
|
|
|
|
|
|
var cosmosClient = _azureCosmos.GetCosmosClient();
|
|
var cosmosClient = _azureCosmos.GetCosmosClient();
|
|
@@ -77,7 +77,7 @@ namespace TEAMModelBI.Controllers.Census
|
|
item.weekCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", $"select value(count(c.id)) from c where c.startTime >= {lWeekS} and c.startTime <= {lWeekE}", $"LessonRecord-{item.id}");
|
|
item.weekCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", $"select value(count(c.id)) from c where c.startTime >= {lWeekS} and c.startTime <= {lWeekE}", $"LessonRecord-{item.id}");
|
|
item.monthCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", $"select value(count(c.id)) from c where c.startTime >= {monthS} and c.startTime <= {monthE}", $"LessonRecord-{item.id}");
|
|
item.monthCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", $"select value(count(c.id)) from c where c.startTime >= {monthS} and c.startTime <= {monthE}", $"LessonRecord-{item.id}");
|
|
}
|
|
}
|
|
- areaSchools = areaSchools.Where(w => w.allCnt != 0 && w.weekCnt != 0 && w.monthCnt != 0).ToList();
|
|
|
|
|
|
+ areaSchools = areaSchools.Where(w => (w.allCnt != 0 || w.weekCnt != 0 || w.monthCnt != 0)).ToList();
|
|
}
|
|
}
|
|
|
|
|
|
return Ok(new { state = RespondCode.Ok, areaSchools });
|
|
return Ok(new { state = RespondCode.Ok, areaSchools });
|