Ver Fonte

,groupId=y.groupId,groupName=y.groupName

CrazyIter_Bin há 3 anos atrás
pai
commit
6d82008240

+ 6 - 0
TEAMModelOS.SDK/Models/Cosmos/Common/GroupList.cs

@@ -69,6 +69,7 @@ namespace TEAMModelOS.SDK.Models
         public int scount { get; set; }
         public List<RMember> members { get; set; } = new List<RMember>();
         public string leader { get; set; }
+        
     }
 
     public class  Member
@@ -92,6 +93,8 @@ namespace TEAMModelOS.SDK.Models
         /// </summary>
         public string irs { get; set; }
         public string tag { get; set; }
+        public string groupId { get; set; }
+        public string groupName { get; set; }
     }
     public class RMember
     {
@@ -126,6 +129,9 @@ namespace TEAMModelOS.SDK.Models
         /// 行政班
         /// </summary>
         public string classId { get; set; }
+        public string groupId { get; set; }
+        public string groupName { get; set; }
+
     }
     public class GroupListDto
     {

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

@@ -486,7 +486,7 @@ namespace TEAMModelOS.SDK.Models
                               requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Class-{school}") }))
                     {
                         ///行政班(学生搜寻classId动态返回)class
-                        List<RMember> smembers = students.Where(x => x.classId.Equals(item.id)).Select(y => new RMember { id = y.id, code = school, name = y.name, type = 2, picture = y.picture, no = y.no,classId=y.classId }).ToList();
+                        List<RMember> smembers = students.Where(x => x.classId.Equals(item.id)).Select(y => new RMember { id = y.id, code = school, name = y.name, type = 2, picture = y.picture, no = y.no,classId=y.classId,groupId=y.groupId,groupName=y.groupName }).ToList();
                         members.AddRange(smembers);
                        
                         RGroupList group = new RGroupList

+ 1 - 14
TEAMModelOS/Controllers/School/ClassController.cs

@@ -130,7 +130,7 @@ namespace TEAMModelOS.Controllers
                 var client = _azureCosmos.GetCosmosClient();
                 foreach (Student stu in students)
                 {
-                    var response = await client.GetContainer(Constant.TEAMModelOS, "Student").ReadItemStreamAsync(stu.id, new PartitionKey($"{stu.code}"));
+                    var response = await client.GetContainer(Constant.TEAMModelOS, "Student").ReadItemStreamAsync(stu.id, new PartitionKey($"Base-{stu.code}"));
                     if (response.Status == 200)
                     {
                         using var json = await JsonDocument.ParseAsync(response.ContentStream);
@@ -140,19 +140,6 @@ namespace TEAMModelOS.Controllers
                         await client.GetContainer(Constant.TEAMModelOS, "Student").ReplaceItemAsync(stuInfo, stuInfo.id, new PartitionKey($"{stuInfo.code}"));
                     }
                 }
-                /*Class classroom = new Class();
-                if (!requert.TryGetProperty("classroom", out JsonElement room)) return BadRequest();
-                //if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                classroom = room.ToObject<Class>();
-               
-                var sresponse = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(classroom.id, new PartitionKey($"{classroom.code}"));
-                if (sresponse.Status == 200)
-                {
-                    using var json = await JsonDocument.ParseAsync(sresponse.ContentStream);
-                    Class classroom1 = json.ToObject<Class>();
-                    //classroom1.students = classroom.students;
-                    var response = await client.GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync(classroom1, classroom1.id, new PartitionKey($"{classroom.code}"));
-                }*/
                 return Ok(new { students });
             }
             catch (Exception ex)

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

@@ -528,7 +528,7 @@ namespace TEAMModelOS.Controllers
                                 students.Add(item);
                             }     
                             ///行政班(学生搜寻classId动态返回)class
-                            List<RMember> smembers = students.Where(x => x.classId.Equals(clazz.id)).Select(y => new RMember { id = y.id, code = $"{_code}", name = y.name, type = 2, picture = y.picture, no = y.no,classId=y.classId }).ToList();
+                            List<RMember> smembers = students.Where(x => x.classId.Equals(clazz.id)).Select(y => new RMember { id = y.id, code = $"{_code}", name = y.name, type = 2, picture = y.picture, no = y.no,classId=y.classId, groupId = y.groupId, groupName = y.groupName }).ToList();
                             groupList = new RGroupList
                             {
                                 id=clazz.id,

+ 1 - 1
TEAMModelOS/Controllers/XTest/DataMigrationController.cs

@@ -74,7 +74,7 @@ namespace TEAMModelOS.Controllers
                         if (item.students.IsNotEmpty())
                         {
                             item.students.ForEach(x => {
-                                members.Add(new Member { id = x.id, code = x.code.Replace("Base-", ""), type = 2 });
+                                members.Add(new Member { id = x.id, code = x.code.Replace("Base-", ""), type = 2,});
                             });
                         }
                         if (item.tmids.IsNotEmpty())