Pārlūkot izejas kodu

Merge branch 'develop5.0-tmd' of http://106.12.23.251:10080/TEAMMODEL/TEAMModelOS into develop5.0-tmd

zhouj1203@hotmail.com 4 gadi atpakaļ
vecāks
revīzija
d0c08b0eea
55 mainītis faili ar 2048 papildinājumiem un 774 dzēšanām
  1. 8 5
      TEAMModelFunction/ActivityHttpTrigger.cs
  2. 1 1
      TEAMModelFunction/CourseServiceBus.cs
  3. 27 0
      TEAMModelFunction/MQActivity.cs
  4. 8 1
      TEAMModelFunction/MonitorCosmosDB.cs
  5. 163 64
      TEAMModelFunction/MonitorServicesBus.cs
  6. 0 133
      TEAMModelFunction/NoticeServiceBus.cs
  7. 13 70
      TEAMModelFunction/StuListServiceBus.cs
  8. 96 136
      TEAMModelFunction/TriggerExam.cs
  9. 30 32
      TEAMModelFunction/TriggerSurvey.cs
  10. 33 52
      TEAMModelFunction/TriggerVote.cs
  11. 9 5
      TEAMModelFunction/local.settings.json
  12. 0 31
      TEAMModelOS.SDK/Context/Constant/Constants.cs
  13. 48 30
      TEAMModelOS.SDK/Models/Cosmos/Common/Notice.cs
  14. 8 1
      TEAMModelOS.SDK/Models/Cosmos/Common/StuActivity.cs
  15. BIN
      TEAMModelOS/ClientApp/src/assets/mark/0.jpg
  16. BIN
      TEAMModelOS/ClientApp/src/assets/mark/1.jpg
  17. BIN
      TEAMModelOS/ClientApp/src/assets/mark/2.jpg
  18. BIN
      TEAMModelOS/ClientApp/src/assets/mark/3.jpg
  19. BIN
      TEAMModelOS/ClientApp/src/assets/mark/4.jpg
  20. BIN
      TEAMModelOS/ClientApp/src/assets/mark/5.jpg
  21. BIN
      TEAMModelOS/ClientApp/src/assets/mark/6.jpg
  22. BIN
      TEAMModelOS/ClientApp/src/assets/mark/7.jpg
  23. BIN
      TEAMModelOS/ClientApp/src/assets/mark/8.jpg
  24. BIN
      TEAMModelOS/ClientApp/src/assets/mark/img0.jpg
  25. BIN
      TEAMModelOS/ClientApp/src/assets/mark/img1.jpg
  26. BIN
      TEAMModelOS/ClientApp/src/assets/mark/img2.jpg
  27. BIN
      TEAMModelOS/ClientApp/src/assets/mark/tmd-logo.png
  28. 1 0
      TEAMModelOS/ClientApp/src/assets/student-web/icons/svg/shaixuan.svg
  29. 3 5
      TEAMModelOS/ClientApp/src/components/student-analysis/total/BaseKnowledgeRadar.vue
  30. 3 2
      TEAMModelOS/ClientApp/src/components/student-analysis/total/BaseScoreRateBar.vue
  31. 4 2
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTestReport.vue
  32. 9 10
      TEAMModelOS/ClientApp/src/components/student-web/EventView/EventList.vue
  33. 6 6
      TEAMModelOS/ClientApp/src/components/student-web/HomeView/MissionListCard.vue
  34. 1 1
      TEAMModelOS/ClientApp/src/static/Global.js
  35. 0 5
      TEAMModelOS/ClientApp/src/utils/evTools.js
  36. 1 1
      TEAMModelOS/ClientApp/src/view/evaluation/bank/ExerciseList.vue
  37. 2 2
      TEAMModelOS/ClientApp/src/view/evaluation/bank/TestPaperList.less
  38. 82 50
      TEAMModelOS/ClientApp/src/view/evaluation/bank/TestPaperList.vue
  39. 3 3
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseChild.vue
  40. 6 6
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseExerciseList.vue
  41. 153 0
      TEAMModelOS/ClientApp/src/view/evaluation/components/DownloadPaper.vue
  42. 5 1
      TEAMModelOS/ClientApp/src/view/evaluation/index/CommonExercise.less
  43. 1 2
      TEAMModelOS/ClientApp/src/view/learnactivity/PaperScore.less
  44. 4 3
      TEAMModelOS/ClientApp/src/view/learnactivity/PaperScore.vue
  45. 10 0
      TEAMModelOS/ClientApp/src/view/learnactivity/Scoring.less
  46. 5 1
      TEAMModelOS/ClientApp/src/view/learnactivity/Scoring.vue
  47. 1078 0
      TEAMModelOS/ClientApp/src/view/learnactivity/markpaper/MarkView.vue
  48. 1 1
      TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/TestAnalysis/TestAnalysis.vue
  49. 19 18
      TEAMModelOS/Controllers/Common/TriggerStuActivity.cs
  50. 9 4
      TEAMModelOS/Controllers/Core/BlobController.cs
  51. 8 3
      TEAMModelOS/Controllers/School/CourseController.cs
  52. 178 9
      TEAMModelOS/Controllers/XTest/TestController.cs
  53. 4 0
      TEAMModelOS/TEAMModelOS.csproj
  54. 5 41
      TEAMModelOS/appsettings.Development.json
  55. 3 37
      TEAMModelOS/appsettings.json

+ 8 - 5
TEAMModelFunction/ActivityHttpTrigger.cs

@@ -167,7 +167,8 @@ namespace TEAMModelFunction
                                 school = info.school,
                                 creatorId = info.creatorId,
                                 subjects = sub,
-                                blob = null
+                                blob = null,
+                                owner = info.owner
 
                             });
                         });
@@ -189,7 +190,8 @@ namespace TEAMModelFunction
                                 school = info.school,
                                 creatorId = info.creatorId,
                                 subjects = sub,
-                                blob=null
+                                blob=null,
+                                owner = info.owner
                             });
                         });
                     }
@@ -259,7 +261,8 @@ namespace TEAMModelFunction
                                 school = info.school,
                                 creatorId = info.creatorId,
                                 subjects = new List<string>() { "" },
-                                blob = null
+                                blob = null,
+                                owner = info.owner
 
                             });
                         });
@@ -281,7 +284,8 @@ namespace TEAMModelFunction
                                 school = info.school,
                                 creatorId = info.creatorId,
                                 subjects = new List<string>() { "" },
-                                blob = null
+                                blob = null,
+                                owner = info.owner
                             });
                         });
                     }
@@ -350,7 +354,6 @@ namespace TEAMModelFunction
                                 creatorId = info.creatorId,
                                 subjects = new List<string>() { "" },
                                 blob = info.blob
-
                             });
                         });
                     }

+ 1 - 1
TEAMModelFunction/CourseServiceBus.cs

@@ -30,7 +30,7 @@ namespace TEAMModelFunction
         /// <param name="msg"></param>
         /// <returns></returns>
         [FunctionName("Course")]
-        public async Task Course([ServiceBusTrigger("active-task", "course", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
+        public async Task Course([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "course", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
         {
             var client = _azureCosmos.GetCosmosClient();
             try

+ 27 - 0
TEAMModelFunction/MQActivity.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace TEAMModelFunction
+{
+    public class MQActivity
+    {
+
+        public string id { get; set; }
+        public string code { get; set; }
+        public string owner { get; set; }
+        public List<string> classes { get; set; }
+        //如果已经完成则不写入???
+        public string progress { get; set; }
+        public string scope { get; set; }
+        public string school { get; set; }
+        public string creatorId { get; set; }
+        public string pk { get; set; }
+        public string name { get; set; }
+        public List<string> subjects { get; set; }
+        public string blob { get; set; }
+        public long startTime { get; set; }
+        public long endTime { get; set; }
+
+    }
+}

+ 8 - 1
TEAMModelFunction/MonitorCosmosDB.cs

@@ -7,6 +7,7 @@ using Azure.Cosmos;
 using Azure.Messaging.ServiceBus;
 using Microsoft.Azure.Documents;
 using Microsoft.Azure.WebJobs;
+using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.Logging;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Extension;
@@ -21,13 +22,17 @@ namespace TEAMModelFunction
         private readonly AzureStorageFactory _azureStorage;
         private readonly DingDing _dingDing;
         private readonly AzureRedisFactory _azureRedis;
-        public MonitorCosmosDB( AzureCosmosFactory azureCosmos, AzureServiceBusFactory azureServiceBus, AzureStorageFactory azureStorage, DingDing dingDing, AzureRedisFactory azureRedis)
+       // private   IConfiguration _configuration { get; set; }
+        public MonitorCosmosDB( AzureCosmosFactory azureCosmos, AzureServiceBusFactory azureServiceBus, AzureStorageFactory azureStorage, DingDing dingDing, AzureRedisFactory azureRedis
+           // , IConfiguration configuration
+            )
         {
             _azureCosmos = azureCosmos;
             _serviceBus = azureServiceBus;
             _azureStorage = azureStorage;
             _dingDing = dingDing;
             _azureRedis = azureRedis;
+          //  _configuration = configuration;
         }
 
         [FunctionName("Common")]
@@ -79,8 +84,10 @@ namespace TEAMModelFunction
                                 id = input.Id,
                                 status = status
                             };
+#if DEBUG
                             await _dingDing.SendBotMsg($"CosmosDBTrigger,{pk}触发变更\n{data.ToJsonString()}",
                                             GroupNames.成都开发測試群組);
+#endif
                             switch (pk)
                             {
                                 case "Exam":

+ 163 - 64
TEAMModelFunction/MonitorServicesBus.cs

@@ -3,33 +3,37 @@ using System.Collections.Generic;
 using System.Text.Json;
 using System.Threading.Tasks;
 using Azure.Cosmos;
+using Azure.Messaging.ServiceBus;
 using Microsoft.Azure.WebJobs;
 using Microsoft.Azure.WebJobs.Host;
 using Microsoft.Extensions.Logging;
 using StackExchange.Redis;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Extension;
+using TEAMModelOS.SDK.Helper.Common.CollectionHelper;
 using TEAMModelOS.SDK.Models;
+using TEAMModelOS.SDK.Models.Cosmos.Common;
 
 namespace TEAMModelFunction
 {
     public class MonitorServicesBus
     {
+        
         private readonly AzureCosmosFactory _azureCosmos;
         private readonly DingDing _dingDing;
         private readonly AzureStorageFactory _azureStorage;
         private readonly AzureRedisFactory _azureRedis;
-        public MonitorServicesBus(AzureCosmosFactory azureCosmos, DingDing dingDing, AzureStorageFactory azureStorage
-             , AzureRedisFactory azureRedis
-            )
+        private readonly AzureServiceBusFactory _serviceBus;
+        public MonitorServicesBus(AzureCosmosFactory azureCosmos, DingDing dingDing, AzureStorageFactory azureStorage   , AzureRedisFactory azureRedis, AzureServiceBusFactory serviceBus)
         {
             _azureCosmos = azureCosmos;
             _dingDing = dingDing;
             _azureStorage = azureStorage;
             _azureRedis = azureRedis;
+            _serviceBus = serviceBus;
         }
         [FunctionName("Exam")]
-        public async Task Exam([ServiceBusTrigger("active-task", "exam", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
+         public async Task Exam([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "exam", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
         {
             try
             {
@@ -42,23 +46,6 @@ namespace TEAMModelFunction
                 ExamInfo exam = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ExamInfo>(id.ToString(), new PartitionKey($"{code}"));
                 exam.progress = progress.ToString();
                 await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(exam, id.ToString(), new PartitionKey($"{code}"));
-                /*                keyValuePairs.TryGetValue("id", out object id);
-                                keyValuePairs.TryGetValue("name", out object name);
-                                keyValuePairs.TryGetValue("code", out object code);*/
-                //keyValuePairs.TryGetValue("status", out object progress);
-                /*if (name.ToString().Equals("Exam", StringComparison.OrdinalIgnoreCase))
-                {
-                    ExamInfo exam = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ExamInfo>(id.ToString(), new PartitionKey($"{code}"));
-                    if (DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().CompareTo(exam.startTime) > 0 && DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().CompareTo(exam.endTime) < 0)
-                    {
-                        exam.progress = "going";
-                    }
-                    else if (DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().CompareTo(exam.endTime) > 0)
-                    {
-                        exam.progress = "finish";
-                    }
-                    await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(exam, id.ToString(), new PartitionKey($"{code}"));
-                }*/
             }
             catch (Exception ex)
             {
@@ -67,7 +54,7 @@ namespace TEAMModelFunction
 
         }
         [FunctionName("Vote")]
-        public async Task Vote([ServiceBusTrigger("active-task", "vote", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
+        public async Task Vote([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "vote", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
         {
             try
             {
@@ -80,29 +67,6 @@ namespace TEAMModelFunction
                 Vote vote = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Vote>(id.ToString(), new PartitionKey($"{code}"));
                 vote.progress = progress.ToString();
                 await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(vote, id.ToString(), new PartitionKey($"{code}"));
-                /*keyValuePairs.TryGetValue("id", out object id);
-                keyValuePairs.TryGetValue("name", out object name);
-                keyValuePairs.TryGetValue("code", out object code);*/
-                //keyValuePairs.TryGetValue("status", out object progress);
-                /*if (name.ToString().Equals("Vote", StringComparison.OrdinalIgnoreCase))
-                {
-                    Vote vote;
-                    var sresponse = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(id.ToString(), new PartitionKey($"{code}"));
-                    if (sresponse.Status == 200)
-                    {
-                        using var json = await JsonDocument.ParseAsync(sresponse.ContentStream);
-                        vote = json.ToObject<Vote>();
-                        if (DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().CompareTo(vote.startTime) > 0 && DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().CompareTo(vote.endTime) < 0)
-                        {
-                            vote.progress = "going";
-                        }
-                        else if (DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().CompareTo(vote.endTime) > 0)
-                        {
-                            vote.progress = "finish";
-                        }
-                        await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(vote, id.ToString(), new PartitionKey($"{code}"));
-                    }
-                }*/
             }
             catch (Exception ex)
             {
@@ -111,7 +75,7 @@ namespace TEAMModelFunction
 
         }
         [FunctionName("Survey")]
-        public async Task Survey([ServiceBusTrigger("active-task", "survey", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
+        public async Task Survey([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "survey", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
         {
             try
             {
@@ -124,23 +88,6 @@ namespace TEAMModelFunction
                 Survey survey = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Survey>(id.ToString(), new PartitionKey($"{code}"));
                 survey.progress = progress.ToString();
                 await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(survey, id.ToString(), new PartitionKey($"{code}"));
-                /*keyValuePairs.TryGetValue("id", out object id);
-                keyValuePairs.TryGetValue("name", out object name);
-                keyValuePairs.TryGetValue("code", out object code);*/
-                //keyValuePairs.TryGetValue("status", out object progress);
-                /*if (name.ToString().Equals("Survey", StringComparison.OrdinalIgnoreCase))
-                {
-                    Survey survey = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Survey>(id.ToString(), new PartitionKey($"{code}"));
-                    if (DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().CompareTo(survey.startTime) > 0 && DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().CompareTo(survey.endTime) < 0)
-                    {
-                        survey.progress = "going";
-                    }
-                    else if (DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().CompareTo(survey.endTime) > 0)
-                    {
-                        survey.progress = "finish";
-                    }
-                    await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(survey, id.ToString(), new PartitionKey($"{code}"));
-                }*/
             }
             catch (Exception ex)
             {
@@ -148,7 +95,7 @@ namespace TEAMModelFunction
             }
         }
         [FunctionName("Blob")]
-        public async Task Blob([ServiceBusTrigger("active-task", "blob", Connection = "Azure:ServiceBus:ConnectionString")] string msg) {
+        public async Task Blob([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "blob", Connection = "Azure:ServiceBus:ConnectionString")] string msg) {
             try
             {
                // await _dingDing.SendBotMsg($"ServiceBus,Blob(){msg}", GroupNames.醍摩豆服務運維群組);
@@ -163,8 +110,10 @@ namespace TEAMModelFunction
                         await _azureRedis.GetRedisClient(8).SortedSetRemoveAsync($"Blob:Catalog:{name}", key);
                         await _azureRedis.GetRedisClient(8).SortedSetIncrementAsync($"Blob:Catalog:{name}", key, size.Item2[key].HasValue ? size.Item2[key].Value : 0);
                     }
+#if DEBUG
                     await _dingDing.SendBotMsg($"ServiceBus,Blob() 容器:{name}使用:{size.Item1},文件分类:{size.Item2.ToJsonString()}",
                             GroupNames.成都开发測試群組);
+#endif
                 }
             }
             catch (Exception ex)
@@ -172,5 +121,155 @@ namespace TEAMModelFunction
                 await _dingDing.SendBotMsg($"ServiceBus,Blob()\n{ex.Message}{ex.StackTrace}", GroupNames.醍摩豆服務運維群組);
             }
         }
+
+        /// <summary>
+        /// 完善课程变更,StuListChange,  originCode是学校编码 则表示名单是学校自定义名单,如果是tmdid则表示醍摩豆的私有名单,scope=school,private。
+        /// </summary>
+        /// <data msg>
+        /// CourseChange
+        ///// </data>
+        /// <param name="msg"></param>
+        /// <returns></returns>
+        [FunctionName("StuList")]
+        public async Task StuList([ServiceBusTrigger("%Azure:ServiceBus:ActiveTask%", "stulist", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
+        {
+            var client = _azureCosmos.GetCosmosClient();
+            try
+            {
+                await _dingDing.SendBotMsg($"ServiceBus,StuList:{msg}", GroupNames.醍摩豆服務運維群組);
+                var jsonMsg = JsonDocument.Parse(msg);
+                StuListChange stuListChange = msg.ToObject<StuListChange>();
+                //名单变动修改学生课程关联信息
+                await StuListService.FixStuCourse(client, stuListChange);
+                //Vote投票 Survey问卷 Exam评测 Learn学习活动 Homework作业活动
+                //名单变动修改学生问卷关联信息
+                await StuListService.FixActivity(client, stuListChange, "Survey");
+                //名单变动修改学生投票关联信息
+                await StuListService.FixActivity(client, stuListChange, "Vote");
+                //名单变动修改学生评测关联信息
+                await StuListService.FixActivity(client, stuListChange, "Exam");
+                //TODO学习活动
+                //await FixActivity(client, stuListChange, "Learn");
+                //TODO作业活动
+                // await FixActivity(client, stuListChange, "Homework");
+            }
+            catch (Exception ex)
+            {
+                await _dingDing.SendBotMsg($"StuListServiceBus-StuList\n{ex.Message}{ex.StackTrace}", GroupNames.成都开发測試群組);
+            }
+        }
+        [FunctionName("Notice")]
+        public async Task Notice([ServiceBusTrigger("%Azure:ServiceBus:NoticeTask%", "notice", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
+        {
+            var client = _azureRedis.GetRedisClient(8);
+            try
+            {
+
+                Console.WriteLine(msg);
+                // List<Task<string>> tasks = new List<Task<string>>();
+                //List<Task> sessionTasks = new List<Task>();
+                var jsonMsg = JsonDocument.Parse(msg);
+                Notice notice = msg.ToObject<Notice>();
+                var blobcntr = "";
+
+                if (notice.scope.Equals("school"))
+                {
+                    blobcntr = notice.school;
+                }
+                else
+                {
+                    blobcntr = notice.creatorId;
+                }
+                if (string.IsNullOrEmpty(blobcntr))
+                {
+                    return;
+                }
+#if DEBUG
+                await _dingDing.SendBotMsg($"NoticeServiceBus-Notice:\n发起通知{msg}", GroupNames.成都开发測試群組);
+#endif
+                var urlNotice = $"{notice.msgId}.json";
+                var blobNotice = new
+                {
+                    notice.type,
+                    notice.priority,
+                    notice.body,
+                    notice.creation,
+                    notice.expire,
+                    notice.creatorId
+
+                };
+                await _azureStorage.UploadFileByContainer(blobcntr, blobNotice.ToJsonString(), "notice", urlNotice);
+                var urlReceiver = $"{notice.msgId}_receiver.json";
+                var blobReceiver = new
+                {
+                    notice.stuids,
+                    notice.tmdids
+                };
+                await _azureStorage.UploadFileByContainer(blobcntr, blobReceiver.ToJsonString(), "notice", urlReceiver);
+                long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
+                // "ttl":2592000,不能超过30天(2592000),一天(3600),一周(25200)
+
+                if (notice.stuids.IsNotEmpty())
+                {
+                    //  List<Receiver> receivers = new List<Receiver>();
+                    foreach (var stu in notice.stuids)
+                    {
+                        Receiver receiver = new Receiver
+                        {
+                            id = notice.msgId,
+                            pk = "Receiver",
+                            status = 0,
+                            scope = "school",
+                            ctime = now,
+                            urlNotice = $"/notice/{urlNotice}",
+                            rid = $"{stu.schoolId}-{stu.id}"
+                        };
+                        var url = $"{stu.id}/receive/{notice.msgId}.json";
+                        await client.HashSetAsync($"Notice:Receiver:{stu.schoolId}-{stu.id}", notice.msgId, $"/student/{url}");
+                        // await client.GetContainer("TEAMModelOS", "Common").UpsertItemAsync<Receiver>(receiver,new Azure.Cosmos.PartitionKey(receiver.code));
+                        //  /student/{stuid}/receive/{notice.sid}.json
+                        //存放通知到学生容器空间
+
+                        await _azureStorage.UploadFileByContainer(blobcntr, receiver.ToJsonString(), "student", url);
+                        var messageBlob = new ServiceBusMessage(receiver.ToJsonString()) { SessionId = $"{stu.schoolId}-{stu.id}" };
+                        // messageBlob.ApplicationProperties.Add("name", "Receiver");
+                        await _serviceBus.GetServiceBusClient().SendMessageAsync("notice-task", messageBlob);
+                    }
+                }
+                if (notice.tmdids.IsNotEmpty())
+                {
+                    foreach (var tmdid in notice.tmdids)
+                    {
+                        Receiver receiver = new Receiver
+                        {
+                            id = notice.msgId,
+                            pk = "Receiver",
+                            status = 0,
+                            //school = stu.schoolId,
+                            scope = "school",
+
+                            ctime = now,
+                            urlNotice = $"/notice/{urlNotice}",
+                            rid = $"{tmdid}"
+                        };
+                        var url = $"{notice.msgId}.json";
+                        await client.HashSetAsync($"Notice:Receiver:{tmdid}", notice.msgId, new { now, url = $"/receive/{url}" }.ToJsonString());
+                        //await client.GetContainer("TEAMModelOS", "Common").UpsertItemAsync<Receiver>(receiver, new Azure.Cosmos.PartitionKey(receiver.code));
+                        //  /student/{stuid}/receive/{notice.sid}.json
+                        //存放通知到学生容器空间
+
+                        await _azureStorage.UploadFileByContainer(blobcntr, receiver.ToJsonString(), "receive", url);
+                        var messageBlob = new ServiceBusMessage(receiver.ToJsonString()) { SessionId = $"{tmdid}" };
+                        //messageBlob.ApplicationProperties.Add("name", "Receiver");
+                        await _serviceBus.GetServiceBusClient().SendMessageAsync("notice-task", messageBlob);
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                await _dingDing.SendBotMsg($"NoticeServiceBus-Notice\n{ex.Message}{ex.StackTrace}", GroupNames.成都开发測試群組);
+            }
+        }
+
     }
 }

+ 0 - 133
TEAMModelFunction/NoticeServiceBus.cs

@@ -1,133 +0,0 @@
-using Azure.Messaging.ServiceBus;
-using Microsoft.Azure.WebJobs;
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Text.Json;
-using System.Threading.Tasks;
-using TEAMModelOS.SDK.DI;
-using TEAMModelOS.SDK.Extension;
-using TEAMModelOS.SDK.Helper.Common.CollectionHelper;
-using TEAMModelOS.SDK.Models;
-
-namespace TEAMModelFunction
-{
-   
-    public class NoticeServiceBus
-    {
-        private readonly AzureCosmosFactory _azureCosmos;
-        private readonly AzureStorageFactory _azureStorage;
-        private readonly AzureServiceBusFactory _serviceBus;
-        private readonly DingDing _dingDing;
-        public NoticeServiceBus(AzureCosmosFactory azureCosmos, DingDing dingDing,AzureStorageFactory azureStorage, AzureServiceBusFactory serviceBus)
-        {
-            _azureStorage = azureStorage;
-            _azureCosmos = azureCosmos;
-            _dingDing = dingDing;
-            _serviceBus = serviceBus;
-        }
-        //[FunctionName("Notice")]
-        //public async  Task Notice([ServiceBusTrigger("active-task", "notice", Connection = "Azure:ServiceBus:ConnectionString")] string msg) {
-        //    var client = _azureCosmos.GetCosmosClient();
-        //    try {
-        //        await _dingDing.SendBotMsg($"NoticeServiceBus-Notice:\n发起通知{msg}", GroupNames.成都开发測試群組);
-        //        List<Task<string>> tasks = new List<Task<string>>();
-        //        List<Task> sessionTasks = new List<Task>();
-        //        var jsonMsg = JsonDocument.Parse(msg);
-        //        Notice notice = msg.ToObject<Notice>();
-        //        var blobcntr = "";
-        //        if (notice.scope.Equals("school"))
-        //        {
-        //            blobcntr = notice.school;
-        //        }
-        //        else {
-        //            blobcntr = notice.creatorId;
-        //        }
-        //        var urlNotice = $"{notice.sid}.json";
-        //        var blobNotice = new { 
-        //            notice.sid, 
-        //            notice.scode,
-        //            notice.spk,
-        //            notice.scope,
-        //            notice.school,
-        //            notice.type,
-        //            notice.level,
-        //            notice.data,
-        //            notice.stime,
-        //            notice.etime,
-        //            notice.creatorId
-        //        };
-        //        tasks.Add(_azureStorage.UploadFileByContainer(blobcntr, blobNotice.ToJsonString(), "notice", urlNotice));
-        //        var urlReceiver = $"{notice.sid}_receiver.json";
-        //        var blobReceiver = new
-        //        {
-        //            notice.stuids,
-        //            notice.tmdids
-        //        };
-        //        tasks.Add(_azureStorage.UploadFileByContainer(blobcntr, blobReceiver.ToJsonString(), "notice", urlReceiver));
-        //        long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
-        //        // "ttl":2592000,不能超过30天(2592000),一天(3600),一周(25200)
-        //        long ttl = notice.etime - now;
-        //        long day30 = 2592000L * 1000;
-        //        if (ttl > day30) {
-        //            ttl = day30;
-        //        }
-        //        if (notice.stuids.IsNotEmpty()) {
-        //            //  List<Receiver> receivers = new List<Receiver>();
-        //            foreach (var stu in notice.stuids) {
-        //                Receiver receiver = new Receiver
-        //                {
-        //                    id = notice.sid,
-        //                    pk = "Receiver",
-        //                    status = 0,
-        //                    school = stu.schoolId,
-        //                    scope = "school",
-        //                    code = $"Receiver-{stu.schoolId}-{stu.id}",
-        //                    ttl = (int)ttl,
-        //                    ctime= now,
-        //                    urlNotice=$"notice/{urlNotice}"
-        //                };
-        //                await client.GetContainer("TEAMModelOS", "Student").UpsertItemAsync<Receiver>(receiver,new Azure.Cosmos.PartitionKey(receiver.code));
-        //                //  /student/{stuid}/receive/{notice.sid}.json
-        //                //存放通知到学生容器空间
-        //                var url = $"{stu.id}/receive/{notice.sid}.json";
-        //                tasks.Add(_azureStorage.UploadFileByContainer(blobcntr, receiver.ToJsonString(), "student", url));
-        //                var messageBlob = new ServiceBusMessage(notice.ToJsonString()) { SessionId =$"{stu.schoolId}-{stu.id}"};
-        //                messageBlob.ApplicationProperties.Add("name", "Receiver");
-        //                sessionTasks.Add(_serviceBus.GetServiceBusClient().SendMessageAsync("active-task", messageBlob));
-        //            }
-        //        }
-        //        if (notice.tmdids.IsNotEmpty())
-        //        {
-        //            foreach (var tmdid in notice.tmdids)
-        //            {
-        //                Receiver receiver = new Receiver
-        //                {
-        //                    id = notice.sid,
-        //                    pk = "Receiver",
-        //                    status = 0,
-        //                    //school = stu.schoolId,
-        //                    scope = "school",
-        //                    code = $"Receiver-{tmdid}",
-        //                    ttl = (int)ttl,
-        //                    ctime = now,
-        //                    urlNotice = $"notice/{urlNotice}"
-        //                };
-        //                await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync<Receiver>(receiver, new Azure.Cosmos.PartitionKey(receiver.code));
-        //                //  /student/{stuid}/receive/{notice.sid}.json
-        //                //存放通知到学生容器空间
-        //                var url = $"{notice.sid}.json";
-        //                tasks.Add(_azureStorage.UploadFileByContainer(blobcntr, receiver.ToJsonString(), "receive", url));
-        //                var messageBlob = new ServiceBusMessage(notice.ToJsonString()) { SessionId = $"{tmdid}" };
-        //                messageBlob.ApplicationProperties.Add("name", "Receiver");
-        //                sessionTasks.Add(_serviceBus.GetServiceBusClient().SendMessageAsync("active-task", messageBlob));
-        //            }
-        //        }
-        //        await Task.WhenAll(sessionTasks);
-        //        await Task.WhenAll(tasks);
-        //    } catch (Exception ex) {
-        //         await _dingDing.SendBotMsg($"NoticeServiceBus-Notice\n{ex.Message}{ex.StackTrace}", GroupNames.成都开发測試群組);
-        //    }
-        //}
-    }
-}

+ 13 - 70
TEAMModelFunction/StuListServiceBus.cs

@@ -13,73 +13,10 @@ using TEAMModelOS.SDK.Models.Cosmos.Common;
 
 namespace TEAMModelFunction
 {
-    public class MQActivity { 
-    
-        public string id { get; set; }
-        public string code { get; set; }
-        public string owner { get; set; }
-        public List<string> classes { get; set; }
-        //如果已经完成则不写入???
-        public string progress { get; set; }
-        public string scope { get; set; }
-        public string school { get; set; }
-        public string creatorId { get; set; }
-        public string pk { get; set; }
-        public string name { get; set; }
-        public List<string> subjects { get; set; }
-        public string blob { get; set; }
-        public long startTime { get; set; }
-        public long endTime { get; set; }
-
-    }
-
-    public class StuListServiceBus
+    public class StuListService
     {
-        private readonly AzureCosmosFactory _azureCosmos;
-        private readonly DingDing _dingDing;
-        public StuListServiceBus(AzureCosmosFactory azureCosmos, DingDing dingDing)
-        {
-            _azureCosmos = azureCosmos;
-            _dingDing = dingDing;
-        }
-        /// <summary>
-        /// 完善课程变更,StuListChange,  originCode是学校编码 则表示名单是学校自定义名单,如果是tmdid则表示醍摩豆的私有名单,scope=school,private。
-        /// </summary>
-        /// <data msg>
-        /// CourseChange
-        ///// </data>
-        /// <param name="msg"></param>
-        /// <returns></returns>
-        [FunctionName("StuList")]
-        public async Task StuList([ServiceBusTrigger("active-task", "stulist", Connection = "Azure:ServiceBus:ConnectionString")] string msg)
+        public static async Task FixActivity(CosmosClient client, StuListChange stuListChange, string type)
         {
-            var client = _azureCosmos.GetCosmosClient();
-            try
-            {
-                await _dingDing.SendBotMsg($"ServiceBus,StuList:{msg}", GroupNames.醍摩豆服務運維群組);
-                var jsonMsg = JsonDocument.Parse(msg);
-                StuListChange stuListChange = msg.ToObject<StuListChange>();
-                //名单变动修改学生课程关联信息
-                await FixStuCourse(client, stuListChange);
-                //Vote投票 Survey问卷 Exam评测 Learn学习活动 Homework作业活动
-                //名单变动修改学生问卷关联信息
-                await FixActivity(client, stuListChange, "Survey");
-                //名单变动修改学生投票关联信息
-                await FixActivity(client, stuListChange, "Vote");
-                //名单变动修改学生评测关联信息
-                await FixActivity(client, stuListChange, "Exam");
-                //TODO学习活动
-                //await FixActivity(client, stuListChange, "Learn");
-                //TODO作业活动
-                // await FixActivity(client, stuListChange, "Homework");
-            }
-            catch (Exception ex)
-            {
-                await _dingDing.SendBotMsg($"StuListServiceBus-StuList\n{ex.Message}{ex.StackTrace}", GroupNames.成都开发測試群組);
-            }
-        }
-
-        public async Task FixActivity(CosmosClient client, StuListChange stuListChange, string type) {
             var query = $"SELECT distinct c.owner, c.id,c.code, c.classes,c.subjects,c.progress,c.scope,c.startTime,c.school,c.creatorId,c.name,c.pk ,c.endTime   FROM c  join A1 in c.classes  where  c.pk='{type}' and A1 in('{stuListChange.listid}') ";
             List<MQActivity> datas = new List<MQActivity>();
             await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<MQActivity>(queryText: query,
@@ -87,9 +24,11 @@ namespace TEAMModelFunction
             {
                 datas.Add(item);
             }
-            foreach (MQActivity activity in datas) {
+            foreach (MQActivity activity in datas)
+            {
                 //已经完结的不再允许加入
-                if (activity.progress.Equals("finish")||activity.progress.Equals("pending")) {
+                if (activity.progress.Equals("finish") || activity.progress.Equals("pending"))
+                {
                     continue;
                 }
                 //学生新加入名单的
@@ -108,7 +47,8 @@ namespace TEAMModelFunction
                         type = type,
                         subjects = type.Equals("Exam") ? activity.subjects : new List<string>() { "" },
                         startTime = activity.startTime,
-                        endTime = activity.endTime
+                        endTime = activity.endTime,
+                        owner= activity.owner
                     };
                     await client.GetContainer("TEAMModelOS", "Student").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
                 }//tmd新加入的
@@ -125,14 +65,16 @@ namespace TEAMModelFunction
                         creatorId = activity.creatorId,
                         pk = "Activity",
                         type = type,
-                        subjects= type.ToLower().Equals("Exam")?activity.subjects:new List<string>() {"" }
+                        subjects = type.ToLower().Equals("Exam") ? activity.subjects : new List<string>() { "" },
+                        owner = activity.owner
                     };
                     await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
                 }
             }
         }
 
-        public async Task FixStuCourse(CosmosClient client, StuListChange stuListChange) {
+        public static async Task FixStuCourse(CosmosClient client, StuListChange stuListChange)
+        {
             //1.查找学校或教师的课程是否包含该名单的课程。
             var query = $"select distinct c.code,c.id,c.no,c.name,c.scope, c.creatorId,c.school from c join A0 in c.schedule where A0.stulist = '{stuListChange.listid}'";
             List<Course> courses = new List<Course>();
@@ -199,5 +141,6 @@ namespace TEAMModelFunction
             }
 
         }
+
     }
 }

+ 96 - 136
TEAMModelFunction/TriggerExam.cs

@@ -18,7 +18,7 @@ namespace TEAMModelFunction
 {
     public class TriggerExam
     {
-        public static async void Trigger(AzureCosmosFactory _azureCosmos, AzureServiceBusFactory _serviceBus, AzureStorageFactory _azureStorage, DingDing _dingDing,
+        public static async void Trigger( AzureCosmosFactory _azureCosmos, AzureServiceBusFactory _serviceBus, AzureStorageFactory _azureStorage, DingDing _dingDing,
             CosmosClient client, Document input, string code, long stime, long etime, string school)
         {
             ExamInfo info = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ExamInfo>(input.Id, new Azure.Cosmos.PartitionKey($"{code}"));
@@ -69,15 +69,15 @@ namespace TEAMModelFunction
                     message.ApplicationProperties.Add("name", "Exam");
                     if (records.Count > 0)
                     {
-                        await _serviceBus.GetServiceBusClient().cancelMessage("active-task", records[0].sequenceNumber);
-                        long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", message, DateTimeOffset.FromUnixTimeMilliseconds(stime));
+                        await _serviceBus.GetServiceBusClient().cancelMessage(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), records[0].sequenceNumber);
+                        long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), message, DateTimeOffset.FromUnixTimeMilliseconds(stime));
                         records[0].sequenceNumber = start;
                         await _azureStorage.SaveOrUpdate<ChangeRecord>(records[0]);
                         //await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(record, record.id, new Azure.Cosmos.PartitionKey($"{record.code}"));
                     }
                     else
                     {
-                        long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", message, DateTimeOffset.FromUnixTimeMilliseconds(stime));
+                        long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), message, DateTimeOffset.FromUnixTimeMilliseconds(stime));
                         ChangeRecord changeRecord = new ChangeRecord
                         {
                             RowKey = input.Id,
@@ -90,45 +90,6 @@ namespace TEAMModelFunction
                     }
                     break;
                 case "going":
-                    //ActivityData data;
-                    //if (info.scope == "school")
-                    //{
-                    //    data = new ActivityData
-                    //    {
-                    //        id = info.id,
-                    //        code = $"Activity-{info.school}",
-                    //        type = "exam",
-                    //        name = info.name,
-                    //        startTime = info.startTime,
-                    //        endTime = info.endTime,
-                    //        scode = info.code,
-                    //        scope = info.scope,
-                    //        classes = info.classes.IsNotEmpty() ? info.classes : new List<string> { "" },
-                    //        tmdids =  new List<string> { "" },
-                    //        progress = "going",
-                    //        subjects = sub
-                    //    };
-                    //    await client.GetContainer("TEAMModelOS", "School").UpsertItemAsync<ActivityData>(data, new Azure.Cosmos.PartitionKey(data.code));
-                    //}
-                    //else if (info.scope == "private")
-                    //{
-                    //    data = new ActivityData
-                    //    {
-                    //        id = info.id,
-                    //        code = $"Activity-Common",
-                    //        type = "exam",
-                    //        name = info.name,
-                    //        startTime = info.startTime,
-                    //        endTime = info.endTime,
-                    //        scode = info.code,
-                    //        scope = info.scope,
-                    //        progress = "going",
-                    //        classes = info.classes.IsNotEmpty() ? info.classes : new List<string> { "" },
-                    //        tmdids = new List<string> { "" },
-                    //        subjects = sub
-                    //    };
-                    //    await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync<ActivityData>(data, new Azure.Cosmos.PartitionKey(data.code));
-                    //}
                     (List<string> tmdids, List<Students> studentss) = await TriggerStuActivity.GetStuList(client, info.classes, info.school);
                     List<StuActivity> stuActivities = new List<StuActivity>();
                     List<StuActivity> tmdActivities = new List<StuActivity>();
@@ -150,7 +111,8 @@ namespace TEAMModelFunction
                                 school = info.school,
                                 creatorId = info.creatorId,
                                 subjects = sub,
-                                blob = null
+                                blob = null,
+                                owner = info.owner
 
                             });
                         });
@@ -173,7 +135,8 @@ namespace TEAMModelFunction
                                 school = info.school,
                                 creatorId = info.creatorId,
                                 subjects = sub,
-                                blob = null
+                                blob = null,
+                                owner = info.owner
                             });
                         });
                     }
@@ -182,24 +145,23 @@ namespace TEAMModelFunction
                     #region
                     Notice notice = new Notice()
                     {
-                        sid = info.id,
-                        scode = info.code,
-                        spk = info.pk,
-                        scope = info.scope,
-                        school = info.school,
-                        stime = info.startTime,
-                        etime = info.endTime,
+                        msgId=info.id,
+                        creation = info.startTime,
+                        expire = info.endTime,
                         creatorId = info.creatorId,
                         stuids = studentss,
                         tmdids = tmdids,
-                        type = "exam-join",//评测参加通知
-                        level = 1,
-                        data = new { }.ToJsonString()
+                        type = "notice",//评测参加通知
+                        priority = "normal",
+                        school = info.school,
+                        scope = info.scope,
+                        //data = new { }.ToJsonString()
+                        body = new Body {sid=info.id,scode=info.code,spk=info.pk,biztype= "exam-join" }
 
                     };
                     //var messageBlob = new ServiceBusMessage(notice.ToJsonString());
                     //messageBlob.ApplicationProperties.Add("name", "Notice");
-                    //await _serviceBus.GetServiceBusClient().SendMessageAsync("active-task", messageBlob);
+                    //await _serviceBus.GetServiceBusClient().SendMessageAsync(Environment.GetEnvironmentVariable("Azure:ServiceBus:NoticeTask"), messageBlob);
                     #endregion
                     if (examClassResults.Count == 0)
                     {
@@ -322,15 +284,15 @@ namespace TEAMModelFunction
                         messageEnd.ApplicationProperties.Add("name", "Exam");
                         if (records.Count > 0)
                         {
-                            long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageEnd, DateTimeOffset.FromUnixTimeMilliseconds(etime));
-                            await _serviceBus.GetServiceBusClient().cancelMessage("active-task", records[0].sequenceNumber);
+                            long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), messageEnd, DateTimeOffset.FromUnixTimeMilliseconds(etime));
+                            await _serviceBus.GetServiceBusClient().cancelMessage(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), records[0].sequenceNumber);
                             records[0].sequenceNumber = end;
                             await _azureStorage.SaveOrUpdate<ChangeRecord>(records[0]);
                             //await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(record, record.id, new Azure.Cosmos.PartitionKey($"{record.code}"));
                         }
                         else
                         {
-                            long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageEnd, DateTimeOffset.FromUnixTimeMilliseconds(etime));
+                            long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), messageEnd, DateTimeOffset.FromUnixTimeMilliseconds(etime));
                             ChangeRecord changeRecord = new ChangeRecord
                             {
                                 RowKey = input.Id,
@@ -357,97 +319,95 @@ namespace TEAMModelFunction
                     }
                     break;
                 case "finish":
-                    if (info.papers.Count > 0) {
-                        int fno = 0;
-                        foreach (ExamSubject subject in info.subjects)
-                        {
-                            await createClassResultAsync(info, examClassResults, subject, fno, _azureCosmos, _dingDing, _azureStorage);
-                            fno++;
-                        }
+                    int fno = 0;
+                    foreach (ExamSubject subject in info.subjects)
+                    {
+                        await createClassResultAsync(info, examClassResults, subject, fno, _azureCosmos, _dingDing, _azureStorage);
+                        fno++;
+                    }
 
-                        //计算单次考试简易统计信息
-                        List<ExamResult> examResults = new List<ExamResult>();
-                        await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<ExamResult>(
-                                           queryText: $"select value(c) from c where c.examId  = '{info.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"ExamResult-{info.id}") }))
+                    //计算单次考试简易统计信息
+                    List<ExamResult> examResults = new List<ExamResult>();
+                    await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<ExamResult>(
+                                       queryText: $"select value(c) from c where c.examId  = '{info.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"ExamResult-{info.id}") }))
+                    {
+                        examResults.Add(item);
+                    }
+                    //结算单科单班的标准差和平均分
+                    foreach (ExamClassResult classResult in examClassResults)
+                    {
+                        //标记单科单班总得分
+                        double subScore = 0;
+                        //标准差
+                        double sPowSum = 0;
+                        var scount = classResult.studentIds.Count;
+                        foreach (List<double> sc in classResult.studentScores)
                         {
-                            examResults.Add(item);
+                            subScore += sc.Sum();
                         }
-                        //结算单科单班的标准差和平均分
-                        foreach (ExamClassResult classResult in examClassResults)
+                        foreach (string sid in classResult.studentIds)
                         {
-                            //标记单科单班总得分
-                            double subScore = 0;
-                            //标准差
-                            double sPowSum = 0;
-                            var scount = classResult.studentIds.Count;
-                            foreach (List<double> sc in classResult.studentScores)
-                            {
-                                subScore += sc.Sum();
-                            }
-                            foreach (string sid in classResult.studentIds)
-                            {
-                                double ssc = classResult.studentScores[classResult.studentIds.IndexOf(sid)].Sum();
-                                sPowSum += Math.Pow(ssc - scount > 0 ? Math.Round(subScore * 1.0 / scount, 2) : 0, 2);
+                            double ssc = classResult.studentScores[classResult.studentIds.IndexOf(sid)].Sum();
+                            sPowSum += Math.Pow(ssc - scount > 0 ? Math.Round(subScore * 1.0 / scount, 2) : 0, 2);
 
-                            }
-                            classResult.standard = Math.Round(scount > 0 ? Math.Pow(sPowSum / scount, 0.5) : 0, 2);
-                            classResult.average = scount > 0 ? Math.Round(subScore / scount, 2) : 0;
-                            await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(classResult, classResult.id, new Azure.Cosmos.PartitionKey($"{classResult.code}"));
                         }
-                        //记录某次考试所有学生得分总分
-                        double score = 0;
-                        double allScore = 0;
-                        int stuCount = 0;
-                        //整体平均分
-                        double average = 0;
-                        //标准差
-                        double powSum = 0;
-                        List<string> losStu = new List<string>();
-                        //先与第一个值取并集
-                        if (examResults.Count > 0)
+                        classResult.standard = Math.Round(scount > 0 ? Math.Pow(sPowSum / scount, 0.5) : 0, 2);
+                        classResult.average = scount > 0 ? Math.Round(subScore / scount, 2) : 0;
+                        await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(classResult, classResult.id, new Azure.Cosmos.PartitionKey($"{classResult.code}"));
+                    }
+                    //记录某次考试所有学生得分总分
+                    double score = 0;
+                    double allScore = 0;
+                    int stuCount = 0;
+                    //整体平均分
+                    double average = 0;
+                    //标准差
+                    double powSum = 0;
+                    List<string> losStu = new List<string>();
+                    //先与第一个值取并集
+                    if (examResults.Count > 0)
+                    {
+                        losStu.Union(examResults[0].lostStus);
+                        foreach (ExamResult examResult in examResults)
                         {
-                            losStu.Union(examResults[0].lostStus);
-                            foreach (ExamResult examResult in examResults)
+                            if (info.id == examResult.examId)
                             {
-                                if (info.id == examResult.examId)
+                                foreach (List<double> sc in examResult.studentScores)
                                 {
-                                    foreach (List<double> sc in examResult.studentScores)
-                                    {
-                                        score += sc.Sum();
-                                    }
-                                    stuCount = examResult.studentIds.Count;
+                                    score += sc.Sum();
                                 }
-                                //powSum += Math.Pow(score - examResult.studentIds.Count > 0 ? Math.Round(score * 1.0 / examResult.studentIds.Count, 2) : 0, 2);
-                                //取交集
-                                losStu = losStu.Intersect(examResult.lostStus).ToList();
+                                stuCount = examResult.studentIds.Count;
                             }
+                            //powSum += Math.Pow(score - examResult.studentIds.Count > 0 ? Math.Round(score * 1.0 / examResult.studentIds.Count, 2) : 0, 2);
+                            //取交集
+                            losStu = losStu.Intersect(examResult.lostStus).ToList();
                         }
-                        double NewsRateScore = stuCount > 0 ? Math.Round(score * 1.0 / stuCount, 2) : 0;
-                        foreach (PaperSimple simple in info.papers)
-                        {
-                            allScore += simple.point.Sum();
-                        }
-                        //计算全科标准差
-                        foreach (string id in examResults[0].studentIds)
-                        {
-                            double sc = 0;
-                            foreach (ExamResult result in examResults)
-                            {
-                                sc += result.studentScores[result.studentIds.IndexOf(id)].Sum();
-                            }
-                            powSum += Math.Pow(sc - NewsRateScore, 2);
-                        }
-                        info.standard = Math.Round(examResults[0].studentIds.Count > 0 ? Math.Pow(powSum / examResults[0].studentIds.Count, 0.5) : 0, 2);
-                        double NewsRate = allScore > 0 ? Math.Round(NewsRateScore / allScore * 100, 2) : 0;
-                        info.lostStu = losStu;
-                        //判断均分是否发生变化,便于实时的更新评测基本信息
-                        if (info.sRate != NewsRate || info.average != NewsRateScore)
+                    }
+                    double NewsRateScore = stuCount > 0 ? Math.Round(score * 1.0 / stuCount, 2) : 0;
+                    foreach (PaperSimple simple in info.papers)
+                    {
+                        allScore += simple.point.Sum();
+                    }
+                    //计算全科标准差
+                    foreach (string id in examResults[0].studentIds)
+                    {
+                        double sc = 0;
+                        foreach (ExamResult result in examResults)
                         {
-                            info.sRate = NewsRate;
-                            info.average = NewsRateScore;
-                            await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync<ExamInfo>(info, info.id, new Azure.Cosmos.PartitionKey(info.code));
+                            sc += result.studentScores[result.studentIds.IndexOf(id)].Sum();
                         }
-                    }                    
+                        powSum += Math.Pow(sc - NewsRateScore, 2);
+                    }
+                    info.standard = Math.Round(examResults[0].studentIds.Count > 0 ? Math.Pow(powSum / examResults[0].studentIds.Count, 0.5) : 0, 2);
+                    double NewsRate = allScore > 0 ? Math.Round(NewsRateScore / allScore * 100, 2) : 0;
+                    info.lostStu = losStu;
+                    //判断均分是否发生变化,便于实时的更新评测基本信息
+                    if (info.sRate != NewsRate || info.average != NewsRateScore)
+                    {
+                        info.sRate = NewsRate;
+                        info.average = NewsRateScore;
+                        await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync<ExamInfo>(info, info.id, new Azure.Cosmos.PartitionKey(info.code));
+                    }
                     break;
             }
         }

+ 30 - 32
TEAMModelFunction/TriggerSurvey.cs

@@ -41,19 +41,6 @@ namespace TEAMModelFunction
                 adcode = $"Activity-{tdata.creatorId}";
                  blobcntr = tdata.creatorId;
             }
-            //ActivityData data = null;
-            //try
-            //{
-            //    if (tdata.scope == "school")
-            //    {
-            //        data = await client.GetContainer("TEAMModelOS", "School").ReadItemAsync<ActivityData>(adid, new Azure.Cosmos.PartitionKey($"{adcode}"));
-            //    }
-            //    else if (tdata.scope == "private")
-            //    {
-            //        data = await client.GetContainer("TEAMModelOS", "Teacher").ReadItemAsync<ActivityData>(adid, new Azure.Cosmos.PartitionKey($"{adcode}"));
-            //    }
-            //}
-            //catch { data = null; }
             Survey survey = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Survey>(input.Id, new Azure.Cosmos.PartitionKey($"{tdata.code}"));
             List<ChangeRecord> changeRecords = await _azureStorage.FindListByDict<ChangeRecord>(new Dictionary<string, object>() { { "RowKey", input.Id }, { "PartitionKey", survey.progress } });
             if (survey != null) {
@@ -64,14 +51,14 @@ namespace TEAMModelFunction
                         messageSurvey.ApplicationProperties.Add("name", "Survey");
                         if (changeRecords.Count > 0)
                         {
-                            await _serviceBus.GetServiceBusClient().cancelMessage("active-task", changeRecords[0].sequenceNumber);
-                            long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageSurvey, DateTimeOffset.FromUnixTimeMilliseconds(tdata.stime));
+                            await _serviceBus.GetServiceBusClient().cancelMessage(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), changeRecords[0].sequenceNumber);
+                            long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), messageSurvey, DateTimeOffset.FromUnixTimeMilliseconds(tdata.stime));
                             changeRecords[0].sequenceNumber = start;
                             await _azureStorage.SaveOrUpdate<ChangeRecord>(changeRecords[0]);
                         }
                         else
                         {
-                            long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageSurvey, DateTimeOffset.FromUnixTimeMilliseconds(tdata.stime));
+                            long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), messageSurvey, DateTimeOffset.FromUnixTimeMilliseconds(tdata.stime));
                             ChangeRecord changeRecord = new ChangeRecord
                             {
                                 RowKey = input.Id,
@@ -84,7 +71,9 @@ namespace TEAMModelFunction
                         break;
                     case "going":
                         (List<string> tmdids,List<Students> students) =   await TriggerStuActivity. GetStuList(client, survey.classes, survey.school);
+#if DEBUG
                         await _dingDing.SendBotMsg($"问卷调查{tdata.id}写入学生表作为活动列表!", GroupNames.成都开发測試群組);
+#endif
                         List<StuActivity> stuActivities = new List<StuActivity>();
                         List<StuActivity> tmdActivities = new List<StuActivity>();
                         if (tmdids.IsNotEmpty()) {
@@ -103,7 +92,8 @@ namespace TEAMModelFunction
                                     school = survey.school,
                                     creatorId = survey.creatorId,
                                     subjects = new List<string> { "" },
-                                    blob = survey.blob
+                                    blob = survey.blob,
+                                    owner = survey.owner
 
                                 });
                             });
@@ -123,7 +113,8 @@ namespace TEAMModelFunction
                                     school = survey.school,
                                     creatorId = survey.creatorId,
                                     subjects = new List<string> { "" },
-                                    blob = survey.blob
+                                    blob = survey.blob,
+                                    owner = survey.owner
                                 });
                             });
                         }
