| 
						
						
							
								
							
						
						
					 | 
					@ -19,7 +19,6 @@ package com.epmet.service.impl; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.alibaba.fastjson.JSON; | 
					 | 
					 | 
					import com.alibaba.fastjson.JSON; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
					 | 
					 | 
					import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.constant.NumConstant; | 
					 | 
					 | 
					import com.epmet.commons.tools.constant.NumConstant; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.constant.StrConstant; | 
					 | 
					 | 
					import com.epmet.commons.tools.constant.StrConstant; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; | 
					 | 
					 | 
					import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -46,7 +45,6 @@ import com.epmet.feign.EpmetCommonServiceOpenFeignClient; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.feign.EpmetMessageOpenFeignClient; | 
					 | 
					 | 
					import com.epmet.feign.EpmetMessageOpenFeignClient; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.feign.EpmetUserOpenFeignClient; | 
					 | 
					 | 
					import com.epmet.feign.EpmetUserOpenFeignClient; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.redis.CustomerAgencyRedis; | 
					 | 
					 | 
					import com.epmet.redis.CustomerAgencyRedis; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.send.SendMqMsgUtil; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.service.AgencyService; | 
					 | 
					 | 
					import com.epmet.service.AgencyService; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.service.CustomerAgencyService; | 
					 | 
					 | 
					import com.epmet.service.CustomerAgencyService; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.service.CustomerOrgParameterService; | 
					 | 
					 | 
					import com.epmet.service.CustomerOrgParameterService; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -547,14 +545,25 @@ public class AgencyServiceImpl implements AgencyService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            formDTO.setOrgId(staffInfo.getAgencyId()); | 
					 | 
					 | 
					            formDTO.setOrgId(staffInfo.getAgencyId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            formDTO.setLevel(OrgInfoConstant.AGENCY); | 
					 | 
					 | 
					            formDTO.setLevel(OrgInfoConstant.AGENCY); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (StringUtils.isNotBlank(customerAgencyEntity.getLatitude())){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            result.setLatitude(new BigDecimal(customerAgencyEntity.getLatitude())); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (StringUtils.isNotBlank(customerAgencyEntity.getLongitude())){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            result.setLongitude(new BigDecimal(customerAgencyEntity.getLongitude())); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        if (formDTO.getLevel().equals(OrgInfoConstant.AGENCY)){ | 
					 | 
					 | 
					        if (formDTO.getLevel().equals(OrgInfoConstant.AGENCY)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            CustomerAgencyEntity entity = customerAgencyDao.selectById(formDTO.getOrgId()); | 
					 | 
					 | 
					            CustomerAgencyEntity entity = customerAgencyDao.selectById(formDTO.getOrgId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            result = ConvertUtils.sourceToTarget(entity,MapOrgResultDTO.class); | 
					 | 
					 | 
					            result = ConvertUtils.sourceToTarget(entity,MapOrgResultDTO.class); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            result.setName(entity.getOrganizationName()); | 
					 | 
					 | 
					            result.setName(entity.getOrganizationName()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            result.setLevel(formDTO.getLevel()); | 
					 | 
					 | 
					            result.setLevel(formDTO.getLevel()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            result.setAgencyLevel(entity.getLevel()); | 
					 | 
					 | 
					            result.setAgencyLevel(entity.getLevel()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            result.setLatitude(StringUtils.isBlank(entity.getLatitude()) ? new BigDecimal(customerAgencyEntity.getLatitude()) : new BigDecimal(entity.getLatitude())); | 
					 | 
					 | 
					            //经纬度 如果本级没有则取根级组织的 根级没有就空着
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            result.setLongitude(StringUtils.isBlank(entity.getLongitude()) ? new BigDecimal(customerAgencyEntity.getLongitude()) : new BigDecimal(entity.getLongitude())); | 
					 | 
					 | 
					            if (StringUtils.isNotBlank(entity.getLatitude()){ | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                result.setLatitude(new BigDecimal(entity.getLatitude())); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (StringUtils.isNotBlank(entity.getLongitude()){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                result.setLongitude(new BigDecimal(entity.getLongitude())); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            if (entity.getLevel().equals(OrgInfoConstant.COMMUNITY)){ | 
					 | 
					 | 
					            if (entity.getLevel().equals(OrgInfoConstant.COMMUNITY)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                List<MapSonOrgResultDTO> son = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.GRID); | 
					 | 
					 | 
					                List<MapSonOrgResultDTO> son = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.GRID); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (CollectionUtils.isNotEmpty(son)){ | 
					 | 
					 | 
					                if (CollectionUtils.isNotEmpty(son)){ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -576,12 +585,9 @@ public class AgencyServiceImpl implements AgencyService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (CollectionUtils.isNotEmpty(directlySub)){ | 
					 | 
					 | 
					                if (CollectionUtils.isNotEmpty(directlySub)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    dtoList.addAll(directlySub); | 
					 | 
					 | 
					                    dtoList.addAll(directlySub); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                if (CollectionUtils.isNotEmpty(dtoList)){ | 
					 | 
					 | 
					                for (MapSonOrgResultDTO d : dtoList) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    MapOrgResultDTO finalResult1 = result; | 
					 | 
					 | 
					                    d.setLatitude(StringUtils.isBlank(d.getLatitudeOrigin()) ? result.getLatitude() : new BigDecimal(d.getLatitudeOrigin())); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    dtoList.forEach(d -> { | 
					 | 
					 | 
					                    d.setLongitude(StringUtils.isBlank(d.getLongitudeOrigin()) ? result.getLongitude() : new BigDecimal(d.getLongitudeOrigin())); | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					                        d.setLatitude(StringUtils.isBlank(d.getLatitudeOrigin()) ? finalResult1.getLatitude() : new BigDecimal(d.getLatitudeOrigin())); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        d.setLongitude(StringUtils.isBlank(d.getLongitudeOrigin()) ? finalResult1.getLongitude() : new BigDecimal(d.getLongitudeOrigin())); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    }); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                result.setChildren(dtoList); | 
					 | 
					 | 
					                result.setChildren(dtoList); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -591,15 +597,19 @@ public class AgencyServiceImpl implements AgencyService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            result.setName(entity.getGridName()); | 
					 | 
					 | 
					            result.setName(entity.getGridName()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            result.setLevel(formDTO.getLevel()); | 
					 | 
					 | 
					            result.setLevel(formDTO.getLevel()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            result.setAgencyLevel(OrgInfoConstant.GRID); | 
					 | 
					 | 
					            result.setAgencyLevel(OrgInfoConstant.GRID); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					            result.setLatitude(StringUtils.isBlank(entity.getLatitude()) ? new BigDecimal(customerAgencyEntity.getLatitude()) : new BigDecimal(entity.getLatitude())); | 
					 | 
					 | 
					            //经纬度 如果本级没有则取根级组织的 根级没有就空着
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					            result.setLongitude(StringUtils.isBlank(entity.getLongitude()) ? new BigDecimal(customerAgencyEntity.getLongitude()) : new BigDecimal(entity.getLongitude())); | 
					 | 
					 | 
					            if (StringUtils.isNotBlank(entity.getLatitude()){ | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                result.setLatitude(new BigDecimal(entity.getLatitude())); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (StringUtils.isNotBlank(entity.getLongitude()){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                result.setLongitude(new BigDecimal(entity.getLongitude())); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            List<MapSonOrgResultDTO> son = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.NEIGHBOR_HOOD); | 
					 | 
					 | 
					            List<MapSonOrgResultDTO> son = customerAgencyDao.selectSonOrg(formDTO.getOrgId(), OrgInfoConstant.NEIGHBOR_HOOD); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            if (CollectionUtils.isNotEmpty(son)){ | 
					 | 
					 | 
					            if (CollectionUtils.isNotEmpty(son)){ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                MapOrgResultDTO finalResult2 = result; | 
					 | 
					 | 
					                for (MapSonOrgResultDTO s : son) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                son.forEach(s -> { | 
					 | 
					 | 
					                    s.setLatitude(StringUtils.isBlank(s.getLatitudeOrigin()) ? result.getLatitude() : new BigDecimal(s.getLatitudeOrigin())); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    s.setLatitude(StringUtils.isBlank(s.getLatitudeOrigin()) ? finalResult2.getLatitude() : new BigDecimal(s.getLatitudeOrigin())); | 
					 | 
					 | 
					                    s.setLongitude(StringUtils.isBlank(s.getLongitudeOrigin()) ? result.getLongitude() : new BigDecimal(s.getLongitudeOrigin())); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    s.setLongitude(StringUtils.isBlank(s.getLongitudeOrigin()) ? finalResult2.getLongitude() : new BigDecimal(s.getLongitudeOrigin())); | 
					 | 
					 | 
					                } | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					                }); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            result.setChildren(CollectionUtils.isEmpty(son) ? new ArrayList<>() : son); | 
					 | 
					 | 
					            result.setChildren(CollectionUtils.isEmpty(son) ? new ArrayList<>() : son); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |