CrazyIter_Bin há 2 anos atrás
pai
commit
a39cbdbcf5

+ 4 - 4
TEAMModelOS.FunctionV4/HttpTrigger/IESHttpTrigger.cs

@@ -92,13 +92,13 @@ namespace TEAMModelOS.FunctionV4.HttpTrigger
                            .GetItemQueryIterator<School>(queryText: schoolSQL, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"Base") }))
             {
                 schools.Add(item);
-            }
+            }           
             ArtSetting artSetting= await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Normal).ReadItemAsync<ArtSetting>($"{_areaId}", new PartitionKey());
             foreach (var school in schools) {
-                var periods = school.period.Where(p => !string.IsNullOrWhiteSpace(p.type));
+                var periods = school.period.Where(p => p.type.IsNotEmpty());
                 foreach (var period in periods)
                 {
-                    var dimension = artSetting.dimensions.FindAll(x => x.type.Contains(period.type));
+                    var dimension = artSetting.dimensions.FindAll(x => x.type.Intersect(period.type).Any());
                     var bindIds = period.subjects.Where(s => !string.IsNullOrWhiteSpace(s.bindId)).Select(x => x.bindId);
                     //该学段未同步学科的。
                     var unBindIds = dimension.Where(z => !string.IsNullOrWhiteSpace(z.subjectBind)).Select(x => x.subjectBind).ToHashSet().Except(bindIds);
@@ -146,7 +146,7 @@ namespace TEAMModelOS.FunctionV4.HttpTrigger
                             //同步知识块。
                             if (old != null)
                             {
-                             
+                                
                             }
                             else { 
                                 

+ 1 - 1
TEAMModelOS.SDK/Models/Cosmos/School/Inner/Period.cs

@@ -35,7 +35,7 @@ namespace TEAMModelOS.SDK.Models
         /// </summary>
         public List<TimeTable> timetable { get; set; } = new List<TimeTable>();
         //"学前","小学","初中","高中","中职(中专,技校,职高)","高职(专科)","大学本科","特殊教育","教育局","电教部门"
-        public string type { get; set; }
+        public List<string> type { get; set; }= new List<string>();
     }
 
     /// <summary>