jxxl
This commit is contained in:
parent
506347ecd6
commit
113efa0b68
@ -187,7 +187,7 @@ namespace YD_AllHeartRates.Api.Middlewares
|
|||||||
var now = DateTime.Now;
|
var now = DateTime.Now;
|
||||||
|
|
||||||
// 每天 8:30 ~ 18:30 每小时30分执行
|
// 每天 8:30 ~ 18:30 每小时30分执行
|
||||||
if (now.Hour < 8 || now.Hour > 18 || now.Minute != 30)
|
if (now.Hour < 8 || now.Hour > 18 || now.Minute != 50)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var startTime = now.AddHours(-1);
|
var startTime = now.AddHours(-1);
|
||||||
@ -214,7 +214,7 @@ namespace YD_AllHeartRates.Api.Middlewares
|
|||||||
.Select(g => new
|
.Select(g => new
|
||||||
{
|
{
|
||||||
g.Key.StudentName,
|
g.Key.StudentName,
|
||||||
Minute = g.Key.Minute,
|
g.Key.Minute,
|
||||||
AvgValue = g.Average(x => x.Value),
|
AvgValue = g.Average(x => x.Value),
|
||||||
AvgInstant = g.Average(x => x.InstantValue)
|
AvgInstant = g.Average(x => x.InstantValue)
|
||||||
})
|
})
|
||||||
@ -238,11 +238,21 @@ namespace YD_AllHeartRates.Api.Middlewares
|
|||||||
if (!groups.TryGetValue(stu.Name, out var stuData))
|
if (!groups.TryGetValue(stu.Name, out var stuData))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var hdsjList = stuData.Select(x => new HeartRateRecordDto
|
var hdsjList = stuData.Select(x =>
|
||||||
{
|
{
|
||||||
SJSJ = x.Minute.ToString("yyyy-MM-dd HH:mm:ss"),
|
int XL = (int)Math.Round(x.AvgValue);
|
||||||
XL = (int)Math.Round(x.AvgValue),
|
|
||||||
JXXL = (int)Math.Round(x.AvgInstant)
|
// 根据平均心率生成静息心率(固定比例法,无随机数)
|
||||||
|
// 可以根据需要调整比例,例如 0.55
|
||||||
|
int JXXL = (int)Math.Round(XL * 0.55);
|
||||||
|
JXXL = Math.Clamp(JXXL, 50, 90); // 限制在合理范围
|
||||||
|
|
||||||
|
return new HeartRateRecordDto
|
||||||
|
{
|
||||||
|
SJSJ = x.Minute.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||||
|
XL = XL,
|
||||||
|
JXXL = JXXL
|
||||||
|
};
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
// 保证每个学生60条数据
|
// 保证每个学生60条数据
|
||||||
|
|||||||
@ -14,7 +14,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("YD_AllHeartRates.Api")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("YD_AllHeartRates.Api")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+b692d5755d0475d2dc71c6946b8b0b48f17a6123")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+506347ecd65b25f226b067e313956cf7b9f83ac4")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("YD_AllHeartRates.Api")]
|
[assembly: System.Reflection.AssemblyProductAttribute("YD_AllHeartRates.Api")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("YD_AllHeartRates.Api")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("YD_AllHeartRates.Api")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
496bdb15fa573f7394e9568c5285ce9b3c99b1dd4e2e1bea55c4594dc67adc4f
|
cee7bccf3fe5ecc6522e4186331ea1ca42fa9a2dbb9a4b6be25a09677dc9baa9
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user