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

+ 80 - 3
TEAMModelOS.Extension/HTEX.Lib/ETL/Lesson/LessonETLService.cs

@@ -28,6 +28,8 @@ using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Models;
 using TEAMModelOS.SDK.Models.Cosmos.Common;
 using TEAMModelOS.SDK.Models.Cosmos.OpenEntity;
+using TEAMModelOS.SDK.Models.Dtos;
+using static TEAMModelOS.SDK.Models.ThirdService;
 
 namespace HTEX.Lib.ETL.Lesson
 {
@@ -45,7 +47,7 @@ namespace HTEX.Lib.ETL.Lesson
         /// <returns></returns>
         public static async Task<(List<StudentLessonData> studentLessonDatas, List<StudentLessonItem> lessonItems)>
             DoStudentLessonData(List<string> objectiveTypes, AzureStorageFactory azureStorage, LessonLocal lessonLocal,DingDing _dingDing,
-            CosmosClient client,string location 
+            CosmosClient client,string location ,AzureRedisFactory azureRedis
             )
         {
             List<StudentLessonData> studentLessonDatas = lessonLocal.studentLessonDatas.ToJsonString().ToObject<List<StudentLessonData>>();
@@ -62,6 +64,7 @@ namespace HTEX.Lib.ETL.Lesson
             string owner = lessonLocal.lessonRecord.scope.Equals("school") ? lessonLocal.lessonRecord.school : lessonLocal.lessonRecord.tmdid;
             try
             {
+                
                 bool exists= await  azureStorage.GetBlobContainerClient("0-public").GetBlobClient($"/lesson/analysis/analysis.json").ExistsAsync();
                 if (exists) 
                 {
@@ -72,6 +75,7 @@ namespace HTEX.Lib.ETL.Lesson
                     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);
+                    await _dingDing.SendBotMsg($"学生课中报告已经生成:{owner},records/{lessonLocal.lessonRecord.id}/student-analysis.xlsx",GroupNames.成都开发測試群組);
                 }
             }
             catch (Exception ex)
@@ -92,6 +96,13 @@ namespace HTEX.Lib.ETL.Lesson
                 }
                 if (school!=null)
                 {
+                    List<Student> studentsBase = new List<Student>();
+                    var result = await client.GetContainer(Constant.TEAMModelOS, Constant.Student).GetList<Student>($"select value c from c where c.id in ({string.Join(",", studentLessonDatas.Select(d => $"'{d.id}'"))})", $"Base-{school.id}");
+                    if (result.list.Any())
+                    {
+                        studentsBase = result.list;
+
+                    }
                     string? periodId = !string.IsNullOrWhiteSpace(lessonLocal.lessonRecord.periodId) ? lessonLocal.lessonRecord.periodId : school.period.FirstOrDefault()?.id;
                     var period = school.period.Find(x => x.id.Equals(periodId));
                     if (period!=null) 
@@ -167,7 +178,7 @@ namespace HTEX.Lib.ETL.Lesson
                                 if (studentLessonData.cooperation>0 || studentLessonData.achieve>0|| studentLessonData.attitude>0 || studentLessonData.cowork>0 ||  studentLessonData.appraise>0) 
                                 {
                                     les.attend=1;
-                                    studentSemester.lessons.Add(new StuLessonLite
+                                    lesson = new StuLessonLite
                                     {
                                         id=lessonLocal.lessonRecord.id,
                                         tmdid=lessonLocal.lessonRecord.tmdid,
@@ -178,7 +189,8 @@ namespace HTEX.Lib.ETL.Lesson
                                         trate=studentLessonData.attitude,
                                         xrate=studentLessonData.cowork,
                                         prate=studentLessonData.appraise
-                                    });
+                                    };
+                                    studentSemester.lessons.Add(lesson);
                                 }
                                 else
                                 {
@@ -193,6 +205,71 @@ namespace HTEX.Lib.ETL.Lesson
                                 }
                             }
                             await client.GetContainer(Constant.TEAMModelOS, Constant.Student).UpsertItemAsync(studentSemester, new PartitionKey(studentSemester.code));
+                            string oid = $"{semester.studyYear}-{semester.currSemester.id}-{studentSemester.stuid}";
+                            string ocode = $"OverallEducation-{school.id}";
+
+                            ResponseMessage oresponse = await client.GetContainer(Constant.TEAMModelOS, Constant.Student).ReadItemStreamAsync(oid, new PartitionKey(ocode));
+                            OverallEducation overallEducation = null;
+                            var student=   studentsBase.Find(x => x.id.Equals(studentSemester.stuid));
+                            if (student!=null)
+                            {
+                                if (!oresponse.IsSuccessStatusCode)
+                                {
+                                    overallEducation = new OverallEducation
+                                    {
+                                        id =oid,
+                                        code = $"OverallEducation-{school}",
+                                        pk = "OverallEducation",
+                                        ttl = -1,
+                                        name = student.name,
+                                        classId = student?.classId,
+                                        schoolCode = $"{school}",
+                                        semesterId = semester.currSemester.id,
+                                        year = semester.studyYear,
+                                        periodId = $"{period.id}",
+                                        stuYear = student.year,
+                                        studentId = student.id,
+                                        lessonScore= new List<StudentLessonRecord>()
+                                    };
+                                }
+                                else 
+                                {
+                                    overallEducation = JsonDocument.Parse(oresponse.Content).RootElement.ToObject<OverallEducation>();
+                                }
+                                var hasrecord = overallEducation.lessonScore.Find(x => x.lessonId.Equals(lessonLocal.lessonRecord.id));
+                                if (hasrecord==null)
+                                {
+                                    hasrecord=   new StudentLessonRecord();
+                                    overallEducation.lessonScore.Add(hasrecord);
+                                }
+                                hasrecord.gscore = studentLessonData.gscore;
+                                hasrecord.pscore = studentLessonData.pscore;
+                                hasrecord.tscore = studentLessonData.tscore;
+                                hasrecord.tmdid = lessonLocal.lessonRecord.tmdid;
+                                hasrecord.school = school.id;
+                                hasrecord.scope = lessonLocal.lessonRecord.scope;
+                                hasrecord.lessonId = lessonLocal.lessonRecord.id;
+                                hasrecord.courseId = lessonLocal.lessonRecord.courseId;
+                                periodId = period?.id;
+                                hasrecord.subjectId = lessonLocal.lessonRecord.subjectId;
+                                hasrecord.time= lessonLocal.lessonRecord.startTime;
+                                hasrecord.attend=les.attend;
+                                if (lesson!=null) 
+                                {
+                                    hasrecord.hrate=lesson.hrate;
+                                    hasrecord.crate=lesson.crate;
+                                    hasrecord.trate=lesson.trate;
+                                    hasrecord.xrate=lesson.xrate;
+                                    hasrecord.prate=lesson.prate;
+                                }
+                                if (overallEducation!=null) 
+                                {
+                                    await client.GetContainer(Constant.TEAMModelOS, Constant.Student).UpsertItemAsync(overallEducation, partitionKey: new PartitionKey(overallEducation.code));
+                                    string key = $"OverallEducation:{school.id}:{period.id}:{semester.studyYear}:{semester.currSemester.id}:{student?.classId}";
+                                    await azureRedis.GetRedisClient(8).HashSetAsync(key, studentLessonData.id, overallEducation.ToJsonString());
+                                    await azureRedis.GetRedisClient(8).KeyExpireAsync(key, new TimeSpan(180 *24, 0, 0));
+                                }
+                            }
                         }
                     }
                 }

+ 1 - 1
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,TEAMModelOS.SDK.DI.DingDing,Microsoft.Azure.Cosmos.CosmosClient,System.String)">
+        <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,Microsoft.Azure.Cosmos.CosmosClient,System.String,TEAMModelOS.SDK.DI.AzureRedisFactory)">
             <summary>
             生成学生student-analysis.json
             </summary>

+ 3 - 452
TEAMModelOS.Function/IESServiceBusTrigger.cs

@@ -1767,7 +1767,7 @@ namespace TEAMModelOS.Function
                                             {
 
                                                 var location = Environment.GetEnvironmentVariable("Option:Location");
-                                                await LessonETLService.DoStudentLessonData(Constant.objectiveTypes, _azureStorage, lessonLocal, _dingDing, client, location);
+                                                await LessonETLService.DoStudentLessonData(Constant.objectiveTypes, _azureStorage, lessonLocal, _dingDing, client, location,_azureRedis);
                                                 
                                                 // 使用当前文化设置的日历
                                                 CultureInfo cultureInfo = CultureInfo.CurrentCulture;
@@ -1789,6 +1789,7 @@ namespace TEAMModelOS.Function
                                                         scope= lessonRecord.scope,
                                                     }.ToJsonString()
                                                 );