@@ -132,38 +123,39 @@ namespace TEAMModelFunction
                         #region
                         Notice notice = new Notice()
                         {
-                            sid = survey.id,
-                            scode = survey.code,
-                            spk = survey.pk,
-                            scope = survey.scope,
-                            school = survey.school,
-                            stime = survey.startTime,
-                            etime = survey.endTime,
+                            creation = survey.startTime,
+                            expire = survey.endTime,
                             creatorId = survey.creatorId,
                             stuids = students,
                             tmdids = tmdids,
-                            type = "survey-join",//问卷参加参加通知
-                            level = 1,
-                            data = new { }.ToJsonString()
+                            type = "notice",//问卷参加参加通知
+                            priority = "normal",
+                            //data = new { }.ToJsonString()
+                            msgId = survey.id,
+                            school = survey.school,
+                            scope = survey.scope,
+                            body = new Body { sid = survey.id, scode = survey.code, spk = survey.pk,  biztype = "survey-join" }
 
                         };
                         //var messageBlob = new ServiceBusMessage(notice.ToJsonString());
                         //messageBlob.ApplicationProperties.Add("name", "Notice");
-                        //await _serviceBus.GetServiceBusClient().SendMessageAsync("active-task", messageBlob);
+                        //await _serviceBus.GetServiceBusClient().SendMessageAsync(Environment.GetEnvironmentVariable("Azure:ServiceBus:NoticeTask"), messageBlob);
                         #endregion
