Browse Source

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

master
yinzuomei 5 years ago
parent
commit
906cc8957c
  1. 5
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java
  2. 6
      epmet-gateway/pom.xml
  3. 11
      epmet-gateway/src/main/resources/bootstrap.yml
  4. 25
      epmet-module/gov-grid/gov-grid-client/pom.xml
  5. 0
      epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/.gitkeep
  6. 0
      epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/.gitkeep
  7. 0
      epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/.gitkeep
  8. 11
      epmet-module/gov-grid/gov-grid-server/Dockerfile
  9. 15
      epmet-module/gov-grid/gov-grid-server/docker-compose.yml
  10. 169
      epmet-module/gov-grid/gov-grid-server/pom.xml
  11. 23
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/GovGridApplication.java
  12. 26
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/config/ModuleConfigImpl.java
  13. 68
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/config/SwaggerConfig.java
  14. 126
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java
  15. 88
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiWarmheartedController.java
  16. 0
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/dao/.gitkeep
  17. 0
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/entity/.gitkeep
  18. 0
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/excel/.gitkeep
  19. 16
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/exception/ModuleErrorCode.java
  20. 94
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java
  21. 66
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java
  22. 0
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/.gitkeep
  23. 88
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java
  24. 46
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java
  25. 0
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/redis/.gitkeep
  26. 81
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiGroupService.java
  27. 61
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiWarmheartedService.java
  28. 65
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiGroupServiceImpl.java
  29. 78
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiWarmheartedServiceImpl.java
  30. 10
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/util/ModuleConstant.java
  31. 71
      epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml
  32. 159
      epmet-module/gov-grid/gov-grid-server/src/main/resources/logback-spring.xml
  33. 0
      epmet-module/gov-grid/gov-grid-server/src/main/resources/mapper/.gitkeep
  34. 20
      epmet-module/gov-grid/pom.xml
  35. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java
  36. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java
  37. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java
  38. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ModuleConstant.java
  39. 1
      epmet-module/pom.xml
  40. 5
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java
  41. 10
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupOperationDTO.java
  42. 47
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyingGroupsFormDTO.java
  43. 29
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGroupIdFromDTO.java
  44. 19
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GovGroupSummarizeFromDTO.java
  45. 36
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupAuditedFromDTO.java
  46. 78
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupDetailResultDTO.java
  47. 50
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupResultDTO.java
  48. 43
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GovGroupSummarizeResultDTO.java
  49. 45
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupAuditedResultDTO.java
  50. 41
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupsInGridResultDTO.java
  51. 91
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java
  52. 33
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java
  53. 10
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupOperationEntity.java
  54. 83
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java
  55. 55
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java
  56. 217
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  57. 82
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java
  58. 5
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java
  59. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java
  60. 10
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  61. 40
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java
  62. 7
      epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/db.sql
  63. 85
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml
  64. 5
      epmet-module/resi-guide/resi-guide-server/pom.xml
  65. 1
      epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java
  66. 1
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java
  67. 10
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/ResiWarmheartedApplyDTO.java
  68. 51
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditApproveFormDTO.java
  69. 66
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditFormDTO.java
  70. 22
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditRejectFormDTO.java
  71. 42
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmGetDetailFormDTO.java
  72. 31
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedAuditedFromDTO.java
  73. 10
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedSubmitFormDTO.java
  74. 106
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/result/ResiWarmAuditResultDTO.java
  75. 46
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/result/ResiWarmheartedAuditedResultDTO.java
  76. 12
      epmet-module/resi-partymember/resi-partymember-server/pom.xml
  77. 12
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetMessageFeignClient.java
  78. 17
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java
  79. 35
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/GovOrgFeignClient.java
  80. 6
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetMessageFeignClientFallback.java
  81. 8
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetUserFeignClientFallBack.java
  82. 28
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/GovOrgFeignClientFallBack.java
  83. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java
  84. 136
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java
  85. 29
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/constant/ResiWarmUserMessageConstant.java
  86. 18
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/constant/ResiWarmheartedVisitConstant.java
  87. 176
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedApplyController.java
  88. 14
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/dao/ResiWarmheartedApplyDao.java
  89. 10
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/entity/ResiWarmheartedApplyEntity.java
  90. 6
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/excel/ResiWarmheartedApplyExcel.java
  91. 44
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java
  92. 579
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java
  93. 42
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/warmhearted/ResiWarmheartedApplyDao.xml
  94. 5
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/redis/migration/db.sql
  95. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java

5
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java

@ -73,4 +73,9 @@ public interface ServiceConstant {
* 消息服务
*/
String EPMET_MESSAGE_SERVER = "epmet-message-server";
/**
* 楼院小组
*/
String RESI_GROUP_SERVER ="resi-group-server";
}

6
epmet-gateway/pom.xml

@ -154,6 +154,8 @@
<gateway.routes.resi-group-server.uri>http://127.0.0.1:8095</gateway.routes.resi-group-server.uri>
<!-- 17、党员认证、热心居民申请 -->
<gateway.routes.resi-partymember-server.uri>http://127.0.0.1:8096</gateway.routes.resi-partymember-server.uri>
<!-- 18、政府端网格管理 -->
<gateway.routes.gov-grid-server.uri>http://127.0.0.1:8097</gateway.routes.gov-grid-server.uri>
<!-- <gateway.routes.resi-partymember-server.uri>lb://resi-partymember-server</gateway.routes.resi-partymember-server.uri>-->
</properties>
</profile>
@ -211,6 +213,8 @@
<gateway.routes.resi-group-server.uri>lb://resi-group-server</gateway.routes.resi-group-server.uri>
<!-- 17、党员认证、热心居民申请 -->
<gateway.routes.resi-partymember-server.uri>lb://resi-partymember-server</gateway.routes.resi-partymember-server.uri>
<!-- 18、政府端网格管理 -->
<gateway.routes.gov-grid-server.uri>lb://gov-grid-server</gateway.routes.gov-grid-server.uri>
</properties>
</profile>
<profile>
@ -267,6 +271,8 @@
<gateway.routes.resi-group-server.uri>lb://resi-group-server</gateway.routes.resi-group-server.uri>
<!-- 17、党员认证、热心居民申请 -->
<gateway.routes.resi-partymember-server.uri>lb://resi-partymember-server</gateway.routes.resi-partymember-server.uri>
<!-- 18、政府端网格管理 -->
<gateway.routes.gov-grid-server.uri>lb://gov-grid-server</gateway.routes.gov-grid-server.uri>
</properties>
</profile>
</profiles>

11
epmet-gateway/src/main/resources/bootstrap.yml

@ -167,6 +167,15 @@ spring:
filters:
- StripPrefix=1
- CpAuth=true
#政府端网格管理
- id: gov-grid-server
uri: @gateway.routes.gov-grid-server.uri@
order: 18
predicates:
- Path=${server.servlet.context-path}/gov/grid/**
filters:
- StripPrefix=1
- CpAuth=true
nacos:
discovery:
server-addr: @nacos.server-addr@
@ -206,6 +215,7 @@ renren:
- /resi/mine/**
- /resi/group/**
- /resi/partymember/**
- /gov/grid/**
management:
endpoints:
web:
@ -272,6 +282,7 @@ epmet:
- /resi/mine/**
- /resi/group/**
- /resi/partymember/**
- /gov/grid/**
swaggerUrls:
jwt:

25
epmet-module/gov-grid/gov-grid-client/pom.xml

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>gov-grid</artifactId>
<groupId>com.epmet</groupId>
<version>2.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>gov-grid-client</artifactId>
<dependencies>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies>
</project>

0
epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/.gitkeep

0
epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/.gitkeep

0
epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/.gitkeep

11
epmet-module/gov-grid/gov-grid-server/Dockerfile

@ -0,0 +1,11 @@
FROM java:8
RUN export LANG="zh_CN.UTF-8"
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' > /etc/timezone
COPY ./target/*.jar ./app.jar
EXPOSE 8097
ENTRYPOINT ["java","-Xms32m","-Xmx200m","-jar","./app.jar"]

15
epmet-module/gov-grid/gov-grid-server/docker-compose.yml

@ -0,0 +1,15 @@
version: "3.7"
services:
gov-grid-server:
container_name: gov-grid-server-dev
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-grid-server:0.3.0
ports:
- "8097:8097"
network_mode: host # 使用现有网络
volumes:
- "/opt/epmet-cloud-logs/dev:/logs"
deploy:
resources:
limits:
cpus: '0.1'
memory: 250M

169
epmet-module/gov-grid/gov-grid-server/pom.xml

@ -0,0 +1,169 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.0</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>gov-grid</artifactId>
<version>2.0.0</version>
</parent>
<artifactId>gov-grid-server</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>gov-grid-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- 替换Feign原生httpclient -->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
<version>10.3.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>gov-org-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>resi-partymember-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>resi-group-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
<resources>
<resource>
<filtering>true</filtering>
<directory>${basedir}/src/main/resources</directory>
</resource>
</resources>
</build>
<profiles>
<profile>
<id>dev-local</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<server.port>8097</server.port>
<spring.profiles.active>dev</spring.profiles.active>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>127.0.0.1</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>123456</spring.redis.password>
<!-- nacos -->
<nacos.register-enabled>false</nacos.register-enabled>
<nacos.server-addr>122.152.200.70:8848</nacos.server-addr>
<nacos.discovery.namespace>fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b</nacos.discovery.namespace>
<nacos.config.namespace></nacos.config.namespace>
<nacos.config.group></nacos.config.group>
<nacos.config-enabled>false</nacos.config-enabled>
<nacos.ip/>
</properties>
</profile>
<profile>
<id>dev</id>
<!--<activation>
<activeByDefault>true</activeByDefault>
</activation>-->
<properties>
<server.port>8097</server.port>
<spring.profiles.active>dev</spring.profiles.active>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>EpmEtrEdIs!q@w</spring.redis.password>
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>192.168.10.150:8848</nacos.server-addr>
<nacos.discovery.namespace>67e3c350-533e-4d7c-9f8f-faf1b4aa82ae</nacos.discovery.namespace>
<nacos.config.namespace></nacos.config.namespace>
<nacos.config.group></nacos.config.group>
<nacos.config-enabled>false</nacos.config-enabled>
<nacos.ip/>
</properties>
</profile>
<profile>
<id>test</id>
<!--<activation>
<activeByDefault>true</activeByDefault>
</activation>-->
<properties>
<server.port>8097</server.port>
<spring.profiles.active>test</spring.profiles.active>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>10.10.10.248</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>123456</spring.redis.password>
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>122.152.200.70:8848</nacos.server-addr>
<nacos.discovery.namespace>fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b</nacos.discovery.namespace>
<nacos.config.namespace></nacos.config.namespace>
<nacos.config.group></nacos.config.group>
<nacos.config-enabled>false</nacos.config-enabled>
<nacos.ip/>
</properties>
</profile>
</profiles>
</project>

23
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/GovGridApplication.java

@ -0,0 +1,23 @@
package com.epmet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
/**
*
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
public class GovGridApplication {
public static void main(String[] args) {
SpringApplication.run(GovGridApplication.class, args);
}
}

26
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/config/ModuleConfigImpl.java

@ -0,0 +1,26 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有侵权必究
*/
package com.epmet.config;
import com.epmet.commons.tools.config.ModuleConfig;
import org.springframework.stereotype.Service;
/**
* 模块配置信息
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@Service
public class ModuleConfigImpl implements ModuleConfig {
@Override
public String getName() {
return "govgrid";
}
}

68
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/config/SwaggerConfig.java

@ -0,0 +1,68 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有侵权必究
*/
package com.epmet.config;
import com.epmet.commons.tools.constant.Constant;
import io.swagger.annotations.ApiOperation;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.ApiKey;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.List;
import static com.google.common.collect.Lists.newArrayList;
/**
* Swagger配置
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
//加了ApiOperation注解的类,才生成接口文档
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
//包下的类,才生成接口文档
//.apis(RequestHandlerSelectors.basePackage("io.renren.controller"))
.paths(PathSelectors.any())
.build()
.directModelSubstitute(java.util.Date.class, String.class)
.securitySchemes(security());
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("人人开源")
.description("系统模块开发文档")
.termsOfServiceUrl("https://www.renren.io/community")
.version("1.4.0")
.build();
}
private List<ApiKey> security() {
return newArrayList(
new ApiKey(Constant.TOKEN_HEADER, Constant.TOKEN_HEADER, "header")
);
}
}

126
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiGroupController.java

@ -0,0 +1,126 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.ApplyingGroupDetailResultDTO;
import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.resi.group.dto.group.form.GovGroupSummarizeFromDTO;
import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO;
import com.epmet.resi.group.dto.group.result.GovGroupSummarizeResultDTO;
import com.epmet.resi.group.dto.group.result.GroupAuditedResultDTO;
import com.epmet.resi.group.dto.group.result.GroupsInGridResultDTO;
import com.epmet.service.ResiGroupService;
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;
/**
* @Description 政府端管理楼院小组业务
* @ClassName ResiGroupController
* @Author wangc
* @date 2020.04.16 15:30
*/
@RestController
@RequestMapping("resi/group")
public class ResiGroupController {
@Autowired
ResiGroupService resiGroupService;
/**
* 小组审核历史列表
*
* @param formDTO 参数
* @return
*/
@PostMapping("audited")
public Result<List<GroupAuditedResultDTO>> audited(@RequestBody GroupAuditedFromDTO formDTO) {
return resiGroupService.audited(formDTO);
}
/**
* 本网格小组列表
*
* @param formDTO 参数
* @return Result<List < GroupAuditedResultDTO>>
*/
@PostMapping("groupsingrid")
public Result<List<GroupsInGridResultDTO>> getGroupsInGrid(GroupAuditedFromDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return resiGroupService.getGroupsInGrid(formDTO);
}
/**
* 小组管理界面信息
*
* @param formDTO 参数
* @return Result<GovGroupSummarizeResultDTO>
*/
@PostMapping("getgroupsummarize")
public Result<GovGroupSummarizeResultDTO> getGroupSummarize(GovGroupSummarizeFromDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return resiGroupService.getGroupSummarize(formDTO);
}
/**
* @Description 查询小组待审核列表
* @Param ApplyingGroupsFormDTO.class
* @return Result<List<ApplyingGroupResultDTO>>
* @Author wangc
* @Date 2020.04.20 13:59
**/
@PostMapping("auditing")
public Result<List<ApplyingGroupResultDTO>> auditing(@LoginUser TokenDto tokenDto, @RequestBody ApplyingGroupsFormDTO applyingGroupsFormDTO){
applyingGroupsFormDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(applyingGroupsFormDTO);
return resiGroupService.auditing(applyingGroupsFormDTO);
}
/**
* @Description 得到待审核/未审核小组信息的详情
* @Param CommonGroupIdFromDTO -> String groupId
* @return Result<ApplyingGroupDetailResultDTO>
* @Author wangc
* @Date 2020.04.20 14:08
**/
@PostMapping("applygroupdetail")
public Result<ApplyingGroupDetailResultDTO> applyGroupDetail(@LoginUser TokenDto tokenDto, @RequestBody CommonGroupIdFromDTO groupIdFromDTO){
groupIdFromDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(groupIdFromDTO);
return resiGroupService.applyGroupDetail(groupIdFromDTO);
}
/**
* @Description 建组申请-审核通过
* @Param AgreeApplyGroupFormDTO
* @return Result
* @Author wangc
* @Date 2020.04.20 14:25
**/
@PostMapping("approve")
public Result agreeApplying(@LoginUser TokenDto tokenDto, @RequestBody AgreeApplyGroupFormDTO agreeApplyGroupFormDTO){
agreeApplyGroupFormDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(agreeApplyGroupFormDTO);
return resiGroupService.agreeApplying(agreeApplyGroupFormDTO);
}
/**
* @Description 建组申请-审核驳回
* @Param DisAgreeApplyGroupFormDTO
* @return Result
* @Author wangc
* @Date 2020.04.20 14:26
**/
@PostMapping("reject")
public Result disagreeApplying(@LoginUser TokenDto tokenDto, @RequestBody DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO){
disAgreeApplyGroupFormDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(disAgreeApplyGroupFormDTO);
return resiGroupService.disagreeApplying(disAgreeApplyGroupFormDTO);
}
}

88
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiWarmheartedController.java

@ -0,0 +1,88 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.resi.partymember.dto.warmhearted.form.*;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO;
import com.epmet.service.ResiWarmheartedService;
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;
/**
* @Description 政府端管理热心居民业务
* @ClassName ResiWarmheartedController
* @Author wangc
* @date 2020.04.16 15:30
*/
@RestController
@RequestMapping("resi/warmhearted")
public class ResiWarmheartedController {
@Autowired
private ResiWarmheartedService resiWarmheartedService;
/**
* 热心居民审核历史列表
*
* @param formDTO 参数
* @return
*/
@PostMapping("audited")
public Result<List<ResiWarmheartedAuditedResultDTO>> audited(@RequestBody ResiWarmheartedAuditedFromDTO formDTO) {
return resiWarmheartedService.audited(formDTO);
}
/**
* @param
* @Author sun
* @Description 政府端-获取待审核的热心居民申请列表
**/
@PostMapping("auditing")
public Result<List<ResiWarmAuditResultDTO>> auditing(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmAuditFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return resiWarmheartedService.auditing(formDTO);
}
/**
* @param
* @Author sun
* @Description 政府端-热心居民申请-审核通过
**/
@PostMapping("approve")
public Result approve(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmAuditApproveFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return resiWarmheartedService.approve(formDTO);
}
/**
* @param
* @Author sun
* @Description 政府端-热心居民申请-审核驳回
**/
@PostMapping("reject")
public Result reject(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmAuditRejectFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return resiWarmheartedService.reject(formDTO);
}
/**
* @param
* @Author sun
* @Description 政府端-热心居民申请详情信息
**/
@PostMapping("getdetail")
public Result<ResiWarmAuditResultDTO> getDetail(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmGetDetailFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return resiWarmheartedService.getDetail(formDTO);
}
}

0
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/dao/.gitkeep

0
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/entity/.gitkeep

0
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/excel/.gitkeep

16
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/exception/ModuleErrorCode.java

@ -0,0 +1,16 @@
package com.epmet.exception;
import com.epmet.commons.tools.exception.ErrorCode;
/**
* 模块错误编码由9位数字组成前6位为模块编码后3位为业务编码
* <p>
* 100001001100001代表模块001代表业务代码
* </p>
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
public interface ModuleErrorCode extends ErrorCode {
}

94
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java

@ -0,0 +1,94 @@
package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.feign.fallback.ResiGroupFeignClientFallBack;
import com.epmet.resi.group.dto.group.form.GovGroupSummarizeFromDTO;
import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO;
import com.epmet.resi.group.dto.group.result.GovGroupSummarizeResultDTO;
import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.ApplyingGroupDetailResultDTO;
import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO;
import com.epmet.resi.group.dto.group.result.GroupAuditedResultDTO;
import com.epmet.resi.group.dto.group.result.GroupsInGridResultDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/4/17 15:24
*/
@FeignClient(name = ServiceConstant.RESI_GROUP_SERVER, fallback = ResiGroupFeignClientFallBack.class)
public interface ResiGroupFeignClient {
/**
* 小组审核历史列表
*
* @param formDTO 参数
* @return Result<List < GroupAuditedResultDTO>>
*/
@PostMapping("/resi/group/group/audited")
Result<List<GroupAuditedResultDTO>> audited(GroupAuditedFromDTO formDTO);
/**
* 本网格小组列表
*
* @param formDTO 参数
* @return Result<List < GroupAuditedResultDTO>>
*/
@PostMapping("/resi/group/group/groupsingrid")
Result<List<GroupsInGridResultDTO>> getGroupsInGrid(GroupAuditedFromDTO formDTO);
/**
* 小组管理界面信息
*
* @param formDTO 参数
* @return Result<GovGroupSummarizeResultDTO>
*/
@PostMapping("/resi/group/group/getgovgroupsummarize")
Result<GovGroupSummarizeResultDTO> getGovGroupSummarize(GovGroupSummarizeFromDTO formDTO);
/**
* @Description 得到小组待审核列表用户信息不注入TokenDTO通过外部服务调用直接传入参数
* @Param ApplyingGroupsFormDTO.class
* @return Result<List<ApplyingGroupResultDTO>>
* @Author wangc
* @Date 2020.04.20 13:59
**/
@PostMapping("/resi/group/group/getapplyinggroups")
Result<List<ApplyingGroupResultDTO>> getApplyingGroups(ApplyingGroupsFormDTO applyingGroupsFormDTO);
/**
* @Description 得到待审核/未审核小组信息的详情
* @Param CommonGroupIdFromDTO -> String groupId
* @return Result<ApplyingGroupDetailResultDTO>
* @Author wangc
* @Date 2020.04.20 14:08
**/
@PostMapping("/resi/group/group/getapplyinggroupdetail")
Result<ApplyingGroupDetailResultDTO> getApplyingGroupDetail(CommonGroupIdFromDTO groupId);
/**
* @Description 建组申请-审核通过
* @Param AgreeApplyGroupFormDTO
* @return Result
* @Author wangc
* @Date 2020.04.20 14:25
**/
@PostMapping("/resi/group/group/agreeapplying")
Result agreeApplying(AgreeApplyGroupFormDTO agreeApplyGroupFormDTO);
/**
* @Description 建组申请-审核驳回
* @Param DisAgreeApplyGroupFormDTO
* @return Result
* @Author wangc
* @Date 2020.04.20 14:26
**/
@PostMapping("/resi/group/group/disagreeapplying")
Result disagreeApplying(DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO);
}

66
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java

@ -0,0 +1,66 @@
package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.feign.fallback.ResiPartymemberFeignClientFallBack;
import com.epmet.resi.partymember.dto.warmhearted.form.*;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* 调用epmet-user服务
*
* @author 赵奇风
*/
@FeignClient(name = ServiceConstant.RESI_PARTYMEMBER_SERVER, fallback = ResiPartymemberFeignClientFallBack.class)
public interface ResiPartymemberFeignClient {
/**
* 居民端-热心居民申请-提交申请数据
*
* @author zhaoqf
**/
@PostMapping(value = "resi/partymember/resiwarmheartedapply/audited")
Result<List<ResiWarmheartedAuditedResultDTO>> audited(@RequestBody ResiWarmheartedAuditedFromDTO formDTO);
/**
* 政府端-获取待审核的热心居民申请列表
* @param
* @return void
* @author sun
*/
@PostMapping(value = "resi/partymember/resiwarmheartedapply/auditing")
Result<List<ResiWarmAuditResultDTO>> auditing(@RequestBody ResiWarmAuditFormDTO formDTO);
/**
* 政府端-热心居民申请-审核通过
* @param
* @return void
* @author sun
*/
@PostMapping(value = "resi/partymember/resiwarmheartedapply/approve")
Result approve(@RequestBody ResiWarmAuditApproveFormDTO formDTO);
/**
* 政府端-热心居民申请-审核驳回
* @param
* @return void
* @author sun
*/
@PostMapping(value = "resi/partymember/resiwarmheartedapply/reject")
Result reject(@RequestBody ResiWarmAuditRejectFormDTO formDTO);
/**
* 政府端-获取待审核的热心居民申请列表
* @param
* @return void
* @author sun
*/
@PostMapping(value = "resi/partymember/resiwarmheartedapply/getdetail")
Result<ResiWarmAuditResultDTO> getDetail(@RequestBody ResiWarmGetDetailFormDTO formDTO);
}

0
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/.gitkeep

88
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java

@ -0,0 +1,88 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.feign.ResiGroupFeignClient;
import com.epmet.resi.group.dto.group.form.GovGroupSummarizeFromDTO;
import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO;
import com.epmet.resi.group.dto.group.result.GovGroupSummarizeResultDTO;
import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.ApplyingGroupDetailResultDTO;
import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO;
import com.epmet.resi.group.dto.group.result.GroupAuditedResultDTO;
import com.epmet.resi.group.dto.group.result.GroupsInGridResultDTO;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/4/17 15:27
*/
@Component
public class ResiGroupFeignClientFallBack implements ResiGroupFeignClient {
@Override
public Result<List<GroupAuditedResultDTO>> audited(GroupAuditedFromDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "audited", formDTO);
}
@Override
public Result<List<GroupsInGridResultDTO>> getGroupsInGrid(GroupAuditedFromDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getGroupsInGrid", formDTO);
}
@Override
public Result<GovGroupSummarizeResultDTO> getGovGroupSummarize(GovGroupSummarizeFromDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getGovGroupSummarize", formDTO);
}
/**
* @Description 得到小组待审核列表用户信息不注入TokenDTO通过外部服务调用直接传入参数
* @Param ApplyingGroupsFormDTO.class
* @return Result<List<ApplyingGroupResultDTO>>
* @Author wangc
* @Date 2020.04.20 13:59
**/
@Override
public Result<List<ApplyingGroupResultDTO>> getApplyingGroups(ApplyingGroupsFormDTO applyingGroupsFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getApplyingGroups", applyingGroupsFormDTO);
}
/**
* @Description 得到待审核/未审核小组信息的详情
* @Param CommonGroupIdFromDTO -> String groupId
* @return Result<ApplyingGroupDetailResultDTO>
* @Author wangc
* @Date 2020.04.20 14:08
**/
@Override
public Result<ApplyingGroupDetailResultDTO> getApplyingGroupDetail(CommonGroupIdFromDTO groupId) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getApplyingGroupDetail", groupId);
}
/**
* @Description 建组申请-审核通过
* @Param AgreeApplyGroupFormDTO
* @return Result
* @Author wangc
* @Date 2020.04.20 14:25
**/
@Override
public Result agreeApplying(AgreeApplyGroupFormDTO agreeApplyGroupFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "agreeApplying", agreeApplyGroupFormDTO);
}
/**
* @Description 建组申请-审核驳回
* @Param DisAgreeApplyGroupFormDTO
* @return Result
* @Author wangc
* @Date 2020.04.20 14:26
**/
@Override
public Result disagreeApplying(DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "disagreeApplying", disAgreeApplyGroupFormDTO);
}
}

46
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java

@ -0,0 +1,46 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.feign.ResiPartymemberFeignClient;
import com.epmet.resi.partymember.dto.warmhearted.form.*;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/4/16 17:01
*/
@Component
public class ResiPartymemberFeignClientFallBack implements ResiPartymemberFeignClient {
@Override
public Result<List<ResiWarmheartedAuditedResultDTO>> audited(ResiWarmheartedAuditedFromDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "audited", formDTO);
}
@Override
public Result<List<ResiWarmAuditResultDTO>> auditing(ResiWarmAuditFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "auditing", formDTO);
}
@Override
public Result approve(ResiWarmAuditApproveFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "approve", formDTO);
}
@Override
public Result reject(ResiWarmAuditRejectFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "reject", formDTO);
}
@Override
public Result<ResiWarmAuditResultDTO> getDetail(ResiWarmGetDetailFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "getDetail", formDTO);
}
}

0
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/redis/.gitkeep

81
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiGroupService.java

@ -0,0 +1,81 @@
package com.epmet.service;
import com.epmet.commons.tools.utils.Result;
import com.epmet.resi.group.dto.group.form.GovGroupSummarizeFromDTO;
import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO;
import com.epmet.resi.group.dto.group.result.GovGroupSummarizeResultDTO;
import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.ApplyingGroupDetailResultDTO;
import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO;
import com.epmet.resi.group.dto.group.result.GroupAuditedResultDTO;
import com.epmet.resi.group.dto.group.result.GroupsInGridResultDTO;
import java.util.List;
/**
* @Description
* @IntefaceName ResiGroupService
* @Author wangc
* @date 2020.04.16 15:40
*/
public interface ResiGroupService {
/**
* 小组审核历史列表
* @param formDTO 参数
* @return Result<List<GroupAuditedResultDTO>>
*/
Result<List<GroupAuditedResultDTO>> audited(GroupAuditedFromDTO formDTO);
/**
* 本网格小组列表
*
* @param formDTO 参数
* @return Result<List<GroupsInGridResultDTO>>
*/
Result<List<GroupsInGridResultDTO>> getGroupsInGrid(GroupAuditedFromDTO formDTO);
/**
* 小组管理界面信息
*
* @param formDTO 参数
* @return Result<GovGroupSummarizeResultDTO>
*/
Result<GovGroupSummarizeResultDTO> getGroupSummarize(GovGroupSummarizeFromDTO formDTO);
/**
* @Description 查询小组待审核列表-调用resi-group服务
* @Param ApplyingGroupsFormDTO.class
* @return Result<List<ApplyingGroupResultDTO>>
* @Author wangc
* @Date 2020.04.20 13:59
**/
Result<List<ApplyingGroupResultDTO>> auditing(ApplyingGroupsFormDTO applyingGroupsFormDTO);
/**
* @Description 得到待审核/未审核小组信息的详情-调用resi-group服务
* @Param CommonGroupIdFromDTO -> String groupId
* @return Result<ApplyingGroupDetailResultDTO>
* @Author wangc
* @Date 2020.04.20 14:08
**/
Result<ApplyingGroupDetailResultDTO> applyGroupDetail(CommonGroupIdFromDTO groupIdFromDTO);
/**
* @Description 建组申请-审核通过-调用resi-group服务
* @Param AgreeApplyGroupFormDTO
* @return Result
* @Author wangc
* @Date 2020.04.20 14:25
**/
Result agreeApplying(AgreeApplyGroupFormDTO agreeApplyGroupFormDTO);
/**
* @Description 建组申请-审核驳回-调用resi-group服务
* @Param DisAgreeApplyGroupFormDTO
* @return Result
* @Author wangc
* @Date 2020.04.20 14:26
**/
Result disagreeApplying(DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO);
}

61
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/ResiWarmheartedService.java

@ -0,0 +1,61 @@
package com.epmet.service;
import com.epmet.commons.tools.utils.Result;
import com.epmet.resi.partymember.dto.warmhearted.form.*;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description
* @IntefaceName ResiWarmheartedService
* @Author wangc
* @date 2020.04.16 15:37
*/
@Service
public interface ResiWarmheartedService {
/**
* 热心居民审核历史列表
* @param formDTO 参数
* @return ResiWarmheartedAuditedResultDTO
*/
Result<List<ResiWarmheartedAuditedResultDTO>> audited(ResiWarmheartedAuditedFromDTO formDTO);
/**
* 政府端-获取待审核的热心居民申请列表
*
* @param
* @return void
* @author sun
*/
Result<List<ResiWarmAuditResultDTO>> auditing(ResiWarmAuditFormDTO formDTO);
/**
* 政府端-热心居民申请-审核通过
*
* @param
* @return void
* @author sun
*/
Result approve(ResiWarmAuditApproveFormDTO formDTO);
/**
* 政府端-热心居民申请-审核驳回
*
* @param
* @return void
* @author sun
*/
Result reject(ResiWarmAuditRejectFormDTO formDTO);
/**
* 政府端-热心居民申请详情信息
*
* @param
* @return void
* @author sun
*/
Result<ResiWarmAuditResultDTO> getDetail(ResiWarmGetDetailFormDTO formDTO);
}

65
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiGroupServiceImpl.java

@ -0,0 +1,65 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.utils.Result;
import com.epmet.feign.ResiGroupFeignClient;
import com.epmet.resi.group.dto.group.form.GovGroupSummarizeFromDTO;
import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO;
import com.epmet.resi.group.dto.group.result.GovGroupSummarizeResultDTO;
import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.ApplyingGroupDetailResultDTO;
import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO;
import com.epmet.resi.group.dto.group.result.GroupAuditedResultDTO;
import com.epmet.resi.group.dto.group.result.GroupsInGridResultDTO;
import com.epmet.service.ResiGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description
* @ClassName ResiGroupServiceImpl
* @Author wangc
* @date 2020.04.16 15:38
*/
@Service
public class ResiGroupServiceImpl implements ResiGroupService{
@Autowired
private ResiGroupFeignClient resiGroupFeignClient;
@Override
public Result<List<GroupAuditedResultDTO>> audited(GroupAuditedFromDTO formDTO) {
return resiGroupFeignClient.audited(formDTO);
}
@Override
public Result<List<GroupsInGridResultDTO>> getGroupsInGrid(GroupAuditedFromDTO formDTO) {
return resiGroupFeignClient.getGroupsInGrid(formDTO);
}
@Override
public Result<GovGroupSummarizeResultDTO> getGroupSummarize(GovGroupSummarizeFromDTO formDTO) {
return resiGroupFeignClient.getGovGroupSummarize(formDTO);
}
@Override
public Result<List<ApplyingGroupResultDTO>> auditing(ApplyingGroupsFormDTO applyingGroupsFormDTO) {
return resiGroupFeignClient.getApplyingGroups(applyingGroupsFormDTO);
}
@Override
public Result<ApplyingGroupDetailResultDTO> applyGroupDetail(CommonGroupIdFromDTO groupIdFromDTO) {
return resiGroupFeignClient.getApplyingGroupDetail(groupIdFromDTO);
}
@Override
public Result agreeApplying(AgreeApplyGroupFormDTO agreeApplyGroupFormDTO) {
return resiGroupFeignClient.agreeApplying(agreeApplyGroupFormDTO);
}
@Override
public Result disagreeApplying(DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO) {
return resiGroupFeignClient.disagreeApplying(disAgreeApplyGroupFormDTO);
}
}

78
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiWarmheartedServiceImpl.java

@ -0,0 +1,78 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.utils.Result;
import com.epmet.feign.ResiPartymemberFeignClient;
import com.epmet.resi.partymember.dto.warmhearted.form.*;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO;
import com.epmet.service.ResiWarmheartedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description
* @ClassName ResiWarmheartedServiceImpl
* @Author wangc
* @date 2020.04.16 15:41
*/
@Service
public class ResiWarmheartedServiceImpl implements ResiWarmheartedService {
@Autowired
private ResiPartymemberFeignClient resiPartymemberFeignClient;
@Override
public Result<List<ResiWarmheartedAuditedResultDTO>> audited(ResiWarmheartedAuditedFromDTO formDTO) {
return resiPartymemberFeignClient.audited(formDTO);
}
/**
* 政府端-获取待审核的热心居民申请列表
*
* @param
* @return void
* @author sun
*/
@Override
public Result<List<ResiWarmAuditResultDTO>> auditing(ResiWarmAuditFormDTO formDTO) {
return resiPartymemberFeignClient.auditing(formDTO);
}
/**
* 政府端-热心居民申请-审核通过
*
* @param
* @return void
* @author sun
*/
@Override
public Result approve(ResiWarmAuditApproveFormDTO formDTO) {
return resiPartymemberFeignClient.approve(formDTO);
}
/**
* 政府端-热心居民申请-审核驳回
*
* @param
* @return void
* @author sun
*/
@Override
public Result reject(ResiWarmAuditRejectFormDTO formDTO) {
return resiPartymemberFeignClient.reject(formDTO);
}
/**
* 政府端-热心居民申请详情信息
*
* @param
* @return void
* @author sun
*/
@Override
public Result<ResiWarmAuditResultDTO> getDetail(ResiWarmGetDetailFormDTO formDTO) {
return resiPartymemberFeignClient.getDetail(formDTO);
}
}

10
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/util/ModuleConstant.java

@ -0,0 +1,10 @@
package com.epmet.util;
/**
* @Description 网格管理模块常量类
* @IntefaceName ModuleConstant
* @Author wangc
* @date 2020.04.16 15:42
*/
public interface ModuleConstant {
}

71
epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml

@ -0,0 +1,71 @@
server:
port: @server.port@
servlet:
context-path: /gov/grid
spring:
main:
allow-bean-definition-overriding: true
application:
name: gov-grid-server
#环境 dev|test|prod
profiles:
active: dev
messages:
encoding: UTF-8
basename: i18n/messages_common
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
redis:
database: @spring.redis.index@
host: @spring.redis.host@
port: @spring.redis.port@
password: @spring.redis.password@
timeout: 30s
cloud:
nacos:
discovery:
server-addr: @nacos.server-addr@
#nacos的命名空间ID,默认是public
namespace: @nacos.discovery.namespace@
#不把自己注册到注册中心的地址
register-enabled: @nacos.register-enabled@
ip: @nacos.ip@
config:
enabled: @nacos.config-enabled@
server-addr: @nacos.server-addr@
namespace: @nacos.config.namespace@
group: @nacos.config.group@
file-extension: yaml
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: ALWAYS
feign:
hystrix:
enabled: true
client:
config:
default:
loggerLevel: BASIC
httpclient:
enabled: true
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 60000 #缺省为1000
ribbon:
ReadTimeout: 300000
ConnectTimeout: 300000

159
epmet-module/gov-grid/gov-grid-server/src/main/resources/logback-spring.xml

@ -0,0 +1,159 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<property name="log.path" value="logs/gov-grid"/>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<!--1. 输出到控制台-->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>debug</level>
</filter>
<encoder>
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
<!-- 设置字符集 -->
<charset>UTF-8</charset>
</encoder>
</appender>
<!--2. 输出到文档-->
<!-- 2.1 level为 DEBUG 日志,时间滚动输出 -->
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/debug.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志归档 -->
<fileNamePattern>${log.path}/debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录debug级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>debug</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 2.2 level为 INFO 日志,时间滚动输出 -->
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/info.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 每天日志归档路径以及格式 -->
<fileNamePattern>${log.path}/info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录info级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>info</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 2.3 level为 WARN 日志,时间滚动输出 -->
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/warn.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录warn级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>warn</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 2.4 level为 ERROR 日志,时间滚动输出 -->
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/error.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录ERROR级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 开发、测试环境 -->
<springProfile name="dev,test">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.dao" level="INFO"/>
<logger name="com.epmet.dao" level="DEBUG"/>
<root level="INFO">
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="WARN_FILE"/>
<appender-ref ref="ERROR_FILE"/>
</root>
</springProfile>
<!-- 生产环境 -->
<springProfile name="prod">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.epmet.dao" level="INFO"/>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="WARN_FILE"/>
<appender-ref ref="ERROR_FILE"/>
</root>
</springProfile>
</configuration>

0
epmet-module/gov-grid/gov-grid-server/src/main/resources/mapper/.gitkeep

20
epmet-module/gov-grid/pom.xml

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>epmet-module</artifactId>
<groupId>com.epmet</groupId>
<version>2.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>gov-grid</artifactId>
<packaging>pom</packaging>
<modules>
<module>gov-grid-client</module>
<module>gov-grid-server</module>
</modules>
</project>

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java

@ -23,8 +23,8 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.CustomerStaffGridDTO;
import com.epmet.excel.CustomerStaffGridExcel;
import com.epmet.service.CustomerStaffGridService;

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java

@ -26,7 +26,7 @@ import java.util.List;
import java.util.Map;
/**
* 网格人员关系表
* 网格人员关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-20
@ -92,4 +92,5 @@ public interface CustomerStaffGridService extends BaseService<CustomerStaffGridE
* @date 2020-04-20
*/
void delete(String[] ids);
}

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

@ -20,9 +20,9 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.CustomerStaffGridDao;
import com.epmet.dto.CustomerStaffGridDTO;
import com.epmet.entity.CustomerStaffGridEntity;
@ -38,7 +38,7 @@ import java.util.List;
import java.util.Map;
/**
* 网格人员关系表
* 网格人员关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-20
@ -65,8 +65,8 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl<CustomerStaffG
return ConvertUtils.sourceToTarget(entityList, CustomerStaffGridDTO.class);
}
private QueryWrapper<CustomerStaffGridEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
private QueryWrapper<CustomerStaffGridEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<CustomerStaffGridEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ModuleConstant.java

@ -1,6 +1,4 @@
package com.epmet.util;/**
* Created by 11 on 2020/3/23.
*/
package com.epmet.util;
/**
* @Description

1
epmet-module/pom.xml

@ -27,6 +27,7 @@
<module>resi-mine</module>
<module>resi-group</module>
<module>resi-partymember</module>
<module>gov-grid</module>
</modules>
</project>

5
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java

@ -67,4 +67,9 @@ public interface TopicConstant {
* 构造queryWrapper 附件排序
* */
String SORT = "SORT";
/**
* 构造queryWrapper 用户Id
* */
String CUSTOMER_USER_ID = "CUSTOMER_USER_ID";
}

10
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupOperationDTO.java

@ -87,4 +87,14 @@ public class ResiGroupOperationDTO implements Serializable {
* OPERATE_USER_ID操作人id
*/
private String operateUserId;
/**
* 审核人员已读未读标识 (未读:unread; 已读:read)
* */
private String readFlag;
/**
* 消息通知内容
* */
private String messageText;
}

47
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyingGroupsFormDTO.java

@ -0,0 +1,47 @@
package com.epmet.resi.group.dto.group.form;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 政府端查询待审核的小组
* @ClassName ApplyingGroupsFormDTO
* @Author wangc
* @date 2020.04.17 14:59
*/
@Data
public class ApplyingGroupsFormDTO implements Serializable{
private static final long serialVersionUID = 1L;
/**
* 客户Id
* */
@NotBlank(message = "客户Id不能为空")
private String customerId;
/**
* 网格Id
* */
@NotBlank(message = "网格Id不能为空")
private String gridId;
/**
* 请求页码 最小是1
* */
@Min(value = 1)
private Integer pageNo;
/**
* 每页数据 默认20
* */
private Integer pageSize = 20;
/**
* 用户Id
* */
@NotBlank(message = "用户Id不能为空")
private String userId;
}

29
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGroupIdFromDTO.java

@ -0,0 +1,29 @@
package com.epmet.resi.group.dto.group.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 通用的传参DTO 只传groupId和userId
* @ClassName CommonGroupIdFromDTO
* @Author wangc
* @date 2020.04.20 14:04
*/
@Data
public class CommonGroupIdFromDTO implements Serializable{
private static final long serialVersionUID = 1L;
/**
* 组Id
* */
@NotBlank(message = "组Id不能为空")
private String groupId;
/**
* 用户Id
* */
@NotBlank(message = "用户Id不能为空")
private String userId;
}

19
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GovGroupSummarizeFromDTO.java

@ -0,0 +1,19 @@
package com.epmet.resi.group.dto.group.form;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/4/20 9:30
*/
@Data
public class GovGroupSummarizeFromDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 小组id
*/
private String groupId;
}

36
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupAuditedFromDTO.java

@ -0,0 +1,36 @@
package com.epmet.resi.group.dto.group.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/4/17 13:39
*/
@Data
public class GroupAuditedFromDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
@NotBlank(message = "客户id不能为空")
private String customerId;
/**
* 网格id
*/
@NotBlank(message = "网格id不能为空")
private String gridId;
/**
* 页码
*/
@NotBlank(message = "页码不能为空")
private Integer pageNo;
/**
* 每页显示数量
*/
@NotBlank(message = "每页显示数量不能为空")
private Integer pageSize;
}

78
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupDetailResultDTO.java

@ -0,0 +1,78 @@
package com.epmet.resi.group.dto.group.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description 建组申请详情
* @ClassName ApplyingGroupDetailResultDTO
* @Author wangc
* @date 2020.04.17 16:13
*/
@Data
public class ApplyingGroupDetailResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 组Id
* */
private String groupId;
/**
* 组名称
* */
private String groupName;
/**
* 组头像
* */
private String groupHeadPhoto;
/**
* 组介绍
* */
private String groupIntroduction;
/**
* 申请时间
* */
private Date createdTime;
/**
* 组长名称
* */
private String groupLeaderName;
/**
* 已同意该申请approved 已驳回rejected
* */
private String status;
/**
* 驳回理由
* */
private String rejectReason;
/**
* 从数据库中获取组长的用户Id,方便获取组长用户信息,返回时将此值置为NULL
* */
private String leaderId;
/**
* 街道
* */
private String street;
/**
* 未读已读标识 unread read
* */
private String readFlag;
/**
* 从数据库中获取组操作记录Id,返回时将此值置为NULL
* */
private String operationId;
}

50
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupResultDTO.java

@ -0,0 +1,50 @@
package com.epmet.resi.group.dto.group.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 政府端查询待审核的小组
* @ClassName ApplyingGroupResultDTO
* @Author wangc
* @date 2020.04.17 15:20
*/
@Data
public class ApplyingGroupResultDTO implements Serializable{
private static final long serialVersionUID = 1L;
/**
* 组Id
* */
private String groupId;
/**
* 组名称
* */
private String groupName;
/**
* 组头像
* */
private String groupHeadPhoto;
/**
* 申请时间
* */
private String createdTime;
/**
* 审核人员已读未读标识(未读:unread ; 已读:read )
* */
private String readFlag;
/**
* 消息通知内容
* */
private String messageText;
}

43
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GovGroupSummarizeResultDTO.java

@ -0,0 +1,43 @@
package com.epmet.resi.group.dto.group.result;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/4/20 9:24
*/
@Data
public class GovGroupSummarizeResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 组id
*/
private String groupId;
/**
* 组头像
*/
private String groupHeadPhoto;
/**
* 组名
*/
private String groupName;
/**
* 成员总数
*/
private Integer totalMember;
/**
* 组长名称
*/
private String leaderName;
/**
* 组介绍
*/
private String groupIntroduction;
/**
* 话题总数
*/
private Integer totalTopics;
}

45
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupAuditedResultDTO.java

@ -0,0 +1,45 @@
package com.epmet.resi.group.dto.group.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/4/17 13:40
*/
@Data
public class GroupAuditedResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 小组ID
*/
private String groupId;
/**
* 小组名称
*/
private String groupName;
/**
* 小组头像
*/
private String groupHeadPhoto;
/**
* 小组介绍
*/
private String groupIntroduction;
/**
* 小组状态已驳回rejected 已通过approved
*/
private String status;
/**
* 审核时间HH:mm
*/
private Date auditedTime;
/**
* 消息通知内容
*/
private String messageText;
}

41
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupsInGridResultDTO.java

@ -0,0 +1,41 @@
package com.epmet.resi.group.dto.group.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/4/17 15:53
*/
@NoArgsConstructor
@Data
public class GroupsInGridResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 小组id
*/
private String groupId;
/**
* 小组名称
*/
private String groupName;
/**
* 小组头像
*/
private String groupHeadPhoto;
/**
* 成员总数
*/
private Integer totalMember;
/**
* 党员总数
*/
private Integer totalPartyMember;
/**
* 当前状态审核通过 - approved 审核中 - under_auditting 审核未通过 - rejected 已屏蔽 - hidden 已关闭 - closed
*/
private String status;
}

91
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java

