Browse Source

添加学生分组字段

liqk 3 years ago
parent
commit
77bbc04c59

+ 2 - 0
TEAMModelOS.SDK/Models/Cosmos/Common/TmdInfo.cs

@@ -19,5 +19,7 @@ namespace TEAMModelOS.SDK.Models
         public string classId { get; set; }
         public int year { get; set; }
         public string schoolId { get; set; }
+        public string groupId { get; set; }
+        public string groupName { get; set; }
     }
 }

+ 2 - 2
TEAMModelOS.SDK/Models/Service/TriggerStuActivity.cs

@@ -244,7 +244,7 @@ namespace TEAMModelFunction
                         gp.list.Select(x => x.id).ToList().ForEach(x => { inidstus.Add($"'{x}'"); });
                         PartitionKey partitionKey = new PartitionKey($"Base-{gp.key.Replace("Base-", "")}");
                         var insqlstu = string.Join(",", inidstus);
-                        var querystu = $"SELECT  c.id,c.code,c.name,c.picture,c.classId,c.year,c.schoolId FROM c where c.id in ({insqlstu})";
+                        var querystu = $"SELECT  c.id,c.code,c.name,c.picture,c.classId,c.groupId,c.groupName,c.year,c.schoolId FROM c where c.id in ({insqlstu})";
                         await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryIterator<StuInfo>(queryText: querystu, requestOptions: new QueryRequestOptions() { PartitionKey= partitionKey }))
                         {
                             stuInfos.Add(item);
@@ -256,7 +256,7 @@ namespace TEAMModelFunction
                 {
                     if (!stuInfos.Select(y => y.classId).ToList().Contains(x.id))
                     {
-                        stuInfos.Add(new StuInfo { id = x.id, code = x.code, schoolId = x.schoolId, classId = x.classId, name = x.name, picture = x.picture, year = x.year });
+                        stuInfos.Add(new StuInfo { id = x.id, code = x.code, schoolId = x.schoolId, classId = x.classId, name = x.name, picture = x.picture, year = x.year,groupId = x.groupId,groupName=x.groupName });
                     }
                 });
                 List<ClassListInfo> classInfo = new List<ClassListInfo>();