Browse Source

Merge branch 'develop' of http://52.130.252.100:10000/TEAMMODEL/TEAMModelOS into develop

OnePsycho 1 year ago
parent
commit
c5e30c8d4a

+ 1 - 1
TEAMModelBI/ClientApp/src/view/schoolmanage/schoolAnalyse.vue

@@ -2832,7 +2832,7 @@ export default {
 .class-info,
 .class-total {
   width: 100%;
-  padding: 0.5% 1%;
+  padding: 1%;
   display: flex;
   flex-wrap: nowrap;
   justify-content: space-between;

+ 0 - 113
TEAMModelBI/Properties/ServiceDependencies/teammodelbi-rc - Web Deploy/profile.arm.json

@@ -1,113 +0,0 @@
-{
-  "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
-  "contentVersion": "1.0.0.0",
-  "metadata": {
-    "_dependencyType": "compute.appService.windows"
-  },
-  "parameters": {
-    "resourceGroupName": {
-      "type": "string",
-      "defaultValue": "TEAMModelChengdu",
-      "metadata": {
-        "description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking."
-      }
-    },
-    "resourceGroupLocation": {
-      "type": "string",
-      "defaultValue": "",
-      "metadata": {
-        "description": "Location of the resource group. Resource groups could have different location than resources, however by default we use API versions from latest hybrid profile which support all locations for resource types we support."
-      }
-    },
-    "resourceName": {
-      "type": "string",
-      "defaultValue": "rc",
-      "metadata": {
-        "description": "Name of the main resource to be created by this template."
-      }
-    },
-    "resourceLocation": {
-      "type": "string",
-      "defaultValue": "[parameters('resourceGroupLocation')]",
-      "metadata": {
-        "description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there."
-      }
-    }
-  },
-  "variables": {
-    "appServicePlan_name": "[concat('Plan', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
-    "appServicePlan_ResourceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Web/serverFarms/', variables('appServicePlan_name'))]"
-  },
-  "resources": [
-    {
-      "type": "Microsoft.Resources/resourceGroups",
-      "name": "[parameters('resourceGroupName')]",
-      "location": "[parameters('resourceGroupLocation')]",
-      "apiVersion": "2019-10-01"
-    },
-    {
-      "type": "Microsoft.Resources/deployments",
-      "name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
-      "resourceGroup": "[parameters('resourceGroupName')]",
-      "apiVersion": "2019-10-01",
-      "dependsOn": [
-        "[parameters('resourceGroupName')]"
-      ],
-      "properties": {
-        "mode": "Incremental",
-        "template": {
-          "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
-          "contentVersion": "1.0.0.0",
-          "resources": [
-            {
-              "location": "[parameters('resourceLocation')]",
-              "name": "[parameters('resourceName')]",
-              "type": "Microsoft.Web/sites",
-              "apiVersion": "2015-08-01",
-              "tags": {
-                "[concat('hidden-related:', variables('appServicePlan_ResourceId'))]": "empty"
-              },
-              "dependsOn": [
-                "[variables('appServicePlan_ResourceId')]"
-              ],
-              "kind": "app",
-              "properties": {
-                "name": "[parameters('resourceName')]",
-                "kind": "app",
-                "httpsOnly": true,
-                "reserved": false,
-                "serverFarmId": "[variables('appServicePlan_ResourceId')]",
-                "siteConfig": {
-                  "metadata": [
-                    {
-                      "name": "CURRENT_STACK",
-                      "value": "dotnetcore"
-                    }
-                  ]
-                }
-              },
-              "identity": {
-                "type": "SystemAssigned"
-              }
-            },
-            {
-              "location": "[parameters('resourceLocation')]",
-              "name": "[variables('appServicePlan_name')]",
-              "type": "Microsoft.Web/serverFarms",
-              "apiVersion": "2015-08-01",
-              "sku": {
-                "name": "S1",
-                "tier": "Standard",
-                "family": "S",
-                "size": "S1"
-              },
-              "properties": {
-                "name": "[variables('appServicePlan_name')]"
-              }
-            }
-          ]
-        }
-      }
-    }
-  ]
-}

+ 3 - 3
TEAMModelBI/TEAMModelBI.csproj

@@ -65,9 +65,9 @@
 		<SpaRoot>ClientApp\</SpaRoot>
 		<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
 		<UserSecretsId>078b5d89-7d90-4f6a-88fc-7d96025990a8</UserSecretsId>
-		<Version>5.2311.8</Version>
-		<AssemblyVersion>5.2311.8.1</AssemblyVersion>
-		<FileVersion>5.2311.8.1</FileVersion>
+		<Version>5.2311.15</Version>
+		<AssemblyVersion>5.2311.15.1</AssemblyVersion>
+		<FileVersion>5.2311.15.1</FileVersion>
 		<Description>TEAMModelBI(BI)</Description>
 		<PackageReleaseNotes>BI版本说明版本切换标记2022000908</PackageReleaseNotes>
 		<PackageId>TEAMModelBI</PackageId>

+ 27 - 8
TEAMModelOS.FunctionV4/CosmosDB/TriggerExam.cs

@@ -1587,22 +1587,25 @@ namespace TEAMModelOS.FunctionV4
                         index_json = await _azureStorage.GetBlobContainerClient($"{info.creatorId}").GetBlobClient($"{info.papers[no].blob}/index.json").DownloadContentAsync();
                     }
                     //BlobDownloadResult index_json = await _azureStorage.GetBlobContainerClient($"{info.school}").GetBlobClient($"{info.papers[no].blob}/index.json").DownloadContentAsync();
-                    JObject jo = JObject.Parse(index_json.Content.ToString());
-                    JArray array = jo.Value<JArray>("slides");
+                    //JObject jo = JObject.Parse(new MemoryStream(Encoding.UTF8.GetBytes(index_json.Content.ToString())).ToString());
+                    JsonElement RecordingJson = JsonDocument.Parse(new MemoryStream(Encoding.UTF8.GetBytes(index_json.Content.ToString()))).RootElement;
+                    RecordingJson.TryGetProperty("slides", out JsonElement slides);
+                    var sdes = slides.ToObject<List<Slides>>();
                     List<string> attachments = new List<string>();
                     if (info.qamode == 1) {
-                        attachments = jo.Value<JArray>("attachments")?.ToObject<List<string>>();
+                        attachments = RecordingJson.GetProperty("attachments").ToObject<List<string>>();
                         if (attachments.Count == 0)
                         {
                             return;
                         }
                     }
                     List<string> urls = new();
-                    foreach (var ne in array)
+                  
+                    foreach (var ne in sdes)
                     {
-                        if (!ne["type"].ToString().Equals("compose"))
+                        if (!ne.type.Equals("compose"))
                         {
-                            urls.Add(ne["url"].ToString());
+                            urls.Add(ne.url);
                         }
                     }
                     
@@ -1693,12 +1696,12 @@ namespace TEAMModelOS.FunctionV4
                         if(location.Equals("China")) //大陸正式站
                         {
                             urlAction = "https://malearn.teammodel.cn";
-                            accessKey = "QUzQqbqbnLsTDTeaJy4Br6wUuqPoAlKpzRK2S6PGImRHAzFuySGAeA==";
+                            accessKey = "2BcXFR_hvzG1pZjqIkaM7Dx74Hcu6m0PwwOacFpDpq44AzFuHJBRXA==";
                         }
                         else if(location.Equals("China-Dep") || location.Equals("China-Test")) //大陸測試站
                         {
                             urlAction = "https://malearn-rc.teammodel.cn";
-                            accessKey = "hESc0g7Q60FTEss4ZnVXPB61S1a8WlAXIq5ULl3T3oTxAzFunpLDwA==";
+                            accessKey = "lghWhJduNiAlo-e8isqEoROjdR7DAC-50XNtanIwHKYlAzFu1aog_A==";
                         }                        
                     }
                     else if (location.Contains("Global"))
