|
@@ -557,21 +557,25 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
|
|
|
dict.TryGetValue("subjectCode", out object subjectCode);
|
|
dict.TryGetValue("subjectCode", out object subjectCode);
|
|
dict.TryGetValue("code", out object code);
|
|
dict.TryGetValue("code", out object code);
|
|
- /* List<string> subjectCouns = JsonApiHelper.FromApiJson<List<string>>(subjectCode.ToApiJson());
|
|
|
|
- for (int i = 0; i < subjectCouns.Count; i++)
|
|
|
|
- {*/
|
|
|
|
- if (RedisHelper.Exists(CacheCosmosPrefix + "examResult" + subjectCode.ToString()))
|
|
|
|
|
|
+ dict.TryGetValue("schoolCode", out object schoolCode);
|
|
|
|
+ /* List<string> subjectCouns = JsonApiHelper.FromApiJson<List<string>>(subjectCode.ToApiJson());
|
|
|
|
+ for (int i = 0; i < subjectCouns.Count; i++)
|
|
|
|
+ {*/
|
|
|
|
+ if (RedisHelper.Exists(CacheCosmosPrefix + "examResult" + subjectCode.ToString()))
|
|
{
|
|
{
|
|
ExamResult result = RedisHelper.HGet<ExamResult>(CacheCosmosPrefix + "examResult" + subjectCode.ToString(), ShaHashHelper.GetSHA1(code.ToString()));
|
|
ExamResult result = RedisHelper.HGet<ExamResult>(CacheCosmosPrefix + "examResult" + subjectCode.ToString(), ShaHashHelper.GetSHA1(code.ToString()));
|
|
//builder.Data(info);
|
|
//builder.Data(info);
|
|
exams.Add(result);
|
|
exams.Add(result);
|
|
}
|
|
}
|
|
//}
|
|
//}
|
|
- Dictionary<string, object> stuMap = new Dictionary<string, object>
|
|
|
|
|
|
+ //List<Student> students = await azureCosmosDBRepository.FindByDict<Student>(stuMap);
|
|
|
|
+ List<Student> students = null;
|
|
|
|
+ if (RedisHelper.Exists(CacheCosmosPrefix + "students"))
|
|
{
|
|
{
|
|
- { "schoolCode", "Habook" }
|
|
|
|
- };
|
|
|
|
- List<Student> students = await azureCosmosDBRepository.FindByDict<Student>(stuMap);
|
|
|
|
|
|
+ students = RedisHelper.HGet<List<Student>>(CacheCosmosPrefix + "students", ShaHashHelper.GetSHA1(schoolCode.ToString()));
|
|
|
|
+ //builder.Data(info);
|
|
|
|
+ //students.Add(student);
|
|
|
|
+ }
|
|
List<string> key = new List<string>
|
|
List<string> key = new List<string>
|
|
{
|
|
{
|
|
"name",
|
|
"name",
|
|
@@ -657,6 +661,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
info.Add(wrong + "");
|
|
info.Add(wrong + "");
|
|
int[] str = strive[i];
|
|
int[] str = strive[i];
|
|
string striveAll = "";
|
|
string striveAll = "";
|
|
|
|
+
|
|
foreach (int n in str)
|
|
foreach (int n in str)
|
|
{
|
|
{
|
|
striveAll += n.ToString() + ",";
|
|
striveAll += n.ToString() + ",";
|
|
@@ -667,8 +672,21 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
{
|
|
{
|
|
careAll += n.ToString() + ",";
|
|
careAll += n.ToString() + ",";
|
|
}
|
|
}
|
|
- info.Add(striveAll.Substring(0, striveAll.Length - 1));
|
|
|
|
- info.Add(careAll.Substring(0, careAll.Length - 1));
|
|
|
|
|
|
+ if (string.IsNullOrEmpty(striveAll))
|
|
|
|
+ {
|
|
|
|
+ info.Add("无");
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ info.Add(striveAll.Substring(0, striveAll.Length - 1));
|
|
|
|
+ }
|
|
|
|
+ if (string.IsNullOrEmpty(careAll))
|
|
|
|
+ {
|
|
|
|
+ info.Add("无");
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ info.Add(careAll.Substring(0, careAll.Length - 1)); ;
|
|
|
|
+ }
|
|
info.Add(stu[i].ToString());
|
|
info.Add(stu[i].ToString());
|
|
datas.Add(info);
|
|
datas.Add(info);
|
|
|
|
|
|
@@ -1515,12 +1533,12 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
}
|
|
}
|
|
|
|
|
|
[HttpPost("FindExamPaper")]
|
|
[HttpPost("FindExamPaper")]
|
|
- public async Task<BaseResponse> FindExamPaper(JosnRequest<Dictionary<string, object>> request)
|
|
|
|
|
|
+ public BaseResponse FindExamPaper(JosnRequest<Dictionary<string, object>> request)
|
|
{
|
|
{
|
|
request.@params.TryGetValue("subjectCode", out object subjectCode);
|
|
request.@params.TryGetValue("subjectCode", out object subjectCode);
|
|
request.@params.TryGetValue("code", out object code);
|
|
request.@params.TryGetValue("code", out object code);
|
|
ResponseBuilder builder = ResponseBuilder.custom();
|
|
ResponseBuilder builder = ResponseBuilder.custom();
|
|
- if (RedisHelper.Instance != null)
|
|
|
|
|
|
+ /*if (RedisHelper.Instance != null)
|
|
{
|
|
{
|
|
|
|
|
|
List<Paper> info = await RedisHelper.CacheShellAsync(CacheCosmosPrefix + request.method,
|
|
List<Paper> info = await RedisHelper.CacheShellAsync(CacheCosmosPrefix + request.method,
|
|
@@ -1532,8 +1550,8 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
{
|
|
{
|
|
List<Paper> info = await FindExamPaperRedis(request.@params, request.method);
|
|
List<Paper> info = await FindExamPaperRedis(request.@params, request.method);
|
|
builder.Data(info);
|
|
builder.Data(info);
|
|
- }
|
|
|
|
- if (RedisHelper.Exists(CacheCosmosPrefix + ""))
|
|
|
|
|
|
+ }*/
|
|
|
|
+ if (RedisHelper.Exists(CacheCosmosPrefix + "paperInfo" + subjectCode.ToString()))
|
|
{
|
|
{
|
|
List<Paper> info = RedisHelper.HGet<List<Paper>>(CacheCosmosPrefix + "paperInfo" + subjectCode.ToString(), ShaHashHelper.GetSHA1(code.ToString()));
|
|
List<Paper> info = RedisHelper.HGet<List<Paper>>(CacheCosmosPrefix + "paperInfo" + subjectCode.ToString(), ShaHashHelper.GetSHA1(code.ToString()));
|
|
builder.Data(info);
|
|
builder.Data(info);
|