Browse Source

事件研判分析

dev_shibei_match
yinzuomei 4 years ago
parent
commit
bcd7cdea4f
  1. 61
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java

61
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java

@ -39,11 +39,13 @@ import com.epmet.constant.EventConstant;
import com.epmet.constant.ResiEventAction;
import com.epmet.dao.*;
import com.epmet.dto.EventProjectInfoDTO;
import com.epmet.dto.IssueProjectCategoryDictDTO;
import com.epmet.dto.ProjectCategoryDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.*;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovIssueOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.ProjectCategoryService;
import com.epmet.service.ResiEventService;
@ -92,6 +94,9 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
private ResiEventReplyDao resiEventReplyDao;
@Autowired
private ProjectCategoryService projectCategoryService;
@Autowired
private GovIssueOpenFeignClient govIssueOpenFeignClient;
/**
* @Description 群众直报待处理处理中已办结列表
@ -690,15 +695,65 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
IcResiUserBriefDTO icResiUserDTO = userRes.getData();
ResiEventResearchAnalysisResDTO resultDTO = ConvertUtils.sourceToTarget(icResiUserDTO, ResiEventResearchAnalysisResDTO.class);
resultDTO.setEpmetUserIdList(!CollectionUtils.isEmpty(formDTO.getEpmetUserIdList()) ? formDTO.getEpmetUserIdList() : Collections.emptyList());
resultDTO.setProjectData(new ArrayList<>());
// 先判断这个项目是否有分类没有直接返回
List<ProjectCategoryDTO> projectCategoryDTOList=projectCategoryService.getProjectCategoryService(formDTO.getProjectId());
if(CollectionUtils.isEmpty(projectCategoryDTOList)){
resultDTO.setProjectData(new ArrayList<>());
return resultDTO;
}
//筛选出所有的一级分类
Set<String> firstCategoryIds=new HashSet<>();
for(ProjectCategoryDTO categoryDTO:projectCategoryDTOList){
if(StringUtils.isNotBlank(categoryDTO.getCategoryPids())){
if(NumConstant.ZERO_STR.equals(categoryDTO.getCategoryPids())){
//当前分类就是一级分类
firstCategoryIds.add(categoryDTO.getCategoryId());
continue;
}
//英文逗号
if(categoryDTO.getCategoryPids().contains(StrConstant.COMMA)){
String[] categoryAtt=categoryDTO.getCategoryPids().split(StrConstant.COMMA);
firstCategoryIds.add(categoryAtt[NumConstant.ZERO]);
continue;
}
//可能也是英文冒号吧。。不知道是啥,所以都判断下吧
if(categoryDTO.getCategoryPids().contains(StrConstant.COLON)){
String[] categoryAtt=categoryDTO.getCategoryPids().split(StrConstant.COLON);
firstCategoryIds.add(categoryAtt[NumConstant.ZERO]);
continue;
}
}
}
//没有一级分类直接退出
if(CollectionUtils.isEmpty(firstCategoryIds)){
return resultDTO;
}
//查询这些分类的名称
//查询出当前人,在居民端小程序里上报的需求且转了项目的,并且还得排除当前的这个项目
//todo
return null;
IssueProjectCategoryDictListFormDTO dictFormDto=new IssueProjectCategoryDictListFormDTO();
dictFormDto.setCustomerId(projectCategoryDTOList.get(NumConstant.ZERO).getCustomerId());
dictFormDto.setCstegoryIdList(new ArrayList<String>(firstCategoryIds));
Result<List<IssueProjectCategoryDictDTO>> categoryRes=govIssueOpenFeignClient.getCategoryList(dictFormDto);
if(!categoryRes.success()||CollectionUtils.isEmpty(categoryRes.getData())){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取项目分类名称异常");
}
List<ProjectDataDTO> projectData=new ArrayList<>();
for(IssueProjectCategoryDictDTO categoryDictDTO:categoryRes.getData()){
//当前项目分类一致,排除当前项目,相同分类编码
//todo
List<ProjectInfoIcData> projectList=null;
//projectDao.selectCommonCategoryEventProject(projectCategoryDTOList.get(NumConstant.ZERO).getCustomerId(),
//categoryDictDTO.getCategoryCode(),formDTO.getProjectId());
if(!CollectionUtils.isEmpty(projectList)){
ProjectDataDTO projectDataDTO=new ProjectDataDTO();
projectDataDTO.setFirstCategoryCode(categoryDictDTO.getCategoryCode());
projectDataDTO.setFirstCategoryName(categoryDictDTO.getCategoryName());
projectDataDTO.setProjectList(projectList);
projectData.add(projectDataDTO);
}
}
resultDTO.setProjectData(projectData);
return resultDTO;
}

Loading…
Cancel
Save