瀏覽代碼

优化事件历史记录显示

weizhengliang 9 月之前
父節點
當前提交
7520641dcb
共有 14 個文件被更改,包括 118 次插入256 次删除
  1. 5 0
      android_mobile/src/main/yd_w_xiaomi_2_chile/code/com/wdkl/ncs/android/component/home/activity/ContactUpdateActivity.kt
  2. 0 16
      android_mobile/src/main/yd_w_xiaomi_2_chile/code/com/wdkl/ncs/android/component/home/activity/WatchCallRecordsActivity.kt
  3. 5 0
      android_mobile/src/main/yd_w_xiaomi_2_chile/code/com/wdkl/ncs/android/component/home/activity/WatchHome2Activity.kt
  4. 0 46
      android_mobile/src/main/yd_w_xiaomi_2_chile/code/com/wdkl/ncs/android/component/home/adapter/NewEventItemAdapter.kt
  5. 43 56
      android_mobile/src/main/yd_w_xiaomi_2_chile/code/com/wdkl/ncs/android/component/home/adapter/WatchCallRecordsItemAdapter.kt
  6. 8 14
      android_mobile/src/main/yd_w_xiaomi_2_chile/code/com/wdkl/ncs/android/component/home/service/WdKeepAliveService.kt
  7. 5 0
      android_mobile/src/main/yd_w_xiaomi_2_chile/res/drawable/sp_event_cancel.xml
  8. 1 6
      android_mobile/src/main/yd_w_xiaomi_2_chile/res/layout/adapter_watch_call_records_item.xml
  9. 1 1
      android_mobile/src/main/yd_w_xiaomi_2_chile/res/layout/user_setting_layout.xml
  10. 1 17
      android_mobile/src/main/yd_watch_2/code/com/wdkl/ncs/android/component/home/activity/WatchCallRecordsActivity.kt
  11. 0 35
      android_mobile/src/main/yd_watch_2/code/com/wdkl/ncs/android/component/home/adapter/NewEventItemAdapter.kt
  12. 43 59
      android_mobile/src/main/yd_watch_2/code/com/wdkl/ncs/android/component/home/adapter/WatchCallRecordsItemAdapter.kt
  13. 5 0
      android_mobile/src/main/yd_watch_2/res/drawable/sp_event_cancel.xml
  14. 1 6
      android_mobile/src/main/yd_watch_2/res/layout/adapter_watch_call_records_item.xml

+ 5 - 0
android_mobile/src/main/yd_w_xiaomi_2_chile/code/com/wdkl/ncs/android/component/home/activity/ContactUpdateActivity.kt

@@ -15,6 +15,7 @@ import com.wdkl.ncs.android.lib.vo.MessageEvent
 import com.wdkl.ncs.android.middleware.common.Constants
 import com.wdkl.ncs.android.middleware.logic.contract.home.WatchHomeActivityContract
 import com.wdkl.ncs.android.middleware.logic.presenter.home.WatchHomeActivityPresenter
+import com.wdkl.ncs.android.middleware.model.PhoneBookItem
 import com.wdkl.ncs.android.middleware.model.ServerIpInfo
 import com.wdkl.ncs.android.middleware.model.dos.AppVersionDO
 import com.wdkl.ncs.android.middleware.model.dos.ChannelDO
@@ -166,6 +167,10 @@ class ContactUpdateActivity: BaseActivity<WatchHomeActivityPresenter, ActivityCo
         }
     }
 
+    override fun showPhoneBook(data: ArrayList<PhoneBookItem>) {
+
+    }
+
     override fun onBackPressed() {
         if (System.currentTimeMillis() - clickTime > 2000) {
             showMessage(R.string.click_twice_to_back)

+ 0 - 16
android_mobile/src/main/yd_w_xiaomi_2_chile/code/com/wdkl/ncs/android/component/home/activity/WatchCallRecordsActivity.kt

@@ -61,8 +61,6 @@ class WatchCallRecordsActivity : BaseActivity<WatchCallRecordsFragmentPresenter,
 
     private val watchCallRecordsItemAdapter = WatchCallRecordsItemAdapter(ArrayList())
 
-    private lateinit var loadingDialog: LoadingDialog
-
     private var customerId = ""
 
     var all = "ALL"
@@ -101,8 +99,6 @@ class WatchCallRecordsActivity : BaseActivity<WatchCallRecordsFragmentPresenter,
         call_records_recyv.layoutManager = virtualLayoutManager
         call_records_recyv.adapter = delegateAdapter
 
-        //loadingDialog = CommonTool.createLoadingDialog(this, R.layout.custom_loading,R.id.loadding_image)
-
         receivedData = intent.getSerializableExtra("data") as WatchContactsVO?
         action = intent.getStringExtra("action")
         customerId = intent.getStringExtra("customer_id").toString()
@@ -159,16 +155,6 @@ class WatchCallRecordsActivity : BaseActivity<WatchCallRecordsFragmentPresenter,
                                         }
                                     }
                                     TcpClient.getInstance().sendTcp(tcpModel, true, transaction)
