Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
wecloud_im_server
Commits
484f5ce2
Commit
484f5ce2
authored
Jun 10, 2022
by
吴星煌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加日志信息
parent
2c3e00e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
6 deletions
+27
-6
core/src/main/java/com/wecloud/im/appmanager/ImOverviewImpl.java
+26
-6
scheduled/src/main/java/io/geekidea/springbootplus/scheduled/OverviewScheduled.java
+1
-0
No files found.
core/src/main/java/com/wecloud/im/appmanager/ImOverviewImpl.java
View file @
484f5ce2
...
@@ -41,6 +41,7 @@ public class ImOverviewImpl implements ImOverview {
...
@@ -41,6 +41,7 @@ public class ImOverviewImpl implements ImOverview {
@Override
@Override
public
OverviewVo
overview
(
Long
appId
)
{
public
OverviewVo
overview
(
Long
appId
)
{
log
.
info
(
"即时通讯服务概览的入参appId为{}"
,
appId
);
OverviewVo
overviewVo
=
new
OverviewVo
();
OverviewVo
overviewVo
=
new
OverviewVo
();
//今日活跃用户
//今日活跃用户
Integer
activeUser
=
imMessageService
.
count
(
new
LambdaQueryWrapper
<
ImMessage
>()
Integer
activeUser
=
imMessageService
.
count
(
new
LambdaQueryWrapper
<
ImMessage
>()
...
@@ -50,11 +51,13 @@ public class ImOverviewImpl implements ImOverview {
...
@@ -50,11 +51,13 @@ public class ImOverviewImpl implements ImOverview {
.
select
(
ImMessage:
:
getSender
)
.
select
(
ImMessage:
:
getSender
)
);
);
overviewVo
.
setActiveUser
(
activeUser
);
overviewVo
.
setActiveUser
(
activeUser
);
log
.
info
(
"即时通讯服务概览的今日活跃用户数量为{}"
,
activeUser
);
//总注册用户数
//总注册用户数
Integer
registerUser
=
imClientService
.
count
(
new
LambdaQueryWrapper
<
ImClient
>()
Integer
registerUser
=
imClientService
.
count
(
new
LambdaQueryWrapper
<
ImClient
>()
.
eq
(
ImClient:
:
getFkAppid
,
appId
)
.
eq
(
ImClient:
:
getFkAppid
,
appId
)
);
);
overviewVo
.
setRegisterUser
(
registerUser
);
overviewVo
.
setRegisterUser
(
registerUser
);
log
.
info
(
"即时通讯服务概览的注册用户数量为{}"
,
registerUser
);
//七天内活跃群组数
//七天内活跃群组数
List
<
Long
>
ids
=
imMessageService
.
list
(
new
LambdaQueryWrapper
<
ImMessage
>()
List
<
Long
>
ids
=
imMessageService
.
list
(
new
LambdaQueryWrapper
<
ImMessage
>()
.
ge
(
ImMessage:
:
getCreateTime
,
LocalDateTime
.
now
().
minusDays
(
7
))
.
ge
(
ImMessage:
:
getCreateTime
,
LocalDateTime
.
now
().
minusDays
(
7
))
...
@@ -70,6 +73,7 @@ public class ImOverviewImpl implements ImOverview {
...
@@ -70,6 +73,7 @@ public class ImOverviewImpl implements ImOverview {
.
in
(
ImConversation:
:
getId
,
ids
)
.
in
(
ImConversation:
:
getId
,
ids
)
);
);
overviewVo
.
setActiveGroup
(
activeGroup
);
overviewVo
.
setActiveGroup
(
activeGroup
);
log
.
info
(
"即时通讯服务概览的活跃群组数量为{}"
,
activeGroup
);
//总群组数
//总群组数
Integer
group
=
imConversationService
.
count
(
new
LambdaQueryWrapper
<
ImConversation
>()
Integer
group
=
imConversationService
.
count
(
new
LambdaQueryWrapper
<
ImConversation
>()
.
eq
(
ImConversation:
:
getFkAppid
,
appId
)
.
eq
(
ImConversation:
:
getFkAppid
,
appId
)
...
@@ -77,12 +81,15 @@ public class ImOverviewImpl implements ImOverview {
...
@@ -77,12 +81,15 @@ public class ImOverviewImpl implements ImOverview {
.
eq
(
ImConversation:
:
getChatType
,
ChatTypeEnum
.
THOUSAND_GROUP
.
getCode
())
.
eq
(
ImConversation:
:
getChatType
,
ChatTypeEnum
.
THOUSAND_GROUP
.
getCode
())
);
);
overviewVo
.
setGroup
(
group
);
overviewVo
.
setGroup
(
group
);
log
.
info
(
"即时通讯服务概览的总群组数量为{}"
,
activeGroup
);
log
.
info
(
"即时通讯服务概览的返回参数为{}"
,
overviewVo
);
return
overviewVo
;
return
overviewVo
;
}
}
@Override
@Override
public
StatisticsVo
groupStatistics
(
Long
appId
,
LocalDateTime
start
,
LocalDateTime
end
)
{
public
StatisticsVo
groupStatistics
(
Long
appId
,
LocalDateTime
start
,
LocalDateTime
end
)
{
log
.
info
(
"即时通讯数据统计的业务统计的appId为{}"
,
appId
);
if
(
start
==
null
&&
end
==
null
){
if
(
start
==
null
&&
end
==
null
){
start
=
LocalDateTime
.
of
(
LocalDate
.
now
(),
LocalTime
.
MIN
).
minusDays
(
8
);
start
=
LocalDateTime
.
of
(
LocalDate
.
now
(),
LocalTime
.
MIN
).
minusDays
(
8
);
end
=
start
.
plusDays
(
7
);
end
=
start
.
plusDays
(
7
);
...
@@ -99,7 +106,7 @@ public class ImOverviewImpl implements ImOverview {
...
@@ -99,7 +106,7 @@ public class ImOverviewImpl implements ImOverview {
);
);
Integer
activeGroup
=
statistics
==
null
?
0
:
statistics
.
getData
();
Integer
activeGroup
=
statistics
==
null
?
0
:
statistics
.
getData
();
statisticsVo
.
setActiveGroup
(
activeGroup
);
statisticsVo
.
setActiveGroup
(
activeGroup
);
log
.
info
(
"即时通讯数据统计的业务统计的活跃群组数为{}"
,
activeGroup
);
//新增群组数(前1天)
//新增群组数(前1天)
Integer
newGroup
=
imConversationService
.
count
(
new
LambdaQueryWrapper
<
ImConversation
>()
Integer
newGroup
=
imConversationService
.
count
(
new
LambdaQueryWrapper
<
ImConversation
>()
.
eq
(
ImConversation:
:
getFkAppid
,
appId
)
.
eq
(
ImConversation:
:
getFkAppid
,
appId
)
...
@@ -110,7 +117,7 @@ public class ImOverviewImpl implements ImOverview {
...
@@ -110,7 +117,7 @@ public class ImOverviewImpl implements ImOverview {
LocalDateTime
.
of
(
LocalDate
.
now
(),
LocalTime
.
MAX
).
minusDays
(
1
))
LocalDateTime
.
of
(
LocalDate
.
now
(),
LocalTime
.
MAX
).
minusDays
(
1
))
);
);
statisticsVo
.
setNewGroup
(
newGroup
);
statisticsVo
.
setNewGroup
(
newGroup
);
log
.
info
(
"即时通讯数据统计的业务统计的新增群组数为{}"
,
newGroup
);
//解散群组数(前一天)
//解散群组数(前一天)
Integer
dismissGroup
=
imMessageService
.
count
(
new
LambdaQueryWrapper
<
ImMessage
>()
Integer
dismissGroup
=
imMessageService
.
count
(
new
LambdaQueryWrapper
<
ImMessage
>()
.
eq
(
ImMessage:
:
getFkAppid
,
appId
)
.
eq
(
ImMessage:
:
getFkAppid
,
appId
)
...
@@ -120,11 +127,12 @@ public class ImOverviewImpl implements ImOverview {
...
@@ -120,11 +127,12 @@ public class ImOverviewImpl implements ImOverview {
LocalDateTime
.
of
(
LocalDate
.
now
(),
LocalTime
.
MAX
).
minusDays
(
1
))
LocalDateTime
.
of
(
LocalDate
.
now
(),
LocalTime
.
MAX
).
minusDays
(
1
))
);
);
statisticsVo
.
setDismissGroup
(
dismissGroup
);
statisticsVo
.
setDismissGroup
(
dismissGroup
);
log
.
info
(
"即时通讯数据统计的业务统计的解散群组数为{}"
,
dismissGroup
);
//活跃群组平均成员数
//活跃群组平均成员数
Integer
avgMember
=
statistics
==
null
?
0
:
statistics
.
getGroupMember
()/
statistics
.
getData
();
Integer
avgMember
=
statistics
==
null
?
0
:
statistics
.
getGroupMember
()/
statistics
.
getData
();
statisticsVo
.
setAvgActiveGroup
(
avgMember
);
statisticsVo
.
setAvgActiveGroup
(
avgMember
);
log
.
info
(
"即时通讯数据统计的业务统计的活跃群组平均成员数为{}"
,
avgMember
);
//活跃群组折线图
//活跃群组折线图
List
<
ImStatistics
>
imStatistics
=
imStatisticsService
.
activeUserOrGroup
(
appId
,
2
,
start
,
end
);
List
<
ImStatistics
>
imStatistics
=
imStatisticsService
.
activeUserOrGroup
(
appId
,
2
,
start
,
end
);
List
<
LineChart
>
activeGroupLine
=
new
ArrayList
<>();
List
<
LineChart
>
activeGroupLine
=
new
ArrayList
<>();
...
@@ -177,13 +185,14 @@ public class ImOverviewImpl implements ImOverview {
...
@@ -177,13 +185,14 @@ public class ImOverviewImpl implements ImOverview {
avgActiveGroupLine
.
add
(
lineChart
);
avgActiveGroupLine
.
add
(
lineChart
);
}
}
statisticsVo
.
setAvgActiveGroupLine
(
avgActiveGroupLine
);
statisticsVo
.
setAvgActiveGroupLine
(
avgActiveGroupLine
);
log
.
info
(
"即时通讯数据统计的业务统计的返回参数为{}"
,
statisticsVo
);
return
statisticsVo
;
return
statisticsVo
;
}
}
@Override
@Override
public
List
<
LineChart
>
activeUser
(
Long
appId
,
LocalDateTime
start
,
LocalDateTime
end
)
{
public
List
<
LineChart
>
activeUser
(
Long
appId
,
LocalDateTime
start
,
LocalDateTime
end
)
{
log
.
info
(
"即时通讯数据统计的用户统计入参为{}"
,
appId
);
if
(
start
==
null
&&
end
==
null
){
if
(
start
==
null
&&
end
==
null
){
start
=
LocalDateTime
.
of
(
LocalDate
.
now
(),
LocalTime
.
MIN
).
minusDays
(
8
);
start
=
LocalDateTime
.
of
(
LocalDate
.
now
(),
LocalTime
.
MIN
).
minusDays
(
8
);
end
=
start
.
plusDays
(
7
);
end
=
start
.
plusDays
(
7
);
...
@@ -197,11 +206,13 @@ public class ImOverviewImpl implements ImOverview {
...
@@ -197,11 +206,13 @@ public class ImOverviewImpl implements ImOverview {
lineChart
.
setDate
(
imStatistic
.
getTime
());
lineChart
.
setDate
(
imStatistic
.
getTime
());
activeUser
.
add
(
lineChart
);
activeUser
.
add
(
lineChart
);
}
}
log
.
info
(
"即时通讯数据统计的用户统计返回参数为{}"
,
activeUser
);
return
activeUser
;
return
activeUser
;
}
}
@Override
@Override
public
RtcRecordVo
RtcStatistics
(
Long
appId
,
LocalDateTime
date
)
{
public
RtcRecordVo
RtcStatistics
(
Long
appId
,
LocalDateTime
date
)
{
log
.
info
(
"音视频通讯数据统计的入参的appId为{}"
,
appId
);
RtcRecordVo
rtcRecordVo
=
new
RtcRecordVo
();
RtcRecordVo
rtcRecordVo
=
new
RtcRecordVo
();
List
<
LineChart
>
video
=
new
ArrayList
<>();
List
<
LineChart
>
video
=
new
ArrayList
<>();
List
<
LineChart
>
voice
=
new
ArrayList
<>();
List
<
LineChart
>
voice
=
new
ArrayList
<>();
...
@@ -267,15 +278,24 @@ public class ImOverviewImpl implements ImOverview {
...
@@ -267,15 +278,24 @@ public class ImOverviewImpl implements ImOverview {
voice
.
add
(
voiceLineChart
);
voice
.
add
(
voiceLineChart
);
//每天的视频通话录制=============================
//每天的视频通话录制=============================
List
<
ImRtcTranscribe
>
imRtcTranscribeList
=
imRtcTranscribeService
.
list
(
new
LambdaQueryWrapper
<
ImRtcTranscribe
>()
List
<
Long
>
ids
=
imRtcTranscribeService
.
list
(
new
LambdaQueryWrapper
<
ImRtcTranscribe
>()
.
between
(
ImRtcTranscribe:
:
getStartTime
,
start
,
end
)
.
between
(
ImRtcTranscribe:
:
getStartTime
,
start
,
end
)
.
groupBy
(
ImRtcTranscribe:
:
getFkRecordId
)
.
groupBy
(
ImRtcTranscribe:
:
getFkRecordId
)
.
select
(
ImRtcTranscribe:
:
getFkRecordId
)
.
select
(
ImRtcTranscribe:
:
getFkRecordId
)
);
).
stream
().
map
(
ImRtcTranscribe:
:
getFkRecordId
).
collect
(
Collectors
.
toList
());
for
(
Long
id
:
ids
)
{
ImRtcRecord
imRtcRecord
=
imRtcRecordService
.
getById
(
id
);
if
(
imRtcRecord
.
getCallType
()==
1
){
}
else
if
(
imRtcRecord
.
getCallType
()==
2
){
}
}
}
}
rtcRecordVo
.
setVideo
(
video
);
rtcRecordVo
.
setVideo
(
video
);
rtcRecordVo
.
setVoice
(
voice
);
rtcRecordVo
.
setVoice
(
voice
);
log
.
info
(
"音视频通讯数据统计的返回参数为{}"
,
rtcRecordVo
);
return
rtcRecordVo
;
return
rtcRecordVo
;
}
}
}
}
scheduled/src/main/java/io/geekidea/springbootplus/scheduled/OverviewScheduled.java
View file @
484f5ce2
...
@@ -87,6 +87,7 @@ public class OverviewScheduled {
...
@@ -87,6 +87,7 @@ public class OverviewScheduled {
groupStatistics
.
setType
(
2
);
groupStatistics
.
setType
(
2
);
groupStatistics
.
setGroupMember
(
groupMember
);
groupStatistics
.
setGroupMember
(
groupMember
);
imStatisticsService
.
save
(
groupStatistics
);
imStatisticsService
.
save
(
groupStatistics
);
log
.
info
(
"数据保存结果为{}"
,
imStatisticsService
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment