Przeglądaj źródła

调整进线分数和踩线部分字段内容和代码

zhouj1203@hotmail.com 3 lat temu
rodzic
commit
f8221ff302

+ 2 - 2
TEAMModelOS.SDK/Models/Cosmos/School/ExamInfo.cs

@@ -105,8 +105,8 @@ namespace TEAMModelOS.SDK.Models
         public double standard { get; set; }
         //记录该评测内容下blob大小
         public long? size { get; set; } = 0;
-        public int income { get; set; }
-        public int touch { get; set; }
+        public int income { get; set; } = 0;
+        public int touch { get; set; } = 0;
         //容器名称 container name
         //public string cn { get; set; }
     }

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

@@ -137,7 +137,7 @@ namespace TEAMModelOS.Controllers.Analysis
                 var client = _azureCosmos.GetCosmosClient();
                 //获取本次评测所有科目结算结果
                 info = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemAsync<ExamInfo>(id.ToString(), new PartitionKey($"Exam-{code}"));
-                School school = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<School>(code.ToString(), new PartitionKey($"Base"));
+                //School school = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<School>(code.ToString(), new PartitionKey($"Base"));
                 var query = $"select c.id,c.name,c.subjectId,c.studentScores,c.studentIds,c.paper,c.classes,c.sRate,c.average,c.standard,c.lostStus,c.record,c.phc,c.plc from c where c.examId =  '{id}' ";
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<ExamResult>(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamResult-{id}") }))
                 {
@@ -151,15 +151,15 @@ namespace TEAMModelOS.Controllers.Analysis
                     examClassResults.Add(item);
 
                 }
-
-                foreach (Period period in school.period)
+                touch = info.touch;
+                income = info.income;
+                /*foreach (Period period in school.period)
                 {
                     if (info.period.id.Equals(period.id))
                     {
-                        touch = period.analysis.touch;
-                        income = period.analysis.income;
+                        
                     }
-                }
+                }*/
                 //计算每个年级参考人数并计算进线分数
                 List<KeyValuePair<string, double>> keys = new List<KeyValuePair<string, double>>();
                 List<double> gradeTotal = new List<double>();