| 
						
						
						
					 | 
				
				 | 
				
					@ -1,5 +1,6 @@ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					package com.epmet.service.impl; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.constant.NumConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.constant.ServiceConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.exception.RenException; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.feign.ResultDataResolver; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -20,7 +21,6 @@ import org.springframework.stereotype.Service; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.stream.Collectors; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.stream.Stream; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					/** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * @author wxz | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -68,6 +68,12 @@ public class ResiEventServiceImpl implements ResiEventService, ResultDataResolve | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        npcData.stream().forEach(npc -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (StringUtils.isBlank(excludeUserId) || !npc.getUserId().equals(excludeUserId)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        OrgInfoResultDTO gridInfo = npcGridInfoMap.get(npc.getGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        String pids; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        if (StringUtils.isNotBlank(gridInfo.getPids()) && !NumConstant.ZERO_STR.equals(gridInfo.getPids())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            pids = gridInfo.getPids().concat(":").concat(gridInfo.getAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        } else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            pids = gridInfo.getAgencyId(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        ResiEventNpcResultDTO resiEventNpcInfo = new ResiEventNpcResultDTO( | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                npc.getUserId(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                npc.getGridId(), | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -75,7 +81,8 @@ public class ResiEventServiceImpl implements ResiEventService, ResultDataResolve | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                npc.getRealName(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                npc.getHeadImgUrl(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                gridInfo != null ? gridInfo.getAgencyId() : null, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                gridInfo != null ? gridInfo.getPids().concat(":").concat(gridInfo.getAgencyId()) : null); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                // gridInfo != null ? gridInfo.getPids().concat(":").concat(gridInfo.getAgencyId()) : null
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                pids); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        npcResultList.add(resiEventNpcInfo); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -122,7 +129,13 @@ public class ResiEventServiceImpl implements ResiEventService, ResultDataResolve | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        OrgInfoResultDTO currentGridInfo = currentGridInfos.get(0); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 因为上游接口的值对应问题,这里只好做一个适配,拼接起来,希望上游代码不要再改了...
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String pids = currentGridInfo.getPids().concat(":").concat(currentGridInfo.getAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // String pids = currentGridInfo.getPids().concat(":").concat(currentGridInfo.getAgencyId());
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String pids; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (StringUtils.isNotBlank(currentGridInfo.getPids()) && !NumConstant.ZERO_STR.equals(currentGridInfo.getPids())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            pids = currentGridInfo.getPids().concat(":").concat(currentGridInfo.getAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            pids = currentGridInfo.getAgencyId(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 父ID列表的index排序字段是从0开始,网格要排在他们前面,则网格的index为-1
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        targetLevels.add(new ResiEventTargetLevelResultDTO(OrgLevelEnums.GRID.getLevel(), OrgLevelEnums.GRID.getLevelName(), currentGridInfo.getOrgId(), currentGridInfo.getAgencyId(), pids, -1)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -135,7 +148,12 @@ public class ResiEventServiceImpl implements ResiEventService, ResultDataResolve | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                throw new RenException(String.format("根据级别%s没有找到对应的组织级别枚举", porg.getLevel())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //parentOrgIds.indexOf(porg.getOrgId()为当前orgId在pids中的位置,得到之后,赋值给index字段,treeset会利用这个字段进行排序
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            ResiEventTargetLevelResultDTO pLevel = new ResiEventTargetLevelResultDTO(porg.getLevel(), levelName, porg.getOrgId(), porg.getPid(), porg.getPids(), parentOrgIds.indexOf(porg.getOrgId())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            ResiEventTargetLevelResultDTO pLevel = new ResiEventTargetLevelResultDTO(porg.getLevel(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    levelName, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    porg.getOrgId(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    porg.getPid(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    porg.getPids(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    parentOrgIds.indexOf(porg.getOrgId())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            targetLevels.add(pLevel); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |