This commit is contained in:
tanglong 2026-01-07 18:20:34 +08:00
parent 7bdd3b25d3
commit 3feec35b44
10 changed files with 51 additions and 51 deletions

View File

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("YD_XinWei.Commons")] [assembly: System.Reflection.AssemblyCompanyAttribute("YD_XinWei.Commons")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+35ad95bd6885f10ef9d0d18bc76609fc1773a39d")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+7bdd3b25d3197213802b19b367c9c9e6ecba10ba")]
[assembly: System.Reflection.AssemblyProductAttribute("YD_XinWei.Commons")] [assembly: System.Reflection.AssemblyProductAttribute("YD_XinWei.Commons")]
[assembly: System.Reflection.AssemblyTitleAttribute("YD_XinWei.Commons")] [assembly: System.Reflection.AssemblyTitleAttribute("YD_XinWei.Commons")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
b0094d31d93d158b8a715e64c9aa2a1dc33706a1b2d46d99732ddf981a165f5d 2cc8d2f686463f07a5c8fe465cc6425ba843827a96c0faadb12d0611a515735a

View File

@ -10,7 +10,7 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules = build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = YD_XinWei.Commons build_property.RootNamespace = YD_XinWei.Commons
build_property.ProjectDir = D:\Git\YD\YD_XinWei.Api\Server\YD_XinWei.Commons\ build_property.ProjectDir = C:\Users\tangl\Desktop\Git\YD_XinWei\Server\YD_XinWei.Commons\
build_property.EnableComHosting = build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop = build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.EffectiveAnalysisLevelStyle = 6.0 build_property.EffectiveAnalysisLevelStyle = 6.0

View File

@ -83,29 +83,56 @@ namespace YD_XinWei.Api.Services.Impl
var sportsTestDataKey = $"SportsTestData_{schoolCode}"; var sportsTestDataKey = $"SportsTestData_{schoolCode}";
var studentListKey = $"StudentList_{schoolCode}"; var studentListKey = $"StudentList_{schoolCode}";
//var studentList = _caching.Get<List<StudentListDto>>(studentListKey); var studentList = _caching.Get<List<StudentListDto>>(studentListKey);
//if (studentList == null || studentList.Count == 0) if (studentList == null || studentList.Count == 0)
//{ {
// studentList = await _sportsContext.Student.Where(x => x.SchoolCode == schoolCode).Select(x => new StudentListDto studentList = await _sportsContext.Student.Where(x => x.SchoolCode == schoolCode).Select(x => new StudentListDto
// {
// StudentNo = x.StudentNo,
// Sex = x.Sex,
// Photo = x.Photo ?? ""
// }).ToListAsync();
// //_caching.AddObject(studentListKey, studentList, 3600);
//}
var studentList = await _sportsContext.Student.Where(x => x.SchoolCode == schoolCode).Select(x => new StudentListDto
{ {
StudentNo = x.StudentNo, StudentNo = x.StudentNo,
Sex = x.Sex, Sex = x.Sex,
Photo = x.Photo ?? "" Photo = x.Photo ?? ""
}).ToListAsync(); }).ToListAsync();
_caching.AddObject(studentListKey, studentList, 3600);
}
//var studentList = await _sportsContext.Student.Where(x => x.SchoolCode == schoolCode).Select(x => new StudentListDto
//{
// StudentNo = x.StudentNo,
// Sex = x.Sex,
// Photo = x.Photo ?? ""
//}).ToListAsync();
res.BasicInfo.FemaleCount = studentList.Count(x => x.Sex == 2); res.BasicInfo.FemaleCount = studentList.Count(x => x.Sex == 2);
res.BasicInfo.MaleCount = studentList.Count(x => x.Sex == 1); res.BasicInfo.MaleCount = studentList.Count(x => x.Sex == 1);
var sportsTestData = _caching.Get<List<SportsTestDataDto>>(sportsTestDataKey);
if (sportsTestData == null || sportsTestData.Count == 0)
{
sportsTestData = await _sportsContext.SportsTestValue.Where(x => x.SchoolCode == schoolCode && x.DataSource == DataSource.XW)
.Select(x => new SportsTestDataDto()
{
SchoolCode = x.SchoolCode,
CategoryValue = x.CategoryValue,
ClassId = x.ClassId,
ClassName = x.ClassName,
GradeId = x.GradeId,
GradeName = x.GradeName,
TeacherId = x.TeacherId,
StudentNo = x.StudentNo,
StudentName = x.StudentName,
Sex = x.Sex,
ScoreTime = x.ScoreTime,
Height = x.Height,
Weight = x.Weight,
Value = x.Value,
Score = x.Score,
Rank = x.Rank
}).ToListAsync();
_caching.AddObject(sportsTestDataKey, sportsTestData, 60);
}
//var sportsTestData = _caching.Get<List<SportsTestDataDto>>(sportsTestDataKey); //var sportsTestData = _caching.Get<List<SportsTestDataDto>>(sportsTestDataKey);
//if (sportsTestData == null || sportsTestData.Count == 0) //if (sportsTestData == null || sportsTestData.Count == 0)
@ -133,33 +160,6 @@ namespace YD_XinWei.Api.Services.Impl
// //_caching.AddObject(sportsTestDataKey, sportsTestData, 60); // //_caching.AddObject(sportsTestDataKey, sportsTestData, 60);
//} //}
var sportsTestData = _caching.Get<List<SportsTestDataDto>>(sportsTestDataKey);
if (sportsTestData == null || sportsTestData.Count == 0)
{
sportsTestData = await _sportsContext.SportsTestValue.Where(x => x.SchoolCode == schoolCode && x.DataSource == DataSource.XW)
.Select(x => new SportsTestDataDto()
{
SchoolCode = x.SchoolCode,
CategoryValue = x.CategoryValue,
ClassId = x.ClassId,
ClassName = x.ClassName,
GradeId = x.GradeId,
GradeName = x.GradeName,
TeacherId = x.TeacherId,
StudentNo = x.StudentNo,
StudentName = x.StudentName,
Sex = x.Sex,
ScoreTime = x.ScoreTime,
Height = x.Height,
Weight = x.Weight,
Value = x.Value,
Score = x.Score,
Rank = x.Rank
}).ToListAsync();
//_caching.AddObject(sportsTestDataKey, sportsTestData, 60);
}
var bestScoreData = sportsTestData var bestScoreData = sportsTestData
.GroupBy(x => x.StudentNo) .GroupBy(x => x.StudentNo)
.Select(g => g.OrderByDescending(x => x.Score).First()) .Select(g => g.OrderByDescending(x => x.Score).First())