@ -22,14 +22,10 @@ import com.epmet.commons.tools.exception.RenException;
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.UserResiInfoFormDTO;
import com.epmet.modules.group.service.ResiGroupService;
import com.epmet.modules.utils.ModuleConstant;
import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.CreatedResultDTO;
import com.epmet.resi.group.dto.group.result.GroupSummarizeResultDTO;
import com.epmet.resi.group.dto.group.result.MyGroupResultDTO;
import com.epmet.resi.group.dto.group.result.RecommendGroupResultDTO;
import com.epmet.resi.group.dto.group.result.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -52,10 +48,11 @@ public class ResiGroupController {
private ResiGroupService resiGroupService;
@GetMapping("test/{test}")
public Result test(@PathVariable("test")String test){
int result=1/0;
public Result test(@PathVariable("test") String test) {
int result = 1 / 0;
return new Result().ok("请求成功啦❤");
}
/**
* @param tokenDto
* @param myGroupFormDTO
@ -220,4 +217,84 @@ public class ResiGroupController {
ValidatorUtils.validateEntity(disAgreeApplyGroupFormDTO);
return resiGroupService.disagreeApplyGroup(disAgreeApplyGroupFormDTO);
}
/**
* 小组审核历史列表
*
* @param formDTO 参数
* @return Result<List < GroupAuditedResultDTO>>
*/
@PostMapping("audited")
public Result<List<GroupAuditedResultDTO>> audited(GroupAuditedFromDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return resiGroupService.audited(formDTO);
}
/**
* 本网格小组列表
*
* @param formDTO 参数
* @return Result<List < GroupAuditedResultDTO>>
*/
@PostMapping("groupsingrid")
public Result<List<GroupsInGridResultDTO>> getGroupsInGrid(GroupAuditedFromDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return resiGroupService.getGroupsInGrid(formDTO);
}
/**
* 小组管理界面信息
*
* @param formDTO 参数
* @return Result<GovGroupSummarizeResultDTO>
*/
@PostMapping("getgovgroupsummarize")
public Result<GovGroupSummarizeResultDTO> getGovGroupSummarize(GovGroupSummarizeFromDTO formDTO) {
return resiGroupService.getGovGroupSummarize(formDTO);
}
/**
* @Description 得到小组待审核列表用户信息不注入TokenDTO通过外部服务调用直接传入参数
* @Param ApplyingGroupsFormDTO.class
* @return Result<List<ApplyingGroupResultDTO>>
* @Author wangc
* @Date 2020.04.20 13:59
**/
@PostMapping("getapplyinggroups")
public Result<List<ApplyingGroupResultDTO>> getApplyingGroups(@RequestBody ApplyingGroupsFormDTO applyingGroupsFormDTO){
ValidatorUtils.validateEntity(applyingGroupsFormDTO);
return resiGroupService.getApplyingGroups(applyingGroupsFormDTO);
}
/**
* @Description 得到待审核/未审核小组信息的详情
* @Param CommonGroupIdFromDTO -> String groupId; String userId
* @return Result<ApplyingGroupDetailResultDTO>
* @Author wangc
* @Date 2020.04.20 14:08
**/
@PostMapping("getapplyinggroupdetail")
public Result<ApplyingGroupDetailResultDTO> getApplyingGroupDetail(@RequestBody CommonGroupIdFromDTO groupIdFromDTO){
ValidatorUtils.validateEntity(groupIdFromDTO);
return resiGroupService.getApplyingGroupDetail(groupIdFromDTO);
}
@PostMapping("agreeapplying")
public Result agreeApplying( @RequestBody AgreeApplyGroupFormDTO agreeApplyGroupFormDTO) {
ValidatorUtils.validateEntity(agreeApplyGroupFormDTO);
return resiGroupService.agreeApplyGroup(agreeApplyGroupFormDTO);
}
/**
* @Description 建组申请-审核驳回-供外部服务调用当前用户Id需要调用时一并传入
* @Param DisAgreeApplyGroupFormDTO
* @return Result
* @Author wangc
* @Date 2020.04.20 14:26
**/
@PostMapping("disagreeapplying")
public Result disagreeApplying(@RequestBody DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO) {
ValidatorUtils.validateEntity(disAgreeApplyGroupFormDTO);
return resiGroupService.disagreeApplyGroup(disAgreeApplyGroupFormDTO);
}
}

33
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java

@ -23,6 +23,7 @@ import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.*;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -106,4 +107,36 @@ public interface ResiGroupDao extends BaseDao<ResiGroupEntity> {
* @Date 2020/3/30 16:03
**/
List<ResiGroupEntity> checkResiGroupName(ApplyCreateGroupFormDTO applyCreateGroupFormDTO);
/**
* 查询小组审核历史列表
* @param formDTO
* @return
*/
List<GroupAuditedResultDTO> selectAuditedGroupList(GroupAuditedFromDTO formDTO);
/**
* 查询网格小组列表
* @param formDTO
* @return
*/
List<ResiGroupEntity> selectGroupsByGridId(GroupAuditedFromDTO formDTO);
/**
* @Description 查询申请中的的小组
* @Param ApplyingGroupsFormDTO
* @return List<ApplyingGroupResultDTO>
* @Author wangc
* @Date 2020.04.20 00:11
**/
List<ApplyingGroupResultDTO> getApplyingGroupsByCustIdAndGridId(ApplyingGroupsFormDTO applyingGroupsFormDTO);
/**
* @Description 获取组审核信息详情:已审核/未审核通用
* @Param groupId
* @return ApplyingGroupDetailResultDTO
* @Author wangc
* @Date 2020.04.20 11:17
**/
ApplyingGroupDetailResultDTO getApplyingGroupDetailByGroupId(@Param("groupId") String groupId);
}

10
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupOperationEntity.java

@ -57,4 +57,14 @@ public class ResiGroupOperationEntity extends BaseEpmetEntity {
* OPERATE_USER_ID操作人id
*/
private String operateUserId;
/**
* 审核人员已读未读标识 (未读:unread; 已读:read)
* */
private String readFlag;
/**
* 消息通知内容
* */
private String messageText;
}

83
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java

@ -17,13 +17,24 @@
package com.epmet.modules.group.redis;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.modules.group.service.ResiGroupService;
import com.epmet.modules.group.service.ResiGroupStatisticalService;
import com.epmet.resi.group.constant.TopicConstant;
import com.epmet.resi.group.dto.group.ResiGroupDTO;
import com.epmet.resi.group.dto.group.ResiGroupInfoRedisDTO;
import com.epmet.resi.group.dto.group.ResiGroupStatisticalDTO;
import com.epmet.resi.group.dto.group.ResiGroupStatisticalInfoRedisDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.*;
/**
* 群组信息表
*
@ -35,6 +46,13 @@ public class ResiGroupRedis {
@Autowired
private RedisUtils redisUtils;
@Autowired
private ResiGroupService groupService;
@Autowired
private ResiGroupStatisticalService statisticalService;
public void delete(Object[] ids) {
}
@ -51,10 +69,75 @@ public class ResiGroupRedis {
}
}
/**
* @Description 查询组的缓存信息如果有直接返回如果没有则从数据库中查询将数据放入缓存并返回
* @Param
* @return
* @Author wangc
* @Date 2020.04.18 12:00
**/
public ResiGroupInfoRedisDTO get(String groupId){
if(StringUtils.isNotBlank(groupId)){
ResiGroupInfoRedisDTO groupCache = (ResiGroupInfoRedisDTO)
redisUtils.get(RedisKeys.getResiGroupInfoKey(groupId));
if(null == groupCache || StringUtils.isBlank(groupCache.getGroupId())){
//如果缓存中没有该组信息,从数据库中查询并放入缓存
ResiGroupDTO groupMySql = groupService.get(groupId);
if(null != groupMySql && StringUtils.isNotBlank(groupMySql.getId())){
ResiGroupInfoRedisDTO groupRedis = ConvertUtils.sourceToTarget(groupMySql,ResiGroupInfoRedisDTO.class);
groupRedis.setGroupId(groupMySql.getId());
groupRedis.setGroupState(groupMySql.getState());
Map<String,Object> param = new HashMap<>();
param.put(TopicConstant.RESI_GROUP_ID,groupId);
param.put(FieldConstant.DEL_FLAG, NumConstant.ZERO_STR);
List<ResiGroupStatisticalDTO> statisticalMySql = statisticalService.list(param);
if(null != statisticalMySql && statisticalMySql.size() >= 1){
if(statisticalMySql.size() > 1){
/*
Collections.sort(statisticalMySql, new Comparator<ResiGroupStatisticalDTO>() {
@Override
public int compare(ResiGroupStatisticalDTO o1, ResiGroupStatisticalDTO o2) {
if(null != o1.getCreatedTime() && null != o2.getCreatedTime()){
return
o1.getCreatedTime().getTime() > o2.getCreatedTime().getTime() ?
-1 : (o1.getCreatedTime().getTime() == o2.getCreatedTime().getTime() ?
0: 1);
}else{
return 0;
}
}
});
statisticalMySql.sort((ResiGroupStatisticalDTO o1, ResiGroupStatisticalDTO o2) ->
o1.getCreatedTime().compareTo(o2.getCreatedTime())
);
//升序
statisticalMySql.sort(Comparator.comparing(e -> e.getCreatedTime()));
statisticalMySql.sort(Comparator.comparing(ResiGroupStatisticalDTO :: getCreatedTime,
(o1 , o2) -> {
return o2.compareTo(o 1);
}));
*/
//按照createdTime降序排序
statisticalMySql.sort(Comparator.comparing(ResiGroupStatisticalDTO :: getCreatedTime,
Collections.reverseOrder()));
}
ResiGroupStatisticalDTO statistical = statisticalMySql.get(0);
ResiGroupStatisticalInfoRedisDTO statisticalRedis =
ConvertUtils.sourceToTarget(statistical,ResiGroupStatisticalInfoRedisDTO.class);
statisticalRedis.setTotalEarnestMembers(statistical.getTotalEarnestMemebers());
statisticalRedis.setTotalNormalMembers(statistical.getTotalNormalMemebers());
groupRedis.setGroupStatisticalInfo(statisticalRedis);
}
//将从数据库中查询出的数据放入缓存
set(groupRedis);
//返回数据
return groupRedis;
}
}
return groupCache;
}
return null;

55
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java

@ -20,17 +20,12 @@ package com.epmet.modules.group.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.UserResiInfoFormDTO;
import com.epmet.modules.group.entity.ResiGroupEntity;
import com.epmet.resi.group.dto.UserRoleDTO;
import com.epmet.resi.group.dto.group.ResiGroupDTO;
import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.CreatedResultDTO;
import com.epmet.resi.group.dto.group.result.GroupSummarizeResultDTO;
import com.epmet.resi.group.dto.group.result.MyGroupResultDTO;
import com.epmet.resi.group.dto.group.result.RecommendGroupResultDTO;
import com.epmet.resi.group.dto.group.result.*;
import java.util.List;
import java.util.Map;
@ -176,8 +171,8 @@ public interface ResiGroupService extends BaseService<ResiGroupEntity> {
Result initApplyCreatedGroup(InitApplyCreatedGroupFormDTO initApplyCreatedGroupFormDTO);
/**
* @return com.epmet.commons.tools.utils.Result
* @param agreeApplyGroupFormDTO
* @return com.epmet.commons.tools.utils.Result
* @Author yinzuomei
* @Description 审核(同意)群申请-测试用后面会放到政府端
* @Date 2020/3/31 12:44
@ -185,8 +180,8 @@ public interface ResiGroupService extends BaseService<ResiGroupEntity> {
Result agreeApplyGroup(AgreeApplyGroupFormDTO agreeApplyGroupFormDTO);
/**
* @return com.epmet.commons.tools.utils.Result
* @param disAgreeApplyGroupFormDTO
* @return com.epmet.commons.tools.utils.Result
* @Author yinzuomei
* @Description 审核拒绝群申请-测试用后面会放到政府端
* @Date 2020/3/31 13:22
@ -194,14 +189,56 @@ public interface ResiGroupService extends BaseService<ResiGroupEntity> {
Result disagreeApplyGroup(DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO);
/**
* @return com.epmet.resi.group.dto.UserRoleDTO
* @param app
* @param userId
* @param customerId
* @param gridId
* @return com.epmet.resi.group.dto.UserRoleDTO
* @Author yinzuomei
* @Description 判断用户当前角色
* @Date 2020/4/1 0:00
**/
UserRoleDTO checkPartyMemberOrWarmHeated(String app, String userId, String customerId, String gridId);
/**
* 小组审核历史列表
*
* @param formDTO 参数
* @return Result<List < GroupAuditedResultDTO>>
*/
Result<List<GroupAuditedResultDTO>> audited(GroupAuditedFromDTO formDTO);
/**
* 本网格小组列表
*
* @param formDTO 参数
* @return Result<List<GroupsInGridResultDTO>>
*/
Result<List<GroupsInGridResultDTO>> getGroupsInGrid(GroupAuditedFromDTO formDTO);
/**
* 小组管理界面信息
*
* @param formDTO 参数
* @return Result<GovGroupSummarizeResultDTO>
*/
Result<GovGroupSummarizeResultDTO> getGovGroupSummarize(GovGroupSummarizeFromDTO formDTO);
/**
* @Description 查询待审核的小组
* @Param ApplyingGroupsFormDTO
* @return Result<List<ApplyingGroupResultDTO>>
* @Author wangc
* @Date 2020.04.18 10:17
**/
Result<List<ApplyingGroupResultDTO>> getApplyingGroups(ApplyingGroupsFormDTO applyingGroupsFormDTO);
/**
* @Description 建组申请详情
* @Param AgreeApplyGroupFormDTO
* @return Result<ApplyingGroupResultDTO>
* @Author wangc
* @Date 2020.04.19 23:32
**/
Result<ApplyingGroupDetailResultDTO> getApplyingGroupDetail(CommonGroupIdFromDTO groupId);
}

217
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java

@ -30,20 +30,22 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.UserResiInfoFormDTO;
import com.epmet.dto.form.UserResiInfoListFormDTO;
import com.epmet.dto.form.UserRoleFormDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.dto.result.UserRoleResultDTO;
import com.epmet.modules.exception.ModuleErrorCode;
import com.epmet.modules.feign.EpmetUserFeignClient;
import com.epmet.modules.group.dao.ResiGroupDao;
import com.epmet.modules.group.dao.ResiGroupOperationDao;
import com.epmet.modules.group.entity.ResiGroupEntity;
import com.epmet.modules.group.entity.ResiGroupOperationEntity;
import com.epmet.modules.group.redis.ResiGroupRedis;
import com.epmet.modules.group.service.ResiGroupOperationService;
import com.epmet.modules.group.service.ResiGroupService;
import com.epmet.modules.group.service.ResiGroupStatisticalService;
import com.epmet.modules.member.dao.GroupMemeberOperationDao;
import com.epmet.modules.member.dao.ResiGroupMemberDao;
import com.epmet.modules.member.redis.ResiGroupMemberRedis;
import com.epmet.modules.member.service.GroupMemeberOperationService;
import com.epmet.modules.member.service.ResiGroupMemberService;
import com.epmet.modules.utils.ModuleConstant;
@ -54,12 +56,10 @@ import com.epmet.resi.group.constant.MemberStateConstant;
import com.epmet.resi.group.dto.UserRoleDTO;
import com.epmet.resi.group.dto.group.*;
import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.CreatedResultDTO;
import com.epmet.resi.group.dto.group.result.GroupSummarizeResultDTO;
import com.epmet.resi.group.dto.group.result.MyGroupResultDTO;
import com.epmet.resi.group.dto.group.result.RecommendGroupResultDTO;
import com.epmet.resi.group.dto.group.result.*;
import com.epmet.resi.group.dto.member.GroupMemeberOperationDTO;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -107,6 +107,9 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
@Autowired
private ResiGroupRedis resiGroupRedis;
@Autowired
private ResiGroupMemberRedis resiGroupMemberRedis;
@Override
public PageData<ResiGroupDTO> page(Map<String, Object> params) {
@ -314,7 +317,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
resiGroupOperation.setOperateUserId(applyCreateGroupFormDTO.getUserId());
resiGroupOperationService.save(resiGroupOperation);
//4、插入一群成员信息(群主)
ResiGroupMemberDTO resiGroupMemberDTO=new ResiGroupMemberDTO();
ResiGroupMemberDTO resiGroupMemberDTO = new ResiGroupMemberDTO();
resiGroupMemberDTO.setCustomerUserId(applyCreateGroupFormDTO.getUserId());
resiGroupMemberDTO.setResiGroupId(resiGroupEntity.getId());
resiGroupMemberDTO.setGroupLeaderFlag(LeaderFlagConstant.GROUP_LEADER);
@ -322,7 +325,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
resiGroupMemberDTO.setEnterGroupType(EnterGroupTypeConstant.CREATED);
resiGroupMemberService.save(resiGroupMemberDTO);
//5、插入一条入群记录(群主的)
GroupMemeberOperationDTO groupMemeberOperationDTO=new GroupMemeberOperationDTO();
GroupMemeberOperationDTO groupMemeberOperationDTO = new GroupMemeberOperationDTO();
groupMemeberOperationDTO.setCustomerUserId(applyCreateGroupFormDTO.getUserId());
groupMemeberOperationDTO.setGroupId(resiGroupEntity.getId());
groupMemeberOperationDTO.setOperateStatus(MemberStateConstant.UNDER_AUDITTING);
@ -331,23 +334,23 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
groupMemeberOperationService.save(groupMemeberOperationDTO);
//6、群初始统计记录
UserRoleDTO userRoleDTO = this.checkPartyMemberOrWarmHeated(applyCreateGroupFormDTO.getApp(),
applyCreateGroupFormDTO.getUserId(),
applyCreateGroupFormDTO.getCustomerId(),
applyCreateGroupFormDTO.getGridId());
ResiGroupStatisticalDTO resiGroupStatisticalDTO=new ResiGroupStatisticalDTO();
applyCreateGroupFormDTO.getUserId(),
applyCreateGroupFormDTO.getCustomerId(),
applyCreateGroupFormDTO.getGridId());
ResiGroupStatisticalDTO resiGroupStatisticalDTO = new ResiGroupStatisticalDTO();
resiGroupStatisticalDTO.setResiGroupId(resiGroupEntity.getId());
resiGroupStatisticalDTO.setTotalMembers(NumConstant.ONE);
resiGroupStatisticalDTO.setTotalNormalMemebers(NumConstant.ONE);
resiGroupStatisticalDTO.setTotalTopics(NumConstant.ZERO);
resiGroupStatisticalDTO.setTotalIssues(NumConstant.ZERO);
if(NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag())){
if (NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag())) {
resiGroupStatisticalDTO.setTotalPartyMembers(NumConstant.ONE);
}else{
} else {
resiGroupStatisticalDTO.setTotalPartyMembers(NumConstant.ZERO);
}
if(NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())){
if (NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())) {
resiGroupStatisticalDTO.setTotalEarnestMemebers(NumConstant.ONE);
}else{
} else {
resiGroupStatisticalDTO.setTotalEarnestMemebers(NumConstant.ZERO);
}
resiGroupStatisticalService.save(resiGroupStatisticalDTO);
@ -452,30 +455,54 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
resiGroupOperation.setOperateUserId(agreeApplyGroupFormDTO.getUserId());
resiGroupOperationService.update(resiGroupOperation);
//3、将群主在群成员的状态改为已通过
ResiGroupMemberDTO resiGroupMemberDTO=resiGroupMemberDao.selectLeaderMember(agreeApplyGroupFormDTO.getGroupId());
ResiGroupMemberDTO resiGroupMemberDTO = resiGroupMemberDao.selectLeaderMember(agreeApplyGroupFormDTO.getGroupId());
resiGroupMemberDTO.setStatus(MemberStateConstant.APPROVED);
resiGroupMemberService.update(resiGroupMemberDTO);
//4、更新群主的出入群记录改为已通过
GroupMemeberOperationDTO groupMemeberOperationDTO=groupMemeberOperationDao.selectLeaderRecord(agreeApplyGroupFormDTO.getGroupId());
GroupMemeberOperationDTO groupMemeberOperationDTO = groupMemeberOperationDao.selectLeaderRecord(agreeApplyGroupFormDTO.getGroupId());
groupMemeberOperationDTO.setOperateStatus(MemberStateConstant.APPROVED);
groupMemeberOperationDTO.setOperateUserId(agreeApplyGroupFormDTO.getUserId());
groupMemeberOperationService.update(groupMemeberOperationDTO);
//5、给用户发送消息???待定
//6、新增小组缓存信息
Map<String,Object> param = new HashMap<>();
param.put("resiGroupId",resiGroupDTO.getId());
//6、新增小组缓存信息、组员缓存信息
Map<String, Object> param = new HashMap<>();
param.put(ModuleConstant.RESI_GROUP_ID_CAMEL, resiGroupDTO.getId());
param.put(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
List<ResiGroupStatisticalDTO> statisticalList = resiGroupStatisticalService.list(param);
if(null != statisticalList && statisticalList.size() > 0){
ResiGroupInfoRedisDTO groupRedis = transferToGroupInfoRedis(resiGroupDTO,statisticalList.get(0));
if (null != statisticalList && statisticalList.size() > 0) {
ResiGroupInfoRedisDTO groupRedis = transferToGroupInfoRedis(resiGroupDTO, statisticalList.get(0));
resiGroupRedis.set(groupRedis);
}else{
//当没有查询到组统计信息时
UserRoleFormDTO userRoleFormDTO = new UserRoleFormDTO();
userRoleFormDTO.setApp("resi");
userRoleFormDTO.setCustomerId(resiGroupDTO.getCustomerId());
userRoleFormDTO.setUserId(agreeApplyGroupFormDTO.getUserId());
//userRoleFormDTO.setGridId
//epmetUserFeignClient.getUserRoleInfo(userRoleFormDTO);
ResiGroupMemberInfoRedisDTO memberRedis = new ResiGroupMemberInfoRedisDTO();
memberRedis.setUserId(resiGroupMemberDTO.getCustomerUserId());
memberRedis.setGroupLeaderFlag("leader");
memberRedis.setEnterGroupType(resiGroupMemberDTO.getEnterGroupType());
memberRedis.setMemberStatus(resiGroupMemberDTO.getStatus());
memberRedis.setGroupId(resiGroupMemberDTO.getResiGroupId());
UserResiInfoFormDTO userParam = new UserResiInfoFormDTO();
userParam.setUserId(resiGroupMemberDTO.getCustomerUserId());
userParam.setCustomerId(resiGroupDTO.getCustomerId());
Result<UserResiInfoResultDTO> userInfo =
epmetUserFeignClient.getUserResiInfoDTO(userParam);
if(userInfo.success() && null != userInfo.getData()){
memberRedis.setUserShowName(userInfo.getData().getShowName());
memberRedis.setUserHeadPhoto(userInfo.getData().getHeadPhoto());
}else{
logger.warn(ModuleConstant.USER_INFO_LIST_NOT_FOUND);
}
resiGroupMemberRedis.set(memberRedis);
} else {
/*
当没有查询到组统计信息时,需要自己封装统计信息
@param UserRoleFormDTO::getApp
@param UserRoleFormDTO::getCustomerId
@param UserRoleFormDTO::getUserId
@param UserRoleFormDTO::getGridId
查询用户身份信息[热心居民/党员]
epmetUserFeignClient.getUserRoleInfo(userRoleFormDTO);
*/
logger.warn(ModuleConstant.NO_SUCH_GROUP_STASTICAL_INFO);
}
@ -502,11 +529,11 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
resiGroupOperation.setOperateReason(disAgreeApplyGroupFormDTO.getRejectReason());
resiGroupOperationService.update(resiGroupOperation);
//3、将群主在群成员的状态改为已通过
ResiGroupMemberDTO resiGroupMemberDTO=resiGroupMemberDao.selectLeaderMember(disAgreeApplyGroupFormDTO.getGroupId());
ResiGroupMemberDTO resiGroupMemberDTO = resiGroupMemberDao.selectLeaderMember(disAgreeApplyGroupFormDTO.getGroupId());
resiGroupMemberDTO.setStatus(MemberStateConstant.REJECTED);
resiGroupMemberService.update(resiGroupMemberDTO);
//4、更新群主的出入群记录改为已通过
GroupMemeberOperationDTO groupMemeberOperationDTO=groupMemeberOperationDao.selectLeaderRecord(disAgreeApplyGroupFormDTO.getGroupId());
GroupMemeberOperationDTO groupMemeberOperationDTO = groupMemeberOperationDao.selectLeaderRecord(disAgreeApplyGroupFormDTO.getGroupId());
groupMemeberOperationDTO.setOperateStatus(MemberStateConstant.REJECTED);
groupMemeberOperationDTO.setOperateUserId(disAgreeApplyGroupFormDTO.getUserId());
groupMemeberOperationService.update(groupMemeberOperationDTO);
@ -555,30 +582,146 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
return userRoleDTO;
}
@Override
public Result<List<GroupAuditedResultDTO>> audited(GroupAuditedFromDTO formDTO) {
Result<List<GroupAuditedResultDTO>> result = new Result<>();
//查询条件
int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
formDTO.setPageNo(pageIndex);
//获取审核列表
List<GroupAuditedResultDTO> resultList = baseDao.selectAuditedGroupList(formDTO);
return result.ok(resultList);
}
@Override
public Result<List<GroupsInGridResultDTO>> getGroupsInGrid(GroupAuditedFromDTO formDTO) {
List<GroupsInGridResultDTO> resultList = new ArrayList<>();
//查询条件
int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
formDTO.setPageNo(pageIndex);
List<ResiGroupEntity> list = baseDao.selectGroupsByGridId(formDTO);
list.forEach(i -> {
//缓存中获取组信息
ResiGroupInfoRedisDTO resiGroupInfoRedisDTO = resiGroupRedis.get(i.getId());
GroupsInGridResultDTO groupsInGridResultDTO = new GroupsInGridResultDTO();
groupsInGridResultDTO.setGroupId(resiGroupInfoRedisDTO.getGroupId());
groupsInGridResultDTO.setGroupName(resiGroupInfoRedisDTO.getGroupName());
groupsInGridResultDTO.setGroupHeadPhoto(resiGroupInfoRedisDTO.getGroupHeadPhoto());
groupsInGridResultDTO.setStatus(resiGroupInfoRedisDTO.getGroupState());
groupsInGridResultDTO.setTotalMember(resiGroupInfoRedisDTO.getGroupStatisticalInfo().getTotalMembers());
groupsInGridResultDTO.setTotalPartyMember(resiGroupInfoRedisDTO.getGroupStatisticalInfo().getTotalPartyMembers());
resultList.add(groupsInGridResultDTO);
});
return new Result<List<GroupsInGridResultDTO>>().ok(resultList);
}
@Override
public Result<GovGroupSummarizeResultDTO> getGovGroupSummarize(GovGroupSummarizeFromDTO formDTO) {
GovGroupSummarizeResultDTO resultDTO = new GovGroupSummarizeResultDTO();
//从缓存中获取组相关信息
ResiGroupInfoRedisDTO resiGroupInfoRedisDTO = resiGroupRedis.get(formDTO.getGroupId());
resultDTO.setGroupId(resiGroupInfoRedisDTO.getGroupId());
resultDTO.setGroupHeadPhoto(resiGroupInfoRedisDTO.getGroupHeadPhoto());
resultDTO.setGroupIntroduction(resiGroupInfoRedisDTO.getGroupIntroduction());
resultDTO.setGroupName(resiGroupInfoRedisDTO.getGroupName());
resultDTO.setTotalMember(resiGroupInfoRedisDTO.getGroupStatisticalInfo().getTotalMembers());
resultDTO.setTotalTopics(resiGroupInfoRedisDTO.getGroupStatisticalInfo().getTotalTopics());
//获取组长信息
Result<UserResiInfoResultDTO> groupLeaderUserInfo = this.getGroupLeaderUserInfo(formDTO.getGroupId());
if (groupLeaderUserInfo.success() && null != groupLeaderUserInfo.getData()) {
resultDTO.setLeaderName(groupLeaderUserInfo.getData().getShowName());
} else {
logger.info("组长注册信息查询失败" + groupLeaderUserInfo.getMsg());
}
return new Result<GovGroupSummarizeResultDTO>().ok(resultDTO);
}
/**
* @return ResiGroupInfoRedisDTO
* @Description 将ResiGroupDTO与ResiGroupStatisticalDTO转换成ResiGroupInfoRedisDTO
* @Param ResiGroupDTO
* @Param ResiGroupStatisticalDTO
* @return ResiGroupInfoRedisDTO
* @Author wangc
* @Date 2020.04.13 16:36
**/
private ResiGroupInfoRedisDTO transferToGroupInfoRedis(ResiGroupDTO groupDTO,ResiGroupStatisticalDTO statisticalDTO){
private ResiGroupInfoRedisDTO transferToGroupInfoRedis(ResiGroupDTO groupDTO, ResiGroupStatisticalDTO statisticalDTO) {
ResiGroupStatisticalInfoRedisDTO statisticalObjct =
ConvertUtils.sourceToTarget(statisticalDTO,ResiGroupStatisticalInfoRedisDTO.class);
ConvertUtils.sourceToTarget(statisticalDTO, ResiGroupStatisticalInfoRedisDTO.class);
statisticalObjct.setTotalEarnestMembers(statisticalDTO.getTotalEarnestMemebers());
statisticalObjct.setTotalNormalMembers(statisticalDTO.getTotalNormalMemebers());
ResiGroupInfoRedisDTO targetObject =
ConvertUtils.sourceToTarget(groupDTO,ResiGroupInfoRedisDTO.class);
ConvertUtils.sourceToTarget(groupDTO, ResiGroupInfoRedisDTO.class);
targetObject.setGroupId(groupDTO.getId());
targetObject.setGroupState(groupDTO.getState());
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN);
if(null != groupDTO.getLatestTopicPublishDate()){
if (null != groupDTO.getLatestTopicPublishDate()) {
targetObject.setLatestTopicPublishDate(format.format(groupDTO.getLatestTopicPublishDate()));
}
targetObject.setGroupStatisticalInfo(statisticalObjct);
return targetObject;
}
/**
* @Description 查询待审核的小组 (不从缓存中取这时还没有成功建组缓存中没有组数据)
* @Param ApplyingGroupsFormDTO
* @return Result<List<ApplyingGroupResultDTO>>
* @Author wangc
* @Date 2020.04.18 10:18
**/
@Override
public Result<List<ApplyingGroupResultDTO>> getApplyingGroups(ApplyingGroupsFormDTO params){
if(null == params.getPageNo()){
throw new RenException(ModuleConstant.PAGE_INDEX_NOT_NULL);
}
params.setPageNo((params.getPageNo() - NumConstant.ONE) * params.getPageSize());
return new Result<List<ApplyingGroupResultDTO>>().ok(baseDao.getApplyingGroupsByCustIdAndGridId(params));
}
/**
* @Description 建组申请详情 已审核(更新已读未读标识)/未审核
* @Param AgreeApplyGroupFormDTO
* @return Result<ApplyingGroupResultDTO>
* @Author wangc
* @Date 2020.04.19 23:32
**/
@Override
public Result<ApplyingGroupDetailResultDTO> getApplyingGroupDetail(CommonGroupIdFromDTO groupId){
//1.查询小组信息
//注意,这里查询出的组申请详情中,无论是已审核还是未审核,都是将该组信息关联到初始化组时状态为[待审核、审核通过、拒绝]其中之一的组操作记录上,并读取审核的已读未读信息,上述三种状态在一个组的所有操作记录当中只可能存在一种,与之后的屏蔽、取消屏蔽、关闭无关,如果查出多条说明建组的逻辑有问题
ApplyingGroupDetailResultDTO detail = baseDao.getApplyingGroupDetailByGroupId(groupId.getGroupId());
//2.查询用户信息(TODO 先走数据库,之后改成走缓存)
List<String> userId = new ArrayList<>();
userId.add(detail.getLeaderId());
Result<List<UserResiInfoResultDTO>> userInfoResult =
epmetUserFeignClient.getUserResiInfoList(new UserResiInfoListFormDTO(userId));
if(userInfoResult.success() && null != userInfoResult.getData() && userInfoResult.getData().size() >= 1){
detail.setGroupHeadPhoto(userInfoResult.getData().get(0).getHeadPhoto());
//姓氏+先生/女士 注:在数据库中拼接成[街道+显示名称]默认格式,故要进行截取
//detail.setGroupLeaderName(userInfoResult.getData().get(0).getShowName().split("-")[NumConstant.ONE]);
//姓氏+名称
detail.setGroupLeaderName(userInfoResult.getData().get(0).getSurname() + userInfoResult.getData().get(0).getName());
detail.setStreet(userInfoResult.getData().get(0).getStreet());
}else{
logger.warn(ModuleConstant.USER_INFO_LIST_NOT_FOUND);
}
//3.未读改成已读
if(StringUtils.equals(detail.getReadFlag(),ModuleConstant.UNREAD)){
ResiGroupOperationEntity operationEntity = new ResiGroupOperationEntity();
operationEntity.setId(detail.getOperationId());
operationEntity.setReadFlag(ModuleConstant.READ);
operationEntity.setUpdatedBy(groupId.getUserId());
resiGroupOperationDao.updateById(operationEntity);
}
//4.将组长用户Id隐藏
detail.setLeaderId(null);
detail.setOperationId(null);
return new Result<ApplyingGroupDetailResultDTO>().ok(detail);
}
}

82
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java

@ -17,15 +17,26 @@
package com.epmet.modules.member.redis;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.map.MapUtil;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.UserResiInfoFormDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.modules.feign.EpmetUserFeignClient;
import com.epmet.modules.group.service.ResiGroupService;
import com.epmet.modules.member.service.ResiGroupMemberService;
import com.epmet.modules.utils.ModuleConstant;
import com.epmet.resi.group.constant.TopicConstant;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO;
import com.epmet.resi.group.dto.member.result.ResiGroupMemberInfoRedisResultDTO;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@ -42,6 +53,17 @@ public class ResiGroupMemberRedis {
@Autowired
private RedisUtils redisUtils;
@Autowired
private ResiGroupMemberService memberService;
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@Autowired
private ResiGroupService groupService;
private Logger logger = LoggerFactory.getLogger(getClass());
public void delete(Object[] ids) {
}
@ -70,14 +92,54 @@ public class ResiGroupMemberRedis {
* @Date 2020.04.13 23:36
**/
public ResiGroupMemberInfoRedisDTO get(String groupId ,String userId){
/*
Map<String, Object> map = redisUtils.hGetAll();
if (MapUtil.isEmpty(map)) {
return null;
ResiGroupMemberInfoRedisDTO memberCache =
(ResiGroupMemberInfoRedisDTO) redisUtils.get(RedisKeys.getResiGroupMemberInfoKey(groupId,userId));
//如果缓存中没有该成员数据
if(null == memberCache && StringUtils.isNotBlank(memberCache.getUserId())){
Map<String,Object> param = new HashMap<>();
param.put(TopicConstant.CUSTOMER_USER_ID,userId);
param.put(TopicConstant.RESI_GROUP_ID,groupId);
param.put(FieldConstant.DEL_FLAG, NumConstant.ZERO_STR);
List<ResiGroupMemberDTO> memberList = memberService.list(param);
if(null != memberList && memberList.size() >= 1){
if(memberList.size() > 1) {
memberList.sort(Comparator.comparing(ResiGroupMemberDTO::getCreatedTime, Collections.reverseOrder()));
}
ResiGroupMemberDTO memberMySql = memberList.get(0);
ResiGroupMemberInfoRedisDTO memberRedis = ConvertUtils.sourceToTarget(memberMySql,ResiGroupMemberInfoRedisDTO.class);
memberRedis.setUserId(memberMySql.getCustomerUserId());
memberRedis.setGroupId(memberMySql.getResiGroupId());
memberRedis.setMemberStatus(memberMySql.getStatus());
UserResiInfoFormDTO userParam = new UserResiInfoFormDTO();
userParam.setUserId(memberMySql.getCustomerUserId());
userParam.setCustomerId(groupService.get(groupId).getCustomerId());
Result<UserResiInfoResultDTO> userInfo = epmetUserFeignClient.getUserResiInfoDTO(userParam);
if(userInfo.success()){
if(null != userInfo.getData()){
memberRedis.setUserShowName(userInfo.getData().getShowName());
memberRedis.setUserHeadPhoto(userInfo.getData().getHeadPhoto());
}
}else{
logger.warn(ModuleConstant.USER_INFO_LIST_NOT_FOUND);
}
set(memberRedis);
return memberRedis;
}else{
//日志打印效果:找不到组员信息,组Id: ********,用户Id:********
logger.warn(ModuleConstant.GROUO_MEMBER_INFO_NOT_FOUND
.concat(ModuleConstant.GROUP_ID)
.concat(groupId)
.concat(ModuleConstant.USER_ID)
.concat(userId));
}
}
//map to bean
ResiGroupMemberInfoRedisDTO member = BeanUtil.mapToBean(map, ResiGroupMemberInfoRedisDTO.class, true);*/
return (ResiGroupMemberInfoRedisDTO) redisUtils.get(RedisKeys.getResiGroupMemberInfoKey(groupId,userId));
return memberCache;
}

5
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java

@ -132,7 +132,7 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
QueryWrapper<ResiGroupMemberEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
return wrapper;
}
@ -176,6 +176,7 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
QueryWrapper<ResiGroupMemberEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(groupId), "RESI_GROUP_ID", groupId)
.eq(StringUtils.isNotBlank(userId), "CUSTOMER_USER_ID", userId);
wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
List<ResiGroupMemberEntity> list = baseDao.selectList(wrapper);
if (null == list || list.size() == 0) {
return null;
@ -358,6 +359,8 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
//ResiGroupStatisticalInfoRedisDTO statisticalCache = groupCache.getGroupStatisticalInfo();
Map<String,Object> paramsMap = new HashMap<>();
paramsMap.put(TopicConstant.RESI_GROUP_ID,groupMemeberOperationDTO.getGroupId());
paramsMap.put(FieldConstant.DEL_FLAG, NumConstant.ZERO_STR);
//不再进行计算,直接从数据库中拉取更新过的数据(在同一个事务中)
List<ResiGroupStatisticalDTO> statisticalDTO = resiGroupStatisticalService.list(paramsMap);
if(null != statisticalDTO && statisticalDTO.size() > 0){
ResiGroupStatisticalInfoRedisDTO statisticalObjct =

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java

@ -98,7 +98,7 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl<ResiTopicCommen
QueryWrapper<ResiTopicCommentEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
return wrapper;
}

10
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java

@ -138,6 +138,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ResiTopicEntity> wrapper = new QueryWrapper<>();
wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
@ -235,6 +236,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
//4.小组统计信息,话题数+1
QueryWrapper<ResiGroupStatisticalEntity> wrapper = new QueryWrapper<>();
wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
wrapper.eq(TopicConstant.RESI_GROUP_ID,resiTopicPublishFormDTO.getGroupId());
List<ResiGroupStatisticalEntity> statistical = resiGroupStatisticalDao.selectList(wrapper);
if(null != statistical && statistical.size() >= NumConstant.ONE){
@ -524,6 +526,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
resultDTO.setTopicStatus(topicDetail.getStatus());
//2.查询话题附件
QueryWrapper<ResiTopicAttachmentEntity> wrapper = new QueryWrapper<>();
wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
wrapper.eq(TopicConstant.TOPIC_ID,topicId);
wrapper.orderByAsc(TopicConstant.SORT);
List<ResiTopicAttachmentEntity> attachments = resiTopicAttachmentDao.selectList(wrapper);
@ -818,6 +821,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
**/
private void updCacheGroupStatisticalInfo(String groupId,String operation,Integer quantity){
//ResiGroupRedis在get()时已经校验缓存中是否有数据,如果没有数据则从数据库中拉取并重新放入缓存
ResiGroupInfoRedisDTO groupCache =
resiGroupRedis.get(groupId);
if(groupCache != null && StringUtils.isNotBlank(groupCache.getGroupId())){
@ -835,13 +839,11 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
groupCache.setGroupStatisticalInfo(statisticalCache);
}else{
//没有相应的群组缓存信息 TODO 从数据库查找存进缓存
//没有相应的群组统计缓存信息
}
resiGroupRedis.set(groupCache);
}else{
//没有相应的群组缓存信息 TODO 从数据库查找存进缓存
//没有相应的群组缓存信息
}
}

40
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java

@ -178,4 +178,44 @@ public interface ModuleConstant extends Constant {
* 避免重复加入群
* */
String ALREADY_APPLIED_GROUP="该群已申请过,请耐心等待审核";
/**
* 找不到组员信息
* */
String GROUO_MEMBER_INFO_NOT_FOUND = "找不到组员信息,";
/**
* 日志拼接信息
* */
String GROUP_ID = "组Id: ";
/**
* 日志拼接信息
* */
String USER_ID = ",用户Id: ";
/**
* 页码不能为空
* */
String PAGE_INDEX_NOT_NULL = "页码不能位空";
/**
* RESI_GROUP_ID驼峰
* */
String RESI_GROUP_ID_CAMEL = "resiGroupId";
/**
* APP 居民端
* */
String APP_RESI = "resi";
/**
* 审核信息未读
* */
String UNREAD = "unread";
/**
* 审核信息已读
* */
String READ = "read";
}

7
epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/db.sql

@ -0,0 +1,7 @@
-- @Date 2020-04-17 15:37
-- @Author wangc
-- @Description 数据库epmet_resi_group中的resi_group_operation(小组操作记录)表新增两个字段,db语句:
ALTER TABLE resi_group_operation ADD (
READ_FLAG VARCHAR (8) DEFAULT NULL COMMENT '审核人员已读未读标识(未读:unread 界面显示红点; 已读:read 不显示红点)',
MESSAGE_TEXT VARCHAR (500) DEFAULT NULL COMMENT '消息通知内容'
);

85
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml

@ -191,4 +191,89 @@
AND rg.GRID_ID = #{gridId}
AND rg.STATE in('approved','under_auditting')
</select>
<!-- 小组审核历史 -->
<select id="selectAuditedGroupList" parameterType="com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO"
resultType="com.epmet.resi.group.dto.group.result.GroupAuditedResultDTO">
SELECT
rg.ID AS "groupId",
rg.GROUP_HEAD_PHOTO AS "groupHeadPhoto",
rg.GROUP_NAME AS "groupName",
rg.GROUP_INTRODUCTION AS "groupIntroduction",
rgo.STATE AS "status",
rgo.MESSAGE_TEXT AS "messageText",
rgo.UPDATED_TIME AS "auditedTime"
FROM
resi_group rg
INNER JOIN resi_group_operation rgo ON rg.ID = rgo.RESI_GROUP_ID
WHERE rg.CUSTOMER_ID = #{customerId}
AND rg.GRID_ID = #{gridId}
AND (rgo.STATE = 'approved' OR rgo.STATE = 'rejected')
AND rg.DEL_FLAG = '0'
AND rgo.DEL_FLAG = '0'
ORDER BY
rgo.UPDATED_TIME DESC
LIMIT #{pageNo}, #{pageSize}
</select>
<select id="selectGroupsByGridId" resultType="com.epmet.modules.group.entity.ResiGroupEntity">
SELECT
*
FROM
resi_group
WHERE CUSTOMER_ID = #{customerId}
AND GRID_ID = #{gridId}
AND DEL_FLAG = '0'
ORDER BY
UPDATED_TIME DESC
LIMIT #{pageNo}, #{pageSize}
</select>
<!-- 查询审核中的组信息列表(分页),一条组数据可能对应多条组操作记录,所以要限制组数据和组操作数据当前都在'待审核'状态来锁定唯一的映射关系 -->
<select id="getApplyingGroupsByCustIdAndGridId" parameterType="com.epmet.resi.group.dto.group.form.ApplyingGroupsFormDTO" resultType="com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO">
SELECT
gro.ID AS groupId,
gro.GROUP_NAME AS groupName,
gro.GROUP_HEAD_PHOTO AS groupHeadPhoto,
oper.READ_FLAG AS readFlag,
oper.MESSAGE_TEXT AS messageText,
CASE
WHEN TO_DAYS(oper.CREATED_TIME) = TO_DAYS(NOW()) THEN DATE_FORMAT(oper.CREATED_TIME,'%k:%i')
ELSE DATE_FORMAT(oper.CREATED_TIME,'%Y-%d-%m %k:%i')
END
AS createdTime
FROM
RESI_GROUP gro
LEFT JOIN RESI_GROUP_OPERATION oper ON ( gro.ID = oper.RESI_GROUP_ID AND oper.DEL_FLAG = '0' )
WHERE
gro.DEL_FLAG = '0'
AND gro.CUSTOMER_ID = #{customerId}
AND gro.GRID_ID = #{gridId}
AND gro.STATE = 'under_auditting'
AND oper.STATE = 'under_auditting'
ORDER BY gro.CREATED_TIME DESC
LIMIT #{pageNo},#{pageSize}
</select>
<!-- 获取组审核信息详情,已审核/未审核通用,一条组数据可能对应多条组操作记录,所以要限制组操作数据当前在'待审核'、'通过'、'拒绝通过'这三种状态之中的某个状态来锁定唯一的映射关系,因为每条组数据所对应的组操作记录的上述三种状态只能存在一种 -->
<select id="getApplyingGroupDetailByGroupId" parameterType="java.lang.String" resultType="com.epmet.resi.group.dto.group.result.ApplyingGroupDetailResultDTO">
SELECT
gro.ID AS groupId,
gro.GROUP_NAME AS groupName,
gro.GROUP_HEAD_PHOTO AS groupHeadPhoto,
oper.READ_FLAG AS readFlag,
oper.MESSAGE_TEXT AS messageText,
DATE_FORMAT(oper.CREATED_TIME,'%Y-%d-%m %k:%i') AS createdTime,
oper.STATE AS status,
oper.OPERATE_REASON rejectReason,
gro.CREATED_BY AS leaderId,
oper.READ_FLAG AS readFlag,
oper.ID AS operationId
FROM
RESI_GROUP gro
LEFT JOIN RESI_GROUP_OPERATION oper ON ( gro.ID = oper.RESI_GROUP_ID AND oper.DEL_FLAG = '0' )
WHERE
gro.DEL_FLAG = '0'
AND gro.ID = #{groupId}
AND oper.STATE IN ('under_auditting','approved','rejected')
</select>
</mapper>

5
epmet-module/resi-guide/resi-guide-server/pom.xml

@ -76,6 +76,11 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>${snakeyaml.version}</version>
</dependency>
</dependencies>
<build>

1
epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/service/impl/StrangerAccessRecordServiceImpl.java

@ -101,6 +101,7 @@ public class StrangerAccessRecordServiceImpl extends BaseServiceImpl<StrangerAcc
QueryWrapper<StrangerAccessRecordEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
Calendar before3daysDate = Calendar.getInstance();
before3daysDate.setTime(new Date());
before3daysDate.add(Calendar.DATE, -3);

1
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java

@ -43,6 +43,7 @@ public class ResiWarmheartedController {
**/
@PostMapping("submit")
public Result submit(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmheartedSubmitFormDTO formDTO) {
formDTO.setApp(tokenDTO.getApp());
ValidatorUtils.validateEntity(formDTO);
return resiWarmheartedService.submit(tokenDTO, formDTO);
}

10
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/ResiWarmheartedApplyDTO.java

@ -69,6 +69,16 @@ public class ResiWarmheartedApplyDTO implements Serializable {
*/
private String refuseReason;
/**
* 审核人员已读未读标识(未读:unread 界面显示红点; 已读:read 不显示红点)
*/
private String readFlag;
/**
* 消息通知内容
*/
private String messageText;
/**
* 热心居民申请行为记录表Id (resi_warmhearted_visit.id)
*/

51
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditApproveFormDTO.java

@ -0,0 +1,51 @@
/**
* 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.resi.partymember.dto.warmhearted.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 政府端-人工审核热心居民申请-审核通过-入参配置
* @author sun
*/
@Data
public class ResiWarmAuditApproveFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 热心居民申请id
*/
@NotBlank(message = "申请ID不能为空")
private String applyId;
/**
* 用户Id
*/
private String userId;
/**
* 所属端 app
*/
private String app;
}

66
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditFormDTO.java

@ -0,0 +1,66 @@
/**
* 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.resi.partymember.dto.warmhearted.form;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 政府端-获取待审核的热心居民申请列表-入参配置
*
* @author sun
*/
@Data
public class ResiWarmAuditFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 用户当前所在网格所属客户id
*/
@NotBlank(message = "客户id不能为空")
private String customerId;
/**
* 用户当前所在网格id
*/
@NotBlank(message = "网格id不能为空")
private String gridId;
/**
* 页码
*/
@Min(1)
private Integer pageNo;
/**
* 每页显示条数
*/
private Integer pageSize = 10;
/**
* 审核状态 key:audit_status,value:(under_auditting:待审核approved:通过rejected :未通过)
*/
private String auditStatus;
}

22
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedAuditFormDTO.java → epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditRejectFormDTO.java

@ -24,11 +24,11 @@ import java.io.Serializable;
/**
* 政府端-人工审核热心居民申请-配置入参
* 政府端-人工审核热心居民申请-审核驳回-入参配置
* @author sun
*/
@Data
public class ResiWarmheartedAuditFormDTO implements Serializable {
public class ResiWarmAuditRejectFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ -36,28 +36,22 @@ public class ResiWarmheartedAuditFormDTO implements Serializable {
* 热心居民申请id
*/
@NotBlank(message = "申请ID不能为空")
private String resiWarmApplyId;
/**
* 审核状态(0:取消驳回 1:审核通过)
*/
@NotBlank(message = "审核状态不能为空")
private String auditStatus;
private String applyId;
/**
* 驳回理由
*/
@NotBlank(message = "驳回理由不能为空")
private String refuseReason;
/**
* 客户Id CUSTOMER.id
* 用户Id
*/
@NotBlank(message = "客户ID不能为空")
private String customerId;
private String userId;
/**
* 用户Id
* 所属端 app
*/
private String userId;
private String app;
}

42
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmGetDetailFormDTO.java

@ -0,0 +1,42 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.resi.partymember.dto.warmhearted.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 政府端-热心居民申请详情信息-入参配置
*
* @author sun
*/
@Data
public class ResiWarmGetDetailFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 热心居民申请id
*/
@NotBlank(message = "申请ID不能为空")
private String applyId;
}

31
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedAuditedFromDTO.java

@ -0,0 +1,31 @@
package com.epmet.resi.partymember.dto.warmhearted.form;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription 热心居民-审核历史请求参数
* @date 2020/4/16 13:51
*/
@Data
public class ResiWarmheartedAuditedFromDTO implements Serializable {
private static final long serialVersionUID = -7290137219142856024L;
/**
* 客户id
*/
private String customerId;
/**
* 网格id
*/
private String gridId;
/**
* 页码
*/
private Integer pageNo;
/**
* 每页显示数量
*/
private Integer pageSize;
}

10
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedSubmitFormDTO.java

@ -61,4 +61,14 @@ public class ResiWarmheartedSubmitFormDTO implements Serializable {
*/
private String userId;
/**
* 所属端 app
*/
private String app;
/**
* 消息内容
*/
private String messageText;
}

106
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/result/ResiWarmAuditResultDTO.java

@ -0,0 +1,106 @@
/**
* 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.resi.partymember.dto.warmhearted.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 政府端-获取待审核的热心居民申请列表-返参配置
*
* @author sun
*/
@Data
public class ResiWarmAuditResultDTO implements Serializable {
private static final long serialVersionUID = -1L;
/**
* 申请单Id
*/
private String applyId;
/**
* 客户Id (customer.id)
*/
private String customerId;
/**
* 网格Id (customer_grid.id)
*/
private String gridId;
/**
* 申请用户id
*/
private String userId;
/**
* 热心居民申请理由 (300字)
*/
private String reason;
/**
* 审核状态 key:audit_status,value:(under_auditting:待审核approved:通过rejected :未通过)
*/
private String auditStatus;
/**
* 拒绝理由
*/
private String refuseReason;
/**
* 申请用户头像
*/
private String userHeadPhoto;
/**
* 申请用户的显示昵称
*/
private String userNickName;
/**
* 阅读标记 未读unread 界面显示红点已读read不显示红点
*/
private String readFlag;
/**
* 消息通知内容
*/
private String messageText;
/**
* 热心居民申请行为记录表Id (resi_warmhearted_visit.id)
*/
private String resiWarmVisitId;
/**
* 申请时间
*/
private Date applyTime;
/**
* 街道
*/
private String street;
}

46
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/result/ResiWarmheartedAuditedResultDTO.java

@ -0,0 +1,46 @@
package com.epmet.resi.partymember.dto.warmhearted.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @author zhaoqifeng
* @dscription 热心居民-审核历史返回值
* @date 2020/4/16 13:52
*/
@Data
public class ResiWarmheartedAuditedResultDTO implements Serializable {
private static final long serialVersionUID = 4109086860497055842L;
/**
* 申请单id
*/
private String applyId;
/**
* 申请用户id
*/
private String userId;
/**
* 申请用户头像
*/
private String userHeadPhoto;
/**
* 申请用户显示昵称
*/
private String userNickName;
/**
* 申请时间HH:mm
*/
private Date applyTime;
/**
* 已驳回rejected 已通过approved
*/
private String status;
/**
* 消息通知内容
*/
private String messageText;
}

12
epmet-module/resi-partymember/resi-partymember-server/pom.xml

@ -81,6 +81,18 @@
<version>RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-message-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>gov-org-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

12
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetMessageFeignClient.java

@ -2,10 +2,13 @@ package com.epmet.modules.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.modules.feign.fallback.EpmetMessageFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
/**
* @author kamui
@ -21,4 +24,13 @@ public interface EpmetMessageFeignClient {
@GetMapping(value = "message/sms/captcha/{mobile}")
Result sendSmsCaptcha(@PathVariable String mobile);
/**
* @param formDto
* @return com.epmet.commons.tools.utils.Result
* @Author sun
* @Description 新增未读消息
**/
@PostMapping(value = "message/usermessage/saveusermessage", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result saveUserMessage(UserMessageFormDTO formDto);
}

17
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java

@ -5,12 +5,15 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.UserResiInfoDTO;
import com.epmet.dto.UserRoleDTO;
import com.epmet.dto.form.UserResiInfoFormDTO;
import com.epmet.dto.form.UserResiInfoListFormDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.modules.feign.fallback.EpmetUserFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
@ -21,6 +24,7 @@ public interface EpmetUserFeignClient {
/**
* 查询用户注册信息
*
* @param userResiInfoFormDTO 参数
* @return Result<UserResiInfoDTO>
*/
@ -29,11 +33,12 @@ public interface EpmetUserFeignClient {
/**
* 党员认证时如果没有注册居民则注册居民信息
*
* @param userResiInfoDTO
* @author zhaoqifeng
**/
@PostMapping("/epmetuser/userresiinfo/saveResiInfo")
Result saveResiInfo (@RequestBody UserResiInfoDTO userResiInfoDTO);
Result saveResiInfo(@RequestBody UserResiInfoDTO userResiInfoDTO);
/**
* 添加用户角色关系
@ -44,4 +49,14 @@ public interface EpmetUserFeignClient {
@PostMapping("/epmetuser/userrole/saveUserRole")
Result saveUserRole(@RequestBody UserRoleDTO userRoleDTO);
/**
* 根据userId集合查询用户注册信息
*
* @param userResiInfoListFormDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.UserResiInfoDTO>>
* @Date 2020/4/7 18:24
**/
@PostMapping("/epmetuser/userresiinfo/getuserresiinfolist")
Result<List<UserResiInfoResultDTO>> getUserResiInfoList(@RequestBody UserResiInfoListFormDTO userResiInfoListFormDTO);
}

35
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/GovOrgFeignClient.java

@ -0,0 +1,35 @@
package com.epmet.modules.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.ListCustomerGridFormDTO;
import com.epmet.modules.feign.fallback.GovOrgFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
/**
* @Description Feign调用gov-org-server模块
* @ClassName GovOrgFeginFallBack
* @Author sun
*/
@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class)
public interface GovOrgFeignClient {
/**
* 根据网格Id查询网格信息
* @param customerGridFormDTO
* @return
*/
@PostMapping("/gov/org/customergrid/getcustomergridbygridid")
Result<CustomerGridDTO> getCustomerGridByGridId(@RequestBody CustomerGridFormDTO customerGridFormDTO);
}

6
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetMessageFeignClientFallback.java

@ -3,6 +3,7 @@ package com.epmet.modules.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.modules.feign.EpmetMessageFeignClient;
import org.springframework.stereotype.Component;
@ -18,4 +19,9 @@ public class EpmetMessageFeignClientFallback implements EpmetMessageFeignClient
return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "sendSmsCaptcha", mobile);
}
@Override
public Result saveUserMessage(UserMessageFormDTO formDto) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "saveUserMessage", formDto);
}
}