+#if DEBUG
                         await _dingDing.SendBotMsg($"问卷调查{tdata.id}写入完成!", GroupNames.成都开发測試群組);
+#endif
                         var messageSurveyEnd = new ServiceBusMessage(new { id = input.Id, progress = "finish", code = tdata.code }.ToJsonString());
                         messageSurveyEnd.ApplicationProperties.Add("name", "Survey");
                         if (changeRecords.Count > 0)
                         {
-                            long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageSurveyEnd, DateTimeOffset.FromUnixTimeMilliseconds(tdata.etime));
-                            await _serviceBus.GetServiceBusClient().cancelMessage("active-task", changeRecords[0].sequenceNumber);
+                            long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), messageSurveyEnd, DateTimeOffset.FromUnixTimeMilliseconds(tdata.etime));
+                            await _serviceBus.GetServiceBusClient().cancelMessage(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), changeRecords[0].sequenceNumber);
                             changeRecords[0].sequenceNumber = end;
                             await _azureStorage.SaveOrUpdate<ChangeRecord>(changeRecords[0]);
                         }
                         else
                         {
-                            long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageSurveyEnd, DateTimeOffset.FromUnixTimeMilliseconds(tdata.etime));
+                            long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), messageSurveyEnd, DateTimeOffset.FromUnixTimeMilliseconds(tdata.etime));
                             ChangeRecord changeRecord = new ChangeRecord
                             {
                                 RowKey = input.Id,
@@ -173,10 +165,14 @@ namespace TEAMModelFunction
                             };
                             await _azureStorage.Save<ChangeRecord>(changeRecord);
                         }
+#if DEBUG
                         await _dingDing.SendBotMsg($"问卷调查{tdata.id}将于:{tdata.etime}完成并结算!", GroupNames.成都开发測試群組);
+#endif
                         break;
                     case "finish":
+#if DEBUG
                         await _dingDing.SendBotMsg($"问卷调查{tdata.id}开始结算{tdata.etime}!", GroupNames.成都开发測試群組);
+#endif
                         var records = await _azureRedis.GetRedisClient(8).HashGetAllAsync($"Survey:Record:{survey.id}");
                         var submits = await _azureRedis.GetRedisClient(8).SetMembersAsync($"Survey:Submit:{survey.id}");
                         List<dynamic> recs = new List<dynamic>();
@@ -208,7 +204,9 @@ namespace TEAMModelFunction
                                 var Record = json.RootElement.ToObject<SurveyRecord>();
                                 surveyRecords.Add(Record);
                             }
+#if DEBUG
                             await _dingDing.SendBotMsg($"问卷调查问题结算数据{surveyRecords.ToJsonString()}", GroupNames.成都开发測試群組);
+#endif
                             for (int index = 0; index < survey.answers.Count; index++)
                             {
                                 string url = $"{survey.id}/qrecord/{index}.json";

+ 33 - 52
TEAMModelFunction/TriggerVote.cs

@@ -20,7 +20,7 @@ namespace TEAMModelFunction
     public static class TriggerVote
     {
 
-        public static async void Trigger(AzureServiceBusFactory _serviceBus, AzureStorageFactory _azureStorage, DingDing _dingDing,
+        public static async void Trigger( AzureServiceBusFactory _serviceBus, AzureStorageFactory _azureStorage, DingDing _dingDing,
             CosmosClient client, Document input, TriggerData tdata, AzureRedisFactory _azureRedis)
         {
             if ((tdata.status != null && tdata.status.Value == 404)||tdata.ttl>0)
@@ -40,23 +40,9 @@ namespace TEAMModelFunction
                 adcode = $"Activity-{tdata.creatorId}";
                 blobcntr = tdata.creatorId;
             }
-           // ActivityData data = null;
-            //try
-            //{
-            //    if (tdata.scope == "school")
-            //    {
-            //        data = await client.GetContainer("TEAMModelOS", "School").ReadItemAsync<ActivityData>(adid, new Azure.Cosmos.PartitionKey($"{adcode}"));
-            //    }
-            //    else if (tdata.scope == "private")
-            //    {
-            //        data = await client.GetContainer("TEAMModelOS", "Teacher").ReadItemAsync<ActivityData>(adid, new Azure.Cosmos.PartitionKey($"{adcode}"));
-            //    }
-            //}
-            //catch
-            //{
-            //    data = null;
-            //}
+#if DEBUG
             await _dingDing.SendBotMsg($"投票活动【{tdata.name}-{tdata.id}-ttl={tdata.ttl}】正在操作", GroupNames.成都开发測試群組);
+#endif
             Vote vote = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Vote>(input.Id, new Azure.Cosmos.PartitionKey($"{tdata.code}"));
             List<ChangeRecord> voteRecords = await _azureStorage.FindListByDict<ChangeRecord>(new Dictionary<string, object>() { { "RowKey", input.Id }, { "PartitionKey", vote.progress } });
             if (vote != null) {
@@ -67,14 +53,14 @@ namespace TEAMModelFunction
                         messageVote.ApplicationProperties.Add("name", "Vote");
                         if (voteRecords.Count > 0)
                         {
-                            long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageVote, DateTimeOffset.FromUnixTimeMilliseconds(tdata.stime));
-                            await _serviceBus.GetServiceBusClient().cancelMessage("active-task", voteRecords[0].sequenceNumber);
+                            long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), messageVote, DateTimeOffset.FromUnixTimeMilliseconds(tdata.stime));
+                            await _serviceBus.GetServiceBusClient().cancelMessage(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), voteRecords[0].sequenceNumber);
                             voteRecords[0].sequenceNumber = start;
                             await _azureStorage.SaveOrUpdate<ChangeRecord>(voteRecords[0]);
                         }
                         else
                         {
-                            long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageVote, DateTimeOffset.FromUnixTimeMilliseconds(tdata.stime));
+                            long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), messageVote, DateTimeOffset.FromUnixTimeMilliseconds(tdata.stime));
                             ChangeRecord changeRecord = new ChangeRecord
                             {
                                 RowKey = input.Id,
@@ -111,7 +97,8 @@ namespace TEAMModelFunction
                                     school = vote.school,
                                     creatorId = vote.creatorId,
                                     subjects = new List<string> { "" } ,
-                                    blob = null
+                                    blob = null,
+                                    owner=vote.owner
                                 });
                             });
                         }
@@ -132,46 +119,48 @@ namespace TEAMModelFunction
                                     school = vote.school,
                                     creatorId = vote.creatorId,
                                     subjects = new List<string> { "" },
-                                    blob=null
+                                    blob=null,
+                                    owner = vote.owner
                                 });
                             });
                         }
                         await TriggerStuActivity.SaveStuActivity(client, stuActivities, tmdActivities);
                         //向学生或醍摩豆账号发起通知
                         #region
-                        Notice notice =   new Notice()
+                        Notice notice = new Notice()
                         {
-                            sid=vote.id,
-                            scode=vote.code,
-                            spk=vote.pk,
-                            scope=vote.scope,
-                            school=vote.school,
-                            stime=vote.startTime,
-                            etime=vote.endTime,
-                            creatorId=vote.creatorId,
-                            stuids=students,
-                            tmdids=tmdids,
-                            type="vote-join",//投票参加通知
-                            level=1,
-                            data=new { }.ToJsonString()
+                           
+                            creation = vote.startTime,
+                            expire = vote.endTime,
+                            creatorId = vote.creatorId,
+                            stuids = students,
+                            tmdids = tmdids,
+                            type = "notice",//问卷参加参加通知
+                            priority = "normal",
+                            msgId=vote.id,
+                            school = vote.school,
+                            scope = vote.scope,
+                            //data = new { }.ToJsonString()
+                            body = new Body { sid = vote.id, scode = vote.code, spk = vote.pk,  biztype = "vote-join" }
 
                         };
+
                         //var messageBlob = new ServiceBusMessage(notice.ToJsonString());
                         //messageBlob.ApplicationProperties.Add("name", "Notice");
-                        //await _serviceBus.GetServiceBusClient().SendMessageAsync("active-task", messageBlob);
+                        //await _serviceBus.GetServiceBusClient().SendMessageAsync(Environment.GetEnvironmentVariable("Azure:ServiceBus:NoticeTask"), messageBlob);
                         #endregion
                         var messageVoteEnd = new ServiceBusMessage(new { id = input.Id, progress = "finish", code = tdata.code }.ToJsonString());
                         messageVoteEnd.ApplicationProperties.Add("name", "Vote");
                         if (voteRecords.Count > 0)
                         {
-                            long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageVoteEnd, DateTimeOffset.FromUnixTimeMilliseconds(tdata.etime));
-                            await _serviceBus.GetServiceBusClient().cancelMessage("active-task", voteRecords[0].sequenceNumber);
+                            long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), messageVoteEnd, DateTimeOffset.FromUnixTimeMilliseconds(tdata.etime));
+                            await _serviceBus.GetServiceBusClient().cancelMessage(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), voteRecords[0].sequenceNumber);
                             voteRecords[0].sequenceNumber = end;
                             await _azureStorage.SaveOrUpdate<ChangeRecord>(voteRecords[0]);
                         }
                         else
                         {
-                            long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageVoteEnd, DateTimeOffset.FromUnixTimeMilliseconds(tdata.etime));
+                            long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), messageVoteEnd, DateTimeOffset.FromUnixTimeMilliseconds(tdata.etime));
                             ChangeRecord changeRecord = new ChangeRecord
                             {
                                 RowKey = input.Id,
@@ -181,10 +170,14 @@ namespace TEAMModelFunction
                             };
                             await _azureStorage.Save<ChangeRecord>(changeRecord);
                         }
+#if DEBUG
                         await _dingDing.SendBotMsg($"投票活动{tdata.id}将于:{tdata.etime}完成并结算!", GroupNames.成都开发測試群組);
+#endif
                         break;
                     case "finish":
+#if DEBUG
                         await _dingDing.SendBotMsg($"投票活动{tdata.id}开始结算{tdata.etime}!", GroupNames.成都开发測試群組);
+#endif
                         //获取投票活动的所有投票记录
                         var records = await _azureRedis.GetRedisClient(8).HashGetAllAsync($"Vote:Record:{vote.id}");
                         //获取投票活动的选项及投票数
@@ -227,18 +220,6 @@ namespace TEAMModelFunction
                             break; 
                         }
                         await Task.WhenAll(tasks);
-                        //data.progress = "finish";
-                        //更新结束状态
-                        //if (vote.scope == "school")
-                        //{
-                        //    await client.GetContainer("TEAMModelOS", "School").ReplaceItemAsync<ActivityData>(data, data.id, new Azure.Cosmos.PartitionKey(data.code));
-                        //}
-                        //else if (vote.scope == "private")
-                        //{
-                        //    await client.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<ActivityData>(data, data.id, new Azure.Cosmos.PartitionKey(data.code));
-                        //}
-                        //_azureRedis.GetRedisClient(8).KeyDelete($"Vote:Record:{vote.id}");
-                        //_azureRedis.GetRedisClient(8).KeyDelete($"Vote:Count:{vote.id}");
                         break;
                 }
             }

+ 9 - 5
TEAMModelFunction/local.settings.json

@@ -4,10 +4,14 @@
     "AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName=teammodellog;AccountKey=lxVDrgs+6rKtmASL3k1WrarrEd5Rk42wS1Mu5+sqQlPya1JLSlFDtnZUvMPeHHe7zlESfn/1NY7CZdGviy2UCw==;EndpointSuffix=core.chinacloudapi.cn",
     "Azure:Storage:ConnectionString": "DefaultEndpointsProtocol=https;AccountName=teammodelstorage;AccountKey=Yq7D4dE6cFuer2d2UZIccTA/i0c3sJ/6ITc8tNOyW+K5f+/lWw9GCos3Mxhj47PyWQgDL8YbVD63B9XcGtrMxQ==;EndpointSuffix=core.chinacloudapi.cn",
     "Azure:ServiceBus:ConnectionString": "Endpoint=sb://teammodelos.servicebus.chinacloudapi.cn/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=Sy4h4EQ8zP+7w/lOLi1X3tGord/7ShFHimHs1vC50Dc=",
-    "Azure:Cosmos:ConnectionString": "AccountEndpoint=https://teammodelos.documents.azure.cn:443/;AccountKey=clF73GwPECfP1lKZTCvs8gLMMyCZig1HODFbhDUsarsAURO7TcOjVz6ZFfPqr1HzYrfjCXpMuVD5TlEG5bFGGg==;",
-    "Azure:Redis:ConnectionString": "CoreRedisCN.redis.cache.chinacloudapi.cn:6380,password=LyJWP1ORJdv+poXWofAF97lhCEQPg1wXWqvtzXGXQuE=,ssl=True,abortConnect=False",
-    "FUNCTIONS_WORKER_RUNTIME": "dotnet",
-    "ScanModel": "TEAMModelOS",
-    "Database": "TEAMModelOS"
+    //"Azure:Cosmos:ConnectionString": "AccountEndpoint=https://teammodelos.documents.azure.cn:443/;AccountKey=clF73GwPECfP1lKZTCvs8gLMMyCZig1HODFbhDUsarsAURO7TcOjVz6ZFfPqr1HzYrfjCXpMuVD5TlEG5bFGGg==;",
+    //"Azure:Redis:ConnectionString": "CoreRedisCN.redis.cache.chinacloudapi.cn:6380,password=LyJWP1ORJdv+poXWofAF97lhCEQPg1wXWqvtzXGXQuE=,ssl=True,abortConnect=False",
+    //"Azure:ServiceBus:ActiveTask": "active-task",
+    //"Azure:ServiceBus:NoticeTask": "notice-task",
+    "Azure:Cosmos:ConnectionString": "AccountEndpoint=https://cdhabookdep-free.documents.azure.cn:443/;AccountKey=JTUVk92Gjsx17L0xqxn0X4wX2thDPMKiw4daeTyV1HzPb6JmBeHdtFY1MF1jdctW1ofgzqkDMFOtcqS46by31A==;",
+    "Azure:Redis:ConnectionString": "106.12.23.251:6379,password=habook,ssl=false,abortConnect=False,writeBuffer=10240",
+    "Azure:ServiceBus:ActiveTask": "dep-active-task",
+    "Azure:ServiceBus:NoticeTask": "dep-notice-task",
+    "FUNCTIONS_WORKER_RUNTIME": "dotnet"
   }  
 }

+ 0 - 31
TEAMModelOS.SDK/Context/Constant/Constants.cs

@@ -1,31 +0,0 @@
-
-namespace TEAMModelOS.SDK.Context.Constant.Common
-{
-    public static class Constants
-    {
-        /// <summary>
-        /// access_token
-        /// </summary>
-		public static readonly string ACCESS_TOKEN = "access_token";
-        /// <summary>
-        /// 引用页
-        /// </summary>
-		public static readonly string REFERER = "referer";
-        /// <summary>
-        /// token 请求头
-        /// </summary>
-		public static readonly string AUTHORIZATION = "Authorization";
-        /// <summary>
-        /// josn格式
-        /// </summary>
-		public static readonly string CONTENT_TYPE_JSON = "application/json";
-        /// <summary>
-        /// 主题
-        /// </summary>
-        public static readonly string TopicName = "active-task";
-        /// <summary>
-        /// 订阅
-        /// </summary>
-        public static readonly string SubName = "active-recive-task";
-    }
-}

+ 48 - 30
TEAMModelOS.SDK/Models/Cosmos/Common/Notice.cs

