This commit is contained in:
tanglong 2026-04-28 10:36:35 +08:00
parent 0bd2c24f93
commit d3e9523a58
2 changed files with 54 additions and 21 deletions

View File

@ -19,7 +19,7 @@ namespace YD_WeChatApplet
{ {
serverOptions.Limits.MaxRequestBodySize = 10485760; serverOptions.Limits.MaxRequestBodySize = 10485760;
}); });
webBuilder.UseKestrel().UseUrls("http://*:9993"); webBuilder.UseKestrel().UseUrls("http://*:9995");
webBuilder.UseIIS(); webBuilder.UseIIS();
webBuilder.UseStartup<Startup>(); webBuilder.UseStartup<Startup>();
}).UseServiceProviderFactory(new AutofacServiceProviderFactory()); }).UseServiceProviderFactory(new AutofacServiceProviderFactory());

View File

@ -203,34 +203,67 @@ namespace YD_WeChatApplet.Api.Services.Impl
if (student == null) if (student == null)
return res; return res;
var grade = await _sportsContext.SportsTestValue.Where(x => x.IsDisplay && x.SchoolCode == student.SchoolCode && x.StudentNo == studentNo).Select(x => new var classInfo = await _sportsContext.Class.FirstOrDefaultAsync(x => x.Id == student.ClassId);
{
x.ScoreTime,
x.GradeId
}).OrderByDescending(x => x.ScoreTime).FirstOrDefaultAsync(); if (classInfo == null)
if (grade == null)
return res; return res;
var categorys = await ( var categorys = new List<dynamic>
from g in _sportsContext.GradeAssocCategory
join s in _sportsContext.SportsTestCategory on g.CategoryValue equals s.CategoryValue
where g.GradeId == grade.GradeId
select new
{ {
s.Id, new
s.CategoryEnum, {
s.CategoryValue, Id = 1,
s.CategoryName, CategoryValue = 1,
g.Weight CategoryName = "BMI",
}).ToListAsync(); CategoryEnum = "BMI",
Weight = 0.15f
},
new
{
Id = 2,
CategoryValue = 2,
CategoryName = "肺活量",
CategoryEnum = "VitalCapacity",
Weight = 0.2f
},
new
{
Id = 4,
CategoryValue = 4,
CategoryName = "坐位体前屈",
CategoryEnum = "Sit_And_Reach",
Weight = 0.15f
},
new
{
Id = 5,
CategoryValue = 5,
CategoryName = "一分钟跳绳",
CategoryEnum = "OneMinuteJumpRope",
Weight = 0.2f
},
new
{
Id = 6,
CategoryValue = 6,
CategoryName = "一分钟仰卧起坐",
CategoryEnum = "One_Minute_Sit_Up",
Weight = 0.15f
},
new
{
Id = 8,
CategoryValue = 6,
CategoryName = "立定跳远",
CategoryEnum = "StandingLongJump",
Weight = 0.15f
}
};
var sportsTestResults = await _sportsContext.SportsTestValue.Where(x => x.IsDisplay && x.SchoolCode == student.SchoolCode).Select(x => new SportsTestValueModel() var sportsTestResults = await _sportsContext.SportsTestValue.Where(x => x.IsDisplay && x.SchoolCode == student.SchoolCode).Select(x => new SportsTestValueModel()
{ {
StudentNo = x.StudentNo, StudentNo = x.StudentNo,
GradeId = x.GradeId,
Value = x.Value, Value = x.Value,
Score = x.Score, Score = x.Score,
Rank = x.Rank, Rank = x.Rank,