-
-                                    /*NettyClient.instance.sendMsg(tcpModel.toJson())
-                                        .subscribe { res: Boolean ->
-                                            if (res) {
-                                                Log.d(TAG, "TCP.发送消息完成")
-                                            } else {
-                                                Log.e(TAG, "TCP.发送消息失败")
-                                                HandleTcpConnect.instance.tcpReConnectWithMsgShow()
-                                            }
-                                        }*/
                                 }
                             } else {
                                 showMessage(R.string.call_phone_failed)
@@ -306,10 +292,8 @@ class WatchCallRecordsActivity : BaseActivity<WatchCallRecordsFragmentPresenter,
             Log.i(TAG, tcpModel.toJson())
             if (tcpModel.type == TcpType.VOICE) {
                 if (tcpModel.action == TcpAction.VoiceAction.SUCCESS) {
-                    //loadingDialog.dismiss()
                     //界面呈现,逻辑在service中
                 } else if (tcpModel.action == TcpAction.VoiceAction.FAILED) {
-                    //loadingDialog.dismiss()
                     call_relyout.isEnabled = true
                     DeviceChannel.calling = false
                     DeviceChannel.callId = 0

+ 5 - 0
android_mobile/src/main/yd_w_xiaomi_2_chile/code/com/wdkl/ncs/android/component/home/activity/WatchHome2Activity.kt

@@ -35,6 +35,7 @@ import com.wdkl.ncs.android.lib.vo.MessageEvent
 import com.wdkl.ncs.android.middleware.common.Constants
 import com.wdkl.ncs.android.middleware.logic.contract.home.WatchHomeActivityContract
 import com.wdkl.ncs.android.middleware.logic.presenter.home.WatchHomeActivityPresenter
+import com.wdkl.ncs.android.middleware.model.PhoneBookItem
 import com.wdkl.ncs.android.middleware.model.ServerIpInfo
 import com.wdkl.ncs.android.middleware.model.dos.AppVersionDO
 import com.wdkl.ncs.android.middleware.model.dos.ChannelDO
@@ -587,6 +588,10 @@ class WatchHome2Activity : BaseActivity<WatchHomeActivityPresenter, WatchActivit
         }
     }
 
+    override fun showPhoneBook(data: ArrayList<PhoneBookItem>) {
+
+    }
+
     /**
      * 设置设备数据
      */

+ 0 - 46
android_mobile/src/main/yd_w_xiaomi_2_chile/code/com/wdkl/ncs/android/component/home/adapter/NewEventItemAdapter.kt

@@ -62,18 +62,15 @@ class NewEventItemAdapter(var data:ArrayList<InteractionVO>, val activity: Activ
         holder.bind { binding ->
             val itemData = getItem(position)
 
-            val toDeviceId:Int?
             binding.eliEventTime.text = TimeTransition().stampToDate(itemData.createDate*1000)
             //binding.eliRoomName.text = itemData.fromFrameFullName
             var showName: String? = ""
             if (itemData.fromDeviceMemberId == Constants.memberId){
                 binding.eliRoomName.text = itemData.toFrameFullName
                 showName = itemData.toMemberName
-                toDeviceId = itemData.toDeviceId
             } else {
                 binding.eliRoomName.text = itemData.fromFrameFullName
                 showName = itemData.fromMemberName
-                toDeviceId = itemData.fromDeviceId
             }
 
             if (TextUtils.isEmpty(showName)) {
@@ -83,17 +80,6 @@ class NewEventItemAdapter(var data:ArrayList<InteractionVO>, val activity: Activ
             }
             binding.eliCallout.visibility = View.GONE
 
-            /*if (toDeviceId != null) {
-                binding.eliVoiceRecorder.visibility = View.VISIBLE
-            } else {
-                binding.eliVoiceRecorder.visibility = View.GONE
-            }
-            binding.eliVoiceRecorder.setOnClickListener{
-                var intent = Intent(activity,VoiceMsgActivity::class.java)
-                intent.putExtra(VoiceMsgActivity.TO_DEVICE_ID, toDeviceId)
-                activity.startActivity(intent)
-            }*/
-
             when (itemData.actionType){
                 TcpType.EVENT.name->{
                     binding.eliImRead.visibility = View.GONE
@@ -137,16 +123,6 @@ class NewEventItemAdapter(var data:ArrayList<InteractionVO>, val activity: Activ
                                 }
                             }
                             TcpClient.getInstance().sendTcp(tcpModel, false, transaction)
-
-                            /*NettyClient.instance.sendMsg(tcpModel.toJson()).subscribe {
-                                if (it) {
-                                    Log.d(TAG, "TCP.发送消息完成")
-                                } else {
-                                    Log.e(TAG, "TCP.发送消息失败")
-                                    HandleTcpConnect.instance.tcpReConnectWithMsgShow()
-                                }
-                                loadingDialog.dismiss()
-                            }*/
                         }
                     }
                 }
@@ -205,15 +181,6 @@ class NewEventItemAdapter(var data:ArrayList<InteractionVO>, val activity: Activ
                                     }
                                 }
                                 TcpClient.getInstance().sendTcp(tcpModel, false, transaction)
-
-                                /*NettyClient.instance.sendMsg(tcpModel.toJson()).subscribe {
-                                    if (it) {
-                                        Log.d(TAG, "TCP.发送消息完成")
-                                    } else {
-                                        Log.e(TAG, "TCP.发送消息失败")
-                                        HandleTcpConnect.instance.tcpReConnectWithMsgShow()
-                                    }
-                                }*/
                             }
                         }
                     }
