CrazyIter_Bin 2 سال پیش
والد
کامیت
6961945319

+ 8 - 4
TEAMModelOS/Controllers/School/SchoolController.cs

@@ -1437,11 +1437,15 @@ namespace TEAMModelOS.Controllers
                                     int asize = obj.size;
                                     teacher.size = obj.size;
                                     List<IdNameCode> nameCodes = new List<IdNameCode> { new IdNameCode { id = obj.id, name = obj.name, code = obj.lang } };
-                                    var schoolData = obj.schools.Find(z => z.schoolId.Equals($"{school_code}"));
-                                    _coreAPIHttpService.PushNotify(nameCodes, "teacher_space-change", Constant.NotifyType_IES5_Management,
-                                    new Dictionary<string, object> { { "tmdname", teacher.name }, { "tmdid", teacher.id }, { "schoolName", schoolData.name },{ "bsize", bsize }, { "asize", asize } }
-                                      , _option.Location, _configuration, _dingDing, "");
+                                 
                                     await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync<SchoolTeacher>(teacher, obj.id, new PartitionKey($"Teacher-{school_code}"));
+                                    var schoolData = obj.schools.Find(z => z.schoolId.Equals($"{school_code}"));
+                                    if (schoolData != null)
+                                    {
+                                        _coreAPIHttpService.PushNotify(nameCodes, "teacher_space-change", Constant.NotifyType_IES5_Management,
+                                       new Dictionary<string, object> { { "tmdname", teacher.name }, { "tmdid", teacher.id }, { "schoolName", schoolData.name }, { "bsize", bsize }, { "asize", asize } }
+                                         , _option.Location, _configuration, _dingDing, "");
+                                    }
                                 }
                             }
                         }

+ 1 - 1
TEAMModelOS/Controllers/School/SchoolTeacherController.cs

@@ -586,7 +586,7 @@ namespace TEAMModelOS.Controllers
                     await client.GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync<SchoolTeacher>(st, id, new PartitionKey($"Teacher-{school_code}"));
                     _coreAPIHttpService.PushNotify(nameCodes, "authority-change", Constant.NotifyType_IES5_Management,
                       new Dictionary<string, object> { { "tmdname", teacher.name }, { "tmdid", teacher.id }, { "schoolName", schoolData.name }, { "addAuthority", $"[{string.Join(",", addText)}]" }, { "rmvAuthority", $"[{string.Join(",", rmvText)}]" } }
-                      , _option.Location, _configuration, _dingDing, "");
+                      , _option.Location, _configuration, _dingDing, _environment.ContentRootPath);
                     schoolTeachers.Add(st);
                 }
                 return Ok(new { teachers = schoolTeachers });