From f0d91419973f404d8f755b6e32834eb418c3a41d Mon Sep 17 00:00:00 2001 From: H Vs Date: Wed, 22 Nov 2023 09:29:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HealthMonitor.Service/Biz/IotWebApiService.cs | 16 +++++++--------- .../Resolver/BloodpressResolver.cs | 1 + 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/HealthMonitor.Service/Biz/IotWebApiService.cs b/HealthMonitor.Service/Biz/IotWebApiService.cs index 5c07cb3..dc6cf19 100644 --- a/HealthMonitor.Service/Biz/IotWebApiService.cs +++ b/HealthMonitor.Service/Biz/IotWebApiService.cs @@ -281,10 +281,12 @@ namespace HealthMonitor.Service.Biz { // 保证实时性,先更新缓存,再更新数据库 var personCache = await _personCacheMgr.GetDeviceGpsPersonCacheObjectBySerialNoAsync(new Guid().ToString(), imei).ConfigureAwait(false); - if (personCache != null - && - string.IsNullOrWhiteSpace(personCache["person"]!["remarks"]!.ToString()) - ) + + if (personCache == null) + { + _logger.LogInformation($"Person remarks数据异常,检查缓存和数据库"); + } + else if (string.IsNullOrWhiteSpace(personCache["person"]!["remarks"]!.ToString())) { var newRemarkData = new { @@ -323,7 +325,7 @@ namespace HealthMonitor.Service.Biz person!.Remarks = newRemarkStr; await _gpsPersonApiClient.UpdateAsync(person, new RequestHeader() { RequestId = $"{imei}" }).ConfigureAwait(false); _logger.LogInformation($"更新Person remarks字段|{person.Remarks}"); - + } else { @@ -332,10 +334,6 @@ namespace HealthMonitor.Service.Biz } flag = cacheFlag; } - else if (personCache == null) - { - _logger.LogInformation($"Person remarks数据异常,检查缓存和数据库"); - } } catch (Exception ex) { diff --git a/HealthMonitor.Service/Resolver/BloodpressResolver.cs b/HealthMonitor.Service/Resolver/BloodpressResolver.cs index 7f6481f..50ffcad 100644 --- a/HealthMonitor.Service/Resolver/BloodpressResolver.cs +++ b/HealthMonitor.Service/Resolver/BloodpressResolver.cs @@ -309,6 +309,7 @@ namespace HealthMonitor.Service.Resolver }; // 下发 IOT 增量值 var flagIot = await _serviceIotWebApi.SetBloodPressCalibrationConfigAsync(bpIncData).ConfigureAwait(false); + if (flagIot) { #region 保存下推记录 stb_hm_bp_push_ref_inc_value