@@ -1741,5 +1744,21 @@ namespace TEAMModelOS.FunctionV4
             public int total { get; set; }
             public double qrate { get; set; }
         }
+
+        public class Slides
+        {
+            public string url { get; set; }
+            public string type { get; set; }
+            public Scoring scoring { get; set; } = new Scoring();
+        }
+
+        public class Scoring
+        {
+            public double score { get; set; }
+            public List<string> knowledge { get; set; } = new List<string>();
+            public int field { get; set; } = new();
+            public List<string> ans { get; set; } = new List<string>();
+        }
+
     }
 }

+ 0 - 174
TEAMModelOS.FunctionV4/Properties/ServiceDependencies/TEAMModelFunction - Zip Deploy/profile.arm.json

@@ -1,174 +0,0 @@
-{
-  "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
-  "contentVersion": "1.0.0.0",
-  "metadata": {
-    "_dependencyType": "compute.function.windows.appService"
-  },
-  "parameters": {
-    "resourceGroupName": {
-      "type": "string",
-      "defaultValue": "TEAMModelChengdu",
-      "metadata": {
-        "description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking."
-      }
-    },
-    "resourceGroupLocation": {
-      "type": "string",
-      "defaultValue": "",
-      "metadata": {
-        "description": "Location of the resource group. Resource groups could have different location than resources, however by default we use API versions from latest hybrid profile which support all locations for resource types we support."
-      }
-    },
-    "resourceName": {
-      "type": "string",
-      "defaultValue": "TEAMModelFunction",
-      "metadata": {
-        "description": "Name of the main resource to be created by this template."
-      }
-    },
-    "resourceLocation": {
-      "type": "string",
-      "defaultValue": "[parameters('resourceGroupLocation')]",
-      "metadata": {
-        "description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there."
-      }
-    }
-  },
-  "resources": [
-    {
-      "type": "Microsoft.Resources/resourceGroups",
-      "name": "[parameters('resourceGroupName')]",
-      "location": "[parameters('resourceGroupLocation')]",
-      "apiVersion": "2019-10-01"
-    },
-    {
-      "type": "Microsoft.Resources/deployments",
-      "name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
-      "resourceGroup": "[parameters('resourceGroupName')]",
-      "apiVersion": "2019-10-01",
-      "dependsOn": [
-        "[parameters('resourceGroupName')]"
-      ],
-      "properties": {
-        "mode": "Incremental",
-        "expressionEvaluationOptions": {
-          "scope": "inner"
-        },
-        "parameters": {
-          "resourceGroupName": {
-            "value": "[parameters('resourceGroupName')]"
-          },
-          "resourceGroupLocation": {
-            "value": "[parameters('resourceGroupLocation')]"
-          },
-          "resourceName": {
-            "value": "[parameters('resourceName')]"
-          },
-          "resourceLocation": {
-            "value": "[parameters('resourceLocation')]"
-          }
-        },
-        "template": {
-          "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
-          "contentVersion": "1.0.0.0",
-          "parameters": {
-            "resourceGroupName": {
-              "type": "string"
-            },
-            "resourceGroupLocation": {
-              "type": "string"
-            },
-            "resourceName": {
-              "type": "string"
-            },
-            "resourceLocation": {
-              "type": "string"
-            }
-          },
-          "variables": {
-            "storage_name": "[toLower(concat('storage', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId))))]",
-            "appServicePlan_name": "[concat('Plan', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
-            "storage_ResourceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Storage/storageAccounts/', variables('storage_name'))]",
-            "appServicePlan_ResourceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Web/serverFarms/', variables('appServicePlan_name'))]",
-            "function_ResourceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Web/sites/', parameters('resourceName'))]"
-          },
-          "resources": [
-            {
-              "location": "[parameters('resourceLocation')]",
-              "name": "[parameters('resourceName')]",
-              "type": "Microsoft.Web/sites",
-              "apiVersion": "2015-08-01",
-              "tags": {
-                "[concat('hidden-related:', variables('appServicePlan_ResourceId'))]": "empty"
-              },
-              "dependsOn": [
-                "[variables('appServicePlan_ResourceId')]",
-                "[variables('storage_ResourceId')]"
-              ],
-              "kind": "functionapp",
-              "properties": {
-                "name": "[parameters('resourceName')]",
-                "kind": "functionapp",
-                "httpsOnly": true,
-                "reserved": false,
-                "serverFarmId": "[variables('appServicePlan_ResourceId')]",
-                "siteConfig": {
-                  "alwaysOn": true
-                }
-              },
-              "identity": {
-                "type": "SystemAssigned"
-              },
-              "resources": [
-                {
-                  "name": "appsettings",
-                  "type": "config",
-                  "apiVersion": "2015-08-01",
-                  "dependsOn": [
-                    "[variables('function_ResourceId')]"
-                  ],
-                  "properties": {
-                    "AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storage_name'), ';AccountKey=', listKeys(variables('storage_ResourceId'), '2017-10-01').keys[0].value, ';EndpointSuffix=', 'core.windows.net')]",
-                    "FUNCTIONS_EXTENSION_VERSION": "~3",
-                    "FUNCTIONS_WORKER_RUNTIME": "dotnet"
-                  }
-                }
-              ]
-            },
-            {
-              "location": "[parameters('resourceGroupLocation')]",
-              "name": "[variables('storage_name')]",
-              "type": "Microsoft.Storage/storageAccounts",
-              "apiVersion": "2017-10-01",
-              "tags": {
-                "[concat('hidden-related:', concat('/providers/Microsoft.Web/sites/', parameters('resourceName')))]": "empty"
-              },
-              "properties": {
-                "supportsHttpsTrafficOnly": true
-              },
-              "sku": {
-                "name": "Standard_LRS"
-              },
-              "kind": "Storage"
-            },
-            {
-              "location": "[parameters('resourceGroupLocation')]",
-              "name": "[variables('appServicePlan_name')]",
-              "type": "Microsoft.Web/serverFarms",
-              "apiVersion": "2015-08-01",
-              "sku": {
-                "name": "S1",
-                "tier": "Standard",
-                "family": "S",
-                "size": "S1"
-              },
-              "properties": {
-                "name": "[variables('appServicePlan_name')]"
-              }
-            }
-          ]
-        }
-      }
-    }
-  ]
-}

+ 0 - 3
TEAMModelOS.FunctionV4/Properties/serviceDependencies.TEAMModelFunction - Zip Deploy.json

@@ -1,3 +0,0 @@
-{
-  "dependencies": {}
-}

+ 3 - 3
TEAMModelOS.FunctionV4/TEAMModelOS.FunctionV4.csproj

@@ -5,9 +5,9 @@
 		<OutputType>Exe</OutputType>
 		<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
 		<SignAssembly>true</SignAssembly>
-		<Version>5.2311.8</Version>
-		<AssemblyVersion>5.2311.8.1</AssemblyVersion>
-		<FileVersion>5.2311.8.1</FileVersion>
+		<Version>5.2311.15</Version>
+		<AssemblyVersion>5.2311.15.1</AssemblyVersion>
+		<FileVersion>5.2311.15.1</FileVersion>
 		<PackageId>TEAMModelOS.FunctionV4</PackageId>
 		<Authors>teammodel</Authors>
 		<Company>醍摩豆(成都)信息技术有限公司</Company>

+ 29 - 74
TEAMModelOS.SDK/DI/AzureCosmos/AzureCosmosExtensions.cs

@@ -65,7 +65,7 @@ namespace TEAMModelOS.SDK.DI
             int totalCount = 0;
             await foreach (var item in container.GetItemQueryStreamIterator(
                 queryText: $"SELECT VALUE COUNT(1) From c {queryWhere}",
-                requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey(partitionkey), MaxItemCount = -1 }))
+                requestOptions: new QueryRequestOptions() { PartitionKey =!string.IsNullOrWhiteSpace(partitionkey) ? new PartitionKey(partitionkey) : null , MaxItemCount = -1 }))
             {
                 using var json = await JsonDocument.ParseAsync(item.ContentStream);
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
@@ -114,17 +114,12 @@ namespace TEAMModelOS.SDK.DI
             }
             return responses;
         }
-        public static async Task<CosmosDBResult<T>> GetList<T>(this CosmosContainer container, QueryDefinition  queryDefinition, string partitionkey, string? continuationToken = null, int? pageSize = null)
+        public static async Task<CosmosDBResult<T>> GetList<T>(this CosmosContainer container, QueryDefinition  queryDefinition, string partitionkey= null, string continuationToken = null, int? pageSize = null)
         {
             List<T> list = new List<T>();
             double RU = 0;
-            if (string.IsNullOrWhiteSpace(partitionkey))
-            {
-                return (new CosmosDBResult<T> { list = list, ru = RU, continuationToken = continuationToken });
-            }
-
             await foreach (var item in container.GetItemQueryStreamIterator(queryDefinition: queryDefinition, continuationToken: continuationToken,
-                requestOptions: new QueryRequestOptions { MaxItemCount = pageSize, PartitionKey = new PartitionKey(partitionkey) }))
+                requestOptions: new QueryRequestOptions { MaxItemCount = pageSize, PartitionKey =!string.IsNullOrWhiteSpace(partitionkey) ? new PartitionKey(partitionkey) : null }))
             {
                 using var json = await JsonDocument.ParseAsync(item.ContentStream);
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
@@ -154,85 +149,45 @@ namespace TEAMModelOS.SDK.DI
             return (new CosmosDBResult<T> { list = list, ru = RU, continuationToken = continuationToken }); ;
         }
 