@@ -265,19 +232,6 @@ class NewEventItemAdapter(var data:ArrayList<InteractionVO>, val activity: Activ
                                 }
                             }
                             TcpClient.getInstance().sendTcp(tcpModel, false, transaction)
-
-                            /*NettyClient.instance.sendMsg(tcpModel.toJson()).subscribe {
-                                if (it) {
-                                    Log.d(TAG, "TCP.发送消息完成")
-                                    tcpModel.data = Gson().toJson(itemData)
-                                    EventBus.getDefault().post(MessageEvent(tcpModel, 999))
-                                } else {
-                                    Log.e(TAG, "TCP.发送消息失败")
-
-                                    HandleTcpConnect.instance.tcpReConnectWithMsgShow()
-                                }
-                                loadingDialog.dismiss()
-                            }*/
                         }
                     }
                 }

+ 43 - 56
android_mobile/src/main/yd_w_xiaomi_2_chile/code/com/wdkl/ncs/android/component/home/adapter/WatchCallRecordsItemAdapter.kt

@@ -14,6 +14,7 @@ import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
 import com.wdkl.ncs.android.lib.utils.BaseRecyclerViewHolder
 import com.wdkl.ncs.android.middleware.model.vo.InteractionVO
 import com.wdkl.ncs.android.middleware.tcp.enums.DeviceTypeEnum
+import com.wdkl.ncs.android.middleware.tcp.enums.EventStatusEnum
 import com.wdkl.ncs.android.middleware.tcp.enums.TcpType
 import com.wdkl.ncs.android.middleware.utils.StringUtil
 
@@ -83,31 +84,54 @@ class WatchCallRecordsItemAdapter(val data: ArrayList<InteractionVO>) : BaseDele
                 binding.nameTv.text = "To: " + itemData.toFrameFullName
             }
 
+            if (itemData.actionType == TcpType.EVENT.name) {
+                if (itemData.actionEndMemberId != null) {
+                    //已响应
+                    binding.treatmentStateImagev.setImageResource(R.drawable.checked_100)
+                    binding.treatmentStateImagev.visibility = View.VISIBLE
+                    binding.playTv.visibility = View.GONE
+                    binding.projectTv.visibility = View.VISIBLE
+                    binding.conductorNameTv.visibility = View.VISIBLE
+                    binding.projectTv.text = itemData.data
+                    binding.conductorNameTv.text = itemData.actionEndMemberName
+                    binding.processingTimeTv.text = TimeTransition().stampToDate(itemData.actionEnd*1000)
+                    binding.projectTv.setBackgroundResource(R.drawable.sp_event_do)
+                    binding.callStatusImagev.setImageResource(R.drawable.event_do)
+                    binding.callStatusImagev.visibility = View.VISIBLE
+                } else {
+                    if (itemData.actionStatus == EventStatusEnum.CANCELED.status) {
+                        //已取消
+                        binding.treatmentStateImagev.visibility = View.GONE
+                        binding.playTv.visibility = View.GONE
+                        binding.projectTv.visibility = View.VISIBLE
+                        binding.projectTv.text = itemData.data
+                        binding.projectTv.setBackgroundResource(R.drawable.sp_event_cancel)
+                        binding.callStatusImagev.setImageResource(R.drawable.event_undo)
+                        binding.callStatusImagev.visibility = View.VISIBLE
+                        binding.processingTimeTv.setText(R.string.event_cancel)
+                    } else {
+                        //未响应
+                        binding.treatmentStateImagev.setImageResource(R.drawable.unchecked_100)
+                        binding.treatmentStateImagev.visibility = View.VISIBLE
+                        binding.playTv.visibility = View.GONE
+                        binding.projectTv.visibility = View.VISIBLE
+                        binding.projectTv.text = itemData.data
+                        binding.projectTv.setBackgroundResource(R.drawable.sp_event_undo)
+                        binding.callStatusImagev.setImageResource(R.drawable.event_undo)
+                        binding.callStatusImagev.visibility = View.VISIBLE
+                        binding.processingTimeTv.setText(R.string.event_undo)
+                    }
+                }
+
+                return
+            }
+
             //是否已播放 已响应
             if (itemData.actionEnd != null) {
                 binding.treatmentStateImagev.setImageResource(R.drawable.checked_100)
                 binding.treatmentStateImagev.visibility = View.VISIBLE
                 binding.processingTimeTv.visibility = View.VISIBLE
 
-                //判断是呼入还是呼出
-                /*if (itemData.fromDeviceMemberId == Constants.memberId){
-                    binding.sickbedTv.text = itemData.toFrameFullName
-                    if (TextUtils.isEmpty(itemData.toMemberName)) {
-                        binding.nameTv.text = "To: " + StringUtil.getResString(R.string.str_null)
-                    } else {
-                        binding.nameTv.text = "To: " + itemData.toMemberName
-                    }
-                    binding.callStatusImagev.setImageResource(R.drawable.hu_chu_yi_jie)
-                } else {
-                    binding.sickbedTv.text = itemData.fromFrameFullName
-                    if (TextUtils.isEmpty(itemData.fromMemberName)) {
-                        binding.nameTv.text = "From: " + StringUtil.getResString(R.string.str_null)
-                    } else {
-                        binding.nameTv.text = "From: " + itemData.fromMemberName
-                    }
-                    binding.callStatusImagev.setImageResource(R.drawable.hu_ru_yi_jie)
-                }*/
-
                 if(itemData.actionType == TcpType.SOS.name){ //sos紧急呼叫 已处理
                     binding.playTv.visibility = View.GONE
                     binding.projectTv.visibility = View.VISIBLE
@@ -118,16 +142,6 @@ class WatchCallRecordsItemAdapter(val data: ArrayList<InteractionVO>) : BaseDele
                     binding.projectTv.setBackgroundResource(R.drawable.sp_event_do)
                     binding.callStatusImagev.setImageResource(R.drawable.sos_96)
                     binding.callStatusImagev.visibility = View.VISIBLE
-                }else if(itemData.actionType == TcpType.EVENT.name){//事件已经响应 相应的数据
-                    binding.playTv.visibility = View.GONE
-                    binding.projectTv.visibility = View.VISIBLE
-                    binding.conductorNameTv.visibility = View.VISIBLE
-                    binding.projectTv.text = itemData.data
-                    binding.conductorNameTv.text = itemData.actionEndMemberName
-                    binding.processingTimeTv.text = TimeTransition().stampToDate(itemData.actionEnd*1000)
-                    binding.projectTv.setBackgroundResource(R.drawable.sp_event_do)
-                    binding.callStatusImagev.setImageResource(R.drawable.event_do)
-                    binding.callStatusImagev.visibility = View.VISIBLE
                 }else if (itemData.actionType == TcpType.IM.name){//语音已播放
 
                     binding.projectTv.visibility = View.GONE
@@ -166,25 +180,6 @@ class WatchCallRecordsItemAdapter(val data: ArrayList<InteractionVO>) : BaseDele
                 binding.conductorNameTv.visibility = View.GONE
                 binding.processingTimeTv.visibility = View.VISIBLE
 
-                //判断是呼入还是呼出 1 分机到主机 2主机到分机
-                /*if(Constants.memberId != itemData.fromDeviceMemberId){
-                    binding.sickbedTv.text = itemData.fromFrameFullName
-                    if (TextUtils.isEmpty(itemData.fromMemberName)) {
-                        binding.nameTv.text = "From: " + StringUtil.getResString(R.string.str_null)
-                    } else {
-                        binding.nameTv.text = "From: " + itemData.fromMemberName
-                    }
-                    binding.callStatusImagev.setImageResource(R.drawable.hu_ru_wei_jie)
-                }else{
-                    binding.sickbedTv.text = itemData.toFrameFullName
-                    if (TextUtils.isEmpty(itemData.toMemberName)) {
-                        binding.nameTv.text = "To: " + StringUtil.getResString(R.string.str_null)
-                    } else {
-                        binding.nameTv.text = "To: " + itemData.toMemberName
-                    }
-                    binding.callStatusImagev.setImageResource(R.drawable.hu_chu_wei_jie)
-                }*/
-
                 if(itemData.actionType == TcpType.SOS.name){ //sos紧急呼叫 未处理
                     binding.playTv.visibility = View.GONE
                     binding.projectTv.visibility = View.VISIBLE
@@ -193,14 +188,6 @@ class WatchCallRecordsItemAdapter(val data: ArrayList<InteractionVO>) : BaseDele
                     binding.processingTimeTv.setText(R.string.event_undo)
                     binding.callStatusImagev.setImageResource(R.drawable.sos_96)
                     binding.callStatusImagev.visibility = View.VISIBLE
-                }else if(itemData.actionType == TcpType.EVENT.name){//事件未处理
-                    binding.playTv.visibility = View.GONE
-                    binding.projectTv.visibility = View.VISIBLE
-                    binding.projectTv.text = itemData.data
-                    binding.projectTv.setBackgroundResource(R.drawable.sp_event_undo)
-                    binding.callStatusImagev.setImageResource(R.drawable.event_undo)
-                    binding.callStatusImagev.visibility = View.VISIBLE
-                    binding.processingTimeTv.setText(R.string.event_undo)
                 }else if (itemData.actionType == TcpType.IM.name){//语音未播放
                     binding.projectTv.visibility = View.GONE
                     binding.playTv.visibility = View.VISIBLE

+ 8 - 14
android_mobile/src/main/yd_w_xiaomi_2_chile/code/com/wdkl/ncs/android/component/home/service/WdKeepAliveService.kt

@@ -871,15 +871,16 @@ class WdKeepAliveService : AbsWorkService() {
                 if (Locale.CHINESE.getLanguage().equals(language)) {
                     SpeechUtil.getInstance().startSpeak("您有新的事件待处理, " + eventStr)
                 } else {
-                    RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.event, false)
+                    //RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.event, false)
+
+                    val text = interactionVO.fromFrameFullName.replace("-", ",") + ", " + interactionVO.data
+                    SpeechUtil.getInstance().startSpeak(text)
                 }
             } else {
-                //MediaPlayHelper.getInstance().playResMusic(R.raw.new_event, 1.0f, false)
-                RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.new_event, false)
+                RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.event, false)
             }
         } else if (model.action == TcpAction.SOSAction.CALL || model.action == TcpAction.SOSAction.ROOM_CALL) {
             AppTool.Time.delay(200) {
-                //MediaPlayHelper.getInstance().playResMusic(R.raw.sos, 1.0f, true)
                 RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.sos, false)
             }
         } else if (model.type == TcpType.EVENT && model.action == TcpAction.EventAction.CANCEL) { // 事件取消
@@ -893,10 +894,7 @@ class WdKeepAliveService : AbsWorkService() {
                     RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.event, false)
                 }
             } else {
-                AppTool.Time.delay(200) {
-                    //MediaPlayHelper.getInstance().playResMusic(R.raw.new_event, 1.0f, false)
-                    RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.new_event, false)
-                }
+                RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.event, false)
             }
         } else if (model.type == TcpType.EVENT && model.action == TcpAction.EventAction.COMPLETED) { //事件完成
             val eventStr = Util.appendSpace(interactionVO.fromFrameFullName.replace("-", ",")) + ", " +
@@ -909,9 +907,7 @@ class WdKeepAliveService : AbsWorkService() {
                     RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.event, false)
                 }
             } else {
-                AppTool.Time.delay(200) {
-                    RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.event, false)
-                }
+                RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.event, false)
             }
         } else if(model.type==TcpType.EVENT && model.action==TcpAction.EventAction.RESPONSED){
             val eventStr = Util.appendSpace(interactionVO.fromFrameFullName.replace("-", ",")) + ", " + interactionVO.data + "事件已由"+interactionVO.actionEndMemberName+"响应"
@@ -923,9 +919,7 @@ class WdKeepAliveService : AbsWorkService() {
                     RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.event, false)
                 }
             } else {
-                AppTool.Time.delay(200) {
-                    RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.event, false)
-                }
+                RingPlayHelper.playRingTone(BaseApplication.appContext, R.raw.event, false)
             }
         } else if (model.type == TcpType.VOICE && model.action == TcpAction.VoiceAction.HCALL) {
             val callRoom = interactionVO.fromFrameFullName.replace("-", " ")

+ 5 - 0
android_mobile/src/main/yd_w_xiaomi_2_chile/res/drawable/sp_event_cancel.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#9FD8DF"/>
+    <corners android:radius="5sp"/>
+</shape>

+ 1 - 6
android_mobile/src/main/yd_w_xiaomi_2_chile/res/layout/adapter_watch_call_records_item.xml

@@ -15,12 +15,6 @@
             android:layout_centerVertical="true"
             android:orientation="vertical">
 
-<!--            <ImageView-->
-<!--                android:id="@+id/tab_imagev"-->
-<!--                android:layout_width="wrap_content"-->
-<!--                android:layout_height="wrap_content"-->
-<!--                android:src="@drawable/hu_ru_yi_jie" />-->
-
             <ImageView
                 android:id="@+id/call_status_imagev"
                 android:layout_width="26dp"
@@ -125,6 +119,7 @@
                     android:id="@+id/processing_time_tv"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
+                    android:textColor="#F78B8F"
                     android:textSize="12sp" />
             </LinearLayout>
         </RelativeLayout>

+ 1 - 1
android_mobile/src/main/yd_w_xiaomi_2_chile/res/layout/user_setting_layout.xml

@@ -267,7 +267,7 @@
                     android:layout_gravity="center_horizontal"
                     android:layout_below="@id/btn_system_setting"
                     android:background="@drawable/javashop_btn_balck_line_bg"
-                    android:text="@string/contatc_update_title"
+                    android:text="@string/contact_update_title"
                     android:textSize="14dp" />
 
                 <Button

+ 1 - 17
android_mobile/src/main/yd_watch_2/code/com/wdkl/ncs/android/component/home/activity/WatchCallRecordsActivity.kt

@@ -64,8 +64,6 @@ class WatchCallRecordsActivity : BaseActivity<WatchCallRecordsFragmentPresenter,
 
     private val watchCallRecordsItemAdapter = WatchCallRecordsItemAdapter(ArrayList())
 
-    private lateinit var loadingDialog: LoadingDialog
-
     private var customerId = ""
 
     var all = "ALL"
@@ -104,8 +102,6 @@ class WatchCallRecordsActivity : BaseActivity<WatchCallRecordsFragmentPresenter,
         call_records_recyv.layoutManager = virtualLayoutManager
         call_records_recyv.adapter = delegateAdapter
 
-        //loadingDialog = CommonTool.createLoadingDialog(this, R.layout.custom_loading,R.id.loadding_image)
-
         receivedData = intent.getSerializableExtra("data") as WatchContactsVO?
         action = intent.getStringExtra("action")
         customerId = intent.getStringExtra("customer_id").toString()
@@ -168,16 +164,6 @@ class WatchCallRecordsActivity : BaseActivity<WatchCallRecordsFragmentPresenter,
                                 }
                                 TcpClient.getInstance().sendTcp(tcpModel, true, transaction)
 
-                                /*val tcpModel = PhoneUtil.phoneCall(Constants.deviceId, receivedData!!.deviceId)
-                                NettyClient.instance.sendMsg(tcpModel.toJson())
-                                    .subscribe { res: Boolean ->
-                                        if (res) {
-                                            Log.d(TAG, "TCP.发送消息完成")
-                                        } else {
-                                            Log.e(TAG, "TCP.发送消息失败")
-                                            HandleTcpConnect.instance.tcpReConnectWithMsgShow()
-                                        }
-                                    }*/
                             } else {
                                 showMessage("呼叫失败,可能手机号异常")
                             }
@@ -318,12 +304,10 @@ class WatchCallRecordsActivity : BaseActivity<WatchCallRecordsFragmentPresenter,
             Log.i(TAG, tcpModel.toJson())
             if (tcpModel.type == TcpType.VOICE) {
                 if (tcpModel.action == TcpAction.VoiceAction.SUCCESS) {
-                    //loadingDialog.dismiss()
                     //界面呈现,逻辑在service中
                 } else if (tcpModel.action == TcpAction.VoiceAction.FAILED) {
-                    //loadingDialog.dismiss()
                     call_relyout.isEnabled = true
-                    DeviceChannel.calling = false;
+                    DeviceChannel.calling = false
                     DeviceChannel.callId = 0
                     showMessage("呼叫失败,可能对方不在线")
                 }else if (tcpModel.action == TcpAction.VoiceAction.CALLING){

+ 0 - 35
android_mobile/src/main/yd_watch_2/code/com/wdkl/ncs/android/component/home/adapter/NewEventItemAdapter.kt

@@ -64,16 +64,13 @@ class NewEventItemAdapter(var data:ArrayList<InteractionVO>, val activity: Activ
         holder.bind { binding ->
             val itemData = getItem(position)
 
-            var toDeviceId:Int?
             binding.eliEventTime.text = TimeTransition().stampToDate(itemData.createDate*1000)
             binding.eliRoomName.text = itemData.fromFrameFullName
             var showName: String? = ""
             if (itemData.fromDeviceMemberId == Constants.memberId){
                 showName = itemData.toMemberName
-                toDeviceId = itemData.toDeviceId
             } else {
                 showName = itemData.fromMemberName
-                toDeviceId = itemData.fromDeviceId
             }
             binding.eliMemberName.text = showName
 
@@ -122,16 +119,6 @@ class NewEventItemAdapter(var data:ArrayList<InteractionVO>, val activity: Activ
                                 }
                             }
                             TcpClient.getInstance().sendTcp(tcpModel, false, transaction)
-
-                            /*NettyClient.instance.sendMsg(tcpModel.toJson()).subscribe {
-                                if (it) {
-                                    Log.d(TAG, "TCP.发送消息完成")
-                                } else {
-                                    Log.e(TAG, "TCP.发送消息失败")
-                                    HandleTcpConnect.instance.tcpReConnectWithMsgShow()
-                                }
-                                loadingDialog.dismiss()
-                            }*/
                         }
                     }
                 }
