This commit is contained in:
tanglong 2026-04-24 15:58:55 +08:00
parent 41672a56aa
commit 2278bfc8a7

View File

@ -203,23 +203,57 @@ namespace YD_WeChatApplet.Api.Services.Impl
if (classInfo == null) if (classInfo == 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 == classInfo.GradeId
select new
{ {
s.Id, new
s.CategoryValue, {
s.CategoryName, Id = 1,
s.CategoryEnum, CategoryValue = 1,
g.Weight CategoryName = "BMI",
}).ToListAsync(); CategoryEnum = "BMI",
Weight = 0.15f
if (categorys == null) },
return res; 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()
{ {
@ -265,7 +299,7 @@ namespace YD_WeChatApplet.Api.Services.Impl
var trendChart = new ScoreTrendChartDataDto var trendChart = new ScoreTrendChartDataDto
{ {
AxisX = trendList.Select(x => x.ScoreTime.ToString("MM-dd HH:mm")).ToList(), AxisX = trendList.Select(x => x.ScoreTime.ToString("yyyy-MM-dd")).ToList(),
AxisY = trendList.Select(x => x.Score ?? 0f).ToList() AxisY = trendList.Select(x => x.Score ?? 0f).ToList()
}; };