-        public static async Task<CosmosDBResult<T>> GetList<T>(this CosmosContainer container, string sql, string partitionkey, string? continuationToken = null, int? pageSize = null)
+        public static async Task<CosmosDBResult<T>> GetList<T>(this CosmosContainer container, string sql, string partitionkey= null, string continuationToken = null, int? pageSize = null)
         {
             List<T> list = new List<T>();
             double RU = 0;
-            if (string.IsNullOrWhiteSpace(partitionkey))
+            try
             {
-                try
+
+                await foreach (var item in container.GetItemQueryStreamIterator(queryText: sql, continuationToken: continuationToken,
+                 requestOptions: new QueryRequestOptions { MaxItemCount = pageSize, PartitionKey =!string.IsNullOrWhiteSpace(partitionkey)?new PartitionKey(partitionkey) : null}))
                 {
-                    await foreach (var item in container.GetItemQueryStreamIterator(queryText: sql, continuationToken: continuationToken,
-                     requestOptions: new QueryRequestOptions { MaxItemCount = pageSize }))
+                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                     {
-                        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())
-                            {
-                                list.Add(obj.ToObject<T>());
-                            }
-                        }
-                        if (sql.Contains(" distinct ", StringComparison.OrdinalIgnoreCase)
-                            || (sql.Contains("order ", StringComparison.OrdinalIgnoreCase)
-                            && !sql.Contains(".order ", StringComparison.OrdinalIgnoreCase)))
-                        {
-                            continuationToken = null;
-                        }
-                        else
-                        {
-                            continuationToken = item.GetContinuationToken();
-                        }
-                        RU += item.RU();
-                        if (pageSize.HasValue && pageSize.Value >= 0 && list.Count >= pageSize)
+                        foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
                         {
-                            break;
+                            list.Add(obj.ToObject<T>());
                         }
                     }
-                }
-                catch (Exception ex)
-                {
-                    Console.WriteLine(ex.ToString());
-                }
-            }
-            else {
-                try
-                {
-                    await foreach (var item in container.GetItemQueryStreamIterator(queryText: sql, continuationToken: continuationToken,
-                     requestOptions: new QueryRequestOptions { MaxItemCount = pageSize, PartitionKey = new PartitionKey(partitionkey) }))
+                    if (sql.Contains(" distinct ", StringComparison.OrdinalIgnoreCase)
+                        || (sql.Contains("order ", StringComparison.OrdinalIgnoreCase)
+                        && !sql.Contains(".order ", StringComparison.OrdinalIgnoreCase)))
                     {
-                        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())
-                            {
-                                list.Add(obj.ToObject<T>());
-                            }
-                        }
-                        if (sql.Contains(" distinct ", StringComparison.OrdinalIgnoreCase)
-                            || (sql.Contains("order ", StringComparison.OrdinalIgnoreCase)
-                            && !sql.Contains(".order ", StringComparison.OrdinalIgnoreCase)))
-                        {
-                            continuationToken = null;
-                        }
-                        else
-                        {
-                            continuationToken = item.GetContinuationToken();
-                        }
-                        RU += item.RU();
-                        if (pageSize.HasValue && pageSize.Value >= 0 && list.Count >= pageSize)
-                        {
-                            break;
-                        }
+                        continuationToken = null;
+                    }
+                    else
+                    {
+                        continuationToken = item.GetContinuationToken();
+                    }
+                    RU += item.RU();
+                    if (pageSize.HasValue && pageSize.Value >= 0 && list.Count >= pageSize)
+                    {
+                        break;
                     }
-                }
-                catch (Exception ex)
-                {
-                    Console.WriteLine(ex.ToString());
                 }
             }
-
-            
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.ToString());
+            }
             //记录日志,RU开销大于400(开发测试),1000(正式)
             return (new CosmosDBResult<T> { list = list, ru = RU, continuationToken = continuationToken }); ;
         }

+ 144 - 3
TEAMModelOS.SDK/Models/Service/StudentService.cs

