update 获取企业列表
This commit is contained in:
@@ -48,6 +48,7 @@ public class WeworkMessageBean {
|
||||
* 获取好友信息 GET_FRIEND_INFO
|
||||
* 获取我的信息 GET_MY_INFO
|
||||
* 获取最近聊天列表 GET_RECENT_LIST
|
||||
* 获取企业列表 GET_CORP_LIST
|
||||
*/
|
||||
public static final int HEART_BEAT = 11;
|
||||
public static final int TYPE_RECEIVE_MESSAGE_LIST = 101;
|
||||
@@ -86,6 +87,7 @@ public class WeworkMessageBean {
|
||||
public static final int GET_MY_INFO = 503;
|
||||
public static final int GET_GROUP_QRCODE = 504;
|
||||
public static final int GET_RECENT_LIST = 505;
|
||||
public static final int GET_CORP_LIST = 506;
|
||||
|
||||
/**
|
||||
* roomType
|
||||
|
||||
@@ -187,6 +187,9 @@ object MyLooper {
|
||||
WeworkMessageBean.GET_RECENT_LIST -> {
|
||||
WeworkController.getRecentList(message)
|
||||
}
|
||||
WeworkMessageBean.GET_CORP_LIST -> {
|
||||
WeworkController.getCorpList(message)
|
||||
}
|
||||
WeworkMessageBean.ROBOT_CONTROLLER_TEST -> {
|
||||
WeworkController.test(message)
|
||||
}
|
||||
|
||||
@@ -412,4 +412,14 @@ object WeworkController {
|
||||
return WeworkGetImpl.getRecentList(message)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取企业列表
|
||||
* @see WeworkMessageBean.GET_CORP_LIST
|
||||
*/
|
||||
@RequestMapping
|
||||
fun getCorpList(message: WeworkMessageBean): Boolean {
|
||||
LogUtils.d("getCorpList():")
|
||||
return WeworkGetImpl.getCorpList(message)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -87,7 +87,7 @@ object WeworkGetImpl {
|
||||
sumInfo = info.toString()
|
||||
}
|
||||
WeworkController.weworkService.webSocketManager.send(weworkMessageBean)
|
||||
return true
|
||||
return getCorpList(message)
|
||||
} else {
|
||||
LogUtils.d("未找到我的昵称")
|
||||
log("未找到我的昵称")
|
||||
@@ -135,7 +135,7 @@ object WeworkGetImpl {
|
||||
weworkMessageBean.type = WeworkMessageBean.GET_MY_INFO
|
||||
weworkMessageBean.myInfo = myInfo
|
||||
WeworkController.weworkService.webSocketManager.send(weworkMessageBean)
|
||||
return true
|
||||
return getCorpList(message)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -238,4 +238,39 @@ object WeworkGetImpl {
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取企业列表
|
||||
*/
|
||||
fun getCorpList(message: WeworkMessageBean): Boolean {
|
||||
goHomeTab("消息")
|
||||
val firstTv = AccessibilityUtil.findAllByClazz(getRoot(), Views.TextView)
|
||||
.firstOrNull { it.text == null }
|
||||
AccessibilityUtil.performClick(firstTv, retry = false)
|
||||
sleep(Constant.CHANGE_PAGE_INTERVAL)
|
||||
val listviewList = AccessibilityUtil.findAllOnceByClazz(getRoot(), Views.RecyclerView, Views.ListView, Views.ViewGroup)
|
||||
.filter { it.childCount >= 2 }
|
||||
val list = listviewList.firstOrNull()
|
||||
if (list != null) {
|
||||
val corpList = arrayListOf<String>()
|
||||
for (i in 0 until list.childCount) {
|
||||
val item = list.getChild(i)
|
||||
val tvList = AccessibilityUtil.findAllOnceByClazz(item, Views.TextView)
|
||||
val textList = tvList.filter { it.text != null }.map { it.text.toString() }
|
||||
if (textList.isNotEmpty()) {
|
||||
corpList.add(textList[0])
|
||||
}
|
||||
}
|
||||
LogUtils.d("我的企业", GsonUtils.toJson(corpList))
|
||||
val weworkMessageBean = WeworkMessageBean()
|
||||
weworkMessageBean.type = WeworkMessageBean.GET_CORP_LIST
|
||||
weworkMessageBean.titleList = corpList
|
||||
WeworkController.weworkService.webSocketManager.send(weworkMessageBean)
|
||||
goHome()
|
||||
return true
|
||||
} else {
|
||||
LogUtils.e("未找到企业列表")
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user