+                                                await _azureRedis.GetRedisClient(8).KeyExpireAsync(key, TimeSpan.FromDays(10));
                                             }
                                            
                                         } catch (Exception ex) {
@@ -2350,7 +2351,7 @@ namespace TEAMModelOS.Function
             }
             catch (Exception ex)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-更新课堂记录出错\n{ex.Message}\n{ex.StackTrace}\n\n{data}\n{code}\n{updates}\n", GroupNames.醍摩豆服務運維群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-更新课堂记录出错IESServiceBusTrigger\n{ex.Message}{ex.StackTrace}{data}{code}", GroupNames.醍摩豆服務運維群組);
             }
             finally
             {
@@ -2380,456 +2381,6 @@ namespace TEAMModelOS.Function
             {
 
                 jsonMsg.TryGetProperty("id", out JsonElement id);
-                List<string> s = new List<string> {
-    "618383714644267008",
-    "618630854016634880",
-    "618639271695355904",
-    "618640449749520384",
-    "620623657311539200",
-    "620769989728800768",
-    "620775070238904320",
-    "620775832566239232",
-    "620776913832644608",
-    "620787217111060480",
-    "620795220476432384",
-    "620796468495781888",
-    "620796818011328512",
-    "620796996902588416",
-    "620797607958155264",
-    "620798527320231936",
-    "620798663412813824",
-    "620799211566403584",
-    "620807116025892864",
-    "620808910961512448",
-    "620809140889063424",
-    "620809163706077184",
-    "620809855023845376",
-    "620809903249952768",
-    "620809998108332032",
-    "620810231823339520",
-    "620810301507506176",
-    "620820698989989888",
-    "620821342563995648",
-    "620822046326263808",
-    "620825397654851584",
-    "620827827394187264",
-    "620852427683401728",
-    "620860204376002560",
-    "620860252375617536",
-    "620861281972391936",
-    "620861393083699200",
-    "620872932612247552",
-    "620873604166455296",
-    "620873982954049536",
-    "620875597110972416",
-    "620887684918939648",
-    "621006983390171136",
-    "621134228180045824",
-    "621140417219530752",
-    "621140419836776448",
-    "621140523113123840",
-    "621140731976880128",
-    "621140902445977600",
-    "621141275739033600",
-    "621143057429041152",
-    "621143125586481152",
-    "621157412396732416",
-    "621159069046149120",
-    "621159268762128384",
-    "621159391265165312",
-    "621159539403788288",
-    "621159910557749248",
-    "621160830200844288",
-    "621161420683350016",
-    "621163812778807296",
-    "621171574149615616",
-    "621172460670291968",
-    "621172564609339392",
-    "621173834309046272",
-    "621174044871495680",
-    "621174420630802432",
-    "621185040327512064",
-    "621189837134893056",
-    "621209903113048064",
-    "621216625554755584",
-    "621221078127218688",
-    "621222075952140288",
-    "621226486669643776",
-    "621241713205317632",
-    "621241909414858752",
-    "621242593262571520",
-    "621248963063975936",
-    "621257063040946176",
-    "621273984884936704",
-    "621495724793794560",
-    "621495850035712000",
-    "621498114712408064",
-    "621498577683877888",
-    "621502049258967040",
-    "621502108839055360",
-    "621502698155544576",
-    "621502898777493504",
-    "621503510453817344",
-    "621503555412561920",
-    "621506847777624064",
-    "621520920695148544",
-    "621521083635470336",
-    "621521363424907264",
-    "621521375567417344",
-    "621521389098242048",
-    "621521653108707328",
-    "621521660582957056",
-    "621521683827789824",
-    "621521884051279872",
-    "621521898194472960",
-    "621522476920344576",
-    "621534127023329280",
-    "621534745100161024",
-    "621535185141370880",
-    "621535527392382976",
-    "621536467751145472",
-    "621537051912835072",
-    "621545585819914240",
-    "621545749347438592",
-    "621546190210732032",
-    "621546198939078656",
-    "621546327259615232",
-    "621546608848408576",
-    "621546623889182720",
-    "621546729304625152",
-    "621546908657258496",
-    "621547271217090560",
-    "621547305165787136",
-    "621548274305863680",
-    "621548738644676608",
-    "621560315955515392",
-    "621570029082775552",
-    "621583702312488960",
-    "621585124852633600",
-    "621585130619801600",
-    "621585142753923072",
-    "621585618891313152",
-    "621585632594104320",
-    "621585771522035712",
-    "621585949750595584",
-    "621586049138823168",
-    "621586610647076864",
-    "621586659619770368",
-    "621586703425081344",
-    "621586819213037568",
-    "621587431103270912",
-    "621590758717263872",
-    "621594392976822272",
-    "621597857589366784",
-    "621598710492696576",
-    "621598756407742464",
-    "621599238425546752",
-    "621599453819834368",
-    "621599484266287104",
-    "621606663941656576",
-    "621610325862649856",
-    "621613236986449920",
-    "621621051201294336",
-    "621622557698822144",
-    "621630794242330624",
-    "621631243456483328",
-    "621839863603400704",
-    "621855326978838528",
-    "621857043967512576",
-    "621857880064266240",
-    "621858877289402368",
-    "621862082693959680",
-    "621864237685411840",
-    "621864472558047232",
-    "621864527574732800",
-    "621864798048620544",
-    "621864858887000064",
-    "621865499801817088",
-    "621865555359567872",
-    "621865835274833920",
-    "621865890400571392",
-    "621866248472498176",
-    "621866587540033536",
-    "621868088098426880",
-    "621876561452339200",
-    "621881641173913600",
-    "621882854607032320",
-    "621883068969521152",
-    "621883353146200064",
-    "621883457919913984",
-    "621883502266290176",
-    "621883800519053312",
-    "621883885965414400",
-    "621883983122272256",
-    "621884114848583680",
-    "621884263620546560",
-    "621884289134497792",
-    "621884510103015424",
-    "621885173524467712",
-    "621885336242491392",
-    "621887597106565120",
-    "621895190914928640",
-    "621895267435810816",
-    "621896772893151232",
-    "621896954112249856",
-    "621897027445460992",
-    "621897567604707328",
-    "621898107998834688",
-    "621898158200459264",
-    "621898307727396864",
-    "621899526344675328",
-    "621899907745320960",
-    "621900186205163520",
-    "621900586954133504",
-    "621902361522212864",
-    "621907255788441600",
-    "621907685201285120",
-    "621907837408382976",
-    "621907935248912384",
-    "621908115318771712",
-    "621908325801529344",
-    "621908468491751424",
-    "621908571340279808",
-    "621908735153016832",
-    "621908903726288896",
-    "621909104381792256",
-    "621909105279373312",
-    "621909121045762048",
-    "621909147788644352",
-    "621909587787911168",
-    "621911671153233920",
-    "621927305996013568",
-    "621931295357931520",
-    "621936143780417536",
-    "621944983200600064",
-    "621946012356972544",
-    "621947865941544960",
-    "621948210059022336",
-    "621948717678858240",
-    "621948780962516992",
-    "621948988794474496",
-    "621949657597218816",
-    "621950255608500224",
-    "621950550191247360",
-    "621951554739638272",
-    "621953293903597568",
-    "621960223103520768",
-    "621961256588414976",
-    "621961351497125888",
-    "621961595106496512",
-    "621961662425075712",
-    "621961687637037056",
-    "621962004848054272",
-    "621972944641462272",
-    "621973028535930880",
-    "621973421928091648",
-    "621983405936087040",
-    "621983416874831872",
-    "621990945226887168",
-    "622039347297914880",
-    "622219970734067712",
-    "622220445072101376",
-    "622220823196995584",
-    "622220907095658496",
-    "622223212322885632",
-    "622224898378567680",
-    "622225102506954752",
-    "622225609669611520",
-    "622226526473162752",
-    "622227538005069824",
-    "622227658805219328",
-    "622227856478572544",
-    "622227891815583744",
-    "622227960128212992",
-    "622227975408062464",
-    "622228052939771904",
-    "622228232720224256",
-    "622228393873772544",
-    "622228505719083008",
-    "622228860137771008",
-    "622229248001839104",
-    "622229337097244672",
-    "622230050397360128",
-    "622230265825202176",
-    "622233666738851840",
-    "622238207286841344",
-    "622240271798767616",
-    "622241089964871680",
-    "622244395906895872",
-    "622245488581808128",
-    "622245757847736320",
-    "622245884159201280",
-    "622245889892814848",
-    "622245980032602112",
-    "622246004212764672",
-    "622246022705451008",
-    "622246065927753728",
-    "622246080335187968",
-    "622246147259502592",
-    "622246192981610496",
-    "622246261495566336",
-    "622246278109204480",
-    "622246282668412928",
-    "622246483055480832",
-    "622246622339928064",
-    "622246713217912832",
-    "622246858013675520",
-    "622247047160008704",
-    "622247254035664896",
-    "622247279268597760",
-    "622247453541928960",
-    "622247491684929536",
-    "622247646895149056",
-    "622251530136981504",
-    "622251552287100928",
-    "622258462763651072",
-    "622259695020806144",
-    "622259719721062400",
-    "622259793050079232",
-    "622260041864581120",
-    "622260121753489408",
-    "622260262698881024",
-    "622260594808066048",
-    "622260655138934784",
-    "622261274935431168",
-    "622262066278961152",
-    "622262263742599168",
-    "622263672001138688",
-    "622263717878435840",
-    "622263723100344320",
-    "622269779817926656",
-    "622269797727604736",
-    "622270569076887552",
-    "622271023580057600",
-    "622271240979222528",
-    "622271452737048576",
-    "622271922943692800",
-    "622271923249876992",
-    "622272290687684608",
-    "622272351601561600",
-    "622272463929217024",
-    "622273113996005376",
-    "622273866223456256",
-    "622275106814693376",
-    "622276503392096256",
-    "622293124038922240",
-    "622299198368387072",
-    "622299566657638400",
-    "622308746101657600",
-    "622309927267995648",
-    "622310108138967040",
-    "622310282273886208",
-    "622310583643017216",
-    "622310608724955136",
-    "622311985710764032",
-    "622314395556515840",
-    "622316532587958272",
-    "622322941039874048",
-    "622323748095266816",
-    "622324453879189504",
-    "622324555704307712",
-    "622324605692022784",
-    "622324710977441792",
-    "622325020995227648",
-    "622325982782689280",
-    "622328362156822528",
-    "622334274850394112",
-    "622334637619941376",
-    "622334916306276352",
-    "622334986128855040",
-    "622335973317021696",
-    "622340107449536512",
-    "622344942609633280",
-    "622345546320973824",
-    "622345954045071360",
-    "622346791358173184",
-    "622347785412415488",
-    "622361047629697024",
-    "622405414553784320",
-    "622583006623830016",
-    "622584532436127744",
-    "622585605171318784",
-    "622586185612660736",
-    "622588372107530240",
-    "622588944613249024",
-    "622589254186438656",
-    "622589637961060352",
-    "622589842081058816",
-    "622590144456822784",
-    "622590268654358528",
-    "622590486774943744",
-    "622590764236541952",
-    "622592268297179136",
-    "622592702449586176",
-    "622592802303381504",
-    "622592966657183744",
-    "622593517155389440",
-    "622594158418333696",
-    "622594188415995904",
-    "622607181128273920",
-    "622607931682197504",
-    "622608246716370944",
-    "622608915187765248",
-    "622608915510726656",
-    "622608955004293120",
-    "622608983328428032",
-    "622608997937188864",
-    "622609215504125952",
-    "622609295036518400",
-    "622609716161417216",
-    "622609742610698240",
-    "622609827109146624",
-    "622609914099011584",
-    "622610318786433024",
-    "622611925741735936",
-    "622613074079256576",
-    "622616982373666816",
-    "622617143690792960",
-    "622620865342869504",
-    "622621344152031232",
-    "622621393175056384",
-    "622621606023401472",
-    "622621657919524864",
-    "622622042872745984",
-    "622622158262243328",
-    "622622397194964992",
-    "622622603592470528",
-    "622623080405143552",
-    "622623915684007936",
-    "622631228293648384",
-    "622632572509360128",
-    "622633696058544128",
-    "622633823452139520",
-    "622634178072154112",
-    "622634841116119040",
-    "622636899290451968",
-    "622637249405784064",
-    "622653321093713920",
-    "622657909020561408",
-    "622660365188206592",
-    "622661493611171840",
-    "622664206759628800",
-    "622672465625223168",
-    "622672985035247616",
-    "622673340770947072",
-    "622673525802668032",
-    "622675496630620160",
-    "622678171988398080",
-    "622686096526020608",
-    "622686635628302336",
-    "622691564308795392",
-    "622696936868286464",
-    "622698217171193856",
-    "622698246917197824",
-    "622698450546462720",
-    "622700153312251904",
-    "622706572044406784",
-    "622706971199541248",
-    "622707320647979008",
-    "622714029521113088",
-    "622978992772878336"};
-                if (s.Contains($"{id}"))
-                { return;}
                 jsonMsg.TryGetProperty("progress", out JsonElement progress);
                 jsonMsg.TryGetProperty("code", out JsonElement _code);
                 jsonMsg.TryGetProperty("tmdid", out JsonElement tmdid);

+ 1 - 1
TEAMModelOS.Function/IESTimerTrigger.cs

@@ -88,7 +88,7 @@ namespace TEAMModelOS.Function
                     {
                         client.DefaultRequestHeaders.Add("Authorization", $"Bearer {token.AccessToken}");
                     }
-                    var data = await TEAMModelOS.SDK.Models.Service.SystemService.AccumulateDaily(_configuration, _azureRedis, _azureCosmos, _coreAPIHttpService, _dingDing, client, _snowflakeId, url, am, pm);
+                    var data = await TEAMModelOS.SDK.Models.Service.SystemService.AccumulateDaily(_configuration, _azureRedis, _azureCosmos,_azureStorage, _coreAPIHttpService, _dingDing, client, _snowflakeId, url, am, pm);
                     //await _dingDing.SendBotMsg($"返回数据{data.ToJsonString()}", GroupNames.成都开发測試群組);
                 }
             }

