|
|
@ -15,7 +15,10 @@ import com.epmet.dataaggre.dto.datastats.result.FactAgencyProjectResultDTO; |
|
|
|
import com.epmet.dataaggre.dto.govissue.IssueProjectCategoryDictDTO; |
|
|
|
import com.epmet.dataaggre.dto.govissue.result.IssueInfoDTO; |
|
|
|
import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO; |
|
|
|
import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO; |
|
|
|
import com.epmet.dataaggre.dto.govproject.ProjectDTO; |
|
|
|
import com.epmet.dataaggre.dto.govproject.ProjectRelatedPersonnelDTO; |
|
|
|
import com.epmet.dataaggre.dto.govproject.ResiEventDTO; |
|
|
|
import com.epmet.dataaggre.dto.govproject.form.*; |
|
|
|
import com.epmet.dataaggre.dto.govproject.result.*; |
|
|
|
import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO; |
|
|
@ -28,6 +31,8 @@ import com.epmet.dataaggre.service.resigroup.ResiGroupService; |
|
|
|
import com.epmet.dto.form.TimestampIntervalFormDTO; |
|
|
|
import com.epmet.dto.form.WorkMinuteFormDTO; |
|
|
|
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
@ -330,7 +335,7 @@ public class GovProjectServiceImpl implements GovProjectService { |
|
|
|
@Override |
|
|
|
public List<ProjectStatusListResultDTO> projectStatusList(ProjectTotalFormDTO formDTO) { |
|
|
|
//所选日期后一天的dateId值
|
|
|
|
formDTO.setYeDateId(DateUtils.dateOrmonthId(formDTO.getDateId(), "date", 1)); |
|
|
|
formDTO.setToDateId(DateUtils.dateOrmonthId(formDTO.getDateId(), "date", 1)); |
|
|
|
//1.查询组织下截止到dateId的某个状态的项目列表
|
|
|
|
List<ProjectStatusListResultDTO> resultList = projectDao.getProjectStatusList(formDTO); |
|
|
|
return resultList; |
|
|
@ -344,7 +349,7 @@ public class GovProjectServiceImpl implements GovProjectService { |
|
|
|
public List<ProjectCategoryTotalResultDTO> projectCategoryList(ProjectCategoryTotalFormDTO formDTO) { |
|
|
|
List<ProjectCategoryTotalResultDTO> resultList = new ArrayList<>(); |
|
|
|
//1.查询客户下一级分类信息
|
|
|
|
List<IssueProjectCategoryDictDTO> categoryList = govIssueService.categoryList(formDTO.getCustomerId()); |
|
|
|
List<IssueProjectCategoryDictDTO> categoryList = govIssueService.categoryList(formDTO.getCustomerId(), "1", "enable"); |
|
|
|
|
|
|
|
//2.按dateId查询组织下一级分类项目总数
|
|
|
|
List<ProjectCategoryTotalResultDTO> list = evaluationIndexService.projectCategoryList(formDTO); |
|
|
@ -372,7 +377,71 @@ public class GovProjectServiceImpl implements GovProjectService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public CategoryProjectResultDTO categoryProjectList(CategoryProjectFormDTO formDTO) { |
|
|
|
return null; |
|
|
|
CategoryProjectResultDTO resultDTO = new CategoryProjectResultDTO(); |
|
|
|
//所选日期后一天的dateId值
|
|
|
|
formDTO.setToDateId(DateUtils.dateOrmonthId(formDTO.getDateId(), "date", 1)); |
|
|
|
//1.查询客户下分类信息
|
|
|
|
List<IssueProjectCategoryDictDTO> categoryList = govIssueService.categoryList(formDTO.getCustomerId(), null, null); |
|
|
|
List<String> categoreCodeList = categoryList.stream().map(ca -> formDTO.getCategoryCode().equals(ca.getParentCategoryCode()) ? ca.getCategoryCode() : "").collect(Collectors.toList()); |
|
|
|
formDTO.setCategoreCodeList(categoreCodeList); |
|
|
|
|
|
|
|
//2.查询组织及下级截止某一天的某个一级分类下的项目列表
|
|
|
|
PageInfo<CategoryProjectResultDTO.Project> result = |
|
|
|
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> projectDao.categoryProjectList(formDTO)); |
|
|
|
if (org.springframework.util.CollectionUtils.isEmpty(result.getList())) { |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
resultDTO.setTotal((int) result.getTotal()); |
|
|
|
|
|
|
|
//3.查询已有项目列表涉及的所有分类信息【一个项目存在多个一级分类下的二级分类】
|
|
|
|
List<String> projectIds = result.getList().stream().map(CategoryProjectResultDTO.Project::getProjectId).collect(Collectors.toList()); |
|
|
|
List<CategoryProjectResultDTO.Project> list = projectDao.getCategoryList(projectIds); |
|
|
|
|
|
|
|
//4.查询网格信息【楼院小组类项目、上报事件且上报给网格的项目才存在网格Id】
|
|
|
|
List<String> gridIds = result.getList().stream().map(CategoryProjectResultDTO.Project::getGridId).collect(Collectors.toList()); |
|
|
|
gridIds = gridIds.stream().distinct().collect(Collectors.toList()); |
|
|
|
List<GridsInfoListResultDTO> gridList = govOrgService.gridListByIds(gridIds); |
|
|
|
|
|
|
|
//5.查询来源议题、事件的项目居民端创建人userId
|
|
|
|
List<ResiEventDTO> eventUser = projectDao.getEventList(projectIds); |
|
|
|
List<ProjectRelatedPersonnelDTO> topicUser = projectDao.getTopicUser(projectIds); |
|
|
|
|
|
|
|
//5.封装数据
|
|
|
|
result.getList().forEach(re -> { |
|
|
|
//项目涉及网格信息
|
|
|
|
gridList.forEach(g -> { |
|
|
|
if (StringUtils.isNotBlank(re.getGridId()) && re.getGridId().equals(g.getGridId())) { |
|
|
|
re.setGridName(g.getName()); |
|
|
|
} |
|
|
|
}); |
|
|
|
//项目涉及分类信息【一个项目涉及多个一级分类】
|
|
|
|
List<String> caId = new ArrayList<>(); |
|
|
|
List<String> caCode = new ArrayList<>(); |
|
|
|
list.forEach(ca -> { |
|
|
|
if (ca.getProjectId().equals(re.getProjectId())) { |
|
|
|
caId.add(ca.getCategoryPids()); |
|
|
|
caCode.add(ca.getCategoryCode()); |
|
|
|
} |
|
|
|
}); |
|
|
|
List<String> caName = new ArrayList<>(); |
|
|
|
categoryList.forEach(ca -> caId.stream().filter(li -> ca.getId().equals(li)).forEach(s -> caName.add(ca.getCategoryName()))); |
|
|
|
re.setCategoryCodes(caCode); |
|
|
|
re.setCategoryNames(caName); |
|
|
|
//项目来源话题、事件的创建人信息
|
|
|
|
eventUser.forEach(ev -> { |
|
|
|
if (re.getProjectId().equals(ev.getProjectId())) { |
|
|
|
re.setUserId(ev.getReportUserId()); |
|
|
|
} |
|
|
|
}); |
|
|
|
topicUser.forEach(to -> { |
|
|
|
if (re.getProjectId().equals(to.getProjectId())) { |
|
|
|
re.setUserId(to.getUserId()); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
resultDTO.setList(result.getList()); |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|