Browse Source

Merge branch 'develop' of http://git.elinkit.com.cn:7070/r/epmet-cloud into release_temp

master
jianjun 4 years ago
parent
commit
6c41acc9bc
  1. 6
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java
  2. 7
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java
  3. 18
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionDataResultDTO.java
  4. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java
  5. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  6. 6
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridsInfoListResultDTO.java
  7. 45
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ResiEventDTO.java
  8. 5
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/CategoryProjectFormDTO.java
  9. 5
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectAnalysisFormDTO.java
  10. 26
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/CategoryProjectResultDTO.java
  11. 65
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectAnalysisResultDTO.java
  12. 33
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryResultDTO.java
  13. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryTotalResultDTO.java
  14. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectMonthIncrResultDTO.java
  15. 10
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectStatusListResultDTO.java
  16. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java
  17. 49
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java
  18. 6
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserBaseInfoDao.java
  19. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java
  20. 42
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java
  21. 493
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java
  22. 20
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java
  23. 32
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  24. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java
  25. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java
  26. 196
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java
  27. 39
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml
  28. 11
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml
  29. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml
  30. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml
  31. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml
  32. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml
  33. 123
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml
  34. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicDao.xml
  35. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java
  36. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java
  37. 19
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandOptionFormDTO.java
  38. 34
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java
  39. 52
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java
  40. 16
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ActivityStatisticsDTO.java
  41. 20
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitDistributionResultDTO.java
  42. 52
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecExcelResultDTO.java
  43. 29
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandResearchAnalysisResultDTO.java
  44. 21
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java
  45. 29
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java
  46. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java
  47. 52
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
  48. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivityDao.java
  49. 20
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java
  50. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java
  51. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
  52. 19
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java
  53. 21
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java
  54. 1
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java
  55. 17
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
  56. 86
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
  57. 48
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  58. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java
  59. 139
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  60. 18
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml
  61. 28
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml
  62. 17
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml
  63. 69
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
  64. 36
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ResiBuzzFormDTO.java
  65. 26
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ResiBuzzLeftPieChartFormDTO.java
  66. 9
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/CategoryListResultDTO.java
  67. 91
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzDTO.java
  68. 44
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzLeftPieChartResultDTO.java
  69. 28
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzResultDTO.java
  70. 18
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java
  71. 17
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java
  72. 38
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java
  73. 37
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java
  74. 27
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java
  75. 94
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
  76. 88
      epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.15__add_colour.sql
  77. 77
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml
  78. 3
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml
  79. 9
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  80. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  81. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java
  82. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  83. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterMatterDao.java
  84. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java
  85. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterMatterService.java
  86. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  87. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterMatterServiceImpl.java
  88. 40
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
  89. 10
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  90. 9
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterMatterDao.xml
  91. 50
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventResearchAnalysisFormDTO.java
  92. 44
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TopicResearchAnalysisFormDTO.java
  93. 11
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/HouseUserDTO.java
  94. 16
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDataDTO.java
  95. 2
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDistributionAnalysisRightDTO.java
  96. 8
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDistributionAnalysisRightResultDTO.java
  97. 23
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectInfoIcData.java
  98. 30
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResiEventResearchAnalysisResDTO.java
  99. 23
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/TopicResearchAnalysisResDTO.java
  100. 2
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java

6
epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java

@ -1,6 +1,8 @@
package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.form.DictListFormDTO;
import com.epmet.commons.tools.dto.result.DictListResultDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.result.CorsConfigResultDTO;
@ -8,6 +10,7 @@ import com.epmet.feign.fallback.EpmetAdminOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
import java.util.Map;
@ -84,4 +87,7 @@ public interface EpmetAdminOpenFeignClient {
*/
@PostMapping("/sys/dict/data/dictmap/{dictType}")
Result<Map<String, String>> dictMap(@PathVariable("dictType") String dictType);
@PostMapping("/sys/dict/data/dictlist")
Result<List<DictListResultDTO>> dictList(@RequestBody DictListFormDTO formDTO);
}

7
epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java

@ -1,6 +1,8 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.form.DictListFormDTO;
import com.epmet.commons.tools.dto.result.DictListResultDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
@ -46,4 +48,9 @@ public class EpmetAdminOpenFeignClientFallback implements EpmetAdminOpenFeignCli
public Result<Map<String, String>> dictMap(String dictType) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictMap", dictType);
}
@Override
public Result<List<DictListResultDTO>> dictList(DictListFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictList", formDTO);
}
}

18
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionDataResultDTO.java

@ -0,0 +1,18 @@
package com.epmet.commons.tools.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/12/8 14:50
*/
@Data
public class OptionDataResultDTO implements Serializable {
private static final long serialVersionUID = 416877704759019210L;
private String label;
private String value;
private String code;
}

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java

@ -18,4 +18,5 @@ public class OptionResultDTO implements Serializable {
private String pValue;
private String sysDictDataId;
private List<OptionResultDTO> children;
private Boolean usableFlag;
}

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -163,6 +163,7 @@ public enum EpmetErrorCode {
EXISTS_SAME_PHONE_ERROR(8529, "%s存在重复"),
COMMUNITY_SELF_ORGANIZATION_LIST_REPART_ERROR(8530, "%s社区自组织名称已存在"),
MATTER_NAME_EXISTS_APPOINTMENT_ERROR(8532, "存在重复预约事项"),
// 该错误不会提示给前端,只是后端传输错误信息用。
ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"),

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 {
}

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

@ -18,9 +18,6 @@ import java.util.List;
@Data
public class ProjectAnalysisFormDTO implements Serializable {
private static final long serialVersionUID = -8515172319313536407L;
//日期yyyymmdd
@NotBlank(message = "日维度ID不能为空", groups = {Analysis.class})
private String dateId;
//小程序话题或事件发起人Id
@NotBlank(message = "话题或事件发起人Id不能为空", groups = {Analysis.class})
private String userId;
@ -28,6 +25,8 @@ public class ProjectAnalysisFormDTO implements Serializable {
@NotNull(message = "分类Code集合不能为空", groups = {Analysis.class})
private List<String> categoryCodeList;
private String customerId;
public interface Analysis extends CustomerClientShowGroup {
}

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

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

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

@ -3,6 +3,8 @@ package com.epmet.dataaggre.dto.govproject.result;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Description 赋能平台项目处理分析研判分析-接口返参
@ -12,23 +14,50 @@ import java.io.Serializable;
public class ProjectAnalysisResultDTO implements Serializable {
private static final long serialVersionUID = 6188316867855643263L;
//组织Id
private String agencyId;
//日期yyyymmdd
private String dateId;
//项目总数
private Integer projectTotal = 0;
//较昨日数
private Integer dateIncr = 0;
//较上月数
private Integer monthIncr = 0;
//未结案项目数
private Integer pendingTotal = 0;
//为结案项目占比 xx%
private String pendingRatio = "0%";
//已结案项目数
private Integer closedTotal = 0;
//已结案项目占比
private String closedRatio = "0%";
//小程序居民Id
private String userId;
//负能平台居民Id
private String icUserId;
//负能平台居民名称
private String icUserName;
//家庭里人员集合
private List<Home> homeUserList = new ArrayList<>();
//楼院小组下分类项目列表
private List<Category> groupProjectList = new ArrayList<>();
//事件上报下分类项目列表
private List<Category> eventProjectList = new ArrayList<>();
@Data
public static class Home {
//家庭Id
private String homeId;
//居民Id
private String icUserId;
//居民姓名
private String icUserName;
}
@Data
public static class Category {
//一级分类Id
private String categoryCode;
//一级分类名称
private String categoryName;
//分类下项目列表【创建时间倒序】
private List<Project> projectList = new ArrayList<>();
}
@Data
public static class Project {
//项目Id
private String projectId;
//项目标题
private String title;
//状态:待处理 pending,结案closed
private String status;
}
}

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

@ -0,0 +1,33 @@
package com.epmet.dataaggre.dto.govproject.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author sun
* @dscription
*/
@NoArgsConstructor
@Data
public class ProjectCategoryResultDTO implements Serializable {
private static final long serialVersionUID = 3217246702883400582L;
/**
* 项目ID
*/
private String projectId;
/**
* 项目标题
*/
private String title;
/**
* 项目状态
*/
private String status;
/**
* 二级分类Code
*/
private String categoryCode;
}

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

@ -18,6 +18,8 @@ public class ProjectCategoryTotalResultDTO implements Serializable {
private String categoryCode;
//一级分类名称
private String categoryName;
//一级分类颜色
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;

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

@ -17,12 +17,14 @@ 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;
}

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));
}

49
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java

@ -0,0 +1,49 @@
/**
* 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.dao.epmetuser;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govproject.result.ProjectAnalysisResultDTO;
import com.epmet.dataaggre.entity.epmetuser.IcResiUserEntity;
import com.epmet.dto.IcResiUserDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 用户基础信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-26
*/
@Mapper
public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
/**
* @Description 根据身份证号查询负能平台用户信息
* @author sun
*/
IcResiUserDTO getIcResiUser(@Param("idCard") String idCard, @Param("customerId") String customerId);
/**
* @Description 查询人员的家庭成员数据
* @author sun
*/
List<ProjectAnalysisResultDTO.Home> getHomeUserList(@Param("homeId") String homeId, @Param("icUserId") String icUserId);
}

6
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserBaseInfoDao.java

@ -20,6 +20,7 @@ package com.epmet.dataaggre.dao.epmetuser;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.epmetuser.result.UserInfosResultDTO;
import com.epmet.dataaggre.entity.epmetuser.UserBaseInfoEntity;
import com.epmet.dto.UserBaseInfoDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -50,4 +51,9 @@ public interface UserBaseInfoDao extends BaseDao<UserBaseInfoEntity> {
*/
List<String> selectUserIdByCustomerId(@Param("userIds") List<String> userIds);
/**
* @Description 查询userId的身份证号在小程序用户中存在的多个userId值
* @author sun
*/
List<UserBaseInfoDTO> getUserBaseList(@Param("userId") String userId);
}

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);
}

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

