فهرست منبع

配套医生主机和混搭项目的护士主机

wangjk 5 سال پیش
والد
کامیت
8954230341

+ 1 - 1
app/src/main/java/com/wdkl/callingmainnurse/common/Constants.java

@@ -225,7 +225,7 @@ public class Constants {
     public static final String MUlTITAP_CALL = "8";
     public static final String TRADITION_CALL = "12";
     public static String CallType = "";
-    public static String DoctorMachineCallStatus = "";//医生主机呼叫护士主机的状态
+    public static String DoctorMachineCallStatus = "0";//医生主机呼叫护士主机的状态
     //呼叫医生主机id
     public static String CALLING_HOST_ID = "";
 

+ 55 - 2
app/src/main/java/com/wdkl/callingmainnurse/ui/fragment/CallingBedFragment.java

@@ -381,6 +381,10 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
      */
     protected RoomEntity.WardInformation.SickbedInformation sickBedInfo;
     /**
+     * 用户选择床位并拨打电话的sipId
+     */
+    protected String callSipId;
+    /**
      * 是否需要轮流播报
      */
     public static boolean have_Speak = true;
@@ -598,6 +602,8 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
                     deleteCallingItem(upScrllUdpEntity, 0);
                 }
                 Constants.DoctorMachineCallStatus = Constants.STANDBY;
+                removeCallList(upScrllUdpEntity);
+
             }
         };
         //用Callback构造ItemtouchHelper
@@ -1010,6 +1016,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
                     callBed = false;
                     ivCallListPic.setImageResource(R.mipmap.ic_calling_sickbed_right_hang_up);
                     mainFragmentActivity.initiateCall(sipAddress, callingEntity.getType(), callingEntity.getDeviceMAC());
+                    removeCallList(callingEntity);
                 }
             } else {
                 if (null != loopingUdpentity && loopingUdpentity.equals(callingEntity)) {
@@ -1046,6 +1053,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());
@@ -1306,7 +1314,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)) {
@@ -1336,6 +1343,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);
@@ -1374,6 +1401,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
@@ -2506,8 +2541,26 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
     public void b(View view) {
         UdpSendUtil.sendNurseStationState(((MainFragmentActivity) getActivity()).getInitDataEntity(), 1);
     }
+    private void removeCallList(UdpEntity udpEntity) {
+
+        if(callListEntityList==null){
+            callListEntityList = new ArrayList<>();
+        }
+        Log.e(TAG,"removeCallList 删除集合。。"+callListEntityList.size());
+        //同步全局呼叫列表中的数据,删除掉多余的
+        for(int i=0;i<callListEntityList.size();i++){
+            CallListEntity callListEntity = callListEntityList.get(i);
+            if(callListEntity.getUdpEntity().getSipAddress().equals(udpEntity.getSipAddress())&&
+                    callListEntity.getUdpEntity().getBedNumber().equals(udpEntity.getBedNumber())){
+                callListEntityList.remove(callListEntity);
+                Log.e(TAG,"removeCallList 删除集合222。。"+callListEntityList.size());
+            }
+        }
+        Log.e(TAG,"removeCallList 删除集合333。。"+callListEntityList.size());
+    }
 
     private void addCallList(UdpEntity udpEntity) {
+
         if(callListEntityList==null){
             callListEntityList = new ArrayList<>();
         }
@@ -2540,7 +2593,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
 //               for(int i=0;i< callListEntityList.size();i++){
                 Log.e(TAG,"呼叫超时线程。。。for");
                 final CallListEntity callListEntity = callListEntityList.get(0);
-                if((System.currentTimeMillis()-callListEntity.getTime())>10000){
+                if((System.currentTimeMillis()-callListEntity.getTime())>30000){
                     UdpSendUtil.sendMultitapCall1(callListEntity);
                     Log.e(TAG,"呼叫超时线程。。。sendCall1");
                     //转接给医生主机后取消护士主机的呼叫列表 线程里面不能更新UI

+ 5 - 5
app/src/main/java/com/wdkl/callingmainnurse/ui/fragment/CallingHostFragment.java

@@ -259,16 +259,16 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
                 .execute(new StringCallback() {
                     @Override
                     public void onError(Call call, Exception e, int id) {
-                        if (swipeNurseRefreshLayout.isRefreshing()) {
-                            swipeNurseRefreshLayout.setRefreshing(false);
+                        if (swipeDoctorRefreshLayout.isRefreshing()) {
+                            swipeDoctorRefreshLayout.setRefreshing(false);
                         }
                         hideProgress();
                     }
 
                     @Override
                     public void onResponse(String response, int id) {
-                        if (swipeNurseRefreshLayout.isRefreshing()) {
-                            swipeNurseRefreshLayout.setRefreshing(false);
+                        if (swipeDoctorRefreshLayout.isRefreshing()) {
+                            swipeDoctorRefreshLayout.setRefreshing(false);
                         }
                         if (notEmpty(response)) {
                             LogUtil.d(CallingHostFragment.class, "part info==" + response);
@@ -374,7 +374,7 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
             ToastUtil.showToast("请先取消当前呼叫");
             return;
         } else if(!Constants.DoctorMachineCallStatus.equals(Constants.STANDBY)){
-            ToastUtil.showToast("请先取消当前呼叫");
+            ToastUtil.showToast("请先取消当前呼叫...");
             return;
         }
         if (doctorHostList.size() <= 0 || position >= doctorHostList.size() || null == doctorHostList.get(position)) {

+ 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

+ 6 - 2
app/src/main/res/layout/fragment_calling_doctor_medica_hosts.xml

@@ -31,7 +31,11 @@
                 android:overScrollMode="never"></android.support.v7.widget.RecyclerView>
             </android.support.v4.widget.SwipeRefreshLayout>
         </LinearLayout>
-
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_toLeftOf="@+id/fragment_calling_host_rl_right"
+        android:orientation="vertical">
         <LinearLayout
             android:id="@+id/fragment_rl_doctor"
             android:layout_width="match_parent"
@@ -53,7 +57,7 @@
             </android.support.v7.widget.RecyclerView>
             </android.support.v4.widget.SwipeRefreshLayout>
         </LinearLayout>
-
+    </LinearLayout>
     </LinearLayout>