Bläddra i källkod

修改课程描述字段

CrazyIter_Bin 3 år sedan
förälder
incheckning
8550ea7ca1

+ 2 - 2
TEAMModelOS.SDK/Models/Cosmos/School/Course.cs

@@ -45,7 +45,7 @@ namespace TEAMModelOS.SDK.Models
         /// </summary>
         /// </summary>
         //public List<Teachers> teachers { get; set; }
         //public List<Teachers> teachers { get; set; }
         public string scope { get; set; }
         public string scope { get; set; }
-        //public string notice { get; set; }
+        public string desc { get; set; }
         public List<Schedule> schedule { get; set; }
         public List<Schedule> schedule { get; set; }
         //public List<Customize> classes { get; set; }
         //public List<Customize> classes { get; set; }
         public string no { get; set; }
         public string no { get; set; }
@@ -79,7 +79,7 @@ namespace TEAMModelOS.SDK.Models
         /// </summary>
         /// </summary>
         public string stulist { get; set; }
         public string stulist { get; set; }
         public List<TimeInfo> time { get; set; } = new List<TimeInfo>();
         public List<TimeInfo> time { get; set; } = new List<TimeInfo>();
-        public string notice { get; set; }
+       
 
 
     }
     }
 
 

+ 27 - 0
TEAMModelOS.SDK/Models/Service/StuListService.cs

@@ -91,6 +91,7 @@ namespace TEAMModelFunction
                             taskStatus = -1,
                             taskStatus = -1,
                             classIds = classes
                             classIds = classes
                         };
                         };
+                     //   await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-StuListService-FixActivity\n名单发生变更 新建活动中间表\n{stucourse.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
                         await client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
                         await client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
                     }
                     }
                     
                     
@@ -120,6 +121,32 @@ namespace TEAMModelFunction
                       //  await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-StuListService-FixActivity\n名单发生变更 新建活动中间表\n{stucourse.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
                       //  await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-StuListService-FixActivity\n名单发生变更 新建活动中间表\n{stucourse.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
                         await client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
                         await client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
                     }
                     }
+                    //tmd新加入的
+                    foreach (string tch in stuListChange.tchjoin)
+                    {
+                        var stucourse = new StuActivity
+                        {
+                            id = activity.id,
+                            scode = activity.code,
+                            name = activity.name,
+                            code = $"Activity-{ activity.school}-{tch}",
+                            scope = activity.scope,
+                            school = activity.school,
+                            creatorId = activity.creatorId,
+                            pk = "Activity",
+                            type = type,
+                            subjects = activity.pk.ToLower().Equals("exam") && activity.subjects.IsNotEmpty() ? new List<string>() { activity.subjects[0].id } : new List<string>() { "" },
+                            startTime = activity.startTime,
+                            endTime = activity.endTime,
+                            blob = activity.blob,
+                            owner = activity.owner,
+                            createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
+                            taskStatus = -1,
+                            classIds = classes
+                        };
+                        //  await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-StuListService-FixActivity\n名单发生变更 新建活动中间表\n{stucourse.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
+                        await client.GetContainer(Constant.TEAMModelOS, "Teacher").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
+                    }
                     foreach (Students students in stuListChange.stuleave)
                     foreach (Students students in stuListChange.stuleave)
                     {
                     {
                         try
                         try

+ 2 - 2
TEAMModelOS/Controllers/School/CourseController.cs

@@ -586,6 +586,7 @@ namespace TEAMModelOS.Controllers
                     courseExtobj.name = course.name;
                     courseExtobj.name = course.name;
                     courseExtobj.id = course.id;
                     courseExtobj.id = course.id;
                     courseExtobj.subject = course.subject;
                     courseExtobj.subject = course.subject;
+                    courseExtobj.desc = course.desc;
                     courseExtobj.period = course.period;
                     courseExtobj.period = course.period;
                     courseExtobj.scope = course.scope;
                     courseExtobj.scope = course.scope;
                     courseExtobj.no = course.no;
                     courseExtobj.no = course.no;
@@ -608,7 +609,6 @@ namespace TEAMModelOS.Controllers
                         }
                         }
                         scheduleExtobj.stulist = schedule.stulist;
                         scheduleExtobj.stulist = schedule.stulist;
                         scheduleExtobj.time = schedule.time;
                         scheduleExtobj.time = schedule.time;
-                        scheduleExtobj.notice = schedule.notice;
                         scheduleExtobj.room = schedule.room;
                         scheduleExtobj.room = schedule.room;
                         scheList.Add(scheduleExtobj);
                         scheList.Add(scheduleExtobj);
                     }
                     }
@@ -882,6 +882,7 @@ namespace TEAMModelOS.Controllers
                 courseExtobj.id = course.id;
                 courseExtobj.id = course.id;
                 courseExtobj.name = course.name;
                 courseExtobj.name = course.name;
                 courseExtobj.subject = course.subject;
                 courseExtobj.subject = course.subject;
+                courseExtobj.desc = course.desc;
                 courseExtobj.period = course.period;
                 courseExtobj.period = course.period;
                 courseExtobj.scope = course.scope;
                 courseExtobj.scope = course.scope;
                 courseExtobj.no = course.no;
                 courseExtobj.no = course.no;
@@ -899,7 +900,6 @@ namespace TEAMModelOS.Controllers
                     }
                     }
                     scheduleExtobj.stulist = schedule.stulist;
                     scheduleExtobj.stulist = schedule.stulist;
                     scheduleExtobj.time = schedule.time;
                     scheduleExtobj.time = schedule.time;
-                    scheduleExtobj.notice = schedule.notice;
                     scheduleExtobj.room = schedule.room;
                     scheduleExtobj.room = schedule.room;
                     scheList.Add(scheduleExtobj);
                     scheList.Add(scheduleExtobj);
                 }
                 }

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

@@ -218,6 +218,7 @@ namespace TEAMModelOS.Controllers
                     creatorId = s.course.creatorId,
                     creatorId = s.course.creatorId,
                     no = s.course.no,
                     no = s.course.no,
                     period = s.course.period,
                     period = s.course.period,
+                    desc = s.course.desc,
                     school = s.course.school,
                     school = s.course.school,
                     scope = s.course.scope,
                     scope = s.course.scope,
                     pk = s.course.pk,
                     pk = s.course.pk,
@@ -227,7 +228,6 @@ namespace TEAMModelOS.Controllers
                         room = c.room,
                         room = c.room,
                         roomName = rooms.FirstOrDefault(t => t.id == c.room).name,
                         roomName = rooms.FirstOrDefault(t => t.id == c.room).name,
                         classId = c.classId,
                         classId = c.classId,
-                        notice = c.notice,
                         teacherId = c.teacherId,
                         teacherId = c.teacherId,
                         teacherName = teachers.FirstOrDefault(t => t.id == c.teacherId).name,
                         teacherName = teachers.FirstOrDefault(t => t.id == c.teacherId).name,
                         time = c.time,
                         time = c.time,