Browse Source

Merge remote-tracking branch 'origin/dev_ic_diaodong' into dev

master
yinzuomei 4 years ago
parent
commit
fb2e75ab29
  1. 7
      epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.10__add_icuserchangetype_dict.sql
  2. 4
      epmet-cloud-generator/src/main/resources/application.yml
  3. 17
      epmet-cloud-generator/src/main/resources/template/Controller.java.vm
  4. 17
      epmet-cloud-generator/src/main/resources/template/DTO.java.vm
  5. 17
      epmet-cloud-generator/src/main/resources/template/Dao.java.vm
  6. 17
      epmet-cloud-generator/src/main/resources/template/Entity.java.vm
  7. 17
      epmet-cloud-generator/src/main/resources/template/Excel.java.vm
  8. 17
      epmet-cloud-generator/src/main/resources/template/Redis.java.vm
  9. 17
      epmet-cloud-generator/src/main/resources/template/Service.java.vm
  10. 17
      epmet-cloud-generator/src/main/resources/template/ServiceImpl.java.vm
  11. 72
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DateEnum.java
  12. 46
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/IcFormCodeEnum.java
  13. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  14. 110
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/FactIcuserCategoryAnalysisDailyDTO.java
  15. 37
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/IcUserCategoryFormDTO.java
  16. 50
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/IcUserCategoryResultDTO.java
  17. 42
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java
  18. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java
  19. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java
  20. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/IcResiUserEntity.java
  21. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java
  22. 19
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  23. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java
  24. 66
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  25. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java
  26. 14
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java
  27. 36
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml
  28. 15
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml
  29. 1
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java
  30. 18
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/customize/IcResiCategoryConfigDTO.java
  31. 32
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IcUserCategoryAnalysisDailyFormDTO.java
  32. 12
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/OrgIcUserTotalDTO.java
  33. 8
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java
  34. 10
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java
  35. 26
      epmet-module/data-statistical/data-statistical-server/pom.xml
  36. 76
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IcController.java
  37. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/customize/IcResiCategoryStatsConfigDao.java
  38. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIcuserCategoryAnalysisDailyDao.java
  39. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java
  40. 74
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIcuserCategoryAnalysisDailyEntity.java
  41. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/customize/IcResiCategoryStatsConfigService.java
  42. 40
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/customize/impl/IcResiCategoryStatsConfigServiceImpl.java
  43. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java
  44. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java
  45. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIcuserCategoryAnalysisDailyService.java
  46. 198
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIcuserCategoryAnalysisDailyServiceImpl.java
  47. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java
  48. 101
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java
  49. 5
      epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml
  50. 21
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.28__fact_icuser_category_analysis_daily.sql
  51. 23
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/customize/IcResiCategoryStatsConfigDao.xml
  52. 13
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIcuserCategoryAnalysisDailyDao.xml
  53. 82
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml
  54. 115
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitCompletionDTO.java
  55. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java
  56. 18
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CompletionFormDTO.java
  57. 40
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PointRecordFormDTO.java
  58. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java
  59. 33
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceItemAddFormDTO.java
  60. 20
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceItemPageFormDTO.java
  61. 24
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceItemSelectFormDTO.java
  62. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/StatusFormDTO.java
  63. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java
  64. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java
  65. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java
  66. 44
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordDTO.java
  67. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PointRecordResultDTO.java
  68. 17
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServicePointDTO.java
  69. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java
  70. 19
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceItemResultDTO.java
  71. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java
  72. 50
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitCompletionController.java
  73. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java
  74. 88
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java
  75. 63
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
  76. 16
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitCompletionDao.java
  77. 39
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceItemDictDao.java
  78. 28
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
  79. 71
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyUnitCompletionEntity.java
  80. 83
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceItemDictEntity.java
  81. 46
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitCompletionService.java
  82. 73
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java
  83. 33
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
  84. 19
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java
  85. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java
  86. 29
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
  87. 86
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitCompletionServiceImpl.java
  88. 35
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  89. 1
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java
  90. 175
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java
  91. 19
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java
  92. 215
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  93. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java
  94. 40
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  95. 49
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.10__update_service_item.sql
  96. 117
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.8__service_item_dict.sql
  97. 22
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.9__add_icompletion.sql
  98. 27
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitCompletionDao.xml
  99. 34
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceItemDictDao.xml
  100. 76
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

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

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

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

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

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

@ -1,20 +1,3 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ${package}.controller;
import ${main}.commons.tools.page.PageData;

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

@ -1,20 +1,3 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ${package}.dto;
import java.io.Serializable;

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

@ -1,20 +1,3 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ${package}.dao;
import ${main}.commons.mybatis.dao.BaseDao;

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

@ -1,20 +1,3 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ${package}.entity;
import com.baomidou.mybatisplus.annotation.TableName;

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

@ -1,20 +1,3 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ${package}.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;

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

@ -1,20 +1,3 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ${package}.redis;
import ${main}.commons.tools.redis.RedisUtils;

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

@ -1,20 +1,3 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ${package}.service;
import ${main}.commons.mybatis.service.BaseService;

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

@ -1,20 +1,3 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ${package}.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -22,10 +22,10 @@ import com.epmet.dataaggre.dto.datastats.form.CustomerDataManageFormDTO;
import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO;
import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO;
import com.epmet.dataaggre.dto.datastats.result.*;
import com.epmet.dataaggre.dto.epmetuser.FactIcuserCategoryAnalysisDailyDTO;
import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectTotalFormDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectMonthIncrResultDTO;
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO;
import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO;
import com.epmet.dataaggre.entity.datastats.DimAgencyEntity;
@ -349,4 +349,12 @@ public interface DataStatsDao {
* @author sun
*/
List<FactAgencyProjectMonthResultDTO> getProjectMonthIncr(ProjectTotalFormDTO formDTO);
List<FactIcuserCategoryAnalysisDailyDTO> queryGridIcUserCategoryData(@Param("orgId") String orgId,
@Param("dateId") String dateId,
@Param("configIds") List<String> configIds);
List<FactIcuserCategoryAnalysisDailyDTO> queryAgencyIcUserCategoryData(@Param("gridPids") String gridPids,
@Param("dateId") String dateId,
@Param("configIds") List<String> configIds);
}

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

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

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

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

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

@ -3,6 +3,7 @@ package com.epmet.dataaggre.service.datastats;
import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO;
import com.epmet.dataaggre.dto.datastats.form.*;
import com.epmet.dataaggre.dto.datastats.result.*;
import com.epmet.dataaggre.dto.epmetuser.FactIcuserCategoryAnalysisDailyDTO;
import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO;
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
@ -279,4 +280,8 @@ public interface DataStatsService {
String startDateID,
String endDateID,
Boolean needCount);
List<FactIcuserCategoryAnalysisDailyDTO> queryGridIcUserCategoryData(String orgId, String dateId, List<String> configIds);
List<FactIcuserCategoryAnalysisDailyDTO> queryAgencyIcUserCategoryData(String gridPids, String dateId, List<String> configIds);
}

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

@ -16,7 +16,8 @@ import com.epmet.dataaggre.dao.datastats.FactGridMemberStatisticsDailyDao;
import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO;
import com.epmet.dataaggre.dto.datastats.form.*;
import com.epmet.dataaggre.dto.datastats.result.*;
import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.FactIcuserCategoryAnalysisDailyDTO;
import com.epmet.dataaggre.dto.epmetuser.form.GridMemberPatrolListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.result.GridMemberPatrolListResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult;
import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO;
@ -2170,4 +2171,20 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve
PageHelper.startPage(pageNo, pageSize, needCount);
return factGridMemberStatisticsDailyDao.listGridMemberDataStatsIncr(pids, gridId, startDateID, endDateID);
}
@Override
public List<FactIcuserCategoryAnalysisDailyDTO> queryGridIcUserCategoryData(String orgId, String dateId, List<String> configIds) {
if(CollectionUtils.isEmpty(configIds)||StringUtils.isBlank(orgId)){
return new ArrayList<>();
}
return dataStatsDao.queryGridIcUserCategoryData(orgId,dateId,configIds);
}
@Override
public List<FactIcuserCategoryAnalysisDailyDTO> queryAgencyIcUserCategoryData(String gridPids, String dateId, List<String> configIds) {
if(CollectionUtils.isEmpty(configIds)||StringUtils.isBlank(gridPids)){
return new ArrayList<>();
}
return dataStatsDao.queryAgencyIcUserCategoryData(gridPids,dateId,configIds);
}
}

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

@ -177,4 +177,11 @@ public interface EpmetUserService {
List<CustomerStaffEntity> listStaffsByIds(List<String> userIdsPart);
List<ListStaffResultDTO> selectStaffList(List<String> staffIds);
/**
* 人员类别分析-各类别人数
* @param formDTO
* @return
*/
List<IcUserCategoryResultDTO> queryIcUserCategoryData(IcUserCategoryFormDTO formDTO);
}

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

