ソースを参照

优化创校字段

Li 3 年 前
コミット
70408e92e7
1 ファイル変更2 行追加2 行削除
  1. 2 2
      TEAMModelBI/Controllers/BISchool/BatchSchoolController.cs

+ 2 - 2
TEAMModelBI/Controllers/BISchool/BatchSchoolController.cs

@@ -280,7 +280,7 @@ namespace TEAMModelBI.Controllers.BISchool
                                 type = bischool.type,
                                 type = bischool.type,
                                 pk = "School",
                                 pk = "School",
                                 ttl = -1,
                                 ttl = -1,
-                                areaId = bischool.areaId,
+                                areaId = string.IsNullOrEmpty(bischool.areaId) ? "" : bischool.areaId,
                                 schoolCode = createSchoolInfo.id,
                                 schoolCode = createSchoolInfo.id,
                                 period = PresetSchoolPeriod(bischool.period, foundSchools.lang, campusId),
                                 period = PresetSchoolPeriod(bischool.period, foundSchools.lang, campusId),
                                 scale = bischool.size >= 300 ? 500 : 0
                                 scale = bischool.size >= 300 ? 500 : 0
@@ -301,7 +301,7 @@ namespace TEAMModelBI.Controllers.BISchool
                             if (teacher != null)
                             if (teacher != null)
                             {
                             {
                                 //教师存在,在该教师信息中添加要管理的学校信息
                                 //教师存在,在该教师信息中添加要管理的学校信息
-                                teacher.schools.Add(new Teacher.TeacherSchool {areaId=bischool.areaId, schoolId = createSchoolInfo.id, name = bischool.name, status = "join", time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() });
+                                teacher.schools.Add(new Teacher.TeacherSchool { areaId = string.IsNullOrEmpty(bischool.areaId) ? "" : bischool.areaId, schoolId = createSchoolInfo.id, name = bischool.name, status = "join", time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() });
                                 //await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, tmdId, new PartitionKey("Base"));
                                 //await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<Teacher>(teacher, tmdId, new PartitionKey("Base"));
                                 SchoolTeacher schoolTeacher = new SchoolTeacher
                                 SchoolTeacher schoolTeacher = new SchoolTeacher
                                 {
                                 {