群组概括信息页面:
/GroupBrief
需要展示有关群组的概括信息,包括群组的组成占比,群组数量,不同群组的数量,均可视化展示
群组有六个种类
Public Work Meeting AVChatRoom Community Private
使用一个一维数组存储其每一个的数量
数据库中有关表为创建群组表create与注销群组表destroyed
每个表都包含以下信息
CallbackCommand | String | 回调命令 |
GroupId | String | 操作的群 ID |
Operator_Account | String | 发起创建群组请求的操作者 UserID |
Owner_Account | String | 请求创建的群的群主 UserID |
Type | String | 请求创建的 群组类型介绍,例如 Public |
Name | String | 请求创建的群组的名称 |
MemberList | Array | 请求创建的群组的初始化成员列表 |
所以需要查询在create表中而不在destroy表中的记录
select a.type,count(*) count from
(select distinct callbackaftercreategroup.groupId,callbackaftercreategroup.type from
callbackaftercreategroup left join callbackaftergroupdestroyed
on callbackaftercreategroup.groupId=callbackaftergroupdestroyed.groupId
where callbackaftergroupdestroyed.groupId is null)a
group by a.type
执行后使用数组存储
int[] type= new int[6];//0-Public,1-Work,2-Meeting,3-AVChatRoom,4-Community,5-Private
while (rs.next()){
switch (rs.getString("type")){
case "Public" :type[0]=rs.getInt("count");break;
case "Work" :type[1]=rs.getInt("count");break;
case "Meeting" :type[2]=rs.getInt("count");break;
case "AVChatRoom" :type[3]=rs.getInt("count");break;
case "Community" :type[4]=rs.getInt("count");break;
case "Private" :type[5]=rs.getInt("count");break;
}
}
前端通过Highlights渲染图表
html与js
<div class="layui-col-md4">
<div id="container2" style="height: 400px"></div>
</div>
<div class="layui-col-md4">
<div id="container" style="height: 400px">