Browse Source

Merge branch 'master' into dev_party_mange

# Conflicts:
#	epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java
#	epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java
feature/teamB_zz_wgh
YUJT 3 years ago
parent
commit
ac3056b84c
  1. 4
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java
  2. 6
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java
  3. 5
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java
  4. 3
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java
  5. 2
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java
  6. 5
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java
  7. 6
      epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.16__self_org_category.sql
  8. 9
      epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.17__add_dict.sql
  9. 1
      epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.18__alter_dict.sql
  10. 11
      epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.19__add_dict.sql
  11. 28
      epmet-admin/epmet-admin-server/src/main/resources/logback-spring.xml
  12. 11
      epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml
  13. 15
      epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java
  14. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java
  15. 42
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HomeMemberOperationEnum.java
  16. 41
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HouseQrcodeEnum.java
  17. 64
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/SelfOrgCategoryEnum.java
  18. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  19. 7
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/processor/MaskProcessor.java
  20. 42
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  21. 17
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/HouseInfoCache.java
  22. 171
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HouseQRcodeUtils.java
  23. 35
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java
  24. 45
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/NodeTree.java
  25. 31
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/NodeTreeUtils.java
  26. 162
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/ExcelFillRowMergeStrategy.java
  27. 105
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/ExcelFillRowMergeStrategy2.java
  28. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectDTO.java
  29. 10
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectProcessDTO.java
  30. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java
  31. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  32. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml
  33. 1
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml
  34. 10
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java
  35. 10
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java
  36. 148
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyUserHouseDailyDTO.java
  37. 139
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridUserHouseDailyDTO.java
  38. 149
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactNeighborhoodUserHouseDailyDTO.java
  39. 35
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/FactUserHouseFormDTO.java
  40. 169
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/FactUserHouseResultDTO.java
  41. 10
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java
  42. 16
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java
  43. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java
  44. 103
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactUserHouseController.java
  45. 28
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/IcHouseDao.java
  46. 26
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyUserHouseDailyDao.java
  47. 28
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridUserHouseDailyDao.java
  48. 27
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactNeighborhoodUserHouseDailyDao.java
  49. 42
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/IcResiUserDao.java
  50. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java
  51. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java
  52. 110
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/IcHouseEntity.java
  53. 118
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyUserHouseDailyEntity.java
  54. 109
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridUserHouseDailyEntity.java
  55. 119
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactNeighborhoodUserHouseDailyEntity.java
  56. 513
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/IcResiUserEntity.java
  57. 56
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/excel/FactUserHouseExcel.java
  58. 28
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java
  59. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java
  60. 73
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/HouseService.java
  61. 42
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/HouseServiceImpl.java
  62. 111
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyUserHouseDailyService.java
  63. 120
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridUserHouseDailyService.java
  64. 113
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactNeighborhoodUserHouseDailyService.java
  65. 78
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactUserHouseService.java
  66. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java
  67. 121
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyUserHouseDailyServiceImpl.java
  68. 138
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridUserHouseDailyServiceImpl.java
  69. 129
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactNeighborhoodUserHouseDailyServiceImpl.java
  70. 307
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactUserHouseServiceImpl.java
  71. 55
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/IcResiUserService.java
  72. 55
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/IcResiUserServiceImpl.java
  73. 11
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.31__alter_govern.sql
  74. 85
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.32__fact_grid_user_house_daily.sql
  75. 28
      epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml
  76. 10
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml
  77. 124
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/IcHouseDao.xml
  78. 4
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml
  79. 138
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyUserHouseDailyDao.xml
  80. 237
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridUserHouseDailyDao.xml
  81. 127
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactNeighborhoodUserHouseDailyDao.xml
  82. 47
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/IcResiUserDao.xml
  83. 8
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationPersonnelDTO.java
  84. 115
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceOrgDTO.java
  85. 116
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectAttachmentDTO.java
  86. 104
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectDTO.java
  87. 9
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java
  88. 19
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddCommunitySelfOrganizationFormDTO.java
  89. 33
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CategorySelfOrgFormDTO.java
  90. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java
  91. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditCommunitySelfOrganizationFormDTO.java
  92. 49
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceEditFormDTO.java
  93. 71
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgAddEditFormDTO.java
  94. 46
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgListFormDTO.java
  95. 27
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitListFormDTO.java
  96. 57
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFeedbackFormDTO.java
  97. 53
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFormDTO.java
  98. 32
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectListFormDTO.java
  99. 66
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectRecordFormDTO.java
  100. 20
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/IcEventCommentToDemandFromDTO.java

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

@ -6,6 +6,7 @@ import com.epmet.commons.tools.dto.result.DictListResultDTO;
import com.epmet.commons.tools.dto.result.DictTreeResultDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.dto.result.CorsConfigResultDTO;
import com.epmet.feign.fallback.EpmetAdminOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
@ -101,4 +102,7 @@ public interface EpmetAdminOpenFeignClient {
@PostMapping("/sys/dict/data/dictlist")
Result<List<DictListResultDTO>> dictList(@RequestBody DictListFormDTO formDTO);
@PostMapping("/sys/dict/data/dictDataList/{dictType}")
Result<List<SysDictDataDTO>> dictDataList(@PathVariable("dictType") String dictType);
}

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

@ -7,6 +7,7 @@ import com.epmet.commons.tools.dto.result.DictTreeResultDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.dto.result.CorsConfigResultDTO;
import com.epmet.feign.EpmetAdminOpenFeignClient;
@ -59,4 +60,9 @@ public class EpmetAdminOpenFeignClientFallback implements EpmetAdminOpenFeignCli
public Result<List<DictListResultDTO>> dictList(DictListFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictList", formDTO);
}
@Override
public Result<List<SysDictDataDTO>> dictDataList(String dictType) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictDataList", dictType);
}
}

5
epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java

@ -172,4 +172,9 @@ public class SysDictDataController {
return new Result<Map<String, String>>().ok(sysDictDataService.dictMap(dictType));
}
@PostMapping("dictDataList/{dictType}")
public Result<List<SysDictDataDTO>> dictDataList(@PathVariable("dictType") String dictType){
List<SysDictDataDTO> list=sysDictDataService.getDictDataList(dictType);
return new Result<List<SysDictDataDTO>>().ok(list);
}
}

3
epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/SysDictDataDao.java

@ -11,6 +11,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.dto.result.DictListResultDTO;
import com.epmet.commons.tools.dto.result.DictTreeResultDTO;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.entity.DictData;
import com.epmet.entity.SysDictDataEntity;
import org.apache.ibatis.annotations.Mapper;
@ -33,4 +34,6 @@ public interface SysDictDataDao extends BaseDao<SysDictDataEntity> {
List<DictListResultDTO> selectDictList(String dictType);
List<DictTreeResultDTO> selectDictData(String dictType);
List<SysDictDataDTO> selectDictDataList(String dictType);
}

2
epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/SysDictDataService.java

@ -90,4 +90,6 @@ public interface SysDictDataService extends BaseService<SysDictDataEntity> {
Map<String, String> dictMap(String dictType);
List<DictTreeResultDTO> dictListTree(String dictType);
List<SysDictDataDTO> getDictDataList(String dictType);
}

5
epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/SysDictDataServiceImpl.java

@ -225,4 +225,9 @@ public class SysDictDataServiceImpl extends BaseServiceImpl<SysDictDataDao, SysD
return TreeUtils.buildTree(resultDTOList);
}
@Override
public List<SysDictDataDTO> getDictDataList(String dictType) {
return baseDao.selectDictDataList(dictType);
}
}

6
epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.16__self_org_category.sql

@ -0,0 +1,6 @@
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 ('1526493468551626753', 'self_org_category', '社区自组织类别', '社区自组织类别:文化队伍、楼委会、老友俱乐部、治安巡逻队、其他', 1, 0, 0, '1', '2022-05-17 17:22:58', '1', '2022-05-17 17:22:58');
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 ('1526495882432299010', 1526493468551626753, '楼委会', 'lwh', '0', '楼委会', 2, 0, 0, '1', '2022-05-17 17:32:34', '1', '2022-05-17 17:32:34');
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 ('1526495969778679810', 1526493468551626753, '老友俱乐部', 'lyjlb', '0', '老友俱乐部', 3, 0, 0, '1', '2022-05-17 17:32:55', '1', '2022-05-17 17:32:55');
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 ('1526496168622243842', 1526493468551626753, '其他', 'other', '0', '其他', 5, 0, 0, '1', '2022-05-17 17:33:42', '1', '2022-05-17 17:33:51');
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 ('1526495766724034562', 1526493468551626753, '文化队伍', 'whdw', '0', '文化队伍', 1, 0, 0, '1', '2022-05-17 17:32:06', '1', '2022-05-17 17:32:40');
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 ('1526496054369402882', 1526493468551626753, '治安巡逻队', 'zaxld', '0', '治安巡逻队', 4, 0, 0, '1', '2022-05-17 17:33:15', '1', '2022-05-17 17:33:24');

9
epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.17__add_dict.sql

@ -0,0 +1,9 @@
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 ('1000000000000000013', 'ic_event', '事件管理', '', '13', '0', '0', '', '2022-05-17 18:23:27', '', '2022-05-17 18:23:27');
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 ('3000000000000000004', '1000000000000000013', '网格员手持终端', '4', '0', '', '4', '0', '0', '', '2022-05-17 18:39:18', '', '2022-05-17 18:39:18');
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 ('3000000000000000003', '1000000000000000013', '12345', '3', '0', '', '3', '0', '0', '', '2022-05-17 18:39:18', '', '2022-05-17 18:39:18');
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 ('3000000000000000002', '1000000000000000013', '社区电话', '2', '0', '', '2', '0', '0', '', '2022-05-17 18:39:18', '', '2022-05-17 18:39:18');
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 ('3000000000000000001', '1000000000000000013', '多媒体反映', '1', '0', '', '1', '0', '0', '', '2022-05-17 18:39:18', '', '2022-05-17 18:39:18');
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 ('3000000000000000000', '1000000000000000013', '随手拍/随时讲', '0', '0', '', '0', '0', '0', '', '2022-05-17 18:39:18', '', '2022-05-17 18:39:18');

1
epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.18__alter_dict.sql

@ -0,0 +1 @@
UPDATE `epmet_admin`.`sys_dict_type` SET `id`='1000000000000000013', `dict_type`='ic_event_source_type', `dict_name`='事件管理', `remark`='', `sort`='13', `DEL_FLAG`='0', `REVISION`='0', `CREATED_BY`='', `CREATED_TIME`='2022-05-17 18:23:27', `UPDATED_BY`='', `UPDATED_TIME`='2022-05-17 18:23:27' WHERE (`id`='1000000000000000013');

11
epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.19__add_dict.sql

