Commit 4b4f0357 by “Kongxiangkun”

工作台互动分析优化

parent b5305922
......@@ -595,28 +595,29 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
if(CollUtil.isNotEmpty(eventTrackDeptNumVoList)){
eventTrackDeptNumVoList.stream().forEach(eventTrackDeptNumVo -> {
List<EventTrackTypeNumVo> eventTrackTypeNumVoList = this.baseMapper.queryTgNumByDept(eventTrackDeptNumVo.getDeptName(),typeId,context.getSiteId());
if(CollectionUtil.isNotEmpty(eventTrackTypeNumVoList)){
List<EventTrackTypeNumVo> voList = Lists.newArrayList();
eventTrackTypeNumVoList.stream().forEach(numVo->{
Optional<EventTrackTypeNumVo> optional= CollectionUtil.isEmpty(voList)?null:voList.stream().filter(v->Objects.equals(v.getType(),numVo.getType())).findFirst();
if(optional!=null&&optional.isPresent()){
EventTrackTypeNumVo vo = optional.get();
if(numVo.getNum()!=null) {
if(vo.getNum()!=null) {
vo.setNum(numVo.getNum()+vo.getNum());
}else{
vo.setNum(numVo.getNum());
}
}
}else{
voList.add(numVo);
}
});
eventTrackDeptNumVo.setEventTrackTypeNumVoList(voList);
}else {
eventTrackDeptNumVo.setEventTrackTypeNumVoList(eventTrackTypeNumVoList);
}
eventTrackTypeNumVoList = Lists.newArrayList();
// if(CollectionUtil.isNotEmpty(eventTrackTypeNumVoList)){
// List<EventTrackTypeNumVo> voList = Lists.newArrayList();
// eventTrackTypeNumVoList.stream().forEach(numVo->{
// Optional<EventTrackTypeNumVo> optional= CollectionUtil.isEmpty(voList)?null:voList.stream().filter(v->Objects.equals(v.getType(),numVo.getType())).findFirst();
// if(optional!=null&&optional.isPresent()){
// EventTrackTypeNumVo vo = optional.get();
// if(numVo.getNum()!=null) {
// if(vo.getNum()!=null) {
// vo.setNum(numVo.getNum()+vo.getNum());
// }else{
// vo.setNum(numVo.getNum());
// }
// }
// }else{
// voList.add(numVo);
// }
// });
// eventTrackDeptNumVo.setEventTrackTypeNumVoList(voList);
// }else {
// eventTrackDeptNumVo.setEventTrackTypeNumVoList(eventTrackTypeNumVoList);
// }
eventTrackDeptNumVo.setEventTrackTypeNumVoList(eventTrackTypeNumVoList);
List<EventTrackTypeNumVo> newEventTrackTypeNumVoList = Lists.newArrayList();
for(Integer month:recentMonths){
EventTrackTypeNumVo eventTrackTypeNumVo = new EventTrackTypeNumVo();
if(CollectionUtil.isEmpty(eventTrackDeptNumVo.getEventTrackTypeNumVoList())){
......@@ -632,9 +633,9 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
eventTrackTypeNumVo.setSubType(String.valueOf(month));
}
}
eventTrackTypeNumVoList.add(eventTrackTypeNumVo);
newEventTrackTypeNumVoList.add(eventTrackTypeNumVo);
}
eventTrackDeptNumVo.setEventTrackTypeNumVoList(eventTrackTypeNumVoList);
eventTrackDeptNumVo.setEventTrackTypeNumVoList(newEventTrackTypeNumVoList);
});
}
......
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