Commit 44a032b6 by 吴星煌

服务概览bug

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