Jelajahi Sumber

处理导入名单,未匹配id的教师。

CrazyIter_Bin 3 tahun lalu
induk
melakukan
65842f825c

+ 1 - 0
TEAMModelOS.FunctionV4/Program.cs

@@ -20,6 +20,7 @@ namespace TEAMModelOS.FunctionV4
         public static async Task Main(string[] args)
         {
 #if DEBUG
+
             Debugger.Launch();
 #endif
 

+ 21 - 0
TEAMModelOS/Controllers/School/SchoolTeacherController.cs

@@ -287,6 +287,27 @@ namespace TEAMModelOS.Controllers
                     });
                     await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).ReplaceItemAsync(teacherImport, $"{school_code}", new PartitionKey("TeacherImport"));
                 }
+                var noids = teacherImport.teachers.Where(x => string.IsNullOrWhiteSpace(x.id));
+                foreach(var t in noids) {
+                    teachers.Add(new ScTeacher
+                    {
+                        id = t.id,
+                        picture = t.picture,
+                        iname = t.iname,
+                        name = t.name,
+                        status = "import",
+                        createTime = t.time,
+                        permissionCount = 0,
+                        size = 0,
+                        permissions = new List<string>(),
+                        roles = new List<string>(),
+                        subjectIds = new List<string>(),
+                        groups = new List<IdNameCode>(),
+                        note = t.note,
+                        phone = t.phone,
+                        email = t.email,
+                    });
+                }
             }
             IEnumerable<string> coreids = null;
             coreids = teachers.Where(z => !string.IsNullOrWhiteSpace(z.id)).Select(x => x.id);

+ 1 - 1
TEAMModelOS/Program.cs

@@ -11,7 +11,7 @@ namespace TEAMModelOS
         public static void Main(string[] args)
         {
 
-            
+           
             CreateHostBuilder(args).Build().Run();
         }