@ -18,15 +18,16 @@
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 com.epmet.dto.ProjectCategoryDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -81,4 +82,37 @@ 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);
/**
* @Description 根据项目来源查询不同分类不同创建人下的分类项目
* @author sun
*/
List<ProjectCategoryResultDTO> getProjectCategoryList(@Param("customerId") String customerId,
@Param("secondCodeList") List<String> secondCodeList,
@Param("userIds") List<String> userIds,
@Param("origin") String origin);
}

493
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java

@ -0,0 +1,493 @@
/**
* 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.entity.epmetuser;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 用户基础信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-26
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_resi_user")
public class IcResiUserEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id customer.id
*/
private String customerId;
/**
*
*/
private String agencyId;
/**
*
*/
private String pids;
/**
* 网格ID
*/
private String gridId;
/**
* 所属小区ID
*/
private String villageId;
/**
* 所属楼宇Id
*/
private String buildId;
/**
* 单元id
*/
private String unitId;
/**
* 所属家庭Id
*/
private String homeId;
/**
* 是否本地户籍
*/
private String isBdhj;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 性别
*/
private String gender;
/**
* 身份证号
*/
private String idCard;
/**
* 出生日期
*/
private String birthday;
/**
* 备注
*/
private String remarks;
/**
* 联系人
*/
private String contacts;
/**
* 联系人电话
*/
private String contactsMobile;
/**
* 九小场所url
*/
private String ninePlace;
/**
* 是否党员
*/
private String isParty;
/**
* 是否低保户
*/
private String isDbh;
/**
* 是否保障房
*/
private String isEnsureHouse;
/**
* 是否失业
*/
private String isUnemployed;
/**
* 是否育龄妇女
*/
private String isYlfn;
/**
* 是否退役军人
*/
private String isVeterans;
/**
* 是否统战人员
*/
private String isUnitedFront;
/**
* 是否信访人员
*/
private String isXfry;
/**
* 是否志愿者
*/
private String isVolunteer;
/**
* 是否老年人
*/
private String isOldPeople;
/**
* 是否空巢
*/
private String isKc;
/**
* 是否失独
*/
private String isSd;
/**
* 是否失能
*/
private String isSn;
/**
* 是否失智
*/
private String isSz;
/**
* 是否残疾
*/
private String isCj;
/**
* 是否大病
*/
private String isDb;
/**
* 是否慢病
*/
private String isMb;
/**
* 是否特殊人群
*/
private String isSpecial;
/**
* 文化程度字典表
*/
private String culture;
/**
* 文化程度备注
*/
private String cultureRemakes;
/**
* 特长字典表
*/
private String specialSkill;
/**
* 兴趣爱好
*/
private String hobby;
/**
* 兴趣爱好备注
*/
private String hobbyRemakes;
/**
* 宗教信仰
*/
private String faith;
/**
* 宗教信仰备注
*/
private String faithRemakes;
/**
* 残疾类别字典表
*/
private String cjlb;
/**
* 残疾登记(状况)字典表
*/
private String cjzk;
/**
* 残疾证号
*/
private String cjzh;
/**
* 残疾说明
*/
private String cjsm;
/**
* 有无监护人yes no
*/
private String ynJdr;
/**
* 有无技能特长yes no
*/
private String ynJntc;
/**
* 有无劳动能力
*/
private String ynLdnl;
/**
* 有无非义务教育阶段助学yes no
*/
private String ynFywjyjdzx;
/**
* 所患大病
*/
private String shdb;
/**
* 患大病时间
*/
private String dbsj;
/**
* 所患慢性病
*/
private String shmxb;
/**
* 患慢性病时间
*/
private String mxbsj;
/**
* 是否参保
*/
private String isCb;
/**
* 自付金额
*/
private String zfje;
/**
* 救助金额
*/
private String jzje;
/**
* 救助时间[yyyy-MM-dd]
*/
private String jzsj;
/**
* 享受救助明细序号
*/
private String jzmxxh;
/**
* 健康信息备注
*/
private String healthRemakes;
/**
* 工作单位
*/
private String gzdw;
/**
* 职业
*/
private String zy;
/**
* 离退休时间
*/
private String ltxsj;
/**
* 工作信息备注
*/
private String workRemake;
/**
* 退休金额
*/
private String txje;
/**
* 月收入
*/
private String ysr;
/**
* 籍贯
*/
private String jg;
/**
* 户籍所在地
*/
private String hjszd;
/**
* 现居住地
*/
private String xjzd;
/**
* 人户情况
*/
private String rhzk;
/**
* 居住信息备注
*/
private String jzxxRemakes;
/**
* 民族字典表
*/
private String mz;
/**
* 与户主关系字典表
*/
private String yhzgx;
/**
* 居住情况字典表
*/
private String jzqk;
/**
* 婚姻状况字典表
*/
private String hyzk;
/**
* 配偶情况字典表
*/
private String poqk;
/**
* 有无赡养人
*/
private String ynSyr;
/**
* 与赡养人关系字典表
*/
private String ysyrgx;
/**
* 赡养人电话
*/
private String syrMobile;
/**
* 家庭信息备注
*/
private String jtxxRemakes;
/**
* 预留字段1
*/
private String field1;
/**
* 预留字段2
*/
private String field2;
/**
* 预留字段3
*/
private String field3;
/**
* 预留字段4
*/
private String field4;
/**
* 预留字段5
*/
private String field5;
/**
* 预留字段6
*/
private String field6;
/**
* 预留字段7
*/
private String field7;
/**
* 预留字段8
*/
private String field8;
/**
* 预留字段9
*/
private String field9;
/**
* 预留字段10
*/
private String field10;
}

20
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java

@ -5,6 +5,9 @@ import com.epmet.dataaggre.dto.epmetuser.result.*;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectAnalysisResultDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.UserBaseInfoDTO;
import java.util.List;
@ -147,4 +150,21 @@ public interface EpmetUserService {
*/
StaffDetailV2FormDTO selectByStaffId(String staffId);
/**
* @Description 查询userId的身份证号在小程序用户中存在的多个userId值
* @author sun
*/
List<UserBaseInfoDTO> getUserBaseList(String userId);
/**
* @Description 根据身份证号查询负能平台用户信息
* @author sun
*/
IcResiUserDTO getIcResiUser(String idNum, String customerId);
/**
* @Description 查询人员的家庭成员数据
* @author sun
*/
List<ProjectAnalysisResultDTO.Home> getHomeUserList(String homeId, String icUserId);
}

32
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -26,6 +26,7 @@ import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffOrgNameResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffOrgRelationResultDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectAnalysisResultDTO;
import com.epmet.dataaggre.entity.epmetuser.CustomerStaffEntity;
import com.epmet.dataaggre.entity.epmetuser.GovStaffRoleEntity;
import com.epmet.dataaggre.entity.epmetuser.ResiUserBadgeEntity;
@ -36,6 +37,8 @@ import com.epmet.dataaggre.service.epmetuser.StaffPatrolDetailService;
import com.epmet.dataaggre.service.epmetuser.StaffPatrolRecordService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.epmet.dataaggre.service.govproject.GovProjectService;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.UserBaseInfoDTO;
import com.epmet.dto.result.StaffRoleResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
@ -79,6 +82,8 @@ public class EpmetUserServiceImpl implements EpmetUserService {
private DataStatsService dataStatsService;
@Resource
private GovStaffRoleDao govStaffRoleDao;
@Resource
private IcResiUserDao icResiUserDao;
/**
* @Description 根据UserIds查询
@ -702,5 +707,32 @@ public class EpmetUserServiceImpl implements EpmetUserService {
return result;
}
/**
* @Description 查询userId的身份证号在小程序用户中存在的多个userId值
* @author sun
*/
@Override
public List<UserBaseInfoDTO> getUserBaseList(String userId) {
return userBaseInfoDao.getUserBaseList(userId);
}
/**
* @Description 根据身份证号查询负能平台用户信息
* @author sun
*/
@Override
public IcResiUserDTO getIcResiUser(String idNum, String customerId) {
return icResiUserDao.getIcResiUser(idNum, customerId);
}
/**
* @Description 查询人员的家庭成员数据
* @author sun
*/
@Override
public List<ProjectAnalysisResultDTO.Home> getHomeUserList(String homeId, String icUserId) {
return icResiUserDao.getHomeUserList(homeId, icUserId);
}
}

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);
}
}

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

@ -15,19 +15,27 @@ 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;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService;
import com.epmet.dataaggre.service.govissue.GovIssueService;
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.UserBaseInfoDTO;
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;
@ -60,6 +68,8 @@ public class GovProjectServiceImpl implements GovProjectService {
private DataStatsService dataStatsService;
@Autowired
private EvaluationIndexService evaluationIndexService;
@Autowired
private EpmetUserService epmetUserService;
/**
* @Description 查询项目信息
@ -281,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());
@ -330,7 +343,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,24 +357,39 @@ 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);
//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());
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;
}
@ -372,7 +400,75 @@ 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().filter(ca -> ca.getParentCategoryCode().equals(formDTO.getCategoryCode())).map(m -> m.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());
}
});
//项目涉及分类信息【一个项目涉及多个一级分类】
//一级分类Id
List<String> caId = new ArrayList<>();
list.forEach(ca -> {
if (ca.getProjectId().equals(re.getProjectId())) {
caId.add(ca.getCategoryPids());
}
});
//一级分类名称、code集合
List<String> caName = new ArrayList<>();
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())) {
re.setUserId(ev.getReportUserId());
}
});
topicUser.forEach(to -> {
if (re.getProjectId().equals(to.getProjectId())) {
re.setUserId(to.getUserId());
}
});
});
resultDTO.setList(result.getList());
return resultDTO;
}
/**
@ -381,7 +477,89 @@ public class GovProjectServiceImpl implements GovProjectService {
*/
@Override
public ProjectAnalysisResultDTO projectAnalysis(ProjectAnalysisFormDTO formDTO) {
return null;
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());
//2.查询对应负能平台用户家庭信息
if (!org.springframework.util.CollectionUtils.isEmpty(userList)) {
//2-1.根据身份证号查询负能平台用户信息
IcResiUserDTO icResiUserDTO = epmetUserService.getIcResiUser(userList.get(0).getIdNum(), formDTO.getCustomerId());
resultDTO.setIcUserId(icResiUserDTO.getId());
resultDTO.setIcUserName(icResiUserDTO.getName());
if (null != icResiUserDTO) {
//2-2.查询人员的家庭成员数据
List<ProjectAnalysisResultDTO.Home> homeList = epmetUserService.getHomeUserList(icResiUserDTO.getHomeId(), icResiUserDTO.getId());
resultDTO.setHomeUserList(homeList);
}
}
if (org.springframework.util.CollectionUtils.isEmpty(userIds)) {
userIds = new ArrayList<>();
userIds.add(formDTO.getUserId());
}
//3.查询一级分类数据
List<IssueProjectCategoryDictDTO> categoryList = govIssueService.categoryList(formDTO.getCustomerId(), null, null);
List<String> secondCodeList = formDTO.getCategoryCodeList().stream().flatMap(code -> categoryList.stream().filter(ca -> code.equals(ca.getParentCategoryCode())).map(second -> {
return second.getCategoryCode();
})).collect(Collectors.toList());
//4.根据userId集合和二级分类Code集合查询来源楼院小组的项目
List<ProjectCategoryResultDTO> groupList = projectDao.getProjectCategoryList(formDTO.getCustomerId(), secondCodeList, userIds, "issue");
//5.根据userId集合和二级分类Code集合查询来源事件上报的项目
List<ProjectCategoryResultDTO> eventList = projectDao.getProjectCategoryList(formDTO.getCustomerId(), secondCodeList, userIds, "resiEvent");
//6.封装数据
//楼院小组下分类项目列表
List<ProjectAnalysisResultDTO.Category> groupProjectList = new ArrayList<>();
//事件上报下分类项目列表
List<ProjectAnalysisResultDTO.Category> eventProjectList = new ArrayList<>();
formDTO.getCategoryCodeList().forEach(code -> {
//一级分类code下的二级分类code集合
Map<String, String> secondCodeMap = new HashMap<>();
//来源楼院小组的分类及项目列表
ProjectAnalysisResultDTO.Category groupCa = new ProjectAnalysisResultDTO.Category();
List<ProjectAnalysisResultDTO.Project> groupPrList = new ArrayList<>();
//来源事件上报的分类及项目列表
ProjectAnalysisResultDTO.Category eventCa = new ProjectAnalysisResultDTO.Category();
List<ProjectAnalysisResultDTO.Project> eventPrList = new ArrayList<>();
categoryList.forEach(ca -> {
groupCa.setCategoryCode(code);
eventCa.setCategoryCode(code);
if (code.equals(ca.getCategoryCode())) {
groupCa.setCategoryName(ca.getCategoryName());
eventCa.setCategoryName(ca.getCategoryName());
}
if (code.equals(ca.getParentCategoryCode())) {
secondCodeMap.put(ca.getCategoryCode(), ca.getCategoryCode());
}
});
//当前分类下来源楼院小组的项目
groupList.forEach(gr -> {
if (secondCodeMap.containsKey(gr.getCategoryCode())) {
ProjectAnalysisResultDTO.Project project = ConvertUtils.sourceToTarget(gr, ProjectAnalysisResultDTO.Project.class);
groupPrList.add(project);
}
});
groupCa.setProjectList(groupPrList);
groupProjectList.add(groupCa);
//当前分类下来源事件上报的项目
eventList.forEach(gr -> {
if (secondCodeMap.containsKey(gr.getCategoryCode())) {
ProjectAnalysisResultDTO.Project project = ConvertUtils.sourceToTarget(gr, ProjectAnalysisResultDTO.Project.class);
eventPrList.add(project);
}
});
eventCa.setProjectList(eventPrList);
eventProjectList.add(eventCa);
});
resultDTO.setGroupProjectList(groupProjectList);
resultDTO.setEventProjectList(eventProjectList);
return resultDTO;
}
/**

39
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dataaggre.dao.epmetuser.IcResiUserDao">
<select id="getIcResiUser" resultType="com.epmet.dto.IcResiUserDTO">
SELECT
id,
customer_id,
agency_id,
grid_id,
home_id,
name,
mobile,
gender,
id_card,
birthday
FROM
ic_resi_user
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND id_card = #{idCard}
</select>
<select id="getHomeUserList" resultType="com.epmet.dataaggre.dto.govproject.result.ProjectAnalysisResultDTO$Home">
SELECT
id icUserId,
home_id homeId,
name icUserName
FROM
ic_resi_user
WHERE
del_flag = '0'
AND home_id = #{homeId}
ORDER BY id = #{icUserId} desc <!-- 指定某个人排在第一位 -->
</select>
</mapper>

11
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml

@ -38,4 +38,15 @@
</foreach>
)
</select>
<select id="getUserBaseList" resultType="com.epmet.dto.UserBaseInfoDTO">
SELECT
*
FROM
user_base_info
WHERE
del_flag = '0'
AND id_num = ( SELECT id_num FROM user_base_info WHERE user_id = #{userId})
</select>
</mapper>

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>

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

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

@ -158,22 +158,92 @@
<select id="getProjectStatusList" resultType="com.epmet.dataaggre.dto.govproject.result.ProjectStatusListResultDTO">
SELECT
agency_id "agencyId",
id "projectId",
origin "origin",
`status` "status",
locate_longitude "longitude",
locate_dimension dimension
agency_id agencyId,
id projectId,
origin origin,
`status` status,
locate_longitude longitude,
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,
IFNULL(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,
substring_index(category_pids, ',', 1) 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,
@ -186,4 +256,41 @@
p.ORIGIN_ID = #{issueId}
</foreach>
</select>
<select id="getProjectCategoryList" resultType="com.epmet.dataaggre.dto.govproject.result.ProjectCategoryResultDTO">
SELECT
p.id projectId,
p.title title,
p.`status` status,
pc.category_code categoryCode
FROM
project p
INNER JOIN project_category pc ON p.id = pc.project_id
<if test="origin != null and origin != '' and origin == 'issue'">
INNER JOIN project_related_personnel prp ON p.id = prp.project_id AND prp.source_type = 'topic'
</if>
<if test="origin != null and origin != '' and origin == 'resiEvent'">
INNER JOIN resi_event re ON p.ID = re.PROJECT_ID
</if>
WHERE
p.del_flag = '0'
AND p.customer_id = #{customerId}
AND p.origin = #{origin}
<foreach collection="secondCodeList" item="code" open="AND pc.category_code IN (" separator="," close=")">
#{code}
</foreach>
<if test="origin != null and origin != '' and origin == 'issue'">
<foreach collection="userIds" item="userId" open="AND prp.user_id IN (" separator="," close=")">
#{userId}
</foreach>
</if>
<if test="origin != null and origin != '' and origin == 'resiEvent'">
<foreach collection="userIds" item="userId" open="AND re.report_user_id IN (" separator="," close=")">
#{userId}
</foreach>
</if>
GROUP BY pc.project_id
ORDER BY p.created_time DESC
</select>
</mapper>

3
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
@ -39,5 +39,6 @@
<foreach item="epmetUserId" collection="epmetUserIdList" open="AND (" separator="or" close=")" index="">
rt.CREATED_BY = #{epmetUserId}
</foreach>
order by rt.CREATED_TIME desc
</select>
</mapper>

4
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java

@ -69,7 +69,7 @@ public class IcPartyActivityDTO implements Serializable {
*/
@NotBlank(message = "服务事项不能为空",groups = AddGroup.class)
private String serviceMatter;
private String serviceMatterName;
/**
* 活动标题
*/
@ -97,7 +97,7 @@ public class IcPartyActivityDTO implements Serializable {
* 活动时间
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern="yyyy-MM-dd HH:mm")
private Date activityTime;
/**

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyActivityFormDTO.java

@ -4,6 +4,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
@ -16,6 +17,7 @@ import java.util.Date;
@Data
public class PartyActivityFormDTO implements Serializable {
private static final long serialVersionUID = -2510068555703677L;
@NotBlank(message = "组织Id不能为空" )
private String agencyId;
private String unitId;
private String title;

19
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandOptionFormDTO.java

@ -0,0 +1,19 @@
package com.epmet.dto.form.demand;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@Data
public class DemandOptionFormDTO implements Serializable {
private static final long serialVersionUID = -5335277881919236426L;
public interface AddUserInternalGroup {
}
@NotBlank(message = "token获取客户id不能为空", groups = AddUserInternalGroup.class)
private String customerId;
@NotBlank(message = "查询条件和查看居民详情:query;新增或修改居民信息:addorupdate", groups = AddUserInternalGroup.class)
private String purpose;
}

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 icResiUserId;
private List<String> epmetUserIdList;
@NotBlank(message = "tokenDto中的customerId不能为空",groups = AddUserInternalGroup.class)
private String customerId;
}

52
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java

@ -0,0 +1,52 @@
package com.epmet.dto.form.demand;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* 数据分析-服务措施分析-分页查询接口入参
*/
@Data
public class PageListAnalysisFormDTO implements Serializable {
private static final long serialVersionUID = 4993949289966075260L;
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
@NotNull(message = "页码不能为空", groups = AddUserInternalGroup.class)
private Integer pageNo;
@NotNull(message = "每页数量不能为空", groups = AddUserInternalGroup.class)
private Integer pageSize;
@NotBlank(message = "先选择组织或网格", groups = AddUserShowGroup.class)
private String orgId;
@NotBlank(message = "组织或网格的上级", groups = AddUserShowGroup.class)
private String pid;
@NotBlank(message = "orgType=grid或者agency,不能为空", groups = AddUserInternalGroup.class)
private String orgType;
@NotBlank(message = "分类编码不能为空", groups = AddUserInternalGroup.class)
private String categoryCode;
@NotBlank(message = "上报时间起始日期不能为空,格式yyyyMMdd", groups = AddUserInternalGroup.class)
private String startDateId;
@NotBlank(message = "上报时间截止日期不能为空,格式yyyyMMdd", groups = AddUserInternalGroup.class)
private String endDateId;
@NotBlank(message = "tokenDto中的customerId不能为空",groups = AddUserInternalGroup.class)
private String customerId;
/**
* orgType=agency时pid拼接上orgId
*/
private String gridPids;
private Boolean pageFlag;
}

