sd
This commit is contained in:
parent
da055f28ca
commit
91983b0b81
@ -1490,8 +1490,8 @@ namespace VOL.Ai.Services
|
|||||||
|
|
||||||
var heartRateDataList = await query.ToListAsync();
|
var heartRateDataList = await query.ToListAsync();
|
||||||
|
|
||||||
if (heartRateDataList.Count == 0)
|
//if (heartRateDataList.Count == 0)
|
||||||
return res;
|
// return res;
|
||||||
|
|
||||||
var classRoom = await _teacherRepository.DbContext.Set<Ai_ClassRoomRecord>().Include(x => x.ClassroomStudentRecord)
|
var classRoom = await _teacherRepository.DbContext.Set<Ai_ClassRoomRecord>().Include(x => x.ClassroomStudentRecord)
|
||||||
.Where(x => x.SchoolCode == paramDto.SchoolCode && x.Id == paramDto.ClassRoomRecordId)
|
.Where(x => x.SchoolCode == paramDto.SchoolCode && x.Id == paramDto.ClassRoomRecordId)
|
||||||
@ -1528,7 +1528,7 @@ namespace VOL.Ai.Services
|
|||||||
res.PeopleNumberBySex = $"{classRoomStudent.Count(x => x.Sex == SexType.Male)}/{classRoomStudent.Count(x => x.Sex == SexType.Female)}";
|
res.PeopleNumberBySex = $"{classRoomStudent.Count(x => x.Sex == SexType.Male)}/{classRoomStudent.Count(x => x.Sex == SexType.Female)}";
|
||||||
|
|
||||||
res.AvgHR = $"{(int)(heartRateDataList.Sum(x => x.Value) / heartRateDataList.Count)} 次/分";
|
res.AvgHR = $"{(int)(heartRateDataList.Sum(x => x.Value) / heartRateDataList.Count)} 次/分";
|
||||||
res.Consumption = $"{Math.Abs(heartRateDataList.Sum(x => x.Consumption ?? 0) / heartRateDataList.Count)} 千卡";
|
res.Consumption = heartRateDataList.Count > 0 ? $"{Math.Abs(heartRateDataList.Sum(x => x.Consumption ?? 0) / heartRateDataList.Count)} 千卡" : "";
|
||||||
//res.Density = $"{(int)(heartRateDataList.Where(x => x.Strength > 50).Sum(x => x.Strength) / heartRateDataList.Count)} %";
|
//res.Density = $"{(int)(heartRateDataList.Where(x => x.Strength > 50).Sum(x => x.Strength) / heartRateDataList.Count)} %";
|
||||||
|
|
||||||
res.Density = $"{(int)Tool.CalculatePercentage(heartRateDataList.Count(x => x.Strength > 50), heartRateDataList.Count)} %";
|
res.Density = $"{(int)Tool.CalculatePercentage(heartRateDataList.Count(x => x.Strength > 50), heartRateDataList.Count)} %";
|
||||||
|
@ -50,7 +50,7 @@ namespace VOL.WebApi
|
|||||||
serverOptions.Limits.MaxRequestLineSize = 81920; // 8 KB
|
serverOptions.Limits.MaxRequestLineSize = 81920; // 8 KB
|
||||||
// Set properties and call methods on options
|
// Set properties and call methods on options
|
||||||
});
|
});
|
||||||
webBuilder.UseKestrel().UseUrls("http://*:9992");
|
webBuilder.UseKestrel().UseUrls("http://*:9993");
|
||||||
webBuilder.UseIIS();
|
webBuilder.UseIIS();
|
||||||
webBuilder.UseStartup<Startup>();
|
webBuilder.UseStartup<Startup>();
|
||||||
}).UseServiceProviderFactory(new AutofacServiceProviderFactory());
|
}).UseServiceProviderFactory(new AutofacServiceProviderFactory());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user