@@ -40,52 +40,43 @@ namespace TEAMModelOS.SDK.Models
     /// </summary>
     public class Notice
     {
-
         /// <summary>
-        /// 源数据的id
+        /// 消息id 
         /// </summary>
-        public string sid { get; set; }
+        public string msgId { get; set; }
         /// <summary>
-        /// 源数据的code
+        /// 發信源服務  IES5
         /// </summary>
-        public string scode { get; set; }
+        public string from { get; set; } = "IES5";
         /// <summary>
-        /// 源数据的pk
-        /// </summary>
-        public string spk { get; set; }
-        /// <summary>
-        /// 源数据的学校编码
-        /// </summary>
-        public string school { get; set; }
-        /// <summary>
-        /// 源数据的scope
-        /// </summary>
-        public string scope { get; set; }
-        /// <summary>
-        /// 通知的业务类型,做什么事情用,具体业务类型再定义。 vote-join 
+        ///  訊息種類 message:訊息,收取會另存至儲存體(blob or table) notice:通知,收取後不另存 
+       /// XXXX通知的业务类型,做什么事情用,具体业务类型再定义。 vote-join 
         /// </summary>
         public string type { get; set; }
         /// <summary>
-        /// 重要等级1置顶,2非常重要,3重要,4普通消息,5不重要
-        /// </summary>
-        public int level { get; set; }
-        /// <summary>
-        /// 传输数据josn
+        /// 重要等级 emergency、high、normal、low 1置顶,2非常重要,3重要,4普通消息,5不重要
         /// </summary>
-        public string data { get; set; }
+        public string priority { get; set; }
         /// <summary>
         /// 创建时间
         /// </summary>
-        public long stime { get; set; }
+        public long creation { get; set; }
         /// <summary>
         /// 到期时间,发给接收者的cosmosDB ttl是从当前时间到结束时间为止
         /// </summary>
-        public long etime { get; set; }
+        public long expire { get; set; }
         /// <summary>
         /// 创建者
         /// </summary>
         public string creatorId { get; set; }
-
+        /// <summary>
+        /// 源数据的学校编码
+        /// </summary>
+        public string school { get; set; }
+        /// <summary>
+        /// 源数据的scope
+        /// </summary>
+        public string scope { get; set; }
         /// 通知主体的被通知人存放位置:  /notice/{业务id}_receiver.json
         /// <summary>
         /// 被通知的醍摩豆账号
@@ -95,9 +86,35 @@ namespace TEAMModelOS.SDK.Models
         /// 被通知的学校学生账号
         /// </summary>
         public List<Students> stuids { get; set; }
+        public  int ttl { get; set;  }
+        /// <summary>
+        /// 正文內容
+        /// </summary>
+        public Body body { get; set; }
     }
 
