瀏覽代碼

<合并主干护士主机修改>

weizhengliang 5 年之前
父節點
當前提交
e629ca88ed

+ 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

+ 4 - 1
app/src/main/java/com/wdkl/callingmainnurse/util/StringUtils.java

@@ -8,6 +8,8 @@ import android.content.pm.PackageManager.NameNotFoundException;
 import android.os.Bundle;
 
 import com.wdkl.callingmainnurse.BuildConfig;
+import com.wdkl.callingmainnurse.MyApplication;
+import com.wdkl.callingmainnurse.R;
 
 import java.io.BufferedReader;
 import java.io.IOException;
@@ -71,7 +73,8 @@ public class StringUtils {
     }
 
     public static String getAllVersionName() {
-        String str = "\r\nAPP版本号:V" + BuildConfig.VERSION_NAME + "     中央服务器系列\r\n发布日期:" + BuildConfig.BUILD_TIME;
+        String str = "\r\nApp名称: " + MyApplication.getAppContext().getString(R.string.app_name)
+                + "\r\nAPP版本号:V" + BuildConfig.VERSION_NAME + "     中央服务器系列\r\n发布日期:" + BuildConfig.BUILD_TIME;
         if (android.os.Build.VERSION.SDK_INT >= 26) { //android8.0 = 26
             str = str + "    android8.1 , rk3368";// rk3368 android8.1
         } else if (android.os.Build.VERSION.SDK_INT >= 24) { //android7.0 = 24