|
@@ -13,6 +13,66 @@ namespace TEAMModelOS.SDK.Models.Service
|
|
{
|
|
{
|
|
public class LessonService
|
|
public class LessonService
|
|
{
|
|
{
|
|
|
|
+ /// <summary>
|
|
|
|
+ ///
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="client"></param>
|
|
|
|
+ /// <param name="_dingDing"></param>
|
|
|
|
+ /// <param name="data"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ public static LessonDis DisLessonCount( LessonRecord oldRecord, LessonRecord newRecord ) {
|
|
|
|
+ //P分数量加减
|
|
|
|
+
|
|
|
|
+ LessonDis lessonDis = new LessonDis();
|
|
|
|
+ if (oldRecord.pScore >= 70)
|
|
|
|
+ {
|
|
|
|
+ if (newRecord.pScore < 70)
|
|
|
|
+ {
|
|
|
|
+ lessonDis. disPCount = -1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if (newRecord.pScore >= 70)
|
|
|
|
+ {
|
|
|
|
+ lessonDis.disPCount = 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //T分数量加减
|
|
|
|
+
|
|
|
|
+ if (oldRecord.tScore >= 70)
|
|
|
|
+ {
|
|
|
|
+ if (newRecord.tScore < 70)
|
|
|
|
+ {
|
|
|
|
+ lessonDis.disTCount = -1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if (newRecord.tScore >= 70)
|
|
|
|
+ {
|
|
|
|
+ lessonDis.disTCount = 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //双绿灯数量
|
|
|
|
+
|
|
|
|
+ if (oldRecord.tScore >= 70 && oldRecord.pScore >= 70)
|
|
|
|
+ {
|
|
|
|
+ if (newRecord.tScore < 70 || newRecord.pScore < 70)
|
|
|
|
+ {
|
|
|
|
+ lessonDis.disDCount = -1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if (newRecord.tScore >= 70 && newRecord.pScore >= 70)
|
|
|
|
+ {
|
|
|
|
+ lessonDis.disDCount = 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return lessonDis;
|
|
|
|
+ }
|
|
|
|
+
|
|
public static async Task FixLessonCount(CosmosClient client, DingDing _dingDing, LessonRecord data)
|
|
public static async Task FixLessonCount(CosmosClient client, DingDing _dingDing, LessonRecord data)
|
|
{
|
|
{
|
|
try
|
|
try
|