Commit 5963a198 by “Kongxiangkun”

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

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