年级id
This commit is contained in:
parent
0bd2c24f93
commit
d3e9523a58
@ -19,7 +19,7 @@ namespace YD_WeChatApplet
|
||||
{
|
||||
serverOptions.Limits.MaxRequestBodySize = 10485760;
|
||||
});
|
||||
webBuilder.UseKestrel().UseUrls("http://*:9993");
|
||||
webBuilder.UseKestrel().UseUrls("http://*:9995");
|
||||
webBuilder.UseIIS();
|
||||
webBuilder.UseStartup<Startup>();
|
||||
}).UseServiceProviderFactory(new AutofacServiceProviderFactory());
|
||||
|
||||
@ -203,34 +203,67 @@ namespace YD_WeChatApplet.Api.Services.Impl
|
||||
if (student == null)
|
||||
return res;
|
||||
|
||||
var grade = await _sportsContext.SportsTestValue.Where(x => x.IsDisplay && x.SchoolCode == student.SchoolCode && x.StudentNo == studentNo).Select(x => new
|
||||
{
|
||||
x.ScoreTime,
|
||||
x.GradeId
|
||||
var classInfo = await _sportsContext.Class.FirstOrDefaultAsync(x => x.Id == student.ClassId);
|
||||
|
||||
}).OrderByDescending(x => x.ScoreTime).FirstOrDefaultAsync();
|
||||
|
||||
if (grade == null)
|
||||
if (classInfo == null)
|
||||
return res;
|
||||
|
||||
var categorys = await (
|
||||
from g in _sportsContext.GradeAssocCategory
|
||||
join s in _sportsContext.SportsTestCategory on g.CategoryValue equals s.CategoryValue
|
||||
|
||||
where g.GradeId == grade.GradeId
|
||||
|
||||
select new
|
||||
var categorys = new List<dynamic>
|
||||
{
|
||||
new
|
||||
{
|
||||
s.Id,
|
||||
s.CategoryEnum,
|
||||
s.CategoryValue,
|
||||
s.CategoryName,
|
||||
g.Weight
|
||||
}).ToListAsync();
|
||||
Id = 1,
|
||||
CategoryValue = 1,
|
||||
CategoryName = "BMI",
|
||||
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()
|
||||
{
|
||||
StudentNo = x.StudentNo,
|
||||
GradeId = x.GradeId,
|
||||
Value = x.Value,
|
||||
Score = x.Score,
|
||||
Rank = x.Rank,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user