Commit 3ad3f065 by 刘鹏

增加控制时间接口

parent 9d2467ed
......@@ -10,7 +10,7 @@ ext {
"m-fm" : "0.0.30.03",
"m-user" : "0.0.61.37",
"m-home" : "0.0.22.65",
"m-im" : "0.0.19.25",
"m-im" : "0.0.19.26",
"m-dynamic" : "0.0.7.22",
"m-article" : "0.0.0.10",
......
package com.yidianling.im.bean;
public class SystemConfigByKeywordBean {
/**
* id : 464
* type : lingxi_set
* name : 灵犀跳转前置信息页时间配置
* keyword : lx_collect_card_config
* isOpen : 1
* sortNumber : 0
* remark :
* createTime : Jul 1, 2021 2:55:12 PM
* updateTime : Jul 3, 2021 4:54:47 PM
* value1 : 120
* value2 :
* value3 :
*/
public String value1;
}
......@@ -10,6 +10,7 @@ import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.RxUtils.applySchedulers
import com.ydl.ydlcommon.data.http.UpLoadLogUtils.upLoadLog
import com.ydl.ydlcommon.modular.ModularServiceManager
......@@ -30,6 +31,7 @@ import com.yidianling.im.bean.GetExpert
import com.yidianling.im.bean.UserTypeBean
import com.yidianling.im.bridge.P2PCustomActionHandlerImpl
import com.yidianling.im.config.constants.ImConstants
import com.yidianling.im.http.ImRetrofitApi
import com.yidianling.im.http.ImRetrofitApi.Companion.getImJavaApi
import com.yidianling.im.http.ImRetrofitApi.Companion.getImRetrofitApi
import com.yidianling.im.router.ImIn
......@@ -112,10 +114,17 @@ object IMChatUtil {
chatItemBean.toUid.toString(),
object : ChatDataRequestListener {
override fun onSuccess(expertInfo: IMExpertBuild) { //新前置信息收集入口
CmsExamQuestionPaperActivity.start(
context, chatItemBean.toUid.toString(), expertInfo,
0
)
ImRetrofitApi.Companion.getImRetrofitApi()
.getSystemConfigByKeyword("lx_collect_card_config")
.compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe{
CmsExamQuestionPaperActivity.start(
context, chatItemBean.toUid.toString(), expertInfo,
0, it.value1)
}
}
})
} else {
......@@ -212,12 +221,18 @@ object IMChatUtil {
} else if (TextUtils.equals(res.data!!.userType, USER_TYPE_ASSISTANT.toString())) {//助理
prepareAssistantChatData(context, toUid, object : ChatDataRequestListener {
override fun onSuccess(expertInfo: IMExpertBuild) { //新前置信息收集入口
CmsExamQuestionPaperActivity.start(
context,
toUid,
expertInfo,
isFromQingShu
)
ImRetrofitApi.Companion.getImRetrofitApi()
.getSystemConfigByKeyword("lx_collect_card_config")
.compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe{
CmsExamQuestionPaperActivity.start(
context, toUid, expertInfo,
isFromQingShu, it.value1
)
}
}
})
} else {
......
......@@ -129,4 +129,10 @@ interface ImRetrofitApi {
@POST("chat/sendNoticeMessage")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun lingxiSendNotice(@Body body: RequestBody): Observable<BaseAPIResponse<Any>>
/**已完成订单*/
@GET("systemconfig/getSystemConfigByKeyword")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getSystemConfigByKeyword( @Query("keyword") keyword: String): Observable<BaseAPIResponse<SystemConfigByKeywordBean>>
}
\ No newline at end of file
......@@ -80,13 +80,18 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
private lateinit var expertInfo: IMExpertBuild
private lateinit var toUid: String
private var isFromQingShu: Int = 0
private var skip_time: Long = 0
@JvmStatic
fun start(context: Context, toUid: String, expertInfo: IMExpertBuild, isFromQingShu: Int) {
fun start(
context: Context, toUid: String, expertInfo: IMExpertBuild,
isFromQingShu: Int, skip_time: String
) {
val starter = Intent(context, CmsExamQuestionPaperActivity::class.java)
this.expertInfo = expertInfo
this.toUid = toUid
this.isFromQingShu = isFromQingShu
this.skip_time = skip_time.toLong()
context.startActivity(starter)
}
}
......@@ -663,13 +668,13 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
if (skipTime == null || skipTime.isEmpty()) {
return false
}
val timeDifference = time - skipTime.toLong()
val timeDifference = (time - skipTime.toLong()) / 1000
val second = 1000
val minute = second * 60
val hour = minute * 60
val day = hour * 24
return timeDifference > 2 * second
return timeDifference > skip_time
}
/**
......
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