Browse Source

修正學校情況統計看板API:學校產品碼List=null處理

jeff 1 year ago
parent
commit
a9ca66dfdd
1 changed files with 3 additions and 0 deletions
  1. 3 0
      TEAMModelBI/Controllers/Census/SchoolController.cs

+ 3 - 0
TEAMModelBI/Controllers/Census/SchoolController.cs

@@ -841,6 +841,9 @@ namespace TEAMModelBI.Controllers.Census
 
             await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<BIRelStats>(queryText: scSql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("BIRel") }))
             {
+                if (item.serial == null) item.serial = new List<string>();
+                if (item.service == null) item.service = new List<string>();
+                if (item.hard == null) item.hard = new List<string>();
                 bIRelStats.Add(item);
                 tempProduct.AddRange(item.serial);
                 tempProduct.AddRange(item.service);