CrazyIter_Bin 9 bulan lalu
induk
melakukan
ac99f97757
1 mengubah file dengan 9 tambahan dan 9 penghapusan
  1. 9 9
      TEAMModelOS.SDK/Models/Service/GroupListService.cs

+ 9 - 9
TEAMModelOS.SDK/Models/Service/GroupListService.cs

@@ -42,7 +42,7 @@ namespace TEAMModelOS.SDK
             List<CourseDto> schoolCourses = new List<CourseDto>();
             List<CourseDto> teahcerCourses = new List<CourseDto>();
             List<string> groupIds = new List<string>();
-            if (!string.IsNullOrWhiteSpace(school)   && !string.IsNullOrWhiteSpace(periodId)) 
+            if (!string.IsNullOrWhiteSpace(school)  && !school.Equals("SYSTEM_NO_SCHOOL")  && !string.IsNullOrWhiteSpace(periodId)) 
             {
               
                 School schoolBase = await client.GetContainer(Constant.TEAMModelOS, Constant.School).ReadItemAsync<School>(school, new PartitionKey("Base"));
@@ -303,7 +303,7 @@ namespace TEAMModelOS.SDK
         {
             List<GroupListGrp> groupLists = new List<GroupListGrp>();
             if (groupTypes.IsEmpty() || groupTypes.Contains("class")) {
-                if (!string.IsNullOrWhiteSpace(school) && memberType == 2)
+                if (!string.IsNullOrWhiteSpace(school) && !school.Equals("SYSTEM_NO_SCHOOL") && memberType == 2)
                 {
                     Student student = null;
                     try
@@ -361,7 +361,7 @@ namespace TEAMModelOS.SDK
             if (groupTypes.IsEmpty() || groupTypes.Contains("teach")) {
                 //教学班
                 string teachsql="";
-                if (!string.IsNullOrWhiteSpace(school) && memberType == 2) {
+                if (!string.IsNullOrWhiteSpace(school) && !school.Equals("SYSTEM_NO_SCHOOL") && memberType == 2) {
                     teachsql= $"SELECT distinct {SummarySql} FROM c join  m  in c.members   where c.type='teach' and  m.id='{memberId}' and m.code='{school}' and m.type=2 ";
                 }
                 if (memberType == 1)
@@ -383,7 +383,7 @@ namespace TEAMModelOS.SDK
                 }
             }
 
-            if (!string.IsNullOrWhiteSpace(school) && (groupTypes.IsEmpty() || groupTypes.Contains("research")))
+            if (!string.IsNullOrWhiteSpace(school) && !school.Equals("SYSTEM_NO_SCHOOL") && (groupTypes.IsEmpty() || groupTypes.Contains("research")))
             {
                 //教研组
                 string teachsql = $"SELECT distinct {SummarySql} FROM c join  m  in c.members   where c.type='research' and  m.id='{memberId}' and m.type=1 ";
@@ -394,7 +394,7 @@ namespace TEAMModelOS.SDK
                     groupLists.Add(new GroupListGrp(item, groupName));
                 }
             }
-            if (!string.IsNullOrWhiteSpace(school) && (groupTypes.IsEmpty() || groupTypes.Contains("yxtrain")))
+            if (!string.IsNullOrWhiteSpace(school) && !school.Equals("SYSTEM_NO_SCHOOL") && (groupTypes.IsEmpty() || groupTypes.Contains("yxtrain")))
             {
                 //研修名单
                 string teachsql = $"SELECT distinct {SummarySql} FROM c join  m  in c.members   where c.type='yxtrain' and  m.id='{memberId}' and m.type=1 ";
@@ -409,7 +409,7 @@ namespace TEAMModelOS.SDK
             List<RMember> rmembers = new List<RMember>();
             List<RGroupList> rgroupList = new List<RGroupList>();
             List<GroupListDto> groupListDtos = new List<GroupListDto>();
-            if (!string.IsNullOrWhiteSpace(school)  && time>0  && groupLists.IsNotEmpty())
+            if (!string.IsNullOrWhiteSpace(school) && !school.Equals("SYSTEM_NO_SCHOOL")  && time>0  && groupLists.IsNotEmpty())
             {
                 School schoolBase = await client.GetContainer(Constant.TEAMModelOS, Constant.School).ReadItemAsync<School>(school, new PartitionKey("Base"));
                 foreach (var period in schoolBase.period)
@@ -1102,7 +1102,7 @@ namespace TEAMModelOS.SDK
             List<RMember> rmembers = new List<RMember>();
             List<RGroupList> rgroupList = new List<RGroupList>();
             List<GroupListDto> groupListDtos = new List<GroupListDto>();
-            if (!string.IsNullOrWhiteSpace(school)   && time>0) {
+            if (!string.IsNullOrWhiteSpace(school)  && !school.Equals("SYSTEM_NO_SCHOOL")   && time>0) {
                 School schoolBase = await client.GetContainer(Constant.TEAMModelOS, Constant.School).ReadItemAsync<School>(school, new PartitionKey("Base"));
                 foreach (var period in schoolBase.period) {
                     var dataSemester = SchoolService.GetSemester(period, time);
@@ -1607,7 +1607,7 @@ namespace TEAMModelOS.SDK
                     }
                     groups.Add("School", groupLists);
 
-                    if (!string.IsNullOrWhiteSpace(school)  && time>0  && groupLists.IsNotEmpty())
+                    if (!string.IsNullOrWhiteSpace(school) && !school.Equals("SYSTEM_NO_SCHOOL")  && time>0  && groupLists.IsNotEmpty())
                     {
                         School schoolBase = await client.GetContainer(Constant.TEAMModelOS, Constant.School).ReadItemAsync<School>(school, new PartitionKey("Base"));
                         foreach (var period in schoolBase.period)
@@ -1785,7 +1785,7 @@ namespace TEAMModelOS.SDK
 
                         //处理研修名单,如果是学校老师的,则需要检查SchoolTeacher
                         //处理 学校教研组,学校管理人员,学校任课教师,学校研修名单。
-                        if (!string.IsNullOrEmpty(school) && ($"{type}".Equals("yxtrain") || $"{type}".Equals("research") || $"{type}".Equals("manage") || $"{type}".Equals("subject")))
+                        if (!string.IsNullOrEmpty(school) && !school.Equals("SYSTEM_NO_SCHOOL") && ($"{type}".Equals("yxtrain") || $"{type}".Equals("research") || $"{type}".Equals("manage") || $"{type}".Equals("subject")))
                         {
                             StringBuilder tmdidSql = new StringBuilder($"SELECT distinct c.name,c.id,c.picture FROM c ");
                             string insql = string.Join(",", tmdids.Select(x => $"'{x.id}'"));