Browse Source

调整mock

datasub12_fetal_heart_rate_0
H Vs 7 months ago
parent
commit
1ef8cafa8c
2 changed files with 7 additions and 9 deletions
  1. +2
    -4
      HealthMonitor.Service/Biz/IotApiService.cs
  2. +5
    -5
      HealthMonitor.WebApi/Controllers/HealthMonitor/HmFetalController.cs

+ 2
- 4
HealthMonitor.Service/Biz/IotApiService.cs View File

@@ -341,8 +341,8 @@ namespace HealthMonitor.Service.Biz



public async Task<bool> SetFetalConfigMockAsync(string serialno, int modeStatus = 0, int maxValue = 0, int minValue = 0,
int highFreqSampleTimes=0,int highFreqSampleInterval=0,int stopHighFreqSampleCount=0,int triggerHighFreqHigh=0,int triggerHighFreqLow=0)
public async Task<bool> SetFetalConfigMockAsync(string serialno, int modeStatus = 0, int triggerHighFreqHigh = 0, int triggerHighFreqLow = 0,
int highFreqSampleTimes=0,int highFreqSampleInterval=0,int stopHighFreqSampleCount=0)
{
try
{
@@ -370,8 +370,6 @@ namespace HealthMonitor.Service.Biz
};

watchConfig["mode"] = modeStatus;
watchConfig["triggerHighFreqHigh"] = maxValue == 0 ? (int)watchConfig["triggerHighFreqHigh"]! : maxValue;
watchConfig["triggerHighFreqLow"] = minValue == 0 ? (int)watchConfig["triggerHighFreqLow"]! : minValue;
watchConfig["highFreqSampleTimes"]= highFreqSampleTimes == 0 ? (int)watchConfig["highFreqSampleTimes"]! : highFreqSampleTimes;
watchConfig["highFreqSampleInterval"] = highFreqSampleInterval == 0 ? (int)watchConfig["highFreqSampleInterval"]! : highFreqSampleInterval;
watchConfig["stopHighFreqSampleCount"] = stopHighFreqSampleCount == 0 ? (int)watchConfig["stopHighFreqSampleCount"]! : stopHighFreqSampleCount;


+ 5
- 5
HealthMonitor.WebApi/Controllers/HealthMonitor/HmFetalController.cs View File

@@ -74,7 +74,7 @@ namespace HealthMonitor.WebApi.Controllers.HealthMonitor
}

[HttpPost]
public async Task<object> SetMockMode2(string sn, int mockMax, int mockMin, int highFreqSampleTimes , int highFreqSampleInterval , int stopHighFreqSampleCount , int triggerHighFreqHigh , int triggerHighFreqLow,string remark = "mock")
public async Task<object> SetMockMode2(string sn, int highFreqSampleTimes , int highFreqSampleInterval , int stopHighFreqSampleCount , int triggerHighFreqHigh , int triggerHighFreqLow,string remark = "mock")
{
var res = await _serviceTDengine.GetBySerialNoAsync<PregnancyCommonHeartRateModel>(sn);
var pchr = res.FirstOrDefault();
@@ -83,15 +83,15 @@ namespace HealthMonitor.WebApi.Controllers.HealthMonitor
{
return "NULL";
}
pchr.MaxValue = mockMax;
pchr.MinValue = mockMin;
pchr.MaxValue = triggerHighFreqHigh;
pchr.MinValue = triggerHighFreqLow;
pchr.Remark = remark;
pchr.Timestamp = DateTime.Now;
pchr.SerialTailNumber = sn[^2..];

await _serviceTDengine.InsertAsync<PregnancyCommonHeartRateModel>("hm_pchr", pchr);
var flag = await _serviceIotApi.SetFetalConfigMockAsync(pchr.SerialNumber, 1, pchr.MaxValue, pchr.MinValue,
highFreqSampleTimes, highFreqSampleInterval, stopHighFreqSampleCount, triggerHighFreqHigh, triggerHighFreqLow);
var flag = await _serviceIotApi.SetFetalConfigMockAsync(pchr.SerialNumber, 1, triggerHighFreqHigh, triggerHighFreqLow,
highFreqSampleTimes, highFreqSampleInterval, stopHighFreqSampleCount);
return new
{
flag,


Loading…
Cancel
Save