CrazyIter_Bin 7 tháng trước cách đây
mục cha
commit
b75119c2c8

+ 28 - 19
HTEX.DataETL/Controllers/LessonRecordController.cs

@@ -1,9 +1,11 @@
-using DocumentFormat.OpenXml.Office2010.Excel;
+using Azure.Storage.Blobs.Models;
+using DocumentFormat.OpenXml.Office2010.Excel;
 using HTEX.Lib.ETL;
 using HTEX.Lib.ETL.Lesson;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Azure.Cosmos;
 using Microsoft.OData.UriParser;
+using System.CodeDom;
 using System.Collections.Generic;
 using System.IO;
 using System.Runtime.InteropServices;
@@ -28,6 +30,7 @@ namespace HTEX.DataETL.Controllers
         private readonly AzureStorageFactory _azureStorage;
         private readonly IConfiguration _configuration;
         private readonly IWebHostEnvironment _webHostEnvironment;
+       
 
         public LessonRecordController(ILogger<LessonRecordController> logger, AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage
             , IConfiguration configuration, IWebHostEnvironment environment)
@@ -37,6 +40,7 @@ namespace HTEX.DataETL.Controllers
             _azureStorage = azureStorage;
             _configuration = configuration;
             _webHostEnvironment = environment;
+             
         }
         [HttpPost("process-local")]
         public async Task<IActionResult> ProcessLocal(JsonElement json)
@@ -145,7 +149,7 @@ namespace HTEX.DataETL.Controllers
                     XmlDocument xmlDocument = new XmlDocument();
                     var runtimePath=  System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
                     xmlDocument.Load($"{runtimePath}\\summary.xml");
-                    await  LessonETLService. ExportToExcel(lessonItems, $"{path}\\analysis.xlsx", xmlDocument);
+                    await  LessonETLService. ExportToExcelLocal(lessonItems, $"{path}\\analysis.xlsx", xmlDocument);
                 }
             }
             return Ok();
@@ -168,29 +172,34 @@ namespace HTEX.DataETL.Controllers
             var runtimePath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
             XmlDocument xmlDocument = new XmlDocument();
             xmlDocument.Load($"{runtimePath}\\summary.xml");
-            List<string> noStujson = new List<string>();
-            foreach (string fileLesson in filesLessons) 
+            foreach (string fileLesson in filesLessons)
             {
                 try {
-                    var stuFile = fileLesson.Replace("-local.json", "-stu.json");
-                    var excleFile = fileLesson.Replace("-local.json", "-stu.xlsx");
-                    if (System.IO.File.Exists(stuFile))
-                    {
-                        string stuJson = await System.IO.File.ReadAllTextAsync(stuFile);
-                        List<StudentLessonData> studentLessonDatas = stuJson.ToObject<List<StudentLessonData>>();
-                        var lessonItems = LessonETLService.ProcessStudentDataV2(studentLessonDatas, lessonDataAnalysis);
-                        await LessonETLService.ExportToExcel(lessonItems, excleFile, xmlDocument);
-                    }
-                    else
+                    string localjson = await System.IO.File.ReadAllTextAsync(fileLesson);
+                    var lessonLocal = localjson.ToObject<LessonLocal>();
+                    List<StudentLessonData> studentLessonDatas = lessonLocal.studentLessonDatas.ToJsonString().ToObject<List<StudentLessonData>>();
+                    studentLessonDatas = LessonETLService.GetBaseInfo(lessonLocal.lessonBase!, studentLessonDatas, lessonLocal?.lessonRecord?.id);
+                    studentLessonDatas = LessonETLService.GetIRSData(lessonLocal.lessonBase!, lessonLocal.timeLineData!, lessonLocal.irsDatas, studentLessonDatas, lessonLocal.examDatas, lessonLocal?.lessonRecord?.id);
+                    studentLessonDatas =  LessonETLService.GetCoworkData(lessonLocal.lessonBase!, lessonLocal.timeLineData!, lessonLocal.coworkDatas, studentLessonDatas, lessonLocal.lessonRecord.id);
+                    studentLessonDatas =  LessonETLService.GetExamData(lessonLocal.lessonBase!, lessonLocal.timeLineData!, lessonLocal.examDatas, studentLessonDatas, Constant.objectiveTypes, lessonLocal.lessonRecord.id);
+                    studentLessonDatas = LessonETLService.GetSmartRatingData(lessonLocal.lessonBase!, lessonLocal.timeLineData!, lessonLocal.smartRatingDatas, studentLessonDatas, lessonLocal.lessonRecord.id);
+                    studentLessonDatas = LessonETLService.GetTaskData(lessonLocal.lessonBase!, lessonLocal.timeLineData!, lessonLocal.taskDatas, studentLessonDatas, lessonLocal.lessonRecord.id);
+                    var pickupData = LessonETLService.GetPickupData(lessonLocal.lessonBase!, lessonLocal.timeLineData!, studentLessonDatas, lessonLocal.lessonRecord.id);
+                    studentLessonDatas= pickupData.studentLessonDatas;
+                    string owner = lessonLocal.lessonRecord.scope.Equals("school") ? lessonLocal.lessonRecord.school : lessonLocal.lessonRecord.tmdid;
+                    var lessonItems = LessonETLService.ProcessStudentDataV2(studentLessonDatas, lessonDataAnalysis);
+                    await LessonETLService.ExportToExcelAzureBlob(lessonItems, _azureStorage, owner, $"{lessonLocal.lessonRecord.id}/student-analysis.xlsx", xmlDocument);
+                    if (lessonLocal.lessonRecord.id.Equals("476665953166430208")) 
                     {
-                        noStujson.Add(stuFile);
+                        int s = 1;
                     }
-                }
-                catch (Exception ex) {
-                   throw new Exception($"{fileLesson},{ex.Message}",ex);
+                    await _azureStorage.GetBlobContainerClient(owner).UploadFileByContainer(studentLessonDatas.ToJsonString(), "records", $"{lessonLocal.lessonRecord.id}/student-analysis.json");
+                } catch (Exception ex )
+                {
+                    throw new Exception($"{fileLesson}",ex);
                 }
             }
-            return Ok(noStujson);
+            return Ok();
         }
 
 

+ 3 - 3
TEAMModelBI/TEAMModelBI.csproj

@@ -65,9 +65,9 @@
 		<SpaRoot>ClientApp\</SpaRoot>
 		<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
 		<UserSecretsId>078b5d89-7d90-4f6a-88fc-7d96025990a8</UserSecretsId>
-		<Version>5.2410.23</Version>
-		<AssemblyVersion>5.2410.23.1</AssemblyVersion>
-		<FileVersion>5.2410.23.1</FileVersion>
+		<Version>5.2410.30</Version>
+		<AssemblyVersion>5.2410.30.1</AssemblyVersion>
+		<FileVersion>5.2410.30.1</FileVersion>
 		<Description>TEAMModelBI(BI)</Description>
 		<PackageReleaseNotes>BI版本说明版本切换标记2022000908</PackageReleaseNotes>
 		<PackageId>TEAMModelBI</PackageId>

+ 137 - 9
TEAMModelOS.Extension/HTEX.Lib/ETL/Lesson/LessonETLService.cs

@@ -19,6 +19,7 @@ using TEAMModelOS.SDK;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Models;
+using TEAMModelOS.SDK.Models.Cosmos.OpenEntity;
 
 namespace HTEX.Lib.ETL.Lesson
 {
@@ -31,7 +32,7 @@ namespace HTEX.Lib.ETL.Lesson
         /// <param name="azureStorage"></param>
         /// <param name="lessonLocal"></param>
         /// <returns></returns>
-        public static async Task DoStudentLessonData(List<string> objectiveTypes, AzureStorageFactory azureStorage, LessonLocal? lessonLocal)
+        public static async Task DoStudentLessonData(List<string> objectiveTypes, AzureStorageFactory azureStorage, LessonLocal lessonLocal,DingDing _dingDing)
         {
             List<StudentLessonData> studentLessonDatas = lessonLocal.studentLessonDatas.ToJsonString().ToObject<List<StudentLessonData>>();
             studentLessonDatas = LessonETLService.GetBaseInfo(lessonLocal.lessonBase!, studentLessonDatas, lessonLocal?.lessonRecord?.id);
@@ -42,11 +43,32 @@ namespace HTEX.Lib.ETL.Lesson
             studentLessonDatas = LessonETLService.GetTaskData(lessonLocal.lessonBase!, lessonLocal.timeLineData!, lessonLocal.taskDatas, studentLessonDatas, lessonLocal.lessonRecord.id);
             var pickupData = LessonETLService.GetPickupData(lessonLocal.lessonBase!, lessonLocal. timeLineData!, studentLessonDatas, lessonLocal.lessonRecord.id);
             studentLessonDatas= pickupData.studentLessonDatas;
+
+            LessonDataAnalysisCluster lessonDataAnalysis = null ;
             string owner = lessonLocal.lessonRecord.scope.Equals("school") ? lessonLocal.lessonRecord.school : lessonLocal.lessonRecord.tmdid;
-            if (!azureStorage.GetBlobContainerClient(owner).GetBlobClient($"records/{lessonLocal.lessonRecord.id}/student-analysis.json").Exists())
+            try
+            {
+                bool exists= await  azureStorage.GetBlobContainerClient("0-public").GetBlobClient($"/lesson/analysis/analysis.json").ExistsAsync();
+                if (exists) 
+                {
+                    BlobDownloadResult blobDownload = await azureStorage.GetBlobContainerClient("0-public").GetBlobClient($"/lesson/analysis/analysis.json").DownloadContentAsync();
+                    lessonDataAnalysis = blobDownload.Content.ToObjectFromJson<LessonDataAnalysisCluster>();
+                    var lessonItems = LessonETLService.ProcessStudentDataV2(studentLessonDatas, lessonDataAnalysis);
+                    XmlDocument xmlDocument = new XmlDocument();
+                    var runtimePath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
+                    xmlDocument.Load($"{runtimePath}\\summary.xml");
+                    await LessonETLService.ExportToExcelAzureBlob(lessonItems,azureStorage, owner,$"{lessonLocal.lessonRecord.id}/student-analysis.xlsx", xmlDocument);
+                }
+            }
+            catch (Exception ex)
             {
-                await azureStorage.GetBlobContainerClient(owner).UploadFileByContainer(studentLessonDatas.ToJsonString(), "records", $"{lessonLocal.lessonRecord.id}/student-analysis.json");
+                if (!ex.Message.Contains("The specified blob does not exist"))
+                {
+                    await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")},lesson/analysis/analysis.json转换异常,{ex.Message}{ex.StackTrace}", GroupNames.成都开发測試群組);
+                }
             }
+            await azureStorage.GetBlobContainerClient(owner).UploadFileByContainer(studentLessonDatas.ToJsonString(), "records", $"{lessonLocal.lessonRecord.id}/student-analysis.json");
+          
         }
         public static void GenAnalysisData(string pathAnalysis, long newest, List<TechCount> techCounts)
         {
@@ -1710,6 +1732,12 @@ namespace HTEX.Lib.ETL.Lesson
             //排名 = (积分 - 最低积分) / (最高积分 - 最低积分) * (最大排名 - 最小排名) + 最小排名
             return x==0 ? 0 : max-min!=0 ? (x - min)*1.0 / (max - min) * (maxRank - minRank) + minRank : (x)*1.0 / (max) * (maxRank - minRank) + minRank;
         }
