Commit 8b670006 by 霍志良

fix:修改专家挂断,用户界面没有销毁BUG,导致后台记录时长异常。增加dialStatus专家状态日志。

parent e9924424
...@@ -5,7 +5,7 @@ ext { ...@@ -5,7 +5,7 @@ ext {
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.48.81", "m-confide" : "0.0.48.82",
"m-consultant" : "0.0.59.36", "m-consultant" : "0.0.59.36",
"m-fm" : "0.0.30.00", "m-fm" : "0.0.30.00",
"m-user" : "0.0.60.34", "m-user" : "0.0.60.34",
...@@ -40,7 +40,7 @@ ext { ...@@ -40,7 +40,7 @@ ext {
"ydl-webview" : "0.0.38.33", "ydl-webview" : "0.0.38.33",
"ydl-media" : "0.0.21.6", "ydl-media" : "0.0.21.6",
"ydl-pay" : "0.0.18.13", "ydl-pay" : "0.0.18.13",
"m-audioim" : "0.0.49.29.13", "m-audioim" : "0.0.49.29.14",
"ydl-flutter-base": "0.0.14.20", "ydl-flutter-base": "0.0.14.20",
//以下 几乎不会动 //以下 几乎不会动
...@@ -89,7 +89,7 @@ ext { ...@@ -89,7 +89,7 @@ ext {
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.48.81", "m-confide" : "0.0.48.82",
"m-consultant" : "0.0.51.16", "m-consultant" : "0.0.51.16",
"m-fm" : "0.0.23.5", "m-fm" : "0.0.23.5",
"m-user" : "0.0.41.13", "m-user" : "0.0.41.13",
...@@ -121,7 +121,7 @@ ext { ...@@ -121,7 +121,7 @@ ext {
"ydl-webview" : "0.0.38.32", "ydl-webview" : "0.0.38.32",
"ydl-media" : "0.0.21.6", "ydl-media" : "0.0.21.6",
"ydl-pay" : "0.0.18.11", "ydl-pay" : "0.0.18.11",
"m-audioim" : "0.0.49.29.13", "m-audioim" : "0.0.49.29.14",
"ydl-flutter-base": "0.0.14.20", "ydl-flutter-base": "0.0.14.20",
//以下 几乎不会动 //以下 几乎不会动
......
...@@ -193,6 +193,11 @@ class AudioHomeActivity : ...@@ -193,6 +193,11 @@ class AudioHomeActivity :
private var hasUpLoadLog = false private var hasUpLoadLog = false
private var callStatus: Int = -1 private var callStatus: Int = -1
/**
* dialStatus 专家通话状态。
*/
private var dialStatus: String? = null
/** /**
* 声网事件回调 (SDK 通过指定的事件通知应用程序 SDK 的运行事件,如: 加入或离开频道,新用户加入频道等) * 声网事件回调 (SDK 通过指定的事件通知应用程序 SDK 的运行事件,如: 加入或离开频道,新用户加入频道等)
...@@ -326,8 +331,8 @@ class AudioHomeActivity : ...@@ -326,8 +331,8 @@ class AudioHomeActivity :
super.onConnectionStateChanged(state, reason) super.onConnectionStateChanged(state, reason)
// 3 网络连接被服务器中止 该情况现在是因为后端踢人逻辑 // 3 网络连接被服务器中止 该情况现在是因为后端踢人逻辑
if (reason == 3) { if (reason == 3) {
writeAgoraLog("通话结束:原因(${reason})") writeAgoraLog("通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason})")
com.yidianling.common.tools.ToastUtil.toastShort("专家已挂断") // com.yidianling.common.tools.ToastUtil.toastShort("专家已挂断")
//通话结束或挂断时,上传日志文件 //通话结束或挂断时,上传日志文件
uploadLog() uploadLog()
leaveChannel() leaveChannel()
...@@ -355,7 +360,8 @@ class AudioHomeActivity : ...@@ -355,7 +360,8 @@ class AudioHomeActivity :
//通话结束或挂断时,上传日志文件 //通话结束或挂断时,上传日志文件
uploadLog() uploadLog()
showToast("专家已挂断") showToast("专家已挂断")
//UserOffLine之后,销毁界面,解决,userOffline有回调之后,onConnectionStateChanged(服务端踢人方法没有调),导致记录时长异常。
leaveChannel()
YDLavManager.instances.callEndStatusUpdate(channelId!!, 4, "对方离开频道") YDLavManager.instances.callEndStatusUpdate(channelId!!, 4, "对方离开频道")
if (totalDisposable != null) { if (totalDisposable != null) {
...@@ -477,6 +483,8 @@ class AudioHomeActivity : ...@@ -477,6 +483,8 @@ class AudioHomeActivity :
listenerUid = intent.getStringExtra(IntentConstants.INTENT_LISTENER_UID) listenerUid = intent.getStringExtra(IntentConstants.INTENT_LISTENER_UID)
listenId = intent.getStringExtra(IntentConstants.INTENT_LISTEN_ID) listenId = intent.getStringExtra(IntentConstants.INTENT_LISTEN_ID)
commentUrl = intent.getStringExtra(IntentConstants.INTENT_COMMENT_URL) commentUrl = intent.getStringExtra(IntentConstants.INTENT_COMMENT_URL)
dialStatus = intent.getStringExtra(IntentConstants.INTENT_DIALSTATUS)
writeAgoraLog("专家的通话状态dialStatus:$dialStatus", isAppend = false)
isShowAXB = intent.getBooleanExtra(IntentConstants.INTENT_ISSHOWAXB, true) isShowAXB = intent.getBooleanExtra(IntentConstants.INTENT_ISSHOWAXB, true)
val logBean = AgoraLogInfoBean( val logBean = AgoraLogInfoBean(
......
...@@ -22,4 +22,5 @@ public interface IntentConstants { ...@@ -22,4 +22,5 @@ public interface IntentConstants {
String INTENT_LISTEN_ID= "intent_listen_id"; String INTENT_LISTEN_ID= "intent_listen_id";
String INTENT_COMMENT_URL= "intent_comment_url"; String INTENT_COMMENT_URL= "intent_comment_url";
String INTENT_ISSHOWAXB= "intent_isshowaxb"; String INTENT_ISSHOWAXB= "intent_isshowaxb";
String INTENT_DIALSTATUS="intent_dialstatus";
} }
...@@ -25,23 +25,30 @@ import com.yidianling.ydl_pay.pay.payDialog.ConfidePayParams ...@@ -25,23 +25,30 @@ import com.yidianling.ydl_pay.pay.payDialog.ConfidePayParams
import com.yidianling.ydl_pay.pay.payDialog.PayDialog import com.yidianling.ydl_pay.pay.payDialog.PayDialog
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
/** /**
* Created by haorui on 2019-10-10. * Created by haorui on 2019-10-10.
* Des: 对应主项目中的WebServiceImpl * Des: 对应主项目中的WebServiceImpl
*/ */
class ConfideWebServiceImpl{ class ConfideWebServiceImpl {
//倾诉支付弹窗 //倾诉支付弹窗
fun confidePayDialog(id: Int?, type : Int?, activity: Activity, confidePay : ConfidePayParams, callType:String?){ fun confidePayDialog(
id: Int?,
type: Int?,
activity: Activity,
confidePay: ConfidePayParams,
callType: String?
) {
PayDialog(activity) PayDialog(activity)
.setCallback(object : CallBack { .setCallback(object : CallBack {
override fun onSuccess() { override fun onSuccess() {
//支付成功,直接拨打 //支付成功,直接拨打
if (TextUtils.isEmpty(confidePay.confideUrl)){ if (TextUtils.isEmpty(confidePay.confideUrl)) {
connectionJava(id?:0,type?:1,activity,null,callType) connectionJava(id ?: 0, type ?: 1, activity, null, callType)
}else{ } else {
//倾诉订单列表页面过来,会有confideUrl值,则直接跳转此url //倾诉订单列表页面过来,会有confideUrl值,则直接跳转此url
NewH5Activity.start(activity, H5Params(confidePay.confideUrl!!,"")) NewH5Activity.start(activity, H5Params(confidePay.confideUrl!!, ""))
} }
} }
...@@ -55,41 +62,72 @@ class ConfideWebServiceImpl{ ...@@ -55,41 +62,72 @@ class ConfideWebServiceImpl{
//java版axb和声网接口 //java版axb和声网接口
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
fun connectionJava(id: Int, type : Int, activity: Activity, tellData : TellData?, callType:String?){ fun connectionJava(
ConfideHomeDataManager.getHttp().connectionJava(ConnectParamJava(""+id, ""+type,callType)) id: Int,
type: Int,
activity: Activity,
tellData: TellData?,
callType: String?
) {
ConfideHomeDataManager.getHttp()
.connectionJava(ConnectParamJava("" + id, "" + type, callType))
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe({ .subscribe({
if ("200" == it.code){ if ("200" == it.code) {
if (it.data?.dialDetail?.dialStatus !=null){ if (it.data?.dialDetail?.dialStatus != null) {
if (100007 == it.data?.dialDetail?.dialStatus) { if (100007 == it.data?.dialDetail?.dialStatus) {
//支付弹窗 //支付弹窗
//参数转换 //参数转换
var confidePay = ConfidePayParams(it.data?.payTitle?:"倾诉服务",it.data?.listenOrderPrice,it.data?.coupon?.couponMoney?:0.00, var confidePay = ConfidePayParams(
it.data?.userBaseInfoRespDto?.availableMoney?:0.00,it.data?.payId?:"","","") it.data?.payTitle ?: "倾诉服务",
confidePayDialog(id,type,activity,confidePay,callType) it.data?.listenOrderPrice,
it.data?.coupon?.couponMoney ?: 0.00,
it.data?.userBaseInfoRespDto?.availableMoney ?: 0.00,
it.data?.payId ?: "",
"",
""
)
confidePayDialog(id, type, activity, confidePay, callType)
} else if (100008 == it.data?.dialDetail?.dialStatus) { } else if (100008 == it.data?.dialDetail?.dialStatus) {
CommonDialog(activity) CommonDialog(activity)
.setCancelAble(false) .setCancelAble(false)
.setMessage(FinalString.TEL_BINDPHONE) .setMessage(FinalString.TEL_BINDPHONE)
.setLeftOnclick("忍痛放弃",null) .setLeftOnclick("忍痛放弃", null)
.setRightClick("果断绑定") { view-> .setRightClick("果断绑定") { view ->
try { try {
ModularServiceManager.provide(IUserService::class.java).wxBindToInputhonePage(activity) ModularServiceManager.provide(IUserService::class.java)
}catch (e: Exception) {} .wxBindToInputhonePage(activity)
} catch (e: Exception) {
}
} }
.show() .show()
}else if(0==it.data?.dialDetail?.dialStatus){ } else if (0 == it.data?.dialDetail?.dialStatus) {
//连接成功 //连接成功
if (it.data?.dialDetail?.callConnectType?:-1==3){ if (it.data?.dialDetail?.callConnectType ?: -1 == 3) {
//声网 //声网
it.data?.dialDetail?.agoraExpertInfo?:return@subscribe it.data?.dialDetail?.agoraExpertInfo ?: return@subscribe
callAgora(activity,id,it.data!!.dialDetail!!.agoraExpertInfo!!,it.data.callId?:"0",it.data.listenOrderId?:0L,tellData,it.data.isShowAxb) callAgora(
}else{ activity,
id,
it.data!!.dialDetail!!.agoraExpertInfo!!,
it.data.callId ?: "0",
it.data.listenOrderId ?: 0L,
tellData,
it.data.isShowAxb,
it.data?.dialDetail?.dialStatus.toString()
)
} else {
//axb //axb
val dialog = AxbConfirmDialog(activity,1,object :AxbConfirmDialog.OnClickEnsureListener{ val dialog = AxbConfirmDialog(
activity,
1,
object : AxbConfirmDialog.OnClickEnsureListener {
override fun onClickEnsure() { override fun onClickEnsure() {
var phoneIntent = Intent(Intent.ACTION_DIAL, Uri.parse("tel:${it.data?.dialDetail?.phoneNu?:0}")) var phoneIntent = Intent(
Intent.ACTION_DIAL,
Uri.parse("tel:${it.data?.dialDetail?.phoneNu ?: 0}")
)
activity.startActivity(phoneIntent) activity.startActivity(phoneIntent)
} }
...@@ -99,22 +137,31 @@ class ConfideWebServiceImpl{ ...@@ -99,22 +137,31 @@ class ConfideWebServiceImpl{
}) })
dialog.show() dialog.show()
} }
}else{ } else {
ToastHelper.show(it.data?.dialDetail?.dialReason?:"连接失败") ToastHelper.show(it.data?.dialDetail?.dialReason ?: "连接失败")
} }
}else{ } else {
ToastHelper.show(it.data?.dialDetail?.dialReason?:"连接失败") ToastHelper.show(it.data?.dialDetail?.dialReason ?: "连接失败")
} }
}else{ } else {
ToastHelper.show(it.msg) ToastHelper.show(it.msg)
} }
}, { }, {
ToastHelper.show(it.message?:"连接失败") ToastHelper.show(it.message ?: "连接失败")
}) })
} }
//启动声网电话 //启动声网电话
private fun callAgora(activity: Activity, confideId:Int, expertInfo : ExpertInfoBean, call_id:String, relation_id:Long, tellData: TellData?,isShowAXB:Boolean){ private fun callAgora(
activity: Activity,
confideId: Int,
expertInfo: ExpertInfoBean,
call_id: String,
relation_id: Long,
tellData: TellData?,
isShowAXB: Boolean,
dialStatus: String
) {
//3G以下或者其他不确定异常能判断出来的 //3G以下或者其他不确定异常能判断出来的
if (!ConfideNetworkUtil.isWifiOr3G(activity)) { if (!ConfideNetworkUtil.isWifiOr3G(activity)) {
CommonDialog.create(activity) CommonDialog.create(activity)
...@@ -124,7 +171,7 @@ class ConfideWebServiceImpl{ ...@@ -124,7 +171,7 @@ class ConfideWebServiceImpl{
} }
.setRightClick("普通电话拨号") { .setRightClick("普通电话拨号") {
connectionJava(confideId,1,activity,tellData,"0") connectionJava(confideId, 1, activity, tellData, "0")
} }
.show() .show()
} else { } else {
...@@ -138,8 +185,9 @@ class ConfideWebServiceImpl{ ...@@ -138,8 +185,9 @@ class ConfideWebServiceImpl{
return return
} }
if(expertInfo.remainingTime?.remainingTime==null){ if (expertInfo.remainingTime?.remainingTime == null) {
expertInfo.remainingTime = ExpertInfoBean.ListenRemainingTime(expertInfo.totalDuration); expertInfo.remainingTime =
ExpertInfoBean.ListenRemainingTime(expertInfo.totalDuration);
} }
ARouter.getInstance().build("/av/AudioHomeActivity") ARouter.getInstance().build("/av/AudioHomeActivity")
...@@ -147,7 +195,10 @@ class ConfideWebServiceImpl{ ...@@ -147,7 +195,10 @@ class ConfideWebServiceImpl{
.withString(IntentConstants.INTENT_EXPERT_NAME, expertInfo.expertName) .withString(IntentConstants.INTENT_EXPERT_NAME, expertInfo.expertName)
.withString(IntentConstants.INTENT_EXPERT_TIPS, expertInfo.expertTips) .withString(IntentConstants.INTENT_EXPERT_TIPS, expertInfo.expertTips)
.withString(IntentConstants.INTENT_ROOM_ID, expertInfo.channelId) .withString(IntentConstants.INTENT_ROOM_ID, expertInfo.channelId)
.withString(IntentConstants.INTENT_REMAIN_TIME, expertInfo.remainingTime.remainingTime) .withString(
IntentConstants.INTENT_REMAIN_TIME,
expertInfo.remainingTime.remainingTime
)
.withString(IntentConstants.INTENT_CALL_ID, call_id) .withString(IntentConstants.INTENT_CALL_ID, call_id)
.withString(IntentConstants.INTENT_RELATION_ID, "${relation_id}") .withString(IntentConstants.INTENT_RELATION_ID, "${relation_id}")
.withString(IntentConstants.INTENT_TOKEN, expertInfo.token) .withString(IntentConstants.INTENT_TOKEN, expertInfo.token)
...@@ -156,7 +207,8 @@ class ConfideWebServiceImpl{ ...@@ -156,7 +207,8 @@ class ConfideWebServiceImpl{
.withString(IntentConstants.INTENT_TOTAL_DURATION, expertInfo.totalDuration) .withString(IntentConstants.INTENT_TOTAL_DURATION, expertInfo.totalDuration)
.withString(IntentConstants.INTENT_COMMENT_URL, expertInfo.commentUrl) .withString(IntentConstants.INTENT_COMMENT_URL, expertInfo.commentUrl)
.withString(IntentConstants.INTENT_LISTEN_ID, confideId.toString()) .withString(IntentConstants.INTENT_LISTEN_ID, confideId.toString())
.withBoolean(IntentConstants.INTENT_ISSHOWAXB,isShowAXB) .withString(IntentConstants.INTENT_DIALSTATUS, dialStatus)
.withBoolean(IntentConstants.INTENT_ISSHOWAXB, isShowAXB)
.navigation(activity) .navigation(activity)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment