|
|
@@ -3,6 +3,7 @@ using HealthMonitor.Model.Cache; |
|
|
|
using HealthMonitor.Model.Config; |
|
|
|
using Microsoft.Extensions.Logging; |
|
|
|
using Microsoft.Extensions.Options; |
|
|
|
using Newtonsoft.Json; |
|
|
|
using Newtonsoft.Json.Linq; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
@@ -123,14 +124,14 @@ namespace HealthMonitor.Service.Cache |
|
|
|
/// <param name="messageId"></param> |
|
|
|
/// <param name="sn"></param> |
|
|
|
/// <returns></returns> |
|
|
|
public async Task<JToken?> GetDeviceGpsPersonCacheObjectBySerialNoAsync(string messageId, string sn) |
|
|
|
public async Task<JObject?> GetDeviceGpsPersonCacheObjectBySerialNoAsync(string messageId, string sn) |
|
|
|
{ |
|
|
|
if (string.IsNullOrWhiteSpace(sn)) return null; |
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
|
var person = await RedisHelperDb7.HGetAsync(CACHE_HASH_KEY_GPSDEVICEPERSON, sn).ConfigureAwait(false); |
|
|
|
return person; |
|
|
|
return (JObject?)JsonConvert.DeserializeObject(person); |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
@@ -146,7 +147,7 @@ namespace HealthMonitor.Service.Cache |
|
|
|
/// <param name="person"></param> |
|
|
|
/// <param name="sn"></param> |
|
|
|
/// <returns></returns> |
|
|
|
public async Task<bool> UpdateDeviceGpsPersonCacheObjectBySerialNoAsync(JToken person, string sn) |
|
|
|
public async Task<bool> UpdateDeviceGpsPersonCacheObjectBySerialNoAsync(JObject person, string sn) |
|
|
|
{ |
|
|
|
var flag = false; |
|
|
|
if (string.IsNullOrWhiteSpace(sn)) return flag; |
|
|
|