+        /// <summary>
+        /// 处理学生课中数据
+        /// </summary>
+        /// <param name="studentLessonDatas"></param>
+        /// <param name="lessonDataAnalysis"></param>
+        /// <returns></returns>
         public static List<StudentLessonItem> ProcessStudentDataV2(List<StudentLessonData> studentLessonDatas, LessonDataAnalysisCluster lessonDataAnalysis)
         {
 
@@ -1725,6 +1753,9 @@ namespace HTEX.Lib.ETL.Lesson
             foreach (var studentLessonData in studentLessonDatas)
             {
                 StudentLessonItem lessonItem = new StudentLessonItem() { studentId= studentLessonData.id! };
+                if (studentLessonData.id.Equals("1529649295")) {
+                    int s1 = 1;
+                }
                 double u = 0.0;
                 if (studentLessonData.attend==1)
                 {
@@ -1735,7 +1766,7 @@ namespace HTEX.Lib.ETL.Lesson
                 //本节课教师手动给学生的个人计分
                 var s = studentLessonData.pscore;
                 //个人计分指数
-                double  c =  GetPersent(lessonDataAnalysis.pscore, s).persent/100;// s*1.0/max_q;
+                double  c =  GetPersent(lessonDataAnalysis.pscore, s).persent;// s*1.0/max_q;
                 {
                     //互动相关的计分
                     //课例互动次数
@@ -1795,9 +1826,42 @@ namespace HTEX.Lib.ETL.Lesson
                         //c+a= 个人计分指数+ 个人互动成效指数
                         //互动成效
                         var f1 = Math.Round(190*1.0/(1+Math.Exp(-(a*m)))-95, 4);
-                        //如果有互动计分,则互动成效指数取0.8 0.2
-                        f1=f1*0.8+d*0.2+c*0.4;
-                        if (f1>95) { f1=95; }
+                        if (f1==0)
+                        {
+                            if (d>0 && c==0)
+                            {
+                                f1=d*0.6;
+                            }
+                            else if (d==0 && c>0)
+                            {
+                                f1=c*0.6;
+                            }
+                            else 
+                            {
+                                f1=(d*0.6+c*0.6)/2;
+                            }
+                           
+                        }
+                        else 
+                        {
+                            //如果有互动计分,则互动成效指数取0.8 0.2
+                            var dy = (95-f1)/95/2;
+                            if (dy>0.2) 
+                            {
+                                dy=0.2;
+                            }
+                            if (dy<0.1) {
+                                dy=0.1;
+                            }
+                            
+                            f1=f1*(dy>0.1? 1-dy : 1-dy*2)+d*dy+c*dy;
+
+                        }
+                        if (f1>95)
+                        {
+                            f1=95;
+                        }
+
                         //var f1 = Math.Round(a*m);
                         lessonItem.hd_cx=f1;
                         
@@ -1914,7 +1978,17 @@ namespace HTEX.Lib.ETL.Lesson
                         groupType+=1;
                         lessonItem.xz_sc=groupTasks.Count();
                     }
-                    var fxGrp = (pickRate+coworkRate+gscoreRate+groupTask)/groupType;
+                    double fxGrp = 0;
+                    if (groupType>0) { 
+                        fxGrp = (pickRate+coworkRate+gscoreRate+groupTask)/groupType; }
+                    if (groupType==2  &&(pickRate>0 && gscoreRate>0)  )
+                    {
+                        fxGrp = (pickRate*0.8+coworkRate+gscoreRate*0.8+groupTask)/groupType;
+                    }
+                    if (groupType==1)
+                    {
+                        fxGrp=(pickRate+coworkRate+gscoreRate+groupTask)*0.8/groupType;
+                    }
                     lessonItem.hz_nl=fxGrp;
                 }
                 {
@@ -2077,6 +2151,11 @@ namespace HTEX.Lib.ETL.Lesson
                 lessonItem.xx_cx=xx_cx;
                 lessonItem.xx_cy=xx_cy;
                 lessonItems.Add(lessonItem);
+                studentLessonData.achieve= lessonItem.xx_cx;
+                studentLessonData.attitude= lessonItem.xx_cy;
+                studentLessonData.appraise= lessonItem.pj_nl;
+                studentLessonData.cowork= lessonItem.xz_cx;
+                studentLessonData.cooperation=lessonItem.hz_nl;
             }
             return lessonItems;
         }
@@ -2117,12 +2196,61 @@ namespace HTEX.Lib.ETL.Lesson
             return datas;
         }
         /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="items"></param>
