Przeglądaj źródła

2.0.0.245,当非本机会诊,增加提示。

felix 11 miesięcy temu
rodzic
commit
a6acbf4680

+ 2 - 1
assets/languages/en_US.json

@@ -22,6 +22,7 @@
     "competentExperts": "Experts",
     "consultationDescription": "Description",
     "expertListIsEmpty":"The list of consultation expert doctor is empty!",
-    "theCurrentPasswordHasExpired":"We detected that your password has not been changed for 3 months. To protect the safety of your account, we suggest you change your password!"
+    "theCurrentPasswordHasExpired":"We detected that your password has not been changed for 3 months. To protect the safety of your account, we suggest you change your password!",
+    "currentConsultationNotSupport":"{0} has sent you an invitation for consultation, but the current ultrasound machine does not support this consultation. Please go to the Flyinsono client for consultation!"
   }
 }

+ 2 - 1
assets/languages/zh_CN.json

@@ -22,6 +22,7 @@
     "competentExperts": "会诊专家",
     "consultationDescription": "会诊描述",
     "expertListIsEmpty":"会诊专家列表为空!",
-    "theCurrentPasswordHasExpired":"检测到您的密码已3个月未修改,为保护账号安全,建议您修改密码!"
+    "theCurrentPasswordHasExpired":"检测到您的密码已3个月未修改,为保护账号安全,建议您修改密码!",
+    "currentConsultationNotSupport":"{0}向您发来了会诊邀请,但是当前超声机不支持该会诊,请前往杏聆荟客户端进行会诊!"
   }
 }

+ 33 - 12
lib/consultation/liveconsultation/models/consultationpopup.dart

@@ -1,14 +1,18 @@
 import 'dart:typed_data';
 
 import 'package:fis_common/index.dart';
+import 'package:fis_i18n/i18n.dart';
 import 'package:fis_jsonrpc/rpc.dart';
 import 'package:flutter_sound/flutter_sound.dart';
 import 'package:flyinsonolite/consultation/liveconsultation/views/consultationrequestdialog.dart';
 import 'package:flyinsonolite/consultation/liveconsultation/models/popuptimer.dart';
+import 'package:flyinsonolite/consultation/records/models/consultationmember.dart';
+import 'package:flyinsonolite/controls/prompt.dart';
 import 'package:flyinsonolite/jsonrpc/fisLib/services/log.m.dart';
 import 'package:flyinsonolite/infrastructure/global.dart';
 import 'package:flyinsonolite/jsonrpc/jsonrpcclientforFISLib.dart';
 import 'package:flyinsonolite/infrastructure/logger.dart';
+import 'package:flyinsonolite/localization/fis_i18n.dart';
 import 'package:flyinsonolite/managers/interfaces/iappointmentmanager.dart';
 import 'package:flyinsonolite/managers/interfaces/iliveconsultationmanager.dart';
 import 'package:flyinsonolite/consultation/records/models/liveconsultation.dart';
@@ -69,12 +73,7 @@ class ConsultationPopup {
   static Future<void> onInviteLiveConsultation(
       Object sender, LiveConsultation e) async {
     ///Felix临时屏蔽非本机会诊
-    final IAppointmentManager appointmentManager =
-        Get.find<IAppointmentManager>();
-    var consultationDetaioDto = await appointmentManager
-        .findConsultationDetailAsync(e.consultationCode!);
-    if (Storage.usDeviceCode != consultationDetaioDto?.deviceCode &&
-        Storage.platform == Platform.Windows) {
+    if (!(await isSupportThisConsultation(e))) {
       return;
     }
     //if (_isPlaying) {
@@ -90,14 +89,10 @@ class ConsultationPopup {
 
   ///加入会诊弹窗
   static void onJoinLiveConsultation(Object sender, LiveConsultation e) async {
-    final IAppointmentManager appointmentManager =
-        Get.find<IAppointmentManager>();
-    var consultationDetaioDto = await appointmentManager
-        .findConsultationDetailAsync(e.consultationCode!);
-    if (Storage.usDeviceCode != consultationDetaioDto?.deviceCode &&
-        Storage.platform == Platform.Windows) {
+    if (!(await isSupportThisConsultation(e))) {
       return;
     }
+
     if (_isPlaying) {
       _stopTimer = true;
       _isPlaying = false;
@@ -176,4 +171,30 @@ class ConsultationPopup {
           "_informUSToFlyinsonoPageAsync error:$ex");
     }
   }
+
+  static Future<bool> isSupportThisConsultation(LiveConsultation e) async {
+    try {
+      final IAppointmentManager appointmentManager =
+          Get.find<IAppointmentManager>();
+      var consultationDetaioDto = await appointmentManager
+          .findConsultationDetailAsync(e.consultationCode!);
+      if (Storage.usDeviceCode != consultationDetaioDto?.deviceCode &&
+          Storage.platform == Platform.Windows) {
+        var initiaor = e.memberLiveDatas[0];
+        if (e.operator != null) {
+          initiaor = ConsultationMember.fromDto(e.operator!)
+              .fixMergedVideoOutputSize()
+              .fixOnlyCamera();
+        }
+        PromptBox.toast(fisI18nBook.common.currentConsultationNotSupport
+            .translate([initiaor.name]));
+        return false;
+      }
+      return true;
+    } catch (ex) {
+      await loggerAsyn(
+          FISDeviceLogCategory.Error, "isSupportThisConsultation error:$ex");
+      return false;
+    }
+  }
 }

+ 8 - 2
lib/localization/fis_common.dart

@@ -24,7 +24,8 @@ class FISCommonModule extends ModuleBase {
       required this.competentExperts,
       required this.consultationDescription,
       required this.expertListIsEmpty,
-      required this.theCurrentPasswordHasExpired});
+      required this.theCurrentPasswordHasExpired,
+      required this.currentConsultationNotSupport});
 
   static const ModuleName = "common";
 
@@ -53,7 +54,9 @@ class FISCommonModule extends ModuleBase {
         competentExperts: map.pick("competentExperts"),
         consultationDescription: map.pick("consultationDescription"),
         expertListIsEmpty: map.pick("expertListIsEmpty"),
-        theCurrentPasswordHasExpired: map.pick("theCurrentPasswordHasExpired"));
+        theCurrentPasswordHasExpired: map.pick("theCurrentPasswordHasExpired"),
+        currentConsultationNotSupport:
+            map.pick("currentConsultationNotSupport"));
   }
 
   /// 请先连接设备云服务!
@@ -122,6 +125,9 @@ class FISCommonModule extends ModuleBase {
   ///密码已过期
   final FTrStr theCurrentPasswordHasExpired;
 
+  ///当前会诊不支持
+  final FTrStr currentConsultationNotSupport;
+
   @override
   getProp(String propName) {
     // TODO: implement getProp