HiITEdenX 2 年之前
父節點
當前提交
38962a750c

+ 1 - 1
TEAMModelOS.FunctionV4/ServiceBus/ActiveTaskTopic.cs

@@ -1774,7 +1774,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
                                 }
                                 }
 
 
                                 msgs.Add(update);
                                 msgs.Add(update);
-                                await BIStats.SetTypeAddStats(client, lessonRecord.school, "Less", 1, 0);//BI统计增/减量
+                               // await BIStats.SetTypeAddStats(client, lessonRecord.school, "Less", 1, 0);//BI统计增/减量
                                 break;
                                 break;
                             default:
                             default:
                                 break;
                                 break;

+ 1 - 1
TEAMModelOS.SDK/Models/Cosmos/OpenEntity/OStudent.cs

@@ -105,7 +105,7 @@ namespace TEAMModelOS.SDK.Models.Cosmos.OpenEntity
         /// <summary>
         /// <summary>
         /// 身份
         /// 身份
         /// </summary>
         /// </summary>
-        public int status { get; set; }
+        //public int status { get; set; }
         /// <summary>
         /// <summary>
         /// 答题总体结果
         /// 答题总体结果
         /// </summary>
         /// </summary>

+ 1 - 1
TEAMModelOS.SDK/Models/Cosmos/Student/StudentArtResult.cs

@@ -30,7 +30,7 @@ namespace TEAMModelOS.SDK.Models
         /// <summary>
         /// <summary>
         /// 艺术评测 音乐 从智音传过来的分数结果信息
         /// 艺术评测 音乐 从智音传过来的分数结果信息
         /// </summary>
         /// </summary>
-        public OAnswer oAnswer { get; set; } = new OAnswer();
+        public OAnswer zyanswer { get; set; } = new OAnswer();
 
 
     }
     }
     public class ArtSubjectScore {
     public class ArtSubjectScore {

+ 1 - 1
TEAMModelOS.SDK/Models/Service/BI/BIStats.cs

@@ -277,7 +277,7 @@ namespace TEAMModelOS.SDK.Models.Service.BI
 
 
             }
             }
 
 
-            if (resStsInfo.Status == 200)
+            if (resStsInfo.Status == 200) 
                 statsInfo = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync<StatsInfo>(statsInfo, scId, new PartitionKey("Statistics"));
                 statsInfo = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync<StatsInfo>(statsInfo, scId, new PartitionKey("Statistics"));
             else
             else
                 statsInfo = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").CreateItemAsync<StatsInfo>(statsInfo, new PartitionKey("Statistics"));
                 statsInfo = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").CreateItemAsync<StatsInfo>(statsInfo, new PartitionKey("Statistics"));

+ 33 - 19
TEAMModelOS/Controllers/OpenApi/Business/BizCustomizeController.cs

@@ -418,28 +418,42 @@ namespace TEAMModelOS.Controllers
             OAnswerUp oAnswer = _answer.ToObject<OAnswerUp>();
             OAnswerUp oAnswer = _answer.ToObject<OAnswerUp>();
             StudentArtResult studentArtResult = new();
             StudentArtResult studentArtResult = new();
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var cosmosClient = _azureCosmos.GetCosmosClient();
-            var resArt = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Student").ReadItemStreamAsync($"{school}-{oAnswer.studentId}", new PartitionKey($"ArtResult-{oAnswer.artId}"));
-            if (resArt.Status == 200)
+            var ids = oAnswer.thirdAnswerId.Split("::");
+            if (ids.Length == 3)
             {
             {
-                JsonDocument jsonD = JsonDocument.Parse(resArt.Content);
-                studentArtResult = jsonD.RootElement.ToObject<StudentArtResult>();
-                var temp = studentArtResult.results.Find(f => f.taskId.Equals(oAnswer.thirdAnswerId));
-                temp.score = oAnswer.score;
-                temp.source = 1;
-                studentArtResult.oAnswer.questionId = oAnswer.questionId;
-                studentArtResult.oAnswer.thirdAnswerId = oAnswer.thirdAnswerId;
-                studentArtResult.oAnswer.score = oAnswer.score;
-                studentArtResult.oAnswer.detail = oAnswer.detail;
-
-                await cosmosClient.GetContainer(Constant.TEAMModelOS, "Student").ReplaceItemAsync<StudentArtResult>(studentArtResult, studentArtResult.id, new PartitionKey(studentArtResult.code));
+                string artId = ids[0];
+                string taskId = ids[1];
+                string studentId = ids[2];
+                var resArt = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Student").ReadItemStreamAsync($"{school}-{studentId}", new PartitionKey($"ArtResult-{artId}"));
+                if (resArt.Status == 200)
+                {
+                    JsonDocument jsonD = JsonDocument.Parse(resArt.Content);
+                    studentArtResult = jsonD.RootElement.ToObject<StudentArtResult>();
+                    var temp = studentArtResult.results.Find(f => f.taskId.Equals(taskId));
+                    if (temp == null) {
+                        temp = new ArtQuotaResult();
+                        temp.subjectId = "subject_music";
+                        temp.subjectName = "音乐";
+                        temp.taskId = taskId;
+                    }
+                    temp.score = oAnswer.score;
+                    temp.source = 1;
+                    studentArtResult.zyanswer.questionId = oAnswer.questionId;
+                    studentArtResult.zyanswer.thirdAnswerId = oAnswer.thirdAnswerId;
+                    studentArtResult.zyanswer.score = oAnswer.score;
+                    studentArtResult.zyanswer.detail = oAnswer.detail;
+                    await cosmosClient.GetContainer(Constant.TEAMModelOS, "Student").ReplaceItemAsync<StudentArtResult>(studentArtResult, studentArtResult.id, new PartitionKey(studentArtResult.code));
+                    return Ok(new { responseData = new ResponseData<dynamic>() { code = RespondCode.Ok, msg = "成功", data = oAnswer } });
+                }
+                else
+                { 
+                    //初始化。
+                }
+            }
+            else {
+                return Ok(new { responseDate = new ResponseData<dynamic>() { code = RespondCode.ParamsError, msg = "第三方id错误。", data = null } });
             }
             }
