Browse Source

Merge remote-tracking branch 'remotes/origin/dev' into dev_optimize_query

# Conflicts:
#	epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
#	epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java
#	epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml
master
jianjun 4 years ago
parent
commit
6782ddd2b4
  1. 7
      epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.10__add_icuserchangetype_dict.sql
  2. 4
      epmet-cloud-generator/src/main/resources/application.yml
  3. 17
      epmet-cloud-generator/src/main/resources/template/Controller.java.vm
  4. 17
      epmet-cloud-generator/src/main/resources/template/DTO.java.vm
  5. 17
      epmet-cloud-generator/src/main/resources/template/Dao.java.vm
  6. 17
      epmet-cloud-generator/src/main/resources/template/Entity.java.vm
  7. 17
      epmet-cloud-generator/src/main/resources/template/Excel.java.vm
  8. 17
      epmet-cloud-generator/src/main/resources/template/Redis.java.vm
  9. 17
      epmet-cloud-generator/src/main/resources/template/Service.java.vm
  10. 17
      epmet-cloud-generator/src/main/resources/template/ServiceImpl.java.vm
  11. 72
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DateEnum.java
  12. 46
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/IcFormCodeEnum.java
  13. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  14. 110
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/FactIcuserCategoryAnalysisDailyDTO.java
  15. 37
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/IcUserCategoryFormDTO.java
  16. 50
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/IcUserCategoryResultDTO.java
  17. 37
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/GridLivelyFormDTO.java
  18. 20
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridDateIdResultDTO.java
  19. 33
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridLivelyResultDTO.java
  20. 4
      epmet-module/data-aggregator/data-aggregator-server/deploy/docker-compose-prod.yml
  21. 29
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java
  22. 42
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java
  23. 19
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java
  24. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolRecordDao.java
  25. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java
  26. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java
  27. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java
  28. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java
  29. 72
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/GridLivelyExcel.java
  30. 13
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java
  31. 32
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  32. 15
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java
  33. 80
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  34. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  35. 107
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  36. 12
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java
  37. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java
  38. 14
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java
  39. 54
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml
  40. 16
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolRecordDao.xml
  41. 13
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml
  42. 16
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml
  43. 15
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml
  44. 2
      epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml
  45. 1
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java
  46. 18
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/customize/IcResiCategoryConfigDTO.java
  47. 32
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IcUserCategoryAnalysisDailyFormDTO.java
  48. 12
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/OrgIcUserTotalDTO.java
  49. 8
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java
  50. 10
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java
  51. 26
      epmet-module/data-statistical/data-statistical-server/pom.xml
  52. 76
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IcController.java
  53. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiICJobController.java
  54. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/customize/IcResiCategoryStatsConfigDao.java
  55. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java
  56. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java
  57. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIcuserCategoryAnalysisDailyDao.java
  58. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java
  59. 74
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIcuserCategoryAnalysisDailyEntity.java
  60. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/customize/IcResiCategoryStatsConfigService.java
  61. 40
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/customize/impl/IcResiCategoryStatsConfigServiceImpl.java
  62. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java
  63. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java
  64. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java
  65. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java
  66. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java
  67. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java
  68. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIcuserCategoryAnalysisDailyService.java
  69. 198
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIcuserCategoryAnalysisDailyServiceImpl.java
  70. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java
  71. 101
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java
  72. 5
      epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml
  73. 21
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.28__fact_icuser_category_analysis_daily.sql
  74. 23
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/customize/IcResiCategoryStatsConfigDao.xml
  75. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml
  76. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml
  77. 13
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIcuserCategoryAnalysisDailyDao.xml
  78. 82
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml
  79. 115
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitCompletionDTO.java
  80. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java
  81. 18
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CompletionFormDTO.java
  82. 40
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PointRecordFormDTO.java
  83. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java
  84. 33
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceItemAddFormDTO.java
  85. 20
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceItemPageFormDTO.java
  86. 24
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceItemSelectFormDTO.java
  87. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/StatusFormDTO.java
  88. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java
  89. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java
  90. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java
  91. 44
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordDTO.java
  92. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordResultDTO.java
  93. 17
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServicePointDTO.java
  94. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java
  95. 19
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceItemResultDTO.java
  96. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java
  97. 50
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitCompletionController.java
  98. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java
  99. 88
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java
  100. 63
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java

7
epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.10__add_icuserchangetype_dict.sql

@ -0,0 +1,7 @@
INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1483355574648180737', 'ic_user_change_type', '人员变动类型', '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', 17, 0, 0, '1', '2022-01-18 16:28:23', '1', '2022-01-18 16:28:42');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1483355968996642817', 1483355574648180737, '迁出', 'out', '0', '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', 4, 0, 0, '1', '2022-01-18 16:29:57', '1', '2022-01-18 16:29:57');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1483355899824181249', 1483355574648180737, '迁入', 'in', '0', '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', 3, 0, 0, '1', '2022-01-18 16:29:41', '1', '2022-01-18 16:29:41');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1483355832321052673', 1483355574648180737, '类别', 'category', '0', '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', 2, 0, 0, '1', '2022-01-18 16:29:25', '1', '2022-01-18 16:29:25');
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1483355752541196290', 1483355574648180737, '新增', 'add', '0', '操作类型名称【add:新增 category:类别 in:迁入 out:迁出】', 1, 0, 0, '1', '2022-01-18 16:29:05', '1', '2022-01-18 16:29:05');

4
epmet-cloud-generator/src/main/resources/application.yml

@ -10,8 +10,8 @@ spring:
#MySQL配置
driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://192.168.1.140:3306/epmet_data_statistical?useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: epmet_dba
password: EpmEt-dbA-UsEr
username: root
password: root
#oracle配置
# driverClassName: oracle.jdbc.OracleDriver
# url: jdbc:oracle:thin:@192.168.10.10:1521:helowin

17
epmet-cloud-generator/src/main/resources/template/Controller.java.vm

@ -1,20 +1,3 @@
/**
* 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 ${package}.controller;
import ${main}.commons.tools.page.PageData;

17
epmet-cloud-generator/src/main/resources/template/DTO.java.vm

@ -1,20 +1,3 @@
/**
* 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 ${package}.dto;
import java.io.Serializable;

17
epmet-cloud-generator/src/main/resources/template/Dao.java.vm

@ -1,20 +1,3 @@
/**
* 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 ${package}.dao;
import ${main}.commons.mybatis.dao.BaseDao;

17
epmet-cloud-generator/src/main/resources/template/Entity.java.vm

@ -1,20 +1,3 @@
/**
* 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 ${package}.entity;
import com.baomidou.mybatisplus.annotation.TableName;

17
epmet-cloud-generator/src/main/resources/template/Excel.java.vm

@ -1,20 +1,3 @@
/**
* 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 ${package}.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;

17
epmet-cloud-generator/src/main/resources/template/Redis.java.vm

@ -1,20 +1,3 @@
/**
* 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 ${package}.redis;
import ${main}.commons.tools.redis.RedisUtils;

17
epmet-cloud-generator/src/main/resources/template/Service.java.vm

@ -1,20 +1,3 @@
/**
* 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 ${package}.service;
import ${main}.commons.mybatis.service.BaseService;

17
epmet-cloud-generator/src/main/resources/template/ServiceImpl.java.vm

@ -1,20 +1,3 @@
/**
* 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 ${package}.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

72
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DateEnum.java

@ -0,0 +1,72 @@
package com.epmet.commons.tools.enums;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import java.util.Objects;
/**
* @author Administrator
*/
public enum DateEnum {
/**
* 月份相关枚举
*/
JAN("01", "1月"),
FEB("02", "2月"),
MAR("03", "3月"),
APR("04", "4月"),
MAY("05", "5月"),
JUN("06", "6月"),
JUL("07", "7月"),
AUG("08", "8月"),
SEP("09", "9月"),
OCT("10", "10月"),
NOV("11", "11月"),
DEC("12", "12月"),
/**
* 季度相关枚举
*/
Q1("Q1", "第一季度"),
Q2("Q2", "第二季度"),
Q3("Q3", "第三季度"),
Q4("Q4", "第四季度"),
UN_KNOWN("0", "未知");
private String code;
private String name;
DateEnum(String code, String name) {
this.code = code;
this.name = name;
}
public static String getName(String code) {
DateEnum[] dateEnums = values();
for (DateEnum dateEnum : dateEnums) {
if (Objects.equals(dateEnum.getCode(), code)) {
return dateEnum.getName();
}
}
return EpmetErrorCode.SERVER_ERROR.getMsg();
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

46
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/IcFormCodeEnum.java

@ -0,0 +1,46 @@
package com.epmet.commons.tools.enums;
/**
* desc数字社区平台-表单配置枚举类
*
* @author jianjun liu
* @date 2020-07-03 11:14
**/
public enum IcFormCodeEnum {
/**
* 表单code枚举
*/
RESI_BASE_INFO("resi_base_info", "居民信息"),
;
private String code;
private String name;
IcFormCodeEnum(String code, String name) {
this.code = code;
this.name = name;
}
public static IcFormCodeEnum getEnum(String code) {
IcFormCodeEnum[] values = IcFormCodeEnum.values();
for (IcFormCodeEnum value : values) {
if (value.getCode().equals(code)) {
return value;
}
}
return null;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}

4
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java

@ -636,4 +636,8 @@ public class RedisKeys {
public static String getOrgTreeCacheKey(String agencyId) {
return rootPrefix.concat("org:temp:orgtree").concat(agencyId);
}
public static String getHouseInfoCacheKey(String houseId,String customerId){
return rootPrefix.concat("house:").concat(customerId).concat(":").concat(houseId);
}
}

110
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/FactIcuserCategoryAnalysisDailyDTO.java

@ -0,0 +1,110 @@
package com.epmet.dataaggre.dto.epmetuser;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 人员类别分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-17
*/
@Data
public class FactIcuserCategoryAnalysisDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键人员类别分析表
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 预警配置ID
*/
private String configId;
/**
* 类别列名对个数据太麻烦了在这个表存一下
*/
private String columnName;
/**
* 当前数据是截止到XXX的yyyyMMdd
*/
private String dateId;
/**
* 网格id或者组织id
*/
private String orgId;
/**
* grid或者agency
*/
private String orgType;
/**
* orgid的上级
*/
private String pid;
/**
* orgid的所有上级
*/
private String pids;
/**
* 当前类别总人数
*/
private Integer total;
/**
* 较上月迁出
*/
private Integer qcIncr;
/**
* 较上月迁入
*/
private Integer qrIncr;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

37
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/IcUserCategoryFormDTO.java

@ -0,0 +1,37 @@
package com.epmet.dataaggre.dto.epmetuser.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 人员类别分析 入参
*/
@Data
public class IcUserCategoryFormDTO implements Serializable {
private static final long serialVersionUID = 2834180692632036316L;
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
@NotBlank(message = "请选择查看某个组织或网格", groups = AddUserShowGroup.class)
private String orgId;
@NotBlank(message = "orgType不能为空", groups = AddUserInternalGroup.class)
private String orgType;
@NotBlank(message = "dateId不能为空", groups = AddUserInternalGroup.class)
@Length(min = 8, max = 8, message = "dateId格式:yyyyMMdd", groups = AddUserInternalGroup.class)
private String dateId;
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId;
}

50
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/IcUserCategoryResultDTO.java

@ -0,0 +1,50 @@
package com.epmet.dataaggre.dto.epmetuser.result;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.io.Serializable;
/**
* 人员类别分析-返参DTO
*/
@Data
public class IcUserCategoryResultDTO implements Serializable {
private static final long serialVersionUID = -2150403803220667018L;
/**
* 居民类别配置主键
*/
// @JsonIgnore
private String configId;
/**
* 当前类别对应的列名
*/
private String categoryKey;
/**
* 类别名称
*/
private String categoryName;
/**
* 类别图标
*/
private String dataIcon;
/**
* 当前类别下总人数
*/
private Integer total=0;
/**
* 桥上月迁入
*/
private Integer immigration=0;
/**
* 较上月迁出
*/
private Integer emigration=0;
}

37
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/GridLivelyFormDTO.java

@ -0,0 +1,37 @@
package com.epmet.dataaggre.dto.govorg.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;
/**
* @Description 网格活跃度-接口入参
* @Author sun
*/
@Data
public class GridLivelyFormDTO implements Serializable {
private static final long serialVersionUID = -3651225675593357002L;
public interface Grid extends CustomerClientShowGroup {
}
/**
* 组织Id
*/
@NotBlank(message = "组织ID不能为空", groups = {Grid.class})
private String agencyId;
/**
* 起始查询时间yyyyMMdd
*/
@NotBlank(message = "起始查询时间不能为空", groups = {Grid.class})
private String startTime;
/**
* 结束查询时间yyyyMMdd
*/
@NotBlank(message = "结束查询时间不能为空", groups = {Grid.class})
private String endTime;
}

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

@ -0,0 +1,20 @@
package com.epmet.dataaggre.dto.govorg.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 网格下按天的上报事件或直接立项数据-接口返参
* @Author sun
*/
@Data
public class GridDateIdResultDTO implements Serializable {
private static final long serialVersionUID = -4304356050545598564L;
//网格Id
private String gridId;
//日维度Id
private String dateId;
//网格所属组织的所有上级Id
private String pids;
}

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

@ -0,0 +1,33 @@
package com.epmet.dataaggre.dto.govorg.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 网格活跃度-接口返参
* @Author sun
*/
@Data
public class GridLivelyResultDTO implements Serializable {
private static final long serialVersionUID = -4304356050545598564L;
//组织Id
private String agencyId;
//组织名称
private String agencyName;
//组织下所有网格总数
private Integer gridSumNum;
//活跃网格数
private Integer gridLivelyNum;
//活跃网格数占比
private String gridLivelyRatio;
//正常运行网格数
private Integer gridOrdinaryNum;
//正常运行网格数占比
private String gridOrdinaryRatio;
//僵尸网格数
private Integer gridLazyNum;
//僵尸网格数占比
private String gridLazyRatio;
}

4
epmet-module/data-aggregator/data-aggregator-server/deploy/docker-compose-prod.yml

@ -9,10 +9,10 @@ services:
volumes:
- "/opt/epmet-cloud-logs/prod:/logs"
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./data-aggregator.jar"
RUN_INSTRUCT: "java -Xms256m -Xmx760m -jar ./data-aggregator.jar"
restart: "unless-stopped"
deploy:
resources:
limits:
cpus: '0.1'
memory: 600M
memory: 800M

29
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java

@ -5,6 +5,7 @@ import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.enums.RequirePermissionEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -26,6 +27,7 @@ import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.enums.GridMemberDataAnalysisEnums;
import com.epmet.dataaggre.service.AggreGridService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.epmet.dto.form.patrol.PcworkRecordListFormDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
@ -373,4 +375,31 @@ public class GovOrgController {
sb.append("的工作统计");
return sb.toString();
}
/**
* @Description 查询组织的直属下级组织下网格活跃度统计查平阴实际是查的下边八个街道的活跃程度
* @author sun
* 网格按运行情况分为活跃网格正常运行网格和僵尸网格三个类别
* 以自然周为计量单位对末级网格运行情况进行考核
* 1周内每个末级网格有5天及5天以上上传事件或开展例行工作的为活跃网格
* 有2天及2天以上5天以下上传事件或开展例行工作的为正常运行网格
* 只有1天上传事件或开展例行工作的为僵尸网格
*/
@PostMapping("gridlively")
public Result<List<GridLivelyResultDTO>> grdiLively(@RequestBody GridLivelyFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, GridLivelyFormDTO.Grid.class);
return new Result<List<GridLivelyResultDTO>>().ok(govOrgService.grdiLively(formDTO));
}
/**
* @Author sun
* @Description 查询组织的直属下级组织下网格活跃度统计--文件导出
**/
@NoRepeatSubmit
@PostMapping("export")
public void pcworkRecordListExport(HttpServletResponse response, @RequestBody GridLivelyFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, GridLivelyFormDTO.Grid.class);
govOrgService.grdiLivelyExport(response, formDTO);
}
}

42
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java

@ -0,0 +1,42 @@
package com.epmet.dataaggre.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.dataaggre.dto.epmetuser.form.IcUserCategoryFormDTO;
import com.epmet.dataaggre.dto.epmetuser.result.IcUserCategoryResultDTO;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
import org.springframework.beans.factory.annotation.Autowired;
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 java.util.List;
@RestController
@RequestMapping("icuser")
public class IcUserController {
@Autowired
private EpmetUserService epmetUserService;
/**
* 人员类别分析-各类别人数
*
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("category-data")
public Result<List<IcUserCategoryResultDTO>> queryIcUserCategoryData(@LoginUser TokenDto tokenDto, @RequestBody IcUserCategoryFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO, IcUserCategoryFormDTO.AddUserShowGroup.class, IcUserCategoryFormDTO.AddUserInternalGroup.class);
return new Result<List<IcUserCategoryResultDTO>>().ok(epmetUserService.queryIcUserCategoryData(formDTO));
}
}

19
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java

@ -22,10 +22,12 @@ import com.epmet.dataaggre.dto.datastats.form.CustomerDataManageFormDTO;
import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO;
import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO;
import com.epmet.dataaggre.dto.datastats.result.*;
import com.epmet.dataaggre.dto.epmetuser.FactIcuserCategoryAnalysisDailyDTO;
import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO;
import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridDateIdResultDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectMonthIncrResultDTO;
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO;
import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO;
import com.epmet.dataaggre.entity.datastats.DimAgencyEntity;
@ -349,4 +351,19 @@ public interface DataStatsDao {
* @author sun
*/
List<FactAgencyProjectMonthResultDTO> getProjectMonthIncr(ProjectTotalFormDTO formDTO);
List<FactIcuserCategoryAnalysisDailyDTO> queryGridIcUserCategoryData(@Param("orgId") String orgId,
@Param("dateId") String dateId,
@Param("configIds") List<String> configIds);
List<FactIcuserCategoryAnalysisDailyDTO> queryAgencyIcUserCategoryData(@Param("gridPids") String gridPids,
@Param("orgId")String orgId,
@Param("dateId") String dateId,
@Param("configIds") List<String> configIds);
/**
* @Description 查询直属下级组织下网格在查询时间段内存在上报事件(直接立项)数的网格一天一条
* @author sun
*/
List<GridDateIdResultDTO> gridDateProjectIncrList(GridLivelyFormDTO formDTO);
}

8
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffPatrolRecordDao.java

@ -22,6 +22,8 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.form.StaffListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.result.StaffListResultDTO;
import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridDateIdResultDTO;
import com.epmet.dataaggre.entity.epmetuser.StaffPatrolRecordEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -60,4 +62,10 @@ public interface StaffPatrolRecordDao extends BaseDao<StaffPatrolRecordEntity> {
* @author sun
*/
List<StaffListResultDTO> gridMemberPatrol(GridMemberPatrolListFormDTO formDTO);
/**
* @Description 查询直属下级组织下网格在查询时间段内存在例行工作次数的网格
* @author sun
*/
List<GridDateIdResultDTO> gridDateRoutineWorkList(GridLivelyFormDTO formDTO);
}

7
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java

@ -23,8 +23,8 @@ import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
/**
* 机关单位信息表
@ -100,4 +100,9 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
*/
List<String> getOrgList(@Param("staffId") String staffId);
/**
* @Description 查询当前组织的直属下级组织列表及组织下的网格总数
* @author sun
*/
LinkedList<GridLivelyResultDTO> subAgencyListAndGridSumNum(@Param("agencyId") String agencyId);
}

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

@ -113,6 +113,7 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
* @author sun
*/
List<ProjectCategoryResultDTO> getProjectCategoryList(@Param("customerId") String customerId,
@Param("categoryCodeList") List<String> categoryCodeList,
@Param("secondCodeList") List<String> secondCodeList,
@Param("userIds") List<String> userIds,
@Param("origin") String origin);

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java

@ -20,6 +20,7 @@ package com.epmet.dataaggre.dao.opercustomize;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.app.result.CustomerFootBarDTO;
import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO;
import com.epmet.dataaggre.dto.epmetuser.result.IcUserCategoryResultDTO;
import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -59,4 +60,5 @@ public interface CustomerFootBarDao extends BaseDao<CustomerFootBarEntity> {
*/
CustomerFootBarEntity selectDefaultIcon(@Param("customerId") String customerId, @Param("appType")String appType, @Param("barKey")String barKey);
List<IcUserCategoryResultDTO> queryCustomerIcResiCategoryStatsConfig(String customerId);
}

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

@ -440,6 +440,11 @@ public class IcResiUserEntity extends BaseEpmetEntity {
*/
private String jtxxRemakes;
/**
* 用户状态0:正常 1:转出
*/
private String status;
/**
* 预留字段1
*/

72
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/excel/GridLivelyExcel.java

@ -0,0 +1,72 @@
/**
* 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.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
/**
* @Description 网格活跃度文件导出-接口返参
* @Author sun
*/
@Data
public class GridLivelyExcel {
@ExcelProperty("组织ID")
@ExcelIgnore
private String agencyId;
//组织名称
@ExcelProperty("组织名称")
@ColumnWidth(15)
private String agencyName;
//组织下所有网格总数
@ExcelProperty("网格总数")
@ColumnWidth(15)
private Integer gridSumNum;
//活跃网格数
@ExcelProperty("活跃网格数")
@ColumnWidth(15)
private Integer gridLivelyNum;
//活跃网格数占比
@ExcelProperty("活跃网格数占比")
@ColumnWidth(15)
private String gridLivelyRatio;
//正常运行网格数
@ExcelProperty("正常运行网格数")
@ColumnWidth(15)
private Integer gridOrdinaryNum;
//正常运行网格数占比
@ExcelProperty("正常运行网格数占比")
@ColumnWidth(15)
private String gridOrdinaryRatio;
//僵尸网格数
@ExcelProperty("僵尸网格数")
@ColumnWidth(15)
private Integer gridLazyNum;
//僵尸网格数占比
@ExcelProperty("僵尸网格数占比")
@ColumnWidth(15)
private String gridLazyRatio;
}

13
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java

@ -3,8 +3,11 @@ package com.epmet.dataaggre.service.datastats;
import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO;
import com.epmet.dataaggre.dto.datastats.form.*;
import com.epmet.dataaggre.dto.datastats.result.*;
import com.epmet.dataaggre.dto.epmetuser.FactIcuserCategoryAnalysisDailyDTO;
import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO;
import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridDateIdResultDTO;
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectMonthIncrResultDTO;
@ -279,4 +282,14 @@ public interface DataStatsService {
String startDateID,
String endDateID,
Boolean needCount);
List<FactIcuserCategoryAnalysisDailyDTO> queryGridIcUserCategoryData(String orgId, String dateId, List<String> configIds);
List<FactIcuserCategoryAnalysisDailyDTO> queryAgencyIcUserCategoryData(String gridPids, String orgId,String dateId, List<String> configIds);
/**
* @Description 查询直属下级组织下网格在查询时间段内存在上报事件(直接立项)数的网格一天一条
* @author sun
*/
List<GridDateIdResultDTO> getGridDateProjectIncrList(GridLivelyFormDTO formDTO);
}

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

@ -16,14 +16,17 @@ import com.epmet.dataaggre.dao.datastats.FactGridMemberStatisticsDailyDao;
import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO;
import com.epmet.dataaggre.dto.datastats.form.*;
import com.epmet.dataaggre.dto.datastats.result.*;
import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.FactIcuserCategoryAnalysisDailyDTO;
import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult;
import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO;
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridDateIdResultDTO;
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO;
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO;
import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO;
@ -2170,4 +2173,29 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve
PageHelper.startPage(pageNo, pageSize, needCount);
return factGridMemberStatisticsDailyDao.listGridMemberDataStatsIncr(pids, gridId, startDateID, endDateID);
}
@Override
public List<FactIcuserCategoryAnalysisDailyDTO> queryGridIcUserCategoryData(String orgId, String dateId, List<String> configIds) {
if(CollectionUtils.isEmpty(configIds)||StringUtils.isBlank(orgId)){
return new ArrayList<>();
}
return dataStatsDao.queryGridIcUserCategoryData(orgId,dateId,configIds);
}
@Override
public List<FactIcuserCategoryAnalysisDailyDTO> queryAgencyIcUserCategoryData(String gridPids, String orgId,String dateId, List<String> configIds) {
if(CollectionUtils.isEmpty(configIds)||StringUtils.isBlank(orgId)){
return new ArrayList<>();
}
return dataStatsDao.queryAgencyIcUserCategoryData(gridPids,orgId,dateId,configIds);
}
/**
* @Description 查询直属下级组织下网格在查询时间段内存在上报事件(直接立项)数的网格一天一条
* @author sun
*/
@Override
public List<GridDateIdResultDTO> getGridDateProjectIncrList(GridLivelyFormDTO formDTO) {
return dataStatsDao.gridDateProjectIncrList(formDTO);
}
}

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

@ -2,8 +2,10 @@ package com.epmet.dataaggre.service.epmetuser;
import com.epmet.dataaggre.dto.epmetuser.form.*;
import com.epmet.dataaggre.dto.epmetuser.result.*;
import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridDateIdResultDTO;
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectAnalysisResultDTO;
import com.epmet.dataaggre.entity.epmetuser.CustomerStaffEntity;
@ -177,4 +179,17 @@ public interface EpmetUserService {
List<CustomerStaffEntity> listStaffsByIds(List<String> userIdsPart);
List<ListStaffResultDTO> selectStaffList(List<String> staffIds);
/**
* 人员类别分析-各类别人数
* @param formDTO
* @return
*/
List<IcUserCategoryResultDTO> queryIcUserCategoryData(IcUserCategoryFormDTO formDTO);
/**
* @Description 查询直属下级组织下网格在查询时间段内存在例行工作次数的网格
* @author sun
*/
List<GridDateIdResultDTO> getGridDateRoutineWorkList(GridLivelyFormDTO formDTO);
}

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