+        /// <param name="filePath"></param>
+        /// <returns></returns>
+        public static async Task ExportToExcelAzureBlob(List<StudentLessonItem> items, AzureStorageFactory azureStorage,string owner , string path ,  XmlDocument xmlDocument)
+        {
+            ExcelPackage.LicenseContext = OfficeOpenXml.LicenseContext.NonCommercial;
+            using (var memoryStream = new MemoryStream()) 
+            {
+                using (ExcelPackage package = new ExcelPackage())
+                {
+                    ExcelWorksheet worksheet = package.Workbook.Worksheets.Add("学生课中数据");
+
+                    // 获取类的属性
+                    PropertyInfo[] properties = typeof(StudentLessonItem).GetProperties();
+
+                    // 添加表头
+                    int currentRow = 1;
+                    for (int i = 0; i < properties.Length; i++)
+                    {
+
+                        string summary = Regex.Replace(GetPropertySummary(properties[i], xmlDocument), @"\s+", "");
+                        worksheet.Cells[currentRow, i + 1].Value = summary;
+                    }
+
+                    // 填充数据
+                    currentRow = 2;
+                    foreach (var item in items)
+                    {
+                        for (int i = 0; i < properties.Length; i++)
+                        {
+                            worksheet.Cells[currentRow, i + 1].Value = properties[i].GetValue(item);
+                        }
+                        currentRow++;
+                    }
+
+                    // 设置表格样式
+                    worksheet.Cells[worksheet.Dimension.Address].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Left;
+                    worksheet.Cells[worksheet.Dimension.Address].Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Top;
+
+                    // 保存到文件流
+                    await package.SaveAsAsync(memoryStream);
+                    memoryStream.Position=0;
+                }
+                await azureStorage.GetBlobContainerClient(owner).UploadFileByContainer(memoryStream, "records", path);
+            }
+        }
+        /// <summary>
         /// 导出Excel
         /// </summary>
         /// <param name="items"></param>
         /// <param name="filePath"></param>
         /// <returns></returns>
-        public static async Task ExportToExcel(List<StudentLessonItem> items, string filePath, XmlDocument xmlDocument)
+        public static async Task ExportToExcelLocal(List<StudentLessonItem> items, string filePath, XmlDocument xmlDocument)
         {
             ExcelPackage.LicenseContext = OfficeOpenXml.LicenseContext.NonCommercial;
             using (ExcelPackage package = new ExcelPackage())

+ 18 - 2
TEAMModelOS.Extension/HTEX.Lib/summary.xml

@@ -8188,7 +8188,7 @@
             小组编号
             </summary>
         </member>
-        <member name="M:HTEX.Lib.ETL.Lesson.LessonETLService.DoStudentLessonData(System.Collections.Generic.List{System.String},TEAMModelOS.SDK.DI.AzureStorageFactory,HTEX.Lib.ETL.Lesson.LessonLocal)">
+        <member name="M:HTEX.Lib.ETL.Lesson.LessonETLService.DoStudentLessonData(System.Collections.Generic.List{System.String},TEAMModelOS.SDK.DI.AzureStorageFactory,HTEX.Lib.ETL.Lesson.LessonLocal,TEAMModelOS.SDK.DI.DingDing)">
             <summary>
             生成学生student-analysis.json
             </summary>
@@ -8295,6 +8295,14 @@
             </summary>
             <returns></returns>
         </member>
+        <member name="M:HTEX.Lib.ETL.Lesson.LessonETLService.ProcessStudentDataV2(System.Collections.Generic.List{TEAMModelOS.SDK.Models.StudentLessonData},HTEX.Lib.ETL.Lesson.LessonDataAnalysisCluster)">
+            <summary>
+            处理学生课中数据
+            </summary>
+            <param name="studentLessonDatas"></param>
+            <param name="lessonDataAnalysis"></param>
+            <returns></returns>
+        </member>
         <member name="M:HTEX.Lib.ETL.Lesson.LessonETLService.CleanDataBySDThreshold(System.Collections.Generic.IEnumerable{System.Double},System.Double)">
             <summary>
             使用标准差定义异常值。如果一个数字与平均值的偏差超过某个标准差倍数(例如2倍或3倍),则可以认为它是异常的。
@@ -8302,7 +8310,15 @@
             <param name="array"></param>
             <returns></returns>
         </member>
-        <member name="M:HTEX.Lib.ETL.Lesson.LessonETLService.ExportToExcel(System.Collections.Generic.List{HTEX.Lib.ETL.Lesson.StudentLessonItem},System.String,System.Xml.XmlDocument)">
+        <member name="M:HTEX.Lib.ETL.Lesson.LessonETLService.ExportToExcelAzureBlob(System.Collections.Generic.List{HTEX.Lib.ETL.Lesson.StudentLessonItem},TEAMModelOS.SDK.DI.AzureStorageFactory,System.String,System.String,System.Xml.XmlDocument)">
+            <summary>
+            
+            </summary>
+            <param name="items"></param>
+            <param name="filePath"></param>
+            <returns></returns>
+        </member>
+        <member name="M:HTEX.Lib.ETL.Lesson.LessonETLService.ExportToExcelLocal(System.Collections.Generic.List{HTEX.Lib.ETL.Lesson.StudentLessonItem},System.String,System.Xml.XmlDocument)">
             <summary>
             导出Excel
             </summary>

+ 7 - 51
TEAMModelOS.Extension/HTEX.Test/Controllers/MockDataController.cs

@@ -242,6 +242,7 @@ namespace HTEX.Test.Controllers
                             item.resultWeight= InteractWeight.T0;
                             item.resultType= InteractReultType.T0;
                             item.itemScore=0;
+                            item.optCount=0;
                             break;
                         //参加
                         case bool when w==1:
@@ -459,19 +460,19 @@ namespace HTEX.Test.Controllers
             }
            
             #endregion 数据模拟
