|
@@ -16,6 +16,7 @@ import android.widget.TextView;
|
|
|
|
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.reflect.TypeToken;
|
|
import com.google.gson.reflect.TypeToken;
|
|
|
|
+import com.wdkl.callingmainnursemanager.MyApplication;
|
|
import com.wdkl.callingmainnursemanager.R;
|
|
import com.wdkl.callingmainnursemanager.R;
|
|
import com.wdkl.callingmainnursemanager.adapter.DoctorHostAdapter;
|
|
import com.wdkl.callingmainnursemanager.adapter.DoctorHostAdapter;
|
|
import com.wdkl.callingmainnursemanager.adapter.DutyDoctorAdapter;
|
|
import com.wdkl.callingmainnursemanager.adapter.DutyDoctorAdapter;
|
|
@@ -26,26 +27,33 @@ import com.wdkl.callingmainnursemanager.base.BaseFragment;
|
|
import com.wdkl.callingmainnursemanager.common.Constants;
|
|
import com.wdkl.callingmainnursemanager.common.Constants;
|
|
import com.wdkl.callingmainnursemanager.entity.CallingQueuingInfoEntity;
|
|
import com.wdkl.callingmainnursemanager.entity.CallingQueuingInfoEntity;
|
|
import com.wdkl.callingmainnursemanager.entity.DoctorHostEntity;
|
|
import com.wdkl.callingmainnursemanager.entity.DoctorHostEntity;
|
|
|
|
+import com.wdkl.callingmainnursemanager.entity.HospitalInfoEntity;
|
|
import com.wdkl.callingmainnursemanager.entity.MessageEvent;
|
|
import com.wdkl.callingmainnursemanager.entity.MessageEvent;
|
|
import com.wdkl.callingmainnursemanager.entity.NurseHostListInfo;
|
|
import com.wdkl.callingmainnursemanager.entity.NurseHostListInfo;
|
|
|
|
+import com.wdkl.callingmainnursemanager.entity.PartInfoEntity;
|
|
|
|
+import com.wdkl.callingmainnursemanager.entity.UdpEntity;
|
|
import com.wdkl.callingmainnursemanager.util.LogUtil;
|
|
import com.wdkl.callingmainnursemanager.util.LogUtil;
|
|
import com.wdkl.callingmainnursemanager.util.StringUtils;
|
|
import com.wdkl.callingmainnursemanager.util.StringUtils;
|
|
import com.wdkl.callingmainnursemanager.util.UIUtils;
|
|
import com.wdkl.callingmainnursemanager.util.UIUtils;
|
|
import com.wdkl.callingmainnursemanager.util.ToastUtil;
|
|
import com.wdkl.callingmainnursemanager.util.ToastUtil;
|
|
|
|
+import com.wdkl.callingmainnursemanager.util.UdpSendUtil;
|
|
import com.zhy.http.okhttp.OkHttpUtils;
|
|
import com.zhy.http.okhttp.OkHttpUtils;
|
|
import com.zhy.http.okhttp.callback.StringCallback;
|
|
import com.zhy.http.okhttp.callback.StringCallback;
|
|
|
|
|
|
import org.greenrobot.eventbus.Subscribe;
|
|
import org.greenrobot.eventbus.Subscribe;
|
|
import org.greenrobot.eventbus.ThreadMode;
|
|
import org.greenrobot.eventbus.ThreadMode;
|
|
|
|
+import org.json.JSONArray;
|
|
import org.json.JSONException;
|
|
import org.json.JSONException;
|
|
import org.json.JSONObject;
|
|
import org.json.JSONObject;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
import butterknife.Bind;
|
|
import butterknife.Bind;
|
|
import butterknife.ButterKnife;
|
|
import butterknife.ButterKnife;
|
|
import okhttp3.Call;
|
|
import okhttp3.Call;
|
|
|
|
|
|
|
|
+import static com.wdkl.callingmainnursemanager.util.StringUtils.formateBankNumber;
|
|
import static com.wdkl.callingmainnursemanager.util.StringUtils.notEmpty;
|
|
import static com.wdkl.callingmainnursemanager.util.StringUtils.notEmpty;
|
|
import static com.wdkl.callingmainnursemanager.util.ToastUtil.showToast;
|
|
import static com.wdkl.callingmainnursemanager.util.ToastUtil.showToast;
|
|
|
|
|
|
@@ -82,6 +90,16 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
|
|
*/
|
|
*/
|
|
private DoctorHostEntity doctorHostEntity;
|
|
private DoctorHostEntity doctorHostEntity;
|
|
private ArrayList<DoctorHostEntity> doctorHostList;
|
|
private ArrayList<DoctorHostEntity> doctorHostList;
|
|
|
|
+
|
|
|
|
+ //科室列表
|
|
|
|
+ private PartInfoEntity partInfoEntity;
|
|
|
|
+
|
|
|
|
+ //科室数据
|
|
|
|
+ private HospitalInfoEntity hospitalInfoEntity;
|
|
|
|
+
|
|
|
|
+ //通话的状态
|
|
|
|
+ private String CALL_STATUS = Constants.STANDBY;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 医生主机的适配器
|
|
* 医生主机的适配器
|
|
*/
|
|
*/
|
|
@@ -171,7 +189,7 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
|
|
|
|
|
|
@Override
|
|
@Override
|
|
protected void initView(View RootView) {
|
|
protected void initView(View RootView) {
|
|
- ivEndCalling.setOnClickListener(this);
|
|
|
|
|
|
+ //ivEndCalling.setOnClickListener(this);
|
|
rvDoctor.addOnItemTouchListener(this);
|
|
rvDoctor.addOnItemTouchListener(this);
|
|
rvNurse.addOnItemTouchListener(this);
|
|
rvNurse.addOnItemTouchListener(this);
|
|
swipeNurseRefreshLayout.setOnRefreshListener(this);
|
|
swipeNurseRefreshLayout.setOnRefreshListener(this);
|
|
@@ -212,7 +230,7 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
|
|
//nurseManager.setOrientation(LinearLayoutManager.HORIZONTAL);
|
|
//nurseManager.setOrientation(LinearLayoutManager.HORIZONTAL);
|
|
GridLayoutManager nurseManager = new GridLayoutManager(getActivity(), 4);
|
|
GridLayoutManager nurseManager = new GridLayoutManager(getActivity(), 4);
|
|
rvNurse.setLayoutManager(nurseManager);
|
|
rvNurse.setLayoutManager(nurseManager);
|
|
- nurseHostAdapter = new NurseHostAdapter(getActivity(), nurseHostList);
|
|
|
|
|
|
+ nurseHostAdapter = new NurseHostAdapter(getActivity(), MyApplication.partInfoList);
|
|
rvNurse.setAdapter(nurseHostAdapter);
|
|
rvNurse.setAdapter(nurseHostAdapter);
|
|
nurseHostAdapter.setNurseHostItemOnclickListener(this);
|
|
nurseHostAdapter.setNurseHostItemOnclickListener(this);
|
|
|
|
|
|
@@ -229,8 +247,10 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
|
|
rvDutyNurses.setAdapter(dutyNurseAdapter);
|
|
rvDutyNurses.setAdapter(dutyNurseAdapter);
|
|
|
|
|
|
//getNurseHostList();
|
|
//getNurseHostList();
|
|
- getNurseHostTestData();
|
|
|
|
|
|
+ //getNurseHostTestData();
|
|
//getDoctorHostList();
|
|
//getDoctorHostList();
|
|
|
|
+ getAllPartInfo();
|
|
|
|
+ getAllDeviceInfo();
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -257,10 +277,12 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
|
|
public void onRefresh() {
|
|
public void onRefresh() {
|
|
resetRightList();
|
|
resetRightList();
|
|
//getNurseHostList();
|
|
//getNurseHostList();
|
|
- getNurseHostTestData();
|
|
|
|
|
|
+ //getNurseHostTestData();
|
|
|
|
+ getAllPartInfo();
|
|
}
|
|
}
|
|
|
|
|
|
- private void getNurseHostTestData() {
|
|
|
|
|
|
+ //test data
|
|
|
|
+ /*private void getNurseHostTestData() {
|
|
ArrayList<String> dutyDoctors = new ArrayList<>();
|
|
ArrayList<String> dutyDoctors = new ArrayList<>();
|
|
dutyDoctors.add("刘医生");
|
|
dutyDoctors.add("刘医生");
|
|
dutyDoctors.add("张医生");
|
|
dutyDoctors.add("张医生");
|
|
@@ -283,11 +305,86 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
|
|
if (swipeNurseRefreshLayout.isRefreshing()) {
|
|
if (swipeNurseRefreshLayout.isRefreshing()) {
|
|
swipeNurseRefreshLayout.setRefreshing(false);
|
|
swipeNurseRefreshLayout.setRefreshing(false);
|
|
}
|
|
}
|
|
|
|
+ }*/
|
|
|
|
+
|
|
|
|
+ private void getAllPartInfo() {
|
|
|
|
+ OkHttpUtils.post().url(Constants.URL + Constants.URL_END + Constants.CALLINGMAINNURSE_PART_INFO)
|
|
|
|
+ .build()
|
|
|
|
+ .execute(new StringCallback() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onError(Call call, Exception e, int id) {
|
|
|
|
+ if (swipeNurseRefreshLayout.isRefreshing()) {
|
|
|
|
+ swipeNurseRefreshLayout.setRefreshing(false);
|
|
|
|
+ }
|
|
|
|
+ hideProgress();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onResponse(String response, int id) {
|
|
|
|
+ if (swipeNurseRefreshLayout.isRefreshing()) {
|
|
|
|
+ swipeNurseRefreshLayout.setRefreshing(false);
|
|
|
|
+ }
|
|
|
|
+ if (notEmpty(response)) {
|
|
|
|
+ LogUtil.d(CallingHostFragment.class, "part info==" + response);
|
|
|
|
+ String code = getStringData(response, "Code");
|
|
|
|
+ if (code.equals("OK!")) {
|
|
|
|
+ String data = response.substring(0, response.length() - 4);
|
|
|
|
+ Gson gson = new Gson();
|
|
|
|
+ partInfoEntity = gson.fromJson(data, PartInfoEntity.class);
|
|
|
|
+ if (null != partInfoEntity) {
|
|
|
|
+ List<PartInfoEntity.PartInfo> list = partInfoEntity.getPartInfoArray();
|
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
|
+ MyApplication.partInfoList.clear();
|
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
|
+ //因为本机设定为总控主机,当成是一个特殊的科室,不需要显示在列表,所以需要过滤掉本机的partId
|
|
|
|
+ if (!Constants.PartID.equals(list.get(i).getID())) {
|
|
|
|
+ MyApplication.partInfoList.add(list.get(i));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ nurseHostAdapter.updateList(MyApplication.partInfoList);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ LogUtil.i(CallingHostFragment.class, "Code==" + code + "---数据返回错误!");
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ LogUtil.i(CallingHostFragment.class, "数据返回为空!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void getAllDeviceInfo() {
|
|
|
|
+ OkHttpUtils.post().url(Constants.URL + Constants.URL_END + Constants.CALLINGMAINNURSE_DEVICE_INFO)
|
|
|
|
+ .addParams("PartID", Constants.PartID)
|
|
|
|
+ .build()
|
|
|
|
+ .execute(new StringCallback() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onError(Call call, Exception e, int id) {
|
|
|
|
+ if (swipeNurseRefreshLayout.isRefreshing()) {
|
|
|
|
+ swipeNurseRefreshLayout.setRefreshing(false);
|
|
|
|
+ }
|
|
|
|
+ hideProgress();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onResponse(String response, int id) {
|
|
|
|
+ if (swipeNurseRefreshLayout.isRefreshing()) {
|
|
|
|
+ swipeNurseRefreshLayout.setRefreshing(false);
|
|
|
|
+ }
|
|
|
|
+ if (notEmpty(response)) {
|
|
|
|
+ LogUtil.d(CallingHostFragment.class, "device info==" + response);
|
|
|
|
+ } else {
|
|
|
|
+ LogUtil.i(CallingHostFragment.class, "数据返回为空!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
private void resetRightList() {
|
|
private void resetRightList() {
|
|
tvCallingTips.setText("");
|
|
tvCallingTips.setText("");
|
|
- nurse_CallStaus.setText("--");
|
|
|
|
|
|
+ nurse_CallStaus.setText("");
|
|
ivDoctorOrNurseCalling.setImageResource(R.mipmap.ic_trusteeship_n);
|
|
ivDoctorOrNurseCalling.setImageResource(R.mipmap.ic_trusteeship_n);
|
|
ivEndCalling.setVisibility(View.GONE);
|
|
ivEndCalling.setVisibility(View.GONE);
|
|
rlIncall.setVisibility(View.VISIBLE);
|
|
rlIncall.setVisibility(View.VISIBLE);
|
|
@@ -335,7 +432,7 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
|
|
/**
|
|
/**
|
|
* 获取医护主机列表信息
|
|
* 获取医护主机列表信息
|
|
*/
|
|
*/
|
|
- private void getNurseHostList() {
|
|
|
|
|
|
+ /*private void getNurseHostList() {
|
|
if (!StringUtils.notEmpty(Constants.PartID)) return;
|
|
if (!StringUtils.notEmpty(Constants.PartID)) return;
|
|
OkHttpUtils.post().url(Constants.URL + Constants.URL_END + Constants.CALLINGMAINNURSE_NURSELIST)
|
|
OkHttpUtils.post().url(Constants.URL + Constants.URL_END + Constants.CALLINGMAINNURSE_NURSELIST)
|
|
.addParams("PartID", Constants.PartID)
|
|
.addParams("PartID", Constants.PartID)
|
|
@@ -381,7 +478,7 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
// /**
|
|
// /**
|
|
// * 获取呼叫历史列表信息
|
|
// * 获取呼叫历史列表信息
|
|
@@ -402,14 +499,128 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
|
|
// });
|
|
// });
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
+
|
|
|
|
+ private void getPartData(String partId) {
|
|
|
|
+ if (!StringUtils.notEmpty(Constants.URL)) return;
|
|
|
|
+ if (!StringUtils.notEmpty(partId)) return;
|
|
|
|
+ OkHttpUtils.post().url(Constants.URL + Constants.URL_END + Constants.CALLINGMAINNURSE_HOSPITAL)
|
|
|
|
+ .addParams("PartID", partId)
|
|
|
|
+ .build()
|
|
|
|
+ .execute(new StringCallback() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onError(Call call, Exception e, int id) {
|
|
|
|
+ LogUtil.d("getPartData", "===error===");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onResponse(String response, int id) {
|
|
|
|
+ String data = response.substring(0, response.length() - 4);
|
|
|
|
+ LogUtil.d("getPartData", "data=="+data);
|
|
|
|
+ try {
|
|
|
|
+ JSONObject jsonObj = new JSONObject(data);
|
|
|
|
+ if (jsonObj.getString("Code").equals("ERROR!")) {
|
|
|
|
+ LogUtil.d("getPartData", "网络错误");
|
|
|
|
+ } else {
|
|
|
|
+ Gson gson = new Gson();
|
|
|
|
+ hospitalInfoEntity = gson.fromJson(data, HospitalInfoEntity.class);
|
|
|
|
+ ArrayList<String> doctorList = (ArrayList<String>) hospitalInfoEntity.getDutyDoctorList();
|
|
|
|
+ ArrayList<String> nurseList = (ArrayList<String>) hospitalInfoEntity.getNurseOnDutyList();
|
|
|
|
+ dutyDoctorAdapter.updateList(doctorList);
|
|
|
|
+ dutyNurseAdapter.updateList(nurseList);
|
|
|
|
+ }
|
|
|
|
+ } catch (JSONException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void getNurseHostInfo(String partId) {
|
|
|
|
+ try {
|
|
|
|
+ OkHttpUtils.post().url(Constants.URL + Constants.URL_END + Constants.CALLINGMAINNURSE_NURSELIST)
|
|
|
|
+ .addParams("PartID", partId)
|
|
|
|
+ .build()
|
|
|
|
+ .execute(new StringCallback() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onError(Call call, Exception e, int id) {
|
|
|
|
+ LogUtil.d("getNurseHostInfo", "===error===");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onResponse(String response, int id) {
|
|
|
|
+ try {
|
|
|
|
+ JSONObject jsonObj = new JSONObject(response);
|
|
|
|
+ if (jsonObj.getString("Code").equals("ERROR!")) {
|
|
|
|
+ LogUtil.d("getNurseHostInfo", "网络错误");
|
|
|
|
+ } else {
|
|
|
|
+ if (jsonObj.getString("Code").equals("OK!")) {
|
|
|
|
+ String data = jsonObj.getString("hostList");
|
|
|
|
+ JSONArray array = new JSONArray(data);
|
|
|
|
+ Gson gson = new Gson();
|
|
|
|
+ List<NurseHostListInfo> nurseHostList = new ArrayList<>();
|
|
|
|
+ for (int i = 0; i < array.length(); i++) {
|
|
|
|
+ NurseHostListInfo nurseHostListInfo = gson.fromJson(array.get(i).toString(), NurseHostListInfo.class);
|
|
|
|
+ nurseHostList.add(nurseHostListInfo);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (nurseHostList.size() > 0 && nurseHostList.get(0) != null) {
|
|
|
|
+ NurseHostListInfo hostInfo = nurseHostList.get(0);
|
|
|
|
+ final String hostId = hostInfo.getDeviceHostingID();
|
|
|
|
+ //final String sip = hostInfo.getDeviceSipIp();
|
|
|
|
+ //final String name = hostInfo.getDeviceName();
|
|
|
|
+ ivEndCalling.setOnClickListener(new View.OnClickListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onClick(View v) {
|
|
|
|
+ getActivity().runOnUiThread(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ callClick(hostId);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ LogUtil.d("Code", "网络错误");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } catch (JSONException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void callClick(String hostId) {
|
|
|
|
+ if (CALL_STATUS.equals(Constants.STANDBY)) {
|
|
|
|
+ //呼叫中
|
|
|
|
+ ivEndCalling.setBackgroundResource(R.mipmap.ic_calling_sickbed_right_hang_up);
|
|
|
|
+ nurse_CallStaus.setText("正在呼叫...");
|
|
|
|
+ UdpSendUtil.sendNurseHostCall(hostId);
|
|
|
|
+ CALL_STATUS = Constants.IN_CALL;
|
|
|
|
+ Constants.CALLING_HOST_ID = hostId;
|
|
|
|
+ } else {
|
|
|
|
+ //挂断
|
|
|
|
+ ivEndCalling.setBackgroundResource(R.mipmap.ic_calling_sickbed_right_calling);
|
|
|
|
+ nurse_CallStaus.setText("");
|
|
|
|
+ UdpSendUtil.sendNurseHostHangUp(hostId);
|
|
|
|
+ CALL_STATUS = Constants.STANDBY;
|
|
|
|
+ Constants.CALLING_HOST_ID = "";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public void onClick(View view) {
|
|
public void onClick(View view) {
|
|
- switch (view.getId()) {
|
|
|
|
|
|
+ /*switch (view.getId()) {
|
|
case R.id.fragment_iv_end_calling: //右边的挂断
|
|
case R.id.fragment_iv_end_calling: //右边的挂断
|
|
ivEndCalling.setBackgroundResource(R.mipmap.ic_calling_sickbed_right_hang_up);
|
|
ivEndCalling.setBackgroundResource(R.mipmap.ic_calling_sickbed_right_hang_up);
|
|
nurse_CallStaus.setText("正在连接中...");
|
|
nurse_CallStaus.setText("正在连接中...");
|
|
break;
|
|
break;
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -447,31 +658,29 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public void nurseHostItemOnclick(View view, int position) {
|
|
public void nurseHostItemOnclick(View view, int position) {
|
|
- if (null == nurseHostList || nurseHostList.size() <= 0 || null == nurseHostList.get(position))
|
|
|
|
|
|
+ if (MyApplication.partInfoList.size() <= 0 || null == MyApplication.partInfoList.get(position)) {
|
|
return;
|
|
return;
|
|
- NurseHostListInfo info = nurseHostList.get(position);
|
|
|
|
- if (info.isChecked()) {
|
|
|
|
- //nurseHostList.get(position).setChecked(false);
|
|
|
|
- //rlIncall.setVisibility(View.GONE);
|
|
|
|
- //rlNotInCallBg.setVisibility(View.VISIBLE);
|
|
|
|
- //tvCallingTips.setText("");
|
|
|
|
- } else {
|
|
|
|
- for (NurseHostListInfo entity : nurseHostList) {
|
|
|
|
|
|
+ }
|
|
|
|
+ PartInfoEntity.PartInfo info = MyApplication.partInfoList.get(position);
|
|
|
|
+ if (!info.isChecked()) {
|
|
|
|
+ for (PartInfoEntity.PartInfo entity : MyApplication.partInfoList) {
|
|
if (null == entity) continue;
|
|
if (null == entity) continue;
|
|
entity.setChecked(false);
|
|
entity.setChecked(false);
|
|
}
|
|
}
|
|
info.setChecked(true);
|
|
info.setChecked(true);
|
|
- tvCallingTips.setText(info.getDeviceName());
|
|
|
|
- nurse_CallStaus.setText(info.getDeviceName());
|
|
|
|
|
|
+ nurseHostAdapter.notifyDataSetChanged();
|
|
|
|
+
|
|
|
|
+ tvCallingTips.setText(info.getPART_NAME());
|
|
|
|
+ //nurse_CallStaus.setText(info.getPART_NAME());
|
|
ivDoctorOrNurseCalling.setImageResource(R.mipmap.ic_nurse_right_in_call);
|
|
ivDoctorOrNurseCalling.setImageResource(R.mipmap.ic_nurse_right_in_call);
|
|
ivEndCalling.setBackgroundResource(R.mipmap.ic_calling_sickbed_right_calling);
|
|
ivEndCalling.setBackgroundResource(R.mipmap.ic_calling_sickbed_right_calling);
|
|
ivEndCalling.setVisibility(View.VISIBLE);
|
|
ivEndCalling.setVisibility(View.VISIBLE);
|
|
rlIncall.setVisibility(View.VISIBLE);
|
|
rlIncall.setVisibility(View.VISIBLE);
|
|
rlNotInCallBg.setVisibility(View.GONE);
|
|
rlNotInCallBg.setVisibility(View.GONE);
|
|
|
|
+
|
|
|
|
+ getPartData(info.getID());
|
|
|
|
+ getNurseHostInfo(info.getID());
|
|
}
|
|
}
|
|
- nurseHostAdapter.notifyDataSetChanged();
|
|
|
|
- dutyDoctorAdapter.updateList(info.getDutyDoctorList());
|
|
|
|
- dutyNurseAdapter.updateList(info.getNurseOnDutyList());
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -508,6 +717,17 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
|
|
|
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
public void onMoonEvent(MessageEvent messageEvent) {
|
|
public void onMoonEvent(MessageEvent messageEvent) {
|
|
|
|
+ if (messageEvent.getType() == Constants.EVENT_UDP2) {
|
|
|
|
+ UdpEntity udpEntity = (UdpEntity) messageEvent.getMessage();
|
|
|
|
+ String nurseHostID = udpEntity.getNurseHostID();
|
|
|
|
+ if (Constants.CALLING_HOST_ID.equals(nurseHostID)) {
|
|
|
|
+ //对方挂断
|
|
|
|
+ ivEndCalling.setBackgroundResource(R.mipmap.ic_calling_sickbed_right_calling);
|
|
|
|
+ nurse_CallStaus.setText("");
|
|
|
|
+ CALL_STATUS = Constants.STANDBY;
|
|
|
|
+ Constants.CALLING_HOST_ID = "";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|