Browse Source

优化第三方课例信息

Li 2 years ago
parent
commit
980befa445

+ 28 - 4
TEAMModelBI/Controllers/BITest/TestController.cs

@@ -54,6 +54,7 @@ using Azure.Storage.Blobs.Specialized;
 using System.Web;
 using Azure.Storage.Sas;
 using DocumentFormat.OpenXml.Drawing.Diagrams;
+using DocumentFormat.OpenXml.Bibliography;
 
 namespace TEAMModelBI.Controllers.BITest
 {
@@ -164,7 +165,7 @@ namespace TEAMModelBI.Controllers.BITest
         /// <param name="jsonElement"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
-        [AuthToken(Roles = "assist,admin")]
+        //[AuthToken(Roles = "assist,admin")]
         [HttpPost("set-savebilog")]
         public async Task<IActionResult> SetTestSaveBIlog(JsonElement jsonElement)
         {
@@ -184,10 +185,33 @@ namespace TEAMModelBI.Controllers.BITest
             //    redisClinet = _azureRedis.GetRedisClient(dbnum: 8, name: BIConst.Global);
             //}
 
-            var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
-            await _azureStorage.SaveLog(type: "table-save", msg: "测试保存方法01", dingDing: _dingDing, httpContext: HttpContext); //IES5 日志记录
+            var blob = _azureStorage.GetBlobContainerClient(containerName: "hbcn");
+            await foreach (BlobItem blobItem in blob.GetBlobsAsync(BlobTraits.None, BlobStates.None, $"records/{383558646003404800}/IES"))
+            {
+                if (blobItem.Name.EndsWith("base.json") || blobItem.Name.EndsWith("TimeLine.json"))
+                {
+                    BlobClient tempClient = blob.GetBlobClient(blobItem.Name);
+                    if (await tempClient.ExistsAsync())
+                    {
+                        using (var meomoryStream = new MemoryStream())
+                        {
+                            var response = blob.GetBlobClient($"{blobItem.Name}").DownloadTo(meomoryStream);
+                            string setr = Encoding.UTF8.GetString(meomoryStream.ToArray()).ToString();
+
+                            //LessonBase res = Encoding.UTF8.GetString(meomoryStream.ToArray()).ToString().ToObject<LessonBase>();
+
+                            //var response = await blob.GetBlobClient($"{blobItem.Name}").DownloadToAsync(meomoryStream);
+
+                            //RecCnt recCnt = Encoding.UTF8.GetString(meomoryStream.ToArray()).ToString().ToObject<RecCnt>();
+                            //string name = stringSuffix.MidStrEx(blobItem.Name, "/", ".");
+                        }
+                    }
+                }
+            }
+            //var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
+            //await _azureStorage.SaveLog(type: "table-save", msg: "测试保存方法01", dingDing: _dingDing, httpContext: HttpContext); //IES5 日志记录
 
-            await AzureStorageBlobExtensions.SaveBILog(blobClient, tableClient, "Test-test", $"{msg}", _dingDing, httpContext: HttpContext);//BI 日志记录
+            //await AzureStorageBlobExtensions.SaveBILog(blobClient, tableClient, "Test-test", $"{msg}", _dingDing, httpContext: HttpContext);//BI 日志记录
 
             return Ok(new { state = 200 });
         }

+ 3 - 3
TEAMModelOS.SDK/Context/Attributes/Filter/ApiTokenAttribute.cs

@@ -171,8 +171,8 @@ namespace TEAMModelOS.Filter
                             {
                                 issuer = keys[3];
                             }
-                            if (iss.Equals(issuer))
-                            {
+                            //if (iss.Equals(issuer))
+                            //{
                                 //aud  受众
                                 id = jwt.Payload.Sub;//主题,又是应用APP,或者企业id 
                                 jti = jwt.Payload.Jti;//jwt唯一标识
@@ -270,7 +270,7 @@ namespace TEAMModelOS.Filter
                                     {
                                     }
                                 }
-                            }
+                            //}
                         }
                         else {
                             msg = "token的scope与接口的业务类型不匹配!"; code = 401008;

+ 17 - 0
TEAMModelOS.SDK/Models/Cosmos/Common/LessonRecord.cs

@@ -67,6 +67,10 @@ namespace TEAMModelOS.SDK.Models
         /// </summary>
         public string courseId { get; set; }
         /// <summary>
+        /// 选填   课程名称  是因支持VR/AR那边课例
+        /// </summary>
+        public string courseName { get; set; }
+        /// <summary>
         ///选填 选用IES5固定名单的id
         /// </summary>
         public List<string> groupIds { get; set; } = new List<string>();
@@ -88,13 +92,22 @@ namespace TEAMModelOS.SDK.Models
         /// </summary>
         public string periodId { get; set; }
         /// <summary>
+        /// 选填 学段名称  是因支持VR/AR那边课例
+        /// </summary>
+        public string periodName { get; set; }
+        /// <summary>
         ///  不填 科目id,由课程id获取
         /// </summary>
         public string subjectId { get; set; }
         /// <summary>
+        /// 选填   科目名称  是因支持VR/AR那边课例
+        /// </summary>
+        public string subjecName { get; set; }
+        /// <summary>
         /// 不填 年级id,由名单id获取
         /// </summary>
         public List<string> grade { get; set; } = new List<string>();
+        public List<string> gradeName { get; set; } = new List<string>();
         /// <summary>
         /// 不填  收藏次数,IES5更新 
         /// </summary>
@@ -211,6 +224,10 @@ namespace TEAMModelOS.SDK.Models
 
         public LearningCategory learningCategory { get; set; }
         public int hitaClientCmpCount { get; set; }
+        /// <summary>
+        /// 课例来源 0 本公司  1 第三方公司    是因支持VR/AR那边课例
+        /// </summary>
+        public int source { get; set; } = 0;
     }
     public class TimeLineData {
       public   List<TimeLineEvent> events { get; set; } = new List<TimeLineEvent>();

+ 228 - 0
TEAMModelOS.SDK/Models/Cosmos/OpenEntity/OSchool.cs

@@ -0,0 +1,228 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace TEAMModelOS.SDK.Models.Cosmos.OpenEntity
+{
+    public class OSchool
+    {
+    }
+
+    public class OLessonRecord
+    {
+        public string id { get; set; }
+
+        /// <summary>
+        ///必填 教师醍摩豆id
+        /// </summary>
+        public string tmdid { get; set; }
+        /// <summary>
+        /// 教师醍摩豆id名称
+        /// </summary>
+        public string tmdname { get; set; }
+        /// <summary>
+        /// 教师醍摩豆id名称
+        /// </summary>
+        public string tmdpicture { get; set; }
+        /// <summary>
+        ///必填 课堂名称
+        /// </summary>
+        public string name { get; set; }
+        /// <summary>
+        ///必填 scope==school必填 | string | 学校id
+        /// </summary>
+        public string school { get; set; }
+        /// <summary>
+        ///必填  视频封面地址
+        /// </summary>
+       // public string poster { get; set; }
+        /// <summary>
+        ///必填 开始时间(时间戳) 1606393763434
+        /// </summary>
+        public long startTime { get; set; }
+        /// <summary>
+        ///必填 上课时长,最后更新
+        /// </summary>
+        public double duration { get; set; }
+        /// <summary>
+        ///选填  t分,科技应用 ,最后更新
+        /// </summary>
+        //public int tScore { get; set; }
+        /// <summary>
+        ///选填   p分,教法应用 ,最后更新
+        /// </summary>
+        //public int pScore { get; set; }
+        /// <summary>
+        ///选填  t灯,科技应用 0红灯,1 黄灯,2绿灯
+        /// </summary>
+        //public int tLevel { get; set; } = -1;
+        /// <summary>
+        ///选填   p灯,教法应用 0红灯,1 黄灯,2绿灯
+        /// </summary>
+        //public int pLevel { get; set; } = -1;
+        /// <summary>
+        ///选填  选用IES5的课程id 
+        /// </summary>
+        public string courseId { get; set; }
+        /// <summary>
+        /// 选填   课程名称  是因支持VR/AR那边课例
+        /// </summary>
+        public string courseName { get; set; }
+        /// <summary>
+        ///选填 选用IES5固定名单的id
+        /// </summary>
+        public List<string> groupIds { get; set; } = new List<string>();
+        public List<string> groupNames { get; set; } = new List<string>();
+        /// <summary>
+        ///选填  学生人数 ,最后更新
+        /// </summary>
+        //public int mCount { get; set; }
+        /// <summary>
+        ///选填  议课次数,大于1则是优课,苏格拉底获取
+        /// </summary>
+        //public int discuss { get; set; }
+        /// <summary>
+        ///选填  科技互动次数, 
+        /// </summary>
+        //public int techCount { get; set; }
+        /// <summary>
+        /// 学 不填 段id,由课程或者名单获取 
+        /// </summary>
+        public string periodId { get; set; }
+        /// <summary>
+        /// 选填 学段名称  是因支持VR/AR那边课例
+        /// </summary>
+        public string periodName { get; set; }
+        /// <summary>
+        ///  不填 科目id,由课程id获取
+        /// </summary>
+        public string subjectId { get; set; }
+        /// <summary>
+        /// 选填   科目名称  是因支持VR/AR那边课例
+        /// </summary>
+        public string subjecName { get; set; }
+        /// <summary>
+        /// 不填 年级id,由名单id获取
+        /// </summary>
+        public List<string> grade { get; set; } = new List<string>();
+        public List<string> gradeName { get; set; } = new List<string>();
+        /// <summary>
+        /// 不填  收藏次数,IES5更新 
+        /// </summary>
+        public int favorite { get; set; }
+        /// <summary>
+        /// 不填 点赞数
+        /// </summary>
+        public int like { get; set; }
+        /// <summary>
+        /// 不填 分享转发数
+        /// </summary>
+        public int share { get; set; }
+        /// <summary>
+        /// 不填  ["混合学习","语文教研"]课例类别,tag标签,IES5维护
+        /// </summary>
+        public List<string> category { get; set; } = new List<string>();
+        /// <summary>
+        /// 0 是否包含视频,1包含视频
+        /// </summary>
+        public int hasVideo { get; set; }
+        //public long videoSize { get; set; }
+        /// <summary>
+        /// 
+        /// 科技互动详细次数。[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49]
+        /// </summary>
+        public List<int> tech { get; set; } = new List<int>();
+        public int status { get; set; } = 0;
+        /// <summary>
+        /// 专家好课,默认0, 1 是好课
+        /// </summary>
+        public int excellent { get; set; } = 0;
+        /// <summary>
+        /// 出席人数
+        /// </summary>
+        public int attendCount { get; set; } = 0;
+        /// <summary>
+        /// 总人数
+        /// </summary>
+        public int clientCount { get; set; } = 0;
+        /// <summary>
+        ///出席率
+        /// </summary>
+        public double attendRate { get; set; } = 0;
+        /// <summary>
+        /// 小组数
+        /// </summary>
+        public int groupCount { get; set; } = 0;
+        /// <summary>
+        /// 任务总数,作品收集任务数
+        /// </summary>
+        public int collateTaskCount { get; set; } = 0;
+        /// <summary>
+        /// 作品总数
+        /// </summary>
+        public int collateCount { get; set; } = 0;
+        /// <summary>
+        /// 推送总数(页面,资源,讯息,差异化)
+        /// </summary>
+        public int pushCount { get; set; } = 0;
+        /// <summary>
+        /// 总计分
+        /// </summary>
+        public double totalPoint { get; set; } = 0;
+        /// <summary>
+        /// 测验总题数
+        /// </summary>
+        public int examQuizCount { get; set; } = 0;
+        /// <summary>
+        /// 互动题数
+        /// </summary>
+        public int interactionCount { get; set; } = 0;
+        /// <summary>
+        /// 测验得分率
+        /// </summary>
+        public double examPointRate { get; set; } = 0;
+        /// <summary>
+        /// 学生互动总数
+        /// </summary>
+        public int clientInteractionCount { get; set; } = 0;
+        /// <summary>
+        /// 学生互动率
+        /// </summary>
+        public double clientInteractionAverge { get; set; } = 0;
+
+        public int examCount { get; set; }
+        /// <summary>
+        /// 总互动分
+        /// </summary>
+        public double totalInteractPoint { get; set; } = 0;
+        /// <summary>
+        /// 过期时间,-1永不过期, 1577808000000 2020-01-01
+        /// </summary>
+        public long expire { get; set; } = -1;
+        /// <summary>
+        /// 先使用这种模式,["all","student"], 暂不 开放 school【开放给部分学校查看】,teacher【开放给部分教师查看】   ["all","school","teacher","student"]
+        /// </summary>
+        //public List<string> show { get; set; } = new List<string>();
+        /// <summary>
+        /// 暂不 开放 school【开放给部分学校查看】学校编码
+        /// </summary>
+        //public List<string> showSchs { get; set; } = new List<string>();
+        /// <summary>
+        /// 暂不 开放 teacher【开放给部分教师查看】醍摩豆id 
+        /// </summary>
+        //public List<string> showTchs { get; set; } = new List<string>();
+        /// <summary>
+        /// 设置强制保留的 =1 ,不会被自动清理的。但是可以被手动清理。
+        /// </summary>
+        //public int save { get; set; } = -1;
+        /// <summary>
+        /// 默认未上传
+        /// </summary>
+        public int upload { get; set; }
+
+        public LearningCategory learningCategory { get; set; }
+        public int hitaClientCmpCount { get; set; }
+    }
+}

+ 168 - 10
TEAMModelOS/Controllers/OpenApi/Business/BizOverallEducationController.cs

@@ -16,6 +16,12 @@ using TEAMModelOS.SDK.Models.Cosmos.Student;
 using DocumentFormat.OpenXml.Math;
 using DocumentFormat.OpenXml.Wordprocessing;
 using TEAMModelOS.Filter;
+using TEAMModelOS.SDK.Models;
+using Azure.Cosmos;
+using TEAMModelOS.SDK.Models.Cosmos.OpenEntity;
+using System;
+using Newtonsoft.Json.Linq;
+using System.Text;
 
 namespace TEAMModelOS.Controllers
 {
@@ -34,7 +40,9 @@ namespace TEAMModelOS.Controllers
         private readonly IConfiguration _configuration;
         private readonly CoreAPIHttpService _coreAPIHttpService;
         private readonly AzureServiceBusFactory _serviceBus;
-        public BizOverallEducationController(AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis, AzureServiceBusFactory serviceBus, DingDing dingDing, CoreAPIHttpService coreAPIHttpService, IOptionsSnapshot<Option> option, IConfiguration configuration)
+        private readonly SnowflakeId _snowflakeId;
+
+        public BizOverallEducationController(AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis, AzureServiceBusFactory serviceBus, DingDing dingDing, CoreAPIHttpService coreAPIHttpService, IOptionsSnapshot<Option> option, IConfiguration configuration, SnowflakeId snowflakeId)
         {
             _azureCosmos = azureCosmos;
             _azureStorage = azureStorage;
@@ -44,9 +52,9 @@ namespace TEAMModelOS.Controllers
             _configuration = configuration;
             _coreAPIHttpService = coreAPIHttpService;
             _serviceBus = serviceBus;
+            _snowflakeId = snowflakeId;
         }
 
-
         /// <summary>
         /// 设置学生画像
         /// </summary>
@@ -78,23 +86,173 @@ namespace TEAMModelOS.Controllers
             return Ok(new { responseData });
         }
 
-
-
-        public async Task<IActionResult> UpGet(JsonElement jsonElement)
+        /// <summary>
+        /// 开课或者上传课例信息  是因支持VR/AR的公司
+        /// </summary>
+        /// <param name="jsonElement"></param>
+        /// <returns></returns>
+        [ProducesDefaultResponseType]
+        [HttpPost("set-lesson-relord")]
+        [ApiToken(Auth = "1903", Name = "开课/上传课例信息", TName = "開課/上傳課例信息", EName = "Start class/upload class information", RWN = "W", Limit = false)]
+        public async Task<IActionResult> UpLessonRec(JsonElement jsonElement)
         {
             var (id, school) = HttpContext.GetApiTokenInfo();
-            //if(!jsonElement.TryGetProperty("schoolId",out JsonElement schoolId)) return Ok(new { code = RespondCode.ParamsError, msg = "参数错误:schoolId", data = "" });
-            //var responseData = await OpenApiService.GetLoginStuInfo(_azureCosmos, _dingDing, _option, id, school, jsonElement);
-            jsonElement.TryGetProperty("basejson", out JsonElement basejson);
-            jsonElement.TryGetProperty("basejson", out JsonElement tempjson);
+            try
+            {
+                jsonElement.TryGetProperty("baseJson", out JsonElement baseJson);    //课例基础文件信息json
+                jsonElement.TryGetProperty("timLineJson", out JsonElement timLineJson); //时间json
+                jsonElement.TryGetProperty("lessId", out JsonElement lessId);  //课例id
+                if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return Ok(new { responseDate = new ResponseData<dynamic>() { code = RespondCode.ParamsError, msg = "baseJson参数错误", data = null } });  //上课人ID
+                jsonElement.TryGetProperty("tmdName", out JsonElement tmdName);  //上课人昵称
+                jsonElement.TryGetProperty("tmdPicture", out JsonElement tmdpicture); //上课人头像
+                if (!jsonElement.TryGetProperty("startTime", out JsonElement startTime)) return Ok(new { responseDate = new ResponseData<dynamic>() { code = RespondCode.ParamsError, msg = "baseJson参数错误", data = null } });  //开始时间
+                if (!jsonElement.TryGetProperty("duration", out JsonElement duration)) return Ok(new { responseDate = new ResponseData<dynamic>() { code = RespondCode.ParamsError, msg = "baseJson参数错误", data = null } });  //上课时长
+                jsonElement.TryGetProperty("periodId", out JsonElement periodId);  //学段id
+                jsonElement.TryGetProperty("periodName", out JsonElement periodName); //学段名称
+                jsonElement.TryGetProperty("groupIds", out JsonElement _groupIds); //名单id
+                jsonElement.TryGetProperty("groupNames", out JsonElement _groupNames); //名单名称
+                jsonElement.TryGetProperty("gradeIds", out JsonElement _gradeIds); //年级id
+                jsonElement.TryGetProperty("gradeNames", out JsonElement _gradeNames); //年级名称
+                jsonElement.TryGetProperty("subjectId", out JsonElement subjectId);  //科目id
+                jsonElement.TryGetProperty("subjecName", out JsonElement subjecName); //科目名称
+                jsonElement.TryGetProperty("courseId", out JsonElement courseId);  //课程id
+                jsonElement.TryGetProperty("courseName", out JsonElement courseName); //课程名称
 
+                LessonRecord lessonRecord = new();
+                LessonBase lessonBase = null;
+                TimeLine timeLine = null;
+                if (!string.IsNullOrEmpty($"{baseJson}"))
+                {
+                    lessonBase = baseJson.ToObject<LessonBase>();
+                    lessonRecord.upload = 1;
+                }
+                else
+                    lessonRecord.upload = 0;
+                if (!string.IsNullOrEmpty($"{timLineJson}")) 
+                {
+                    timeLine = timLineJson.ToObject<TimeLine>();
+                    lessonRecord.upload = 1;
+                }
+                else
+                    lessonRecord.upload = 0;
+
+                List<string> groupIds = new();
+                List<string> groupNames = new();
+                List<string> gradeIds = new();
+                List<string> gradeNames = new();
 
+                if (!string.IsNullOrEmpty($"{_groupIds}"))
+                    groupIds = _groupIds.ToObject<List<string>>();
+                if (!string.IsNullOrEmpty($"{_groupNames}"))
+                    groupNames = _groupNames.ToObject<List<string>>();
+                if (!string.IsNullOrEmpty($"{_gradeIds}"))
+                    gradeIds = _gradeIds.ToObject<List<string>>();
+                if (!string.IsNullOrEmpty($"{_gradeNames}"))
+                    gradeNames = _gradeNames.ToObject<List<string>>();
 
-            return Ok(new { responseData = new ResponseData<dynamic>() { code = RespondCode.ParamsError, msg = "idToken参数错误", data = null } });
+                var cosmosClient = _azureCosmos.GetCosmosClient();
+                string code = $"LessonRecord-{school}";
 
+                var resLess = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{lessId}", new PartitionKey($"{code}"));
+                if (resLess.Status == 200)
+                {
+                    JsonDocument jsonD = JsonDocument.Parse(resLess.Content);
+                    lessonRecord = jsonD.RootElement.ToObject<LessonRecord>();
+                }
+                else
+                {
+                    lessonRecord.id = _snowflakeId.NextId().ToString();
+                    lessonRecord.code = code;
+                }
 
+                lessonRecord.tmdid = $"{tmdId}";
+                lessonRecord.tmdname = $"{tmdName}";
+                lessonRecord.tmdpicture = $"{tmdpicture}";
+                lessonRecord.name = lessonBase.summary.activityName;
+                lessonRecord.school = school;
+                lessonRecord.scope = "school";
+                lessonRecord.startTime = long.Parse($"{startTime}");
+                lessonRecord.duration = double.Parse($"{duration}");
+                lessonRecord.periodId = $"{periodId}";
+                lessonRecord.periodName = $"{periodName}";
+                lessonRecord.subjectId = $"{subjectId}";
+                lessonRecord.subjecName = $"{subjecName}";
+                lessonRecord.courseId = $"{courseId}";
+                lessonRecord.courseName = $"{courseName}";
+                lessonRecord.groupIds = groupIds;
+                lessonRecord.groupNames = groupNames;
+                lessonRecord.grade = gradeIds;
+                lessonRecord.gradeName = gradeNames;
+
+                if (!string.IsNullOrEmpty($"{baseJson}"))
+                {
+                    lessonRecord.attendCount = lessonBase.summary.attendCount;
+                    lessonRecord.clientCount = lessonBase.summary.clientCount;
+                    lessonRecord.attendRate = lessonBase.summary.attendRate;
+                    lessonRecord.groupCount = lessonBase.summary.groupCount;
+                    lessonRecord.collateTaskCount = lessonBase.summary.collateTaskCount;
+                    lessonRecord.collateCount = lessonBase.summary.collateCount;
+                    lessonRecord.pushCount = lessonBase.summary.pushCount;
+                    lessonRecord.totalPoint = lessonBase.summary.totalPoint;
+                    lessonRecord.examQuizCount = lessonBase.summary.examQuizCount;
+                    lessonRecord.interactionCount = lessonBase.summary.interactionCount;
+                    lessonRecord.examPointRate = lessonBase.summary.examPointRate;
+                    lessonRecord.clientInteractionCount = lessonBase.summary.clientInteractionCount;
+                    lessonRecord.clientInteractionAverge = lessonBase.summary.clientInteractionAverge;
+                    lessonRecord.examCount = lessonBase.summary.examCount;
+                    lessonRecord.totalInteractPoint = lessonBase.summary.totalInteractPoint;
+                    lessonRecord.source = 1;
+                }
+                if (resLess.Status == 200)
+                    lessonRecord = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync<LessonRecord>(lessonRecord, lessonRecord.id, new PartitionKey($"{code}"));
+                else
+                    lessonRecord = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<LessonRecord>(lessonRecord, new PartitionKey($"{code}"));
+
+                var blobClient = _azureStorage.GetBlobContainerClient(containerName: $"{school}");
+                if (!string.IsNullOrEmpty($"{baseJson}"))
+
+                    //保存Basejson文件
+                    await AzureStorageBlobExtensions.UploadFileByContainer(blobClient, lessonBase.ToJsonString(), $"records/{lessonRecord.id}/IES", $"Base.json");
+
+                if (!string.IsNullOrEmpty($"{timLineJson}"))
+                    //保存TimeLinejson文件
+                    await AzureStorageBlobExtensions.UploadFileByContainer(blobClient, timeLine.ToJsonString(), $"records/{lessonRecord.id}/IES", $"TimeLine.json");
+
+                return Ok(new { responseData = new ResponseData<dynamic>() { code = RespondCode.Ok, msg = "成功", data = lessonRecord } });                
+            }
+            catch (Exception ex)
+            {
+                await _dingDing.SendBotMsg($"OpenApi,{Environment.GetEnvironmentVariable("Option:Location")} BizOverallEducation/UpLessonRec()   参数:bizId:{id},school:{school},json:{jsonElement.ToJsonString()} \n  {ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
+                return Ok(new { responseData= new ResponseData<dynamic>() { code = RespondCode.Error, msg = "服务端异常" } });
+            }
         }
 
+        /// <summary>
+        /// 获取学校课例
+        /// </summary>
+        /// <param name="jsonElement"></param>
+        /// <returns></returns>
+        [ProducesDefaultResponseType]
+        [HttpPost("get-lesson-relords")]
+        [ApiToken(Auth = "1904", Name = "获取学校课例", TName = "獲取學校課例", EName = "Get school lessons", RWN = "R", Limit = false)]
+        public async Task<IActionResult> GetLessonRec(JsonElement jsonElement)
+        {
+            var (id, school) = HttpContext.GetApiTokenInfo();
+            jsonElement.TryGetProperty("lessId", out JsonElement lessId);
+            var cosmosClient = _azureCosmos.GetCosmosClient();
+
+            StringBuilder sql = new("select value(c) from c where c.source=1");
+            if (!string.IsNullOrEmpty($"{lessId}"))
+                sql.Append($" and c.id='{lessId}'");
+
+            List<OLessonRecord> lessonRecords = new();
+            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS,"School").GetItemQueryIterator<OLessonRecord>(queryText:sql.ToString(),requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonRecord-{school}") }))
+            {
+                lessonRecords.Add(item);
+            }
+
+            return Ok(new { responseData = new ResponseData<dynamic>() { code = RespondCode.Ok, msg = "成功", data = lessonRecords } });
+        }
         ///数据结构说明
         /**
          *