16
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ActivityStatisticsDTO.java

@ -0,0 +1,16 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/12/9 16:05
*/
@Data
public class ActivityStatisticsDTO implements Serializable {
private String unitCount;
private String activityCount;
}

20
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitDistributionResultDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/12/9 10:05
*/
@Data
public class PartyUnitDistributionResultDTO implements Serializable {
private static final long serialVersionUID = -4066938451623510159L;
private String id;
private String name;
private String type;
private String longitude;
private String latitude;
}

52
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecExcelResultDTO.java

@ -0,0 +1,52 @@
package com.epmet.dto.result.demand;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class DemandRecExcelResultDTO implements Serializable {
private static final long serialVersionUID = -1110606022410166621L;
@Excel(name = "状态", width = 15)
private String statusName;
@Excel(name = "所属网格", width = 40)
private String gridName;
@Excel(name = "需求类型", width = 40)
private String categoryName;
@Excel(name = "需求内容", width = 40)
private String content;
@Excel(name = "上报类型", width = 40)
private String reportTypeName;
@Excel(name = "上报人", width = 20)
private String reportUserName;
@Excel(name = "上报时间", width = 25,format ="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date reportTime;
@Excel(name = "需求人", width = 20)
private String demandUserName;
/**
* 尹作梅(志愿者)
* XXX(社会组织)
* XXX(社区自组织)
* XXX(区域化党建单位)
*/
@Excel(name = "服务方", width = 15)
private String serviceShowName;
@Excel(name = "服务时间", width = 25,format ="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date wantServiceTime;
}

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;
}

21
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java

@ -29,6 +29,7 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcPartyActivityDTO;
import com.epmet.dto.form.PartyActivityFormDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.excel.IcPartyActivityExcel;
import com.epmet.service.IcPartyActivityService;
import org.apache.commons.collections4.CollectionUtils;
@ -117,4 +118,24 @@ public class IcPartyActivityController {
public Result importData(@LoginUser TokenDto tokenDto, HttpServletResponse response, @RequestPart("file") MultipartFile file) throws IOException {
return icPartyActivityService.importData(tokenDto, response, file);
}
/**
* @Description 联建活动分类统计
* @Param formDTO
* @Return {@link Result< List< OptionDTO>>}
* @Author zhaoqifeng
* @Date 2021/12/9 16:20
*/
@PostMapping("statistics")
public Result<List<OptionDTO>> statistics(@RequestBody PartyActivityFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return new Result<List<OptionDTO>>().ok(icPartyActivityService.statistics(formDTO));
}
@PostMapping("activitylist")
public Result<PageData<IcPartyActivityDTO>> activityList(@LoginUser TokenDto tokenDto, @RequestBody PartyActivityFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO);
PageData<IcPartyActivityDTO> page = icPartyActivityService.getActivityList(tokenDto, formDTO);
return new Result<PageData<IcPartyActivityDTO>>().ok(page);
}
}

29
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java

@ -19,6 +19,7 @@ package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
@ -28,8 +29,10 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.PartyActivityFormDTO;
import com.epmet.dto.form.PartyUnitFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.PartyUnitDistributionResultDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.excel.IcPartyUnitExcel;
import com.epmet.service.IcPartyUnitService;
@ -150,4 +153,30 @@ public class IcPartyUnitController {
public Result importData(@LoginUser TokenDto tokenDto, HttpServletResponse response, @RequestPart("file") MultipartFile file) throws IOException {
return icPartyUnitService.importData(tokenDto, response, file);
}
/**
* @Description 按类型统计单位数量
* @Param dto
* @Return {@link Result< List< OptionDataResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/12/8 14:52
*/
@PostMapping("typestatistics")
public Result<List<OptionDataResultDTO>> typeStatistics(@RequestBody PartyActivityFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO);
return new Result<List<OptionDataResultDTO>>().ok(icPartyUnitService.typeStatistics(formDTO));
}
/**
* @Description 联建单位分布
* @Param formDTO
* @Return {@link Result< List< PartyUnitDistributionResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/12/9 10:11
*/
@PostMapping("distribution")
public Result<List<PartyUnitDistributionResultDTO>> distribution(@RequestBody PartyActivityFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO);
return new Result<List<PartyUnitDistributionResultDTO>>().ok(icPartyUnitService.distribution(formDTO));
}
}

13
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java

@ -132,6 +132,19 @@ public class IcResiDemandDictController {
return new Result<List<OptionResultDTO>>().ok(icResiDemandDictService.getDemandOptions(tokenDto.getCustomerId()));
}
/**
* 服务措施管理界面
*
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("option-service")
public Result<List<OptionResultDTO>> getDemandOptionsV2(@LoginUser TokenDto tokenDto,@RequestBody DemandOptionFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,DemandOptionFormDTO.AddUserInternalGroup.class);
return new Result<List<OptionResultDTO>>().ok(icResiDemandDictService.getDemandOptionsV2(formDTO));
}
/**
* 居民信息列表需要展示分类名称单独开出来这个接口供user查询

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

@ -20,21 +20,22 @@ package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
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.IcResiUserReportDemandRes;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.demand.*;
import com.epmet.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@ -210,7 +211,50 @@ 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));
}
/**
* 数分析-服务措施分析-分页查询
*
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("pagelist-analysis")
public Result<PageData<DemandRecResultDTO>> pageListAnalysis(@LoginUser TokenDto tokenDto,@RequestBody PageListAnalysisFormDTO formDTO){
formDTO.setPageFlag(true);
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,PageListAnalysisFormDTO.AddUserShowGroup.class,PageListAnalysisFormDTO.AddUserInternalGroup.class);
return new Result<PageData<DemandRecResultDTO>>().ok(icUserDemandRecService.pageListAnalysis(formDTO));
}
/**
* 数据分析-服务措施分析-导出
* @param response
* @param tokenDto
* @param formDTO
* @throws Exception
*/
@PostMapping("analysis-export")
public Result analysisExport(HttpServletResponse response,@LoginUser TokenDto tokenDto, @RequestBody PageListAnalysisFormDTO formDTO)throws Exception {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setPageFlag(false);
PageData<DemandRecResultDTO> res=icUserDemandRecService.pageListAnalysis(formDTO);
if (!CollectionUtils.isEmpty(res.getList())) {
ExcelUtils.exportExcelToTarget(response, null, res.getList(), DemandRecExcelResultDTO.class);
return new Result();
}
return new Result();
}
}

11
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivityDao.java

@ -18,6 +18,8 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.PartyActivityFormDTO;
import com.epmet.dto.result.ActivityStatisticsDTO;
import com.epmet.entity.IcPartyActivityEntity;
import org.apache.ibatis.annotations.Mapper;
@ -29,5 +31,14 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface IcPartyActivityDao extends BaseDao<IcPartyActivityEntity> {
/**
* @Description 联建活动统计
* @Param formDTO
* @Return {@link ActivityStatisticsDTO}
* @Author zhaoqifeng
* @Date 2021/12/9 16:06
*/
ActivityStatisticsDTO getStatistics(PartyActivityFormDTO formDTO);
}

20
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java

@ -18,6 +18,8 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
import com.epmet.dto.result.PartyUnitDistributionResultDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcPartyUnitEntity;
import org.apache.ibatis.annotations.Mapper;
@ -43,4 +45,22 @@ public interface IcPartyUnitDao extends BaseDao<IcPartyUnitEntity> {
List<OptionDTO> selectListByAgencyId(@Param("agencyIds") List<String> agencyIds,
@Param("unitName") String unitName,
@Param("customerId")String customerId);
/**
* 单位分类统计
* @Param agencyId
* @Return {@link java.util.List<com.epmet.commons.tools.dto.result.OptionDataResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/8 15:25
*/
List<OptionDataResultDTO> getTypeStatistics(@Param("agencyId")String agencyId);
/**
* @Description 联建单位分布
* @Param agencyId
* @Return {@link List< PartyUnitDistributionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/9 14:24
*/
List<PartyUnitDistributionResultDTO> getDistribution(@Param("agencyId")String agencyId);
}

4
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java

@ -36,8 +36,8 @@ import java.util.Set;
*/
@Mapper
public interface IcResiDemandDictDao extends BaseDao<IcResiDemandDictEntity> {
List<OptionResultDTO> selectDemandOptions(@Param("customerId") String customerId);
List<OptionResultDTO> selectChildDemands(@Param("customerId")String customerId, @Param("parentCode") String parentCode);
List<OptionResultDTO> selectDemandOptions(@Param("customerId") String customerId,@Param("usableFlagFormValue") String usableFlagFormValue);
List<OptionResultDTO> selectChildDemands(@Param("customerId")String customerId, @Param("parentCode") String parentCode,@Param("usableFlagFormValue") String usableFlagFormValue);
String selectCategoryNames(@Param("customerId") String customerId,@Param("codeSet") Set<String> codeSet);

9
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java

@ -19,6 +19,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.demand.IcResiUserDemandFromDTO;
import com.epmet.dto.form.demand.PageListAnalysisFormDTO;
import com.epmet.dto.form.demand.UserDemandPageFormDTO;
import com.epmet.dto.result.demand.DemandRecResultDTO;
import com.epmet.dto.result.demand.IcResiUserReportDemandRes;
@ -56,4 +57,12 @@ public interface IcUserDemandRecDao extends BaseDao<IcUserDemandRecEntity> {
* @return
*/
DemandRecResultDTO selectDemandRecDetail(@Param("customerId") String customerId, @Param("demandRecId") String demandRecId);
/**
* 数分析-服务措施分析-分页查询
*
* @param formDTO
* @return
*/
List<DemandRecResultDTO> pageListAnalysis(PageListAnalysisFormDTO formDTO);
}

19
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java

@ -23,6 +23,7 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcPartyActivityDTO;
import com.epmet.dto.form.PartyActivityFormDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcPartyActivityEntity;
import org.springframework.web.multipart.MultipartFile;
@ -98,4 +99,22 @@ public interface IcPartyActivityService extends BaseService<IcPartyActivityEntit
* @Date 2021/11/29 11:01
*/
Result importData(TokenDto tokenDto, HttpServletResponse response, MultipartFile file) throws IOException;
/**
* 联建活动统计
* @Param formDTO
* @Return {@link List< OptionDTO>}
* @Author zhaoqifeng
* @Date 2021/12/9 14:55
*/
List<OptionDTO> statistics(PartyActivityFormDTO formDTO);
/**
* 联建活动统计列表
* @Param formDTO
* @Return {@link PageData< IcPartyActivityDTO>}
* @Author zhaoqifeng
* @Date 2021/12/9 16:24
*/
PageData<IcPartyActivityDTO> getActivityList(TokenDto tokenDto, PartyActivityFormDTO formDTO);
}

