Browse Source

Merge branches 'dev_temp' and 'release_temp' of http://git.elinkit.com.cn:7070/r/epmet-cloud into release_temp

dev_shibei_match
wxz 5 years ago
parent
commit
792f6a1e34
  1. 5
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java
  2. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  3. 11
      epmet-gateway/pom.xml
  4. 9
      epmet-gateway/src/main/resources/bootstrap.yml
  5. 35
      epmet-module/epmet-ext/epmet-ext-client/pom.xml
  6. 31
      epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinAgencyFormDTO.java
  7. 31
      epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinDeptFormDTO.java
  8. 32
      epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinGridFormDTO.java
  9. 32
      epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/RoleResultDTO.java
  10. 42
      epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/StaffSinDeptResultDTO.java
  11. 11
      epmet-module/epmet-ext/epmet-ext-server/Dockerfile
  12. 17
      epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml
  13. 17
      epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml
  14. 17
      epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-test.yml
  15. 293
      epmet-module/epmet-ext/epmet-ext-server/pom.xml
  16. 17
      epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/EpmetExtApplication.java
  17. 40
      epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/aspect/RequestLogAspect.java
  18. 26
      epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/config/ModuleConfigImpl.java
  19. 17
      epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java
  20. 65
      epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java
  21. 41
      epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java
  22. 126
      epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java
  23. 100
      epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml
  24. 1
      epmet-module/epmet-ext/epmet-ext-server/src/main/resources/db/migration/V0.0.1__demo.sql
  25. 164
      epmet-module/epmet-ext/epmet-ext-server/src/main/resources/logback-spring.xml
  26. 21
      epmet-module/epmet-ext/pom.xml
  27. 1
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java
  28. 20
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyIdFormDTO.java
  29. 21
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerIdFormDTO.java
  30. 20
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentIdFormDTO.java
  31. 20
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GridIdFormDTO.java
  32. 20
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridCountResultDTO.java
  33. 43
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  34. 25
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  35. 5
      epmet-module/gov-org/gov-org-server/pom.xml
  36. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
  37. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java
  38. 13
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffDepartmentController.java
  39. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
  40. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java
  41. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java
  42. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
  43. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java
  44. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffDepartmentService.java
  45. 48
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  46. 18
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java
  47. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffDepartmentServiceImpl.java
  48. 11
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  49. 11
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml
  50. 11
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml
  51. 48
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java
  52. 16
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDetailResultDTO.java
  53. 2
      epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml
  54. 2
      epmet-module/gov-project/gov-project-server/pom.xml
  55. 8
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java
  56. 10
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java
  57. 9
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java
  58. 10
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java
  59. 77
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  60. 6
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java
  61. 13
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml
  62. 5
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerDTO.java
  63. 17
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/GridCountFormDTO.java
  64. 36
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoResultDTO.java
  65. 17
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/GridCountResultDTO.java
  66. 11
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java
  67. 7
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java
  68. 11
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/constant/ModuleConstant.java
  69. 23
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java
  70. 18
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java
  71. 5
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerEntity.java
  72. 3
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/excel/CustomerExcel.java
  73. 23
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java
  74. 33
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java
  75. 5
      epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.2__update_customer.sql
  76. 24
      epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml
  77. 116
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionDetailDTO.java
  78. 67
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomizedDTO.java
  79. 106
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedDTO.java
  80. 106
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedVisitedDTO.java
  81. 90
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionShoppingHistoryDTO.java
  82. 23
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CommonFunctionIdFormDTO.java
  83. 59
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionCustomizedListFormDTO.java
  84. 35
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java
  85. 56
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionVisitedFromDTO.java
  86. 72
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveFunctionCustomizedFormDTO.java
  87. 53
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomerFunctionFormDTO.java
  88. 72
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java
  89. 47
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateShoppingStatusFormDTO.java
  90. 61
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java
  91. 61
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListDTO.java
  92. 29
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListResultDTO.java
  93. 50
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionDetailResultDTO.java
  94. 2
      epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml
  95. 2
      epmet-module/oper-customize/oper-customize-server/pom.xml
  96. 158
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java
  97. 177
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java
  98. 128
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedVisitedController.java
  99. 94
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionShoppingHistoryController.java
  100. 79
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java

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

@ -133,4 +133,9 @@ public interface ServiceConstant {
* 积分银行
* */
String EPMET_POINT_SERVER = "epmet-point-server";
/**
* 开放接口服务
*/
String EPMET_EXT_SERVER = "epmet-ext-server";
}

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

@ -75,6 +75,8 @@ public enum EpmetErrorCode {
STAFF_ADD_FAILED(8403,"人员添加失败"),
STAFF_EDIT_FAILED(8404,"人员编辑失败"),
CANNOT_DISABLE_YOURSELF(8405,"您不能禁用自己"),
NO_SET_GRID_COUNT(8406,"您还未设置创建网格数量上限,请联系管理员设置"),
GRID_COUNT_UP(8407,"您的创建网格数量已到达上限,请联系管理员设置"),
ALREADY_EVALUATE(8501,"您已评价"),
ALREADY_VOTE(8502,"您已表态"),

11
epmet-gateway/pom.xml

@ -190,12 +190,15 @@
<gateway.routes.epmet-third-server.uri>lb://epmet-third-server</gateway.routes.epmet-third-server.uri>
<!-- <gateway.routes.epmet-third-server.uri>http://localhost:8110</gateway.routes.epmet-third-server.uri>-->
<!-- 爱心互助 -->
<!-- 32、爱心互助 -->
<gateway.routes.epmet-heart-server.url>lb://epmet-heart-server</gateway.routes.epmet-heart-server.url>
<!-- <gateway.routes.epmet-heart-server.url>http://127.0.0.1:8111</gateway.routes.epmet-heart-server.url>-->
<!-- 32、 积分银行 -->
<!-- 33、 积分银行 -->
<gateway.routes.epmet-point-server.url>lb://epmet-point-server</gateway.routes.epmet-point-server.url>
<!-- <gateway.routes.epmet-point-server.url>http://127.0.0.1:8112</gateway.routes.epmet-point-server.url>-->
<!-- 34、 开放接口服务 -->
<gateway.routes.epmet-ext-server.url>lb://epmet-ext-server</gateway.routes.epmet-ext-server.url>
<!-- <gateway.routes.epmet-ext-server.url>http://127.0.0.1:8113</gateway.routes.epmet-ext-server.url>-->
</properties>
</profile>
<profile>
@ -284,6 +287,8 @@
<gateway.routes.epmet-heart-server.url>lb://epmet-heart-server</gateway.routes.epmet-heart-server.url>
<!-- 33、积分银行 -->
<gateway.routes.epmet-point-server.url>lb://epmet-point-server</gateway.routes.epmet-point-server.url>
<!-- 34、开放接口服务 -->
<gateway.routes.epmet-ext-server.url>lb://epmet-ext-server</gateway.routes.epmet-ext-server.url>
</properties>
</profile>
<profile>
@ -369,6 +374,8 @@
<gateway.routes.epmet-heart-server.url>lb://epmet-heart-server</gateway.routes.epmet-heart-server.url>
<!-- 33、 积分银行 -->
<gateway.routes.epmet-point-server.url>lb://epmet-point-server</gateway.routes.epmet-point-server.url>
<!-- 34、开放接口服务 -->
<gateway.routes.epmet-ext-server.url>lb://epmet-ext-server</gateway.routes.epmet-ext-server.url>
</properties>
</profile>
</profiles>

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

@ -313,6 +313,15 @@ spring:
filters:
- StripPrefix=1
- CpAuth=true
# 开放接口服务
- id: epmet-ext-server
uri: @gateway.routes.epmet-ext-server.url@
order: 34
predicates:
- Path=${server.servlet.context-path}/epmet/ext/**
filters:
- StripPrefix=1
- CpAuth=true
nacos:
discovery:
server-addr: @nacos.server-addr@

35
epmet-module/epmet-ext/epmet-ext-client/pom.xml

@ -0,0 +1,35 @@
<?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>
<parent>
<artifactId>epmet-ext</artifactId>
<groupId>com.epmet</groupId>
<version>2.0.0</version>
</parent>
<artifactId>epmet-ext-client</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-tools</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-mp</artifactId>
<version>3.6.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
</build>
</project>

31
epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinAgencyFormDTO.java

@ -0,0 +1,31 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/13 9:33 上午
*/
@Data
public class StaffSinAgencyFormDTO implements Serializable {
private static final long serialVersionUID = 1827402498483127629L;
//后端自己看
public interface StaffSinAgency{}
/**
* appId+customerId+时间戳加密secret
*/
// @NotBlank(message = "secret不能为空",groups = {StaffSinDept.class})
private String accessToken;
/**
* 机关Id
*/
@NotBlank(message = "机关Id不能为空",groups = {StaffSinAgency.class})
private String agencyId;
}

31
epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinDeptFormDTO.java

@ -0,0 +1,31 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/13 9:33 上午
*/
@Data
public class StaffSinDeptFormDTO implements Serializable {
private static final long serialVersionUID = 1827404498483127629L;
//后端自己看
public interface StaffSinDept{}
/**
* appId+customerId+时间戳加密secret
*/
// @NotBlank(message = "secret不能为空",groups = {StaffSinDept.class})
private String accessToken;
/**
* 部门Id
*/
@NotBlank(message = "部门Id不能为空",groups = {StaffSinDept.class})
private String departmentId;
}

32
epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinGridFormDTO.java

@ -0,0 +1,32 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/13 9:33 上午
*/
@Data
public class StaffSinGridFormDTO implements Serializable {
private static final long serialVersionUID = 1827404498483127629L;
//后端自己看
public interface StaffSinGrid{}
/**
* appId+customerId+时间戳加密secret
*/
// @NotBlank(message = "secret不能为空",groups = {StaffSinGrid.class})
private String accessToken;
/**
* 网格Id
*/
@NotBlank(message = "网格Id不能为空",groups = {StaffSinGrid.class})
private String gridId;
}

32
epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/RoleResultDTO.java

@ -0,0 +1,32 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/13 9:30 上午
*/
@Data
public class RoleResultDTO implements Serializable {
private static final long serialVersionUID = -4321366067217459L;
/**
* 角色key
*/
private String roleKey;
/**
* 角色名称
*/
private String roleName;
/**
* 用户id
*/
@JsonIgnore
private String userId;
}

42
epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/StaffSinDeptResultDTO.java

@ -0,0 +1,42 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/8/13 9:25 上午
*/
@Data
public class StaffSinDeptResultDTO implements Serializable {
private static final long serialVersionUID = -3440415466710443002L;
/**
* 工作人员Id
*/
private String staffId;
/**
* 工作人员名称
*/
private String staffName;
/**
* 头像
*/
private String headPhoto;
/**
* 性别1男2女0未知
*/
private Integer gender;
/**
* 角色列表
*/
private List<RoleResultDTO> roleList;
}

11
epmet-module/epmet-ext/epmet-ext-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 8113
ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"]

17
epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml

@ -0,0 +1,17 @@
version: "3.7"
services:
epmet-ext-server:
container_name: epmet-ext-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-ext-server:0.0.1
ports:
- "8113:8113"
network_mode: host # 使用现有网络
volumes:
- "/opt/epmet-cloud-logs/dev:/logs"
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar"
deploy:
resources:
limits:
cpus: '0.1'
memory: 250M

17
epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml

@ -0,0 +1,17 @@
version: "3.7"
services:
epmet-ext-server:
container_name: epmet-ext-server-prod
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-ext-server:0.0.1
ports:
- "8113:8113"
network_mode: host # 使用现有网络
volumes:
- "/opt/epmet-cloud-logs/prod:/logs"
environment:
RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar"
deploy:
resources:
limits:
cpus: '0.1'
memory: 600M

17
epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-test.yml

@ -0,0 +1,17 @@
version: "3.7"
services:
epmet-ext-server:
container_name: epmet-ext-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-ext-server:0.0.1
ports:
- "8113:8113"
network_mode: host # 使用现有网络
volumes:
- "/opt/epmet-cloud-logs/test:/logs"
environment:
RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar"
deploy:
resources:
limits:
cpus: '0.1'
memory: 250M

293
epmet-module/epmet-ext/epmet-ext-server/pom.xml

@ -0,0 +1,293 @@
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.0.1</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-ext</artifactId>
<version>2.0.0</version>
</parent>
<artifactId>epmet-ext-server</artifactId>
<packaging>jar</packaging>
<properties>
<aliyun.core.version>3.2.2</aliyun.core.version>
<aliyun.dysmsapi.version>1.1.0</aliyun.dysmsapi.version>
<qcloud.qcloudsms.version>1.0.5</qcloud.qcloudsms.version>
<freemarker.version>2.3.28</freemarker.version>
</properties>
<dependencies>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-ext-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-tools</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-user-client</artifactId>
<version>2.0.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>epmet-commons-mybatis</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>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>${aliyun.core.version}</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
<version>${aliyun.dysmsapi.version}</version>
</dependency>
<dependency>
<groupId>com.github.qcloudsms</groupId>
<artifactId>qcloudsms</artifactId>
<version>${qcloud.qcloudsms.version}</version>
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>${freemarker.version}</version>
</dependency>
<!-- 替换Feign原生httpclient -->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
<version>10.3.0</version>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<!--<version>5.1.1</version>-->
</dependency>
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-common</artifactId>
<version>3.6.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-common-clienttoken</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>oper-crm-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-oss-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>5.1.12.RELEASE</version>
<scope>compile</scope>
</dependency>
<!-- 钉钉机器人 -->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>alibaba-dingtalk-service-sdk</artifactId>
<version>1.0.1</version>
</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</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<server.port>8113</server.port>
<spring.profiles.active>dev</spring.profiles.active>
<!-- 数据库配置-->
<spring.datasource.druid.url>
<![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_third?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url>
<spring.datasource.druid.username>epmet_third_user</spring.datasource.druid.username>
<spring.datasource.druid.password>EpmEt-db-UsEr</spring.datasource.druid.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.130</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/>
<spring.flyway.enabled>false</spring.flyway.enabled>
</properties>
</profile>
<profile>
<id>test</id>
<!--<activation>
<activeByDefault>true</activeByDefault>
</activation>-->
<properties>
<server.port>8113</server.port>
<spring.profiles.active>test</spring.profiles.active>
<!-- 数据库配置-->
<spring.datasource.druid.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_third?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url>
<spring.datasource.druid.username>epmet</spring.datasource.druid.username>
<spring.datasource.druid.password>elink@833066</spring.datasource.druid.password>
<!-- 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/>
<spring.flyway.enabled>true</spring.flyway.enabled>
</properties>
</profile>
<profile>
<id>prod</id>
<!--<activation>
<activeByDefault>true</activeByDefault>
</activation>-->
<properties>
<server.port>8113</server.port>
<spring.profiles.active>prod</spring.profiles.active>
<!-- 数据库配置-->
<spring.datasource.druid.url>
<![CDATA[jdbc:mysql://rm-m5e3vzs2637224wj9.mysql.rds.aliyuncs.com:3306/epmet_third?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url>
<spring.datasource.druid.username>epmet_third_user</spring.datasource.druid.username>
<spring.datasource.druid.password>EpmEt-db-UsEr</spring.datasource.druid.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com</spring.redis.host>
<spring.redis.port>6379</spring.redis.port>
<spring.redis.password>EpmEtclOUdrEdIs!Q2w</spring.redis.password>
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>192.168.11.180:8848</nacos.server-addr>
<nacos.discovery.namespace>bd205d23-e696-47be-b995-916313f86e99</nacos.discovery.namespace>
<nacos.config.namespace></nacos.config.namespace>
<nacos.config.group></nacos.config.group>
<nacos.config-enabled>false</nacos.config-enabled>
<nacos.ip/>
<spring.flyway.enabled>true</spring.flyway.enabled>
</properties>
</profile>
</profiles>
</project>

17
epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/EpmetExtApplication.java

@ -0,0 +1,17 @@
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;
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
public class EpmetExtApplication {
public static void main(String[] args) {
SpringApplication.run(EpmetExtApplication.class, args);
}
}

40
epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/aspect/RequestLogAspect.java

@ -0,0 +1,40 @@
package com.epmet.aspect;
import com.epmet.commons.tools.aspect.BaseRequestLogAspect;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/**
* 日志/异常处理切面实现调用父类方法完成日志记录和异常处理
*/
@Aspect
@Component
@Order(0)
public class RequestLogAspect extends BaseRequestLogAspect {
@Override
@Around(value = "execution(* com.epmet.controller.*Controller*.*(..)) ")
public Object proceed(ProceedingJoinPoint point) throws Throwable {
return super.proceed(point, getRequest());
}
/**
* 获取Request对象
*
* @return
*/
private HttpServletRequest getRequest() {
RequestAttributes ra = RequestContextHolder.getRequestAttributes();
ServletRequestAttributes sra = (ServletRequestAttributes) ra;
return sra.getRequest();
}
}

26
epmet-module/epmet-ext/epmet-ext-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 "epmetext";
}
}

17
epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java

@ -0,0 +1,17 @@
package com.epmet.constant;
/**
* @Description
* @author zxc
*/
public interface ModuleConstant {
String ERROR_GOV_ORG_GRID = "调用gov_org服务查询【网格】下的所有工作人员失败";
String ERROR_GOV_ORG_DEPARTMENT = "调用gov_org服务查询【部门】下的所有工作人员失败";
String ERROR_GOV_ORG_AGENCY = "调用gov_org服务查询【机关】下的所有工作人员失败";
String ERROR_EPMET_USER = "调用epmet_user服务查询网格下的所有工作人员失败";
}

65
epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java

@ -0,0 +1,65 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.*;
import com.epmet.dto.result.StaffSinAgencyResultDTO;
import com.epmet.dto.result.StaffSinDeptResultDTO;
import com.epmet.dto.result.StaffSinGridResultDTO;
import com.epmet.service.OpenUpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/8/13 9:16 上午
*/
@RestController
@RequestMapping("staff")
public class OpenUpController {
@Autowired
private OpenUpService openUpService;
/**
* @Description 网格工作人员 被禁用的未激活的不显示
* @param formDTO
* @author zxc
* @date 2020/8/13 9:42 上午
*/
@PostMapping("staffsingrid")
public Result<List<StaffSinGridResultDTO>> staffSinGrid(@RequestBody StaffSinGridFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, StaffSinGridFormDTO.StaffSinGrid.class);
return new Result<List<StaffSinGridResultDTO>>().ok(openUpService.staffSinGrid(formDTO));
}
/**
* @Description 部门工作人员 被禁用的未激活的不显示
* @param formDTO
* @author zxc
* @date 2020/8/13 9:51 上午
*/
@PostMapping("staffsindept")
public Result<List<StaffSinDeptResultDTO>> staffSinDept(@RequestBody StaffSinDeptFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, StaffSinDeptFormDTO.StaffSinDept.class);
return new Result<List<StaffSinDeptResultDTO>>().ok(openUpService.staffSinDept(formDTO));
}
/**
* @Description 机关工作人员 被禁用的未激活的不显示
* @param formDTO
* @author zxc
* @date 2020/8/17 9:59 上午
*/
@PostMapping("staffsinagency")
public Result<List<StaffSinAgencyResultDTO>> staffSinAgency(@RequestBody StaffSinAgencyFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, StaffSinAgencyFormDTO.StaffSinAgency.class);
return new Result<List<StaffSinAgencyResultDTO>>().ok(openUpService.staffSinAgency(formDTO));
}
}

41
epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java

@ -0,0 +1,41 @@
package com.epmet.service;
import com.epmet.dto.form.StaffSinAgencyFormDTO;
import com.epmet.dto.form.StaffSinDeptFormDTO;
import com.epmet.dto.form.StaffSinGridFormDTO;
import com.epmet.dto.result.StaffSinAgencyResultDTO;
import com.epmet.dto.result.StaffSinDeptResultDTO;
import com.epmet.dto.result.StaffSinGridResultDTO;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/8/13 9:17 上午
*/
public interface OpenUpService {
/**
* @Description 网格工作人员 被禁用的未激活的不显示
* @param formDTO
* @author zxc
* @date 2020/8/13 9:42 上午
*/
List<StaffSinGridResultDTO> staffSinGrid(StaffSinGridFormDTO formDTO);
/**
* @Description 部门工作人员 被禁用的未激活的不显示
* @param formDTO
* @author zxc
* @date 2020/8/13 9:51 上午
*/
List<StaffSinDeptResultDTO> staffSinDept(StaffSinDeptFormDTO formDTO);
/**
* @Description 机关工作人员 被禁用的未激活的不显示
* @param formDTO
* @author zxc
* @date 2020/8/17 9:59 上午
*/
List<StaffSinAgencyResultDTO> staffSinAgency(StaffSinAgencyFormDTO formDTO);
}

126
epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java