+ 3 - 26
TEAMModelOS.SDK/Models/Cosmos/Common/StudentScoreRecord.cs

@@ -216,8 +216,7 @@ namespace TEAMModelOS.SDK.Models.Cosmos.Common
         public string subjectId { get; set; }
         public double gscore { get; set; } //组计分
         public double pscore { get; set; }  //个人计分
-        public double tscore { get; set; } //互动计分
-
+        public double tscore { get; set; } //互动计分 
         /// <summary>
         /// 合作能力表现
         /// </summary>
@@ -243,34 +242,12 @@ namespace TEAMModelOS.SDK.Models.Cosmos.Common
         /// 课例时间
         /// </summary>
         public long time { get; set; }
-        /// <summary>
-        /// 互动参与率
-        /// </summary>
-        public double interactRate { get; set; }
-        /// <summary>
-        /// 任务参与率
-        /// </summary>
-        public double taskRate { get; set; }
+       
         /// <summary>
         /// 出席状态
         /// </summary>
         public int attend { get; set; }
-        /// <summary>
-        /// 组任务参与率
-        /// </summary>
-        public double groupTaskRate { get; set; }
-        /// <summary>
-        /// 互评参与率, 实际评论数/需要评论的数量
-        /// </summary>
-        public double commentRate { get; set; }
-        /// <summary>
-        /// 协作参与率(小组协作,个人协作,差异化协作)
-        /// </summary>
-        public double cooperationRate { get; set; }
-        /// <summary>
-        /// 名单信息
-        /// </summary>
-        //public List<string> groupIds { get; set; } = new List<string>();
+       
     }
 
 

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

@@ -192,7 +192,7 @@ namespace TEAMModelOS.SDK.Models.Service
                     stuids.ToList().ForEach(x => {
                         x.school = string.IsNullOrWhiteSpace(x.school) ? school : x.school;
                     });
-                  var result= await client.GetContainer(Constant.TEAMModelOS, Constant.Student).GetList<Student>($"select value c from c where c.id in ({string.Join(",",stuids.Select(d=>$"'{d.id}'"))})", $"Base-{school}");
+                    var result= await client.GetContainer(Constant.TEAMModelOS, Constant.Student).GetList<Student>($"select value c from c where c.id in ({string.Join(",",stuids.Select(d=>$"'{d.id}'"))})", $"Base-{school}");
                     if (result.list.Any()) { 
                         studentsBase = result.list;
                     

+ 68 - 2
TEAMModelOS.SDK/Models/Service/SystemService.cs

@@ -19,6 +19,7 @@ using TEAMModelOS.SDK.Models.Dtos;
 using static TEAMModelOS.SDK.CoreAPIHttpService;
 using Microsoft.Azure.Cosmos;
 using System.Collections;
+using TEAMModelOS.SDK.Models.Cosmos.OpenEntity;
 namespace TEAMModelOS.SDK.Models.Service
 {
     public static class SystemService
@@ -47,7 +48,26 @@ IES早间报告:{tmdname}您好,以下是您发布过的作业任务汇总
         static string cn_examTitle = "评测任务提交详情:";
         static string cn_lessonTitle = "课堂教学出席详情:";
         static string cn_groupTitle = "个人课程名单变化详情:";
+
+        static string cn_lessonDetail = @"名称:{name},开课时间:{time},时长{duration}
+1.本节课名单{count}人,分成{groupCount}组,出席人数:{attendCount}人,缺席:{absentCount}人,出席率{attendRate}%<br>
+2.学习参与度指数平均:{engagementIndexAverge} <br>
+分组参与度:{grpEngagement}G1(94),G2(94),G3(94),G4(94) <br>
+参与较多者:{highRankEngagement}S5(94),S1(94),S6(94),S2(94),S15(94)<br>
+3.记分:总记分:{totalPoint}分 <br>
+个人记分较多者:{highRankPerPoint}S1(1),S2(1),S3(1),S4(1),S5(1) <br>
+小组记分较多的:{highRankGrpPoint}G1(0),G2(0),G3(0),G4(0)<br>
+4.互动:{interactionCount}题,总互动分:{totalInteractPoint}分<br>
+5.任务:{pushCount}次,作品总数:{collateTaskCount}件<br>
+6.测验:{examCount}次,题数:{examQuizCount}题,平均得分率:{examPointRate}% <br>
+表现较好者:{highRankExam}S12(100),S17(100),S9(100),S11(100),S7(100) <br>
+表现较弱者:{lowRankExam}S21(34),S20(34)<br>
+7.互评:{smartRatingCount}次,合计参与:{clientSmartRatingCount}次,平均:1次/人<br>
+8.协作:{coworkTaskCount}次,作品总数:{coworkGroupCount}件,总操作量:{coworkGroupCount},平均操作量:0.0/人<br>";
+
         #endregion
+
+
         #region
         static string tw_wb = @"
 IES晚間報告:{tmdname}您好,以下是您的今日個人IES教學總結報告,截至{sendTime},您已發布{examCount}次測驗任務,{homeworkCount}次作業任務,並使用HiTeach上傳了{lessonCount}節課堂教學活動。
@@ -71,6 +91,21 @@ IES晨間報告:{tmdname}您好,以下是您曾經發佈過的作業任務
         static string tw_examTitle = "測驗任務完成詳情:";
         static string tw_lessonTitle = "課堂教學出席詳情:";
         static string tw_groupTitle = "個人課程名單變動詳情:";
+        static string tw_lessonDetail = @"名称:{name},開課時間:{time},時長{duration}
+1.本節課名單{count}人,分成{groupCount}組,出席人数:{attendCount}人,缺席:{absentCount}人,出席率{attendRate}%<br>
+2.學習参與度指數平均:{engagementIndexAverge}<br>
+分組参舆度:{grpEngagement}G1(94),G2(94),G3(94),G4(94)<br>
+参與较多者:{highRankEngagement}S5(94),S1(94),S6(94),S2(94),S15(94)<br>
+3.記分:總記分:{totalPoint}分<br>
+個人記分较多者:{highRankPerPoint}S1(1),S2(1),S3(1),S4(1),S5(1)<br>
+小組記分较多的:{highRankGrpPoint}G1(0),G2(0),G3(0),G4(0)<br>
+4.互動:{interactionCount}题,總互動分:{totalInteractPoint}分<br>
+5.任務:{pushCount}次,作品總数:{collateTaskCount}件<br>
+6.測驗:{examCount}次,题數:{examQuizCount}题,平均得分率:{examPointRate}%<br>
+表現较好者:{highRankExam}S12(100),S17(100),S9(100),S11(100),S7(100)<br>
+表現较弱者:{lowRankExam}S21(34),S20(34)<br>
+7.互评:{smartRatingCount}次,合計参與:{clientSmartRatingCount}次,平均:1次/人<br>
+8.協作:{coworkTaskCount}次,作品總數:{coworkGroupCount}件,總操作量:{coworkGroupCount},平均操作量:0.0/人<br>";
         #endregion
         #region
         static string en_wb = @"
@@ -95,6 +130,21 @@ Hello {tmdname}, here is the summary report of the homework tasks you have poste
         static string en_examTitle = "Test task submission details:";
         static string en_lessonTitle = "Lesson attendance details:";
         static string en_groupTitle = "Personal course list change details:";
+        static string en_lessonDetail = @"name:{name},start time:{time},duration{duration}
+1.This class has a roster of {count} people, divided into {groupCount} groups, with {attendCount} attendees, {absentCount} absences, and an attendance rate of {attendRate}%.<br>
+2.The average learning engagement index is {engagementIndexAverge}. <br>
+Group engagement: {grpEngagement}G1(94), G2(94), G3(94), G4(94). <br>
+Most engaged participants: {highRankEngagement}S5(94), S1(94), S6(94), S2(94), S15(94).<br>
+3.Scoring: Total points scored: {totalPoint}. <br>
+Top individual scorers: {highRankPerPoint}S1(1), S2(1), S3(1), S4(1), S5(1). <br>
+Top group scorers: {highRankGrpPoint}G1(0), G2(0), G3(0), G4(0).<br>
+4.Interaction: {interactionCount} questions, Total interaction points: {totalInteractPoint}.<br>
+5.Tasks: {pushCount} times, Total number of works: {collateTaskCount}.<br>
+6.Tests: {examCount} times, Number of questions: {examQuizCount}, Average score rate: {examPointRate}%. <br>
+Top performers: {highRankExam}S12(100), S17(100), S9(100), S11(100), S7(100). <br>
+Lower performers: {lowRankExam}S21(34), S20(34).<br>
+7.Peer reviews: {smartRatingCount} times, Total participation: {clientSmartRatingCount} times, Average: 1 time per person.<br>
+8.Collaboration: {coworkTaskCount} times, Total number of works: {coworkGroupCount}, Total operation count: {coworkGroupCount}, Average operation count per person: 0.0.<br>";
         #endregion
 
 
@@ -186,7 +236,7 @@ Hello {tmdname}, here is the summary report of the homework tasks you have poste
         /// <param name="am"></param>
         /// <param name="pm"></param>
         /// <returns></returns>
-        public static async Task<List<CodeValue> > AccumulateDaily(IConfiguration _configuration,AzureRedisFactory _azureRedis,AzureCosmosFactory _azureCosmos,
+        public static async Task<List<CodeValue> > AccumulateDaily(IConfiguration _configuration,AzureRedisFactory _azureRedis,AzureCosmosFactory _azureCosmos,AzureStorageFactory _azureStorage,
             CoreAPIHttpService coreAPIHttpService, DingDing dingDing,HttpClient _httpClient, SnowflakeId _snowflakeId,string notifyUrl,  int am=0 ,int pm=0)
         {
             DateTimeOffset now = DateTimeOffset.Now;
@@ -452,6 +502,7 @@ Hello {tmdname}, here is the summary report of the homework tasks you have poste
                     }
                 }
                 StringBuilder lessonSB = new StringBuilder();
+                StringBuilder lessonDetailSB = new StringBuilder();
                 foreach (var lesson in lessoncreate)
                 {
                     string[] ks = lesson.Key.Split("::");
@@ -467,12 +518,27 @@ Hello {tmdname}, here is the summary report of the homework tasks you have poste
                             var teahcerResult = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher).GetList<LessonRecord>(sql, "LessonRecord");
                             lessons.AddRange(schoolResult.list);
                             lessons.AddRange(teahcerResult.list);
-                            foreach(var lessonRecord in lessons) 
+                            foreach (var lessonRecord in lessons)
                             {
+                                LessonBase lessonBase = null;
+                                try
+                                {
+                                    string owner = lessonRecord.scope.Equals("school") ?  lessonRecord.school :  lessonRecord.tmdid;
+                                    BlobDownloadResult baseblobDownload = await _azureStorage.GetBlobContainerClient(owner).GetBlobClient($"/records/{lessonRecord.id}/IES/base.json").DownloadContentAsync();
+                                    string basejson = baseblobDownload.Content.ToString().Replace("\"Uncall\"", "0").Replace("Uncall", "0");
+                                    lessonBase = basejson.ToObject<LessonBase>();
+                                }
+                                catch (Exception ex)
+                                {
+                                }
                                 lessonCount++;
                                 switch (lang)
                                 {
                                     case "zh-cn":
+                                        if (lessonBase!=null) 
+                                        {
+                                             //cn_lessonDetail.Replace("{name}", lessonRecord)
+                                        }
                                         lessonSB.Append(cn_lessonList.Replace("{lessonName}", lessonRecord.name).Replace("{memberCount}", $"{lessonRecord.clientCount}").Replace("{attendCount}", $"{lessonRecord.attendCount}")).Replace("{attendRate}", $"{lessonRecord.attendRate}");
                                         break;
                                     case "zh-tw":

+ 2 - 2
TEAMModelOS/Controllers/Client/HiTeachController.cs

@@ -148,12 +148,12 @@ namespace TEAMModelOS.Controllers.Client
             }
             catch (CosmosException ex) when (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
             {
-                await _dingDing.SendBotMsg($"更新课堂记录出错CosmosException{_lessonId}\n{ex.StackTrace}{ex.Message}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"更新课堂记录出错HiTeachControllerCosmosException{_lessonId}\n{ex.StackTrace}{ex.Message}", GroupNames.成都开发測試群組);
                 return BadRequest("课堂记录不存在");
             }
             catch (Exception ex)
             {
-                await _dingDing.SendBotMsg($"更新课堂记录出错Exception{_lessonId}\n{ex.StackTrace}{ex.Message}", GroupNames.成都开发測試群組);
+                await _dingDing.SendBotMsg($"更新课堂记录出错HiTeachControllerException{_lessonId}\n{ex.StackTrace}{ex.Message}", GroupNames.成都开发測試群組);
                 return BadRequest();
             }
         }

+ 1 - 1
TEAMModelOS/Controllers/Third/IRS/ThirdIRSController.cs

@@ -147,7 +147,7 @@ namespace TEAMModelOS.Controllers
                                                 JsonElement json = content.ToObject<JsonElement>();
                                                 if (json.GetProperty("code").GetInt32()==0)
                                                 {
-                                                    await _dingDing.SendBotMsg($"{_option.Location},139zhxy电子学生证任务推送成功。\n{json.GetProperty("message").GetString()}{data.ToJsonString()}", GroupNames.成都开发測試群組);
+                                                   // await _dingDing.SendBotMsg($"{_option.Location},139zhxy电子学生证任务推送成功。\n{json.GetProperty("message").GetString()}{data.ToJsonString()}", GroupNames.成都开发測試群組);
                                                 }
                                                 else
                                                 {

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

@@ -138,7 +138,7 @@ namespace TEAMModelOS.Controllers
             {
                 client.DefaultRequestHeaders.Add("Authorization", $"Bearer {token.AccessToken}");
             }
-            List<CodeValue> notifys= await SystemService.AccumulateDaily(_configuration, _azureRedis,_azureCosmos, _coreAPIHttpService,_dingDing,client, _snowflakeId, url,am ,pm );
+            List<CodeValue> notifys= await SystemService.AccumulateDaily(_configuration, _azureRedis,_azureCosmos,_azureStorage, _coreAPIHttpService,_dingDing,client, _snowflakeId, url,am ,pm );
             return Ok(new { notifys });
         }