@ -11,9 +11,11 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.BadgeConstant;
import com.epmet.constant.OrgInfoConstant;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmetuser.*;
import com.epmet.dataaggre.dto.epmetuser.CustomerStaffDTO;
import com.epmet.dataaggre.dto.epmetuser.FactIcuserCategoryAnalysisDailyDTO;
import com.epmet.dataaggre.dto.epmetuser.StaffPatrolDetailDTO;
import com.epmet.dataaggre.dto.epmetuser.StaffPatrolRecordDTO;
import com.epmet.dataaggre.dto.epmetuser.form.*;
@ -27,6 +29,12 @@ import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffOrgNameResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffOrgRelationResultDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectAnalysisResultDTO;
import com.epmet.dataaggre.entity.epmetuser.CustomerStaffEntity;
import com.epmet.dataaggre.entity.epmetuser.GovStaffRoleEntity;
import com.epmet.dataaggre.entity.epmetuser.ResiUserBadgeEntity;
import com.epmet.dataaggre.entity.epmetuser.StaffRoleEntity;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.entity.epmetuser.*;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
@ -34,11 +42,13 @@ import com.epmet.dataaggre.service.epmetuser.StaffPatrolDetailService;
import com.epmet.dataaggre.service.epmetuser.StaffPatrolRecordService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.epmet.dataaggre.service.govproject.GovProjectService;
import com.epmet.dataaggre.service.opercustomize.CustomerFootBarService;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.UserBaseInfoDTO;
import com.epmet.dto.result.StaffRoleResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -81,6 +91,8 @@ public class EpmetUserServiceImpl implements EpmetUserService {
private GovStaffRoleDao govStaffRoleDao;
@Resource
private IcResiUserDao icResiUserDao;
@Resource
private CustomerFootBarService customerFootBarService;
/**
* @Description 根据UserIds查询
@ -750,4 +762,58 @@ public class EpmetUserServiceImpl implements EpmetUserService {
public List<ListStaffResultDTO> selectStaffList(List<String> staffIds) {
return customerStaffDao.selectStaffList(staffIds);
}
/**
* 人员类别分析-各类别人数
*
* @param formDTO
* @return
*/
@Override
public List<IcUserCategoryResultDTO> queryIcUserCategoryData(IcUserCategoryFormDTO formDTO) {
// 1、 先查询出居民类别配置(状态为显示)
List<IcUserCategoryResultDTO> resList=customerFootBarService.queryCustomerIcResiCategoryStatsConfig(formDTO.getCustomerId());
if(CollectionUtils.isNotEmpty(resList)){
List<String> configIds=resList.stream().map(IcUserCategoryResultDTO::getConfigId).collect(Collectors.toList());
if(OrgInfoConstant.GRID.equals(formDTO.getOrgType())){
List<FactIcuserCategoryAnalysisDailyDTO> list=dataStatsService.queryGridIcUserCategoryData(formDTO.getOrgId(),formDTO.getDateId(),configIds);
if(CollectionUtils.isNotEmpty(list)){
Map<String, FactIcuserCategoryAnalysisDailyDTO> configMap = list.stream().collect(Collectors.toMap(FactIcuserCategoryAnalysisDailyDTO::getConfigId, m -> m, (k1, k2) -> k1));
resList.forEach(resDto->{
if(MapUtils.isNotEmpty(configMap)&&configMap.containsKey(resDto.getConfigId())){
FactIcuserCategoryAnalysisDailyDTO dailyDTO=configMap.get(resDto.getConfigId());
resDto.setTotal(dailyDTO.getTotal());
resDto.setImmigration(dailyDTO.getQrIncr());
resDto.setEmigration(dailyDTO.getQcIncr());
}
});
}
}else if(OrgInfoConstant.AGENCY.equals(formDTO.getOrgType())){
CustomerAgencyEntity agencyEntity=govOrgService.getAgencyInfo(formDTO.getOrgId());
String gridPids="";
if(NumConstant.ZERO_STR.equals(agencyEntity.getPid())){
// 当前组织是根组织
gridPids=formDTO.getOrgId();
}else {
gridPids=agencyEntity.getPids().concat(StrConstant.COLON).concat(formDTO.getOrgId());
}
List<FactIcuserCategoryAnalysisDailyDTO> list = dataStatsService.queryAgencyIcUserCategoryData(gridPids, formDTO.getDateId(), configIds);
if(CollectionUtils.isNotEmpty(list)){
Map<String, FactIcuserCategoryAnalysisDailyDTO> configMap = list.stream().collect(Collectors.toMap(FactIcuserCategoryAnalysisDailyDTO::getConfigId, m -> m, (k1, k2) -> k1));
resList.forEach(resDto->{
if(MapUtils.isNotEmpty(configMap)&&configMap.containsKey(resDto.getConfigId())){
FactIcuserCategoryAnalysisDailyDTO dailyDTO=configMap.get(resDto.getConfigId());
resDto.setTotal(dailyDTO.getTotal());
resDto.setImmigration(dailyDTO.getQrIncr());
resDto.setEmigration(dailyDTO.getQcIncr());
}
});
}
}
}
return resList;
}
}

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

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

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

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

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

@ -1107,4 +1107,40 @@
ORDER BY month_id ASC
</select>
<select id="queryGridIcUserCategoryData" parameterType="map" resultType="com.epmet.dataaggre.dto.epmetuser.FactIcuserCategoryAnalysisDailyDTO">
SELECT
m.*
FROM
fact_icuser_category_analysis_daily m
WHERE
m.DATE_ID = #{dateId}
AND m.DEL_FLAG = '0'
AND m.ORG_ID = #{orgId}
<if test='null!=configIds and configIds.size()>0'>
<foreach collection="configIds" item="configId" open="AND (" close=")" separator=" OR ">
m.CONFIG_ID = #{configId}
</foreach>
</if>
</select>
<select id="queryAgencyIcUserCategoryData" parameterType="map" resultType="com.epmet.dataaggre.dto.epmetuser.FactIcuserCategoryAnalysisDailyDTO">
SELECT
m.CONFIG_ID,m.COLUMN_NAME,
SUM(m.TOTAL)as TOTAL,
SUM(m.QR_INCR) AS QR_INCR,
SUM(m.QC_INCR) AS QC_INCR
FROM
fact_icuser_category_analysis_daily m
WHERE
m.DATE_ID = #{dateId}
AND m.DEL_FLAG = '0'
AND m.PIDS LIKE concat(#{gridPids},'%')
AND M.ORG_TYPE='grid'
<if test='null!=configIds and configIds.size()>0'>
<foreach collection="configIds" item="configId" open="AND (" close=")" separator=" OR ">
m.CONFIG_ID = #{configId}
</foreach>
</if>
group by m.CONFIG_ID,m.COLUMN_NAME
</select>
</mapper>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.customize.IcResiCategoryStatsConfigDao">
<select id="queryDataColumn" parameterType="java.lang.String" resultType="com.epmet.dto.customize.IcResiCategoryConfigDTO">
SELECT
m.COLUMN_NAME as columnName,
c.id as configId,
m.LABEL as itemLabel
FROM
ic_form_item m
INNER JOIN ic_resi_category_stats_config c ON ( m.CUSTOMER_ID = c.CUSTOMER_ID AND m.COLUMN_NAME = c.COLUMN_NAME AND c.DEL_FLAG = '0' )
WHERE
m.DEL_FLAG = '0'
AND m.DATA_ANALYSE = '1'
AND m.CUSTOMER_ID = #{customerId}
ORDER BY
m.SORT ASC
</select>
</mapper>

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

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.stats.FactIcuserCategoryAnalysisDailyDao">
<delete id="limitDelete" parameterType="map">
delete from fact_icuser_category_analysis_daily
where CUSTOMER_ID = #{customerId}
and date_id=#{dateId}
and org_type=#{orgType}
limit 1000
</delete>
</mapper>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

16
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitCompletionDao.java

@ -0,0 +1,16 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.IcPartyUnitCompletionEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 联建单位完成情况
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-17
*/
@Mapper
public interface IcPartyUnitCompletionDao extends BaseDao<IcPartyUnitCompletionEntity> {
}

39
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceItemDictDao.java

@ -0,0 +1,39 @@
/**
* 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;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.demand.ServiceItemResultDTO;
import com.epmet.entity.IcServiceItemDictEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 服务事项分类字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-14
*/
@Mapper
public interface IcServiceItemDictDao extends BaseDao<IcServiceItemDictEntity> {
List<ServiceItemResultDTO> pageList(String customerId);
IcServiceItemDictEntity selectMax(String customerId);
}

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

@ -19,13 +19,13 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.form.PointRecordFormDTO;
import com.epmet.dto.form.demand.IcResiUserDemandFromDTO;
import com.epmet.dto.form.demand.PageListAnalysisFormDTO;
import com.epmet.dto.form.demand.UserDemandPageFormDTO;
import com.epmet.dto.result.PointRecordDTO;
import com.epmet.dto.result.ServicePointDTO;
import com.epmet.dto.result.demand.*;
import com.epmet.dto.result.demand.DemandRecResultDTO;
import com.epmet.dto.result.demand.IcResiUserReportDemandRes;
import com.epmet.dto.result.demand.ServiceStatDTO;
import com.epmet.entity.IcUserDemandRecEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -118,4 +118,26 @@ public interface IcUserDemandRecDao extends BaseDao<IcUserDemandRecEntity> {
@Param("type")String type);
int evaluate(@Param("demandRecId")String demandRecId, @Param("finishResult")String finishResult);
/**
* 组织单位积分记录
*
* @Param formDTO
* @Return {@link List< PointRecordDTO>}
* @Author zhaoqifeng
* @Date 2022/1/18 10:33
*/
List<PointRecordDTO> getPointRecordList(PointRecordFormDTO formDTO);
Integer getTotalPoint(PointRecordFormDTO formDTO);
/**
* 组织单位积分
* @Param agencyId
* @Param serviceType
* @Return {@link List< ServicePointDTO>}
* @Author zhaoqifeng
* @Date 2022/1/21 15:53
*/
List<ServicePointDTO> getServicePoint(@Param("customerId")String customerId, @Param("serviceType")String serviceType);
}