21
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java

@ -18,12 +18,15 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.PartyActivityFormDTO;
import com.epmet.dto.form.PartyUnitFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.PartyUnitDistributionResultDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcPartyUnitEntity;
import org.springframework.web.multipart.MultipartFile;
@ -120,4 +123,22 @@ public interface IcPartyUnitService extends BaseService<IcPartyUnitEntity> {
* @Date 2021/11/29 11:01
*/
Result importData(TokenDto tokenDto, HttpServletResponse response, MultipartFile file) throws IOException;
/**
* @Description 按类型统计单位数量
* @Param formDTO
* @Return {@link List< OptionDataResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/8 14:56
*/
List<OptionDataResultDTO> typeStatistics(PartyActivityFormDTO formDTO);
/**
* 联建单位分布
* @Param formDTO
* @Return {@link List< PartyUnitDistributionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/9 10:10
*/
List<PartyUnitDistributionResultDTO> distribution(PartyActivityFormDTO formDTO);
}

1
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java

@ -86,6 +86,7 @@ public interface IcResiDemandDictService extends BaseService<IcResiDemandDictEnt
*/
List<OptionResultDTO> getDemandOptions(String customerId);
List<OptionResultDTO> getDemandOptionsV2(DemandOptionFormDTO formDTO);
/**
* 居民信息列表需要展示分类名称单独开出来这个接口供user查询
* @param formDTO

17
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,20 @@ public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntit
* @return
*/
DemandRecResultDTO queryDemandDetail(DemandDetailFormDTO formDTO);
/**
* 数据分析-个人档案-需求详情研判分析
*
* @param formDTO
* @return
*/
DemandResearchAnalysisResultDTO queryDemandResearchAnalysis(DemandResearchAnalysisFormDTO formDTO);
/**
* 数分析-服务措施分析-分页查询
*
* @param formDTO
* @return
*/
PageData<DemandRecResultDTO> pageListAnalysis(PageListAnalysisFormDTO formDTO);
}

86
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java

@ -36,6 +36,7 @@ import com.epmet.dto.IcPartyActivityDTO;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.PartyActivityFormDTO;
import com.epmet.dto.form.demand.SubCodeFormDTO;
import com.epmet.dto.result.ActivityStatisticsDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcPartyActivityEntity;
import com.epmet.excel.IcPartyActivityImportExcel;
@ -149,7 +150,13 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
@Override
public IcPartyActivityDTO get(String id) {
IcPartyActivityEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcPartyActivityDTO.class);
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(entity.getCustomerId());
codeFormDTO.setParentCategoryCode("1010");
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
IcPartyActivityDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyActivityDTO.class);
dto.setServiceMatterName(categoryMap.get(dto.getServiceMatter()));
return dto;
}
@Override
@ -287,4 +294,81 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
return new Result().ok(str);
}
/**
* 联建活动统计
*
* @param formDTO
* @Param formDTO
* @Return {@link List< OptionDTO>}
* @Author zhaoqifeng
* @Date 2021/12/9 14:55
*/
@Override
public List<OptionDTO> statistics(PartyActivityFormDTO formDTO) {
List<OptionDTO> list = new ArrayList<>();
if (null == formDTO.getStartTime() && null == formDTO.getEndTime()) {
setDate(formDTO);
}
ActivityStatisticsDTO dto = baseDao.getStatistics(formDTO);
OptionDTO unit = new OptionDTO();
unit.setLabel("组织单位");
unit.setValue(dto.getUnitCount());
list.add(unit);
OptionDTO activity = new OptionDTO();
activity.setLabel("组织活动");
activity.setValue(dto.getActivityCount());
list.add(activity);
return list;
}
/**
* 联建活动统计列表
*
* @param formDTO
* @Param formDTO
* @Return {@link PageData< IcPartyActivityDTO>}
* @Author zhaoqifeng
* @Date 2021/12/9 16:24
*/
@Override
public PageData<IcPartyActivityDTO> getActivityList(TokenDto tokenDto, PartyActivityFormDTO formDTO) {
if (null == formDTO.getStartTime() && null == formDTO.getEndTime()) {
setDate(formDTO);
}
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
LambdaQueryWrapper<IcPartyActivityEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcPartyActivityEntity::getAgencyId, formDTO.getAgencyId());
wrapper.eq(StringUtils.isNotBlank(formDTO.getServiceMatter()), IcPartyActivityEntity::getServiceMatter, formDTO.getServiceMatter());
wrapper.ge(null != formDTO.getStartTime(),IcPartyActivityEntity::getActivityTime, formDTO.getStartTime());
wrapper.le(null != formDTO.getEndTime(), IcPartyActivityEntity::getActivityTime, formDTO.getEndTime());
wrapper.orderByDesc(IcPartyActivityEntity::getActivityTime);
List<IcPartyActivityEntity> list = baseDao.selectList(wrapper);
List<IcPartyActivityDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartyActivityDTO.class);
IcPartyUnitDTO unitDTO = new IcPartyUnitDTO();
unitDTO.setAgencyId(formDTO.getAgencyId());
if (CollectionUtils.isNotEmpty(dtoList)) {
Map<String, String> option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(tokenDto.getCustomerId());
codeFormDTO.setParentCategoryCode("1010");
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
dtoList.forEach(dto -> {
dto.setServiceMatterName(categoryMap.get(dto.getServiceMatter()));
dto.setUnitName(option.get(dto.getUnitId()));
});
}
PageInfo<IcPartyActivityDTO> pageInfo = new PageInfo<>(dtoList);
return new PageData<>(dtoList, pageInfo.getTotal());
}
private void setDate(PartyActivityFormDTO formDTO) {
String start = DateUtils.getBeforeNDay(30);
formDTO.setEndTime(DateUtils.parse(start.concat("000000"), DateUtils.DATE_TIME_NO_SPLIT));
String end = DateUtils.format(new Date(), DateUtils.DATE_PATTERN);
formDTO.setEndTime(DateUtils.parse(end.concat(" 23:59:59"), DateUtils.DATE_TIME_PATTERN));
}
}

48
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java

