Browse Source

<客户需求:院级总机,可以查看下辖科室所有护士主机并能通话,还能和各分机通话,修改了一些界面,还需要服务端修改接口来满足数据交互>

weizhengliang 5 years ago
parent
commit
e3ce048b6d

+ 21 - 0
app/build.gradle

@@ -1,6 +1,21 @@
 apply plugin: 'com.android.application'
 
 android {
+    signingConfigs {
+        release {
+            storeFile file("keystore_wuyuqing_3128/rk3128.jks")
+            storePassword "111111"
+            keyAlias "rk3128"
+            keyPassword "111111"
+        }
+        debug {
+            storeFile file("keystore_wuyuqing_3128/rk3128.jks")
+            storePassword "111111"
+            keyAlias "rk3128"
+            keyPassword "111111"
+        }
+    }
+
     compileSdkVersion 26
     buildToolsVersion "26.0.1"
     defaultConfig {
@@ -15,7 +30,13 @@ android {
         buildConfigField "String", "BUILD_TIME", getDate()
     }
     buildTypes {
+        debug {
+            signingConfig signingConfigs.debug
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+        }
         release {
+            signingConfig signingConfigs.release
             minifyEnabled false
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
         }

+ 12 - 8
app/src/main/java/com/wdkl/callingmainnurse/adapter/SicknessRoomAdapter.java

@@ -62,16 +62,19 @@ public class SicknessRoomAdapter extends RecyclerView.Adapter<SicknessRoomAdapte
         if (position == 0) {
             //设置第一个item的UI
             holder.standby_top_Img.setVisibility(View.GONE);
-            holder.tvBedNum.setVisibility(View.GONE);
-            holder.tvRoomNum.setVisibility(View.GONE);
-            holder.tvTitle.setVisibility(View.VISIBLE);
+            //holder.tvBedNum.setVisibility(View.GONE);
+            //holder.tvRoomNum.setVisibility(View.GONE);
+            //holder.tvTitle.setVisibility(View.VISIBLE);
+            holder.tvRoomNum.setText("选择科室");
+            holder.tvBedNum.setText("");
+
             //获取全局的呼叫列表
-            if (((MyApplication) mcontext.getApplicationContext()).callEntityList.size() > 0) {
+            /*if (((MyApplication) mcontext.getApplicationContext()).callEntityList.size() > 0) {
                 holder.tvPoint.setText(((MyApplication) mcontext.getApplicationContext()).callEntityList.size() + "");
                 holder.tvPoint.setVisibility(View.VISIBLE);
             } else {
                 holder.tvPoint.setVisibility(View.GONE);
-            }
+            }*/
 
         } else {
             holder.tvTitle.setVisibility(View.GONE);
@@ -112,14 +115,15 @@ public class SicknessRoomAdapter extends RecyclerView.Adapter<SicknessRoomAdapte
         //点中item 的逻辑
         //如果选中的是第一个
         if (selectedPosition == 0) {
-            if (selectedPosition == position) {
+            /*if (selectedPosition == position) {
                 holder.rlCallMain.setBackgroundResource(R.mipmap.bg_call_list_p);
             } else {
                 holder.rlCallMain.setBackgroundResource(R.mipmap.bg_stanby_n);
-            }
+            }*/
+            holder.rlCallMain.setBackgroundResource(R.mipmap.bg_stanby_n);
         } else {
             if (position == 0) {
-                holder.rlCallMain.setBackgroundResource(R.mipmap.bg_call_list_n);
+                holder.rlCallMain.setBackgroundResource(R.mipmap.bg_stanby_n);
             } else {
                 if (selectedPosition == position) {
                     if (list.get(position).isNursing()) {

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

@@ -233,6 +233,8 @@ public class Constants {
      */
     public static String PartID = "";
 
+    public static String PartName = "";
+
     public static int currentFragment = 0;
     /**
      * 白天还是晚上<br>

+ 1 - 0
app/src/main/java/com/wdkl/callingmainnurse/ui/activity/InitActivity.java

@@ -306,6 +306,7 @@ public class InitActivity extends BaseActivity implements SerialPortUtil.IForBro
             Constants.MYSELF_ID = initDataEntity.getId();
             Constants.CALLMAIN_ID = initDataEntity.getDeviceHostingID();
             Constants.PartID = initDataEntity.getPartId();
+            Constants.PartName = initDataEntity.getDepartment();
 
             initDataEntity.getDeviceNurse_Level0();
             setSystemTime(initDataEntity);

+ 10 - 9
app/src/main/java/com/wdkl/callingmainnurse/ui/activity/MainFragmentActivity.java

@@ -349,7 +349,8 @@ public class MainFragmentActivity extends FragmentActivity implements IVvsipServ
         try {
             //初始化数据
             initDataEntity = (InitDataEntity) getIntent().getExtras().get(Constants.INITENTITY);
-            tvHospital.setText(initDataEntity.getHospital() + initDataEntity.getDepartment());
+            //tvHospital.setText(initDataEntity.getHospital() + initDataEntity.getDepartment());
+            tvHospital.setText(initDataEntity.getHospital());
 
 
         } catch (Exception e) {
@@ -528,6 +529,14 @@ public class MainFragmentActivity extends FragmentActivity implements IVvsipServ
         hideFragments(transaction);
         switch (index) {
             case 0:
+                if (callingDoctorFragment == null) {
+                    callingDoctorFragment = new CallingHostFragment();
+                    transaction.add(R.id.show_fragment_fl, callingDoctorFragment);
+                } else {
+                    transaction.show(callingDoctorFragment);
+                }
+                break;
+            case 1:
                 //callingSickBedFragment callingDoctorFragment
                 // broadcastFragment  systemSettingFragment  trusteeshipFragment
                 if (callingSickBedFragment == null) {
@@ -539,14 +548,6 @@ public class MainFragmentActivity extends FragmentActivity implements IVvsipServ
                     transaction.show(callingSickBedFragment);
                 }
                 break;
-            case 1:
-                if (callingDoctorFragment == null) {
-                    callingDoctorFragment = new CallingHostFragment();
-                    transaction.add(R.id.show_fragment_fl, callingDoctorFragment);
-                } else {
-                    transaction.show(callingDoctorFragment);
-                }
-                break;
             case 2:
                 if (broadcastFragment == null) {
                     broadcastFragment = new BroadcastFragment();

+ 47 - 4
app/src/main/java/com/wdkl/callingmainnurse/ui/fragment/CallingBedFragment.java

@@ -1,11 +1,13 @@
 package com.wdkl.callingmainnurse.ui.fragment;
 
 import android.annotation.SuppressLint;
+import android.content.DialogInterface;
 import android.content.Intent;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
 import android.support.v4.widget.SwipeRefreshLayout;
+import android.support.v7.app.AlertDialog;
 import android.support.v7.widget.GridLayoutManager;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
@@ -15,9 +17,12 @@ import android.view.LayoutInflater;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.ScrollView;
+import android.widget.Spinner;
 import android.widget.TextView;
 
 import com.google.gson.Gson;
@@ -158,6 +163,10 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
 
     @Bind(R.id.fragment_call_sickbed_room_tv_list_title)
     TextView tvTitle;
+
+    @Bind(R.id.tv_part_title)
+    TextView tvPartTitle;
+
     /**
      * 病房适配器
      */
@@ -440,6 +449,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
         vRightPatientInfo.setVisibility(View.VISIBLE);
         vRightCallInfo.setVisibility(View.GONE);
         vRightCallListInfo.setVisibility(View.GONE);
+        tvPartTitle.setText("当前科室: " + Constants.PartName);
         //默认设置
         rvCallBed.addOnItemTouchListener(new RecyclerView.OnItemTouchListener() {
             @Override
@@ -528,7 +538,7 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
         //获得医院信息
         getHospitalData();
         //初始化排队信息栏数据
-        initCallingQueuingInfo();
+        //initCallingQueuingInfo();
         MainFragmentActivity.initCallVoiceShowProgress();//add by waderson 20190801 SIP通话音量不能保存?要动态设置??曹强的东西真搞不懂他
     }
 
@@ -1031,12 +1041,13 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
         }
         //重置床位数据
         if (position == 0) {
-            sickbedInformationList = null;
-            callListAdapter.updateList(((MyApplication) getActivity().getApplication()).callEntityList);
+            //sickbedInformationList = null;
+            //callListAdapter.updateList(((MyApplication) getActivity().getApplication()).callEntityList);
             rvCallBed.setVisibility(View.GONE);
             rvCallList.setVisibility(View.VISIBLE);
             llBgList.setBackgroundResource(R.mipmap.bg_call_list);
-            tvTitle.setText("呼叫列表");
+            //tvTitle.setText("呼叫列表");
+            showPartSelectDialog();
         } else {
             llBgList.setBackgroundResource(R.mipmap.bg_bed_list);
             tvTitle.setText("床位列表");
@@ -1118,6 +1129,38 @@ public class CallingBedFragment extends BaseFragment implements SicknessBedAdapt
         }
     }
 
+    private void showPartSelectDialog() {
+        final String[] partItems = {Constants.PartName};  //test
+        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
+        builder.setTitle("请选择科室");
+        builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
+            @Override
+            public void onClick(DialogInterface dialog, int which) {
+                //
+            }
+        });
+        AlertDialog dialog = builder.create();
+        //dialog.setCanceledOnTouchOutside(false);
+        View dialogView = View.inflate(getActivity(), R.layout.dialog_part_select_layout, null);
+        ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_item, partItems);
+        spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+        Spinner partSpinner = dialogView.findViewById(R.id.sp_part_select);
+        partSpinner.setAdapter(spinnerAdapter);
+        partSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+            @Override
+            public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
+                Log.d("wzl", "on item selected: " + position);
+            }
+
+            @Override
+            public void onNothingSelected(AdapterView<?> parent) {
+
+            }
+        });
+        dialog.setView(dialogView);
+        dialog.show();
+    }
+
     private void setPatientView(RoomEntity.WardInformation.SickbedInformation bedEntity) {
         if (null != bedEntity) {
             tvRoomBedAnswerState.setText(wardInformationList.get(this.position).getRoomNum() + "房" + bedEntity.getBedNum() + "床");

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

@@ -162,7 +162,7 @@ public class CallingHostFragment extends BaseFragment implements DoctorHostAdapt
     @Override
     protected void initData() {
         initRecyclerManager();
-        initCallQueuingInfoBarData();
+        //initCallQueuingInfoBarData();
     }
 
     @Override

+ 7 - 8
app/src/main/java/com/wdkl/callingmainnurse/widget/dialog/CallingPopUpWindow.java

@@ -158,20 +158,19 @@ public class CallingPopUpWindow implements View.OnClickListener {
     @Override
     public void onClick(View view) {
         switch (view.getId()) {
-            case R.id.activity_main_layout_ll_sickness_bed_call:
-                resetBtn();
-                EventBus.getDefault().post(new MessageEvent(0, Constants.EVENT_FRAGMENT));
-                ivSickNessCall.setImageResource(R.mipmap.main_left_patient_bed_call_sel);
-                tvSickNessCall.setTextColor(ContextCompat.getColor(mContext, R.color.yellow_color));
-
-                break;
             case R.id.activity_main_layout_ll_call_doctor:
                 resetBtn();
-                EventBus.getDefault().post(new MessageEvent(1, Constants.EVENT_FRAGMENT));
+                EventBus.getDefault().post(new MessageEvent(0, Constants.EVENT_FRAGMENT));
                 ivCallDoctor.setImageResource(R.mipmap.main_left_calling_doctor_sel);
                 tvCallDoctor.setTextColor(ContextCompat.getColor(mContext, R.color.yellow_color));
                 tvMedicaHosts.setTextColor(ContextCompat.getColor(mContext, R.color.yellow_color));
                 break;
+            case R.id.activity_main_layout_ll_sickness_bed_call:
+                resetBtn();
+                EventBus.getDefault().post(new MessageEvent(1, Constants.EVENT_FRAGMENT));
+                ivSickNessCall.setImageResource(R.mipmap.main_left_patient_bed_call_sel);
+                tvSickNessCall.setTextColor(ContextCompat.getColor(mContext, R.color.yellow_color));
+                break;
             case R.id.activity_main_layout_ll_broadcast:
                 resetBtn();
                 EventBus.getDefault().post(new MessageEvent(2, Constants.EVENT_FRAGMENT));

+ 27 - 25
app/src/main/res/layout/activity_main_sideslip_popu_window.xml

@@ -6,7 +6,7 @@
 
     <TextView
         android:layout_width="match_parent"
-        android:layout_height="@dimen/margin_40dp"></TextView>
+        android:layout_height="@dimen/margin_40dp"/>
 
     <LinearLayout
         android:layout_width="150dp"
@@ -16,74 +16,73 @@
         android:orientation="vertical">
 
         <LinearLayout
-            android:id="@+id/activity_main_layout_ll_sickness_bed_call"
+            android:id="@+id/activity_main_layout_ll_call_doctor"
             android:layout_width="match_parent"
             android:layout_height="0dp"
             android:layout_marginTop="@dimen/margin_25dp"
+            android:layout_gravity="center"
             android:layout_weight="1"
             android:gravity="center"
             android:orientation="vertical">
 
             <ImageView
-                android:id="@+id/activity_main_layout_iv_sickness_bed_call"
+                android:id="@+id/activity_main_layout_iv_call_doctor"
                 android:layout_width="90dp"
                 android:layout_height="90dp"
-                android:background="@mipmap/main_left_patient_bed_call_sel" />
+                android:background="@mipmap/main_left_calling_doctor_def" />
 
             <TextView
-                android:id="@+id/activity_main_layout_tv_sickness_bed_call"
+                android:id="@+id/activity_main_layout_tv_call_doctor"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
+                android:layout_gravity="center"
                 android:layout_marginTop="-10dp"
                 android:gravity="center"
-                android:text="病床呼叫"
+                android:text="主机呼叫"
                 android:textColor="@color/yellow_color"
                 android:textSize="@dimen/text_size_15px"
                 android:textStyle="bold"
                 android:typeface="serif" />
 
+            <TextView
+                android:id="@+id/activity_main_layout_tv_medicalHosts"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:gravity="center"
+                android:text=""
+                android:textColor="@color/white"
+                android:textSize="@dimen/margin_10dp"
+                android:textStyle="bold"
+                android:typeface="serif" />
+
         </LinearLayout>
 
         <LinearLayout
-            android:id="@+id/activity_main_layout_ll_call_doctor"
+            android:id="@+id/activity_main_layout_ll_sickness_bed_call"
             android:layout_width="match_parent"
             android:layout_height="0dp"
-            android:layout_gravity="center"
             android:layout_weight="1"
             android:gravity="center"
-            android:visibility="gone"
             android:orientation="vertical">
 
             <ImageView
-                android:id="@+id/activity_main_layout_iv_call_doctor"
+                android:id="@+id/activity_main_layout_iv_sickness_bed_call"
                 android:layout_width="90dp"
                 android:layout_height="90dp"
-                android:background="@mipmap/main_left_calling_doctor_def" />
+                android:background="@mipmap/main_left_patient_bed_call_sel" />
 
             <TextView
-                android:id="@+id/activity_main_layout_tv_call_doctor"
+                android:id="@+id/activity_main_layout_tv_sickness_bed_call"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_gravity="center"
                 android:layout_marginTop="-10dp"
                 android:gravity="center"
-                android:text="主机呼叫"
+                android:text="病床呼叫"
                 android:textColor="@color/white"
                 android:textSize="@dimen/text_size_15px"
                 android:textStyle="bold"
                 android:typeface="serif" />
 
-            <TextView
-                android:id="@+id/activity_main_layout_tv_medicalHosts"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:gravity="center"
-                android:text=""
-                android:textColor="@color/white"
-                android:textSize="@dimen/margin_10dp"
-                android:textStyle="bold"
-                android:typeface="serif" />
-
         </LinearLayout>
 
         <LinearLayout
@@ -92,6 +91,7 @@
             android:layout_height="0dp"
             android:layout_weight="1"
             android:gravity="center"
+            android:visibility="gone"
             android:orientation="vertical">
 
             <ImageView
@@ -120,6 +120,7 @@
             android:layout_height="0dp"
             android:layout_weight="1"
             android:gravity="center"
+            android:visibility="gone"
             android:orientation="vertical">
 
             <ImageView
@@ -149,6 +150,7 @@
             android:layout_height="0dp"
             android:layout_weight="1"
             android:gravity="center"
+            android:visibility="gone"
             android:orientation="vertical">
 
             <ImageView

+ 22 - 0
app/src/main/res/layout/dialog_part_select_layout.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:padding="10dp">
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="16dp"
+        android:text="科室名称:"
+        android:textSize="20sp"/>
+    <Spinner
+        android:id="@+id/sp_part_select"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center"
+        android:layout_marginStart="20dp"
+        android:layout_marginEnd="20dp"
+        android:textSize="20sp" />
+</LinearLayout>

+ 12 - 1
app/src/main/res/layout/fragment_calling_sick_bed.xml

@@ -15,10 +15,21 @@
         android:layout_toLeftOf="@+id/fragment_sick_bed_layout_rv_right"
         android:orientation="vertical">
 
+        <TextView
+            android:id="@+id/tv_part_title"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:padding="4dp"
+            android:layout_centerHorizontal="true"
+            android:layout_alignParentTop="true"
+            android:textSize="24sp"
+            android:text="当前科室: " />
+
         <android.support.v4.widget.SwipeRefreshLayout
             android:id="@+id/fragment_calling_bed_layout_sr_refresh"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
+            android:layout_below="@id/tv_part_title"
             android:layout_above="@+id/fragment_ll_sickbed_bg">
 
             <android.support.v7.widget.RecyclerView
@@ -74,7 +85,7 @@
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:ems="1"
-                android:text="呼叫列表"
+                android:text="床位列表"
                 android:gravity="center"
                 android:textSize="21sp" />
         </LinearLayout>

+ 4 - 3
app/src/main/res/layout/fragment_calling_sickbed_sickness_room_adapter_layout.xml

@@ -66,10 +66,11 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginTop="2dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginRight="2dp"
+                android:layout_gravity="center_horizontal"
                 android:text=""
                 android:textColor="@color/black"
-
-
                 android:textSize="@dimen/text_size_13px" />
         </LinearLayout>
     </RelativeLayout>
@@ -84,6 +85,6 @@
         android:layout_marginTop="2dp"
         android:textColor="@color/black"
         android:textSize="@dimen/text_size_15px"
-        android:text="呼叫列表"
+        android:text="选择科室"
         android:visibility="gone" />
 </RelativeLayout>

+ 4 - 4
app/src/main/res/layout/fragment_medical_hosts_call_queuing_info_bar_layout.xml

@@ -25,9 +25,8 @@
             android:id="@+id/fragment_rv_calling_queuing_info_bar"
             android:layout_width="match_parent"
             android:layout_height="240dp"
-            android:overScrollMode="never">
-
-        </android.support.v7.widget.RecyclerView>
+            android:overScrollMode="never"
+            android:background="@drawable/shape_medical_host_not_in_call_bg"/>
 
         <TextView
             android:id="@+id/fragment_tv_calling_tips"
@@ -46,7 +45,8 @@
             android:id="@+id/fragment_rl_not_in_call_bg"
             android:layout_width="match_parent"
             android:layout_height="400dp"
-            android:background="@drawable/shape_medical_host_not_in_call_bg"></RelativeLayout>
+            android:background="@drawable/shape_medical_host_not_in_call_bg">
+        </RelativeLayout>
 
         <RelativeLayout
             android:id="@+id/fragment_medical_host_rl_in_call"

+ 4 - 3
app/src/main/res/layout/fragment_right_in_calling_layout.xml

@@ -10,7 +10,8 @@
         android:layout_above="@+id/fragment_calling_right_layout_ll_bottom"
         android:layout_centerHorizontal="true"
         android:background="@drawable/fragment_call_sickbed_right_bg_shape"
-        android:orientation="vertical">
+        android:orientation="vertical"
+        android:visibility="gone">
 
         <TextView
             android:id="@+id/fragment_rv_calling_textinfo"
@@ -30,7 +31,7 @@
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:layout_below="@+id/fragment_rv_calling_textinfo"
-            android:overScrollMode="never"></android.support.v7.widget.RecyclerView>
+            android:overScrollMode="never" />
 
         <TextView
             android:id="@+id/fragment_rv_calling_nodatainfomation"
@@ -54,7 +55,7 @@
     <LinearLayout
         android:id="@+id/fragment_calling_right_layout_ll_bottom"
         android:layout_width="300dp"
-        android:layout_height="wrap_content"
+        android:layout_height="match_parent"
         android:layout_above="@+id/fragment_calling_right_layout_ll_call"
         android:layout_centerHorizontal="true"
         android:background="@drawable/shape_call_scroll_info_bar"

+ 1 - 1
app/src/main/res/values/strings.xml

@@ -1,5 +1,5 @@
 <resources>
-    <string name="app_name">护士机</string>
+    <string name="app_name">护士机</string>
     <string name="loading_title">努力加载中</string>
     <!--初始化提示String-->
     <string name="DEVICE_NULL">设备未启用</string>