@ -0,0 +1,11 @@
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 ('1000000000000000014', 'ic_service_type', '服务类别', '', '20', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27');
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 ('3100000000000000000', '1000000000000000014', '社区养老', '00', '0', '', '0', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27');
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 ('3100000000000000001', '1000000000000000014', '社会保障', '01', '0', '', '1', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27');
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 ('3100000000000000002', '1000000000000000014', '社区救助', '02', '0', '', '2', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27');
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 ('3100000000000000003', '1000000000000000014', '健康医疗', '03', '0', '', '3', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27');
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 ('3100000000000000004', '1000000000000000014', '社区安全', '04', '0', '', '4', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27');
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 ('3100000000000000005', '1000000000000000014', '社区卫生', '05', '0', '', '5', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27');
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 ('3100000000000000006', '1000000000000000014', '社区环境', '06', '0', '', '6', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27');
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 ('3100000000000000007', '1000000000000000014', '社区治安', '07', '0', '', '7', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27');
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 ('3100000000000000008', '1000000000000000014', '社区文化', '08', '0', '', '8', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27');

28
epmet-admin/epmet-admin-server/src/main/resources/logback-spring.xml

@ -133,12 +133,36 @@
</filter>
</appender>
<!-- rocketmq client 的日志appender -->
<appender name="RocketmqClientAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/rocketmqclient.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%X{Transaction-Serial}] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/rocketmqclient-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
</appender>
<!-- 开发、测试环境 -->
<springProfile name="dev,test,local">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.dao" level="INFO"/>
<logger name="com.epmet.dao" level="DEBUG"/>
<!-- 只打印rocketmq client的日志 -->
<logger name="RocketmqClient" level="INFO" additivity="false">
<appender-ref ref="RocketmqClientAppender"/>
</logger>
<root level="INFO">
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
@ -152,6 +176,10 @@
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.dao" level="INFO"/>
<!-- 只打印rocketmq client的日志 -->
<logger name="RocketmqClient" level="INFO" additivity="false">
<appender-ref ref="RocketmqClientAppender"/>
</logger>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="DEBUG_FILE"/>

11
epmet-admin/epmet-admin-server/src/main/resources/mapper/SysDictDataDao.xml

@ -33,4 +33,15 @@
a.sort asc
</select>
<select id="selectDictDataList" resultType="com.epmet.dto.SysDictDataDTO">
select sd.*
from sys_dict_data sd
where sd.DEL_FLAG='0'
and sd.dict_type_id=(
select st.id
from sys_dict_type st
where st.DEL_FLAG='0'
and st.dict_type=#{dictType}
)order by sort asc
</select>
</mapper>

15
epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java

@ -147,12 +147,7 @@ public class FieldMetaObjectHandler implements MetaObjectHandler {
updatedTime = metaObject.getValue(FieldConstant.UPDATED_TIME_HUMP);
}
if (updatedTime == null) {
if(metaObject.hasGetter(FieldConstant.CREATED_TIME_HUMP)) {
updatedTime = metaObject.getValue(FieldConstant.CREATED_TIME_HUMP);
}
if(updatedTime == null) {
updatedTime = new Date();
}
updatedTime = new Date();
}
return updatedTime;
}
@ -165,13 +160,7 @@ public class FieldMetaObjectHandler implements MetaObjectHandler {
}
if (value == null) {
if(metaObject.hasGetter(FieldConstant.CREATED_BY_HUMP)) {
value = metaObject.getValue(FieldConstant.CREATED_BY_HUMP);
}
if(null == value) {
value = Optional.ofNullable(loginUserUtil.getLoginUserId()).orElse(Constant.APP_USER_FLAG);
}
value = Optional.ofNullable(loginUserUtil.getLoginUserId()).orElse(Constant.APP_USER_FLAG);
}
return value;

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java

@ -23,6 +23,9 @@ public enum DictTypeEnum {
PATROL_WORK_TYPE("patrol_work_type", "例行工作分类", 13),
GRID_TYPE("grid_type", "网格类型", 12),
ITEM_TYPE_QUERY("item_type_query","居民信息组件查询方式",14),
SELF_ORG_CATEGORY("self_org_category","社区自组织分类",15),
IC_EVENT_SOURCE_TYPE("ic_event_source_type","事件管理",19),
IC_SERVICE_TYPE("ic_service_type","服务类别",20),
;
private final String code;

42
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HomeMemberOperationEnum.java

@ -0,0 +1,42 @@
package com.epmet.commons.tools.enums;
/**
* 组织级别枚举类
* dev|test|prod
*
* @author jianjun liu
* @date 2020-07-03 11:14
**/
public enum HomeMemberOperationEnum {
ADD("add", "新增"),
UPDATE("update", "修改"),
DELETE("delele", "删除");
private String code;
private String name;
HomeMemberOperationEnum(String code, String name) {
this.code = code;
this.name = name;
}
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;
}
}

41
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HouseQrcodeEnum.java

@ -0,0 +1,41 @@
package com.epmet.commons.tools.enums;
/**
* @describe: 一户一档二维码信息
* @author wangtong
* @date 2022/6/1 13:34
* @params
* @return
*/
public enum HouseQrcodeEnum {
SUFFIX(".png", "二维码格式的后缀"),
PREFIX_KEY("house_qrcode_pre", "二维码格式的前缀key");
// PREFIX("https://epmet-dev.elinkservice.cn/cqrcode-ty/", "二维码地址的前缀");
private String code;
private String name;
HouseQrcodeEnum(String code, String name) {
this.code = code;
this.name = name;
}
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;
}
}

64
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/SelfOrgCategoryEnum.java

@ -0,0 +1,64 @@
package com.epmet.commons.tools.enums;
/**
* 社区自组织增加分类文化队伍楼委会老友俱乐部治安巡逻队其他
*/
public enum SelfOrgCategoryEnum {
// 文化队伍: #e70014
// 楼委会: #f59701
// 老友俱乐部: #8fc41e
// 治安巡逻队: #00a1be
// 其他: #0067b6
/**
* 环境变量枚举
*/
WHDW("whdw", "文化队伍", "#e70014", 1),
LWH("lwh", "楼委会", "#f59701", 2),
LYJLB("lyjlb", "老友俱乐部", "#8fc41e", 3),
ZAXLD("zaxld", "治安巡逻队", "#00a1be", 4),
OTHER("other", "其他", "#0067b6", 5),
;
private final String code;
private final String name;
private final String color;
private final Integer sort;
SelfOrgCategoryEnum(String code, String name, String color, Integer sort) {
this.code = code;
this.name = name;
this.color = color;
this.sort = sort;
}
public static SelfOrgCategoryEnum getEnum(String code) {
SelfOrgCategoryEnum[] values = SelfOrgCategoryEnum.values();
for (SelfOrgCategoryEnum value : values) {
if (value.getCode().equals(code)) {
return value;
}
}
return SelfOrgCategoryEnum.OTHER;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
public String getColor() {
return color;
}
public Integer getSort() {
return sort;
}
}

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

@ -255,7 +255,10 @@ public enum EpmetErrorCode {
IC_NAT(8924,"平台已存在记录,请去修改原有记录"),
RESI_IC_NAT(8925,"已存在记录,请联系社区工作人员修改"),
IC_MOVE_IN(8926,"居民信息中房屋信息与当前选择房屋不一致,是否更新?"),
NOT_REGEIST_RESI(8927,"未注册居民"),
UNIT_EXIST_HOUSES_ERROR(8928,"单元下存在房屋,不可修改单元数"),
MISMATCH(10086,"人员与房屋信息不匹配,请与工作人员联系。"),
//通用错误码 start
//通用的 错误消息自己定义返回

7
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/processor/MaskProcessor.java

@ -141,15 +141,16 @@ public class MaskProcessor {
* @return
*/
private String maskIdCard(String originString) {
int clearTextLength = 12;
// 仅将6位之后的全都打码
int length = originString.length();
if (length <= 6) {
if (length <= clearTextLength) {
return originString;
}
String maskStr = StrUtil.repeatByLength("*", length - 6);
String maskStr = StrUtil.repeatByLength("*", length - clearTextLength);
return originString.replaceAll("^(\\d{6})[a-zA-Z0-9]*$", new StringBuilder("$1").append(maskStr).toString());
return originString.replaceAll("^(\\d{10})\\d+([a-zA-Z0-9]{2})$", new StringBuilder("$1").append(maskStr).append("$2").toString());
}
/**

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

@ -101,7 +101,7 @@ public class RedisKeys {
* epmet:sys:security:user:token字符串
*/
public static String getCpUserKey(String app, String client, String userId) {
return rootPrefix.concat("sys:security:user:").concat(app).concat(":").concat(client).concat(":").concat(userId);
return rootPrefix.concat("sys:security:user:").concat(app).concat(StrConstant.COLON).concat(client).concat(StrConstant.COLON).concat(userId);
}
/**
@ -200,7 +200,7 @@ public class RedisKeys {
* @return
*/
public static String getRoleOpeScopesKey(String roleId, String opeKey) {
return rootPrefix.concat("gov:access:role:opescopes:").concat(roleId).concat(":").concat(opeKey);
return rootPrefix.concat("gov:access:role:opescopes:").concat(roleId).concat(StrConstant.COLON).concat(opeKey);
}
/**
@ -338,7 +338,7 @@ public class RedisKeys {
* @return
*/
public static String getCustomerStatsCalFlag(String customerId) {
return getCustomerStatsCalKeyPrefix().concat(":").concat(customerId);
return getCustomerStatsCalKeyPrefix().concat(StrConstant.COLON).concat(customerId);
}
/**
@ -364,7 +364,7 @@ public class RedisKeys {
* @return
*/
public static String getCustomerFootbarKey(String customerId, String appType) {
return rootPrefix.concat("footbar").concat(":").concat(customerId).concat(":").concat(appType);
return rootPrefix.concat("footbar").concat(StrConstant.COLON).concat(customerId).concat(StrConstant.COLON).concat(appType);
}
@ -397,7 +397,7 @@ public class RedisKeys {
* @date 2020.11.05 13:34
*/
public static String getResiUserBadgeKey(String customerId, String userId) {
return rootPrefix.concat("badge:user:").concat(customerId).concat(":").concat(StringUtils.isBlank(userId) ? "*" : userId);
return rootPrefix.concat("badge:user:").concat(customerId).concat(StrConstant.COLON).concat(StringUtils.isBlank(userId) ? "*" : userId);
}
/**
@ -483,7 +483,7 @@ public class RedisKeys {
**/
public static String getGroupMsgReadKey(String source, String groupId, String sourceId) {
String currentMonth= DateUtils.getBeforeNMonth(NumConstant.ZERO);
return "groupread:".concat(currentMonth).concat(":").concat(source).concat(":").concat(groupId).concat(":").concat(sourceId);
return "groupread:".concat(currentMonth).concat(StrConstant.COLON).concat(source).concat(StrConstant.COLON).concat(groupId).concat(StrConstant.COLON).concat(sourceId);
}
/**
@ -497,7 +497,7 @@ public class RedisKeys {
**/
public static String getGroupMsgShouldReadUser(String source, String groupId, String sourceId) {
String currentMonth= DateUtils.getBeforeNMonth(NumConstant.ZERO);
return "groupread:user:".concat(currentMonth).concat(":").concat(source).concat(":").concat(groupId).concat(":").concat(sourceId);
return "groupread:user:".concat(currentMonth).concat(StrConstant.COLON).concat(source).concat(StrConstant.COLON).concat(groupId).concat(StrConstant.COLON).concat(sourceId);
}
/**
@ -560,7 +560,7 @@ public class RedisKeys {
* @date 2021.09.23 17:38:37
*/
public static String getQuestionnaireAccessKey(String userId, String qKey) {
return rootPrefix.concat("questionnaire:accesskey:").concat(userId).concat(":").concat(qKey);
return rootPrefix.concat("questionnaire:accesskey:").concat(userId).concat(StrConstant.COLON).concat(qKey);
}
/**
@ -594,7 +594,7 @@ public class RedisKeys {
* @date 2021.10.25 17:49:43
*/
public static String loginTicket(String app, String ticket) {
return rootPrefix.concat("sys:security:ticket:").concat(app).concat(":").concat(ticket);
return rootPrefix.concat("sys:security:ticket:").concat(app).concat(StrConstant.COLON).concat(ticket);
}
/**
@ -649,7 +649,7 @@ public class RedisKeys {
}
public static String getHouseInfoCacheKey(String houseId,String customerId){
return rootPrefix.concat("house:").concat(customerId).concat(":").concat(houseId);
return rootPrefix.concat("house:").concat(customerId).concat(StrConstant.COLON).concat(houseId);
}
/**
@ -671,7 +671,7 @@ public class RedisKeys {
* @return
*/
public static String icResiImportTypeKey(String importTag, String type) {
return icResiImportBaseKey(importTag).concat(":").concat(type);
return icResiImportBaseKey(importTag).concat(StrConstant.COLON).concat(type);
}
/**
@ -682,7 +682,7 @@ public class RedisKeys {
* @return
*/
public static String icResiImportResiCategoryKey(String importTag, String type, String resiId) {
return icResiImportTypeKey(importTag, type).concat(":").concat(resiId);
return icResiImportTypeKey(importTag, type).concat(StrConstant.COLON).concat(resiId);
}
/**
@ -693,7 +693,7 @@ public class RedisKeys {
* @date 2022/2/14 9:38 上午
*/
public static String getTemporaryHouseInfoCacheKey(String customerId,String userId){
return rootPrefix.concat("temporary:").concat("temporaryHouse:").concat(customerId).concat(":").concat(userId);
return rootPrefix.concat("temporary:").concat("temporaryHouse:").concat(customerId).concat(StrConstant.COLON).concat(userId);
}
/**
@ -704,7 +704,7 @@ public class RedisKeys {
* @date 2022/2/14 9:38 上午
*/
public static String getTemporaryGridInfoCacheKey(String customerId,String userId){
return rootPrefix.concat("temporary:").concat("temporaryGrid:").concat(customerId).concat(":").concat(userId);
return rootPrefix.concat("temporary:").concat("temporaryGrid:").concat(customerId).concat(StrConstant.COLON).concat(userId);
}
/**
@ -715,7 +715,7 @@ public class RedisKeys {
* @date 2022/2/14 9:39 上午
*/
public static String getTemporaryNeighborHoodInfoCacheKey(String customerId,String userId){
return rootPrefix.concat("temporary:").concat("temporaryNeighborHood:").concat(customerId).concat(":").concat(userId);
return rootPrefix.concat("temporary:").concat("temporaryNeighborHood:").concat(customerId).concat(StrConstant.COLON).concat(userId);
}
/**
@ -726,7 +726,7 @@ public class RedisKeys {
* @date 2022/2/14 9:39 上午
*/
public static String getTemporaryBuildingInfoCacheKey(String customerId,String userId){
return rootPrefix.concat("temporary:").concat("temporaryBuilding:").concat(customerId).concat(":").concat(userId);
return rootPrefix.concat("temporary:").concat("temporaryBuilding:").concat(customerId).concat(StrConstant.COLON).concat(userId);
}
/**
@ -737,15 +737,15 @@ public class RedisKeys {
* @date 2022/2/14 1:54 下午
*/
public static String getTemporaryBuildingUnitInfoCacheKey(String customerId,String userId){
return rootPrefix.concat("temporary:").concat("temporaryBuildingUnit:").concat(customerId).concat(":").concat(userId);
return rootPrefix.concat("temporary:").concat("temporaryBuildingUnit:").concat(customerId).concat(StrConstant.COLON).concat(userId);
}
public static String getTemporaryImportResultCacheKey(String customerId,String userId){
return rootPrefix.concat("temporary:").concat("temporaryResult:").concat(customerId).concat(":").concat(userId);
return rootPrefix.concat("temporary:").concat("temporaryResult:").concat(customerId).concat(StrConstant.COLON).concat(userId);
}
public static String getCustomerMenuList(String customerId, Integer type) {
return getCustomerMenuListPrefix().concat(customerId).concat(":type:")+type;
public static String getCustomerMenuList(String customerId, Integer type, String tableName) {
return getCustomerMenuListPrefix().concat("type:").concat(type.toString()).concat(":tableName:").concat(tableName).concat(StrConstant.COLON).concat(customerId);
}
/**
@ -753,7 +753,7 @@ public class RedisKeys {
* @return
*/
public static String getCustomerMenuListPrefix() {
return rootPrefix.concat("oper:access:nav:customerId:");
return rootPrefix.concat("gov:access:nav:");
}
/**

17
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/HouseInfoCache.java

@ -89,4 +89,21 @@ public class HouseInfoCache implements Serializable {
* 组织的area_code
*/
private String areaCode;
/**
* 网格id
*/
private String gridId;
/**
* 网格名称
*/
private String gridName;
/**
* 房屋编码
*/
private String houseCode;
/**
* 二维码地址
*/
private String houseQrcodeUrl;
}

171
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HouseQRcodeUtils.java

@ -0,0 +1,171 @@
package com.epmet.commons.tools.utils;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.WriterException;
import com.google.zxing.client.j2se.MatrixToImageConfig;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.common.CharacterSetECI;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import lombok.extern.slf4j.Slf4j;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
/**
* Date 2022/06/7 10:01
* Description:房屋一户一码生成工具类
*/
@Slf4j
public class HouseQRcodeUtils {
/**
* 二维码颜色 默认是黑色
*/
private static final Color QRCOLOR = Color.black;
/**
* 背景颜色
*/
private static final Color BGWHITE = Color.white;
public static final int WIDTH = 800;
public static final int HEIGHT = 800;
public static final int MARGIN = 10;
public static final int FONTSIZE = 40;
/**
* 房屋一户一码生成-指定像素
*
* @param contents 说明
* @return BufferedImage
* @throws Exception
*/
public static BufferedImage drawHouseQRImage(String pressText, String contents) throws Exception {
BufferedImage qRImage = null;
if (contents == null || "".equals(contents)) {
throw new Exception("content说明不能为空");
}
// 二维码参数设置
HashMap<EncodeHintType, Object> hints = new HashMap<>();
hints.put(EncodeHintType.CHARACTER_SET, CharacterSetECI.UTF8); // 编码设置
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); // 安全等级,最高h
hints.put(EncodeHintType.MARGIN, MARGIN); // 设置margin=0-10
// 二维码图片的生成
BarcodeFormat format = BarcodeFormat.QR_CODE;
// 创建矩阵容器
BitMatrix matrix = null;
try {
matrix = new MultiFormatWriter().encode(contents, format, WIDTH, HEIGHT, hints);
} catch (WriterException e) {
log.error("method exception", e);
}
// 设置矩阵转为图片的参数
MatrixToImageConfig toImageConfig = new MatrixToImageConfig(QRCOLOR.getRGB(), BGWHITE.getRGB());
// 矩阵转换图像
qRImage = MatrixToImageWriter.toBufferedImage(matrix, toImageConfig);
return pressHouseText(pressText, qRImage);
}
/**
* @param pressText 二维码下方插入文字
* @param image 需要添加文字的图片
* @为图片添加文字
*/
private static BufferedImage pressHouseText(String pressText, BufferedImage image) throws Exception {
BufferedImage outImage = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB);
//计算文字开始的位置
//x开始的位置:(图片宽度-字体大小*字的个数)/2
int startX = (WIDTH - (FONTSIZE * pressText.length())) / 2;
//y开始的位置:图片高度-(图片高度-图片宽度)/2
// int startY = HEIGHT - (HEIGHT - WIDTH) / 2 + FONTSIZE;
int startY = 740;
int imageW = outImage.getWidth();
int imageH = outImage.getHeight();
Graphics2D g = outImage.createGraphics();
g.drawImage(image, 0, 0, imageW, imageH, null);
g.setColor(QRCOLOR);
g.setFont(new Font("Noto Sans SC Light", Font.BOLD, FONTSIZE));
g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g.setBackground(Color.white);
// 获取文字数量 按照字节展示
int size = pressText.getBytes("GBK").length;
// 获取一行最多能容纳多少文字 按照文字字节展示
int maxSize = (WIDTH / FONTSIZE - 2) * 2;
if (size > maxSize) {
int v = size % maxSize;
for (int a = 0; a < (size / maxSize); a++) {
String s = outStringByByte(pressText, maxSize);
g.drawString(s, (WIDTH - (FONTSIZE * (WIDTH / FONTSIZE - 2))) / 2, startY);
pressText = pressText.substring(s.length(), pressText.length());
startY = startY + 35;
}
if (v != 0) {
g.drawString(pressText, (WIDTH - (FONTSIZE * v)) / 2, startY);
}
} else {
g.drawString(pressText, (WIDTH - ((pressText.getBytes("GBK").length) / 2) * FONTSIZE) / 2, startY);
}
g.dispose();
return outImage;
}
/**
* 保存二维码图片到本地
*
* @param contents
* @throws Exception
*/
public static void createImg(String pressText, String contents, String filename, String filePath) throws Exception {
BufferedImage qRImageWithLogo = drawHouseQRImage(pressText, contents);
// 写入返回
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageIO.write(qRImageWithLogo, "jpg", baos);
//图片类型
String imageType = "jpg";
//生成二维码存放文件
File file = new File(filePath + filename + ".jpg");
if (!file.exists()) {
file.mkdirs();
}
ImageIO.write(qRImageWithLogo, imageType, file);
baos.close();
}
private static String outStringByByte(String str, int len) throws IOException {
byte[] btf = str.getBytes("GBK");
int count = 0;
for (int j = len - 1; j >= 0; j--) {
if (btf[j] < 0) {
count++;
} else {
break;
}
}
if (count % 2 == 0) {
return new String(btf, 0, len, "GBK");
} else {
return new String(btf, 0, len - 1, "GBK");
}
}
}

35
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java

@ -143,6 +143,41 @@ public class HttpClientManager {
}
/**
* desc: 发送json post 请求
* param: url,jsonStrParam
* return: CallResult<String>
* date: 2019/2/21 9:12
*
* @author: jianjun liu
*/
public Result<String> sendPostAndHeader(String url, Map<String, Object> paramsMap, Map<String,String> headerMap) {
try {
HttpPost httppost = new HttpPost(url);
httppost.setConfig(requestConfig);
httppost.addHeader(HEADER_CONTENT_TYPE, HEADER_APPLICATION_FORM_URL_ENCODED);
if (null != headerMap){
headerMap.forEach((k,v) -> {
httppost.addHeader(k,v);
});
}
List<NameValuePair> list = new ArrayList<NameValuePair>();
for (String key : paramsMap.keySet()) {
list.add(new BasicNameValuePair(key, String.valueOf(paramsMap.get(key))));
}
UrlEncodedFormEntity urlEncodedFormEntity = new UrlEncodedFormEntity(list, UTF8);
httppost.setEntity(urlEncodedFormEntity);
return execute(httppost, false);
} catch (Exception e) {
log.error("send exception", e);
return new Result<String>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg());
}
}
/**
* desc: 发送json post 请求
* param: url,jsonStrParam

45
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/NodeTree.java

@ -0,0 +1,45 @@
package com.epmet.commons.tools.utils;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class NodeTree<T> implements Serializable {
private static final long serialVersionUID = 8020505121785861117L;
/**
* 主键
*/
private String id;
/**
* 上级ID
*/
private String pid;
/**
* 子节点列表
*/
private List<T> children = new ArrayList<>();
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public List<T> getChildren() {
return children;
}
public void setChildren(List<T> children) {
this.children = children;
}
}

31
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/NodeTreeUtils.java

@ -0,0 +1,31 @@
package com.epmet.commons.tools.utils;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
public class NodeTreeUtils {
public static <T extends NodeTree> List<T> build(List<T> treeNodes) {
List<T> result = new ArrayList<>();
//list转map
Map<String, T> nodeMap = new LinkedHashMap<>(treeNodes.size());
for(T treeNode : treeNodes){
nodeMap.put(treeNode.getId(), treeNode);
}
for(T node : nodeMap.values()) {
T parent = nodeMap.get(node.getPid());
if(parent != null && !(node.getId().equals(parent.getId()))){
parent.getChildren().add(node);
continue;
}
result.add(node);
}
return result;
}
}

162
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/ExcelFillRowMergeStrategy.java

@ -0,0 +1,162 @@
package com.epmet.commons.tools.utils.poi.excel.handler;
import com.alibaba.excel.write.handler.RowWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteTableHolder;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTMergeCell;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTMergeCells;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorksheet;
import java.lang.reflect.Field;
/**
* desc:按行对单元格合并策略 依据是第一列的值
*
* @author liujianjun
*/
@Slf4j
public class ExcelFillRowMergeStrategy implements RowWriteHandler {
/**
* 分段总数据量 本批次写入的数据总量
*/
private Integer secTotalCount;
/**
* 需要合并的列 下标
*/
private int[] mergeColumnIndexArr;
/**
* 默认隐藏第一列 用于合并数据
*/
private boolean hiddenFirst = true;
//已合并单元格数
private int mergedTotalCount = 0;
//合并行计数
private int count;
public ExcelFillRowMergeStrategy(int[] mergeColumnIndexArr) {
this.mergeColumnIndexArr = mergeColumnIndexArr;
}
public ExcelFillRowMergeStrategy(int[] mergeColumnIndexArr, boolean hiddenFirst) {
this.mergeColumnIndexArr = mergeColumnIndexArr;
this.hiddenFirst = hiddenFirst;
}
@Override
public void beforeRowCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Integer rowIndex, Integer relativeRowIndex, Boolean isHead) {
}
@Override
public void afterRowCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Integer relativeRowIndex, Boolean isHead) {
// 隐藏id列
if (hiddenFirst) {
writeSheetHolder.getSheet().setColumnHidden(0, true);
}
}
@Override
public void afterRowDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Integer relativeRowIndex, Boolean isHead) {
//当前行索引
int curRowNum = row.getRowNum();
if (mergeColumnIndexArr != null && mergeColumnIndexArr.length > 0 && !isHead) {
//当前行第一列单元格
Cell curA1Cell = row.getCell(0);
Object curA1Data = curA1Cell.getCellType() == CellType.STRING ? curA1Cell.getStringCellValue() : curA1Cell.getNumericCellValue();
//上一行第一列单元格
Cell preA1Cell = row.getSheet().getRow(curRowNum - 1).getCell(0);
Object preA1Data = preA1Cell.getCellType() == CellType.STRING ? preA1Cell.getStringCellValue() : preA1Cell.getNumericCellValue();
log.info("curRowNum:{},是否相等:{}",curRowNum,curA1Data.equals(preA1Data));
if (curA1Data.equals(preA1Data)){
count ++;
log.info("需要合并的列数:{}",count);
}else {
if (count > 0){
log.info("需要合并了");
for (int i = 0; i < mergeColumnIndexArr.length; i++) {
mergeSomeRow(writeSheetHolder,curRowNum,count,i);
}
count = 0;
}
}
if (curRowNum == secTotalCount && count > 0){
for (int i = 0; i < mergeColumnIndexArr.length; i++) {
mergeSomeRow(writeSheetHolder,curRowNum + 1,count,i);
}
}
}
}
/*private void mergeSameRow(WriteSheetHolder writeSheetHolder, int curRowIndex, int curColIndex) {
Sheet sheet = writeSheetHolder.getSheet();
List<CellRangeAddress> mergeRegions = sheet.getMergedRegions();
boolean isMerged = false;
for (int i = 0; i < mergeRegions.size() && !isMerged; i++) {
CellRangeAddress cellRangeAddr = mergeRegions.get(i);
// 若上一个单元格已经被合并,则先移出原有的合并单元,再重新添加合并单元
if (cellRangeAddr.isInRange(curRowIndex - 1, curColIndex)) {
sheet.removeMergedRegion(i);
cellRangeAddr.setLastRow(curRowIndex);
sheet.addMergedRegionUnsafe(cellRangeAddr);
isMerged = true;
}
}
// 若上一个单元格未被合并,则新增合并单元
if (!isMerged) {
CellRangeAddress cellRangeAddress = new CellRangeAddress(curRowIndex - 1, curRowIndex, curColIndex, curColIndex);
sheet.addMergedRegionUnsafe(cellRangeAddress);
}
}
*/
/**
* 按列合并单元格
* @param writeSheetHolder
* @param curRowIndex 当前行索引有n行固定行就加n
* @param needMergeNum 需要合并的行数
* @param curColIndex 需要合并的列
*/
private void mergeSomeRow(WriteSheetHolder writeSheetHolder, int curRowIndex, int needMergeNum, int curColIndex) {
Sheet sheet = writeSheetHolder.getSheet();
try {
CellRangeAddress cellAddresses = new CellRangeAddress(curRowIndex - needMergeNum - 1, curRowIndex-1, curColIndex, curColIndex);
Field sh = sheet.getClass().getDeclaredField("_sh");
sh.setAccessible(true);
XSSFSheet shSheet = (XSSFSheet)sh.get(sheet);
CTWorksheet worksheet = shSheet.getCTWorksheet();
CTMergeCells ctMergeCells = mergedTotalCount > 0 ? worksheet.getMergeCells() : worksheet.addNewMergeCells();
CTMergeCell ctMergeCell = ctMergeCells.addNewMergeCell();
ctMergeCell.setRef(cellAddresses.formatAsString());
mergedTotalCount ++;
} catch (Exception e) {
e.printStackTrace();
}
}
public void setSecTotalCount(Integer secTotalCount) {
this.secTotalCount = secTotalCount;
}
}

105
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/poi/excel/handler/ExcelFillRowMergeStrategy2.java

@ -0,0 +1,105 @@
package com.epmet.commons.tools.utils.poi.excel.handler;
import com.alibaba.excel.write.handler.RowWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteTableHolder;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.util.CellRangeAddress;
import java.util.List;
/**
* desc:按行对单元格合并策略 依据是第一列的值
*
* @author liujianjun
*/
@Slf4j
public class ExcelFillRowMergeStrategy2 implements RowWriteHandler {
/**
* 需要合并的列 下标
*/
private int[] mergeColumnIndexArr;
/**
* 从下标n行开始合并
*/
private int mergeRowIndex;
/**
* 默认隐藏第一列 用于合并数据
*/
private boolean hiddenFirst = true;
public ExcelFillRowMergeStrategy2(int mergeRowIndex, int[] mergeColumnIndexArr) {
this.mergeRowIndex = mergeRowIndex;
this.mergeColumnIndexArr = mergeColumnIndexArr;
}
public ExcelFillRowMergeStrategy2(int mergeRowIndex, int[] mergeColumnIndexArr, boolean hiddenFirst) {
this.mergeRowIndex = mergeRowIndex;
this.mergeColumnIndexArr = mergeColumnIndexArr;
this.hiddenFirst = hiddenFirst;
}
@Override
public void beforeRowCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Integer rowIndex, Integer relativeRowIndex, Boolean isHead) {
}
@Override
public void afterRowCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Integer relativeRowIndex, Boolean isHead) {
// 隐藏id列
if (hiddenFirst) {
writeSheetHolder.getSheet().setColumnHidden(0, true);
}
}
@Override
public void afterRowDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Integer relativeRowIndex, Boolean isHead) {
//当前行索引
int curRowNum = row.getRowNum();
if (mergeColumnIndexArr != null && mergeColumnIndexArr.length > 0 && !isHead) {
//当前行第一列单元格
Cell curA1Cell = row.getCell(0);
Object curA1Data = curA1Cell.getCellType() == CellType.STRING ? curA1Cell.getStringCellValue() : curA1Cell.getNumericCellValue();
//上一行第一列单元格
Cell preA1Cell = row.getSheet().getRow(curRowNum - 1).getCell(0);
Object preA1Data = preA1Cell.getCellType() == CellType.STRING ? preA1Cell.getStringCellValue() : preA1Cell.getNumericCellValue();
if (curA1Data.equals(preA1Data)) {
for (int value : mergeColumnIndexArr) {
mergeSameRow(writeSheetHolder, curRowNum, value);
}
}
}
}
private void mergeSameRow(WriteSheetHolder writeSheetHolder, int curRowIndex, int curColIndex) {
Sheet sheet = writeSheetHolder.getSheet();
List<CellRangeAddress> mergeRegions = sheet.getMergedRegions();
boolean isMerged = false;
for (int i = 0; i < mergeRegions.size() && !isMerged; i++) {
CellRangeAddress cellRangeAddr = mergeRegions.get(i);
// 若上一个单元格已经被合并,则先移出原有的合并单元,再重新添加合并单元
if (cellRangeAddr.isInRange(curRowIndex - 1, curColIndex)) {
sheet.removeMergedRegion(i);
cellRangeAddr.setLastRow(curRowIndex);
sheet.addMergedRegionUnsafe(cellRangeAddr);
isMerged = true;
}
}
// 若上一个单元格未被合并,则新增合并单元
if (!isMerged) {
CellRangeAddress cellRangeAddress = new CellRangeAddress(curRowIndex - 1, curRowIndex, curColIndex, curColIndex);
sheet.addMergedRegionUnsafe(cellRangeAddress);
}
}
}

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

@ -50,6 +50,8 @@ public class ProjectDTO implements Serializable {
*/
private String agencyId;
private String gridId;
/**
* 来源议题issue
*/

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

@ -109,6 +109,16 @@ public class ProjectProcessDTO implements Serializable {
*/
private String costWorkdays;
/**
* 协办单位ID
*/
private String assistanceUnitId;
/**
* 协办单位类型1社区自组织2联建单位
*/
private String assistanceUnitType;
/**
* 删除标识0.未删除 1.已删除
*/

8
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java

@ -187,5 +187,13 @@ public class FactAgencyGovernDailyEntity extends BaseEpmetEntity {
* 18当前组织内来源于工作人员上报事件的项目结案无需解决数
*/
private Integer workEventUnResolvedCount;
/**
* 19当前组织内来源于事件管理的项目结案已解决数
*/
private Integer icEventResolvedCount;
/**
* 20当前组织内来源于事件管理的项目结案无需解决数
*/
private Integer icEventUnResolvedCount;
}

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

@ -1201,9 +1201,12 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve
Integer eventUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getEventUnResolvedCount).sum();
Integer workEventResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getWorkEventResolvedCount).sum();
Integer workEventUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getWorkEventUnResolvedCount).sum();
Integer icEventResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getIcEventResolvedCount).sum();
Integer icEventUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getIcEventUnResolvedCount).sum();
Integer closedProjectTotal = issueResolvedCount + issueUnResolvedCount+projectResolvedCount
+ projectUnResolvedCount + eventResolvedCount + eventUnResolvedCount
+ workEventResolvedCount + workEventUnResolvedCount;
+ workEventResolvedCount + workEventUnResolvedCount
+icEventResolvedCount + icEventUnResolvedCount;
resultDTO.setProblemResolvedCount(closedProjectTotal);
resultDTO.setGroupSelfGovernRatio(getPercentage(inGroupTopicResolvedCount + inGroupTopicUnResolvedCount, problemResolvedCount));
resultDTO.setGridSelfGovernRatio(getPercentage(gridSelfGovernProjectTotal, closedProjectTotal));

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

@ -631,7 +631,8 @@
ISSUE_PROJECT_RESOLVED_COUNT+ISSUE_PROJECT_UN_RESOLVED_COUNT
+APPROVAL_PROJECT_RESOLVED_COUNT+APPROVAL_PROJECT_UN_RESOLVED_COUNT
+EVENT_RESOLVED_COUNT+EVENT_UN_RESOLVED_COUNT
+WORK_EVENT_RESOLVED_COUNT+WORK_EVENT_UN_RESOLVED_COUNT AS problemResolvedCount,
+WORK_EVENT_RESOLVED_COUNT+WORK_EVENT_UN_RESOLVED_COUNT
+IC_EVENT_RESOLVED_COUNT+IC_EVENT_UN_RESOLVED_COUNT AS problemResolvedCount,
concat(ROUND(group_self_govern_ratio*100, 1),'%') AS groupSelfGovernRatio,
concat(ROUND(grid_self_govern_ratio*100, 1),'%') AS gridSelfGovernRatio,
concat(ROUND(community_closed_ratio*100, 1),'%') AS communityResolvedRatio,
@ -654,7 +655,8 @@
ISSUE_PROJECT_RESOLVED_COUNT+ISSUE_PROJECT_UN_RESOLVED_COUNT
+APPROVAL_PROJECT_RESOLVED_COUNT+APPROVAL_PROJECT_UN_RESOLVED_COUNT
+EVENT_RESOLVED_COUNT+EVENT_UN_RESOLVED_COUNT
+WORK_EVENT_RESOLVED_COUNT+WORK_EVENT_UN_RESOLVED_COUNT AS problemResolvedCount,
+WORK_EVENT_RESOLVED_COUNT+WORK_EVENT_UN_RESOLVED_COUNT
+IC_EVENT_RESOLVED_COUNT+IC_EVENT_UN_RESOLVED_COUNT AS problemResolvedCount,
concat(ROUND(group_self_govern_ratio*100, 1),'%') AS groupSelfGovernRatio,
concat(ROUND(grid_self_govern_ratio*100, 1),'%') AS gridSelfGovernRatio,
concat(ROUND(community_closed_ratio*100, 1),'%') AS communityResolvedRatio,
@ -693,7 +695,9 @@
EVENT_RESOLVED_COUNT,
EVENT_UN_RESOLVED_COUNT,
WORK_EVENT_RESOLVED_COUNT,
WORK_EVENT_UN_RESOLVED_COUNT
WORK_EVENT_UN_RESOLVED_COUNT,
IC_EVENT_RESOLVED_COUNT,
IC_EVENT_UN_RESOLVED_COUNT
FROM
fact_agency_govern_daily
WHERE

1
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml

@ -203,6 +203,7 @@
<when test="orgType == 'department'">
INNER JOIN screen_customer_dept org ON org.CUSTOMER_ID = u.CUSTOMER_ID AND org.DEPT_ID = u.ORG_ID AND org.DEL_FLAG = '0'
</when>
</choose>
</if>
WHERE

10
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java

@ -147,6 +147,16 @@ public class FactAgencyGovernDailyDTO implements Serializable {
*/
private Integer workEventUnResolvedCount;
/**
* 19当前组织内来源于事件管理的项目结案已解决数
*/
private Integer icEventResolvedCount;
/**
* 20当前组织内来源于事件管理的项目结案无需解决数
*/
private Integer icEventUnResolvedCount;
/**
* 未出当前网格的结案项目数
*/

10
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java

@ -158,6 +158,16 @@ public class FactGridGovernDailyDTO implements Serializable {
*/
private Integer workEventUnResolvedCount;
/**
* 19当前组织内来源于事件管理的项目结案已解决数
*/
private Integer icEventResolvedCount;
/**
* 20当前组织内来源于事件管理的项目结案无需解决数
*/
private Integer icEventUnResolvedCount;
/**
* 15未出当前网格的结案项目数=11+12+13+14
*/

148
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyUserHouseDailyDTO.java

@ -0,0 +1,148 @@
package com.epmet.dto.stats;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 人房信息统计数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-27
*/
@Data
public class FactAgencyUserHouseDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键customer_id+AGENCY_ID+date_id只有一条记录
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 数据更新至yyyyMMdd;
*/
private String dateId;
/**
* 组织id
*/
private String agencyId;
/**
* agency_id所属的机关级别社区级community
街道:street,
区县级: district,
市级: city
省级:province
*/
private String level;
/**
* 组织i所属的组织id
*/
private String pid;
/**
* 组织i所有上级id
*/
private String pids;
/**
* 小区总数
*/
private Integer neighbourhoodsCount;
/**
* 房屋总数
*/
private Integer houseCount;
/**
* 自住房屋总数
*/
private Integer houseSelfCount;
/**
* 出租房屋总数
*/
private Integer houseLeaseCount;
/**
* 闲置房屋总数
*/
private Integer houseIdleCount;
/**
* 居民总数
*/
private Integer userCount;
/**
* 常住居民总数
*/
private Integer userResiCount;
/**
* 流动居民总数
*/
private Integer userFloatCount;
/**
* 当日新增房屋数
*/
private Integer houseIncr;
/**
* 当日修改房屋数
*/
private Integer houseModify;
/**
* 当日新增居民数
*/
private Integer userIncr;
/**
* 当日修改居民数
*/
private Integer userModify;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间第一次提交审核的时间注意和历史表的第一条记录时间一致
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

139
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridUserHouseDailyDTO.java

@ -0,0 +1,139 @@
package com.epmet.dto.stats;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 网格的人房信息统计数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-27
*/
@Data
public class FactGridUserHouseDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键customer_id+grid_id+date_id只有一条记录
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 数据更新至yyyyMMdd;
*/
private String dateId;
/**
* 网格id
*/
private String gridId;
/**
* 网格所属的组织id
*/
private String pid;
/**
* 网格所有上级id
*/
private String pids;
/**
* 小区总数
*/
private Integer neighbourhoodsCount;
/**
* 房屋总数
*/
private Integer houseCount;
/**
* 自住房屋总数
*/
private Integer houseSelfCount;
/**
* 出租房屋总数
*/
private Integer houseLeaseCount;
/**
* 闲置房屋总数
*/
private Integer houseIdleCount;
/**
* 居民总数
*/
private Integer userCount;
/**
* 常住居民总数
*/
private Integer userResiCount;
/**
* 流动居民总数
*/
private Integer userFloatCount;
/**
* 当日新增房屋数
*/
private Integer houseIncr;
/**
* 当日修改房屋数
*/
private Integer houseModify;
/**
* 当日新增居民数
*/
private Integer userIncr;
/**
* 当日修改居民数
*/
private Integer userModify;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间第一次提交审核的时间注意和历史表的第一条记录时间一致
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

149
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactNeighborhoodUserHouseDailyDTO.java

@ -0,0 +1,149 @@
package com.epmet.dto.stats;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 网格的人房信息统计数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-01
*/
@Data
public class FactNeighborhoodUserHouseDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键customer_id+grid_id+date_id只有一条记录
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 数据更新至yyyyMMdd;
*/
private String dateId;
/**
* 网格id
*/
private String gridId;
/**
* 网格所属的组织id
*/
private String pid;
/**
* 网格所有上级id
*/
private String pids;
/**
* 小区ID
*/
private String neighbourhoodsId;
/**
* 小区名称
*/
private String neighborHoodName;
/**
* 小区总数
*/
private Integer neighbourhoodsCount;
/**
* 房屋总数
*/
private Integer houseCount;
/**
* 自住房屋总数
*/
private Integer houseSelfCount;
/**
* 出租房屋总数
*/
private Integer houseLeaseCount;
/**
* 闲置房屋总数
*/
private Integer houseIdleCount;
/**
* 居民总数
*/
private Integer userCount;
/**
* 常住居民总数
*/
private Integer userResiCount;
/**
* 流动居民总数
*/
private Integer userFloatCount;
/**
* 当日新增房屋数
*/
private Integer houseIncr;
/**
* 当日修改房屋数
*/
private Integer houseModify;
/**
* 当日新增居民数
*/
private Integer userIncr;
/**
* 当日修改居民数
*/
private Integer userModify;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间第一次提交审核的时间注意和历史表的第一条记录时间一致
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

35
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/FactUserHouseFormDTO.java

@ -0,0 +1,35 @@
package com.epmet.dto.stats.form;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 人房信息统计数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-27
*/
@Data
public class FactUserHouseFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 数据更新至yyyyMMdd;
*/
private String dateId;
/**
* level
*/
private String level;
}

169
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/FactUserHouseResultDTO.java

@ -0,0 +1,169 @@
package com.epmet.dto.stats.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 人房信息统计数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-27
*/
@Data
public class FactUserHouseResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键customer_id+AGENCY_ID+date_id只有一条记录
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 数据更新至yyyyMMdd;
*/
private String dateId;
/**
* 网格id
*/
private String gridId;
/**
* 组织id
*/
private String agencyId;
/**
* 组织id
*/
private String agencyName;
/**
* 小区ID
*/
private String neighbourhoodsId;
/**
* 小区名称
*/
private String neighborHoodName;
/**
* agency_id所属的机关级别社区级community
街道:street,
区县级: district,
市级: city
省级:province
*/
private String level;
/**
* 组织i所属的组织id
*/
private String pid;
/**
* 组织i所有上级id
*/
private String pids;
/**
* 小区总数
*/
private Integer neighbourhoodsCount;
/**
* 房屋总数
*/
private Integer houseCount;
/**
* 自住房屋总数
*/
private Integer houseSelfCount;
/**
* 出租房屋总数
*/
private Integer houseLeaseCount;
/**
* 闲置房屋总数
*/
private Integer houseIdleCount;
/**
* 居民总数
*/
private Integer userCount;
/**
* 常住居民总数
*/
private Integer userResiCount;
/**
* 流动居民总数
*/
private Integer userFloatCount;
/**
* 当日新增房屋数
*/
private Integer houseIncr;
/**
* 当日修改房屋数
*/
private Integer houseModify;
/**
* 当日新增居民数
*/
private Integer userIncr;
/**
* 当日修改居民数
*/
private Integer userModify;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间第一次提交审核的时间注意和历史表的第一条记录时间一致
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

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

@ -13,6 +13,7 @@ import com.epmet.dto.org.result.CustomerAgencyDTO;
import com.epmet.dto.org.result.CustomerGridDTO;
import com.epmet.dto.screen.form.InitCustomerIndexForm;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.dto.stats.form.FactUserHouseFormDTO;
import com.epmet.dto.user.form.StaffBaseInfoFormDTO;
import com.epmet.dto.user.param.MidPatrolFormDTO;
import com.epmet.dto.user.result.GridUserInfoDTO;
@ -368,4 +369,13 @@ public interface DataStatisticalOpenFeignClient {
@PostMapping("/data/stats/screenextract/data_check")
Result dataCheck(@RequestBody ExtractOriginFormDTO formDTO);
@PostMapping("/data/stats/factAgencyUserHouseDaily/userHouseStatGrid")
Result userHouseStatGrid(@RequestBody FactUserHouseFormDTO formDTO);
@PostMapping("/data/stats/factAgencyUserHouseDaily/userHouseStatAgency")
Result userHouseStatAgency(@RequestBody FactUserHouseFormDTO formDTO);
@PostMapping("/data/stats/factAgencyUserHouseDaily/userHouseStatNeighborhood")
Result userHouseStatNeighborhood(@RequestBody FactUserHouseFormDTO formDTO);
}

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

@ -14,6 +14,7 @@ import com.epmet.dto.org.result.CustomerAgencyDTO;
import com.epmet.dto.org.result.CustomerGridDTO;
import com.epmet.dto.screen.form.InitCustomerIndexForm;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.dto.stats.form.FactUserHouseFormDTO;
import com.epmet.dto.user.form.StaffBaseInfoFormDTO;
import com.epmet.dto.user.param.MidPatrolFormDTO;
import com.epmet.dto.user.result.GridUserInfoDTO;
@ -351,4 +352,19 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
public Result dataCheck(ExtractOriginFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "dataCheck", formDTO);
}
@Override
public Result userHouseStatGrid(FactUserHouseFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "userHouseStatGrid", formDTO);
}
@Override
public Result userHouseStatAgency(FactUserHouseFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "userHouseStatAgency", formDTO);
}
@Override
public Result userHouseStatNeighborhood(FactUserHouseFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "userHouseStatNeighborhood", formDTO);
}
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java