-            else
-                return Ok(new { responseDate = new ResponseData<dynamic>() { code = RespondCode.NotFound, msg = "未找到活动相关学生答题信息", data = null } });
-
-            return Ok(new { responseData = new ResponseData<dynamic>() { code = RespondCode.Ok, msg = "成功", data = oAnswer } });
         }
         }
-
-
         #endregion
         #endregion
 
 
 
 

+ 1 - 42
TEAMModelOS/Controllers/OpenApi/Business/BizOverallEducationController.cs

@@ -414,48 +414,7 @@ namespace TEAMModelOS.Controllers
 
 
         #endregion
         #endregion
 
 
-        #region 智音公司
-
-
-        /// <summary>
-        /// 添加/修改学生艺术评测(音乐)答题结果
-        /// </summary>
-        /// <param name="jsonElement"></param>
-        /// <returns></returns>
-        //[ProducesDefaultResponseType]
-        //[HttpPost("set-stdent-score")]
-        //[ApiToken(Auth = "1905", Name = "添加/修改学生艺术评测(音乐)答题结果", TName = "添加/修改學生藝術評測音樂答題結果", EName = "Add/modify the music answer results of student art evaluation", RWN = "W", Limit = false)]
-        public async Task<IActionResult> SetStudnetScore(JsonElement jsonElement)
-        {
-            var (id, school) = HttpContext.GetApiTokenInfo();
-            if (!jsonElement.TryGetProperty("oAnswer", out JsonElement _oAnswer)) return Ok(new { responseDate = new ResponseData<dynamic>() { code = RespondCode.ParamsError, msg = "oaswer参数错误", data = null } });
-            OAnswerUp oAnswer = _oAnswer.ToObject<OAnswerUp>();
-            StudentArtResult studentArtResult = new();
-            var cosmosClient = _azureCosmos.GetCosmosClient();
-            var resArt = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Student").ReadItemStreamAsync($"{school}-{oAnswer.studentId}", new PartitionKey($"ArtResult-{oAnswer.artId}"));
-            if (resArt.Status == 200)
-            {
-                JsonDocument jsonD = JsonDocument.Parse(resArt.Content);
-                studentArtResult = jsonD.RootElement.ToObject<StudentArtResult>();
-                var temp = studentArtResult.results.Find(f => f.taskId.Equals(oAnswer.thirdAnswerId));
-                temp.score = oAnswer.score;
-                temp.source = 1;
-                studentArtResult.oAnswer.questionId = oAnswer.questionId;
-                studentArtResult.oAnswer.thirdAnswerId = oAnswer.thirdAnswerId;
-                studentArtResult.oAnswer.score = oAnswer.score;
-                studentArtResult.oAnswer.detail = oAnswer.detail;
-
-                await cosmosClient.GetContainer(Constant.TEAMModelOS, "Student").ReplaceItemAsync<StudentArtResult>(studentArtResult, studentArtResult.id, new PartitionKey(studentArtResult.code));
-            }
-            else
-                return Ok(new { responseDate = new ResponseData<dynamic>() { code = RespondCode.NotFound, msg = "未找到活动相关学生答题信息", data = null } });
-
-            return Ok(new { responseData = new ResponseData<dynamic>() { code = RespondCode.Ok, msg = "成功", data = oAnswer } });
-        }
-
-
-        #endregion
-
+        
 
 
 
 
         ///数据结构说明
         ///数据结构说明

+ 2 - 0
TEAMModelOS/Controllers/Student/OverallEducationController.cs

@@ -184,6 +184,8 @@ namespace TEAMModelOS.Controllers
 
 
             string oesql = $"select value c from c where c.semesterId='{_semesterId}' and  c.year={_year} and c.periodId='{_periodId}' " +
             string oesql = $"select value c from c where c.semesterId='{_semesterId}' and  c.year={_year} and c.periodId='{_periodId}' " +
                 $"and c.classId in {string.Join(",",classes.Select(z=>$"'{z}'"))} ";
                 $"and c.classId in {string.Join(",",classes.Select(z=>$"'{z}'"))} ";
+            var oeresults = await client.GetContainer(Constant.TEAMModelOS, Constant.Student).GetList<OverallEducation>(oesql, $"OverallEducation-{_school}");
+
             return Ok(new { studentCount ,classCount=classes.Count, grade=years.Count });
             return Ok(new { studentCount ,classCount=classes.Count, grade=years.Count });
         }
         }
     }
     }