wangjk 4 anni fa
parent
commit
ab9056cb92

+ 1 - 1
app/build.gradle

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

+ 13 - 1
app/src/main/java/com/wdkl/callingdoctor/adapter/CallListAdapter.java

@@ -2,6 +2,8 @@ package com.wdkl.callingdoctor.adapter;
 
 import android.content.Context;
 import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -71,7 +73,17 @@ public class CallListAdapter extends RecyclerView.Adapter<CallListAdapter.MyView
             holder.rlMain.setBackgroundResource(R.mipmap.bg_bed_stanby_n);
         }
         holder.tvRoomNumTail.setVisibility(View.VISIBLE);
+
         String type = list.get(position).getType();
+        Log.e("tag","type11111 "+type+" getDeviceMAC() "+list.get(position).getDeviceMAC());
+
+        //护士主机转接过来的
+        if(!TextUtils.isEmpty(list.get(position).getDeviceMAC())&&list.get(position).getDeviceMAC().length()<3
+                &&!list.get(position).getDeviceMAC().equals("0")){
+            type = list.get(position).getDeviceMAC();
+        }
+
+        Log.e("tag","type "+type);
         switch (type) {
             case Constants.DOOR_CALL:
                 holder.llBed.setVisibility(View.GONE);
@@ -82,7 +94,7 @@ public class CallListAdapter extends RecyclerView.Adapter<CallListAdapter.MyView
                 holder.tvName.setText(" 门口机 ");
                 break;
             case Constants.SON_CALL:
-            case Constants.MUlTITAP_CALL:
+//            case Constants.MUlTITAP_CALL:
             case Constants.TRADITION_CALL:
                 holder.llBed.setVisibility(View.VISIBLE);
                 holder.llRoom.setVisibility(View.VISIBLE);

+ 2 - 2
app/src/main/java/com/wdkl/callingdoctor/common/Constants.java

@@ -229,8 +229,8 @@ public class Constants {
     public static final String TRADITION_CALL = "12";
     public static String CallType = "";
     public static String NurseHostCallStatus = "0";//护士主机呼叫医生主机的状态
-    //呼叫护士主机id
-    public static String CALLING_HOST_ID = "";
+    //呼叫护士主机id
+    public static String CALLING_NURSE_HOST_ID = "";
 
     public static String MYSELF_ID = "";//自己的机器ID
     public static String CALLMAIN_ID = "";//所属主机机器ID

+ 41 - 26
app/src/main/java/com/wdkl/callingdoctor/ui/fragment/CallingBedFragment.java

@@ -10,6 +10,7 @@ import android.support.v7.widget.GridLayoutManager;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.support.v7.widget.helper.ItemTouchHelper;
+import android.text.TextUtils;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
@@ -582,9 +583,8 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
                 } else {
                     deleteCallingItem(upScrllUdpEntity, 0);
                 }
-
                 //发送医生主机挂断电话udp add wang
-                UdpSendUtil.sendDoctorHangUpPhone(callingEntity);
+                UdpSendUtil.sendDoctorHangUpPhone(upScrllUdpEntity);
                 Constants.NurseHostCallStatus = Constants.STANDBY;
 
             }
@@ -1443,7 +1443,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
                             Constants.NurseHostCallStatus = Constants.IN_CALL;
                         }
                         break;
-                    case "call_13_hang_up": //医生主机取消呼叫 add by waderson 20191108
+                    case "call_13_hang_up": //护士主机取消呼叫 add by waderson 20191108
                         Log.e(TAG,"call_13_hang_up.....");
 
                         deleteManagerCallingItem(udpEntity);
@@ -1454,7 +1454,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
                         Constants.NurseHostCallStatus = Constants.STANDBY;
                         Constants.CALL_STATE = Constants.STANDBY;
                         break;
-                    case "call_15": //护士主机转接医生主机
+                    case "call_15": //护士主机转接分机的呼叫给医生主机
                         if (isBelongSupervisor(nurseHostID)) {
                             Log.e("call_15","call_15 nurseHostID "+nurseHostID);
                             if (!PalyPhonetics.speakEntityList.contains(udpEntity)) {
@@ -1936,6 +1936,12 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
             resIdlist.clear();
             String type = loopingUdpentity.getType();
 
+            //护士主机转接过来的
+            if(!TextUtils.isEmpty(loopingUdpentity.getDeviceMAC())&&loopingUdpentity.getDeviceMAC().length()<3
+                    &&!loopingUdpentity.getDeviceMAC().equals("0")){
+                type = loopingUdpentity.getDeviceMAC();
+            }
+
             String rnb = loopingUdpentity.getRoomNumber();
             String bnb = loopingUdpentity.getBedNumber();
             boolean haveVip = false;
@@ -2063,28 +2069,28 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
                     resIdlist.add(R.raw.nurse_host);
                     resIdlist.add(R.raw.hujiao);
                     break;
-                case Constants.MUlTITAP_CALL://护士主机转接给医生机
-                    ArrayList<String> list_str8 = StringUtils.substringBySing(roomnumber);
-                    ArrayList<String> list_str88 = StringUtils.substringBySing(bednumber);
-                    if (null != list_str8 && "1".equals(voiceBroadcastType)) {//是否要播报“房” 0不要  1要
-                        for (String s : list_str8) {
-                            resIdlist.add(PalyPhonetics.getResIdInt(s));
-                        }
-                        resIdlist.add(R.raw.fang);
-                    }
-
-                    if (null != list_str88) {
-                        if (haveVip) {// add by waderson 20191212
-                            resIdlist.add(R.raw.vip);
-                        }
-
-                        for (String s : list_str88) {
-                            resIdlist.add(PalyPhonetics.getResIdInt(s));
-                        }
-                        resIdlist.add(R.raw.chuang);
-                        resIdlist.add(R.raw.hujiao);
-                    }
-                    break;
+//                case Constants.MUlTITAP_CALL://护士主机转接给医生机
+//                    ArrayList<String> list_str8 = StringUtils.substringBySing(roomnumber);
+//                    ArrayList<String> list_str88 = StringUtils.substringBySing(bednumber);
+//                    if (null != list_str8 && "1".equals(voiceBroadcastType)) {//是否要播报“房” 0不要  1要
+//                        for (String s : list_str8) {
+//                            resIdlist.add(PalyPhonetics.getResIdInt(s));
+//                        }
+//                        resIdlist.add(R.raw.fang);
+//                    }
+//
+//                    if (null != list_str88) {
+//                        if (haveVip) {// add by waderson 20191212
+//                            resIdlist.add(R.raw.vip);
+//                        }
+//
+//                        for (String s : list_str88) {
+//                            resIdlist.add(PalyPhonetics.getResIdInt(s));
+//                        }
+//                        resIdlist.add(R.raw.chuang);
+//                        resIdlist.add(R.raw.hujiao);
+//                    }
+//                    break;
 
             }
             if (null != loopVoice) {
@@ -2212,8 +2218,17 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
                             endCall(); //挂断电话!
                         }
                         // ivCallPic.setImageResource(R.mipmap.ic_calling_sickbed_right_calling);
+
+                        if (handTelephone) {
+                            if (Constants.CallType.equals(Constants.DOCTOR_CALL)) {
+                                UdpSendUtil.sendNurseHostHangUp(Constants.CALLING_NURSE_HOST_ID);//通知护士主机改变状态
+                                Constants.NurseHostCallStatus = Constants.STANDBY;
+                            }
+                        }
+
                         handTelephone = false;
                         MainFragmentActivity.initCallVoiceShowProgress();//20190801 waderson
+
                     }
                     if (0 == data) {//拿起状态
                         Constants.HANDS_FREE = false;

+ 4 - 2
app/src/main/java/com/wdkl/callingdoctor/ui/fragment/CallingHostFragment.java

@@ -595,7 +595,7 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
             Log.e(TAG,"callClick 正在呼叫");
             UdpSendUtil.sendNurseHostCall(hostId);
             Constants.CALL_STATE = Constants.IN_CALL;
-            Constants.CALLING_HOST_ID = hostId;
+            Constants.CALLING_NURSE_HOST_ID = hostId;
             Constants.CallType = Constants.DOCTOR_CALL;
         } else {
             //主动挂断
@@ -605,7 +605,7 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
                 nurse_CallStaus.setText("");
                 UdpSendUtil.sendNurseHostHangUp(hostId);
                 Constants.CALL_STATE = Constants.STANDBY;
-                Constants.CALLING_HOST_ID = "";
+                Constants.CALLING_NURSE_HOST_ID = "";
             }
         }
     }
