From a6f02e8fd433c520353c40c29af8be75f0863713 Mon Sep 17 00:00:00 2001 From: H Vs Date: Fri, 16 Aug 2024 18:29:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=B8=B8=E8=A7=84=E5=AD=95?= =?UTF-8?q?=E5=A6=87=E5=BF=83=E7=8E=87=E7=BB=9F=E8=AE=A1=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HealthMonitor.WebApi/Worker.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/HealthMonitor.WebApi/Worker.cs b/HealthMonitor.WebApi/Worker.cs index 4b7f2f7..53b7666 100644 --- a/HealthMonitor.WebApi/Worker.cs +++ b/HealthMonitor.WebApi/Worker.cs @@ -1003,6 +1003,10 @@ namespace HealthMonitor.WebApi // 获取当前时间 DateTime nowInterval = (DateTime)heartRate.LastUpdate!; + if (nowInterval.Second > 0) + { + nowInterval = nowInterval.AddMinutes(1); + } // 计算last_update到上一间隔的分钟数 int minutesToSubtract = nowInterval.Minute % intervalFHR; @@ -1031,14 +1035,14 @@ namespace HealthMonitor.WebApi var normalPhrStatEndTime = nextInterval; - _logger.LogInformation($"{heartRate.Serialno} 计算胎心数据, 周期:{normalPhrStatStartTime}-{normalPhrStatEndTime} "); + _logger.LogInformation($" {heartRate.MessageId} -- {heartRate.Serialno} 计算胎心数据, 周期:{normalPhrStatStartTime}-{normalPhrStatEndTime} "); var filteredPhr = daysPhr // 使用 last_update 下一刻 .Where(i => i.LastUpdate <= normalPhrStatEndTime && i.LastUpdate >= normalPhrStatStartTime) .ToList(); if (filteredPhr.Count == 0) { - _logger.LogWarning($"{heartRate.Serialno} 周期:{normalPhrStatStartTime}-{normalPhrStatEndTime} 孕妇心率数据不足,{filteredPhr.Count}条记录"); + _logger.LogWarning($"{heartRate.MessageId} -- {heartRate.Serialno} 周期:{normalPhrStatStartTime}-{normalPhrStatEndTime} 孕妇心率数据不足,{filteredPhr.Count}条记录"); return; } var phrValue = filteredPhr.Count == 1