|
@@ -68,7 +68,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
|
|
|
}
|
|
|
catch (CosmosException e)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ExamBus()-CosmosDB异常{e.Message}\n{e.Status}{e.StackTrace}", GroupNames.成都开发測試群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ExamBus()-CosmosDB异常{e.Message}\n{e.Status}{e.StackTrace}\n{msg}", GroupNames.成都开发測試群組);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -92,7 +92,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
|
|
|
}
|
|
|
catch (CosmosException e)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,VoteBus()-CosmosDB异常{e.Message}\n{e.Status}{e.StackTrace}", GroupNames.成都开发測試群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,VoteBus()-CosmosDB异常{e.Message}\n{e.Status}{e.StackTrace}\n{msg}", GroupNames.成都开发測試群組);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -116,7 +116,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
|
|
|
}
|
|
|
catch (CosmosException e)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Correct()-CosmosDB异常{e.Message}\n{e.Status}{e.StackTrace}", GroupNames.成都开发測試群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Correct()-CosmosDB异常{e.Message}\n{e.Status}{e.StackTrace}\n{msg}", GroupNames.成都开发測試群組);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -141,7 +141,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
|
|
|
}
|
|
|
catch (CosmosException e)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,SurveyBus()-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,SurveyBus()-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}\n{msg}", GroupNames.成都开发測試群組);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -164,7 +164,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
|
|
|
}
|
|
|
catch (CosmosException e)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Homework()-CosmosDB异常{e.StackTrace}{e.Message}{e.StackTrace}\n{e.Status}", GroupNames.成都开发測試群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Homework()-CosmosDB异常{e.StackTrace}{e.Message}{e.StackTrace}\n{e.Status}\n{msg}", GroupNames.成都开发測試群組);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -190,7 +190,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
|
|
|
}
|
|
|
catch (CosmosException e)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Study()-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Study()-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}\n{msg}", GroupNames.成都开发測試群組);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -214,7 +214,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
|
|
|
}
|
|
|
catch (CosmosException e)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ExamLite()-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}", GroupNames.成都开发測試群組);
|
|
|
+ await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,ExamLite()-CosmosDB异常{e.StackTrace}{e.Message}\n{e.Status}\n{msg}", GroupNames.成都开发測試群組);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -1091,27 +1091,31 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
|
|
|
List<GroupListDto> groupLists = groups?.FindAll(x => !string.IsNullOrEmpty(x.periodId) && x.year > 0 && !string.IsNullOrEmpty(x.school));
|
|
|
if (groupLists.IsNotEmpty() && !string.IsNullOrWhiteSpace(lessonRecord.periodId))
|
|
|
{
|
|
|
- School schoolObj = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<School>(lessonRecord.school, new PartitionKey("Base"));
|
|
|
-
|
|
|
- //年级算法
|
|
|
- int? Count = schoolObj.period.Find(x => x.id.Equals(lessonRecord.periodId)).grades?.Count;
|
|
|
- if (Count.HasValue)
|
|
|
- {
|
|
|
- int Month = DateTimeOffset.UtcNow.Month;
|
|
|
- int Year = DateTimeOffset.UtcNow.Year;
|
|
|
- foreach (int year in groupLists.Select(x => x.year))
|
|
|
+ try {
|
|
|
+ School schoolObj = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<School>(lessonRecord.school, new PartitionKey("Base"));
|
|
|
+ //年级算法
|
|
|
+ var period = schoolObj.period.Find(x => x.id.Equals(lessonRecord.periodId));
|
|
|
+ int? Count = period?.grades?.Count;
|
|
|
+ if (Count.HasValue)
|
|
|
{
|
|
|
- int grade;
|
|
|
- if (Month >= 1 && Month <= 6)
|
|
|
- {
|
|
|
- grade = (Year - year + 1) / Count.Value;
|
|
|
- }
|
|
|
- else
|
|
|
+ int Month = DateTimeOffset.UtcNow.Month;
|
|
|
+ int Year = DateTimeOffset.UtcNow.Year;
|
|
|
+ foreach (int year in groupLists.Select(x => x.year))
|
|
|
{
|
|
|
- grade = (Year - year) / Count.Value;
|
|
|
+ int grade;
|
|
|
+ if (Month >= 1 && Month <= 6)
|
|
|
+ {
|
|
|
+ grade = (Year - year + 1) / Count.Value;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ grade = (Year - year) / Count.Value;
|
|
|
+ }
|
|
|
+ grades.Add($"{grade}");
|
|
|
}
|
|
|
- grades.Add($"{grade}");
|
|
|
}
|
|
|
+ } catch (CosmosException ex) when (ex.Status == 404) {
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
lessonRecord.grade.AddRange(grades);
|
|
@@ -1399,7 +1403,6 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
|
|
|
try
|
|
|
{
|
|
|
ItemResponse<StuCourse> stuCourse = await client.GetContainer(Constant.TEAMModelOS, "Student").ReadItemAsync<StuCourse>(courseChange.id, new PartitionKey($"StuCourse-{courseChange.school}-{stu.id}"));
|
|
|
-
|
|
|
if (stuCourse.Value.stulist.Contains(delList))
|
|
|
{
|
|
|
stuCourse.Value.stulist.Remove(delList);
|
|
@@ -1418,7 +1421,8 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
|
|
|
}
|
|
|
catch (CosmosException ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"OS,{ Environment.GetEnvironmentVariable("Option:Location")},CourseServiceBus -CosmosDB异常\n{ex.Message}{ex.StackTrace}", GroupNames.成都开发測試群組);
|
|
|
+ continue;
|
|
|
+ // await _dingDing.SendBotMsg($"OS,{ Environment.GetEnvironmentVariable("Option:Location")},CourseServiceBus -CosmosDB异常\n{ex.Message}{ex.StackTrace}", GroupNames.成都开发測試群組);
|
|
|
}
|
|
|
}
|
|
|
foreach (var tmd in delTmdidsCls)
|