|
@@ -7,12 +7,13 @@ import com.alibaba.android.vlayout.LayoutHelper
|
|
import com.alibaba.android.vlayout.layout.LinearLayoutHelper
|
|
import com.alibaba.android.vlayout.layout.LinearLayoutHelper
|
|
import com.wdkl.ncs.android.component.home.R
|
|
import com.wdkl.ncs.android.component.home.R
|
|
import com.wdkl.ncs.android.component.home.databinding.AdapterWatchCallRecordsItemBinding
|
|
import com.wdkl.ncs.android.component.home.databinding.AdapterWatchCallRecordsItemBinding
|
|
|
|
+import com.wdkl.ncs.android.component.home.util.MediaPlayHelper
|
|
import com.wdkl.ncs.android.component.nursehome.common.Constants
|
|
import com.wdkl.ncs.android.component.nursehome.common.Constants
|
|
-import com.wdkl.ncs.android.component.nursehome.util.MediaPlayer
|
|
|
|
import com.wdkl.ncs.android.component.nursehome.util.TimeTransition
|
|
import com.wdkl.ncs.android.component.nursehome.util.TimeTransition
|
|
import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
|
|
import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
|
|
import com.wdkl.ncs.android.lib.utils.BaseRecyclerViewHolder
|
|
import com.wdkl.ncs.android.lib.utils.BaseRecyclerViewHolder
|
|
import com.wdkl.ncs.android.lib.utils.showMessage
|
|
import com.wdkl.ncs.android.lib.utils.showMessage
|
|
|
|
+import com.wdkl.ncs.android.middleware.api.UrlManager
|
|
import com.wdkl.ncs.android.middleware.model.vo.InteractionVO
|
|
import com.wdkl.ncs.android.middleware.model.vo.InteractionVO
|
|
import com.wdkl.ncs.android.middleware.tcp.TcpClient
|
|
import com.wdkl.ncs.android.middleware.tcp.TcpClient
|
|
import com.wdkl.ncs.android.middleware.tcp.channel.EventUtil
|
|
import com.wdkl.ncs.android.middleware.tcp.channel.EventUtil
|
|
@@ -74,30 +75,21 @@ class WatchCallRecordsItemAdapter(val data: ArrayList<InteractionVO>) : BaseDele
|
|
|
|
|
|
//是否已播放 已响应
|
|
//是否已播放 已响应
|
|
if (itemData.actionEnd != null) {
|
|
if (itemData.actionEnd != null) {
|
|
- Log.e(TAG, "" + itemData.actionEnd+" "+position)
|
|
|
|
- Log.e(TAG, "" + itemData.actionType+" "+position)
|
|
|
|
- Log.e(TAG, "" + itemData.data+" "+position)
|
|
|
|
-
|
|
|
|
- Log.e(TAG, "" + itemData.actionDirectionType+" "+position)
|
|
|
|
- Log.e(TAG, "" + TcpType.IM.name+" "+position)
|
|
|
|
-
|
|
|
|
- binding.treatmentStateImagev.setImageResource(R.drawable.yi_chu_li)
|
|
|
|
|
|
+ binding.treatmentStateImagev.setImageResource(R.drawable.checked_100)
|
|
binding.treatmentStateImagev.visibility = View.VISIBLE
|
|
binding.treatmentStateImagev.visibility = View.VISIBLE
|
|
binding.processingTimeTv.visibility = View.VISIBLE
|
|
binding.processingTimeTv.visibility = View.VISIBLE
|
|
|
|
|
|
//判断是呼入还是呼出 1 分机到主机 2主机到分机
|
|
//判断是呼入还是呼出 1 分机到主机 2主机到分机
|
|
- if(itemData.actionDirectionType == 1){
|
|
|
|
- binding.sickbedTv.text = itemData.fromFrameFullName
|
|
|
|
- binding.nameTv.text = itemData.fromMemberName
|
|
|
|
- //TODO 图标显示不正常 暂时没放完整图标
|
|
|
|
- binding.callStatusImagev.setImageResource(R.drawable.hu_ru_yi_jie)
|
|
|
|
- }else if(itemData.actionDirectionType == 2 || itemData.actionDirectionType == 3){
|
|
|
|
|
|
+ if (itemData.fromDeviceMemberId == Constants.memberId){
|
|
binding.sickbedTv.text = itemData.toFrameFullName
|
|
binding.sickbedTv.text = itemData.toFrameFullName
|
|
binding.nameTv.text = itemData.toMemberName
|
|
binding.nameTv.text = itemData.toMemberName
|
|
binding.callStatusImagev.setImageResource(R.drawable.hu_chu_yi_jie)
|
|
binding.callStatusImagev.setImageResource(R.drawable.hu_chu_yi_jie)
|
|
|
|
+ } else {
|
|
|
|
+ binding.sickbedTv.text = itemData.fromFrameFullName
|
|
|
|
+ binding.nameTv.text = itemData.fromMemberName
|
|
|
|
+ binding.callStatusImagev.setImageResource(R.drawable.hu_ru_yi_jie)
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
if(itemData.actionType == TcpType.SOS.name){ //sos紧急呼叫 已处理
|
|
if(itemData.actionType == TcpType.SOS.name){ //sos紧急呼叫 已处理
|
|
binding.playTv.visibility = View.GONE
|
|
binding.playTv.visibility = View.GONE
|
|
binding.projectTv.visibility = View.VISIBLE
|
|
binding.projectTv.visibility = View.VISIBLE
|
|
@@ -105,8 +97,8 @@ class WatchCallRecordsItemAdapter(val data: ArrayList<InteractionVO>) : BaseDele
|
|
binding.projectTv.text = "SOS"
|
|
binding.projectTv.text = "SOS"
|
|
binding.conductorNameTv.text = itemData.toMemberName
|
|
binding.conductorNameTv.text = itemData.toMemberName
|
|
binding.processingTimeTv.text = TimeTransition().stampToDate(itemData.actionEnd*1000)
|
|
binding.processingTimeTv.text = TimeTransition().stampToDate(itemData.actionEnd*1000)
|
|
- binding.projectTv.setBackgroundResource(R.drawable.sp_event_handled)
|
|
|
|
-
|
|
|
|
|
|
+ binding.projectTv.setBackgroundResource(R.drawable.sp_event_do)
|
|
|
|
+ binding.callStatusImagev.setImageResource(R.drawable.sos_96)
|
|
}else if(itemData.actionType == TcpType.EVENT.name){//事件已经响应 相应的数据
|
|
}else if(itemData.actionType == TcpType.EVENT.name){//事件已经响应 相应的数据
|
|
binding.playTv.visibility = View.GONE
|
|
binding.playTv.visibility = View.GONE
|
|
binding.projectTv.visibility = View.VISIBLE
|
|
binding.projectTv.visibility = View.VISIBLE
|
|
@@ -114,7 +106,8 @@ class WatchCallRecordsItemAdapter(val data: ArrayList<InteractionVO>) : BaseDele
|
|
binding.projectTv.text = itemData.data
|
|
binding.projectTv.text = itemData.data
|
|
binding.conductorNameTv.text = itemData.toMemberName
|
|
binding.conductorNameTv.text = itemData.toMemberName
|
|
binding.processingTimeTv.text = TimeTransition().stampToDate(itemData.actionEnd*1000)
|
|
binding.processingTimeTv.text = TimeTransition().stampToDate(itemData.actionEnd*1000)
|
|
- binding.projectTv.setBackgroundResource(R.drawable.sp_event_handled)
|
|
|
|
|
|
+ binding.projectTv.setBackgroundResource(R.drawable.sp_event_do)
|
|
|
|
+ binding.callStatusImagev.setImageResource(R.drawable.event_do)
|
|
}else if (itemData.actionType == TcpType.IM.name){//语音已播放
|
|
}else if (itemData.actionType == TcpType.IM.name){//语音已播放
|
|
|
|
|
|
binding.projectTv.visibility = View.GONE
|
|
binding.projectTv.visibility = View.GONE
|
|
@@ -140,41 +133,35 @@ class WatchCallRecordsItemAdapter(val data: ArrayList<InteractionVO>) : BaseDele
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
- Log.e(TAG, "" + itemData.actionEnd+" "+position)
|
|
|
|
- Log.e(TAG, "" + itemData.actionType+" "+position)
|
|
|
|
- Log.e(TAG, "" + itemData.data+" "+position)
|
|
|
|
- Log.e(TAG, "" + itemData.actionDirectionType+" "+position)
|
|
|
|
-
|
|
|
|
- binding.treatmentStateImagev.setImageResource(R.drawable.wei_chu_li)
|
|
|
|
|
|
+ binding.treatmentStateImagev.setImageResource(R.drawable.unchecked_100)
|
|
binding.treatmentStateImagev.visibility = View.VISIBLE
|
|
binding.treatmentStateImagev.visibility = View.VISIBLE
|
|
binding.conductorNameTv.visibility = View.GONE
|
|
binding.conductorNameTv.visibility = View.GONE
|
|
binding.processingTimeTv.visibility = View.VISIBLE
|
|
binding.processingTimeTv.visibility = View.VISIBLE
|
|
|
|
|
|
//判断是呼入还是呼出 1 分机到主机 2主机到分机
|
|
//判断是呼入还是呼出 1 分机到主机 2主机到分机
|
|
- if(itemData.actionDirectionType == 1){
|
|
|
|
- Log.e(TAG, "进入。。。。" )
|
|
|
|
|
|
+ if(Constants.memberId!=itemData.fromDeviceMemberId){
|
|
binding.sickbedTv.text = itemData.fromFrameFullName
|
|
binding.sickbedTv.text = itemData.fromFrameFullName
|
|
binding.nameTv.text = itemData.fromMemberName
|
|
binding.nameTv.text = itemData.fromMemberName
|
|
binding.callStatusImagev.setImageResource(R.drawable.hu_ru_wei_jie)
|
|
binding.callStatusImagev.setImageResource(R.drawable.hu_ru_wei_jie)
|
|
- }else if(itemData.actionDirectionType == 2 || itemData.actionDirectionType == 3){
|
|
|
|
|
|
+ }else{
|
|
binding.sickbedTv.text = itemData.toFrameFullName
|
|
binding.sickbedTv.text = itemData.toFrameFullName
|
|
binding.nameTv.text = itemData.toMemberName
|
|
binding.nameTv.text = itemData.toMemberName
|
|
binding.callStatusImagev.setImageResource(R.drawable.hu_chu_wei_jie)
|
|
binding.callStatusImagev.setImageResource(R.drawable.hu_chu_wei_jie)
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
if(itemData.actionType == TcpType.SOS.name){ //sos紧急呼叫 未处理
|
|
if(itemData.actionType == TcpType.SOS.name){ //sos紧急呼叫 未处理
|
|
binding.playTv.visibility = View.GONE
|
|
binding.playTv.visibility = View.GONE
|
|
binding.projectTv.visibility = View.VISIBLE
|
|
binding.projectTv.visibility = View.VISIBLE
|
|
binding.projectTv.text = "SOS"
|
|
binding.projectTv.text = "SOS"
|
|
- binding.projectTv.setBackgroundResource(R.drawable.sp_event_unhandled_bg)
|
|
|
|
|
|
+ binding.projectTv.setBackgroundResource(R.drawable.sp_event_undo)
|
|
binding.processingTimeTv.text = "未处理"
|
|
binding.processingTimeTv.text = "未处理"
|
|
-
|
|
|
|
|
|
+ binding.callStatusImagev.setImageResource(R.drawable.sos_96)
|
|
}else if(itemData.actionType == TcpType.EVENT.name){//事件未处理
|
|
}else if(itemData.actionType == TcpType.EVENT.name){//事件未处理
|
|
binding.playTv.visibility = View.GONE
|
|
binding.playTv.visibility = View.GONE
|
|
binding.projectTv.visibility = View.VISIBLE
|
|
binding.projectTv.visibility = View.VISIBLE
|
|
binding.projectTv.text = itemData.data
|
|
binding.projectTv.text = itemData.data
|
|
- binding.projectTv.setBackgroundResource(R.drawable.sp_event_unhandled_bg)
|
|
|
|
|
|
+ binding.projectTv.setBackgroundResource(R.drawable.sp_event_undo)
|
|
|
|
+ binding.callStatusImagev.setImageResource(R.drawable.event_undo)
|
|
binding.processingTimeTv.text = "未处理"
|
|
binding.processingTimeTv.text = "未处理"
|
|
}else if (itemData.actionType == TcpType.IM.name){//语音未播放
|
|
}else if (itemData.actionType == TcpType.IM.name){//语音未播放
|
|
binding.projectTv.visibility = View.GONE
|
|
binding.projectTv.visibility = View.GONE
|
|
@@ -195,24 +182,14 @@ class WatchCallRecordsItemAdapter(val data: ArrayList<InteractionVO>) : BaseDele
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
binding.projectTv.setOnClickListener {
|
|
binding.projectTv.setOnClickListener {
|
|
- //事件处理监听
|
|
|
|
-// 点击之后发送通知
|
|
|
|
-// showMessage("点击了事件按钮")
|
|
|
|
if (itemData.actionEnd != null)return@setOnClickListener
|
|
if (itemData.actionEnd != null)return@setOnClickListener
|
|
- Log.e(TAG, "点击了事件按钮")
|
|
|
|
|
|
+ Log.i(TAG, "点击了事件按钮")
|
|
|
|
|
|
Thread(Runnable {
|
|
Thread(Runnable {
|
|
run {
|
|
run {
|
|
- Log.e(TAG, "aaassss "+ Constants.deviceId +"kong")
|
|
|
|
-
|
|
|
|
if (!Constants.deviceId.equals("")) {
|
|
if (!Constants.deviceId.equals("")) {
|
|
var eventTcpModel = EventUtil.eventResponse(Constants.deviceId.toInt(), itemData.fromDeviceId, itemData.id)
|
|
var eventTcpModel = EventUtil.eventResponse(Constants.deviceId.toInt(), itemData.fromDeviceId, itemData.id)
|
|
-// val map = HashMap<String,Int>()
|
|
|
|
-// map.put("id",1)
|
|
|
|
-// eventTcpModel.setData(map)
|
|
|
|
TcpClient.getInstance().sendMsg(eventTcpModel.toJson())
|
|
TcpClient.getInstance().sendMsg(eventTcpModel.toJson())
|
|
} else {
|
|
} else {
|
|
showMessage("获取不到当给前设备id")
|
|
showMessage("获取不到当给前设备id")
|
|
@@ -230,15 +207,8 @@ class WatchCallRecordsItemAdapter(val data: ArrayList<InteractionVO>) : BaseDele
|
|
run {
|
|
run {
|
|
if (!Constants.deviceId.equals("")) {
|
|
if (!Constants.deviceId.equals("")) {
|
|
var imUtilTcpModel = ImUtil.imRead(Constants.deviceId.toInt(), itemData.fromDeviceId, itemData.id)
|
|
var imUtilTcpModel = ImUtil.imRead(Constants.deviceId.toInt(), itemData.fromDeviceId, itemData.id)
|
|
-
|
|
|
|
-// val map = HashMap<String,Int>()
|
|
|
|
-// map.put("id",1)
|
|
|
|
-// imUtilTcpModel.setData(map)
|
|
|
|
TcpClient.getInstance().sendMsg(imUtilTcpModel.toJson())
|
|
TcpClient.getInstance().sendMsg(imUtilTcpModel.toJson())
|
|
- var mediaPlayer = MediaPlayer()
|
|
|
|
- mediaPlayer.startMediaPlayer("http://192.168.1.112:8006"+itemData.data)
|
|
|
|
- mediaPlayer.setVolume(0.3f)
|
|
|
|
-
|
|
|
|
|
|
+ MediaPlayHelper.getInstance().playUrlMusic(UrlManager.build().device_url+itemData.data,0.8f,false)
|
|
} else {
|
|
} else {
|
|
showMessage("获取不到当给前设备id")
|
|
showMessage("获取不到当给前设备id")
|
|
}
|
|
}
|