felix 1 жил өмнө
parent
commit
a9c568b615

+ 183 - 127
Vinno.vCloud.Common.FIS/Helper/JsonRpcHelper.cs

@@ -2,6 +2,7 @@
 using System;
 using System.Collections.Generic;
 using System.Net.Http;
+using System.Text.Json;
 using Vinno.IUS.Common.Log;
 using Vinno.vCloud.Common.FIS.Remedicals;
 using WingInterfaceLibrary.DTO.Device;
@@ -31,6 +32,8 @@ namespace Vinno.vCloud.Common.FIS.Helper
 {
     internal static class JsonRpcHelper
     {
+        #region IConnectService
+
         internal static ConnectResultInfo Connect(IConnectService connectService, ConnectRequest connectRequest)
         {
             try
@@ -101,6 +104,10 @@ namespace Vinno.vCloud.Common.FIS.Helper
             return false;
         }
 
+        #endregion IConnectService
+
+        #region IDeviceService
+
         internal static DeviceServerSettingResult QueryServerConfig(IDeviceService deviceService, TokenRequest tokenRequest)
         {
             try
@@ -122,6 +129,7 @@ namespace Vinno.vCloud.Common.FIS.Helper
         {
             try
             {
+                Logger.WriteLineInfo($"IDeviceService ReportLiveStateAsync:{JsonSerializer.Serialize(reportLiveStateRequest)}");
                 return deviceService.ReportLiveStateAsync(reportLiveStateRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
@@ -139,6 +147,7 @@ namespace Vinno.vCloud.Common.FIS.Helper
         {
             try
             {
+                Logger.WriteLineInfo($"IDeviceService CreateLiveRoomInfoAsync:{JsonSerializer.Serialize(createLiveRoomInfoRequest)}");
                 return deviceService.CreateLiveRoomInfoAsync(createLiveRoomInfoRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
@@ -173,6 +182,7 @@ namespace Vinno.vCloud.Common.FIS.Helper
         {
             try
             {
+                Logger.WriteLineInfo($"IDeviceService GetModelsAsync:{JsonSerializer.Serialize(getModelsRequest)}");
                 return deviceService.GetModelsAsync(getModelsRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
@@ -190,6 +200,7 @@ namespace Vinno.vCloud.Common.FIS.Helper
         {
             try
             {
+                Logger.WriteLineInfo($"IDeviceService SyncBrandModelOutputConfigAsync:{JsonSerializer.Serialize(syncBrandModelOutputConfigRequest)}");
                 return deviceService.SyncBrandModelOutputConfigAsync(syncBrandModelOutputConfigRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
@@ -207,6 +218,7 @@ namespace Vinno.vCloud.Common.FIS.Helper
         {
             try
             {
+                Logger.WriteLineInfo($"IDeviceService ReportVideoDeviceInfoAsync:{JsonSerializer.Serialize(reportVideoDeviceInfoRequest)}");
                 return deviceService.ReportVideoDeviceInfoAsync(reportVideoDeviceInfoRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
@@ -224,6 +236,7 @@ namespace Vinno.vCloud.Common.FIS.Helper
         {
             try
             {
+                Logger.WriteLineInfo($"IDeviceService SendControlParameterByDeviceAsync:{JsonSerializer.Serialize(sendControlParameterByDeviceRequest)}");
                 return deviceService.SendControlParameterByDeviceAsync(sendControlParameterByDeviceRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
@@ -241,6 +254,7 @@ namespace Vinno.vCloud.Common.FIS.Helper
         {
             try
             {
+                Logger.WriteLineInfo($"IDeviceService AcceptRemoteConnnectionAsync:{JsonSerializer.Serialize(controlDeviceResponseRequest)}");
                 return deviceService.AcceptRemoteConnnectionAsync(controlDeviceResponseRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
@@ -254,373 +268,418 @@ namespace Vinno.vCloud.Common.FIS.Helper
             return false;
         }
 
-        internal static bool AcceptRemoteConnnectionInLiveConsultationService(ILiveConsultationService liveConsultationService, ControlDeviceResponseRequest controlDeviceResponseRequest)
+        internal static bool DisconnectRemoteControl(IDeviceService deviceService, RemoteConnectStautsRequest remoteConnectStautsRequest)
         {
             try
             {
-                return liveConsultationService.AcceptRemoteConnnectionAsync(controlDeviceResponseRequest).GetAwaiter().GetResult();
+                Logger.WriteLineInfo($"IDeviceService DisconnectRemoteControl:{JsonSerializer.Serialize(remoteConnectStautsRequest)}");
+                return deviceService.DisconnectRemoteControl(remoteConnectStautsRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"AcceptRemoteConnnectionInLiveConsultationService Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                Logger.WriteLineError($"DisconnectRemoteControl Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"AcceptRemoteConnnectionInLiveConsultationService Error,ErrorMsg:{ex}");
+                Logger.WriteLineError($"DisconnectRemoteControl Error,ErrorMsg:{ex}");
             }
             return false;
         }
 
-        internal static bool DisconnectRemoteControl(IDeviceService deviceService, RemoteConnectStautsRequest remoteConnectStautsRequest)
+        internal static bool UploadDeviceDownloadPatchProgressToUser(IDeviceService deviceService, UploadDeviceDownloadPatchProgressToUserRequest uploadDeviceDownloadPatchProgressToUserRequest)
         {
             try
             {
-                return deviceService.DisconnectRemoteControl(remoteConnectStautsRequest).GetAwaiter().GetResult();
+                Logger.WriteLineInfo($"IDeviceService UploadDeviceDownloadPatchProgressToUserAsync:{JsonSerializer.Serialize(uploadDeviceDownloadPatchProgressToUserRequest)}");
+                return deviceService.UploadDeviceDownloadPatchProgressToUserAsync(uploadDeviceDownloadPatchProgressToUserRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"DisconnectRemoteControl Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                Logger.WriteLineError($"UploadDeviceDownloadPatchProgressToUserAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"DisconnectRemoteControl Error,ErrorMsg:{ex}");
+                Logger.WriteLineError($"UploadDeviceDownloadPatchProgressToUserAsync Error,ErrorMsg:{ex}");
             }
             return false;
         }
 
-        internal static CreateExaminfoResult CreateExamInfo(IRemedicalService remedicalService, CreateExaminfoRequest createExaminfoRequest)
+        internal static bool ResponseRemoteLog(IDeviceService deviceService, RemoteLogResponseRequest remoteLogResponseRequest)
         {
             try
             {
-                return remedicalService.CreateExamInfoAsync(createExaminfoRequest).GetAwaiter().GetResult();
+                Logger.WriteLineInfo($"IDeviceService ResponseRemoteLogAsync:{JsonSerializer.Serialize(remoteLogResponseRequest)}");
+                return deviceService.ResponseRemoteLogAsync(remoteLogResponseRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"CreateExamInfoAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                Logger.WriteLineError($"ResponseRemoteLog Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"CreateExamInfoAsync Error,ErrorMsg:{ex}");
+                Logger.WriteLineError($"ResponseRemoteLogAsync Error,ErrorMsg:{ex}");
             }
-            return null;
+            return false;
         }
 
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="remedicalService"></param>
-        /// <param name="uploadExamDataRequest"></param>
-        /// <returns>0为上传成功,-1为上传失败,大于0时为上传失败的代码</returns>
-        internal static ResultInfo UploadExamData(IRemedicalService remedicalService, UploadExamDataRequest uploadExamDataRequest)
+        internal static bool UploadDevicePrinter(IDeviceService deviceService, UploadDevicePrinterRequest uploadDevicePrinterRequest)
         {
             try
             {
-                var result = remedicalService.UploadExamDataAsync(uploadExamDataRequest).GetAwaiter().GetResult();
-                return new ResultInfo(result, 0);
+                Logger.WriteLineInfo($"IDeviceService UploadDevicePrinterAsync:{JsonSerializer.Serialize(uploadDevicePrinterRequest)}");
+                return deviceService.UploadDevicePrinterAsync(uploadDevicePrinterRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"UploadExamDataAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
-                return new ResultInfo(false, rpcExcetpion.ErrorCode);
+                Logger.WriteLineError($"UploadDevicePrinterAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"UploadExamDataAsync Error,ErrorMsg:{ex}");
-                return new ResultInfo(false, -1);
+                Logger.WriteLineError($"UploadDevicePrinterAsync Error,ErrorMsg:{ex}");
             }
+            return false;
         }
 
-        internal static bool DeviceFinishExam(IRemedicalService remedicalService, DeviceFinishExamRequest deviceFinishExamRequest)
+        internal static bool DeviceRemoteConnectHeartRate(IDeviceService deviceService, RemoteConnectHeartRateRequest remoteConnectHeartRateRequest)
         {
             try
             {
-                return remedicalService.DeviceFinishExamAsync(deviceFinishExamRequest).GetAwaiter().GetResult();
+                return deviceService.DeviceRemoteConnectHeartRateAsync(remoteConnectHeartRateRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"DeviceFinishExamAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                Logger.WriteLineError($"DeviceRemoteConnectHeartRateAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"DeviceFinishExamAsync Error,ErrorMsg:{ex}");
+                Logger.WriteLineError($"DeviceRemoteConnectHeartRateAsync Error,ErrorMsg:{ex}");
             }
             return false;
         }
 
-        internal static PageResult<QueryExamListItemResult> QueryExamList(IRemedicalService remedicalService, QueryExamListRequest queryExamListRequest)
+        internal static bool HeartRate(IDeviceService deviceService, TokenRequest tokenRequest)
         {
             try
             {
-                return remedicalService.QueryExamListAsync(queryExamListRequest).GetAwaiter().GetResult();
+                return deviceService.HeartRateAsync(tokenRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"QueryExamListAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                Logger.WriteLineError($"HeartRateAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"QueryExamListAsync Error,ErrorMsg:{ex}");
+                Logger.WriteLineError($"HeartRateAsync Error,ErrorMsg:{ex}");
             }
-            return null;
+            return false;
         }
 
-        internal static QueryExamInfoResult QueryExamInfo(IRemedicalService remedicalService, QueryExamInfoRequest queryExamInfoRequest)
+        internal static string SendResultToClient(IDeviceService deviceService, SendResultToClientRequest sendResultToClientRequest)
         {
             try
             {
-                return remedicalService.QueryExamInfoAsync(queryExamInfoRequest).GetAwaiter().GetResult();
+                Logger.WriteLineInfo($"IDeviceService SendResultToClientAsync:{JsonSerializer.Serialize(sendResultToClientRequest)}");
+                return deviceService.SendResultToClientAsync(sendResultToClientRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"QueryExamInfoAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                Logger.WriteLineError($"SendResultToClientAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"QueryExamInfoAsync Error,ErrorMsg:{ex}");
+                Logger.WriteLineError($"SendResultToClientAsync Error,ErrorMsg:{ex}");
             }
-            return null;
+            return "";
         }
 
-        internal static List<ServerInfoDTO> GetServerInfoList(IVinnoServerService vinnoServerService, QueryServerInfoRequest queryServerInfoRequest)
+        internal static string GetResultFromServer(IDeviceService deviceService, GetResultFromServerRequest getResultFromServerRequest)
         {
             try
             {
-                return vinnoServerService.GetServerInfoListAsync(queryServerInfoRequest).GetAwaiter().GetResult();
+                return deviceService.GetResultFromServerAsync(getResultFromServerRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"GetServerInfoListAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                Logger.WriteLineError($"GetResultFromServerAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"GetServerInfoListAsync Error,ErrorMsg:{ex}");
+                Logger.WriteLineError($"GetResultFromServerAsync Error,ErrorMsg:{ex}");
             }
-            return new List<ServerInfoDTO>();
+            return "";
         }
 
-        internal static EchoResult Echo(IVinnoServerService vinnoServerService)
+        internal static bool DeviceCancelLogDownload(IDeviceService deviceService, DeivceCancelLogDownloadRequest deivceCancelLogDownloadRequest)
         {
             try
             {
-                return vinnoServerService.EchoAsync().GetAwaiter().GetResult();
+                return deviceService.DeviceCancelLogDownloadAsync(deivceCancelLogDownloadRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"EchoAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                Logger.WriteLineError($"DeviceCancelLogDownloadAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
             }
-            catch (HttpRequestException)
+            catch (Exception ex)
             {
-                Logger.WriteLineError($"EchoAsync Error:HttpRequestException");
+                Logger.WriteLineError($"DeviceCancelLogDownloadAsync Error,ErrorMsg:{ex}");
+            }
+            return false;
+        }
+
+        internal static ProbeApplicationSettingInfoDTO GetProbeApplicationSetting(IDeviceService deviceService, GetControlParametersRequest getControlParametersRequest)
+        {
+            try
+            {
+                return deviceService.GetProbeApplicationSettingAsync(getControlParametersRequest).GetAwaiter().GetResult();
+            }
+            catch (RpcException rpcExcetpion)
+            {
+                Logger.WriteLineError($"GetProbeApplicationSettingAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"EchoAsync Error,ErrorMsg:{ex}");
+                Logger.WriteLineError($"GetProbeApplicationSettingAsync Error,ErrorMsg:{ex}");
             }
             return null;
         }
 
-        internal static bool UploadDeviceDownloadPatchProgressToUser(IDeviceService deviceService, UploadDeviceDownloadPatchProgressToUserRequest uploadDeviceDownloadPatchProgressToUserRequest)
+        internal static bool ResponseProbeApplicationSetting(IDeviceService deviceService, ProbeApplicationSettingResultRequest probeApplicationSettingResultRequest)
         {
             try
             {
-                return deviceService.UploadDeviceDownloadPatchProgressToUserAsync(uploadDeviceDownloadPatchProgressToUserRequest).GetAwaiter().GetResult();
+                Logger.WriteLineInfo($"IDeviceService ResponseProbeApplicationSettingAsync:{JsonSerializer.Serialize(probeApplicationSettingResultRequest)}");
+                return deviceService.ResponseProbeApplicationSettingAsync(probeApplicationSettingResultRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"UploadDeviceDownloadPatchProgressToUserAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                Logger.WriteLineError($"ResponseProbeApplicationSettingAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"UploadDeviceDownloadPatchProgressToUserAsync Error,ErrorMsg:{ex}");
+                Logger.WriteLineError($"ResponseProbeApplicationSettingAsync Error,ErrorMsg:{ex}");
             }
             return false;
         }
 
-        internal static bool ResponseRemoteLog(IDeviceService deviceService, RemoteLogResponseRequest remoteLogResponseRequest)
+        #endregion IDeviceService
+
+        #region ILiveConsultationService
+
+        internal static bool AcceptRemoteConnnectionInLiveConsultationService(ILiveConsultationService liveConsultationService, ControlDeviceResponseRequest controlDeviceResponseRequest)
         {
             try
             {
-                return deviceService.ResponseRemoteLogAsync(remoteLogResponseRequest).GetAwaiter().GetResult();
+                Logger.WriteLineInfo($"ILiveConsultationService AcceptRemoteConnnectionAsync:{JsonSerializer.Serialize(controlDeviceResponseRequest)}");
+                return liveConsultationService.AcceptRemoteConnnectionAsync(controlDeviceResponseRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"ResponseRemoteLog Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                Logger.WriteLineError($"AcceptRemoteConnnectionInLiveConsultationService Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"ResponseRemoteLogAsync Error,ErrorMsg:{ex}");
+                Logger.WriteLineError($"AcceptRemoteConnnectionInLiveConsultationService Error,ErrorMsg:{ex}");
             }
             return false;
         }
 
-        internal static bool UploadDevicePrinter(IDeviceService deviceService, UploadDevicePrinterRequest uploadDevicePrinterRequest)
+        internal static LiveConsultationHeartRateResult HeartRate(ILiveConsultationService liveConsultationService, LiveConsultationHeartRateRequest liveConsultationHeartRateRequest)
         {
             try
             {
-                return deviceService.UploadDevicePrinterAsync(uploadDevicePrinterRequest).GetAwaiter().GetResult();
+                return liveConsultationService.HeartRateAsync(liveConsultationHeartRateRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"UploadDevicePrinterAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                Logger.WriteLineError($"LiveConsultation HeartRateAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"UploadDevicePrinterAsync Error,ErrorMsg:{ex}");
+                Logger.WriteLineError($"LiveConsultation HeartRateAsync Error,ErrorMsg:{ex}");
             }
-            return false;
+            return null;
         }
 
-        internal static bool DeviceRemoteConnectHeartRate(IDeviceService deviceService, RemoteConnectHeartRateRequest remoteConnectHeartRateRequest)
+        #endregion ILiveConsultationService
+
+        #region IRemedicalService
+
+        internal static CreateExaminfoResult CreateExamInfo(IRemedicalService remedicalService, CreateExaminfoRequest createExaminfoRequest)
         {
             try
             {
-                return deviceService.DeviceRemoteConnectHeartRateAsync(remoteConnectHeartRateRequest).GetAwaiter().GetResult();
+                Logger.WriteLineInfo($"IRemedicalService CreateExamInfoAsync:{JsonSerializer.Serialize(createExaminfoRequest)}");
+                return remedicalService.CreateExamInfoAsync(createExaminfoRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"DeviceRemoteConnectHeartRateAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                Logger.WriteLineError($"CreateExamInfoAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"DeviceRemoteConnectHeartRateAsync Error,ErrorMsg:{ex}");
+                Logger.WriteLineError($"CreateExamInfoAsync Error,ErrorMsg:{ex}");
             }
-            return false;
+            return null;
         }
 
-        internal static bool HeartRate(IDeviceService deviceService, TokenRequest tokenRequest)
+        /// <summary>
+        ///
+        /// </summary>
+        /// <param name="remedicalService"></param>
+        /// <param name="uploadExamDataRequest"></param>
+        /// <returns>0为上传成功,-1为上传失败,大于0时为上传失败的代码</returns>
+        internal static ResultInfo UploadExamData(IRemedicalService remedicalService, UploadExamDataRequest uploadExamDataRequest)
         {
             try
             {
-                return deviceService.HeartRateAsync(tokenRequest).GetAwaiter().GetResult();
+                Logger.WriteLineInfo($"IRemedicalService UploadExamDataAsync:{JsonSerializer.Serialize(uploadExamDataRequest)}");
+                var result = remedicalService.UploadExamDataAsync(uploadExamDataRequest).GetAwaiter().GetResult();
+                return new ResultInfo(result, 0);
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"HeartRateAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                Logger.WriteLineError($"UploadExamDataAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                return new ResultInfo(false, rpcExcetpion.ErrorCode);
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"HeartRateAsync Error,ErrorMsg:{ex}");
+                Logger.WriteLineError($"UploadExamDataAsync Error,ErrorMsg:{ex}");
+                return new ResultInfo(false, -1);
             }
-            return false;
         }
 
-        internal static string SendResultToClient(IDeviceService deviceService, SendResultToClientRequest sendResultToClientRequest)
+        internal static bool DeviceFinishExam(IRemedicalService remedicalService, DeviceFinishExamRequest deviceFinishExamRequest)
         {
             try
             {
-                return deviceService.SendResultToClientAsync(sendResultToClientRequest).GetAwaiter().GetResult();
+                Logger.WriteLineInfo($"IRemedicalService DeviceFinishExamAsync:{JsonSerializer.Serialize(deviceFinishExamRequest)}");
+                return remedicalService.DeviceFinishExamAsync(deviceFinishExamRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"SendResultToClientAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                Logger.WriteLineError($"DeviceFinishExamAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"SendResultToClientAsync Error,ErrorMsg:{ex}");
+                Logger.WriteLineError($"DeviceFinishExamAsync Error,ErrorMsg:{ex}");
             }
-            return "";
+            return false;
         }
 
-        internal static string GetResultFromServer(IDeviceService deviceService, GetResultFromServerRequest getResultFromServerRequest)
+        internal static PageResult<QueryExamListItemResult> QueryExamList(IRemedicalService remedicalService, QueryExamListRequest queryExamListRequest)
         {
             try
             {
-                return deviceService.GetResultFromServerAsync(getResultFromServerRequest).GetAwaiter().GetResult();
+                Logger.WriteLineInfo($"IRemedicalService QueryExamListAsync:{JsonSerializer.Serialize(queryExamListRequest)}");
+                return remedicalService.QueryExamListAsync(queryExamListRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"GetResultFromServerAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                Logger.WriteLineError($"QueryExamListAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"GetResultFromServerAsync Error,ErrorMsg:{ex}");
+                Logger.WriteLineError($"QueryExamListAsync Error,ErrorMsg:{ex}");
             }
-            return "";
+            return null;
         }
 
-        internal static StorageServiceSettingDTO GetAuthorization(IStorageService storageService, FileServiceRequest fileServiceRequest)
+        internal static QueryExamInfoResult QueryExamInfo(IRemedicalService remedicalService, QueryExamInfoRequest queryExamInfoRequest)
         {
             try
             {
-                return storageService.GetAuthorizationAsync(fileServiceRequest).GetAwaiter().GetResult();
+                Logger.WriteLineInfo($"IRemedicalService QueryExamInfoAsync:{JsonSerializer.Serialize(queryExamInfoRequest)}");
+                return remedicalService.QueryExamInfoAsync(queryExamInfoRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"GetAuthorizationAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                Logger.WriteLineError($"QueryExamInfoAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"GetAuthorizationAsync Error,ErrorMsg:{ex}");
+                Logger.WriteLineError($"QueryExamInfoAsync Error,ErrorMsg:{ex}");
             }
             return null;
         }
 
-        internal static bool DeviceCancelLogDownload(IDeviceService deviceService, DeivceCancelLogDownloadRequest deivceCancelLogDownloadRequest)
+        internal static string GetCollcetingRecordCode(IRemedicalService remedicalService, TokenRequest tokenRequest)
         {
             try
             {
-                return deviceService.DeviceCancelLogDownloadAsync(deivceCancelLogDownloadRequest).GetAwaiter().GetResult();
+                return remedicalService.GetCollcetingRecordCodeAsync(tokenRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"DeviceCancelLogDownloadAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                Logger.WriteLineError($"LiveConsultation GetCollcetingRecordCodeAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"DeviceCancelLogDownloadAsync Error,ErrorMsg:{ex}");
+                Logger.WriteLineError($"LiveConsultation GetCollcetingRecordCodeAsync Error,ErrorMsg:{ex}");
             }
-            return false;
+            return null;
         }
 
-        internal static GetUpgradeInfoResult GetUpgradeInfo(IUpgradeService upgradeService, GetUpgradeInfoRequest getUpgradeInfoRequest)
+        #endregion IRemedicalService
+
+        #region IVinnoServerService
+
+        internal static List<ServerInfoDTO> GetServerInfoList(IVinnoServerService vinnoServerService, QueryServerInfoRequest queryServerInfoRequest)
         {
             try
             {
-                return upgradeService.GetUpgradeInfoAsync(getUpgradeInfoRequest).GetAwaiter().GetResult();
+                return vinnoServerService.GetServerInfoListAsync(queryServerInfoRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"GetUpgradeInfoAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                Logger.WriteLineError($"GetServerInfoListAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"GetUpgradeInfoAsync Error,ErrorMsg:{ex}");
+                Logger.WriteLineError($"GetServerInfoListAsync Error,ErrorMsg:{ex}");
             }
-            return null;
+            return new List<ServerInfoDTO>();
         }
 
-        internal static ProbeApplicationSettingInfoDTO GetProbeApplicationSetting(IDeviceService deviceService, GetControlParametersRequest getControlParametersRequest)
+        internal static EchoResult Echo(IVinnoServerService vinnoServerService)
         {
             try
             {
-                return deviceService.GetProbeApplicationSettingAsync(getControlParametersRequest).GetAwaiter().GetResult();
+                return vinnoServerService.EchoAsync().GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"GetProbeApplicationSettingAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                Logger.WriteLineError($"EchoAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+            }
+            catch (HttpRequestException)
+            {
+                Logger.WriteLineError($"EchoAsync Error:HttpRequestException");
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"GetProbeApplicationSettingAsync Error,ErrorMsg:{ex}");
+                Logger.WriteLineError($"EchoAsync Error,ErrorMsg:{ex}");
             }
             return null;
         }
 
-        internal static bool ResponseProbeApplicationSetting(IDeviceService deviceService, ProbeApplicationSettingResultRequest probeApplicationSettingResultRequest)
+        #endregion IVinnoServerService
+
+        #region IStorageService
+
+        internal static StorageServiceSettingDTO GetAuthorization(IStorageService storageService, FileServiceRequest fileServiceRequest)
         {
             try
             {
-                return deviceService.ResponseProbeApplicationSettingAsync(probeApplicationSettingResultRequest).GetAwaiter().GetResult();
+                return storageService.GetAuthorizationAsync(fileServiceRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"ResponseProbeApplicationSettingAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                Logger.WriteLineError($"GetAuthorizationAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"ResponseProbeApplicationSettingAsync Error,ErrorMsg:{ex}");
+                Logger.WriteLineError($"GetAuthorizationAsync Error,ErrorMsg:{ex}");
             }
-            return false;
+            return null;
         }
 
         internal static StorageServiceSettingDTO GetStorageTestUrl(IStorageService storageService, CheckStorageRequest checkStorageRequest)
@@ -640,23 +699,31 @@ namespace Vinno.vCloud.Common.FIS.Helper
             return null;
         }
 
-        internal static LiveConsultationHeartRateResult HeartRate(ILiveConsultationService liveConsultationService, LiveConsultationHeartRateRequest liveConsultationHeartRateRequest)
+        #endregion IStorageService
+
+        #region IUpgradeService
+
+        internal static GetUpgradeInfoResult GetUpgradeInfo(IUpgradeService upgradeService, GetUpgradeInfoRequest getUpgradeInfoRequest)
         {
             try
             {
-                return liveConsultationService.HeartRateAsync(liveConsultationHeartRateRequest).GetAwaiter().GetResult();
+                return upgradeService.GetUpgradeInfoAsync(getUpgradeInfoRequest).GetAwaiter().GetResult();
             }
             catch (RpcException rpcExcetpion)
             {
-                Logger.WriteLineError($"LiveConsultation HeartRateAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
+                Logger.WriteLineError($"GetUpgradeInfoAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
             }
             catch (Exception ex)
             {
-                Logger.WriteLineError($"LiveConsultation HeartRateAsync Error,ErrorMsg:{ex}");
+                Logger.WriteLineError($"GetUpgradeInfoAsync Error,ErrorMsg:{ex}");
             }
             return null;
         }
 
+        #endregion IUpgradeService
+
+        #region IEducationService
+
         internal static LiveHeartRateResult HeartRate(IEducationService educationService, LiveHeartRateRequest liveHeartRateRequest)
         {
             try
@@ -674,6 +741,10 @@ namespace Vinno.vCloud.Common.FIS.Helper
             return null;
         }
 
+        #endregion IEducationService
+
+        #region IOrganizationService
+
         internal static OrganizationDTO GetOrganizationByCode(IOrganizationService organizationService, GetOrganizationByCodeRequest getOrganizationByCodeRequest)
         {
             try
@@ -691,21 +762,6 @@ namespace Vinno.vCloud.Common.FIS.Helper
             return null;
         }
 
-        internal static string GetCollcetingRecordCode(IRemedicalService remedicalService, TokenRequest tokenRequest)
-        {
-            try
-            {
-                return remedicalService.GetCollcetingRecordCodeAsync(tokenRequest).GetAwaiter().GetResult();
-            }
-            catch (RpcException rpcExcetpion)
-            {
-                Logger.WriteLineError($"LiveConsultation GetCollcetingRecordCodeAsync Error,ErrorCode:{rpcExcetpion.ErrorCode},ErrorMsg:{rpcExcetpion.InternalMessage} ");
-            }
-            catch (Exception ex)
-            {
-                Logger.WriteLineError($"LiveConsultation GetCollcetingRecordCodeAsync Error,ErrorMsg:{ex}");
-            }
-            return null;
-        }
+        #endregion IOrganizationService
     }
 }