|
@@ -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
|