排序
This commit is contained in:
parent
922cd4beca
commit
09ddbc0005
Binary file not shown.
Binary file not shown.
@ -14,7 +14,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("YD_XinWei.Commons")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f9f4a53c41a5029c82bfb442fd4e2b9f2980218f")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+922cd4beca32dd7110c41a523d23b114176a3a0b")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("YD_XinWei.Commons")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("YD_XinWei.Commons")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@ -1 +1 @@
|
||||
74c4dd81c8aa3b83c88922809ca51fe25d7816fdf64b1c08a9bf0d7628572ab1
|
||||
f98fc273dcd7d743144a77bbe89c38aafb9c6660ae1cf7e7ea16bcac6dd155ec
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -19,7 +19,7 @@ namespace YD_XinWei.Api
|
||||
{
|
||||
serverOptions.Limits.MaxRequestBodySize = 10485760;
|
||||
});
|
||||
webBuilder.UseKestrel().UseUrls("http://*:9995");
|
||||
webBuilder.UseKestrel().UseUrls("http://*:9994");
|
||||
webBuilder.UseIIS();
|
||||
webBuilder.UseStartup<Startup>();
|
||||
}).UseServiceProviderFactory(new AutofacServiceProviderFactory());
|
||||
|
||||
@ -172,11 +172,15 @@ namespace YD_XinWei.Api.Services.Impl
|
||||
CategoryValue = g.Key,
|
||||
|
||||
// 优良率计算:分数 > 80 的人数 ÷ 总人数
|
||||
ExcellentRate = (int)Math.Round(sportsTestData.Count(x => x.CategoryValue == g.Key && x.Score > 80) * 100.0 / Math.Max(sportsTestData.Count(x => x.CategoryValue == g.Key), 1), MidpointRounding.AwayFromZero),
|
||||
ExcellentRate = (int)Math.Round(
|
||||
sportsTestData.Count(x => x.CategoryValue == g.Key && x.Score > 80) * 100.0 /
|
||||
Math.Max(sportsTestData.Count(x => x.CategoryValue == g.Key), 1),
|
||||
MidpointRounding.AwayFromZero
|
||||
),
|
||||
|
||||
// 男生前十名
|
||||
MaleRankList = g.Where(x => x.Sex == 1)
|
||||
.OrderByDescending(x => x.Value)
|
||||
MaleRankList = (g.Where(x => x.Sex == 1)
|
||||
.OrderBy(x => g.Key == 3 ? x.Value : -x.Value) // 条件排序
|
||||
.Take(10)
|
||||
.Select((x, index) => new StudentScoreRankingDto
|
||||
{
|
||||
@ -184,11 +188,11 @@ namespace YD_XinWei.Api.Services.Impl
|
||||
StudentNo = x.StudentNo,
|
||||
StudentName = x.StudentName,
|
||||
Value = x.CategoryValue == 1 ? $"{x.Height}cm/{x.Weight}kg" : $"{x.Value}{((SportsTestItemType)x.CategoryValue).GetUnit()}"
|
||||
}).ToList(),
|
||||
})).ToList(),
|
||||
|
||||
// 女生前十名
|
||||
FemaleRankList = g.Where(x => x.Sex == 2)
|
||||
.OrderByDescending(x => x.Value)
|
||||
FemaleRankList = (g.Where(x => x.Sex == 2)
|
||||
.OrderBy(x => g.Key == 3 ? x.Value : -x.Value) // 条件排序
|
||||
.Take(10)
|
||||
.Select((x, index) => new StudentScoreRankingDto
|
||||
{
|
||||
@ -196,10 +200,11 @@ namespace YD_XinWei.Api.Services.Impl
|
||||
StudentNo = x.StudentNo,
|
||||
StudentName = x.StudentName,
|
||||
Value = x.CategoryValue == 1 ? $"{x.Height}cm/{x.Weight}kg" : $"{x.Value}{((SportsTestItemType)x.CategoryValue).GetUnit()}"
|
||||
}).ToList()
|
||||
})).ToList()
|
||||
})
|
||||
.ToList();
|
||||
|
||||
|
||||
res.ItemDatalist = projectResults;
|
||||
|
||||
var classListKey = $"ClassList_{schoolCode}";
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -14,7 +14,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("YD_XinWei.Api")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f9f4a53c41a5029c82bfb442fd4e2b9f2980218f")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+922cd4beca32dd7110c41a523d23b114176a3a0b")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("YD_XinWei.Api")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("YD_XinWei.Api")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@ -1 +1 @@
|
||||
3ee2a4997ca5a7a114829a3edd61a9285483441b9edac8b0338989a7c9e658a8
|
||||
7e5321acb1dd2df00cdf92241817af42b08287146feb91b5a34d93b70138def9
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user