71
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPartyUnitCompletionEntity.java

@ -0,0 +1,71 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 联建单位完成情况
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_party_unit_completion")
public class IcPartyUnitCompletionEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
*
*/
private String pids;
/**
* 单位ID
*/
private String unitId;
/**
* 类型 monthly月度quarter季度
*/
private String type;
/**
* 评分 百分制
*/
private String score;
/**
* 完成情况1已完成0未完成
*/
private String status;
/**
* 年份
*/
private String year;
/**
* 月或季度
*/
private String monthQuarter;
/**
* 时间
*/
private String recordDate;
}

83
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceItemDictEntity.java

@ -0,0 +1,83 @@
/**
* 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;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 服务事项分类字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_service_item_dict")
public class IcServiceItemDictEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 父级,一级默认为0
*/
private String parentCode;
/**
* 分类编码
*/
private String categoryCode;
/**
* 分类名称
*/
private String categoryName;
/**
* 级别
*/
private Integer level;
/**
* 备注
*/
private String remark;
/**
* 排序
*/
private Integer sort;
/**
* 1可用0不可用
*/
private Boolean usableFlag;
/**
* 奖励积分
*/
private Integer awardPoint;
}

46
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitCompletionService.java

@ -0,0 +1,46 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcPartyUnitCompletionDTO;
import com.epmet.dto.form.CompletionFormDTO;
import com.epmet.entity.IcPartyUnitCompletionEntity;
/**
* 联建单位完成情况
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-17
*/
public interface IcPartyUnitCompletionService extends BaseService<IcPartyUnitCompletionEntity> {
/**
* 默认分页
*
* @param formDTO
* @return PageData<IcPartyUnitCompletionDTO>
* @author generator
* @date 2022-01-17
*/
PageData<IcPartyUnitCompletionDTO> page(CompletionFormDTO formDTO);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-01-17
*/
void save(IcPartyUnitCompletionDTO dto);
/**
* 删除
*
* @param id
* @return void
* @author generator
* @date 2022-01-17
*/
void delete(String id);
}

73
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.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;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.form.demand.ServiceItemAddFormDTO;
import com.epmet.dto.form.demand.ServiceItemPageFormDTO;
import com.epmet.dto.form.demand.ServiceItemSelectFormDTO;
import com.epmet.dto.form.demand.StatusFormDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.demand.ServiceItemResultDTO;
import com.epmet.entity.IcServiceItemDictEntity;
import java.util.List;
/**
* 服务事项分类字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-14
*/
public interface IcServiceItemDictService extends BaseService<IcServiceItemDictEntity> {
/**
* 01列表查询
* @param formDTO
* @return
*/
PageData<ServiceItemResultDTO> page(ServiceItemPageFormDTO formDTO);
/**
* 02添加或者修改分类
* @param formDTO
*/
void addOrUpdate(ServiceItemAddFormDTO formDTO);
/**
* 03启用或者禁用分类
* @param formDTO
* @return
*/
void updateStatus(StatusFormDTO formDTO);
/**
* 新增联建单位查询服务事项列表
* @param customerId
* @return
*/
List<OptionDTO> queryDictList(String customerId);
/**
* 前端调用此接口
* @param formDTO
* @return
*/
List<OptionDTO> queryDictListForSelect(ServiceItemSelectFormDTO formDTO);
}

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

@ -20,11 +20,14 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.form.PointRecordFormDTO;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.PointRecordResultDTO;
import com.epmet.dto.result.demand.*;
import com.epmet.entity.IcUserDemandRecEntity;
import java.util.List;
import java.util.Map;
/**
* 居民需求记录表
@ -214,4 +217,34 @@ public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntit
*/
UserDemandRelResDTO queryUserDemandRel(UserDemandRelFormDTO formDTO);
/**
* 社区查询 根据"需求人"精确查询根据"需求内容""服务方"模糊查询
* @param customerId 客户ID
* @param keyword 关键词
* @param keyword 关键词
* @param pageNo
* @param pageSize
* @return
*/
PageData<DemandRecResultDTO> search(String customerId, String agencyId, String keyword, Integer pageNo, Integer pageSize);
/**
* 组织单位积分记录
* @Param formDTO
* @Return {@link PointRecordResultDTO}
* @Author zhaoqifeng
* @Date 2022/1/18 9:45
*/
PointRecordResultDTO pointRecordList(PointRecordFormDTO formDTO);
/**
* 组织单位积分
*
* @Param customerId
* @Param serviceType
* @Return {@link Map< String, Integer>}
* @Author zhaoqifeng
* @Date 2022/1/21 16:02
*/
Map<String, Integer> getServicePoint(String customerId, String serviceType);
}

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

@ -35,17 +35,14 @@ import com.epmet.dao.ActUserRelationDao;
import com.epmet.dao.HeartUserInfoDao;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.demand.SubCodeFormDTO;
import com.epmet.dto.form.resi.*;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.resi.*;
import com.epmet.entity.ActInfoEntity;
import com.epmet.entity.ActUserRelationEntity;
import com.epmet.service.ActInfoService;
import com.epmet.service.ActUserRelationService;
import com.epmet.service.IcPartyUnitService;
import com.epmet.service.IcResiDemandDictService;
import com.epmet.service.*;
import com.epmet.utils.CaculateDistance;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -77,9 +74,9 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
@Autowired
private HeartUserInfoDao heartUserInfoDao;
@Resource
private IcResiDemandDictService icResiDemandDictService;
@Resource
private IcPartyUnitService icPartyUnitService;
@Resource
private IcServiceItemDictService icServiceItemDictService;
@Override
public PageData<ActInfoDTO> page(Map<String, Object> params) {
@ -260,11 +257,9 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
if (StringUtils.isNotBlank(detailResultDTO.getServiceMatter())) {
//获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(tokenDto.getCustomerId());
codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
detailResultDTO.setServiceMatterName(categoryMap.get(detailResultDTO.getServiceMatter()));
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId());
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
detailResultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(detailResultDTO.getServiceMatter()) ? categoryMap.get(detailResultDTO.getServiceMatter()) : StrConstant.EPMETY_STR);
}
if (StringUtils.isNotBlank(detailResultDTO.getUnitId())) {
//获取单位名称

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java

@ -23,6 +23,7 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.ExcelPoiUtils;
import com.epmet.commons.tools.validator.PhoneValidatorUtils;
import com.epmet.constant.IcCommunitySelfOrganizationConstant;
import com.epmet.constant.UserDemandConstant;
import com.epmet.dao.IcCommunitySelfOrganizationDao;
import com.epmet.dto.IcCommunitySelfOrganizationDTO;
import com.epmet.dto.form.AddCommunitySelfOrganizationFormDTO;
@ -279,6 +280,8 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
if (null == staffInfo){
throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId()));
}
//获取单位积分
Map<String, Integer> pointMap = icUserDemandRecService.getServicePoint(tokenDto.getCustomerId(), UserDemandConstant.COMMUNITY_ORG);
formDTO.setAgencyId(staffInfo.getAgencyId());
formDTO.setCustomerId(tokenDto.getCustomerId());
final int[] i = {(formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize() + NumConstant.ONE};
@ -290,6 +293,7 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
objectPageInfo.getList().forEach(l -> {
l.setSort(i[NumConstant.ZERO]);
i[NumConstant.ZERO]++;
l.setScore(null == pointMap.get(l.getOrgId())?NumConstant.ZERO:pointMap.get(l.getOrgId()));
});
result.setList(objectPageInfo.getList());
}
@ -301,6 +305,7 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
AtomicReference<Integer> sort = new AtomicReference<>(NumConstant.ONE);
resultDTOs.forEach(r -> {
r.setSort(sort.getAndSet(sort.get() + NumConstant.ONE));
r.setScore(null == pointMap.get(r.getOrgId())?NumConstant.ZERO:pointMap.get(r.getOrgId()));
});
result.setList(resultDTOs);
}

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

@ -35,14 +35,13 @@ import com.epmet.dao.IcPartyActivityDao;
import com.epmet.dto.IcPartyActivityDTO;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.PartyActivityFormDTO;
import com.epmet.dto.form.demand.SubCodeFormDTO;
import com.epmet.dto.result.ActivityStatisticsDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcPartyActivityEntity;
import com.epmet.excel.IcPartyActivityImportExcel;
import com.epmet.service.IcPartyActivityService;
import com.epmet.service.IcPartyUnitService;
import com.epmet.service.IcResiDemandDictService;
import com.epmet.service.IcServiceItemDictService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
@ -71,11 +70,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
@Resource
private IcPartyUnitService icPartyUnitService;
@Resource
private IcResiDemandDictService icResiDemandDictService;
/**
* 服务事项code
*/
private static final String SERVICE_MATTER_CODE = "1010";
private IcServiceItemDictService icServiceItemDictService;
@Override
public PageData<IcPartyActivityDTO> search(PartyActivityFormDTO formDTO) {
@ -159,10 +155,9 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
return null;
}
//获取服务事项名称
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(entity.getCustomerId());
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(entity.getCustomerId());
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
IcPartyActivityDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyActivityDTO.class);
dto.setServiceMatterName(categoryMap.get(dto.getServiceMatter()));
//获取单位名称
@ -225,10 +220,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
//获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(tokenDto.getCustomerId());
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getLabel, OptionDTO::getValue));
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId());
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//获取联建单位
IcPartyUnitDTO unitDTO = new IcPartyUnitDTO();
unitDTO.setAgencyId(staffInfoCache.getAgencyId());
@ -369,10 +362,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
//获取联建单位
Map<String, String> option = icPartyUnitService.options(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//获取服务事项字典
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(tokenDto.getCustomerId());
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId());
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//数据组装
dtoList.forEach(dto -> {
dto.setServiceMatterName(categoryMap.get(dto.getServiceMatter()));

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

@ -0,0 +1,86 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.enums.DateEnum;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcPartyUnitCompletionDao;
import com.epmet.dto.IcPartyUnitCompletionDTO;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.CompletionFormDTO;
import com.epmet.entity.IcPartyUnitCompletionEntity;
import com.epmet.service.IcPartyUnitCompletionService;
import com.epmet.service.IcPartyUnitService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
/**
* 联建单位完成情况
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-17
*/
@Service
public class IcPartyUnitCompletionServiceImpl extends BaseServiceImpl<IcPartyUnitCompletionDao, IcPartyUnitCompletionEntity> implements IcPartyUnitCompletionService {
@Resource
private IcPartyUnitService icPartyUnitService;
@Override
public PageData<IcPartyUnitCompletionDTO> page(CompletionFormDTO formDTO) {
if (StringUtils.isBlank(formDTO.getUnitId())) {
return new PageData<>(Collections.emptyList(), NumConstant.ZERO);
}
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
LambdaQueryWrapper<IcPartyUnitCompletionEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcPartyUnitCompletionEntity::getUnitId, formDTO.getUnitId());
wrapper.orderByDesc(IcPartyUnitCompletionEntity::getCreatedTime);
List<IcPartyUnitCompletionEntity> list = baseDao.selectList(wrapper);
PageInfo<IcPartyUnitCompletionEntity> pageInfo = new PageInfo<>(list);
List<IcPartyUnitCompletionDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitCompletionDTO.class);
if(CollectionUtils.isNotEmpty(dtoList)) {
dtoList.forEach(item -> {
item.setMonthQuarterName(DateEnum.getName(item.getMonthQuarter()));
});
}
return new PageData<>(dtoList, pageInfo.getTotal());
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcPartyUnitCompletionDTO dto) {
IcPartyUnitCompletionEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyUnitCompletionEntity.class);
if (StringUtils.isNotBlank(dto.getYear()) && StringUtils.isNotBlank(dto.getMonthQuarter())) {
entity.setRecordDate(dto.getYear().concat(dto.getMonthQuarter()));
}
if(StringUtils.isBlank(dto.getId())) {
IcPartyUnitDTO unity = icPartyUnitService.get(dto.getUnitId());
entity.setCustomerId(unity.getCustomerId());
entity.setAgencyId(unity.getAgencyId());
entity.setPids(unity.getPids());
insert(entity);
} else {
updateById(entity);
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String id) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteById(id);
}
}

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

@ -40,12 +40,12 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.ExcelPoiUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.UserDemandConstant;
import com.epmet.dao.IcPartyUnitDao;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.PartyActivityFormDTO;
import com.epmet.dto.form.PartyUnitFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.form.demand.SubCodeFormDTO;
import com.epmet.dto.result.PartyUnitDistributionResultDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.demand.ServiceStatDTO;
@ -54,6 +54,7 @@ import com.epmet.excel.IcPartyUnitImportExcel;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.service.IcPartyUnitService;
import com.epmet.service.IcResiDemandDictService;
import com.epmet.service.IcServiceItemDictService;
import com.epmet.service.IcUserDemandRecService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -87,7 +88,8 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
private IcUserDemandRecService icUserDemandRecService;
@Resource
private IcResiDemandDictService icResiDemandDictService;
@Resource
private IcServiceItemDictService icServiceItemDictService;
@Override
public PageData<IcPartyUnitDTO> search(PartyUnitFormDTO formDTO) {
@ -104,10 +106,11 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
PageInfo<IcPartyUnitEntity> pageInfo = new PageInfo<>(list);
List<IcPartyUnitDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class);
Result<Map<String, String>> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode());
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(formDTO.getCustomerId());
codeFormDTO.setParentCategoryCode("1010");
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//服务事项列表从需求分类中抽离出来,改为查询ic_service_item_dict表
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId());
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//获取单位积分
Map<String, Integer> pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT);
dtoList.forEach(item -> {
item.setType(unitTypeMap.getData().get(item.getType()));
if (StringUtils.isNotBlank(item.getServiceMatter())) {
@ -121,6 +124,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
}else{
item.setSatisfaction(new BigDecimal(item.getSatisfaction()).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
}
item.setScore(null == pointMap.get(item.getId())?NumConstant.ZERO:pointMap.get(item.getId()));
});
return new PageData<>(dtoList, pageInfo.getTotal());
}
@ -138,10 +142,11 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
List<IcPartyUnitEntity> list = baseDao.selectList(wrapper);
List<IcPartyUnitDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class);
Result<Map<String, String>> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode());
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(formDTO.getCustomerId());
codeFormDTO.setParentCategoryCode("1010");
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//服务事项列表从需求分类中抽离出来,改为查询ic_service_item_dict表
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId());
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//获取单位积分
Map<String, Integer> pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT);
dtoList.forEach(item -> {
item.setType(unitTypeMap.getData().get(item.getType()));
if (StringUtils.isNotBlank(item.getServiceMatter())) {
@ -150,6 +155,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
} else {
item.setServiceMatterList(new ArrayList<>());
}
item.setScore(null == pointMap.get(item.getId())?NumConstant.ZERO:pointMap.get(item.getId()));
});
return dtoList;
}
@ -168,7 +174,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
IcPartyUnitEntity entity = baseDao.selectById(id);
IcPartyUnitDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyUnitDTO.class);
if (StringUtils.isNotBlank(dto.getServiceMatter())) {
//获取单位积分
Map<String, Integer> pointMap = icUserDemandRecService.getServicePoint(entity.getCustomerId(), UserDemandConstant.PARTY_UNIT);
dto.setServiceMatterList(Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA)));
dto.setScore(null == pointMap.get(id)?NumConstant.ZERO:pointMap.get(id));
}
return dto;
}
@ -312,10 +321,8 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
if (null == staffInfoCache) {
throw new EpmetException(8000, "获取用户缓存失败");
}
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(tokenDto.getCustomerId());
codeFormDTO.setParentCategoryCode("1010");
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getLabel, OptionDTO::getValue));
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId());
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//1.数据校验
Iterator<IcPartyUnitImportExcel> iterator = result.iterator();
while (iterator.hasNext()) {

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

@ -225,6 +225,7 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
return list;
}
@Transactional(rollbackFor = Exception.class)
@Override
public void updateStatus(StatusFormDTO formDTO) {
IcResiDemandDictEntity origin = baseDao.selectById(formDTO.getCategoryId());

175
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java

@ -0,0 +1,175 @@
/**
* 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.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dao.IcServiceItemDictDao;
import com.epmet.dto.form.demand.ServiceItemAddFormDTO;
import com.epmet.dto.form.demand.ServiceItemPageFormDTO;
import com.epmet.dto.form.demand.ServiceItemSelectFormDTO;
import com.epmet.dto.form.demand.StatusFormDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.demand.ServiceItemResultDTO;
import com.epmet.entity.IcServiceItemDictEntity;
import com.epmet.service.IcServiceItemDictService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 服务事项分类字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-01-14
*/
@Slf4j
@Service
public class IcServiceItemDictServiceImpl extends BaseServiceImpl<IcServiceItemDictDao, IcServiceItemDictEntity> implements IcServiceItemDictService {
/**
* 列表查询
*
* @param formDTO
* @return
*/
@Override
public PageData<ServiceItemResultDTO> page(ServiceItemPageFormDTO formDTO) {
//目前不分页,只是接口支持分页
List<ServiceItemResultDTO> list = baseDao.pageList(formDTO.getCustomerId());
return new PageData<>(list, CollectionUtils.isNotEmpty(list) ? list.size() : NumConstant.ZERO);
}
/**
* 02添加或者修改分类
*
* @param formDTO
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void addOrUpdate(ServiceItemAddFormDTO formDTO) {
formDTO.setCategoryName(formDTO.getCategoryName().trim());
//分类名称是否唯一
LambdaQueryWrapper<IcServiceItemDictEntity> nameQuery = new LambdaQueryWrapper<>();
nameQuery.eq(IcServiceItemDictEntity::getCustomerId, formDTO.getCustomerId())
.eq(IcServiceItemDictEntity::getCategoryName, formDTO.getCategoryName())
.ne(StringUtils.isNotBlank(formDTO.getCategoryId()), IcServiceItemDictEntity::getId, formDTO.getCategoryId());
if (baseDao.selectCount(nameQuery) > 0) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前客户下,分类名称已存在", "分类名称已存在");
}
if (StringUtils.isNotBlank(formDTO.getCategoryId())) {
LambdaUpdateWrapper<IcServiceItemDictEntity> update = new LambdaUpdateWrapper<>();
update.eq(IcServiceItemDictEntity::getId, formDTO.getCategoryId());
update.set(IcServiceItemDictEntity::getCategoryName, formDTO.getCategoryName())
.set(IcServiceItemDictEntity::getAwardPoint, formDTO.getAwardPoint());
baseDao.update(null, update);
return;
}
//如果说当前查询的编码是1022,但是库里面1023已经存在且del_flag='0'。这个时候新增的编码为1023就会报错。
IcServiceItemDictEntity max = baseDao.selectMax(formDTO.getCustomerId());
// 获取编码
IcServiceItemDictEntity insert = new IcServiceItemDictEntity();
insert.setCustomerId(formDTO.getCustomerId());
insert.setAwardPoint(formDTO.getAwardPoint());
insert.setCategoryName(formDTO.getCategoryName());
insert.setUsableFlag(true);
insert.setParentCode(NumConstant.ZERO_STR);
insert.setLevel(NumConstant.ONE);
insert.setSort(null != max ? max.getSort() + 1 : NumConstant.ONE);
insert.setCategoryCode(null != max ? String.valueOf(Integer.valueOf(max.getCategoryCode()) + 1) : "1001");
baseDao.insert(insert);
}
/**
* 03启用或者禁用分类
*
* @param formDTO
* @return
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void updateStatus(StatusFormDTO formDTO) {
LambdaUpdateWrapper<IcServiceItemDictEntity> update = new LambdaUpdateWrapper<>();
update.eq(IcServiceItemDictEntity::getId, formDTO.getCategoryId())
.set(IcServiceItemDictEntity::getUsableFlag, formDTO.getUsableFlag())
.set(IcServiceItemDictEntity::getUpdatedTime, new Date())
.set(IcServiceItemDictEntity::getUpdatedBy, formDTO.getUserId());
baseDao.update(null, update);
}
/**
* 新增联建单位查询服务事项列表
*
* @param customerId
* @return
*/
@Override
public List<OptionDTO> queryDictList(String customerId) {
List<OptionDTO> resultList=new ArrayList<>();
LambdaQueryWrapper<IcServiceItemDictEntity> query = new LambdaQueryWrapper<>();
query.eq(IcServiceItemDictEntity::getCustomerId, customerId)
.orderByAsc(IcServiceItemDictEntity::getSort);
List<IcServiceItemDictEntity> list=baseDao.selectList(query);
for(IcServiceItemDictEntity entity:list){
OptionDTO optionDTO=new OptionDTO();
optionDTO.setLabel(entity.getCategoryName());
optionDTO.setValue(entity.getCategoryCode());
optionDTO.setAwardPoint(entity.getAwardPoint());
resultList.add(optionDTO);
}
return resultList;
}
/**
* 前端调用此接口
*
* @param formDTO
* @return
*/
@Override
public List<OptionDTO> queryDictListForSelect(ServiceItemSelectFormDTO formDTO) {
List<OptionDTO> resultList = new ArrayList<>();
LambdaQueryWrapper<IcServiceItemDictEntity> query = new LambdaQueryWrapper<>();
query.eq(IcServiceItemDictEntity::getCustomerId, formDTO.getCustomerId())
.eq(StringUtils.isNotBlank(formDTO.getType()) && "usable".equals(formDTO.getType()), IcServiceItemDictEntity::getUsableFlag, true)
.orderByAsc(IcServiceItemDictEntity::getSort);
List<IcServiceItemDictEntity> list=baseDao.selectList(query);
for(IcServiceItemDictEntity entity:list){
OptionDTO optionDTO=new OptionDTO();
optionDTO.setLabel(entity.getCategoryName());
optionDTO.setValue(entity.getCategoryCode());
optionDTO.setAwardPoint(entity.getAwardPoint());
resultList.add(optionDTO);
}
return resultList;
}
}

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

@ -19,18 +19,21 @@ package com.epmet.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.UserDemandConstant;
import com.epmet.dao.IcSocietyOrgDao;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.IcSocietyOrgDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.*;
import com.epmet.dto.result.GetListSocietyOrgResultDTO;
import com.epmet.dto.result.OrgInfoResultDTO;
import com.epmet.dto.result.SocietyOrgListResultDTO;
import com.epmet.dto.result.StaffSinGridResultDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcSocietyOrgEntity;
import com.epmet.excel.IcSocietyOrgExcel;
@ -127,7 +130,8 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
return resultDTO;
}
resultDTO.setTotal((int) result.getTotal());
//获取组织积分
Map<String, Integer> pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.SOCIAL_ORG);
//2.查询被绑定管理员信息
UserIdsFormDTO dto = new UserIdsFormDTO();
List<String> staffIdList = result.getList().stream().map(SocietyOrgListResultDTO::getAdminStaffId).collect(Collectors.toList());
@ -150,7 +154,9 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
throw new RenException("获取组织基础信息失败......");
}
result.getList().forEach(r -> orgResult.getData().stream().filter(u -> r.getAgencyId().equals(u.getOrgId())).forEach(u -> r.setAgencyName(u.getOrgName())));
result.getList().forEach(item -> {
item.setScore(null == pointMap.get(item.getSocietyId())?NumConstant.ZERO:pointMap.get(item.getSocietyId()));
});
resultDTO.setList(result.getList());
return resultDTO;
}
@ -169,14 +175,15 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
throw new RenException("工作人员所属组织信息查询异常");
}
List<String> agencyIds = new ArrayList<>();
if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) {
//2022.01.26与社会组织列表一直,查询当前工作人员所属组织建立的社会组织
/*if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) {
if (staffInfoCacheResult.getAgencyPIds().contains(StrConstant.COLON)) {
agencyIds.addAll(Arrays.asList(staffInfoCacheResult.getAgencyPIds().split(StrConstant.COLON)));
}else{
//当前用户属于第二级组织的人,不会有:
agencyIds.add(staffInfoCacheResult.getAgencyPIds());
}
}
}*/
agencyIds.add(staffInfoCacheResult.getAgencyId());
resultList = baseDao.selectListByAgencyId(agencyIds, formDTO.getServiceName(), formDTO.getCustomerId(), formDTO.getQueryPurpose());
return resultList;

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

@ -22,12 +22,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.DictTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
@ -77,7 +79,7 @@ import java.util.stream.Collectors;
*/
@Slf4j
@Service
public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecDao, IcUserDemandRecEntity> implements IcUserDemandRecService {
public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecDao, IcUserDemandRecEntity> implements IcUserDemandRecService, ResultDataResolver {
@Autowired
private IcUserDemandOperateLogDao operateLogDao;
@Autowired
@ -152,7 +154,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
// 查询需求人的居住地址
Set<String> houseIds=new HashSet<>();
houseIds.add(updateEntity.getDemandUserHouseId());
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds);
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds,dto.getCustomerId());
if(!houseInfoRes.success()||CollectionUtils.isEmpty(houseInfoRes.getData())){
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人房屋地址信息异常"+JSON.toJSONString(houseInfoRes));
}
@ -221,7 +223,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
// 查询需求人的居住地址
Set<String> houseIds=new HashSet<>();
houseIds.add(insertEntity.getDemandUserHouseId());
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds);
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds, fromDTO.getCustomerId());
if(!houseInfoRes.success()||CollectionUtils.isEmpty(houseInfoRes.getData())){
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人房屋地址信息异常"+JSON.toJSONString(houseInfoRes));
}
@ -792,67 +794,76 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
list=baseDao.pageListAnalysis(formDTO);
}
if(CollectionUtils.isNotEmpty(list)){
//1、查询网格信息
List<String> gridIds=list.stream().map(DemandRecResultDTO::getGridId).collect(Collectors.toList());
Result<List<AllGridsByUserIdResultDTO>> gridInfoRes=govOrgOpenFeignClient.getGridListByGridIds(gridIds);
List<AllGridsByUserIdResultDTO> gridInfoList = gridInfoRes.success() && !CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>();
Map<String, AllGridsByUserIdResultDTO> gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, Function.identity()));
//2、查询分类名称
List<String> categoryCodes=list.stream().map(DemandRecResultDTO::getCategoryCode).collect(Collectors.toList());
List<IcResiDemandDictEntity> dictList=demandDictService.listByCodes(formDTO.getCustomerId(),categoryCodes);
Map<String, String> dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName));
fillDemandsInfo(list, formDTO.getCustomerId());
}
return new PageData<>(list, total);
}
//3、查询志愿者
// 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
Map<String,String> userInfoMap=new HashMap<>();
Set<String> userIdList=list.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet());
if(CollectionUtils.isNotEmpty(userIdList)){
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList));
if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"查询志愿者信息异常");
}
userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName));
/**
* 填充需求信息
* @param demandList 需求列表
* @param customerId 客户id
*/
public void fillDemandsInfo(List<DemandRecResultDTO> demandList, String customerId) {
//1、查询网格信息
List<String> gridIds=demandList.stream().map(DemandRecResultDTO::getGridId).collect(Collectors.toList());
Result<List<AllGridsByUserIdResultDTO>> gridInfoRes=govOrgOpenFeignClient.getGridListByGridIds(gridIds);
List<AllGridsByUserIdResultDTO> gridInfoList = gridInfoRes.success() && !CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>();
Map<String, AllGridsByUserIdResultDTO> gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, Function.identity()));
//2、查询分类名称
List<String> categoryCodes=demandList.stream().map(DemandRecResultDTO::getCategoryCode).collect(Collectors.toList());
List<IcResiDemandDictEntity> dictList=demandDictService.listByCodes(customerId,categoryCodes);
Map<String, String> dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName));
//3、查询志愿者
// 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
Map<String,String> userInfoMap=new HashMap<>();
Set<String> userIdList=demandList.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet());
if(CollectionUtils.isNotEmpty(userIdList)){
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList));
if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"查询志愿者信息异常");
}
userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName));
}
for(DemandRecResultDTO res:list){
if (null != gridInfoMap && gridInfoMap.containsKey(res.getGridId())) {
res.setGridName(gridInfoMap.get(res.getGridId()).getGridName());
}
for(DemandRecResultDTO res:demandList){
if (null != gridInfoMap && gridInfoMap.containsKey(res.getGridId())) {
res.setGridName(gridInfoMap.get(res.getGridId()).getGridName());
}
if (null != dictMap && dictMap.containsKey(res.getCategoryCode())) {
res.setCategoryName(dictMap.get(res.getCategoryCode()));
}
res.setFirstCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(), res.getFirstCategoryCode()));
if (null != userInfoMap && userInfoMap.containsKey(res.getServerId())) {
res.setServiceName(userInfoMap.get(res.getServerId()));
}
//社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help
//待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished
//服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
switch (res.getServiceType())
{
case UserDemandConstant.PARTY_UNIT:
res.setServiceShowName(res.getServiceName().concat("(区域化党建单位)"));
break;
case UserDemandConstant.SOCIAL_ORG:
res.setServiceShowName(res.getServiceName().concat("(社会组织)"));
break;
case UserDemandConstant.COMMUNITY_ORG:
res.setServiceShowName(res.getServiceName().concat("(社区自组织)"));
break;
case UserDemandConstant.VOLUNTEER:
res.setServiceShowName(res.getServiceName().concat("(志愿者)"));
break;
default:
res.setServiceShowName(res.getServiceName());
log.warn("serviceType 错误");
break;
}
res.setServiceShowFlag(StringUtils.isNotBlank(res.getServerId()));
if (null != dictMap && dictMap.containsKey(res.getCategoryCode())) {
res.setCategoryName(dictMap.get(res.getCategoryCode()));
}
res.setFirstCategoryName(demandDictService.getCategoryName(customerId, res.getFirstCategoryCode()));
if (null != userInfoMap && userInfoMap.containsKey(res.getServerId())) {
res.setServiceName(userInfoMap.get(res.getServerId()));
}
//社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help
//待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished
//服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
switch (res.getServiceType())
{
case UserDemandConstant.PARTY_UNIT:
res.setServiceShowName(res.getServiceName().concat("(区域化党建单位)"));
break;
case UserDemandConstant.SOCIAL_ORG:
res.setServiceShowName(res.getServiceName().concat("(社会组织)"));
break;
case UserDemandConstant.COMMUNITY_ORG:
res.setServiceShowName(res.getServiceName().concat("(社区自组织)"));
break;
case UserDemandConstant.VOLUNTEER:
res.setServiceShowName(res.getServiceName().concat("(志愿者)"));
break;
default:
res.setServiceShowName(res.getServiceName());
log.warn("serviceType 错误");
break;
}
res.setServiceShowFlag(StringUtils.isNotBlank(res.getServerId()));
}
return new PageData<>(list, total);
}
/**
@ -1603,7 +1614,95 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
return res;
}
@Override
public PageData<DemandRecResultDTO> search(String customerId, String agencyId, String keyword, Integer pageNo, Integer pageSize) {
CustomerAgencyDTO agency = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(agencyId), ServiceConstant.GOV_ORG_SERVER,
EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询需求列表】查询当前staff所属组织信息失败", null);
if (agency == null) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询需求列表】查询当前staff所属组织信息失败");
}
String gridPids;
if(NumConstant.ZERO_STR.equals(agency.getPid())){
gridPids = agencyId;
}else{
gridPids = agency.getPids().concat(StrConstant.COLON).concat(agencyId);
}
PageListAnalysisFormDTO queryForm = new PageListAnalysisFormDTO();
queryForm.setCustomerId(customerId);
queryForm.setGridPids(gridPids);
queryForm.setKeyword(keyword);
PageHelper.startPage(pageNo, pageSize);
List<DemandRecResultDTO> list = baseDao.pageListAnalysis(queryForm);
// 填充信息
fillDemandsInfo(list, customerId);
return new PageData<>(list, new PageInfo<>(list).getTotal());
}
/**
* 组织单位积分记录
*
* @param formDTO
* @Param formDTO
* @Return {@link PointRecordResultDTO}
* @Author zhaoqifeng
* @Date 2022/1/18 9:45
*/
@Override
public PointRecordResultDTO pointRecordList(PointRecordFormDTO formDTO) {
PointRecordResultDTO result = new PointRecordResultDTO();
if (StringUtils.isBlank(formDTO.getServiceId())) {
result.setTotalPoint(NumConstant.ZERO);
result.setPage(new PageData<>(Collections.emptyList(), NumConstant.ZERO));
}
Integer total = baseDao.getTotalPoint(formDTO);
//总积分
result.setTotalPoint(null == total?NumConstant.ZERO:total);
//分页查询
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
List<PointRecordDTO> list = baseDao.getPointRecordList(formDTO);
PageInfo<PointRecordDTO> pageInfo = new PageInfo<>(list);
if (CollectionUtils.isNotEmpty(list)) {
//查询分类名称
List<String> categoryCodes = list.stream().map(PointRecordDTO::getCategoryCode).collect(Collectors.toList());
List<IcResiDemandDictEntity> dictList = demandDictService.listByCodes(formDTO.getCustomerId(), categoryCodes);
Map<String, String> dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName));
list.forEach(item -> {
if (dictMap.containsKey(item.getCategoryCode())) {
item.setCategoryName(dictMap.get(item.getCategoryCode()));
}
});
}
result.setPage(new PageData<>(list, pageInfo.getTotal()));
return result;
}
/**
* 组织单位积分
*
* @param customerId
* @param serviceType
* @Param customerId
* @Param serviceType
* @Return {@link Map< String, Integer>}
* @Author zhaoqifeng
* @Date 2022/1/21 16:02
*/
@Override
public Map<String, Integer> getServicePoint(String customerId, String serviceType) {
List<ServicePointDTO> list = baseDao.getServicePoint(customerId, serviceType);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyMap();
}
return list.stream().collect(Collectors.toMap(ServicePointDTO::getServerId, ServicePointDTO::getPoint));
}
}

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