@@ -22,7 +22,48 @@ namespace TEAMModelOS.SDK
 {
     public class StudentService
     {
+        public class StudentActivity
+        {
+
+            public string id { get; set; }
+            public string code { get; set; }
 
+            /// <summary>
+            /// 源数据的发布层级 类型 school  teacher
+            /// </summary>
+            public string owner { get; set; }
+          
+            public string pk {  get; set; }
+            //评测模式
+            public string source { get; set; }
+            public string name { get; set; }
+            public long startTime { get; set; }
+            public long endTime { get; set; }
+            public string scope { get; set; }
+            public string school { get; set; }
+            public string creatorId { get; set; }
+        
+            public List<string> subjects { get; set; }
+         
+            public List<string> classes { get; set; }
+            public List<string> stuLists { get; set; }
+            public List<string> tchLists { get; set; }
+            public long createTime { get; set; } = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
+            public Dictionary<string, JsonElement> ext { get; set; } = new Dictionary<string, JsonElement>();
+            /// 评分状态,0,未评分, 1已评分
+            public int sStatus { get; set; } = 0;
+            //评测 纸本1或者书面问答0
+            public int qamode { get; set; } = 0;
+            //标记作业活动是否比交
+            public bool mustSubmit { get; set; } = false;
+            //标记问卷是否重复提交 0 否 1 是
+            public int isSub { get; set; } = 0;
+            /// <summary>
+            /// 任务完成状态,-1 未参与,0,未完成, 1已完成
+            /// </summary>
+            public int taskStatus { get; set; } = -1;
+            public string recordUrl { get; set; }
+        }
 
         /// <summary>
         ///
@@ -35,8 +76,9 @@ namespace TEAMModelOS.SDK
         /// <param name="types">Exam ,Vote,Homework,Survey</param>
         /// <param name="_azureCosmos"></param>
         /// <param name="azureRedis"></param>
-        public static async void FindActivity(JsonElement request,string userId ,string userType, List<string>groupListIds, string school,List<string> types, AzureCosmosFactory _azureCosmos, AzureRedisFactory azureRedis)
+        public static async void FindActivity(JsonElement request,string userId ,string userType, List<string>groupListIds,List<string> subjects, string school,List<string> types, AzureCosmosFactory _azureCosmos, AzureRedisFactory azureRedis)
         {
+            string filed = "c.id ,c.code,c.owner,c.pk,c.qamode,c.name,c.school,c.startTime,c.endTime,c.classes,c.stuLists,c.tchLists,c.createTime,c.creatorId,c.ext,c.isSub,c.mustSubmit,c.sStatus,c.scope,c.source,c.subjects";
             if (string.IsNullOrWhiteSpace(school))
             {
                 if (request.TryGetProperty("school", out JsonElement schooljson))
@@ -47,7 +89,7 @@ namespace TEAMModelOS.SDK
                     }
                 }
             }
-            long stime = 0, etime = 0; 
+            long stime = DateTimeOffset.UtcNow.AddDays(-30).ToUnixTimeMilliseconds(), etime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); 
             if (request.TryGetProperty("stime", out JsonElement _stime))
             {
                 if (!_stime.ValueKind.Equals(JsonValueKind.Undefined) && !_stime.ValueKind.Equals(JsonValueKind.Null) && _stime.TryGetInt64(out long data))
@@ -62,10 +104,109 @@ namespace TEAMModelOS.SDK
                     etime= data;
                 }
             }
+            string code = null;
+            string  groupListSQL =string .Empty ;
 
-        }
 
