tijiao
This commit is contained in:
parent
975088da26
commit
0bd2c24f93
@ -203,68 +203,37 @@ namespace YD_WeChatApplet.Api.Services.Impl
|
|||||||
if (student == null)
|
if (student == null)
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
var classInfo = await _sportsContext.Class.FirstOrDefaultAsync(x => x.Id == student.ClassId);
|
var grade = await _sportsContext.SportsTestValue.Where(x => x.IsDisplay && x.SchoolCode == student.SchoolCode && x.StudentNo == studentNo).Select(x => new
|
||||||
|
{
|
||||||
|
x.ScoreTime,
|
||||||
|
x.GradeId
|
||||||
|
|
||||||
if (classInfo == null)
|
}).OrderByDescending(x => x.ScoreTime).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
if (grade == null)
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
var categorys = new List<dynamic>
|
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
|
||||||
{
|
{
|
||||||
new
|
s.Id,
|
||||||
{
|
s.CategoryEnum,
|
||||||
Id = 1,
|
s.CategoryValue,
|
||||||
CategoryValue = 1,
|
s.CategoryName,
|
||||||
CategoryName = "BMI",
|
g.Weight
|
||||||
CategoryEnum = "BMI",
|
}).ToListAsync();
|
||||||
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,
|
||||||
Value = x.Value,
|
Value = x.Value,
|
||||||
Score = x.Score,
|
Score = x.Score,
|
||||||
|
Rank = x.Rank,
|
||||||
AdditionalScore = x.AdditionalScore,
|
AdditionalScore = x.AdditionalScore,
|
||||||
CategoryValue = x.CategoryValue,
|
CategoryValue = x.CategoryValue,
|
||||||
ScoreTime = x.ScoreTime
|
ScoreTime = x.ScoreTime
|
||||||
@ -305,7 +274,7 @@ namespace YD_WeChatApplet.Api.Services.Impl
|
|||||||
var trendChart = new ScoreTrendChartDataDto
|
var trendChart = new ScoreTrendChartDataDto
|
||||||
{
|
{
|
||||||
AxisX = trendList.Select(x => x.ScoreTime.ToString("yyyy-MM-dd")).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.Value ?? 0f).ToList()
|
||||||
};
|
};
|
||||||
|
|
||||||
res.CategoryScoreList.Add(new CategoryScoreDto()
|
res.CategoryScoreList.Add(new CategoryScoreDto()
|
||||||
@ -313,6 +282,8 @@ namespace YD_WeChatApplet.Api.Services.Impl
|
|||||||
CategoryValue = item.CategoryValue,
|
CategoryValue = item.CategoryValue,
|
||||||
Name = item.CategoryName,
|
Name = item.CategoryName,
|
||||||
|
|
||||||
|
Rank = lastResult?.Rank,
|
||||||
|
|
||||||
PrevScore = prevResult?.Score ?? 0,
|
PrevScore = prevResult?.Score ?? 0,
|
||||||
LastScore = lastResult?.Score ?? 0,
|
LastScore = lastResult?.Score ?? 0,
|
||||||
|
|
||||||
|
|||||||
@ -481,6 +481,13 @@ namespace YD_WeChatApplet.Services
|
|||||||
if (string.IsNullOrWhiteSpace(studentNo) || studentNo == "0")
|
if (string.IsNullOrWhiteSpace(studentNo) || studentNo == "0")
|
||||||
studentNo = UserLoginContext.Current.UserNo;
|
studentNo = UserLoginContext.Current.UserNo;
|
||||||
|
|
||||||
|
var student = await _sportsContext.Student.FirstOrDefaultAsync(x => x.StudentNo == studentNo);
|
||||||
|
|
||||||
|
if (student == null)
|
||||||
|
throw new Exception($"未找到学生信息:{studentNo}");
|
||||||
|
|
||||||
|
res.Age = student.Age;
|
||||||
|
|
||||||
// 构建心跳数据查询
|
// 构建心跳数据查询
|
||||||
IQueryable<Ai_HeartRateData> heartRateQuery = _sportsContext.Ai_HeartRateData;
|
IQueryable<Ai_HeartRateData> heartRateQuery = _sportsContext.Ai_HeartRateData;
|
||||||
|
|
||||||
|
|||||||
@ -28,11 +28,11 @@
|
|||||||
|
|
||||||
"RedisConnectionString": "8.153.108.90,Password=yd708090,SyncTimeout=15000,defaultDatabase=4",
|
"RedisConnectionString": "8.153.108.90,Password=yd708090,SyncTimeout=15000,defaultDatabase=4",
|
||||||
|
|
||||||
"DbConnectionString": " Data Source=rm-uf64b8oxdt19pfyxfao.sqlserver.rds.aliyuncs.com;Database=YD_WeChatAppletDB_QA;User ID=qa;Password=Admin@123;Connect Timeout=500;",
|
//"DbConnectionString": " Data Source=rm-uf64b8oxdt19pfyxfao.sqlserver.rds.aliyuncs.com;Database=YD_WeChatAppletDB_QA;User ID=qa;Password=Admin@123;Connect Timeout=500;",
|
||||||
"SmartSportsString": " Data Source=rm-uf64b8oxdt19pfyxfao.sqlserver.rds.aliyuncs.com;Database=SmartSportsServerDB_QA;User ID=qa;Password=Admin@123;Connect Timeout=500;",
|
//"SmartSportsString": " Data Source=rm-uf64b8oxdt19pfyxfao.sqlserver.rds.aliyuncs.com;Database=SmartSportsServerDB_QA;User ID=qa;Password=Admin@123;Connect Timeout=500;",
|
||||||
|
|
||||||
//"DbConnectionString": " Data Source=rm-uf64b8oxdt19pfyxfao.sqlserver.rds.aliyuncs.com;Database=YD_WeChatAppletDB;User ID=yd;Password=Admin@123456;Connect Timeout=500;",
|
"DbConnectionString": " Data Source=rm-uf64b8oxdt19pfyxfao.sqlserver.rds.aliyuncs.com;Database=YD_WeChatAppletDB;User ID=yd;Password=Admin@123456;Connect Timeout=500;",
|
||||||
//"SmartSportsString": " Data Source=rm-uf64b8oxdt19pfyxfao.sqlserver.rds.aliyuncs.com;Database=SmartSportsServerDB;User ID=yd;Password=Admin@123456;Connect Timeout=500;",
|
"SmartSportsString": " Data Source=rm-uf64b8oxdt19pfyxfao.sqlserver.rds.aliyuncs.com;Database=SmartSportsServerDB;User ID=yd;Password=Admin@123456;Connect Timeout=500;",
|
||||||
"CorsUrls": "http://localhost:8081,http://localhost:8080,http://localhost:7080,http://localhost:9980,http://127.0.0.1:9993,http://localhost:9993",
|
"CorsUrls": "http://localhost:8081,http://localhost:8080,http://localhost:7080,http://localhost:9980,http://127.0.0.1:9993,http://localhost:9993",
|
||||||
|
|
||||||
"WeChat": {
|
"WeChat": {
|
||||||
|
|||||||
@ -11,6 +11,11 @@ namespace YD_WeChatApplet.Commons.Dto.ClassRoomRecord
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class StudentClassRoomReportDto
|
public class StudentClassRoomReportDto
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 年龄
|
||||||
|
/// </summary>
|
||||||
|
public int Age { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 最大心率
|
/// 最大心率
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -31,13 +36,11 @@ namespace YD_WeChatApplet.Commons.Dto.ClassRoomRecord
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int HighIntensity { get; set; }
|
public int HighIntensity { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 中高强度时长占比
|
/// 中高强度时长占比
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double HighIntensityDurationRatio { get; set; }
|
public double HighIntensityDurationRatio { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 总个数
|
/// 总个数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -62,6 +62,11 @@ namespace YD_WeChatApplet.Commons.Dto.Patriarch
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string ImgUrl { get; set; }
|
public string ImgUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 等级
|
||||||
|
/// </summary>
|
||||||
|
public string Rank { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 成绩趋势图
|
/// 成绩趋势图
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user