Browse Source

Merge branch 'develop' into release_temp

dev_shibei_match
sunyuchao 4 years ago
parent
commit
b3db53edb1
  1. 6
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridsInfoListResultDTO.java
  2. 45
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ResiEventDTO.java
  3. 5
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/CategoryProjectFormDTO.java
  4. 11
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/CategoryProjectResultDTO.java
  5. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectStatusListResultDTO.java
  6. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java
  7. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java
  8. 31
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java
  9. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java
  10. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java
  11. 75
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java
  12. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml
  13. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml
  14. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml
  15. 76
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml
  16. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicDao.xml
  17. 34
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java
  18. 29
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandResearchAnalysisResultDTO.java
  19. 14
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
  20. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
  21. 51
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  22. 36
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ResiBuzzFormDTO.java
  23. 26
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ResiBuzzLeftPieChartFormDTO.java
  24. 91
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzDTO.java
  25. 36
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzLeftPieChartResultDTO.java
  26. 28
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzResultDTO.java
  27. 9
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java
  28. 5
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java
  29. 38
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java
  30. 37
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java
  31. 27
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java
  32. 94
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
  33. 76
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml
  34. 2
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDistributionAnalysisRightDTO.java
  35. 8
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDistributionAnalysisRightResultDTO.java
  36. 2
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java
  37. 22
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  38. 15
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HouseUserDTO.java
  39. 19
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcResiUserBriefDTO.java
  40. 3
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  41. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  42. 13
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  43. 21
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  44. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  45. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  46. 37
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

6
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridsInfoListResultDTO.java

@ -24,8 +24,12 @@ public class GridsInfoListResultDTO implements Serializable {
private String gridId;
/**
* 网格名称
* 组织-网格名称
*/
private String gridName;
/**
* 网格名称
*/
private String name;
}

45
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ResiEventDTO.java

