Преглед на файлове

<修改bug:护士主机挂断分机,门口机状态未更新>

weizhengliang преди 5 години
родител
ревизия
936f9910ed
променени са 2 файла, в които са добавени 34 реда и са изтрити 2 реда
  1. 1 1
      app/build.gradle
  2. 33 1
      app/src/main/java/com/wdkl/callingmainnurse/ui/fragment/CallingBedFragment.java

+ 1 - 1
app/build.gradle

@@ -24,7 +24,7 @@ android {
         minSdkVersion 15
         targetSdkVersion 26
         versionCode 1
-        versionName "1.33"
+        versionName "1.34"
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
         multiDexEnabled true
 

+ 33 - 1
app/src/main/java/com/wdkl/callingmainnurse/ui/fragment/CallingBedFragment.java

@@ -374,6 +374,10 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
      */
     protected RoomEntity.WardInformation.SickbedInformation sickBedInfo;
     /**
+     * 用户选择床位并拨打电话的sipId
+     */
+    protected String callSipId;
+    /**
      * 是否需要轮流播报
      */
     public static boolean have_Speak = true;
@@ -1028,6 +1032,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
                         LogUtil.d("sipAddress", "Call==sipAddress==" + sipAddress);
                         LogUtil.d("sipAddress", "Call==deviceMAC==" + sickBedInfo.getDeviceMAC());
                         //ToastUtil.showToast(sipAddress+"===="+sickBedInfo.getDeviceMAC());
+                        callSipId = sipAddress;
                         callBed = true;
                         ivCallPic.setImageResource(R.mipmap.ic_calling_sickbed_right_hang_up);
                         mainFragmentActivity.initiateCall(sipAddress, "", sickBedInfo.getDeviceMAC() == null ? "-1" : sickBedInfo.getDeviceMAC());
@@ -1279,7 +1284,6 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
                     if (have_Call) {
                         setVolumePA(false);
                         if (CALL_LIST_POSITION >= 0 && upScrllPosition != CALL_LIST_POSITION) {
-
                             if (!callBed) {
                                 endCallNotifi(callingEntity);
                                 if (((MyApplication) getActivity().getApplication()).callEntityList.contains(callingEntity)) {
@@ -1309,6 +1313,26 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
                                 }
                             }
                         }
+
+                        //fix bug: 分机呼叫护士主机,护士主机从房间列表里面拨打该分机,然后挂断,呼叫列表和门口机状态未更新
+                        UdpEntity removeEntity = null;
+                        for (UdpEntity entity : MyApplication.callEntityList) {
+                            if (entity != null && callSipId != null && callSipId.equals(entity.getSipAddress())) {
+                                removeEntity = entity;
+                                break;
+                            }
+                        }
+                        if (removeEntity != null) {
+                            MyApplication.callEntityList.remove(removeEntity);
+                            sendNoAnyRequestDoor(removeEntity);
+                            sendCallWaitingNumber(MyApplication.callEntityList.size());
+                            callListAdapter.notifyDataSetChanged();
+                            roomAdapter.notifyDataSetChanged();
+                            if (!StringUtils.listNotEmpty(((MyApplication) getActivity().getApplication()).callEntityList)) {
+                                setPowerLed("1");
+                            }
+                        }
+                        callSipId = "";
                         vRightPatientInfo.setVisibility(View.VISIBLE);
                         vRightCallListInfo.setVisibility(View.GONE);
                         vRightCallInfo.setVisibility(View.GONE);
@@ -1343,6 +1367,14 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
                         callingNotifi(callingEntity);
                     }
 
+                    //fix bug: 分机呼叫护士主机,护士主机从房间列表里面拨打该分机,然后挂断,呼叫列表和门口机状态未更新
+                    for (UdpEntity entity : MyApplication.callEntityList) {
+                        if (entity != null && callSipId != null && callSipId.equals(entity.getSipAddress())) {
+                            callingNotifi(entity);
+                            break;
+                        }
+                    }
+
                     MainFragmentActivity.initCallVoiceShowProgress();//20190801 waderson
                     new Handler().postDelayed(new Runnable() {
                         @Override