|
@@ -83,25 +83,28 @@ public class AgentNewLogServiceImpl extends ServiceImpl<IAgentNewLogMapper, Agen
|
|
|
public HashMap<String,LogDataVo> getLogDataM(AgentNew agentNew) {
|
|
|
HashMap<String,LogDataVo> map = new HashMap<>();
|
|
|
|
|
|
- if(agentNew.getParentId() == null){
|
|
|
- List<AgentNew> bySubAgent = agentNewService.getBySubAgent(agentNew.getId());
|
|
|
+ LogDataVo logDataVo = getLogDataVo(Arrays.asList(agentNew.getId()));
|
|
|
+ LogDataVo logDataVo2 = null;
|
|
|
+ List<AgentNew> bySubAgent = agentNewService.getBySubAgent(agentNew.getId());
|
|
|
+ if(!bySubAgent.isEmpty()){
|
|
|
List<Integer> agentIds = bySubAgent.stream().map(AgentNew::getId).collect(Collectors.toList());
|
|
|
- LogDataVo logDataVo = getLogDataVo(Arrays.asList(agentNew.getId()));
|
|
|
- LogDataVo logDataVo2 = getLogDataVo(agentIds);
|
|
|
- map.put("agentData",logDataVo);
|
|
|
- map.put("subAgentData",logDataVo2);
|
|
|
- }else {
|
|
|
- LogDataVo logDataVo = getLogDataVo(Arrays.asList(agentNew.getId()));
|
|
|
- map.put("agentData",logDataVo);
|
|
|
- map.put("subAgentData",null);
|
|
|
+ List<AgentNew> bySubAgent1 = agentNewService.getBySubAgent(agentIds);
|
|
|
+ if(!bySubAgent1.isEmpty()){
|
|
|
+ List<Integer> agentIds2 = bySubAgent1.stream().map(AgentNew::getId).collect(Collectors.toList());
|
|
|
+ agentIds.addAll(agentIds2);
|
|
|
+ }
|
|
|
+ logDataVo2 = getLogDataVo(agentIds);
|
|
|
}
|
|
|
+
|
|
|
+ map.put("agentData",logDataVo);
|
|
|
+ map.put("subAgentData",logDataVo2);
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
private LogDataVo getLogDataVo(List<Integer> agentIds){
|
|
|
LogDataVo logDataVo = new LogDataVo();
|
|
|
if(agentIds.isEmpty()){
|
|
|
- return logDataVo;
|
|
|
+ return null;
|
|
|
}
|
|
|
List<AgentNewLog> logDataM = this.getBaseMapper().getLogDataM(agentIds);
|
|
|
for (AgentNewLog log : logDataM) {
|
|
@@ -121,10 +124,17 @@ public class AgentNewLogServiceImpl extends ServiceImpl<IAgentNewLogMapper, Agen
|
|
|
|
|
|
List<Integer> agentIds = new ArrayList<>();
|
|
|
agentIds.add(param.getAgentId());
|
|
|
- if(param.getAgentNew().getParentId() == null){
|
|
|
- List<AgentNew> bySubAgent = agentNewService.getBySubAgent(param.getAgentNew().getId());
|
|
|
- agentIds.addAll( bySubAgent.stream().map(AgentNew::getId).collect(Collectors.toList()));
|
|
|
+ List<AgentNew> bySubAgent = agentNewService.getBySubAgent(param.getAgentNew().getId());
|
|
|
+ if(!bySubAgent.isEmpty()){
|
|
|
+ List<Integer> subAgentIds = bySubAgent.stream().map(AgentNew::getId).collect(Collectors.toList());
|
|
|
+ agentIds.addAll( subAgentIds);
|
|
|
+ List<AgentNew> bySubAgent1 = agentNewService.getBySubAgent(subAgentIds);
|
|
|
+ if(!bySubAgent1.isEmpty()){
|
|
|
+ List<Integer> subAgentIds1 = bySubAgent1.stream().map(AgentNew::getId).collect(Collectors.toList());
|
|
|
+ agentIds.addAll( subAgentIds1);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
if(agentIds.isEmpty()){
|
|
|
return PageInfo.PageInfo(new Page(param.getPageNum(),param.getPageSize()));
|
|
|
}
|