@ -0,0 +1,126 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.ModuleConstant;
import com.epmet.dto.form.*;
import com.epmet.dto.result.StaffSinAgencyResultDTO;
import com.epmet.dto.result.StaffSinDeptResultDTO;
import com.epmet.dto.result.StaffSinGridResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.OpenUpService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* @Author zxc
* @DateTime 2020/8/13 9:18 上午
*/
@Service
public class OpenUpServiceImpl implements OpenUpService {
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
/**
* @Description 网格工作人员 被禁用的未激活的不显示
* @param formDTO
* @author zxc
* @date 2020/8/13 9:42 上午
*/
@Override
public List<StaffSinGridResultDTO> staffSinGrid(StaffSinGridFormDTO formDTO) {
CommonGridIdFormDTO commonGridId = new CommonGridIdFormDTO();
commonGridId.setGridId(formDTO.getGridId());
commonGridId.setUserId(UUID.randomUUID().toString().replace(StrConstant.HYPHEN, ""));
Result<List<String>> gridStaffs = govOrgOpenFeignClient.getGridStaffs(commonGridId);
if (!gridStaffs.success()){
throw new RenException(ModuleConstant.ERROR_GOV_ORG_GRID);
}
if (gridStaffs.getData().size() == NumConstant.ZERO){
return new ArrayList<>();
}
return this.getStaffList(gridStaffs.getData());
}
/**
* @Description 部门工作人员 被禁用的未激活的不显示
* @param formDTO
* @author zxc
* @date 2020/8/13 9:51 上午
*/
@Override
public List<StaffSinDeptResultDTO> staffSinDept(StaffSinDeptFormDTO formDTO) {
DepartmentIdFormDTO departmentId = new DepartmentIdFormDTO();
departmentId.setDepartmentId(formDTO.getDepartmentId());
Result<List<String>> departmentStaffs = govOrgOpenFeignClient.getDepartmentStaffs(departmentId);
if (!departmentStaffs.success()){
throw new RenException(ModuleConstant.ERROR_GOV_ORG_DEPARTMENT);
}
if (departmentStaffs.getData().size() == NumConstant.ZERO){
return new ArrayList<>();
}
List<StaffSinGridResultDTO> data = this.getStaffList(departmentStaffs.getData());
List<StaffSinDeptResultDTO> result = new ArrayList<>();
data.forEach(staff -> {
StaffSinDeptResultDTO dept = new StaffSinDeptResultDTO();
BeanUtils.copyProperties(staff,dept);
result.add(dept);
});
return result;
}
/**
* @Description 机关工作人员 被禁用的未激活的不显示
* @param formDTO
* @author zxc
* @date 2020/8/17 9:59 上午
*/
@Override
public List<StaffSinAgencyResultDTO> staffSinAgency(StaffSinAgencyFormDTO formDTO) {
AgencyIdFormDTO agencyId = new AgencyIdFormDTO();
agencyId.setAgencyId(formDTO.getAgencyId());
Result<List<String>> agencyStaffs = govOrgOpenFeignClient.getAgencyStaffs(agencyId);
if (!agencyStaffs.success()){
throw new RenException(ModuleConstant.ERROR_GOV_ORG_AGENCY);
}
if (agencyStaffs.getData().size() == NumConstant.ZERO){
return new ArrayList<>();
}
List<StaffSinGridResultDTO> staffList = this.getStaffList(agencyStaffs.getData());
List<StaffSinAgencyResultDTO> result = new ArrayList<>();
staffList.forEach(staff -> {
StaffSinAgencyResultDTO agency = new StaffSinAgencyResultDTO();
BeanUtils.copyProperties(staff,agency);
result.add(agency);
});
return result;
}
/**
* @Description 获取工作人员信息
* @param userIds
* @author zxc
* @date 2020/8/17 1:30 下午
*/
public List<StaffSinGridResultDTO> getStaffList(List<String> userIds){
UserIdsFormDTO userIdsForm = new UserIdsFormDTO();
userIdsForm.setUserIds(userIds);
Result<List<StaffSinGridResultDTO>> staffInfoList = epmetUserOpenFeignClient.getStaffInfoList(userIdsForm);
if (!staffInfoList.success()){
throw new RenException(ModuleConstant.ERROR_EPMET_USER);
}
return staffInfoList.getData();
}
}

100
epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml

@ -0,0 +1,100 @@
server:
port: @server.port@
servlet:
context-path: /epmet/ext
spring:
main:
allow-bean-definition-overriding: true
application:
name: epmet-ext-server
# dev|test|prod
profiles:
active: dev
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
datasource:
druid:
#MySQL
driver-class-name: com.mysql.cj.jdbc.Driver
url: @spring.datasource.druid.url@
username: @spring.datasource.druid.username@
password: @spring.datasource.druid.password@
cloud:
nacos:
discovery:
server-addr: @nacos.server-addr@
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
flyway:
enabled: @spring.flyway.enabled@
locations: classpath:db/migration
url: @spring.datasource.druid.url@
user: @spring.datasource.druid.username@
password: @spring.datasource.druid.password@
baseline-on-migrate: true
baseline-version: 0
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: ALWAYS
mybatis-plus:
mapper-locations: classpath:/mapper/**/*.xml
typeAliasesPackage: com.epmet.entity
global-config:
db-config:
id-type: ID_WORKER
field-strategy: NOT_NULL
column-underline: true
banner: false
configuration:
map-underscore-to-camel-case: true
cache-enabled: false
call-setters-on-nulls: true
jdbc-type-for-null: 'null'
feign:
hystrix:
enabled: true
client:
config:
default:
loggerLevel: BASIC
httpclient:
enabled: true
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 60000
ribbon:
ReadTimeout: 300000
ConnectTimeout: 300000
pagehelper:
helper-dialect: mysql
reasonable: false

1
epmet-module/epmet-ext/epmet-ext-server/src/main/resources/db/migration/V0.0.1__demo.sql

@ -0,0 +1 @@
select 0;

164
epmet-module/epmet-ext/epmet-ext-server/src/main/resources/logback-spring.xml

@ -0,0 +1,164 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<property name="log.path" value="logs/ext"/>
<springProperty scope="context" name="appname" source="spring.application.name"/>
<!-- 日志上下文名称 -->
<contextName>${appname}</contextName>
<!-- 彩色日志格式 -->
<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} [%contextName] [%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} [%contextName] [%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} [%contextName] [%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} [%contextName] [%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>

21
epmet-module/epmet-ext/pom.xml

@ -0,0 +1,21 @@
<?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>epmet-ext</artifactId>
<packaging>pom</packaging>
<modules>
<module>epmet-ext-client</module>
<module>epmet-ext-server</module>
</modules>
</project>

1
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java

@ -31,6 +31,7 @@ public class AppLetAuthorizationController {
@PostMapping("gotoauth")
public Result<GoToAuthResultDTO> goToAuth(@LoginUser TokenDto tokenDto, @RequestBody GoToAuthFormDTO formDTO, @RequestHeader("source")String source){
ValidatorUtils.validateEntity(formDTO);
GoToAuthResultDTO goToAuthResultDTO = appLetAuthorizationService.goToAuth(tokenDto,formDTO,source);
return new Result().ok(goToAuthResultDTO);
}

20
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyIdFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/17 10:37 上午
*/
@Data
public class AgencyIdFormDTO implements Serializable {
private static final long serialVersionUID = -1719033407335647411L;
/**
* 部门Id
*/
private String agencyId;
}

21
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerIdFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/13 5:56 下午
*/
@Data
public class CustomerIdFormDTO implements Serializable {
private static final long serialVersionUID = 4512080710854617599L;
public interface Customer{}
@NotBlank(message = "customerId不能为空",groups = {Customer.class})
private String customerId;
}

20
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentIdFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/13 10:37 上午
*/
@Data
public class DepartmentIdFormDTO implements Serializable {
private static final long serialVersionUID = -1718433407335647411L;
/**
* 部门Id
*/
private String departmentId;
}

20
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GridIdFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/13 10:35 上午
*/
@Data
public class GridIdFormDTO implements Serializable {
private static final long serialVersionUID = -1062540828459359881L;
/**
* 网格Id
*/
private String gridId;
}

20
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridCountResultDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/14 9:27 上午
*/
@Data
public class CustomerGridCountResultDTO implements Serializable {
private static final long serialVersionUID = 386294009143897744L;
/**
* 客户下的网格数量
*/
private Integer gridCount;
}

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

@ -4,10 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerPartyBranchDTO;
import com.epmet.dto.form.AddAgencyAndStaffFormDTO;
import com.epmet.dto.form.BelongGridNameFormDTO;
import com.epmet.dto.form.ListPartyBranchFormDTO;
import com.epmet.dto.form.StaffOrgFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.fallback.GovOrgOpenFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
@ -22,7 +19,7 @@ import java.util.List;
* @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:37
*/
// @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class, url = "localhost:8092")
//@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class, url = "localhost:8092")
@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class)
public interface GovOrgOpenFeignClient {
@ -187,4 +184,40 @@ public interface GovOrgOpenFeignClient {
**/
@PostMapping(value = "/gov/org/customeragency/getStaffOrgList",consumes = MediaType.APPLICATION_JSON_VALUE)
Result<List<StaffOrgsResultDTO>> getStaffOrgList(StaffOrgFormDTO staffOrgFormDTO);
/**
* @Description 查询一个网格下的所有工作人员
* @param gridIdFormDTO
* @author zxc
* @date 2020/8/13 10:46 上午
*/
@PostMapping(value = "/gov/org/customerstaffgrid/getgridstaffs")
Result<List<String>> getGridStaffs(@RequestBody CommonGridIdFormDTO gridIdFormDTO);
/**
* @Description 查询部门下工作人员
* @param formDTO
* @author zxc
* @date 2020/8/13 2:46 下午
*/
@PostMapping(value = "/gov/org/customerstaffdepartment/getdepartmentstaffs")
Result<List<String>> getDepartmentStaffs(@RequestBody DepartmentIdFormDTO formDTO);
/**
* @Description 查询客户下的网格数量
* @param customerIdFormDTO
* @author zxc
* @date 2020/8/14 9:31 上午
*/
@PostMapping(value = "/gov/org/customergrid/gridcount")
Result<CustomerGridCountResultDTO> selectGridCount(@RequestBody CustomerIdFormDTO customerIdFormDTO);
/**
* @Description 查询机关下工作人员
* @param formDTO
* @author zxc
* @date 2020/8/17
*/
@PostMapping(value = "/gov/org/customerstaffagency/getagencystaffs")
Result<List<String>> getAgencyStaffs(@RequestBody AgencyIdFormDTO formDTO);
}

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

@ -5,10 +5,7 @@ import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerPartyBranchDTO;
import com.epmet.dto.form.AddAgencyAndStaffFormDTO;
import com.epmet.dto.form.BelongGridNameFormDTO;
import com.epmet.dto.form.ListPartyBranchFormDTO;
import com.epmet.dto.form.StaffOrgFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.GovOrgOpenFeignClient;
import org.springframework.stereotype.Component;
@ -114,4 +111,24 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result<List<StaffOrgsResultDTO>> getStaffOrgList(StaffOrgFormDTO staffOrgFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffOrgList", staffOrgFormDTO);
}
@Override
public Result<List<String>> getGridStaffs(CommonGridIdFormDTO gridIdFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridStaffs", gridIdFormDTO);
}
@Override
public Result<List<String>> getDepartmentStaffs(DepartmentIdFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getDepartmentStaffs", formDTO);
}
@Override
public Result<CustomerGridCountResultDTO> selectGridCount(CustomerIdFormDTO customerIdFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectGridCount", customerIdFormDTO);
}
@Override
public Result<List<String>> getAgencyStaffs(AgencyIdFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyStaffs", formDTO);
}
}

5
epmet-module/gov-org/gov-org-server/pom.xml

@ -18,6 +18,11 @@
<artifactId>gov-org-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>oper-crm-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-mybatis</artifactId>

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java

@ -216,4 +216,16 @@ public class CustomerGridController {
return customerGridService.queryCustomerGridList(formDTO);
}
/**
* @Description 查询客户下的网格数量
* @param customerIdFormDTO
* @author zxc
* @date 2020/8/14 9:31 上午
*/
@PostMapping("gridcount")
public Result<CustomerGridCountResultDTO> selectGridCount(@RequestBody CustomerIdFormDTO customerIdFormDTO){
ValidatorUtils.validateEntity(customerIdFormDTO, CustomerIdFormDTO.Customer.class);
return new Result<CustomerGridCountResultDTO>().ok(customerGridService.selectGridCount(customerIdFormDTO));
}
}

20
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java

@ -17,9 +17,7 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
@ -28,12 +26,8 @@ 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.dto.CustomerStaffAgencyDTO;
import com.epmet.dto.form.StaffsInAgencyFromDTO;
import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.result.CommonStaffInfoResultDTO;
import com.epmet.dto.form.AgencyIdFormDTO;
import com.epmet.dto.result.LatestCustomerResultDTO;
import com.epmet.dto.result.StaffInfoResultDTO;
import com.epmet.excel.CustomerStaffAgencyExcel;
import com.epmet.service.CustomerStaffAgencyService;
import org.springframework.beans.factory.annotation.Autowired;
@ -111,7 +105,15 @@ public class CustomerStaffAgencyController {
return customerStaffAgencyService.getLatestCustomer(userId);
}
/**
* @Description 查询机关下工作人员
* @param agencyIdFormDTO
* @author zxc
* @date 2020/8/17 10:14 上午
*/
@PostMapping("getagencystaffs")
public Result<List<String>> getAgencyStaffs(@RequestBody AgencyIdFormDTO agencyIdFormDTO){
return new Result<List<String>>().ok(customerStaffAgencyService.getAgencyStaffs(agencyIdFormDTO));
}
}

