|
@@ -8,14 +8,14 @@ using TEAMModelOS.SDK;
|
|
using TEAMModelOS.SDK.Helper.Common.CollectionHelper;
|
|
using TEAMModelOS.SDK.Helper.Common.CollectionHelper;
|
|
using TEAMModelOS.SDK.Helper.Common.StringHelper;
|
|
using TEAMModelOS.SDK.Helper.Common.StringHelper;
|
|
using TEAMModelOS.SDK.DI;
|
|
using TEAMModelOS.SDK.DI;
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
using System.Diagnostics;
|
|
using System.Diagnostics;
|
|
using TEAMModelOS.SDK.Helper.Common.JsonHelper;
|
|
using TEAMModelOS.SDK.Helper.Common.JsonHelper;
|
|
using TEAMModelOS.SDK.Helper.Security.ShaHash;
|
|
using TEAMModelOS.SDK.Helper.Security.ShaHash;
|
|
using TEAMModelOS.SDK.Context.Exception;
|
|
using TEAMModelOS.SDK.Context.Exception;
|
|
using TEAMModelOS.Service.Models;
|
|
using TEAMModelOS.Service.Models;
|
|
-using TEAMModelOS.SDK.Helper.Network.HttpHelper;
|
|
|
|
|
|
+
|
|
using TEAMModelOS.Service.Analysis.Implements;
|
|
using TEAMModelOS.Service.Analysis.Implements;
|
|
using OpenXmlPowerTools;
|
|
using OpenXmlPowerTools;
|
|
using System.Text.Json;
|
|
using System.Text.Json;
|
|
@@ -29,13 +29,13 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
{
|
|
{
|
|
|
|
|
|
private readonly AzureCosmosFactory azureCosmosDBRepository;
|
|
private readonly AzureCosmosFactory azureCosmosDBRepository;
|
|
-
|
|
|
|
|
|
+
|
|
private const string CacheCosmosPrefix = "Analysis:";
|
|
private const string CacheCosmosPrefix = "Analysis:";
|
|
private const int timeoutSeconds = 3600;
|
|
private const int timeoutSeconds = 3600;
|
|
- public AchievementController( AzureCosmosFactory _azureCosmosDBRepository)
|
|
|
|
|
|
+ public AchievementController(AzureCosmosFactory _azureCosmosDBRepository)
|
|
{
|
|
{
|
|
azureCosmosDBRepository = _azureCosmosDBRepository;
|
|
azureCosmosDBRepository = _azureCosmosDBRepository;
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|
|
[HttpPost("Achievement")]
|
|
[HttpPost("Achievement")]
|
|
@@ -92,7 +92,8 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- public async Task<Dictionary<string, dynamic>> FindExamRedis(Dictionary<string, object> dict, string method) {
|
|
|
|
|
|
+ public async Task<Dictionary<string, dynamic>> FindExamRedis(Dictionary<string, object> dict, string method)
|
|
|
|
+ {
|
|
|
|
|
|
ResponseBuilder builder = ResponseBuilder.custom();
|
|
ResponseBuilder builder = ResponseBuilder.custom();
|
|
//Console.WriteLine(DateTimeOffset.Now.Second);
|
|
//Console.WriteLine(DateTimeOffset.Now.Second);
|
|
@@ -103,7 +104,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
/*if (RedisHelper.Instance != null)
|
|
/*if (RedisHelper.Instance != null)
|
|
{
|
|
{
|
|
exams = await RedisHelper.CacheShellAsync(CacheCosmosPrefix + "FindExamResultRedis",
|
|
exams = await RedisHelper.CacheShellAsync(CacheCosmosPrefix + "FindExamResultRedis",
|
|
- ShaHashHelper.GetSHA1(JsonNetHelper.ToJson(dict)), timeoutSeconds, () => { return FindExamResultRedis(dict, "FindExamResultRedis"); });
|
|
|
|
|
|
+ ShaHashHelper.GetSHA1(dict.ToJsonString()), timeoutSeconds, () => { return FindExamResultRedis(dict, "FindExamResultRedis"); });
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -118,7 +119,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
exams.Add(result);
|
|
exams.Add(result);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
Dictionary<string, object> stuMap = new Dictionary<string, object>
|
|
Dictionary<string, object> stuMap = new Dictionary<string, object>
|
|
{
|
|
{
|
|
@@ -565,7 +566,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
}
|
|
}
|
|
public async Task<List<Dictionary<string, dynamic>>> FindPointAnalysisRedis(Dictionary<string, object> dict, string method)
|
|
public async Task<List<Dictionary<string, dynamic>>> FindPointAnalysisRedis(Dictionary<string, object> dict, string method)
|
|
{
|
|
{
|
|
- //ResponseBuilder builder = ResponseBuilder.custom();
|
|
|
|
|
|
+ //ResponseBuilder builder = ResponseBuilder.custom();
|
|
List<Dictionary<string, dynamic>> scatterAnalysis = new List<Dictionary<string, dynamic>>();
|
|
List<Dictionary<string, dynamic>> scatterAnalysis = new List<Dictionary<string, dynamic>>();
|
|
//Dictionary<string, object> scatterAnalysis = new Dictionary<string, object>();
|
|
//Dictionary<string, object> scatterAnalysis = new Dictionary<string, object>();
|
|
List<ExamResult> exams = new List<ExamResult>();
|
|
List<ExamResult> exams = new List<ExamResult>();
|
|
@@ -577,11 +578,11 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
for (int i = 0; i < subjectCouns.Count; i++)
|
|
for (int i = 0; i < subjectCouns.Count; i++)
|
|
{*/
|
|
{*/
|
|
if (RedisHelper.Exists(CacheCosmosPrefix + "examResult" + subjectCode.ToString()))
|
|
if (RedisHelper.Exists(CacheCosmosPrefix + "examResult" + subjectCode.ToString()))
|
|
- {
|
|
|
|
- ExamResult result = RedisHelper.HGet<ExamResult>(CacheCosmosPrefix + "examResult" + subjectCode.ToString(), ShaHashHelper.GetSHA1(code.ToString()));
|
|
|
|
- //builder.Data(info);
|
|
|
|
- exams.Add(result);
|
|
|
|
- }
|
|
|
|
|
|
+ {
|
|
|
|
+ ExamResult result = RedisHelper.HGet<ExamResult>(CacheCosmosPrefix + "examResult" + subjectCode.ToString(), ShaHashHelper.GetSHA1(code.ToString()));
|
|
|
|
+ //builder.Data(info);
|
|
|
|
+ exams.Add(result);
|
|
|
|
+ }
|
|
//}
|
|
//}
|
|
//List<Student> students = await azureCosmosDBRepository.FindByDict<Student>(stuMap);
|
|
//List<Student> students = await azureCosmosDBRepository.FindByDict<Student>(stuMap);
|
|
List<Student> students = null;
|
|
List<Student> students = null;
|
|
@@ -691,7 +692,8 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
{
|
|
{
|
|
info.Add("无");
|
|
info.Add("无");
|
|
}
|
|
}
|
|
- else {
|
|
|
|
|
|
+ else
|
|
|
|
+ {
|
|
info.Add(striveAll.Substring(0, striveAll.Length - 1));
|
|
info.Add(striveAll.Substring(0, striveAll.Length - 1));
|
|
}
|
|
}
|
|
if (string.IsNullOrEmpty(careAll))
|
|
if (string.IsNullOrEmpty(careAll))
|
|
@@ -701,7 +703,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
else
|
|
else
|
|
{
|
|
{
|
|
info.Add(careAll.Substring(0, careAll.Length - 1)); ;
|
|
info.Add(careAll.Substring(0, careAll.Length - 1)); ;
|
|
- }
|
|
|
|
|
|
+ }
|
|
info.Add(stu[i].ToString());
|
|
info.Add(stu[i].ToString());
|
|
datas.Add(info);
|
|
datas.Add(info);
|
|
|
|
|
|
@@ -736,7 +738,8 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return scatterAnalysis;
|
|
return scatterAnalysis;
|
|
- }else return scatterAnalysis;
|
|
|
|
|
|
+ }
|
|
|
|
+ else return scatterAnalysis;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -778,31 +781,31 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
dict.TryGetValue("schoolCode", out object schoolCode);
|
|
dict.TryGetValue("schoolCode", out object schoolCode);
|
|
dict.TryGetValue("code", out object code);
|
|
dict.TryGetValue("code", out object code);
|
|
//dict.TryGetValue("scopeCode", out object scopeCode);
|
|
//dict.TryGetValue("scopeCode", out object scopeCode);
|
|
-/* Dictionary<string, object> sub = new Dictionary<string, object>
|
|
|
|
- {
|
|
|
|
- { "subjectCode", subjectCode.ToString()},
|
|
|
|
- { "code",code.ToString()}
|
|
|
|
- };
|
|
|
|
- Dictionary<string, object> examMap = new Dictionary<string, object>
|
|
|
|
- {
|
|
|
|
- { "subjectCode", subjectCode.ToString()},
|
|
|
|
- { "code", code.ToString()},
|
|
|
|
- { "schoolCode", schoolCode.ToString()}
|
|
|
|
- };*/
|
|
|
|
|
|
+ /* Dictionary<string, object> sub = new Dictionary<string, object>
|
|
|
|
+ {
|
|
|
|
+ { "subjectCode", subjectCode.ToString()},
|
|
|
|
+ { "code",code.ToString()}
|
|
|
|
+ };
|
|
|
|
+ Dictionary<string, object> examMap = new Dictionary<string, object>
|
|
|
|
+ {
|
|
|
|
+ { "subjectCode", subjectCode.ToString()},
|
|
|
|
+ { "code", code.ToString()},
|
|
|
|
+ { "schoolCode", schoolCode.ToString()}
|
|
|
|
+ };*/
|
|
//List<ExamResult> exams = await azureCosmosDBRepository.FindByDict<ExamResult>(examMap);
|
|
//List<ExamResult> exams = await azureCosmosDBRepository.FindByDict<ExamResult>(examMap);
|
|
List<ExamResult> exams = new List<ExamResult>();
|
|
List<ExamResult> exams = new List<ExamResult>();
|
|
if (RedisHelper.Exists(CacheCosmosPrefix + "examResult" + subjectCode.ToString()))
|
|
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()));
|
|
exams.Add(result);
|
|
exams.Add(result);
|
|
- }
|
|
|
|
|
|
+ }
|
|
List<Paper> paper = new List<Paper>();
|
|
List<Paper> paper = new List<Paper>();
|
|
if (RedisHelper.Exists(CacheCosmosPrefix + "paperInfo" + subjectCode.ToString()))
|
|
if (RedisHelper.Exists(CacheCosmosPrefix + "paperInfo" + subjectCode.ToString()))
|
|
{
|
|
{
|
|
Paper paper1 = RedisHelper.HGet<Paper>(CacheCosmosPrefix + "paperInfo" + subjectCode.ToString(), ShaHashHelper.GetSHA1(code.ToString()));
|
|
Paper paper1 = RedisHelper.HGet<Paper>(CacheCosmosPrefix + "paperInfo" + subjectCode.ToString(), ShaHashHelper.GetSHA1(code.ToString()));
|
|
- paper.Add(paper1);
|
|
|
|
|
|
+ paper.Add(paper1);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
List<string> key = new List<string>
|
|
List<string> key = new List<string>
|
|
{
|
|
{
|
|
@@ -971,17 +974,20 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
values[20] = quality[k].ToString();
|
|
values[20] = quality[k].ToString();
|
|
values[21] = answer[k].ToString();
|
|
values[21] = answer[k].ToString();
|
|
string pointName = "";
|
|
string pointName = "";
|
|
- if (paper[0].item[k].points.Count == 1 ) {
|
|
|
|
|
|
+ if (paper[0].item[k].points.Count == 1)
|
|
|
|
+ {
|
|
foreach (string index in paper[0].item[k].points)
|
|
foreach (string index in paper[0].item[k].points)
|
|
{
|
|
{
|
|
- pointName = index ;
|
|
|
|
|
|
+ pointName = index;
|
|
}
|
|
}
|
|
- } else if (paper[0].item[k].points.Count > 1) {
|
|
|
|
|
|
+ }
|
|
|
|
+ else if (paper[0].item[k].points.Count > 1)
|
|
|
|
+ {
|
|
foreach (string index in paper[0].item[k].points)
|
|
foreach (string index in paper[0].item[k].points)
|
|
{
|
|
{
|
|
pointName += index + ",";
|
|
pointName += index + ",";
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ }
|
|
values[22] = pointName;
|
|
values[22] = pointName;
|
|
datas.Add(values);
|
|
datas.Add(values);
|
|
|
|
|
|
@@ -1024,34 +1030,34 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
dict.TryGetValue("schoolCode", out object schoolCode);
|
|
dict.TryGetValue("schoolCode", out object schoolCode);
|
|
dict.TryGetValue("code", out object code);
|
|
dict.TryGetValue("code", out object code);
|
|
//dict.TryGetValue("scopeCode", out object scopeCode);
|
|
//dict.TryGetValue("scopeCode", out object scopeCode);
|
|
- /* Dictionary<string, object> sub = new Dictionary<string, object>
|
|
|
|
- {
|
|
|
|
- { "subjectCode", subjectCode.ToString()},
|
|
|
|
- { "code",code.ToString()}
|
|
|
|
|
|
+ /* Dictionary<string, object> sub = new Dictionary<string, object>
|
|
|
|
+ {
|
|
|
|
+ { "subjectCode", subjectCode.ToString()},
|
|
|
|
+ { "code",code.ToString()}
|
|
|
|
|
|
- };
|
|
|
|
- Dictionary<string, object> examMap = new Dictionary<string, object>
|
|
|
|
- {
|
|
|
|
- { "schoolCode", schoolCode.ToString()},
|
|
|
|
- { "code", code.ToString()},
|
|
|
|
- { "subjectCode", subjectCode.ToString()}
|
|
|
|
|
|
+ };
|
|
|
|
+ Dictionary<string, object> examMap = new Dictionary<string, object>
|
|
|
|
+ {
|
|
|
|
+ { "schoolCode", schoolCode.ToString()},
|
|
|
|
+ { "code", code.ToString()},
|
|
|
|
+ { "subjectCode", subjectCode.ToString()}
|
|
|
|
|
|
|
|
|
|
- };*/
|
|
|
|
|
|
+ };*/
|
|
List<ExamResult> exams = new List<ExamResult>();
|
|
List<ExamResult> exams = new List<ExamResult>();
|
|
|
|
|
|
- if (RedisHelper.Exists(CacheCosmosPrefix + "examResult" + subjectCode.ToString()))
|
|
|
|
- {
|
|
|
|
- ExamResult res = RedisHelper.HGet<ExamResult>(CacheCosmosPrefix + "examResult" + subjectCode.ToString(), ShaHashHelper.GetSHA1(code.ToString()));
|
|
|
|
- exams.Add(res);
|
|
|
|
- }
|
|
|
|
|
|
+ if (RedisHelper.Exists(CacheCosmosPrefix + "examResult" + subjectCode.ToString()))
|
|
|
|
+ {
|
|
|
|
+ ExamResult res = RedisHelper.HGet<ExamResult>(CacheCosmosPrefix + "examResult" + subjectCode.ToString(), ShaHashHelper.GetSHA1(code.ToString()));
|
|
|
|
+ exams.Add(res);
|
|
|
|
+ }
|
|
List<Paper> paper = new List<Paper>();
|
|
List<Paper> paper = new List<Paper>();
|
|
if (RedisHelper.Exists(CacheCosmosPrefix + "paperInfo" + subjectCode.ToString()))
|
|
if (RedisHelper.Exists(CacheCosmosPrefix + "paperInfo" + subjectCode.ToString()))
|
|
{
|
|
{
|
|
|
|
|
|
Paper papers = RedisHelper.HGet<Paper>(CacheCosmosPrefix + "paperInfo" + subjectCode.ToString(), ShaHashHelper.GetSHA1(code.ToString()));
|
|
Paper papers = RedisHelper.HGet<Paper>(CacheCosmosPrefix + "paperInfo" + subjectCode.ToString(), ShaHashHelper.GetSHA1(code.ToString()));
|
|
paper.Add(papers);
|
|
paper.Add(papers);
|
|
- }
|
|
|
|
|
|
+ }
|
|
Dictionary<string, object> stuMap = new Dictionary<string, object>
|
|
Dictionary<string, object> stuMap = new Dictionary<string, object>
|
|
{
|
|
{
|
|
{ "schoolCode", "Habook" }
|
|
{ "schoolCode", "Habook" }
|
|
@@ -1085,7 +1091,8 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- else {
|
|
|
|
|
|
+ else
|
|
|
|
+ {
|
|
paper.ForEach(p =>
|
|
paper.ForEach(p =>
|
|
{
|
|
{
|
|
p.item.ForEach(i =>
|
|
p.item.ForEach(i =>
|
|
@@ -1124,7 +1131,8 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
resultSum.Sort(delegate (double s1, double s2) { return s1.CompareTo(s2); });
|
|
resultSum.Sort(delegate (double s1, double s2) { return s1.CompareTo(s2); });
|
|
double rhlCount = resultSum.Count * 0.27;
|
|
double rhlCount = resultSum.Count * 0.27;
|
|
double rhl = resultSum[int.Parse(rhwCount.ToString("0"))];
|
|
double rhl = resultSum[int.Parse(rhwCount.ToString("0"))];
|
|
- foreach (ExamResult ex in exams) {
|
|
|
|
|
|
+ foreach (ExamResult ex in exams)
|
|
|
|
+ {
|
|
point = ex.point;
|
|
point = ex.point;
|
|
result = ex.result;
|
|
result = ex.result;
|
|
classes = ex.classes;
|
|
classes = ex.classes;
|
|
@@ -1142,8 +1150,10 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
{
|
|
{
|
|
knowledgeName.Add(cla);
|
|
knowledgeName.Add(cla);
|
|
}
|
|
}
|
|
- for (int k = 0;k < knowledgeName.Count;k++ ) {
|
|
|
|
- if (null == knowledgeName[k]) {
|
|
|
|
|
|
+ for (int k = 0; k < knowledgeName.Count; k++)
|
|
|
|
+ {
|
|
|
|
+ if (null == knowledgeName[k])
|
|
|
|
+ {
|
|
knowledgeName.Remove(knowledgeName[k]);
|
|
knowledgeName.Remove(knowledgeName[k]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1248,7 +1258,8 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
paper.ForEach(p =>
|
|
paper.ForEach(p =>
|
|
{
|
|
{
|
|
int n = 0;
|
|
int n = 0;
|
|
- if (dict.TryGetValue("type", out object Type)) {
|
|
|
|
|
|
+ if (dict.TryGetValue("type", out object Type))
|
|
|
|
+ {
|
|
p.item.ForEach(i =>
|
|
p.item.ForEach(i =>
|
|
{
|
|
{
|
|
if (i.field != null && i.field.Contains(knowledgeName[k]))
|
|
if (i.field != null && i.field.Contains(knowledgeName[k]))
|
|
@@ -1260,7 +1271,9 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
}
|
|
}
|
|
n++;
|
|
n++;
|
|
});
|
|
});
|
|
- } else {
|
|
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
p.item.ForEach(i =>
|
|
p.item.ForEach(i =>
|
|
{
|
|
{
|
|
if (i.points != null && i.points.Contains(knowledgeName[k]))
|
|
if (i.points != null && i.points.Contains(knowledgeName[k]))
|
|
@@ -1317,7 +1330,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
{
|
|
{
|
|
if (dict.TryGetValue("type", out object Type))
|
|
if (dict.TryGetValue("type", out object Type))
|
|
{
|
|
{
|
|
- if (i.field!= null && i.field.Contains(knowledgeName[k]))
|
|
|
|
|
|
+ if (i.field != null && i.field.Contains(knowledgeName[k]))
|
|
{
|
|
{
|
|
|
|
|
|
//Dictionary<string, double> mapkeyItem = new Dictionary<string, double>();
|
|
//Dictionary<string, double> mapkeyItem = new Dictionary<string, double>();
|
|
@@ -1346,7 +1359,8 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
}
|
|
}
|
|
n++;
|
|
n++;
|
|
}
|
|
}
|
|
- else {
|
|
|
|
|
|
+ else
|
|
|
|
+ {
|
|
if (i.points != null && i.points.Contains(knowledgeName[k]))
|
|
if (i.points != null && i.points.Contains(knowledgeName[k]))
|
|
{
|
|
{
|
|
|
|
|
|
@@ -1428,7 +1442,8 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
}
|
|
}
|
|
x++;
|
|
x++;
|
|
}
|
|
}
|
|
- else {
|
|
|
|
|
|
+ else
|
|
|
|
+ {
|
|
if (i.points != null && i.points.Contains(knowledgeName[k]))
|
|
if (i.points != null && i.points.Contains(knowledgeName[k]))
|
|
{
|
|
{
|
|
//当前知识点在该题占比多少
|
|
//当前知识点在该题占比多少
|
|
@@ -1522,28 +1537,32 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
}
|
|
}
|
|
if (RedisHelper.Instance != null)
|
|
if (RedisHelper.Instance != null)
|
|
{
|
|
{
|
|
- try {
|
|
|
|
|
|
+ try
|
|
|
|
+ {
|
|
///RedisHelper.Instance.CurrentSerialize = obj => System.Text.Json.JsonSerializer.Serialize(obj);
|
|
///RedisHelper.Instance.CurrentSerialize = obj => System.Text.Json.JsonSerializer.Serialize(obj);
|
|
- /// RedisHelper.Instance.CurrentDeserialize = (json, type) => System.Text.Json.JsonSerializer.Deserialize(json, type);
|
|
|
|
|
|
+ /// RedisHelper.Instance.CurrentDeserialize = (json, type) => System.Text.Json.JsonSerializer.Deserialize(json, type);
|
|
List<ExamInfo> info = await RedisHelper.CacheShellAsync(CacheCosmosPrefix + "FindExamInfo",
|
|
List<ExamInfo> info = await RedisHelper.CacheShellAsync(CacheCosmosPrefix + "FindExamInfo",
|
|
ShaHashHelper.GetSHA1(dict.ToJsonString()), timeoutSeconds, () => { return FindExamInfoRedis(dict, "FindExamInfo"); });
|
|
ShaHashHelper.GetSHA1(dict.ToJsonString()), timeoutSeconds, () => { return FindExamInfoRedis(dict, "FindExamInfo"); });
|
|
|
|
|
|
builder.Data(info);
|
|
builder.Data(info);
|
|
- } catch (Exception e) {
|
|
|
|
|
|
+ }
|
|
|
|
+ catch (Exception e)
|
|
|
|
+ {
|
|
throw new BizException(e.Message);
|
|
throw new BizException(e.Message);
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- List<ExamInfo> info = await FindExamInfoRedis(dict, "FindExamInfo");
|
|
|
|
|
|
+ List<ExamInfo> info = await FindExamInfoRedis(dict, "FindExamInfo");
|
|
builder.Data(info);
|
|
builder.Data(info);
|
|
}
|
|
}
|
|
return builder.build();
|
|
return builder.build();
|
|
}
|
|
}
|
|
|
|
|
|
- public async Task<List<ExamInfo>> FindExamInfoRedis(Dictionary<string, object> dict,string method)
|
|
|
|
|
|
+ public async Task<List<ExamInfo>> FindExamInfoRedis(Dictionary<string, object> dict, string method)
|
|
{
|
|
{
|
|
- try {
|
|
|
|
|
|
+ try
|
|
|
|
+ {
|
|
List<ExamInfo> info = await azureCosmosDBRepository.FindByDict<ExamInfo>(dict);
|
|
List<ExamInfo> info = await azureCosmosDBRepository.FindByDict<ExamInfo>(dict);
|
|
|
|
|
|
if (RedisHelper.Instance != null)
|
|
if (RedisHelper.Instance != null)
|
|
@@ -1559,7 +1578,9 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return info;
|
|
return info;
|
|
- } catch (Exception e) {
|
|
|
|
|
|
+ }
|
|
|
|
+ catch (Exception e)
|
|
|
|
+ {
|
|
throw new BizException(e.Message);
|
|
throw new BizException(e.Message);
|
|
|
|
|
|
}
|
|
}
|
|
@@ -1722,7 +1743,8 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
}
|
|
}
|
|
return builder.build();
|
|
return builder.build();
|
|
}
|
|
}
|
|
- public async Task<List<Dictionary<string, dynamic>>> FindHomeStatisticsRedis(Dictionary<string, object> dict, string method) {
|
|
|
|
|
|
+ public async Task<List<Dictionary<string, dynamic>>> FindHomeStatisticsRedis(Dictionary<string, object> dict, string method)
|
|
|
|
+ {
|
|
|
|
|
|
//request.@params.TryGetValue("subjectCode", out object subjectCode);
|
|
//request.@params.TryGetValue("subjectCode", out object subjectCode);
|
|
dict.TryGetValue("schoolCode", out object schoolCode);
|
|
dict.TryGetValue("schoolCode", out object schoolCode);
|
|
@@ -1751,7 +1773,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
List<ExamInfo> newInfo = new List<ExamInfo>();
|
|
List<ExamInfo> newInfo = new List<ExamInfo>();
|
|
//获取各个学段最新的考试信息
|
|
//获取各个学段最新的考试信息
|
|
foreach (IGrouping<string, ExamInfo> group in exams.GroupBy(c => c.conditions.period))
|
|
foreach (IGrouping<string, ExamInfo> group in exams.GroupBy(c => c.conditions.period))
|
|
- {
|
|
|
|
|
|
+ {
|
|
ExamInfo examInfo = group.ToList().OrderByDescending(e => e.createTime).ToList().FirstOrDefault();
|
|
ExamInfo examInfo = group.ToList().OrderByDescending(e => e.createTime).ToList().FirstOrDefault();
|
|
newInfo.Add(examInfo);
|
|
newInfo.Add(examInfo);
|
|
};
|
|
};
|
|
@@ -2072,7 +2094,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
{ "KeyLines",KeyLines}
|
|
{ "KeyLines",KeyLines}
|
|
};
|
|
};
|
|
map.Add(AveragePointMap);
|
|
map.Add(AveragePointMap);
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
//Redis处理结果集
|
|
//Redis处理结果集
|