8
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetUserFeignClientFallBack.java

@ -6,10 +6,13 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.UserResiInfoDTO;
import com.epmet.dto.UserRoleDTO;
import com.epmet.dto.form.UserResiInfoFormDTO;
import com.epmet.dto.form.UserResiInfoListFormDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.modules.feign.EpmetUserFeignClient;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
@ -31,4 +34,9 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient {
public Result saveUserRole(UserRoleDTO userRoleDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "saveUserRole", userRoleDTO);
}
@Override
public Result<List<UserResiInfoResultDTO>> getUserResiInfoList(UserResiInfoListFormDTO userResiInfoListFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserResiInfoList", userResiInfoListFormDTO);
}
}

28
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/GovOrgFeignClientFallBack.java

@ -0,0 +1,28 @@
package com.epmet.modules.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.modules.feign.GovOrgFeignClient;
import org.springframework.stereotype.Component;
/**
* @Description Feign
* @ClassName GovOrgFeginFallBack
* @Author sun
*/
@Component
public class GovOrgFeignClientFallBack implements GovOrgFeignClient {
/**
* 根据网格Id查询网格信息
* @param customerGridFormDTO
* @return
*/
@Override
public Result<CustomerGridDTO> getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getCustomerGridByGridId",customerGridFormDTO);
}
}