13
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffDepartmentController.java

@ -26,6 +26,7 @@ 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.dto.CustomerStaffDepartmentDTO;
import com.epmet.dto.form.DepartmentIdFormDTO;
import com.epmet.excel.CustomerStaffDepartmentExcel;
import com.epmet.service.CustomerStaffDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
@ -91,4 +92,16 @@ public class CustomerStaffDepartmentController {
ExcelUtils.exportExcelToTarget(response, null, list, CustomerStaffDepartmentExcel.class);
}
/**
* @Description 查询部门下工作人员
* @param formDTO
* @author zxc
* @date 2020/8/13 2:46 下午
*/
@PostMapping("getdepartmentstaffs")
public Result<List<String>> getDepartmentStaffs(@RequestBody DepartmentIdFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO);
return new Result<List<String>>().ok(customerStaffDepartmentService.getDepartmentStaffs(formDTO));
}
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java

@ -216,4 +216,12 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
* @Description 单客户-指定区时查询当前城市下除该区之外其余的网格
**/
List<PublicCustomerGridForStrangerResultDTO> selectThirdRestGridWithoutGivenAreaCode(Map<String, Object> map);
/**
* @Description 查询当前客户已有网格数量
* @param customerId
* @author zxc
* @date 2020/8/12 5:10 下午
*/
Integer selectGridCount(@Param("customerId")String customerId);
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java

@ -100,4 +100,12 @@ public interface CustomerStaffAgencyDao extends BaseDao<CustomerStaffAgencyEntit
* @Date 2020/7/23 21:10
**/
CustomerAgencyDTO selectMyAgency(String staffId);
/**
* @Description 查询机关下工作人员的 userId
* @param agencyId
* @author zxc
* @date 2020/8/17 10:19 上午
*/
List<String> getAgencyStaffList(@Param("agencyId")String agencyId);
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java

@ -66,4 +66,12 @@ public interface CustomerStaffDepartmentDao extends BaseDao<CustomerStaffDepartm
* @Description 遍历查询每个部门下人员
*/
List<CustomerStaffDepartmentDTO> selectDeptStaffs(@Param("deptIdList") List<String> deptIdList);
/**
* @Description 查询部门下的工作人员userId
* @param departmentId
* @author zxc
* @date 2020/8/13 2:53 下午
*/
List<String> getDepartmentStaffList(@Param("departmentId")String departmentId);
}

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

@ -251,4 +251,12 @@ public interface CustomerGridService extends BaseService<CustomerGridEntity> {
* @Description 单客户-陌生人导览模块调用-根据地区编码查询客户下的网格列表
**/
Result<List<PublicCustomerGridForStrangerResultDTO>> queryCustomerGridList(ThirdCustomerGridListFormDTO formDTO);
/**
* @Description 查询客户下的网格数量
* @param customerIdFormDTO
* @author zxc
* @date 2020/8/14 9:31 上午
*/
CustomerGridCountResultDTO selectGridCount( CustomerIdFormDTO customerIdFormDTO);
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerStaffAgencyDTO;
import com.epmet.dto.form.AgencyIdFormDTO;
import com.epmet.dto.form.CommonDepartmentFormDTO;
import com.epmet.dto.form.StaffsInAgencyFromDTO;
import com.epmet.dto.form.CommonGridIdFormDTO;
@ -142,4 +143,12 @@ public interface CustomerStaffAgencyService extends BaseService<CustomerStaffAge
* @return com.epmet.dto.CustomerStaffAgencyDTO
*/
CustomerStaffAgencyDTO getInfoByUserId(String userId);
/**
* @Description 查询机关下工作人员
* @param agencyIdFormDTO
* @author zxc
* @date 2020/8/17 10:14 上午
*/
List<String> getAgencyStaffs(AgencyIdFormDTO agencyIdFormDTO);
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffDepartmentService.java

@ -20,6 +20,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.CustomerStaffDepartmentDTO;
import com.epmet.dto.form.DepartmentIdFormDTO;
import com.epmet.entity.CustomerStaffDepartmentEntity;
import java.util.List;
@ -92,4 +93,12 @@ public interface CustomerStaffDepartmentService extends BaseService<CustomerStaf
* @date 2020-04-20
*/
void delete(String[] ids);
/**
* @Description 查询部门下工作人员
* @param formDTO
* @author zxc
* @date 2020/8/13 2:46 下午
*/
List<String> getDepartmentStaffs(DepartmentIdFormDTO formDTO);
}

48
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -29,7 +29,6 @@ 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.constant.CustomerGridConstant;
import com.epmet.dao.CustomerAgencyDao;
import com.epmet.dao.CustomerGridDao;
import com.epmet.dao.CustomerStaffGridDao;
import com.epmet.dto.*;
@ -37,9 +36,9 @@ import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerGridEntity;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.service.CustomerAgencyService;
import com.epmet.service.CustomerGridService;
import com.epmet.service.CustomerStaffGridService;
import com.epmet.util.ModuleConstant;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@ -69,11 +68,11 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@Autowired
private CustomerStaffGridService customerStaffGridService;
@Autowired
private CustomerStaffGridDao customerStaffGridDao;
@Autowired
private CustomerAgencyDao customerAgencyDao;
private OperCrmOpenFeignClient operCrmOpenFeignClient;
@Autowired
private CustomerGridDao customerGridDao;
@Override
public PageData<CustomerGridDTO> page(Map<String, Object> params) {
@ -206,15 +205,36 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
return new Result<GridDetailResultDTO>().ok(griddetail);
}
/**
* @Desc 网格添加
* @Author zxc
* @param tokenDto
* @param addGridFormDTO
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Result<AddGridResultDTO> addGrid(TokenDto tokenDto, AddGridFormDTO addGridFormDTO) {
//查询是否重名
CustomerAgencyDTO customerAgencyDTO=customerAgencyService.get(addGridFormDTO.getAgencyId());
// 1. 查询该客户下可创建网格的最大数量
GridCountFormDTO gridCount = new GridCountFormDTO();
String customerId = customerAgencyDTO.getCustomerId();
gridCount.setCustomerId(customerId);
GridCountResultDTO grid = operCrmOpenFeignClient.getGridCount(gridCount).getData();
if (grid.getGridCount().equals(NumConstant.ZERO)){
throw new RenException(EpmetErrorCode.GRID_COUNT_UP.getCode());
}
// 2. 判断当前客户下存在的网格数量
Integer gridCounts = customerGridDao.selectGridCount(customerId);
if (gridCounts >= grid.getGridCount()){
throw new RenException(EpmetErrorCode.GRID_COUNT_UP.getCode());
}
// 3. 查询网格名称是否重名
AddGridResultDTO gridResult = baseDao.selectGridIdByGridName(addGridFormDTO.getGridName(), addGridFormDTO.getAgencyId(), null);
if (gridResult!=null){
return new Result().error(EpmetErrorCode.NOT_ADD_GRID.getCode());
}
CustomerAgencyDTO customerAgencyDTO=customerAgencyService.get(addGridFormDTO.getAgencyId());
CustomerGridEntity customerGridEntity = new CustomerGridEntity();
BeanUtils.copyProperties(addGridFormDTO,customerGridEntity);
customerGridEntity.setAreaCode(customerAgencyDTO.getAreaCode());
@ -615,4 +635,18 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
}
/**
* @Description 查询客户下的网格数量
* @param customerIdFormDTO
* @author zxc
* @date 2020/8/14 9:31 上午
*/
@Override
public CustomerGridCountResultDTO selectGridCount(CustomerIdFormDTO customerIdFormDTO) {
Integer gridCount = customerGridDao.selectGridCount(customerIdFormDTO.getCustomerId());
CustomerGridCountResultDTO customerGridCount = new CustomerGridCountResultDTO();
customerGridCount.setGridCount(gridCount);
return customerGridCount;
}
}

18
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java

@ -27,10 +27,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.CustomerStaffAgencyDao;
import com.epmet.dto.*;
import com.epmet.dto.form.CommonDepartmentFormDTO;
import com.epmet.dto.form.CommonGridIdFormDTO;
import com.epmet.dto.form.CommonUserIdListFormDTO;
import com.epmet.dto.form.StaffsInAgencyFromDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.CommonStaffInfoResultDTO;
import com.epmet.dto.result.LatestCustomerResultDTO;
import com.epmet.entity.CustomerStaffAgencyEntity;
@ -72,6 +69,8 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl<CustomerStaf
private CustomerGridService customerGridService;
@Autowired
private CustomerDepartmentService customerDepartmentService;
@Autowired
private CustomerStaffAgencyDao customerStaffAgencyDao;
@Override
public PageData<CustomerStaffAgencyDTO> page(Map<String, Object> params) {
@ -213,4 +212,15 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl<CustomerStaf
return ConvertUtils.sourceToTarget(entity, CustomerStaffAgencyDTO.class);
}
/**
* @Description 查询机关下工作人员
* @param agencyIdFormDTO
* @author zxc
* @date 2020/8/17 10:14 上午
*/
@Override
public List<String> getAgencyStaffs(AgencyIdFormDTO agencyIdFormDTO) {
return customerStaffAgencyDao.getAgencyStaffList(agencyIdFormDTO.getAgencyId());
}
}

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

@ -25,6 +25,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.CustomerStaffDepartmentDao;
import com.epmet.dto.CustomerStaffDepartmentDTO;
import com.epmet.dto.form.DepartmentIdFormDTO;
import com.epmet.entity.CustomerStaffDepartmentEntity;
import com.epmet.redis.CustomerStaffDepartmentRedis;
import com.epmet.service.CustomerStaffDepartmentService;
@ -47,7 +48,7 @@ import java.util.Map;
public class CustomerStaffDepartmentServiceImpl extends BaseServiceImpl<CustomerStaffDepartmentDao, CustomerStaffDepartmentEntity> implements CustomerStaffDepartmentService {
@Autowired
private CustomerStaffDepartmentRedis customerStaffDepartmentRedis;
private CustomerStaffDepartmentDao customerStaffDepartmentDao;
@Override
public PageData<CustomerStaffDepartmentDTO> page(Map<String, Object> params) {
@ -101,4 +102,16 @@ public class CustomerStaffDepartmentServiceImpl extends BaseServiceImpl<Customer
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @Description 查询部门下工作人员
* @param formDTO
* @author zxc
* @date 2020/8/13 2:46 下午
*/
@Override
public List<String> getDepartmentStaffs(DepartmentIdFormDTO formDTO) {
String departmentId = formDTO.getDepartmentId();
return customerStaffDepartmentDao.getDepartmentStaffList(departmentId);
}
}

11
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -462,4 +462,15 @@
) AS c
LIMIT #{pageNo}, #{pageSize}
</select>
<!-- 查询当前客户已有网格数量 -->
<select id="selectGridCount" resultType="java.lang.Integer">
SELECT
COUNT( id ) AS gridCount
FROM
customer_grid
WHERE
del_flag = '0'
AND customer_id = #{customerId}
</select>
</mapper>

11
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml

@ -141,4 +141,15 @@
csa.DEL_FLAG = '0'
AND csa.USER_ID = #{staffId}
</select>
<!-- 查询机关下工作人员的 userId -->
<select id="getAgencyStaffList" resultType="java.lang.String">
SELECT
user_id AS userId
FROM
customer_staff_agency
WHERE
del_flag = '0'
AND agency_id = #{agencyId}
</select>
</mapper>

11
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml

@ -27,6 +27,17 @@
</foreach>
</select>
<!-- 查询部门下的工作人员userId -->
<select id="getDepartmentStaffList" resultType="java.lang.String">
SELECT
user_id AS userId
FROM
customer_staff_department
WHERE
del_flag = '0'
AND department_id = #{departmentId}
</select>
<!-- 修改部门人数 -->
<update id="updateDepartmentStaffCount">
UPDATE

48
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java

@ -0,0 +1,48 @@
package com.epmet.dto.form;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/8/12 17:52
*/
@Data
public class ProjectResponseFormDTO implements Serializable {
private static final long serialVersionUID = -4915724637094689896L;
/**
* 用户Id
*/
private String userId;
/**
* 项目Id
*/
private String projectId;
/**
* 流程节点Id
*/
private String projectProcessId;
/**
* 公开答复内容
*/
@Length(max = 1000, message = "公开答复不能超过1000个字符")
private String publicReply;
/**
* 内部流转意见
*/
@NotBlank(message = "内部备注不能为空")
@Length(max = 1000, message = "内部备注不能超过1000个字符")
private String internalRemark;
/**
* 项目人员关联表ID
*/
private String projectStaffId;
/**
* 部门名
*/
private String departmentName;
}

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

@ -1,6 +1,7 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
@ -10,6 +11,7 @@ import java.util.List;
* @dscription
* @date 2020/5/11 15:33
*/
@NoArgsConstructor
@Data
public class ProjectDetailResultDTO implements Serializable {
@ -49,6 +51,18 @@ public class ProjectDetailResultDTO implements Serializable {
/**
* 当前跟进部门
*/
private List<String> departmentNameList;
private List<DepartmentNameListBean> departmentNameList;
@NoArgsConstructor
@Data
public static class DepartmentNameListBean {
/**
* 部门名
*/
private String departmentName;
/**
* 工作人员
*/
private List<String> staffList;
}
}

2
epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
gov-project-server:
container_name: gov-project-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.40
image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.42
ports:
- "8102:8102"
network_mode: host # 使用现有网络

2
epmet-module/gov-project/gov-project-server/pom.xml

@ -2,7 +2,7 @@
<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">
<version>0.3.40</version>
<version>0.3.42</version>
<parent>
<artifactId>gov-project</artifactId>
<groupId>com.epmet</groupId>

8
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java

@ -59,6 +59,14 @@ public interface ProjectConstant {
* 处理名-转项目
*/
String OPERATION_CREATED_NAME = "转项目";
/**
* 处理-退回
*/
String OPERATION_RESPONSES = "response";
/**
* 处理名-退回
*/
String OPERATION_RESPONSES_NAME = "处理/响应";
/**
* 是否处理-未处理

10
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java

@ -19,6 +19,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.ProjectStaffDTO;
import com.epmet.dto.form.LatestListFormDTO;
import com.epmet.dto.form.ProjectListFromDTO;
import com.epmet.dto.form.ShiftProjectsFromDTO;
@ -78,6 +79,15 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
*/
List<String> selectDepartmentNameList(ProjectDTO dto);
/**
* 当前处理部门及工作人员
* @author zhaoqifeng
* @date 2020/8/14 10:56
* @param dto
* @return java.util.List<com.epmet.dto.ProjectStaffDTO>
*/
List<ProjectStaffDTO> selectCurrentDepartmentList(ProjectDTO dto);
/**
* 获取项目详情
* @author zhaoqifeng

9
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java

@ -178,4 +178,13 @@ public interface ProjectService extends BaseService<ProjectEntity> {
* @Description 获取客户下已结案项目列表按结案时间倒序
**/
List<LatestListResultDTO> getClosedProjectList(LatestListFormDTO formDTO);
/**
* 处理响应
* @author zhaoqifeng
* @date 2020/8/14 9:42
* @param formDTO
* @return void
*/
void response(ProjectResponseFormDTO formDTO);
}

10
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java

@ -107,4 +107,14 @@ public interface ProjectTraceService {
* @Description 项目跟踪-项目人员选择
**/
ProcessorListResultDTO processorList(ProcessorListFormDTO formDTO);
/**
* 处理响应
* @author zhaoqifeng
* @date 2020/8/12 17:54
* @param tokenDto
* @param formDTO
* @return void
*/
void response(TokenDto tokenDto, ProjectResponseFormDTO formDTO);
}

77
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

@ -44,10 +44,7 @@ import com.epmet.entity.ProjectEntity;
import com.epmet.entity.ProjectProcessEntity;
import com.epmet.entity.ProjectRelatedPersonnelEntity;
import com.epmet.entity.ProjectStaffEntity;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.GovOrgFeignClient;
import com.epmet.feign.MessageFeignClient;
import com.epmet.feign.*;
import com.epmet.redis.ProjectRedis;
import com.epmet.service.*;
import org.apache.commons.lang3.StringUtils;
@ -87,6 +84,8 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
private MessageFeignClient messageFeignClient;
@Autowired
private ProjectRelatedPersonnelService projectRelatedPersonnelService;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Value("${openapi.scan.server.url}")
private String scanApiUrl;
@Value("${openapi.scan.method.textSyncScan}")
@ -281,16 +280,41 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
}
//获取当前跟进部门
List<String> departmentNameList = new ArrayList<>();
List<ProjectStaffDTO> departmentNameList = new ArrayList<>();
List<ProjectDetailResultDTO.DepartmentNameListBean> departmentList = new ArrayList<>();
if (ProjectConstant.CLOSED.equals(resultDTO.getProjectStatus())) {
//项目已结案,跟进部门为空
resultDTO.setDepartmentNameList(departmentNameList);
resultDTO.setDepartmentNameList(departmentList);
} else {
//项目未结案,找出所有跟进部门
ProjectDTO projectDTO = new ProjectDTO();
projectDTO.setId(fromDTO.getProjectId());
departmentNameList = baseDao.selectDepartmentNameList(projectDTO);
resultDTO.setDepartmentNameList(departmentNameList);
departmentNameList = baseDao.selectCurrentDepartmentList(projectDTO);
//提取工作人员ID
List<String> staffIdList = departmentNameList.stream().map(ProjectStaffDTO::getStaffId).collect(Collectors.toList());
staffIdList = staffIdList.stream().distinct().collect(Collectors.toList());
//根据部门分组
Map<String, List<ProjectStaffDTO>> departmentMap =
departmentNameList.stream().collect(Collectors.groupingBy(ProjectStaffDTO::getDepartmentName));
//获取工作人员信息(姓名)
UserIdsFormDTO userIdsFormDTO = new UserIdsFormDTO();
userIdsFormDTO.setUserIds(staffIdList);
Result<List<StaffSinGridResultDTO>> staffListResult = epmetUserOpenFeignClient.getStaffInfoList(userIdsFormDTO);
if (!staffListResult.success()) {
throw new RenException(staffListResult.getCode(), staffListResult.getMsg());
}
List<StaffSinGridResultDTO> staffList = staffListResult.getData();
for (String departmentName : departmentMap.keySet()) {
ProjectDetailResultDTO.DepartmentNameListBean bean = new ProjectDetailResultDTO.DepartmentNameListBean();
bean.setDepartmentName(departmentName);
List<ProjectStaffDTO> staffDTOList = departmentMap.get(departmentName);
List<String> staffNameList =
staffDTOList.stream().flatMap(staffDto -> staffList.stream().filter(staffInfo ->
staffDto.getStaffId().equals(staffInfo.getStaffId())).map((StaffSinGridResultDTO::getStaffName))).collect(Collectors.toList());
bean.setStaffList(staffNameList);
departmentList.add(bean);
}
resultDTO.setDepartmentNameList(departmentList);
}
return resultDTO;
@ -635,4 +659,41 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
return baseDao.selectClosedProjectList(formDTO);
}
@Override
public void response(ProjectResponseFormDTO formDTO) {
//公开回复内容审核
if (com.alibaba.nacos.client.utils.StringUtils.isNotBlank(formDTO.getPublicReply())) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
taskDTO.setContent(formDTO.getPublicReply());
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
}
//获取项目相关信息
ProjectEntity projectEntity = baseDao.selectById(formDTO.getProjectId());
if (ProjectConstant.CLOSED.equals(projectEntity.getStatus())) {
throw new RenException(EpmetErrorCode.PROJECT_IS_CLOSED.getCode());
}
//处理响应记录加入项目进展表
ProjectProcessEntity projectProcessEntity = new ProjectProcessEntity();
projectProcessEntity.setProjectId(formDTO.getProjectId());
projectProcessEntity.setDepartmentName(formDTO.getDepartmentName());
projectProcessEntity.setOperation(ProjectConstant.OPERATION_RESPONSES);
projectProcessEntity.setOperationName(ProjectConstant.OPERATION_RESPONSES_NAME);
projectProcessEntity.setPublicReply(formDTO.getPublicReply());
projectProcessEntity.setInternalRemark(formDTO.getInternalRemark());
projectProcessEntity.setStaffId(formDTO.getUserId());
projectProcessService.insert(projectProcessEntity);
}
}

6
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java

@ -95,4 +95,10 @@ public class ProjectTraceServiceImpl implements ProjectTraceService {
Result<ProcessorListResultDTO> resultDTOResult = govOrgFeignClient.getProcessorList(staffEntity.getOrgId());
return resultDTOResult.getData();
}
@Override
public void response(TokenDto tokenDto, ProjectResponseFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
projectService.response(formDTO);
}
}

13
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml

@ -183,5 +183,16 @@
AND origin = #{origin}
AND origin_id = #{originId}
</select>
<select id="selectCurrentDepartmentList" resultType="com.epmet.dto.ProjectStaffDTO">
SELECT DISTINCT
DEPARTMENT_NAME,
STAFF_ID
FROM
project p
INNER JOIN project_staff ps ON p.ID = ps.PROJECT_ID
WHERE p.DEL_FLAG = '0'
AND ps.DEL_FLAG = '0'
AND p.ID = #{id}
AND ps.IS_HANDLE = 'unhandled'
</select>
</mapper>

5
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerDTO.java