@ -24,7 +24,10 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.form.DictListFormDTO;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.dto.result.DictListResultDTO;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
import com.epmet.commons.tools.enums.DictTypeEnum;
import com.epmet.commons.tools.enums.PartyUnitTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -37,9 +40,11 @@ import com.epmet.commons.tools.utils.ExcelPoiUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcPartyUnitDao;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.PartyActivityFormDTO;
import com.epmet.dto.form.PartyUnitFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.form.demand.SubCodeFormDTO;
import com.epmet.dto.result.PartyUnitDistributionResultDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcPartyUnitEntity;
import com.epmet.excel.IcPartyUnitImportExcel;
@ -370,6 +375,49 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
return new Result().ok(str);
}
/**
* @param formDTO
* @Description 按类型统计单位数量
* @Param formDTO
* @Return {@link List<OptionDataResultDTO>}
* @Author zhaoqifeng
* @Date 2021/12/8 14:56
*/
@Override
public List<OptionDataResultDTO> typeStatistics(PartyActivityFormDTO formDTO) {
DictListFormDTO dictFromDTO = new DictListFormDTO();
dictFromDTO.setDictType(DictTypeEnum.PARTY_UNIT_TYPE.getCode());
Result<List<DictListResultDTO>> dictResult = epmetAdminOpenFeignClient.dictList(dictFromDTO);
if (!dictResult.success()) {
throw new EpmetException(dictResult.getCode());
}
List<OptionDataResultDTO> list = baseDao.getTypeStatistics(formDTO.getAgencyId());
Map<String, String> map = list.stream().collect(Collectors.toMap(OptionDataResultDTO::getCode, OptionDataResultDTO::getValue));
return dictResult.getData().stream().map(item -> {
OptionDataResultDTO dto = new OptionDataResultDTO();
dto.setLabel(item.getLabel());
dto.setCode(item.getValue());
dto.setValue(null == map.get(item.getValue())?NumConstant.ZERO_STR:map.get(item.getValue()));
return dto;
}).collect(Collectors.toList());
}
/**
* 联建单位分布
*
* @param formDTO
* @Param formDTO
* @Return {@link List<PartyUnitDistributionResultDTO >}
* @Author zhaoqifeng
* @Date 2021/12/9 10:10
*/
@Override
public List<PartyUnitDistributionResultDTO> distribution(PartyActivityFormDTO formDTO) {
return baseDao.getDistribution(formDTO.getAgencyId());
}
private String getServiceMatter(Map<String, String> map, String matter) {
List<String> matters = Arrays.asList(matter.split(StrConstant.COLON));
List<String> list = matters.stream().map(map::get).collect(Collectors.toList());

13
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java

@ -182,7 +182,18 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
*/
@Override
public List<OptionResultDTO> getDemandOptions(String customerId) {
return baseDao.selectDemandOptions(customerId);
return baseDao.selectDemandOptions(customerId,null);
}
@Override
public List<OptionResultDTO> getDemandOptionsV2(DemandOptionFormDTO formDTO) {
if ("addorupdate".equals(formDTO.getPurpose())) {
//只查询可用的
return baseDao.selectDemandOptions(formDTO.getCustomerId(), "1");
}
//查询全部
return baseDao.selectDemandOptions(formDTO.getCustomerId(), null);
}
@Override

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

@ -37,13 +37,16 @@ import com.epmet.dao.IcUserDemandOperateLogDao;
import com.epmet.dao.IcUserDemandRecDao;
import com.epmet.dao.IcUserDemandSatisfactionDao;
import com.epmet.dao.IcUserDemandServiceDao;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerGridDTO;
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,8 +557,144 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
}
/**
* 数据分析-个人档案-需求详情研判分析
*
* @param formDTO
* @return
*/
@Override
public DemandResearchAnalysisResultDTO queryDemandResearchAnalysis(DemandResearchAnalysisFormDTO formDTO) {
//获取案件居民和及家属列表
Result<IcResiUserBriefDTO> userRes = epmetUserOpenFeignClient.findFamilyMem(formDTO.getIcResiUserId());
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.getIcResiUserId());
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;
}
/**
* 数分析-服务措施分析-分页查询
*
* @param formDTO
* @return
*/
@Override
public PageData<DemandRecResultDTO> pageListAnalysis(PageListAnalysisFormDTO formDTO) {
if("agency".equals(formDTO.getOrgType())){
if(NumConstant.ZERO_STR.equals(formDTO.getPid())){
//当前传入的组织id=客户的根组织
formDTO.setGridPids(formDTO.getOrgId());
}else{
//找到当前组织的所有上级,再拼接上自己
Result<CustomerAgencyDTO> customerAgencyDTOResult=govOrgOpenFeignClient.getAgencyById(formDTO.getOrgId());
if(!customerAgencyDTOResult.success()||null==customerAgencyDTOResult.getData()){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取组织信息异常govOrgOpenFeignClient.getAgencyById");
}
formDTO.setGridPids(customerAgencyDTOResult.getData().getPids().concat(StrConstant.COLON).concat(formDTO.getOrgId()));
}
}
long total=NumConstant.ZERO;
List<DemandRecResultDTO> list=new ArrayList<>();
if(formDTO.getPageFlag()){
PageInfo<DemandRecResultDTO> pageInfo= PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.pageListAnalysis(formDTO));
list=pageInfo.getList();
total=pageInfo.getTotal();
}else{
list=baseDao.pageListAnalysis(formDTO);
}
if(CollectionUtils.isNotEmpty(list)){
//1、查询网格信息
List<String> gridIds=list.stream().map(DemandRecResultDTO::getGridId).collect(Collectors.toList());
Result<List<AllGridsByUserIdResultDTO>> gridInfoRes=govOrgOpenFeignClient.getGridListByGridIds(gridIds);
List<AllGridsByUserIdResultDTO> gridInfoList = gridInfoRes.success() && !CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>();
Map<String, AllGridsByUserIdResultDTO> gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, Function.identity()));
//2、查询分类名称
List<String> categoryCodes=list.stream().map(DemandRecResultDTO::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));
//3、查询志愿者
// 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
Map<String,String> userInfoMap=new HashMap<>();
List<String> userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(userIdList)){
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList);
if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){
throw new RenException("查询志愿者信息异常");
}
userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName));
}
//查询字典表
Result<Map<String, String>> reportTypeRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_REPORT_TYPE.getCode());
Map<String,String> reportTypeMap=reportTypeRes.success()&& MapUtils.isNotEmpty(reportTypeRes.getData())?reportTypeRes.getData():new HashMap<>();
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<>();
Result<Map<String, String>> serviceTypeRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_SERVICE_TYPE.getCode());
Map<String,String> serviceTypeMap=serviceTypeRes.success()&& MapUtils.isNotEmpty(serviceTypeRes.getData())?serviceTypeRes.getData():new HashMap<>();
for(DemandRecResultDTO res:list){
if (null != gridInfoMap && gridInfoMap.containsKey(res.getGridId())) {
res.setGridName(gridInfoMap.get(res.getGridId()).getGridName());
}
if (null != dictMap && dictMap.containsKey(res.getCategoryCode())) {
res.setCategoryName(dictMap.get(res.getCategoryCode()));
}
res.setFirstCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(), res.getFirstCategoryCode()));
if (null != userInfoMap && userInfoMap.containsKey(res.getServerId())) {
res.setServiceName(userInfoMap.get(res.getServerId()));
}
//社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help
res.setReportTypeName(reportTypeMap.containsKey(res.getReportType())?reportTypeMap.get(res.getReportType()):StrConstant.EPMETY_STR);
//待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished
res.setStatusName(statusMap.containsKey(res.getStatus())?statusMap.get(res.getStatus()):StrConstant.EPMETY_STR);
//服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
res.setServiceShowName(serviceTypeMap.containsKey(res.getServiceType())?res.getServiceName().concat("(").concat(serviceTypeMap.get(res.getServiceType())).concat(")"):StrConstant.EPMETY_STR);
}
}
return new PageData<>(list, total);
}

18
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml

@ -26,6 +26,24 @@
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="getStatistics" resultType="com.epmet.dto.result.ActivityStatisticsDTO" parameterType="com.epmet.dto.form.PartyActivityFormDTO">
SELECT
count( ID ) AS "activityCount",
COUNT( DISTINCT UNIT_ID ) AS "unitCount"
FROM
ic_party_activity
WHERE DEL_FLAG = '0'
AND (AGENCY_ID = #{agencyId} OR PIDS LIKE concat( '%', #{agencyId}, '%' ))
<if test='null != serviceMatter'>
AND SERVICE_MATTER = #{serviceMatter}
</if>
<if test='null != startTime'>
AND ACTIVITY_TIME &gt;= #{startTime}
</if>
<if test='null != endTime'>
AND ACTIVITY_TIME &lt;= #{endTime}
</if>
</select>
</mapper>

28
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml

@ -46,4 +46,32 @@
</foreach>
</select>
<select id="getTypeStatistics" resultType="com.epmet.commons.tools.dto.result.OptionDataResultDTO">
SELECT
TYPE AS "code",
COUNT( ID ) AS "value"
FROM
ic_party_unit
WHERE
DEL_FLAG = '0'
AND (AGENCY_ID = #{agencyId} OR PIDS LIKE concat( '%', #{agencyId}, '%' ))
GROUP BY
TYPE
</select>
<select id="getDistribution" resultType="com.epmet.dto.result.PartyUnitDistributionResultDTO">
SELECT
ID,
UNIT_NAME AS "name",
TYPE,
LONGITUDE,
LATITUDE
FROM
ic_party_unit
WHERE
DEL_FLAG = '0'
AND (AGENCY_ID = #{agencyId} OR PIDS LIKE concat( '%', #{agencyId}, '%' ))
ORDER BY
ID
</select>
</mapper>

17
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml

@ -24,8 +24,9 @@
<result column="value" property="value"/>
<result column="label" property="label"/>
<result column="PARENT_CODE" property="pValue"/>
<result column="usableFlag" property="usableFlag"/>
<collection property="children" ofType="com.epmet.commons.tools.dto.result.OptionResultDTO"
select="selectChildDemands" column="customerId=customerId,parentCode=value">
select="selectChildDemands" column="customerId=customerId,parentCode=value,usableFlagFormValue=usable_flag_form_value">
</collection>
</resultMap>
<select id="selectDemandOptions" resultMap="DemandResult">
@ -33,13 +34,18 @@
CUSTOMER_ID AS customerId,
CATEGORY_CODE AS "value",
CATEGORY_NAME AS "label",
PARENT_CODE as pValue
PARENT_CODE as pValue,
#{usableFlagFormValue} as usable_flag_form_value,
USABLE_FLAG as usableFlag
FROM
ic_resi_demand_dict
WHERE
DEL_FLAG = 0
AND LEVEL = 1
AND CUSTOMER_ID = #{customerId}
<if test="null !=usableFlagFormValue and usableFlagFormValue!='' ">
and USABLE_FLAG=#{usableFlagFormValue}
</if>
ORDER BY
SORT ASC
</select>
@ -48,7 +54,9 @@
CUSTOMER_ID AS customerId,
CATEGORY_CODE AS "value",
CATEGORY_NAME AS "label",
PARENT_CODE as pValue
PARENT_CODE as pValue,
#{usableFlagFormValue} as usable_flag_form_value,
USABLE_FLAG as usableFlag
FROM
ic_resi_demand_dict
WHERE
@ -56,6 +64,9 @@
AND LEVEL = 2
AND CUSTOMER_ID = #{customerId}
AND PARENT_CODE = #{parentCode}
<if test="null !=usableFlagFormValue and usableFlagFormValue!='' ">
and USABLE_FLAG=#{usableFlagFormValue}
</if>
ORDER BY
SORT ASC
</select>

69
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

@ -192,4 +192,73 @@
AND r.CUSTOMER_ID = #{customerId}
and r.id=#{demandRecId}
</select>
<!-- 列表查询 -->
<select id="pageListAnalysis" parameterType="com.epmet.dto.form.demand.PageListAnalysisFormDTO" resultType="com.epmet.dto.result.demand.DemandRecResultDTO">
SELECT
r.ID as demandRecId,
r.GRID_ID as gridId,
r.agency_id as agencyId,
r.CATEGORY_CODE as categoryCode,
r.PARENT_CODE as parentCode,
r.CONTENT,
r.REPORT_TYPE as reportType,
r.REPORT_TIME as reportTime,
r.REPORT_USER_NAME as reportUserName,
r.REPORT_USER_MOBILE as reportUserMobile,
r.`STATUS` as status,
r.DEMAND_USER_ID as demandUserId,
r.DEMAND_USER_NAME as demandUserName,
r.DEMAND_USER_MOBILE as demandUserMobile,
concat(r.DEMAND_USER_NAME,'(',r.DEMAND_USER_MOBILE,')') as demandUser,
r.WANT_SERVICE_TIME as wantServiceTime,
IFNULL(r.FINISH_RESULT,'') as finishResult,
r.CANCEL_TIME as cancelTime,
r.EVALUATE_FLAG as evaluateFlag,
IFNULL(sa.SCORE,0) as score,
IFNULL( s.SERVICE_TYPE, '' ) AS serviceType,
IFNULL( s.SERVER_ID, '' ) AS serverId,
(
CASE WHEN s.SERVICE_TYPE='social_org' then (select m1.SOCIETY_NAME as socialOrgName from ic_society_org m1 where m1.id=s.SERVER_ID)
WHEN s.SERVICE_TYPE='community_org' then (select m2.ORGANIZATION_NAME as communityName from ic_community_self_organization m2 where m2.id=s.SERVER_ID)
WHEN s.SERVICE_TYPE='party_unit' then (select m3.UNIT_NAME as partyUnitName from ic_party_unit m3 where m3.id=s.SERVER_ID)
else ''
end
) as serviceName,
s.SERVICE_START_TIME as serviceStartTime,
s.SERVICE_END_TIME as serviceEndTime,
IFNULL(s.FINISH_DESC,'') as finishDesc,
'' AS serviceShowName,
s.id as serviceId,
(
case when r.PARENT_CODE !='0' then r.PARENT_CODE
ELSE R.CATEGORY_CODE
END
) as firstCategoryCode
FROM
ic_user_demand_rec r
left JOIN ic_user_demand_service s ON ( r.id = s.DEMAND_REC_ID AND s.DEL_FLAG = '0' )
left join ic_user_demand_satisfaction sa on(r.id=sa.DEMAND_REC_ID AND sa.DEL_FLAG = '0')
WHERE
r.DEL_FLAG = '0'
AND r.CUSTOMER_ID = #{customerId}
<if test="null != orgType and orgType == 'grid' ">
and r.GRID_ID=#{orgId}
</if>
<if test="null != orgType and orgType == 'agency' ">
AND r.GRID_PIDS LIKE concat(#{gridPids},'%')
</if>
<if test="null != categoryCode and categoryCode !='' ">
and r.CATEGORY_CODE LIKE CONCAT(#{categoryCode},'%')
</if>
<if test=" null != startDateId and startDateId != '' ">
AND DATE_FORMAT(r.REPORT_TIME,'%Y%m%d') <![CDATA[ >= ]]> #{startDateId}
</if>
<if test="null != endDateId and endDateId != '' ">
AND DATE_FORMAT(r.REPORT_TIME,'%Y%m%d') <![CDATA[ <= ]]> #{endDateId}
</if>
order by r.WANT_SERVICE_TIME desc,r.REPORT_TIME asc
</select>
</mapper>

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;
}

9
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/CategoryListResultDTO.java

@ -27,6 +27,14 @@ public class CategoryListResultDTO implements Serializable {
private Integer count;
/**
* 颜色
*/
private String colour;
/**
* 1级分类长度
*/
private Integer codeLength;
public CategoryListResultDTO() {
@ -34,5 +42,6 @@ public class CategoryListResultDTO implements Serializable {
this.categoryName = "";
this.count = NumConstant.ZERO;
this.codeLength = NumConstant.ZERO;
this.colour = "";
}
}

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 = "其他";
}
}

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

@ -0,0 +1,44 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
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;
public ResiBuzzLeftPieChartResultDTO() {
this.count = NumConstant.ZERO;
this.categoryCode = "";
this.categoryName = "";
this.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<>();
}
}

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

@ -10,7 +10,6 @@ import com.epmet.dto.IssueSuggestionDTO;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.fallback.GovIssueOpenFeignClientFallBack;
import com.epmet.feign.fallback.GovIssueOpenFeignClientFallBackFactory;
import com.epmet.project.dto.CustomerCategoryDTO;
import com.epmet.project.dto.result.ProjectCategoryDictResultDTO;
@ -356,4 +355,21 @@ 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);
/**
* @param formDTO
* @return
* @Description 批量查询分类信息
* @Author yinzuomei
**/
@PostMapping(value = "/gov/issue/issueprojectcategorydict/getcategorylist")
public Result<List<IssueProjectCategoryDictDTO>> getCategoryList(@RequestBody IssueProjectCategoryDictListFormDTO formDTO);
}

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