@@ -184,15 +171,6 @@ class NewEventItemAdapter(var data:ArrayList<InteractionVO>, val activity: Activ
                                     }
                                 }
                                 TcpClient.getInstance().sendTcp(tcpModel, false, transaction)
-
-                                /*NettyClient.instance.sendMsg(tcpModel.toJson()).subscribe {
-                                    if (it) {
-                                        Log.d(TAG, "TCP.发送消息完成")
-                                    } else {
-                                        Log.e(TAG, "TCP.发送消息失败")
-                                        HandleTcpConnect.instance.tcpReConnectWithMsgShow()
-                                    }
-                                }*/
                             }
                         }
                     }
@@ -241,19 +219,6 @@ class NewEventItemAdapter(var data:ArrayList<InteractionVO>, val activity: Activ
                                 }
                             }
                             TcpClient.getInstance().sendTcp(tcpModel, false, transaction)
-
-                            /*NettyClient.instance.sendMsg(tcpModel.toJson()).subscribe {
-                                if (it) {
-                                    Log.d(TAG, "TCP.发送消息完成")
-                                    tcpModel.data = Gson().toJson(itemData)
-                                    EventBus.getDefault().post(MessageEvent(tcpModel, 999))
-                                } else {
-                                    Log.e(TAG, "TCP.发送消息失败")
-
-                                    HandleTcpConnect.instance.tcpReConnectWithMsgShow()
-                                }
-                                loadingDialog.dismiss()
-                            }*/
                         }
                     }
                 }