-            string jsons = await System.IO.File.ReadAllTextAsync("E:\\lesson-local\\analysis\\analysis.json");
+            string jsons = await System.IO.File.ReadAllTextAsync("F:\\lesson-local\\analysis\\analysis.json");
             long time = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
             LessonDataAnalysisCluster lessonDataAnalysis = jsons.ToObject<LessonDataAnalysisCluster>();
 
             var lessonItems= LessonETLService. ProcessStudentDataV2(students, lessonDataAnalysis);
-            var excleFile = $"E:\\mock-data\\{time}.xlsx";
+            var excleFile = $"F:\\mock-data\\{time}.xlsx";
             var runtimePath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
             XmlDocument xmlDocument = new XmlDocument();
             xmlDocument.Load($"{runtimePath}\\summary.xml");
             List<string> noStujson = new List<string>();
-            await LessonETLService.ExportToExcel(lessonItems, excleFile, xmlDocument);
+            await LessonETLService.ExportToExcelLocal(lessonItems, excleFile, xmlDocument);
             try {
-                await System.IO.File.WriteAllTextAsync($"E:\\mock-data\\{time}.json", new { scount, ecount, qcount, icount, tcount, pcount, xcount, students }.ToJsonString());
+                await System.IO.File.WriteAllTextAsync($"F:\\mock-data\\{time}.json", new { scount, ecount, qcount, icount, tcount, pcount, xcount, students }.ToJsonString());
             } catch (Exception ex) {
                 Console.WriteLine(scount);
             }
@@ -480,27 +481,7 @@ namespace HTEX.Test.Controllers
 
         
  
-        private static string GetPropertySummary(PropertyInfo property)
-        {
-            var xmlDocumentationFile = "./x.xml"; // XML注释文件路径
-            if (System.IO. File.Exists(xmlDocumentationFile))
-            {
-                XmlDocument xmlDocument = new XmlDocument();
-                xmlDocument.Load(xmlDocumentationFile);
-
-                XmlNodeList xmlNodeList = xmlDocument.DocumentElement.SelectNodes("//member[@name='P:" + property.DeclaringType.FullName + "." + property.Name + "']");
-
-                if (xmlNodeList.Count > 0)
-                {
-                    XmlNode xmlNode = xmlNodeList[0];
-                    if (xmlNode != null && xmlNode.FirstChild != null)
-                    {
-                        return xmlNode.FirstChild.InnerText;
-                    }
-                }
-            }
-            return property.Name;
-        }
+        
         private static int GetRandomValueByWeight(List<WeightedItem> items)
         {
             Random random = new Random();
@@ -526,32 +507,7 @@ namespace HTEX.Test.Controllers
             //排名 = (积分 - 最低积分) / (最高积分 - 最低积分) * (最大排名 - 最小排名) + 最小排名
             return Math.Round(x==0 ? 0 : max-min!=0 ? (x - min)*1.0 / (max - min) * (maxRank - minRank) + minRank : (x)*1.0 / (max) * (maxRank - minRank) + minRank,4);
         }
-        /// <summary>
-        /// 计算当前元素在集合中超过了多少百分比的值
-        /// </summary>
-        /// <param name="nums"></param>
-        /// <param name="curr"></param>
-        /// <returns></returns>
-        public static double GetPersent(IEnumerable<double> nums, double curr)
-        {
-            int count = 0;
-            foreach (var op in nums.OrderBy(x => x))
-            {
-                if (op < curr)
-                {
-                    count++;
-                }
-                else if (op == curr)
-                {
-                    count++;
-                }
-                else
-                {
-                    break;
-                }
-            }
-            return count *1.0/ nums.Count() * 100;
-        }
+        
     }
     class WeightedItem
     {

+ 1 - 1
TEAMModelOS.Extension/HTEX.Test/Program.cs

@@ -70,7 +70,7 @@ namespace HTEX.Test
 
         public static string Test2() 
         {
-            string? pathAnalysis = $"E:\\lesson-local\\analysis";
+            string? pathAnalysis = $"F:\\lesson-local\\analysis";
             var filesAnalysis = FileHelper.ListAllFiles(pathAnalysis);
             List<LessonDataAnalysisMonth> lessonDataAnalysisMonths = new List<LessonDataAnalysisMonth>();
             LessonDataAnalysisCluster lessonDataAnalysisCluster = new LessonDataAnalysisCluster();

+ 0 - 8
TEAMModelOS.Extension/HTEX.Test/x.xml

@@ -4,14 +4,6 @@
         <name>HTEX.Test</name>
     </assembly>
     <members>
-        <member name="M:HTEX.Test.Controllers.MockDataController.GetPersent(System.Collections.Generic.IEnumerable{System.Double},System.Double)">
-            <summary>
-            计算当前元素在集合中超过了多少百分比的值
-            </summary>
-            <param name="nums"></param>
-            <param name="curr"></param>
-            <returns></returns>
-        </member>
         <member name="M:HTEX.Test.Program.GetPersent(System.Collections.Generic.IEnumerable{System.Double},System.Int32)">
             <summary>
             计算当前元素在集合中超过了多少百分比的值

+ 1 - 1
TEAMModelOS.Function/IESServiceBusTrigger.cs

@@ -1761,7 +1761,7 @@ namespace TEAMModelOS.Function
                                             studentLessonDatas=studentLessonDatas
                                         };
                                         try {
-                                            await LessonETLService.DoStudentLessonData(Constant.objectiveTypes, _azureStorage, lessonLocal);
+                                            await LessonETLService.DoStudentLessonData(Constant.objectiveTypes, _azureStorage, lessonLocal,_dingDing);
                                         } catch (Exception ex) {
                                             await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}处理学生课中数据发生异常,{_lessonId}\n{ex.Message}\n{ex.StackTrace}\n\n{lessonRecord.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
                                         }

+ 3 - 3
TEAMModelOS.Function/TEAMModelOS.Function.csproj

@@ -5,9 +5,9 @@
     <OutputType>Exe</OutputType>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-	<Version>5.2410.23</Version>
-	<AssemblyVersion>5.2410.23.1</AssemblyVersion>
-	<FileVersion>5.2410.23.1</FileVersion>
+	<Version>5.2410.30</Version>
+	<AssemblyVersion>5.2410.30.1</AssemblyVersion>
+	<FileVersion>5.2410.30.1</FileVersion>
 	<PackageId>TEAMModelOS.FunctionV4</PackageId>
 	<Authors>teammodel</Authors>
 	<Company>醍摩豆(成都)信息技术有限公司</Company>

+ 1 - 1
TEAMModelOS.SDK/Models/Cosmos/Common/LessonRecord.cs

@@ -697,7 +697,7 @@ namespace TEAMModelOS.SDK.Models
         /// <summary>
         /// 当前任务操作次数。一般为一次,智慧评分,在互评的时候可能会被分配多个作品,会评论多次。
         /// </summary>
-        public int optCount { get; set; } = 1;
+        public int optCount { get; set; } 
     }
     public static class InteractReultType
     {

+ 5 - 0
TEAMModelOS.SDK/Models/Service/Common/ActivityService.cs

@@ -812,12 +812,17 @@ namespace TEAMModelOS.SDK
                     yearSql = $" and c.year={_year}";
                 }
             }