@ -0,0 +1,45 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dataaggre.dto.govproject;
import lombok.Data;
import java.io.Serializable;
/**
* 居民报事表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@Data
public class ResiEventDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
private String projectId;
private String reportUserId;
}

5
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/CategoryProjectFormDTO.java

@ -33,6 +33,11 @@ public class CategoryProjectFormDTO implements Serializable {
private Integer pageSize = 20;
//是否分页(是:true 否:false)
private Boolean isPage = true;
//明天的dateId值
private String toDateId;
private String customerId;
private List<String> categoreCodeList;
public interface Category extends CustomerClientShowGroup {
}

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

@ -1,5 +1,6 @@
package com.epmet.dataaggre.dto.govproject.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@ -26,7 +27,7 @@ public class CategoryProjectResultDTO implements Serializable {
private String projectId;
//项目编码[目前没这个功能 默认为空]
private String projectCode = "";
//一级分类Id集合
//一级分类Code集合
private List<String> categoryCodes;
//一级分类名称集合
private List<String> categoryNames;
@ -42,10 +43,14 @@ public class CategoryProjectResultDTO implements Serializable {
private String title;
//转项目时间
private String time;
//当前人员是否处理:未处理unhandled,已处理handle
private String isHandle;
//小程序居民端话题或事件创建人【立项项目此值为空】
private String userId;
//分类对应的所有上级,英文逗号隔开【目前分类只有两级,所以这个字段值其实就是一类的id值】
@JsonIgnore
private String categoryPids;
//二级分类code
@JsonIgnore
private String categoryCode;
}
}

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

@ -24,5 +24,7 @@ public class ProjectStatusListResultDTO implements Serializable {
private Integer longitude;
//纬度
private Integer dimension;
//项目标题
private String title;
}

3
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java

@ -102,8 +102,9 @@ public class GovProjectController {
* @author sun
*/
@PostMapping("categoryprojectlist")
public Result<CategoryProjectResultDTO> categoryProjectList(@RequestBody CategoryProjectFormDTO formDTO) {
public Result<CategoryProjectResultDTO> categoryProjectList(@LoginUser TokenDto tokenDto, @RequestBody CategoryProjectFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, CategoryProjectFormDTO.Category.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<CategoryProjectResultDTO>().ok(govProjectService.categoryProjectList(formDTO));
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java

@ -80,5 +80,5 @@ public interface IssueDao extends BaseDao<IssueEntity> {
* @Description 查询客户下分类信息
* @author sun
**/
List<IssueProjectCategoryDictDTO> getCategoryList(@Param("customerId") String customerId);
List<IssueProjectCategoryDictDTO> getCategoryList(@Param("customerId") String customerId, @Param("level") String level, @Param("isDisable") String isDisable);
}

31
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java

@ -18,14 +18,14 @@
package com.epmet.dataaggre.dao.govproject;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govproject.result.IssueProjectCategory;
import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO;
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.AllProjectFormDTO;
import com.epmet.dataaggre.dto.govproject.form.CategoryProjectFormDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectDistributionResultDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectInfoDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectStatusListResultDTO;
import com.epmet.dataaggre.dto.govproject.result.*;
import com.epmet.dataaggre.entity.govproject.ProjectEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -81,4 +81,27 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
List<ProjectStatusListResultDTO> getProjectStatusList(ProjectTotalFormDTO formDTO);
List<IssueProjectCategory> selectProjectIssueCategory(@Param("issueIds") List<String> issueIds);
/**
* @Description 查询组织截止某一天的某个分类下的项目列表
* @author sun
*/
List<CategoryProjectResultDTO.Project> categoryProjectList(CategoryProjectFormDTO formDTO);
/**
* @Description 查询项目对应的所有分类信息
* @author sun
*/
List<CategoryProjectResultDTO.Project> getCategoryList(@Param("projectIds") List<String> projectIds);
/**
* @Description 查询来源事件的项目居民端创建人信息
* @author sun
*/
List<ResiEventDTO> getEventList(@Param("projectIds") List<String> projectIds);
/**
* @Description 查询来源话题的项目居民端创建人信息
* @author sun
*/
List<ProjectRelatedPersonnelDTO> getTopicUser(@Param("projectIds") List<String> projectIds);
}

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java

@ -48,8 +48,8 @@ public interface GovIssueService {
List<IssueInfoDTO> selectShiftProjectIssueList(String customerId,String gridId,Integer pageNo,Integer pageSize);
/**
* @Description 查询客户下一级分类信息
* @Description 查询客户下分类信息
* @author sun
**/
List<IssueProjectCategoryDictDTO> categoryList(String customerId);
List<IssueProjectCategoryDictDTO> categoryList(String customerId, String level, String isDisable);
}

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java

@ -329,8 +329,8 @@ public class GovIssueServiceImpl implements GovIssueService {
* @author sun
**/
@Override
public List<IssueProjectCategoryDictDTO> categoryList(String customerId) {
return issueDao.getCategoryList(customerId);
public List<IssueProjectCategoryDictDTO> categoryList(String customerId, String level, String isDisable) {
return issueDao.getCategoryList(customerId, level, isDisable);
}
}

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

@ -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;
}
/**

8
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml

@ -131,8 +131,12 @@
FROM issue_project_category_dict
WHERE del_flag = 0
AND customer_id = #{customerId}
AND category_type = '1'
AND is_disable = 'enable'
<if test="level != null and level.trim() != ''">
AND category_type = #{level}
</if>
<if test="isDisable != null and isDisable.trim() != ''">
AND is_disable = #{isDisable}
</if>
ORDER BY category_code
</select>

3
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml

@ -22,7 +22,8 @@
cg.grid_name,
CONCAT(ca.organization_name,'-',cg.grid_name)
) AS 'gridName',
cg.customer_id AS 'customerId'
cg.customer_id AS 'customerId',
cg.grid_name AS 'name'
FROM
customer_grid cg
INNER JOIN customer_agency ca ON cg.pid = ca.id

2
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml

@ -27,7 +27,7 @@
ca.level,
ca.area_code,
ca.parent_area_code,
( CASE WHEN ca.longitude is THEN
( CASE WHEN ca.longitude is null THEN
( SELECT longitude FROM customer_agency
WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
ORDER BY pid ASC LIMIT 1

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

@ -163,17 +163,87 @@
origin "origin",
`status` "status",
locate_longitude "longitude",
locate_dimension dimension
locate_dimension dimension,
title title
FROM
project
WHERE
del_flag = '0'
AND agency_id = #{agencyId}
AND org_id_path LIKE CONCAT('%', #{agencyId}, '%')
AND `status` = #{status}
AND created_time <![CDATA[<]]> DATE_FORMAT(#{dateId}, '%Y-%m-%d')
AND created_time <![CDATA[<]]> DATE_FORMAT(#{toDateId}, '%Y-%m-%d')
ORDER BY created_time DESC
</select>
<select id="categoryProjectList" resultType="com.epmet.dataaggre.dto.govproject.result.CategoryProjectResultDTO$Project">
SELECT
p.agency_id agencyId,
p.id projectId,
p.origin origin,
pc.grid_id gridId,
p.`status` status,
p.title title,
p.created_time time
FROM
project p
INNER JOIN project_category pc ON p.id = pc.project_id
WHERE
p.del_flag = '0'
AND p.org_id_path LIKE CONCAT('%', #{agencyId}, '%')
AND p.created_time <![CDATA[<]]> DATE_FORMAT(#{toDateId}, '%Y-%m-%d')
<foreach collection="categoreCodeList" item="code" open="AND pc.category_code IN (" separator="," close=")">
#{code}
</foreach>
GROUP BY
pc.project_id
ORDER BY
p.created_time DESC
</select>
<select id="getCategoryList" resultType="com.epmet.dataaggre.dto.govproject.result.CategoryProjectResultDTO$Project">
SELECT
project_id projectId,
category_pids categoryPids, <!-- 目前分类只有两级,所以这个字段值其实就是一类的id值 -->
category_code categoryCode
FROM
project_category
WHERE
del_flag = '0'
<foreach collection="projectIds" item="projectId" open="AND project_id IN (" separator="," close=")">
#{projectId}
</foreach>
GROUP BY
category_pids, project_id
ORDER BY project_id
</select>
<select id="getEventList" resultType="com.epmet.dataaggre.dto.govproject.ResiEventDTO">
SELECT
project_id projectId,
report_user_id reportUserId
FROM
resi_event
WHERE
DEL_FLAG = '0'
<foreach collection="projectIds" item="projectId" open="AND project_id IN (" separator="," close=")">
#{projectId}
</foreach>
</select>
<select id="getTopicUser" resultType="com.epmet.dataaggre.dto.govproject.ProjectRelatedPersonnelDTO">
SELECT
project_id projectId,
user_id userId
FROM
project_related_personnel
WHERE
del_flag = '0'
AND source_type = 'topic'
<foreach collection="projectIds" item="projectId" open="AND project_id IN (" separator="," close=")">
#{projectId}
</foreach>
</select>
<select id="selectProjectIssueCategory" parameterType="map" resultType="com.epmet.dataaggre.dto.govproject.result.IssueProjectCategory">
SELECT
p.ORIGIN_ID AS issueId,

2
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicDao.xml

@ -28,7 +28,7 @@
resultType="com.epmet.dataaggre.dto.resigroup.result.UserTopicResDTO">
SELECT
rt.id as topicId,
rt.TOPIC_CONTENT as topicContent,
IFNULL(rt.TOPIC_CONTENT,'语音话题') as topicContent,
rt.SHIFT_ISSUE as shiftIssue,
IFNULL(rt.ISSUE_ID,'') AS issueId,
rt.CREATED_TIME as releaseTime

34
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java

@ -0,0 +1,34 @@
package com.epmet.dto.form.demand;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* 需求研判分析 入参DTO
*/
@Data
public class DemandResearchAnalysisFormDTO implements Serializable {
private static final long serialVersionUID = 3528172570410679765L;
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
@NotBlank(message = "firstCategoryCode不能为空",groups = AddUserInternalGroup.class)
private String firstCategoryCode;
@NotBlank(message = "isResiUserId不能为空",groups = AddUserInternalGroup.class)
private String isResiUserId;
private List<String> epmetUserIdList;
@NotBlank(message = "tokenDto中的customerId不能为空",groups = AddUserInternalGroup.class)
private String customerId;
}

29
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandResearchAnalysisResultDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.result.demand;
import com.epmet.dto.result.HouseUserDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 数据分析-个人档案-需求详情研判分析
*/
@Data
public class DemandResearchAnalysisResultDTO implements Serializable {
private static final long serialVersionUID = -1024304149893118204L;
/**
* 居民信息及家属列表
*/
private String icResiUserId;
private String icUserName;
private String houseId;
private List<HouseUserDTO> houseUserList;
private List<IcResiUserReportDemandRes> demandList;
/**
* 入参中给的再返回去
*/
private List<String> epmetUserIdList;
}

14
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java

@ -25,6 +25,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.UserDemandConstant;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.demand.DemandRecResultDTO;
import com.epmet.dto.result.demand.DemandResearchAnalysisResultDTO;
import com.epmet.dto.result.demand.IcResiUserReportDemandRes;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.service.*;
@ -210,7 +211,18 @@ public class IcUserDemandRecController {
}
/**
* 数据分析-个人档案-需求详情研判分析
*
* @param formDTO
* @return
*/
@PostMapping("demand-research-analysis")
public Result<DemandResearchAnalysisResultDTO> queryDemandResearchAnalysis(@LoginUser TokenDto tokenDto,@RequestBody DemandResearchAnalysisFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO, DemandResearchAnalysisFormDTO.AddUserInternalGroup.class);
return new Result<DemandResearchAnalysisResultDTO>().ok(icUserDemandRecService.queryDemandResearchAnalysis(formDTO));
}
}