@ -85,6 +85,8 @@ public interface ProjectConstant {
String PROJECT_ORIGIN_EVENT="resi_event";
String PROJECT_ORIGIN_WORK_EVENT="work_event";
String IC_EVENT="ic_event";
/**
* 自办
*/

103
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactUserHouseController.java

@ -0,0 +1,103 @@
package com.epmet.controller;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.stats.form.FactUserHouseFormDTO;
import com.epmet.dto.stats.result.FactUserHouseResultDTO;
import com.epmet.excel.FactUserHouseExcel;
import com.epmet.service.stats.FactUserHouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 人房信息统计数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-27
*/
@RestController
@RequestMapping("factAgencyUserHouseDaily")
public class FactUserHouseController {
@Autowired
private FactUserHouseService factUserHouseService;
@RequestMapping("page")
public Result<PageData<FactUserHouseResultDTO>> page(@RequestParam Map<String, Object> params) {
PageData<FactUserHouseResultDTO> page = factUserHouseService.page(params);
return new Result<PageData<FactUserHouseResultDTO>>().ok(page);
}
/**
* 合计
*
* @param params
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.stats.result.FactUserHouseResultDTO>
* @author zhy
* @date 2022/5/31 9:48
*/
@RequestMapping("total")
public Result<FactUserHouseResultDTO> total(@RequestParam Map<String, Object> params) {
FactUserHouseResultDTO dto = factUserHouseService.total(params);
return new Result<FactUserHouseResultDTO>().ok(dto);
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<FactUserHouseResultDTO> list = factUserHouseService.list(params);
if (list.isEmpty()) {
FactUserHouseResultDTO dto = new FactUserHouseResultDTO();
list.add(dto);
}
ExcelUtils.exportExcelToTarget(response, null, list, FactUserHouseExcel.class);
}
/**
* 统计网格纬度
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author zhy
* @date 2022/5/31 9:48
*/
@PostMapping("userHouseStatGrid")
public Result userHouseStatGrid(@RequestBody FactUserHouseFormDTO formDTO) {
factUserHouseService.statGrid(formDTO);
return new Result();
}
/**
* 统计小区纬度
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author wgf
* @date 2022/5/31 9:48
*/
@PostMapping("userHouseStatNeighborhood")
public Result userHouseStatNeighborhood(@RequestBody FactUserHouseFormDTO formDTO) {
factUserHouseService.statNeighborhood(formDTO);
return new Result();
}
/**
* 统计组织纬度
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author zhy
* @date 2022/5/31 9:48
*/
@PostMapping("userHouseStatAgency")
public Result userHouseStatAgency(@RequestBody FactUserHouseFormDTO formDTO) {
factUserHouseService.statAgency(formDTO);
return new Result();
}
}

28
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/IcHouseDao.java

@ -0,0 +1,28 @@
package com.epmet.dao.org;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.form.FactUserHouseFormDTO;
import com.epmet.dto.stats.result.FactUserHouseResultDTO;
import com.epmet.entity.org.IcHouseEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 房屋信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-25
*/
@Mapper
public interface IcHouseDao extends BaseDao<IcHouseEntity> {
List<FactUserHouseResultDTO> houseStat(FactUserHouseFormDTO formDTO);
List<FactUserHouseResultDTO> houseStatNew(FactUserHouseFormDTO formDTO);
List<FactUserHouseResultDTO> neighborhoodStatStat(FactUserHouseFormDTO formDTO);
List<FactUserHouseResultDTO> neighborhoodStatStatNew(FactUserHouseFormDTO formDTO);
}

26
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyUserHouseDailyDao.java

@ -0,0 +1,26 @@
package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.form.FactUserHouseFormDTO;
import com.epmet.dto.stats.result.FactUserHouseResultDTO;
import com.epmet.entity.stats.FactAgencyUserHouseDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 人房信息统计数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-27
*/
@Mapper
public interface FactAgencyUserHouseDailyDao extends BaseDao<FactAgencyUserHouseDailyEntity> {
List<FactUserHouseResultDTO> listPage(Map<String, Object> params);
List<FactUserHouseResultDTO> getTotal(Map<String, Object> params);
void deleteByDateId(FactUserHouseFormDTO formDTO);
}

28
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridUserHouseDailyDao.java

@ -0,0 +1,28 @@
package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.form.FactUserHouseFormDTO;
import com.epmet.dto.stats.result.FactUserHouseResultDTO;
import com.epmet.entity.stats.FactGridUserHouseDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 网格的人房信息统计数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-27
*/
@Mapper
public interface FactGridUserHouseDailyDao extends BaseDao<FactGridUserHouseDailyEntity> {
List<FactUserHouseResultDTO> listPage(Map<String, Object> params);
List<FactUserHouseResultDTO> getTotal(Map<String, Object> params);
List<FactUserHouseResultDTO> statAgency(FactUserHouseFormDTO formDTO);
void deleteByDateId(FactUserHouseFormDTO formDTO);
}

27
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactNeighborhoodUserHouseDailyDao.java

@ -0,0 +1,27 @@
package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.form.FactUserHouseFormDTO;
import com.epmet.dto.stats.result.FactUserHouseResultDTO;
import com.epmet.entity.stats.FactNeighborhoodUserHouseDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 网格的人房信息统计数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-01
*/
@Mapper
public interface FactNeighborhoodUserHouseDailyDao extends BaseDao<FactNeighborhoodUserHouseDailyEntity> {
void deleteByDateId(FactUserHouseFormDTO formDTO);
List<FactUserHouseResultDTO> listPage(Map<String, Object> params);
List<FactUserHouseResultDTO> getTotal(Map<String, Object> params);
}

42
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/IcResiUserDao.java

@ -0,0 +1,42 @@
/**
* 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.dao.user;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.form.FactUserHouseFormDTO;
import com.epmet.dto.stats.result.FactUserHouseResultDTO;
import com.epmet.entity.user.IcResiUserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 用户基础信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-26
*/
@Mapper
public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
List<FactUserHouseResultDTO> userStat(FactUserHouseFormDTO formDTO);
List<FactUserHouseResultDTO> userStatNew(FactUserHouseFormDTO formDTO);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java

@ -186,4 +186,14 @@ public class FactAgencyGovernDailyEntity extends BaseEpmetEntity {
*/
private Integer districtDeptClosedCount;
/**
* 19当前组织内来源于事件管理的项目结案已解决数
*/
private Integer icEventResolvedCount;
/**
* 20当前组织内来源于事件管理的项目结案无需解决数
*/
private Integer icEventUnResolvedCount;
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java

@ -186,6 +186,16 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity {
*/
private Integer workEventUnResolvedCount;
/**
* 19当前组织内来源于事件管理的项目结案已解决数
*/
private Integer icEventResolvedCount;
/**
* 20当前组织内来源于事件管理的项目结案无需解决数
*/
private Integer icEventUnResolvedCount;
/**
* 当前网格内出来的项目由社区结案(已解决+未解决)的项目总数

110
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/IcHouseEntity.java

@ -0,0 +1,110 @@
/**
* 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.entity.org;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 房屋信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-25
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_house")
public class IcHouseEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 小区id
*/
private String neighborHoodId;
/**
* 片区idneighbor_hood_part.id,可为空
*/
private String partId;
/**
* 所属楼栋id
*/
private String buildingId;
/**
* 所属单元id
*/
private String buildingUnitId;
/**
* 房屋名字后台插入时生成
*/
private String houseName;
/**
* 门牌号
*/
private String doorName;
/**
* 房屋类型这里存储字典value就可以
*/
private String houseType;
/**
* 存储字典value
*/
private String purpose;
/**
* 1出租0未出租
*/
private Integer rentFlag;
/**
* 房主姓名
*/
private String ownerName;
/**
* 房主电话
*/
private String ownerPhone;
/**
* 房主身份证号
*/
private String ownerIdCard;
/**
* 排序
*/
private BigDecimal sort;
}

118
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyUserHouseDailyEntity.java

@ -0,0 +1,118 @@
package com.epmet.entity.stats;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 人房信息统计数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-27
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_agency_user_house_daily")
public class FactAgencyUserHouseDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 数据更新至yyyyMMdd;
*/
private String dateId;
/**
* 组织id
*/
private String agencyId;
/**
* agency_id所属的机关级别社区级community
街道:street,
区县级: district,
市级: city
省级:province
*/
private String level;
/**
* 组织i所属的组织id
*/
private String pid;
/**
* 组织i所有上级id
*/
private String pids;
/**
* 小区总数
*/
private Integer neighbourhoodsCount;
/**
* 房屋总数
*/
private Integer houseCount;
/**
* 自住房屋总数
*/
private Integer houseSelfCount;
/**
* 出租房屋总数
*/
private Integer houseLeaseCount;
/**
* 闲置房屋总数
*/
private Integer houseIdleCount;
/**
* 居民总数
*/
private Integer userCount;
/**
* 常住居民总数
*/
private Integer userResiCount;
/**
* 流动居民总数
*/
private Integer userFloatCount;
/**
* 当日新增房屋数
*/
private Integer houseIncr;
/**
* 当日修改房屋数
*/
private Integer houseModify;
/**
* 当日新增居民数
*/
private Integer userIncr;
/**
* 当日修改居民数
*/
private Integer userModify;
}

109
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridUserHouseDailyEntity.java

@ -0,0 +1,109 @@
package com.epmet.entity.stats;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 网格的人房信息统计数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-27
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_grid_user_house_daily")
public class FactGridUserHouseDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 数据更新至yyyyMMdd;
*/
private String dateId;
/**
* 网格id
*/
private String gridId;
/**
* 网格所属的组织id
*/
private String pid;
/**
* 网格所有上级id
*/
private String pids;
/**
* 小区总数
*/
private Integer neighbourhoodsCount;
/**
* 房屋总数
*/
private Integer houseCount;
/**
* 自住房屋总数
*/
private Integer houseSelfCount;
/**
* 出租房屋总数
*/
private Integer houseLeaseCount;
/**
* 闲置房屋总数
*/
private Integer houseIdleCount;
/**
* 居民总数
*/
private Integer userCount;
/**
* 常住居民总数
*/
private Integer userResiCount;
/**
* 流动居民总数
*/
private Integer userFloatCount;
/**
* 当日新增房屋数
*/
private Integer houseIncr;
/**
* 当日修改房屋数
*/
private Integer houseModify;
/**
* 当日新增居民数
*/
private Integer userIncr;
/**
* 当日修改居民数
*/
private Integer userModify;
}

119
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactNeighborhoodUserHouseDailyEntity.java

@ -0,0 +1,119 @@
package com.epmet.entity.stats;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 网格的人房信息统计数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-01
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_neighborhood_user_house_daily")
public class FactNeighborhoodUserHouseDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 数据更新至yyyyMMdd;
*/
private String dateId;
/**
* 网格id
*/
private String gridId;
/**
* 网格所属的组织id
*/
private String pid;
/**
* 网格所有上级id
*/
private String pids;
/**
* 小区ID
*/
private String neighbourhoodsId;
/**
* 小区名称
*/
private String neighborHoodName;
/**
* 房屋总数
*/
private Integer houseCount;
/**
* 小区总数
*/
private Integer neighbourhoodsCount;
/**
* 自住房屋总数
*/
private Integer houseSelfCount;
/**
* 出租房屋总数
*/
private Integer houseLeaseCount;
/**
* 闲置房屋总数
*/
private Integer houseIdleCount;
/**
* 居民总数
*/
private Integer userCount;
/**
* 常住居民总数
*/
private Integer userResiCount;
/**
* 流动居民总数
*/
private Integer userFloatCount;
/**
* 当日新增房屋数
*/
private Integer houseIncr;
/**
* 当日修改房屋数
*/
private Integer houseModify;
/**
* 当日新增居民数
*/
private Integer userIncr;
/**
* 当日修改居民数
*/
private Integer userModify;
}

513
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/IcResiUserEntity.java

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

56
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/excel/FactUserHouseExcel.java

@ -0,0 +1,56 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 人房信息统计数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-27
*/
@Data
public class FactUserHouseExcel {
@Excel(name = "组织结构")
private String agencyName;
@Excel(name = "小区数")
private Integer neighbourhoodsCount;
@Excel(name = "房屋数")
private Integer houseCount;
@Excel(name = "自住房屋数")
private Integer houseSelfCount;
@Excel(name = "出租房屋数")
private Integer houseLeaseCount;
@Excel(name = "闲置房屋数")
private Integer houseIdleCount;
@Excel(name = "居民总数")
private Integer userCount;
@Excel(name = "常住人口数")
private Integer userResiCount;
@Excel(name = "流动人口数")
private Integer userFloatCount;
@Excel(name = "新增房屋数")
private Integer houseIncr;
@Excel(name = "新增人口数")
private Integer userIncr;
@Excel(name = "修改房屋数")
private Integer houseModify;
@Excel(name = "修改人口数")
private Integer userModify;
}

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

