You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BloodpressResolver.cs 22KB

1 anno fa
1 anno fa
1 anno fa
1 anno fa
1 anno fa
1 anno fa
1 anno fa
1 anno fa
1 anno fa
1 anno fa
1 anno fa
1 anno fa
1 anno fa
1 anno fa
1 anno fa
1 anno fa
1 anno fa
1 anno fa
1 anno fa
1 anno fa
1 anno fa
1 anno fa
1 anno fa
1 anno fa
1 anno fa
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  1. 
  2. using HealthMonitor.Common;
  3. using HealthMonitor.Common.helper;
  4. using HealthMonitor.Service.Biz.db;
  5. using HealthMonitor.Service.Cache;
  6. using HealthMonitor.Service.Etcd;
  7. using HealthMonitor.Service.Resolver.Interface;
  8. using HealthMonitor.Service.Sub;
  9. using HealthMonitor.Service.Sub.Topic.Model;
  10. using Microsoft.EntityFrameworkCore.Metadata;
  11. using Microsoft.Extensions.Logging;
  12. using Newtonsoft.Json;
  13. using System;
  14. using System.Collections.Generic;
  15. using System.Data.Common;
  16. using System.Linq;
  17. using System.Text;
  18. using System.Text.Json.Serialization;
  19. using System.Threading.Tasks;
  20. using TDengineTMQ;
  21. using TelpoDataService.Util.Entities.GpsCard;
  22. using TelpoDataService.Util;
  23. using TelpoDataService.Util.Entities.GpsLocationHistory;
  24. using HealthMonitor.Service.Biz;
  25. using HealthMonitor.Model.Service;
  26. namespace HealthMonitor.Service.Resolver
  27. {
  28. public class BloodpressResolver: IResolver
  29. {
  30. private readonly ILogger<BloodpressResolver> _logger;
  31. private readonly PersonCacheManager _personCacheMgr;
  32. private readonly TDengineService _serviceTDengine;
  33. private readonly BloodPressReferenceValueCacheManager _bpRefValCacheManager;
  34. private readonly HttpHelper _httpHelper = default!;
  35. private readonly GpsCardAccessorClient<GpsPerson> _gpsPersonApiClient;
  36. private readonly IotWebApiService _serviceIotWebApi;
  37. private readonly AsyncLocal<string> _messageId = new();
  38. private readonly AsyncLocal<HisGpsBloodPress> _msgData = new();
  39. private readonly EtcdService _serviceEtcd;
  40. public BloodpressResolver(
  41. TDengineService serviceDengine,
  42. BloodPressReferenceValueCacheManager bpRefValCacheManager,
  43. PersonCacheManager personCacheMgr, HttpHelper httpHelper,
  44. GpsCardAccessorClient<GpsPerson> gpsPersonApiClient,
  45. IotWebApiService iotWebApiService,
  46. EtcdService serviceEtcd,
  47. ILogger<BloodpressResolver> logger)
  48. {
  49. _httpHelper = httpHelper;
  50. _serviceTDengine = serviceDengine;
  51. _bpRefValCacheManager = bpRefValCacheManager;
  52. _gpsPersonApiClient = gpsPersonApiClient;
  53. _serviceIotWebApi = iotWebApiService;
  54. _logger = logger;
  55. _personCacheMgr = personCacheMgr;
  56. _serviceEtcd = serviceEtcd;
  57. }
  58. public void SetResolveInfo(PackageMsgModel msg)
  59. {
  60. var topicHmBloodPress = JsonConvert.DeserializeObject<TopicHmBloodPress>(msg.DetailData.ToString()!);
  61. _messageId.Value = msg.MessageId;
  62. _msgData.Value = new HisGpsBloodPress()
  63. {
  64. BloodPressId = topicHmBloodPress!.BloodPressId,
  65. MessageId = topicHmBloodPress!.MessageId,
  66. Serialno= topicHmBloodPress!.Serialno,
  67. SystolicValue = topicHmBloodPress!.SystolicValue,
  68. DiastolicValue= topicHmBloodPress!.DiastolicValue,
  69. LastUpdate= DateTimeUtil.GetDateTimeFromUnixTimeMilliseconds(SafeType.SafeInt64(topicHmBloodPress.LastUpdate) / 1000000),
  70. CreateTime= DateTimeUtil.GetDateTimeFromUnixTimeMilliseconds(SafeType.SafeInt64(topicHmBloodPress.CreateTime) / 1000000),
  71. Method= topicHmBloodPress!.Method,
  72. IsDisplay=topicHmBloodPress!.IsDisplay ? 1 : 0
  73. };
  74. }
  75. public override string ToString()
  76. {
  77. return $"{nameof(BloodpressResolver)}[{_messageId.Value}]";
  78. }
  79. public async Task ExecuteMessageAsync()
  80. {
  81. var messageId = _messageId.Value;
  82. var bp = _msgData.Value!;
  83. #region 获取个人信息
  84. var person = await _personCacheMgr.GetDeviceGpsPersonCacheBySerialNoAsync(bp.MessageId, bp.Serialno).ConfigureAwait(false);
  85. //验证这个信息是否存在
  86. if (person == null || person?.Person.BornDate == null)
  87. {
  88. _logger.LogWarning("验证个人信息,找不到个人信息,跳过此消息");
  89. return;
  90. }
  91. // 验证年龄是否在范围 (2 - 120)
  92. var age = SafeType.SafeInt(DateTime.Today.Year - person?.Person.BornDate!.Value.Year!);
  93. if (age < 1 || age > 120)
  94. {
  95. _logger.LogWarning("验证年龄,不在范围 (2 - 120)岁,跳过此消息");
  96. return;
  97. }
  98. #endregion
  99. var gender = person?.Person.Gender == true ? 1 : 2;
  100. var isHypertension = SafeType.SafeBool(person?.Person.Ishypertension!);
  101. var height = SafeType.SafeDouble(person?.Person.Height!);
  102. var weight = SafeType.SafeDouble(person?.Person.Weight!);
  103. #region 计算增量值
  104. var bpRef = await _bpRefValCacheManager.GetBloodPressReferenceValueAsync(age, gender, isHypertension);
  105. var last = await _serviceTDengine.GetLastAsync("stb_hm_bp_push_ref_inc_value", $"serialno='{bp.Serialno}' order by ts desc");
  106. //var ts = last?[0];
  107. var systolicRefValue = bpRef?.Systolic;//?
  108. var diastolicRefValue = bpRef?.Diastolic;//?
  109. long duration = 7 * 24 * 3600 * 1000;
  110. int systolicInc;
  111. int diastolicInc;
  112. string sql = string.Empty;
  113. var remarkFlag = false;
  114. // 曾经有下发记录
  115. if (last?.Count!=0)
  116. {
  117. if (DateTime.TryParse(last?[0]!.ToString(), out DateTime newTs))
  118. {
  119. systolicRefValue = (int)last?[2]!;
  120. diastolicRefValue = (int)last?[3]!;
  121. duration = SafeType.SafeInt64(((DateTime)bp.LastUpdate! - newTs).TotalMilliseconds);
  122. }
  123. }
  124. TimeSpan ts= TimeSpan.FromMilliseconds(duration);
  125. // 获取历史数据
  126. ////DateTime now = DateTime.Now;
  127. //DateTime now = (DateTime)bp.LastUpdate!; //测试
  128. //DateTime startTime = now.AddDays(-duration);
  129. //DateTime endTime = now;
  130. DateTime endTime = (DateTime)bp.LastUpdate!; //测试
  131. DateTime startTime = endTime-ts;
  132. // 如果hm_bp_config_manual_calibration存在数据,使用最新数据
  133. //
  134. var systolicAggregate = await _serviceTDengine.GetAggregateValueAsync("systolic_value", "stb_hm_bloodpress", $"ts>='{startTime:yyyy-MM-ddTHH:mm:ss.fffZ}' and ts <='{endTime:yyyy-MM-ddTHH:mm:ss.fffZ}' and serialno='{bp.Serialno}'");
  135. var diastolicAggregate = await _serviceTDengine.GetAggregateValueAsync("diastolic_value", "stb_hm_bloodpress", $"ts>='{startTime:yyyy-MM-ddTHH:mm:ss.fffZ}' and ts <='{endTime:yyyy-MM-ddTHH:mm:ss.fffZ}' and serialno='{bp.Serialno}'");
  136. //var systolicAggregate = _serviceTDengine.GetAggregateValue("systolic_value", "hm_bloodpress", $"ts>='{startTime:yyyy-MM-ddTHH:mm:ss.fffZ}' and ts <='{endTime:yyyy-MM-ddTHH:mm:ss.fffZ}' and serialno='{bp.Serialno}'");
  137. //var diastolicAggregate = _serviceTDengine.GetAggregateValue("diastolic_value", "hm_bloodpress", $"ts>='{startTime:yyyy-MM-ddTHH:mm:ss.fffZ}' and ts <='{endTime:yyyy-MM-ddTHH:mm:ss.fffZ}' and serialno='{bp.Serialno}'");
  138. // 最大值
  139. var systolicMax = systolicAggregate.Max;
  140. var diastolicMax = diastolicAggregate.Max;
  141. // 最小值
  142. var systolicMin = systolicAggregate.Min;
  143. var diastolicMin = diastolicAggregate.Min;
  144. // 偏移参数
  145. var avgOffset = 0.25M;
  146. var systolicAvgOffset = avgOffset;
  147. var diastolicAvgOffset = avgOffset;
  148. // 计算去除最大值和最小值和异常值的平均值
  149. var systolicAvg = await _serviceTDengine.GetAvgExceptMaxMinValueAsync("systolic_value", "stb_hm_bloodpress", $"ts>='{startTime:yyyy-MM-ddTHH:mm:ss.fffZ}' and ts <='{endTime:yyyy-MM-ddTHH:mm:ss.fffZ}' and serialno='{bp.Serialno}' and systolic_value < {systolicRefValue} ");
  150. var diastolicAvg = await _serviceTDengine.GetAvgExceptMaxMinValueAsync("diastolic_value", "stb_hm_bloodpress", $"ts>='{startTime:yyyy-MM-ddTHH:mm:ss.fffZ}' and ts <='{endTime:yyyy-MM-ddTHH:mm:ss.fffZ}' and serialno='{bp.Serialno}' and diastolic_value < {diastolicRefValue}");
  151. if (systolicAvg.Equals(0) || diastolicAvg.Equals(0))
  152. {
  153. _logger.LogWarning("平均值为0不保存");
  154. systolicAvg = bp.SystolicValue;
  155. diastolicAvg = bp.DiastolicValue;
  156. systolicInc = (int)((systolicRefValue - systolicAvg) * systolicAvgOffset)! > 0? (int)((systolicRefValue - systolicAvg) * systolicAvgOffset)!:0;
  157. diastolicInc = (int)((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)! >0? (int)((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)!:0;
  158. // 初始化 remark
  159. remarkFlag = await _serviceIotWebApi.UpdatePersonRemarksAsync(bp.Serialno, (int)systolicRefValue!, (int)diastolicRefValue!, systolicInc, diastolicInc).ConfigureAwait(false);
  160. if (remarkFlag)
  161. {
  162. // 下推
  163. BloodPressCalibrationConfigModel bpIncData = new()
  164. {
  165. Imei = bp.Serialno,
  166. SystolicRefValue = (int)systolicRefValue!, //收缩压标定值,值为0 表示不生效
  167. DiastolicRefValue = (int)diastolicRefValue!, //舒张压标定值,值为0表示不生效
  168. SystolicIncValue = systolicInc, //收缩压显示增量,值为0 表示不生效
  169. DiastolicIncValue = diastolicInc //舒张压显示增量,值为0 表示不生效
  170. };
  171. // 下发 IOT 增量值
  172. var flagIot = await _serviceIotWebApi.SetBloodPressCalibrationConfigAsync(bpIncData).ConfigureAwait(false);
  173. if (flagIot)
  174. {
  175. #region 保存下推记录 stb_hm_bp_push_ref_inc_value
  176. sql = $"INSERT INTO health_monitor.hm_bp_push_ref_inc_value_{bp.Serialno.Substring(bp.Serialno.Length - 2)} " +
  177. $"USING health_monitor.stb_hm_bp_push_ref_inc_value " +
  178. $"TAGS ('{bp.Serialno.Substring(bp.Serialno.Length - 2)}') " +
  179. $"VALUES(" +
  180. $"'{DateTime.Now:yyyy-MM-dd HH:mm:ss.fff}'," +
  181. $"'{bp.Serialno}'," +
  182. $"{systolicRefValue}," +
  183. $"{diastolicRefValue}," +
  184. $"{systolicInc}," +
  185. $"{diastolicInc}," +
  186. $"{true})";
  187. _serviceTDengine.ExecuteInsertSQL(sql);
  188. #endregion
  189. }
  190. }
  191. return;
  192. }
  193. //var systolicAvg = _serviceTDengine.GetAvgExceptMaxMinValue("systolic_value", "hm_bloodpress", $"ts>='{startTime:yyyy-MM-ddTHH:mm:ss.fffZ}' and ts <='{endTime:yyyy-MM-ddTHH:mm:ss.fffZ}' and serialno='{bp.Serialno}' and systolic_value < {systolicRefValue} ");
  194. //var diastolicAvg = _serviceTDengine.GetAvgExceptMaxMinValue("diastolic_value", "hm_bloodpress", $"ts>='{startTime:yyyy-MM-ddTHH:mm:ss.fffZ}' and ts <='{endTime:yyyy-MM-ddTHH:mm:ss.fffZ}' and serialno='{bp.Serialno}' and diastolic_value < {diastolicRefValue}");
  195. // 增量值=(标定值-平均值)* 0.25
  196. systolicInc = systolicAvg.Equals(0M) ? 0 : (int)((systolicRefValue - systolicAvg) * systolicAvgOffset)!;
  197. diastolicInc = diastolicAvg.Equals(0M) ? 0 : (int)((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)!;
  198. #endregion
  199. #region 插入BP增量值 hm_bloodpress_stats_inc
  200. // 自动建表
  201. sql = $"INSERT INTO health_monitor.hm_bp_stats_inc_{bp.Serialno.Substring(bp.Serialno.Length - 2)} " +
  202. $"USING health_monitor.stb_hm_bloodpress_stats_inc " +
  203. $"TAGS ('{bp.Serialno.Substring(bp.Serialno.Length - 2)}') " +
  204. $"VALUES(" +
  205. $"'{bp.LastUpdate:yyyy-MM-dd HH:mm:ss.fff}'," +
  206. $"'{bp.BloodPressId}'," +
  207. $"'{bp.MessageId}'," +
  208. $"'{bp.Serialno}'," +
  209. $"{bp.SystolicValue}," +
  210. $"{systolicRefValue}," +
  211. $"{systolicAvg}," +
  212. $"{systolicMax}," +
  213. $"{systolicMin}," +
  214. $"{systolicAvgOffset}," +
  215. $"{systolicInc}," +
  216. $"{bp.DiastolicValue}," +
  217. $"{diastolicRefValue}," +
  218. $"{diastolicAvg}," +
  219. $"{diastolicMax}," +
  220. $"{diastolicMin}," +
  221. $"{diastolicAvgOffset}," +
  222. $"{diastolicInc}," +
  223. $"{gender}," +
  224. $"{age}," +
  225. $"{height}," +
  226. $"{weight}," +
  227. $"'{bp.LastUpdate:yyyy-MM-dd HH:mm:ss.fff}'," +
  228. $"{duration}," +
  229. $"'{startTime:yyyy-MM-dd HH:mm:ss.fff}'," +
  230. $"'{endTime:yyyy-MM-dd HH:mm:ss.fff}'," +
  231. $"'{string.Empty}'," +
  232. $"{isHypertension})";
  233. _serviceTDengine.ExecuteInsertSQL(sql);
  234. // 发送到 设置设备血压标定参数
  235. #endregion
  236. // 初始化 remark
  237. remarkFlag = await _serviceIotWebApi.UpdatePersonRemarksAsync(bp.Serialno, (int)systolicRefValue!, (int)diastolicRefValue!, systolicInc, diastolicInc).ConfigureAwait(false);
  238. if (remarkFlag)
  239. {
  240. // 下推
  241. BloodPressCalibrationConfigModel bpIncData = new()
  242. {
  243. Imei = bp.Serialno,
  244. SystolicRefValue = (int)systolicRefValue!, //收缩压标定值,值为0 表示不生效
  245. DiastolicRefValue = (int)diastolicRefValue!, //舒张压标定值,值为0表示不生效
  246. SystolicIncValue = systolicInc, //收缩压显示增量,值为0 表示不生效
  247. DiastolicIncValue = diastolicInc //舒张压显示增量,值为0 表示不生效
  248. };
  249. // 下发 IOT 增量值
  250. var flagIot = await _serviceIotWebApi.SetBloodPressCalibrationConfigAsync(bpIncData).ConfigureAwait(false);
  251. if (flagIot)
  252. {
  253. #region 保存下推记录 stb_hm_bp_push_ref_inc_value
  254. sql = $"INSERT INTO health_monitor.hm_bp_push_ref_inc_value_{bp.Serialno.Substring(bp.Serialno.Length - 2)} " +
  255. $"USING health_monitor.stb_hm_bp_push_ref_inc_value " +
  256. $"TAGS ('{bp.Serialno.Substring(bp.Serialno.Length - 2)}') " +
  257. $"VALUES(" +
  258. $"'{DateTime.Now:yyyy-MM-dd HH:mm:ss.fff}'," +
  259. $"'{bp.Serialno}'," +
  260. $"{systolicRefValue}," +
  261. $"{diastolicRefValue}," +
  262. $"{systolicInc}," +
  263. $"{diastolicInc}," +
  264. $"{true})";
  265. _serviceTDengine.ExecuteInsertSQL(sql);
  266. #endregion
  267. }
  268. }
  269. // 注册定时下发事件
  270. // 获取当前时间
  271. //DateTime sNow = DateTime.Now;
  272. //// 计算距离明天12点的时间间隔
  273. //TimeSpan timeUntil = new DateTime(sNow.Year, sNow.Month, sNow.Day, 12, 0, 0) - sNow;
  274. //// 如果当前时间已经超过了12点,将等待到明天
  275. //if (timeUntil < TimeSpan.Zero)
  276. //{
  277. // timeUntil = timeUntil.Add(TimeSpan.FromHours(24));
  278. //}
  279. //var data = new
  280. //{
  281. // imei = bp.Serialno,
  282. // systolicCalibrationValue = systolicRefValue, //收缩压标定值,值为0 表示不生效
  283. // diastolicCalibrationValue = diastolicRefValue, //舒张压标定值,值为0表示不生效
  284. // systolicIncValue = systolicInc, //收缩压显示增量,值为0 表示不生效
  285. // diastolicIncValue = diastolicInc //舒张压显示增量,值为0 表示不生效
  286. //};
  287. //var url = $"http://id.ssjlai.com/webapi/api/Command/SetBloodPressCalibrationConfig";
  288. //List<KeyValuePair<string, string>> headers = new()
  289. //{
  290. // new KeyValuePair<string, string>("AuthKey", "key1")
  291. //};
  292. //var data = new
  293. //{
  294. // imei = bp.Serialno,
  295. // systolicCalibrationValue = systolicRefValue, //收缩压标定值,值为0 表示不生效
  296. // diastolicCalibrationValue = diastolicRefValue, //舒张压标定值,值为0表示不生效
  297. // systolicIncValue = systolicInc, //收缩压显示增量,值为0 表示不生效
  298. // diastolicIncValue = diastolicInc //舒张压显示增量,值为0 表示不生效
  299. //};
  300. //var result = JsonConvert.SerializeObject(data);
  301. //var result = bp.Serialno;
  302. var key = $"health_moniter/schedule_push/imei/{bp.Serialno}";
  303. var schedule_push = await _serviceEtcd.GetValAsync(key).ConfigureAwait(false);
  304. if (string.IsNullOrWhiteSpace(schedule_push))
  305. {
  306. // 注册首次下推
  307. #if DEBUG
  308. // await _serviceEtcd.PutValAsync(key, result, 60*1, false).ConfigureAwait(false);
  309. var interval = 0;
  310. // 获取当前时间
  311. DateTime now = DateTime.Now;
  312. // 计算距离下一个$interval天后的8点的时间间隔
  313. DateTime nextRunTime = new DateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute+1, 58).AddDays(interval);
  314. TimeSpan timeUntilNextRun = nextRunTime - now;
  315. // 如果当前时间已经超过了8点,将等待到明天后的8点
  316. if (timeUntilNextRun < TimeSpan.Zero)
  317. {
  318. timeUntilNextRun = timeUntilNextRun.Add(TimeSpan.FromMinutes(1));
  319. nextRunTime += timeUntilNextRun;
  320. }
  321. var ttl = (long)timeUntilNextRun.TotalSeconds;
  322. var data = new
  323. {
  324. imei = bp.Serialno,
  325. create_time = now.ToString("yyyy-MM-dd HH:mm:ss"),
  326. ttl,
  327. next_run_time= nextRunTime.ToString("yyyy-MM-dd HH:mm:ss")
  328. };
  329. var result=JsonConvert.SerializeObject(data);
  330. await _serviceEtcd.PutValAsync(key, result, ttl, false).ConfigureAwait(false);
  331. #else
  332. //DateTime sNow = DateTime.Now;
  333. //// 计算距离19:59:55点的时间间隔
  334. //TimeSpan timeUntil = new DateTime(sNow.Year, sNow.Month, sNow.Day, 19, 59, 55) - sNow;
  335. //// 如果当前时间已经超过了12点,将等待到明天
  336. //if (timeUntil < TimeSpan.Zero)
  337. //{
  338. // timeUntil = timeUntil.Add(TimeSpan.FromHours(24));
  339. //}
  340. //var ttl = (long)timeUntil.TotalSeconds;
  341. var interval = 0;
  342. // 获取当前时间
  343. DateTime now = DateTime.Now;
  344. // 计算距离下一个$interval天后的8点的时间间隔
  345. DateTime nextRunTime = new DateTime(now.Year, now.Month, now.Day, 19, 59, 58).AddDays(interval);
  346. TimeSpan timeUntilNextRun = nextRunTime - now;
  347. // 如果当前时间已经超过了8点,将等待到明天后的8点
  348. if (timeUntilNextRun < TimeSpan.Zero)
  349. {
  350. timeUntilNextRun = timeUntilNextRun.Add(TimeSpan.FromDays(1));
  351. nextRunTime += timeUntilNextRun;
  352. }
  353. var ttl =(long)timeUntilNextRun.TotalSeconds;
  354. var data = new
  355. {
  356. imei = bp.Serialno,
  357. create_time = now.ToString("yyyy-MM-dd HH:mm:ss"),
  358. ttl,
  359. next_run_time = nextRunTime.ToString("yyyy-MM-dd HH:mm:ss")
  360. };
  361. var result = JsonConvert.SerializeObject(data);
  362. await _serviceEtcd.PutValAsync(key, result,ttl, false).ConfigureAwait(false);
  363. #endif
  364. }
  365. //// 生效
  366. //if (DateTime.Now.Hour == 1)
  367. //{
  368. // var data = new
  369. // {
  370. // imei = bp.Serialno,
  371. // systolicCalibrationValue = systolicRefValue, //收缩压标定值,值为0 表示不生效
  372. // diastolicCalibrationValue = diastolicRefValue, //舒张压标定值,值为0表示不生效
  373. // systolicIncValue = systolicInc, //收缩压显示增量,值为0 表示不生效
  374. // diastolicIncValue = diastolicInc //舒张压显示增量,值为0 表示不生效
  375. // };
  376. // var result = await _httpHelper.HttpToPostAsync(url, data, headers).ConfigureAwait(false);
  377. // _logger.LogInformation($"将 {JsonConvert.SerializeObject(data)}发送到 {url} 并且返回 {JsonConvert.SerializeObject(result)}");
  378. //}
  379. //// 不生效
  380. //else if (DateTime.Now.Hour == 3)
  381. //{
  382. // var data = new
  383. // {
  384. // imei = bp.Serialno,
  385. // systolicCalibrationValue = 0, //收缩压标定值,值为0 表示不生效
  386. // diastolicCalibrationValue = 0, //舒张压标定值,值为0表示不生效
  387. // systolicIncValue = 0, //收缩压显示增量,值为0 表示不生效
  388. // diastolicIncValue = 0 //舒张压显示增量,值为0 表示不生效
  389. // };
  390. // var result = await _httpHelper.HttpToPostAsync(url, data, headers).ConfigureAwait(false);
  391. // _logger.LogInformation($"将 {JsonConvert.SerializeObject(data)}发送到 {url} 并且返回 {JsonConvert.SerializeObject(result)}");
  392. //}
  393. }
  394. }
  395. }