CrazyIter_Bin 3 年之前
父节点
当前提交
81e4593518
共有 2 个文件被更改,包括 5 次插入4 次删除
  1. 3 3
      TEAMModelFunction/MonitorServicesBus.cs
  2. 2 1
      TEAMModelOS.SDK/Models/Service/LessonService.cs

+ 3 - 3
TEAMModelFunction/MonitorServicesBus.cs

@@ -922,8 +922,6 @@ namespace TEAMModelFunction
                                 msgs.Add(update);
                                 msgs.Add(update);
                                 break;
                                 break;
                             case "delete":
                             case "delete":
-                                //BlobDownloadResult ActivityInfoblobDownload = await _azureStorage.GetBlobContainerClient(blobname).GetBlobClient($"/{_lessonId}/IES/ActivityInfo.json").DownloadContentAsync();
-                                //var activityInfos = ActivityInfoblobDownload.Content.ToObjectFromJson<List<LessonActivityInfo>>();
                                 try
                                 try
                                 {
                                 {
                                     await client.GetContainer(Constant.TEAMModelOS, tbname).DeleteItemAsync<LessonRecord>(lessonId, new PartitionKey(code));
                                     await client.GetContainer(Constant.TEAMModelOS, tbname).DeleteItemAsync<LessonRecord>(lessonId, new PartitionKey(code));
@@ -932,6 +930,7 @@ namespace TEAMModelFunction
                                 catch (CosmosException ex) {
                                 catch (CosmosException ex) {
                                     msgs.Add(update);
                                     msgs.Add(update);
                                 }
                                 }
+                                lessonRecord = null;
                                 break;
                                 break;
                             case "create":
                             case "create":
                                 oldlessonRecord = null;
                                 oldlessonRecord = null;
@@ -999,10 +998,11 @@ namespace TEAMModelFunction
                                 break;
                                 break;
                         }
                         }
                     }
                     }
+                    //
+                    await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, tbname).ReplaceItemAsync<LessonRecord>(lessonRecord, lessonId, new PartitionKey(code));
                     //计算课堂更新前后的差值
                     //计算课堂更新前后的差值
                     lessonDis = LessonService.DisLessonCount(oldlessonRecord, lessonRecord, lessonDis);
                     lessonDis = LessonService.DisLessonCount(oldlessonRecord, lessonRecord, lessonDis);
                     await LessonService.FixLessonCount(client, _dingDing, lessonRecord, lessonDis);
                     await LessonService.FixLessonCount(client, _dingDing, lessonRecord, lessonDis);
-                    await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, tbname).ReplaceItemAsync<LessonRecord>(lessonRecord, lessonId, new PartitionKey(code));
                 }
                 }
             }
             }
             catch (Exception ex)
             catch (Exception ex)

+ 2 - 1
TEAMModelOS.SDK/Models/Service/LessonService.cs

@@ -49,8 +49,9 @@ namespace TEAMModelOS.SDK.Models.Service
             //无效操作
             //无效操作
             else if (oldRecord == null && newRecord == null)
             else if (oldRecord == null && newRecord == null)
             {
             {
-                //前后操作都有值,则表示更新
+
             }
             }
+            //前后操作都有值,则表示更新
             else
             else
             {
             {
                 //P分数量加减
                 //P分数量加减