| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -25,8 +25,8 @@ import com.epmet.commons.rocketmq.messages.ProjectChangedMQMsg; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.constant.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.exception.EpmetErrorCode; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.exception.ExceptionUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.exception.EpmetException; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.exception.ExceptionUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.exception.RenException; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.page.PageData; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.redis.common.CustomerOrgRedis; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -58,11 +58,12 @@ import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.send.SendMqMsgUtil; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.github.pagehelper.PageHelper; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.github.pagehelper.PageInfo; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.google.common.base.Joiner; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.google.gson.Gson; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.google.gson.GsonBuilder; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.collections4.CollectionUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import lombok.extern.slf4j.Slf4j; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.collections4.CollectionUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.collections4.ListUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.io.FilenameUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.lang3.StringUtils; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -76,7 +77,6 @@ import org.springframework.web.context.request.RequestContextHolder; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.web.context.request.ServletRequestAttributes; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.web.multipart.MultipartFile; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import javax.servlet.http.HttpServletRequest; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.text.ParseException; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.text.SimpleDateFormat; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -2916,26 +2916,31 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							ProjectDistributionAnalysisRightResultDTO result = new ProjectDistributionAnalysisRightResultDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							List<ProjectDistributionAnalysisRightDTO> orgList = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							Result<List<SonOrgResultDTO>> sonOrgList = govOrgOpenFeignClient.getSonAgencyId(formDTO.getOrgId(), agencyInfo.getLevel()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if (!sonOrgList.success() || CollectionUtils.isEmpty(sonOrgList.getData())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								throw new EpmetException(String.format("查询组织{%s}的下级组织失败或为空...",formDTO.getOrgId())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if (!sonOrgList.success()){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								throw new EpmetException(String.format("查询组织{%s}的下级组织失败...",formDTO.getOrgId())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if (CollectionUtils.isEmpty(sonOrgList.getData())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								return result; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							// 所有子级orgId,并构建全部数据
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							List<SonOrgResultDTO> orgIds = sonOrgList.getData(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							for (SonOrgResultDTO o : orgIds) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								ProjectDistributionAnalysisRightDTO dto = new ProjectDistributionAnalysisRightDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								dto.setOrgId(o.getOrgId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								orgList.add(dto); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							List<ProjectDistributionAnalysisRightDTO> dtos; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if (!agencyInfo.getLevel().equals(ProjectConstant.ORG_LEVEL_COMMUNITY)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								orgList = baseDao.selectProjectCountByOrg(orgIds, formDTO.getStartDate(),formDTO.getEndDate()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								dtos = baseDao.selectProjectCountByOrg(orgIds, formDTO.getStartDate(),formDTO.getEndDate()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							}else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								for (SonOrgResultDTO o : orgIds) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									ProjectDistributionAnalysisRightDTO dto = new ProjectDistributionAnalysisRightDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									dto.setOrgId(o.getOrgId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									orgList.add(dto); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								Result<List<ProjectDistributionAnalysisRightDTO>> projectCountByGrid = govIssueOpenFeignClient.getProjectCountByGrid(formDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								if (!projectCountByGrid.success()){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									throw new EpmetException("查询网格项目数失败..."); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								if (CollectionUtils.isNotEmpty(projectCountByGrid.getData())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									orgList.stream().forEach(o -> projectCountByGrid.getData().stream().filter(p -> p.getOrgId().equals(o.getOrgId())).forEach(p -> o.setCount(p.getCount()))); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								dtos = projectCountByGrid.getData(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if (CollectionUtils.isNotEmpty(dtos)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								orgList.stream().forEach(o -> dtos.stream().filter(p -> p.getOrgId().equals(o.getOrgId())).forEach(p -> o.setCount(p.getCount()))); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if (CollectionUtils.isEmpty(orgList)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								return result; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |