|
@@ -169,7 +169,7 @@ namespace TEAMModelOS.SDK.Models.Service
|
|
return dict;
|
|
return dict;
|
|
}
|
|
}
|
|
public static async void DoLessonStudentRecord(DingDing _dingding, SnowflakeId snowflakeId, LessonRecord lessonRecord, string scope, CosmosClient client, string school, string tmdid,
|
|
public static async void DoLessonStudentRecord(DingDing _dingding, SnowflakeId snowflakeId, LessonRecord lessonRecord, string scope, CosmosClient client, string school, string tmdid,
|
|
- Teacher teacher, AzureServiceBusFactory _serviceBus, AzureStorageFactory _azureStorage, IConfiguration _configuration, LessonBase lessonBase)
|
|
|
|
|
|
+ Teacher teacher, AzureServiceBusFactory _serviceBus, AzureStorageFactory _azureStorage, IConfiguration _configuration, LessonBase lessonBase,AzureRedisFactory _azureRedis)
|
|
{
|
|
{
|
|
|
|
|
|
try
|
|
try
|
|
@@ -226,7 +226,7 @@ namespace TEAMModelOS.SDK.Models.Service
|
|
dataSemester= SchoolService.GetSemester(period);
|
|
dataSemester= SchoolService.GetSemester(period);
|
|
}
|
|
}
|
|
List <Task<ItemResponse<StudentScoreRecord>>> records = new List<Task<ItemResponse<StudentScoreRecord>>>();
|
|
List <Task<ItemResponse<StudentScoreRecord>>> records = new List<Task<ItemResponse<StudentScoreRecord>>>();
|
|
- List<Task<ItemResponse<OverallEducation>>> overallEducations = new List<Task<ItemResponse<OverallEducation>>>();
|
|
|
|
|
|
+ HashSet <OverallEducation> overallEducations = new HashSet<OverallEducation>();
|
|
stuids.ToList().ForEach(async x => {
|
|
stuids.ToList().ForEach(async x => {
|
|
var record = lessonStudentRecords.Find(l => l.stuid.Equals(x.id) && l.code.Equals($"StudentScoreRecord") && l.school.Equals(x.school));
|
|
var record = lessonStudentRecords.Find(l => l.stuid.Equals(x.id) && l.code.Equals($"StudentScoreRecord") && l.school.Equals(x.school));
|
|
ClientSummaryList clientSummaryList = lessonBase.report.clientSummaryList.Find(c => c.seatID == x.seatID);
|
|
ClientSummaryList clientSummaryList = lessonBase.report.clientSummaryList.Find(c => c.seatID == x.seatID);
|
|
@@ -376,7 +376,7 @@ namespace TEAMModelOS.SDK.Models.Service
|
|
);
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- overallEducations.Add(client.GetContainer(Constant.TEAMModelOS, Constant.Student).UpsertItemAsync(overallEducation, partitionKey: new PartitionKey(overallEducation.code)));
|
|
|
|
|
|
+ overallEducations.Add(overallEducation);
|
|
}
|
|
}
|
|
records.Add(client.GetContainer(Constant.TEAMModelOS, Constant.Student).UpsertItemAsync(record, partitionKey: new PartitionKey(record.code)));
|
|
records.Add(client.GetContainer(Constant.TEAMModelOS, Constant.Student).UpsertItemAsync(record, partitionKey: new PartitionKey(record.code)));
|
|
});
|
|
});
|
|
@@ -466,7 +466,12 @@ namespace TEAMModelOS.SDK.Models.Service
|
|
}
|
|
}
|
|
if (overallEducations.Any())
|
|
if (overallEducations.Any())
|
|
{
|
|
{
|
|
- await Task.WhenAll(overallEducations);
|
|
|
|
|
|
+ foreach (var item in overallEducations) {
|
|
|
|
+ await client.GetContainer(Constant.TEAMModelOS, Constant.Student).UpsertItemAsync(item, partitionKey: new PartitionKey(item.code));
|
|
|
|
+ string key = $"OverallEducation:{item.schoolCode}:{item.periodId}:{item.year}:{item.semesterId}:{item.classId}";
|
|
|
|
+ await _azureRedis.GetRedisClient(8).HashSetAsync(key, item.studentId, item.ToJsonString());
|
|
|
|
+ await _azureRedis.GetRedisClient(8).KeyExpireAsync(key,new TimeSpan(180 *24 ,0,0));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|