@ -6,7 +6,6 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.LatestActContentDTO;
import com.epmet.dto.LatestActInfoDTO;
import com.epmet.dto.form.demand.SubCodeFormDTO;
import com.epmet.dto.form.work.ActPreviewFormDTO;
import com.epmet.dto.form.work.DraftActContentFormDTO;
import com.epmet.dto.form.work.DraftActInfoFormDTO;
@ -43,14 +42,10 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
@Autowired
private LatestActContentService latestActContentService;
@Resource
private IcResiDemandDictService icResiDemandDictService;
private IcServiceItemDictService icServiceItemDictService;
@Resource
private IcPartyUnitService icPartyUnitService;
/**
* 服务事项code
*/
private static final String SERVICE_MATTER_CODE = "1010";
/**
* @return com.epmet.dto.form.work.PublishActInitResultDTO
@ -142,10 +137,8 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
if (StringUtils.isNotBlank(actPreviewResultDTO.getServiceMatter())) {
//获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(formDTO.getCustomerId());
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId());
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
actPreviewResultDTO.setServiceMatterName(categoryMap.get(actPreviewResultDTO.getServiceMatter()));
}
if (StringUtils.isNotBlank(actPreviewResultDTO.getUnitId())) {

40
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java

@ -25,7 +25,6 @@ import com.epmet.dto.*;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.dto.form.WxSubscribeMessageFormDTO;
import com.epmet.dto.form.demand.SubCodeFormDTO;
import com.epmet.dto.form.work.*;
import com.epmet.dto.result.ActSponsorResultDTO;
import com.epmet.dto.result.demand.OptionDTO;
@ -34,6 +33,7 @@ import com.epmet.entity.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.*;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -99,10 +99,9 @@ public class WorkActServiceImpl implements WorkActService {
@Resource
private IcPartyActivityService icPartyActivityService;
@Resource
private IcResiDemandDictService icResiDemandDictService;
@Resource
private IcPartyUnitService icPartyUnitService;
@Resource
private IcServiceItemDictService icServiceItemDictService;
/**
@ -782,11 +781,10 @@ public class WorkActServiceImpl implements WorkActService {
if (StringUtils.isNotBlank(canceledActDetailResultDTO.getServiceMatter())) {
//获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(customerId);
codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
canceledActDetailResultDTO.setServiceMatterName(categoryMap.get(canceledActDetailResultDTO.getServiceMatter()));
List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(customerId);
Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
canceledActDetailResultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(canceledActDetailResultDTO.getServiceMatter()) ?
categoryMap.get(canceledActDetailResultDTO.getServiceMatter()) : StrConstant.EPMETY_STR);
}
if (StringUtils.isNotBlank(canceledActDetailResultDTO.getUnitId())) {
//获取单位名称
@ -840,11 +838,9 @@ public class WorkActServiceImpl implements WorkActService {
if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) {
//获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(formDTO.getCustomerId());
codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter()));
List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId());
Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(resultDTO.getServiceMatter()) ? categoryMap.get(resultDTO.getServiceMatter()) : StrConstant.EPMETY_STR);
}
if (StringUtils.isNotBlank(resultDTO.getUnitId())) {
//获取单位名称
@ -921,11 +917,9 @@ public class WorkActServiceImpl implements WorkActService {
}
if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) {
//获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(customerId);
codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter()));
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(customerId);
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(resultDTO.getServiceMatter()) ? categoryMap.get(resultDTO.getServiceMatter()) : StrConstant.EPMETY_STR);
}
if (StringUtils.isNotBlank(resultDTO.getUnitId())) {
//获取单位名称
@ -1317,11 +1311,9 @@ public class WorkActServiceImpl implements WorkActService {
if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) {
//获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(customerId);
codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter()));
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(customerId);
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(resultDTO.getServiceMatter()) ? categoryMap.get(resultDTO.getServiceMatter()) : StrConstant.EPMETY_STR);
}
if (StringUtils.isNotBlank(resultDTO.getUnitId())) {
//获取单位名称

49
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.10__update_service_item.sql

@ -0,0 +1,49 @@
-- 服务事项从需求分类字典表中抽离出来了,对应历史数据修改如下
-- 1、联建单位的服务事项置空
update ic_party_unit set SERVICE_MATTER ='';
-- 2、联建活动的服务事项修改为新的编码
update ic_party_activity set SERVICE_MATTER='1006' where SERVICE_MATTER = '10100006';
update ic_party_activity set SERVICE_MATTER='1008' where SERVICE_MATTER = '10100008';
update ic_party_activity set SERVICE_MATTER='1002' where SERVICE_MATTER = '10100002';
update ic_party_activity set SERVICE_MATTER='1009' where SERVICE_MATTER = '10100009';
update ic_party_activity set SERVICE_MATTER='1017' where SERVICE_MATTER = '10100017';
update ic_party_activity set SERVICE_MATTER='1021' where SERVICE_MATTER = '10100021';
update ic_party_activity set SERVICE_MATTER='1015' where SERVICE_MATTER = '10100015';
update ic_party_activity set SERVICE_MATTER='1011' where SERVICE_MATTER = '10100011';
update ic_party_activity set SERVICE_MATTER='1018' where SERVICE_MATTER = '10100018';
update ic_party_activity set SERVICE_MATTER='1005' where SERVICE_MATTER = '10100005';
update ic_party_activity set SERVICE_MATTER='1010' where SERVICE_MATTER = '10100010';
update ic_party_activity set SERVICE_MATTER='1003' where SERVICE_MATTER = '10100003';
update ic_party_activity set SERVICE_MATTER='1020' where SERVICE_MATTER = '10100020';
update ic_party_activity set SERVICE_MATTER='1022' where SERVICE_MATTER = '10100022';
update ic_party_activity set SERVICE_MATTER='1014' where SERVICE_MATTER = '10100014';
update ic_party_activity set SERVICE_MATTER='1007' where SERVICE_MATTER = '10100007';
update ic_party_activity set SERVICE_MATTER='1001' where SERVICE_MATTER = '10100001';
update ic_party_activity set SERVICE_MATTER='1004' where SERVICE_MATTER = '10100004';
update ic_party_activity set SERVICE_MATTER='1016' where SERVICE_MATTER = '10100016';
update ic_party_activity set SERVICE_MATTER='1013' where SERVICE_MATTER = '10100013';
update ic_party_activity set SERVICE_MATTER='1012' where SERVICE_MATTER = '10100012';
update ic_party_activity set SERVICE_MATTER='1019' where SERVICE_MATTER = '10100019';
-- 3、爱心互助-活动类型为联建活动,对应的服务事项编码改为新的
update act_info set SERVICE_MATTER='1006' where ACT_TYPE='party' and SERVICE_MATTER='10100006' ;
update act_info set SERVICE_MATTER='1008' where ACT_TYPE='party' and SERVICE_MATTER='10100008' ;
update act_info set SERVICE_MATTER='1002' where ACT_TYPE='party' and SERVICE_MATTER='10100002' ;
update act_info set SERVICE_MATTER='1009' where ACT_TYPE='party' and SERVICE_MATTER='10100009' ;
update act_info set SERVICE_MATTER='1017' where ACT_TYPE='party' and SERVICE_MATTER='10100017' ;
update act_info set SERVICE_MATTER='1021' where ACT_TYPE='party' and SERVICE_MATTER='10100021' ;
update act_info set SERVICE_MATTER='1015' where ACT_TYPE='party' and SERVICE_MATTER='10100015' ;
update act_info set SERVICE_MATTER='1011' where ACT_TYPE='party' and SERVICE_MATTER='10100011' ;
update act_info set SERVICE_MATTER='1018' where ACT_TYPE='party' and SERVICE_MATTER='10100018' ;
update act_info set SERVICE_MATTER='1005' where ACT_TYPE='party' and SERVICE_MATTER='10100005' ;
update act_info set SERVICE_MATTER='1010' where ACT_TYPE='party' and SERVICE_MATTER='10100010' ;
update act_info set SERVICE_MATTER='1003' where ACT_TYPE='party' and SERVICE_MATTER='10100003' ;
update act_info set SERVICE_MATTER='1020' where ACT_TYPE='party' and SERVICE_MATTER='10100020' ;
update act_info set SERVICE_MATTER='1022' where ACT_TYPE='party' and SERVICE_MATTER='10100022' ;
update act_info set SERVICE_MATTER='1014' where ACT_TYPE='party' and SERVICE_MATTER='10100014' ;
update act_info set SERVICE_MATTER='1007' where ACT_TYPE='party' and SERVICE_MATTER='10100007' ;
update act_info set SERVICE_MATTER='1001' where ACT_TYPE='party' and SERVICE_MATTER='10100001' ;
update act_info set SERVICE_MATTER='1004' where ACT_TYPE='party' and SERVICE_MATTER='10100004' ;
update act_info set SERVICE_MATTER='1016' where ACT_TYPE='party' and SERVICE_MATTER='10100016' ;
update act_info set SERVICE_MATTER='1013' where ACT_TYPE='party' and SERVICE_MATTER='10100013' ;
update act_info set SERVICE_MATTER='1012' where ACT_TYPE='party' and SERVICE_MATTER='10100012' ;
update act_info set SERVICE_MATTER='1019' where ACT_TYPE='party' and SERVICE_MATTER='10100019' ;

117
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.8__service_item_dict.sql

@ -0,0 +1,117 @@
CREATE TABLE `ic_service_item_dict` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id',
`PARENT_CODE` varchar(32) NOT NULL COMMENT '父级,一级默认为0',
`CATEGORY_CODE` varchar(32) NOT NULL COMMENT '分类编码',
`CATEGORY_NAME` varchar(255) NOT NULL COMMENT '分类名称',
`LEVEL` int(11) NOT NULL COMMENT '级别',
`REMARK` varchar(255) DEFAULT NULL COMMENT '备注',
`SORT` int(10) unsigned NOT NULL COMMENT '排序',
`USABLE_FLAG` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1可用,0不可用',
`AWARD_POINT` int(11) NOT NULL COMMENT '奖励积分',
`DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE,
UNIQUE KEY `uk_dict_value` (`CATEGORY_CODE`,`CUSTOMER_ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='服务事项分类字典表';
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1', 'default', '0', '1001', '积极配合社区安全巡查员进行场所消防、安全等方面的检查,并具备必须的安全意识及设备设施', 1, NULL, 1, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('2', 'default', '0', '1002', '积极参与社区举办的各类生产生活安全培训讲座等', 1, NULL, 2, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3', 'default', '0', '1003', '定期开展内部自检自查,安全培训及演练,紧绷安全生产生活弦', 1, NULL, 3, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('4', 'default', '0', '1004', '社区困难群体生活帮扶', 1, NULL, 4, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('5', 'default', '0', '1005', '社区低保、伤残等困难家庭子女学习辅导', 1, NULL, 5, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('6', 'default', '0', '1006', '未成年人兴趣培养', 1, NULL, 6, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('7', 'default', '0', '1007', '楼道基础设施维护', 1, NULL, 7, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('8', 'default', '0', '1008', '健康知识专业讲座', 1, NULL, 8, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('9', 'default', '0', '1009', '老年人现代智能设备培训', 1, NULL, 9, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('10', 'default', '0', '1010', '空巢老人志愿帮扶', 1, NULL, 10, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('11', 'default', '0', '1011', '法律专业问题咨询', 1, NULL, 11, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('12', 'default', '0', '1012', '矛盾调解专业法律顾问', 1, NULL, 12, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('13', 'default', '0', '1013', '居民紧急自救、他救技能', 1, NULL, 13, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('14', 'default', '0', '1014', '少儿安全意识培养', 1, NULL, 14, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('15', 'default', '0', '1015', '文化队伍的培育和提升', 1, NULL, 15, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('16', 'default', '0', '1016', '老年群体的心理辅导', 1, NULL, 16, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('17', 'default', '0', '1017', '丰富多样的文体活动', 1, NULL, 17, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('18', 'default', '0', '1018', '失业人员技能培训', 1, NULL, 18, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('19', 'default', '0', '1019', '青年人文化活动的开展', 1, NULL, 19, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('20', 'default', '0', '1020', '亲子教育课堂', 1, NULL, 20, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('21', 'default', '0', '1021', '未成年人“家风”培育', 1, NULL, 21, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
INSERT INTO `epmet_heart`.`ic_service_item_dict` (`ID`, `CUSTOMER_ID`, `PARENT_CODE`, `CATEGORY_CODE`, `CATEGORY_NAME`, `LEVEL`, `REMARK`, `SORT`, `USABLE_FLAG`, `AWARD_POINT`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('22', 'default', '0', '1022', '和谐邻里活动开展', 1, NULL, 22, 1, 10, 0, 0, 'APP_USER', '2022-01-13 14:37:12', 'APP_USER', '2022-01-13 14:37:12');
-- 共建单位及九小场所共建 统一删除
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于服务事项分类"
where CATEGORY_CODE='1010' or PARENT_CODE='1010';
-- 居民积分统一从需求分类中移除
-- 1、民生服务
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1002' or PARENT_CODE='1002';
-- 2、便民服务
-- 2.1便民服务-参与日常矛盾调解并取得一定成效
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='10030001' or PARENT_CODE='10030001';
-- 2.2便民服务-爱心敲门,自愿与社区高龄、独居、孤寡、残障等人员结对子,参与日常探望、帮扶
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='10030004' or PARENT_CODE='10030004';
-- 2.3便民服务-收集反馈社区特殊群体(高龄、残障、独居等)生活需求,并协助社区共同落实解决。
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='10030005' or PARENT_CODE='10030005';
-- 3、城市建设
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1004' or PARENT_CODE='1004';
-- 4、社区建设
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1005' or PARENT_CODE='1005';
-- 5、社区自治
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1006' or PARENT_CODE='1006';
-- 6、思想建设
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1008' or PARENT_CODE='1008';
-- 7、文化娱乐
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1009' or PARENT_CODE='1009';
-- 8、社会治安
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1013' or PARENT_CODE='1013';
-- 9、消防安全
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1014' or PARENT_CODE='1014';
-- 10、文化体育
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1015' or PARENT_CODE='1015';
-- 11、慈善募捐
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1020' or PARENT_CODE='1020';
-- 12、其他
update ic_resi_demand_dict set DEL_FLAG='1',UPDATED_TIME=NOW(),REMARK="当前分类归属于居民积分"
where CATEGORY_CODE='1022' or PARENT_CODE='1022';
-- 删除需求记录、服务记录、评价记录
update ic_user_demand_rec
set DEL_FLAG='1',UPDATED_TIME=NOW(),UPDATED_BY='删除分类'
where CATEGORY_CODE in (
select distinct m.CATEGORY_CODE
from ic_resi_demand_dict m where m.DEL_FLAG='1'
and m.CUSTOMER_ID!='default'
);
update ic_user_demand_service set DEL_FLAG='1',UPDATED_TIME=NOW()
where DEMAND_REC_ID in(
select m.id from ic_user_demand_rec m where m.DEL_FLAG='1'
);
update ic_user_demand_satisfaction set DEL_FLAG='1',UPDATED_TIME=NOW()
WHERE DEMAND_REC_ID IN(
select m.id from ic_user_demand_rec m where m.DEL_FLAG='1'
);

22
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.9__add_icompletion.sql

@ -0,0 +1,22 @@
CREATE TABLE `ic_party_unit_completion`
(
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
`AGENCY_ID` varchar(64) NOT NULL COMMENT '组织ID',
`PIDS` varchar(255) NOT NULL,
`UNIT_ID` varchar(64) NOT NULL COMMENT '单位ID',
`TYPE` varchar(10) NOT NULL COMMENT '类型 monthly月度,quarter季度',
`SCORE` varchar(5) NOT NULL COMMENT '评分 百分制',
`STATUS` varchar(1) NOT NULL COMMENT '完成情况1已完成,0未完成',
`YEAR` varchar(4) NOT NULL COMMENT '年份',
`MONTH_QUARTER` varchar(4) NOT NULL COMMENT '月或季度',
`RECORD_DATE` varchar(12) NOT NULL COMMENT '时间',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除',
`REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='联建单位完成情况';

27
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitCompletionDao.xml

@ -0,0 +1,27 @@
<?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.IcPartyUnitCompletionDao">
<resultMap type="com.epmet.entity.IcPartyUnitCompletionEntity" id="icPartyUnitCompletionMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="pids" column="PIDS"/>
<result property="unitId" column="UNIT_ID"/>
<result property="type" column="TYPE"/>
<result property="score" column="SCORE"/>
<result property="status" column="STATUS"/>
<result property="year" column="YEAR"/>
<result property="monthQuarter" column="MONTH_QUARTER"/>
<result property="recordDate" column="RECORD_DATE"/>
<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>
</mapper>

34
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceItemDictDao.xml

@ -0,0 +1,34 @@
<?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.IcServiceItemDictDao">
<select id="pageList" parameterType="java.lang.String" resultType="com.epmet.dto.result.demand.ServiceItemResultDTO">
SELECT
d.id AS categoryId,
d.CATEGORY_NAME AS categoryName,
d.AWARD_POINT AS awardPoint,
d.USABLE_FLAG AS usableFlag
FROM
ic_service_item_dict d
WHERE
d.DEL_FLAG = '0'
AND d.CUSTOMER_ID = #{customerId}
ORDER BY
d.SORT DESC
</select>
<select id="selectMax" parameterType="java.lang.String" resultType="com.epmet.entity.IcServiceItemDictEntity">
SELECT
d.ID,
d.CATEGORY_CODE,
d.SORT
FROM
ic_service_item_dict d
WHERE
d.DEL_FLAG = '0'
AND d.CUSTOMER_ID = #{customerId}
order by CATEGORY_CODE desc
limit 1
</select>
</mapper>

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

@ -325,6 +325,13 @@
<if test="null != excludeStatus and excludeStatus !='' ">
and r.STATUS !=#{excludeStatus}
</if>
<if test="null != keyword and keyword != ''">
AND (
r.DEMAND_USER_NAME = #{keyword}
OR match(r.CONTENT) against (#{keyword} in boolean mode )
OR s.SERVER_NAME like CONCAT('%',#{keyword},'%')
)
</if>
order by r.WANT_SERVICE_TIME desc,r.REPORT_TIME asc
</select>
@ -565,4 +572,73 @@
UPDATED_TIME=NOW()
where id=#{demandRecId}
</update>
<select id="getPointRecordList" resultType="com.epmet.dto.result.PointRecordDTO">
SELECT
a.CATEGORY_CODE,
a.DEMAND_USER_NAME,
a.CONTENT,
a.AWARD_POINT AS point,
a.`STATUS`,
c.SCORE,
DATE_FORMAT(c.EVALUATE_TIME, '%Y-%m-%d %H:%i') AS pointTime
FROM
ic_user_demand_rec a
INNER JOIN ic_user_demand_service b ON a.ID = b.DEMAND_REC_ID AND b.SERVICE_TYPE = #{serviceType}
AND b.SERVER_ID = #{serviceId} AND b.DEL_FLAG = '0'
INNER JOIN ic_user_demand_satisfaction c ON a.ID = c.DEMAND_REC_ID AND c.DEL_FLAG = '0'
WHERE
a.DEL_FLAG = '0'
AND a.`STATUS` = 'finished'
AND a.EVALUATE_FLAG = 1
and a.FINISH_RESULT='resolved'
<if test="null != startTime">
AND c.EVALUATE_TIME &gt;= #{startTime}
</if>
<if test="null != endTime">
AND c.EVALUATE_TIME &lt;= #{endTime}
</if>
ORDER BY c.EVALUATE_TIME DESC
</select>
<select id="getTotalPoint" resultType="java.lang.Integer">
SELECT
SUM(a.AWARD_POINT)
FROM
ic_user_demand_rec a
INNER JOIN ic_user_demand_service b ON a.ID = b.DEMAND_REC_ID AND b.SERVICE_TYPE = #{serviceType}
AND b.SERVER_ID = #{serviceId} AND b.DEL_FLAG = '0'
INNER JOIN ic_user_demand_satisfaction c ON a.ID = c.DEMAND_REC_ID AND c.DEL_FLAG = '0'
WHERE
a.DEL_FLAG = '0'
AND a.`STATUS` = 'finished'
AND a.EVALUATE_FLAG = 1
and a.FINISH_RESULT='resolved'
<if test="null != startTime">
AND c.EVALUATE_TIME &gt;= #{startTime}
</if>
<if test="null != endTime">
AND c.EVALUATE_TIME &lt;= #{endTime}
</if>
</select>
<select id="getServicePoint" resultType="com.epmet.dto.result.ServicePointDTO">
SELECT
b.SERVER_ID,
SUM( a.AWARD_POINT ) AS point
FROM
ic_user_demand_rec a
INNER JOIN ic_user_demand_service b ON a.ID = b.DEMAND_REC_ID
AND b.SERVICE_TYPE = #{serviceType}
AND b.DEL_FLAG = '0'
INNER JOIN ic_user_demand_satisfaction c ON a.ID = c.DEMAND_REC_ID
AND c.DEL_FLAG = '0'
WHERE
a.DEL_FLAG = '0'
AND a.`STATUS` = 'finished'
AND a.EVALUATE_FLAG = 1
and a.FINISH_RESULT='resolved'
AND b.CUSTOMER_ID = #{customerId}
GROUP BY
b.SERVER_ID
</select>
</mapper>

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

Loading…
Cancel
Save