Commit b2d7fdb3 authored by 刘基明's avatar 刘基明

metrics fix

parent b1fe8056
......@@ -48,6 +48,7 @@ public class VisitLogService {
.stream().map(VisitLogEntity::getRefId).distinct().collect(Collectors.toList());
return ListUtils.subtract(refIds, visited);
}
public List<String> queryUserVisited(String userId) {
List<String> visited = visitLogMapper.selectList(new LambdaQueryWrapper<VisitLogEntity>()
.eq(VisitLogEntity::getVisitorId, userId))
......@@ -58,7 +59,7 @@ public class VisitLogService {
@Transactional
public void insertOrUpdateDur(VisitLogEntity vs) {
if (visitLogMapper.selectByIdentAndRefId(vs.getIdent(), vs.getRefType(), vs.getRefId()) == null) {
if (visitLogMapper.selectByIdentAndRefId(vs.getIdent(), vs.getRefId(), vs.getRefType()) == null) {
visitLogMapper.insert(vs);
} else {
visitLogMapper.updateDurByIdent(vs.getDuration(), vs.getIdent());
......@@ -92,7 +93,7 @@ public class VisitLogService {
// 查询主题 浏览量
public Integer queryThemeVisit(List<String> themes) {
if (CollectionUtils.isEmpty(themes)){
if (CollectionUtils.isEmpty(themes)) {
return 0;
}
return visitLogMapper.selectCount(new LambdaQueryWrapper<VisitLogEntity>()
......@@ -114,11 +115,11 @@ public class VisitLogService {
//统计行为集合的浏览量
public Map<String, Integer> getCountMapByTargetIds(List<String> refIds, String refType) {
if (CollectionUtils.isEmpty(refIds)){
if (CollectionUtils.isEmpty(refIds)) {
return new HashMap<>();
}
LambdaQueryWrapper<VisitLogEntity> wrapper = (new LambdaQueryWrapper<VisitLogEntity>()
.in(VisitLogEntity::getRefId,refIds))
.in(VisitLogEntity::getRefId, refIds))
.eq(VisitLogEntity::getDeleteTag, DeleteTagEnum.NOT_DELETED)
.eq(VisitLogEntity::getRefType, refType)
.groupBy(VisitLogEntity::getRefId);
......
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