Browse Source

病危护理项底色使用对应护理项颜色

weizhengliang 2 years ago
parent
commit
678ca16279

+ 60 - 54
android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/adapter/FrameBedVosConfinementAdapter.kt

@@ -72,74 +72,80 @@ class FrameBedVosConfinementAdapter(val data: ArrayList<FrameBedVO>) : BaseDeleg
      */
     override fun onBindViewHolder(holder: BaseRecyclerViewHolder<AdapterHospitalFramePartBinding>?, position: Int) {
         holder?.bind { binding ->
-            val itemData = getItem(position)
-            if (itemData.customerName != null) {
-                binding.patientNameTv.text = itemData.customerName
-            } else {
-                binding.patientImagev.setImageResource(R.drawable.kong_chuang)
-                binding.patientNameTv.setText(R.string.empty_bed)
-            }
+            try {
+                val itemData = getItem(position)
+                if (itemData.customerName != null) {
+                    binding.patientNameTv.text = itemData.customerName
+                } else {
+                    binding.patientImagev.setImageResource(R.drawable.kong_chuang)
+                    binding.patientNameTv.setText(R.string.empty_bed)
+                }
 
-            if (itemData.customerAge != null) {
-                binding.patientAgeTv.text = itemData.customerAge.toString() + itemData.customerAgeUnit
-            } else {
-                binding.patientAgeTv.text = "--"
-            }
+                if (itemData.customerAge != null) {
+                    binding.patientAgeTv.text =
+                        itemData.customerAge.toString() + itemData.customerAgeUnit
+                } else {
+                    binding.patientAgeTv.text = "--"
+                }
 
-            binding.roomNumberTv.text = itemData.frameBed.fullName
-            binding.roomNumberTv.setTextColor(Color.parseColor("#2F9DF1"))
-
-            var critical = false
-            binding.rlBedInfo.setBackgroundResource(R.drawable.item_selector)
-            if (itemData.nurseConfigDtos != null && itemData.nurseConfigDtos.size > 0) {
-                for (nurseConfig in itemData.nurseConfigDtos) {
-                    if (nurseConfig.boolCritical != null && nurseConfig.boolCritical) {
-                        binding.roomNumberTv.setTextColor(Color.WHITE)
-                        //病危标识
-                        binding.rlBedInfo.setBackgroundResource(R.drawable.item_selector_critical)
-                        binding.tvNurseConfigName.text = nurseConfig.nurseConfigName
-                        if (!TextUtils.isEmpty(nurseConfig.nurseColorRbg)) {
+                binding.roomNumberTv.text = itemData.frameBed.fullName
+                binding.roomNumberTv.setTextColor(Color.parseColor("#2F9DF1"))
+
+                var critical = false
+                binding.rlBedInfo.setBackgroundResource(R.drawable.item_selector)
+                if (itemData.nurseConfigDtos != null && itemData.nurseConfigDtos.size > 0) {
+                    for (nurseConfig in itemData.nurseConfigDtos) {
+                        if (nurseConfig.boolCritical != null && nurseConfig.boolCritical) {
+                            binding.roomNumberTv.setTextColor(Color.WHITE)
+                            //病危标识
+                            binding.tvNurseConfigName.text = nurseConfig.nurseConfigName
+                            if (!TextUtils.isEmpty(nurseConfig.nurseColorRbg)) {
+                                binding.rlBedInfo.setBackgroundColor(Color.parseColor("#" + nurseConfig.nurseColorRbg))
+                                binding.tvNurseConfigColor.visibility = View.VISIBLE
+                                binding.tvNurseConfigColor.setBackgroundColor(Color.parseColor("#" + nurseConfig.nurseColorRbg))
+                                binding.tvNurseConfigColor.text = nurseConfig.nurseOptionName
+                            } else {
+                                binding.rlBedInfo.setBackgroundResource(R.color.color_critical)
+                                binding.tvNurseConfigColor.text = ""
+                                binding.tvNurseConfigColor.visibility = View.INVISIBLE
+                            }
+                            critical = true
+                            break
+                        }
+                    }
+
+                    if (!critical) {
+                        val nurseItem = itemData.nurseConfigDtos.get(0)
+                        binding.tvNurseConfigName.text = nurseItem.nurseConfigName
+                        if (!TextUtils.isEmpty(nurseItem.nurseColorRbg)) {
+                            binding.tvNurseConfigColor.text = nurseItem.nurseOptionName
                             binding.tvNurseConfigColor.visibility = View.VISIBLE
-                            binding.tvNurseConfigColor.setBackgroundColor(Color.parseColor("#" + nurseConfig.nurseColorRbg))
-                            binding.tvNurseConfigColor.text = nurseConfig.nurseOptionName
+                            binding.tvNurseConfigColor.setBackgroundColor(Color.parseColor("#" + nurseItem.nurseColorRbg))
                         } else {
                             binding.tvNurseConfigColor.text = ""
                             binding.tvNurseConfigColor.visibility = View.INVISIBLE
                         }
-                        critical = true
-                        break
                     }
+                } else {
+                    binding.tvNurseConfigName.text = ""
+                    binding.tvNurseConfigColor.text = ""
+                    binding.tvNurseConfigColor.visibility = View.INVISIBLE
                 }
 
-                if (!critical) {
-                    val nurseItem = itemData.nurseConfigDtos.get(0)
-                    binding.tvNurseConfigName.text = nurseItem.nurseConfigName
-                    if (!TextUtils.isEmpty(nurseItem.nurseColorRbg)) {
-                        binding.tvNurseConfigColor.text = nurseItem.nurseOptionName
-                        binding.tvNurseConfigColor.visibility = View.VISIBLE
-                        binding.tvNurseConfigColor.setBackgroundColor(Color.parseColor("#" + nurseItem.nurseColorRbg))
+                if (itemData.customerSex != null) {
+                    binding.sexImagev.visibility = View.VISIBLE
+                    if (itemData.customerSex == 1) {
+                        binding.sexImagev.setImageResource(R.drawable.man)
+                        binding.patientImagev.setImageResource(R.drawable.bing_ren_xiang_qing_man)
                     } else {
-                        binding.tvNurseConfigColor.text = ""
-                        binding.tvNurseConfigColor.visibility = View.INVISIBLE
+                        binding.sexImagev.setImageResource(R.drawable.nv)
+                        binding.patientImagev.setImageResource(R.drawable.bing_ren_xiang_qing)
                     }
-                }
-            } else {
-                binding.tvNurseConfigName.text = ""
-                binding.tvNurseConfigColor.text = ""
-                binding.tvNurseConfigColor.visibility = View.INVISIBLE
-            }
-
-            if (itemData.customerSex != null) {
-                binding.sexImagev.visibility = View.VISIBLE
-                if (itemData.customerSex == 1) {
-                    binding.sexImagev.setImageResource(R.drawable.man)
-                    binding.patientImagev.setImageResource(R.drawable.bing_ren_xiang_qing_man)
                 } else {
-                    binding.sexImagev.setImageResource(R.drawable.nv)
-                    binding.patientImagev.setImageResource(R.drawable.bing_ren_xiang_qing)
+                    binding.sexImagev.visibility = View.GONE
                 }
-            } else {
-                binding.sexImagev.visibility = View.GONE
+            } catch (ex: Exception) {
+                ex.printStackTrace()
             }
 
             //Log.e("FrameBedVosAdapter ", "FrameBedVosAdapter...." + itemData.customerName)

+ 4 - 0
android_host/src/main/h10_wke_1h/java/com/wdkl/ncs/android/component/nursehome/fragment/SipCallFragment.kt

@@ -15,6 +15,7 @@ import com.wdkl.ncs.android.lib.utils.showMessage
 import com.wdkl.ncs.android.middleware.common.Constants
 import com.wdkl.ncs.android.middleware.model.bean.SettingConfiguration
 import com.wdkl.ncs.android.middleware.model.dos.InteractionDO
+import com.wdkl.ncs.android.middleware.tcp.TcpClient
 import com.wdkl.ncs.android.middleware.tcp.channel.DeviceChannel
 import com.wdkl.ncs.android.middleware.tcp.channel.VoiceUtil
 import com.wdkl.ncs.android.middleware.tcp.dto.TcpModel
@@ -69,6 +70,9 @@ class SipCallFragment: BaseCallFragment() {
                 showCallView(false)
                 Constants.CALL_STATE = Constants.CALL_CALLING
                 DeviceChannel.calling = true
+
+                //发送accept消息
+                VoiceUtil.acceptAudioCall(Constants.ids, Constants.fromId, Constants.interactionId)
             }
         }
     }

+ 60 - 54
android_host/src/main/h10_z3128_1h/java/com/wdkl/ncs/android/component/nursehome/adapter/FrameBedVosConfinementAdapter.kt

@@ -72,74 +72,80 @@ class FrameBedVosConfinementAdapter(val data: ArrayList<FrameBedVO>) : BaseDeleg
      */
     override fun onBindViewHolder(holder: BaseRecyclerViewHolder<AdapterHospitalFramePartBinding>?, position: Int) {
         holder?.bind { binding ->
-            val itemData = getItem(position)
-            if (itemData.customerName != null) {
-                binding.patientNameTv.text = itemData.customerName
-            } else {
-                binding.patientImagev.setImageResource(R.drawable.kong_chuang)
-                binding.patientNameTv.setText(R.string.empty_bed)
-            }
+            try {
+                val itemData = getItem(position)
+                if (itemData.customerName != null) {
+                    binding.patientNameTv.text = itemData.customerName
+                } else {
+                    binding.patientImagev.setImageResource(R.drawable.kong_chuang)
+                    binding.patientNameTv.setText(R.string.empty_bed)
+                }
 
-            if (itemData.customerAge != null) {
-                binding.patientAgeTv.text = itemData.customerAge.toString() + itemData.customerAgeUnit
-            } else {
-                binding.patientAgeTv.text = "--"
-            }
+                if (itemData.customerAge != null) {
+                    binding.patientAgeTv.text =
+                        itemData.customerAge.toString() + itemData.customerAgeUnit
+                } else {
+                    binding.patientAgeTv.text = "--"
+                }
 
-            binding.roomNumberTv.text = itemData.frameBed.fullName
-            binding.roomNumberTv.setTextColor(Color.parseColor("#2F9DF1"))
-
-            var critical = false
-            binding.rlBedInfo.setBackgroundResource(R.drawable.item_selector)
-            if (itemData.nurseConfigDtos != null && itemData.nurseConfigDtos.size > 0) {
-                for (nurseConfig in itemData.nurseConfigDtos) {
-                    if (nurseConfig.boolCritical != null && nurseConfig.boolCritical) {
-                        binding.roomNumberTv.setTextColor(Color.WHITE)
-                        //病危标识
-                        binding.rlBedInfo.setBackgroundResource(R.drawable.item_selector_critical)
-                        binding.tvNurseConfigName.text = nurseConfig.nurseConfigName
-                        if (!TextUtils.isEmpty(nurseConfig.nurseColorRbg)) {
+                binding.roomNumberTv.text = itemData.frameBed.fullName
+                binding.roomNumberTv.setTextColor(Color.parseColor("#2F9DF1"))
+
+                var critical = false
+                binding.rlBedInfo.setBackgroundResource(R.drawable.item_selector)
+                if (itemData.nurseConfigDtos != null && itemData.nurseConfigDtos.size > 0) {
+                    for (nurseConfig in itemData.nurseConfigDtos) {
+                        if (nurseConfig.boolCritical != null && nurseConfig.boolCritical) {
+                            binding.roomNumberTv.setTextColor(Color.WHITE)
+                            //病危标识
+                            binding.tvNurseConfigName.text = nurseConfig.nurseConfigName
+                            if (!TextUtils.isEmpty(nurseConfig.nurseColorRbg)) {
+                                binding.rlBedInfo.setBackgroundColor(Color.parseColor("#" + nurseConfig.nurseColorRbg))
+                                binding.tvNurseConfigColor.visibility = View.VISIBLE
+                                binding.tvNurseConfigColor.setBackgroundColor(Color.parseColor("#" + nurseConfig.nurseColorRbg))
+                                binding.tvNurseConfigColor.text = nurseConfig.nurseOptionName
+                            } else {
+                                binding.rlBedInfo.setBackgroundResource(R.color.color_critical)
+                                binding.tvNurseConfigColor.text = ""
+                                binding.tvNurseConfigColor.visibility = View.INVISIBLE
+                            }
+                            critical = true
+                            break
+                        }
+                    }
+
+                    if (!critical) {
+                        val nurseItem = itemData.nurseConfigDtos.get(0)
+                        binding.tvNurseConfigName.text = nurseItem.nurseConfigName
+                        if (!TextUtils.isEmpty(nurseItem.nurseColorRbg)) {
                             binding.tvNurseConfigColor.visibility = View.VISIBLE
-                            binding.tvNurseConfigColor.setBackgroundColor(Color.parseColor("#" + nurseConfig.nurseColorRbg))
-                            binding.tvNurseConfigColor.text = nurseConfig.nurseOptionName
+                            binding.tvNurseConfigColor.setBackgroundColor(Color.parseColor("#" + nurseItem.nurseColorRbg))
+                            binding.tvNurseConfigColor.text = nurseItem.nurseOptionName
                         } else {
                             binding.tvNurseConfigColor.text = ""
                             binding.tvNurseConfigColor.visibility = View.INVISIBLE
                         }
-                        critical = true
-                        break
                     }
+                } else {
+                    binding.tvNurseConfigName.text = ""
+                    binding.tvNurseConfigColor.text = ""
+                    binding.tvNurseConfigColor.visibility = View.INVISIBLE
                 }
 
-                if (!critical) {
-                    val nurseItem = itemData.nurseConfigDtos.get(0)
-                    binding.tvNurseConfigName.text = nurseItem.nurseConfigName
-                    if (!TextUtils.isEmpty(nurseItem.nurseColorRbg)) {
-                        binding.tvNurseConfigColor.visibility = View.VISIBLE
-                        binding.tvNurseConfigColor.setBackgroundColor(Color.parseColor("#" + nurseItem.nurseColorRbg))
-                        binding.tvNurseConfigColor.text = nurseItem.nurseOptionName
+                if (itemData.customerSex != null) {
+                    binding.sexImagev.visibility = View.VISIBLE
+                    if (itemData.customerSex == 1) {
+                        binding.sexImagev.setImageResource(R.drawable.man)
+                        binding.patientImagev.setImageResource(R.drawable.bing_ren_xiang_qing_man)
                     } else {
-                        binding.tvNurseConfigColor.text = ""
-                        binding.tvNurseConfigColor.visibility = View.INVISIBLE
+                        binding.sexImagev.setImageResource(R.drawable.nv)
+                        binding.patientImagev.setImageResource(R.drawable.bing_ren_xiang_qing)
                     }
-                }
-            } else {
-                binding.tvNurseConfigName.text = ""
-                binding.tvNurseConfigColor.text = ""
-                binding.tvNurseConfigColor.visibility = View.INVISIBLE
-            }
-
-            if (itemData.customerSex != null) {
-                binding.sexImagev.visibility = View.VISIBLE
-                if (itemData.customerSex == 1) {
-                    binding.sexImagev.setImageResource(R.drawable.man)
-                    binding.patientImagev.setImageResource(R.drawable.bing_ren_xiang_qing_man)
                 } else {
-                    binding.sexImagev.setImageResource(R.drawable.nv)
-                    binding.patientImagev.setImageResource(R.drawable.bing_ren_xiang_qing)
+                    binding.sexImagev.visibility = View.GONE
                 }
-            } else {
-                binding.sexImagev.visibility = View.GONE
+            } catch (ex: Exception) {
+                ex.printStackTrace()
             }
 
             //Log.e("FrameBedVosAdapter ", "FrameBedVosAdapter...." + itemData.customerName)

+ 3 - 0
android_host/src/main/h10_z3128_1h/java/com/wdkl/ncs/android/component/nursehome/fragment/SipCallFragment.kt

@@ -69,6 +69,9 @@ class SipCallFragment: BaseCallFragment() {
                 showCallView(false)
                 Constants.CALL_STATE = Constants.CALL_CALLING
                 DeviceChannel.calling = true
+
+                //发送accept消息
+                VoiceUtil.acceptAudioCall(Constants.ids, Constants.fromId, Constants.interactionId)
             }
         }
     }