+ 43 - 59
android_mobile/src/main/yd_watch_2/code/com/wdkl/ncs/android/component/home/adapter/WatchCallRecordsItemAdapter.kt

@@ -12,6 +12,7 @@ import com.wdkl.ncs.android.component.home.util.TimeTransition
 import com.wdkl.ncs.android.lib.adapter.BaseDelegateAdapter
 import com.wdkl.ncs.android.lib.utils.BaseRecyclerViewHolder
 import com.wdkl.ncs.android.middleware.model.vo.InteractionVO
+import com.wdkl.ncs.android.middleware.tcp.enums.EventStatusEnum
 import com.wdkl.ncs.android.middleware.tcp.enums.TcpType
 
 /**
@@ -67,6 +68,48 @@ class WatchCallRecordsItemAdapter(val data: ArrayList<InteractionVO>) : BaseDele
                 binding.callTimeTv.text = TimeTransition().stampToDate(itemData.createDate*1000)
             }
 
+            if (itemData.actionType == TcpType.EVENT.name) {
+                if (itemData.actionEndMemberId != null) {
+                    //已响应
+                    binding.treatmentStateImagev.setImageResource(R.drawable.checked_100)
+                    binding.treatmentStateImagev.visibility = View.VISIBLE
+                    binding.playTv.visibility = View.GONE
+                    binding.projectTv.visibility = View.VISIBLE
+                    binding.conductorNameTv.visibility = View.VISIBLE
+                    binding.projectTv.text = itemData.data
+                    binding.conductorNameTv.text = itemData.actionEndMemberName
+                    binding.processingTimeTv.text = TimeTransition().stampToDate(itemData.actionEnd*1000)
+                    binding.projectTv.setBackgroundResource(R.drawable.sp_event_do)
+                    binding.callStatusImagev.setImageResource(R.drawable.event_do)
+                    binding.callStatusImagev.visibility = View.VISIBLE
+                } else {
+                    if (itemData.actionStatus == EventStatusEnum.CANCELED.status) {
+                        //已取消
+                        binding.treatmentStateImagev.visibility = View.GONE
+                        binding.playTv.visibility = View.GONE
+                        binding.projectTv.visibility = View.VISIBLE
+                        binding.projectTv.text = itemData.data
+                        binding.projectTv.setBackgroundResource(R.drawable.sp_event_cancel)
+                        binding.callStatusImagev.setImageResource(R.drawable.event_undo)
+                        binding.callStatusImagev.visibility = View.VISIBLE
+                        binding.processingTimeTv.setText(R.string.event_cancel)
+                    } else {
+                        //未响应
+                        binding.treatmentStateImagev.setImageResource(R.drawable.unchecked_100)
+                        binding.treatmentStateImagev.visibility = View.VISIBLE
+                        binding.playTv.visibility = View.GONE
+                        binding.projectTv.visibility = View.VISIBLE
+                        binding.projectTv.text = itemData.data
+                        binding.projectTv.setBackgroundResource(R.drawable.sp_event_undo)
+                        binding.callStatusImagev.setImageResource(R.drawable.event_undo)
+                        binding.callStatusImagev.visibility = View.VISIBLE
+                        binding.processingTimeTv.setText(R.string.event_undo)
+                    }
+                }
+
+                return
+            }
+
             //是否已播放 已响应
             if (itemData.actionEnd != null) {
                 binding.treatmentStateImagev.setImageResource(R.drawable.checked_100)
@@ -95,39 +138,25 @@ class WatchCallRecordsItemAdapter(val data: ArrayList<InteractionVO>) : BaseDele
                     binding.processingTimeTv.text = TimeTransition().stampToDate(itemData.actionEnd*1000)
                     binding.projectTv.setBackgroundResource(R.drawable.sp_event_do)
                     binding.callStatusImagev.setImageResource(R.drawable.sos_96)
-                }else if(itemData.actionType == TcpType.EVENT.name){//事件已经响应 相应的数据
-                    binding.playTv.visibility = View.GONE
-                    binding.projectTv.visibility = View.VISIBLE
-                    binding.conductorNameTv.visibility = View.VISIBLE
-                    binding.projectTv.text = itemData.data
-                    binding.conductorNameTv.text = itemData.toMemberName
-                    binding.processingTimeTv.text = TimeTransition().stampToDate(itemData.actionEnd*1000)
-                    binding.projectTv.setBackgroundResource(R.drawable.sp_event_do)
-                    binding.callStatusImagev.setImageResource(R.drawable.event_do)
                 }else if (itemData.actionType == TcpType.IM.name){//语音已播放
-
                     binding.projectTv.visibility = View.GONE
                     binding.playTv.visibility = View.VISIBLE
                     binding.conductorNameTv.visibility = View.GONE
                     binding.playTv.setBackgroundResource(R.drawable.yi_bo_fang)
                     binding.processingTimeTv.text = "已播放"
-
                 }else if(itemData.actionType == TcpType.VOICE.name || itemData.actionType == TcpType.PHONE.name){ //语音呼叫已接听
                     binding.projectTv.visibility = View.GONE
                     binding.playTv.visibility = View.GONE
                     binding.treatmentStateImagev.visibility = View.GONE
                     binding.conductorNameTv.visibility = View.GONE
                     binding.processingTimeTv.visibility = View.GONE
-
                 }else if(itemData.actionType == TcpType.VIDEO.name){ //视频呼叫已接听
-
                     binding.projectTv.visibility = View.GONE
                     binding.playTv.visibility = View.GONE
                     binding.treatmentStateImagev.visibility = View.GONE
                     binding.conductorNameTv.visibility = View.GONE
                     binding.processingTimeTv.visibility = View.GONE
                 }
-
             } else {
                 binding.treatmentStateImagev.setImageResource(R.drawable.unchecked_100)
                 binding.treatmentStateImagev.visibility = View.VISIBLE
@@ -154,13 +183,6 @@ class WatchCallRecordsItemAdapter(val data: ArrayList<InteractionVO>) : BaseDele
                     binding.projectTv.setBackgroundResource(R.drawable.sp_event_undo)
                     binding.processingTimeTv.text = "未处理"
                     binding.callStatusImagev.setImageResource(R.drawable.sos_96)
-                }else if(itemData.actionType == TcpType.EVENT.name){//事件未处理
-                    binding.playTv.visibility = View.GONE
-                    binding.projectTv.visibility = View.VISIBLE
-                    binding.projectTv.text = itemData.data
-                    binding.projectTv.setBackgroundResource(R.drawable.sp_event_undo)
-                    binding.callStatusImagev.setImageResource(R.drawable.event_undo)
-                    binding.processingTimeTv.text = "未处理"
                 }else if (itemData.actionType == TcpType.IM.name){//语音未播放
                     binding.projectTv.visibility = View.GONE
                     binding.playTv.visibility = View.VISIBLE
@@ -176,46 +198,8 @@ class WatchCallRecordsItemAdapter(val data: ArrayList<InteractionVO>) : BaseDele
                     binding.playTv.visibility = View.GONE
                     binding.treatmentStateImagev.visibility = View.GONE
                     binding.processingTimeTv.visibility = View.GONE
-
                 }
             }
-
-//            binding.projectTv.setOnClickListener {
-//                if (itemData.actionEnd != null)return@setOnClickListener
-//                Log.i(TAG, "点击了事件按钮")
-//
-//                Thread(Runnable {
-//                    run {
-//                        if (!Constants.deviceId.equals("")) {
-//                            var eventTcpModel = EventUtil.eventResponse(Constants.deviceId.toInt(), itemData.fromDeviceId, itemData.id)
-//                            NettyClient.Companion.getInstance().sendMsg(eventTcpModel.toJson())
-//                        } else {
-//                            showMessage("获取不到当给前设备id")
-//                        }
-//                    }
-//                }).start()
-//
-//                //处理完之后要刷新数据
-//            }
-//            binding.playTv.setOnClickListener {
-//                if (itemData.actionEnd != null)return@setOnClickListener
-//                //点击之后播放语音留言
-//                showMessage("点击了播放留言")
-//                Thread(Runnable {
-//                    run {
-//                        if (!Constants.deviceId.equals("")) {
-//                            var imUtilTcpModel = ImUtil.imRead(Constants.deviceId.toInt(), itemData.fromDeviceId, itemData.id)
-//                            NettyClient.Companion.getInstance().sendMsg(imUtilTcpModel.toJson())
-//                            MediaPlayHelper.getInstance().playUrlMusic(UrlManager.build().device_url+itemData.data,0.8f,false)
-//                        } else {
-//                            showMessage("获取不到当给前设备id")
-//                        }
-//                    }
-//                }).start()
-//
-//                //处理完之后要刷新数据
-//            }
-
         }
     }
 

+ 5 - 0
android_mobile/src/main/yd_watch_2/res/drawable/sp_event_cancel.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#9FD8DF"/>
+    <corners android:radius="5sp"/>
+</shape>

+ 1 - 6
android_mobile/src/main/yd_watch_2/res/layout/adapter_watch_call_records_item.xml

@@ -15,12 +15,6 @@
             android:layout_centerVertical="true"
             android:orientation="vertical">
 
-<!--            <ImageView-->
-<!--                android:id="@+id/tab_imagev"-->
-<!--                android:layout_width="wrap_content"-->
-<!--                android:layout_height="wrap_content"-->
-<!--                android:src="@drawable/hu_ru_yi_jie" />-->
-
             <ImageView
                 android:id="@+id/call_status_imagev"
                 android:layout_width="26dp"
@@ -125,6 +119,7 @@
                     android:id="@+id/processing_time_tv"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
+                    android:textColor="#F78B8F"
                     android:textSize="12sp" />
             </LinearLayout>
         </RelativeLayout>