@ -23,7 +23,6 @@ import com.epmet.resi.group.dto.group.result.ApplicationListResultDTO;
import com.epmet.resi.group.dto.group.result.*;
import com.epmet.resi.mine.dto.from.MyShiftIssueTopicsFormDTO;
import com.epmet.resi.mine.dto.result.MyShiftIssueTopicsResultDTO;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
@ -290,4 +289,20 @@ 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);
}
/**
* @param formDTO
* @return
* @Description 批量查询分类信息
* @Author yinzuomei
**/
@Override
public Result<List<IssueProjectCategoryDictDTO>> getCategoryList(IssueProjectCategoryDictListFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getCategoryList", 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,@Param("customerId")String customerId);
/**
* @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, tokenDto.getCustomerId());
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;
}
}

88
epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.15__add_colour.sql

@ -0,0 +1,88 @@
alter table issue_project_category_dict add column `COLOUR` VARCHAR(20) COMMENT '颜色' AFTER `SORT`;
UPDATE issue_project_category_dict
SET colour = '#ffba00'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '市场监管';
UPDATE issue_project_category_dict
SET colour = '#ffd074'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '卫生计生监督执法';
UPDATE issue_project_category_dict
SET colour = '#42cd05'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '建设管理';
UPDATE issue_project_category_dict
SET colour = '#16d783'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '文化执法';
UPDATE issue_project_category_dict
SET colour = '#00e5ed'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '民政';
UPDATE issue_project_category_dict
SET colour = '#0091ed'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '其他';
UPDATE issue_project_category_dict
SET colour = '#1b51ff'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '城市管理';
UPDATE issue_project_category_dict
SET colour = '#1641cc'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '公安交通管理';
UPDATE issue_project_category_dict
SET colour = '#2a00ff'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '消防安全';
UPDATE issue_project_category_dict
SET colour = '#7800ff'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '创卫复审类';
UPDATE issue_project_category_dict
SET colour = '#c600ff'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '环境保护';
UPDATE issue_project_category_dict
SET colour = '#ff00d2'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '安全监管';
UPDATE issue_project_category_dict
SET colour = '#ff2a00'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '社会治安综治';
UPDATE issue_project_category_dict
SET colour = '#ff7800'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '食品药品监管';

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

@ -577,4 +577,81 @@
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,colour FROM
(SELECT
i.ID AS issueId,
IFNULL(LEFT(ic.CATEGORY_CODE,#{length}),'') AS categoryCode,
IFNULL(cd.CATEGORY_NAME,'其他') AS categoryName,
IFNULL(cd.colour,'#0091ed') AS colour
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 = LEFT(ic.CATEGORY_CODE,#{length}) 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>

3
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml

@ -250,7 +250,8 @@
SELECT
CATEGORY_CODE,
CATEGORY_NAME,
LENGTH(CATEGORY_CODE) AS codeLength
LENGTH(CATEGORY_CODE) AS codeLength,
IFNULL(colour,'') AS colour
FROM issue_project_category_dict
WHERE DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}

9
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -531,4 +531,13 @@ public interface GovOrgOpenFeignClient {
@GetMapping("/gov/org/customergrid/getGridIListByAgency/{agencyId}")
Result<List<CustomerGridDTO>> getGridIListByAgency(@PathVariable("agencyId") String agencyId);
/**
* @Description 查询下级agencyId
* @param orgId
* @author zxc
* @date 2021/12/9 4:42 下午
*/
@PostMapping("/gov/org/agency/getsonagencyid")
Result<List<String>> getSonAgencyId(@RequestParam("orgId")String orgId);
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -334,6 +334,11 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridIListByAgency", agencyId);
}
@Override
public Result<List<String>> getSonAgencyId(String orgId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getSonAgencyId", orgId);
}
@Override
public Result<String> selectPidsByGridId(String gridId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectPidsByGridId", gridId);

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java

@ -349,4 +349,15 @@ public class AgencyController {
return new Result<List<BaseInfoFamilyBuildingResultDTO>>().ok(agencyService.baseInfoFamilyBuilding(formDTO));
}
/**
* @Description 查询下级agencyId
* @param orgId
* @author zxc
* @date 2021/12/9 4:42 下午
*/
@PostMapping("getsonagencyid")
public Result<List<String>> getSonAgencyId(@RequestParam("orgId")String orgId){
return new Result<List<String>>().ok(agencyService.getSonAgencyId(orgId));
}
}

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -275,10 +275,12 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
List<MapSonOrgResultDTO> selectSonOrg(@Param("pid")String pid,@Param("type")String type);
/**
* desc获取组织网格树 含直属网格
* @param agencyId
* @return
* @Description 查询下级agencyId
* @param orgId
* @author zxc
* @date 2021/12/9 4:42 下午
*/
AgencyTreeResultDTO getAgencyGridTree(String agencyId);
List<String> getSonAgencyId(@Param("orgId") String orgId);
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterMatterDao.java

@ -22,6 +22,8 @@ import com.epmet.entity.IcPartyServiceCenterMatterEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 党群服务中心可预约事项表
*
@ -38,5 +40,13 @@ public interface IcPartyServiceCenterMatterDao extends BaseDao<IcPartyServiceCen
* @date 2021/11/22 10:29 上午
*/
void deleteMattersByPartyServiceCenterId(@Param("partyServiceCenterId") String partyServiceCenterId);
/**
* @Description 根据党群服务中心ID查询事件名字
* @param centerId
* @author zxc
* @date 2021/12/10 8:56 上午
*/
List<String> selectMatterNameByCenterId(@Param("centerId") String centerId);
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java

@ -148,4 +148,12 @@ public interface AgencyService {
*/
List<BaseInfoFamilyBuildingResultDTO> baseInfoFamilyBuilding(BaseInfoFamilyBuildingFormDTO formDTO);
/**
* @Description 查询下级agencyId
* @param orgId
* @author zxc
* @date 2021/12/9 4:42 下午
*/
List<String> getSonAgencyId(String orgId);
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterMatterService.java

@ -100,4 +100,12 @@ public interface IcPartyServiceCenterMatterService extends BaseService<IcPartySe
* @date 2021/11/22 10:29 上午
*/
void deleteMattersByPartyServiceCenterId(String partyServiceCenterId);
/**
* @Description 根据党群服务中心ID查询事件名字
* @param centerId
* @author zxc
* @date 2021/12/10 8:56 上午
*/
List<String> selectMatterNameByCenterId(String centerId);
}

15
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