@ -88,6 +88,11 @@ public class CustomerDTO implements Serializable {
*/
private String logo;
/**
* 客户允许创建的网格数
*/
private Integer gridNumber;
/**
* 删除标识0.未删除 1.已删除
*/

17
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/GridCountFormDTO.java

@ -0,0 +1,17 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/12 4:34 下午
*/
@Data
public class GridCountFormDTO implements Serializable {
private static final long serialVersionUID = 3121175488079594627L;
private String customerId;
}

36
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoResultDTO.java

@ -0,0 +1,36 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/14 9:01 上午
*/
@Data
public class CustomerInfoResultDTO implements Serializable {
private static final long serialVersionUID = 7653925905635170972L;
/**
* 客户Id
*/
private String customerId;
/**
* 客户名称
*/
private String customerName;
/**
* 已创建网格数
*/
private Integer createGridNum;
/**
* 最大允许创建数
*/
private Integer maxGridNum;
}

17
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/GridCountResultDTO.java

@ -0,0 +1,17 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/12 4:31 下午
*/
@Data
public class GridCountResultDTO implements Serializable {
private static final long serialVersionUID = -5523213918272649646L;
private Integer gridCount;
}

11
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java

@ -6,6 +6,8 @@ import com.epmet.dto.CustomerAppDTO;
import com.epmet.dto.CustomerDTO;
import com.epmet.dto.form.CustomerAppSecretFormDTO;
import com.epmet.dto.form.CustomerManagerFormDTO;
import com.epmet.dto.form.GridCountFormDTO;
import com.epmet.dto.result.GridCountResultDTO;
import com.epmet.feign.fallback.OperCrmOpenFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
@ -62,4 +64,13 @@ public interface OperCrmOpenFeignClient {
*/
@PostMapping("/oper/crm/customer/getalllist")
Result<List<CustomerDTO>> getAllCustomerList();
/**
* @Description 查询客户下可以创建网格的最大数
* @param formDTO
* @author zxc
* @date 2020/8/12 4:37 下午
*/
@PostMapping("/oper/crm/customer/getgridcount")
Result<GridCountResultDTO> getGridCount(@RequestBody GridCountFormDTO formDTO);
}

7
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java

@ -7,6 +7,8 @@ import com.epmet.dto.CustomerAppDTO;
import com.epmet.dto.CustomerDTO;
import com.epmet.dto.form.CustomerAppSecretFormDTO;
import com.epmet.dto.form.CustomerManagerFormDTO;
import com.epmet.dto.form.GridCountFormDTO;
import com.epmet.dto.result.GridCountResultDTO;
import com.epmet.feign.OperCrmOpenFeignClient;
import org.springframework.stereotype.Component;
@ -50,4 +52,9 @@ public class OperCrmOpenFeignClientFallback implements OperCrmOpenFeignClient {
public Result<List<CustomerDTO>> getAllCustomerList() {
return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getAllCustomerList", null);
}
@Override
public Result<GridCountResultDTO> getGridCount(GridCountFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getGridCount", formDTO);
}
}

11
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/constant/ModuleConstant.java

@ -0,0 +1,11 @@
package com.epmet.constant;
/**
* @Author zxc
* @DateTime 2020/8/14 9:46 上午
*/
public interface ModuleConstant {
String ERROR_GOV_ORG_COUNT = "调用gov_org服务【查询客户下网格数量】失败";
}

23
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java

@ -32,6 +32,8 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.CustomerDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.CustomerDetailResultDTO;
import com.epmet.dto.result.CustomerInfoResultDTO;
import com.epmet.dto.result.GridCountResultDTO;
import com.epmet.dto.result.ValidCustomerResultDTO;
import com.epmet.excel.CustomerExcel;
import com.epmet.feign.GovOrgFeignClient;
@ -256,4 +258,25 @@ public class CustomerController {
return new Result<List<CustomerDTO>>().ok(customerService.getAllList());
}
/**
* @Description 查询客户下可以创建网格的最大数
* @author zxc
* @date 2020/8/12 4:30 下午
*/
@PostMapping("getgridcount")
public Result<GridCountResultDTO> getGridCount(@RequestBody GridCountFormDTO formDTO){
return new Result<GridCountResultDTO>().ok(customerService.getGridCount(formDTO));
}
/**
* @Description 查询客户基本信息
* @param formDTO
* @author zxc
* @date 2020/8/14 9:08 上午
*/
@PostMapping("getcustomer")
public Result<CustomerInfoResultDTO> getCustomer(@RequestBody CustomerIdFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, CustomerIdFormDTO.Customer.class);
return new Result<CustomerInfoResultDTO>().ok(customerService.getCustomer(formDTO));
}
}

18
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java

@ -19,7 +19,9 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.CustomerDTO;
import com.epmet.dto.result.CustomerInfoResultDTO;
import com.epmet.dto.result.CustomerResultDTO;
import com.epmet.dto.result.GridCountResultDTO;
import com.epmet.dto.result.ValidCustomerResultDTO;
import com.epmet.entity.CustomerEntity;
import org.apache.ibatis.annotations.Mapper;
@ -74,4 +76,20 @@ public interface CustomerDao extends BaseDao<CustomerEntity> {
*/
List<CustomerEntity> getAllList();
/**
* @Description 查询客户下可以创建网格的最大数
* @param customerId
* @author zxc
* @date 2020/8/12 4:46 下午
*/
GridCountResultDTO getGridCount(@Param("customerId")String customerId);
/**
* @Description 根据客户Id查询客户基本信息
* @param customerId
* @author zxc
* @date 2020/8/14 9:12 上午
*/
CustomerInfoResultDTO selectCustomerBasicInfo(@Param("customerId")String customerId);
}

5
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerEntity.java

@ -88,4 +88,9 @@ public class CustomerEntity extends BaseEpmetEntity {
*/
private String logo;
/**
* 客户允许创建的网格数
*/
private Integer gridNumber;
}

3
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/excel/CustomerExcel.java

@ -76,5 +76,8 @@ public class CustomerExcel {
@Excel(name = "更新时间")
private Date updatedTime;
@Excel(name = "客户允许创建的网格数")
private Integer gridNumber;
}

23
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java

@ -21,13 +21,13 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerDTO;
import com.epmet.dto.form.CustomerFormDTO;
import com.epmet.dto.form.CustomerInitFormDTO;
import com.epmet.dto.form.CustomerManagerFormDTO;
import com.epmet.dto.form.PageQueryFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.CustomerDetailResultDTO;
import com.epmet.dto.result.CustomerInfoResultDTO;
import com.epmet.dto.result.GridCountResultDTO;
import com.epmet.dto.result.ValidCustomerResultDTO;
import com.epmet.entity.CustomerEntity;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
import java.util.Map;
@ -174,4 +174,19 @@ public interface CustomerService extends BaseService<CustomerEntity> {
* @return
*/
List<CustomerDTO> getAllList();
/**
* @Description 查询客户下可以创建网格的最大数
* @author zxc
* @date 2020/8/12 4:30 下午
*/
GridCountResultDTO getGridCount( GridCountFormDTO formDTO);
/**
* @Description 查询客户基本信息
* @param formDTO
* @author zxc
* @date 2020/8/14 9:08 上午
*/
CustomerInfoResultDTO getCustomer( CustomerIdFormDTO formDTO);
}

33
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java

@ -30,6 +30,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.ModuleConstant;
import com.epmet.constant.RoleKeyConstants;
import com.epmet.constant.UserWorkType;
import com.epmet.dao.CustomerDao;
@ -76,6 +77,8 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn
private OperCustomizeFeignClient operCustomizeFeignClient;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private CustomerDao customerDao;
@Override
public PageData<CustomerDTO> page(Map<String, Object> params) {
@ -470,6 +473,8 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn
}
customerEntity.setOrganizationLevel(level);
customerEntity.setLogo("");
//新客户默认可以创建三个网格
customerEntity.setGridNumber(NumConstant.THREE);
if (baseDao.insert(customerEntity) < NumConstant.ONE) {
throw new RenException(EpmetErrorCode.OPER_ADD_CUSTOMER_ERROR.getCode());
}
@ -543,4 +548,32 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn
return ConvertUtils.sourceToTarget(list,CustomerDTO.class);
}
/**
* @Description 查询客户下可以创建网格的最大数
* @author zxc
* @date 2020/8/12 4:30 下午
*/
@Override
public GridCountResultDTO getGridCount(GridCountFormDTO formDTO) {
return customerDao.getGridCount(formDTO.getCustomerId());
}
/**
* @Description 查询客户基本信息
* @param formDTO
* @author zxc
* @date 2020/8/14 9:08 上午
*/
@Override
public CustomerInfoResultDTO getCustomer(CustomerIdFormDTO formDTO) {
String customerId = formDTO.getCustomerId();
CustomerInfoResultDTO customerInfoResultDTO = customerDao.selectCustomerBasicInfo(customerId);
Result<CustomerGridCountResultDTO> result = govOrgOpenFeignClient.selectGridCount(formDTO);
if (!result.success()){
throw new RenException(ModuleConstant.ERROR_GOV_ORG_COUNT);
}
customerInfoResultDTO.setCreateGridNum(result.getData().getGridCount());
return customerInfoResultDTO;
}
}

5
epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.2__update_customer.sql

@ -0,0 +1,5 @@
ALTER TABLE `customer`
ADD COLUMN `GRID_NUMBER` int(11) NULL COMMENT '客户允许创建的网格数' AFTER `ORGANIZATION_LEVEL`;
UPDATE customer SET GRID_NUMBER = 10;

24
epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml

@ -78,4 +78,28 @@
WHERE
del_flag = '0'
</select>
<!-- 查询客户下可以创建网格的最大数 -->
<select id="getGridCount" resultType="com.epmet.dto.result.GridCountResultDTO">
SELECT
IFNULL( grid_number, 0 ) AS gridCount
FROM
customer
WHERE
del_flag = 0
AND id = #{customerId}
</select>
<!-- 根据客户Id查询客户基本信息 -->
<select id="selectCustomerBasicInfo" resultType="com.epmet.dto.result.CustomerInfoResultDTO">
SELECT
id AS customerId,
customer_name AS customerName,
IFNULL( grid_number, 0 ) AS maxGridNum
FROM
customer
WHERE
del_flag = 0
AND id = #{customerId}
</select>
</mapper>

116
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionDetailDTO.java

@ -0,0 +1,116 @@
/**
* 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.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 客户定制功能详情表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-11
*/
@Data
public class CustomerFunctionDetailDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 功能Id
*/
private String functionId;
/**
* 自定义功能名称
*/
private String functionName;
/**
* 自定义大图标
*/
private String iconLargeImg;
/**
* 自定义小图标
*/
private String iconSmallImg;
/**
* 自定义业务域名
*/
private String domainName;
/**
* 外链地址
*/
private String targetLink;
/**
* 上架状态0下架1上架
*/
private Integer shoppingStatus;
/**
* 自定义排序
*/
private Integer displayOrder;
/**
* 删除标识(0.未删除 1.已删除)
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

67
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomizedDTO.java

@ -0,0 +1,67 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 定制功能修改 入参
*
* @author zhangyong
* @since v1.0.0 2020-08-13
*/
@Data
public class CustomizedDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 定制功能ID
*/
private String functionId;
/**
* 上架状态0下架1上架
*/
private String shoppingStatus;
/**
* 功能说明
*/
private String functionExplain;
/**
* 定制功能详情ID
*/
private String customizedId;
/**
* 默认名称
*/
private String customizedName;
/**
* 默认大图标
*/
private String iconLargeImg;
/**
* 默认小图标
*/
private String iconSmallImg;
/**
* 外链地址
*/
private String targetLink;
/**
* 业务域名
*/
private String domainName;
/**
* 来源app(政府端:gov居民端:resi)
*/
private String fromApp;
}

106
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedDTO.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.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 定制功能
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-11
*/
@Data
public class FunctionCustomizedDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 功能ID(function.ID)
*/
private String functionId;
/**
* 默认名称
*/
private String customizedName;
/**
* 默认大图标
*/
private String iconLargeImg;
/**
* 默认小图标
*/
private String iconSmallImg;
/**
* 外链地址(必须是https的请求)
*/
private String targetLink;
/**
* 删除标识(0.未删除 1.已删除)
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 业务域名
*/
private String realmName;
/**
* 来源app(政府端:gov居民端:resi)
*/
private String fromApp;
}

106
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedVisitedDTO.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.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 定制功能访问记录表 记录居民端工作端那些人访问过定制功能以及访问的结果
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-13
*/
@Data
public class FunctionCustomizedVisitedDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 用户Id
*/
private String userId;
/**
* 所属端 居民端:resi工作端:work
*/
private String clientType;
/**
* 功能Id
*/
private String functionId;
/**
* 请求地址 访问的url地址
*/
private String url;
/**
* 结果 成功success失败error
*/
private String result;
/**
* 原因 失败的原因:请求超时404500等
*/
private String msg;
/**
* 删除标识(0.未删除 1.已删除)
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

90
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionShoppingHistoryDTO.java

@ -0,0 +1,90 @@
/**
* 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.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 客户定制功能上下架历史
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-14
*/
@Data
public class FunctionShoppingHistoryDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户Id
*/
private String customerId;
/**
* 功能Id
*/
private String functionId;
/**
* 上下架状态 上架状态0下架1上架
*/
private Integer shoppingStatus;
/**
* 理由
*/
private String reason;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 删除标识(0.未删除 1.已删除)
*/
private Integer delFlag;
}