2
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java

@ -153,7 +153,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
PartymemberInfoEntity partyMemberInfoEntity = ConvertUtils.sourceToTarget(partyMemberInfoDTO,
PartymemberInfoEntity.class);
if (confirmAutoDTO == null || (confirmAutoDTO.getResult().compareTo(PartyMemberConstant.BENCHMARK) < 0 && !confirmAutoDTO.getComparisonResults())) {
if (confirmAutoDTO == null || !confirmAutoDTO.getComparisonResults()) {
//将访问记录更新到热心居民申请行为记录表
saveOrUpdateVisit(partyMemberInfoDTO.getPartymemberVisitId(), null, PartyMemberConstant.OPERATE_AUTO_FAILED);

136
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java

@ -40,6 +40,9 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static java.util.stream.Collectors.toList;
/**
* 党员库基本信息表
@ -125,25 +128,58 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl<PartymemberB
if (null != idCardList && idCardList.size() > 0) {
//优先判断身份证和手机号
Optional<PartymemberBaseInfoEntity> matchingResult =
idCardList.stream().filter(baseInfo -> baseInfo.getMobile().equals(partyMemberInfo.getMobile())).findFirst();
if (matchingResult.isPresent()) {
confirmAutoDTO = getResult(matchingResult.get(), partyMemberInfo, true);
return confirmAutoDTO;
List<PartymemberBaseInfoEntity> matchingList = idCardList.stream().filter(baseInfo ->
baseInfo.getMobile().equals(partyMemberInfo.getMobile())).collect(toList());
if (matchingList.size() > 0) {
//姓名匹配度是01(含)以上
List<PartymemberBaseInfoEntity> nameMatchingList = idCardList.stream().filter(baseInfo ->
getOneSimilarity(baseInfo.getName(), name,
PartyMemberConstant.NAME_SMALL)).collect(toList());
if (nameMatchingList.size() > 0) {
//获取匹配度最高的一条
PartymemberBaseInfoEntity baseInfoEntity =
nameMatchingList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0);
confirmAutoDTO = getResult(baseInfoEntity, partyMemberInfo, true);
return confirmAutoDTO;
}
}
//判断身份证和姓名
matchingResult = idCardList.stream().filter(baseInfo -> baseInfo.getName().equals(name)).findFirst();
if (matchingResult.isPresent()) {
confirmAutoDTO = getResult(matchingResult.get(), partyMemberInfo, true);
matchingList = idCardList.stream().filter(baseInfo -> baseInfo.getName().equals(name)).collect(toList());
if (matchingList.size() > 0) {
//手机号匹配度是01(含)以上
List<PartymemberBaseInfoEntity> mobileMatchingList = idCardList.stream().filter(baseInfo ->
getOneSimilarity(baseInfo.getMobile(), partyMemberInfo.getMobile(),
PartyMemberConstant.MOBILE_SMALL)).collect(toList());
if (mobileMatchingList.size() > 0) {
//获取匹配度最高的一条
PartymemberBaseInfoEntity baseInfoEntity =
mobileMatchingList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0);
confirmAutoDTO = getResult(baseInfoEntity, partyMemberInfo, true);
return confirmAutoDTO;
}
}
//有一项是11的情况下,另外两项需要是10(含)以上,可以认证通过;
matchingList = idCardList.stream().filter(baseInfo ->
getOneSimilarity(baseInfo.getMobile(), partyMemberInfo.getMobile(),
PartyMemberConstant.MOBILE_MOST) && getOneSimilarity(baseInfo.getName(),
name, PartyMemberConstant.NAME_MOST)).collect(toList());
if (matchingList.size() > 0) {
//获取匹配度最高的一条
PartymemberBaseInfoEntity baseInfoEntity =
matchingList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0);
confirmAutoDTO = getResult(baseInfoEntity, partyMemberInfo, true);
return confirmAutoDTO;
}
//获取匹配度最高的数据
sortList.add(idCardList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
getSimilarity(p, partyMemberInfo)).reversed()).collect(Collectors.toList()).get(0));
getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0));
} else {
//根据手机号匹配数据
@ -151,32 +187,63 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl<PartymemberB
if (null != mobileList && mobileList.size() > 0) {
//判断手机号和姓名
Optional<PartymemberBaseInfoEntity> matchingResult =
mobileList.stream().filter(baseInfo -> baseInfo.getName().equals(name)).findFirst();
if (matchingResult.isPresent()) {
confirmAutoDTO = getResult(matchingResult.get(), partyMemberInfo, true);
List<PartymemberBaseInfoEntity> matchingList =
mobileList.stream().filter(baseInfo -> baseInfo.getName().equals(name)).collect(toList());
if (matchingList.size() > 0) {
//身份证匹配度是01(含)以上
List<PartymemberBaseInfoEntity> idCardMatchingList = mobileList.stream().filter(baseInfo ->
getOneSimilarity(baseInfo.getIdCard(), partyMemberInfo.getIdCard(),
PartyMemberConstant.ID_SMALL)).collect(toList());
if (idCardMatchingList.size() > 0) {
//获取匹配度最高的一条
PartymemberBaseInfoEntity baseInfoEntity =
idCardMatchingList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0);
confirmAutoDTO = getResult(baseInfoEntity, partyMemberInfo, true);
return confirmAutoDTO;
}
}
//有一项是11的情况下,另外两项需要是10(含)以上,可以认证通过;
matchingList = mobileList.stream().filter(baseInfo ->
getOneSimilarity(baseInfo.getIdCard(), partyMemberInfo.getIdCard(),
PartyMemberConstant.ID_MOST) && getOneSimilarity(baseInfo.getName(),
name, PartyMemberConstant.NAME_MOST)).collect(toList());
if (matchingList.size() > 0) {
//获取匹配度最高的一条
PartymemberBaseInfoEntity baseInfoEntity =
matchingList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0);
confirmAutoDTO = getResult(baseInfoEntity, partyMemberInfo, true);
return confirmAutoDTO;
}
//获取匹配度最高的数据
sortList.add(mobileList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
getSimilarity(p, partyMemberInfo)).reversed()).collect(Collectors.toList()).get(0));
getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0));
} else {
//根据姓名匹配数据
List<PartymemberBaseInfoEntity> nameList = baseDao.selectBaseInfoByName(partyMemberInfo);
if (null != nameList && nameList.size() > 0) {
//有一项是11的情况下,另外两项需要是10(含)以上,可以认证通过;
List<PartymemberBaseInfoEntity> matchingList = nameList.stream().filter(baseInfo ->
getOneSimilarity(baseInfo.getIdCard(), partyMemberInfo.getIdCard(),
PartyMemberConstant.ID_MOST) && getOneSimilarity(baseInfo.getMobile(),
partyMemberInfo.getMobile(), PartyMemberConstant.MOBILE_MOST)).collect(toList());
if (matchingList.size() > 0) {
//获取匹配度最高的一条
PartymemberBaseInfoEntity baseInfoEntity =
matchingList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0);
confirmAutoDTO = getResult(baseInfoEntity, partyMemberInfo, true);
return confirmAutoDTO;
}
//获取匹配度最高的数据
sortList.add(nameList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
getSimilarity(p, partyMemberInfo)).reversed()).collect(Collectors.toList()).get(0));
PartymemberBaseInfoEntity similar =
nameList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
getSimilarity(p, partyMemberInfo)).reversed()).collect(Collectors.toList()).get(0);
confirmAutoDTO = getResult(similar, partyMemberInfo, false);
return confirmAutoDTO;
getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0));
} else {
return null;
@ -184,9 +251,9 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl<PartymemberB
}
}
PartymemberBaseInfoEntity similar =
PartymemberBaseInfoEntity similar =
sortList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
getSimilarity(p, partyMemberInfo)).reversed()).collect(Collectors.toList()).get(0);
getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0);
return getResult(similar, partyMemberInfo, false);
}
@ -274,4 +341,15 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl<PartymemberB
return result;
}
/**
* 相似度判断
*
* @return String
*/
private boolean getOneSimilarity(String base, String input, double rule) {
Levenshtein levenshtein = new Levenshtein();
double result = levenshtein.distance(base, input);
return result <= rule;
}
}

29
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/constant/ResiWarmUserMessageConstant.java

@ -0,0 +1,29 @@
package com.epmet.modules.warmhearted.constant;
/**
* @Description 热心居民模块消息通知
* @Author sun
*/
public interface ResiWarmUserMessageConstant {
/**
* 消息标题
*/
String GROUP_TITLE = "您有一条小组消息";
/**
* 热心居民提交申请时给网格长发送消息XX街道-XX先生/女士申请成为热心居民请审核
*/
String RESIWARM_APPLY_MSG = "%s申请成为热心居民,请审核。";
/**
* 热心居民申请审核通过给申请人发送消息您好您申请的第三网格热心居民已审核通过请查看
*/
String AUDIT_APPROVE_MSG = "您好,您申请的%s热心居民已审核通过,请查看。";
/**
* 热心居民申请审核驳回给申请人发送消息您好您申请的第三网格热心居民由于不符合条件的原因已被驳回
*/
String AUDIT_REJECT_MSG = "您好,您申请的%s热心居民,由于不符合条件的原因,已被驳回。";
}

18
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/constant/ResiWarmheartedVisitConstant.java

@ -46,6 +46,16 @@ public interface ResiWarmheartedVisitConstant {
*/
String REJECTED = "rejected";
/**
* 未读
*/
String UN_READ="unread";
/**
* 已读
*/
String READ="read";
String RESI_WARM_INIT = "您的信息已提交成功,请等待后台审核。";
String RESI_WARM_SUBMIT = "热心居民信息已提交成功,请等待后台审核。";
@ -59,4 +69,12 @@ public interface ResiWarmheartedVisitConstant {
* 数据库操作异常
*/
String REPEAT_EXCEPTION = "已存在待审核的申请,不能重复申请";
String SELECT_USERINFO_EXCEPTION = "未查询到申请人基本信息,申请提交失败";
String UPDATE_EXCEPTION = "热心居民申请数据更新失败,热心居民角色添加失败";
String SELECT_EXCEPTION = "根据申请Id未查询到热心居民申请详情信息";
String AUDIT_EXCEPTION = "该申请数据已审核,不能再次审核";
}

176
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedApplyController.java

@ -17,7 +17,9 @@
package com.epmet.modules.warmhearted.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
@ -28,9 +30,9 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.modules.warmhearted.excel.ResiWarmheartedApplyExcel;
import com.epmet.modules.warmhearted.service.ResiWarmheartedApplyService;
import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.*;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -50,64 +52,114 @@ import java.util.Map;
@RequestMapping("resiwarmheartedapply")
public class ResiWarmheartedApplyController {
@Autowired
private ResiWarmheartedApplyService resiWarmheartedApplyService;
@GetMapping("page")
public Result<PageData<ResiWarmheartedApplyDTO>> page(@RequestParam Map<String, Object> params) {
PageData<ResiWarmheartedApplyDTO> page = resiWarmheartedApplyService.page(params);
return new Result<PageData<ResiWarmheartedApplyDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ResiWarmheartedApplyDTO> get(@PathVariable("id") String id) {
ResiWarmheartedApplyDTO data = resiWarmheartedApplyService.get(id);
return new Result<ResiWarmheartedApplyDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody ResiWarmheartedApplyDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
resiWarmheartedApplyService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody ResiWarmheartedApplyDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
resiWarmheartedApplyService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids) {
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
resiWarmheartedApplyService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<ResiWarmheartedApplyDTO> list = resiWarmheartedApplyService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ResiWarmheartedApplyExcel.class);
}
@PostMapping("init")
public Result<ResiWarmheartedResultDTO> init(@RequestBody ResiWarmheartedFormDTO formDTO) {
return resiWarmheartedApplyService.init(formDTO);
}
@PostMapping("submit")
public Result submit(@RequestBody ResiWarmheartedSubmitFormDTO formDTO) {
return resiWarmheartedApplyService.submit(formDTO);
}
@PostMapping("manageaudit")
public Result manageAudit(@RequestBody ResiWarmheartedAuditFormDTO formDTO) {
return resiWarmheartedApplyService.manageAudit(formDTO);
}
@Autowired
private ResiWarmheartedApplyService resiWarmheartedApplyService;
@GetMapping("page")
public Result<PageData<ResiWarmheartedApplyDTO>> page(@RequestParam Map<String, Object> params) {
PageData<ResiWarmheartedApplyDTO> page = resiWarmheartedApplyService.page(params);
return new Result<PageData<ResiWarmheartedApplyDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ResiWarmheartedApplyDTO> get(@PathVariable("id") String id) {
ResiWarmheartedApplyDTO data = resiWarmheartedApplyService.get(id);
return new Result<ResiWarmheartedApplyDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody ResiWarmheartedApplyDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
resiWarmheartedApplyService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody ResiWarmheartedApplyDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
resiWarmheartedApplyService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids) {
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
resiWarmheartedApplyService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<ResiWarmheartedApplyDTO> list = resiWarmheartedApplyService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ResiWarmheartedApplyExcel.class);
}
@PostMapping("init")
public Result<ResiWarmheartedResultDTO> init(@RequestBody ResiWarmheartedFormDTO formDTO) {
return resiWarmheartedApplyService.init(formDTO);
}
@PostMapping("submit")
public Result submit(@RequestBody ResiWarmheartedSubmitFormDTO formDTO) {
return resiWarmheartedApplyService.submit(formDTO);
}
/**
* 热心居民审核历史列表
*
* @param formDTO 参数
* @return
*/
@PostMapping("audited")
public Result<List<ResiWarmheartedAuditedResultDTO>> audited(@RequestBody ResiWarmheartedAuditedFromDTO formDTO) {
return resiWarmheartedApplyService.audited(formDTO);
}
/**
* @param
* @Author sun
* @Description 政府端-获取待审核的热心居民申请列表
**/
@PostMapping("auditing")
public Result<List<ResiWarmAuditResultDTO>> auditing(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmAuditFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return resiWarmheartedApplyService.auditing(formDTO);
}
/**
* @param
* @Author sun
* @Description 政府端-热心居民申请-审核通过
**/
@PostMapping("approve")
public Result approve(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmAuditApproveFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return resiWarmheartedApplyService.approve(formDTO);
}
/**
* @param
* @Author sun
* @Description 政府端-热心居民申请-审核驳回
**/
@PostMapping("reject")
public Result reject(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmAuditRejectFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return resiWarmheartedApplyService.reject(formDTO);
}
/**
* @param
* @Author sun
* @Description 政府端-热心居民申请详情信息
**/
@PostMapping("getdetail")
public Result<ResiWarmAuditResultDTO> getDetail(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmGetDetailFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return resiWarmheartedApplyService.getDetail(formDTO);
}
}

14
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/dao/ResiWarmheartedApplyDao.java

@ -18,12 +18,16 @@
package com.epmet.modules.warmhearted.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity;
import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmAuditFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditedFromDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 热心居民申请表
*
@ -40,4 +44,12 @@ public interface ResiWarmheartedApplyDao extends BaseDao<ResiWarmheartedApplyEnt
*/
ResiWarmheartedApplyDTO selectResiWarmheartedApply(ResiWarmheartedFormDTO formDTO);
List<ResiWarmheartedApplyEntity> selectAuditedApplyList(ResiWarmheartedAuditedFromDTO params);
/**
* 查询待审核状态的热心居民申请
* @param formDTO
* @return
*/
List<ResiWarmAuditResultDTO> selectResiWarmAuditList(ResiWarmAuditFormDTO formDTO);
}

10
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/entity/ResiWarmheartedApplyEntity.java

@ -68,6 +68,16 @@ public class ResiWarmheartedApplyEntity extends BaseEpmetEntity {
*/
private String refuseReason;
/**
* 审核人员已读未读标识(未读:unread 界面显示红点; 已读:read 不显示红点)
*/
private String readFlag;
/**
* 消息通知内容
*/
private String messageText;
/**
* 热心居民申请行为记录表Id (resi_warmhearted_visit.id)
*/

6
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/excel/ResiWarmheartedApplyExcel.java

@ -52,6 +52,12 @@ public class ResiWarmheartedApplyExcel {
@Excel(name = "拒绝理由")
private String refuseReason;
@Excel(name = "阅读标记")
private String readFlag;
@Excel(name = "消息通知内容")
private String messageText;
@Excel(name = "热心居民申请行为记录表Id (resi_warmhearted_visit.id)")
private String resiWarmVisitId;

44
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java

@ -22,9 +22,9 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity;
import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.*;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO;
import java.util.List;
@ -117,11 +117,45 @@ public interface ResiWarmheartedApplyService extends BaseService<ResiWarmhearted
Result submit(ResiWarmheartedSubmitFormDTO formDTO);
/**
* 政府端-热心居民申请人工审核
* 热心居民审核历史列表
* @param formDTO 参数
* @return ResiWarmheartedAuditedResultDTO
*/
Result<List<ResiWarmheartedAuditedResultDTO>> audited(ResiWarmheartedAuditedFromDTO formDTO);
/**
* 政府端-获取待审核的热心居民申请列表
*
* @param
* @return void
* @author sun
*/
Result<List<ResiWarmAuditResultDTO>> auditing(ResiWarmAuditFormDTO formDTO);
/**
* 政府端-热心居民申请-审核通过
*
* @param
* @return void
* @author sun
*/
Result approve(ResiWarmAuditApproveFormDTO formDTO);
/**
* 政府端-热心居民申请-审核驳回
*
* @param
* @return void
* @author sun
*/
Result reject(ResiWarmAuditRejectFormDTO formDTO);
/**
* 政府端-热心居民申请详情信息
*
* @param
* @return void
* @author sun
*/
Result manageAudit(ResiWarmheartedAuditFormDTO formDTO);
Result<ResiWarmAuditResultDTO> getDetail(ResiWarmGetDetailFormDTO formDTO);
}

579
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java

@ -19,7 +19,6 @@ package com.epmet.modules.warmhearted.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.EpmetRoleKeyConstant;
@ -31,11 +30,18 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.PartyMemberConstant;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.UserRoleDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.dto.form.UserResiInfoFormDTO;
import com.epmet.dto.form.UserResiInfoListFormDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.modules.feign.EpmetMessageFeignClient;
import com.epmet.modules.feign.EpmetUserFeignClient;
import com.epmet.modules.utils.ModuleConstant;
import com.epmet.modules.feign.GovOrgFeignClient;
import com.epmet.modules.warmhearted.constant.ResiWarmUserMessageConstant;
import com.epmet.modules.warmhearted.constant.ResiWarmheartedVisitConstant;
import com.epmet.modules.warmhearted.dao.ResiWarmheartedApplyDao;
import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity;
@ -43,22 +49,22 @@ import com.epmet.modules.warmhearted.redis.ResiWarmheartedApplyRedis;
import com.epmet.modules.warmhearted.service.ResiWarmheartedApplyService;
import com.epmet.modules.warmhearted.service.ResiWarmheartedVisitService;
import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.*;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.stream.Collectors;
/**
* 热心居民申请表
@ -69,174 +75,391 @@ import org.slf4j.LoggerFactory;
@Service
public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmheartedApplyDao, ResiWarmheartedApplyEntity> implements ResiWarmheartedApplyService {
private static final Logger logger = LoggerFactory.getLogger(ResiWarmheartedApplyServiceImpl.class);
@Autowired
private ResiWarmheartedApplyRedis resiWarmheartedApplyRedis;
@Autowired
private ResiWarmheartedVisitService resiWarmheartedVisitService;
@Autowired
private ResiWarmheartedApplyDao resiWarmheartedApplyDao;
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@Override
public PageData<ResiWarmheartedApplyDTO> page(Map<String, Object> params) {
IPage<ResiWarmheartedApplyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ResiWarmheartedApplyDTO.class);
}
@Override
public List<ResiWarmheartedApplyDTO> list(Map<String, Object> params) {
List<ResiWarmheartedApplyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ResiWarmheartedApplyDTO.class);
}
private QueryWrapper<ResiWarmheartedApplyEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<ResiWarmheartedApplyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ResiWarmheartedApplyDTO get(String id) {
ResiWarmheartedApplyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ResiWarmheartedApplyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ResiWarmheartedApplyDTO dto) {
ResiWarmheartedApplyEntity entity = ConvertUtils.sourceToTarget(dto, ResiWarmheartedApplyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ResiWarmheartedApplyDTO dto) {
ResiWarmheartedApplyEntity entity = ConvertUtils.sourceToTarget(dto, ResiWarmheartedApplyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result<ResiWarmheartedResultDTO> init(ResiWarmheartedFormDTO formDTO) {
Result<ResiWarmheartedResultDTO> result = new Result<ResiWarmheartedResultDTO>();
//0:先判断该用户是否是已注册居民
UserResiInfoFormDTO userResiInfoFormDTO = new UserResiInfoFormDTO();
userResiInfoFormDTO.setCustomerId(formDTO.getCustomerId());
userResiInfoFormDTO.setUserId(formDTO.getUserId());
Result<UserResiInfoResultDTO> result1 = epmetUserFeignClient.getUserResiInfoDTO(userResiInfoFormDTO);
if (!result1.success() || null == result1.getData()) {
result.setCode(EpmetErrorCode.CANNOT_AUDIT_WARM.getCode());
result.setMsg(EpmetErrorCode.CANNOT_AUDIT_WARM.getMsg());
return result;
}
//1:热心居民申请行为记录表新增数据
result = resiWarmheartedVisitService.saveResiWarmheartedVisit(formDTO);
if (!result.success()) {
logger.error(ResiWarmheartedVisitConstant.OPERATION_EXCEPTION);
}
ResiWarmheartedResultDTO resiWarmheartedResultDTO = result.getData();
//2:查询是否已申请热心居民(不查询审核未通过的)
formDTO.setAuditStatus(ResiWarmheartedVisitConstant.REJECTED);
ResiWarmheartedApplyDTO resiWarmheartedApplyDTO = resiWarmheartedApplyDao.selectResiWarmheartedApply(formDTO);
if (null == resiWarmheartedApplyDTO || StringUtils.isEmpty(resiWarmheartedApplyDTO.getId())) {
//是否已申请热心居民 0:否, 1:是
resiWarmheartedResultDTO.setIsApplied(NumConstant.ZERO_STR);
} else {
resiWarmheartedResultDTO.setIsApplied(NumConstant.ONE_STR);
result.setCode(NumConstant.ZERO);
result.setMsg(ResiWarmheartedVisitConstant.RESI_WARM_INIT);
}
return result.ok(resiWarmheartedResultDTO);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result submit(ResiWarmheartedSubmitFormDTO formDTO) {
Result result = new Result();
//0:为防止前台点击多次提交 先查询一下是否有已提交数据
ResiWarmheartedFormDTO ResiWarmheartedFormDTO = ConvertUtils.sourceToTarget(formDTO, ResiWarmheartedFormDTO.class);
ResiWarmheartedFormDTO.setAuditStatus(ResiWarmheartedVisitConstant.REJECTED);
ResiWarmheartedApplyDTO resiWarmheartedApplyDTO = resiWarmheartedApplyDao.selectResiWarmheartedApply(ResiWarmheartedFormDTO);
if (null != resiWarmheartedApplyDTO) {
logger.error(ResiWarmheartedVisitConstant.REPEAT_EXCEPTION);
throw new RenException(ResiWarmheartedVisitConstant.REPEAT_EXCEPTION);
}else{
//1:将申请记录存入热心居民申请表中
saveResiWarmApply(formDTO);
//2:将最后一次操作行为更新到热心居民申请行为记录表中
resiWarmheartedVisitService.updateResiWarmVisit(formDTO);
result.setCode(NumConstant.ZERO);
result.setMsg(ResiWarmheartedVisitConstant.RESI_WARM_SUBMIT);
}
return result;
}
/**
* 热心居民申请表新增数据
*
* @param formDTO
* @return
*/
public void saveResiWarmApply(ResiWarmheartedSubmitFormDTO formDTO) {
ResiWarmheartedApplyEntity entity = new ResiWarmheartedApplyEntity();
entity.setCustomerId(formDTO.getCustomerId());
entity.setGridId(formDTO.getGridId());
entity.setUserId(formDTO.getUserId());
entity.setReason(formDTO.getReason());
entity.setResiWarmVisitId(formDTO.getResiWarmVisitId());
entity.setAuditStatus(ResiWarmheartedVisitConstant.UNDER_AUDITTING);
baseDao.insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result manageAudit(ResiWarmheartedAuditFormDTO formDTO) {
Result result = new Result();
//1:更新热心居民申请表数据
ResiWarmheartedApplyEntity entity = new ResiWarmheartedApplyEntity();
entity.setId(formDTO.getResiWarmApplyId());
if (NumConstant.ZERO_STR.equals(formDTO.getAuditStatus())) {
//审核状态-未通过
entity.setAuditStatus(PartyMemberConstant.REJECTED);
} else {
//审核状态-通过
entity.setAuditStatus(PartyMemberConstant.APPROVED);
}
if (!StringUtils.isBlank(formDTO.getRefuseReason())) {
entity.setRefuseReason(formDTO.getRefuseReason());
}
int num = baseDao.updateById(entity);
//2:审核通过的添加热心居民的角色
if (num > NumConstant.ZERO && NumConstant.ONE_STR.equals(formDTO.getAuditStatus())) {
//查询需要添加热心居民角色的userId
ResiWarmheartedApplyEntity resiWarmheartedApplyEntity = baseDao.selectById(formDTO.getResiWarmApplyId());
UserRoleDTO dto = new UserRoleDTO();
dto.setCustomerId(formDTO.getCustomerId());
dto.setUserId(resiWarmheartedApplyEntity.getUserId());
//所属端-居民端
dto.setApp(AppClientConstant.APP_RESI);
//角色-热心居民
dto.setRoleKey(EpmetRoleKeyConstant.WARMHEARTED);
//角色表新增网格Id
dto.setGridId(resiWarmheartedApplyEntity.getGridId());
result = epmetUserFeignClient.saveUserRole(dto);
private static final Logger logger = LoggerFactory.getLogger(ResiWarmheartedApplyServiceImpl.class);
@Autowired
private ResiWarmheartedApplyRedis resiWarmheartedApplyRedis;
@Autowired
private ResiWarmheartedVisitService resiWarmheartedVisitService;
@Autowired
private ResiWarmheartedApplyDao resiWarmheartedApplyDao;
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@Autowired
private EpmetMessageFeignClient epmetMessageFeignClient;
@Autowired
private GovOrgFeignClient govOrgFeignClient;
@Override
public PageData<ResiWarmheartedApplyDTO> page(Map<String, Object> params) {
IPage<ResiWarmheartedApplyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ResiWarmheartedApplyDTO.class);
}
@Override
public List<ResiWarmheartedApplyDTO> list(Map<String, Object> params) {
List<ResiWarmheartedApplyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ResiWarmheartedApplyDTO.class);
}
private QueryWrapper<ResiWarmheartedApplyEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<ResiWarmheartedApplyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ResiWarmheartedApplyDTO get(String id) {
ResiWarmheartedApplyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ResiWarmheartedApplyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ResiWarmheartedApplyDTO dto) {
ResiWarmheartedApplyEntity entity = ConvertUtils.sourceToTarget(dto, ResiWarmheartedApplyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ResiWarmheartedApplyDTO dto) {
ResiWarmheartedApplyEntity entity = ConvertUtils.sourceToTarget(dto, ResiWarmheartedApplyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result<ResiWarmheartedResultDTO> init(ResiWarmheartedFormDTO formDTO) {
Result<ResiWarmheartedResultDTO> result = new Result<ResiWarmheartedResultDTO>();
//0:先判断该用户是否是已注册居民
UserResiInfoFormDTO userResiInfoFormDTO = new UserResiInfoFormDTO();
userResiInfoFormDTO.setCustomerId(formDTO.getCustomerId());
userResiInfoFormDTO.setUserId(formDTO.getUserId());
Result<UserResiInfoResultDTO> result1 = epmetUserFeignClient.getUserResiInfoDTO(userResiInfoFormDTO);
if (!result1.success() || null == result1.getData()) {
result.setCode(EpmetErrorCode.CANNOT_AUDIT_WARM.getCode());
result.setMsg(EpmetErrorCode.CANNOT_AUDIT_WARM.getMsg());
return result;
}
//1:热心居民申请行为记录表新增数据
result = resiWarmheartedVisitService.saveResiWarmheartedVisit(formDTO);
if (!result.success()) {
logger.error(ResiWarmheartedVisitConstant.OPERATION_EXCEPTION);
}
ResiWarmheartedResultDTO resiWarmheartedResultDTO = result.getData();
//2:查询是否已申请热心居民(不查询审核未通过的)
formDTO.setAuditStatus(ResiWarmheartedVisitConstant.REJECTED);
ResiWarmheartedApplyDTO resiWarmheartedApplyDTO = resiWarmheartedApplyDao.selectResiWarmheartedApply(formDTO);
if (null == resiWarmheartedApplyDTO || StringUtils.isEmpty(resiWarmheartedApplyDTO.getId())) {
//是否已申请热心居民 0:否, 1:是
resiWarmheartedResultDTO.setIsApplied(NumConstant.ZERO_STR);
} else {
resiWarmheartedResultDTO.setIsApplied(NumConstant.ONE_STR);
result.setCode(NumConstant.ZERO);
result.setMsg(ResiWarmheartedVisitConstant.RESI_WARM_INIT);
}
return result.ok(resiWarmheartedResultDTO);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result submit(ResiWarmheartedSubmitFormDTO formDTO) {
Result result = new Result();
//0:为防止前台点击多次提交 先查询一下是否有已提交数据
ResiWarmheartedFormDTO ResiWarmheartedFormDTO = ConvertUtils.sourceToTarget(formDTO, ResiWarmheartedFormDTO.class);
ResiWarmheartedFormDTO.setAuditStatus(ResiWarmheartedVisitConstant.REJECTED);
ResiWarmheartedApplyDTO resiWarmheartedApplyDTO = resiWarmheartedApplyDao.selectResiWarmheartedApply(ResiWarmheartedFormDTO);
if (null != resiWarmheartedApplyDTO) {
logger.error(ResiWarmheartedVisitConstant.REPEAT_EXCEPTION);
throw new RenException(ResiWarmheartedVisitConstant.REPEAT_EXCEPTION);
} else {
//0:调用user服务获取申请人的基本信息
UserResiInfoFormDTO resiInfoParam = new UserResiInfoFormDTO();
resiInfoParam.setCustomerId(formDTO.getCustomerId());
resiInfoParam.setUserId(formDTO.getUserId());
Result<UserResiInfoResultDTO> resultUserInfo = epmetUserFeignClient.getUserResiInfoDTO(resiInfoParam);
if (!resultUserInfo.success() || null == resultUserInfo.getData()) {
throw new RenException(ResiWarmheartedVisitConstant.SELECT_USERINFO_EXCEPTION);
}
String showName = resultUserInfo.getData().getShowName();
String messageContent = String.format(ResiWarmUserMessageConstant.RESIWARM_APPLY_MSG, showName);
formDTO.setMessageText(messageContent);
//1:将申请记录存入热心居民申请表中
saveResiWarmApply(formDTO);
//2:将最后一次操作行为更新到热心居民申请行为记录表中
resiWarmheartedVisitService.updateResiWarmVisit(formDTO);
//3:添加消息信息,给网格长发消息
saveResiWarmUserMessage(formDTO);
result.setCode(NumConstant.ZERO);
result.setMsg(ResiWarmheartedVisitConstant.RESI_WARM_SUBMIT);
}
return result;
}
/**
* 热心居民申请表新增数据
*
* @param formDTO
* @return
*/
public void saveResiWarmApply(ResiWarmheartedSubmitFormDTO formDTO) {
ResiWarmheartedApplyEntity entity = new ResiWarmheartedApplyEntity();
entity.setCustomerId(formDTO.getCustomerId());
entity.setGridId(formDTO.getGridId());
entity.setUserId(formDTO.getUserId());
entity.setReason(formDTO.getReason());
entity.setResiWarmVisitId(formDTO.getResiWarmVisitId());
entity.setAuditStatus(ResiWarmheartedVisitConstant.UNDER_AUDITTING);
entity.setReadFlag(ResiWarmheartedVisitConstant.UN_READ);
entity.setMessageText(formDTO.getMessageText());
baseDao.insert(entity);
}
/**
* 热心居民申请像网格长发送消息
*
* @param formDTO
* @return
* @Author sun
*/
private void saveResiWarmUserMessage(ResiWarmheartedSubmitFormDTO formDTO) {
UserMessageFormDTO userMessageFormDTO = new UserMessageFormDTO();
userMessageFormDTO.setCustomerId(formDTO.getCustomerId());
userMessageFormDTO.setGridId(formDTO.getGridId());
//网格长用户Id TODO
//userMessageFormDTO.setUserId();
userMessageFormDTO.setUserId(formDTO.getUserId());//先在token中取一个默认值
userMessageFormDTO.setApp(formDTO.getApp());
userMessageFormDTO.setTitle(ResiWarmUserMessageConstant.GROUP_TITLE);
userMessageFormDTO.setMessageContent(formDTO.getMessageText());
userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ);
//保存消息
epmetMessageFeignClient.saveUserMessage(userMessageFormDTO);
}
@Override
public Result<List<ResiWarmheartedAuditedResultDTO>> audited(ResiWarmheartedAuditedFromDTO formDTO) {
Result<List<ResiWarmheartedAuditedResultDTO>> result = new Result<>();
List<ResiWarmheartedAuditedResultDTO> resultList = new ArrayList<>();
//查询条件
int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
formDTO.setPageNo(pageIndex);
//获取审核列表
List<ResiWarmheartedApplyEntity> applyList = baseDao.selectAuditedApplyList(formDTO);
if (null == applyList || applyList.size() == 0) {
return result.ok(resultList);
}
//提取所有userID
List<String> userIds =
applyList.stream().map(ResiWarmheartedApplyEntity::getUserId).collect(Collectors.toList());
//获取用户昵称,头像
UserResiInfoListFormDTO userResiInfoListFormDTO = new UserResiInfoListFormDTO();
userResiInfoListFormDTO.setUserIdList(userIds);
List<UserResiInfoResultDTO> userResiInfoList =
epmetUserFeignClient.getUserResiInfoList(userResiInfoListFormDTO).getData();
if (null == userResiInfoList || userResiInfoList.size() == 0) {
return result.ok(resultList);
}
return result;
}
resultList = applyList.stream().flatMap(apply -> userResiInfoList.stream().filter(user ->
apply.getUserId().equals(user.getUserId())).map(userInfo -> {
ResiWarmheartedAuditedResultDTO resultDTO = new ResiWarmheartedAuditedResultDTO();
resultDTO.setApplyId(apply.getId());
resultDTO.setUserId(apply.getUserId());
resultDTO.setStatus(apply.getAuditStatus());
resultDTO.setApplyTime(apply.getUpdatedTime());
resultDTO.setMessageText(apply.getMessageText());
resultDTO.setUserNickName(userInfo.getShowName());
resultDTO.setUserHeadPhoto(userInfo.getHeadPhoto());
return resultDTO;
})).collect(Collectors.toList());
return result.ok(resultList);
}
/**
* 政府端-获取待审核的热心居民申请列表
*
* @param
* @return void
* @author sun
*/
@Override
public Result<List<ResiWarmAuditResultDTO>> auditing(ResiWarmAuditFormDTO formDTO) {
Result<List<ResiWarmAuditResultDTO>> result = new Result<>();
List<ResiWarmAuditResultDTO> applyList = new ArrayList<>();
//1:查询待审核状态的热心居民申请
formDTO.setAuditStatus(PartyMemberConstant.UNDER_AUDITTING);
formDTO.setPageNo((formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize());
applyList = baseDao.selectResiWarmAuditList(formDTO);
if (null == applyList || applyList.size() < NumConstant.ONE) {
return result.ok(applyList);
}
//2:调用epmet-user服务 获取用户头像 昵称
//遍历获取所有的userId
List<String> userIds = applyList.stream().map(ResiWarmAuditResultDTO::getUserId).collect(Collectors.toList());
//获取所有用户的头像 昵称
UserResiInfoListFormDTO userResiInfoListFormDTO = new UserResiInfoListFormDTO();
userResiInfoListFormDTO.setUserIdList(userIds);
List<UserResiInfoResultDTO> userResiInfoList = epmetUserFeignClient.getUserResiInfoList(userResiInfoListFormDTO).getData();
if (null == userResiInfoList || userResiInfoList.size() < NumConstant.ONE) {
return result.ok(applyList);
}
//3:将每个用户的头像 昵称放到对应实体中返回给前台
List<ResiWarmAuditResultDTO> resultList = applyList.stream().flatMap(apply -> userResiInfoList.stream().filter(user ->
apply.getUserId().equals(user.getUserId())).map(userInfo -> {
ResiWarmAuditResultDTO resultDTO = ConvertUtils.sourceToTarget(apply, ResiWarmAuditResultDTO.class);
resultDTO.setUserNickName(null == userInfo.getShowName() ? "" : userInfo.getShowName());
resultDTO.setUserHeadPhoto(null == userInfo.getHeadPhoto() ? "" : userInfo.getHeadPhoto());
return resultDTO;
})).collect(Collectors.toList());
return result.ok(resultList);
}
/**
* 政府端-热心居民申请-审核通过
*
* @param
* @return void
* @author sun
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Result approve(ResiWarmAuditApproveFormDTO formDTO) {
Result result = new Result();
//0:先校验数据是否是未审核状态,防止接口测试调用多次
ResiWarmheartedApplyEntity entity = baseDao.selectById(formDTO.getApplyId());
if (null == entity || !ResiWarmheartedVisitConstant.UNDER_AUDITTING.equals(entity.getAuditStatus())) {
result.error(ResiWarmheartedVisitConstant.AUDIT_EXCEPTION);
return result;
}
//1:更新热心居民申请表数据
//审核状态-通过
entity.setAuditStatus(PartyMemberConstant.APPROVED);
int num = baseDao.updateById(entity);
//2:审核通过的添加热心居民的角色
if (num < NumConstant.ONE) {
result.error(ResiWarmheartedVisitConstant.UPDATE_EXCEPTION);
return result;
}
//查询需要添加热心居民角色的userId
UserRoleDTO dto = new UserRoleDTO();
dto.setCustomerId(entity.getCustomerId());
dto.setUserId(entity.getUserId());
//所属端-居民端
dto.setApp(AppClientConstant.APP_RESI);
//角色-热心居民
dto.setRoleKey(EpmetRoleKeyConstant.WARMHEARTED);
//角色表新增网格Id
dto.setGridId(entity.getGridId());
result = epmetUserFeignClient.saveUserRole(dto);
//3:为申请人发送审核通过消息提示
result = auditMessage(entity, ResiWarmUserMessageConstant.AUDIT_APPROVE_MSG);
return result;
}
/**
* 热心居民申请审核通过向申请人发送消息
* @Author sun
* @param formDTO
* @param userMsg 消息模板
*/
private Result auditMessage(ResiWarmheartedApplyEntity formDTO, String userMsg) {
UserMessageFormDTO userMessageFormDTO = new UserMessageFormDTO();
userMessageFormDTO.setCustomerId(formDTO.getCustomerId());
userMessageFormDTO.setGridId(formDTO.getGridId());
userMessageFormDTO.setUserId(formDTO.getUserId());
userMessageFormDTO.setApp(AppClientConstant.APP_RESI);
userMessageFormDTO.setTitle(ResiWarmUserMessageConstant.GROUP_TITLE);
//调用gov-org服务查询网格信息
CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO();
customerGridFormDTO.setGridId(formDTO.getGridId());
Result<CustomerGridDTO> result = govOrgFeignClient.getCustomerGridByGridId(customerGridFormDTO);
String gridName = null;
if (result.success() && null != result.getData()) {
gridName = result.getData().getGridName();
}
String messageContent = String.format(userMsg, gridName);
userMessageFormDTO.setMessageContent(messageContent);
userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ);
//保存消息
return epmetMessageFeignClient.saveUserMessage(userMessageFormDTO);
}
/**
* 政府端-热心居民申请-审核驳回
*
* @param
* @return void
* @author sun
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Result reject(ResiWarmAuditRejectFormDTO formDTO) {
Result result = new Result();
//0:先校验数据是否是未审核状态,防止接口测试调用多次
ResiWarmheartedApplyEntity entity = baseDao.selectById(formDTO.getApplyId());
if (null == entity || !ResiWarmheartedVisitConstant.UNDER_AUDITTING.equals(entity.getAuditStatus())) {
result.error(ResiWarmheartedVisitConstant.AUDIT_EXCEPTION);
return result;
}
//1:更新热心居民申请表数据
//审核状态-未通过
entity.setAuditStatus(PartyMemberConstant.REJECTED);
entity.setRefuseReason(formDTO.getRefuseReason());
baseDao.updateById(entity);
//2:为申请人发送审核驳回消息提示
//查询申请信息
auditMessage(entity, ResiWarmUserMessageConstant.AUDIT_REJECT_MSG);
return result;
}
/**
* 政府端-热心居民申请详情信息
*
* @param
* @return void
* @author sun
*/
@Override
public Result<ResiWarmAuditResultDTO> getDetail(ResiWarmGetDetailFormDTO formDTO) {
Result<ResiWarmAuditResultDTO> result = new Result<>();
//1:根据申请Id查询热心居民申请审核详情
ResiWarmheartedApplyEntity entity = baseDao.selectById(formDTO.getApplyId());
if (null == entity) {
result.error(ResiWarmheartedVisitConstant.SELECT_EXCEPTION);
return result;
}
//2:修改申请数据状态为已读
if(!ResiWarmheartedVisitConstant.READ.equals(entity.getReadFlag())){
entity.setReadFlag(ResiWarmheartedVisitConstant.READ);
baseDao.updateById(entity);
}
//3:调用epmet-user服务查询用户头像 昵称信息
UserResiInfoFormDTO userResiInfoFormDTO = new UserResiInfoFormDTO();
userResiInfoFormDTO.setCustomerId(entity.getCustomerId());
userResiInfoFormDTO.setUserId(entity.getUserId());
Result<UserResiInfoResultDTO> resultUserInfo = epmetUserFeignClient.getUserResiInfoDTO(userResiInfoFormDTO);
if (!resultUserInfo.success() || null == resultUserInfo.getData()) {
result.error(ResiWarmheartedVisitConstant.SELECT_EXCEPTION);
return result;
}
UserResiInfoResultDTO userInfo = resultUserInfo.getData();
ResiWarmAuditResultDTO resultDTO = ConvertUtils.sourceToTarget(entity, ResiWarmAuditResultDTO.class);
resultDTO.setApplyTime(entity.getUpdatedTime());
resultDTO.setUserNickName(null == userInfo.getShowName() ? "" : userInfo.getShowName());
resultDTO.setUserHeadPhoto(null == userInfo.getHeadPhoto() ? "" : userInfo.getHeadPhoto());
resultDTO.setStreet(userInfo.getStreet());
return result.ok(resultDTO);
}
}

42
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/warmhearted/ResiWarmheartedApplyDao.xml

@ -56,6 +56,48 @@
AND rw.audit_status != #{auditStatus}
</if>
</select>
<select id="selectAuditedApplyList"
parameterType="com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditedFromDTO"
resultType="com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity">
SELECT
*
FROM
resi_warmhearted_apply
WHERE customer_id = #{customerId}
AND grid_id = #{gridId}
AND audit_status != 'under_auditting'
AND DEL_FLAG = 0
ORDER BY UPDATED_TIME DESC
LIMIT #{pageNo}, #{pageSize}
</select>
<select id="selectResiWarmAuditList"
resultType="com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO">
SELECT
id AS 'applyId',
customer_id AS 'customerId',
grid_id AS 'gridId',
user_id AS 'userId',
reason AS 'reason',
audit_status AS 'auditStatus',
refuse_reason AS 'refuseReason',
read_flag AS 'readFlag',
message_text AS 'messageText',
resi_warm_visit_id AS 'resiWarmVisitId',
created_time AS 'applyTime'
FROM resi_warmhearted_apply
WHERE del_flag = '0'
<if test='customerId != "" and customerId != null'>
AND customer_id = #{customerId}
</if>
<if test='gridId != "" and gridId != null'>
AND grid_id = #{gridId}
</if>
<if test='auditStatus != "" and auditStatus != null'>
AND audit_status = #{auditStatus}
</if>
ORDER BY CREATED_TIME DESC
LIMIT #{pageNo}, #{pageSize}
</select>
</mapper>

5
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/redis/migration/db.sql

@ -0,0 +1,5 @@
#epmet_resi_partymember数据库-热心居民申请表新增字段
ALTER TABLE resi_warmhearted_apply ADD (
READ_FLAG VARCHAR (255) DEFAULT NULL COMMENT '审核人员已读未读标识(未读:unread 界面显示红点; 已读:read 不显示红点)',
MESSAGE_TEXT VARCHAR (500) DEFAULT NULL COMMENT '消息通知内容'
);

1
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java

@ -172,6 +172,7 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl<RegisterRelatio
QueryWrapper<UserCustomerEntity> wrapper = new QueryWrapper<>();
wrapper.eq(UserCustomerConstant.CUSTOMER_ID,enterGridFormDTO.getCustomerId());
wrapper.eq(UserCustomerConstant.USER_ID,enterGridFormDTO.getUserId());
wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
//1.查找用户注册关系表,如果没有表示当前用户为陌生人(拉取用户微信表信息),如果有表示当前用户已经进行居民认证

Loading…
Cancel
Save