Преглед изворни кода

调整edoc

datasub12_fetal_heart_rate_0
H Vs пре 3 месеци
родитељ
комит
0f33ee46b4
3 измењених фајлова са 31 додато и 23 уклоњено
  1. +23
    -17
      HealthMonitor.Service/Biz/IotApiService.cs
  2. +5
    -4
      HealthMonitor.Service/Biz/db/TDengineService.cs
  3. +3
    -2
      HealthMonitor.WebApi/Worker.cs

+ 23
- 17
HealthMonitor.Service/Biz/IotApiService.cs Прегледај датотеку

@@ -295,23 +295,29 @@ namespace HealthMonitor.Service.Biz
};


var data = new
{
imeis = new string[] { serialno },
enabled = (int)watchConfig["enabled"]!,
interval= (int)watchConfig["interval"]!,
triggerHighFreqHigh = maxValue == 0 ? (int)watchConfig["triggerHighFreqHigh"]! : maxValue,
triggerHighFreqLow = minValue == 0 ? (int)watchConfig["triggerHighFreqLow"]! : minValue,
highFreqSampleTimes = (int)watchConfig["highFreqSampleTimes"]!,
highFreqSampleInterval = (int)watchConfig["highFreqSampleInterval"]!,
stopHighFreqSampleCount = (int)watchConfig["stopHighFreqSampleCount"]!,
mode = modeStatus,
edoc = watchConfig["EDOC"]!,
vibrateEnabled = (int)watchConfig["vibrateEnabled"]!,
lcdEnabled = (int)watchConfig["lcdEnabled"]!,
upperAlarmThreshold = (int)watchConfig["upperAlarmThreshold"]!,
lowerAlarmThreshold = (int)watchConfig["lowerAlarmThreshold"]!
};
//var data = new
//{
// imeis = new string[] { serialno },
// enabled = (int)watchConfig["enabled"]!,
// interval= (int)watchConfig["interval"]!,
// triggerHighFreqHigh = maxValue == 0 ? (int)watchConfig["triggerHighFreqHigh"]! : maxValue,
// triggerHighFreqLow = minValue == 0 ? (int)watchConfig["triggerHighFreqLow"]! : minValue,
// highFreqSampleTimes = (int)watchConfig["highFreqSampleTimes"]!,
// highFreqSampleInterval = (int)watchConfig["highFreqSampleInterval"]!,
// stopHighFreqSampleCount = (int)watchConfig["stopHighFreqSampleCount"]!,
// mode = modeStatus,
// edoc = watchConfig["EDOC"]!,
// vibrateEnabled = (int)watchConfig["vibrateEnabled"]!,
// lcdEnabled = (int)watchConfig["lcdEnabled"]!,
// upperAlarmThreshold = (int)watchConfig["upperAlarmThreshold"]!,
// lowerAlarmThreshold = (int)watchConfig["lowerAlarmThreshold"]!
//};
watchConfig["mode"] = modeStatus;
watchConfig["triggerHighFreqHigh"] = maxValue == 0 ? (int)watchConfig["triggerHighFreqHigh"]! : maxValue;
watchConfig["triggerHighFreqLow"] = minValue == 0 ? (int)watchConfig["triggerHighFreqLow"]! : minValue;

var data = watchConfig;

var setUrl = $"{_configService.IotCore}/SetFetalConfig";
_logger.LogInformation($"{setUrl} 请求 {JsonConvert.SerializeObject(JsonConvert.SerializeObject(data))}");
var res = await _httpHelper.HttpToPostAsync(setUrl, data, headers).ConfigureAwait(false);


+ 5
- 4
HealthMonitor.Service/Biz/db/TDengineService.cs Прегледај датотеку

@@ -972,12 +972,13 @@ namespace HealthMonitor.Service.Biz.db
{
return null;
}
long.TryParse(watchConfig["EDOC"]!.ToString(), out long edoc);
// long.TryParse(watchConfig["EDOC"]!.ToString(), out long edoc);
// "EDOC": "1720860180652",当前时间 - (EDOC - 280) days =怀孕时间
edoc = edoc.ToString().Length == 10 ? edoc * 1000 : edoc;
int pregnancyWeek = (DateTime.Now-DateTimeUtil.GetDateTimeFromUnixTimeMilliseconds(edoc).AddDays(-280)).Days / 7;
//edoc = edoc.ToString().Length == 10 ? edoc * 1000 : edoc;
var edoc = DateTimeUtil.ToDateTime(watchConfig["EDOC"]!.ToString());
int pregnancyWeek = (DateTime.Now- edoc.AddDays(-280)).Days / 7;

_logger.LogInformation($"IMEI {serialNo},EDOC:{edoc},NOW:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")},SinceNOW:{DateTimeUtil.GetDateTimeFromUnixTimeMilliseconds(edoc).AddDays(-280).ToString("yyyy-MM-dd HH:mm:ss")},怀孕周数 {pregnancyWeek}");
_logger.LogInformation($"IMEI {serialNo},EDOC:{edoc},NOW:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")},SinceNOW:{edoc.AddDays(-280).ToString("yyyy-MM-dd HH:mm:ss")},怀孕周数 {pregnancyWeek}");

float statMaxValueFprCoefficient = 0f;
float statMinValueFprCoefficient = 0f;


+ 3
- 2
HealthMonitor.WebApi/Worker.cs Прегледај датотеку

@@ -351,9 +351,10 @@ namespace HealthMonitor.WebApi
//在餐后时间段(8:00~10:00,12:00~14:00,18:00~20:00,22:00~24:00)取中间值。其他时间段取正常起始值
bool isInTimeRanges = IsNowInTimeRanges();

long.TryParse(watchConfig!["EDOC"]!.ToString(), out long edoc);
//long.TryParse(watchConfig!["EDOC"]!.ToString(), out long edoc);
var edoc = DateTimeUtil.ToDateTime(watchConfig!["EDOC"]!.ToString());

int pregnancyWeeks = (DateTime.Now - DateTimeUtil.GetDateTimeFromUnixTimeMilliseconds(edoc).AddDays(-280)).Days / 7;
int pregnancyWeeks = (DateTime.Now -edoc.AddDays(-280)).Days / 7;
if (pregnancyWeeks >= 12 && pregnancyWeeks <= 50)
{
var fetalMovementMap = _mgrFetalMovementNormalValueRangeCache.GetFetalMovements();


Loading…
Откажи
Сачувај