23
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CommonFunctionIdFormDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 入参为定制功能ID
*
* @author zhangyong
* @since v1.0.0 2020-08-13
*/
@Data
public class CommonFunctionIdFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 定制功能ID
*/
@NotBlank(message = "定制功能ID不能为空")
private String functionId;
}

59
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionCustomizedListFormDTO.java

@ -0,0 +1,59 @@
/**
* 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.dto.form;
import lombok.Data;
import javax.validation.constraints.Min;
import java.io.Serializable;
/**
* 定制功能列表 入参
*
* @author zhangyong
* @since v1.0.0 2020-08-14
*/
@Data
public class FunctionCustomizedListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 功能名称
*/
private String customizedName;
/**
* 所属端
*/
private String fromApp;
/**
* 页码从1开始
*/
@Min(value = 1, message = "页码必须大于0")
private Integer pageNo;
/**
* 页容量默认20页
*/
@Min(value = 1, message = "每页条数必须大于必须大于0")
private Integer pageSize;
}

35
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java

@ -0,0 +1,35 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 查询客户定制功能列表-接口入参
* @Author sun
*/
@Data
public class FunctionDetailFromDTO implements Serializable {
private static final long serialVersionUID = -6163303184086480522L;
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
/**
* 客户ID
*/
@NotBlank(message = "客户Id不能为空", groups = {AddUserShowGroup.class})
private String customerId;
/**
* resi居民端work工作端
*/
@NotBlank(message = "所属端不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class})
private String clientType;
}

56
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionVisitedFromDTO.java

@ -0,0 +1,56 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 查询客户定制功能列表-接口入参
* @Author sun
*/
@Data
public class FunctionVisitedFromDTO implements Serializable {
private static final long serialVersionUID = -6163303184086480522L;
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
/**
* 用户Id
*/
private String userId;
/**
* 客户Id
*/
private String customerId;
/**
* 所属端
*/
@NotBlank(message = "所属端不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class})
private String clientType;
/**
* 功能Id
*/
@NotBlank(message = "功能Id不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class})
private String functionId;
/**
* 请求地址
*/
@NotBlank(message = "请求地址不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class})
private String url;
/**
* 结果
*/
@NotBlank(message = "结果不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class})
private String result;
/**
* 原因
*/
private String msg;
}

72
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveFunctionCustomizedFormDTO.java

@ -0,0 +1,72 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* 定制功能新增 入参
*
* @author zhangyong
* @since v1.0.0 2020-08-13
*/
@Data
public class SaveFunctionCustomizedFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 功能名称
*/
@NotBlank(message = "功能名称不能为空")
private String functionName;
/**
* 功能类型0.默认功能1.定制功能
*/
@NotBlank(message = "功能类型:0.默认功能,1.定制功能不能为空")
private String functionGroup;
/**
* 功能说明
*/
@NotBlank(message = "功能说明不能为空")
private String functionExplain;
/**
* 默认大图标
*/
@NotBlank(message = "默认大图标不能为空")
private String iconLargeImg;
/**
* 默认小图标
*/
@NotBlank(message = "默认小图标不能为空")
private String iconSmallImg;
/**
* 外链地址
*/
@NotBlank(message = "外链地址不能为空")
private String targetLink;
/**
* 上架状态0下架1上架
*/
@NotBlank(message = "上架状态:0:下架、1:上架不能为空")
private String shoppingStatus;
/**
* 业务域名(https;//... 无端口号)
*/
@NotBlank(message = "业务域名(https;//... 无端口号)不能为空")
private String domainName;
/**
* 来源app(工作端:gov居民端:resi)
*/
@NotBlank(message = "来源app(工作端:gov、居民端:resi)不能为空")
private String fromApp;
}

53
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomerFunctionFormDTO.java

@ -0,0 +1,53 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 客户定制功能修改 入参
* 目前允许修改功能名称大小图标
*
* @author zhangyong
* @since v1.0.0 2020-08-13
*/
@Data
public class UpdateCustomerFunctionFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
public interface AddUserInternalGroup {}
public interface AddUserShowGroup extends CustomerClientShowGroup {}
/**
* 客户Id
*/
@NotBlank(message = "客户ID不能为空", groups = {AddUserInternalGroup.class})
private String customerId;
/**
* 功能ID
*/
@NotBlank(message = "功能ID不能为空", groups = {AddUserInternalGroup.class})
private String functionId;
/**
* 自定义功能名称
*/
@NotBlank(message = "自定义功能名称不能为空", groups = {AddUserShowGroup.class})
private String functionName;
/**
* 自定义大图标
*/
@NotBlank(message = "自定义大图标不能为空", groups = {AddUserShowGroup.class})
private String iconLargeImg;
/**
* 自定义小图标
*/
@NotBlank(message = "自定义小图标不能为空", groups = {AddUserShowGroup.class})
private String iconSmallImg;
private String userId;
}

72
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java

@ -0,0 +1,72 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 定制功能修改 入参
*
* @author zhangyong
* @since v1.0.0 2020-08-13
*/
@Data
public class UpdateCustomizedFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 定制功能ID
*/
@NotBlank(message = "定制功能ID不能为空")
private String functionId;
/**
* 上架状态0下架1上架
*/
@NotBlank(message = "上架状态:0:下架、1:上架不能为空")
private String shoppingStatus;
/**
* 功能说明
*/
@NotBlank(message = "功能说明不能为空")
private String functionExplain;
/**
* 默认名称
*/
@NotBlank(message = "默认名称不能为空")
private String customizedName;
/**
* 默认大图标
*/
@NotBlank(message = "默认大图标不能为空")
private String iconLargeImg;
/**
* 默认小图标
*/
@NotBlank(message = "默认小图标不能为空")
private String iconSmallImg;
/**
* 外链地址
*/
@NotBlank(message = "外链地址不能为空")
private String targetLink;
/**
* 业务域名
*/
@NotBlank(message = "业务域名不能为空")
private String domainName;
/**
* 来源app(工作端:gov居民端:resi)
*/
@NotBlank(message = "来源app(工作端:gov、居民端:resi)不能为空")
private String fromApp;
}

47
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateShoppingStatusFormDTO.java

@ -0,0 +1,47 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 修改客户定制功能上下架 入参
*
* @author zhangyong
* @since v1.0.0 2020-08-13
*/
@Data
public class UpdateShoppingStatusFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
public interface AddUserInternalGroup {}
public interface AddUserShowGroup extends CustomerClientShowGroup {}
/**
* 客户Id
*/
@NotBlank(message = "客户Id不能为空", groups = {AddUserInternalGroup.class})
private String customerId;
/**
* 功能ID
*/
@NotBlank(message = "功能ID不能为空", groups = {AddUserInternalGroup.class})
private String functionId;
/**
* 上架状态0下架1上架
*/
@NotBlank(message = "上架状态:0:下架、1:上架不能为空", groups = {AddUserShowGroup.class})
private String shoppingStatus;
/**
* 理由
*/
@NotBlank(message = "上下架理由不能为空", groups = {AddUserShowGroup.class})
private String reason;
private String userId;
}

61
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java

@ -0,0 +1,61 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 定制功能详情 返回值
*
* @author zhangyong
* @since v1.0.0 2020-08-13
*/
@Data
public class FunctionCustomizedDetailResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 功能ID(function.ID)
*/
private String functionId;
/**
* 上架状态0下架1上架
*/
private String shoppingStatus;
/**
* 功能说明
*/
private String functionExplain;
/**
* 默认名称
*/
private String customizedName;
/**
* 默认大图标
*/
private String iconLargeImg;
/**
* 默认小图标
*/
private String iconSmallImg;
/**
* 外链地址
*/
private String targetLink;
/**
* 业务域名
*/
private String domainName;
/**
* 来源app(工作端:gov居民端:resi)
*/
private String fromApp;
}

61
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListDTO.java

@ -0,0 +1,61 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 定制功能列表 返回值
*
* @author zhangyong
* @since v1.0.0 2020-08-14
*/
@Data
public class FunctionCustomizedListDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 功能ID(function.ID)
*/
private String functionId;
/**
* 上架状态0下架1上架
*/
private String shoppingStatus;
/**
* 功能说明
*/
private String functionExplain;
/**
* 默认名称
*/
private String customizedName;
/**
* 默认大图标
*/
private String iconLargeImg;
/**
* 默认小图标
*/
private String iconSmallImg;
/**
* 外链地址
*/
private String targetLink;
/**
* 业务域名
*/
private String domainName;
/**
* 来源app(政府端:gov居民端:resi)
*/
private String fromApp;
}

29
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListResultDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 定制功能列表 返回值
*
* @author zhangyong
* @since v1.0.0 2020-08-14
*/
@Data
public class FunctionCustomizedListResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 列表总条数
*/
private Integer total;
/**
* 列表内容
*/
private List<FunctionCustomizedListDTO> listDTOS;
}

50
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionDetailResultDTO.java

@ -0,0 +1,50 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
/**
* 查询客户定制功能列表-接口返参
* @Author sun
*/
@Data
public class FunctionDetailResultDTO implements Serializable {
private static final long serialVersionUID = 2971689193155710437L;
/**
* 功能Id
*/
private String functionId;
/**
* 自定义功能名称
*/
private String functionName;
/**
* 自定义大图标
*/
private String iconLargeImg;
/**
* 自定义小图标
*/
private String iconSmallImg;
/**
* 请求地址https://+业务域名+外链地址)
*/
private String url;
/**
* 自定义排序
*/
private String dispalyOrder;
/**
* 自定义json(目前是空值)
*/
private ArrayList customerParameter;
}

2
epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
oper-customize-server:
container_name: oper-customize-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.26
image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.27
ports:
- "8089:8089"
network_mode: host # 使用现有网络

2
epmet-module/oper-customize/oper-customize-server/pom.xml

@ -2,7 +2,7 @@
<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.26</version>
<version>0.3.27</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>oper-customize</artifactId>

158
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java

