Commit 44a032b6 by 吴星煌

服务概览bug

parent 18eafb0e
...@@ -2,10 +2,11 @@ package com.wecloud.imserver.client.model.vo; ...@@ -2,10 +2,11 @@ package com.wecloud.imserver.client.model.vo;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
import java.util.List; import java.util.List;
@Data @Data
public class StatisticsVo { public class StatisticsVo implements Serializable {
//活跃群组 //活跃群组
private Integer activeGroup; private Integer activeGroup;
......
package com.wecloud.im.appmanager; package com.wecloud.im.appmanager;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wecloud.im.entity.ImClient; import com.wecloud.im.entity.ImClient;
import com.wecloud.im.entity.ImConversation; import com.wecloud.im.entity.ImConversation;
import com.wecloud.im.entity.ImMessage; import com.wecloud.im.entity.ImMessage;
...@@ -46,14 +47,11 @@ public class ImOverviewImpl implements ImOverview { ...@@ -46,14 +47,11 @@ public class ImOverviewImpl implements ImOverview {
HashMap<String, Integer> count = new HashMap<>(); HashMap<String, Integer> count = new HashMap<>();
//今日活跃用户 //今日活跃用户
List<Long> userIds = imMessageService.list(new LambdaQueryWrapper<ImMessage>() Integer activeUser = imMessageService.count(new LambdaQueryWrapper<ImMessage>()
.eq(ImMessage::getFkAppid, appId) .eq(ImMessage::getFkAppid, appId)
.groupBy(ImMessage::getSender) .ge(ImMessage::getCreateTime, LocalDateTime.of(LocalDate.now(), LocalTime.MIN))
.ge(ImMessage::getCreateTime, LocalDateTime.of(LocalDate.now(), LocalTime.MIN))) .groupBy(ImMessage::getSender)
.stream().map(ImMessage::getSender).collect(Collectors.toList()); .select(ImMessage::getSender)
Integer activeUser = imClientService.count(new LambdaQueryWrapper<ImClient>()
.eq(ImClient::getFkAppid, appId)
.in(ImClient::getId, userIds)
); );
count.put("activeUser",activeUser); count.put("activeUser",activeUser);
//总注册用户数 //总注册用户数
...@@ -66,6 +64,7 @@ public class ImOverviewImpl implements ImOverview { ...@@ -66,6 +64,7 @@ public class ImOverviewImpl implements ImOverview {
.ge(ImMessage::getCreateTime, LocalDateTime.now().minusDays(7)) .ge(ImMessage::getCreateTime, LocalDateTime.now().minusDays(7))
.le(ImMessage::getCreateTime, LocalDateTime.now()) .le(ImMessage::getCreateTime, LocalDateTime.now())
.groupBy(ImMessage::getFkConversationId) .groupBy(ImMessage::getFkConversationId)
.select(ImMessage::getFkConversationId)
).stream().map(ImMessage::getFkConversationId).collect(Collectors.toList()); ).stream().map(ImMessage::getFkConversationId).collect(Collectors.toList());
Integer activeGroup = imConversationService.count(new LambdaQueryWrapper<ImConversation>() Integer activeGroup = imConversationService.count(new LambdaQueryWrapper<ImConversation>()
......
...@@ -88,4 +88,6 @@ public interface ImMessageMapper extends BaseMapper<ImMessage> { ...@@ -88,4 +88,6 @@ public interface ImMessageMapper extends BaseMapper<ImMessage> {
*/ */
List<ReaderVo> getReaders(@Param("currentClientId") Long currentClientId, @Param("param") GetReadersParam param); List<ReaderVo> getReaders(@Param("currentClientId") Long currentClientId, @Param("param") GetReadersParam param);
} }
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