Commit 484f5ce2 by 吴星煌

添加日志信息

parent 2c3e00e0
......@@ -41,6 +41,7 @@ public class ImOverviewImpl implements ImOverview {
@Override
public OverviewVo overview(Long appId) {
log.info("即时通讯服务概览的入参appId为{}",appId);
OverviewVo overviewVo = new OverviewVo();
//今日活跃用户
Integer activeUser = imMessageService.count(new LambdaQueryWrapper<ImMessage>()
......@@ -50,11 +51,13 @@ public class ImOverviewImpl implements ImOverview {
.select(ImMessage::getSender)
);
overviewVo.setActiveUser(activeUser);
log.info("即时通讯服务概览的今日活跃用户数量为{}",activeUser);
//总注册用户数
Integer registerUser = imClientService.count(new LambdaQueryWrapper<ImClient>()
.eq(ImClient::getFkAppid,appId)
);
overviewVo.setRegisterUser(registerUser);
log.info("即时通讯服务概览的注册用户数量为{}",registerUser);
//七天内活跃群组数
List<Long> ids = imMessageService.list(new LambdaQueryWrapper<ImMessage>()
.ge(ImMessage::getCreateTime, LocalDateTime.now().minusDays(7))
......@@ -70,6 +73,7 @@ public class ImOverviewImpl implements ImOverview {
.in(ImConversation::getId, ids)
);
overviewVo.setActiveGroup(activeGroup);
log.info("即时通讯服务概览的活跃群组数量为{}",activeGroup);
//总群组数
Integer group = imConversationService.count(new LambdaQueryWrapper<ImConversation>()
.eq(ImConversation::getFkAppid,appId)
......@@ -77,12 +81,15 @@ public class ImOverviewImpl implements ImOverview {
.eq(ImConversation::getChatType, ChatTypeEnum.THOUSAND_GROUP.getCode())
);
overviewVo.setGroup(group);
log.info("即时通讯服务概览的总群组数量为{}",activeGroup);
log.info("即时通讯服务概览的返回参数为{}",overviewVo);
return overviewVo;
}
@Override
public StatisticsVo groupStatistics(Long appId, LocalDateTime start, LocalDateTime end) {
log.info("即时通讯数据统计的业务统计的appId为{}",appId);
if(start == null && end ==null){
start = LocalDateTime.of(LocalDate.now(), LocalTime.MIN).minusDays(8);
end = start.plusDays(7);
......@@ -99,7 +106,7 @@ public class ImOverviewImpl implements ImOverview {
);
Integer activeGroup = statistics == null ? 0 : statistics.getData();
statisticsVo.setActiveGroup(activeGroup);
log.info("即时通讯数据统计的业务统计的活跃群组数为{}",activeGroup);
//新增群组数(前1天)
Integer newGroup = imConversationService.count(new LambdaQueryWrapper<ImConversation>()
.eq(ImConversation::getFkAppid, appId)
......@@ -110,7 +117,7 @@ public class ImOverviewImpl implements ImOverview {
LocalDateTime.of(LocalDate.now(), LocalTime.MAX).minusDays(1))
);
statisticsVo.setNewGroup(newGroup);
log.info("即时通讯数据统计的业务统计的新增群组数为{}",newGroup);
//解散群组数(前一天)
Integer dismissGroup = imMessageService.count(new LambdaQueryWrapper<ImMessage>()
.eq(ImMessage::getFkAppid, appId)
......@@ -120,11 +127,12 @@ public class ImOverviewImpl implements ImOverview {
LocalDateTime.of(LocalDate.now(), LocalTime.MAX).minusDays(1))
);
statisticsVo.setDismissGroup(dismissGroup);
log.info("即时通讯数据统计的业务统计的解散群组数为{}",dismissGroup);
//活跃群组平均成员数
Integer avgMember = statistics == null ? 0 : statistics.getGroupMember()/statistics.getData();
statisticsVo.setAvgActiveGroup(avgMember);
log.info("即时通讯数据统计的业务统计的活跃群组平均成员数为{}",avgMember);
//活跃群组折线图
List<ImStatistics> imStatistics = imStatisticsService.activeUserOrGroup(appId, 2, start, end);
List<LineChart> activeGroupLine = new ArrayList<>();
......@@ -177,13 +185,14 @@ public class ImOverviewImpl implements ImOverview {
avgActiveGroupLine.add(lineChart);
}
statisticsVo.setAvgActiveGroupLine(avgActiveGroupLine);
log.info("即时通讯数据统计的业务统计的返回参数为{}",statisticsVo);
return statisticsVo;
}
@Override
public List<LineChart> activeUser(Long appId, LocalDateTime start, LocalDateTime end) {
log.info("即时通讯数据统计的用户统计入参为{}",appId);
if(start == null && end ==null){
start = LocalDateTime.of(LocalDate.now(), LocalTime.MIN).minusDays(8);
end = start.plusDays(7);
......@@ -197,11 +206,13 @@ public class ImOverviewImpl implements ImOverview {
lineChart.setDate(imStatistic.getTime());
activeUser.add(lineChart);
}
log.info("即时通讯数据统计的用户统计返回参数为{}",activeUser);
return activeUser;
}
@Override
public RtcRecordVo RtcStatistics(Long appId, LocalDateTime date) {
log.info("音视频通讯数据统计的入参的appId为{}",appId);
RtcRecordVo rtcRecordVo = new RtcRecordVo();
List<LineChart> video = new ArrayList<>();
List<LineChart> voice = new ArrayList<>();
......@@ -267,15 +278,24 @@ public class ImOverviewImpl implements ImOverview {
voice.add(voiceLineChart);
//每天的视频通话录制=============================
List<ImRtcTranscribe> imRtcTranscribeList = imRtcTranscribeService.list(new LambdaQueryWrapper<ImRtcTranscribe>()
List<Long> ids = imRtcTranscribeService.list(new LambdaQueryWrapper<ImRtcTranscribe>()
.between(ImRtcTranscribe::getStartTime, start, end)
.groupBy(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.setVoice(voice);
log.info("音视频通讯数据统计的返回参数为{}",rtcRecordVo);
return rtcRecordVo;
}
}
......@@ -87,6 +87,7 @@ public class OverviewScheduled {
groupStatistics.setType(2);
groupStatistics.setGroupMember(groupMember);
imStatisticsService.save(groupStatistics);
log.info("数据保存结果为{}",imStatisticsService);
}
}
......
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