zhouj1203@hotmail.com 2 年之前
父节点
当前提交
b687efd77d

+ 1 - 1
TEAMModelOS/Controllers/Analysis/AnalysisController.cs

@@ -950,7 +950,7 @@ namespace TEAMModelOS.Controllers.Analysis
                                 {
                                     s,
                                     "-",
-                                    sta[i].ToString(),
+                                    sta[i] > 1 ? "1" : sta[i].ToString(),
                                     pass[i].ToString(),
                                     i + 1 + "",
                                     Math.Round(e.studentScores[i].Sum(),2).ToString()

+ 2 - 1
TEAMModelOS/Controllers/Analysis/ArtAnalysisController.cs

@@ -464,7 +464,8 @@ namespace TEAMModelOS.Controllers.Analysis
                 List<(string id, double sta, double pass, string stu)> stus = new();
                 e.studentIds.ForEach(s =>
                 {
-                    stus.Add((s, sta[i], pass[i] * 0.01, stu[i]));
+                    var stuSta = sta[i] > 1 ? 1 : sta[i];
+                    stus.Add((s, stuSta, pass[i] * 0.01, stu[i]));
                     i++;
                 });
                 return new KeyValuePair<string, List<(string id, double sta, double pass, string stu)>>(e.subjectId, stus);

+ 1 - 1
TEAMModelOS/Controllers/Common/ExamController.cs

@@ -2102,7 +2102,7 @@ namespace TEAMModelOS.Controllers
                     {
                                     members.Where(c => c.id.Equals(s)).FirstOrDefault()?.name,
                                     "-",
-                                    sta[i].ToString(),
+                                    sta[i] > 1 ? "1": sta[i].ToString(),
                                     pass[i].ToString(),
                                     i + 1 + "",
                                     Math.Round(e.studentScores[i].Sum(),2).ToString()

+ 5 - 2
TEAMModelOS/Controllers/OpenApi/Business/BizCustomizeController.cs

@@ -24,6 +24,7 @@ using DocumentFormat.OpenXml.Office2016.Excel;
 using DocumentFormat.OpenXml.Wordprocessing;
 using TEAMModelOS.Controllers.Analysis;
 using System.Net.Http;
+using Microsoft.AspNetCore.Hosting;
 
 namespace TEAMModelOS.Controllers
 {  /// <summary>
@@ -43,8 +44,9 @@ namespace TEAMModelOS.Controllers
         private readonly AzureServiceBusFactory _serviceBus;
         private readonly SnowflakeId _snowflakeId;
         private readonly IHttpClientFactory _httpClient;
+        private readonly IWebHostEnvironment _environment;
 
-        public BizCustomizeController(AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis, AzureServiceBusFactory serviceBus, DingDing dingDing, CoreAPIHttpService coreAPIHttpService, IOptionsSnapshot<Option> option, IConfiguration configuration, SnowflakeId snowflakeId, IHttpClientFactory httpClient)
+        public BizCustomizeController(AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis, AzureServiceBusFactory serviceBus, DingDing dingDing, CoreAPIHttpService coreAPIHttpService, IOptionsSnapshot<Option> option, IConfiguration configuration, SnowflakeId snowflakeId, IHttpClientFactory httpClient, IWebHostEnvironment hostingEnvironment)
         {
             _azureCosmos = azureCosmos;
             _azureStorage = azureStorage;
@@ -56,6 +58,7 @@ namespace TEAMModelOS.Controllers
             _serviceBus = serviceBus;
             _snowflakeId = snowflakeId;
             _httpClient = httpClient;
+            _environment = hostingEnvironment;
         }
         //shasdu
         #region  杉达公司
@@ -431,7 +434,7 @@ namespace TEAMModelOS.Controllers
         public async Task<IActionResult> GetAnalysisCourse(JsonElement json)
         {
             var (id, school) = HttpContext.GetApiTokenInfo();
-            var responseData = await OpenApiService.getCourseTechnology(_httpClient, _dingDing, id, school, json);
+            var responseData = await OpenApiService.getCourseTechnology(_httpClient, _dingDing, id, school, json,_environment);
             return Ok(new { responseData });
         }
 

+ 341 - 94
TEAMModelOS/Controllers/OpenApi/OpenApiService.cs

@@ -43,12 +43,16 @@ using System.Net.Http.Json;
 using System.Drawing;
 using Microsoft.AspNetCore.DataProtection;
 using Newtonsoft.Json.Linq;
+using Microsoft.Extensions.Hosting;
+using Microsoft.AspNetCore.Hosting;
+using TEAMModelOS.Models.ShanDa;
+using System.Runtime.ConstrainedExecution;
 
 namespace TEAMModelOS.Controllers
 {
     public class OpenApiService
     {
-        
+
 
         private static List<string> weekDays = new List<string> { "MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN" };
 
@@ -125,7 +129,7 @@ namespace TEAMModelOS.Controllers
             AzureCosmosQuery cosmosDbQuery = SQLHelper.GetSQL(dict, sql);
             string tbname = "";
             string code = "";
-           
+
             List<string> autoTch = new List<string>();
             string sqlPrivate = "";
             code = $"LessonRecord-{school}";
@@ -242,16 +246,16 @@ namespace TEAMModelOS.Controllers
         /// <returns></returns>
         /// <exception cref="NotImplementedException"></exception>
         public static async Task<ResponseData<dynamic>> GetLessonRecord(AzureCosmosFactory _azureCosmos, IConfiguration _configuration, AzureServiceBusFactory _serviceBus,
-           Option _option,  DingDing _dingDing, string id, string school, JsonElement json)
+           Option _option, DingDing _dingDing, string id, string school, JsonElement json)
         {
 
             json.TryGetProperty("identity", out JsonElement _identity);
             string identity = "";
             if (!string.IsNullOrWhiteSpace($"{_identity}"))
             {
-                identity =$"{_identity}";
+                identity = $"{_identity}";
             }
-           
+
             json.TryGetProperty("managePage", out JsonElement _managePage);
             bool managePage = false;
             if (_managePage.ValueKind.Equals(JsonValueKind.True))
@@ -289,12 +293,12 @@ namespace TEAMModelOS.Controllers
             AzureCosmosQuery cosmosDbQuery = SQLHelper.GetSQL(dict, sql);
             string tbname = "";
             string code = "";
-             
+
             string sqlPrivate = "";
             List<string> autoTch = new List<string>();
             code = $"LessonRecord-{school}";
             tbname = "School";
-           
+
             List<string> ids = new List<string>();
             //只查询某个老师的课例
             if (json.TryGetProperty("tmdid", out JsonElement tmdid) && !string.IsNullOrWhiteSpace($"{tmdid}"))
@@ -384,7 +388,8 @@ namespace TEAMModelOS.Controllers
                     }
                     if (codes.IsNotEmpty())
                     {
-                        lessonRecords.ForEach(x => {
+                        lessonRecords.ForEach(x =>
+                        {
                             var tmd = codes.Find(z => z.id.Equals(x.tmdid));
                             if (tmd != null)
                             {
@@ -398,9 +403,11 @@ namespace TEAMModelOS.Controllers
                 if (groupIds.Any())
                 {
                     List<GroupListDto> groupLists = await GroupListService.GetGroupListByListids(_azureCosmos.GetCosmosClient(), _dingDing, groupIds.ToList(), school);
-                    lessonRecords.ForEach(x => {
+                    lessonRecords.ForEach(x =>
+                    {
                         List<string> groupNmae = new List<string>();
-                        x.groupIds.ForEach(y => {
+                        x.groupIds.ForEach(y =>
+                        {
                             var dto = groupLists.Find(z => z.id.Equals(y));
                             string name = dto != null ? dto.name : "-";
                             groupNmae.Add(name);
@@ -408,9 +415,17 @@ namespace TEAMModelOS.Controllers
                         x.groupNames = groupNmae;
                     });
                 }
-                ResponseData<dynamic> resDate = new ResponseData<dynamic> { code= RespondCode.Ok,msg="成功", data =new  { currCount = lessonRecords.Count, continuationToken,
-                    lessonRecords=  lessonRecords.Select(x => new { x.tmdid, x.tmdname, x.tmdpicture, x.name, x.school, x.startTime, x.duration, x.courseId, x.groupIds, x.periodId, x.subjectId, x.grade, x.id, x.category })
-                } };
+                ResponseData<dynamic> resDate = new ResponseData<dynamic>
+                {
+                    code = RespondCode.Ok,
+                    msg = "成功",
+                    data = new
+                    {
+                        currCount = lessonRecords.Count,
+                        continuationToken,
+                        lessonRecords = lessonRecords.Select(x => new { x.tmdid, x.tmdname, x.tmdpicture, x.name, x.school, x.startTime, x.duration, x.courseId, x.groupIds, x.periodId, x.subjectId, x.grade, x.id, x.category })
+                    }
+                };
                 return resDate;
             }
             catch (Exception)
@@ -468,7 +483,7 @@ namespace TEAMModelOS.Controllers
         /// <param name="school"></param>
         /// <param name="json"></param>
         /// <returns></returns>
-        public static async Task<ResponseData<List<OGroupList>>> GetGroupList(AzureCosmosFactory _azureCosmos,DingDing _dingDing,string bizId, string school, JsonElement json)
+        public static async Task<ResponseData<List<OGroupList>>> GetGroupList(AzureCosmosFactory _azureCosmos, DingDing _dingDing, string bizId, string school, JsonElement json)
         {
             try
             {
@@ -516,7 +531,7 @@ namespace TEAMModelOS.Controllers
                             school = $"{school}",
                             type = "class",
                             year = item.year,
-                            expire=0,
+                            expire = 0,
                             groupName = groupNames
                         };
                         tempGroupLists.Add(group);
@@ -560,8 +575,8 @@ namespace TEAMModelOS.Controllers
                         tempGroupLists.Add(new GroupListGrp(item, groupName));
                     }
                 }
-                groupLists = tempGroupLists.Select(x => new OGroupList { id = x.id, name = x.name, type = x.type, periodId = x.periodId, school = x.school, scope = x.scope, year = x.year,expire=x.expire }).ToList();
-                if (groupLists.Count > 0) 
+                groupLists = tempGroupLists.Select(x => new OGroupList { id = x.id, name = x.name, type = x.type, periodId = x.periodId, school = x.school, scope = x.scope, year = x.year, expire = x.expire }).ToList();
+                if (groupLists.Count > 0)
                 {
                     resDate.code = RespondCode.Ok;
                     resDate.msg = "成功";
@@ -601,7 +616,8 @@ namespace TEAMModelOS.Controllers
                 if (!json.TryGetProperty("ids", out JsonElement ids)) return new ResponseData<dynamic>() { code = RespondCode.NotFound, msg = "参数错误" };
                 List<string> listids = ids.ToObject<List<string>>();
                 (List<RMember> members, List<RGroupList> tGroups) = await GroupListService.GetMemberByListids(_coreAPIHttpService, client, _dingDing, listids, $"{school}");
-                groups = tGroups.Select(x => new OGgroup {
+                groups = tGroups.Select(x => new OGgroup
+                {
                     name = x.name,
                     no = x.no,
                     periodId = x.periodId,
@@ -622,7 +638,7 @@ namespace TEAMModelOS.Controllers
             {
                 await _dingDing.SendBotMsg($"OpenApi,{Environment.GetEnvironmentVariable("Option:Location")} OpenApiService/GetGroupMembers()   参数:bizId:{bizId},school:{school},json:{json.ToJsonString()} \n  {ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
                 return new ResponseData<dynamic>() { code = RespondCode.Error, msg = "服务端异常" };
-                
+
             }
         }
 
@@ -636,7 +652,7 @@ namespace TEAMModelOS.Controllers
         /// <param name="school"></param>
         /// <param name="json"></param>
         /// <returns></returns>
-        public static async Task<ResponseData<dynamic>> GetCourseList(AzureCosmosFactory _azureCosmos, DingDing _dingDing,string bizId ,string school, JsonElement json)
+        public static async Task<ResponseData<dynamic>> GetCourseList(AzureCosmosFactory _azureCosmos, DingDing _dingDing, string bizId, string school, JsonElement json)
         {
             try
             {
@@ -731,7 +747,7 @@ namespace TEAMModelOS.Controllers
             }
         }
 
-        public static async Task<ResponseData<dynamic>> getCourseTechnology(IHttpClientFactory _httpClient, DingDing _dingDing, string bizId, string school, JsonElement json)
+        public static async Task<ResponseData<dynamic>> getCourseTechnology(IHttpClientFactory _httpClient, DingDing _dingDing, string bizId, string school, JsonElement json, IWebHostEnvironment _environment)
         {
             try
             {
@@ -742,7 +758,22 @@ namespace TEAMModelOS.Controllers
                 //data.Add("params", new { method = "statistic/data/"});
                 //HttpResponseMessage responseMessage = await _httpClient.CreateClient().PostAsJsonAsync("http://116.204.72.199:81/statistic/data/", data);
                 var response = await _httpClient.CreateClient().PostAsync("http://116.204.72.199:81/statistic/data/", httpContent);
-                List<Events> events = new();
+                //获取配置文件内容
+                string path = $"{_environment.ContentRootPath}/JsonFile/Core/field.json";
+
+                StreamReader streamReader = new(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite), Encoding.UTF8);
+                StringBuilder stringBuilder = new();
+                string text;
+                while ((text = streamReader.ReadLine()) != null)
+                {
+                    stringBuilder.Append(text.ToString());
+                }
+                streamReader.Close();
+                string input = stringBuilder.ToString();
+                Field fields = input.ToObject<Field>();
+                List<CourseBase> courses = new();
+                List<(string name, double T, double P, int attendCount,int mCount,int groups,long time, List<(string name, int count)> counts)> scores = new();
+                //List<(string name, List<(string name, int count)> counts)> eveCounts = new();
                 if (response.IsSuccessStatusCode)
                 {
                     string responseBody = response.Content.ReadAsStringAsync().Result;
@@ -750,17 +781,189 @@ namespace TEAMModelOS.Controllers
                     JArray array = jo.Value<JArray>("base");
                     foreach (var ne in array)
                     {
+                        CourseBase @base = new();
+                        var tname = ne["tmdname"].Value<string>();
+                        var cname = ne["courseName"].Value<string>();
+                        var attendCount = ne["attendCount"].Value<int>();
+                        var mCount = ne["mCount"].Value<int>();
+                        var time = ne["time"].Value<long>();
                         var obj = ne["events"].ToObject<List<Events>>();
+                        @base.tmdname = tname;
+                        @base.courseName = cname;
+                        @base.attendCount = attendCount;
+                        @base.mCount = mCount;
+                        @base.groups = new List<string>();
+                        @base.time = time;
+                        @base.eves = obj;
                         //events.Add(obj);
-                        events.AddRange(obj);
+                        courses.Add(@base);
                     }
+                    foreach (var eve in courses)
+                    {
+                        var countEve = eve.eves.GroupBy(x => x.@event).Select(y => new { name = y.Key, value = y.Sum(c => c.freq) });
+                        double scoreA = 0;
+                        if (countEve.Any())
+                        {
+                            scoreA += 20;
+                        }
+                        double scoreB = 0;
+                        int P1Count = 0;
+                        int P2Count = 0;
+                        int P3Count = 0;
+                        int P4Count = 0;
+                        int P5Count = 0;
+                        List<(string name, int count)> eves = new();
+                        foreach (var per in countEve)
+                        {
+                            eves.Add((per.name, per.value));
+                            foreach (var evePercent in fields.fields)
+                            {
+                                //计算T分
+                                if (per.name.Equals(evePercent.field))
+                                {
+                                    if (evePercent.dimension.Equals("小组学习"))
+                                    {
+                                        P1Count++;
+                                    }
+                                    if (evePercent.dimension.Equals("全班互动"))
+                                    {
+                                        P2Count++;
+                                    }
+                                    if (evePercent.dimension.Equals("生本决策"))
+                                    {
+                                        P3Count++;
+                                    }
+                                    if (evePercent.dimension.Equals("全班测验"))
+                                    {
+                                        P4Count++;
+                                    }
+                                    if (evePercent.dimension.Equals("个人学习"))
+                                    {
+                                        P5Count++;
+                                    }
+                                    double bScore = 0;
+                                    if (per.value == 1)
+                                    {
+                                        bScore += evePercent.percent * 0.9;
+                                    }
+                                    else if (per.value == 2)
+                                    {
+                                        bScore += evePercent.percent * 0.95;
+                                    }
+                                    else if (per.value >= 3)
+                                    {
+                                        bScore += evePercent.percent;
+                                    }
+                                    scoreB += bScore;
+                                }
+                            }
+                        }
+                        List<(string name, double score)> PScore = new();
+
+                        double P1Score = 0;
+                        if (P1Count == 1)
+                        {
+                            P1Score = 18 * 0.8;
+                        }
+                        else if (P1Count == 2)
+                        {
+                            P1Score = 18 * 0.9;
+                        }
+                        else if (P1Count >= 3)
+                        {
+                            P1Score = 18;
+                        }
+                        double P2Score = 0;
+                        if (P2Count == 1)
+                        {
+                            P2Score = 18 * 0.8;
+                        }
+                        else if (P2Count == 2)
+                        {
+                            P2Score = 18 * 0.9;
+                        }
+                        else if (P2Count >= 3)
+                        {
+                            P2Score = 18;
+                        }
+                        double P3Score = 0;
+                        if (P3Count == 1)
+                        {
+                            P3Score = 18 * 0.8;
+                        }
+                        else if (P3Count == 2)
+                        {
+                            P3Score = 18 * 0.9;
+                        }
+                        else if (P3Count >= 3)
+                        {
+                            P3Score = 18;
+                        }
+                        double P4Score = 0;
+                        if (P4Count == 1)
+                        {
+                            P4Score = 18 * 0.8;
+                        }
+                        else if (P3Count == 2)
+                        {
+                            P4Score = 18 * 0.9;
+                        }
+                        else if (P4Count >= 3)
+                        {
+                            P4Score = 18;
+                        }
+                        double P5Score = 0;
+                        if (P5Count == 1)
+                        {
+                            P5Score = 18 * 0.8;
+                        }
+                        else if (P5Count == 2)
+                        {
+                            P5Score = 18 * 0.9;
+                        }
+                        else if (P5Count >= 3)
+                        {
+                            P5Score = 18;
+                        }
+                        double P6Score = (P1Score + P2Score + P3Score + P4Score + P5Score) * 0.1;
+                        PScore.Add(("小组学习", P1Score));
+                        PScore.Add(("全班互动", P2Score));
+                        PScore.Add(("生本决策", P3Score));
+                        PScore.Add(("全班测验", P4Score));
+                        PScore.Add(("个人学习", P5Score));
+                        PScore.Add(("多元评价", P6Score));
+                        double P = P1Score + P2Score + P3Score + P4Score + P5Score + P6Score;
+                        double scoreC = (scoreA + scoreB) * 0.1;
+                        double scoreT = scoreA + scoreB + scoreC;
+                        scoreT = scoreT > 0 ? Math.Round(scoreT, 2) : 0;
+                        P = P > 0 ? Math.Round(P, 2) : 0;
+                        scores.Add((eve.courseName, scoreT, P,eve.attendCount,eve.mCount,eve.groups.Count,eve.time,eves));
+                        //eveCounts.Add((eve.courseName, eves));
+                    }
+                    //var eve = courses.Select(c => c.eves).ToList();
                     /*using JsonDocument document = JsonDocument.Parse(responseBody.ToString());
                     if (document.RootElement.TryGetProperty("base", out JsonElement AccessTokenObj))
                     {
                         //AccessToken = AccessTokenObj.ToString();
                     }*/
                 }
-                return new ResponseData<dynamic>() { code = RespondCode.Ok, msg = "成功", data = new { events } };
+                var courseScore = scores.Select(c => new
+                {
+                    c.name,
+                    c.T,
+                    c.P,
+                    c.attendCount,
+                    c.mCount,
+                    c.groups,
+                    c.time,
+                    count = c.counts.Select(x => new { x.name, x.count })
+                });
+                /*var courseCount = eveCounts.Select(c => new
+                {
+                    c.name,
+                    count = c.counts.Select(x => new { x.name, x.count })
+                });*/
+                return new ResponseData<dynamic>() { code = RespondCode.Ok, msg = "成功", data = new { courseScore} };
                 /*if (period != null)
                 {
                     return new ResponseData<dynamic>() { code = RespondCode.Ok, msg = "成功", data = new { period.subjects, period.timetable, period.grades, period.majors, weekDays } };
@@ -775,7 +978,7 @@ namespace TEAMModelOS.Controllers
                 return new ResponseData<dynamic>() { code = RespondCode.Error, msg = "服务端异常" };
             }
         }
-        
+
         /// <summary>
         /// 物理教室列表
         /// [ApiToken(Auth = "1401", Name = "物理教室列表",TName ="",EName ="", RWN = "R", Limit = false)]
@@ -786,13 +989,13 @@ namespace TEAMModelOS.Controllers
         /// <param name="school"></param>
         /// <param name="json"></param>
         /// <returns></returns>
-        public static async Task<ResponseData<List<ORoom>>> GetRoomList(AzureCosmosFactory _azureCosmos, DingDing _dingDing, string bizId, string school,JsonElement json)
+        public static async Task<ResponseData<List<ORoom>>> GetRoomList(AzureCosmosFactory _azureCosmos, DingDing _dingDing, string bizId, string school, JsonElement json)
         {
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
                 List<ORoom> dtRooms = new();
-                 StringBuilder sql = new StringBuilder($"select value(c) from c where 1=1 ");
+                StringBuilder sql = new StringBuilder($"select value(c) from c where 1=1 ");
                 json.TryGetProperty("openType", out JsonElement openType);
                 json.TryGetProperty("no", out JsonElement no);
 
@@ -846,7 +1049,7 @@ namespace TEAMModelOS.Controllers
                 {
                     JsonDocument document = JsonDocument.Parse(response.Content);
                     Room tRoom = document.RootElement.Deserialize<Room>();
-                    return new ResponseData<dynamic>() { code = RespondCode.Ok, msg = "成功",data = new { tRoom.id, tRoom.name, tRoom.x, tRoom.y, tRoom.openType, tRoom.style, tRoom.area, tRoom.address, school } };
+                    return new ResponseData<dynamic>() { code = RespondCode.Ok, msg = "成功", data = new { tRoom.id, tRoom.name, tRoom.x, tRoom.y, tRoom.openType, tRoom.style, tRoom.area, tRoom.address, school } };
                 }
                 else
                     return new ResponseData<dynamic>() { code = RespondCode.NotFound, msg = "未找到物理教室详情" };
@@ -912,13 +1115,13 @@ namespace TEAMModelOS.Controllers
                 if (coreUsers.Count > 0)
                 {
                     var teacherIds = coreUsers.Select(x => x.id).Except(teachers.Select(x => x.id));
-                    unjoined= coreUsers.FindAll(x => teacherIds.Contains(x.id));
+                    unjoined = coreUsers.FindAll(x => teacherIds.Contains(x.id));
                 }
 
                 List<dynamic> tchs = new List<dynamic>();
                 teachers.Select(x => new { x.id, x.name, x.picture, x.job, x.subjectIds, x.roles }).ToList().ForEach(x =>
                 {
-                    if (coreUsers.Count > 0) 
+                    if (coreUsers.Count > 0)
                     {
                         var coreUser = coreUsers.Find(c => c.id.Equals(x.id));
                         if (coreUser != null)
@@ -950,9 +1153,11 @@ namespace TEAMModelOS.Controllers
         /// <param name="school"></param>
         /// <param name="json"></param>
         /// <returns></returns>
-        public static async Task<ResponseData<dynamic>> GetTeacherTeach(AzureCosmosFactory _azureCosmos, DingDing _dingDing, string bizId, string school, JsonElement json) {
+        public static async Task<ResponseData<dynamic>> GetTeacherTeach(AzureCosmosFactory _azureCosmos, DingDing _dingDing, string bizId, string school, JsonElement json)
+        {
 
-            try {
+            try
+            {
                 if (json.TryGetProperty("tmdid", out JsonElement _tmdid))
                 {
                     json.TryGetProperty("period", out JsonElement _period);
@@ -966,7 +1171,8 @@ namespace TEAMModelOS.Controllers
                     await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<OCourse>(queryText: query,
                             requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{school}") }))
                     {
-                        if (!string.IsNullOrWhiteSpace(item.schedule?.stulist)) {
+                        if (!string.IsNullOrWhiteSpace(item.schedule?.stulist))
+                        {
                             classIds.Add(item.schedule?.stulist);
                         }
                         if (!string.IsNullOrWhiteSpace(item.schedule?.classId))
@@ -976,9 +1182,10 @@ namespace TEAMModelOS.Controllers
                         courses.Add(item);
                     }
                     List<OGroupList> groupLists = new List<OGroupList>();
-                    if (classIds.Any()) {
-                    var tempGroupLists=   await  GroupListService.GetGroupListByListids(_azureCosmos.GetCosmosClient(), _dingDing, classIds.ToList(), school);
-                        groupLists = tempGroupLists.Select(x => new OGroupList { id = x.id, name = x.name, type = x.type, periodId = x.periodId, school = x.school, scope = x.scope, year = x.year,expire=x.expire }).ToList();
+                    if (classIds.Any())
+                    {
+                        var tempGroupLists = await GroupListService.GetGroupListByListids(_azureCosmos.GetCosmosClient(), _dingDing, classIds.ToList(), school);
+                        groupLists = tempGroupLists.Select(x => new OGroupList { id = x.id, name = x.name, type = x.type, periodId = x.periodId, school = x.school, scope = x.scope, year = x.year, expire = x.expire }).ToList();
                     }
 
                     var group = courses.GroupBy(x => x.id).Select(g => new { key = g.Key, list = g.ToList() });
@@ -1000,12 +1207,16 @@ namespace TEAMModelOS.Controllers
                             schedule = x.list.Select(x => x.schedule).ToList()
                         });
                     });
-                    return new ResponseData<dynamic>() { 
-                        code=RespondCode.Ok,data=new {
-                          
-                            courses = coursesR.Select(x => new {
+                    return new ResponseData<dynamic>()
+                    {
+                        code = RespondCode.Ok,
+                        data = new
+                        {
+
+                            courses = coursesR.Select(x => new
+                            {
                                 x.id,
-                                school=school,
+                                school = school,
                                 x.name,
                                 x.no,
                                 x.period,
@@ -1014,15 +1225,18 @@ namespace TEAMModelOS.Controllers
                                 x.creatorId,
                                 x.year,
                                 x.schedule
-                            }) ,
+                            }),
                             groupLists
-                        } 
+                        }
                     };
                 }
-                else {
+                else
+                {
                     return new ResponseData<dynamic>() { code = RespondCode.ParamsError, msg = "参数错误" };
                 }
-            } catch (Exception ex) {
+            }
+            catch (Exception ex)
+            {
                 await _dingDing.SendBotMsg($"OpenApi,{Environment.GetEnvironmentVariable("Option:Location")} OpenApiService/GetTeacherTeach()   参数:bizId:{bizId},school:{school},json:{json.ToJsonString()} \n  {ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
                 return new ResponseData<dynamic>() { code = RespondCode.Error, msg = "服务端异常" };
             }
@@ -1336,7 +1550,7 @@ namespace TEAMModelOS.Controllers
         /// <param name="_dingDing"></param>
         /// <param name="json"></param>
         /// <returns></returns>
-        public static async Task<ResponseData<List<OVolume>>> GetVolumes(AzureCosmosFactory _azureCosmos,DingDing _dingDing, string bizId, string school, JsonElement json)
+        public static async Task<ResponseData<List<OVolume>>> GetVolumes(AzureCosmosFactory _azureCosmos, DingDing _dingDing, string bizId, string school, JsonElement json)
         {
             try
             {
@@ -1379,7 +1593,7 @@ namespace TEAMModelOS.Controllers
         /// <param name="_dingDing"></param>
         /// <param name="json"></param>
         /// <returns></returns>
-        public static async Task<ResponseData<dynamic>> GetKnowledges(AzureCosmosFactory _azureCosmos, DingDing _dingDing, string bizId, string school, JsonElement json) 
+        public static async Task<ResponseData<dynamic>> GetKnowledges(AzureCosmosFactory _azureCosmos, DingDing _dingDing, string bizId, string school, JsonElement json)
         {
             try
             {
@@ -1399,12 +1613,12 @@ namespace TEAMModelOS.Controllers
 
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<Knowledge>(queryText: sql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
                 {
-                    knowledges.Add(new {  item.periodId,  item.subjectId,  item.points,  item.blocks, item.id });
+                    knowledges.Add(new { item.periodId, item.subjectId, item.points, item.blocks, item.id });
                 }
-               
+
                 if (knowledges.Any())
                 {
-                    var  data  = knowledges.Select(x => new {  });
+                    var data = knowledges.Select(x => new { });
                     responseData = new() { code = RespondCode.Ok, msg = "成功", data = knowledges };
                 }
                 else
@@ -1427,21 +1641,26 @@ namespace TEAMModelOS.Controllers
         /// <param name="_dingDing"></param>
         /// <param name="json"></param>
         /// <returns></returns>
-        public static async Task<ResponseData<dynamic>> UpsertStudentPortrait(AzureCosmosFactory _azureCosmos, DingDing _dingDing, string bizId, string school, JsonElement json) {
-            try {
+        public static async Task<ResponseData<dynamic>> UpsertStudentPortrait(AzureCosmosFactory _azureCosmos, DingDing _dingDing, string bizId, string school, JsonElement json)
+        {
+            try
+            {
                 ResponseData<dynamic> responseData = new();
                 var client = _azureCosmos.GetCosmosClient();
                 if (!json.TryGetProperty("schoolCode", out JsonElement schoolCode))
                 {
                     return responseData = new() { code = RespondCode.ParamsError, msg = "schoolCode为空" };
                 }
-                if (!json.TryGetProperty("periodId", out JsonElement periodId)) {
+                if (!json.TryGetProperty("periodId", out JsonElement periodId))
+                {
                     return responseData = new() { code = RespondCode.ParamsError, msg = "periodId为空" };
                 }
-                if (!json.TryGetProperty("subjectId", out JsonElement subjectId)) {
+                if (!json.TryGetProperty("subjectId", out JsonElement subjectId))
+                {
                     return responseData = new() { code = RespondCode.ParamsError, msg = "subjectId为空" };
                 }
-                if (!json.TryGetProperty("students", out JsonElement _students) && !_students.ValueKind.Equals(JsonValueKind.Array)) {
+                if (!json.TryGetProperty("students", out JsonElement _students) && !_students.ValueKind.Equals(JsonValueKind.Array))
+                {
                     return responseData = new() { code = RespondCode.ParamsError, msg = "students为空或格式错误" };
                 }
                 if (!$"{subjectId}".Equals("subject_sport") && !$"{subjectId}".Equals("subject_virtue") && !$"{subjectId}".Equals("subject_labour")
@@ -1452,8 +1671,8 @@ namespace TEAMModelOS.Controllers
                 }
                 School schoolBase = await client.GetContainer(Constant.TEAMModelOS, Constant.School).ReadItemAsync<School>(school, new PartitionKey("Base"));
                 List<PortraitStudent> students = _students.ToObject<List<PortraitStudent>>();
-                List<(Student studentBase, PortraitStudent portrait) > studentsBases = new List<(Student, PortraitStudent)>();
-                List<PortraitStudent> unmatchStuInfo =new List<PortraitStudent>();
+                List<(Student studentBase, PortraitStudent portrait)> studentsBases = new List<(Student, PortraitStudent)>();
+                List<PortraitStudent> unmatchStuInfo = new List<PortraitStudent>();
                 List<PortraitStudent> unmatchSemester = new List<PortraitStudent>();
                 List<PortraitStudent> upsertDatas = new List<PortraitStudent>();
                 string stusql = $"select c.id,c.classId,c.name,c.year  from c where c.id in ({string.Join(",", students.Select(f => $"'{f.studentId}'"))})";
@@ -1471,8 +1690,9 @@ namespace TEAMModelOS.Controllers
                     //    unmatchStuInfo.Add(student);
                     //}
                 }
-                var unexist =  students.FindAll(z => !studentsBases.Select(z => z.studentBase.id).Contains(z.studentId));
-                if (unexist.Any()) {
+                var unexist = students.FindAll(z => !studentsBases.Select(z => z.studentBase.id).Contains(z.studentId));
+                if (unexist.Any())
+                {
                     unmatchStuInfo.AddRange(unexist);
                 }
                 Period period = schoolBase.period.Find(x => x.id.Equals($"{periodId}"));
@@ -1481,7 +1701,8 @@ namespace TEAMModelOS.Controllers
                 {
                     return responseData = new() { code = RespondCode.NotFound, msg = "periodId不存在" };
                 }
-                else {
+                else
+                {
                     bool periodChange = false;
                     if (!period.semesters.Any())
                     {
@@ -1504,7 +1725,8 @@ namespace TEAMModelOS.Controllers
                         periodChange = true;
                     }
                     //是否需要创建科目 
-                    if (!$"{subjectId}".Equals("subject_art")) {
+                    if (!$"{subjectId}".Equals("subject_art"))
+                    {
                         var bind = period.subjects.Find(x => !string.IsNullOrWhiteSpace(x.bindId) && x.bindId.Equals($"{subjectId}"));
                         if (bind == null)
                         {
@@ -1520,14 +1742,15 @@ namespace TEAMModelOS.Controllers
                                 case bool when $"{subjectId}".Equals("subject_labour"):
                                     subjectName = "劳动";
                                     break;
-                                //case bool when $"{subjectId}".Equals("subject_music"):
-                                //    subjectName = "音乐";
-                                //    break;
-                                //case bool when $"{subjectId}".Equals("subject_painting"):
-                                //    subjectName = "美术";
-                                //    break;
+                                    //case bool when $"{subjectId}".Equals("subject_music"):
+                                    //    subjectName = "音乐";
+                                    //    break;
+                                    //case bool when $"{subjectId}".Equals("subject_painting"):
+                                    //    subjectName = "美术";
+                                    //    break;
                             }
-                            if (!string.IsNullOrWhiteSpace(subjectName)) {
+                            if (!string.IsNullOrWhiteSpace(subjectName))
+                            {
                                 var subName = period.subjects.Find(z => z.name.Contains(subjectName));
                                 if (subName != null)
                                 {
@@ -1546,15 +1769,17 @@ namespace TEAMModelOS.Controllers
                         await client.GetContainer(Constant.TEAMModelOS, Constant.School).ReplaceItemAsync<School>(schoolBase, school, new PartitionKey("Base"));
                     }
                     List<Semester> sortedSemesters = SchoolService.SortSemester(period.semesters);
-                    foreach (var studentInfo in studentsBases) {
+                    foreach (var studentInfo in studentsBases)
+                    {
                         Student student = studentInfo.studentBase;
                         string studentId = studentInfo.studentBase.id;
-                        string classId= studentInfo.studentBase.classId;
+                        string classId = studentInfo.studentBase.classId;
                         List<SemesterData> semesterDatas = studentInfo.portrait.semesterData;
-                      
+
                         if (semesterDatas.Any())
                         {
-                            semesterDatas.ForEach(data => {
+                            semesterDatas.ForEach(data =>
+                            {
                                 if (!string.IsNullOrWhiteSpace(data.semesterId))
                                 {
                                     var semester = period.semesters.Find(s => s.id.Equals(data.semesterId));
@@ -1616,7 +1841,8 @@ namespace TEAMModelOS.Controllers
                                 });
                             }
                             var okSemesterDatas = semesterDatas.Where(z => !z.semesterId.Contains("学期无效"));
-                            if (okSemesterDatas.Any()) {
+                            if (okSemesterDatas.Any())
+                            {
                                 upsertDatas.Add(new PortraitStudent
                                 {
                                     studentId = studentInfo.portrait.studentId,
@@ -1640,7 +1866,8 @@ namespace TEAMModelOS.Controllers
                                 var newDatas = semesterDatas.FindAll(k => nodbids.Contains($"{k.year}-{k.semesterId}-{studentId}"));
                                 var updateDatas = semesterDatas.FindAll(k => overallEducations.Select(z => z.id).Contains($"{k.year}-{k.semesterId}-{studentId}"));
                                 List<OverallEducation> newOverallEducations = new List<OverallEducation>();
-                                newDatas.ForEach(z => {
+                                newDatas.ForEach(z =>
+                                {
                                     //处理新增的学生学期画像
                                     var overallEducation = newOverallEducations.Find(o => o.id.Equals($"{z.year}-{z.semesterId}-{studentId}") && o.code.Equals($"OverallEducation-{schoolCode}"));
                                     if (overallEducation == null)
@@ -1666,7 +1893,8 @@ namespace TEAMModelOS.Controllers
                                 if (newOverallEducations.Any())
                                 {
                                     newOverallEducations = FillSemesterData($"{subjectId}", newOverallEducations, newDatas);
-                                    foreach (var edu in newOverallEducations) {
+                                    foreach (var edu in newOverallEducations)
+                                    {
                                         await client.GetContainer(Constant.TEAMModelOS, Constant.Student).CreateItemAsync(edu, new PartitionKey(edu.code));
                                     }
                                 }
@@ -1675,32 +1903,38 @@ namespace TEAMModelOS.Controllers
                                     overallEducations = FillSemesterData($"{subjectId}", overallEducations, updateDatas);
                                     foreach (var edu in overallEducations)
                                     {
-                                        await client.GetContainer(Constant.TEAMModelOS, Constant.Student).ReplaceItemAsync(edu,edu.id, new PartitionKey(edu.code));
+                                        await client.GetContainer(Constant.TEAMModelOS, Constant.Student).ReplaceItemAsync(edu, edu.id, new PartitionKey(edu.code));
                                     }
                                 }
                             }
                         }
                     }
                 }
-                return responseData = new() { data = new { unmatchStuInfo, unmatchSemester , upsertDatas }, code = RespondCode.Ok, msg = "成功" };
-            } catch (CosmosException cex) when(cex.Status==404) {
+                return responseData = new() { data = new { unmatchStuInfo, unmatchSemester, upsertDatas }, code = RespondCode.Ok, msg = "成功" };
+            }
+            catch (CosmosException cex) when (cex.Status == 404)
+            {
                 return new ResponseData<dynamic>() { code = RespondCode.NotFound, msg = "学校编码不存在" };
             }
-            catch (Exception ex) {
+            catch (Exception ex)
+            {
                 await _dingDing.SendBotMsg($"OpenApi,{Environment.GetEnvironmentVariable("Option:Location")} OpenApiService/UpsertStudentPortrait()  参数:bizId:{bizId},school:{school},参数json:{json.ToJsonString()} \n  {ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
                 return new ResponseData<dynamic>() { code = RespondCode.Error, msg = "服务端异常" };
             }
         }
-        public static List<OverallEducation>  FillSemesterData(string subjectId, List<OverallEducation> overallEducations, List<SemesterData> semestersDatas) {
+        public static List<OverallEducation> FillSemesterData(string subjectId, List<OverallEducation> overallEducations, List<SemesterData> semestersDatas)
+        {
 
-            semestersDatas.ForEach(z => {
-                var oedu=  overallEducations.Find(x => x.id.Equals($"{z.year}-{z.semesterId}"));
-                if (oedu != null) {
-                    List<EducationScore> educationScores=null;
+            semestersDatas.ForEach(z =>
+            {
+                var oedu = overallEducations.Find(x => x.id.Equals($"{z.year}-{z.semesterId}"));
+                if (oedu != null)
+                {
+                    List<EducationScore> educationScores = null;
                     switch (true)
                     {
                         case bool when $"{subjectId}".Equals("subject_sport"):
-                            educationScores=oedu.sports;
+                            educationScores = oedu.sports;
                             break;
                         case bool when $"{subjectId}".Equals("subject_virtue"):
                             educationScores = oedu.virtue;
@@ -1717,10 +1951,11 @@ namespace TEAMModelOS.Controllers
                         case bool when $"{subjectId}".Equals("subject_art"):
                             educationScores = oedu.art;
                             break;
-                        default:educationScores = new List<EducationScore>();
+                        default:
+                            educationScores = new List<EducationScore>();
                             break;
                     }
-                    var edu= educationScores.Find(m => m.examId.Equals(z.examId));
+                    var edu = educationScores.Find(m => m.examId.Equals(z.examId));
                     z.totalScore = z.totalScore <= 0 ? 100 : z.totalScore;
                     if (edu == null)
                     {
@@ -1761,7 +1996,8 @@ namespace TEAMModelOS.Controllers
             var apiResult = table.ExecuteQuerySegmented(new TableQuery<OpenApi>().Where(tbqurey), null);
             List<OpenApi> apis = apiResult.Results;
             //数据库历史数据处理
-            apis.ForEach(x => {
+            apis.ForEach(x =>
+            {
                 var api = openApis.Find(z => z.RowKey.Equals(x.RowKey));
                 if (api != null)
                 {
@@ -1790,7 +2026,8 @@ namespace TEAMModelOS.Controllers
             var hookResult = table.ExecuteQuerySegmented(new TableQuery<WebHook>().Where(tbqurey), null);
             List<WebHook> hooks = hookResult.Results;
             //数据库历史数据处理
-            hooks.ForEach(x => {
+            hooks.ForEach(x =>
+            {
                 var api = webHooks.Find(z => z.RowKey.Equals(x.RowKey));
                 if (api != null)
                 {
@@ -1829,7 +2066,7 @@ namespace TEAMModelOS.Controllers
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
-             
+
                 //if (!string.IsNullOrWhiteSpace($"{_idToken}") && JwtAuthExtension.ValidateApiToken($"{_idToken}", _option.JwtSecretKey))
                 //{
                 //    JwtSecurityToken jwt = new($"{_idToken}");
@@ -1837,8 +2074,8 @@ namespace TEAMModelOS.Controllers
                 OStudent student = new();
                 jwt.Payload.TryGetValue("name", out object stuName);
                 jwt.Payload.TryGetValue("picture", out object stuPicture);
-                if(!jwt.Payload.TryGetValue("scope", out object scope)) return new ResponseData<dynamic>() { code = RespondCode.ParamsError, msg = "参数错误:scope", data = null };
-                if(!jwt.Payload.TryGetValue("roles", out object _roles)) return new ResponseData<dynamic>() { code = RespondCode.ParamsError, msg = "参数错误:roles", data = null };
+                if (!jwt.Payload.TryGetValue("scope", out object scope)) return new ResponseData<dynamic>() { code = RespondCode.ParamsError, msg = "参数错误:scope", data = null };
+                if (!jwt.Payload.TryGetValue("roles", out object _roles)) return new ResponseData<dynamic>() { code = RespondCode.ParamsError, msg = "参数错误:roles", data = null };
                 jwt.Payload.TryGetValue("permissions", out object permissions);
                 jwt.Payload.TryGetValue("standard", out object standard);
                 jwt.Payload.TryGetValue("area", out object area);
@@ -1904,7 +2141,7 @@ namespace TEAMModelOS.Controllers
         {
 
             if (!json.TryGetProperty("ids", out JsonElement _ids)) return new ResponseData<dynamic>() { code = RespondCode.ParamsError, msg = "idToken参数错误", data = null };
-            try                    
+            try
             {
                 List<string> ids = _ids.ToObject<List<string>>();
                 List<OStudent> student = new();
@@ -1930,7 +2167,17 @@ namespace TEAMModelOS.Controllers
                 await _dingDing.SendBotMsg($"OpenApi,{Environment.GetEnvironmentVariable("Option:Location")} OpenApiService/GetLoginStuInfo()   参数:学生id集合:{_ids},school:{school},json:{json.ToJsonString()} \n  {ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
                 return new ResponseData<dynamic>() { code = RespondCode.Error, msg = "服务器错误" };
             }
-        }     
+        }
+    }
+    public class CourseBase
+    {
+        public string tmdname { get; set; }
+        public string courseName { get; set; }
+        public int attendCount { get; set; }
+        public int mCount { get; set; }
+        public List<string> groups { get; set; }
+        public long time { get; set; }
+        public List<Events> eves { get; set; }
     }
     public class Events
     {

文件差异内容过多而无法显示
+ 6 - 6
TEAMModelOS/Controllers/XTest/FixDataController.cs


+ 21 - 3
TEAMModelOS/Controllers/XTest/TestController.cs

@@ -5,6 +5,9 @@ using Azure.Messaging.ServiceBus;
 using Azure.Storage.Blobs.Models;
 using DinkToPdf;
 using DinkToPdf.Contracts;
+using DocumentFormat.OpenXml.Office2010.Excel;
+using DocumentFormat.OpenXml.Office2016.Excel;
+using DocumentFormat.OpenXml.Wordprocessing;
 using HTEXLib.COMM.Helpers;
 using HTEXLib.Helpers.ShapeHelpers;
 using MathNet.Numerics.Distributions;
@@ -1231,6 +1234,21 @@ namespace TEAMModelOS.Controllers
             //var techs= teachers.Where(t => string.IsNullOrWhiteSpace(t.tmdid));
             return Ok(teachers);
         }
+        [HttpPost("get-token")]
+        public async Task<IActionResult> GetToken(JsonElement request)
+        {
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            if (!request.TryGetProperty("host", out JsonElement host)) return BadRequest();
+            if (!request.TryGetProperty("name", out JsonElement name)) return BadRequest();
+            if (!request.TryGetProperty("picture", out JsonElement picture)) return BadRequest();
+            if (!request.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
+            if (!request.TryGetProperty("school", out JsonElement school)) return BadRequest();
+            var auth_token = JwtAuthExtension.CreateAuthToken(host.ToString(), id.ToString(), name.ToString(), 
+                picture.ToString(), _option.JwtSecretKey,
+                scope: "student", Website: "IES", areaId: areaId.ToString(),schoolID: school.ToString(), roles: new[] { "student" }, expire: 1);
+            //var techs= teachers.Where(t => string.IsNullOrWhiteSpace(t.tmdid));
+            return Ok(auth_token);
+        }
         [HttpPost("test-scteacher-dn")]
         public async Task<IActionResult> TestScteacherDn(JsonElement json)
         {
@@ -1864,8 +1882,8 @@ namespace TEAMModelOS.Controllers
                 ObjectSettings objectSettings = new ObjectSettings();
                 objectSettings.PagesCount = true;
                 objectSettings.HtmlContent = html;
-                WebSettings webSettings = new WebSettings();
-                webSettings.DefaultEncoding = "utf-8";
+                //WebSettings webSettings = new WebSettings();
+                //webSettings.DefaultEncoding = "utf-8";
                 HeaderSettings headerSettings = new HeaderSettings();
                 headerSettings.FontSize = 15;
                 headerSettings.FontName = "fangsong";
@@ -1878,7 +1896,7 @@ namespace TEAMModelOS.Controllers
                 // footerSettings.Line = true;
                 objectSettings.HeaderSettings = headerSettings;
                 objectSettings.FooterSettings = footerSettings;
-                objectSettings.WebSettings = webSettings;
+                //objectSettings.WebSettings = webSettings;
                 HtmlToPdfDocument htmlToPdfDocument = new HtmlToPdfDocument()
                 {
                     GlobalSettings = globalSettings,

+ 113 - 0
TEAMModelOS/JsonFile/Core/field.json

@@ -0,0 +1,113 @@
+{
+  "total": 100,
+  "fields": [
+    {
+      "field": "PgPushLoad",
+      "percent": 3,
+      "desc": "教室端ppt播放次数",
+      "dimension": ""
+    },
+    {
+      "field": "BeamPgLoad",
+      "percent": 3,
+      "desc": "教室端视频播放次数",
+      "dimension": "个人学习"
+    },
+    {
+      "field": "DiffPush",
+      "percent": 6,
+      "desc": "教师端网页播放次数",
+      "dimension": "生本决策"
+    },
+    {
+      "field": "HitaClientCmp",
+      "percent": 4,
+      "desc": "教师端AI化身调取的次数",
+      "dimension": "小组学习"
+    },
+    {
+      "field": "PopQuesLoad",
+      "percent": 4,
+      "desc": "教师发起题目次数",
+      "dimension": "全班互动"
+    },
+    {
+      "field": "QuesLoad",
+      "percent": 4,
+      "desc": "教师发起多题次数",
+      "dimension": "全班测验"
+    },
+    {
+      "field": "ReAtmpAnsStrt",
+      "percent": 6,
+      "desc": "教师二次发起题目次数",
+      "dimension": "全班互动"
+    },
+    {
+      "field": "StatChartLoad",
+      "percent": 4,
+      "desc": "教师端查看答题统计次数",
+      "dimension": "全班互动"
+    },
+    {
+      "field": "GrpChart",
+      "percent": 6,
+      "desc": "教师端查看分组评分次数",
+      "dimension": "小组学习"
+    },
+    {
+      "field": "PickupResult",
+      "percent": 3,
+      "desc": "教师手动分组次数",
+      "dimension": "生本决策"
+    },
+    {
+      "field": "PickupSmart",
+      "percent": 6,
+      "desc": "教师自动分组次数",
+      "dimension": "生本决策"
+    },
+    {
+      "field": "ShowAnsLoad",
+      "percent": 3,
+      "desc": "学生端开麦次数",
+      "dimension": "生本决策"
+    },
+    {
+      "field": "ScoBrdLoad",
+      "percent": 3,
+      "desc": "教师查看答题统计详情页次数",
+      "dimension": "小组学习"
+    },
+    {
+      "field": "TimerResult",
+      "percent": 3,
+      "desc": "教师端设置分组时长次数",
+      "dimension": ""
+    },
+    {
+      "field": "WrkCmp",
+      "percent": 3,
+      "desc": "教师端大黑板展示次数",
+      "dimension": "小组学习"
+    },
+    {
+      "field": "TakePic",
+      "percent": 3,
+      "desc": "教师端ppt标注(画红线)次数",
+      "dimension": ""
+    },
+    {
+      "field": "EzsStartRecord",
+      "percent": 3,
+      "desc": "课堂视频录制次数",
+      "dimension": ""
+    },
+    {
+      "field": "PgJump",
+      "percent": 3,
+      "desc": "ppt翻页次数",
+      "dimension": ""
+    }
+  ]
+}

+ 17 - 0
TEAMModelOS/Models/ShanDa/Field.cs

@@ -0,0 +1,17 @@
+using DocumentFormat.OpenXml.Office2010.ExcelAc;
+using System.Collections.Generic;
+
+namespace TEAMModelOS.Models.ShanDa
+{
+    public class Field
+    {
+        public double total { get; set; }
+        public List<application> fields { get; set; } = new List<application>();
+    }
+    public class application { 
+        public string field { get; set; }
+        public double percent { get; set; }
+        public string desc { get; set; }
+        public string dimension { get; set; }
+    }
+}