|
@@ -73,7 +73,7 @@ namespace TEAMModelOS.SDK.Models.Service
|
|
|
return lessonDis;
|
|
|
}
|
|
|
|
|
|
- public static async Task FixLessonCount(CosmosClient client, DingDing _dingDing, LessonRecord data)
|
|
|
+ public static async Task FixLessonCount(CosmosClient client, DingDing _dingDing, LessonRecord data, LessonDis lessonDis)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
@@ -85,12 +85,12 @@ namespace TEAMModelOS.SDK.Models.Service
|
|
|
string code = string.Empty;
|
|
|
if (data.scope.Equals("school"))
|
|
|
{
|
|
|
- code = $"LessonCount-{data.school}";
|
|
|
+ code = $"LessonCount-{data.school}-{year}";
|
|
|
tbname = "School";
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- code = $"LessonCount";
|
|
|
+ code = $"LessonCount-{year}";
|
|
|
tbname = "Teacher";
|
|
|
}
|
|
|
var response = await client.GetContainer(Constant.TEAMModelOS, tbname).ReadItemStreamAsync(data.id.ToString(), new PartitionKey(code));
|
|
@@ -100,11 +100,15 @@ namespace TEAMModelOS.SDK.Models.Service
|
|
|
LessonCount count = json.ToObject<LessonCount>();
|
|
|
if (count.courseIds.Count > 0)
|
|
|
{
|
|
|
+ count.tCount[day] += lessonDis.disTCount;
|
|
|
+ count.pCount[day] += lessonDis.disPCount;
|
|
|
+ count.ptCount[day] += lessonDis.disDCount;
|
|
|
if (!count.courseIds.Contains(data.courseId))
|
|
|
{
|
|
|
count.courseIds.Add(data.courseId);
|
|
|
count.beginCount[day] += 1;
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
await client.GetContainer("TEAMModelOS", tbname).ReplaceItemAsync(count, count.id, new PartitionKey(code));
|
|
|
}
|
|
@@ -120,6 +124,9 @@ namespace TEAMModelOS.SDK.Models.Service
|
|
|
List<double> list = new List<double>(da);
|
|
|
list[day] += 1;
|
|
|
count.beginCount.AddRange(list);
|
|
|
+ count.tCount[day] += lessonDis.disTCount;
|
|
|
+ count.pCount[day] += lessonDis.disPCount;
|
|
|
+ count.ptCount[day] += lessonDis.disDCount;
|
|
|
count.courseIds.Add(data.courseId);
|
|
|
await client.GetContainer("TEAMModelOS", "tbname").CreateItemAsync(count, new PartitionKey(code));
|
|
|
}
|