Commit 4b4f0357 by “Kongxiangkun”

工作台互动分析优化

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