@@ -619,6 +619,8 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
      */
     @Override
     public void nurseHostItemOnclick(View view, int position) {
+        Log.e(TAG,"CALL_STATE "+Constants.CALL_STATE +" CallType "+Constants.CallType);
+
         if (!Constants.CALL_STATE.equals(Constants.STANDBY) && Constants.CallType.equals(Constants.DOCTOR_CALL)) {
             ToastUtil.showToast("请先取消当前呼叫");
             return;

+ 4 - 4
app/src/main/java/com/wdkl/callingdoctor/util/AnalysisUdpUtil.java

@@ -67,7 +67,7 @@ public class AnalysisUdpUtil {
                         nurse_call_doctor_udpEntity.setShowText("总控制室主机呼叫护士主机");
                         EventBus.getDefault().post(new MessageEvent(nurse_call_doctor_udpEntity, Constants.EVENT_UDP));
                         break;
-                    case "call_13_hang_up": //医生主机取消呼叫
+                    case "call_13_hang_up": //护士主机取消呼叫
                         UdpEntity call_13_hang_up = new UdpEntity();
                         call_13_hang_up.setIndexes(data[0]);
                         call_13_hang_up.setNurseHostID(data[1]);
@@ -83,7 +83,7 @@ public class AnalysisUdpUtil {
                         call_13_hang_up.setShowText("总控制室主机取消呼叫");
                         EventBus.getDefault().post(new MessageEvent(call_13_hang_up, Constants.EVENT_UDP));
                         break;
-                    case "call_13_upremove": //主机上滑移除了呼叫列表中的一个条目
+                    case "call_13_upremove": //护士主机上滑移除医生主机呼叫
                         UdpEntity call_13_upremove = new UdpEntity();
                         call_13_upremove.setIndexes(data[0]);
                         call_13_upremove.setNurseHostID(data[1]);
@@ -236,7 +236,7 @@ public class AnalysisUdpUtil {
                     //手表呼叫护士主机");
                     break;
                 case "call_15":
-                    //护士主机转接医生主机");
+                    //护士主机转接床头分机呼叫给医生主机
                     UdpEntity call_15_multitap = new UdpEntity();
                     call_15_multitap.setIndexes(data[0]);
                     call_15_multitap.setNurseHostID(data[1]);
@@ -254,7 +254,7 @@ public class AnalysisUdpUtil {
 
                     break;
                 case "call_15_cancel":
-                    //取消其他医生主机转接");
+                    //取消其他医生主机呼叫的转接
                     UdpEntity call_15_cancel = new UdpEntity();
                     call_15_cancel.setIndexes(data[0]);
                     call_15_cancel.setNurseHostID(data[1]);

+ 1 - 1
app/src/main/java/com/wdkl/callingdoctor/util/PalyPhonetics.java

@@ -132,7 +132,7 @@ public class PalyPhonetics {
         } else if (id == R.raw.manager) {
             return 1150;
         }
-        return 700;
+        return 900;
     }
 
 

+ 3 - 3
app/src/main/java/com/wdkl/callingdoctor/util/UdpSendUtil.java

@@ -176,7 +176,7 @@ public class UdpSendUtil {
     }
 
     /**
-     * 医生主机上滑移除后发UDP通知外面
+     * 医生主机上滑移除后发UDP通知护士主机
      *
      * @param udpEntity
      * @param hostId
@@ -264,7 +264,7 @@ public class UdpSendUtil {
     }
 
     /**
-     * 医生主机挂断通话,需要通知对方护士主机
+     * 医生主机取消呼叫,需要通知对方护士主机
      */
     public static void sendNurseHostHangUp(String hostId) {
         AnalysisUdpUtil.sendUdpData("call_14_hang_up",
@@ -394,7 +394,7 @@ public class UdpSendUtil {
                 , Constants.MAC_ADDRESS);
     }
     /**
-     * 医生主机挂断电话
+     * 医生主机挂断电话 通知护士主机可以继续转接呼叫
      *
      * @param udpEntity
      */