+            long now = DateTimeOffset.Now.ToUnixTimeMilliseconds();
             string sql = $"select value c from c where c.owner='{_areaId}' {yearSql}  ";
             var result = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Common).GetList<ActivityDto>(sql, "Activity");
             result.list.ForEach(z => {
                 var (blob_uri, blob_sas) = _azureStorage.GetBlobContainerSAS(z.owner, BlobContainerSasPermissions.Read | BlobContainerSasPermissions.List);
                 z.sas=blob_sas;
                 z.url=blob_uri;
+                if (z.etime<now&& z.publish==1) 
+                {
+                    z.publish=2;
+                }
             });
             return result.list.OrderByDescending(z => z.stime);
         }

+ 3 - 3
TEAMModelOS.SDK/TEAMModelOS.SDK.csproj

@@ -1,9 +1,9 @@
 <Project Sdk="Microsoft.NET.Sdk">
 	<PropertyGroup>
 		<TargetFramework>net8.0</TargetFramework>
-		<Version>5.2410.23</Version>
-		<AssemblyVersion>5.2410.23.1</AssemblyVersion>
-		<FileVersion>5.2410.23.1</FileVersion>
+		<Version>5.2410.30</Version>
+		<AssemblyVersion>5.2410.30.1</AssemblyVersion>
+		<FileVersion>5.2410.30.1</FileVersion>
 		<PackageReleaseNotes>发版</PackageReleaseNotes>
 	</PropertyGroup>
 

+ 4 - 4
TEAMModelOS/TEAMModelOS.csproj

@@ -79,11 +79,11 @@
 		<SpaRoot>ClientApp\</SpaRoot>
 		<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
 		<UserSecretsId>078b5d89-7d90-4f6a-88fc-7d96025990a8</UserSecretsId>
-		<Version>5.2410.23</Version>
-		<AssemblyVersion>5.2410.23.1</AssemblyVersion>
-		<FileVersion>5.2410.23.1</FileVersion>
+		<Version>5.2410.30</Version>
+		<AssemblyVersion>5.2410.30.1</AssemblyVersion>
+		<FileVersion>5.2410.30.1</FileVersion>
 		<Description>TEAMModelOS(IES5)</Description>
-		<PackageReleaseNotes>IES版本说明版本切换标记5.2410.23.1</PackageReleaseNotes>
+		<PackageReleaseNotes>IES版本说明版本切换标记5.2410.30.1</PackageReleaseNotes>
 		<PackageId>TEAMModelOS</PackageId>
 		<Authors>teammodel</Authors>
 		<Company>醍摩豆(成都)信息技术有限公司</Company>

+ 1 - 1
TEAMModelOS/appsettings.Development.json

@@ -18,7 +18,7 @@
     "IdTokenSalt": "8263692E2213497BB55E74792B7900B4",
     "HttpTrigger": "https://teammodelosfunction-test.chinacloudsites.cn/api/",
     //"HttpTrigger": "http://localhost:7071/api/"
-    "Version": "5.2410.23.1"
+    "Version": "5.2410.30.1"
   },
   "Azure": {
     // 测试站数据库

+ 1 - 1
TEAMModelOS/appsettings.json

@@ -18,7 +18,7 @@
     "Exp": 86400,
     "IdTokenSalt": "8263692E2213497BB55E74792B7900B4",
     "HttpTrigger": "https://teammodelosfunction.chinacloudsites.cn/api/",
-    "Version": "5.2410.23.1"
+    "Version": "5.2410.30.1"
   },
   "Azure": {
     "Storage": {