Просмотр исходного кода

Merge branch 'ZJ/develop-20220831' into develop

zj 2 лет назад
Родитель
Сommit
723b326276

+ 30 - 0
TEAMModelOS.FunctionV4/ServiceBus/ActiveTaskTopic.cs

@@ -209,6 +209,34 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
             }
 
         }
+
+
+        [Function("Art")]
+        public async Task ArtFunc([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "art", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
+        {
+            string activityId = string.Empty;
+            try
+            {
+                var jsonMsg = JsonDocument.Parse(msg);
+                jsonMsg.RootElement.TryGetProperty("id", out JsonElement id);
+                jsonMsg.RootElement.TryGetProperty("progress", out JsonElement progress);
+                jsonMsg.RootElement.TryGetProperty("code", out JsonElement code);
+                var client = _azureCosmos.GetCosmosClient();
+                ArtEvaluation art = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemAsync<ArtEvaluation>(id.ToString(), new PartitionKey($"{code}"));
+                art.progress = progress.ToString();
+                activityId = id.ToString();
+                await client.GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync(art, id.ToString(), new PartitionKey($"{code}"));
+            }
+            catch (CosmosException e)
+            {
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Art()-CosmosDB异常{e.Message}\n{e.StackTrace}\n{e.Status}\n{msg}", GroupNames.醍摩豆服務運維群組);
+            }
+            catch (Exception ex)
+            {
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-ServiceBus,Art()\n{ex.Message}\n{ex.StackTrace}\n\n{msg}", GroupNames.醍摩豆服務運維群組);
+            }
+
+        }
         [Function("ExamLite")]
         public async Task ExamLiteFunc([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "examlite", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
         {
@@ -595,6 +623,8 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
                 await ActivityService.FixActivity(client, _dingDing, groupChange, "ExamLite");
                 //名单变动修改学生作业活动信息
                 await ActivityService.FixActivity(client, _dingDing, groupChange, "Homework");
+                //名单变动修改学生艺术评价活动信息
+                await ActivityService.FixActivity(client, _dingDing, groupChange, "Art");
                 //TODO学习活动
                 //await FixActivity(client, stuListChange, "Learn");
 

+ 3 - 0
TEAMModelOS.SDK/Models/Cosmos/Common/ArtEvaluation.cs

@@ -32,6 +32,7 @@ namespace TEAMModelOS.SDK.Models.Cosmos.Common
         /// 学生名单(包含自定义个人学生名单,学校教学班)
         /// </summary>
         public List<string> stuLists { get; set; } = new List<string>();
+        public List<string> tchLists { get; set; } = new List<string>();
 
         public List<string> sIds { get; set; } = new List<string>();
         /// <summary>
@@ -72,5 +73,7 @@ namespace TEAMModelOS.SDK.Models.Cosmos.Common
         public string subject { get; set; }
         public int? isOrder { get; set; } = 0;
         public string type { get; set; }
+        public string workDesc { get; set; }
+        public string workEnd { get; set; }
     }
 }