Browse Source

統測活動 追加"預報名"架構(進行中)

jeff 2 months ago
parent
commit
4a085a62e5

+ 2 - 1
TEAMModelOS.SDK/Models/Cosmos/Teacher/JointEvent.cs

@@ -36,6 +36,7 @@ namespace TEAMModelOS.SDK.Models
             public string id { get; set; } //活動進程ID
             public string name { get; set; } //進程名稱
             public string type { get; set; } //"exam":評量 "join":報名 "other":其他
+            public string joinType { get; set; } //報名類型 "pre":預報名 "regular":正式報名
             public string examType { get; set; } //評量類型 "regular":一般競賽 "custom":決賽
             public bool examOverwrite { get; set; } //評量可否重複作答 true:可 false:不可
             public List<JointEventScheduleBlob> blobs { get; set; } = null; //說明文件存放Blob
@@ -60,7 +61,7 @@ namespace TEAMModelOS.SDK.Models
     public class JointEventGroupBase
     {
         public string scope { get; set; } //school:學校(選課班) private:個人 
-        public string type { get; set; } //類型 "regular":報名名單 "custom":決賽用名單
+        public string type { get; set; } //類型 "pre":預報名名單 "regular":正式報名名單 "custom":決賽用名單
         public string creatorId { get; set; }
         public string creatorName { get; set; }
         public string creatorEmail { get; set; }

+ 3 - 1
TEAMModelOS/Controllers/Teacher/JointEventController.cs

@@ -442,6 +442,7 @@ namespace TEAMModelOS.Controllers.Common
                     }
                     jointEventSchedule.name = schedule.name;
                     jointEventSchedule.type = schedule.type;
+                    jointEventSchedule.joinType = (schedule.type.Equals("join")) ? schedule.joinType : null;
                     jointEventSchedule.examType = (schedule.type.Equals("join")) ? null : schedule.examType;
                     jointEventSchedule.examOverwrite = schedule.examOverwrite;
                     long startTimeOld = jointEventSchedule.startTime;
@@ -696,6 +697,7 @@ namespace TEAMModelOS.Controllers.Common
                 string provinceName = (request.TryGetProperty("provinceName", out JsonElement _provinceName)) ? _provinceName.ToString() : string.Empty;
                 string cityId = (request.TryGetProperty("cityId", out JsonElement _cityId)) ? _cityId.ToString() : string.Empty;
                 string cityName = (request.TryGetProperty("cityName", out JsonElement _cityName)) ? _cityName.ToString() : string.Empty;
+                string joinType = (request.TryGetProperty("joinType", out JsonElement _joinType)) ? _joinType.ToString() : "pre";
                 string scope = (request.TryGetProperty("scope", out JsonElement _scope)) ? _scope.ToString() : string.Empty;
                 List<JointEventGroupBase.JointEventGroupCourse> courseLists = (request.TryGetProperty("courseLists", out JsonElement _courseLists)) ? _courseLists.ToObject<List<JointEventGroupBase.JointEventGroupCourse>>() : null;
                 if (string.IsNullOrWhiteSpace(jointEventId) || string.IsNullOrWhiteSpace(jointGroupId) || string.IsNullOrWhiteSpace(creatorId) || courseLists == null || string.IsNullOrWhiteSpace(scope))
@@ -747,7 +749,7 @@ namespace TEAMModelOS.Controllers.Common
                     jointCourse.provinceName = provinceName;
                     jointCourse.cityId = cityId;
                     jointCourse.cityName = cityName;
-                    jointCourse.type = "regular"; //教師報名名單
+                    jointCourse.type = (joinType.Equals("pre")) ? "pre" : "regular"; //regular:教師正式報名名單 pre:預報名名單
                     //courseLists修正:防止course的重複生成
                     List<JointEventGroupBase.JointEventGroupCourse> courseListsFix = new List<JointEventGroupBase.JointEventGroupCourse>();
                     foreach (JointEventGroupBase.JointEventGroupCourse courseInfo in courseLists)