View File

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("YD_XinWei.Api")] [assembly: System.Reflection.AssemblyCompanyAttribute("YD_XinWei.Api")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+35ad95bd6885f10ef9d0d18bc76609fc1773a39d")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+7bdd3b25d3197213802b19b367c9c9e6ecba10ba")]
[assembly: System.Reflection.AssemblyProductAttribute("YD_XinWei.Api")] [assembly: System.Reflection.AssemblyProductAttribute("YD_XinWei.Api")]
[assembly: System.Reflection.AssemblyTitleAttribute("YD_XinWei.Api")] [assembly: System.Reflection.AssemblyTitleAttribute("YD_XinWei.Api")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
8fcb698e781269d044bd4e8633786876937f11fe32cf7dcaeb9e1a6cad1302da 34384d21dca01e788acaeaa1d2e1fe004164bf6f5d12e402f2069e4a31083347

View File

@ -11,13 +11,13 @@ build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = YD_XinWei.Api build_property.RootNamespace = YD_XinWei.Api
build_property.RootNamespace = YD_XinWei.Api build_property.RootNamespace = YD_XinWei.Api
build_property.ProjectDir = D:\Git\YD\YD_XinWei.Api\Server\YD_XinWei\ build_property.ProjectDir = C:\Users\tangl\Desktop\Git\YD_XinWei\Server\YD_XinWei\
build_property.EnableComHosting = build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop = build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.RazorLangVersion = 6.0 build_property.RazorLangVersion = 6.0
build_property.SupportLocalizedComponentNames = build_property.SupportLocalizedComponentNames =
build_property.GenerateRazorMetadataSourceChecksumAttributes = build_property.GenerateRazorMetadataSourceChecksumAttributes =
build_property.MSBuildProjectDirectory = D:\Git\YD\YD_XinWei.Api\Server\YD_XinWei build_property.MSBuildProjectDirectory = C:\Users\tangl\Desktop\Git\YD_XinWei\Server\YD_XinWei
build_property._RazorSourceGeneratorDebug = build_property._RazorSourceGeneratorDebug =
build_property.EffectiveAnalysisLevelStyle = 6.0 build_property.EffectiveAnalysisLevelStyle = 6.0
build_property.EnableCodeStyleSeverity = build_property.EnableCodeStyleSeverity =