@ -0,0 +1,158 @@
/**
* 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.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;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.CustomerFunctionDetailDTO;
import com.epmet.dto.form.FunctionDetailFromDTO;
import com.epmet.dto.form.UpdateCustomerFunctionFormDTO;
import com.epmet.dto.form.UpdateShoppingStatusFormDTO;
import com.epmet.dto.result.FunctionDetailResultDTO;
import com.epmet.excel.CustomerFunctionDetailExcel;
import com.epmet.service.CustomerFunctionDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 客户定制功能详情表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-11
*/
@RestController
@RequestMapping("customerfunctiondetail")
public class CustomerFunctionDetailController {
@Autowired
private CustomerFunctionDetailService customerFunctionDetailService;
@GetMapping("page")
public Result<PageData<CustomerFunctionDetailDTO>> page(@RequestParam Map<String, Object> params){
PageData<CustomerFunctionDetailDTO> page = customerFunctionDetailService.page(params);
return new Result<PageData<CustomerFunctionDetailDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<CustomerFunctionDetailDTO> get(@PathVariable("id") String id){
CustomerFunctionDetailDTO data = customerFunctionDetailService.get(id);
return new Result<CustomerFunctionDetailDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody CustomerFunctionDetailDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
customerFunctionDetailService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody CustomerFunctionDetailDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
customerFunctionDetailService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
customerFunctionDetailService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<CustomerFunctionDetailDTO> list = customerFunctionDetailService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, CustomerFunctionDetailExcel.class);
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 居民端-获取客户定制功能列表
**/
@PostMapping("resifunctiondetaillist")
public Result<List<FunctionDetailResultDTO>> resiFunctionDetail(@LoginUser TokenDto tokenDto, @RequestBody FunctionDetailFromDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, FunctionDetailFromDTO.AddUserShowGroup.class);
return new Result<List<FunctionDetailResultDTO>>().ok(customerFunctionDetailService.resiAndWorkFunctionDetail(formDTO));
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 工作端-获取客户定制功能列表
**/
@PostMapping("workfunctiondetaillist")
public Result<List<FunctionDetailResultDTO>> workFunctionDetail(@LoginUser TokenDto tokenDto, @RequestBody FunctionDetailFromDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, FunctionDetailFromDTO.AddUserInternalGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<List<FunctionDetailResultDTO>>().ok(customerFunctionDetailService.resiAndWorkFunctionDetail(formDTO));
}
/**
* 修改客户定制功能上下架
* 修改上下架状态保存上下架历史
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 09:17 2020-08-17
**/
@PostMapping("updateshoppingstatus")
public Result updateShoppingStatus(@LoginUser TokenDto tokenDto, @RequestBody UpdateShoppingStatusFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, UpdateShoppingStatusFormDTO.AddUserInternalGroup.class, UpdateShoppingStatusFormDTO.AddUserShowGroup.class);
formDTO.setUserId(tokenDto.getUserId());
return customerFunctionDetailService.updateShoppingStatus(formDTO);
}
/**
* 客户定制功能修改 入参
* 目前允许修改功能名称大小图标
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 09:17 2020-08-17
**/
@PostMapping("updatecustomerfunction")
public Result updateCustomerFunction(@LoginUser TokenDto tokenDto, @RequestBody UpdateCustomerFunctionFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, UpdateCustomerFunctionFormDTO.AddUserInternalGroup.class, UpdateCustomerFunctionFormDTO.AddUserShowGroup.class);
formDTO.setUserId(tokenDto.getUserId());
return customerFunctionDetailService.updateCustomerFunction(formDTO);
}
}

177
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java

@ -0,0 +1,177 @@
/**
* 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.controller;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.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.dto.FunctionCustomizedDTO;
import com.epmet.dto.form.CommonFunctionIdFormDTO;
import com.epmet.dto.form.FunctionCustomizedListFormDTO;
import com.epmet.dto.form.SaveFunctionCustomizedFormDTO;
import com.epmet.dto.form.UpdateCustomizedFormDTO;
import com.epmet.dto.result.FunctionCustomizedDetailResultDTO;
import com.epmet.dto.result.FunctionCustomizedListResultDTO;
import com.epmet.excel.FunctionCustomizedExcel;
import com.epmet.service.FunctionCustomizedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 定制功能
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-11
*/
@RestController
@RequestMapping("functioncustomized")
public class FunctionCustomizedController {
@Autowired
private FunctionCustomizedService functionCustomizedService;
@GetMapping("page")
public Result<PageData<FunctionCustomizedDTO>> page(@RequestParam Map<String, Object> params){
PageData<FunctionCustomizedDTO> page = functionCustomizedService.page(params);
return new Result<PageData<FunctionCustomizedDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<FunctionCustomizedDTO> get(@PathVariable("id") String id){
FunctionCustomizedDTO data = functionCustomizedService.get(id);
return new Result<FunctionCustomizedDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody FunctionCustomizedDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
functionCustomizedService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody FunctionCustomizedDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
functionCustomizedService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
functionCustomizedService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<FunctionCustomizedDTO> list = functionCustomizedService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, FunctionCustomizedExcel.class);
}
/**
* 定制功能新增(功能表定制功能表)
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 09:54 2020-08-13
**/
@PostMapping("savefunctioncustomized")
public Result saveFunctionCustomized(@RequestBody SaveFunctionCustomizedFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO);
functionCustomizedService.saveFunctionCustomized(formDTO);
return new Result();
}
/**
* 定制功能详情
* 根据定制功能Id查询对应的详情数据
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.FunctionCustomizedDetailResultDTO>
* @Author zhangyong
* @Date 10:36 2020-08-13
**/
@PostMapping("getfunctioncustomized")
public Result<FunctionCustomizedDetailResultDTO> getFunctionCustomized(@RequestBody CommonFunctionIdFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO);
return functionCustomizedService.getFunctionCustomized(formDTO);
}
/**
* 定制功能删除
* 单条删除在没有客户使用的前提下可以逻辑删除(客户定制功能详情表 没查到就是没人在使用)
* 当功能 有客户在使用时返回code: 8000
* msg: 功能正在使用中不允许删除
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 11:03 2020-08-13
**/
@PostMapping("deletefunctioncustomized")
public Result deleteFunctionCustomized(@RequestBody CommonFunctionIdFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO);
return functionCustomizedService.deleteFunctionCustomized(formDTO);
}
/**
* 定制功能修改
* 有客户在使用该功能时则不允许修改上下架状态业务域名和外链地址所属端app,
* 只能修改功能名称和大小图标
* 修改的要判断是否有客户在使用有用的要批量更新已使用客户数据
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 14:52 2020-08-13
**/
@PostMapping("updatecustomized")
public Result updateCustomized(@RequestBody UpdateCustomizedFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO);
return functionCustomizedService.updateCustomized(formDTO);
}
/**
* 定制功能列表
* 按功能分组先工作端在居民端在按创建时间倒序
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.FunctionCustomizedListResultDTO>
* @Author zhangyong
* @Date 10:07 2020-08-14
**/
@PostMapping("functioncustomizedlist")
public Result<FunctionCustomizedListResultDTO> functionCustomizedList(@RequestBody FunctionCustomizedListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO);
return functionCustomizedService.functionCustomizedList(formDTO);
}
}

128
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedVisitedController.java

@ -0,0 +1,128 @@
/**
* 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.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;
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.dto.FunctionCustomizedVisitedDTO;
import com.epmet.dto.form.FunctionDetailFromDTO;
import com.epmet.dto.form.FunctionVisitedFromDTO;
import com.epmet.dto.result.FunctionDetailResultDTO;
import com.epmet.excel.FunctionCustomizedVisitedExcel;
import com.epmet.service.FunctionCustomizedVisitedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 定制功能访问记录表 记录居民端工作端那些人访问过定制功能以及访问的结果
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-13
*/
@RestController
@RequestMapping("functioncustomizedvisited")
public class FunctionCustomizedVisitedController {
@Autowired
private FunctionCustomizedVisitedService functionCustomizedVisitedService;
@GetMapping("page")
public Result<PageData<FunctionCustomizedVisitedDTO>> page(@RequestParam Map<String, Object> params){
PageData<FunctionCustomizedVisitedDTO> page = functionCustomizedVisitedService.page(params);
return new Result<PageData<FunctionCustomizedVisitedDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<FunctionCustomizedVisitedDTO> get(@PathVariable("id") String id){
FunctionCustomizedVisitedDTO data = functionCustomizedVisitedService.get(id);
return new Result<FunctionCustomizedVisitedDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody FunctionCustomizedVisitedDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
functionCustomizedVisitedService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody FunctionCustomizedVisitedDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
functionCustomizedVisitedService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
functionCustomizedVisitedService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<FunctionCustomizedVisitedDTO> list = functionCustomizedVisitedService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, FunctionCustomizedVisitedExcel.class);
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 居民端-保存定制功能访问记录
**/
@PostMapping("saveresifunctionvisited")
public Result saveResiFunctionVisited(@LoginUser TokenDto tokenDto, @RequestBody FunctionVisitedFromDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, FunctionVisitedFromDTO.AddUserInternalGroup.class, FunctionVisitedFromDTO.AddUserShowGroup.class);
formDTO.setUserId(tokenDto.getUserId());
functionCustomizedVisitedService.saveFunctionVisited(formDTO);
return new Result();
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 工作端-保存定制功能访问记录
**/
@PostMapping("saveworkfunctionvisited")
public Result<List<FunctionDetailResultDTO>> saveWorkFunctionVisited(@LoginUser TokenDto tokenDto, @RequestBody FunctionVisitedFromDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, FunctionVisitedFromDTO.AddUserInternalGroup.class, FunctionVisitedFromDTO.AddUserShowGroup.class);
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
functionCustomizedVisitedService.saveFunctionVisited(formDTO);
return new Result();
}
}

94
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionShoppingHistoryController.java

@ -0,0 +1,94 @@
/**
* 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.controller;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.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.dto.FunctionShoppingHistoryDTO;
import com.epmet.excel.FunctionShoppingHistoryExcel;
import com.epmet.service.FunctionShoppingHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 客户定制功能上下架历史
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-14
*/
@RestController
@RequestMapping("functionshoppinghistory")
public class FunctionShoppingHistoryController {
@Autowired
private FunctionShoppingHistoryService functionShoppingHistoryService;
@GetMapping("page")
public Result<PageData<FunctionShoppingHistoryDTO>> page(@RequestParam Map<String, Object> params){
PageData<FunctionShoppingHistoryDTO> page = functionShoppingHistoryService.page(params);
return new Result<PageData<FunctionShoppingHistoryDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<FunctionShoppingHistoryDTO> get(@PathVariable("id") String id){
FunctionShoppingHistoryDTO data = functionShoppingHistoryService.get(id);
return new Result<FunctionShoppingHistoryDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody FunctionShoppingHistoryDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
functionShoppingHistoryService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody FunctionShoppingHistoryDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
functionShoppingHistoryService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
functionShoppingHistoryService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<FunctionShoppingHistoryDTO> list = functionShoppingHistoryService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, FunctionShoppingHistoryExcel.class);
}
}

79
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java

@ -0,0 +1,79 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.CustomerFunctionDetailDTO;
import com.epmet.dto.form.FunctionDetailFromDTO;
import com.epmet.dto.form.UpdateCustomerFunctionFormDTO;
import com.epmet.dto.form.UpdateShoppingStatusFormDTO;
import com.epmet.dto.result.FunctionDetailResultDTO;
import com.epmet.entity.CustomerFunctionDetailEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 客户定制功能详情表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-11
*/
@Mapper
public interface CustomerFunctionDetailDao extends BaseDao<CustomerFunctionDetailEntity> {
/**
* 根据functionId查询使用该功能的客户id customizedId
* 可用来判断该功能是否有客户在使用
*
* @param functionId
* @return java.util.List<com.epmet.dto.CustomerFunctionDetailDTO>
* @Author zhangyong
* @Date 11:14 2020-08-13
**/
List<CustomerFunctionDetailDTO> selectCustomerIdByFunctionId(@Param("functionId") String functionId);
/**
* @param formDTO
* @return
* @Author sun
* @Description 根据所属端和客户Id查询客户定制功能列表
**/
List<FunctionDetailResultDTO> selectFunctionDetailList(FunctionDetailFromDTO formDTO);
/**
* 修改客户定制功能上下架
* 修改上下架状态保存上下架历史
*
* @param formDTO
* @Author zhangyong
* @Date 09:17 2020-08-17
**/
void updateShoppingStatus(UpdateShoppingStatusFormDTO formDTO);
/**
* 客户定制功能修改 入参
* 目前允许修改功能名称大小图标
*
* @param formDTO
* @Author zhangyong
* @Date 10:00 2020-08-17
**/
void updateCustomerFunction(UpdateCustomerFunctionFormDTO formDTO);
}

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

Loading…
Cancel
Save