9
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java

@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.demand.DemandRecResultDTO;
import com.epmet.dto.result.demand.DemandResearchAnalysisResultDTO;
import com.epmet.dto.result.demand.IcResiUserReportDemandRes;
import com.epmet.entity.IcUserDemandRecEntity;
@ -144,4 +145,12 @@ public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntit
* @return
*/
DemandRecResultDTO queryDemandDetail(DemandDetailFormDTO formDTO);
/**
* 数据分析-个人档案-需求详情研判分析
*
* @param formDTO
* @return
*/
DemandResearchAnalysisResultDTO queryDemandResearchAnalysis(DemandResearchAnalysisFormDTO formDTO);
}

51
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java

@ -42,8 +42,10 @@ import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.AllGridsByUserIdResultDTO;
import com.epmet.dto.result.IcResiUserBriefDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.dto.result.demand.DemandRecResultDTO;
import com.epmet.dto.result.demand.DemandResearchAnalysisResultDTO;
import com.epmet.dto.result.demand.IcResiUserReportDemandRes;
import com.epmet.entity.*;
import com.epmet.feign.EpmetAdminOpenFeignClient;
@ -554,7 +556,56 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
}
/**
* 数据分析-个人档案-需求详情研判分析
*
* @param formDTO
* @return
*/
@Override
public DemandResearchAnalysisResultDTO queryDemandResearchAnalysis(DemandResearchAnalysisFormDTO formDTO) {
//获取案件居民和及家属列表
Result<IcResiUserBriefDTO> userRes = epmetUserOpenFeignClient.findFamilyMem(formDTO.getIsResiUserId());
if (userRes.success() || null == userRes.getData()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民信息及技术接口异常");
}
IcResiUserBriefDTO icResiUserDTO = userRes.getData();
DemandResearchAnalysisResultDTO resultDTO = ConvertUtils.sourceToTarget(icResiUserDTO, DemandResearchAnalysisResultDTO.class);
resultDTO.setEpmetUserIdList(CollectionUtils.isNotEmpty(formDTO.getEpmetUserIdList()) ? formDTO.getEpmetUserIdList() : Collections.emptyList());
//获取当前需求人,相同分类的需求列表。不分页,直接返回所有
List<String> userIds=new ArrayList<>();
userIds.add(formDTO.getIsResiUserId());
if(CollectionUtils.isNotEmpty(formDTO.getEpmetUserIdList())){
userIds.addAll(formDTO.getEpmetUserIdList());
}
IcResiUserDemandFromDTO icResiUserDemandFromDTO=new IcResiUserDemandFromDTO();
icResiUserDemandFromDTO.setUserIds(userIds);
icResiUserDemandFromDTO.setFirstCategoryCode(formDTO.getFirstCategoryCode());
List<IcResiUserReportDemandRes> demandList = baseDao.selectUserDemand(icResiUserDemandFromDTO);
if(CollectionUtils.isNotEmpty(demandList)){
// 1、状态字典
Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode());
Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>();
//2、查询分类名称
List<String> categoryCodes = demandList.stream().map(IcResiUserReportDemandRes::getCategoryCode).collect(Collectors.toList());
List<IcResiDemandDictEntity> dictList = demandDictService.listByCodes(formDTO.getCustomerId(), categoryCodes);
Map<String, String> dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName));
for (IcResiUserReportDemandRes resDto : demandList) {
//状态赋值
resDto.setStatusName(statusMap.containsKey(resDto.getStatus()) ? statusMap.get(resDto.getStatus()) : StrConstant.EPMETY_STR);
if (null != dictMap && dictMap.containsKey(resDto.getCategoryCode())) {
//分类名称XXX-XX 或者XXX
resDto.setCategoryName(dictMap.get(resDto.getCategoryCode()));
}
//一级分类名称
resDto.setFirstCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(),resDto.getFirstCategoryCode()));
}
resultDTO.setDemandList(CollectionUtils.isNotEmpty(demandList) ? demandList : Collections.emptyList());
}
return resultDTO;
}

36
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ResiBuzzFormDTO.java

@ -0,0 +1,36 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/12/8 3:29 下午
* @DESC
*/
@Data
public class ResiBuzzFormDTO implements Serializable {
private static final long serialVersionUID = 7477325476668438447L;
public interface ResiBuzzForm{}
private String orgId;
private String orgType;
/**
* 表决中voting 已转项目shift_project 已关闭closed全部all
*/
@NotBlank(message = "status不能为空",groups = ResiBuzzForm.class)
private String status;
@NotNull(message = "pageSize不能为空",groups = ResiBuzzForm.class)
private Integer pageSize;
@NotNull(message = "pageNo不能为空",groups = ResiBuzzForm.class)
private Integer pageNo;
}

26
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ResiBuzzLeftPieChartFormDTO.java

@ -0,0 +1,26 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/12/9 9:53 上午
* @DESC
*/
@Data
public class ResiBuzzLeftPieChartFormDTO implements Serializable {
private static final long serialVersionUID = -7312573663758331220L;
/**
* 组织ID
*/
private String orgId;
/**
* 组织类型agency组织grid网格
*/
private String orgType;
}

91
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzDTO.java

@ -0,0 +1,91 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/12/8 3:37 下午
* @DESC
*/
@Data
public class ResiBuzzDTO implements Serializable {
private static final long serialVersionUID = -1844581181580474374L;
@JsonIgnore
private String createdBy;
/**
* 排序
*/
private Integer sort;
/**
* 议题标题
*/
private String issueTitle;
/**
* 议题ID
*/
private String issueId;
/**
* 建议
*/
private String suggestion;
/**
* 状态
*/
private String status;
/**
* 创建时间
*/
private String createdTime;
/**
* 支持个数
*/
private Integer supportCount;
/**
* 反对个数
*/
private Integer oppositionCount;
/**
* 表决占比
*/
private String voteAccount;
/**
* 议题发起人
*/
private String issueOriginator;
/**
* 分类名字
*/
private String categoryName;
public ResiBuzzDTO() {
this.createdBy = "";
this.sort = NumConstant.ZERO;
this.issueTitle = "";
this.issueId = "";
this.suggestion = "";
this.status = "";
this.createdTime = "";
this.supportCount = NumConstant.ZERO;
this.oppositionCount = NumConstant.ZERO;
this.voteAccount = "";
this.issueOriginator = "";
this.categoryName = "其他";
}
}

36
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzLeftPieChartResultDTO.java

@ -0,0 +1,36 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/12/9 9:56 上午
* @DESC
*/
@Data
public class ResiBuzzLeftPieChartResultDTO implements Serializable {
private static final long serialVersionUID = -4673540577019002156L;
/**
* 数量
*/
private Integer count;
/**
* 分类编码
*/
private String categoryCode;
/**
* 分类名字
*/
private String categoryName;
/**
* 颜色
*/
private String colour;
}

28
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzResultDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/12/8 3:36 下午
* @DESC
*/
@Data
public class ResiBuzzResultDTO implements Serializable {
private static final long serialVersionUID = 4914999826185811915L;
private Integer total;
private List<ResiBuzzDTO> list;
public ResiBuzzResultDTO() {
this.total = NumConstant.ZERO;
this.list = new ArrayList<>();
}
}

9
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java

@ -356,4 +356,13 @@ public interface GovIssueOpenFeignClient {
@PostMapping(value = "/gov/issue/issueprojectcategorydict/categorylist")
Result<List<CategoryListResultDTO>> selectCategoryOneLevelListByCustomerId(@LoginUser TokenDto tokenDto);
/**
* @Description 查询组织下每个网格的项目数
* @param formDTO
* @author zxc
* @date 2021/12/9 2:59 下午
*/
@PostMapping(value = "/gov/issue/issue/projectcountbygrid")
Result<List<ProjectDistributionAnalysisRightDTO>> getProjectCountByGrid(@RequestBody ProjectDistributionAnalysisFormDTO formDTO);
}

5
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java

@ -290,4 +290,9 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient
public Result<List<CategoryListResultDTO>> selectCategoryOneLevelListByCustomerId(TokenDto tokenDto) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "selectCategoryOneLevelListByCustomerId", tokenDto);
}
@Override
public Result<List<ProjectDistributionAnalysisRightDTO>> getProjectCountByGrid(ProjectDistributionAnalysisFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getProjectCountByGrid", formDTO);
}
}

38
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java

@ -1,5 +1,7 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.IssueDTO;
@ -284,7 +286,41 @@ public class IssueController {
return new Result<List<UnResolvedResultDTO>>().ok(issueService.getUnResolvedList(formDTO));
}
// @PostMapping("resibuzz")
/**
* @Description 居民热议列表
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2021/12/8 3:50 下午
*/
@PostMapping("resibuzz")
public Result<ResiBuzzResultDTO> resiBuzz(@RequestBody ResiBuzzFormDTO formDTO, @LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(formDTO, ResiBuzzFormDTO.ResiBuzzForm.class);
return new Result<ResiBuzzResultDTO>().ok(issueService.resiBuzz(formDTO,tokenDto));
}
/**
* @Description 居民热议左边饼图
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2021/12/9 10:03 上午
*/
@PostMapping("resibuzz-leftpiechart")
public Result<List<ResiBuzzLeftPieChartResultDTO>> resiBuzzLeftPieChart(@RequestBody ResiBuzzLeftPieChartFormDTO formDTO,@LoginUser TokenDto tokenDto){
return new Result<List<ResiBuzzLeftPieChartResultDTO>>().ok(issueService.resiBuzzLeftPieChart(formDTO,tokenDto));
}
/**
* @Description 查询组织下每个网格的项目数
* @param formDTO
* @author zxc
* @date 2021/12/9 2:59 下午
*/
@PostMapping("projectcountbygrid")
public Result<List<ProjectDistributionAnalysisRightDTO>> getProjectCountByGrid(@RequestBody ProjectDistributionAnalysisFormDTO formDTO){
return new Result<List<ProjectDistributionAnalysisRightDTO>>().ok(issueService.getProjectCountByGrid(formDTO));
}
}

37
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java

@ -225,4 +225,41 @@ public interface IssueDao extends BaseDao<IssueEntity> {
* @return java.util.List<com.epmet.dto.result.UnResolvedResultDTO>
*/
List<UnResolvedResultDTO> selectUnResolvedList(@Param("gridId") String gridId);
/**
* @Description 查询表决前50名
* @param orgId
* @param orgType
* @param status
* @author zxc
* @date 2021/12/8 4:08 下午
*/
List<ResiBuzzDTO> selectIssueLimit50(@Param("orgId")String orgId,@Param("orgType")String orgType,@Param("status")String status);
/**
* @Description 查询客户下1级分类的长度
* @param customerId
* @author zxc
* @date 2021/12/9 10:28 上午
*/
Integer selectOneLevelCategoryLength(@Param("customerId")String customerId);
/**
* @Description 查询居民热议左侧饼图
* @param orgId
* @param orgType
* @param length
* @author zxc
* @date 2021/12/9 10:57 上午
*/
List<ResiBuzzLeftPieChartResultDTO> resiBuzzLeftPieChart(@Param("orgId")String orgId,@Param("orgType")String orgType,@Param("length")Integer length);
/**
* @Description 查询组织下每个网格的项目数
* @param orgId
* @author zxc
* @date 2021/12/9 2:59 下午
*/
List<ProjectDistributionAnalysisRightDTO> getProjectCountByGrid(@Param("orgId")String orgId,@Param("startDate")String startDate,@Param("endDate")String endDate);
}

27
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java

@ -350,4 +350,31 @@ public interface IssueService extends BaseService<IssueEntity> {
* @return java.util.List<com.epmet.dto.result.UnResolvedResultDTO>
*/
List<UnResolvedResultDTO> getUnResolvedList(ShiftProjectListFromDTO fromDTO);
/**
* @Description 居民热议列表
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2021/12/8 3:50 下午
*/
ResiBuzzResultDTO resiBuzz(ResiBuzzFormDTO formDTO , TokenDto tokenDto);
/**
* @Description 居民热议左边饼图
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2021/12/9 10:03 上午
*/
List<ResiBuzzLeftPieChartResultDTO> resiBuzzLeftPieChart(ResiBuzzLeftPieChartFormDTO formDTO,TokenDto tokenDto);
/**
* @Description 查询组织下每个网格的项目数
* @param formDTO
* @author zxc
* @date 2021/12/9 2:59 下午
*/
List<ProjectDistributionAnalysisRightDTO> getProjectCountByGrid(ProjectDistributionAnalysisFormDTO formDTO);
}

94
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java

@ -9,10 +9,13 @@ import com.epmet.commons.rocketmq.messages.GroupAchievementMQMsg;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
@ -67,6 +70,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/**
@ -1564,12 +1568,90 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
return resultList;
}
public static void main(String[] args) {
List<String> list = new ArrayList<>();
list.add("1");
list.add("2");
list.add("3");
System.out.println(list.subList(0, 3));
/**
* @Description 居民热议列表
* 如果议题没有分类默认显示其他产品说的
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2021/12/8 3:50 下午
*/
@Override
public ResiBuzzResultDTO resiBuzz(ResiBuzzFormDTO formDTO, TokenDto tokenDto) {
if (StringUtils.isBlank(formDTO.getOrgId())){
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == staffInfo){
throw new EpmetException("未查询到此工作人员的所属组织信息...");
}
formDTO.setOrgId(staffInfo.getAgencyId());
formDTO.setOrgType(IssueConstant.ISSUE_AGENCY);
}
PageInfo<ResiBuzzDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectIssueLimit50(formDTO.getOrgId(), formDTO.getOrgType(), formDTO.getStatus()));
List<ResiBuzzDTO> list = pageInfo.getList();
if (CollectionUtils.isEmpty(list)){
return new ResiBuzzResultDTO();
}
AtomicReference<Integer> no = new AtomicReference<>((formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize() + NumConstant.ONE);
ResiBuzzResultDTO result = new ResiBuzzResultDTO();
UserResiInfoListFormDTO userResiInfoListFormDTO = new UserResiInfoListFormDTO();
userResiInfoListFormDTO.setUserIdList(list.stream().map(ResiBuzzDTO::getCreatedBy).collect(Collectors.toList()));
Result<List<UserResiInfoResultDTO>> usersResult = epmetUserFeignClient.getUserResiInfoList(userResiInfoListFormDTO);
if (!usersResult.success()){
throw new EpmetException("查询人员姓名失败...");
}
Integer total = Integer.valueOf(String.valueOf(pageInfo.getTotal()));
result.setTotal(total > NumConstant.FIFTY ? NumConstant.FIFTY : total);
list.forEach(l -> {
l.setSort(no.getAndSet(no.get() + NumConstant.ONE));
usersResult.getData().forEach(u -> {
if (l.getCreatedBy().equals(u.getUserId())){
l.setIssueOriginator(u.getShowName());
}
});
});
result.setList(list);
return result;
}
/**
* @Description 居民热议左边饼图
* @param formDTO
* @param tokenDto
* @author zxc
* @date 2021/12/9 10:03 上午
*/
@Override
public List<ResiBuzzLeftPieChartResultDTO> resiBuzzLeftPieChart(ResiBuzzLeftPieChartFormDTO formDTO, TokenDto tokenDto) {
if (StringUtils.isBlank(formDTO.getOrgId())){
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == staffInfo){
throw new EpmetException("未查询到此工作人员的所属组织信息...");
}
formDTO.setOrgId(staffInfo.getAgencyId());
formDTO.setOrgType(IssueConstant.ISSUE_AGENCY);
}
Integer length = baseDao.selectOneLevelCategoryLength(tokenDto.getCustomerId());
List<ResiBuzzLeftPieChartResultDTO> result = baseDao.resiBuzzLeftPieChart(formDTO.getOrgId(), formDTO.getOrgType(), length);
if(CollectionUtils.isEmpty(result)){
return new ArrayList<>();
}
return result;
}
/**
* @Description 查询组织下每个网格的项目数
* @param formDTO
* @author zxc
* @date 2021/12/9 2:59 下午
*/
@Override
public List<ProjectDistributionAnalysisRightDTO> getProjectCountByGrid(ProjectDistributionAnalysisFormDTO formDTO) {
List<ProjectDistributionAnalysisRightDTO> result = baseDao.getProjectCountByGrid(formDTO.getOrgId(), formDTO.getStartDate(), formDTO.getEndDate());
if (CollectionUtils.isEmpty(result)){
return new ArrayList<>();
}
return result;
}
}

76
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml

@ -577,4 +577,80 @@
AND ISSUE_STATUS = 'closed'
AND RESOLVE_TYPE = 'unresolved'
</select>
<!-- 查询表决前50名 -->
<select id="selectIssueLimit50" resultType="com.epmet.dto.result.ResiBuzzDTO">
SELECT
i.ID AS issueId,
i.ISSUE_TITLE,
i.SUGGESTION,
i.CREATED_BY,
(CASE WHEN i.ISSUE_STATUS = 'shift_project' THEN '已转项目'
WHEN i.ISSUE_STATUS = 'voting' THEN '表决中'
WHEN i.ISSUE_STATUS = 'closed' THEN '已关闭'
ELSE '表决中' END ) AS `status`,
i.CREATED_TIME,
s.SUPPORT_COUNT,
s.OPPOSITION_COUNT,
CONCAT(s.SUPPORT_COUNT + s.OPPOSITION_COUNT,'/',s.VOTABLE_COUNT) AS voteAccount
FROM issue i
LEFT JOIN issue_vote_statistical s ON (s.ISSUE_ID = i.ID AND s.DEL_FLAG = '0')
WHERE i.DEL_FLAG = '0'
<if test='status != "all" '>
AND i.ISSUE_STATUS = #{status}
</if>
<if test='orgType == "grid" '>
AND i.GRID_ID = #{orgId}
</if>
<if test='orgType == "agency" '>
AND i.ORG_ID_PATH LIKE CONCAT('%',#{orgId})
</if>
ORDER BY (s.SUPPORT_COUNT + s.OPPOSITION_COUNT) DESC,i.created_time DESC
</select>
<!-- 查询客户下1级分类的长度 -->
<select id="selectOneLevelCategoryLength" resultType="java.lang.Integer">
SELECT LENGTH(CATEGORY_CODE) FROM issue_project_category_dict
WHERE DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND IS_DISABLE = 'enable'
AND CATEGORY_TYPE = '1'
LIMIT 1
</select>
<!-- 查询居民热议左侧饼图 -->
<select id="resiBuzzLeftPieChart" resultType="com.epmet.dto.result.ResiBuzzLeftPieChartResultDTO">
SELECT COUNT(issueId) AS count,categoryCode,categoryName FROM
(SELECT
i.ID AS issueId,
IFNULL(LEFT(ic.CATEGORY_CODE,#{length}),'') AS categoryCode,
IFNULL(cd.CATEGORY_NAME,'其他') AS categoryName
FROM issue i
LEFT JOIN issue_vote_statistical s ON (s.ISSUE_ID = i.ID AND s.DEL_FLAG = '0')
LEFT JOIN issue_category ic ON (ic.ISSUE_ID = i.ID AND ic.DEL_FLAG = '0' AND ic.CUSTOMER_ID = i.CUSTOMER_ID)
LEFT JOIN issue_project_category_dict cd ON (cd.CATEGORY_CODE = ic.CATEGORY_CODE AND cd.DEL_FLAG = '0' AND cd.CUSTOMER_ID = ic.CUSTOMER_ID)
WHERE i.DEL_FLAG = '0'
<if test='orgType == "grid" '>
AND i.GRID_ID = #{orgId}
</if>
<if test='orgType == "agency" '>
AND i.ORG_ID_PATH LIKE CONCAT('%',#{orgId})
</if>
ORDER BY (s.SUPPORT_COUNT + s.OPPOSITION_COUNT) DESC,i.created_time DESC LIMIT 50)temp
GROUP BY categoryCode
</select>
<!-- 查询组织下每个网格的项目数 -->
<select id="getProjectCountByGrid" resultType="com.epmet.dto.result.ProjectDistributionAnalysisRightDTO">
SELECT
GRID_ID,
COUNT(ID) AS count
FROM issue
WHERE DEL_FLAG = '0'
AND ISSUE_STATUS = 'shift_project'
AND ORG_ID = #{orgId}
AND DATE_FORMAT(SHIFTED_TIME,'%Y-%m-%d') >= #{startDate}
AND DATE_FORMAT(SHIFTED_TIME,'%Y-%m-%d') <![CDATA[ <= ]]> #{endDate}
GROUP BY GRID_ID
</select>
</mapper>

2
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDistributionAnalysisRightDTO.java

@ -1,6 +1,7 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@ -23,6 +24,7 @@ public class ProjectDistributionAnalysisRightDTO implements Serializable {
/**
* 组织类型组织agency网格grid
*/
@JsonIgnore
private String orgType;
/**

8
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDistributionAnalysisRightResultDTO.java

@ -3,6 +3,7 @@ package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
@ -30,4 +31,11 @@ public class ProjectDistributionAnalysisRightResultDTO implements Serializable {
private String above;
private List<ProjectDistributionAnalysisRightDTO> list;
public ProjectDistributionAnalysisRightResultDTO() {
this.under = "";
this.middle = "";
this.above = "";
this.list = new ArrayList<>();
}
}

2
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java

@ -197,4 +197,6 @@ public interface ProjectConstant {
String ORG_TYPE_GRID = "grid";
String ORG_LEVEL_COMMUNITY = "community";
}

22
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

@ -29,7 +29,9 @@ import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
@ -2900,7 +2902,25 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
*/
@Override
public ProjectDistributionAnalysisRightResultDTO projectDistributionAnalysisRight(ProjectDistributionAnalysisFormDTO formDTO, TokenDto tokenDto) {
return null;
if (StringUtils.isBlank(formDTO.getOrgId())){
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == staffInfo){
throw new EpmetException("未查询到此工作人员的所属组织信息...");
}
formDTO.setOrgId(staffInfo.getAgencyId());
}
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getOrgId());
if (null == agencyInfo){
throw new EpmetException(String.format("未查询到此组织信息{%s}",formDTO.getOrgId()));
}
ProjectDistributionAnalysisRightResultDTO result = new ProjectDistributionAnalysisRightResultDTO();
List<ProjectDistributionAnalysisRightDTO> orgList = new ArrayList<>();
if (!agencyInfo.getLevel().equals(ProjectConstant.ORG_LEVEL_COMMUNITY)){
}else {
}
return result;
}
/**

15
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HouseUserDTO.java

@ -0,0 +1,15 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 家属
*/
@Data
public class HouseUserDTO implements Serializable {
private static final long serialVersionUID = -5307147522738642535L;
private String icResiUserId;
private String icUserName;
}

19
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcResiUserBriefDTO.java

@ -0,0 +1,19 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 案件居民家属列表
* 只有名称这些简要信息
*/
@Data
public class IcResiUserBriefDTO extends HouseUserDTO implements Serializable {
private String houseId;
/**
* 同屋的其他人
*/
private List<HouseUserDTO> houseUserList;
}

3
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -669,4 +669,7 @@ public interface EpmetUserOpenFeignClient {
*/
@PostMapping(value = "/epmetuser/user/findepmetuser")
Result<ResiUserResDTO> findEpmetUser(@RequestBody ResiUserFormDTO formDTO);
@GetMapping("/epmetuser/icresiuser/findfamilymem/{icResiUserId}")
Result<IcResiUserBriefDTO> findFamilyMem(@PathVariable("icResiUserId") String icResiUserId);
}

5
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -490,4 +490,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
public Result<ResiUserResDTO> findEpmetUser(ResiUserFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "findEpmetUser", formDTO);
}
@Override
public Result<IcResiUserBriefDTO> findFamilyMem(String icResiUserId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "findFamilyMem", icResiUserId);
}
}

