Commit 5963a198 by “Kongxiangkun”

评论,收藏,点赞 埋点面板修改

parent f6164744
......@@ -399,63 +399,64 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
return null;
}
private List<EventTrackTypeNumVo> queryNumByType(String date, Boolean isPre, List<Integer> types,String subName) {
logger.info("埋点统计行为统计入参date:{},isPre:{}, types:{}, subName:{}", date, isPre, types, subName);
private List<EventTrackTypeNumVo> queryNumByType(String date, Boolean isPre, List<Integer> types,String subIds) {
logger.info("埋点统计行为统计入参date:{},isPre:{}, types:{}, subName:{}", date, isPre, types, subIds);
if(ObjectUtils.isEmpty(date)){
date = "3";
}
String dateString =getDateString(date);
Long id = null;
RequestContext context = ContextHolder.get();
if(!ObjectUtils.isEmpty(subName)) {
String key = "event_track_type";
List<Dictionary> dictionaryList = dictionaryFeignClients.listChildDictionary(key, false, 1);
if (CollUtil.isNotEmpty(dictionaryList)) {
Optional<Dictionary> optional = dictionaryList.stream().filter(d -> Objects.equals(d.getValue(), "6")&&Objects.equals(d.getCnName(), subName)).findFirst();
if (optional != null && optional.isPresent()) {
Dictionary dictionary = optional.get();
id = Long.valueOf(dictionary.getCode());
}
}
}
// if(!ObjectUtils.isEmpty(subName)) {
// String key = "event_track_type";
// List<Dictionary> dictionaryList = dictionaryFeignClients.listChildDictionary(key, false, 1);
// if (CollUtil.isNotEmpty(dictionaryList)) {
// Optional<Dictionary> optional = dictionaryList.stream().filter(d -> Objects.equals(d.getValue(), "6")&&Objects.equals(d.getCnName(), subName)).findFirst();
// if (optional != null && optional.isPresent()) {
// Dictionary dictionary = optional.get();
// id = Long.valueOf(dictionary.getCode());
// }
// }
// }
List<String> subNameList = null;
List<DataClassification> classificationList = null;
if(id!=null) {
classificationList = dataClassificationService.getSon(id);
if(CollectionUtil.isNotEmpty(classificationList)){
subNameList = classificationList.stream().map(DataClassification::getName).collect(Collectors.toList());
}
}
// List<DataClassification> classificationList = null;
// if(id!=null) {
// classificationList = dataClassificationService.getSon(id);
// if(CollectionUtil.isNotEmpty(classificationList)){
// subNameList = classificationList.stream().map(DataClassification::getName).collect(Collectors.toList());
// }
// }
List<EventTrackTypeNumVo> eventTrackTypeNumVoList = null;
List<String> subIdList = Arrays.asList(subIds.split(","));
//判断是否获取阅读量
if(types.get(0).equals(6)){
// if(types.get(0).equals(6)){
//阅读量
List<String> subIdList = Lists.newArrayList();
for(DataClassification item : classificationList){
subIdList.add(item.getId().toString());
}
eventTrackTypeNumVoList = this.baseMapper.queryNumByTypeInformation(null,date,dateString,types,subIdList,context.getSiteId(), isPre);
} else {
logger.info("埋点统计行为统计入参date:{},isPre:{}, types:{}, subName:{}, siteId:{}, subNameList:{}", date, isPre, types, subName, context.getSiteId(), subNameList);
eventTrackTypeNumVoList = this.baseMapper.queryNumByType(null,date,dateString,types,subNameList,context.getSiteId(), isPre);
// List<String> subIdList = Lists.newArrayList();
// for(DataClassification item : classificationList){
// subIdList.add(item.getId().toString());
// }
// eventTrackTypeNumVoList = this.baseMapper.queryNumByTypeInformation(null,date,dateString,types,subIdList,context.getSiteId(), isPre);
// } else {
logger.info("埋点统计行为统计入参date:{},isPre:{}, types:{}, subName:{}, siteId:{}, subIdList:{}", date, isPre, types, subIdList, context.getSiteId(), subIdList);
eventTrackTypeNumVoList = this.baseMapper.queryNumByType(null,date,dateString,types,subIdList,context.getSiteId(), isPre);
logger.info("埋点统计行为统计查询结果:{}", JSONUtil.toJsonStr(eventTrackTypeNumVoList));
}
if(CollectionUtil.isNotEmpty(subNameList)){
List<EventTrackTypeNumVo> finalEventTrackTypeNumVoList = eventTrackTypeNumVoList;
subNameList.stream().forEach(name->{
EventTrackTypeNumVo eventTrackTypeNumVo = new EventTrackTypeNumVo();
eventTrackTypeNumVo.setNum(0);
eventTrackTypeNumVo.setSubType(name);
if(CollectionUtil.isNotEmpty(finalEventTrackTypeNumVoList)){
Optional optional = finalEventTrackTypeNumVoList.stream().filter(e->Objects.equals(e.getSubType(),name)).findFirst();
if(optional==null||!optional.isPresent()){
finalEventTrackTypeNumVoList.add(eventTrackTypeNumVo);
}
}else{
finalEventTrackTypeNumVoList.add(eventTrackTypeNumVo);
}
});
}
// }
// if(CollectionUtil.isNotEmpty(subNameList)){
// List<EventTrackTypeNumVo> finalEventTrackTypeNumVoList = eventTrackTypeNumVoList;
// subNameList.stream().forEach(name->{
// EventTrackTypeNumVo eventTrackTypeNumVo = new EventTrackTypeNumVo();
// eventTrackTypeNumVo.setNum(0);
// eventTrackTypeNumVo.setSubType(name);
// if(CollectionUtil.isNotEmpty(finalEventTrackTypeNumVoList)){
// Optional optional = finalEventTrackTypeNumVoList.stream().filter(e->Objects.equals(e.getSubType(),name)).findFirst();
// if(optional==null||!optional.isPresent()){
// finalEventTrackTypeNumVoList.add(eventTrackTypeNumVo);
// }
// }else{
// finalEventTrackTypeNumVoList.add(eventTrackTypeNumVo);
// }
// });
// }
return eventTrackTypeNumVoList;
}
......
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