CrazyIter_Bin пре 3 година
родитељ
комит
037bd5b831

+ 3 - 1
TEAMModelFunction/ScsApisHttpTrigger.cs

@@ -69,7 +69,6 @@ namespace TEAMModelFunction
                 yxtrain.Add(item);
             }
             string sql = $" SELECT value(c) FROM c where ARRAY_LENGTH(c.binds)>0 ";
-
             List<Teacher> teachers = new List<Teacher>();
             await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<Teacher>(queryText: sql,
                 requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base") }))
@@ -83,6 +82,9 @@ namespace TEAMModelFunction
             return new OkObjectResult(new { });
         }
 
+
+
+
         /// <summary>
         /// 
         /// </summary>

+ 3 - 0
TEAMModelOS.SDK/Models/Service/FixDataService.cs

@@ -27,6 +27,9 @@ namespace TEAMModelOS.SDK.Models.Service
         /// <returns></returns>
         public static async Task<List<Student>> FixStudentInfo(CosmosClient client, DingDing _dingDing, AzureStorageFactory _azureStorage, JsonElement data)
         {
+
+            
+
             var code = data.GetProperty("code").GetString();
             var ids = data.GetProperty("ids").ToObject<List<string>>();
             var dict = data.GetProperty("dict").ToObject<Dictionary<string, object>>();

Разлика између датотеке није приказан због своје велике величине
+ 25 - 22
TEAMModelOS/Controllers/Third/ScController.cs


+ 6 - 3
TEAMModelOS/Controllers/XTest/FixDataController.cs

@@ -28,6 +28,7 @@ using Azure;
 using Microsoft.Extensions.Options;
 using Microsoft.Extensions.Configuration;
 using TEAMModelOS.Models;
+using System.Text.RegularExpressions;
 
 namespace TEAMModelOS.Controllers
 {
@@ -54,16 +55,18 @@ namespace TEAMModelOS.Controllers
         }
 
         /// <summary>
-        /// 测试blob多线程写入同一个文件
+        /// 批量导入自动加入学校
         /// </summary>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("fix-joinschool")]
         public async Task<IActionResult> GenerateSchoolCodes(JsonElement json)
         {
+           
             JsonElement _teachers =json.GetProperty("teachers");
-            
-            List<JoinSchool> joins= _teachers.ToObject<List<JoinSchool>>();
+            string jsons = _teachers.ToJsonString();
+            jsons = Regex.Replace(jsons, @"\s", "");
+            List<JoinSchool> joins= jsons.ToObject<List<JoinSchool>>();
             string url = _configuration.GetValue<string>("HaBookAuth:CoreId:userinfo");
             HttpClient client = new HttpClient();
             var tmdids= joins.Select(x => x.tmdid).ToList();

+ 6 - 6
TEAMModelOS/appsettings.Development.json

@@ -21,16 +21,16 @@
   },
   "Azure": {
     "Storage": {
-      "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=teammodelstorage;AccountKey=Yq7D4dE6cFuer2d2UZIccTA/i0c3sJ/6ITc8tNOyW+K5f+/lWw9GCos3Mxhj47PyWQgDL8YbVD63B9XcGtrMxQ==;EndpointSuffix=core.chinacloudapi.cn"
-      //"ConnectionString": "DefaultEndpointsProtocol=https;AccountName=teammodelos;AccountKey=Dl04mfZ9hE9cdPVO1UtqTUQYN/kz/dD/p1nGvSq4tUu/4WhiKcNRVdY9tbe8620nPXo/RaXxs+1F9sVrWRo0bg==;EndpointSuffix=core.chinacloudapi.cn"
+      //"ConnectionString": "DefaultEndpointsProtocol=https;AccountName=teammodelstorage;AccountKey=Yq7D4dE6cFuer2d2UZIccTA/i0c3sJ/6ITc8tNOyW+K5f+/lWw9GCos3Mxhj47PyWQgDL8YbVD63B9XcGtrMxQ==;EndpointSuffix=core.chinacloudapi.cn"
+      "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=teammodelos;AccountKey=Dl04mfZ9hE9cdPVO1UtqTUQYN/kz/dD/p1nGvSq4tUu/4WhiKcNRVdY9tbe8620nPXo/RaXxs+1F9sVrWRo0bg==;EndpointSuffix=core.chinacloudapi.cn"
     },
     "Cosmos": {
-      "ConnectionString": "AccountEndpoint=https://cdhabookdep-free.documents.azure.cn:443/;AccountKey=JTUVk92Gjsx17L0xqxn0X4wX2thDPMKiw4daeTyV1HzPb6JmBeHdtFY1MF1jdctW1ofgzqkDMFOtcqS46by31A==;"
-      //"ConnectionString": "AccountEndpoint=https://teammodelos.documents.azure.cn:443/;AccountKey=clF73GwPECfP1lKZTCvs8gLMMyCZig1HODFbhDUsarsAURO7TcOjVz6ZFfPqr1HzYrfjCXpMuVD5TlEG5bFGGg==;"
+      //"ConnectionString": "AccountEndpoint=https://cdhabookdep-free.documents.azure.cn:443/;AccountKey=JTUVk92Gjsx17L0xqxn0X4wX2thDPMKiw4daeTyV1HzPb6JmBeHdtFY1MF1jdctW1ofgzqkDMFOtcqS46by31A==;"
+      "ConnectionString": "AccountEndpoint=https://teammodelos.documents.azure.cn:443/;AccountKey=clF73GwPECfP1lKZTCvs8gLMMyCZig1HODFbhDUsarsAURO7TcOjVz6ZFfPqr1HzYrfjCXpMuVD5TlEG5bFGGg==;"
     },
     "Redis": {
-      "ConnectionString": "52.130.252.100:6379,password=habook,ssl=false,abortConnect=False,writeBuffer=10240"
-      //"ConnectionString": "CoreRedisCN.redis.cache.chinacloudapi.cn:6380,password=LyJWP1ORJdv+poXWofAF97lhCEQPg1wXWqvtzXGXQuE=,ssl=True,abortConnect=False"
+      //"ConnectionString": "52.130.252.100:6379,password=habook,ssl=false,abortConnect=False,writeBuffer=10240"
+      "ConnectionString": "CoreRedisCN.redis.cache.chinacloudapi.cn:6380,password=LyJWP1ORJdv+poXWofAF97lhCEQPg1wXWqvtzXGXQuE=,ssl=True,abortConnect=False"
     },
     "ServiceBus": {
       "ConnectionString": "Endpoint=sb://teammodelos.servicebus.chinacloudapi.cn/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=Sy4h4EQ8zP+7w/lOLi1X3tGord/7ShFHimHs1vC50Dc=",