@ -285,6 +285,32 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgency
});
}
//2022-5-23 当前组织内:来源于事件管理的项目:结案已解决数
Map<String, OrgStatisticsResultDTO> icEventProjectResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId,
dateId, ProjectConstant.RESOLVED,
ProjectConstant.IC_EVENT);
if (!icEventProjectResolvedTotal.isEmpty()) {
agencyGovernDailyList.forEach(item -> {
OrgStatisticsResultDTO dto = icEventProjectResolvedTotal.get(item.getAgencyId());
if (null != dto) {
item.setIcEventResolvedCount(dto.getSum());
}
});
}
//2022-5-23 当前组织内:来源于事件管理的项目:结案无需解决数
Map<String, OrgStatisticsResultDTO> icEventProjectUnResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId,
dateId, ProjectConstant.UNRESOLVED,
ProjectConstant.IC_EVENT);
if (!icEventProjectUnResolvedTotal.isEmpty()) {
agencyGovernDailyList.forEach(item -> {
OrgStatisticsResultDTO dto = icEventProjectUnResolvedTotal.get(item.getAgencyId());
if (null != dto) {
item.setIcEventUnResolvedCount(dto.getSum());
}
});
}
// 2.党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的)
agencyGovernDailyList.forEach(item -> {
int count = item.getInGroupTopicResolvedCount() + item.getInGroupTopicUnResolvedCount();
@ -423,6 +449,8 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgency
entity.setEventUnResolvedCount(NumConstant.ZERO);
entity.setWorkEventResolvedCount(NumConstant.ZERO);
entity.setWorkEventUnResolvedCount(NumConstant.ZERO);
entity.setIcEventResolvedCount(NumConstant.ZERO);
entity.setIcEventUnResolvedCount(NumConstant.ZERO);
entity.setInGroupTopicResolvedCount(NumConstant.ZERO);
entity.setInGroupTopicUnResolvedCount(NumConstant.ZERO);
entity.setGridSelfGovernProjectTotal(NumConstant.ZERO);

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

@ -115,6 +115,8 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
Map<String,Integer> eventProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_EVENT,DimObjectStatusConstant.UNRESOLVED);
Map<String,Integer> workEventProjectResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_WORK_EVENT,DimObjectStatusConstant.RESOLVED);
Map<String,Integer> workEventProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_WORK_EVENT,DimObjectStatusConstant.UNRESOLVED);
Map<String,Integer> icEventProjectResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.IC_EVENT,DimObjectStatusConstant.RESOLVED);
Map<String,Integer> icEventProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.IC_EVENT,DimObjectStatusConstant.UNRESOLVED);
Map<String, Integer> inGroupTopicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,NumConstant.ZERO_STR);
Map<String, Integer> inGroupTopicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,NumConstant.ZERO_STR);
Map<String, GovernGridClosedTotalCommonDTO> dtoMap=getGovernGridClosedTotalCommonDTOMap(customerId,gridIds);
@ -182,6 +184,16 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
insertEntity.setWorkEventUnResolvedCount(workEventProjectUnResolvedMap.get(insertEntity.getGridId()));
}
// 2022-5-23 当前组织内:来源于事件管理的项目:结案已解决数
if(icEventProjectResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setIcEventResolvedCount(icEventProjectResolvedMap.get(insertEntity.getGridId()));
}
// 2022-5-23 当前组织内:来源于事件管理的项目:结案无需解决数
if(icEventProjectUnResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setIcEventUnResolvedCount(icEventProjectUnResolvedMap.get(insertEntity.getGridId()));
}
// 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的)
// 9、当前网格内,未出小组即未转议题的:话题关闭已解决数
if(inGroupTopicResolvedMap.containsKey(insertEntity.getGridId())){
@ -226,7 +238,9 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
+ insertEntity.getEventResolvedCount()
+ insertEntity.getEventUnResolvedCount()
+ insertEntity.getWorkEventResolvedCount()
+ insertEntity.getWorkEventUnResolvedCount();
+ insertEntity.getWorkEventUnResolvedCount()
+ insertEntity.getIcEventResolvedCount()
+ insertEntity.getIcEventUnResolvedCount();
// 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的)
//界面展示:2、党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数
int groupSelfGovernRatioFz=insertEntity.getInGroupTopicResolvedCount()+insertEntity.getInGroupTopicUnResolvedCount();

73
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/HouseService.java

@ -0,0 +1,73 @@
/**
* 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.service.org;
import com.epmet.dto.stats.form.FactUserHouseFormDTO;
import com.epmet.dto.stats.result.FactUserHouseResultDTO;
import java.util.List;
/**
* 小区表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-25
*/
public interface HouseService {
/**
* 房屋统计
*
* @param formDTO
* @return java.util.List<com.epmet.dto.stats.result.FactUserHouseResultDTO>
* @author zhy
* @date 2022/5/30 13:33
*/
List<FactUserHouseResultDTO> houseStat(FactUserHouseFormDTO formDTO);
/**
* 房屋统计(小区)
*
* @param formDTO
* @return java.util.List<com.epmet.dto.stats.result.FactUserHouseResultDTO>
* @author wgf
* @date 2022/5/30 13:33
*/
List<FactUserHouseResultDTO> houseStatNew(FactUserHouseFormDTO formDTO);
/**
* 小区统计
*
* @param formDTO
* @return java.util.List<com.epmet.dto.stats.result.FactUserHouseResultDTO>
* @author zhy
* @date 2022/5/30 13:33
*/
List<FactUserHouseResultDTO> neighborhoodStat(FactUserHouseFormDTO formDTO);
/**
* 小区统计(小区)
*
* @param formDTO
* @return java.util.List<com.epmet.dto.stats.result.FactUserHouseResultDTO>
* @author wgf
* @date 2022/5/30 13:33
*/
List<FactUserHouseResultDTO> neighborhoodStatNew(FactUserHouseFormDTO formDTO);
}

42
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/HouseServiceImpl.java

@ -0,0 +1,42 @@
package com.epmet.service.org.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.org.IcHouseDao;
import com.epmet.dto.stats.form.FactUserHouseFormDTO;
import com.epmet.dto.stats.result.FactUserHouseResultDTO;
import com.epmet.entity.org.IcHouseEntity;
import com.epmet.service.org.HouseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@DataSource(DataSourceConstant.GOV_ORG)
@Service
public class HouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntity> implements HouseService, ResultDataResolver {
@Override
public List<FactUserHouseResultDTO> houseStat(FactUserHouseFormDTO formDTO) {
return baseDao.houseStat(formDTO);
}
@Override
public List<FactUserHouseResultDTO> houseStatNew(FactUserHouseFormDTO formDTO) {
return baseDao.houseStatNew(formDTO);
}
@Override
public List<FactUserHouseResultDTO> neighborhoodStat(FactUserHouseFormDTO formDTO) {
return baseDao.neighborhoodStatStat(formDTO);
}
@Override
public List<FactUserHouseResultDTO> neighborhoodStatNew(FactUserHouseFormDTO formDTO) {
return baseDao.neighborhoodStatStatNew(formDTO);
}
}

111
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyUserHouseDailyService.java

@ -0,0 +1,111 @@
package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.FactAgencyUserHouseDailyDTO;
import com.epmet.dto.stats.FactGridUserHouseDailyDTO;
import com.epmet.dto.stats.form.FactUserHouseFormDTO;
import com.epmet.dto.stats.result.FactUserHouseResultDTO;
import com.epmet.entity.stats.FactAgencyUserHouseDailyEntity;
import java.util.List;
import java.util.Map;
/**
* 人房信息统计数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-27
*/
public interface FactAgencyUserHouseDailyService extends BaseService<FactAgencyUserHouseDailyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<FactAgencyUserHouseDailyDTO>
* @author generator
* @date 2022-05-27
*/
PageData<FactUserHouseResultDTO> page(Map<String, Object> params);
/**
* 分页合计
*
* @param params
* @return PageData<FactAgencyUserHouseDailyDTO>
* @author generator
* @date 2022-05-27
*/
FactUserHouseResultDTO getTotal(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<FactAgencyUserHouseDailyDTO>
* @author generator
* @date 2022-05-27
*/
List<FactAgencyUserHouseDailyDTO> list(Map<String, Object> params);
/**
* 查询导出数据
*
* @param params
* @return java.util.List<FactUserHouseResultDTO>
* @author generator
* @date 2022-05-27
*/
List<FactUserHouseResultDTO> listExport(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return FactAgencyUserHouseDailyDTO
* @author generator
* @date 2022-05-27
*/
FactAgencyUserHouseDailyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-05-27
*/
void save(FactAgencyUserHouseDailyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-05-27
*/
void update(FactAgencyUserHouseDailyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2022-05-27
*/
void delete(String[] ids);
/**
* 物理删除历史数据
*
* @param formDTO
* @return void
* @author zhy
* @date 2022/5/30 13:32
*/
void deleteByDateId(FactUserHouseFormDTO formDTO);
}

120
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridUserHouseDailyService.java

@ -0,0 +1,120 @@
package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.FactGridUserHouseDailyDTO;
import com.epmet.dto.stats.form.FactUserHouseFormDTO;
import com.epmet.dto.stats.result.FactUserHouseResultDTO;
import com.epmet.entity.stats.FactGridUserHouseDailyEntity;
import java.util.List;
import java.util.Map;
/**
* 网格的人房信息统计数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-27
*/
public interface FactGridUserHouseDailyService extends BaseService<FactGridUserHouseDailyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<FactGridUserHouseDailyDTO>
* @author generator
* @date 2022-05-27
*/
PageData<FactUserHouseResultDTO> page(Map<String, Object> params);
/**
* 页面合计
*
* @param params
* @return PageData<FactGridUserHouseDailyDTO>
* @author generator
* @date 2022-05-27
*/
FactUserHouseResultDTO getTotal(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<FactGridUserHouseDailyDTO>
* @author generator
* @date 2022-05-27
*/
List<FactGridUserHouseDailyDTO> list(Map<String, Object> params);
/**
* 查询导出数据
*
* @param params
* @return java.util.List<FactUserHouseResultDTO>
* @author generator
* @date 2022-05-27
*/
List<FactUserHouseResultDTO> listExport(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return FactGridUserHouseDailyDTO
* @author generator
* @date 2022-05-27
*/
FactGridUserHouseDailyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-05-27
*/
void save(FactGridUserHouseDailyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-05-27
*/
void update(FactGridUserHouseDailyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2022-05-27
*/
void delete(String[] ids);
/**
* 物理删除历史数据
*
* @param formDTO
* @return void
* @author zhy
* @date 2022/5/30 13:32
*/
void deleteByDateId(FactUserHouseFormDTO formDTO);
/**
* 根据网格统计组织数据
*
* @param formDTO
* @return java.util.List<com.epmet.dto.stats.result.FactUserHouseResultDTO>
* @author zhy
* @date 2022/5/30 13:32
*/
List<FactUserHouseResultDTO> statAgency(FactUserHouseFormDTO formDTO);
}

113
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactNeighborhoodUserHouseDailyService.java

@ -0,0 +1,113 @@
package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.FactNeighborhoodUserHouseDailyDTO;
import com.epmet.dto.stats.form.FactUserHouseFormDTO;
import com.epmet.dto.stats.result.FactUserHouseResultDTO;
import com.epmet.entity.stats.FactNeighborhoodUserHouseDailyEntity;
import java.util.List;
import java.util.Map;
/**
* 网格的人房信息统计数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-01
*/
public interface FactNeighborhoodUserHouseDailyService extends BaseService<FactNeighborhoodUserHouseDailyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<FactNeighborhoodUserHouseDailyDTO>
* @author generator
* @date 2022-06-01
*/
PageData<FactUserHouseResultDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<FactNeighborhoodUserHouseDailyDTO>
* @author generator
* @date 2022-06-01
*/
List<FactNeighborhoodUserHouseDailyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return FactNeighborhoodUserHouseDailyDTO
* @author generator
* @date 2022-06-01
*/
FactNeighborhoodUserHouseDailyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-06-01
*/
void save(FactNeighborhoodUserHouseDailyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-06-01
*/
void update(FactNeighborhoodUserHouseDailyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2022-06-01
*/
void delete(String[] ids);
/**
* 物理删除历史数据
*
* @param formDTO
* @return void
* @author wgf
* @date 2022/5/30 13:32
*/
void deleteByDateId(FactUserHouseFormDTO formDTO);
/**
* 查询导出数据
*
* @param params
* @return java.util.List<FactUserHouseResultDTO>
* @author wgf
* @date 2022-05-27
*/
List<FactUserHouseResultDTO> listExport(Map<String, Object> params);
/**
* 页面合计
*
* @param params
* @return PageData<FactGridUserHouseDailyDTO>
* @author wgf
* @date 2022-05-27
*/
FactUserHouseResultDTO getTotal(Map<String, Object> params);
}

78
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactUserHouseService.java

@ -0,0 +1,78 @@
package com.epmet.service.stats;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.FactAgencyUserHouseDailyDTO;
import com.epmet.dto.stats.form.FactUserHouseFormDTO;
import com.epmet.dto.stats.result.FactUserHouseResultDTO;
import java.util.List;
import java.util.Map;
/**
* 人房信息统计数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-27
*/
public interface FactUserHouseService {
/**
* 默认分页
*
* @param params
* @return PageData<FactAgencyUserHouseDailyDTO>
* @author generator
* @date 2022-05-27
*/
PageData<FactUserHouseResultDTO> page(Map<String, Object> params);
/**
* 页面合计
*
* @param params
* @return PageData<FactAgencyUserHouseDailyDTO>
* @author generator
* @date 2022-05-27
*/
FactUserHouseResultDTO total(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<FactAgencyUserHouseDailyDTO>
* @author generator
* @date 2022-05-27
*/
List<FactUserHouseResultDTO> list(Map<String, Object> params);
/**
* 人房网格数据
*
* @param formDTO
* @return void
* @author zhy
* @date 2022/5/30 13:31
*/
void statGrid(FactUserHouseFormDTO formDTO);
/**
* 人房小区数据
*
* @param formDTO
* @return void
* @author wgf
* @date 2022/5/30 13:31
*/
void statNeighborhood(FactUserHouseFormDTO formDTO);
/**
* 人房组织数据
*
* @param formDTO
* @return void
* @author zhy
* @date 2022/5/30 13:31
*/
void statAgency(FactUserHouseFormDTO formDTO);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java

@ -81,9 +81,11 @@ public class DimGridServiceImpl extends BaseServiceImpl<DimGridDao, DimGridEntit
private QueryWrapper<DimGridEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
String customerId = (String)params.get("customerId");
QueryWrapper<DimGridEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
wrapper.eq(StringUtils.isNotBlank(customerId), "CUSTOMER_ID", customerId);
return wrapper;
}

121
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyUserHouseDailyServiceImpl.java

@ -0,0 +1,121 @@
package com.epmet.service.stats.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.stats.FactAgencyUserHouseDailyDao;
import com.epmet.dto.stats.FactAgencyUserHouseDailyDTO;
import com.epmet.dto.stats.form.FactUserHouseFormDTO;
import com.epmet.dto.stats.result.FactUserHouseResultDTO;
import com.epmet.entity.stats.FactAgencyUserHouseDailyEntity;
import com.epmet.service.stats.FactAgencyUserHouseDailyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 人房信息统计数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-27
*/
@Service
public class FactAgencyUserHouseDailyServiceImpl extends BaseServiceImpl<FactAgencyUserHouseDailyDao, FactAgencyUserHouseDailyEntity> implements FactAgencyUserHouseDailyService {
@Autowired
private LoginUserUtil loginUserUtil;
@Override
public PageData<FactUserHouseResultDTO> page(Map<String, Object> params) {
params.put("customerId", loginUserUtil.getLoginUserCustomerId());
IPage<FactUserHouseResultDTO> page = getPage(params);
List<FactUserHouseResultDTO> list = baseDao.listPage(params);
return new PageData<>(list, page.getTotal());
}
@Override
public FactUserHouseResultDTO getTotal(Map<String, Object> params) {
params.put("customerId", loginUserUtil.getLoginUserCustomerId());
List<FactUserHouseResultDTO> list = baseDao.getTotal(params);
// 只有当日数据直接展示,否则需要统计时间段内两天差值进行Incr和Modify数据计算
if (list.size() == NumConstant.ZERO) {
return null;
} else if (list.size() == NumConstant.ONE) {
return list.get(0);
} else {
FactUserHouseResultDTO first = list.get(0);
FactUserHouseResultDTO last = list.get(list.size() - 1);
FactUserHouseResultDTO dto = last;
dto.setHouseIncr(last.getHouseIncr() - first.getHouseIncr());
dto.setHouseModify(last.getHouseModify() - first.getHouseModify());
dto.setUserIncr(last.getUserIncr() - first.getUserIncr());
dto.setUserModify(last.getUserModify() - first.getUserModify());
return dto;
}
}
@Override
public List<FactAgencyUserHouseDailyDTO> list(Map<String, Object> params) {
List<FactAgencyUserHouseDailyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, FactAgencyUserHouseDailyDTO.class);
}
@Override
public List<FactUserHouseResultDTO> listExport(Map<String, Object> params) {
return baseDao.listPage(params);
}
private QueryWrapper<FactAgencyUserHouseDailyEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<FactAgencyUserHouseDailyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public FactAgencyUserHouseDailyDTO get(String id) {
FactAgencyUserHouseDailyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, FactAgencyUserHouseDailyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(FactAgencyUserHouseDailyDTO dto) {
FactAgencyUserHouseDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactAgencyUserHouseDailyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(FactAgencyUserHouseDailyDTO dto) {
FactAgencyUserHouseDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactAgencyUserHouseDailyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public void deleteByDateId(FactUserHouseFormDTO formDTO) {
baseDao.deleteByDateId(formDTO);
}
}

138
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridUserHouseDailyServiceImpl.java

@ -0,0 +1,138 @@
package com.epmet.service.stats.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.stats.FactGridUserHouseDailyDao;
import com.epmet.dto.stats.FactGridUserHouseDailyDTO;
import com.epmet.dto.stats.form.FactUserHouseFormDTO;
import com.epmet.dto.stats.result.FactUserHouseResultDTO;
import com.epmet.entity.stats.FactGridUserHouseDailyEntity;
import com.epmet.service.stats.FactGridUserHouseDailyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 网格的人房信息统计数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-27
*/
@Service
public class FactGridUserHouseDailyServiceImpl extends BaseServiceImpl<FactGridUserHouseDailyDao, FactGridUserHouseDailyEntity> implements FactGridUserHouseDailyService {
@Autowired
private LoginUserUtil loginUserUtil;
@Override
public PageData<FactUserHouseResultDTO> page(Map<String, Object> params) {
params.put("customerId", loginUserUtil.getLoginUserCustomerId());
IPage<FactUserHouseResultDTO> page = getPage(params);
List<FactUserHouseResultDTO> list = baseDao.listPage(params);
return new PageData<>(list, page.getTotal());
}
@Override
public FactUserHouseResultDTO getTotal(Map<String, Object> params) {
params.put("customerId", loginUserUtil.getLoginUserCustomerId());
List<FactUserHouseResultDTO> list = baseDao.getTotal(params);
// 只有当日数据直接展示,否则需要统计时间段内两天差值进行Incr和Modify数据计算
if (list.size() == NumConstant.ZERO) {
return null;
} else if (list.size() == NumConstant.ONE) {
return list.get(0);
} else {
Integer houseIncr = 0;
Integer houseModify = 0;
Integer userIncr = 0;
Integer userModify = 0;
for(FactUserHouseResultDTO factUserHouseResultDTO : list){
houseIncr = houseIncr + factUserHouseResultDTO.getHouseIncr();
houseModify = houseModify + factUserHouseResultDTO.getHouseModify();
userIncr = userIncr + factUserHouseResultDTO.getUserIncr();
userModify = userModify + factUserHouseResultDTO.getUserModify();
}
FactUserHouseResultDTO dto = list.get(list.size() - 1);
dto.setHouseIncr(houseIncr);
dto.setHouseModify(houseModify);
dto.setUserIncr(userIncr);
dto.setUserModify(userModify);
return dto;
}
}
@Override
public List<FactGridUserHouseDailyDTO> list(Map<String, Object> params) {
List<FactGridUserHouseDailyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, FactGridUserHouseDailyDTO.class);
}
@Override
public List<FactUserHouseResultDTO> listExport(Map<String, Object> params) {
return baseDao.listPage(params);
}
private QueryWrapper<FactGridUserHouseDailyEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
String dateId = (String) params.get("dateId");
String customerId = (String) params.get("customerId");
QueryWrapper<FactGridUserHouseDailyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
wrapper.eq(StringUtils.isNotBlank(dateId), "DATE_ID", dateId);
wrapper.eq(StringUtils.isNotBlank(customerId), "CUSTOMER_ID", customerId);
return wrapper;
}
@Override
public FactGridUserHouseDailyDTO get(String id) {
FactGridUserHouseDailyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, FactGridUserHouseDailyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(FactGridUserHouseDailyDTO dto) {
FactGridUserHouseDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGridUserHouseDailyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(FactGridUserHouseDailyDTO dto) {
FactGridUserHouseDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGridUserHouseDailyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public void deleteByDateId(FactUserHouseFormDTO formDTO) {
baseDao.deleteByDateId(formDTO);
}
@Override
public List<FactUserHouseResultDTO> statAgency(FactUserHouseFormDTO formDTO) {
return baseDao.statAgency(formDTO);
}
}

129
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactNeighborhoodUserHouseDailyServiceImpl.java

@ -0,0 +1,129 @@
package com.epmet.service.stats.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dao.stats.FactNeighborhoodUserHouseDailyDao;
import com.epmet.dto.stats.FactNeighborhoodUserHouseDailyDTO;
import com.epmet.dto.stats.form.FactUserHouseFormDTO;
import com.epmet.dto.stats.result.FactUserHouseResultDTO;
import com.epmet.entity.stats.FactGridUserHouseDailyEntity;
import com.epmet.entity.stats.FactNeighborhoodUserHouseDailyEntity;
import com.epmet.service.stats.FactNeighborhoodUserHouseDailyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
/**
* 网格的人房信息统计数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-01
*/
@Service
public class FactNeighborhoodUserHouseDailyServiceImpl extends BaseServiceImpl<FactNeighborhoodUserHouseDailyDao, FactNeighborhoodUserHouseDailyEntity> implements FactNeighborhoodUserHouseDailyService {
@Autowired
private LoginUserUtil loginUserUtil;
@Override
public PageData<FactUserHouseResultDTO> page(Map<String, Object> params) {
params.put("customerId", loginUserUtil.getLoginUserCustomerId());
IPage<FactUserHouseResultDTO> page = getPage(params);
List<FactUserHouseResultDTO> list = baseDao.listPage(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<FactNeighborhoodUserHouseDailyDTO> list(Map<String, Object> params) {
List<FactNeighborhoodUserHouseDailyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, FactNeighborhoodUserHouseDailyDTO.class);
}
private QueryWrapper<FactNeighborhoodUserHouseDailyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<FactNeighborhoodUserHouseDailyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public FactNeighborhoodUserHouseDailyDTO get(String id) {
FactNeighborhoodUserHouseDailyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, FactNeighborhoodUserHouseDailyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(FactNeighborhoodUserHouseDailyDTO dto) {
FactNeighborhoodUserHouseDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactNeighborhoodUserHouseDailyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(FactNeighborhoodUserHouseDailyDTO dto) {
FactNeighborhoodUserHouseDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactNeighborhoodUserHouseDailyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public void deleteByDateId(FactUserHouseFormDTO formDTO) {
baseDao.deleteByDateId(formDTO);
}
@Override
public List<FactUserHouseResultDTO> listExport(Map<String, Object> params) {
return baseDao.listPage(params);
}
@Override
public FactUserHouseResultDTO getTotal(Map<String, Object> params) {
params.put("customerId", loginUserUtil.getLoginUserCustomerId());
List<FactUserHouseResultDTO> list = baseDao.getTotal(params);
// 只有当日数据直接展示,否则需要统计时间段内两天差值进行Incr和Modify数据计算
if (list.size() == NumConstant.ZERO) {
return null;
} else if (list.size() == NumConstant.ONE) {
return list.get(0);
} else {
Integer houseIncr = 0;
Integer houseModify = 0;
Integer userIncr = 0;
Integer userModify = 0;
for(FactUserHouseResultDTO factUserHouseResultDTO : list){
houseIncr = houseIncr + factUserHouseResultDTO.getHouseIncr();
houseModify = houseModify + factUserHouseResultDTO.getHouseModify();
userIncr = userIncr + factUserHouseResultDTO.getUserIncr();
userModify = userModify + factUserHouseResultDTO.getUserModify();
}
FactUserHouseResultDTO dto = list.get(list.size() - 1);
dto.setHouseIncr(houseIncr);
dto.setHouseModify(houseModify);
dto.setUserIncr(userIncr);
dto.setUserModify(userModify);
return dto;
}
}
}

307
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactUserHouseServiceImpl.java

@ -0,0 +1,307 @@
package com.epmet.service.stats.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.enums.OrgLevelEnum;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.stats.FactGridUserHouseDailyDTO;
import com.epmet.dto.stats.form.FactUserHouseFormDTO;
import com.epmet.dto.stats.result.FactUserHouseResultDTO;
import com.epmet.entity.stats.FactAgencyUserHouseDailyEntity;
import com.epmet.entity.stats.FactGridUserHouseDailyEntity;
import com.epmet.entity.stats.FactNeighborhoodUserHouseDailyEntity;
import com.epmet.service.org.HouseService;
import com.epmet.service.stats.*;
import com.epmet.service.user.IcResiUserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* 人房信息统计数按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-27
*/
@Service
@Slf4j
public class FactUserHouseServiceImpl implements FactUserHouseService {
@Autowired
private FactAgencyUserHouseDailyService factAgencyUserHouseDailyService;
@Autowired
private FactGridUserHouseDailyService factGridUserHouseDailyService;
@Autowired
private FactNeighborhoodUserHouseDailyService factNeighborhoodUserHouseDailyService;
@Autowired
private HouseService houseService;
@Autowired
private IcResiUserService icResiUserService;
@Autowired
private DimGridService dimGridService;
@Override
public PageData<FactUserHouseResultDTO> page(Map<String, Object> params) {
PageData<FactUserHouseResultDTO> page = null;
if (params.containsKey("startTime") && params.containsKey("endTime")) {
if (StringUtils.isNotBlank(params.get("startTime").toString()) && StringUtils.isNotBlank(params.get("endTime").toString())) {
params.put("dateId", StringUtils.EMPTY);
} else {
params.put("dateId", DateUtils.getBeforeNDay(NumConstant.ONE));
}
} else {
params.put("dateId", DateUtils.getBeforeNDay(NumConstant.ONE));
}
if (params.containsKey("level")) {
if("neighborhood".equals(params.get("level").toString()) || OrgLevelEnum.GRID.getCode().equals(params.get("level").toString())){
page = factNeighborhoodUserHouseDailyService.page(params);
}else if (OrgLevelEnum.COMMUNITY.getCode().equals(params.get("level").toString())) {
page = factGridUserHouseDailyService.page(params);
} else {
page = factAgencyUserHouseDailyService.page(params);
}
}
return page;
}
@Override
public FactUserHouseResultDTO total(Map<String, Object> params) {
FactUserHouseResultDTO dto = null;
// 不查询时间段默认查询当天
if (params.containsKey("startTime") && params.containsKey("endTime")) {
if (StringUtils.isNotBlank(params.get("startTime").toString()) && StringUtils.isNotBlank(params.get("endTime").toString())) {
params.put("dateId", StringUtils.EMPTY);
} else {
params.put("dateId", DateUtils.getBeforeNDay(NumConstant.ONE));
}
} else {
params.put("dateId", DateUtils.getBeforeNDay(NumConstant.ONE));
}
// 网格纬度查询网格统计表,其余纬度查询组织统计表
if (params.containsKey("level")) {
if("neighborhood".equals(params.get("level").toString())){
dto = factNeighborhoodUserHouseDailyService.getTotal(params);
}else if (OrgLevelEnum.GRID.getCode().equals(params.get("level").toString())) {
dto = factGridUserHouseDailyService.getTotal(params);
} else {
dto = factAgencyUserHouseDailyService.getTotal(params);
}
}
return dto;
}
@Override
public List<FactUserHouseResultDTO> list(Map<String, Object> params) {
List<FactUserHouseResultDTO> list = new ArrayList<>();
if (params.containsKey("level")) {
if("neighborhood".equals(params.get("level").toString()) || OrgLevelEnum.GRID.getCode().equals(params.get("level").toString())){
list = factNeighborhoodUserHouseDailyService.listExport(params);
}else if (OrgLevelEnum.COMMUNITY.getCode().equals(params.get("level").toString())) {
list = factGridUserHouseDailyService.listExport(params);
} else {
list = factAgencyUserHouseDailyService.listExport(params);
}
}
FactUserHouseResultDTO dto = total(params);
if (dto != null) {
dto.setAgencyName("合计");
}
list.add(dto);
return list;
}
@Override
public void statGrid(FactUserHouseFormDTO formDTO) {
if (StringUtils.isBlank(formDTO.getDateId())) {
formDTO.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE));
}
String dateId = formDTO.getDateId();
String customerId = formDTO.getCustomerId();
// 先删除历史
factGridUserHouseDailyService.deleteByDateId(formDTO);
// 保证小区是全部网格后,其余数据进行循环匹配
List<FactUserHouseResultDTO> neiList = houseService.neighborhoodStat(formDTO);
List<FactUserHouseResultDTO> houseList = houseService.houseStat(formDTO);
List<FactUserHouseResultDTO> userList = icResiUserService.userStat(formDTO);
List<FactUserHouseResultDTO> addList = new ArrayList<>();
neiList.forEach(item -> {
String gridId = item.getGridId();
FactUserHouseResultDTO dto = new FactUserHouseResultDTO();
dto.setCustomerId(formDTO.getCustomerId());
dto.setDateId(dateId);
dto.setGridId(gridId);
dto.setPid(item.getPid());
dto.setPids(item.getPids());
dto.setNeighbourhoodsCount(item.getNeighbourhoodsCount());
Optional<FactUserHouseResultDTO> houseOptional = houseList.stream().filter(house -> gridId.equals(house.getGridId()) && customerId.equals(house.getCustomerId())).findFirst();
if (houseOptional.isPresent()) {
dto.setHouseCount(houseOptional.get().getHouseCount());
dto.setHouseSelfCount(houseOptional.get().getHouseSelfCount());
dto.setHouseLeaseCount(houseOptional.get().getHouseLeaseCount());
dto.setHouseIdleCount(houseOptional.get().getHouseIdleCount());
dto.setHouseIncr(houseOptional.get().getHouseIncr());
dto.setHouseModify(houseOptional.get().getHouseModify());
} else {
dto.setHouseCount(NumConstant.ZERO);
dto.setHouseSelfCount(NumConstant.ZERO);
dto.setHouseLeaseCount(NumConstant.ZERO);
dto.setHouseIdleCount(NumConstant.ZERO);
dto.setHouseIncr(NumConstant.ZERO);
dto.setHouseModify(NumConstant.ZERO);
}
Optional<FactUserHouseResultDTO> userOptional = userList.stream().filter(user -> gridId.equals(user.getGridId()) && customerId.equals(user.getCustomerId())).findFirst();
if (userOptional.isPresent()) {
dto.setUserCount(userOptional.get().getUserCount());
dto.setUserResiCount(userOptional.get().getUserResiCount());
dto.setUserFloatCount(userOptional.get().getUserFloatCount());
dto.setUserIncr(userOptional.get().getUserIncr());
dto.setUserModify(userOptional.get().getUserModify());
} else {
dto.setUserCount(NumConstant.ZERO);
dto.setUserResiCount(NumConstant.ZERO);
dto.setUserFloatCount(NumConstant.ZERO);
dto.setUserIncr(NumConstant.ZERO);
dto.setUserModify(NumConstant.ZERO);
}
addList.add(dto);
});
List<FactGridUserHouseDailyEntity> entityList = ConvertUtils.sourceToTarget(addList, FactGridUserHouseDailyEntity.class);
factGridUserHouseDailyService.insertBatch(entityList);
}
/**
* 小区
* @author wgf
* @param formDTO
*/
@Override
public void statNeighborhood(FactUserHouseFormDTO formDTO) {
log.info("$$$进入业务逻辑");
if (StringUtils.isBlank(formDTO.getDateId())) {
formDTO.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE));
}
String dateId = formDTO.getDateId();
String customerId = formDTO.getCustomerId();
// 先删除历史
factNeighborhoodUserHouseDailyService.deleteByDateId(formDTO);
log.info("$$$删除历史完成");
// 保证小区是全部网格后,其余数据进行循环匹配
List<FactUserHouseResultDTO> neiList = houseService.neighborhoodStatNew(formDTO);
List<FactUserHouseResultDTO> houseList = houseService.houseStatNew(formDTO);
List<FactUserHouseResultDTO> userList = icResiUserService.userStatNew(formDTO);
List<FactUserHouseResultDTO> addList = new ArrayList<>();
neiList.forEach(item -> {
String gridId = item.getGridId() == null ? "" : item.getGridId();
String neighborHoodsId = item.getNeighbourhoodsId();
FactUserHouseResultDTO dto = new FactUserHouseResultDTO();
dto.setCustomerId(formDTO.getCustomerId());
dto.setDateId(dateId);
dto.setGridId(gridId);
dto.setPid(item.getPid() == null ? "" : item.getPid());
dto.setPids(item.getPids() == null ? "" : item.getPids());
dto.setNeighbourhoodsCount(item.getNeighbourhoodsCount());
dto.setNeighbourhoodsId(item.getNeighbourhoodsId());
dto.setNeighborHoodName(item.getNeighborHoodName());
Optional<FactUserHouseResultDTO> houseOptional = houseList.stream().filter(house -> neighborHoodsId.equals(house.getNeighbourhoodsId()) && customerId.equals(house.getCustomerId())).findFirst();
if (houseOptional.isPresent()) {
dto.setHouseCount(houseOptional.get().getHouseCount());
dto.setHouseSelfCount(houseOptional.get().getHouseSelfCount());
dto.setHouseLeaseCount(houseOptional.get().getHouseLeaseCount());
dto.setHouseIdleCount(houseOptional.get().getHouseIdleCount());
} else {
dto.setHouseCount(NumConstant.ZERO);
dto.setHouseSelfCount(NumConstant.ZERO);
dto.setHouseLeaseCount(NumConstant.ZERO);
dto.setHouseIdleCount(NumConstant.ZERO);
}
Optional<FactUserHouseResultDTO> userOptional = userList.stream().filter(user -> neighborHoodsId.equals(user.getNeighbourhoodsId()) && customerId.equals(user.getCustomerId())).findFirst();
if (userOptional.isPresent()) {
dto.setUserCount(userOptional.get().getUserCount());
dto.setUserResiCount(userOptional.get().getUserResiCount());
dto.setUserFloatCount(userOptional.get().getUserFloatCount());
} else {
dto.setUserCount(NumConstant.ZERO);
dto.setUserResiCount(NumConstant.ZERO);
dto.setUserFloatCount(NumConstant.ZERO);
}
addList.add(dto);
});
log.info("$$$addList:::::" + addList);
List<FactNeighborhoodUserHouseDailyEntity> entityList = ConvertUtils.sourceToTarget(addList, FactNeighborhoodUserHouseDailyEntity.class);
factNeighborhoodUserHouseDailyService.insertBatch(entityList);
}
@Override
public void statAgency(FactUserHouseFormDTO formDTO) {
if (StringUtils.isBlank(formDTO.getDateId())) {
formDTO.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE));
}
Map<String, Object> params = new HashMap<>();
params.put("dateId", formDTO.getDateId());
params.put("customerId", formDTO.getCustomerId());
List<FactGridUserHouseDailyDTO> list = factGridUserHouseDailyService.list(params);
if (list.isEmpty()) {
return;
}
// 先删除历史
factAgencyUserHouseDailyService.deleteByDateId(formDTO);
// 使用机构表左关联,对不同纬度的机构进行分组统计
formDTO.setLevel("community");
List<FactUserHouseResultDTO> commList = factGridUserHouseDailyService.statAgency(formDTO);
if (!commList.isEmpty()) {
commList.forEach(item -> item.setDateId(formDTO.getDateId()));
factAgencyUserHouseDailyService.insertBatch(ConvertUtils.sourceToTarget(commList, FactAgencyUserHouseDailyEntity.class));
}
formDTO.setLevel("street");
List<FactUserHouseResultDTO> streetList = factGridUserHouseDailyService.statAgency(formDTO);
if (!streetList.isEmpty()) {
streetList.forEach(item -> item.setDateId(formDTO.getDateId()));
factAgencyUserHouseDailyService.insertBatch(ConvertUtils.sourceToTarget(streetList, FactAgencyUserHouseDailyEntity.class));
}
formDTO.setLevel("district");
List<FactUserHouseResultDTO> districtList = factGridUserHouseDailyService.statAgency(formDTO);
if (!districtList.isEmpty()) {
districtList.forEach(item -> item.setDateId(formDTO.getDateId()));
factAgencyUserHouseDailyService.insertBatch(ConvertUtils.sourceToTarget(districtList, FactAgencyUserHouseDailyEntity.class));
}
formDTO.setLevel("city");
List<FactUserHouseResultDTO> cityList = factGridUserHouseDailyService.statAgency(formDTO);
if (!cityList.isEmpty()) {
cityList.forEach(item -> item.setDateId(formDTO.getDateId()));
factAgencyUserHouseDailyService.insertBatch(ConvertUtils.sourceToTarget(cityList, FactAgencyUserHouseDailyEntity.class));
}
formDTO.setLevel("province");
List<FactUserHouseResultDTO> provinceList = factGridUserHouseDailyService.statAgency(formDTO);
if (!provinceList.isEmpty()) {
provinceList.forEach(item -> item.setDateId(formDTO.getDateId()));
factAgencyUserHouseDailyService.insertBatch(ConvertUtils.sourceToTarget(provinceList, FactAgencyUserHouseDailyEntity.class));
}
}
}

55
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/IcResiUserService.java

@ -0,0 +1,55 @@
/**
* 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.service.user;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.stats.form.FactUserHouseFormDTO;
import com.epmet.dto.stats.result.FactUserHouseResultDTO;
import com.epmet.entity.user.IcResiUserEntity;
import java.util.List;
/**
* 用户基础信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-26
*/
public interface IcResiUserService extends BaseService<IcResiUserEntity> {
/**
* 居民统计
*
* @param formDTO
* @return java.util.List<com.epmet.dto.stats.result.FactUserHouseResultDTO>
* @author zhy
* @date 2022/5/30 13:33
*/
List<FactUserHouseResultDTO> userStat(FactUserHouseFormDTO formDTO);
/**
* 居民统计(小区)
*
* @param formDTO
* @return java.util.List<com.epmet.dto.stats.result.FactUserHouseResultDTO>
* @author wgf
* @date 2022/5/30 13:33
*/
List<FactUserHouseResultDTO> userStatNew(FactUserHouseFormDTO formDTO);
}

55
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/IcResiUserServiceImpl.java

@ -0,0 +1,55 @@
/**
* 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.service.user.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.user.IcResiUserDao;
import com.epmet.dto.stats.form.FactUserHouseFormDTO;
import com.epmet.dto.stats.result.FactUserHouseResultDTO;
import com.epmet.entity.user.IcResiUserEntity;
import com.epmet.service.user.IcResiUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 用户基础信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-26
*/
@Slf4j
@DataSource(DataSourceConstant.EPMET_USER)
@Service
public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResiUserEntity> implements IcResiUserService, ResultDataResolver {
@Override
public List<FactUserHouseResultDTO> userStat(FactUserHouseFormDTO formDTO) {
return baseDao.userStat(formDTO);
}
@Override
public List<FactUserHouseResultDTO> userStatNew(FactUserHouseFormDTO formDTO) {
return baseDao.userStatNew(formDTO);
}
}

11
epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.31__alter_govern.sql

@ -0,0 +1,11 @@
ALTER TABLE `fact_agency_govern_daily`
ADD COLUMN `IC_EVENT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '19、当前组织内:来源于事件管理的项目:结案已解决数' AFTER `WORK_EVENT_UN_RESOLVED_COUNT`,
ADD COLUMN `IC_EVENT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '20、当前组织内:来源于事件管理的项目:结案无需解决数' AFTER `IC_EVENT_RESOLVED_COUNT`;
ALTER TABLE `epmet_data_statistical`.`fact_grid_govern_daily`
ADD COLUMN `IC_EVENT_RESOLVED_COUNT` int(11) NULL DEFAULT 0 COMMENT '19、当前组织内:来源于事件管理的项目:结案已解决数' AFTER `WORK_EVENT_UN_RESOLVED_COUNT`,
ADD COLUMN `IC_EVENT_UN_RESOLVED_COUNT` int(11) NULL DEFAULT 0 COMMENT '20、当前组织内:来源于事件管理的项目:结案无需解决数' AFTER `IC_EVENT_RESOLVED_COUNT`;

85
epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.32__fact_grid_user_house_daily.sql

@ -0,0 +1,85 @@
/*
Navicat Premium Data Transfer
Source Server : epmet_cloud_dev_statistical
Source Server Type : MySQL
Source Server Version : 50726
Source Host : 192.168.1.140:3306
Source Schema : epmet_data_statistical
Target Server Type : MySQL
Target Server Version : 50726
File Encoding : 65001
Date: 31/05/2022 13:29:46
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for fact_grid_user_house_daily
-- ----------------------------
DROP TABLE IF EXISTS `fact_grid_user_house_daily`;
CREATE TABLE `fact_grid_user_house_daily` (
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键,customer_id+grid_id+date_id只有一条记录',
`CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id',
`DATE_ID` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '数据更新至:yyyyMMdd; ',
`GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格id',
`PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格所属的组织id',
`PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格所有上级id',
`NEIGHBOURHOODS_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '小区总数',
`HOUSE_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '房屋总数',
`HOUSE_SELF_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '自住房屋总数',
`HOUSE_LEASE_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '出租房屋总数',
`HOUSE_IDLE_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '闲置房屋总数',
`USER_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '居民总数',
`USER_RESI_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '常住居民总数',
`USER_FLOAT_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '流动居民总数',
`HOUSE_INCR` int(11) NOT NULL DEFAULT 0 COMMENT '当日新增房屋数',
`HOUSE_MODIFY` int(11) NOT NULL DEFAULT 0 COMMENT '当日修改房屋数',
`USER_INCR` int(11) NOT NULL DEFAULT 0 COMMENT '当日新增居民数',
`USER_MODIFY` int(11) NOT NULL DEFAULT 0 COMMENT '当日修改居民数',
`DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除',
`REVISION` int(11) NOT NULL DEFAULT 0 COMMENT '乐观锁',
`CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致',
`UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '网格的人房信息统计数,按天统计' ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for fact_agency_user_house_daily
-- ----------------------------
DROP TABLE IF EXISTS `fact_agency_user_house_daily`;
CREATE TABLE `fact_agency_user_house_daily` (
`ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键,customer_id+AGENCY_ID+date_id只有一条记录',
`CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id',
`DATE_ID` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '数据更新至:yyyyMMdd; ',
`AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织id',
`LEVEL` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'agency_id所属的机关级别(社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province)',
`PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织i所属的组织id',
`PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织i所有上级id',
`NEIGHBOURHOODS_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '小区总数',
`HOUSE_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '房屋总数',
`HOUSE_SELF_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '自住房屋总数',
`HOUSE_LEASE_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '出租房屋总数',
`HOUSE_IDLE_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '闲置房屋总数',
`USER_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '居民总数',
`USER_RESI_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '常住居民总数',
`USER_FLOAT_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '流动居民总数',
`HOUSE_INCR` int(11) NOT NULL DEFAULT 0 COMMENT '当日新增房屋数',
`HOUSE_MODIFY` int(11) NOT NULL DEFAULT 0 COMMENT '当日修改房屋数',
`USER_INCR` int(11) NOT NULL DEFAULT 0 COMMENT '当日新增居民数',
`USER_MODIFY` int(11) NOT NULL DEFAULT 0 COMMENT '当日修改居民数',
`DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除',
`REVISION` int(11) NOT NULL DEFAULT 0 COMMENT '乐观锁',
`CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致',
`UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '人房信息统计数,按天统计' ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1;

28
epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml

@ -138,11 +138,35 @@
</filter>
</appender>
<!-- rocketmq client 的日志appender -->
<appender name="RocketmqClientAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/rocketmqclient.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%X{Transaction-Serial}] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/rocketmqclient-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
</appender>
<!-- 开发、测试环境 -->
<springProfile name="dev,test,local">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.dao" level="DEBUG"/>
<!-- 只打印rocketmq client的日志 -->
<logger name="RocketmqClient" level="INFO" additivity="false">
<appender-ref ref="RocketmqClientAppender"/>
</logger>
<root level="INFO">
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
@ -166,6 +190,10 @@
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.dao" level="INFO"/>
<!-- 只打印rocketmq client的日志 -->
<logger name="RocketmqClient" level="INFO" additivity="false">
<appender-ref ref="RocketmqClientAppender"/>
</logger>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="DEBUG_FILE"/>

10
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml

@ -141,7 +141,7 @@
WHERE
1 = 1
AND f.ORIGIN = 'issue'
AND f.ORIGIN IN('issue', 'ic_event')
AND f.PROJECT_STATUS = 'closed'
AND f.CUSTOMER_ID = #{customerId}
) a
@ -468,7 +468,7 @@
AND fm.MONTH_ID = #{monthId}
AND fm.PROJECT_STATUS = 'closed'
AND fm.GRID_ID != ''
AND fm.ORIGIN = 'issue'
AND fm.ORIGIN IN('issue', 'ic_event')
) a
GROUP BY
GRID_ID
@ -490,7 +490,7 @@
WHERE fm.CUSTOMER_ID = #{customerId}
AND fm.MONTH_ID = #{monthId}
AND fm.PROJECT_STATUS = 'closed'
AND fm.ORIGIN = 'issue'
AND fm.ORIGIN IN('issue', 'ic_event')
) a
GROUP BY
AGENCY_ID
@ -680,7 +680,7 @@
fm.CUSTOMER_ID = #{customerId}
AND fm.PROJECT_STATUS = 'closed'
AND fm.GRID_ID != ''
AND fm.ORIGIN = 'issue'
AND fm.ORIGIN IN('issue', 'ic_event')
) a
GROUP BY
GRID_ID
@ -701,7 +701,7 @@
INNER JOIN fact_origin_project_main_daily fm ON fm.PIDS LIKE CONCAT( '%', da.ID, '%' )
WHERE fm.CUSTOMER_ID = #{customerId}
AND fm.PROJECT_STATUS = 'closed'
AND fm.ORIGIN = 'issue'
AND fm.ORIGIN IN('issue', 'ic_event')
) a
GROUP BY
AGENCY_ID

124
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/IcHouseDao.xml

@ -0,0 +1,124 @@
<?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.org.IcHouseDao">
<select id="houseStat" resultType="com.epmet.dto.stats.result.FactUserHouseResultDTO">
SELECT
g.CUSTOMER_ID,
g.id AS GRID_ID,
g.PID,
g.PIDS,
sum( CASE WHEN t.RENT_FLAG = '0' THEN 1 ELSE 0 END ) AS houseSelfCount,
sum( CASE WHEN t.RENT_FLAG = '1' THEN 1 ELSE 0 END ) AS houseLeaseCount,
sum( CASE WHEN t.RENT_FLAG = '2' THEN 1 ELSE 0 END ) AS houseIdleCount,
sum( CASE WHEN t.id IS NOT NULL THEN 1 ELSE 0 END ) AS houseCount,
sum( CASE WHEN (t.id IS NOT NULL and DATE_FORMAT(t.CREATED_TIME,'%Y-%m-%d') = DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 1 DAY ),'%Y-%m-%d')) THEN 1 ELSE 0 END ) AS houseIncr,
sum( CASE WHEN (t.id IS NOT NULL and t.CREATED_TIME != t.UPDATED_TIME and DATE_FORMAT(t.UPDATED_TIME,'%Y-%m-%d') = DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 1 DAY ),'%Y-%m-%d')) THEN 1 ELSE 0 END ) AS houseModify
FROM
customer_grid g
LEFT JOIN (
SELECT
h.id,
h.RENT_FLAG,
n.GRID_ID,
h.CREATED_TIME,
h.UPDATED_TIME
FROM
ic_house h
LEFT JOIN ic_neighbor_hood n ON h.NEIGHBOR_HOOD_ID = n.id
WHERE h.CREATED_TIME &lt; DATE_ADD( DATE_FORMAT(#{dateId},'%Y-%m-%d'), INTERVAL 1 DAY )
AND n.DEL_FLAG = '0'
AND h.DEL_FLAG = '0'
) t ON t.GRID_ID = g.ID
WHERE
g.DEL_FLAG = '0'
<if test='customerId != "" and customerId != null '>
AND g.CUSTOMER_ID = #{customerId}
</if>
GROUP BY
g.CUSTOMER_ID,
g.id
</select>
<select id="houseStatNew" resultType="com.epmet.dto.stats.result.FactUserHouseResultDTO">
SELECT
t.NEIGHBOR_HOOD_ID as NEIGHBOURHOODS_ID,
g.CUSTOMER_ID,
g.id AS GRID_ID,
g.PID,
g.PIDS,
sum( CASE WHEN t.RENT_FLAG = '0' THEN 1 ELSE 0 END ) AS houseSelfCount,
sum( CASE WHEN t.RENT_FLAG = '1' THEN 1 ELSE 0 END ) AS houseLeaseCount,
sum( CASE WHEN t.RENT_FLAG = '2' THEN 1 ELSE 0 END ) AS houseIdleCount,
sum( CASE WHEN t.id IS NOT NULL THEN 1 ELSE 0 END ) AS houseCount,
sum( CASE WHEN (t.id IS NOT NULL and DATE_FORMAT(t.CREATED_TIME,'%Y-%m-%d') = DATE_FORMAT(now(),'%Y-%m-%d')) THEN 1 ELSE 0 END ) AS houseIncr,
sum( CASE WHEN (t.id IS NOT NULL and t.CREATED_TIME != t.UPDATED_TIME and DATE_FORMAT(t.UPDATED_TIME,'%Y-%m-%d') = DATE_FORMAT(now(),'%Y-%m-%d')) THEN 1 ELSE 0 END ) AS houseModify
FROM (
SELECT
h.id,
h.RENT_FLAG,
n.GRID_ID,
h.CREATED_TIME,
h.UPDATED_TIME,
h.NEIGHBOR_HOOD_ID
FROM
ic_house h
LEFT JOIN ic_neighbor_hood n ON h.NEIGHBOR_HOOD_ID = n.id
WHERE h.CREATED_TIME &lt; DATE_ADD( DATE_FORMAT(#{dateId},'%Y-%m-%d'), INTERVAL 1 DAY )
AND n.DEL_FLAG = '0'
AND h.DEL_FLAG = '0'
) t
left join customer_grid g on g.id = t.GRID_ID and g.DEL_FLAG = '0'
WHERE 1=1
<if test='customerId != "" and customerId != null '>
AND g.CUSTOMER_ID = #{customerId}
</if>
GROUP BY
g.CUSTOMER_ID
</select>
<select id="neighborhoodStatStat" resultType="com.epmet.dto.stats.result.FactUserHouseResultDTO">
SELECT
g.CUSTOMER_ID,
g.id AS GRID_ID,
g.PID,
g.PIDS,
count( n.id ) AS neighbourhoodsCount
FROM
customer_grid g
LEFT JOIN ic_neighbor_hood n ON n.GRID_ID = g.id
AND n.CREATED_TIME &lt; DATE_ADD( DATE_FORMAT(#{dateId},'%Y-%m-%d'), INTERVAL 1 DAY )
AND n.DEL_FLAG = '0'
WHERE
g.DEL_FLAG = '0'
<if test='customerId != "" and customerId != null '>
AND g.CUSTOMER_ID = #{customerId}
</if>
GROUP BY
g.CUSTOMER_ID,
g.id;
</select>
<select id="neighborhoodStatStatNew" resultType="com.epmet.dto.stats.result.FactUserHouseResultDTO">
SELECT
n.ID as NEIGHBOURHOODS_ID,
n.NEIGHBOR_HOOD_NAME,
n.CUSTOMER_ID,
g.id AS GRID_ID,
g.PID,
g.PIDS,
1 AS neighbourhoodsCount
FROM
ic_neighbor_hood n
LEFT JOIN customer_grid g ON n.GRID_ID = g.id and g.DEL_FLAG = '0'
AND n.CREATED_TIME &lt; DATE_ADD( DATE_FORMAT(#{dateId},'%Y-%m-%d'), INTERVAL 1 DAY )
WHERE n.DEL_FLAG = '0'
<if test='customerId != "" and customerId != null '>
AND n.CUSTOMER_ID = #{customerId}
</if>
GROUP BY
n.CUSTOMER_ID,n.ID;
</select>
</mapper>

4
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml

@ -58,7 +58,7 @@
FROM project
WHERE
DEL_FLAG = '0'
AND (ORIGIN = 'issue' OR ORIGIN = 'resi_event')
AND ORIGIN IN('issue', 'resi_event', 'ic_event')
AND STATUS = 'closed'
AND CUSTOMER_ID = #{customerId}
AND DATE_FORMAT(UPDATED_TIME, '%Y-%m-%d') <![CDATA[ <= ]]> #{date}
@ -72,7 +72,7 @@
FROM project
WHERE
DEL_FLAG = '0'
AND (ORIGIN = 'issue' OR ORIGIN = 'resi_event')
AND ORIGIN IN('issue', 'resi_event', 'ic_event')
AND STATUS = 'closed'
AND CUSTOMER_ID = #{customerId}
AND DATE_FORMAT(UPDATED_TIME, '%Y-%m-%d') = #{date}

138
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyUserHouseDailyDao.xml

@ -0,0 +1,138 @@
<?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.FactAgencyUserHouseDailyDao">
<resultMap type="com.epmet.entity.stats.FactAgencyUserHouseDailyEntity" id="factAgencyUserHouseDailyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="dateId" column="DATE_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="level" column="LEVEL"/>
<result property="pid" column="PID"/>
<result property="pids" column="PIDS"/>
<result property="neighbourhoodsCount" column="NEIGHBOURHOODS_COUNT"/>
<result property="houseCount" column="HOUSE_COUNT"/>
<result property="houseSelfCount" column="HOUSE_SELF_COUNT"/>
<result property="houseLeaseCount" column="HOUSE_LEASE_COUNT"/>
<result property="houseIdleCount" column="HOUSE_IDLE_COUNT"/>
<result property="userCount" column="USER_COUNT"/>
<result property="userResiCount" column="USER_RESI_COUNT"/>
<result property="userFloatCount" column="USER_FLOAT_COUNT"/>
<result property="houseIncr" column="HOUSE_INCR"/>
<result property="houseModify" column="HOUSE_MODIFY"/>
<result property="userIncr" column="USER_INCR"/>
<result property="userModify" column="USER_MODIFY"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="listPage" resultType="com.epmet.dto.stats.result.FactUserHouseResultDTO">
SELECT
d.AGENCY_NAME AS AGENCY_NAME,
max( NEIGHBOURHOODS_COUNT ) AS NEIGHBOURHOODS_COUNT,
max( HOUSE_COUNT ) AS HOUSE_COUNT,
max( HOUSE_SELF_COUNT ) AS HOUSE_SELF_COUNT,
max( HOUSE_LEASE_COUNT ) AS HOUSE_LEASE_COUNT,
max( HOUSE_IDLE_COUNT ) AS HOUSE_IDLE_COUNT,
max( USER_COUNT ) AS USER_COUNT,
max( USER_RESI_COUNT ) AS USER_RESI_COUNT,
max( USER_FLOAT_COUNT ) AS USER_FLOAT_COUNT,
max( HOUSE_INCR ) AS HOUSE_INCR,
max( HOUSE_MODIFY ) AS HOUSE_MODIFY,
max( USER_INCR ) AS USER_INCR,
max( USER_MODIFY ) AS USER_MODIFY
FROM
fact_agency_user_house_daily a
LEFT JOIN dim_agency d ON d.id = a.AGENCY_ID
WHERE
d.DEL_FLAG = '0'
<if test="customerId != null and customerId != ''">
AND a.CUSTOMER_ID = #{customerId}
AND d.CUSTOMER_ID = #{customerId}
</if>
<if test="dateId != null and dateId != ''">
AND a.DATE_ID = #{dateId}
</if>
<if test="level == 'street'">
AND a.LEVEL = 'community'
AND a.PID = #{agencyId}
</if>
<if test="level == 'district'">
AND a.LEVEL = 'street'
AND a.PID = #{agencyId}
</if>
<if test="level == 'city'">
AND a.LEVEL = 'district'
AND a.PID = #{agencyId}
</if>
<if test="level == 'province'">
AND a.LEVEL = 'city'
AND a.PID = #{agencyId}
</if>
<if test="startTime != null and startTime != ''">
AND DATE_FORMAT( a.DATE_ID, '%Y-%m-%d' ) >= DATE_FORMAT( #{startTime}, '%Y-%m-%d' )
</if>
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT( a.DATE_ID, '%Y-%m-%d' ) &lt;= DATE_FORMAT( #{endTime}, '%Y-%m-%d' )
</if>
GROUP BY
a.AGENCY_ID
</select>
<select id="getTotal" resultType="com.epmet.dto.stats.result.FactUserHouseResultDTO">
SELECT
d.AGENCY_NAME AS AGENCY_NAME,
sum( NEIGHBOURHOODS_COUNT ) AS NEIGHBOURHOODS_COUNT,
sum( HOUSE_COUNT ) AS HOUSE_COUNT,
sum( HOUSE_SELF_COUNT ) AS HOUSE_SELF_COUNT,
sum( HOUSE_LEASE_COUNT ) AS HOUSE_LEASE_COUNT,
sum( HOUSE_IDLE_COUNT ) AS HOUSE_IDLE_COUNT,
sum( USER_COUNT ) AS USER_COUNT,
sum( USER_RESI_COUNT ) AS USER_RESI_COUNT,
sum( USER_FLOAT_COUNT ) AS USER_FLOAT_COUNT,
sum( HOUSE_INCR ) AS HOUSE_INCR,
sum( HOUSE_MODIFY ) AS HOUSE_MODIFY,
sum( USER_INCR ) AS USER_INCR,
sum( USER_MODIFY ) AS USER_MODIFY
FROM
fact_agency_user_house_daily a
LEFT JOIN dim_agency d ON d.id = a.AGENCY_ID
WHERE
d.DEL_FLAG = '0'
<if test="customerId != null and customerId != ''">
AND a.CUSTOMER_ID = #{customerId}
AND d.CUSTOMER_ID = #{customerId}
</if>
<if test="agencyId != null and agencyId != ''">
AND a.AGENCY_ID = #{agencyId}
</if>
<if test="dateId != null and dateId != ''">
AND a.DATE_ID = #{dateId}
</if>
<if test="startTime != null and startTime != ''">
AND DATE_FORMAT( a.DATE_ID, '%Y-%m-%d' ) >= DATE_FORMAT( #{startTime}, '%Y-%m-%d' )
</if>
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT( a.DATE_ID, '%Y-%m-%d' ) &lt;= DATE_FORMAT( #{endTime}, '%Y-%m-%d' )
</if>
GROUP BY
a.DATE_ID
ORDER BY
a.DATE_ID ASC
</select>
<delete id="deleteByDateId">
DELETE
FROM
fact_agency_user_house_daily
WHERE
DATE_ID = #{dateId}
AND CUSTOMER_ID = #{customerId}
</delete>
</mapper>

237
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridUserHouseDailyDao.xml

@ -0,0 +1,237 @@
<?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.FactGridUserHouseDailyDao">
<resultMap type="com.epmet.entity.stats.FactGridUserHouseDailyEntity" id="factGridUserHouseDailyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="dateId" column="DATE_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="pid" column="PID"/>
<result property="pids" column="PIDS"/>
<result property="neighbourhoodsCount" column="NEIGHBOURHOODS_COUNT"/>
<result property="houseCount" column="HOUSE_COUNT"/>
<result property="houseSelfCount" column="HOUSE_SELF_COUNT"/>
<result property="houseLeaseCount" column="HOUSE_LEASE_COUNT"/>
<result property="houseIdleCount" column="HOUSE_IDLE_COUNT"/>
<result property="userCount" column="USER_COUNT"/>
<result property="userResiCount" column="USER_RESI_COUNT"/>
<result property="userFloatCount" column="USER_FLOAT_COUNT"/>
<result property="houseIncr" column="HOUSE_INCR"/>
<result property="houseModify" column="HOUSE_MODIFY"/>
<result property="userIncr" column="USER_INCR"/>
<result property="userModify" column="USER_MODIFY"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="listPage" resultType="com.epmet.dto.stats.result.FactUserHouseResultDTO">
SELECT
g.GRID_NAME AS AGENCY_NAME,
max( NEIGHBOURHOODS_COUNT ) AS NEIGHBOURHOODS_COUNT,
max( HOUSE_COUNT ) AS HOUSE_COUNT,
max( HOUSE_SELF_COUNT ) AS HOUSE_SELF_COUNT,
max( HOUSE_LEASE_COUNT ) AS HOUSE_LEASE_COUNT,
max( HOUSE_IDLE_COUNT ) AS HOUSE_IDLE_COUNT,
max( USER_COUNT ) AS USER_COUNT,
max( USER_RESI_COUNT ) AS USER_RESI_COUNT,
max( USER_FLOAT_COUNT ) AS USER_FLOAT_COUNT,
max( HOUSE_INCR ) AS HOUSE_INCR,
max( HOUSE_MODIFY ) AS HOUSE_MODIFY,
max( USER_INCR ) AS USER_INCR,
max( USER_MODIFY ) AS USER_MODIFY
FROM
fact_grid_user_house_daily d
LEFT JOIN dim_grid g ON g.id = d.GRID_ID
WHERE
g.DEL_FLAG = '0'
<if test="customerId != null and customerId != ''">
AND g.CUSTOMER_ID = #{customerId}
AND d.CUSTOMER_ID = #{customerId}
</if>
<if test="level == 'grid'">
AND d.GRID_ID = #{agencyId}
</if>
<if test="level == 'community'">
AND d.PID = #{agencyId}
</if>
<if test="dateId != null and dateId != ''">
AND d.DATE_ID = #{dateId}
</if>
<if test="startTime != null and startTime != ''">
AND DATE_FORMAT( d.DATE_ID, '%Y-%m-%d' ) >= DATE_FORMAT( #{startTime}, '%Y-%m-%d' )
</if>
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT( d.DATE_ID, '%Y-%m-%d' ) &lt;= DATE_FORMAT( #{endTime}, '%Y-%m-%d' )
</if>
GROUP BY
GRID_ID
</select>
<select id="getTotal" resultType="com.epmet.dto.stats.result.FactUserHouseResultDTO">
SELECT
g.GRID_NAME AS AGENCY_NAME,
sum( NEIGHBOURHOODS_COUNT ) AS NEIGHBOURHOODS_COUNT,
sum( HOUSE_COUNT ) AS HOUSE_COUNT,
sum( HOUSE_SELF_COUNT ) AS HOUSE_SELF_COUNT,
sum( HOUSE_LEASE_COUNT ) AS HOUSE_LEASE_COUNT,
sum( HOUSE_IDLE_COUNT ) AS HOUSE_IDLE_COUNT,
sum( USER_COUNT ) AS USER_COUNT,
sum( USER_RESI_COUNT ) AS USER_RESI_COUNT,
sum( USER_FLOAT_COUNT ) AS USER_FLOAT_COUNT,
sum( HOUSE_INCR ) AS HOUSE_INCR,
sum( HOUSE_MODIFY ) AS HOUSE_MODIFY,
sum( USER_INCR ) AS USER_INCR,
sum( USER_MODIFY ) AS USER_MODIFY
FROM
fact_grid_user_house_daily d
LEFT JOIN dim_grid g ON g.id = d.GRID_ID
LEFT JOIN dim_agency a ON a.id = d.PID
WHERE
g.DEL_FLAG = '0'
<if test="customerId != null and customerId != ''">
AND g.CUSTOMER_ID = #{customerId}
AND d.CUSTOMER_ID = #{customerId}
</if>
<if test="agencyId != null and agencyId != ''">
AND d.GRID_ID = #{agencyId}
</if>
<if test="dateId != null and dateId != ''">
AND d.DATE_ID = #{dateId}
</if>
<if test="startTime != null and startTime != ''">
AND DATE_FORMAT( d.DATE_ID, '%Y-%m-%d' ) >= DATE_FORMAT( #{startTime}, '%Y-%m-%d' )
</if>
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT( d.DATE_ID, '%Y-%m-%d' ) &lt;= DATE_FORMAT( #{endTime}, '%Y-%m-%d' )
</if>
GROUP BY
d.DATE_ID
ORDER BY
d.DATE_ID ASC
</select>
<select id="statAgency" resultType="com.epmet.dto.stats.result.FactUserHouseResultDTO">
SELECT
t.*,
ag.id AS AGENCY_ID,
ag.CUSTOMER_ID,
ag.`LEVEL`,
ag.PID,
ag.PIDS
FROM
dim_agency ag
LEFT JOIN (
SELECT
<if test="level == 'community'">
c.id AS AGENCY,
</if>
<if test="level == 'street'">
s.id AS AGENCY,
</if>
<if test="level == 'district'">
di.id AS AGENCY,
</if>
<if test="level == 'city'">
ci.id AS AGENCY,
</if>
<if test="level == 'province'">
p.id AS AGENCY,
</if>
sum( NEIGHBOURHOODS_COUNT ) AS NEIGHBOURHOODS_COUNT,
sum( HOUSE_COUNT ) AS HOUSE_COUNT,
sum( HOUSE_SELF_COUNT ) AS HOUSE_SELF_COUNT,
sum( HOUSE_LEASE_COUNT ) AS HOUSE_LEASE_COUNT,
sum( HOUSE_IDLE_COUNT ) AS HOUSE_IDLE_COUNT,
sum( USER_COUNT ) AS USER_COUNT,
sum( USER_RESI_COUNT ) AS USER_RESI_COUNT,
sum( USER_FLOAT_COUNT ) AS USER_FLOAT_COUNT,
sum( HOUSE_INCR ) AS HOUSE_INCR,
sum( HOUSE_MODIFY ) AS HOUSE_MODIFY,
sum( USER_INCR ) AS USER_INCR,
sum( USER_MODIFY ) AS USER_MODIFY
FROM
fact_grid_user_house_daily d
INNER JOIN dim_grid g ON g.id = d.GRID_ID
INNER JOIN dim_agency c ON c.id = g.AGENCY_ID
<if test="level == 'community'">
WHERE
d.DATE_ID = #{dateId}
AND d.CUSTOMER_ID = #{customerId}
GROUP BY
c.id
</if>
<if test="level == 'street'">
INNER JOIN dim_agency s ON s.id = c.pid
WHERE
d.DATE_ID = #{dateId}
AND d.CUSTOMER_ID = #{customerId}
GROUP BY
s.id
</if>
<if test="level == 'district'">
INNER JOIN dim_agency s ON s.id = c.pid
INNER JOIN dim_agency di ON di.id = s.pid
WHERE
d.DATE_ID = #{dateId}
AND d.CUSTOMER_ID = #{customerId}
GROUP BY
di.id
</if>
<if test="level == 'city'">
INNER JOIN dim_agency s ON s.id = c.pid
INNER JOIN dim_agency di ON di.id = s.pid
INNER JOIN dim_agency ci ON ci.id = di.pid
INNER JOIN dim_agency p ON p.id = ci.pid
WHERE
d.DATE_ID = #{dateId}
AND d.CUSTOMER_ID = #{customerId}
GROUP BY
ci.id
</if>
<if test="level == 'province'">
INNER JOIN dim_agency s ON s.id = c.pid
INNER JOIN dim_agency di ON di.id = s.pid
INNER JOIN dim_agency ci ON ci.id = di.pid
INNER JOIN dim_agency p ON p.id = ci.pid
WHERE
d.DATE_ID = #{dateId}
AND d.CUSTOMER_ID = #{customerId}
GROUP BY
p.id
</if>
) t ON t.AGENCY = ag.id
WHERE
ag.CUSTOMER_ID = #{customerId}
AND ag.AGENCY_DIM_TYPE = 'all'
<if test="level == 'community'">
AND ag.`LEVEL` = 'community'
</if>
<if test="level == 'street'">
AND ag.`LEVEL` = 'street'
</if>
<if test="level == 'district'">
AND ag.`LEVEL` = 'district'
</if>
<if test="level == 'city'">
AND ag.`LEVEL` = 'city'
</if>
<if test="level == 'province'">
AND ag.`LEVEL` = 'province'
</if>
</select>
<delete id="deleteByDateId">
DELETE
FROM
fact_grid_user_house_daily
WHERE
DATE_ID = #{dateId}
AND CUSTOMER_ID = #{customerId}
</delete>
</mapper>

127
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactNeighborhoodUserHouseDailyDao.xml

@ -0,0 +1,127 @@
<?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.FactNeighborhoodUserHouseDailyDao">
<resultMap type="com.epmet.entity.stats.FactNeighborhoodUserHouseDailyEntity" id="factNeighborhoodUserHouseDailyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="dateId" column="DATE_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="pid" column="PID"/>
<result property="pids" column="PIDS"/>
<result property="neighbourhoodsId" column="NEIGHBOURHOODS_ID"/>
<result property="neighborHoodName" column="NEIGHBOR_HOOD_NAME"/>
<result property="houseCount" column="HOUSE_COUNT"/>
<result property="houseSelfCount" column="HOUSE_SELF_COUNT"/>
<result property="houseLeaseCount" column="HOUSE_LEASE_COUNT"/>
<result property="houseIdleCount" column="HOUSE_IDLE_COUNT"/>
<result property="userCount" column="USER_COUNT"/>
<result property="userResiCount" column="USER_RESI_COUNT"/>
<result property="userFloatCount" column="USER_FLOAT_COUNT"/>
<result property="houseIncr" column="HOUSE_INCR"/>
<result property="houseModify" column="HOUSE_MODIFY"/>
<result property="userIncr" column="USER_INCR"/>
<result property="userModify" column="USER_MODIFY"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<delete id="deleteByDateId">
DELETE
FROM
fact_neighborhood_user_house_daily
WHERE
DATE_ID = #{dateId}
AND CUSTOMER_ID = #{customerId}
</delete>
<select id="listPage" resultType="com.epmet.dto.stats.result.FactUserHouseResultDTO">
SELECT
d.NEIGHBOR_HOOD_NAME AS AGENCY_NAME,
d.NEIGHBOURHOODS_ID,
d.NEIGHBOR_HOOD_NAME,
max( NEIGHBOURHOODS_COUNT ) AS NEIGHBOURHOODS_COUNT,
max( HOUSE_COUNT ) AS HOUSE_COUNT,
max( HOUSE_SELF_COUNT ) AS HOUSE_SELF_COUNT,
max( HOUSE_LEASE_COUNT ) AS HOUSE_LEASE_COUNT,
max( HOUSE_IDLE_COUNT ) AS HOUSE_IDLE_COUNT,
max( USER_COUNT ) AS USER_COUNT,
max( USER_RESI_COUNT ) AS USER_RESI_COUNT,
max( USER_FLOAT_COUNT ) AS USER_FLOAT_COUNT,
max( HOUSE_INCR ) AS HOUSE_INCR,
max( HOUSE_MODIFY ) AS HOUSE_MODIFY,
max( USER_INCR ) AS USER_INCR,
max( USER_MODIFY ) AS USER_MODIFY
FROM
fact_neighborhood_user_house_daily d
LEFT JOIN dim_grid g ON g.id = d.GRID_ID
WHERE
g.DEL_FLAG = '0'
<if test="customerId != null and customerId != ''">
AND g.CUSTOMER_ID = #{customerId}
AND d.CUSTOMER_ID = #{customerId}
</if>
<if test="level == 'neighborhood'">
AND d.NEIGHBOURHOODS_ID = #{agencyId}
</if>
<if test="level == 'grid'">
AND d.GRID_ID = #{agencyId}
</if>
<if test="dateId != null and dateId != ''">
AND d.DATE_ID = #{dateId}
</if>
<if test="startTime != null and startTime != ''">
AND DATE_FORMAT( d.DATE_ID, '%Y-%m-%d' ) >= DATE_FORMAT( #{startTime}, '%Y-%m-%d' )
</if>
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT( d.DATE_ID, '%Y-%m-%d' ) &lt;= DATE_FORMAT( #{endTime}, '%Y-%m-%d' )
</if>
GROUP BY d.NEIGHBOURHOODS_ID
</select>
<select id="getTotal" resultType="com.epmet.dto.stats.result.FactUserHouseResultDTO">
SELECT
d.NEIGHBOR_HOOD_NAME AS AGENCY_NAME,
sum( NEIGHBOURHOODS_COUNT ) AS NEIGHBOURHOODS_COUNT,
sum( HOUSE_COUNT ) AS HOUSE_COUNT,
sum( HOUSE_SELF_COUNT ) AS HOUSE_SELF_COUNT,
sum( HOUSE_LEASE_COUNT ) AS HOUSE_LEASE_COUNT,
sum( HOUSE_IDLE_COUNT ) AS HOUSE_IDLE_COUNT,
sum( USER_COUNT ) AS USER_COUNT,
sum( USER_RESI_COUNT ) AS USER_RESI_COUNT,
sum( USER_FLOAT_COUNT ) AS USER_FLOAT_COUNT,
sum( HOUSE_INCR ) AS HOUSE_INCR,
sum( HOUSE_MODIFY ) AS HOUSE_MODIFY,
sum( USER_INCR ) AS USER_INCR,
sum( USER_MODIFY ) AS USER_MODIFY
FROM
fact_neighborhood_user_house_daily d
WHERE d.DEL_FLAG = '0'
<if test="customerId != null and customerId != ''">
AND d.CUSTOMER_ID = #{customerId}
</if>
<if test="agencyId != null and agencyId != ''">
AND d.NEIGHBOURHOODS_ID = #{agencyId}
</if>
<if test="dateId != null and dateId != ''">
AND d.DATE_ID = #{dateId}
</if>
<if test="startTime != null and startTime != ''">
AND DATE_FORMAT( d.DATE_ID, '%Y-%m-%d' ) >= DATE_FORMAT( #{startTime}, '%Y-%m-%d' )
</if>
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT( d.DATE_ID, '%Y-%m-%d' ) &lt;= DATE_FORMAT( #{endTime}, '%Y-%m-%d' )
</if>
GROUP BY
d.DATE_ID
ORDER BY
d.DATE_ID ASC
</select>
</mapper>

47
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/IcResiUserDao.xml

@ -0,0 +1,47 @@
<?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.user.IcResiUserDao">
<select id="userStat" resultType="com.epmet.dto.stats.result.FactUserHouseResultDTO">
SELECT
CUSTOMER_ID,
GRID_ID,
sum( CASE WHEN IS_FLOATING = '0' THEN 1 ELSE 0 END ) AS userResiCount,
sum( CASE WHEN IS_FLOATING = '1' THEN 1 ELSE 0 END ) AS userFloatCount,
sum( CASE WHEN id IS NOT NULL THEN 1 ELSE 0 END ) AS userCount,
sum( CASE WHEN (id IS NOT NULL and DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') = DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 1 DAY ),'%Y-%m-%d')) THEN 1 ELSE 0 END ) AS userIncr,
sum( CASE WHEN (id IS NOT NULL and CREATED_TIME != UPDATED_TIME and DATE_FORMAT(UPDATED_TIME,'%Y-%m-%d') = DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 1 DAY ),'%Y-%m-%d')) THEN 1 ELSE 0 END ) AS userModify
FROM
ic_resi_user
WHERE
del_flag = '0'
AND STATUS = '0'
AND CREATED_TIME &lt;= DATE_ADD( DATE_FORMAT(#{dateId},'%Y-%m-%d'), INTERVAL 1 DAY )
GROUP BY
CUSTOMER_ID,
AGENCY_ID
</select>
<select id="userStatNew" resultType="com.epmet.dto.stats.result.FactUserHouseResultDTO">
SELECT
CUSTOMER_ID,
GRID_ID,
VILLAGE_ID as NEIGHBOURHOODS_ID,
sum( CASE WHEN IS_FLOATING = '0' THEN 1 ELSE 0 END ) AS userResiCount,
sum( CASE WHEN IS_FLOATING = '1' THEN 1 ELSE 0 END ) AS userFloatCount,
sum( CASE WHEN id IS NOT NULL THEN 1 ELSE 0 END ) AS userCount,
sum( CASE WHEN (id IS NOT NULL and DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') = DATE_FORMAT(now(),'%Y-%m-%d')) THEN 1 ELSE 0 END ) AS userIncr,
sum( CASE WHEN (id IS NOT NULL and CREATED_TIME != UPDATED_TIME and DATE_FORMAT(UPDATED_TIME,'%Y-%m-%d') = DATE_FORMAT(now(),'%Y-%m-%d')) THEN 1 ELSE 0 END ) AS userModify
FROM
ic_resi_user
WHERE
del_flag = '0'
AND STATUS = '0'
AND CREATED_TIME &lt;= DATE_ADD( DATE_FORMAT(#{dateId},'%Y-%m-%d'), INTERVAL 1 DAY )
GROUP BY
CUSTOMER_ID,
VILLAGE_ID
</select>
</mapper>

8
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcCommunitySelfOrganizationPersonnelDTO.java

@ -17,6 +17,7 @@
package com.epmet.dto;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@ -42,6 +43,7 @@ public class IcCommunitySelfOrganizationPersonnelDTO implements Serializable {
/**
* 客户ID
*/
@JsonIgnore
private String customerId;
/**
@ -62,31 +64,37 @@ public class IcCommunitySelfOrganizationPersonnelDTO implements Serializable {
/**
*
*/
@JsonIgnore
private Integer delFlag;
/**
* 乐观锁
*/
@JsonIgnore
private String revision;
/**
* 创建人
*/
@JsonIgnore
private String createdBy;
/**
* 创建时间
*/
@JsonIgnore
private Date createdTime;
/**
* 更新人
*/
@JsonIgnore
private String updatedBy;
/**
* 更新时间
*/
@JsonIgnore
private Date updatedTime;
}

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

@ -0,0 +1,115 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 服务组织表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-27
*/
@Data
public class IcServiceOrgDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 所属组织机构Id
*/
private String agencyId;
/**
* agencyId的所有上级包含自己
*/
private String agencyIdPath;
/**
* 服务类别字典表 ic_service_type多个值逗号分隔
*/
private String serviceType;
/**
* 服务组织名称
*/
private String orgName;
/**
* 组织描述
*/
private String orgDescribe;
/**
* 负责人姓名
*/
private String principalName;
/**
* 负责人电话
*/
private String principalMobile;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
/**
* 地址
*/
private String address;
/**
* 备注
*/
private String remark;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

116
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectAttachmentDTO.java

@ -0,0 +1,116 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 事件附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-27
*/
@Data
public class IcServiceProjectAttachmentDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 事件Id
*/
private String icServiceId;
private String attachTo;
/**
* 附件名
*/
private String attachmentName;
private String name;
/**
* 文件格式JPGPNGPDFJPEGBMPMP4WMAM4AMP3DOCDOCXXLS
*/
private String attachmentFormat;
private String format;
/**
* 附件类型图片 - image 视频 - video 语音 - voice 文档 - doc
*/
private String attachmentType;
private String type;
/**
* 附件地址
*/
private String attachmentUrl;
private String url;
/**
* 排序字段
*/
private Integer sort;
/**
* 附件状态审核中auditing
auto_passed: 自动通过
review结果不确定需要人工审核
block: 结果违规
rejected人工审核驳回;
approved人工审核通过
现在图片是同步审核的所以图片只有auto_passed一种状态
*/
private String status;
/**
* 失败原因
*/
private String reason;
/**
* 语音或视频时长,
*/
private Integer duration;
/**
* 删除标记 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

104
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectDTO.java

@ -0,0 +1,104 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 服务项目管理表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-27
*/
@Data
public class IcServiceProjectDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 组织ID的上级
*/
private String pid;
/**
* 组织ID的所有上级[包括自己]
*/
private String agencyIdPath;
/**
* 服务类别值
*/
private String serviceCategoryKey;
/**
* 服务名称
*/
private String serviceName;
/**
* 服务内容
*/
private String serviceContent;
/**
* 政策级别0市级1区级2街道级
*/
private String policyLevel;
/**
* 政策依据
*/
private String policyGround;
/**
* 启用状态,0启用1禁用
*/
private Integer enabled;
/**
*
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

9
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandRecDTO.java

@ -150,6 +150,15 @@ public class IcUserDemandRecDTO implements Serializable {
*/
private Integer awardPoint;
/**
* 来源[需求录入:demand 事件管理:ic_event]
*/
private String origin;
/**
* 来源Id[目前只有来源事件管理的有值]
*/
private String originId;
/**
* 删除标识0.未删除 1.已删除
*/

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

@ -1,7 +1,9 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.epmet.dto.IcCommunitySelfOrganizationPersonnelDTO;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@ -18,36 +20,40 @@ public class AddCommunitySelfOrganizationFormDTO implements Serializable {
private static final long serialVersionUID = -4996925380900678065L;
public interface AddCommunitySelfOrganizationForm{}
public interface AddCommunitySelfOrganizationForm extends CustomerClientShowGroup {}
/**
* 组织名称
*/
@NotBlank(message = "organizationName不能为空",groups = AddCommunitySelfOrganizationForm.class)
@NotBlank(message = "组织名称不能为空",groups = AddCommunitySelfOrganizationForm.class)
@Length(max = 50,message = "组织名称最多输入50字",groups = AddCommunitySelfOrganizationForm.class)
private String organizationName;
@NotBlank(message = "分类不能为空", groups = AddCommunitySelfOrganizationForm.class)
private String categoryCode;
/**
* 组织人数
*/
@NotNull(message = "organizationPersonCount不能为空",groups = AddCommunitySelfOrganizationForm.class)
@NotNull(message = "组织人数不能为空",groups = AddCommunitySelfOrganizationForm.class)
private Integer organizationPersonCount;
/**
* 负责人姓名
*/
@NotBlank(message = "principalName不能为空",groups = AddCommunitySelfOrganizationForm.class)
@NotBlank(message = "负责人不能为空",groups = AddCommunitySelfOrganizationForm.class)
private String principalName;
/**
* 负责人电话
*/
@NotBlank(message = "principalPhone不能为空",groups = AddCommunitySelfOrganizationForm.class)
@NotBlank(message = "联系电话",groups = AddCommunitySelfOrganizationForm.class)
private String principalPhone;
/**
* 服务事项
*/
@NotBlank(message = "serviceItem不能为空",groups = AddCommunitySelfOrganizationForm.class)
@NotBlank(message = "服务事项不能为空",groups = AddCommunitySelfOrganizationForm.class)
private String serviceItem;
/**
@ -63,6 +69,7 @@ public class AddCommunitySelfOrganizationFormDTO implements Serializable {
/**
* 经度
*/
@NotBlank(message = "位置坐标不能为空",groups = AddCommunitySelfOrganizationForm.class)
private String longitude;
/**

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

@ -0,0 +1,33 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@Data
public class CategorySelfOrgFormDTO extends PageFormDTO implements Serializable {
/**
* 默认展示全部此列可空
*/
private String categoryCode;
/**
* token中获取
*/
@NotBlank(message = "customerId不能为空",groups = PageFormDTO.AddUserInternalGroup.class)
private String customerId;
/**
* token中获取
*/
@NotBlank(message = "staffId不能为空",groups = PageFormDTO.AddUserInternalGroup.class)
private String staffId;
/**
* 当前登录用户所属组织id
*/
private String agencyId;
}

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

@ -48,4 +48,6 @@ public class CommunitySelfOrganizationListFormDTO implements Serializable {
private Integer ranking;
private String remark;
private String categoryCode;
}

6
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditCommunitySelfOrganizationFormDTO.java

@ -26,6 +26,12 @@ public class EditCommunitySelfOrganizationFormDTO implements Serializable {
@NotBlank(message = "organizationName不能为空",groups = EditCommunitySelfOrganizationForm.class)
private String organizationName;
/**
* 分类编码
*/
@NotBlank(message = "categoryCode不能为空",groups = EditCommunitySelfOrganizationForm.class)
private String categoryCode;
/**
* 组织人数
*/

49
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceEditFormDTO.java

@ -0,0 +1,49 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
* 服务项目记录修改
*/
@Data
public class IcServiceEditFormDTO implements Serializable {
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
@NotBlank(message = "", groups = AddUserInternalGroup.class)
private String serviceRecordId;
private String principalName;
private String principalContact;
/**
* 服务时间
*/
@NotNull(message = "起始服务时间不能为空", groups = AddUserShowGroup.class)
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date serviceTimeStart;
/**
* 服务截止时间
*/
@NotNull(message = "截止服务时间不能为空", groups = AddUserShowGroup.class)
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date serviceTimeEnd;
/**
* 备注
*/
private String remark;
}

71
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgAddEditFormDTO.java

@ -0,0 +1,71 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 服务组织新增/修改
* @Author sun
*/
@Data
public class IcServiceOrgAddEditFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
public interface Del extends CustomerClientShowGroup {
}
/**
* 服务组织Id
*/
@NotBlank(message = "服务组织Id不能为空", groups = {UpdateGroup.class, Del.class})
private String icServiceOrgId;
/**
* 服务类型多个值逗号分隔字典值,字典keyic_service_type
*/
@NotBlank(message = "服务类型不能为空", groups = {AddGroup.class})
private String serviceType;
/**
* 服务组织名称
*/
@NotBlank(message = "服务组织名称不能为空", groups = {AddGroup.class})
private String orgName;
/**
* 组织描述
*/
private String orgDescribe;
/**
* 负责人姓名
*/
@NotBlank(message = "负责人姓名不能为空", groups = {AddGroup.class})
private String principalName;
/**
* 联系方式
*/
@NotBlank(message = "联系方式不能为空", groups = {AddGroup.class})
private String principalMobile;
/**
* 经度
*/
private String longitude;
/**
* 维度
*/
private String latitude;
/**
* 服务地址
*/
private String address;
/**
* 备注信息
*/
private String remark;
private String customerId;
private String userId;
}

46
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgListFormDTO.java

@ -0,0 +1,46 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 组织服务组织列表--接口入参
* @Author sun
*/
@Data
public class IcServiceOrgListFormDTO implements Serializable {
private static final long serialVersionUID = 9156247659994638103L;
/**
* 服务类型字典值
*/
private String serviceType;
/**
* 服务组织名称
*/
private String orgName;
/**
* 服务地址
*/
private String address;
/**
* 备注信息
*/
private String remark;
/**
* 页码
*/
private Integer pageNo = 1;
/**
* 每页显示数量
*/
private Integer pageSize = 20;
private Boolean isPage = true;
private String icServiceOrgId;
private String customerId;
private String staffId;
private String agencyId;
}

27
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitListFormDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2022/5/17 18:45
* @DESC
*/
@Data
public class PartyUnitListFormDTO implements Serializable {
private static final long serialVersionUID = 8059924463686783668L;
/**
* 联建单位IDs
*/
private List<String> partyUnitIds;
/**
* 社区自组织IDs
*/
private List<String> communitySelfIds;
}

57
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFeedbackFormDTO.java

@ -0,0 +1,57 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.util.List;
@Data
public class ServiceProjectFeedbackFormDTO {
/**
* 反馈接口分组
*/
public interface FeedbackGroup {}
/**
* 发起服务接口分组
*/
public interface InitiateGroup {}
@NotBlank(message = "服务记录id不能为空", groups = { FeedbackGroup.class })
private String serviceRecordId;
private String serviceProjectId;
private String serviceGoal;
private String serviceEffect;
private Integer servicePeopleNumber;
/**
* 服务状态in_service服务中completed:已完成
*/
@NotBlank(message = "服务状态不能为空", groups = { FeedbackGroup.class, InitiateGroup.class })
private String serviceStatus;
/**
* 满意度不满意:bad基本满意:good非常满意:perfect
* 按理说服务完成的时候才可以选不完成应该不能选可是谁知道呢原型也没写
*/
private String satisfaction;
private String longitude;
private String latitude;
private String address;
@Valid
private List<Attachment> attachmentList;
@Data
public static class Attachment {
@NotBlank(message = "附件名称不能为空", groups = { FeedbackGroup.class, InitiateGroup.class })
private String attachmentName;
@NotBlank(message = "附件格式不能为空", groups = { FeedbackGroup.class, InitiateGroup.class })
private String attachmentFormat;
@NotBlank(message = "附件类型不能为空", groups = { FeedbackGroup.class, InitiateGroup.class })
private String attachmentType;
@NotBlank(message = "附件url不能为空", groups = { FeedbackGroup.class, InitiateGroup.class })
private String attachmentUrl;
}
}

53
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFormDTO.java

@ -0,0 +1,53 @@
package com.epmet.dto.form;
import com.epmet.dto.IcServiceProjectAttachmentDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2022/5/27 15:53
* @DESC
*/
@Data
public class ServiceProjectFormDTO implements Serializable {
private static final long serialVersionUID = -4573264697450644498L;
public interface ServiceProjectAddForm{}
public interface ServiceProjectUpdateForm{}
@NotBlank(message = "服务类别不能为空",groups = {ServiceProjectAddForm.class})
private String serviceCategoryKey;
@NotBlank(message = "服务名称不能为空",groups = {ServiceProjectAddForm.class,ServiceProjectUpdateForm.class})
private String serviceName;
@NotBlank(message = "服务内容不能为空",groups = {ServiceProjectAddForm.class,ServiceProjectUpdateForm.class})
private String serviceContent;
/**
* 政策依据
*/
private String policyGround;
/**
* 政策级别0市级1区级2街道级
*/
private String policyLevel;
private String customerId;
private String userId;
@NotBlank(message = "serviceProjectId不能为空",groups = {ServiceProjectUpdateForm.class})
private String serviceProjectId;
/**
* 附件集合
*/
private List<IcServiceProjectAttachmentDTO> attachmentList;
}

32
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectListFormDTO.java

@ -0,0 +1,32 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/5/27 16:42
* @DESC
*/
@Data
public class ServiceProjectListFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = -6508966695564469253L;
public interface ServiceProjectDetail{}
private String serviceCategoryKey;
private String serviceName;
private String serviceContent;
private String policyGround;
private String customerId;
private String userId;
private String agencyId;
@NotBlank(message = "serviceProjectId不能为空",groups = ServiceProjectDetail.class)
private String serviceProjectId;
}

66
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectRecordFormDTO.java

@ -0,0 +1,66 @@
package com.epmet.dto.form;
import com.epmet.dto.result.IcServiceScopeDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
@Data
public class ServiceProjectRecordFormDTO {
/**
* 发起服务
*/
public interface Initiate {}
@NotBlank(message = "服务类别key不能为空", groups = { Initiate.class })
private String serviceCategoryKey;
@NotBlank(message = "服务项目Id不能为空", groups = { Initiate.class })
private String serviceProjectId;
private String serviceProjectName;
@NotBlank(message = "服务组织Id不能为空", groups = { Initiate.class })
private String serviceOrgId;
private String serviceOrgName;
@NotEmpty(message = "发布范围不能为空", groups = { Initiate.class })
private List<IcServiceScopeDTO> serviceScope;
@NotNull(message = "服务起始时间不能为空", groups = { Initiate.class })
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date serviceTimeStart;
@NotNull(message = "服务结束时间不能为空", groups = { Initiate.class })
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date serviceTimeEnd;
private String serviceStatus;
private String satisfaction;
private String principalName;
private String principalContact;
/**
* 备注
*/
private String remark;
@Valid
private ServiceProjectFeedbackFormDTO feedback;
private Integer pageNo = 1;
private Integer pageSize = 20;
}

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

@ -0,0 +1,20 @@
package com.epmet.dto.form.demand;
import lombok.Data;
import java.io.Serializable;
@Data
public class IcEventCommentToDemandFromDTO implements Serializable {
private static final long serialVersionUID = 591380873862126679L;
//客户Id
private String customerId;
//需求Id
private String demandRecId;
//评价满意度【 不满意:bad、基本满意:good、非常满意:perfect 】
private String satisfaction;
//当前操作工作人员Id
private String staffId;
}

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

Loading…
Cancel
Save