+            if (groupListIds.IsNotEmpty())
+            {
+                List<string >  arrayStr= new List<string>();
+                groupListIds.ForEach(z => {
+                    arrayStr.Add($"array_contains(c.classes,'{z}') ");
+                    arrayStr.Add($"array_contains(c.stuLists,'{z}') ");
+                    arrayStr.Add($"array_contains(c.tchLists,'{z}') ");
+                });
+                groupListSQL= $"and ({string.Join(" or ", arrayStr)})";
+            }
+            else
+            {
+                throw new Exception("名单为空");
+            }
+            
+            List<StudentActivity> activities = new List<StudentActivity>();
+            if (types.IsEmpty()|| types.Contains("Exam")) {
+                string subjectSQL = "";
+                string subjectJoin = "";
+                if (subjects.IsNotEmpty()) {
+                    subjectJoin = "join s in c.subjects";
+                    subjectSQL = $" and  c.id in ({string.Join(",",subjects.Select(z=>$"'{z}'"))}) ";
+                }
+                StringBuilder SQL = new StringBuilder( $"select { filed} from c {subjectJoin} where c.pk='Exam' {subjectSQL} {groupListSQL} and c.createTime>={stime} and c.createTime <= {etime} and c.startTime <= {DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()}");
+                //获取学校发布的活动
+                if (userType.Equals(Constant.ScopeStudent)  && ! string.IsNullOrWhiteSpace(school)) {
+                   var resultSchool =   await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Common).GetList<StudentActivity>($"{SQL.ToString()}  and c.owner='school' ", $"Exam-{school}");
+                    activities.AddRange(resultSchool.list);
+                }
+                //获取教师发布的活动(个人名单,学校名单)
+                {
+                    var resultTeacher = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Common).GetList<StudentActivity>($"{SQL.ToString()}  and c.owner='teacher' ");
+                    activities.AddRange(resultTeacher.list);
+                }
+            }
+
+            if (types.IsEmpty()|| types.Contains("Vote"))
+            {
+               
+                StringBuilder SQL = new StringBuilder($"select {filed} from c  where c.pk='Vote' {groupListSQL} and c.createTime>={stime} and c.createTime <= {etime} and c.startTime <= {DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()}");
+                //获取学校发布的活动
+                if (userType.Equals(Constant.ScopeStudent)  && !string.IsNullOrWhiteSpace(school))
+                {
+                    var resultSchool = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Common).GetList<StudentActivity>($"{SQL.ToString()}  and c.owner='school' ", $"Vote-{school}");
+                    activities.AddRange(resultSchool.list);
+                }
+                //获取教师发布的活动(个人名单,学校名单)
+                {
+                    var resultTeacher = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Common).GetList<StudentActivity>($"{SQL.ToString()}  and c.owner='teacher' ");
+                    activities.AddRange(resultTeacher.list);
+                }
+            }
+            if (types.IsEmpty()|| types.Contains("Survey"))
+            {
+
+                StringBuilder SQL = new StringBuilder($"select {filed} from c  where c.pk='Survey' {groupListSQL} and c.createTime>={stime} and c.createTime <= {etime} and c.startTime <= {DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()}");
+                //获取学校发布的活动
+                if (userType.Equals(Constant.ScopeStudent)  && !string.IsNullOrWhiteSpace(school))
+                {
+                    var resultSchool = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Common).GetList<StudentActivity>($"{SQL.ToString()}  and c.owner='school' ", $"Survey-{school}");
+                    activities.AddRange(resultSchool.list);
+                }
+                //获取教师发布的活动(个人名单,学校名单)
+                {
+                    var resultTeacher = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Common).GetList<StudentActivity>($"{SQL.ToString()}  and c.owner='teacher' ");
+                    activities.AddRange(resultTeacher.list);
+                }
+            }
+            if (types.IsEmpty()|| types.Contains("Homework"))
+            {
+
+                StringBuilder SQL = new StringBuilder($"select {filed} from c  where c.pk='Homework' {groupListSQL} and c.createTime>={stime} and c.createTime <= {etime} and c.startTime <= {DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()}");
+                //获取学校发布的活动
+                if (userType.Equals(Constant.ScopeStudent)  && !string.IsNullOrWhiteSpace(school))
+                {
+                    var resultSchool = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Common).GetList<StudentActivity>($"{SQL.ToString()}  and c.owner='school' ", $"Homework-{school}");
+                    activities.AddRange(resultSchool.list);
+                }
+                //获取教师发布的活动(个人名单,学校名单)
+                {
+                    var resultTeacher = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Common).GetList<StudentActivity>($"{SQL.ToString()}  and c.owner='teacher' ");
+                    activities.AddRange(resultTeacher.list);
+                }
+            }
+            if (types.IsEmpty()|| types.Contains("Art"))
+            {
+
+                StringBuilder SQL = new StringBuilder($"select {filed} from c  where c.pk='Art' {groupListSQL} and c.createTime>={stime} and c.createTime <= {etime} and c.startTime <= {DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()}");
+                //获取学校发布的活动
+                if (userType.Equals(Constant.ScopeStudent)  && !string.IsNullOrWhiteSpace(school))
+                {
+                    var resultSchool = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Common).GetList<StudentActivity>($"{SQL.ToString()}  and c.school='school' ", $"Art-{school}");
+                    activities.AddRange(resultSchool.list);
+                }
+            }
+            //作答 记录recordUrl  taskStatus
+        }
 
+       
 
 
 

+ 3 - 3
TEAMModelOS.SDK/TEAMModelOS.SDK.csproj

@@ -2,9 +2,9 @@
 
   <PropertyGroup>
     <TargetFramework>net6.0</TargetFramework>
-    <Version>5.2311.8</Version>
-    <AssemblyVersion>5.2311.8.1</AssemblyVersion>
-    <FileVersion>5.2311.8.1</FileVersion>
+    <Version>5.2311.15</Version>
+    <AssemblyVersion>5.2311.15.1</AssemblyVersion>
+    <FileVersion>5.2311.15.1</FileVersion>
     <PackageReleaseNotes>发版</PackageReleaseNotes>
   </PropertyGroup>
 

+ 5 - 3
TEAMModelOS/ClientApp/src/view/student-web/AppNew.vue

@@ -75,7 +75,8 @@
                     </Tooltip>
                     <!-- 作业 -->
                     <Tooltip :content="$t('studentWeb.type.homework')">
-                        <MenuItem name="6" to="/studentWeb/homeworkView" v-show="selectClass && !isScale">
+                        <MenuItem name="6" to="/studentWeb/homeworkView"
+                                v-show="getNowCourse && getNowCourse.id && !onlySystem && getNowCourse.subject && selectClass && !isScale">
                             <svg-icon icon-class="doc" class="tabIcon3" />
                             <span class="no-show" v-show="MyNo != 6">{{ $t('studentWeb.type.homework') }}</span>
                         </MenuItem>
@@ -116,7 +117,8 @@
                     </MenuItem> -->
                     <!-- 成绩 -->
                     <Tooltip :content="$t('studentWeb.type.achievement')">
-                        <MenuItem name="7" to="/studentWeb/achievement" v-show="getNowCourse && getNowCourse.id && !onlySystem && getNowCourse.subject && selectClass && !isScale">
+                        <MenuItem name="7" to="/studentWeb/achievement"
+                                v-show="getNowCourse && getNowCourse.id && !onlySystem && getNowCourse.subject && selectClass && !isScale">
                             <Icon custom="iconfont icon-chengjitongji" size="18" style="font-weight: bold" />
                             <span class="no-show" v-show="MyNo != 7">{{ $t('studentWeb.type.achievement') }}</span>
                         </MenuItem>
@@ -793,7 +795,7 @@ export default {
         classChange(value) {
             if(value) {
                 // 没有课程 && 行政班未加入课程
-                if((this.onlySystem || this.courseList[this.selectClass - 1].isSystem) && this.noJumpRouter.includes(this.$route.path)) {
+                if((this.onlySystem || this.courseList[this.selectClass - 1].subjectList) && this.noJumpRouter.includes(this.$route.path)) {
                     this.$router.push({
                         path: '/studentWeb/examView'
                     })

+ 4 - 4
TEAMModelOS/TEAMModelOS.csproj

@@ -74,11 +74,11 @@
     <SpaRoot>ClientApp\</SpaRoot>
     <DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
     <UserSecretsId>078b5d89-7d90-4f6a-88fc-7d96025990a8</UserSecretsId>
-    <Version>5.2311.8</Version>
-    <AssemblyVersion>5.2311.8.1</AssemblyVersion>
-    <FileVersion>5.2311.8.1</FileVersion>
+    <Version>5.2311.15</Version>
+    <AssemblyVersion>5.2311.15.1</AssemblyVersion>
+    <FileVersion>5.2311.15.1</FileVersion>
     <Description>TEAMModelOS(IES5)</Description>
-    <PackageReleaseNotes>IES版本说明版本切换标记5.2311.8.1</PackageReleaseNotes>
+    <PackageReleaseNotes>IES版本说明版本切换标记5.2311.15.1</PackageReleaseNotes>
     <PackageId>TEAMModelOS</PackageId>
     <Authors>teammodel</Authors>
     <Company>醍摩豆(成都)信息技术有限公司</Company>

+ 1 - 1
TEAMModelOS/appsettings.Development.json

@@ -18,7 +18,7 @@
     "IdTokenSalt": "8263692E2213497BB55E74792B7900B4",
     "HttpTrigger": "https://teammodelosfunction-test.chinacloudsites.cn/api/",
     //"HttpTrigger": "http://localhost:7071/api/"
-    "Version": "5.2311.8.1"
+    "Version": "5.2311.15.1"
   },
   "Azure": {
     // 测试站数据库

+ 1 - 1
TEAMModelOS/appsettings.json

@@ -18,7 +18,7 @@
     "Exp": 86400,
     "IdTokenSalt": "8263692E2213497BB55E74792B7900B4",
     "HttpTrigger": "https://teammodelosfunction.chinacloudsites.cn/api/",
-    "Version": "5.2311.8.1"
+    "Version": "5.2311.15.1"
   },
   "Azure": {
     "Storage": {