-
+    /// <summary>
+    /// 传输数据josn
+    /// </summary>
+    public class Body {
+        /// <summary>
+        /// 业务类型  vote-join  exam-join  survey-join
+        /// </summary>
+        public string biztype { get; set; }
+        /// <summary>
+        /// 源数据的id
+        /// </summary>
+        public string sid { get; set; }
+        /// <summary>
+        /// 源数据的code
+        /// </summary>
+        public string scode { get; set; }
+        /// <summary>
+        /// 源数据的pk
+        /// </summary>
+        public string spk { get; set; }
+      
+    }
     /*
     {
         "id":"通知id"
@@ -114,8 +131,9 @@ namespace TEAMModelOS.SDK.Models
     /// pk  :Receiver
     /// </summary>
     /// /student/{stuid}/
-    public class Receiver : CosmosEntity
+    public class Receiver  
     {
+        public string id { get; set; }
         public string pk { get; set; } = "Receiver";
         /// <summary>
         /// 0 已发送,1已查看,2已处理,-1已过期
@@ -128,7 +146,7 @@ namespace TEAMModelOS.SDK.Models
         /// <summary>
         /// 当rid是学校的学生时,学校编码不能为空
         /// </summary>
-        public string school { get; set; }
+        ///public string school { get; set; }
         /// <summary>
         /// 源数据的scope   school则接收者是学校的学生/teacher接收者是醍摩豆账号
         /// </summary>

+ 8 - 1
TEAMModelOS.SDK/Models/Cosmos/Common/StuActivity.cs

@@ -38,7 +38,13 @@ namespace TEAMModelOS.SDK.Models.Cosmos.Common
     /// </summary>
     public class StuActivity : CosmosEntity
     {
-       
+        /// <summary>
+        /// 源数据的发布层级 类型 school  teacher
+        /// </summary>
+        public string owner { get; set; }
+        /// <summary>
+        /// 源数据的 code
+        /// </summary>
         public string scode { get; set; }
         public string type { get; set; }
         public string name { get; set; }
@@ -50,5 +56,6 @@ namespace TEAMModelOS.SDK.Models.Cosmos.Common
         public List<string> subjects { get; set; }
         public string blob { get; set; }
         public string recordUrl { get; set; }
+        
     }
 }

BIN
TEAMModelOS/ClientApp/src/assets/mark/0.jpg


BIN
TEAMModelOS/ClientApp/src/assets/mark/1.jpg


BIN
TEAMModelOS/ClientApp/src/assets/mark/2.jpg


BIN
TEAMModelOS/ClientApp/src/assets/mark/3.jpg


BIN
TEAMModelOS/ClientApp/src/assets/mark/4.jpg


BIN
TEAMModelOS/ClientApp/src/assets/mark/5.jpg


BIN
TEAMModelOS/ClientApp/src/assets/mark/6.jpg


BIN
TEAMModelOS/ClientApp/src/assets/mark/7.jpg


BIN
TEAMModelOS/ClientApp/src/assets/mark/8.jpg


BIN
TEAMModelOS/ClientApp/src/assets/mark/img0.jpg


BIN
TEAMModelOS/ClientApp/src/assets/mark/img1.jpg


BIN
TEAMModelOS/ClientApp/src/assets/mark/img2.jpg


BIN
TEAMModelOS/ClientApp/src/assets/mark/tmd-logo.png


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 0
TEAMModelOS/ClientApp/src/assets/student-web/icons/svg/shaixuan.svg


+ 3 - 5
TEAMModelOS/ClientApp/src/components/student-analysis/total/BaseKnowledgeRadar.vue

@@ -32,8 +32,6 @@
                         }
                     },
 					gird:{
-						height:420,
-						bottom:'10%'
 					},
                     radar: {
                         triggerEvent: true,
@@ -45,7 +43,7 @@
                                 padding: [13, 15]
                             }
                         },
-                        center: ['45%', '60%'],
+                        center: ['45%', '50%'],
                         indicator: indicator,
                         splitArea: {
                             areaStyle: {
@@ -161,8 +159,8 @@
 
     .myRadar {
         width: 100%;
-        height: 450px;
-        margin: 30px auto 0 auto;
+        height: 420px;
+        margin: 50px auto 0 auto;
         display: block;
     }
 </style>

+ 3 - 2
TEAMModelOS/ClientApp/src/components/student-analysis/total/BaseScoreRateBar.vue

@@ -195,12 +195,13 @@
 
 			/* 根据学生总体数据来换取得分率区间分布数据 */
 			doRender(list,isAll) {
-				let sRateArr = isAll ? list.map(i => i.sRate * 100) : list.map(i => i.subjects[this.subjectIndex].sRate * 100)
+				let sRateArr = isAll ? list.map(i => i.sRate) : list.map(i => i.subjects[this.subjectIndex].sRate)
 				let splitArr = [...new Array(10).keys()]
 				let result = new Array(10).fill(0)
+				console.log(sRateArr)
 				sRateArr.forEach(rate => {
 					splitArr.forEach((j, index) => {
-						if(rate.toString().length === 3){
+						if(rate === 100){
 							result[9]++
 						}else if(rate.toString().slice(0, 1) === j.toString()) {
 							result[index]++

+ 4 - 2
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTestReport.vue

@@ -441,12 +441,14 @@
             },
             //处理学生作答数据blob地址
             formUrl(data) { 
-                let container = data.code
+                console.log(data)
+                console.log(this.$store.getters.getItemTitle)
                 let a = ""
                 if (data.blob.indexOf('https://teammodelstorage') > -1) {
                     a = data.blob
                 } else {
-                    a = `${this.$GLOBAL.BLOB_URL}/${container}/exam/${data.blob}`
+                    let url = data.scope == 'school' ? JSON.parse(decodeURIComponent(localStorage.student_profile, "utf-8")).blob_uri : JSON.parse(decodeURIComponent(localStorage.user_profile, "utf-8")).blob_uri
+                    a = `${url}/exam/${data.blob}`
                 }
                 return a 
             },

+ 9 - 10
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventList.vue

@@ -67,14 +67,14 @@
                         <li class="list-item-icon">
                             <svg-icon v-if="item.eventType == 'HomeWork'" icon-class="doc" />
                             <svg-icon v-if="item.eventType == 'Preview'"  icon-class="selflearninginTime" />
-                            <svg-icon v-if="item.eventType == 'Exam'"     icon-class="multiTest" />
-                            <svg-icon v-if="item.eventType == 'Vote'"     icon-class="vote" />
-                            <svg-icon v-if="item.eventType == 'Survey'"   icon-class="quesnaire" />
+                            <svg-icon v-if="item.eventType == 'Exam'||item.eventType == 'exam'" icon-class="multiTest" />
+                            <svg-icon v-if="item.eventType == 'Vote'||item.eventType == 'vote'" icon-class="vote" />
+                            <svg-icon v-if="item.eventType == 'Survey'||item.eventType == 'survey'" icon-class="quesnaire" />
                         </li>
                         <li class="list-item-info"
-                            v-if="item.eventType == 'Exam'">
+                            v-if="item.eventType == 'Exam'||item.eventType == 'exam'">
                             <p class="list-item-title">
-                                <span class="list-item-typeMark">{{item.scope == 'school' ? $t('studentWeb.public.schoolExam'):$t('studentWeb.public.privateExam')}}</span>
+                                <span class="list-item-typeMark">{{item.owner == 'school' ? $t('studentWeb.public.schoolExam'):$t('studentWeb.public.privateExam')}}</span>
                                 <span>{{ item.name }}</span>
                             </p>
                             <p class="list-item-time">
@@ -82,9 +82,9 @@
                             </p>
                         </li>             
                         <li class="list-item-info"
-                            v-if="item.eventType == 'Vote'">
+                            v-if="item.eventType == 'Vote'||item.eventType == 'vote'">
                             <p class="list-item-title">
-                                <span class="list-item-typeMark">{{item.scope == 'school' ? $t('studentWeb.public.schoolVote'):$t('studentWeb.public.privateVote')}}</span>
+                                <span class="list-item-typeMark">{{item.owner == 'school' ? $t('studentWeb.public.schoolVote'):$t('studentWeb.public.privateVote')}}</span>
                                 <span>{{ item.name }}</span>
                             </p>
                             <p class="list-item-time">
@@ -92,9 +92,9 @@
                             </p>
                         </li>       
                         <li class="list-item-info"
-                            v-if="item.eventType == 'Survey'">
+                            v-if="item.eventType == 'Survey'||item.eventType == 'survey'">
                             <p class="list-item-title">
-                                <span class="list-item-typeMark">{{item.scope == 'school' ? $t('studentWeb.public.schoolSurvey'):$t('studentWeb.public.privateSurvey')}}</span>
+                                <span class="list-item-typeMark">{{item.owner == 'school' ? $t('studentWeb.public.schoolSurvey'):$t('studentWeb.public.privateSurvey')}}</span>
                                 <span>{{ item.name }}</span>
                             </p>
                             <p class="list-item-time">
@@ -225,7 +225,6 @@
                             for (let item of res.datas) {
                                 item.eventType = item.type
                                 item.progress = this.timeStatus(item)
-                                console.log(item)
                                 data.push(item)
                             }
                             this.eventList = [...data]

+ 6 - 6
TEAMModelOS/ClientApp/src/components/student-web/HomeView/MissionListCard.vue

@@ -19,17 +19,17 @@
                             <svg-icon v-if="item.eventType == 'Homework'" icon-class="doc" />
                             <svg-icon v-if="item.eventType == 'Learn'"
                                       icon-class="selflearninginTime" />
-                            <svg-icon v-if="  item.eventType == 'Exam'"
+                            <svg-icon v-if="item.eventType == 'Exam'||item.eventType == 'exam' "
                                       icon-class="test"
                                       class="reset-testIcon" />
-                            <svg-icon v-if="item.eventType == 'Vote'" icon-class="vote" />
-                            <svg-icon v-if="item.eventType == 'Survey'" icon-class="quesnaire" />
+                            <svg-icon v-if="item.eventType == 'Vote'||item.eventType == 'vote'" icon-class="vote" />
+                            <svg-icon v-if="item.eventType == 'Survey'||item.eventType == 'survey'" icon-class="quesnaire" />
                         </li>
                         <li class="list-item-info">
                             <p class="list-item-title">
-                                <span v-show="item.eventType == 'Exam'" class="list-item-typeMark">{{item.scope == 'school'? $t('studentWeb.public.schoolExam'):$t('studentWeb.public.privateExam')}}</span>
-                                <span v-show="item.eventType == 'Vote'" class="list-item-typeMark">{{item.scope == 'school'? $t('studentWeb.public.schoolVote'):$t('studentWeb.public.privateVote')}}</span>
-                                <span v-show="item.eventType == 'Survey'" class="list-item-typeMark">{{item.scope == 'school'? $t('studentWeb.public.schoolSurvey'):$t('studentWeb.public.privateSurvey')}}</span>
+                                <span v-show="item.eventType == 'Exam'||item.eventType == 'exam'" class="list-item-typeMark">{{item.owner == 'school'? $t('studentWeb.public.schoolExam'):$t('studentWeb.public.privateExam')}}</span>
+                                <span v-show="item.eventType == 'Vote'||item.eventType == 'vote'" class="list-item-typeMark">{{item.owner == 'school'? $t('studentWeb.public.schoolVote'):$t('studentWeb.public.privateVote')}}</span>
+                                <span v-show="item.eventType == 'Survey'||item.eventType == 'survey'" class="list-item-typeMark">{{item.owner == 'school'? $t('studentWeb.public.schoolSurvey'):$t('studentWeb.public.privateSurvey')}}</span>
                                 <span>{{ item.name }}</span>
                                 <div style="float:right;margin-top:-20px">
                                     <div class="list-item-unDone" v-show="timeStatus(item) == 'going'">

+ 1 - 1
TEAMModelOS/ClientApp/src/static/Global.js

@@ -5,7 +5,7 @@ import VueI18n from 'vue-i18n'
 const PRIVATE_SPACE = 1024 * 1024 * 1024 * 1 //教师Blob个人空间
 const SCHOOL_SPACE = 1024 * 1024 * 1024 * 10 //学校Blob空间
 const DEFAULT_SCHOOL_CODE = 'SYSTEM_NO_SCHOOL' //尚未归属学校的默认学校编码
-const BLOB_URL = 'https://teammodelstorage.blob.core.chinacloudapi.cn' //尚未归属学校的默认学校编码
+const BLOB_URL = 'https://teammodelstorage.blob.core.chinacloudapi.cn'  //(废弃) 大陆和国际站的host 不同,不能在这里统一获取,需要从登录信息里面获取
 
 //文件类型,对应内容模块Blob目录
 const CONTENT_TYPES = {

+ 0 - 5
TEAMModelOS/ClientApp/src/utils/evTools.js

@@ -320,9 +320,7 @@ export default {
 	
 	/* 获取完整的试卷数据 */
 	getFullPaper(paper,examScope){
-		console.log('evTools换取试卷' , paper)
 		let curScope = examScope || paper.examScope || paper.scope
-		console.log(curScope)
 		return new Promise(async (r,j) => {
 			let blobHost = curScope === 'school' ?  JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri :  JSON.parse(decodeURIComponent(localStorage.user_profile, "utf-8")).blob_uri
 			// 根据试卷的Blob地址 去读取JSON文件
@@ -365,7 +363,6 @@ export default {
 					})
 					
 					Promise.all(promiseArr).then(res => {
-						console.log(res)
 						res.forEach((resItem,resIndex) => {
 							resItem.children = []
 							if(resItem.pid){
@@ -444,14 +441,12 @@ export default {
 	},
 	/* 获取完整的试卷数据 */
 	getComposeItem(paper) {
-		console.log(paper)
 		return new Promise(async (r, j) => {
 			// 根据试卷的Blob地址 去读取JSON文件
 			let sasString = paper.scope === 'school' ? await $tools.getSchoolSas(paper.code) : await $tools.getPrivateSas(paper.code)
 			try {
 				let jsonInfo = await $tools.getFile(paper.blob + sasString.sas)
 				let jsonData = JSON.parse(jsonInfo)
-				console.log(jsonData)
 				// 获取试卷包含的试题数据并包装好
 				if (jsonData.length) {
 					r(jsonData)

+ 1 - 1
TEAMModelOS/ClientApp/src/view/evaluation/bank/ExerciseList.vue

@@ -93,7 +93,7 @@
 						</div>
 						<div class="item-question-text" v-html="item.question"></div>
 					</div>
-					<span class="item-btn-toggle">
+					<span class="item-btn-toggle" style="justify-content: flex-end;">
 						<Icon :type="
                 collapseList.indexOf(index) > -1
                   ? 'ios-arrow-dropup'

+ 2 - 2
TEAMModelOS/ClientApp/src/view/evaluation/bank/TestPaperList.less

@@ -173,11 +173,11 @@
 			}
 
             &-delete{
-                font-weight:bold;
+                // font-weight:bold;
             }
 			
 			&-edit{
-				font-weight:bold;
+				// font-weight:bold;
 				margin-right: 30px;
 			}
         }

+ 82 - 50
TEAMModelOS/ClientApp/src/view/evaluation/bank/TestPaperList.vue

@@ -13,56 +13,68 @@
 		<div class="pl-content-wrap" v-else>
 			<Loading :top="100" v-show="dataLoading" type="1" hideMask></Loading>
 			<div style="width: 100%;" v-if="!isPreview">
-				<div class="paper-item" v-for="(paper,index) in paperList" :key="index"  @click="onPreviewPaper(paper)">
+				<div class="paper-item" v-for="(paper,index) in paperList" :key="index" @click="onPreviewPaper(paper)">
 					<div class="paper-item-name">
 						<span class="paper-item-tag" v-if="isSchool">{{ paper.subjectName }}</span>
 						<span style="margin-left: 8px;">{{ paper.name }}</span>
 					</div>
 					<div class="paper-item-info">
-						<span class="info-item" v-if="isSchool">{{$t('evaluation.paperList.usePeriod')}}:<span class="info-bold">{{ getPeriodName(paper.periodId) }}</span></span>
-						<span class="info-item" v-if="isSchool">{{$t('evaluation.paperList.useGrade')}}:<span class="info-bold" v-for="(grade,gIndex) in paper.gradeIds" :key="gIndex">{{ getGradeName(paper.periodId,grade) }}
+						<span class="info-item" v-if="isSchool">{{$t('evaluation.paperList.usePeriod')}}:<span
+								class="info-bold">{{ getPeriodName(paper.periodId) }}</span></span>
+						<span class="info-item" v-if="isSchool">{{$t('evaluation.paperList.useGrade')}}:<span
+								class="info-bold" v-for="(grade,gIndex) in paper.gradeIds"
+								:key="gIndex">{{ getGradeName(paper.periodId,grade) }}
 								<span v-show="gIndex !== paper.gradeIds.length - 1"> / </span></span></span>
-						<span class="info-item">{{$t('evaluation.paperList.itemCount')}}:<span class="info-bold">{{ paper.scoring ? paper.scoring.length : 0 }}</span></span>
+						<span class="info-item">{{$t('evaluation.paperList.itemCount')}}:<span
+								class="info-bold">{{ paper.scoring ? paper.scoring.length : 0 }}</span></span>
 						<!-- <span class="info-item">难度系数:<span class="info-bold">{{ paper.item ? handleDiffCalc(paper.item) : 0 }}</span></span> -->
 					</div>
 					<div class="paper-item-tools">
-						<!-- <span class="paper-item-tools-edit">
-							<Icon type="md-eye" />
-							<span>预览</span>
+						<!-- <span class="paper-item-tools-edit" @click.stop="goToDownload(paper)">
+							<Icon type="md-download" />
+							<span>下载试卷</span>
 						</span> -->
-						<span class="paper-item-tools-edit" @click.stop="goToPaper(paper)" v-if="($access.can('admin.*||exercise-upd') || !isSchool)">
+						<span class="paper-item-tools-edit" @click.stop="goToPaper(paper)"
+							v-if="($access.can('admin.*||exercise-upd') || !isSchool)">
 							<Icon type="ios-create" />
 							<span>{{$t('evaluation.editItem')}}</span>
 						</span>
-						<span class="paper-item-tools-delete" @click.stop="onDeletePaper(paper)" v-if="($access.can('admin.*||exercise-upd') || !isSchool)">
+						<span class="paper-item-tools-delete" @click.stop="onDeletePaper(paper)"
+							v-if="($access.can('admin.*||exercise-upd') || !isSchool)">
 							<Icon type="md-trash" />
 							<span>{{$t('evaluation.deleteItem')}}</span>
 						</span>
 					</div>
 				</div>
-				
+
 				<!-- 底部分页区域 -->
-				<Page :total="totalNum" show-sizer show-total :page-size="pageSize" :current="pageNum" @on-page-size-change="pageSizeChange"
-				 @on-change="pageChange" :page-size-opts="[10,20,30,40]" />
+				<Page :total="totalNum" show-sizer show-total :page-size="pageSize" :current="pageNum"
+					@on-page-size-change="pageSizeChange" @on-change="pageChange" :page-size-opts="[10,20,30,40]" />
 			</div>
-			
+
 			<div class="pl-review-wrap animated fadeIn" v-if="isPreview">
-					<div class="pl-review-wrap-left">
-						<TestPaper :paper="evaluationInfo" isExamPaper isHideAnalysis></TestPaper>
-					</div>
-					
-					<div class="pl-review-wrap-right">
-						<h2>{{$t('evaluation.paperList.paperAnalysis')}}</h2>
-						<p style="margin-bottom: 20px;margin-top: 10px;">({{$t('evaluation.paperList.totalScore')}}:{{ evaluationInfo.score }} {{$t('evaluation.paperList.score')}})</p>
-						<BaseTypePie :echartsData="evaluationInfo"></BaseTypePie>
-						<BaseObjectivePie :echartsData="evaluationInfo"></BaseObjectivePie>
-						<BaseDiffPie :echartsData="evaluationInfo"></BaseDiffPie>
-						<BasePointPie :echartsData="evaluationInfo"></BasePointPie>
-					</div>
+				<div class="pl-review-wrap-left">
+					<TestPaper :paper="evaluationInfo" isExamPaper isHideAnalysis></TestPaper>
+				</div>
+
+				<div class="pl-review-wrap-right">
+					<h2>{{$t('evaluation.paperList.paperAnalysis')}}</h2>
+					<p style="margin-bottom: 20px;margin-top: 10px;">
+						({{$t('evaluation.paperList.totalScore')}}:{{ evaluationInfo.score }}
+						{{$t('evaluation.paperList.score')}})</p>
+					<BaseTypePie :echartsData="evaluationInfo"></BaseTypePie>
+					<BaseObjectivePie :echartsData="evaluationInfo"></BaseObjectivePie>
+					<BaseDiffPie :echartsData="evaluationInfo"></BaseDiffPie>
+					<BasePointPie :echartsData="evaluationInfo"></BasePointPie>
+				</div>
 			</div>
 		</div>
-		
-		
+
+
+		<Modal v-model="isShowDownLoad" width="800px"  title="下载试卷">
+			<DownloadPaper :paper="fullPaperJson"></DownloadPaper>
+		</Modal>
+
 	</div>
 </template>
 <script>
@@ -96,13 +108,17 @@
 				originList: [],
 				schoolInfo: {},
 				filterSort: 'createTime',
-				evaluationInfo:null,
-				isPreview:false,
+				evaluationInfo: null,
+				isPreview: false,
 				paperInfo: {
 					name: "",
 					score: 100,
 					item: []
-				}
+				},
+				fullPaperJson: {
+					id:'0'
+				},
+				isShowDownLoad: false
 			}
 		},
 		created() {
@@ -111,44 +127,49 @@
 
 		},
 		methods: {
-			
-			async onPreviewPaper(paper){
+
+			async onPreviewPaper(paper) {
 				this.dataLoading = true
 				let curPaper = paper
 				try {
 					// 获取完整试卷数据再跳转编辑页面
-					let fullPaperJson = await this.$evTools.getFullPaper(curPaper)
+					let fullPaperJson = this.fullPaperJson.id === curPaper.id ? this.fullPaperJson : await this.$evTools.getFullPaper(curPaper)
+					this.fullPaperJson = fullPaperJson
 					fullPaperJson.code = curPaper.code
 					let paper = fullPaperJson
 					let schoolInfo = null
-					if(paper.scope === 'school'){
+					if (paper.scope === 'school') {
 						schoolInfo = await this.getSchoolBaseInfo()
-						this.subjectList = schoolInfo ? this.schoolInfo.period.filter(i => i.id === paper.periodId)[0].subjects : []
+						this.subjectList = schoolInfo ? this.schoolInfo.period.filter(i => i.id === paper.periodId)[0]
+							.subjects : []
 					}
 					this.evaluationInfo = {
 						id: paper.id,
 						name: paper.name,
-						code:paper.code,
+						code: paper.code,
 						type: paper.scope,
-						paperPeriod: schoolInfo && paper.scope === 'school' ? this.schoolInfo.period.map(i => i.id).indexOf(paper.periodId) : null,
+						paperPeriod: schoolInfo && paper.scope === 'school' ? this.schoolInfo.period.map(i => i.id)
+							.indexOf(paper.periodId) : null,
 						paperGrade: schoolInfo && paper.scope === 'school' ? paper.gradeIds : [],
-						paperSubject: schoolInfo && paper.scope === 'school' ? this.subjectList.map(i => i.id).indexOf(paper.subjectId) : [],
+						paperSubject: schoolInfo && paper.scope === 'school' ? this.subjectList.map(i => i.id)
+							.indexOf(paper.subjectId) : [],
 						score: paper.score,
 						item: paper.item,
-						multipleRule:paper.multipleRule,
+						multipleRule: paper.multipleRule,
 						startTime: 0,
 						endTime: 0,
-						createType:'manual'
+						createType: 'manual'
 					}
 					this.isPreview = true
 					this.$emit('onPaperClick')
 					this.dataLoading = false
 				} catch (e) {
+					console.log(e)
 					this.dataLoading = false
 					this.$Message.error(this.$t('evaluation.paperList.paperErrorTip'))
 				}
 			},
-			
+
 			/** 获取当前学校基础数据 */
 			getSchoolBaseInfo() {
 				return new Promise((r, j) => {
@@ -156,12 +177,12 @@
 						let schoolBaseInfo = res.school_base;
 						if (schoolBaseInfo) {
 							r(schoolBaseInfo)
-						}else{
+						} else {
 							r(null)
 						}
 					});
 				})
-			
+
 			},
 
 			/** 执行筛选条件获取数据 */
@@ -211,7 +232,8 @@
 				this.dataLoading = true
 				try {
 					// 获取完整试卷数据再跳转编辑页面
-					let fullPaperJson = await this.$evTools.getFullPaper(paper)
+					let fullPaperJson = this.fullPaperJson.id === paper.id ? this.fullPaperJson : await this.$evTools.getFullPaper(paper)
+					this.fullPaperJson = fullPaperJson
 					fullPaperJson.code = paper.code
 					console.log(fullPaperJson)
 					this.dataLoading = false
@@ -225,7 +247,14 @@
 					this.$Message.error(this.$t('evaluation.paperList.paperErrorTip'))
 					this.dataLoading = false
 				}
+			},
 
+			/* 下载试卷 */
+			async goToDownload(paper) {
+				let fullPaperJson = this.fullPaperJson.id === paper.id ? this.fullPaperJson : await this.$evTools.getFullPaper(paper)
+				this.fullPaperJson = fullPaperJson
+				this.isShowDownLoad = true
+				console.log('要下载的试卷', fullPaperJson)
 			},
 
 			/**
@@ -258,12 +287,13 @@
 					}
 				})
 			},
-			
+
 			/* 删除blob指定试题目录下所有 */
 			deleteBlobPrefix(paper) {
-				return new Promise((resolve,reject) => {
+				return new Promise((resolve, reject) => {
 					this.$api.blob.deletePrefix({
-						"cntr": paper.scope === 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId,
+						"cntr": paper.scope === 'school' ? this.$store.state.userInfo.schoolCode : this
+							.$store.state.userInfo.TEAMModelId,
 						"prefix": "paper/" + paper.name
 					}).then(
 						(res) => {
@@ -325,7 +355,8 @@
 			 * @param code
 			 */
 			getPeriodName(code) {
-				return this.$store.state.user.schoolProfile.school_base ? this.$store.state.user.schoolProfile.school_base.period.filter(i => i.id === code)[0].name : this.$t('evaluation.noData')
+				return this.$store.state.user.schoolProfile.school_base ? this.$store.state.user.schoolProfile.school_base
+					.period.filter(i => i.id === code)[0].name : this.$t('evaluation.noData')
 			},
 
 			/**
@@ -333,8 +364,9 @@
 			 * @param code
 			 */
 			getGradeName(periodId, code) {
-				return this.$store.state.user.schoolProfile.school_base ? this.$store.state.user.schoolProfile.school_base.period.filter(i => i.id === periodId)[0].grades.filter(j =>
-					j.id === code)[0].name : this.$t('evaluation.noData')
+				return this.$store.state.user.schoolProfile.school_base ? this.$store.state.user.schoolProfile.school_base
+					.period.filter(i => i.id === periodId)[0].grades.filter(j =>
+						j.id === code)[0].name : this.$t('evaluation.noData')
 			},
 
 			/**

+ 3 - 3
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseChild.vue

@@ -16,7 +16,7 @@
 			<div class="item-btn-toggle" v-if="isShowScore">
 				<template>
 					<InputNumber :max="totalScore" :min="0" v-model="item.score"
-						style="display: inline-block ;width: 60px;margin-right: 10px;height: 30px;" @click.stop>
+						style="display: inline-block ;width: 50px;margin-right: 10px;height: 30px;" @click.stop>
 					</InputNumber>
 					<span style="margin-right: 20px;">{{$t('evaluation.paperList.score')}}</span>
 				</template>
@@ -234,6 +234,7 @@
 
 			&-question {
 				font-size: 14px;
+				max-width: 85%;
 				// color:#01b087;
 
 				&-order {
@@ -251,9 +252,8 @@
 			}
 
 			&-option {
-				font-size: 14px;
 				margin: 10px 5px;
-				margin-left: 80px;
+				margin-left: 20px;
 
 				&-order {
 					display: inline-block;

+ 6 - 6
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseExerciseList.vue

@@ -38,7 +38,7 @@
 						<span v-else>{{$t('evaluation.exerciseList.noOptionTip')}}</span>
 					</div>
 
-					<div @click="onQuestionToggle(exerciseList.indexOf(item),item.id,$event,typeItem.list)">
+					<div @click="onQuestionToggle(exerciseList.indexOf(item),item.id,$event,typeItem.list)" style="max-width: 85%;">
 						<!-- 题干部分 -->
 						<div class="item-question">
 							<div v-if="viewModel === 'list'">
@@ -61,17 +61,17 @@
 					<div class="exercise-item-children" v-if="item.children.length">
 						<BaseChild :children="item.children" :totalScore="item.score" :isShowScore="!isExamPaper"></BaseChild>
 					</div>
-					<div class="item-btn-toggle" @click.stop v-show="isShowTools && !isPreview" >
+					<div class="item-btn-toggle" @click.stop v-show="isShowTools && !isPreview">
 						<template v-if="!isExamPaper">
-							<InputNumber :max="item.score + surPlusScore" :min="0" v-model="item.score" style="display: inline-block ;width: 60px;margin-right: 10px;height: 30px;"
+							<InputNumber :max="item.score + surPlusScore" :min="0" v-model="item.score" style="display: inline-block ;width: 50px;margin-right: 10px;height: 30px;"
 							 @click.stop></InputNumber>
-							<span style="margin-right: 20px;">{{$t('evaluation.paperList.score')}}</span>
+							<span style="margin-right: 10px;">{{$t('evaluation.paperList.score')}}</span>
 							<!-- <span class="item-score" title="设置题目分数" @click.stop="onSetSingleItem(item,index)" v-else>{{ item.score }} 分</span> -->
 						</template>
 						<template v-else>
-							<span style="margin-right: 20px;font-size: 16px;"> <span style="font-weight: bold;color: #0086E6;">{{ item.score }}</span>  {{$t('evaluation.paperList.score')}}</span>
+							<span style="margin-right: 10px;font-size: 16px;"> <span style="font-weight: bold;color: #0086E6;">{{ item.score }}</span>  {{$t('evaluation.paperList.score')}}</span>
 						</template>
-						<Icon :type="collapseList.indexOf(index) > -1 ? 'ios-arrow-dropup' : 'ios-arrow-dropdown'" />
+						<Icon :type="collapseList.indexOf(index) > -1 ? 'ios-arrow-dropup' : 'ios-arrow-dropdown'" v-if="item.type !== 'compose'"/>
 					</div>
 					
 					<!-- 答案以及解析 -->

+ 153 - 0
TEAMModelOS/ClientApp/src/view/evaluation/components/DownloadPaper.vue

@@ -0,0 +1,153 @@
+<template>
+	<div class="download-paper-wrap" ref="childRef">
+		<div class="dp-top">
+			<p class="dp-top-title">{{ paperItem.name }}</p>
+		</div>
+		<div class="dp-content">
+			<div class="dp-group-item" v-for="(gItem,gIndex) in groupList">
+				<p v-show="gItem.list.length" class="dp-group-title">
+					<span>{{ numberConvertToUppercase(gIndex + 1) }} : {{ exersicesType[gItem.type] }}</span>
+					<span style="font-size: 14px;">({{ gItem.score || 0 }}{{$t('evaluation.paperList.score')}}) </span>
+				</p>
+					<div class="dp-item" v-for="(item,index) in gItem.list">
+						<span class="dp-item-order">{{ index + 1 }}、({{ item.score }}分) </span>
+						<div>
+							<span class="dp-item-question" v-html="item.question"></span>
+							<div class="dp-item-options">
+								<!-- 选项部分 -->
+								<div v-for="(option,optionIndex) in item.option" :key="optionIndex" class="dp-item-options">
+									<div class="item-option-content">
+										<div class="item-option-order">{{String.fromCharCode(64 + parseInt(optionIndex+1))}} :</div>
+										<div class="item-option-text" v-html="option.value"></div>
+									</div>
+								</div>
+							</div>
+						</div>
+					</div>
+					
+					
+			</div>
+			
+		</div>
+	</div>
+</template>
+<script>
+	export default {
+		name: 'DownloadPaper',
+		props: {
+			paper: {
+				type: Object,
+				default: () => {}
+			},
+		},
+		data() {
+			return {
+				exersicesType: this.$GLOBAL.EXERCISE_TYPES(),
+				paperItem:{
+					name:'',
+					item:[]
+				},
+				typeList: ['single', 'multiple', 'judge', 'complete', 'subjective', 'connector', 'correct', 'compose'],
+				groupList:[]
+			}
+		},
+		created() {
+			
+
+		},
+		methods: {
+			doGroupPaper(paper){
+				/* 处理试卷内题目按照题型排序 */
+				let that = this
+				let groupList = []
+				this.typeList.forEach(item => {
+					this._.mapKeys(this._.groupBy(paper.item, 'type'), function(value, key) {
+						if (key === item) { /* 按照题型排序,并且计算每种题型的总分 */
+							groupList.push({
+								type: key,
+								list: value,
+								score: value.reduce((p, e) => parseInt(p) + parseInt(e.score), 0)
+							})
+						}
+					})
+				});
+				return groupList
+			},
+			
+			/**
+			 * 数字与中文转换
+			 * @param num
+			 */
+			numberConvertToUppercase(num) {
+				num = Number(num)
+				var upperCaseNumber = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '百', '千', '万', '亿']
+				var length = String(num).length
+				if (length === 1) {
+					return upperCaseNumber[num]
+				} else if (length === 2) {
+					if (num === 10) {
+						return upperCaseNumber[num]
+					} else if (num > 10 && num < 20) {
+						return '十' + upperCaseNumber[String(num).charAt(1)]
+					} else {
+						return upperCaseNumber[String(num).charAt(0)] + '十' + upperCaseNumber[String(num).charAt(1)].replace('零', '')
+					}
+				}
+			},
+
+		},
+
+		watch: {
+			paper: {
+				handler(n) {
+					if(n){
+						this.groupList = this.doGroupPaper(n)
+						this.paperItem = n
+					}
+				}
+			},
+			
+		}
+
+	}
+</script>
+
+
+<style lang="less" scoped>
+	.download-paper-wrap{
+		.dp-top{
+			padding: 20px 0;
+			&-title{
+				text-align: center;
+				font-size: 24px;
+				font-weight: bold;
+			}
+		}
+		
+		.dp-content{
+			.dp-group-title{
+				font-size: 16px;
+				margin: 20px 0;
+			}
+			.dp-item{
+				display: flex;
+				font-size: 14px;
+				margin-top: 20px;
+				&-order{
+					min-width: 50px;
+				}
+				&-question{
+					flex:1;
+					padding-left: 10px;
+				}
+			}
+			
+			.dp-item-options{
+				.item-option-content{
+					display: flex;
+					margin: 10px 0;
+				}
+			}
+		}
+	}
+</style>

+ 5 - 1
TEAMModelOS/ClientApp/src/view/evaluation/index/CommonExercise.less

@@ -158,8 +158,12 @@
   }
   .item-btn-toggle {
     position: absolute;
-    right: 20px;
+    right: 10px;
     top: 8px;
+	width: 15%;
+	display: flex;
+	justify-content: center;
+	align-items: center;
     .ivu-icon {
       font-size: 22px;
       cursor: pointer;

+ 1 - 2
TEAMModelOS/ClientApp/src/view/learnactivity/PaperScore.less

@@ -282,9 +282,8 @@
 			}
 			
 			&-option{
-				font-size: 14px;
 				margin: 10px 5px;
-				margin-left: 80px;
+				margin-left: 20px;
 				
 				&-order{
 					display: inline-block;

+ 4 - 3
TEAMModelOS/ClientApp/src/view/learnactivity/PaperScore.vue

@@ -642,17 +642,18 @@ export default {
                     if (newValue.answers.length) {
                         try {
                             let sas = this.examScope == 'school' ? this.$store.state.user.schoolProfile.blob_sas : this.$store.state.user.userProfile.blob_sas
-                            let container = this.examScope == 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId
+                            //let container = this.examScope == 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId
+                            let blobUrl = this.examScope == 'school' ? JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri : JSON.parse(decodeURIComponent(localStorage.user_profile, "utf-8")).blob_uri
                             let a = null
                             // 如果有批注则渲染批注,没有则渲染元数据
                             if (newValue.mark) {
-                                a = await await this.$tools.getFile(`${this.$GLOBAL.BLOB_URL}/${container}/exam/${newValue.mark}?${sas}`)
+                                a = await await this.$tools.getFile(`${blobUrl}/exam/${newValue.mark}?${sas}`)
                             } else {
                                 //为了兼容原来完整的路径,这里做判断
                                 if (newValue.answers[0].indexOf('https://teammodelstorage') > -1) {
                                     a = await this.$tools.getFile(`${newValue.answers[0]}?${sas}`)
                                 } else {
-                                    a = await this.$tools.getFile(`${this.$GLOBAL.BLOB_URL}/${container}/exam/${newValue.answers[0]}?${sas}`)
+                                    a = await this.$tools.getFile(`${blobUrl}/exam/${newValue.answers[0]}?${sas}`)
                                 }
                             }
 

+ 10 - 0
TEAMModelOS/ClientApp/src/view/learnactivity/Scoring.less

@@ -94,4 +94,14 @@
     float: right;
     margin-top: 15px;
     color: white;
+}
+.mark-viewer{
+    z-index: 9999;
+    width: 100%;
+    height: 100%;
+    position: fixed;
+    bottom: 0;
+    right: 0;
+    top: 0;
+    left: 0;
 }

+ 5 - 1
TEAMModelOS/ClientApp/src/view/learnactivity/Scoring.vue

@@ -57,10 +57,14 @@
                 </div>
             </div>
         </vuescroll>
+        <!-- <div class="mark-viewer">
+            <MarkView></MarkView>
+        </div> -->
     </div>
 </template>
 <script>
 import PaperScore from "./PaperScore.vue";
+import MarkView from "./markpaper/MarkView.vue";
 import SimpleAnalysis from "./SimpleAnalysis.vue";
 export default {
     props: {
@@ -72,7 +76,7 @@ export default {
         }
     },
     components: {
-        PaperScore, SimpleAnalysis
+        PaperScore, SimpleAnalysis, MarkView
     },
     data() {
         return {

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1078 - 0
TEAMModelOS/ClientApp/src/view/learnactivity/markpaper/MarkView.vue


+ 1 - 1
TEAMModelOS/ClientApp/src/view/student-analysis/total-analysis/TestAnalysis/TestAnalysis.vue

@@ -298,7 +298,7 @@
 						title: item.className,
 						sortable: 'custom',
 						key: item.className,
-						render: (h, params) => {
+						renderType: (h, params) => {
 							return h('span', (Number(params.row[item.className])).toFixed(0) + '%')
 						},
 						minWidth: 150

+ 19 - 18
TEAMModelOS/Controllers/Common/TriggerStuActivity.cs

@@ -18,37 +18,37 @@ namespace OS.Funct
     public class TriggerStuActivity
     {
 
-        public static async Task<string> SaveStuActivity(CosmosClient client,List<StuActivity> stuActivities,List<StuActivity> tmdActivities) {
-
+        public static async Task<string> SaveStuActivity(CosmosClient client, List<StuActivity> stuActivities, List<StuActivity> tmdActivities)
+        {
             if (stuActivities.IsNotEmpty())
             {
                 foreach (var x in stuActivities)
                 {
                     await client.GetContainer("TEAMModelOS", "Student").UpsertItemAsync(x, new PartitionKey(x.code));
                 }
-
-
             }
             if (tmdActivities.IsNotEmpty())
             {
                 foreach (var x in tmdActivities)
                 {
-                    await client.GetContainer("TEAMModelOS", "Student").UpsertItemAsync(x, new PartitionKey(x.code));
+                    await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync(x, new PartitionKey(x.code));
                 }
-
             }
-            return ""; 
+            return "";
         }
-         
-        public  static async Task<(List<string> tmdids,List<Students> studentss)> GetStuList(  CosmosClient client, List<string> classes,string  school) {
 
+        public static async Task<(List<string> tmdids, List<Students> studentss)> GetStuList(CosmosClient client, List<string> classes, string school)
+        {
+            List<string> tmdids = new List<string>();
             List<Students> studentss = new List<Students>();
+            if (!classes.IsNotEmpty()) { return (tmdids, studentss); }
             List<string> sqlList = new List<string>();
             classes.ForEach(x => { sqlList.Add($" '{x}' "); });
             string sql = string.Join(" , ", sqlList);
             List<StuList> schList = new List<StuList>();
             List<Student> students = new List<Student>();
-            if (!string.IsNullOrEmpty(school)) {
+            if (!string.IsNullOrEmpty(school))
+            {
                 await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<StuList>(queryText: $"select value(c) from c where c.id in ({sql})",
                 requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"StuList-{school}") }))
                 {
@@ -68,10 +68,10 @@ namespace OS.Funct
             {
                 tchLists.Add(item);
             }
-            List<string> tmdids = new List<string>();
-            schList.ForEach(x => { 
-                if (x.students.IsNotEmpty()) 
-                { 
+
+            schList.ForEach(x => {
+                if (x.students.IsNotEmpty())
+                {
                     studentss.AddRange(x.students);
                 }
                 if (x.tmids.IsNotEmpty())
@@ -79,9 +79,10 @@ namespace OS.Funct
                     tmdids.AddRange(x.tmids);
                 }
             });
-            tchLists.ForEach(x => 
+            tchLists.ForEach(x =>
             {
-                if (x.students.IsNotEmpty()) { 
+                if (x.students.IsNotEmpty())
+                {
                     studentss.AddRange(x.students);
                 }
                 if (x.tmids.IsNotEmpty())
@@ -90,9 +91,9 @@ namespace OS.Funct
                 }
             });
             students.ForEach(x => {
-                studentss.Add(new Students { id = x.id, code = x.code,schoolId=x.schoolId });
+                studentss.Add(new Students { id = x.id, code = x.code, schoolId = x.schoolId });
             });
-            return (tmdids,studentss);
+            return (tmdids, studentss);
         }
     }
 }

+ 9 - 4
TEAMModelOS/Controllers/Core/BlobController.cs

@@ -33,12 +33,14 @@ namespace TEAMModelOS.Controllers.Core
         private readonly IHttpClientFactory _clientFactory;
         private readonly AzureRedisFactory _azureRedis;
         private readonly AzureServiceBusFactory _serviceBus;
-        public BlobController(AzureStorageFactory azureStorage, AzureServiceBusFactory serviceBus, IHttpClientFactory clientFactory, AzureRedisFactory azureRedis)
+        public IConfiguration _configuration { get; set; }
+        public BlobController(AzureStorageFactory azureStorage, AzureServiceBusFactory serviceBus, IHttpClientFactory clientFactory, AzureRedisFactory azureRedis, IConfiguration configuration)
         {
             _azureStorage = azureStorage;
             _clientFactory = clientFactory;
             _serviceBus = serviceBus;
             _azureRedis = azureRedis;
+            _configuration = configuration;
         }
 
         /// <summary>
@@ -129,7 +131,8 @@ namespace TEAMModelOS.Controllers.Core
                 }
                 var messageBlob = new ServiceBusMessage(new { id = Guid.NewGuid().ToString(), progress = "update", name = blobContainerName }.ToJsonString());
                 messageBlob.ApplicationProperties.Add("name", "Blob");
-                await _serviceBus.GetServiceBusClient().SendMessageAsync("active-task", messageBlob);
+                var ActiveTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");
+                await _serviceBus.GetServiceBusClient().SendMessageAsync(ActiveTask, messageBlob);
                 return Ok(new { status, catalog,size=useSize });
             }
             else {
@@ -214,7 +217,8 @@ namespace TEAMModelOS.Controllers.Core
                     }
                     var messageBlob = new ServiceBusMessage(new { id = Guid.NewGuid().ToString(), progress = "update", name = blobContainerName }.ToJsonString());
                     messageBlob.ApplicationProperties.Add("name", "Blob");
-                    await _serviceBus.GetServiceBusClient().SendMessageAsync("active-task", messageBlob);
+                    var ActiveTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");
+                    await _serviceBus.GetServiceBusClient().SendMessageAsync(ActiveTask, messageBlob);
                     return Ok(new { status,size= useSize,catalog });
                 }
                 else
@@ -410,7 +414,8 @@ namespace TEAMModelOS.Controllers.Core
             }
             var messageBlob = new ServiceBusMessage(new {id=Guid.NewGuid().ToString(), progress = "update",name=name}.ToJsonString());
             messageBlob.ApplicationProperties.Add("name", "Blob");
-            await _serviceBus.GetServiceBusClient().SendMessageAsync("active-task", messageBlob);
+            var ActiveTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");
+            await _serviceBus.GetServiceBusClient().SendMessageAsync(ActiveTask, messageBlob);
             return Ok(new { size=useSize, catalog });
         }
 

+ 8 - 3
TEAMModelOS/Controllers/School/CourseController.cs

@@ -23,6 +23,7 @@ using System.Dynamic;
 using Azure;
 using TEAMModelOS.SDK.Models.Cosmos.Common;
 using Azure.Messaging.ServiceBus;
+using Microsoft.Extensions.Configuration;
 
 namespace TEAMModelOS.Controllers
 {
@@ -37,12 +38,14 @@ namespace TEAMModelOS.Controllers
         private readonly DingDing _dingDing;
         private readonly Option _option;
         private readonly AzureServiceBusFactory _serviceBus;
-        public CourseController(AzureCosmosFactory azureCosmos, DingDing dingDing, IOptionsSnapshot<Option> option , AzureServiceBusFactory serviceBus)
+        public IConfiguration _configuration { get; set; }
+        public CourseController(AzureCosmosFactory azureCosmos, DingDing dingDing, IOptionsSnapshot<Option> option , AzureServiceBusFactory serviceBus, IConfiguration configuration)
         {
             _azureCosmos = azureCosmos;
             _dingDing = dingDing;
             _option = option?.Value;
             _serviceBus = serviceBus;
+            _configuration = configuration;
         }
 
         /// <summary>
@@ -258,7 +261,8 @@ namespace TEAMModelOS.Controllers
                         }
                         var messageChange = new ServiceBusMessage(change.ToJsonString());
                         messageChange.ApplicationProperties.Add("name", "StuList");
-                        await _serviceBus.GetServiceBusClient().SendMessageAsync("active-task", messageChange);
+                        var ActiveTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");
+                        await _serviceBus.GetServiceBusClient().SendMessageAsync(ActiveTask, messageChange);
                     }
                     stuList = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "School").UpsertItemAsync(stuList, new PartitionKey($"StuList-{originCode}"));
                 }
@@ -326,7 +330,8 @@ namespace TEAMModelOS.Controllers
                         }
                         var messageChange = new ServiceBusMessage(change.ToJsonString());
                         messageChange.ApplicationProperties.Add("name", "StuList");
-                        await _serviceBus.GetServiceBusClient().SendMessageAsync("active-task", messageChange);
+                        var ActiveTask = _configuration.GetValue<string>("Azure:ServiceBus:ActiveTask");
+                        await _serviceBus.GetServiceBusClient().SendMessageAsync(ActiveTask, messageChange);
                     }
                     stuList.code = "StuList";
                     stuList = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync(stuList, new PartitionKey($"StuList"));

+ 178 - 9
TEAMModelOS/Controllers/XTest/TestController.cs

@@ -53,13 +53,10 @@ namespace TEAMModelOS.Controllers.XTest
         [HttpGet("test-redis")]
         public async Task<IActionResult> TestRedis( ) {
 
-           var db  = _azureRedis.GetRedisClient(8);
-            //var keys = server.Keys(pattern: "Vote*", database: db.Database);
-            //foreach (var key in keys) {
-            //    Console.WriteLine(key);
-            //}
+           
+            var db  = _azureRedis.GetRedisClient(8);
 
-           // db.HashScanAsync()
+          await  db.StringSetAsync("1111", "111111");
                 return Ok() ;
         }
         /// <summary>
@@ -188,13 +185,104 @@ namespace TEAMModelOS.Controllers.XTest
 
         [ProducesDefaultResponseType]
         //[AuthToken(Roles = "teacher")]
-        [HttpPost("fixExamActivity")]
+        [HttpPost("fix-exam-activity")]
         public async Task<IActionResult> ExamActivity(JsonElement request)
         {
             
            var datas = request.ToObject<List<string>>();
             var client = _azureCosmos.GetCosmosClient();
 
+            var query = $"select  *  from c ";
+            foreach (string data in datas)
+            {
+                List<ExamInfo> exams = new List<ExamInfo>();
+                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(
+                    queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Exam-{data}") }))
+                {
+                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
+                    {
+                        foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
+                        {
+                            exams.Add(obj.ToObject<ExamInfo>());
+                        }
+                    }
+                }
+                foreach (var info in exams)
+                {
+                    if (!info.classes.IsNotEmpty())
+                    {
+                        continue;
+                    }
+                    List<string> sub = new List<string>();
+                    foreach (ExamSubject subject in info.subjects)
+                    {
+                        sub.Add(subject.id);
+                    }
+                    (List<string> tmdids, List<Students> studentss) = await TriggerStuActivity.GetStuList(client, info.classes, info.school);
+                    List<StuActivity> stuActivities = new List<StuActivity>();
+                    List<StuActivity> tmdActivities = new List<StuActivity>();
+                    if (tmdids.IsNotEmpty())
+                    {
+                        tmdids.ForEach(x => {
+                            tmdActivities.Add(new StuActivity
+                            {
+                                pk = "Activity",
+                                id = info.id,
+                                code = $"Activity-{x}",
+                                type = "exam",
+                                name = info.name,
+                                startTime = info.startTime,
+                                endTime = info.endTime,
+                                scode = info.code,
+                                scope = info.scope,
+                                school = info.school,
+                                creatorId = info.creatorId,
+                                subjects = sub,
+                                blob = null,
+                                owner = info.owner
+
+                            });
+                        });
+                    }
+                    if (studentss.IsNotEmpty())
+                    {
+                        studentss.ForEach(x => {
+                            stuActivities.Add(new StuActivity
+                            {
+                                pk = "Activity",
+                                id = info.id,
+                                code = $"Activity-{info.school}-{x.id}",
+                                type = "exam",
+                                name = info.name,
+                                startTime = info.startTime,
+                                endTime = info.endTime,
+                                scode = info.code,
+                                scope = info.scope,
+                                school = info.school,
+                                creatorId = info.creatorId,
+                                subjects = sub,
+                                blob = null,
+                                owner = info.owner
+                            });
+                        });
+                    }
+                    await TriggerStuActivity.SaveStuActivity(client, stuActivities, tmdActivities);
+                }
+            }
+            return new OkObjectResult(new { });
+        }
+
+
+        [ProducesDefaultResponseType]
+        //[AuthToken(Roles = "teacher")]
+        [HttpPost("fix-vote-activity")]
+        public async Task<IActionResult> VoteActivity(JsonElement request)
+        {
+
+            var datas = request.ToObject<List<string>>();
+            var client = _azureCosmos.GetCosmosClient();
+
             var query = $"select  *  from c ";
             foreach (string data in datas)
             {
@@ -238,7 +326,8 @@ namespace TEAMModelOS.Controllers.XTest
                                 school = info.school,
                                 creatorId = info.creatorId,
                                 subjects = new List<string>() { "" },
-                                blob = null
+                                blob = null,
+                                owner = info.owner
 
                             });
                         });
@@ -260,7 +349,87 @@ namespace TEAMModelOS.Controllers.XTest
                                 school = info.school,
                                 creatorId = info.creatorId,
                                 subjects = new List<string>() { "" },
-                                blob = null
+                                blob = null,
+                                owner = info.owner
+                            });
+                        });
+                    }
+                    await TriggerStuActivity.SaveStuActivity(client, stuActivities, tmdActivities);
+                }
+            }
+            return new OkObjectResult(new { });
+        }
+        [ProducesDefaultResponseType]
+        //[AuthToken(Roles = "teacher")]
+        [HttpPost("fix-survey-activity")]
+        public async Task<IActionResult> SurveyActivity(JsonElement request)
+        {
+            var datas = request.ToObject<List<string>>();
+            var client = _azureCosmos.GetCosmosClient();
+            var query = $"select  *  from c ";
+            foreach (string data in datas)
+            {
+                List<Survey> surveys = new List<Survey>();
+                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(
+                    queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Survey-{data}") }))
+                {
+                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
+                    {
+                        foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
+                        {
+                            surveys.Add(obj.ToObject<Survey>());
+                        }
+                    }
+                }
+                foreach (var info in surveys)
+                {
+                    if (!info.classes.IsNotEmpty())
+                    {
+                        continue;
+                    }
+                    (List<string> tmdids, List<Students> studentss) = await TriggerStuActivity.GetStuList(client, info.classes, info.school);
+                    List<StuActivity> stuActivities = new List<StuActivity>();
+                    List<StuActivity> tmdActivities = new List<StuActivity>();
+                    if (tmdids.IsNotEmpty())
+                    {
+                        tmdids.ForEach(x => {
+                            tmdActivities.Add(new StuActivity
+                            {
+                                pk = "Activity",
+                                id = info.id,
+                                code = $"Activity-{x}",
+                                type = "survey",
+                                name = info.name,
+                                startTime = info.startTime,
+                                endTime = info.endTime,
+                                scode = info.code,
+                                scope = info.scope,
+                                school = info.school,
+                                creatorId = info.creatorId,
+                                subjects = new List<string>() { "" },
+                                blob = info.blob
+                            });
+                        });
+                    }
+                    if (studentss.IsNotEmpty())
+                    {
+                        studentss.ForEach(x => {
+                            stuActivities.Add(new StuActivity
+                            {
+                                pk = "Activity",
+                                id = info.id,
+                                code = $"Activity-{info.school}-{x.id}",
+                                type = "survey",
+                                name = info.name,
+                                startTime = info.startTime,
+                                endTime = info.endTime,
+                                scode = info.code,
+                                scope = info.scope,
+                                school = info.school,
+                                creatorId = info.creatorId,
+                                subjects = new List<string>() { "" },
+                                blob = info.blob
                             });
                         });
                     }

+ 4 - 0
TEAMModelOS/TEAMModelOS.csproj

@@ -32,6 +32,10 @@
     <Folder Include="logfile\" />
     <Folder Include="wwwroot\" />
   </ItemGroup>
+
+  <ItemGroup>
+    <None Include="TEAMModelOS.csproj" />
+  </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\TEAMModelOS.SDK\TEAMModelOS.SDK.csproj" />
   </ItemGroup>

+ 5 - 41
TEAMModelOS/appsettings.Development.json

@@ -21,65 +21,29 @@
     "Storage": {
       "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=teammodelstorage;AccountKey=Yq7D4dE6cFuer2d2UZIccTA/i0c3sJ/6ITc8tNOyW+K5f+/lWw9GCos3Mxhj47PyWQgDL8YbVD63B9XcGtrMxQ==;EndpointSuffix=core.chinacloudapi.cn"
     },
-    "Table": {
-      "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=teammodelstorage;AccountKey=Yq7D4dE6cFuer2d2UZIccTA/i0c3sJ/6ITc8tNOyW+K5f+/lWw9GCos3Mxhj47PyWQgDL8YbVD63B9XcGtrMxQ==;EndpointSuffix=core.chinacloudapi.cn"
-    },
-    "Blob": {
-      "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=teammodelstorage;AccountKey=Yq7D4dE6cFuer2d2UZIccTA/i0c3sJ/6ITc8tNOyW+K5f+/lWw9GCos3Mxhj47PyWQgDL8YbVD63B9XcGtrMxQ==;EndpointSuffix=core.chinacloudapi.cn",
-      "Container": "teammodelos"
-    },
     "Cosmos": {
+      //"ConnectionString": "AccountEndpoint=https://cdhabookdep-free.documents.azure.cn:443/;AccountKey=JTUVk92Gjsx17L0xqxn0X4wX2thDPMKiw4daeTyV1HzPb6JmBeHdtFY1MF1jdctW1ofgzqkDMFOtcqS46by31A==;"
       "ConnectionString": "AccountEndpoint=https://teammodelos.documents.azure.cn:443/;AccountKey=clF73GwPECfP1lKZTCvs8gLMMyCZig1HODFbhDUsarsAURO7TcOjVz6ZFfPqr1HzYrfjCXpMuVD5TlEG5bFGGg==;"
     },
     "CosmosDep": {
       "ConnectionString": "AccountEndpoint=https://cdhabookdep-free.documents.azure.cn:443/;AccountKey=JTUVk92Gjsx17L0xqxn0X4wX2thDPMKiw4daeTyV1HzPb6JmBeHdtFY1MF1jdctW1ofgzqkDMFOtcqS46by31A==;"
     },
     "Redis": {
+      //"ConnectionString": "106.12.23.251:6379,password=habook,ssl=false,abortConnect=False,writeBuffer=10240"
       "ConnectionString": "CoreRedisCN.redis.cache.chinacloudapi.cn:6380,password=LyJWP1ORJdv+poXWofAF97lhCEQPg1wXWqvtzXGXQuE=,ssl=True,abortConnect=False"
-      //"ConnectionString": "CoreRedisCN.redis.cache.chinacloudapi.cn:6380,password=LyJWP1ORJdv+poXWofAF97lhCEQPg1wXWqvtzXGXQuE=,ssl=True,abortConnect=False,defaultDatabase=8,writeBuffer=10240,poolsize=50"
     },
     "ServiceBus": {
       "ConnectionString": "Endpoint=sb://teammodelos.servicebus.chinacloudapi.cn/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=Sy4h4EQ8zP+7w/lOLi1X3tGord/7ShFHimHs1vC50Dc=",
-      "Topics": [
-        {
-          "Name": "test_topic_ActiveTask",
-          "Subscribe": [ "test_topic_ReciveTask" ]
-        }
-      ]
+      "ActiveTask": "dep-active-task",
+      "NoticeTask": "dep-notice-task"
     }
   },
   "HaBookAuth": {
-    "TeamModelRegistUrl": "https://account.habookaclass.biz/regist?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJsb2dpbiIsImF1ZCI6ImNoZW5nZHVMb2dpbiIsImlzcyI6Imh0dHBzOi8vYXBpLmhhYm9va2FjbGFzcy5iaXoiLCJpYXQiOjE1MzYxMzUwNDcsIm5iZiI6MTUzNjEzNTA0NywiZXhwIjoxNTY3NTU1MjAwLCJpZHAiOiJIYWJvb2sgQ29yZVNlcnZpY2UifQ.F4AnkbJrMRoZvJ6SC-lqZEYIYSoq5x8lvX6_a3YqSgM&callback=",
-    "TeamModelLoginUrl": "https://account.habookaclass.biz/?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJsb2dpbiIsImF1ZCI6ImNoZW5nZHVMb2dpbiIsImlzcyI6Imh0dHBzOi8vYXBpLmhhYm9va2FjbGFzcy5iaXoiLCJpYXQiOjE1MzYxMzUwNDcsIm5iZiI6MTUzNjEzNTA0NywiZXhwIjoxNTY3NTU1MjAwLCJpZHAiOiJIYWJvb2sgQ29yZVNlcnZpY2UifQ.F4AnkbJrMRoZvJ6SC-lqZEYIYSoq5x8lvX6_a3YqSgM&callback=",
-    "AccountUrl": "https://api.habookaclass.biz/account",
-    "ServiceUrl": "https://api.habookaclass.biz/service",
-    "UserInfoKey": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJpZCIsImF1ZCI6ImNoZW5nZHVJZCIsImlzcyI6Imh0dHBzOi8vYXBpLmhhYm9va2FjbGFzcy5iaXoiLCJpYXQiOjE1MzYwNTIzNjcsIm5iZiI6MTUzNjA1MjM2NywiZXhwIjoxNTY3NTU1MjAwLCJpZHAiOiJIYWJvb2sgQ29yZVNlcnZpY2UifQ.RGKDVtwFEp4OBctlHOuF6yqyI21fTz4cinCxjFCxkSQ",
-    "SchoolCodeKey": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJzY2hvb2xDb2RlIiwiYXVkIjoiY2hlbmdkdVNjaG9vbENvZGUiLCJpc3MiOiJodHRwczovL2FwaS5oYWJvb2thY2xhc3MuYml6IiwiaWF0IjoxNTM2MDUyNDI3LCJuYmYiOjE1MzYwNTI0MjcsImV4cCI6MTU2NzU1NTIwMCwiaWRwIjoiSGFib29rIENvcmVTZXJ2aWNlIn0.8m5VH3Nz4N9EdMz8AexTOEuDVitcJZFKy9DfW_UQkSY",
-    "SmsKey": "Basic ZmYwMWM0YTJjODdmZmNkYTUyNjhmMDEwOmE0YTE5YTVjNTU2ZWVhZTNjZmZhNTI0Mg==",
-    "IES5Auth": {
-      "token": {
-        "grant_type": "driver",
-        "client_id": "c7317f88-7cea-4e48-ac57-a16071f7b884",
-        "client_secret": "kguxh:V.PLmxBdaI@jnrTrDSth]A3346"
-      },
-      "refresh_token": {
-        "grant_type": "refresh_token",
-        "client_id": "c7317f88-7cea-4e48-ac57-a16071f7b884",
-        "refresh_token": "{access_token}"
-      },
-      "url": "https://api2.teammodel.cn/oauth2/token"
-    },
     "CoreId": {
       "userinfo": "https://api2.teammodel.cn/Oauth2/GetUserInfos"
     },
     "CoreService": {
       "deviceinfo": "https://api2.teammodel.net/oauth2/getdeviceinfos"
     }
-  },
-  "SmsSendCloud": {
-    "SmsUrl": "http://www.sendcloud.net/smsapi/send",
-    "SmsUser": "Chengdu",
-    "SmsKey": "XaHPbnPLd0NPTfnUCUD5cRlhY2nEEUCj"
-  },
-  "BasicRouter": "{\"data\":[{\"name\":\"testschooldashboard\",\"path\":\"testschooldashboard\",\"component\":\"smartschooldashboard/Index.vue\"},{\"name\":\"testschool\",\"path\":\"testschool\",\"component\":\"school-mgmt/Index.vue\",\"children\":[{\"name\":\"system\",\"path\":\"system\",\"component\":\"school-mgmt/SystemSetting/SystemSetting.vue\"},{\"name\":\"classroom\",\"path\":\"classroom\",\"component\":\"school-mgmt/ClassroomSetting/ClassroomSetting.vue\"}]}]}"
+  }
 }

+ 3 - 37
TEAMModelOS/appsettings.json

@@ -22,10 +22,6 @@
     "Storage": {
       "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=teammodelstorage;AccountKey=Yq7D4dE6cFuer2d2UZIccTA/i0c3sJ/6ITc8tNOyW+K5f+/lWw9GCos3Mxhj47PyWQgDL8YbVD63B9XcGtrMxQ==;EndpointSuffix=core.chinacloudapi.cn"
     },
-    "Blob": {
-      "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=teammodelstorage;AccountKey=Yq7D4dE6cFuer2d2UZIccTA/i0c3sJ/6ITc8tNOyW+K5f+/lWw9GCos3Mxhj47PyWQgDL8YbVD63B9XcGtrMxQ==;EndpointSuffix=core.chinacloudapi.cn",
-      "Container": "teammodelos"
-    },
     "Cosmos": {
       "ConnectionString": "AccountEndpoint=https://teammodelos.documents.azure.cn:443/;AccountKey=clF73GwPECfP1lKZTCvs8gLMMyCZig1HODFbhDUsarsAURO7TcOjVz6ZFfPqr1HzYrfjCXpMuVD5TlEG5bFGGg==;"
     },
@@ -37,46 +33,16 @@
     },
     "ServiceBus": {
       "ConnectionString": "Endpoint=sb://teammodelos.servicebus.chinacloudapi.cn/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=Sy4h4EQ8zP+7w/lOLi1X3tGord/7ShFHimHs1vC50Dc=",
-      "Topics": [
-        {
-          "Name": "test_topic_ActiveTask",
-          "Subscribe": [ "test_topic_ReciveTask" ]
-        }
-      ]
+      "ActiveTask": "active-task",
+      "NoticeTask": "notice-task"
     }
   },
   "HaBookAuth": {
-    "TeamModelRegistUrl": "https://account.habookaclass.biz/regist?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJsb2dpbiIsImF1ZCI6ImNoZW5nZHVMb2dpbiIsImlzcyI6Imh0dHBzOi8vYXBpLmhhYm9va2FjbGFzcy5iaXoiLCJpYXQiOjE1MzYxMzUwNDcsIm5iZiI6MTUzNjEzNTA0NywiZXhwIjoxNTY3NTU1MjAwLCJpZHAiOiJIYWJvb2sgQ29yZVNlcnZpY2UifQ.F4AnkbJrMRoZvJ6SC-lqZEYIYSoq5x8lvX6_a3YqSgM&callback=",
-    "TeamModelLoginUrl": "https://account.habookaclass.biz/?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJsb2dpbiIsImF1ZCI6ImNoZW5nZHVMb2dpbiIsImlzcyI6Imh0dHBzOi8vYXBpLmhhYm9va2FjbGFzcy5iaXoiLCJpYXQiOjE1MzYxMzUwNDcsIm5iZiI6MTUzNjEzNTA0NywiZXhwIjoxNTY3NTU1MjAwLCJpZHAiOiJIYWJvb2sgQ29yZVNlcnZpY2UifQ.F4AnkbJrMRoZvJ6SC-lqZEYIYSoq5x8lvX6_a3YqSgM&callback=",
-    "AccountUrl": "https://api.habookaclass.biz/account",
-    "ServiceUrl": "https://api.habookaclass.biz/service",
-    "UserInfoKey": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJpZCIsImF1ZCI6ImNoZW5nZHVJZCIsImlzcyI6Imh0dHBzOi8vYXBpLmhhYm9va2FjbGFzcy5iaXoiLCJpYXQiOjE1MzYwNTIzNjcsIm5iZiI6MTUzNjA1MjM2NywiZXhwIjoxNTY3NTU1MjAwLCJpZHAiOiJIYWJvb2sgQ29yZVNlcnZpY2UifQ.RGKDVtwFEp4OBctlHOuF6yqyI21fTz4cinCxjFCxkSQ",
-    "SchoolCodeKey": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJzY2hvb2xDb2RlIiwiYXVkIjoiY2hlbmdkdVNjaG9vbENvZGUiLCJpc3MiOiJodHRwczovL2FwaS5oYWJvb2thY2xhc3MuYml6IiwiaWF0IjoxNTM2MDUyNDI3LCJuYmYiOjE1MzYwNTI0MjcsImV4cCI6MTU2NzU1NTIwMCwiaWRwIjoiSGFib29rIENvcmVTZXJ2aWNlIn0.8m5VH3Nz4N9EdMz8AexTOEuDVitcJZFKy9DfW_UQkSY",
-    "SmsKey": "Basic ZmYwMWM0YTJjODdmZmNkYTUyNjhmMDEwOmE0YTE5YTVjNTU2ZWVhZTNjZmZhNTI0Mg==",
-    "IES5Auth": {
-      "token": {
-        "grant_type": "driver",
-        "client_id": "c7317f88-7cea-4e48-ac57-a16071f7b884",
-        "client_secret": "kguxh:V.PLmxBdaI@jnrTrDSth]A3346"
-      },
-      "refresh_token": {
-        "grant_type": "refresh_token",
-        "client_id": "c7317f88-7cea-4e48-ac57-a16071f7b884",
-        "refresh_token": "{access_token}"
-      },
-      "url": "https://api2.teammodel.cn/oauth2/token"
-    },
     "CoreId": {
       "userinfo": "https://api2.teammodel.cn/Oauth2/GetUserInfos"
     },
     "CoreService": {
       "deviceinfo": "https://api2.teammodel.net/oauth2/getdeviceinfos"
     }
-    },
-  "SmsSendCloud": {
-    "SmsUrl": "http://www.sendcloud.net/smsapi/send",
-    "SmsUser": "Chengdu",
-    "SmsKey": "XaHPbnPLd0NPTfnUCUD5cRlhY2nEEUCj"
-  },
-  "BasicRouter": "{\"data\":[{\"name\":\"testschooldashboard\",\"path\":\"testschooldashboard\",\"component\":\"smartschooldashboard/Index.vue\"},{\"name\":\"testschool\",\"path\":\"testschool\",\"component\":\"school-mgmt/Index.vue\",\"children\":[{\"name\":\"system\",\"path\":\"system\",\"component\":\"school-mgmt/SystemSetting/SystemSetting.vue\"},{\"name\":\"classroom\",\"path\":\"classroom\",\"component\":\"school-mgmt/ClassroomSetting/ClassroomSetting.vue\"}]}]}"
+  }
 }