13
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java

@ -206,6 +206,19 @@ public class IcResiUserController {
return new Result<List<HomeUserResultDTO>>().ok(icResiUserService.getPeopleByRoom(formDTO.getHomeId()));
}
/**
* 根据ic_resi_user找家属
* @param icResiUserId
* @return
*/
@GetMapping("findfamilymem/{icResiUserId}")
public Result<IcResiUserBriefDTO> findFamilyMem(@PathVariable("icResiUserId") String icResiUserId){
if(StringUtils.isNotBlank(icResiUserId)){
return new Result<IcResiUserBriefDTO>().ok(icResiUserService.findFamilyMem(icResiUserId));
}
return new Result<>();
}
@PostMapping("listresi")
public Result<PageData<Map<String, Object>>> queryListResi1(@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO) {
//pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");

21
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -20,10 +20,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.form.ResiUserQueryValueDTO;
import com.epmet.dto.result.DemandUserResDTO;
import com.epmet.dto.result.IcFormResColumnDTO;
import com.epmet.dto.result.PersonDataResultDTO;
import com.epmet.dto.result.SearchByNameResultDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.IcResiUserEntity;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
@ -166,4 +163,20 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
IcResiUserDTO selectIdByIdCard(@Param("customerId") String customerId,
@Param("idNum")String idNum,
@Param("icResiUserId")String icResiUserId);
/**
* 获取居民名称家属名称和id
* @param isResiUserId
* @return
*/
IcResiUserBriefDTO selectIcResuUser(@Param("isResiUserId") String isResiUserId);
/**
* 除了本人以外住在这个房子的人
*
* @param currentIcResiUserId
* @param homeId
* @return
*/
List<HouseUserDTO> selectListFamilyMember(@Param("currentIcResiUserId") String currentIcResiUserId, @Param("homeId") String homeId);
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java

@ -151,4 +151,6 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
* @return
*/
IcResiUserDTO getByIdCard(String customerId, String idNum,String icResiUserId);
IcResiUserBriefDTO findFamilyMem(String icResiUserId);
}

5
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -878,4 +878,9 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
return baseDao.selectIdByIdCard(customerId,idNum,icResiUserId);
}
@Override
public IcResiUserBriefDTO findFamilyMem(String icResiUserId) {
return baseDao.selectIcResuUser(icResiUserId);
}
}

37
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -324,4 +324,41 @@
and ir.id=#{icResiUserId}
</if>
</select>
<resultMap id="IcResiUserBriefDTOMap" type="com.epmet.dto.result.IcResiUserBriefDTO">
<id property="icResiUserId" column="ID" ></id>
<result property="houseId" column="HOME_ID"/>
<result property="icUserName" column="NAME"/>
<collection property="houseUserList" ofType="com.epmet.dto.result.HouseUserDTO"
column="{currentIcResiUserId=ID,homeId=HOME_ID}" select="com.epmet.dao.IcResiUserDao.selectListFamilyMember">
</collection>
</resultMap>
<!-- 查询当前居民的姓名,和房屋id -->
<select id="selectIcResuUser" parameterType="map" resultMap="IcResiUserBriefDTOMap">
SELECT
m.ID,
m.HOME_ID,
m.`NAME`
FROM
ic_resi_user m
WHERE
m.DEL_FLAG = '0'
AND m.id = #{isResiUserId}
</select>
<!-- 除了本人以外,住在这个房子的人 -->
<select id="selectListFamilyMember" parameterType="map" resultType="com.epmet.dto.result.HouseUserDTO">
SELECT
m.ID,
m.`NAME`
FROM
ic_resi_user m
WHERE
m.DEL_FLAG = '0'
AND m.id != #{isResiUserId}
and m.HOME_ID=#{homeId}
order by m.CREATED_TIME asc
</select>
</mapper>

Loading…
Cancel
Save