@ -621,6 +621,21 @@ public class AgencyServiceImpl implements AgencyService {
return result;
}
/**
* @Description 查询下级agencyId
* @param orgId
* @author zxc
* @date 2021/12/9 4:42 下午
*/
@Override
public List<String> getSonAgencyId(String orgId) {
List<String> result = customerAgencyDao.getSonAgencyId(orgId);
if (CollectionUtils.isNotEmpty(result)){
return result;
}
return new ArrayList<>();
}
private CustomerAgencyEntity constructInsertEntity(AddAgencyV2FormDTO formDTO, CustomerAgencyDTO parent) {
CustomerAgencyEntity insertEntity = ConvertUtils.sourceToTarget(formDTO, CustomerAgencyEntity.class);
insertEntity.setOrganizationName(formDTO.getAgencyName());

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterMatterServiceImpl.java

@ -109,4 +109,15 @@ public class IcPartyServiceCenterMatterServiceImpl extends BaseServiceImpl<IcPar
baseDao.deleteMattersByPartyServiceCenterId(partyServiceCenterId);
}
/**
* @Description 根据党群服务中心ID查询事件名字
* @param centerId
* @author zxc
* @date 2021/12/10 8:56 上午
*/
@Override
public List<String> selectMatterNameByCenterId(String centerId) {
return baseDao.selectMatterNameByCenterId(centerId);
}
}

40
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java

@ -25,6 +25,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
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.CustomerOrgRedis;
@ -137,6 +138,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
* @date 2021/11/22 9:13 上午
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void addPartyServiceCenter(AddPartyServiceCenterFormDTO formDTO, TokenDto tokenDto) {
String customerId = tokenDto.getCustomerId();
LambdaQueryWrapper<IcPartyServiceCenterEntity> l = new LambdaQueryWrapper<>();
@ -164,6 +166,12 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
baseDao.insert(centerEntity);
if (CollectionUtils.isNotEmpty(formDTO.getMatterList())){
List<IcPartyServiceCenterMatterEntity> matters = ConvertUtils.sourceToTarget(formDTO.getMatterList(), IcPartyServiceCenterMatterEntity.class);
List<String> paramMatterNames = matters.stream().map(m -> m.getMatterName()).collect(Collectors.toList());
Integer allSize = paramMatterNames.size();
Integer distinctSize = paramMatterNames.stream().distinct().collect(Collectors.toList()).size();
if (distinctSize < allSize){
throw new EpmetException(EpmetErrorCode.MATTER_NAME_EXISTS_APPOINTMENT_ERROR.getCode());
}
matters.forEach(m -> {
m.setCustomerId(customerId);
m.setPartyServiceCenterId(centerEntity.getId());
@ -181,6 +189,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
* @date 2021/11/22 10:21 上午
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void editPartyServiceCenter(EditPartyServiceCenterFormDTO formDTO, TokenDto tokenDto) {
LambdaQueryWrapper<IcPartyServiceCenterEntity> l = new LambdaQueryWrapper<>();
l.eq(IcPartyServiceCenterEntity::getCenterName,formDTO.getCenterName())
@ -194,14 +203,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
IcPartyServiceCenterEntity centerEntity = ConvertUtils.sourceToTarget(formDTO, IcPartyServiceCenterEntity.class);
centerEntity.setId(formDTO.getPartyServiceCenterId());
baseDao.updateById(centerEntity);
if (CollectionUtils.isNotEmpty(formDTO.getMatterList())){
List<IcPartyServiceCenterMatterEntity> matters = ConvertUtils.sourceToTarget(formDTO.getMatterList(), IcPartyServiceCenterMatterEntity.class);
matters.forEach(m -> {
m.setCustomerId(tokenDto.getCustomerId());
m.setPartyServiceCenterId(formDTO.getPartyServiceCenterId());
});
matterService.insertBatch(matters);
}
// del matter
if (CollectionUtils.isNotEmpty(formDTO.getDelMatterList())){
List<String> delMatterList = formDTO.getDelMatterList();
@ -218,6 +220,25 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
matterService.deleteBatchIds(delMatterList);
}
}
if (CollectionUtils.isNotEmpty(formDTO.getMatterList())){
List<String> existsMatterNames = matterService.selectMatterNameByCenterId(formDTO.getPartyServiceCenterId());
List<IcPartyServiceCenterMatterEntity> matters = ConvertUtils.sourceToTarget(formDTO.getMatterList(), IcPartyServiceCenterMatterEntity.class);
List<String> paramMatterNames = matters.stream().map(m -> m.getMatterName()).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(existsMatterNames)){
paramMatterNames.addAll(existsMatterNames);
}
Integer allSize = paramMatterNames.size();
Integer distinctSize = paramMatterNames.stream().distinct().collect(Collectors.toList()).size();
if (distinctSize < allSize){
throw new EpmetException(EpmetErrorCode.MATTER_NAME_EXISTS_APPOINTMENT_ERROR.getCode());
}
matters.forEach(m -> {
m.setCustomerId(tokenDto.getCustomerId());
m.setPartyServiceCenterId(formDTO.getPartyServiceCenterId());
});
matterService.insertBatch(matters);
}
}
/**
@ -227,6 +248,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
* @date 2021/11/22 1:25 下午
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void delMatter(DelMatterFormDTO formDTO) {
LambdaQueryWrapper<IcMatterAppointmentRecordEntity> re = new LambdaQueryWrapper<>();
re.eq(BaseEpmetEntity::getDelFlag,NumConstant.ZERO).
@ -247,6 +269,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
* @date 2021/11/22 2:06 下午
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void appointment(AppointmentFormDTO formDTO, TokenDto tokenDto) {
String customerId = tokenDto.getCustomerId();
LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>();
@ -407,6 +430,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
* @date 2021/11/26 5:21 下午
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void cancelAppointment(CancelAppointmentFormDTO formDTO) {
matterAppointmentRecordDao.cancelAppointment(formDTO.getRecordId(), formDTO.getUserId());
}

10
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -638,4 +638,14 @@
order by created_time desc
</select>
<!-- 查询下级agencyId -->
<select id="getSonAgencyId" resultType="java.lang.String">
SELECT
ID
FROM customer_agency
WHERE
DEL_FLAG = '0'
AND PID = #{orgId}
</select>
</mapper>

9
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterMatterDao.xml

@ -10,4 +10,13 @@
AND PARTY_SERVICE_CENTER_ID = #{partyServiceCenterId}
</delete>
<!-- 根据党群服务中心ID查询事件名字 -->
<select id="selectMatterNameByCenterId" resultType="java.lang.String">
SELECT
matter_name
FROM ic_party_service_center_matter
WHERE DEL_FLAG = 0
AND party_service_center_id = #{centerId}
</select>
</mapper>

50
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ResiEventResearchAnalysisFormDTO.java

@ -0,0 +1,50 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* 数据分析-个人档案-上报事件详情-研判分析查看项目通分类+来源于当前上报人上报的所有事件
*
*/
@Data
public class ResiEventResearchAnalysisFormDTO implements Serializable {
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
/**
* 当前选中的事件id
*/
@NotBlank(message = "resiEventId不能为空",groups = AddUserInternalGroup.class)
private String resiEventId;
/**
* 当前选中的事件转为的项目id
*/
@NotBlank(message = "projectId不能为空",groups = AddUserInternalGroup.class)
private String projectId;
/**
* 个人档案的这个人
*/
@NotBlank(message = "icResiUserId不能为空",groups = AddUserInternalGroup.class)
private String icResiUserId;
/**
* 个人档案的这个人对应小程序的人的用户id
*/
private List<String> epmetUserIdList;
@NotBlank(message = "tokenDto中的customerId不能为空",groups = AddUserInternalGroup.class)
private String customerId;
}

44
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TopicResearchAnalysisFormDTO.java

@ -0,0 +1,44 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* 话题详情-研判分析
*/
@Data
public class TopicResearchAnalysisFormDTO implements Serializable {
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
/**
* 当前选中的事件转为的项目id
*/
@NotBlank(message = "projectId不能为空",groups = AddUserInternalGroup.class)
private String projectId;
/**
* 个人档案的这个人
*/
@NotBlank(message = "icResiUserId不能为空",groups = AddUserInternalGroup.class)
private String icResiUserId;
/**
* 个人档案的这个人对应小程序的人的用户id
*/
private List<String> epmetUserIdList;
@NotBlank(message = "tokenDto中的customerId不能为空",groups = AddUserInternalGroup.class)
private String customerId;
}

11
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/HouseUserDTO.java

@ -0,0 +1,11 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
@Data
public class HouseUserDTO implements Serializable {
private String icResiUserId;
private String icUserName;
}

16
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDataDTO.java

@ -0,0 +1,16 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 数据分析-个人档案-上报事件详情-研判分析查看项目通分类+来源于当前上报人上报的所有事件
*/
@Data
public class ProjectDataDTO implements Serializable {
private String firstCategoryCode;
private String firstCategoryName;
private List<ProjectInfoIcData> projectList;
}

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<>();
}
}

23
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectInfoIcData.java

@ -0,0 +1,23 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 数据分析-个人档案-上报事件详情-研判分析查看项目通分类+来源于当前上报人上报的所有事件
*/
@Data
public class ProjectInfoIcData implements Serializable {
private static final long serialVersionUID = -1937915930811634827L;
private String projectId;
private String projectTitle;
private String resiEventId;
private String projectStatus;
/**
* 以下这两个参数是给话题详情-研判分析用的
*/
private String issueId;
private String topicId;
}

30
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResiEventResearchAnalysisResDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 数据分析-个人档案-上报事件详情-研判分析查看项目通分类+来源于当前上报人上报的所有事件
*
*/
@Data
public class ResiEventResearchAnalysisResDTO implements Serializable {
/**
* 居民信息及家属列表
*/
private String icResiUserId;
private String icUserName;
private String houseId;
private List<HouseUserDTO> houseUserList;
/**
* 入参中给的再返回去
*/
private List<String> epmetUserIdList;
private List<ProjectDataDTO> projectData;
}

23
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/TopicResearchAnalysisResDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.result;
import lombok.Data;
import java.util.List;
@Data
public class TopicResearchAnalysisResDTO {
/**
* 居民信息及家属列表
*/
private String icResiUserId;
private String icUserName;
private String houseId;
private List<HouseUserDTO> houseUserList;
/**
* 入参中给的再返回去
*/
private List<String> epmetUserIdList;
private List<ProjectDataDTO> projectData;
}

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";
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save