Browse Source

代码调整

dev_shibei_match
sunyuchao 4 years ago
parent
commit
8a75815338
  1. 15
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/CategoryProjectResultDTO.java
  2. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryTotalResultDTO.java
  3. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectMonthIncrResultDTO.java
  4. 8
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectStatusListResultDTO.java
  5. 46
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java
  6. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml
  7. 14
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml

15
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/CategoryProjectResultDTO.java

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
@ -28,15 +29,15 @@ public class CategoryProjectResultDTO implements Serializable {
//项目编码[目前没这个功能 默认为空]
private String projectCode = "";
//一级分类Code集合
private List<String> categoryCodes;
private List<String> categoryCodes = new ArrayList<>();
//一级分类名称集合
private List<String> categoryNames;
private List<String> categoryNames = new ArrayList<>();
//来源:议题issue 项目立项:agency 事件:resi_event【控制电机查看时里边三个按钮的显示】
private String origin;
//网格Id[立项项目此值为空]
private String gridId;
//网格名[立项项目此值为空]
private String gridName;
//网格Id[上报给组织的事件、直接立项项目此值为空]
private String gridId = "";
//网格名[上报给组织的事件、直接立项项目此值为空]
private String gridName = "";
//状态:待处理 pending,已结案closed
private String status;
//标题
@ -44,7 +45,7 @@ public class CategoryProjectResultDTO implements Serializable {
//转项目时间
private String time;
//小程序居民端话题或事件创建人【立项项目此值为空】
private String userId;
private String userId = "";
//分类对应的所有上级,英文逗号隔开【目前分类只有两级,所以这个字段值其实就是一类的id值】
@JsonIgnore
private String categoryPids;

2
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryTotalResultDTO.java

@ -19,7 +19,7 @@ public class ProjectCategoryTotalResultDTO implements Serializable {
//一级分类名称
private String categoryName;
//一级分类颜色
private String colour;
private String colour = "";
//分类下项目总数
private Integer total = 0;

2
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectMonthIncrResultDTO.java

@ -13,7 +13,7 @@ public class ProjectMonthIncrResultDTO implements Serializable {
private static final long serialVersionUID = 6188316867855643263L;
//横坐标值
private Integer value;
private Integer value = 0;
//横坐标
private String type;

8
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectStatusListResultDTO.java

@ -17,13 +17,13 @@ public class ProjectStatusListResultDTO implements Serializable {
//项目Id
private String projectId;
//来源:议题issue 项目立项:agency 事件:resi_event
private Integer origin;
private String origin;
//状态:待处理 pending,结案closed
private Integer status;
private String status;
//经度
private Integer longitude;
private String longitude;
//纬度
private Integer dimension;
private String dimension;
//项目标题
private String title;

46
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java

@ -15,7 +15,6 @@ 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.govissue.result.ShiftProjectIssueListResultDTO;
import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO;
import com.epmet.dataaggre.dto.govproject.ProjectDTO;
import com.epmet.dataaggre.dto.govproject.ProjectRelatedPersonnelDTO;
@ -31,7 +30,6 @@ import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.epmet.dataaggre.service.govproject.GovProjectService;
import com.epmet.dataaggre.service.resigroup.ResiGroupService;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.ProjectCategoryDTO;
import com.epmet.dto.UserBaseInfoDTO;
import com.epmet.dto.form.TimestampIntervalFormDTO;
import com.epmet.dto.form.WorkMinuteFormDTO;
@ -293,6 +291,9 @@ public class GovProjectServiceImpl implements GovProjectService {
result.setPendingRatio(l.getPendingRatio());
result.setClosedTotal(l.getClosedTotal());
result.setClosedRatio(l.getClosedRatio());
//默认较昨日较上个月增长值就是当前日期的数据
result.setDateIncr(l.getProjectTotal());
result.setMonthIncr(l.getProjectTotal());
}
if (formDTO.getYeDateId().equals(l.getDateId())) {
result.setDateIncr(result.getProjectTotal() - l.getProjectTotal());
@ -362,19 +363,33 @@ public class GovProjectServiceImpl implements GovProjectService {
List<ProjectCategoryTotalResultDTO> list = evaluationIndexService.projectCategoryList(formDTO);
//3.封装数据并返回
categoryList.forEach(ca -> {
//有数据的排在前边,没数据的按分类顺序排在后边
Map<String, String> map = new HashMap<>();
list.forEach(l -> {
ProjectCategoryTotalResultDTO dto = new ProjectCategoryTotalResultDTO();
dto.setAgencyId(formDTO.getAgencyId());
dto.setCategoryCode(ca.getCategoryCode());
dto.setCategoryName(ca.getCategoryName());
dto.setColour(ca.getColour());
list.forEach(l -> {
dto.setTotal(l.getTotal());
categoryList.forEach(ca -> {
if (ca.getCategoryCode().equals(l.getCategoryCode())) {
dto.setTotal(l.getTotal());
dto.setCategoryCode(ca.getCategoryCode());
dto.setCategoryName(ca.getCategoryName());
dto.setColour(ca.getColour());
}
});
map.put(l.getCategoryCode(), l.getCategoryCode());
resultList.add(dto);
});
categoryList.forEach(ca -> {
if (!map.containsKey(ca.getCategoryCode())) {
ProjectCategoryTotalResultDTO dto = new ProjectCategoryTotalResultDTO();
dto.setAgencyId(formDTO.getAgencyId());
dto.setCategoryCode(ca.getCategoryCode());
dto.setCategoryName(ca.getCategoryName());
dto.setColour(ca.getColour());
resultList.add(dto);
map.put(ca.getCategoryCode(), ca.getCategoryCode());
}
});
return resultList;
}
@ -390,7 +405,7 @@ public class GovProjectServiceImpl implements GovProjectService {
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());
List<String> categoreCodeList = categoryList.stream().filter(ca -> ca.getParentCategoryCode().equals(formDTO.getCategoryCode())).map(m -> m.getCategoryCode()).collect(Collectors.toList());
formDTO.setCategoreCodeList(categoreCodeList);
//2.查询组织及下级截止某一天的某个一级分类下的项目列表
@ -423,18 +438,22 @@ public class GovProjectServiceImpl implements GovProjectService {
}
});
//项目涉及分类信息【一个项目涉及多个一级分类】
//一级分类Id
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());
}
});
//一级分类名称、code集合
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);
List<String> caCode = new ArrayList<>();
categoryList.forEach(ca -> caId.stream().filter(li -> ca.getId().equals(li)).forEach(s -> {
caName.add(ca.getCategoryName());
caCode.add(ca.getCategoryCode());
}));
re.setCategoryNames(caName);
re.setCategoryCodes(caCode);
//项目来源话题、事件的创建人信息
eventUser.forEach(ev -> {
if (re.getProjectId().equals(ev.getProjectId())) {
@ -459,6 +478,7 @@ public class GovProjectServiceImpl implements GovProjectService {
@Override
public ProjectAnalysisResultDTO projectAnalysis(ProjectAnalysisFormDTO formDTO) {
ProjectAnalysisResultDTO resultDTO = new ProjectAnalysisResultDTO();
resultDTO.setUserId(formDTO.getUserId());
//1.查询userId的身份证号在小程序用户中存在的多个userId值
List<UserBaseInfoDTO> userList = epmetUserService.getUserBaseList(formDTO.getUserId());
List<String> userIds = userList.stream().map(UserBaseInfoDTO::getUserId).collect(Collectors.toList());

1
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml

@ -193,6 +193,7 @@
`level` = '1'
AND org_id = #{agencyId}
AND date_id = #{dateId}
ORDER BY project_total DESC
</select>
</mapper>

14
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml

@ -158,11 +158,11 @@
<select id="getProjectStatusList" resultType="com.epmet.dataaggre.dto.govproject.result.ProjectStatusListResultDTO">
SELECT
agency_id "agencyId",
id "projectId",
origin "origin",
`status` "status",
locate_longitude "longitude",
agency_id agencyId,
id projectId,
origin origin,
`status` status,
locate_longitude longitude,
locate_dimension dimension,
title title
FROM
@ -180,7 +180,7 @@
p.agency_id agencyId,
p.id projectId,
p.origin origin,
pc.grid_id gridId,
IFNULL(pc.grid_id, '') gridId,
p.`status` status,
p.title title,
p.created_time time
@ -203,7 +203,7 @@
<select id="getCategoryList" resultType="com.epmet.dataaggre.dto.govproject.result.CategoryProjectResultDTO$Project">
SELECT
project_id projectId,
category_pids categoryPids, <!-- 目前分类只有两级,所以这个字段值其实就是一类的id值 -->
substring_index(category_pids, ',', 1) categoryPids, <!-- 目前分类只有两级,所以这个字段值其实就是一类的id值,后续上报上来的数据会存在多个 -->
category_code categoryCode
FROM
project_category

Loading…
Cancel
Save