| 
						
						
						
					 | 
				
				 | 
				
					@ -1,5 +1,6 @@ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					package com.epmet.service.impl; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.constant.AppClientConstant; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -29,15 +30,14 @@ import com.epmet.commons.tools.utils.ScanContentUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dao.IcEventDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.CustomerAgencyDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.IcEventDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.IcResiUserDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.IssueProjectCategoryDictDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.form.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.form.demand.DemandRecId; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.result.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.entity.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.enums.EcEventProcessStatusEnum; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.feign.EpmetAdminOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.feign.EpmetHeartOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.feign.GovIssueOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.feign.GovOrgOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.feign.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.constant.TopicConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.github.pagehelper.PageHelper; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -88,7 +88,8 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private IcEventReplyService icEventReplyService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private IcEventOperationLogService icEventOperationLogService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private EpmetUserOpenFeignClient userOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public PageData<IcEventListResultDTO> list(IcEventListFormDTO formDTO) { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -511,4 +512,95 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return resultList; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public IcEventYpAnalysisResultDTO getYpAnalysis(String eventId) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 事件上报渠道字典
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, String> sourceTypeMap = getResultDataOrThrowsException( | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                adminOpenFeignClient.dictMap("ic_event_source_type"), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                ServiceConstant.EPMET_ADMIN_SERVER, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                EpmetErrorCode.SERVER_ERROR.getCode(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                "【事件研判分析】查询事件上报渠道字典失败", | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                "【事件研判分析】查询事件上报渠道字典失败"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 事件信息
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        IcEventEntity event = baseDao.selectById(eventId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (event == null) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return null; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 事件分类
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        IcEventCategoryEntity eventCategory = icEventCategoryService.getByEventId(eventId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 分类字典
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        IssueProjectCategoryDictDTO categoryDictItem = getResultDataOrThrowsException(govIssueOpenFeignClient.getByCategoryCode(eventCategory.getCategoryCode()), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                ServiceConstant.GOV_ISSUE_SERVER, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                EpmetErrorCode.SERVER_ERROR.getCode(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                "【事件研判分析】查询分类字典失败", | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                "【事件研判分析】查询分类字典失败"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 上报人信息
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String idCard = event.getIdCard(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String icResiId = null; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IcEventYpAnalysisResultDTO.Dependent> dependents = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (StringUtils.isNotBlank(idCard)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            IcResiUserDTO resiInfo = getResultDataOrThrowsException(userOpenFeignClient.getByResiIdCard(idCard), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    ServiceConstant.EPMET_USER_SERVER, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    EpmetErrorCode.SERVER_ERROR.getCode(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    "【事件研判分析】根据身份证号查找居民信息失败", | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    "【事件研判分析】根据身份证号查找居民信息失败"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (resiInfo != null) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                icResiId = resiInfo.getId(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            dependents = getDependents(event.getIdCard()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        IcEventYpAnalysisResultDTO r = new IcEventYpAnalysisResultDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        r.setReportorResiId(icResiId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        r.setReportorName(event.getName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        r.setSourceTypeName(sourceTypeMap.get(event.getSourceType())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        r.setDependents(dependents); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        r.setCategoryCode(categoryDictItem.getParentCategoryCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        r.setCategoryPids(eventCategory.getCategoryPids()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        r.setReportorMobile(event.getMobile()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        r.setReportorIdCard(idCard); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (eventCategory != null) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            r.setCategoryName(categoryDictItem.getParentCategoryName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return r; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * 查询家属 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @param idCard | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @return | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private List<IcEventYpAnalysisResultDTO.Dependent> getDependents(String idCard) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        IcResiUserBriefDTO familyInfo = getResultDataOrThrowsException(userOpenFeignClient.findFamilyMemByIdCard(idCard), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                ServiceConstant.EPMET_USER_SERVER, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                EpmetErrorCode.SERVER_ERROR.getCode(), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                "【事件研判分析】查找家属失败", | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                "【事件研判分析】查找家属失败"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        ArrayList<IcEventYpAnalysisResultDTO.Dependent> dependents = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        for (HouseUserDTO u : familyInfo.getHouseUserList()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            dependents.add(new IcEventYpAnalysisResultDTO.Dependent(u.getIcResiUserId(), u.getIcUserName())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return dependents; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public PageData<IcEventResultDTO> getSameCategoryEvents(String orgId, String orgType, String categoryPids, Integer pageNo, Integer pageSize) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String gridPids = null; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if ("agency".equals(orgType)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            gridPids = getEventGridPids(orgId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        PageHelper.startPage(pageNo, pageSize); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IcEventResultDTO> list = baseDao.listEventsByPCategoryInOrg(orgId, gridPids, orgType, categoryPids); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        PageInfo<IcEventResultDTO> pageInfo = new PageInfo<>(list); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return new PageData<>(list, pageInfo.getTotal()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					} |