提交 c44f6a19 编写于 作者: F fancy

会议管理可打开在线会议

上级 44eb9f39
......@@ -239,7 +239,11 @@ class FastCheckInManager() {
}
// 结束定位
private fun stopLocation() {
mLocationClient.stop()
try {
mLocationClient.stop()
} catch (e: Exception) {
XLog.error("", e)
}
}
/**
......
......@@ -248,7 +248,7 @@ class O2InstantMessageActivity : BaseMVPActivity<O2InstantMessageContract.View,
}
}else if (type.startsWith("meeting_")) {
setLinkStyle(textView) {
go<MeetingMainActivity>()
openMeeting(msg)
}
}else if (type.startsWith("attachment_")) {
setLinkStyle(textView) {
......@@ -280,6 +280,14 @@ class O2InstantMessageActivity : BaseMVPActivity<O2InstantMessageContract.View,
}
}
private fun openMeeting(msg: InstantMessage) {
val json = JSONTokener(msg.body).nextValue()
if (json is JSONObject) {
val id = try {json.getString("id")}catch (e: Exception){null}
MeetingMainActivity.openWithMeetingInfo(this, id)
}
}
private fun openWork(msg: InstantMessage, textView: TextView) {
val json = JSONTokener(msg.body).nextValue()
if (json is JSONObject) {
......
......@@ -47,8 +47,10 @@ class O2IMConversationPresenter : BasePresenterImpl<O2IMConversationContract.Vie
ser.instantMessageList(100)
.subscribeOn(Schedulers.io())
.flatMap { res ->
val list = res.data
if (list != null && list.isNotEmpty()) {
XLog.info("instant message size ${list.size}")
val newList = list.sortedBy { it.createTime }
Observable.just(newList)
}else {
......
package net.zoneland.x.bpm.mobile.v1.zoneXBPM.app.meeting.invited
import android.app.Activity
import android.os.Bundle
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
......@@ -19,6 +20,7 @@ import net.zoneland.x.bpm.mobile.v1.zoneXBPM.utils.AndroidUtils
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.utils.FileExtensionHelper
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.utils.XLog
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.utils.XToast
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.utils.extension.go
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.utils.imageloader.O2ImageLoaderManager
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.widgets.CircleImageView
import java.io.File
......@@ -34,19 +36,30 @@ class MeetingDetailInfoActivity : BaseMVPActivity<MeetingDetailInfoContract.View
private val meetingFileList = ArrayList<MeetingFileInfoJson>()
companion object {
val meetingDetail = "MEETING_DETAIL_INFO"
const val meetingDetailKey = "MEETING_DETAIL_INFO"
fun openMeetingDetail(activity: Activity, meetingInfo: MeetingInfoJson) {
if (meetingInfo.mode == "online" && !TextUtils.isEmpty(meetingInfo.roomLink)) {
XLog.info("打开在线会议,${meetingInfo.roomLink}")
AndroidUtils.runDefaultBrowser(activity, meetingInfo.roomLink)
} else {
val bundle = Bundle()
bundle.putSerializable(meetingDetailKey, meetingInfo)
activity.go<MeetingDetailInfoActivity>(bundle)
}
}
}
override fun afterSetContentView(savedInstanceState: Bundle?) {
setupToolBar(getString(R.string.meeting_detail),true,false)
if (intent.extras?.getSerializable(meetingDetail) == null) {
if (intent.extras?.getSerializable(meetingDetailKey) == null) {
XToast.toastShort(this, "没有获取到会议详细信息!")
finish()
return
}
val meetingDetailInfo = intent.extras?.getSerializable(meetingDetail) as MeetingInfoJson
val meetingDetailInfo = intent.extras?.getSerializable(meetingDetailKey) as MeetingInfoJson
notAcceptPersonList.addAll(meetingDetailInfo.inviteMemberList)
notAcceptPersonList.removeAll(meetingDetailInfo.acceptPersonList)
acceptPersonList.addAll(meetingDetailInfo.acceptPersonList)
......
package net.zoneland.x.bpm.mobile.v1.zoneXBPM.app.meeting.main
import android.app.Activity
import android.os.Bundle
import android.text.TextUtils
import androidx.fragment.app.Fragment
import android.view.View
import kotlinx.android.synthetic.main.activity_meeting.*
......@@ -9,12 +11,15 @@ import kotlinx.android.synthetic.main.fragment_meeting_bottom_bar.*
import net.muliba.changeskin.FancySkinManager
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.R
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.app.base.BaseMVPActivity
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.app.meeting.invited.MeetingDetailInfoActivity
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.app.meeting.invited.MeetingInvitedFragment
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.app.meeting.room.MeetingRoomFragment
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.core.component.adapter.CommonFragmentPagerAdapter
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.model.bo.api.meeting.MeetingInfoJson
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.utils.XToast
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.utils.extension.addOnPageChangeListener
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.utils.extension.go
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.widgets.dialog.O2DialogSupport
class MeetingMainActivity : BaseMVPActivity<MeetingMainContract.View, MeetingMainContract.Presenter>(), MeetingMainContract.View, View.OnClickListener {
......@@ -28,11 +33,23 @@ class MeetingMainActivity : BaseMVPActivity<MeetingMainContract.View, MeetingMai
override var mPresenter: MeetingMainContract.Presenter = MeetingMainPresenter()
companion object {
const val meetingInfoIdKey = "meetingInfoIdKey" // 需要打开的会议详情的 id
fun openWithMeetingInfo(activity: Activity, meetingInfoId: String?) {
val bundle = Bundle()
bundle.putString(meetingInfoIdKey, meetingInfoId)
activity.go<MeetingMainActivity>(bundle)
}
}
override fun layoutResId(): Int = R.layout.activity_meeting
override fun afterSetContentView(savedInstanceState: Bundle?) {
setupToolBar(getString(R.string.title_activity_meeting), true, true)
setupToolBar(getString(R.string.title_activity_meeting),
setupBackButton = true,
isCloseBackIcon = true
)
fragmentList.add(MeetingMainFragment())
fragmentList.add(MeetingInvitedFragment())
......@@ -56,6 +73,11 @@ class MeetingMainActivity : BaseMVPActivity<MeetingMainContract.View, MeetingMai
icon_meeting_room_tab.setOnClickListener(this)
selectTab(0)
val id = intent?.extras?.getString(meetingInfoIdKey)
if (!TextUtils.isEmpty(id)) {
mPresenter.getMeetingById(id!!)
}
}
private fun selectTab(i: Int) {
......@@ -112,4 +134,13 @@ class MeetingMainActivity : BaseMVPActivity<MeetingMainContract.View, MeetingMai
overridePendingTransition(R.anim.activity_scale_in, R.anim.activity_scale_out)
}
override fun getMeetingById(meetingInfo: MeetingInfoJson) {
O2DialogSupport.openConfirmDialog(this, "需要打开会议【${meetingInfo.subject}】的具体页面吗?", {d ->
MeetingDetailInfoActivity.openMeetingDetail(this, meetingInfo)
})
}
override fun error(errorMsg: String) {
XToast.toastShort(errorMsg)
}
}
......@@ -2,10 +2,16 @@ package net.zoneland.x.bpm.mobile.v1.zoneXBPM.app.meeting.main
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.app.base.BasePresenter
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.app.base.BaseView
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.model.bo.api.meeting.MeetingInfoJson
object MeetingMainContract {
interface View : BaseView
interface View : BaseView {
fun getMeetingById(meetingInfo: MeetingInfoJson)
fun error(errorMsg: String)
}
interface Presenter : BasePresenter<View>
interface Presenter : BasePresenter<View> {
fun getMeetingById(id: String)
}
}
......@@ -68,9 +68,7 @@ class MeetingMainFragment : BaseMVPViewPagerFragment<MeetingMainFragmentContract
meeting_recycler_view.adapter = adapter
adapter.setOnItemClickListener { _, position ->
val meetingInvited = meetingList[position]
val bundle = Bundle()
bundle.putSerializable(MeetingDetailInfoActivity.meetingDetail, meetingInvited)
activity?.go<MeetingDetailInfoActivity>(bundle)
mPresenter.getMeetingById(meetingInvited.id)
}
ll_meeting_main_month_chang.setOnClickListener {
......@@ -268,6 +266,13 @@ class MeetingMainFragment : BaseMVPViewPagerFragment<MeetingMainFragmentContract
XToast.toastShort(activity, message)
}
override fun getMeetingById(meetingInfo: MeetingInfoJson) {
activity?.let {
MeetingDetailInfoActivity.openMeetingDetail(it, meetingInfo)
}
}
private val adapter: CommonRecycleViewAdapter<MeetingInfoJson> by lazy {
object : CommonRecycleViewAdapter<MeetingInfoJson>(activity, meetingList, R.layout.item_meeting_list_view) {
override fun convert(holder: CommonRecyclerViewHolder?, t: MeetingInfoJson?) {
......
......@@ -18,6 +18,7 @@ object MeetingMainFragmentContract {
fun checkViewerBack(isDay: Boolean, result: Boolean)
fun startProcessSuccess(workId:String)
fun startProcessFail(message:String)
fun getMeetingById(meetingInfo: MeetingInfoJson)
}
interface Presenter : BasePresenter<View> {
......@@ -29,5 +30,6 @@ object MeetingMainFragmentContract {
fun checkViewer(isDay: Boolean, config: String)
fun loadCurrentPersonIdentityWithProcess(processId: String)
fun startProcess(title: String, identifyId: String, processId: String)
fun getMeetingById(id: String)
}
}
......@@ -314,4 +314,25 @@ class MeetingMainFragmentPresenter : BasePresenterImpl<MeetingMainFragmentContra
})
}
}
override fun getMeetingById(id: String) {
if (TextUtils.isEmpty(id)) {
mView?.onException("参数不能为空!")
return
}
getMeetingAssembleControlService(mView?.getContext())?.let { service ->
service.getMeetingById(id)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.o2Subscribe {
onNext {
mView?.getMeetingById(it.data)
}
onError { e, isNetworkError ->
XLog.error("", e)
mView?.onException(e?.message ?: "请求异常!")
}
}
}
}
}
package net.zoneland.x.bpm.mobile.v1.zoneXBPM.app.meeting.main
import android.text.TextUtils
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.app.base.BasePresenterImpl
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.utils.XLog
import net.zoneland.x.bpm.mobile.v1.zoneXBPM.utils.extension.o2Subscribe
import rx.android.schedulers.AndroidSchedulers
import rx.schedulers.Schedulers
class MeetingMainPresenter : BasePresenterImpl<MeetingMainContract.View>(), MeetingMainContract.Presenter
class MeetingMainPresenter : BasePresenterImpl<MeetingMainContract.View>(), MeetingMainContract.Presenter {
override fun getMeetingById(id: String) {
if (TextUtils.isEmpty(id)) {
mView?.error("参数不能为空!")
return
}
getMeetingAssembleControlService(mView?.getContext())?.let { service ->
service.getMeetingById(id)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.o2Subscribe {
onNext {
mView?.getMeetingById(it.data)
}
onError { e, isNetworkError ->
XLog.error("", e)
mView?.error(e?.message ?: "请求异常!")
}
}
}
}
}
......@@ -45,7 +45,12 @@ data class MeetingInfoJson(
var attachmentList : List<MeetingFileInfoJson> = ArrayList(),
var hostUnit: String = "",// 承办部门
var hostPerson: String = "",// 主持人
var type: String = "" // 会议类型
var type: String = "", // 会议类型
// 2023-05 新增字段 在线会议
var mode:String = "", // online
var roomId:String = "", // 在线会议房间号
var roomLink: String = "", // 在线会议打开链接
): Serializable
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册