@ -11,9 +11,11 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.BadgeConstant;
import com.epmet.constant.OrgInfoConstant;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmetuser.*;
import com.epmet.dataaggre.dto.epmetuser.CustomerStaffDTO;
import com.epmet.dataaggre.dto.epmetuser.FactIcuserCategoryAnalysisDailyDTO;
import com.epmet.dataaggre.dto.epmetuser.StaffPatrolDetailDTO;
import com.epmet.dataaggre.dto.epmetuser.StaffPatrolRecordDTO;
import com.epmet.dataaggre.dto.epmetuser.form.*;
@ -21,24 +23,31 @@ import com.epmet.dataaggre.dto.epmetuser.result.*;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridDateIdResultDTO;
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.*;
import com.epmet.dataaggre.entity.epmetuser.CustomerStaffEntity;
import com.epmet.dataaggre.entity.epmetuser.GovStaffRoleEntity;
import com.epmet.dataaggre.entity.epmetuser.ResiUserBadgeEntity;
import com.epmet.dataaggre.entity.epmetuser.StaffRoleEntity;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
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.dataaggre.service.opercustomize.CustomerFootBarService;
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;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -81,6 +90,8 @@ public class EpmetUserServiceImpl implements EpmetUserService {
private GovStaffRoleDao govStaffRoleDao;
@Resource
private IcResiUserDao icResiUserDao;
@Resource
private CustomerFootBarService customerFootBarService;
/**
* @Description 根据UserIds查询
@ -750,4 +761,71 @@ public class EpmetUserServiceImpl implements EpmetUserService {
public List<ListStaffResultDTO> selectStaffList(List<String> staffIds) {
return customerStaffDao.selectStaffList(staffIds);
}
/**
* 人员类别分析-各类别人数
*
* @param formDTO
* @return
*/
@Override
public List<IcUserCategoryResultDTO> queryIcUserCategoryData(IcUserCategoryFormDTO formDTO) {
// 1、 先查询出居民类别配置(状态为显示)
List<IcUserCategoryResultDTO> resList=customerFootBarService.queryCustomerIcResiCategoryStatsConfig(formDTO.getCustomerId());
if(CollectionUtils.isNotEmpty(resList)){
List<String> configIds=resList.stream().map(IcUserCategoryResultDTO::getConfigId).collect(Collectors.toList());
if(OrgInfoConstant.GRID.equals(formDTO.getOrgType())){
List<FactIcuserCategoryAnalysisDailyDTO> list=dataStatsService.queryGridIcUserCategoryData(formDTO.getOrgId(),formDTO.getDateId(),configIds);
if(CollectionUtils.isNotEmpty(list)){
Map<String, FactIcuserCategoryAnalysisDailyDTO> configMap = list.stream().collect(Collectors.toMap(FactIcuserCategoryAnalysisDailyDTO::getConfigId, m -> m, (k1, k2) -> k1));
resList.forEach(resDto->{
if(MapUtils.isNotEmpty(configMap)&&configMap.containsKey(resDto.getConfigId())){
FactIcuserCategoryAnalysisDailyDTO dailyDTO=configMap.get(resDto.getConfigId());
resDto.setTotal(dailyDTO.getTotal());
resDto.setImmigration(dailyDTO.getQrIncr());
resDto.setEmigration(dailyDTO.getQcIncr());
}
});
}
}else if(OrgInfoConstant.AGENCY.equals(formDTO.getOrgType())){
/*CustomerAgencyEntity agencyEntity=govOrgService.getAgencyInfo(formDTO.getOrgId());
String gridPids="";
if(NumConstant.ZERO_STR.equals(agencyEntity.getPid())){
// 当前组织是根组织
gridPids=formDTO.getOrgId();
}else {
if("b09527201c4409e19d1dbc5e3c3429a1".equals(formDTO.getCustomerId())){
//市北的是英文冒号隔开的
gridPids=agencyEntity.getPids().concat(StrConstant.COMMA).concat(formDTO.getOrgId());
}else{
gridPids=agencyEntity.getPids().concat(StrConstant.COLON).concat(formDTO.getOrgId());
}
}*/
List<FactIcuserCategoryAnalysisDailyDTO> list = dataStatsService.queryAgencyIcUserCategoryData(null, formDTO.getOrgId(), formDTO.getDateId(), configIds);
if(CollectionUtils.isNotEmpty(list)){
Map<String, FactIcuserCategoryAnalysisDailyDTO> configMap = list.stream().collect(Collectors.toMap(FactIcuserCategoryAnalysisDailyDTO::getConfigId, m -> m, (k1, k2) -> k1));
resList.forEach(resDto->{
if(MapUtils.isNotEmpty(configMap)&&configMap.containsKey(resDto.getConfigId())){
FactIcuserCategoryAnalysisDailyDTO dailyDTO=configMap.get(resDto.getConfigId());
resDto.setTotal(dailyDTO.getTotal());
resDto.setImmigration(dailyDTO.getQrIncr());
resDto.setEmigration(dailyDTO.getQcIncr());
}
});
}
}
}
return resList;
}
/**
* @Description 查询直属下级组织下网格在查询时间段内存在例行工作次数的网格
* @author sun
*/
@Override
public List<GridDateIdResultDTO> getGridDateRoutineWorkList(GridLivelyFormDTO formDTO) {
return staffPatrolRecordDao.gridDateRoutineWorkList(formDTO);
}
}

18
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java

@ -4,14 +4,12 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.form.NextAreaCodeFormDTO;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO;
import com.epmet.dataaggre.dto.govorg.form.SubOrgFormDTO;
import com.epmet.dataaggre.dto.govorg.form.*;
import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
@ -172,4 +170,16 @@ public interface GovOrgService {
* @date 2021/11/5 2:57 下午
*/
CustomerGridDTO getGridInfo(String gridId);
/**
* @Description 查询组织的直属下级组织下网格活跃度统计查平阴实际是查的下边八个街道的活跃程度
* @author sun
*/
List<GridLivelyResultDTO> grdiLively(GridLivelyFormDTO formDTO);
/**
* @Author sun
* @Description 查询组织的直属下级组织下网格活跃度统计--文件导出
**/
void grdiLivelyExport(HttpServletResponse response, GridLivelyFormDTO formDTO);
}

107
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java

@ -1,5 +1,8 @@
package com.epmet.dataaggre.service.govorg.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
@ -8,19 +11,20 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.govorg.*;
import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.StaffRoleListResultDTO;
import com.epmet.dataaggre.dto.govorg.*;
import com.epmet.dataaggre.dto.govorg.form.NextAreaCodeFormDTO;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO;
import com.epmet.dataaggre.dto.govorg.form.SubOrgFormDTO;
import com.epmet.dataaggre.dto.govorg.form.*;
import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.excel.GridLivelyExcel;
import com.epmet.dataaggre.service.commonservice.AreaCodeService;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.epmet.dataaggre.service.opercrm.CustomerRelation;
@ -30,6 +34,9 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@ -58,6 +65,8 @@ public class GovOrgServiceImpl implements GovOrgService {
private CustomerStaffGridDao customerStaffGridDao;
@Autowired
private EpmetUserService epmetUserService;
@Autowired
private DataStatsService dataStatsService;
/**
* @param staffId
@ -590,5 +599,95 @@ public class GovOrgServiceImpl implements GovOrgService {
return customerGridDao.getGridInfo(gridId);
}
/**
* @Description 查询组织的直属下级组织下网格活跃度统计查平阴实际是查的下边八个街道的活跃程度
* @author sun
* 网格按运行情况分为活跃网格正常运行网格和僵尸网格三个类别
* 以自然周为计量单位对末级网格运行情况进行考核
* 1周内每个末级网格有5天及5天以上上传事件或开展例行工作的为活跃网格
* 有2天及2天以上5天以下上传事件或开展例行工作的为正常运行网格
* 只有1天上传事件或开展例行工作的为僵尸网格
*/
@Override
public List<GridLivelyResultDTO> grdiLively(GridLivelyFormDTO formDTO) {
//1.查询当前组织的直属下级组织列表及组织下的网格总数
LinkedList<GridLivelyResultDTO> subList = customerAgencyDao.subAgencyListAndGridSumNum(formDTO.getAgencyId());
//2.查询直属下级组织下网格在查询时间段内存在例行工作次数的网格,一天一条
List<GridDateIdResultDTO> workList = epmetUserService.getGridDateRoutineWorkList(formDTO);
//3.查询直属下级组织下网格在查询时间段内存在上报事件(直接立项)数的网格,一天一条
List<GridDateIdResultDTO> projectList = dataStatsService.getGridDateProjectIncrList(formDTO);
//4.汇总数据,一个网格一天只记录一条数据,这条数据可能是例行工作的也可能是上报事件的,也可能某一天两个数都有,但只记录一条
Set<String> map = workList.stream().map(o -> o.getGridId() + o.getDateId()).collect(Collectors.toSet());
projectList.stream().filter(pro -> !map.contains(pro.getGridId() + pro.getDateId())).forEach(p -> workList.add(p));
//5.按组织封装数据
//计算百分比使用,保留小数点后两位
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.TWO);
subList.forEach(sub -> {
Map<String, Integer> hash = new HashMap<>();
workList.forEach(w -> {
if (w.getPids().contains(sub.getAgencyId())) {
if (hash.containsKey(w.getGridId())) {
hash.put(w.getGridId(), hash.get(w.getGridId()) + NumConstant.ONE);
} else {
hash.put(w.getGridId(), NumConstant.ONE);
}
}
});
//活跃网格数、普通网格数、僵尸网格数
int gridLivelyNum = 0;
int gridOrdinaryNum = 0;
for (Integer val : hash.values()) {
if (val >= NumConstant.FIVE) {
gridLivelyNum++;
} else if (val >= NumConstant.TWO && val < NumConstant.FIVE) {
gridOrdinaryNum++;
}
}
sub.setGridLivelyNum(gridLivelyNum);
sub.setGridLivelyRatio((sub.getGridSumNum() == 0 || gridLivelyNum > sub.getGridSumNum()) ? "0%" : numberFormat.format(((float) gridLivelyNum / (float) sub.getGridSumNum()) * 100) + "%");
sub.setGridOrdinaryNum(gridOrdinaryNum);
sub.setGridOrdinaryRatio((sub.getGridSumNum() == 0 || gridOrdinaryNum > sub.getGridSumNum()) ? "0%" : numberFormat.format(((float) gridOrdinaryNum / (float) sub.getGridSumNum()) * 100) + "%");
int gridLazyNum = sub.getGridSumNum() - gridLivelyNum - gridOrdinaryNum;
sub.setGridLazyNum(gridLazyNum < 0 ? 0 : gridLazyNum);
sub.setGridLazyRatio((sub.getGridSumNum() == 0 || gridLazyNum < 0) ? "0%" : numberFormat.format(((float) gridLazyNum / (float) sub.getGridSumNum()) * 100) + "%");
});
return subList;
}
/**
* @Author sun
* @Description 查询组织的直属下级组织下网格活跃度统计--文件导出
**/
@Override
public void grdiLivelyExport(HttpServletResponse response, GridLivelyFormDTO formDTO) {
ExcelWriter excelWriter = null;
try {
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel("网格活跃度统计表.xlsx", response)).build();
WriteSheet writeSheet = EasyExcel.writerSheet(excelSheetName(formDTO)).build();
writeSheet.setClazz(GridLivelyExcel.class);
List<GridLivelyExcel> data = ConvertUtils.sourceToTarget(grdiLively(formDTO), GridLivelyExcel.class);
excelWriter.write(data, writeSheet);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (excelWriter != null) {
excelWriter.finish();
}
}
}
private String excelSheetName(GridLivelyFormDTO formDTO){
StringBuilder name = new StringBuilder();
SimpleDateFormat format1 = new SimpleDateFormat("yyyyMMdd");
SimpleDateFormat format2 = new SimpleDateFormat("yyyy年MM月dd日");
try{
name.append(format2.format(format1.parse(formDTO.getStartTime()))).append("至").append(format2.format(format1.parse(formDTO.getEndTime()))).append("网格活跃度统计");
} catch (Exception e) {
e.printStackTrace();
}
return name.toString();
}
}

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

@ -1,6 +1,7 @@
package com.epmet.dataaggre.service.govproject.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.CustomerIdConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
@ -559,10 +560,10 @@ public class GovProjectServiceImpl implements GovProjectService {
})).collect(Collectors.toList());
//4.根据userId集合和二级分类Code集合查询来源楼院小组的项目
List<ProjectCategoryResultDTO> groupList = projectDao.getProjectCategoryList(formDTO.getCustomerId(), secondCodeList, userIds, "issue");
List<ProjectCategoryResultDTO> groupList = projectDao.getProjectCategoryList(formDTO.getCustomerId(), formDTO.getCategoryCodeList(), (CustomerIdConstant.SHI_BEI_CUSTOMER_ID.equals(formDTO.getCustomerId()) ? null : secondCodeList), userIds, "issue");
//5.根据userId集合和二级分类Code集合查询来源事件上报的项目
List<ProjectCategoryResultDTO> eventList = projectDao.getProjectCategoryList(formDTO.getCustomerId(), secondCodeList, userIds, "resiEvent");
List<ProjectCategoryResultDTO> eventList = projectDao.getProjectCategoryList(formDTO.getCustomerId(), formDTO.getCategoryCodeList(), secondCodeList, userIds, "resiEvent");
//6.封装数据
//楼院小组下分类项目列表
@ -591,9 +592,14 @@ public class GovProjectServiceImpl implements GovProjectService {
});
//当前分类下来源楼院小组的项目
groupList.forEach(gr -> {
if (secondCodeMap.containsKey(gr.getCategoryCode()) && !formDTO.getProjectId().equals(gr.getProjectId())) {
if (CustomerIdConstant.SHI_BEI_CUSTOMER_ID.equals(formDTO.getCustomerId()) && !formDTO.getProjectId().equals(gr.getProjectId())) {
ProjectAnalysisResultDTO.Project project = ConvertUtils.sourceToTarget(gr, ProjectAnalysisResultDTO.Project.class);
groupPrList.add(project);
} else {
if (secondCodeMap.containsKey(gr.getCategoryCode()) && !formDTO.getProjectId().equals(gr.getProjectId())) {
ProjectAnalysisResultDTO.Project project = ConvertUtils.sourceToTarget(gr, ProjectAnalysisResultDTO.Project.class);
groupPrList.add(project);
}
}
});
groupCa.setProjectList(groupPrList);

9
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java

@ -20,8 +20,11 @@ package com.epmet.dataaggre.service.opercustomize;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dataaggre.dto.app.form.AppFootBarFormDTO;
import com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.IcUserCategoryResultDTO;
import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity;
import java.util.List;
/**
* APP底部菜单栏信息
*
@ -40,4 +43,10 @@ public interface CustomerFootBarService extends BaseService<CustomerFootBarEntit
*/
AppFootBarResultDTO queryAppFootBars(AppFootBarFormDTO footBarFormDTO);
/**
* 查询居民类别配置表ic_resi_category_stats_config
* @param customerId
* @return
*/
List<IcUserCategoryResultDTO> queryCustomerIcResiCategoryStatsConfig(String customerId);
}

14
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java

@ -27,7 +27,7 @@ import com.epmet.dataaggre.dao.opercustomize.CustomerFootBarDao;
import com.epmet.dataaggre.dto.app.form.AppFootBarFormDTO;
import com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO;
import com.epmet.dataaggre.dto.app.result.CustomerFootBarDTO;
import com.epmet.dataaggre.dto.epmetuser.IcFormResColumnDTO;
import com.epmet.dataaggre.dto.epmetuser.result.IcUserCategoryResultDTO;
import com.epmet.dataaggre.entity.opercrm.CustomerParameterEntity;
import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity;
import com.epmet.dataaggre.service.opercrm.CustomerParameterService;
@ -39,7 +39,6 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Set;
/**
@ -114,4 +113,15 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl<CustomerFootBarD
return resultDTO;
}
/**
* 查询居民类别配置表ic_resi_category_stats_config
*
* @param customerId
* @return
*/
@Override
public List<IcUserCategoryResultDTO> queryCustomerIcResiCategoryStatsConfig(String customerId) {
return baseDao.queryCustomerIcResiCategoryStatsConfig(customerId);
}
}

54
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml

@ -1107,4 +1107,58 @@
ORDER BY month_id ASC
</select>
<select id="queryGridIcUserCategoryData" parameterType="map" resultType="com.epmet.dataaggre.dto.epmetuser.FactIcuserCategoryAnalysisDailyDTO">
SELECT
m.*
FROM
fact_icuser_category_analysis_daily m
WHERE
m.DATE_ID = #{dateId}
AND m.DEL_FLAG = '0'
AND m.ORG_ID = #{orgId}
<if test='null!=configIds and configIds.size()>0'>
<foreach collection="configIds" item="configId" open="AND (" close=")" separator=" OR ">
m.CONFIG_ID = #{configId}
</foreach>
</if>
</select>
<select id="queryAgencyIcUserCategoryData" parameterType="map" resultType="com.epmet.dataaggre.dto.epmetuser.FactIcuserCategoryAnalysisDailyDTO">
SELECT
m.CONFIG_ID,m.COLUMN_NAME,
SUM(m.TOTAL)as TOTAL,
SUM(m.QR_INCR) AS QR_INCR,
SUM(m.QC_INCR) AS QC_INCR
FROM
fact_icuser_category_analysis_daily m
WHERE
m.DATE_ID = #{dateId}
AND m.DEL_FLAG = '0'
<if test="gridPids != null and gridPids != '' ">
AND m.PIDS LIKE concat(#{gridPids},'%')
</if>
AND m.pids like concat('%',#{orgId},'%')
AND M.ORG_TYPE='grid'
<if test='null!=configIds and configIds.size()>0'>
<foreach collection="configIds" item="configId" open="AND (" close=")" separator=" OR ">
m.CONFIG_ID = #{configId}
</foreach>
</if>
group by m.CONFIG_ID,m.COLUMN_NAME
</select>
<select id="gridDateProjectIncrList" resultType="com.epmet.dataaggre.dto.govorg.result.GridDateIdResultDTO">
SELECT
grid_id gridId,
date_id dateId,
pids pids
FROM
fact_grid_member_statistics_daily
WHERE del_flag = '0'
AND date_id <![CDATA[ >= ]]> #{startTime}
AND date_id <![CDATA[ <= ]]> #{endTime}
AND project_incr > 0
AND pids LIKE CONCAT('%', #{agencyId}, '%')
GROUP BY grid_id, date_id
</select>
</mapper>

16
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffPatrolRecordDao.xml

@ -141,4 +141,20 @@
GROUP BY staff_id
</select>
<select id="gridDateRoutineWorkList" resultType="com.epmet.dataaggre.dto.govorg.result.GridDateIdResultDTO">
SELECT
grid_id gridId,
date_id dateId,
grid_pids pids
FROM
stats_staff_patrol_record_daily
WHERE
del_flag = '0'
AND date_id <![CDATA[ >= ]]> #{startTime}
AND date_id <![CDATA[ <= ]]> #{endTime}
AND routine_work_count > 0
AND grid_pids LIKE CONCAT('%', #{agencyId}, '%')
GROUP BY grid_id, date_id
</select>
</mapper>

13
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml

@ -286,4 +286,17 @@
AND USER_ID = #{staffId}
</select>
<select id="subAgencyListAndGridSumNum" resultType="com.epmet.dataaggre.dto.govorg.result.GridLivelyResultDTO">
SELECT
ca.id agencyId,
ca.organization_name agencyName,
(select COUNT(0) from customer_grid where del_flag = '0' and pids LIKE CONCAT('%',ca.id,'%')) gridSumNum
FROM
customer_agency ca
WHERE
del_flag = '0'
AND pid = #{agencyId}
ORDER BY created_time ASC
</select>
</mapper>

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

@ -259,6 +259,7 @@
AND `status` = #{status}
AND created_time <![CDATA[<]]> DATE_FORMAT(#{toDateId}, '%Y-%m-%d')
ORDER BY created_time DESC
LIMIT 2000
</select>
<select id="categoryProjectList" resultType="com.epmet.dataaggre.dto.govproject.result.CategoryProjectResultDTO$Project">
@ -363,9 +364,18 @@
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>
<choose>
<when test="null != secondCodeList and secondCodeList.size > 0">
<foreach collection="secondCodeList" item="code" open="AND pc.category_code IN (" separator="," close=")">
#{code}
</foreach>
</when>
<otherwise>
<foreach collection="categoryCodeList" item="code" open="AND (" separator=" OR " close=" )" >
pc.category_code LIKE CONCAT(#{code}, '%')
</foreach>
</otherwise>
</choose>
<if test="origin != null and origin != '' and origin == 'issue'">
<foreach collection="userIds" item="userId" open="AND prp.user_id IN (" separator="," close=")">
#{userId}

15
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml

@ -39,4 +39,19 @@
AND C.DISPLAY='1'
</select>
<select id="queryCustomerIcResiCategoryStatsConfig" parameterType="java.lang.String" resultType="com.epmet.dataaggre.dto.epmetuser.result.IcUserCategoryResultDTO">
SELECT
m.id AS configId,
m.COLUMN_NAME AS categoryKey,
m.LABEL AS categoryName,
m.DATA_ICON AS dataIcon
FROM
ic_resi_category_stats_config m
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
AND m.`STATUS`='show'
ORDER BY
m.SORT ASC
</select>
</mapper>

2
epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml

@ -9,7 +9,7 @@ services:
volumes:
- "/opt/epmet-cloud-logs/prod:/logs"
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx1024m -jar ./data-report.jar"
RUN_INSTRUCT: "java -Xms256m -Xmx1524m -jar ./data-report.jar"
restart: "unless-stopped"
deploy:
resources:

1
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java

@ -15,4 +15,5 @@ public interface DataSourceConstant {
String PARTY_MEMBER = "partyMember";
String EPMET_HEART="epmetHeart";
String EPMET_POINT = "epmetPoint";
String OPER_CUSTOMIZE="operCustomize";
}

18
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/customize/IcResiCategoryConfigDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto.customize;
import lombok.Data;
import java.io.Serializable;
@Data
public class IcResiCategoryConfigDTO implements Serializable {
private String configId;
/**
* 列名
*/
private String columnName;
private String itemLabel;
}

32
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IcUserCategoryAnalysisDailyFormDTO.java

@ -0,0 +1,32 @@
package com.epmet.dto.extract.form;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import java.io.Serializable;
/**
* 数字社区-人员类别分析按天计算入参
* 以下参数都可以为空
*/
@Data
public class IcUserCategoryAnalysisDailyFormDTO implements Serializable {
public interface AddUserInternalGroup {
}
private String customerId;
@Length(max = 8, message = "日期格式:yyyyMMdd", groups = AddUserInternalGroup.class)
private String dateId;
/**
* 开始时间
*/
@Length(max = 8, message = "开始日期日期格式:yyyyMMdd", groups = AddUserInternalGroup.class)
private String startDate;
/**
* 结束时间
*/
@Length(max = 8, message = "截止日期格式:yyyyMMdd", groups = AddUserInternalGroup.class)
private String endDate;
}

12
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/OrgIcUserTotalDTO.java

@ -0,0 +1,12 @@
package com.epmet.dto.user.result;
import lombok.Data;
import java.io.Serializable;
@Data
public class OrgIcUserTotalDTO implements Serializable {
private String orgId;
private Integer total;
private String columnName;
}

8
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java

@ -5,10 +5,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.StatsFormDTO;
import com.epmet.dto.basereport.form.EventInfoFormDTO;
import com.epmet.dto.basereport.result.EventInfoResultDTO;
import com.epmet.dto.extract.form.BizDataFormDTO;
import com.epmet.dto.extract.form.ExtractIndexFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.dto.extract.form.*;
import com.epmet.dto.group.form.GroupStatsFormDTO;
import com.epmet.dto.group.form.GroupTotalFormDTO;
import com.epmet.dto.org.form.GridBaseInfoFormDTO;
@ -365,4 +362,7 @@ public interface DataStatisticalOpenFeignClient {
*/
@PostMapping("/data/stats/shibeiICJob/userPointAndProjectStatus/{bizType}")
Result userPointAndProjectStatus(@PathVariable("bizType") String biztype,@RequestBody ExtractOriginFormDTO formDTO);
@PostMapping("/data/stats/ic/user/category-analysis-daily")
Result statUserCategoryDaily(@RequestBody IcUserCategoryAnalysisDailyFormDTO formDTO);
}

10
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java

@ -6,10 +6,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.StatsFormDTO;
import com.epmet.dto.basereport.form.EventInfoFormDTO;
import com.epmet.dto.basereport.result.EventInfoResultDTO;
import com.epmet.dto.extract.form.BizDataFormDTO;
import com.epmet.dto.extract.form.ExtractIndexFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.dto.extract.form.*;
import com.epmet.dto.group.form.GroupStatsFormDTO;
import com.epmet.dto.group.form.GroupTotalFormDTO;
import com.epmet.dto.org.form.GridBaseInfoFormDTO;
@ -344,4 +341,9 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
public Result userPointAndProjectStatus(String biztype,ExtractOriginFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "userPointAndProjectStatus", biztype,formDTO);
}
@Override
public Result statUserCategoryDaily(IcUserCategoryAnalysisDailyFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "statUserCategoryDaily", formDTO);
}
}

26
epmet-module/data-statistical/data-statistical-server/pom.xml

@ -260,6 +260,13 @@
<datasource.druid.epmetPoint.username>epmet_point_user</datasource.druid.epmetPoint.username>
<datasource.druid.epmetPoint.password>EpmEt-db-UsEr</datasource.druid.epmetPoint.password>
<!-- oper_customize-->
<datasource.druid.operCustomize.url>
<![CDATA[jdbc:mysql://192.168.1.140:3306/epmet_oper_customize?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.operCustomize.url>
<datasource.druid.operCustomize.username>epmet_oper_customize_user</datasource.druid.operCustomize.username>
<datasource.druid.operCustomize.password>EpmEt-db-UsEr</datasource.druid.operCustomize.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.140</spring.redis.host>
@ -382,6 +389,13 @@
<datasource.druid.epmetPoint.username>epmet_point_user</datasource.druid.epmetPoint.username>
<datasource.druid.epmetPoint.password>EpmEt-db-UsEr</datasource.druid.epmetPoint.password>
<!-- oper_customize-->
<datasource.druid.operCustomize.url>
<![CDATA[jdbc:mysql://192.168.1.140:3306/epmet_oper_customize?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.operCustomize.url>
<datasource.druid.operCustomize.username>epmet_oper_customize_user</datasource.druid.operCustomize.username>
<datasource.druid.operCustomize.password>EpmEt-db-UsEr</datasource.druid.operCustomize.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.140</spring.redis.host>
@ -504,6 +518,12 @@
<datasource.druid.epmetPoint.username>epmet</datasource.druid.epmetPoint.username>
<datasource.druid.epmetPoint.password>elink@833066</datasource.druid.epmetPoint.password>
<datasource.druid.operCustomize.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_oper_customize?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.operCustomize.url>
<datasource.druid.operCustomize.username>epmet</datasource.druid.operCustomize.username>
<datasource.druid.operCustomize.password>elink@833066</datasource.druid.operCustomize.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com</spring.redis.host>
@ -622,6 +642,12 @@
<datasource.druid.epmetPoint.username>epmet_point_user</datasource.druid.epmetPoint.username>
<datasource.druid.epmetPoint.password>EpmEt-db-UsEr</datasource.druid.epmetPoint.password>
<datasource.druid.operCustomize.url>
<![CDATA[jdbc:mysql://rm-m5e3vzs2637224wj9.mysql.rds.aliyuncs.com:3306/epmet_oper_customize?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.operCustomize.url>
<datasource.druid.operCustomize.username>epmet_oper_customize_user</datasource.druid.operCustomize.username>
<datasource.druid.operCustomize.password>EpmEt-db-UsEr</datasource.druid.operCustomize.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com</spring.redis.host>

76
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IcController.java

@ -0,0 +1,76 @@
package com.epmet.controller;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.extract.form.IcUserCategoryAnalysisDailyFormDTO;
import com.epmet.service.stats.DimCustomerService;
import com.epmet.service.stats.FactIcuserCategoryAnalysisDailyService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
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 java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
/**
* @Description 数字社区相关统计任务可以放这目前只有人员类别分析
* @Author yinzuomei
* @Date 2022/01/17
* @Version 1.0
*/
@RestController
@RequestMapping("ic")
public class IcController {
@Autowired
private FactIcuserCategoryAnalysisDailyService userCategoryAnalysisDailyService;
@Autowired
private DimCustomerService dimCustomerService;
/**
* 数字社区-基础信息-人员类别分析-每个类别的人员总数较上月迁入迁出人数
* 说明安调统计截止到当前dateId的党员总数+30迁入党员+之前的居民在本月内变更为党员身份的-10在本月丢失党员身份的人+迁出的人
* @return
*/
@PostMapping("/user/category-analysis-daily")
public Result statUserCategoryDaily(@RequestBody IcUserCategoryAnalysisDailyFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, IcUserCategoryAnalysisDailyFormDTO.AddUserInternalGroup.class);
List<String> customerIds = new ArrayList<>();
if (StringUtils.isNotBlank(formDTO.getCustomerId())) {
customerIds.add(formDTO.getCustomerId());
} else {
//未指定客户,则查询dim_customer表
customerIds = dimCustomerService.selectCustomerIdPage(NumConstant.ONE, NumConstant.ONE_THOUSAND);
}
if (CollectionUtils.isNotEmpty(customerIds)) {
customerIds.forEach(customerId -> {
if (StringUtils.isNotBlank(formDTO.getStartDate()) && StringUtils.isNotBlank(formDTO.getEndDate())) {
//[a,b]yyyyMMdd
List<String> daysBetween = DateUtils.getDaysBetween(formDTO.getStartDate(), formDTO.getEndDate());
daysBetween.forEach(dateId -> {
//计算网格维度的数据
userCategoryAnalysisDailyService.statUserCategoryGridDaily(customerId, dateId);
});
} else if (StringUtils.isNotBlank(formDTO.getDateId())) {
//计算网格维度的数据
userCategoryAnalysisDailyService.statUserCategoryGridDaily(customerId, formDTO.getDateId());
} else {
//计算网格维度的数据
//当前时间的前一天yyyyMMdd
String dateId = LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", "");
userCategoryAnalysisDailyService.statUserCategoryGridDaily(customerId, dateId);
}
});
}
return new Result();
}
}

17
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiICJobController.java

@ -35,6 +35,8 @@ public class ShiBeiICJobController {
private StatsProjectService statsProjectService;
@Autowired
private RedisUtils redisUtils;
@Autowired
private com.epmet.service.stats.FactIcuserCategoryAnalysisDailyService userCategoryAnalysisDailyService;
@PostMapping("userPointAndProjectStatus/{bizType}")
public Result<String> userPointAndProjectStatus(@PathVariable("bizType") String bizType, @RequestBody ExtractOriginFormDTO formDTO) {
@ -66,6 +68,7 @@ public class ShiBeiICJobController {
private void executeMethod(String bizType, String customerId, String d) {
if (bizType.equals(BizTypeEnum.USER.getType())){
this.extractUserPointData(customerId, d);
this.statUserCategoryGridDaily(customerId, d);
}
if (bizType.equals(BizTypeEnum.PROJECT.getType())) {
this.agencyProjectStats(customerId, d);
@ -103,4 +106,18 @@ public class ShiBeiICJobController {
log.error("市北-热心市民/党员得分数据写入失败,参数为:{}" + customerId + StrConstant.HYPHEN + dateId, e);
}
}
/**
* desc:抽取 用户类别分析数据
* @param customerId
* @param dateId
*/
private void statUserCategoryGridDaily(String customerId, String dateId) {
try {
//用户 类别分析
userCategoryAnalysisDailyService.statUserCategoryGridDaily(customerId, dateId);
} catch (Exception e) {
log.error("市北-居民分类分析数据写入失败,参数为:{}" + customerId + StrConstant.HYPHEN + dateId, e);
}
}
}

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/customize/IcResiCategoryStatsConfigDao.java

@ -0,0 +1,14 @@
package com.epmet.dao.customize;
import com.epmet.dto.customize.IcResiCategoryConfigDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface IcResiCategoryStatsConfigDao {
List<IcResiCategoryConfigDTO> queryDataColumn(String customerId);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java

@ -64,7 +64,7 @@ public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao<FactOriginPr
* @author wangc
* @date 2020.10.19 16:26
*/
void deleteByProjectIds(@Param("list") List<String> list,@Param("customerId") String customerId);
void deleteByProjectIds(@Param("list") List<String> list, @Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @Description 批量插入

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java

@ -128,7 +128,7 @@ public interface ProjectProcessDao extends BaseDao<ProjectProcessEntity> {
* @author wangc
* @date 2020.10.23 11:13
*/
List<ProjectOrgPeriodResultDTO> selectProjectOrgPeriodDirectly(@Param("customerId") String customerId, @Param("projectId") String projectId);
List<ProjectOrgPeriodResultDTO> selectProjectOrgPeriodDirectly(@Param("customerId") String customerId, @Param("datetId")String datetId, @Param("projectId") String projectId);
/**
* @param projects

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIcuserCategoryAnalysisDailyDao.java

@ -0,0 +1,20 @@
package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.FactIcuserCategoryAnalysisDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 人员类别分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-17
*/
@Mapper
public interface FactIcuserCategoryAnalysisDailyDao extends BaseDao<FactIcuserCategoryAnalysisDailyEntity> {
int limitDelete(@Param("customerId")String customerId,
@Param("dateId")String dateId,
@Param("orgType")String orgType);
}

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java

@ -269,5 +269,19 @@ public interface UserDao {
List<String> filterUserIds(@Param("userIds") List<String> userIds, @Param("roleKey") String roleKey);
List<PatrolRoutineWorkResult> selectRoutineWorkListByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId);
List<OrgIcUserTotalDTO> selectCountForGrid(@Param("customerId") String customerId,
@Param("columnName") String columnName);
OrgIcUserTotalDTO selectCountForAgency(@Param("customerId") String customerId,
@Param("columnName") String columnName,
@Param("agencyId") String agencyId);
List<OrgIcUserTotalDTO> selectGridIcUserCategoryTotal(@Param("customerId")String customerId, @Param("dateId")String dateId);
List<OrgIcUserTotalDTO> selectGridIcUserCategoryIncr(@Param("customerId")String customerId,
@Param("startDate")String startDate,
@Param("endDate")String endDate,
@Param("type")String type);
}

74
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIcuserCategoryAnalysisDailyEntity.java

@ -0,0 +1,74 @@
package com.epmet.entity.stats;
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 2022-01-17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_icuser_category_analysis_daily")
public class FactIcuserCategoryAnalysisDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 预警配置ID
*/
private String configId;
/**
* 类别列名对个数据太麻烦了在这个表存一下
*/
private String columnName;
/**
* 当前数据是截止到XXX的yyyyMMdd
*/
private String dateId;
/**
* 网格id或者组织id
*/
private String orgId;
/**
* grid或者agency
*/
private String orgType;
/**
* orgid的上级
*/
private String pid;
/**
* orgid的所有上级
*/
private String pids;
/**
* 当前类别总人数
*/
private Integer total;
/**
* 较上月迁出
*/
private Integer qcIncr;
/**
* 较上月迁入
*/
private Integer qrIncr;
}

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/customize/IcResiCategoryStatsConfigService.java

@ -0,0 +1,22 @@
package com.epmet.service.customize;
import com.epmet.dto.customize.IcResiCategoryConfigDTO;
import java.util.List;
/**
* 居民类别配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
public interface IcResiCategoryStatsConfigService {
/**
* 返回用于数据分析的列名+居民类别配置表的id
* @param customerId
* @return
*/
List<IcResiCategoryConfigDTO> queryDataColumn(String customerId);
}

40
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/customize/impl/IcResiCategoryStatsConfigServiceImpl.java

@ -0,0 +1,40 @@
package com.epmet.service.customize.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.customize.IcResiCategoryStatsConfigDao;
import com.epmet.dto.customize.IcResiCategoryConfigDTO;
import com.epmet.service.customize.IcResiCategoryStatsConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 居民类别配置表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-04
*/
@Slf4j
@DataSource(DataSourceConstant.OPER_CUSTOMIZE)
@Service
public class IcResiCategoryStatsConfigServiceImpl implements IcResiCategoryStatsConfigService{
@Autowired
private IcResiCategoryStatsConfigDao baseDao;
/**
* 返回用于数据分析的列名+居民类别配置表的id
*
* @param customerId
* @return
*/
@Override
public List<IcResiCategoryConfigDTO> queryDataColumn(String customerId) {
return baseDao.queryDataColumn(customerId);
}
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java

@ -452,7 +452,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
@Override
public void extractProjectPeriodData(ExtractOriginFormDTO param) {
List<ProjectOrgPeriodResultDTO> extractData =
projectProcessService.getProjectPeriodDirectly(param.getCustomerId(), param.getObjectId());
projectProcessService.getProjectPeriodDirectly(param.getCustomerId(), param.getDateId(), param.getObjectId());
List<FactOriginProjectOrgPeriodDailyEntity> formattingData = new LinkedList<>();
extractData.forEach(original -> {
FactOriginProjectOrgPeriodDailyEntity dest
@ -494,14 +494,17 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
});
if (!CollectionUtils.isEmpty(formattingData)) {
List<String> projectList = new ArrayList<>();
projectList.add(param.getObjectId());
factOriginProjectOrgPeriodDailyDao.deleteByProjectIds(projectList, param.getCustomerId());
if (StringUtils.isNotEmpty(param.getObjectId())) {
projectList.add(param.getObjectId());
}
factOriginProjectOrgPeriodDailyDao.deleteByProjectIds(projectList, param.getCustomerId(), param.getDateId());
Lists.partition(formattingData, NumConstant.ONE_HUNDRED)
.forEach(part -> factOriginProjectOrgPeriodDailyDao.insertBatch(part));
}
}
/**
* @Description 项目节点耗时数据补齐
* @param

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java

@ -136,4 +136,6 @@ public interface ScreenCustomerGridService extends BaseService<ScreenCustomerGri
* @return
*/
Date getLastSyncEndTime();
List<ScreenCustomerGridEntity> getByCustomerId(String customerId);
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java

@ -290,4 +290,11 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl<ScreenCustome
public Date getLastSyncEndTime() {
return dimLastSyncRecordDao.getDimLastSyncEndTime("grid");
}
@Override
public List<ScreenCustomerGridEntity> getByCustomerId(String customerId) {
LambdaQueryWrapper<ScreenCustomerGridEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ScreenCustomerGridEntity::getCustomerId, customerId);
return baseDao.selectList(wrapper);
}
}

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java

@ -246,9 +246,9 @@ public class DataReportingServiceImpl implements DataReportingService {
dto.setEventDescription(project.getProjectContent());
dto.setSuccessfulOrNo(ProjectConstant.CLOSED_CASE.equals(project.getProjectStatusCode())?"Y":"N");
if (ProjectConstant.CLOSED_CASE.equals(project.getProjectStatusCode())) {
dto.setWaysOfResolving(project.getOrgId().equals(project.getFinishOrg())?ProjectConstant.PROJECT_SELF_CLOSED:ProjectConstant.PROJECT_REPORT);
//办结组织是机关时,办结层级为机关的层级
if (OrgTypeConstant.AGENCY.equals(project.getFinishOrgType())) {
dto.setWaysOfResolving(ProjectConstant.PROJECT_REPORT);
//如果是孔村的项目办结层级需要降一级
if("2fe0065f70ca0e23ce4c26fca5f1d933".equals(project.getCustomerId())) {
if (StringUtils.isNotBlank(project.getFinishOrgLevel())) {
@ -268,6 +268,7 @@ public class DataReportingServiceImpl implements DataReportingService {
dto.setCompleteLevel(getCompleteLevel(project.getFinishOrgLevel()));
}
} else if (OrgTypeConstant.DEPARTMENT.equals(project.getFinishOrgType())) {
dto.setWaysOfResolving(ProjectConstant.PROJECT_REPORT);
//办结组织是部门时,办结层级为部门所在组织的曾经
String[] orgIds = project.getOrgIdPath().split(StrConstant.COLON);
int size = orgIds.length;
@ -276,6 +277,7 @@ public class DataReportingServiceImpl implements DataReportingService {
dto.setCompleteLevel(getCompleteLevel(agency.getLevel()));
}
} else {
dto.setWaysOfResolving(ProjectConstant.PROJECT_SELF_CLOSED);
//办结组织是网格时,办结层级为网格
dto.setCompleteLevel("5");
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java

@ -112,7 +112,7 @@ public interface ProjectProcessService extends BaseService<ProjectProcessEntity>
* @author wangc
* @date 2020.10.23 09:10
*/
List<ProjectOrgPeriodResultDTO> getProjectPeriodDirectly(String customerId, String projectId);
List<ProjectOrgPeriodResultDTO> getProjectPeriodDirectly(String customerId, String datetId, String projectId);
/**
* 获取办结组织

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java

@ -101,15 +101,15 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao
* @Description 直接从项目业务改造获取项目节点耗时信息
* @param
* @param customerId
* @param date
* @param datetId
* @param projectId
* @return java.util.List<com.epmet.dto.project.result.ProjectOrgPeriodResultDTO>
* @author wangc
* @date 2020.10.23 09:10
*/
@Override
public List<ProjectOrgPeriodResultDTO> getProjectPeriodDirectly(String customerId, String projectId) {
return baseDao.selectProjectOrgPeriodDirectly(customerId, projectId);
public List<ProjectOrgPeriodResultDTO> getProjectPeriodDirectly(String customerId, String datetId, String projectId) {
return baseDao.selectProjectOrgPeriodDirectly(customerId, datetId, projectId);
}
@Override

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIcuserCategoryAnalysisDailyService.java

@ -0,0 +1,20 @@
package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.stats.FactIcuserCategoryAnalysisDailyEntity;
/**
* 人员类别分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-17
*/
public interface FactIcuserCategoryAnalysisDailyService extends BaseService<FactIcuserCategoryAnalysisDailyEntity> {
/**
* 数字社区-基础信息-人员类别分析-每个类别的人员总数较上月迁入迁出人数
* 网格
* @param customerId
* @param dateId
*/
void statUserCategoryGridDaily(String customerId, String dateId);
}

198
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIcuserCategoryAnalysisDailyServiceImpl.java

@ -0,0 +1,198 @@
package com.epmet.service.stats.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.enums.OrgTypeEnum;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.stats.FactIcuserCategoryAnalysisDailyDao;
import com.epmet.dto.customize.IcResiCategoryConfigDTO;
import com.epmet.dto.user.result.OrgIcUserTotalDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;
import com.epmet.entity.stats.FactIcuserCategoryAnalysisDailyEntity;
import com.epmet.service.customize.IcResiCategoryStatsConfigService;
import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService;
import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService;
import com.epmet.service.stats.FactIcuserCategoryAnalysisDailyService;
import com.epmet.service.user.UserService;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 人员类别分析
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-17
*/
@Service
@Slf4j
@DataSource(DataSourceConstant.STATS)
public class FactIcuserCategoryAnalysisDailyServiceImpl extends BaseServiceImpl<FactIcuserCategoryAnalysisDailyDao, FactIcuserCategoryAnalysisDailyEntity> implements FactIcuserCategoryAnalysisDailyService {
@Autowired
private IcResiCategoryStatsConfigService icResiCategoryStatsConfigService;
@Autowired
private ScreenCustomerAgencyService agencyService;
@Autowired
private ScreenCustomerGridService gridService;
@Autowired
private UserService userService;
/**
* 数字社区-基础信息-人员类别分析-每个类别的人员总数较上月迁入迁出人数
*
* @param customerId
* @param dateId
*/
@Override
public void statUserCategoryGridDaily(String customerId, String dateId) {
//查询出所有用语数据分析的类别column_name,没有则不计算
List<IcResiCategoryConfigDTO> columnList = icResiCategoryStatsConfigService.queryDataColumn(customerId);
if (CollectionUtils.isEmpty(columnList)) {
return;
}
//所有网格查询出来
List<ScreenCustomerGridEntity> gridDTOList = gridService.getByCustomerId(customerId);
if (CollectionUtils.isEmpty(gridDTOList)) {
return;
}
//网格维度、组织维度初始好数据
List<FactIcuserCategoryAnalysisDailyEntity> initList = constructInitValue(customerId, dateId, gridDTOList, columnList);
if (CollectionUtils.isEmpty(initList)) {
return;
}
//当这3个数都为0的时候不插入数据库了
List<FactIcuserCategoryAnalysisDailyEntity> insertList = initList.stream().filter(entity -> (null != entity.getTotal() && entity.getTotal() > 0)
|| (null != entity.getQcIncr() && entity.getQcIncr() > 0)
|| (null != entity.getQrIncr() && entity.getQrIncr() > 0)).collect(Collectors.toList());
//删除旧数据
clearOldDatas(customerId, dateId, OrgTypeEnum.GRID.getCode());
// 批量插入数据
Lists.partition(insertList, NumConstant.ONE_HUNDRED).forEach(list -> {
insertBatch(list);
});
}
/**
* 删除旧数据
*
* @param customerId
* @param dateId
* @param orgType gridagency
*/
private void clearOldDatas(String customerId, String dateId, String orgType) {
int deleteNum;
do {
//每次删除1000条
deleteNum = baseDao.limitDelete(customerId, dateId, orgType);
} while (deleteNum != NumConstant.ZERO);
}
/**
* @param customerId
* @param dateId yyyyMMdd
* @param gridDTOList 当前客户下所有的网格
* @param columnList 所有需要分析的类别对应的ic_resi_user的列名目前只有18类
* @return
*/
private List<FactIcuserCategoryAnalysisDailyEntity> constructInitValue(String customerId, String dateId, List<ScreenCustomerGridEntity> gridDTOList, List<IcResiCategoryConfigDTO> columnList) {
List<FactIcuserCategoryAnalysisDailyEntity> list = new ArrayList<>();
//1、total
// 查询明细ic_user_change_detailed变更明细表,各个网格的各个分类的总人数
Map<String, List<OrgIcUserTotalDTO>> totalMapList = userService.calGridIcUserTotal(customerId, dateId);
String monthId = dateId.substring(NumConstant.ZERO, NumConstant.SIX);
String startDate = monthId.concat("01");
String endDate = dateId;
//2、迁入+30:eg:dateId:20211226, [20211201,20211226],类别sum值=1的
Map<String, List<OrgIcUserTotalDTO>> qrList = userService.calGridIcUserIncr(customerId, startDate, endDate, "qr");
//3、迁出 -10 :eg:dateId:20211226, [20211201,20211226],类别sum值 !=1的
Map<String, List<OrgIcUserTotalDTO>> qcList = userService.calGridIcUserIncr(customerId, startDate, endDate, "qc");
for (IcResiCategoryConfigDTO config : columnList) {
gridDTOList.forEach(grid -> {
FactIcuserCategoryAnalysisDailyEntity gridData = new FactIcuserCategoryAnalysisDailyEntity();
gridData.setCustomerId(customerId);
gridData.setConfigId(config.getConfigId());
gridData.setColumnName(config.getColumnName());
gridData.setDateId(dateId);
gridData.setOrgId(grid.getGridId());
gridData.setOrgType(OrgTypeEnum.GRID.getCode());
gridData.setPid(StringUtils.isNotBlank(grid.getParentAgencyId()) ? grid.getParentAgencyId() : NumConstant.ZERO_STR);
gridData.setPids(grid.getAllParentIds());
//截止到目前累计值
boolean totalZeroFlag = true;
if (MapUtils.isNotEmpty(totalMapList) && totalMapList.containsKey(grid.getGridId())) {
//当前网格下,有的类别
List<OrgIcUserTotalDTO> crrentGrid = totalMapList.get(grid.getGridId());
if (CollectionUtils.isNotEmpty(crrentGrid)) {
//各个类别对应的数
Map<String, Integer> categoryTotalMap = crrentGrid.stream().collect(Collectors.toMap(OrgIcUserTotalDTO::getColumnName, OrgIcUserTotalDTO::getTotal, (key1, key2) -> key2));
if (MapUtils.isNotEmpty(categoryTotalMap) && categoryTotalMap.containsKey(config.getColumnName())) {
totalZeroFlag = false;
gridData.setTotal(categoryTotalMap.get(config.getColumnName()));
}
}
}
if (totalZeroFlag) {
gridData.setTotal(NumConstant.ZERO);
}
//较上月迁入
boolean incrZeroFlag = true;
if (MapUtils.isNotEmpty(qrList) && qrList.containsKey(grid.getGridId())) {
//当前网格下,有的类别
List<OrgIcUserTotalDTO> crrentGrid = qrList.get(grid.getGridId());
if (CollectionUtils.isNotEmpty(crrentGrid)) {
//各个类别对应的数
Map<String, Integer> categoryTotalMap = crrentGrid.stream().collect(Collectors.toMap(OrgIcUserTotalDTO::getColumnName, OrgIcUserTotalDTO::getTotal, (key1, key2) -> key2));
if (MapUtils.isNotEmpty(categoryTotalMap) && categoryTotalMap.containsKey(config.getColumnName())) {
incrZeroFlag = false;
gridData.setQrIncr(categoryTotalMap.get(config.getColumnName()));
}
}
}
if (incrZeroFlag) {
gridData.setQrIncr(NumConstant.ZERO);
}
// 较上月迁出:
boolean qcZeroFlag = true;
if (MapUtils.isNotEmpty(qcList) && qcList.containsKey(grid.getGridId())) {
//当前网格下,有的类别
List<OrgIcUserTotalDTO> crrentGridQc = qcList.get(grid.getGridId());
if (CollectionUtils.isNotEmpty(crrentGridQc)) {
//各个类别对应的数
Map<String, Integer> categoryTotalMap = crrentGridQc.stream().collect(Collectors.toMap(OrgIcUserTotalDTO::getColumnName, OrgIcUserTotalDTO::getTotal, (key1, key2) -> key2));
if (MapUtils.isNotEmpty(categoryTotalMap) && categoryTotalMap.containsKey(config.getColumnName())) {
qcZeroFlag = false;
gridData.setQcIncr(categoryTotalMap.get(config.getColumnName()));
}
}
}
if (qcZeroFlag) {
gridData.setQcIncr(NumConstant.ZERO);
}
list.add(gridData);
});
}
return list;
}
}

29
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java

@ -157,4 +157,33 @@ public interface UserService {
* @return
*/
List<PatrolRoutineWorkResult> selectRoutineWorkListByDateId(String customerId, String dateId);
Map<String,Integer> selectCountForGrid(String customerId, String columnName);
/**
*
* @param customerId
* @param columnName
* @param agencyIds
* @return
*/
Map<String, Integer> selectCountForGrid(String customerId, String columnName, List<String> agencyIds);
/**
*
* @param customerId
* @param dateId 截止到这一天的各个网格下每个分类的总人数
* @return
*/
Map<String, List<OrgIcUserTotalDTO>> calGridIcUserTotal(String customerId, String dateId);
/**
*
* @param customerId
* @param startDate 变动时间在此范围内的 yyyyMMdd
* @param endDate :yyyyMMdd
* @param type:qr:迁入qc:迁出
* @return
*/
Map<String, List<OrgIcUserTotalDTO>> calGridIcUserIncr(String customerId, String startDate, String endDate, String type);
}

101
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java

@ -1126,4 +1126,105 @@ public class UserServiceImpl implements UserService {
public List<PatrolRoutineWorkResult> selectRoutineWorkListByDateId(String customerId, String dateId) {
return userDao.selectRoutineWorkListByDateId(customerId, dateId);
}
/**
*
* @param customerId
* @param columnName
* @return 截止到目前每个网格内某个分类的总人数
*/
@Override
public Map<String, Integer> selectCountForGrid(String customerId, String columnName) {
Map<String, Integer> map = new HashMap<>();
List<OrgIcUserTotalDTO> list = userDao.selectCountForGrid(customerId, columnName);
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)) {
map = list.stream().collect(Collectors.toMap(OrgIcUserTotalDTO::getOrgId, OrgIcUserTotalDTO::getTotal));
}
return map;
}
/**
* @param customerId
* @param columnName
* @param agencyIds
* @return 截止到目前各个组织内某个分类的总人数
*/
@Override
public Map<String, Integer> selectCountForGrid(String customerId, String columnName, List<String> agencyIds) {
Map<String, Integer> map = new HashMap<>();
if (CollectionUtils.isEmpty(agencyIds)) {
return map;
}
List<OrgIcUserTotalDTO> list = new ArrayList<>();
for (String agencyId:agencyIds) {
OrgIcUserTotalDTO dto=new OrgIcUserTotalDTO();
dto.setOrgId(agencyId);
OrgIcUserTotalDTO totalDto=userDao.selectCountForAgency(customerId,columnName,agencyId);
dto.setTotal(null!=totalDto?totalDto.getTotal():NumConstant.ZERO);
list.add(dto);
}
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)) {
map = list.stream().collect(Collectors.toMap(OrgIcUserTotalDTO::getOrgId, OrgIcUserTotalDTO::getTotal));
}
return map;
}
/**
* @param customerId
* @param dateId 截止到这一天的各个网格下每个分类的总人数
* @return
*/
@Override
public Map<String, List<OrgIcUserTotalDTO>> calGridIcUserTotal(String customerId, String dateId) {
Map<String, List<OrgIcUserTotalDTO>> resultMap=new HashMap<>();
List<OrgIcUserTotalDTO> list=userDao.selectGridIcUserCategoryTotal(customerId,dateId);
if(CollectionUtils.isEmpty(list)){
return resultMap;
}
// list 数据
// gridId columnName total
// 1001 IS_DBH 1
// 1001 IS_PARTY 1
// 1002 IS_DBH 1
// 1002 IS_ENSURE_HOUSE 1
// 1003 IS_VETERANS 1
// 1004 IS_PARTY 1
for(OrgIcUserTotalDTO dto:list){
if(resultMap.containsKey(dto.getOrgId())){
resultMap.get(dto.getOrgId()).add(dto);
continue;
}
List<OrgIcUserTotalDTO> newList=new ArrayList<>();
newList.add(dto);
resultMap.put(dto.getOrgId(),newList);
}
return resultMap;
}
/**
* @param customerId
* @param startDate 变动时间在此范围内的 yyyyMMdd
* @param endDate :yyyyMMdd
* @param type :qr:迁入qc:迁出
* @return
*/
@Override
public Map<String, List<OrgIcUserTotalDTO>> calGridIcUserIncr(String customerId, String startDate, String endDate, String type) {
Map<String, List<OrgIcUserTotalDTO>> resultMap=new HashMap<>();
List<OrgIcUserTotalDTO> list=userDao.selectGridIcUserCategoryIncr(customerId,startDate,endDate,type);
if(CollectionUtils.isEmpty(list)){
return resultMap;
}
for(OrgIcUserTotalDTO dto:list){
if(resultMap.containsKey(dto.getOrgId())){
resultMap.get(dto.getOrgId()).add(dto);
continue;
}
List<OrgIcUserTotalDTO> newList=new ArrayList<>();
newList.add(dto);
resultMap.put(dto.getOrgId(),newList);
}
return resultMap;
}
}

5
epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml

@ -188,6 +188,11 @@ dynamic:
url: @datasource.druid.epmetPoint.url@
username: @datasource.druid.epmetPoint.username@
password: @datasource.druid.epmetPoint.password@
operCustomize:
driver-class-name: com.mysql.cj.jdbc.Driver
url: @datasource.druid.operCustomize.url@
username: @datasource.druid.operCustomize.username@
password: @datasource.druid.operCustomize.password@
thread:
# 线程池配置

21
epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.28__fact_icuser_category_analysis_daily.sql

@ -0,0 +1,21 @@
CREATE TABLE `fact_icuser_category_analysis_daily` (
`ID` varchar(32) NOT NULL COMMENT '主键(人员类别分析表)',
`CUSTOMER_ID` varchar(32) NOT NULL COMMENT '客户id',
`CONFIG_ID` varchar(64) NOT NULL COMMENT '预警配置ID',
`COLUMN_NAME` varchar(32) NOT NULL COMMENT '列名',
`DATE_ID` varchar(8) NOT NULL COMMENT '当前数据是截止到XXX的:yyyyMMdd',
`ORG_ID` varchar(32) NOT NULL COMMENT '网格id或者组织id',
`ORG_TYPE` varchar(10) NOT NULL COMMENT 'grid或者agency',
`PID` varchar(32) NOT NULL COMMENT 'orgid的上级',
`PIDS` varchar(255) NOT NULL COMMENT 'orgid的所有上级',
`TOTAL` int(11) NOT NULL COMMENT '当前类别总人数',
`QR_INCR` int(11) NOT NULL COMMENT '较上月迁入',
`QC_INCR` int(11) NOT NULL COMMENT '较上月迁出',
`DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='人员类别分析(目前只统计了网格)';

23
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/customize/IcResiCategoryStatsConfigDao.xml

@ -0,0 +1,23 @@
<?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.dao.customize.IcResiCategoryStatsConfigDao">
<select id="queryDataColumn" parameterType="java.lang.String" resultType="com.epmet.dto.customize.IcResiCategoryConfigDTO">
SELECT
m.COLUMN_NAME as columnName,
c.id as configId,
m.LABEL as itemLabel
FROM
ic_form_item m
INNER JOIN ic_resi_category_stats_config c ON ( m.CUSTOMER_ID = c.CUSTOMER_ID AND m.COLUMN_NAME = c.COLUMN_NAME AND c.DEL_FLAG = '0' )
WHERE
m.DEL_FLAG = '0'
AND m.DATA_ANALYSE = '1'
AND m.CUSTOMER_ID = #{customerId}
ORDER BY
m.SORT ASC
</select>
</mapper>

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml

@ -40,6 +40,7 @@
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND (DATE_FORMAT(INFORMED_DATE,"%Y%m%d") &gt;= #{dateId} OR DATE_FORMAT(HANDLED_DATE,"%Y%m%d") &gt;= #{dateId} OR DATE_FORMAT(PERIOD_TILL_REPLY_FIRSTLY,"%Y%m%d") &gt;= #{dateId})
<if test="null != list and list.size() > 0">
<foreach collection="list" open="AND ( " close=" )" separator=" OR " item="item">
PROJECT_ID = #{item}

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml

@ -177,7 +177,7 @@
FROM PROJECT_STAFF staff
INNER JOIN PROJECT_ORG_RELATION relation ON staff.ID = relation.PROJECT_STAFF_ID AND relation.DEL_FLAG = '0'
AND (DATE_FORMAT(FIRST_DEALT_DATE,"%Y%m%d") &gt;= #{datetId} OR DATE_FORMAT(HANDLED_DATE,"%Y%m%d") &gt;= #{datetId} OR DATE_FORMAT(INFORMED_DATE,"%Y%m%d") &gt;= #{datetId})
WHERE staff.DEL_FLAG = '0'
<if test="projectId != null and projectId != ''">
AND staff.PROJECT_ID = #{projectId}

13
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIcuserCategoryAnalysisDailyDao.xml

@ -0,0 +1,13 @@
<?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.dao.stats.FactIcuserCategoryAnalysisDailyDao">
<delete id="limitDelete" parameterType="map">
delete from fact_icuser_category_analysis_daily
where CUSTOMER_ID = #{customerId}
and date_id=#{dateId}
and org_type=#{orgType}
limit 1000
</delete>
</mapper>

82
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml

@ -1074,4 +1074,86 @@
</select>
<select id="selectCountForGrid" parameterType="map" resultType="com.epmet.dto.user.result.OrgIcUserTotalDTO">
SELECT
m.grid_id as orgId
count(*) AS total,
#{columnName} as columnName
FROM
ic_resi_user m
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
AND concat('m.',${columnName}) = '1'
AND m.GRID_ID=#{gridId}
group by m.grid_id
</select>
<select id="selectCountForAgency" parameterType="map" resultType="com.epmet.dto.user.result.OrgIcUserTotalDTO">
SELECT
#{agencyId} as orgId,
count(*) AS total,
#{columnName} as columnName
FROM
ic_resi_user m
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
AND concat('m.',${columnName}) = '1'
AND ( m.AGENCY_ID = #{agencyId} OR M.PIDS LIKE CONCAT( '%', #{agencyId}, '%' ) )
</select>
<select id="selectGridIcUserCategoryTotal" parameterType="map" resultType="com.epmet.dto.user.result.OrgIcUserTotalDTO">
select
temp.orgId,
temp.FIELD_NAME as columnName,
count(temp.IC_USER_ID) as total
from (
SELECT
d.GRID_ID as orgId,
d.IC_USER_ID,
d.FIELD_NAME,
sum(d.`VALUE`)as result
FROM
ic_user_change_detailed d
WHERE
d.DEL_FLAG = '0'
AND d.CUSTOMER_ID = #{customerId}
AND DATE_FORMAT( d.CREATED_TIME, '%Y%m%d' ) &lt;= #{dateId}
group by d.GRID_ID,d.IC_USER_ID,d.FIELD_NAME
)temp
where temp.result=1
group by temp.orgId,temp.FIELD_NAME
</select>
<select id="selectGridIcUserCategoryIncr" parameterType="map" resultType="com.epmet.dto.user.result.OrgIcUserTotalDTO">
select
temp.orgId,
temp.FIELD_NAME as columnName,
count(temp.IC_USER_ID) as total
from (
SELECT
d.GRID_ID as orgId,
d.IC_USER_ID,
d.FIELD_NAME,
sum(d.`VALUE`)as result
FROM
ic_user_change_detailed d
WHERE
d.DEL_FLAG = '0'
AND d.CUSTOMER_ID = #{customerId}
AND DATE_FORMAT( d.CREATED_TIME, '%Y%m%d' ) &gt;= #{startDate}
AND DATE_FORMAT( d.CREATED_TIME, '%Y%m%d' ) &lt;= #{endDate}
group by d.GRID_ID,d.IC_USER_ID,d.FIELD_NAME
)temp
where 1=1
<if test="type != null and type == 'qr'">
and temp.result=1
</if>
<if test="type != null and type == 'qc'">
and temp.result = -1
</if>
group by temp.orgId,temp.FIELD_NAME
</select>
</mapper>

115
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitCompletionDTO.java

@ -0,0 +1,115 @@
package com.epmet.dto;
import com.epmet.commons.tools.validator.group.AddGroup;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
* 联建单位完成情况
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-17
*/
@Data
public class IcPartyUnitCompletionDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
*
*/
private String pids;
/**
* 单位ID
*/
@NotNull(message = "单位ID不能为空",groups = AddGroup.class)
private String unitId;
/**
* 类型 monthly月度quarter季度
*/
@NotNull(message = "类型不能为空",groups = AddGroup.class)
private String type;
/**
* 评分 百分制
*/
@NotNull(message = "评分不能为空",groups = AddGroup.class)
private String score;
/**
* 完成情况1已完成0未完成
*/
@NotNull(message = "完成情况不能为空",groups = AddGroup.class)
private String status;
/**
* 年份
*/
@NotNull(message = "年份不能为空",groups = AddGroup.class)
private String year;
/**
* 月或季度
*/
@NotNull(message = "月或季度",groups = AddGroup.class)
private String monthQuarter;
private String monthQuarterName;
/**
* 时间
*/
private String recordDate;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java

@ -115,6 +115,11 @@ public class IcPartyUnitDTO implements Serializable {
*/
private String satisfaction;
/**
* 评分
*/
private Integer score;
/**
* 备注
*/

18
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CompletionFormDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/1/17 15:46
*/
@Data
public class CompletionFormDTO implements Serializable {
private static final long serialVersionUID = 4925867264241549310L;
private String unitId;
private Integer pageNo = 1;
private Integer pageSize = 10;
}

40
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PointRecordFormDTO.java

@ -0,0 +1,40 @@
package com.epmet.dto.form;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/1/18 9:34
*/
@NoArgsConstructor
@Data
public class PointRecordFormDTO implements Serializable {
private static final long serialVersionUID = -5200348821951188343L;
/**
* 服务方类型社会组织social_org社区自组织community_org区域党建单位party_unit
*/
private String serviceType;
/**
* 服务方ID
*/
private String serviceId;
/**
* 开始时间
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date startTime;
/**
* 结束时间
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date endTime;
private Integer pageNo = 1;
private Integer pageSize = 10;
private String customerId;
}

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

@ -53,4 +53,9 @@ public class PageListAnalysisFormDTO implements Serializable {
* 数据分析-服务措施分析排除已取消
*/
private String excludeStatus;
/**
* 搜索关键词
*/
private String keyword;
}

33
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceItemAddFormDTO.java

@ -0,0 +1,33 @@
package com.epmet.dto.form.demand;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* 新增或者修改服务事项分类
*/
@Data
public class ServiceItemAddFormDTO implements Serializable {
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId;
@NotBlank(message = "分类名称不能为空", groups = AddUserShowGroup.class)
@Length(max = 100, message = "分类名称至多输入100字", groups = AddUserShowGroup.class)
private String categoryName;
@NotNull(message = "", groups = AddUserShowGroup.class)
private Integer awardPoint;
private String categoryId;
}

20
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceItemPageFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.form.demand;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 服务事项分类列表查询入参
* 目前不分页
*/
@Data
public class ServiceItemPageFormDTO extends PageFormDTO implements Serializable {
public interface AddUserInternalGroup {}
@NotBlank(message = "客户id不能为空",groups = AddUserInternalGroup.class)
private String customerId;
}

24
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceItemSelectFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.form.demand;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@Data
public class ServiceItemSelectFormDTO implements Serializable {
private static final long serialVersionUID = 1689002457565460495L;
public interface AddUserInternalGroup {
}
/**
* all:查询全部
* usable可用的
* 默认查询全部
*/
private String type;
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId;
}

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/StatusFormDTO.java

@ -17,4 +17,7 @@ public class StatusFormDTO implements Serializable {
@NotNull(message = "usableFlag不能为空", groups = AddUserInternalGroup.class)
private Boolean usableFlag;
@NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class)
private String userId;
}

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java

@ -74,4 +74,9 @@ public class UserDemandPageFormDTO extends PageFormDTO implements Serializable {
* 希望截止
*/
private String wantServiceEndTime;
/**
* 搜索关键词
*/
private String keyword;
}

6
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java

@ -67,7 +67,10 @@ public class CommunitySelfOrganizationListDTO implements Serializable {
* 社区自组织ID
*/
private String orgId;
/**
* 积分
*/
private Integer score;
/**
* 社区自组织人员
*/
@ -84,6 +87,7 @@ public class CommunitySelfOrganizationListDTO implements Serializable {
this.longitude = "";
this.latitude = "";
this.orgId = "";
this.score = NumConstant.ZERO;
this.organizationPersonnel = new ArrayList<>();
}
}

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

@ -68,6 +68,10 @@ public class GetListSocietyOrgResultDTO implements Serializable {
private String longitude;
//维度
private String latitude;
/**
* 积分
*/
private Integer score;
}
}

44
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordDTO.java

@ -0,0 +1,44 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/1/18 9:30
*/
@NoArgsConstructor
@Data
public class PointRecordDTO implements Serializable {
private static final long serialVersionUID = 8562346042241117055L;
/**
* 需求类型
*/
@JsonIgnore
private String categoryCode;
private String categoryName;
/**
* 需求人
*/
private String demandUserName;
/**
* 需求内容
*/
private String content;
/**
* 发放积分时间
*/
private String pointTime;
/**
* 评价
*/
private String score;
/**
* 积分
*/
private String point;
}

21
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordResultDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.page.PageData;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/1/18 9:28
*/
@NoArgsConstructor
@Data
public class PointRecordResultDTO implements Serializable {
private static final long serialVersionUID = -2359756064125925616L;
private Integer totalPoint;
private PageData<PointRecordDTO> page;
}

17
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServicePointDTO.java

@ -0,0 +1,17 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/1/21 15:47
*/
@Data
public class ServicePointDTO implements Serializable {
private static final long serialVersionUID = -1127819263685687151L;
private String serverId;
private Integer point;
}

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java

@ -59,5 +59,5 @@ public class SocietyOrgListResultDTO implements Serializable {
private String longitude;
//维度
private String latitude;
private Integer score;
}

19
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceItemResultDTO.java

@ -0,0 +1,19 @@
package com.epmet.dto.result.demand;
import lombok.Data;
import java.io.Serializable;
/**
* 服务事项分类列表查询返参
* 目前不分页
*/
@Data
public class ServiceItemResultDTO implements Serializable {
private static final long serialVersionUID = -590440160577071133L;
private String categoryId;
private String categoryName;
private Integer awardPoint;
private Boolean usableFlag;
}

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java

@ -169,9 +169,4 @@ public interface ActConstant {
* 活动类型-联建活动
*/
String PARTY = "party";
/**
* 服务事项code
*/
String SERVICE_MATTER_CODE = "1010";
}

50
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitCompletionController.java

@ -0,0 +1,50 @@
package com.epmet.controller;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
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.IcPartyUnitCompletionDTO;
import com.epmet.dto.form.CompletionFormDTO;
import com.epmet.service.IcPartyUnitCompletionService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 联建单位完成情况
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-17
*/
@RestController
@RequestMapping("icpartyunitcompletion")
public class IcPartyUnitCompletionController {
@Autowired
private IcPartyUnitCompletionService icPartyUnitCompletionService;
@PostMapping("list")
public Result<PageData<IcPartyUnitCompletionDTO>> page(@RequestBody CompletionFormDTO formDTO){
PageData<IcPartyUnitCompletionDTO> page = icPartyUnitCompletionService.page(formDTO);
return new Result<PageData<IcPartyUnitCompletionDTO>>().ok(page);
}
@PostMapping("save")
public Result save(@RequestBody IcPartyUnitCompletionDTO dto){
//效验数据
if (StringUtils.isBlank(dto.getUnitId())) {
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
}
icPartyUnitCompletionService.save(dto);
return new Result();
}
@PostMapping("delete")
public Result delete(@RequestBody IcPartyUnitCompletionDTO dto){
icPartyUnitCompletionService.delete(dto.getId());
return new Result();
}
}

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

@ -115,7 +115,8 @@ public class IcResiDemandDictController {
* @return
*/
@PostMapping("updatestatus")
public Result updateStatus(@RequestBody StatusFormDTO formDTO){
public Result updateStatus(@LoginUser TokenDto tokenDto,@RequestBody StatusFormDTO formDTO){
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,StatusFormDTO.AddUserInternalGroup.class);
icResiDemandDictService.updateStatus(formDTO);
return new Result();

88
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java

@ -0,0 +1,88 @@
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.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.demand.ServiceItemAddFormDTO;
import com.epmet.dto.form.demand.ServiceItemPageFormDTO;
import com.epmet.dto.form.demand.ServiceItemSelectFormDTO;
import com.epmet.dto.form.demand.StatusFormDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.demand.ServiceItemResultDTO;
import com.epmet.service.IcServiceItemDictService;
import org.springframework.beans.factory.annotation.Autowired;
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 java.util.List;
/**
* 服务事项分类字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-27
*/
@RestController
@RequestMapping("serviceitem")
public class IcServiceItemDictController {
@Autowired
private IcServiceItemDictService icServiceItemDictService;
/**
* 01分页列表查询
*
* @param formDTO
* @return
*/
@PostMapping("list")
public Result<PageData<ServiceItemResultDTO>> page(@RequestBody ServiceItemPageFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,ServiceItemPageFormDTO.AddUserInternalGroup.class);
PageData<ServiceItemResultDTO> page = icServiceItemDictService.page(formDTO);
return new Result<PageData<ServiceItemResultDTO>>().ok(page);
}
/**
* 02新增分类
* @param formDTO
* @return
*/
@PostMapping("saveorupdate")
public Result addOrUpdate(@RequestBody ServiceItemAddFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, ServiceItemAddFormDTO.AddUserShowGroup.class,ServiceItemAddFormDTO.AddUserInternalGroup.class);
icServiceItemDictService.addOrUpdate(formDTO);
return new Result();
}
/**
* 03启用或者禁用分类
* @param formDTO
* @return
*/
@PostMapping("updatestatus")
public Result updateStatus(@LoginUser TokenDto tokenDto, @RequestBody StatusFormDTO formDTO){
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,StatusFormDTO.AddUserInternalGroup.class);
icServiceItemDictService.updateStatus(formDTO);
return new Result();
}
/**
* 新增联建单位查询服务事项列表
*
* @param tokenDto
* @return
*/
@PostMapping("dict-list")
public Result<List<OptionDTO>> queryDictList(@LoginUser TokenDto tokenDto,@RequestBody ServiceItemSelectFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,ServiceItemSelectFormDTO.AddUserInternalGroup.class);
return new Result<List<OptionDTO>>().ok(icServiceItemDictService.queryDictListForSelect(formDTO));
}
}

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

@ -21,8 +21,11 @@ import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.MqConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
@ -30,12 +33,18 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.SystemMessageType;
import com.epmet.constant.UserDemandConstant;
import com.epmet.dto.form.LoginUserDetailsFormDTO;
import com.epmet.dto.form.PointRecordFormDTO;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.LoginUserDetailsResultDTO;
import com.epmet.dto.result.PointRecordResultDTO;
import com.epmet.dto.result.demand.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PostMapping;
@ -57,8 +66,8 @@ import java.util.List;
@Slf4j
@RestController
@RequestMapping("userdemand")
public class IcUserDemandRecController {
public class IcUserDemandRecController implements ResultDataResolver {
@Autowired
private IcUserDemandRecService icUserDemandRecService;
@Autowired
@ -71,6 +80,8 @@ public class IcUserDemandRecController {
private IcPartyUnitService icPartyUnitService;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient userOpenFeignClient;
/**
* 根据服务方类型查询 下拉框
@ -321,5 +332,53 @@ public class IcUserDemandRecController {
return new Result<CategoryAnalysisResDTO>().ok(icUserDemandRecService.categoryAnalysis(formDTO));
}
/**
* 搜索需求根据需求人精确搜索需求方需求内容模糊搜索
* @return
*/
@PostMapping("search")
public Result search(@RequestBody UserDemandPageFormDTO input, @LoginUser TokenDto loginUser) {
ValidatorUtils.validateEntity(input);
String keyword = input.getKeyword();
Integer pageNo = input.getPageNo();
Integer pageSize = input.getPageSize();
if (StringUtils.isBlank(keyword)) {
return new Result();
}
keyword = keyword.trim();
LoginUserDetailsFormDTO form = new LoginUserDetailsFormDTO();
form.setApp(loginUser.getApp());
form.setClient(loginUser.getClient());
form.setUserId(loginUser.getUserId());
LoginUserDetailsResultDTO loginUserDetail = getResultDataOrThrowsException(userOpenFeignClient.getLoginUserDetails(form),
ServiceConstant.EPMET_USER_SERVER,
EpmetErrorCode.SERVER_ERROR.getCode(),
"【社区查询】查找当前人所属组织失败",
null);
PageData<DemandRecResultDTO> page = icUserDemandRecService.search(loginUser.getCustomerId(), loginUserDetail.getAgencyId(), keyword, pageNo, pageSize);
return new Result().ok(page);
}
/**
* 组织单位积分记录
*
* @Param formDTO
* @Return {@link Result< PointRecordResultDTO>}
* @Author zhaoqifeng
* @Date 2022/1/18 9:45
*/
@PostMapping("recordList")
public Result<PointRecordResultDTO> pointRecordList(@LoginUser TokenDto tokenDto, @RequestBody PointRecordFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
PointRecordResultDTO result = icUserDemandRecService.pointRecordList(formDTO);
return new Result<PointRecordResultDTO>().ok(result);
}
}

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

Loading…
Cancel
Save