From e36ee17735977a05a944eca594ba2b72f90bc118 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 11 Aug 2020 13:47:41 +0800 Subject: [PATCH 001/119] =?UTF-8?q?epmet-ext=E6=9C=8D=E5=8A=A1=E5=88=9B?= =?UTF-8?q?=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/constant/ServiceConstant.java | 5 + epmet-gateway/pom.xml | 11 +- .../src/main/resources/bootstrap.yml | 9 + .../epmet-ext/epmet-ext-client/pom.xml | 35 +++ .../epmet/feifn/EpmetExtOpenFeignClient.java | 18 ++ .../impl/EpmetExtOpenFeignClientFallBack.java | 16 + .../epmet-ext/epmet-ext-server/Dockerfile | 11 + .../deploy/docker-compose-dev.yml | 17 ++ .../deploy/docker-compose-prod.yml | 17 ++ .../deploy/docker-compose-test.yml | 17 ++ .../epmet-ext/epmet-ext-server/pom.xml | 283 ++++++++++++++++++ .../java/com/epmet/EpmetExtApplication.java | 17 ++ .../com/epmet/aspect/RequestLogAspect.java | 40 +++ .../com/epmet/config/ModuleConfigImpl.java | 26 ++ .../com/epmet/constant/ModuleConstant.java | 10 + .../src/main/resources/bootstrap.yml | 100 +++++++ .../resources/db/migration/V0.0.1__demo.sql | 1 + .../src/main/resources/logback-spring.xml | 164 ++++++++++ epmet-module/epmet-ext/pom.xml | 21 ++ epmet-module/pom.xml | 1 + 20 files changed, 817 insertions(+), 2 deletions(-) create mode 100644 epmet-module/epmet-ext/epmet-ext-client/pom.xml create mode 100644 epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/feifn/EpmetExtOpenFeignClient.java create mode 100644 epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/feifn/impl/EpmetExtOpenFeignClientFallBack.java create mode 100644 epmet-module/epmet-ext/epmet-ext-server/Dockerfile create mode 100644 epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml create mode 100644 epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml create mode 100644 epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-test.yml create mode 100644 epmet-module/epmet-ext/epmet-ext-server/pom.xml create mode 100644 epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/EpmetExtApplication.java create mode 100644 epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/aspect/RequestLogAspect.java create mode 100644 epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/config/ModuleConfigImpl.java create mode 100644 epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java create mode 100644 epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml create mode 100644 epmet-module/epmet-ext/epmet-ext-server/src/main/resources/db/migration/V0.0.1__demo.sql create mode 100644 epmet-module/epmet-ext/epmet-ext-server/src/main/resources/logback-spring.xml create mode 100644 epmet-module/epmet-ext/pom.xml diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java index db6dea1b61..b66c3c33d2 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java +++ b/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"; } diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index d6d74e1b5b..b21830e44e 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -190,12 +190,15 @@ lb://epmet-third-server - + lb://epmet-heart-server - + lb://epmet-point-server + + lb://epmet-ext-server + @@ -284,6 +287,8 @@ lb://epmet-heart-server lb://epmet-point-server + + lb://epmet-ext-server @@ -369,6 +374,8 @@ lb://epmet-heart-server lb://epmet-point-server + + lb://epmet-ext-server diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index c2105542bb..121e797b01 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/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}/ext/** + filters: + - StripPrefix=1 + - CpAuth=true nacos: discovery: server-addr: @nacos.server-addr@ diff --git a/epmet-module/epmet-ext/epmet-ext-client/pom.xml b/epmet-module/epmet-ext/epmet-ext-client/pom.xml new file mode 100644 index 0000000000..edb8fb13a1 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/pom.xml @@ -0,0 +1,35 @@ + + + 4.0.0 + + + epmet-ext + com.epmet + 2.0.0 + + + + epmet-ext-client + jar + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + com.github.binarywang + weixin-java-mp + 3.6.0 + compile + + + + + ${project.artifactId} + + + \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/feifn/EpmetExtOpenFeignClient.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/feifn/EpmetExtOpenFeignClient.java new file mode 100644 index 0000000000..857129ffed --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/feifn/EpmetExtOpenFeignClient.java @@ -0,0 +1,18 @@ +package com.epmet.feifn; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.feifn.impl.EpmetExtOpenFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; + +/** + * desc: 数据统计 对外feign client + * + * @return: + * @date: 2020/8/11 13:24 + * @author: zxc + */ +//url="http://localhost:8113" +@FeignClient(name = ServiceConstant.EPMET_EXT_SERVER, fallback = EpmetExtOpenFeignClientFallBack.class) +public interface EpmetExtOpenFeignClient { + +} diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/feifn/impl/EpmetExtOpenFeignClientFallBack.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/feifn/impl/EpmetExtOpenFeignClientFallBack.java new file mode 100644 index 0000000000..6e46f94381 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/feifn/impl/EpmetExtOpenFeignClientFallBack.java @@ -0,0 +1,16 @@ +package com.epmet.feifn.impl; + +import com.epmet.feifn.EpmetExtOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * desc: + * + * @return: + * @date: 2020/8/11 13:28 + * @author: zxc + */ +@Component +public class EpmetExtOpenFeignClientFallBack implements EpmetExtOpenFeignClient { + +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/Dockerfile b/epmet-module/epmet-ext/epmet-ext-server/Dockerfile new file mode 100644 index 0000000000..2a18b4bf3a --- /dev/null +++ b/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"] \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml new file mode 100644 index 0000000000..58cd450f0f --- /dev/null +++ b/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 \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml new file mode 100644 index 0000000000..14e6df41ba --- /dev/null +++ b/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 \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-test.yml b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-test.yml new file mode 100644 index 0000000000..4335ec3381 --- /dev/null +++ b/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 \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-server/pom.xml b/epmet-module/epmet-ext/epmet-ext-server/pom.xml new file mode 100644 index 0000000000..286741c1a5 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/pom.xml @@ -0,0 +1,283 @@ + + + 4.0.0 + 0.0.1 + + + com.epmet + epmet-ext + 2.0.0 + + + epmet-ext-server + jar + + + 3.2.2 + 1.1.0 + 1.0.5 + 2.3.28 + + + + + com.epmet + epmet-ext-client + 2.0.0 + + + com.epmet + epmet-commons-tools + 2.0.0 + + + com.epmet + epmet-commons-mybatis + 2.0.0 + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework + spring-context-support + + + org.springframework.boot + spring-boot-starter-actuator + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + com.aliyun + aliyun-java-sdk-core + ${aliyun.core.version} + + + com.aliyun + aliyun-java-sdk-dysmsapi + ${aliyun.dysmsapi.version} + + + com.github.qcloudsms + qcloudsms + ${qcloud.qcloudsms.version} + + + com.sun.mail + javax.mail + + + org.freemarker + freemarker + ${freemarker.version} + + + + io.github.openfeign + feign-httpclient + 10.3.0 + + + + org.flywaydb + flyway-core + + + + + + com.squareup.okhttp3 + okhttp + 4.0.0 + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + org.dom4j + dom4j + 2.1.3 + compile + + + com.github.binarywang + weixin-java-common + 3.6.0 + compile + + + com.epmet + epmet-common-clienttoken + 2.0.0 + compile + + + com.epmet + oper-crm-client + 2.0.0 + compile + + + com.epmet + epmet-oss-client + 2.0.0 + compile + + + org.springframework + spring-test + 5.1.12.RELEASE + compile + + + + + com.aliyun + alibaba-dingtalk-service-sdk + 1.0.1 + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + ${project.basedir}/src/main/java + + + true + ${basedir}/src/main/resources + + + + + + dev + + true + + + 8113 + dev + + + + + + epmet_third_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + + + false + + + false + + + + test + + + 8113 + test + + + + + + epmet + elink@833066 + + 0 + r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com + 6379 + EpmEtrEdIs!q@w + + true + 192.168.10.150:8848 + 67e3c350-533e-4d7c-9f8f-faf1b4aa82ae + + + false + + + true + + + + + prod + + + 8113 + prod + + + + + + epmet_third_user + EpmEt-db-UsEr + + 0 + r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com + 6379 + EpmEtclOUdrEdIs!Q2w + + true + 192.168.11.180:8848 + bd205d23-e696-47be-b995-916313f86e99 + + + false + + + true + + + + + diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/EpmetExtApplication.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/EpmetExtApplication.java new file mode 100644 index 0000000000..89508e7873 --- /dev/null +++ b/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); + } + +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/aspect/RequestLogAspect.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..49581cf63c --- /dev/null +++ b/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(); + } + +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/config/ModuleConfigImpl.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/config/ModuleConfigImpl.java new file mode 100644 index 0000000000..5cc47783e6 --- /dev/null +++ b/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"; + } +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java new file mode 100644 index 0000000000..3bf387efcf --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java @@ -0,0 +1,10 @@ +package com.epmet.constant; + +/** + * @Description + * @author zxc + */ +public interface ModuleConstant { + + +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000..c51f11149a --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml @@ -0,0 +1,100 @@ +server: + port: @server.port@ + servlet: + context-path: /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 \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..ec4a9fc8e0 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/logback-spring.xml @@ -0,0 +1,164 @@ + + + + + + + + + + ${appname} + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + ${log.path}/error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/epmet-ext/pom.xml b/epmet-module/epmet-ext/pom.xml new file mode 100644 index 0000000000..795eb9a45f --- /dev/null +++ b/epmet-module/epmet-ext/pom.xml @@ -0,0 +1,21 @@ + + + + epmet-module + com.epmet + 2.0.0 + + 4.0.0 + + epmet-ext + pom + + + epmet-ext-client + epmet-ext-server + + + + \ No newline at end of file diff --git a/epmet-module/pom.xml b/epmet-module/pom.xml index dd7611267b..2f4b8d2ff8 100644 --- a/epmet-module/pom.xml +++ b/epmet-module/pom.xml @@ -42,6 +42,7 @@ epmet-third epmet-heart epmet-point + epmet-ext From ee01f791bca4371faa6d8e7f16dd77c17b40f766 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 12 Aug 2020 09:20:56 +0800 Subject: [PATCH 002/119] =?UTF-8?q?=E5=AE=9A=E5=88=B6=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E3=80=81sql=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/CustomerFunctionDetailDTO.java | 111 ++++++++++++++++++ .../com/epmet/dto/FunctionCustomizedDTO.java | 106 +++++++++++++++++ .../CustomerFunctionDetailController.java | 94 +++++++++++++++ .../FunctionCustomizedController.java | 94 +++++++++++++++ .../epmet/dao/CustomerFunctionDetailDao.java | 33 ++++++ .../com/epmet/dao/FunctionCustomizedDao.java | 33 ++++++ .../entity/CustomerFunctionDetailEntity.java | 81 +++++++++++++ .../entity/FunctionCustomizedEntity.java | 76 ++++++++++++ .../excel/CustomerFunctionDetailExcel.java | 80 +++++++++++++ .../epmet/excel/FunctionCustomizedExcel.java | 77 ++++++++++++ .../redis/CustomerFunctionDetailRedis.java | 47 ++++++++ .../epmet/redis/FunctionCustomizedRedis.java | 47 ++++++++ .../CustomerFunctionDetailService.java | 95 +++++++++++++++ .../service/FunctionCustomizedService.java | 95 +++++++++++++++ .../CustomerFunctionDetailServiceImpl.java | 104 ++++++++++++++++ .../impl/FunctionCustomizedServiceImpl.java | 104 ++++++++++++++++ .../V0.0.4__add_customer_function_detail.sql | 26 ++++ .../mapper/CustomerFunctionDetailDao.xml | 7 ++ .../mapper/FunctionCustomizedDao.xml | 8 ++ 19 files changed, 1318 insertions(+) create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionDetailDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionDetailEntity.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedEntity.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFunctionDetailExcel.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedExcel.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFunctionDetailRedis.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionCustomizedRedis.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionDetailDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionDetailDTO.java new file mode 100644 index 0000000000..6d0635965b --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionDetailDTO.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 realmName; + + /** + * 外链地址 + */ + private String targetLink; + + /** + * 自定义排序 + */ + private Integer displayOrder; + + /** + * 删除标识(0.未删除 1.已删除) + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedDTO.java new file mode 100644 index 0000000000..cd924cc5c5 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java new file mode 100644 index 0000000000..364e57c6e5 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.CustomerFunctionDetailDTO; +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> page(@RequestParam Map params){ + PageData page = customerFunctionDetailService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CustomerFunctionDetailDTO data = customerFunctionDetailService.get(id); + return new Result().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 params, HttpServletResponse response) throws Exception { + List list = customerFunctionDetailService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerFunctionDetailExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java new file mode 100644 index 0000000000..f2b7d76b19 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.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> page(@RequestParam Map params){ + PageData page = functionCustomizedService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + FunctionCustomizedDTO data = functionCustomizedService.get(id); + return new Result().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 params, HttpServletResponse response) throws Exception { + List list = functionCustomizedService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, FunctionCustomizedExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java new file mode 100644 index 0000000000..cf669b9411 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.CustomerFunctionDetailEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户定制功能详情表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +@Mapper +public interface CustomerFunctionDetailDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java new file mode 100644 index 0000000000..81bec520b6 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.FunctionCustomizedEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 定制功能 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +@Mapper +public interface FunctionCustomizedDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionDetailEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionDetailEntity.java new file mode 100644 index 0000000000..13db363fea --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionDetailEntity.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户定制功能详情表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_function_detail") +public class CustomerFunctionDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 功能Id + */ + private String functionId; + + /** + * 自定义功能名称 + */ + private String functionName; + + /** + * 自定义大图标 + */ + private String iconLargeImg; + + /** + * 自定义小图标 + */ + private String iconSmallImg; + + /** + * 自定义业务域名 + */ + private String realmName; + + /** + * 外链地址 + */ + private String targetLink; + + /** + * 自定义排序 + */ + private Integer displayOrder; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedEntity.java new file mode 100644 index 0000000000..38f6e46959 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 定制功能 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("function_customized") +public class FunctionCustomizedEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 功能ID(function.ID) + */ + private String functionId; + + /** + * 默认名称 + */ + private String customizedName; + + /** + * 默认大图标 + */ + private String iconLargeImg; + + /** + * 默认小图标 + */ + private String iconSmallImg; + + /** + * 外链地址(必须是https的请求) + */ + private String targetLink; + + /** + * 业务域名 + */ + private String realmName; + + /** + * 来源app(政府端:gov、居民端:resi) + */ + private String fromApp; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFunctionDetailExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFunctionDetailExcel.java new file mode 100644 index 0000000000..06afddcd89 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFunctionDetailExcel.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 客户定制功能详情表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +@Data +public class CustomerFunctionDetailExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "功能Id") + private String functionId; + + @Excel(name = "自定义功能名称") + private String functionName; + + @Excel(name = "自定义大图标") + private String iconLargeImg; + + @Excel(name = "自定义小图标") + private String iconSmallImg; + + @Excel(name = "自定义业务域名") + private String realmName; + + @Excel(name = "外链地址") + private String targetLink; + + @Excel(name = "自定义排序") + private Integer displayOrder; + + @Excel(name = "删除标识(0.未删除 1.已删除)") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedExcel.java new file mode 100644 index 0000000000..786705a763 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedExcel.java @@ -0,0 +1,77 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 定制功能 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +@Data +public class FunctionCustomizedExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "功能ID(function.ID)") + private String functionId; + + @Excel(name = "默认名称") + private String customizedName; + + @Excel(name = "默认大图标") + private String iconLargeImg; + + @Excel(name = "默认小图标") + private String iconSmallImg; + + @Excel(name = "外链地址(必须是https的请求)") + private String targetLink; + + @Excel(name = "删除标识(0.未删除 1.已删除)") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "业务域名") + private String realmName; + + @Excel(name = "来源app(政府端:gov、居民端:resi)") + private String fromApp; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFunctionDetailRedis.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFunctionDetailRedis.java new file mode 100644 index 0000000000..c60f3b338f --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFunctionDetailRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 客户定制功能详情表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +@Component +public class CustomerFunctionDetailRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionCustomizedRedis.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionCustomizedRedis.java new file mode 100644 index 0000000000..f2854b11ef --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionCustomizedRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 定制功能 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +@Component +public class FunctionCustomizedRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java new file mode 100644 index 0000000000..5c5237077c --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CustomerFunctionDetailDTO; +import com.epmet.entity.CustomerFunctionDetailEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户定制功能详情表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +public interface CustomerFunctionDetailService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-08-11 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-08-11 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerFunctionDetailDTO + * @author generator + * @date 2020-08-11 + */ + CustomerFunctionDetailDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-11 + */ + void save(CustomerFunctionDetailDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-11 + */ + void update(CustomerFunctionDetailDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-08-11 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java new file mode 100644 index 0000000000..d2ca6af480 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.FunctionCustomizedDTO; +import com.epmet.entity.FunctionCustomizedEntity; + +import java.util.List; +import java.util.Map; + +/** + * 定制功能 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +public interface FunctionCustomizedService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-08-11 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-08-11 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FunctionCustomizedDTO + * @author generator + * @date 2020-08-11 + */ + FunctionCustomizedDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-11 + */ + void save(FunctionCustomizedDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-11 + */ + void update(FunctionCustomizedDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-08-11 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java new file mode 100644 index 0000000000..cb98e0da8d --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.CustomerFunctionDetailDao; +import com.epmet.dto.CustomerFunctionDetailDTO; +import com.epmet.entity.CustomerFunctionDetailEntity; +import com.epmet.redis.CustomerFunctionDetailRedis; +import com.epmet.service.CustomerFunctionDetailService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 客户定制功能详情表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +@Service +public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl implements CustomerFunctionDetailService { + + @Autowired + private CustomerFunctionDetailRedis customerFunctionDetailRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CustomerFunctionDetailDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CustomerFunctionDetailDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public CustomerFunctionDetailDTO get(String id) { + CustomerFunctionDetailEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CustomerFunctionDetailDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CustomerFunctionDetailDTO dto) { + CustomerFunctionDetailEntity entity = ConvertUtils.sourceToTarget(dto, CustomerFunctionDetailEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CustomerFunctionDetailDTO dto) { + CustomerFunctionDetailEntity entity = ConvertUtils.sourceToTarget(dto, CustomerFunctionDetailEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java new file mode 100644 index 0000000000..a978198c89 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.FunctionCustomizedDao; +import com.epmet.dto.FunctionCustomizedDTO; +import com.epmet.entity.FunctionCustomizedEntity; +import com.epmet.redis.FunctionCustomizedRedis; +import com.epmet.service.FunctionCustomizedService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 定制功能 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +@Service +public class FunctionCustomizedServiceImpl extends BaseServiceImpl implements FunctionCustomizedService { + + @Autowired + private FunctionCustomizedRedis functionCustomizedRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FunctionCustomizedDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FunctionCustomizedDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FunctionCustomizedDTO get(String id) { + FunctionCustomizedEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FunctionCustomizedDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FunctionCustomizedDTO dto) { + FunctionCustomizedEntity entity = ConvertUtils.sourceToTarget(dto, FunctionCustomizedEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FunctionCustomizedDTO dto) { + FunctionCustomizedEntity entity = ConvertUtils.sourceToTarget(dto, FunctionCustomizedEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql new file mode 100644 index 0000000000..d75428c980 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql @@ -0,0 +1,26 @@ +DROP TABLE IF EXISTS `customer_function_detail`; +CREATE TABLE `customer_function_detail` ( + `ID` varchar(64) NOT NULL COMMENT ''主键'', + `CUSTOMER_ID` varchar(32) NOT NULL COMMENT ''客户Id'', + `FUNCTION_ID` varchar(32) NOT NULL COMMENT ''功能Id'', + `FUNCTION_NAME` varchar(32) NOT NULL COMMENT ''自定义功能名称'', + `ICON_LARGE_IMG` varchar(32) NOT NULL COMMENT ''自定义大图标'', + `ICON_SMALL_IMG` varchar(32) NOT NULL COMMENT ''自定义小图标'', + `REALM_NAME` varchar(32) NOT NULL COMMENT ''自定义业务域名'', + `TARGET_LINK` varchar(32) NOT NULL COMMENT ''外链地址'', + `DISPLAY_ORDER` int(11) NOT NULL COMMENT ''自定义排序'', + `DEL_FLAG` int(11) NOT NULL COMMENT ''删除标识(0.未删除 1.已删除)'', + `REVISION` int(11) NOT NULL COMMENT ''乐观锁'', + `CREATED_BY` varchar(32) NOT NULL COMMENT ''创建人'', + `CREATED_TIME` datetime NOT NULL COMMENT ''创建时间'', + `UPDATED_BY` varchar(32) NOT NULL COMMENT ''更新人'', + `UPDATED_TIME` datetime NOT NULL COMMENT ''更新时间'', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT=''客户定制功能详情表''; + + + +ALTER TABLE `function_customized` ADD COLUMN `REALM_NAME` VARCHAR (128) CHARACTER +SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '业务域名' AFTER `UPDATED_TIME`, + ADD COLUMN `FROM_APP` VARCHAR (32) CHARACTER +SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '来源app(政府端:gov、居民端:resi)' AFTER `REALM_NAME`; diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml new file mode 100644 index 0000000000..bf676117e5 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml new file mode 100644 index 0000000000..1a6e03ed81 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file From 6df21aa1ee7c559145039a5cba039daffa33bbb9 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 12 Aug 2020 10:41:07 +0800 Subject: [PATCH 003/119] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=BD=91=E6=A0=BC=E6=95=B0=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/CustomerDTO.java | 5 +++++ .../src/main/java/com/epmet/entity/CustomerEntity.java | 5 +++++ .../src/main/java/com/epmet/excel/CustomerExcel.java | 3 +++ .../java/com/epmet/service/impl/CustomerServiceImpl.java | 2 ++ .../main/resources/db/migration/V0.0.2__update_customer.sql | 3 +++ 5 files changed, 18 insertions(+) create mode 100644 epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.2__update_customer.sql diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerDTO.java index 7a78fbb209..8e752eb744 100644 --- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerDTO.java +++ b/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.已删除 */ diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerEntity.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerEntity.java index c5c511cbed..6e56fbee35 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerEntity.java +++ b/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; + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/excel/CustomerExcel.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/excel/CustomerExcel.java index 1708a19dbc..7bd1260e8d 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/excel/CustomerExcel.java +++ b/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; + } \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java index 219ad17f20..6565160593 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java @@ -470,6 +470,8 @@ public class CustomerServiceImpl extends BaseServiceImpl Date: Wed, 12 Aug 2020 17:24:25 +0800 Subject: [PATCH 004/119] =?UTF-8?q?db=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V0.0.4__add_customer_function_detail.sql | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql index d75428c980..9f2e70f784 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql @@ -1,13 +1,13 @@ DROP TABLE IF EXISTS `customer_function_detail`; CREATE TABLE `customer_function_detail` ( `ID` varchar(64) NOT NULL COMMENT ''主键'', - `CUSTOMER_ID` varchar(32) NOT NULL COMMENT ''客户Id'', - `FUNCTION_ID` varchar(32) NOT NULL COMMENT ''功能Id'', - `FUNCTION_NAME` varchar(32) NOT NULL COMMENT ''自定义功能名称'', - `ICON_LARGE_IMG` varchar(32) NOT NULL COMMENT ''自定义大图标'', - `ICON_SMALL_IMG` varchar(32) NOT NULL COMMENT ''自定义小图标'', - `REALM_NAME` varchar(32) NOT NULL COMMENT ''自定义业务域名'', - `TARGET_LINK` varchar(32) NOT NULL COMMENT ''外链地址'', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT ''客户Id'', + `FUNCTION_ID` varchar(64) NOT NULL COMMENT ''功能Id'', + `FUNCTION_NAME` varchar(128) NOT NULL COMMENT ''自定义功能名称'', + `ICON_LARGE_IMG` varchar(128) NOT NULL COMMENT ''自定义大图标'', + `ICON_SMALL_IMG` varchar(128) NOT NULL COMMENT ''自定义小图标'', + `DOMAIN_NAME` varchar(32) NOT NULL COMMENT ''自定义业务域名'', + `TARGET_LINK` varchar(128) NOT NULL COMMENT ''外链地址'', `DISPLAY_ORDER` int(11) NOT NULL COMMENT ''自定义排序'', `DEL_FLAG` int(11) NOT NULL COMMENT ''删除标识(0.未删除 1.已删除)'', `REVISION` int(11) NOT NULL COMMENT ''乐观锁'', @@ -20,7 +20,7 @@ CREATE TABLE `customer_function_detail` ( -ALTER TABLE `function_customized` ADD COLUMN `REALM_NAME` VARCHAR (128) CHARACTER +ALTER TABLE `function_customized` ADD COLUMN `DOMAIN_NAME` VARCHAR (128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '业务域名' AFTER `UPDATED_TIME`, ADD COLUMN `FROM_APP` VARCHAR (32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '来源app(政府端:gov、居民端:resi)' AFTER `REALM_NAME`; From 83424ba36bd66a0ec2352dc5970d58a5a075bae9 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 12 Aug 2020 17:36:14 +0800 Subject: [PATCH 005/119] =?UTF-8?q?=E4=BF=AE=E6=94=B9sql=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=20=E8=AE=BE=E7=BD=AE=E7=BD=91=E6=A0=BC=E6=95=B0=E9=BB=98?= =?UTF-8?q?=E8=AE=A410?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/db/migration/V0.0.2__update_customer.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.2__update_customer.sql b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.2__update_customer.sql index c60b9bfe46..27379d7feb 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.2__update_customer.sql +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.2__update_customer.sql @@ -1,3 +1,5 @@ ALTER TABLE `customer` -ADD COLUMN `GRID_NUMBER` int(11) NULL COMMENT '客户允许创建的网格数' AFTER `ORGANIZATION_LEVEL`; \ No newline at end of file +ADD COLUMN `GRID_NUMBER` int(11) NULL COMMENT '客户允许创建的网格数' AFTER `ORGANIZATION_LEVEL`; + +UPDATE customer SET GRID_NUMBER = 10; \ No newline at end of file From 7ad16dabc98e6599a25df2ae56dcfad73dfb4dda Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 12 Aug 2020 17:57:53 +0800 Subject: [PATCH 006/119] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=BF=BD=E8=B8=AA?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/ProjectResponseFormDTO.java | 48 +++++++++++++++++++ .../epmet/service/ProjectTraceService.java | 9 ++++ .../service/impl/ProjectTraceServiceImpl.java | 5 ++ 3 files changed, 62 insertions(+) create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java new file mode 100644 index 0000000000..bd7a69b259 --- /dev/null +++ b/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; +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java index a3ebf9d74c..bb4f4b4c36 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java @@ -107,4 +107,13 @@ public interface ProjectTraceService { * @Description 项目跟踪-项目人员选择 **/ ProcessorListResultDTO processorList(ProcessorListFormDTO formDTO); + + /** + * 处理响应 + * @author zhaoqifeng + * @date 2020/8/12 17:54 + * @param formDTO + * @return void + */ + void response(ProjectResponseFormDTO formDTO); } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java index fb608230b0..684a213503 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java @@ -95,4 +95,9 @@ public class ProjectTraceServiceImpl implements ProjectTraceService { Result resultDTOResult = govOrgFeignClient.getProcessorList(staffEntity.getOrgId()); return resultDTOResult.getData(); } + + @Override + public void response(ProjectResponseFormDTO formDTO) { + + } } From 7bcedf2ac231e2241379d950598e81afc92cbb33 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 12 Aug 2020 18:07:48 +0800 Subject: [PATCH 007/119] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 2 ++ .../java/com/epmet/dao/CustomerGridDao.java | 8 +++++ .../service/impl/CustomerGridServiceImpl.java | 32 ++++++++++++++++--- .../main/resources/mapper/CustomerGridDao.xml | 11 +++++++ .../com/epmet/dto/form/GridCountFormDTO.java | 17 ++++++++++ .../epmet/dto/result/GridCountResultDTO.java | 17 ++++++++++ .../epmet/feign/OperCrmOpenFeignClient.java | 11 +++++++ .../OperCrmOpenFeignClientFallback.java | 7 ++++ .../epmet/controller/CustomerController.java | 11 +++++++ .../main/java/com/epmet/dao/CustomerDao.java | 9 ++++++ .../com/epmet/service/CustomerService.java | 13 +++++--- .../service/impl/CustomerServiceImpl.java | 12 +++++++ .../src/main/resources/mapper/CustomerDao.xml | 11 +++++++ 13 files changed, 152 insertions(+), 9 deletions(-) create mode 100644 epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/GridCountFormDTO.java create mode 100644 epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/GridCountResultDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index fbbeebccbf..50512fd6d6 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/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,"您已表态"), diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index 09f71efd99..1d50d1453a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -216,4 +216,12 @@ public interface CustomerGridDao extends BaseDao { * @Description 单客户-指定区时查询当前城市下除该区之外其余的网格 **/ List selectThirdRestGridWithoutGivenAreaCode(Map map); + + /** + * @Description 查询当前客户已有网格数量 + * @param customerId + * @author zxc + * @date 2020/8/12 5:10 下午 + */ + Integer selectGridCount(@Param("customerId")String customerId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index 8f023276a3..fd32b2a087 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -37,6 +37,7 @@ 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; @@ -69,11 +70,11 @@ public class CustomerGridServiceImpl extends BaseServiceImpl page(Map params) { @@ -206,15 +207,36 @@ public class CustomerGridServiceImpl extends BaseServiceImpl().ok(griddetail); } + /** + * @Desc 网格添加 + * @Author zxc + * @param tokenDto + * @param addGridFormDTO + * @return + */ @Override @Transactional(rollbackFor = Exception.class) public Result 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()); diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index 802ec9f2f3..b9a98117e1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -462,4 +462,15 @@ ) AS c LIMIT #{pageNo}, #{pageSize} + + + \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/GridCountFormDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/GridCountFormDTO.java new file mode 100644 index 0000000000..a4ebfedc5c --- /dev/null +++ b/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; +} diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/GridCountResultDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/GridCountResultDTO.java new file mode 100644 index 0000000000..7264a71c72 --- /dev/null +++ b/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; +} diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java index 7b426012b4..161d3e5f9e 100644 --- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java +++ b/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> getAllCustomerList(); + + /** + * @Description 查询客户下可以创建网格的最大数 + * @param formDTO + * @author zxc + * @date 2020/8/12 4:37 下午 + */ + @PostMapping("/oper/crm/customer/getgridcount") + Result getGridCount(@RequestBody GridCountFormDTO formDTO); } diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java index b4f3947ed7..f4ad95f4ca 100644 --- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java +++ b/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> getAllCustomerList() { return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getAllCustomerList", null); } + + @Override + public Result getGridCount(GridCountFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getGridCount", formDTO); + } } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java index 79c49245b6..dc26003a63 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java @@ -32,6 +32,7 @@ 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.GridCountResultDTO; import com.epmet.dto.result.ValidCustomerResultDTO; import com.epmet.excel.CustomerExcel; import com.epmet.feign.GovOrgFeignClient; @@ -256,4 +257,14 @@ public class CustomerController { return new Result>().ok(customerService.getAllList()); } + /** + * @Description 查询客户下可以创建网格的最大数 + * @author zxc + * @date 2020/8/12 4:30 下午 + */ + @PostMapping("getgridcount") + public Result getGridCount(@RequestBody GridCountFormDTO formDTO){ + return new Result().ok(customerService.getGridCount(formDTO)); + } + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java index dea5f2f40b..40dd5394e6 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.CustomerDTO; 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 +75,12 @@ public interface CustomerDao extends BaseDao { */ List getAllList(); + /** + * @Description 查询客户下可以创建网格的最大数 + * @param customerId + * @author zxc + * @date 2020/8/12 4:46 下午 + */ + GridCountResultDTO getGridCount(@Param("customerId")String customerId); + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java index b815474688..08475a9f5b 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java @@ -21,11 +21,9 @@ 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.GridCountResultDTO; import com.epmet.dto.result.ValidCustomerResultDTO; import com.epmet.entity.CustomerEntity; @@ -174,4 +172,11 @@ public interface CustomerService extends BaseService { * @return */ List getAllList(); + + /** + * @Description 查询客户下可以创建网格的最大数 + * @author zxc + * @date 2020/8/12 4:30 下午 + */ + GridCountResultDTO getGridCount( GridCountFormDTO formDTO); } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java index 6565160593..a408167145 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java @@ -76,6 +76,8 @@ public class CustomerServiceImpl extends BaseServiceImpl page(Map params) { @@ -545,4 +547,14 @@ public class CustomerServiceImpl extends BaseServiceImpl + + + From 02305a9eff4f0a067a42744563ee4e18c726306b Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 13 Aug 2020 09:22:59 +0800 Subject: [PATCH 008/119] =?UTF-8?q?controller=E5=92=8Cservice=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/OpenUpController.java | 13 +++++++++++++ .../main/java/com/epmet/service/OpenUpService.java | 8 ++++++++ .../com/epmet/service/impl/OpenUpServiceImpl.java | 12 ++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java create mode 100644 epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java create mode 100644 epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java new file mode 100644 index 0000000000..52529d3f25 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java @@ -0,0 +1,13 @@ +package com.epmet.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:16 上午 + */ +@RestController +@RequestMapping("staff") +public class OpenUpController { +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java new file mode 100644 index 0000000000..89eabf11c5 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java @@ -0,0 +1,8 @@ +package com.epmet.service; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:17 上午 + */ +public interface OpenUpService { +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java new file mode 100644 index 0000000000..13eee68ae1 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java @@ -0,0 +1,12 @@ +package com.epmet.service.impl; + +import com.epmet.service.OpenUpService; +import org.springframework.stereotype.Service; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:18 上午 + */ +@Service +public class OpenUpServiceImpl implements OpenUpService { +} From a564ec8de864979ebe69cbcf88c58cb39328eeb3 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 13 Aug 2020 14:04:28 +0800 Subject: [PATCH 009/119] =?UTF-8?q?epmet-ext=20dto=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/StaffSinDeptFormDTO.java | 31 ++++++++++++++ .../epmet/dto/form/StaffSinGridFormDTO.java | 32 ++++++++++++++ .../dto/result/StaffSinDeptResultDTO.java | 42 +++++++++++++++++++ .../epmet/feifn/EpmetExtOpenFeignClient.java | 18 -------- .../impl/EpmetExtOpenFeignClientFallBack.java | 16 ------- 5 files changed, 105 insertions(+), 34 deletions(-) create mode 100644 epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinDeptFormDTO.java create mode 100644 epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinGridFormDTO.java create mode 100644 epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/StaffSinDeptResultDTO.java delete mode 100644 epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/feifn/EpmetExtOpenFeignClient.java delete mode 100644 epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/feifn/impl/EpmetExtOpenFeignClientFallBack.java diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinDeptFormDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinDeptFormDTO.java new file mode 100644 index 0000000000..b66de79686 --- /dev/null +++ b/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; +} diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinGridFormDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinGridFormDTO.java new file mode 100644 index 0000000000..a694dfddb1 --- /dev/null +++ b/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; +} diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/StaffSinDeptResultDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/StaffSinDeptResultDTO.java new file mode 100644 index 0000000000..dca9c292a3 --- /dev/null +++ b/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 roleList; + +} diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/feifn/EpmetExtOpenFeignClient.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/feifn/EpmetExtOpenFeignClient.java deleted file mode 100644 index 857129ffed..0000000000 --- a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/feifn/EpmetExtOpenFeignClient.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.epmet.feifn; - -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.feifn.impl.EpmetExtOpenFeignClientFallBack; -import org.springframework.cloud.openfeign.FeignClient; - -/** - * desc: 数据统计 对外feign client - * - * @return: - * @date: 2020/8/11 13:24 - * @author: zxc - */ -//url="http://localhost:8113" -@FeignClient(name = ServiceConstant.EPMET_EXT_SERVER, fallback = EpmetExtOpenFeignClientFallBack.class) -public interface EpmetExtOpenFeignClient { - -} diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/feifn/impl/EpmetExtOpenFeignClientFallBack.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/feifn/impl/EpmetExtOpenFeignClientFallBack.java deleted file mode 100644 index 6e46f94381..0000000000 --- a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/feifn/impl/EpmetExtOpenFeignClientFallBack.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.epmet.feifn.impl; - -import com.epmet.feifn.EpmetExtOpenFeignClient; -import org.springframework.stereotype.Component; - -/** - * desc: - * - * @return: - * @date: 2020/8/11 13:28 - * @author: zxc - */ -@Component -public class EpmetExtOpenFeignClientFallBack implements EpmetExtOpenFeignClient { - -} From 8b081281c06e0a537961d51593ddf39b746c5995 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 13 Aug 2020 14:17:56 +0800 Subject: [PATCH 010/119] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=9A=E5=88=B6?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E8=AE=BF=E9=97=AE=E8=AE=B0=E5=BD=95=E8=A1=A8?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/FunctionCustomizedVisitedDTO.java | 106 ++++++++++++++++++ .../FunctionCustomizedVisitedController.java | 94 ++++++++++++++++ .../dao/FunctionCustomizedVisitedDao.java | 33 ++++++ .../FunctionCustomizedVisitedEntity.java | 76 +++++++++++++ .../excel/FunctionCustomizedVisitedExcel.java | 77 +++++++++++++ .../redis/FunctionCustomizedVisitedRedis.java | 47 ++++++++ .../FunctionCustomizedVisitedService.java | 95 ++++++++++++++++ .../FunctionCustomizedVisitedServiceImpl.java | 104 +++++++++++++++++ .../V0.0.4__add_customer_function_detail.sql | 20 ++++ .../mapper/FunctionCustomizedVisitedDao.xml | 7 ++ 10 files changed, 659 insertions(+) create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedVisitedDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedVisitedController.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedVisitedDao.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedVisitedEntity.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedVisitedExcel.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionCustomizedVisitedRedis.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedVisitedService.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedVisitedServiceImpl.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedVisitedDao.xml diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedVisitedDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedVisitedDTO.java new file mode 100644 index 0000000000..84d2b50095 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + + /** + * 原因 失败的原因(例:请求超时、404、500等) + */ + private String msg; + + /** + * 删除标识(0.未删除 1.已删除) + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedVisitedController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedVisitedController.java new file mode 100644 index 0000000000..2c758cc8e2 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedVisitedController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.FunctionCustomizedVisitedDTO; +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> page(@RequestParam Map params){ + PageData page = functionCustomizedVisitedService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + FunctionCustomizedVisitedDTO data = functionCustomizedVisitedService.get(id); + return new Result().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 params, HttpServletResponse response) throws Exception { + List list = functionCustomizedVisitedService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, FunctionCustomizedVisitedExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedVisitedDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedVisitedDao.java new file mode 100644 index 0000000000..471724a387 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedVisitedDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.FunctionCustomizedVisitedEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 定制功能访问记录表 记录居民端、工作端那些人访问过定制功能以及访问的结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-13 + */ +@Mapper +public interface FunctionCustomizedVisitedDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedVisitedEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedVisitedEntity.java new file mode 100644 index 0000000000..6e9dfb53cd --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedVisitedEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 定制功能访问记录表 记录居民端、工作端那些人访问过定制功能以及访问的结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-13 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("function_customized_visited") +public class FunctionCustomizedVisitedEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户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; + + /** + * 原因 失败的原因(例:请求超时、404、500等) + */ + private String msg; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedVisitedExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedVisitedExcel.java new file mode 100644 index 0000000000..6d631d8380 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedVisitedExcel.java @@ -0,0 +1,77 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 定制功能访问记录表 记录居民端、工作端那些人访问过定制功能以及访问的结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-13 + */ +@Data +public class FunctionCustomizedVisitedExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "用户Id") + private String userId; + + @Excel(name = "所属端 居民端:resi工作端:work") + private String clientType; + + @Excel(name = "功能Id") + private String functionId; + + @Excel(name = "请求地址 访问的url地址") + private String url; + + @Excel(name = "结果 成功success失败error") + private String result; + + @Excel(name = "原因 失败的原因(例:请求超时、404、500等)") + private String msg; + + @Excel(name = "删除标识(0.未删除 1.已删除)") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionCustomizedVisitedRedis.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionCustomizedVisitedRedis.java new file mode 100644 index 0000000000..fabdc63ff3 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionCustomizedVisitedRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 定制功能访问记录表 记录居民端、工作端那些人访问过定制功能以及访问的结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-13 + */ +@Component +public class FunctionCustomizedVisitedRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedVisitedService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedVisitedService.java new file mode 100644 index 0000000000..b0dadfb74f --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedVisitedService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.FunctionCustomizedVisitedDTO; +import com.epmet.entity.FunctionCustomizedVisitedEntity; + +import java.util.List; +import java.util.Map; + +/** + * 定制功能访问记录表 记录居民端、工作端那些人访问过定制功能以及访问的结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-13 + */ +public interface FunctionCustomizedVisitedService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-08-13 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-08-13 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FunctionCustomizedVisitedDTO + * @author generator + * @date 2020-08-13 + */ + FunctionCustomizedVisitedDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-13 + */ + void save(FunctionCustomizedVisitedDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-13 + */ + void update(FunctionCustomizedVisitedDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-08-13 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedVisitedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedVisitedServiceImpl.java new file mode 100644 index 0000000000..0efa5282e7 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedVisitedServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.FunctionCustomizedVisitedDao; +import com.epmet.dto.FunctionCustomizedVisitedDTO; +import com.epmet.entity.FunctionCustomizedVisitedEntity; +import com.epmet.redis.FunctionCustomizedVisitedRedis; +import com.epmet.service.FunctionCustomizedVisitedService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 定制功能访问记录表 记录居民端、工作端那些人访问过定制功能以及访问的结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-13 + */ +@Service +public class FunctionCustomizedVisitedServiceImpl extends BaseServiceImpl implements FunctionCustomizedVisitedService { + + @Autowired + private FunctionCustomizedVisitedRedis functionCustomizedVisitedRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FunctionCustomizedVisitedDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FunctionCustomizedVisitedDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FunctionCustomizedVisitedDTO get(String id) { + FunctionCustomizedVisitedEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FunctionCustomizedVisitedDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FunctionCustomizedVisitedDTO dto) { + FunctionCustomizedVisitedEntity entity = ConvertUtils.sourceToTarget(dto, FunctionCustomizedVisitedEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FunctionCustomizedVisitedDTO dto) { + FunctionCustomizedVisitedEntity entity = ConvertUtils.sourceToTarget(dto, FunctionCustomizedVisitedEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql index 9f2e70f784..62f992bbb8 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql @@ -24,3 +24,23 @@ ALTER TABLE `function_customized` ADD COLUMN `DOMAIN_NAME` VARCHAR (128) CHARACT SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '业务域名' AFTER `UPDATED_TIME`, ADD COLUMN `FROM_APP` VARCHAR (32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '来源app(政府端:gov、居民端:resi)' AFTER `REALM_NAME`; + + +DROP TABLE IF EXISTS `function_customized_visited`; +CREATE TABLE function_customized_visited( + ID VARCHAR(64) NOT NULL COMMENT '主键' , + CUSTOMER_ID VARCHAR(32) NOT NULL COMMENT '客户ID' , + USER_ID VARCHAR(64) NOT NULL COMMENT '用户Id' , + CLIENT_TYPE VARCHAR(32) NOT NULL COMMENT '所属端 居民端:resi工作端:work' , + FUNCTION_ID VARCHAR(64) NOT NULL COMMENT '功能Id' , + URL VARCHAR(128) NOT NULL COMMENT '请求地址 访问的url地址' , + RESULT VARCHAR(1024) NOT NULL COMMENT '结果 成功success失败error' , + MSG VARCHAR(128) NOT NULL COMMENT '原因 失败的原因(例:请求超时、404、500等)' , + DEL_FLAG INT NOT NULL COMMENT '删除标识(0.未删除 1.已删除)' , + REVISION INT NOT NULL COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , + CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , + UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '定制功能访问记录表 记录居民端、工作端那些人访问过定制功能以及访问的结果'; \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedVisitedDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedVisitedDao.xml new file mode 100644 index 0000000000..938b189b2b --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedVisitedDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file From a8a034b06c5c75050eb18a115a42f93a3fef235a Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Thu, 13 Aug 2020 14:31:11 +0800 Subject: [PATCH 011/119] =?UTF-8?q?=E5=AE=9A=E5=88=B6=E5=8A=9F=E8=83=BD-?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E3=80=81=E5=88=A0=E9=99=A4=E3=80=81=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/CommonFunctionIdFormDTO.java | 23 ++++++ .../form/SaveFunctionCustomizedFormDTO.java | 72 ++++++++++++++++++ .../FunctionCustomizedDetailResultDTO.java | 66 ++++++++++++++++ .../FunctionCustomizedController.java | 52 ++++++++++++- .../epmet/dao/CustomerFunctionDetailDao.java | 17 ++++- .../com/epmet/dao/FunctionCustomizedDao.java | 29 ++++++- .../entity/FunctionCustomizedEntity.java | 4 +- .../service/FunctionCustomizedService.java | 38 +++++++++- .../impl/FunctionCustomizedServiceImpl.java | 75 ++++++++++++++++++- .../mapper/CustomerFunctionDetailDao.xml | 11 ++- .../mapper/FunctionCustomizedDao.xml | 26 ++++++- 11 files changed, 395 insertions(+), 18 deletions(-) create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CommonFunctionIdFormDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveFunctionCustomizedFormDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CommonFunctionIdFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CommonFunctionIdFormDTO.java new file mode 100644 index 0000000000..a2200fdf5c --- /dev/null +++ b/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; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveFunctionCustomizedFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveFunctionCustomizedFormDTO.java new file mode 100644 index 0000000000..830361aeb3 --- /dev/null +++ b/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; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java new file mode 100644 index 0000000000..c66714806e --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java @@ -0,0 +1,66 @@ +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; + + /** + * 定制详情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; +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java index f2b7d76b19..5e08b41c16 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java @@ -26,6 +26,9 @@ 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.SaveFunctionCustomizedFormDTO; +import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; import com.epmet.excel.FunctionCustomizedExcel; import com.epmet.service.FunctionCustomizedService; import org.springframework.beans.factory.annotation.Autowired; @@ -37,7 +40,7 @@ import java.util.Map; /** - * 定制功能 + * 定制功能 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-08-11 @@ -45,7 +48,7 @@ import java.util.Map; @RestController @RequestMapping("functioncustomized") public class FunctionCustomizedController { - + @Autowired private FunctionCustomizedService functionCustomizedService; @@ -91,4 +94,47 @@ public class FunctionCustomizedController { ExcelUtils.exportExcelToTarget(response, null, list, FunctionCustomizedExcel.class); } -} \ No newline at end of file + /** + * 定制功能新增(功能表、定制功能表) + * + * @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 + * @Author zhangyong + * @Date 10:36 2020-08-13 + **/ + @PostMapping("getfunctioncustomized") + public Result getFunctionCustomized(@RequestBody CommonFunctionIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return functionCustomizedService.getFunctionCustomized(formDTO); + } + + /** + * 定制功能删除 + * 单条删除,在没有客户使用的前提下可以逻辑删除(客户定制功能详情表 ,没查到就是没人在使用) + * @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); + } +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java index cf669b9411..0b6c9c20fc 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java @@ -20,6 +20,9 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.CustomerFunctionDetailEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 客户定制功能详情表 @@ -29,5 +32,15 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface CustomerFunctionDetailDao extends BaseDao { - -} \ No newline at end of file + + /** + * 根据functionId查询使用该功能的,客户id: customizedId + * 可用来判断该功能,是否有客户在使用 + * + * @param functionId + * @return java.util.List + * @Author zhangyong + * @Date 11:14 2020-08-13 + **/ + List selectCustomerIdByFunctionId(@Param("functionId") String functionId); +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java index 81bec520b6..51fcc8d4b8 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java @@ -18,16 +18,39 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.CommonFunctionIdFormDTO; +import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; import com.epmet.entity.FunctionCustomizedEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** - * 定制功能 + * 定制功能 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-08-11 */ @Mapper public interface FunctionCustomizedDao extends BaseDao { - -} \ No newline at end of file + + /** + * 定制功能详情 + * 根据定制功能Id查询对应的详情数据 + * + * @param formDTO + * @return com.epmet.dto.result.FunctionCustomizedDetailResultDTO + * @Author zhangyong + * @Date 10:36 2020-08-13 + **/ + FunctionCustomizedDetailResultDTO getFunctionCustomizedByFunctionId(CommonFunctionIdFormDTO formDTO); + + /** + * 根据functionId, 对定制功能表,进行逻辑删除 + * + * @param functionId + * @return void + * @Author zhangyong + * @Date 13:31 2020-08-13 + **/ + void delByFunctionId(@Param("functionId") String functionId); +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedEntity.java index 38f6e46959..45983b12b0 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedEntity.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedEntity.java @@ -26,7 +26,7 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * 定制功能 + * 定制功能 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-08-11 @@ -66,7 +66,7 @@ public class FunctionCustomizedEntity extends BaseEpmetEntity { /** * 业务域名 */ - private String realmName; + private String domainName; /** * 来源app(政府端:gov、居民端:resi) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java index d2ca6af480..5186baadff 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java @@ -19,14 +19,18 @@ package com.epmet.service; 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.FunctionCustomizedDTO; +import com.epmet.dto.form.CommonFunctionIdFormDTO; +import com.epmet.dto.form.SaveFunctionCustomizedFormDTO; +import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; import com.epmet.entity.FunctionCustomizedEntity; import java.util.List; import java.util.Map; /** - * 定制功能 + * 定制功能 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-08-11 @@ -92,4 +96,34 @@ public interface FunctionCustomizedService extends BaseService + * @Author zhangyong + * @Date 10:36 2020-08-13 + **/ + Result getFunctionCustomized(CommonFunctionIdFormDTO formDTO); + + /** + * 定制功能删除 + * 单条删除,在没有客户使用的前提下可以逻辑删除(客户定制功能详情表 ,没查到就是没人在使用) + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 11:03 2020-08-13 + **/ + Result deleteFunctionCustomized(CommonFunctionIdFormDTO formDTO); +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java index a978198c89..2e5ab91e4b 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java @@ -20,14 +20,23 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.CustomerFunctionDetailDao; import com.epmet.dao.FunctionCustomizedDao; +import com.epmet.dao.FunctionDao; import com.epmet.dto.FunctionCustomizedDTO; +import com.epmet.dto.form.CommonFunctionIdFormDTO; +import com.epmet.dto.form.SaveFunctionCustomizedFormDTO; +import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; import com.epmet.entity.FunctionCustomizedEntity; +import com.epmet.entity.FunctionEntity; import com.epmet.redis.FunctionCustomizedRedis; import com.epmet.service.FunctionCustomizedService; +import com.epmet.service.FunctionService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -38,7 +47,7 @@ import java.util.List; import java.util.Map; /** - * 定制功能 + * 定制功能 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-08-11 @@ -48,6 +57,10 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl page(Map params) { @@ -101,4 +114,62 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl getFunctionCustomized(CommonFunctionIdFormDTO formDTO) { + FunctionCustomizedDetailResultDTO resultDTO = baseDao.getFunctionCustomizedByFunctionId(formDTO); + return new Result().ok(resultDTO); + } + + @Override + public Result deleteFunctionCustomized(CommonFunctionIdFormDTO formDTO) { + // 1.客户定制功能详情表 ,没查到就是没人在使用 + List customizedId = customerFunctionDetailDao.selectCustomerIdByFunctionId(formDTO.getFunctionId()); + if (customizedId != null && customizedId.size() > NumConstant.ZERO){ + return new Result<>().error(8000, "功能正在使用中,不允许删除!"); + } else { + // 2.单条逻辑删除 - 功能表 + String[] ids = new String[1]; + ids[0] = formDTO.getFunctionId(); + functionService.delete(ids); + // 3.单条逻辑删除 - 定制功能表 + baseDao.delByFunctionId(formDTO.getFunctionId()); + } + return new Result(); + } + + /** + * 保存数据到 功能表 + * @param formDTO + * @return com.epmet.entity.FunctionEntity + * @Author zhangyong + * @Date 10:03 2020-08-13 + **/ + private FunctionEntity saveFunction(SaveFunctionCustomizedFormDTO formDTO){ + FunctionEntity entity = new FunctionEntity(); + entity.setFunctionName(formDTO.getFunctionName()); + entity.setFunctionIcon(formDTO.getIconLargeImg()); + entity.setFunctionGroup(Integer.valueOf(formDTO.getFunctionGroup())); + entity.setShoppingStatus(Integer.valueOf(formDTO.getShoppingStatus())); + entity.setFunctionExplain(formDTO.getFunctionExplain()); + functionService.insert(entity); + return entity; + } + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml index bf676117e5..c8f7bbc925 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml @@ -3,5 +3,14 @@ + + - \ No newline at end of file + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml index 1a6e03ed81..b43ee05063 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml @@ -2,7 +2,27 @@ + + - - - \ No newline at end of file + + update function_customized set DEL_FLAG = 1 where FUNCTION_ID = #{functionId} and DEL_FLAG = '0' + + From 9bdddd42166c23884656d685c6b06f9fea568cd2 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 13 Aug 2020 14:32:27 +0800 Subject: [PATCH 012/119] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-ext/epmet-ext-server/pom.xml | 10 ++++ .../com/epmet/constant/ModuleConstant.java | 3 + .../epmet/controller/OpenUpController.java | 40 +++++++++++++ .../java/com/epmet/service/OpenUpService.java | 24 ++++++++ .../epmet/service/impl/OpenUpServiceImpl.java | 56 +++++++++++++++++++ .../epmet/dto/form/DepartmentIdFormDTO.java | 20 +++++++ .../com/epmet/dto/form/GridIdFormDTO.java | 20 +++++++ .../epmet/feign/GovOrgOpenFeignClient.java | 14 +++-- .../GovOrgOpenFeignClientFallback.java | 10 ++-- epmet-module/gov-org/gov-org-server/pom.xml | 5 ++ .../com/epmet/dto/form/UserIdsFormDTO.java | 18 ++++++ .../com/epmet/dto/result/RoleResultDTO.java | 33 +++++++++++ .../dto/result/StaffSinGridResultDTO.java | 42 ++++++++++++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 9 +++ .../EpmetUserOpenFeignClientFallback.java | 5 ++ .../controller/CustomerStaffController.java | 12 ++++ .../java/com/epmet/dao/CustomerStaffDao.java | 13 +++-- .../java/com/epmet/dao/GovStaffRoleDao.java | 10 ++++ .../epmet/service/CustomerStaffService.java | 8 +++ .../impl/CustomerStaffServiceImpl.java | 36 ++++++++++++ .../resources/mapper/CustomerStaffDao.xml | 19 +++++++ .../main/resources/mapper/GovStaffRoleDao.xml | 18 ++++++ 22 files changed, 413 insertions(+), 12 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentIdFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GridIdFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserIdsFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RoleResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffSinGridResultDTO.java diff --git a/epmet-module/epmet-ext/epmet-ext-server/pom.xml b/epmet-module/epmet-ext/epmet-ext-server/pom.xml index 286741c1a5..5a9047f096 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/pom.xml +++ b/epmet-module/epmet-ext/epmet-ext-server/pom.xml @@ -31,6 +31,16 @@ epmet-commons-tools 2.0.0 + + com.epmet + epmet-user-client + 2.0.0 + + + com.epmet + gov-org-client + 2.0.0 + com.epmet epmet-commons-mybatis diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java index 3bf387efcf..3fb03ea4b0 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java @@ -6,5 +6,8 @@ package com.epmet.constant; */ public interface ModuleConstant { + String ERROR_GOV_ORG = "调用gov_org服务查询网格下的所有工作人员失败"; + + String ERROR_EPMET_USER = "调用epmet_user服务查询网格下的所有工作人员失败"; } diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java index 52529d3f25..39c72634ed 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java @@ -1,8 +1,20 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.StaffSinDeptFormDTO; +import com.epmet.dto.form.StaffSinGridFormDTO; +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 上午 @@ -10,4 +22,32 @@ import org.springframework.web.bind.annotation.RestController; @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> staffSinGrid(@RequestBody StaffSinGridFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, StaffSinGridFormDTO.StaffSinGrid.class); + return new Result>().ok(openUpService.staffSinGrid(formDTO)); + } + + /** + * @Description 部门工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/13 9:51 上午 + */ + @PostMapping("staffsindept") + public Result> staffSinDept(@RequestBody StaffSinDeptFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, StaffSinDeptFormDTO.StaffSinDept.class); + return new Result>().ok(openUpService.staffSinDept(formDTO)); + } + } diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java index 89eabf11c5..6ede09ec01 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java @@ -1,8 +1,32 @@ package com.epmet.service; +import com.epmet.dto.form.StaffSinDeptFormDTO; +import com.epmet.dto.form.StaffSinGridFormDTO; +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 staffSinGrid(StaffSinGridFormDTO formDTO); + + /** + * @Description 部门工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/13 9:51 上午 + */ + List staffSinDept( StaffSinDeptFormDTO formDTO); + } diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java index 13eee68ae1..d2150266aa 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java @@ -1,12 +1,68 @@ package com.epmet.service.impl; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.ModuleConstant; +import com.epmet.dto.form.CommonGridIdFormDTO; +import com.epmet.dto.form.StaffSinDeptFormDTO; +import com.epmet.dto.form.StaffSinGridFormDTO; +import com.epmet.dto.form.UserIdsFormDTO; +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.bouncycastle.math.raw.Mod; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + /** * @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 staffSinGrid(StaffSinGridFormDTO formDTO) { + CommonGridIdFormDTO commonGridId = new CommonGridIdFormDTO(); + commonGridId.setGridId(formDTO.getGridId()); + commonGridId.setUserId(""); + Result> gridStaffs = govOrgOpenFeignClient.getGridStaffs(commonGridId); + if (!gridStaffs.success()){ + throw new RenException(ModuleConstant.ERROR_GOV_ORG); + } + List userIds = gridStaffs.getData(); + UserIdsFormDTO userIdsForm = new UserIdsFormDTO(); + userIdsForm.setUserIds(userIds); + Result> staffInfoList = epmetUserOpenFeignClient.getStaffInfoList(userIdsForm); + if (!staffInfoList.success()){ + throw new RenException(ModuleConstant.ERROR_EPMET_USER); + } + return staffInfoList.getData(); + } + + /** + * @Description 部门工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/13 9:51 上午 + */ + @Override + public List staffSinDept(StaffSinDeptFormDTO formDTO) { + return null; + } } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentIdFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentIdFormDTO.java new file mode 100644 index 0000000000..326a86860b --- /dev/null +++ b/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; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GridIdFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GridIdFormDTO.java new file mode 100644 index 0000000000..89f7e8489b --- /dev/null +++ b/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; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index a6bcb7d128..e0cbd43441 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/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; @@ -187,4 +184,13 @@ public interface GovOrgOpenFeignClient { **/ @PostMapping(value = "/gov/org/customeragency/getStaffOrgList",consumes = MediaType.APPLICATION_JSON_VALUE) Result> getStaffOrgList(StaffOrgFormDTO staffOrgFormDTO); + + /** + * @Description 查询一个网格下的所有工作人员 + * @param gridIdFormDTO + * @author zxc + * @date 2020/8/13 10:46 上午 + */ + @PostMapping("/gov/org/customerstaffgrid/getgridstaffs") + Result> getGridStaffs(@RequestBody CommonGridIdFormDTO gridIdFormDTO); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 6824fa5e65..d4a0d581b8 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/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,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { public Result> getStaffOrgList(StaffOrgFormDTO staffOrgFormDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffOrgList", staffOrgFormDTO); } + + @Override + public Result> getGridStaffs(CommonGridIdFormDTO gridIdFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridStaffs", gridIdFormDTO); + } } diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index bff2680d39..4ed6f8392a 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -18,6 +18,11 @@ gov-org-client 2.0.0 + + com.epmet + oper-crm-client + 2.0.0 + com.epmet epmet-commons-mybatis diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserIdsFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserIdsFormDTO.java new file mode 100644 index 0000000000..de8c542864 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserIdsFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/13 1:36 下午 + */ +@Data +public class UserIdsFormDTO implements Serializable { + + private static final long serialVersionUID = -6168528618954442905L; + + private List userIds; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RoleResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RoleResultDTO.java new file mode 100644 index 0000000000..c6424eca94 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RoleResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import jdk.nashorn.internal.ir.annotations.Ignore; +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 = -432136606721817459L; + + /** + * 角色key + */ + private String roleKey; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 用户id + */ + @JsonIgnore + private String userId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffSinGridResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffSinGridResultDTO.java new file mode 100644 index 0000000000..3827b2ea17 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffSinGridResultDTO.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 StaffSinGridResultDTO 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 roleList; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 8ea872a683..e627d868a9 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -259,4 +259,13 @@ public interface EpmetUserOpenFeignClient { **/ @PostMapping(value = "epmetuser/gridlatest/latestgridinfo") Result latestGridInfo(@RequestBody LatestGridInfoFormDTO formDTO); + + /** + * @Description 查询工作人员的信息 + * @param formDTO + * @author zxc + * @date 2020/8/13 1:37 下午 + */ + @PostMapping("epmetuser/customerstaff/getstaffinfolist") + Result> getStaffInfoList(@RequestBody UserIdsFormDTO formDTO); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 6e137becc1..f434996933 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -183,4 +183,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result latestGridInfo(LatestGridInfoFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "latestGridInfo", formDTO); } + + @Override + public Result> getStaffInfoList(UserIdsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffInfoList", formDTO); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index fd0c0f5a9e..8ed7c0727d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -321,4 +321,16 @@ public class CustomerStaffController { public Result> getCustsomerStaffByIdAndPhone(@RequestBody ThirdCustomerStaffFormDTO formDTO) { return new Result>().ok(customerStaffService.getCustsomerStaffByIdAndPhone(formDTO)); } + + /** + * @Description 查询工作人员的信息 + * @param formDTO + * @author zxc + * @date 2020/8/13 1:45 下午 + */ + @PostMapping("getstaffinfolist") + public Result> getStaffInfoList(@RequestBody UserIdsFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(customerStaffService.getStaffInfoList(formDTO)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index be19478a91..ce0ff406c7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -21,10 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.*; import com.epmet.dto.form.*; -import com.epmet.dto.result.DepartInStaffListResultDTO; -import com.epmet.dto.result.StaffInfoResultDTO; -import com.epmet.dto.result.CommonStaffInfoResultDTO; -import com.epmet.dto.result.StaffListResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.CustomerStaffEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -148,4 +145,12 @@ public interface CustomerStaffDao extends BaseDao { * @Description 根据客户ID、手机号查询政府端工作人员基本信息 **/ List selectStaff(ThirdCustomerStaffFormDTO formDTO); + + /** + * @Description 查询工作人员的信息 + * @param userIds + * @author zxc + * @date 2020/8/13 1:45 下午 + */ + List getStaffInfoList(@Param("userIds")List userIds); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java index 275a2e9742..0d019d63f6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java @@ -20,6 +20,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; +import com.epmet.dto.result.RoleInfoResultDTO; +import com.epmet.dto.result.RoleResultDTO; import com.epmet.entity.GovStaffRoleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -61,4 +63,12 @@ public interface GovStaffRoleDao extends BaseDao { List listRolesByCustomer(@Param("customerId") String customerId); GovStaffRoleResultDTO getDTOById(@Param("roleId") String roleId); + + /** + * @Description 查询用户的权限 + * @param userIds + * @author zxc + * @date 2020/8/13 2:14 下午 + */ + List getRoleInfoList(@Param("userIds")List userIds); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java index edbef03d60..1eb5e070e4 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java @@ -258,4 +258,12 @@ public interface CustomerStaffService extends BaseService { * @Description 根据客户ID、手机号查询政府端工作人员基本信息,校验用户是否存在 **/ List getCustsomerStaffByIdAndPhone(ThirdCustomerStaffFormDTO formDTO); + + /** + * @Description 查询工作人员的信息 + * @param formDTO + * @author zxc + * @date 2020/8/13 1:45 下午 + */ + List getStaffInfoList( UserIdsFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 0f00a32191..2ff38361cb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -36,6 +36,7 @@ import com.epmet.constant.RoleKeyConstants; import com.epmet.constant.UserConstant; import com.epmet.constant.UserRoleConstant; import com.epmet.dao.CustomerStaffDao; +import com.epmet.dao.GovStaffRoleDao; import com.epmet.dao.StaffRoleDao; import com.epmet.dto.*; import com.epmet.dto.form.*; @@ -56,6 +57,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -93,6 +95,10 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl page(Map params) { @@ -540,4 +546,34 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl getStaffInfoList(UserIdsFormDTO formDTO) { + List userIds = formDTO.getUserIds(); + // 1. 根据userId查询人员基本信息 + List staffInfoList = customerStaffDao.getStaffInfoList(userIds); + if (staffInfoList.size() == NumConstant.ZERO){ + return staffInfoList; + } + // 2. 根据userId查询权限 + List roleInfoList = govStaffRoleDao.getRoleInfoList(userIds); + staffInfoList.forEach(staffInfo -> { + List roleResult = new ArrayList<>(); + roleInfoList.forEach(role -> { + if (staffInfo.getStaffId().equals(role.getUserId())){ + RoleResultDTO result = new RoleResultDTO(); + BeanUtils.copyProperties(role,result); + roleResult.add(result); + } + }); + staffInfo.setRoleList(roleResult); + }); + return staffInfoList; + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index 7466c53d67..888dc5c142 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -215,4 +215,23 @@ AND mobile = #{mobile} ORDER BY active_time DESC, created_time ASC + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml index 22f47ce8bc..a9da37f9d9 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml @@ -68,4 +68,22 @@ gsr.ORG_TYPE AS orgType FROM gov_staff_role gsr WHERE ID = #{roleId} + + + \ No newline at end of file From d7bfefa6d8e007de4414ba2861efd01f76234479 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Thu, 13 Aug 2020 15:28:30 +0800 Subject: [PATCH 013/119] =?UTF-8?q?=E5=AE=9A=E5=88=B6=E5=8A=9F=E8=83=BD-?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E9=80=BB=E8=BE=91-=E5=88=9D=E7=A8=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/UpdateCustomizedFormDTO.java | 78 +++++++++++++++++++ .../FunctionCustomizedController.java | 20 +++++ .../service/FunctionCustomizedService.java | 14 ++++ .../impl/FunctionCustomizedServiceImpl.java | 56 +++++++++++++ 4 files changed, 168 insertions(+) create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java new file mode 100644 index 0000000000..8b73f7cf19 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java @@ -0,0 +1,78 @@ +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; + + /** + * 定制功能详情ID + */ + @NotBlank(message = "定制功能详情ID不能为空") + private String customizedId; + + /** + * 默认名称 + */ + @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; +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java index 5e08b41c16..1739ec15ae 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java @@ -28,6 +28,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.FunctionCustomizedDTO; import com.epmet.dto.form.CommonFunctionIdFormDTO; import com.epmet.dto.form.SaveFunctionCustomizedFormDTO; +import com.epmet.dto.form.UpdateCustomizedFormDTO; import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; import com.epmet.excel.FunctionCustomizedExcel; import com.epmet.service.FunctionCustomizedService; @@ -127,6 +128,8 @@ public class FunctionCustomizedController { /** * 定制功能删除 * 单条删除,在没有客户使用的前提下可以逻辑删除(客户定制功能详情表 ,没查到就是没人在使用) + * 当功能 有客户在使用时,返回code: 8000 + * msg: 功能正在使用中,不允许删除! * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong @@ -137,4 +140,21 @@ public class FunctionCustomizedController { 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); + } } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java index 5186baadff..b52125f21d 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java @@ -23,6 +23,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.FunctionCustomizedDTO; import com.epmet.dto.form.CommonFunctionIdFormDTO; import com.epmet.dto.form.SaveFunctionCustomizedFormDTO; +import com.epmet.dto.form.UpdateCustomizedFormDTO; import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; import com.epmet.entity.FunctionCustomizedEntity; @@ -126,4 +127,17 @@ public interface FunctionCustomizedService extends BaseService customizedId = customerFunctionDetailDao.selectCustomerIdByFunctionId(formDTO.getFunctionId()); @@ -154,6 +156,41 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl customizedId = customerFunctionDetailDao.selectCustomerIdByFunctionId(formDTO.getFunctionId()); + FunctionCustomizedEntity entity = new FunctionCustomizedEntity(); + entity.setId(formDTO.getCustomizedId()); + entity.setIconLargeImg(formDTO.getIconLargeImg()); + entity.setIconSmallImg(formDTO.getIconSmallImg()); + entity.setCustomizedName(formDTO.getCustomizedName()); + if (customizedId != null && customizedId.size() > NumConstant.ZERO){ + // 有客户正在使用该 功能,只能修改功能名称和大小图标, 需要批量更新客户数据 + // 2.修改 功能表, 修改的字段范围,是:功能名称和大小图标 + this.upFunction(formDTO); + + // 3.修改 定制功能表, 修改的字段范围,是:功能名称和大小图标 + baseDao.updateById(entity); + + // 4.修改 客户定制功能详情表(多客户), 修改的字段范围,是:功能名称和大小图标 + return new Result<>().error(8000, "客户正在使用该功能不允许修改上下架状态、业务域名和外链地址、所属端app!"); + } else { + // 没有客户正在使用该 功能 + // 2.修改 功能表, 修改的字段范围,是所有入参字段 + this.upFunction(formDTO); + + // 3.修改 定制功能表, 修改的字段范围,是所有入参字段 + entity.setFunctionId(formDTO.getFunctionId()); + entity.setTargetLink(formDTO.getTargetLink()); + entity.setDomainName(formDTO.getDomainName()); + entity.setFromApp(formDTO.getFromApp()); + baseDao.updateById(entity); + } + return new Result(); + } + /** * 保存数据到 功能表 * @param formDTO @@ -172,4 +209,23 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl Date: Thu, 13 Aug 2020 16:31:52 +0800 Subject: [PATCH 014/119] =?UTF-8?q?epmet-ext=20=E9=83=A8=E9=97=A8=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/RoleResultDTO.java | 32 +++++++++++++++++++ .../com/epmet/constant/ModuleConstant.java | 4 ++- .../epmet/controller/OpenUpController.java | 9 ++++++ .../epmet/service/impl/OpenUpServiceImpl.java | 31 ++++++++++++++---- .../epmet/feign/GovOrgOpenFeignClient.java | 9 ++++++ .../GovOrgOpenFeignClientFallback.java | 5 +++ .../CustomerStaffDepartmentController.java | 13 ++++++++ .../epmet/dao/CustomerStaffDepartmentDao.java | 8 +++++ .../CustomerStaffDepartmentService.java | 9 ++++++ .../CustomerStaffDepartmentServiceImpl.java | 15 ++++++++- .../mapper/CustomerStaffDepartmentDao.xml | 11 +++++++ .../service/impl/ResiGroupServiceImpl.java | 1 + .../resources/mapper/CustomerStaffDao.xml | 2 ++ 13 files changed, 141 insertions(+), 8 deletions(-) create mode 100644 epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/RoleResultDTO.java diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/RoleResultDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/RoleResultDTO.java new file mode 100644 index 0000000000..a15e6b5827 --- /dev/null +++ b/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; +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java index 3fb03ea4b0..2743ae7afd 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java @@ -6,7 +6,9 @@ package com.epmet.constant; */ public interface ModuleConstant { - String ERROR_GOV_ORG = "调用gov_org服务查询网格下的所有工作人员失败"; + String ERROR_GOV_ORG_GRID = "调用gov_org服务查询【网格】下的所有工作人员失败"; + + String ERROR_GOV_ORG_DEPARTMENT = "调用gov_org服务查询【部门】下的所有工作人员失败"; String ERROR_EPMET_USER = "调用epmet_user服务查询网格下的所有工作人员失败"; diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java index 39c72634ed..d0435300df 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java @@ -2,10 +2,14 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.StaffSinDeptFormDTO; import com.epmet.dto.form.StaffSinGridFormDTO; +import com.epmet.dto.form.UserIdsFormDTO; 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.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -13,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.ArrayList; import java.util.List; /** @@ -25,6 +30,10 @@ public class OpenUpController { @Autowired private OpenUpService openUpService; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; /** * @Description 网格工作人员 被禁用的、未激活的不显示 diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java index d2150266aa..d3cc815455 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java @@ -3,19 +3,18 @@ package com.epmet.service.impl; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.ModuleConstant; -import com.epmet.dto.form.CommonGridIdFormDTO; -import com.epmet.dto.form.StaffSinDeptFormDTO; -import com.epmet.dto.form.StaffSinGridFormDTO; -import com.epmet.dto.form.UserIdsFormDTO; +import com.epmet.dto.form.*; 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.bouncycastle.math.raw.Mod; +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; /** @@ -43,7 +42,7 @@ public class OpenUpServiceImpl implements OpenUpService { commonGridId.setUserId(""); Result> gridStaffs = govOrgOpenFeignClient.getGridStaffs(commonGridId); if (!gridStaffs.success()){ - throw new RenException(ModuleConstant.ERROR_GOV_ORG); + throw new RenException(ModuleConstant.ERROR_GOV_ORG_GRID); } List userIds = gridStaffs.getData(); UserIdsFormDTO userIdsForm = new UserIdsFormDTO(); @@ -63,6 +62,26 @@ public class OpenUpServiceImpl implements OpenUpService { */ @Override public List staffSinDept(StaffSinDeptFormDTO formDTO) { - return null; + DepartmentIdFormDTO departmentId = new DepartmentIdFormDTO(); + departmentId.setDepartmentId(formDTO.getDepartmentId()); + Result> departmentStaffs = govOrgOpenFeignClient.getDepartmentStaffs(departmentId); + if (!departmentStaffs.success()){ + throw new RenException(ModuleConstant.ERROR_GOV_ORG_DEPARTMENT); + } + List userIds = departmentStaffs.getData(); + UserIdsFormDTO userIdsForm = new UserIdsFormDTO(); + userIdsForm.setUserIds(userIds); + Result> staffInfoList = epmetUserOpenFeignClient.getStaffInfoList(userIdsForm); + if (!staffInfoList.success()){ + throw new RenException(ModuleConstant.ERROR_EPMET_USER); + } + List data = staffInfoList.getData(); + List result = new ArrayList<>(); + data.forEach(staff -> { + StaffSinDeptResultDTO dept = new StaffSinDeptResultDTO(); + BeanUtils.copyProperties(staff,dept); + result.add(dept); + }); + return result; } } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index e0cbd43441..162bd8a07a 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -193,4 +193,13 @@ public interface GovOrgOpenFeignClient { */ @PostMapping("/gov/org/customerstaffgrid/getgridstaffs") Result> getGridStaffs(@RequestBody CommonGridIdFormDTO gridIdFormDTO); + + /** + * @Description 查询部门下工作人员 + * @param formDTO + * @author zxc + * @date 2020/8/13 2:46 下午 + */ + @PostMapping("/gov/org/customerstaffdepartment/getdepartmentstaffs") + Result> getDepartmentStaffs(@RequestBody DepartmentIdFormDTO formDTO); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index d4a0d581b8..c4421f69a7 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -116,4 +116,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { public Result> getGridStaffs(CommonGridIdFormDTO gridIdFormDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridStaffs", gridIdFormDTO); } + + @Override + public Result> getDepartmentStaffs(DepartmentIdFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getDepartmentStaffs", formDTO); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffDepartmentController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffDepartmentController.java index ee22c850bb..e61828a3c4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffDepartmentController.java +++ b/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> getDepartmentStaffs(@RequestBody DepartmentIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(customerStaffDepartmentService.getDepartmentStaffs(formDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java index 88fc246656..363e575499 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java @@ -66,4 +66,12 @@ public interface CustomerStaffDepartmentDao extends BaseDao selectDeptStaffs(@Param("deptIdList") List deptIdList); + + /** + * @Description 查询部门下的工作人员userId + * @param departmentId + * @author zxc + * @date 2020/8/13 2:53 下午 + */ + List getDepartmentStaffList(@Param("departmentId")String departmentId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffDepartmentService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffDepartmentService.java index f34735eeef..db5fa63d2e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffDepartmentService.java +++ b/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 getDepartmentStaffs(DepartmentIdFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffDepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffDepartmentServiceImpl.java index 81cf6dafd9..4e6a504c2e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffDepartmentServiceImpl.java +++ b/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 implements CustomerStaffDepartmentService { @Autowired - private CustomerStaffDepartmentRedis customerStaffDepartmentRedis; + private CustomerStaffDepartmentDao customerStaffDepartmentDao; @Override public PageData page(Map params) { @@ -101,4 +102,16 @@ public class CustomerStaffDepartmentServiceImpl extends BaseServiceImpl getDepartmentStaffs(DepartmentIdFormDTO formDTO) { + String departmentId = formDTO.getDepartmentId(); + return customerStaffDepartmentDao.getDepartmentStaffList(departmentId); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml index 927d919372..7e04df040b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml @@ -27,6 +27,17 @@ + + + UPDATE diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index 881374f12c..dacfd6dbb8 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -59,6 +59,7 @@ import com.epmet.resi.group.constant.MemberStateConstant; import com.epmet.resi.group.dto.UserRoleDTO; import com.epmet.resi.group.dto.group.*; import com.epmet.resi.group.dto.group.form.*; +import com.epmet.resi.group.dto.group.form.GridIdFormDTO; import com.epmet.resi.group.dto.group.form.ShouldVoteCountFormDTO; import com.epmet.resi.group.dto.group.result.*; import com.epmet.resi.group.dto.member.GroupMemeberOperationDTO; diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index 888dc5c142..16924ddb12 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -229,6 +229,8 @@ WHERE cs.del_flag = 0 AND uw.del_flag = 0 + AND cs.active_flag = 'active' + AND cs.enable_flag = 'enable' AND cs.user_id = #{userId} From c93a45c7fdbf1060162640777a0dcf2bdb6c85f1 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Thu, 13 Aug 2020 17:27:15 +0800 Subject: [PATCH 015/119] =?UTF-8?q?=E5=AE=9A=E5=88=B6=E6=9C=8D=E5=8A=A1-?= =?UTF-8?q?=E4=BF=AE=E6=94=B9-=E5=88=9D=E7=A8=BF(=E6=9C=AA=E6=B5=8B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/CustomerFunctionDetailDTO.java | 4 +- .../java/com/epmet/dto/CustomizedDTO.java | 67 +++++++++++++++++++ .../epmet/dao/CustomerFunctionDetailDao.java | 5 +- .../com/epmet/dao/FunctionCustomizedDao.java | 10 +++ .../entity/CustomerFunctionDetailEntity.java | 2 +- .../impl/FunctionCustomizedServiceImpl.java | 60 +++++++++++++++-- .../mapper/CustomerFunctionDetailDao.xml | 13 +++- .../mapper/FunctionCustomizedDao.xml | 20 ++++++ 8 files changed, 166 insertions(+), 15 deletions(-) create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomizedDTO.java diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionDetailDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionDetailDTO.java index 6d0635965b..40136207f0 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionDetailDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionDetailDTO.java @@ -66,7 +66,7 @@ public class CustomerFunctionDetailDTO implements Serializable { /** * 自定义业务域名 */ - private String realmName; + private String domainName; /** * 外链地址 @@ -108,4 +108,4 @@ public class CustomerFunctionDetailDTO implements Serializable { */ private Date updatedTime; -} \ No newline at end of file +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomizedDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomizedDTO.java new file mode 100644 index 0000000000..aa54ed57bf --- /dev/null +++ b/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; +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java index 0b6c9c20fc..924b7cfa85 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomerFunctionDetailDTO; import com.epmet.entity.CustomerFunctionDetailEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -38,9 +39,9 @@ public interface CustomerFunctionDetailDao extends BaseDao + * @return java.util.List * @Author zhangyong * @Date 11:14 2020-08-13 **/ - List selectCustomerIdByFunctionId(@Param("functionId") String functionId); + List selectCustomerIdByFunctionId(@Param("functionId") String functionId); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java index 51fcc8d4b8..6c358516fd 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomizedDTO; import com.epmet.dto.form.CommonFunctionIdFormDTO; import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; import com.epmet.entity.FunctionCustomizedEntity; @@ -53,4 +54,13 @@ public interface FunctionCustomizedDao extends BaseDao * @Date 13:31 2020-08-13 **/ void delByFunctionId(@Param("functionId") String functionId); + + /** + * 根据功能id,查询定制功能全部信息(定制功能表+功能表) + * @param functionId + * @return com.epmet.dto.CustomizedDTO + * @Author zhangyong + * @Date 16:21 2020-08-13 + **/ + CustomizedDTO selectCustomized(@Param("functionId") String functionId); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionDetailEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionDetailEntity.java index 13db363fea..aab31d79a7 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionDetailEntity.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionDetailEntity.java @@ -66,7 +66,7 @@ public class CustomerFunctionDetailEntity extends BaseEpmetEntity { /** * 自定义业务域名 */ - private String realmName; + private String domainName; /** * 外链地址 diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java index c1fd95df1c..6f22d3ba15 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java @@ -20,14 +20,15 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.CustomerFunctionDetailDao; import com.epmet.dao.FunctionCustomizedDao; -import com.epmet.dao.FunctionDao; +import com.epmet.dto.CustomerFunctionDetailDTO; +import com.epmet.dto.CustomizedDTO; import com.epmet.dto.FunctionCustomizedDTO; import com.epmet.dto.form.CommonFunctionIdFormDTO; import com.epmet.dto.form.SaveFunctionCustomizedFormDTO; @@ -36,6 +37,7 @@ import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; import com.epmet.entity.FunctionCustomizedEntity; import com.epmet.entity.FunctionEntity; import com.epmet.redis.FunctionCustomizedRedis; +import com.epmet.service.CustomerFunctionDetailService; import com.epmet.service.FunctionCustomizedService; import com.epmet.service.FunctionService; import org.apache.commons.lang3.StringUtils; @@ -43,6 +45,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -62,6 +65,8 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl page(Map params) { @@ -142,7 +147,7 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl customizedId = customerFunctionDetailDao.selectCustomerIdByFunctionId(formDTO.getFunctionId()); + List customizedId = customerFunctionDetailDao.selectCustomerIdByFunctionId(formDTO.getFunctionId()); if (customizedId != null && customizedId.size() > NumConstant.ZERO){ return new Result<>().error(8000, "功能正在使用中,不允许删除!"); } else { @@ -160,22 +165,63 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl customizedId = customerFunctionDetailDao.selectCustomerIdByFunctionId(formDTO.getFunctionId()); + List customizedId = customerFunctionDetailDao.selectCustomerIdByFunctionId(formDTO.getFunctionId()); FunctionCustomizedEntity entity = new FunctionCustomizedEntity(); entity.setId(formDTO.getCustomizedId()); entity.setIconLargeImg(formDTO.getIconLargeImg()); entity.setIconSmallImg(formDTO.getIconSmallImg()); entity.setCustomizedName(formDTO.getCustomizedName()); if (customizedId != null && customizedId.size() > NumConstant.ZERO){ - // 有客户正在使用该 功能,只能修改功能名称和大小图标, 需要批量更新客户数据 + // 根据功能id,查询功能的详细信息 + CustomizedDTO customizedDTO = baseDao.selectCustomized(formDTO.getFunctionId()); + // 判断这个功能,用户使用的是默认的,还是自定义的 + + // 该集合,用户统一修改 客户定制功能详情表 + List upCustomizedInfoUserId = new ArrayList<>(); + + // 统一提示 不能进行修改的客户id + StringBuilder tipCustomizedInfoUserId = new StringBuilder(); + + // 如果这个功能,被客户重新定义了,则不会修改 + for (int i = 0; i < customizedId.size(); i++){ + if (null != customizedDTO){ + if (customizedDTO.getCustomizedName().equals(customizedId.get(i).getFunctionName()) + && customizedDTO.getIconLargeImg().equals(customizedId.get(i).getIconLargeImg()) + && customizedDTO.getIconSmallImg().equals(customizedId.get(i).getIconSmallImg()) + && customizedDTO.getDomainName().equals(customizedId.get(i).getDomainName()) + && customizedDTO.getTargetLink().equals(customizedId.get(i).getTargetLink()) ){ + // 这个功能,客户使用的是默认的,则修改 + if (!formDTO.getShoppingStatus().equals(customizedDTO.getShoppingStatus()) + || !formDTO.getFunctionExplain().equals(customizedDTO.getFunctionExplain()) + || !formDTO.getTargetLink().equals(customizedDTO.getTargetLink()) + || !formDTO.getDomainName().equals(customizedDTO.getDomainName()) + || !formDTO.getFromApp().equals(customizedDTO.getFromApp()) ){ + // 如果修改的内容是其他字段,则返回语句 + tipCustomizedInfoUserId.append(customizedId.get(i).getId()); + } else if (!formDTO.getCustomizedName().equals(customizedDTO.getCustomizedName()) + || !formDTO.getIconLargeImg().equals(customizedDTO.getIconLargeImg()) + || !formDTO.getIconSmallImg().equals(customizedDTO.getIconSmallImg())){ + // 如果修改的内容只是:功能名称和大小图标,, 需要批量更新客户数据 + upCustomizedInfoUserId.add(customizedId.get(i).getId()); + } + } + } + } + // 1.修改 客户定制功能详情表 + if (upCustomizedInfoUserId != null && upCustomizedInfoUserId.size() > NumConstant.ZERO){ + String[] ueserIds = new String[upCustomizedInfoUserId.size()]; + customerFunctionDetailService.delete(upCustomizedInfoUserId.toArray(ueserIds)); + } // 2.修改 功能表, 修改的字段范围,是:功能名称和大小图标 this.upFunction(formDTO); // 3.修改 定制功能表, 修改的字段范围,是:功能名称和大小图标 baseDao.updateById(entity); - // 4.修改 客户定制功能详情表(多客户), 修改的字段范围,是:功能名称和大小图标 - return new Result<>().error(8000, "客户正在使用该功能不允许修改上下架状态、业务域名和外链地址、所属端app!"); + // 4.提示哪些用户不能被修改 + if (tipCustomizedInfoUserId != null && tipCustomizedInfoUserId.length() >NumConstant.ZERO){ + return new Result<>().error(8000, "客户正在使用该功能不允许修改上下架状态、业务域名和外链地址、所属端app!"); + } } else { // 没有客户正在使用该 功能 // 2.修改 功能表, 修改的字段范围,是所有入参字段 diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml index c8f7bbc925..e86be93679 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml @@ -5,12 +5,19 @@ - diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml index b43ee05063..3d9ac9e6cb 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml @@ -25,4 +25,24 @@ update function_customized set DEL_FLAG = 1 where FUNCTION_ID = #{functionId} and DEL_FLAG = '0' + + + From ffbaef160fd3e1f0171d69428fb5bdf983444e86 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 13 Aug 2020 17:50:02 +0800 Subject: [PATCH 016/119] =?UTF-8?q?=E5=88=A0=E9=99=A4AutoWrite?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/OpenUpController.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java index d0435300df..2fb0ad964a 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java @@ -30,10 +30,6 @@ public class OpenUpController { @Autowired private OpenUpService openUpService; - @Autowired - private GovOrgOpenFeignClient govOrgOpenFeignClient; - @Autowired - private EpmetUserOpenFeignClient epmetUserOpenFeignClient; /** * @Description 网格工作人员 被禁用的、未激活的不显示 From e77c4cf5c8dfc8283e0c2f97c1a6bf3945a3cd6f Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Fri, 14 Aug 2020 09:47:24 +0800 Subject: [PATCH 017/119] =?UTF-8?q?=E5=AE=9A=E5=88=B6=E6=9C=8D=E5=8A=A1-?= =?UTF-8?q?=E4=BF=AE=E6=94=B9-=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/FunctionCustomizedServiceImpl.java | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java index 6f22d3ba15..23448fbea6 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java @@ -34,6 +34,7 @@ import com.epmet.dto.form.CommonFunctionIdFormDTO; import com.epmet.dto.form.SaveFunctionCustomizedFormDTO; import com.epmet.dto.form.UpdateCustomizedFormDTO; import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; +import com.epmet.entity.CustomerFunctionDetailEntity; import com.epmet.entity.FunctionCustomizedEntity; import com.epmet.entity.FunctionEntity; import com.epmet.redis.FunctionCustomizedRedis; @@ -166,31 +167,26 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl customizedId = customerFunctionDetailDao.selectCustomerIdByFunctionId(formDTO.getFunctionId()); - FunctionCustomizedEntity entity = new FunctionCustomizedEntity(); + FunctionCustomizedEntity entity = ConvertUtils.sourceToTarget(formDTO, FunctionCustomizedEntity.class); entity.setId(formDTO.getCustomizedId()); - entity.setIconLargeImg(formDTO.getIconLargeImg()); - entity.setIconSmallImg(formDTO.getIconSmallImg()); - entity.setCustomizedName(formDTO.getCustomizedName()); if (customizedId != null && customizedId.size() > NumConstant.ZERO){ // 根据功能id,查询功能的详细信息 CustomizedDTO customizedDTO = baseDao.selectCustomized(formDTO.getFunctionId()); - // 判断这个功能,用户使用的是默认的,还是自定义的 - // 该集合,用户统一修改 客户定制功能详情表 - List upCustomizedInfoUserId = new ArrayList<>(); - + List upCustomizedInfo = new ArrayList<>(); // 统一提示 不能进行修改的客户id StringBuilder tipCustomizedInfoUserId = new StringBuilder(); // 如果这个功能,被客户重新定义了,则不会修改 for (int i = 0; i < customizedId.size(); i++){ if (null != customizedDTO){ + // 功能信息和客户信息:判断这个功能,用户使用的是默认的,还是自定义的 if (customizedDTO.getCustomizedName().equals(customizedId.get(i).getFunctionName()) && customizedDTO.getIconLargeImg().equals(customizedId.get(i).getIconLargeImg()) && customizedDTO.getIconSmallImg().equals(customizedId.get(i).getIconSmallImg()) && customizedDTO.getDomainName().equals(customizedId.get(i).getDomainName()) && customizedDTO.getTargetLink().equals(customizedId.get(i).getTargetLink()) ){ - // 这个功能,客户使用的是默认的,则修改 + // 这个功能,客户使用的是默认的,则判断本次修改的字段,如果是功能名称和大小图标,则批量更新客户数据,负责提示 不能修改 if (!formDTO.getShoppingStatus().equals(customizedDTO.getShoppingStatus()) || !formDTO.getFunctionExplain().equals(customizedDTO.getFunctionExplain()) || !formDTO.getTargetLink().equals(customizedDTO.getTargetLink()) @@ -202,15 +198,20 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl NumConstant.ZERO){ - String[] ueserIds = new String[upCustomizedInfoUserId.size()]; - customerFunctionDetailService.delete(upCustomizedInfoUserId.toArray(ueserIds)); + if (upCustomizedInfo != null && upCustomizedInfo.size() > NumConstant.ZERO){ + customerFunctionDetailService.updateBatchById(upCustomizedInfo); } // 2.修改 功能表, 修改的字段范围,是:功能名称和大小图标 this.upFunction(formDTO); @@ -226,12 +227,7 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl Date: Fri, 14 Aug 2020 09:58:59 +0800 Subject: [PATCH 018/119] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=A4=84=E7=90=86?= =?UTF-8?q?=E5=93=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/ProjectConstant.java | 8 ++++ .../com/epmet/service/ProjectService.java | 9 ++++ .../epmet/service/ProjectTraceService.java | 3 +- .../service/impl/ProjectServiceImpl.java | 43 +++++++++++++++++++ .../service/impl/ProjectTraceServiceImpl.java | 5 ++- 5 files changed, 65 insertions(+), 3 deletions(-) diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java index ff9dfb0dc1..dd0f37c086 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/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 = "处理/响应"; /** * 是否处理-未处理 diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java index 9dafa894ab..e34e2ecd21 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java @@ -178,4 +178,13 @@ public interface ProjectService extends BaseService { * @Description 获取客户下已结案项目列表,按结案时间倒序 **/ List getClosedProjectList(LatestListFormDTO formDTO); + + /** + * 处理响应 + * @author zhaoqifeng + * @date 2020/8/14 9:42 + * @param formDTO + * @return void + */ + void response(ProjectResponseFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java index bb4f4b4c36..d41408524c 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java @@ -112,8 +112,9 @@ public interface ProjectTraceService { * 处理响应 * @author zhaoqifeng * @date 2020/8/12 17:54 + * @param tokenDto * @param formDTO * @return void */ - void response(ProjectResponseFormDTO formDTO); + void response(TokenDto tokenDto, ProjectResponseFormDTO formDTO); } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index ea153d138d..c1f4b80987 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -635,4 +635,47 @@ public class ProjectServiceImpl extends BaseServiceImpl 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()); + } + + //更新项目关联表 + ProjectStaffEntity projectStaffEntity = new ProjectStaffEntity(); + projectStaffEntity.setId(formDTO.getProjectStaffId()); + projectStaffEntity.setIsHandle(ProjectConstant.HANDLE); + projectStaffService.updateById(projectStaffEntity); + + //处理响应记录加入项目进展表 + 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); + } + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java index 684a213503..d8ddde09ba 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java @@ -97,7 +97,8 @@ public class ProjectTraceServiceImpl implements ProjectTraceService { } @Override - public void response(ProjectResponseFormDTO formDTO) { - + public void response(TokenDto tokenDto, ProjectResponseFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + projectService.response(formDTO); } } From f83947cc31f7cfe19bd587ec41ef3ae9e041c1dc Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 14 Aug 2020 10:14:14 +0800 Subject: [PATCH 019/119] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=AE=9A=E5=88=B6=E5=8A=9F=E8=83=BD=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E3=80=81=E5=AE=9A=E5=88=B6=E5=8A=9F=E8=83=BD=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/FunctionDetailFromDTO.java | 35 ++++++++++++ .../dto/form/FunctionVisitedFromDTO.java | 56 +++++++++++++++++++ .../dto/result/FunctionDetailResultDTO.java | 50 +++++++++++++++++ .../CustomerFunctionDetailController.java | 30 ++++++++++ .../FunctionCustomizedVisitedController.java | 34 +++++++++++ .../epmet/dao/CustomerFunctionDetailDao.java | 10 ++++ .../CustomerFunctionDetailService.java | 10 ++++ .../FunctionCustomizedVisitedService.java | 9 +++ .../CustomerFunctionDetailServiceImpl.java | 21 ++++++- .../FunctionCustomizedVisitedServiceImpl.java | 14 +++++ .../mapper/CustomerFunctionDetailDao.xml | 29 ++++++++++ 11 files changed, 297 insertions(+), 1 deletion(-) create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionVisitedFromDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionDetailResultDTO.java diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java new file mode 100644 index 0000000000..ee133cd136 --- /dev/null +++ b/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; + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionVisitedFromDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionVisitedFromDTO.java new file mode 100644 index 0000000000..829e019fac --- /dev/null +++ b/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; + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionDetailResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionDetailResultDTO.java new file mode 100644 index 0000000000..debdfc6016 --- /dev/null +++ b/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; +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java index 364e57c6e5..55b7f391f0 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java @@ -17,7 +17,9 @@ 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; @@ -26,6 +28,9 @@ 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.CustomerFunctionDetailDTO; +import com.epmet.dto.FunctionDTO; +import com.epmet.dto.form.FunctionDetailFromDTO; +import com.epmet.dto.result.FunctionDetailResultDTO; import com.epmet.excel.CustomerFunctionDetailExcel; import com.epmet.service.CustomerFunctionDetailService; import org.springframework.beans.factory.annotation.Autowired; @@ -91,4 +96,29 @@ public class CustomerFunctionDetailController { ExcelUtils.exportExcelToTarget(response, null, list, CustomerFunctionDetailExcel.class); } + /** + * @param formDTO + * @return + * @Author sun + * @Description 居民端-获取客户定制功能列表 + **/ + @PostMapping("resifunctiondetaillist") + public Result> resiFunctionDetail(@LoginUser TokenDto tokenDto, @RequestBody FunctionDetailFromDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, FunctionDetailFromDTO.AddUserShowGroup.class); + return new Result>().ok(customerFunctionDetailService.resiAndWorkFunctionDetail(formDTO)); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 工作端-获取客户定制功能列表 + **/ + @PostMapping("workfunctiondetaillist") + public Result> workFunctionDetail(@LoginUser TokenDto tokenDto, @RequestBody FunctionDetailFromDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, FunctionDetailFromDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result>().ok(customerFunctionDetailService.resiAndWorkFunctionDetail(formDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedVisitedController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedVisitedController.java index 2c758cc8e2..faea8de9e9 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedVisitedController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedVisitedController.java @@ -17,7 +17,9 @@ 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; @@ -26,6 +28,9 @@ 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; @@ -91,4 +96,33 @@ public class FunctionCustomizedVisitedController { 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> 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(); + } + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java index 924b7cfa85..b3f4638322 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java @@ -19,6 +19,8 @@ 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.result.FunctionDetailResultDTO; import com.epmet.entity.CustomerFunctionDetailEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -44,4 +46,12 @@ public interface CustomerFunctionDetailDao extends BaseDao selectCustomerIdByFunctionId(@Param("functionId") String functionId); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 根据所属端和客户Id查询客户定制功能列表 + **/ + List selectFunctionDetailList(FunctionDetailFromDTO formDTO); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java index 5c5237077c..a1ec9f6cf8 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java @@ -20,6 +20,8 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.CustomerFunctionDetailDTO; +import com.epmet.dto.form.FunctionDetailFromDTO; +import com.epmet.dto.result.FunctionDetailResultDTO; import com.epmet.entity.CustomerFunctionDetailEntity; import java.util.List; @@ -92,4 +94,12 @@ public interface CustomerFunctionDetailService extends BaseService resiAndWorkFunctionDetail(FunctionDetailFromDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedVisitedService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedVisitedService.java index b0dadfb74f..a87e756c02 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedVisitedService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedVisitedService.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.FunctionCustomizedVisitedDTO; +import com.epmet.dto.form.FunctionVisitedFromDTO; import com.epmet.entity.FunctionCustomizedVisitedEntity; import java.util.List; @@ -92,4 +93,12 @@ public interface FunctionCustomizedVisitedService extends BaseService implements CustomerFunctionDetailService { + private Logger logger = LogManager.getLogger(CustomerFunctionDetailServiceImpl.class); @Autowired private CustomerFunctionDetailRedis customerFunctionDetailRedis; @@ -101,4 +106,18 @@ public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl resiAndWorkFunctionDetail(FunctionDetailFromDTO formDTO) { + //根据客户Id和所属端查询客户定制功能列表数据 + logger.info(String.format("根据客户Id和所属端查询客户定制功能列表,对应客户Id->%s,所属端->%s", formDTO.getCustomerId(), formDTO.getClientType())); + List list = baseDao.selectFunctionDetailList(formDTO); + return list; + } + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedVisitedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedVisitedServiceImpl.java index 0efa5282e7..481bb68736 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedVisitedServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedVisitedServiceImpl.java @@ -25,6 +25,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.FunctionCustomizedVisitedDao; import com.epmet.dto.FunctionCustomizedVisitedDTO; +import com.epmet.dto.form.FunctionVisitedFromDTO; import com.epmet.entity.FunctionCustomizedVisitedEntity; import com.epmet.redis.FunctionCustomizedVisitedRedis; import com.epmet.service.FunctionCustomizedVisitedService; @@ -101,4 +102,17 @@ public class FunctionCustomizedVisitedServiceImpl extends BaseServiceImpl + + + From 305ae61464e89ac84ca2d0b814605510e30ad606 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Fri, 14 Aug 2020 10:30:15 +0800 Subject: [PATCH 020/119] =?UTF-8?q?=E5=AE=9A=E5=80=BC=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/FunctionCustomizedListFormDTO.java | 59 ++++++++++++++++++ .../dto/result/FunctionCustomizedListDTO.java | 61 +++++++++++++++++++ .../FunctionCustomizedListResultDTO.java | 29 +++++++++ .../FunctionCustomizedController.java | 17 ++++++ .../com/epmet/dao/FunctionCustomizedDao.java | 25 ++++++++ .../service/FunctionCustomizedService.java | 13 ++++ .../impl/FunctionCustomizedServiceImpl.java | 12 ++++ .../mapper/FunctionCustomizedDao.xml | 43 +++++++++++++ 8 files changed, 259 insertions(+) create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionCustomizedListFormDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListResultDTO.java diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionCustomizedListFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionCustomizedListFormDTO.java new file mode 100644 index 0000000000..2c6e3c037a --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListDTO.java new file mode 100644 index 0000000000..85faedd828 --- /dev/null +++ b/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; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListResultDTO.java new file mode 100644 index 0000000000..fc44d76d1a --- /dev/null +++ b/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 listDTOS; + + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java index 1739ec15ae..1df9d0e568 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java @@ -27,9 +27,11 @@ 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; @@ -157,4 +159,19 @@ public class FunctionCustomizedController { ValidatorUtils.validateEntity(formDTO); return functionCustomizedService.updateCustomized(formDTO); } + + /** + * 定制功能列表 + * 按功能分组,先工作端在居民端,在按创建时间倒序 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:07 2020-08-14 + **/ + @PostMapping("functioncustomizedlist") + public Result functionCustomizedList(@RequestBody FunctionCustomizedListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return functionCustomizedService.functionCustomizedList(formDTO); + } } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java index 6c358516fd..d283a1a586 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java @@ -20,11 +20,15 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.CustomizedDTO; import com.epmet.dto.form.CommonFunctionIdFormDTO; +import com.epmet.dto.form.FunctionCustomizedListFormDTO; import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; +import com.epmet.dto.result.FunctionCustomizedListDTO; import com.epmet.entity.FunctionCustomizedEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 定制功能 * @@ -63,4 +67,25 @@ public interface FunctionCustomizedDao extends BaseDao * @Date 16:21 2020-08-13 **/ CustomizedDTO selectCustomized(@Param("functionId") String functionId); + + /** + * 定制功能列表 + * 按功能分组,先工作端在居民端,在按创建时间倒序 + * + * @param formDTO + * @return java.lang.util + * @Author zhangyong + * @Date 10:07 2020-08-14 + **/ + List selectListFunctionCustomizedList(FunctionCustomizedListFormDTO formDTO); + + /** + * 定制功能列表 - 总数 + * + * @param formDTO + * @return java.lang.Integer + * @Author zhangyong + * @Date 10:10 2020-08-14 + **/ + Integer countTotalFunctionCustomizedList(FunctionCustomizedListFormDTO formDTO); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java index b52125f21d..178c2d439b 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java @@ -22,9 +22,11 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; 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.entity.FunctionCustomizedEntity; import java.util.List; @@ -140,4 +142,15 @@ public interface FunctionCustomizedService extends BaseService + * @Author zhangyong + * @Date 10:07 2020-08-14 + **/ + Result functionCustomizedList(FunctionCustomizedListFormDTO formDTO); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java index 23448fbea6..ff45c737a0 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java @@ -31,9 +31,11 @@ import com.epmet.dto.CustomerFunctionDetailDTO; import com.epmet.dto.CustomizedDTO; 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.entity.CustomerFunctionDetailEntity; import com.epmet.entity.FunctionCustomizedEntity; import com.epmet.entity.FunctionEntity; @@ -233,6 +235,16 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl functionCustomizedList(FunctionCustomizedListFormDTO formDTO) { + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(pageIndex); + FunctionCustomizedListResultDTO resultDTO = new FunctionCustomizedListResultDTO(); + resultDTO.setListDTOS(baseDao.selectListFunctionCustomizedList(formDTO)); + resultDTO.setTotal(baseDao.countTotalFunctionCustomizedList(formDTO)); + return new Result().ok(resultDTO); + } + /** * 保存数据到 功能表 * @param formDTO diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml index 3d9ac9e6cb..1aed963adc 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml @@ -45,4 +45,47 @@ WHERE f.DEL_FLAG = '0' AND f.ID = #{functionId} + + + + + + From d52f6a849e19236f483ab50c549ad27aa0e821ba Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Fri, 14 Aug 2020 11:04:13 +0800 Subject: [PATCH 021/119] =?UTF-8?q?=E5=AE=9A=E5=88=B6=E5=8A=9F=E8=83=BD-?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3=EF=BC=8C=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/FunctionCustomizedServiceImpl.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java index ff45c737a0..af8e3642ea 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java @@ -169,8 +169,6 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl customizedId = customerFunctionDetailDao.selectCustomerIdByFunctionId(formDTO.getFunctionId()); - FunctionCustomizedEntity entity = ConvertUtils.sourceToTarget(formDTO, FunctionCustomizedEntity.class); - entity.setId(formDTO.getCustomizedId()); if (customizedId != null && customizedId.size() > NumConstant.ZERO){ // 根据功能id,查询功能的详细信息 CustomizedDTO customizedDTO = baseDao.selectCustomized(formDTO.getFunctionId()); @@ -216,9 +214,14 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl Date: Fri, 14 Aug 2020 14:26:46 +0800 Subject: [PATCH 022/119] =?UTF-8?q?=E5=AE=9A=E5=88=B6=E6=9C=8D=E5=8A=A1-?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3=EF=BC=8C=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/UpdateCustomizedFormDTO.java | 6 -- .../com/epmet/dao/FunctionCustomizedDao.java | 10 +++ .../impl/FunctionCustomizedServiceImpl.java | 62 +++++++++++++------ .../mapper/FunctionCustomizedDao.xml | 27 ++++++++ 4 files changed, 79 insertions(+), 26 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java index 8b73f7cf19..ccd5483a49 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java @@ -33,12 +33,6 @@ public class UpdateCustomizedFormDTO implements Serializable { @NotBlank(message = "功能说明不能为空") private String functionExplain; - /** - * 定制功能详情ID - */ - @NotBlank(message = "定制功能详情ID不能为空") - private String customizedId; - /** * 默认名称 */ diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java index d283a1a586..34b32e48f1 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java @@ -88,4 +88,14 @@ public interface FunctionCustomizedDao extends BaseDao * @Date 10:10 2020-08-14 **/ Integer countTotalFunctionCustomizedList(FunctionCustomizedListFormDTO formDTO); + + /** + * 根据功能id,修改定制功能表 + * + * @param entity + * @return void + * @Author zhangyong + * @Date 13:26 2020-08-14 + **/ + void updateFunctionCustomized(FunctionCustomizedEntity entity); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java index af8e3642ea..55aa6933d1 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java @@ -193,7 +193,7 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl NumConstant.ZERO){ customerFunctionDetailService.updateBatchById(upCustomizedInfo); + // 2.客户正在使用该功能,根据入参参数,修改功能表、定制功能表 + this.functionInUse(formDTO); } - // 2.修改 功能表, 修改的字段范围,是:功能名称和大小图标 - this.upFunction(formDTO, NumConstant.ZERO); - // 3.修改 定制功能表, 修改的字段范围,是:功能名称和大小图标 - FunctionCustomizedEntity entity = new FunctionCustomizedEntity(); - entity.setId(formDTO.getCustomizedId()); - entity.setCustomizedName(formDTO.getCustomizedName()); - entity.setIconLargeImg(formDTO.getIconLargeImg()); - entity.setIconSmallImg(formDTO.getIconSmallImg()); - baseDao.updateById(entity); - - // 4.提示哪些用户不能被修改 + // 3.提示哪些用户不能被修改 if (tipCustomizedInfoUserId != null && tipCustomizedInfoUserId.length() >NumConstant.ZERO){ - return new Result<>().error(8000, "客户正在使用该功能不允许修改上下架状态、业务域名和外链地址、所属端app!"); + return new Result<>().error(8000, "客户"+ tipCustomizedInfoUserId +"正在使用该功能不允许修改上下架状态、业务域名和外链地址、所属端app!"); } } else { - // 没有客户正在使用该 功能 - // 2.修改 功能表, 修改的字段范围,是所有入参字段 - this.upFunction(formDTO, NumConstant.ONE); - // 3.修改 定制功能表, 修改的字段范围,是所有入参字段 - FunctionCustomizedEntity entity = ConvertUtils.sourceToTarget(formDTO, FunctionCustomizedEntity.class); - entity.setId(formDTO.getCustomizedId()); - baseDao.updateById(entity); + // 1. 没有客户使用该 功能,根据入参参数,修改功能表、定制功能表 + this.functionNotUsed(formDTO); } return new Result(); } @@ -287,4 +274,39 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl + + + UPDATE function_customized + SET + + CUSTOMIZED_NAME = #{customizedName}, + + + ICON_LARGE_IMG = #{iconLargeImg}, + + + ICON_SMALL_IMG = #{iconSmallImg}, + + + TARGET_LINK = #{targetLink}, + + + DOMAIN_NAME = #{domainName}, + + + FROM_APP = #{fromApp}, + + UPDATED_TIME = now() + WHERE + DEL_FLAG = '0' + AND FUNCTION_ID = #{functionId} + From 1ac26ad815a73b681daac03a68525435e32178ef Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Fri, 14 Aug 2020 14:48:13 +0800 Subject: [PATCH 023/119] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E7=BB=B4=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/FunctionCustomizedServiceImpl.java | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java index 55aa6933d1..59ac2895c5 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java @@ -167,12 +167,12 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl customizedId = customerFunctionDetailDao.selectCustomerIdByFunctionId(formDTO.getFunctionId()); if (customizedId != null && customizedId.size() > NumConstant.ZERO){ - // 根据功能id,查询功能的详细信息 + // 2.1 根据功能id,查询功能的详细信息 CustomizedDTO customizedDTO = baseDao.selectCustomized(formDTO.getFunctionId()); - // 该集合,用户统一修改 客户定制功能详情表 + // 该集合,统一修改 客户定制功能详情表 List upCustomizedInfo = new ArrayList<>(); // 统一提示 不能进行修改的客户id StringBuilder tipCustomizedInfoUserId = new StringBuilder(); @@ -180,24 +180,24 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl NumConstant.ZERO){ + // 5.1 修改 客户定制功能详情表 customerFunctionDetailService.updateBatchById(upCustomizedInfo); - // 2.客户正在使用该功能,根据入参参数,修改功能表、定制功能表 + // 6. 客户正在使用该功能,根据入参参数,修改功能表、定制功能表 this.functionInUse(formDTO); } - - // 3.提示哪些用户不能被修改 + // 5.2 提示哪些用户不能被修改 if (tipCustomizedInfoUserId != null && tipCustomizedInfoUserId.length() >NumConstant.ZERO){ return new Result<>().error(8000, "客户"+ tipCustomizedInfoUserId +"正在使用该功能不允许修改上下架状态、业务域名和外链地址、所属端app!"); } } else { - // 1. 没有客户使用该 功能,根据入参参数,修改功能表、定制功能表 + // 2.2 没有客户使用该 功能,根据入参参数,修改功能表、定制功能表 this.functionNotUsed(formDTO); } return new Result(); From a9d17098b99649ee6e41a087917dafc421053785 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Fri, 14 Aug 2020 14:54:19 +0800 Subject: [PATCH 024/119] =?UTF-8?q?=E5=AE=9A=E5=88=B6=E5=8A=9F=E8=83=BD=20?= =?UTF-8?q?-=20nei=E6=8E=A5=E5=8F=A3=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/SaveFunctionCustomizedFormDTO.java | 4 ++-- .../java/com/epmet/dto/form/UpdateCustomizedFormDTO.java | 4 ++-- .../dto/result/FunctionCustomizedDetailResultDTO.java | 7 +------ .../src/main/resources/mapper/FunctionCustomizedDao.xml | 1 - 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveFunctionCustomizedFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveFunctionCustomizedFormDTO.java index 830361aeb3..20d3fd5298 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveFunctionCustomizedFormDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveFunctionCustomizedFormDTO.java @@ -65,8 +65,8 @@ public class SaveFunctionCustomizedFormDTO implements Serializable { private String domainName; /** - * 来源app(政府端:gov、居民端:resi) + * 来源app(工作端:gov、居民端:resi) */ - @NotBlank(message = "来源app(政府端:gov、居民端:resi)不能为空") + @NotBlank(message = "来源app(工作端:gov、居民端:resi)不能为空") private String fromApp; } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java index ccd5483a49..5deee63b26 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java @@ -65,8 +65,8 @@ public class UpdateCustomizedFormDTO implements Serializable { private String domainName; /** - * 来源app(政府端:gov、居民端:resi) + * 来源app(工作端:gov、居民端:resi) */ - @NotBlank(message = "来源app(政府端:gov、居民端:resi)不能为空") + @NotBlank(message = "来源app(工作端:gov、居民端:resi)不能为空") private String fromApp; } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java index c66714806e..b9f30936f9 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java @@ -29,11 +29,6 @@ public class FunctionCustomizedDetailResultDTO implements Serializable { */ private String functionExplain; - /** - * 定制详情ID - */ - private String customizedId; - /** * 默认名称 */ @@ -60,7 +55,7 @@ public class FunctionCustomizedDetailResultDTO implements Serializable { private String domainName; /** - * 来源app(政府端:gov、居民端:resi) + * 来源app(工作端:gov、居民端:resi) */ private String fromApp; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml index d852ad6dea..f862114288 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml @@ -9,7 +9,6 @@ cu.FUNCTION_ID functionId, f.SHOPPING_STATUS shoppingStatus, f.FUNCTION_EXPLAIN functionExplain, - cu.ID customizedId, cu.CUSTOMIZED_NAME customizedName, cu.ICON_LARGE_IMG iconLargeImg, cu.ICON_SMALL_IMG iconSmallImg, From a76644de52dd3acb6a4462e385450058daa783d5 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 14 Aug 2020 15:05:00 +0800 Subject: [PATCH 025/119] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=A6=E6=83=85-?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E5=A4=84=E7=90=86=E9=83=A8=E9=97=A8=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=B7=A5=E4=BD=9C=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/ProjectDetailResultDTO.java | 16 +++++++- .../main/java/com/epmet/dao/ProjectDao.java | 10 +++++ .../service/impl/ProjectServiceImpl.java | 40 +++++++++++++++---- .../src/main/resources/mapper/ProjectDao.xml | 13 +++++- .../resources/mapper/CustomerStaffDao.xml | 3 +- 5 files changed, 70 insertions(+), 12 deletions(-) diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDetailResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDetailResultDTO.java index f44973bcea..4ffddb9ba4 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDetailResultDTO.java +++ b/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 departmentNameList; + private List departmentNameList; + @NoArgsConstructor + @Data + public static class DepartmentNameListBean { + /** + * 部门名 + */ + private String departmentName; + /** + * 工作人员 + */ + private List staffList; + } } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java index a45b46bb0a..4d20d6327c 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java +++ b/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 { */ List selectDepartmentNameList(ProjectDTO dto); + /** + * 当前处理部门及工作人员 + * @author zhaoqifeng + * @date 2020/8/14 10:56 + * @param dto + * @return java.util.List + */ + List selectCurrentDepartmentList(ProjectDTO dto); + /** * 获取项目详情 * @author zhaoqifeng diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index c1f4b80987..1aef659ccd 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/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 departmentNameList = new ArrayList<>(); + List departmentNameList = new ArrayList<>(); + List 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 staffIdList = departmentNameList.stream().map(ProjectStaffDTO::getStaffId).collect(Collectors.toList()); + staffIdList = staffIdList.stream().distinct().collect(Collectors.toList()); + //根据部门分组 + Map> departmentMap = + departmentNameList.stream().collect(Collectors.groupingBy(ProjectStaffDTO::getDepartmentName)); + //获取工作人员信息(姓名) + UserIdsFormDTO userIdsFormDTO = new UserIdsFormDTO(); + userIdsFormDTO.setUserIds(staffIdList); + Result> staffListResult = epmetUserOpenFeignClient.getStaffInfoList(userIdsFormDTO); + if (!staffListResult.success()) { + throw new RenException(staffListResult.getCode(), staffListResult.getMsg()); + } + List staffList = staffListResult.getData(); + for (String departmentName : departmentMap.keySet()) { + ProjectDetailResultDTO.DepartmentNameListBean bean = new ProjectDetailResultDTO.DepartmentNameListBean(); + bean.setDepartmentName(departmentName); + List staffDTOList = departmentMap.get(departmentName); + List 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; diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml index db34280061..8979d90f57 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml @@ -183,5 +183,16 @@ AND origin = #{origin} AND origin_id = #{originId} - + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index 16924ddb12..bcd20d8b96 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -225,10 +225,9 @@ gender AS gender FROM customer_staff cs - LEFT JOIN user_wechat uw ON uw.user_id = cs.user_id + LEFT JOIN user_wechat uw ON uw.user_id = cs.user_id AND uw.del_flag = 0 WHERE cs.del_flag = 0 - AND uw.del_flag = 0 AND cs.active_flag = 'active' AND cs.enable_flag = 'enable' AND From 6e751aa7a4513df01365f4390e9ff9bc98eba63a Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 14 Aug 2020 15:37:09 +0800 Subject: [PATCH 026/119] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E5=AE=9A=E5=88=B6=E5=8A=9F=E8=83=BD=E4=B8=8A=E4=B8=8B=E6=9E=B6?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/CustomerFunctionDetailDTO.java | 5 + .../epmet/dto/FunctionShoppingHistoryDTO.java | 86 +++++++++++++++ .../FunctionShoppingHistoryController.java | 94 ++++++++++++++++ .../epmet/dao/FunctionShoppingHistoryDao.java | 33 ++++++ .../entity/CustomerFunctionDetailEntity.java | 5 + .../entity/FunctionShoppingHistoryEntity.java | 61 ++++++++++ .../excel/CustomerFunctionDetailExcel.java | 3 + .../excel/FunctionShoppingHistoryExcel.java | 65 +++++++++++ .../redis/FunctionShoppingHistoryRedis.java | 47 ++++++++ .../FunctionShoppingHistoryService.java | 95 ++++++++++++++++ .../FunctionShoppingHistoryServiceImpl.java | 104 ++++++++++++++++++ .../mapper/FunctionShoppingHistoryDao.xml | 20 ++++ 12 files changed, 618 insertions(+) create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionShoppingHistoryDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionShoppingHistoryController.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionShoppingHistoryDao.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionShoppingHistoryEntity.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionShoppingHistoryExcel.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionShoppingHistoryRedis.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionShoppingHistoryService.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionShoppingHistoryServiceImpl.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionShoppingHistoryDao.xml diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionDetailDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionDetailDTO.java index 40136207f0..8f2d7d09b7 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionDetailDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionDetailDTO.java @@ -73,6 +73,11 @@ public class CustomerFunctionDetailDTO implements Serializable { */ private String targetLink; + /** + * 上架状态:0:下架、1:上架 + */ + private Integer shoppingStatus; + /** * 自定义排序 */ diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionShoppingHistoryDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionShoppingHistoryDTO.java new file mode 100644 index 0000000000..9b1eea8a51 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionShoppingHistoryDTO.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionShoppingHistoryController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionShoppingHistoryController.java new file mode 100644 index 0000000000..51e1c62815 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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> page(@RequestParam Map params){ + PageData page = functionShoppingHistoryService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + FunctionShoppingHistoryDTO data = functionShoppingHistoryService.get(id); + return new Result().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 params, HttpServletResponse response) throws Exception { + List list = functionShoppingHistoryService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, FunctionShoppingHistoryExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionShoppingHistoryDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionShoppingHistoryDao.java new file mode 100644 index 0000000000..674482045f --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionShoppingHistoryDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.FunctionShoppingHistoryEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户定制功能上下架历史 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-14 + */ +@Mapper +public interface FunctionShoppingHistoryDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionDetailEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionDetailEntity.java index aab31d79a7..53931cb040 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionDetailEntity.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionDetailEntity.java @@ -73,6 +73,11 @@ public class CustomerFunctionDetailEntity extends BaseEpmetEntity { */ private String targetLink; + /** + * 上架状态:0:下架、1:上架 + */ + private Integer shoppingStatus; + /** * 自定义排序 */ diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionShoppingHistoryEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionShoppingHistoryEntity.java new file mode 100644 index 0000000000..6d8f479bac --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionShoppingHistoryEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户定制功能上下架历史 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("function_shopping_history") +public class FunctionShoppingHistoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 功能Id + */ + private String functionId; + + /** + * 上下架状态 上架状态:0:下架、1:上架 + */ + private Integer shoppingStatus; + + /** + * 理由 + */ + private String reason; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFunctionDetailExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFunctionDetailExcel.java index 06afddcd89..13c88668e8 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFunctionDetailExcel.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFunctionDetailExcel.java @@ -55,6 +55,9 @@ public class CustomerFunctionDetailExcel { @Excel(name = "外链地址") private String targetLink; + @Excel(name = "自定义排序") + private Integer shoppingStatus; + @Excel(name = "自定义排序") private Integer displayOrder; diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionShoppingHistoryExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionShoppingHistoryExcel.java new file mode 100644 index 0000000000..a99dfed1f6 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionShoppingHistoryExcel.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 客户定制功能上下架历史 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-14 + */ +@Data +public class FunctionShoppingHistoryExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "功能Id") + private String functionId; + + @Excel(name = "上下架状态 上架状态:0:下架、1:上架") + private Integer shoppingStatus; + + @Excel(name = "理由") + private String reason; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionShoppingHistoryRedis.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionShoppingHistoryRedis.java new file mode 100644 index 0000000000..ebe8a91096 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionShoppingHistoryRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 客户定制功能上下架历史 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-14 + */ +@Component +public class FunctionShoppingHistoryRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionShoppingHistoryService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionShoppingHistoryService.java new file mode 100644 index 0000000000..33f6d6ead6 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionShoppingHistoryService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.FunctionShoppingHistoryDTO; +import com.epmet.entity.FunctionShoppingHistoryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户定制功能上下架历史 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-14 + */ +public interface FunctionShoppingHistoryService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-08-14 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-08-14 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FunctionShoppingHistoryDTO + * @author generator + * @date 2020-08-14 + */ + FunctionShoppingHistoryDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-14 + */ + void save(FunctionShoppingHistoryDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-14 + */ + void update(FunctionShoppingHistoryDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-08-14 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionShoppingHistoryServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionShoppingHistoryServiceImpl.java new file mode 100644 index 0000000000..acd0aed260 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionShoppingHistoryServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.FunctionShoppingHistoryDao; +import com.epmet.dto.FunctionShoppingHistoryDTO; +import com.epmet.entity.FunctionShoppingHistoryEntity; +import com.epmet.redis.FunctionShoppingHistoryRedis; +import com.epmet.service.FunctionShoppingHistoryService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 客户定制功能上下架历史 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-14 + */ +@Service +public class FunctionShoppingHistoryServiceImpl extends BaseServiceImpl implements FunctionShoppingHistoryService { + + @Autowired + private FunctionShoppingHistoryRedis functionShoppingHistoryRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FunctionShoppingHistoryDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FunctionShoppingHistoryDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FunctionShoppingHistoryDTO get(String id) { + FunctionShoppingHistoryEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FunctionShoppingHistoryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FunctionShoppingHistoryDTO dto) { + FunctionShoppingHistoryEntity entity = ConvertUtils.sourceToTarget(dto, FunctionShoppingHistoryEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FunctionShoppingHistoryDTO dto) { + FunctionShoppingHistoryEntity entity = ConvertUtils.sourceToTarget(dto, FunctionShoppingHistoryEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionShoppingHistoryDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionShoppingHistoryDao.xml new file mode 100644 index 0000000000..a591988091 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionShoppingHistoryDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From ea22b09b81c01ae8d35e1f3f18082a0ed51404c0 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 14 Aug 2020 15:37:23 +0800 Subject: [PATCH 027/119] =?UTF-8?q?=E5=85=B3=E9=97=AD=E8=AF=9D=E9=A2=98?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B7=B2=E8=A7=A3=E5=86=B3=E6=9C=AA=E8=A7=A3?= =?UTF-8?q?=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/resi/group/dto/topic/ResiTopicDTO.java | 5 +++++ .../group/dto/topic/form/ResiTopicOperationFormDTO.java | 7 +++++++ .../com/epmet/modules/topic/entity/ResiTopicEntity.java | 5 +++++ .../modules/topic/service/impl/ResiTopicServiceImpl.java | 2 ++ .../src/main/resources/db/migration/V0.0.2__topic.sql | 1 + 5 files changed, 20 insertions(+) create mode 100644 epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.2__topic.sql diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicDTO.java index 35e6963377..f60ac86651 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicDTO.java @@ -53,6 +53,11 @@ public class ResiTopicDTO implements Serializable { */ private String status; + /** + * 是否解决(已解决 resolved,未解决 unresolved) + */ + private String closedStatus; + /** * 省 */ diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicOperationFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicOperationFormDTO.java index 58853940ce..3dffb22abe 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicOperationFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicOperationFormDTO.java @@ -2,6 +2,7 @@ package com.epmet.resi.group.dto.topic.form; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -25,6 +26,12 @@ public class ResiTopicOperationFormDTO implements Serializable { */ private String operateReason; + /** + * 是否解决(已解决 resolved,未解决 unresolved) + */ + @NotBlank(message = "解决状态不能为空") + private String closedStatus; + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicEntity.java index d16ba57c73..1214e5d71a 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicEntity.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicEntity.java @@ -53,6 +53,11 @@ public class ResiTopicEntity extends BaseEpmetEntity { */ private String status; + /** + * 是否解决(已解决 resolved,未解决 unresolved) + */ + private String closedStatus; + /** * 省 */ diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index 958b1b4424..1a5d8964a3 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -523,6 +523,8 @@ public class ResiTopicServiceImpl extends BaseServiceImpl id = new ArrayList<>(); id.add(closeFormDTO.getTopicId()); baseDao.cancelHiddenOrCloseBatch(id,tokenDto.getUserId(),TopicConstant.CLOSED); diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.2__topic.sql b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.2__topic.sql new file mode 100644 index 0000000000..c087db0c7d --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.2__topic.sql @@ -0,0 +1 @@ +ALTER TABLE resi_topic ADD COLUMN CLOSED_STATUS varchar(32) NULL COMMENT '关闭状态:已解决 resolved,未解决 unresolved' AFTER STATUS; \ No newline at end of file From 656f983af24fc5ae209f861a03b204c98a6a74b7 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 14 Aug 2020 15:42:29 +0800 Subject: [PATCH 028/119] =?UTF-8?q?project=20group=20user=20=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov-project-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/gov-project/gov-project-server/pom.xml | 2 +- .../resi-group/resi-group-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/resi-group/resi-group-server/pom.xml | 2 +- epmet-user/epmet-user-server/deploy/docker-compose-dev.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml index 32758e7186..b676654e4b 100644 --- a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml +++ b/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.41 ports: - "8102:8102" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-project/gov-project-server/pom.xml b/epmet-module/gov-project/gov-project-server/pom.xml index 79ff122454..b9102ce049 100644 --- a/epmet-module/gov-project/gov-project-server/pom.xml +++ b/epmet-module/gov-project/gov-project-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.40 + 0.3.41 gov-project com.epmet diff --git a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml index 44921cae4f..82c760eeb0 100644 --- a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml +++ b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-group-server: container_name: resi-group-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/resi-group-server:0.3.64 + image: 192.168.1.130:10080/epmet-cloud-dev/resi-group-server:0.3.65 ports: - "8095:8095" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-group/resi-group-server/pom.xml b/epmet-module/resi-group/resi-group-server/pom.xml index 1e66ca7900..f93bd8bc88 100644 --- a/epmet-module/resi-group/resi-group-server/pom.xml +++ b/epmet-module/resi-group/resi-group-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.64 + 0.3.65 com.epmet resi-group diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml index 60fb75bf2c..8555b3ea46 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.116 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.117 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index a1575aa794..c92fe0c949 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.116 + 0.3.117 com.epmet epmet-user From cd79ffc3723dcc033c325b7d04fe44376aa5e894 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 14 Aug 2020 16:09:09 +0800 Subject: [PATCH 029/119] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=A4=84=E7=90=86?= =?UTF-8?q?=E5=93=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/ProjectServiceImpl.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 1aef659ccd..3c572a6eac 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -684,12 +684,6 @@ public class ProjectServiceImpl extends BaseServiceImpl Date: Fri, 14 Aug 2020 16:10:23 +0800 Subject: [PATCH 030/119] =?UTF-8?q?third=E6=9C=8D=E5=8A=A1=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-third-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/epmet-third/epmet-third-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml index 09c911c908..6c2e768fc7 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.129 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.130 ports: - "8110:8110" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-third/epmet-third-server/pom.xml b/epmet-module/epmet-third/epmet-third-server/pom.xml index 1192cb671b..491700fcb5 100644 --- a/epmet-module/epmet-third/epmet-third-server/pom.xml +++ b/epmet-module/epmet-third/epmet-third-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.129 + 0.0.130 com.epmet From 3c0649c7fa10b7ced9b1c482aa99a44be3d7de04 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 14 Aug 2020 16:20:30 +0800 Subject: [PATCH 031/119] =?UTF-8?q?third=E6=9C=8D=E5=8A=A1=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/AppLetAuthorizationController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java index 64a4bb3376..0b302cdd61 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java +++ b/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 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); } From 72ff31c3fcaae3c92a3aeeafa3df6e61563258a2 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 14 Aug 2020 16:29:52 +0800 Subject: [PATCH 032/119] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/OpenUpServiceImpl.java | 5 ++- .../com/epmet/dto/form/CustomerIdFormDTO.java | 21 +++++++++++ .../result/CustomerGridCountResultDTO.java | 20 +++++++++++ .../epmet/feign/GovOrgOpenFeignClient.java | 13 +++++-- .../GovOrgOpenFeignClientFallback.java | 5 +++ .../controller/CustomerGridController.java | 12 +++++++ .../epmet/service/CustomerGridService.java | 8 +++++ .../service/impl/CustomerGridServiceImpl.java | 16 +++++++-- .../dto/result/CustomerInfoResultDTO.java | 36 +++++++++++++++++++ .../com/epmet/constant/ModuleConstant.java | 11 ++++++ .../epmet/controller/CustomerController.java | 25 +++++++++++++ .../main/java/com/epmet/dao/CustomerDao.java | 9 +++++ .../com/epmet/service/CustomerService.java | 10 ++++++ .../service/impl/CustomerServiceImpl.java | 19 ++++++++++ .../src/main/resources/mapper/CustomerDao.xml | 13 +++++++ 15 files changed, 218 insertions(+), 5 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerIdFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridCountResultDTO.java create mode 100644 epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoResultDTO.java create mode 100644 epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/constant/ModuleConstant.java diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java index d3cc815455..136fe2e55f 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java @@ -1,8 +1,10 @@ package com.epmet.service.impl; +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.CustomerAgencyDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.StaffSinDeptResultDTO; import com.epmet.dto.result.StaffSinGridResultDTO; @@ -16,6 +18,7 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; +import java.util.UUID; /** * @Author zxc @@ -39,7 +42,7 @@ public class OpenUpServiceImpl implements OpenUpService { public List staffSinGrid(StaffSinGridFormDTO formDTO) { CommonGridIdFormDTO commonGridId = new CommonGridIdFormDTO(); commonGridId.setGridId(formDTO.getGridId()); - commonGridId.setUserId(""); + commonGridId.setUserId(UUID.randomUUID().toString().replace(StrConstant.HYPHEN, "")); Result> gridStaffs = govOrgOpenFeignClient.getGridStaffs(commonGridId); if (!gridStaffs.success()){ throw new RenException(ModuleConstant.ERROR_GOV_ORG_GRID); diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerIdFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerIdFormDTO.java new file mode 100644 index 0000000000..0e853c6275 --- /dev/null +++ b/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; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridCountResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridCountResultDTO.java new file mode 100644 index 0000000000..1f583338a2 --- /dev/null +++ b/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; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 162bd8a07a..361a3e5b76 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -19,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 { @@ -191,7 +191,7 @@ public interface GovOrgOpenFeignClient { * @author zxc * @date 2020/8/13 10:46 上午 */ - @PostMapping("/gov/org/customerstaffgrid/getgridstaffs") + @PostMapping(value = "/gov/org/customerstaffgrid/getgridstaffs") Result> getGridStaffs(@RequestBody CommonGridIdFormDTO gridIdFormDTO); /** @@ -202,4 +202,13 @@ public interface GovOrgOpenFeignClient { */ @PostMapping("/gov/org/customerstaffdepartment/getdepartmentstaffs") Result> getDepartmentStaffs(@RequestBody DepartmentIdFormDTO formDTO); + + /** + * @Description 查询客户下的网格数量 + * @param customerIdFormDTO + * @author zxc + * @date 2020/8/14 9:31 上午 + */ + @PostMapping("/gov/org/customergrid/gridcount") + Result selectGridCount(@RequestBody CustomerIdFormDTO customerIdFormDTO); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index c4421f69a7..370559ff57 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -121,4 +121,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { public Result> getDepartmentStaffs(DepartmentIdFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getDepartmentStaffs", formDTO); } + + @Override + public Result selectGridCount(CustomerIdFormDTO customerIdFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectGridCount", customerIdFormDTO); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index 69eecc5d2c..b86bb7df20 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java +++ b/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 selectGridCount(@RequestBody CustomerIdFormDTO customerIdFormDTO){ + ValidatorUtils.validateEntity(customerIdFormDTO, CustomerIdFormDTO.Customer.class); + return new Result().ok(customerGridService.selectGridCount(customerIdFormDTO)); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index 518e20fdb5..67c425915f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -251,4 +251,12 @@ public interface CustomerGridService extends BaseService { * @Description 单客户-陌生人导览模块调用-根据地区编码查询客户下的网格列表 **/ Result> queryCustomerGridList(ThirdCustomerGridListFormDTO formDTO); + + /** + * @Description 查询客户下的网格数量 + * @param customerIdFormDTO + * @author zxc + * @date 2020/8/14 9:31 上午 + */ + CustomerGridCountResultDTO selectGridCount( CustomerIdFormDTO customerIdFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index fd32b2a087..afece523c4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/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.*; @@ -40,7 +39,6 @@ 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; @@ -637,4 +635,18 @@ public class CustomerGridServiceImpl extends BaseServiceImpl> page(@RequestParam Map params) { @@ -267,4 +271,25 @@ public class CustomerController { return new Result().ok(customerService.getGridCount(formDTO)); } + /** + * @Description 查询客户基本信息 + * @param formDTO + * @author zxc + * @date 2020/8/14 9:08 上午 + */ + @PostMapping("getcustomer") + public Result getCustomer(@RequestBody CustomerIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, CustomerIdFormDTO.Customer.class); + return new Result().ok(customerService.getCustomer(formDTO)); + } + + + @PostMapping("zxc") + public void getZxc(){ + CommonGridIdFormDTO commonGridId = new CommonGridIdFormDTO(); + commonGridId.setGridId("111"); + commonGridId.setUserId("111"); + Result> gridStaffs = govOrgOpenFeignClient.getGridStaffs(commonGridId); + System.out.println(gridStaffs); + } } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java index 40dd5394e6..6c21743bbb 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java @@ -19,6 +19,7 @@ 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; @@ -83,4 +84,12 @@ public interface CustomerDao extends BaseDao { */ GridCountResultDTO getGridCount(@Param("customerId")String customerId); + /** + * @Description 根据客户Id查询客户基本信息 + * @param customerId + * @author zxc + * @date 2020/8/14 9:12 上午 + */ + CustomerInfoResultDTO selectCustomerBasicInfo(@Param("customerId")String customerId); + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java index 08475a9f5b..cf32a13308 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java @@ -23,9 +23,11 @@ import com.epmet.commons.tools.utils.Result; 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.entity.CustomerEntity; +import org.springframework.web.bind.annotation.RequestBody; import java.util.List; import java.util.Map; @@ -179,4 +181,12 @@ public interface CustomerService extends BaseService { * @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); } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java index a408167145..51364b48d9 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java +++ b/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; @@ -557,4 +558,22 @@ public class CustomerServiceImpl extends BaseServiceImpl result = govOrgOpenFeignClient.selectGridCount(formDTO); + if (!result.success()){ + throw new RenException(ModuleConstant.ERROR_GOV_ORG_COUNT); + } + customerInfoResultDTO.setCreateGridNum(result.getData().getGridCount()); + return customerInfoResultDTO; + } + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml index 6586930075..33c0dd52e2 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml @@ -89,4 +89,17 @@ del_flag = 0 AND id = #{customerId} + + + From 03dcf784c2398ac06f136f78070fd12bac202e03 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 14 Aug 2020 16:30:57 +0800 Subject: [PATCH 033/119] =?UTF-8?q?DB=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V0.0.4__add_customer_function_detail.sql | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql index 62f992bbb8..5e61ca48a2 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql @@ -8,6 +8,7 @@ CREATE TABLE `customer_function_detail` ( `ICON_SMALL_IMG` varchar(128) NOT NULL COMMENT ''自定义小图标'', `DOMAIN_NAME` varchar(32) NOT NULL COMMENT ''自定义业务域名'', `TARGET_LINK` varchar(128) NOT NULL COMMENT ''外链地址'', + `SHOPPING_STATUS` int(11) NOT NULL COMMENT ''上架状态(0.下架 1.上架)'', `DISPLAY_ORDER` int(11) NOT NULL COMMENT ''自定义排序'', `DEL_FLAG` int(11) NOT NULL COMMENT ''删除标识(0.未删除 1.已删除)'', `REVISION` int(11) NOT NULL COMMENT ''乐观锁'', @@ -43,4 +44,20 @@ CREATE TABLE function_customized_visited( UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , PRIMARY KEY (ID) -) COMMENT = '定制功能访问记录表 记录居民端、工作端那些人访问过定制功能以及访问的结果'; \ No newline at end of file +) COMMENT = '定制功能访问记录表 记录居民端、工作端那些人访问过定制功能以及访问的结果'; + + +DROP TABLE IF EXISTS `function_shopping_history`; +CREATE TABLE function_shopping_history( + ID VARCHAR(64) NOT NULL COMMENT '主键' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户Id' , + FUNCTION_ID VARCHAR(64) NOT NULL COMMENT '功能Id' , + SHOPPING_STATUS INT NOT NULL COMMENT '上下架状态 上架状态:0:下架、1:上架' , + REASON VARCHAR(1024) NOT NULL COMMENT '理由' , + REVISION INT NOT NULL COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , + CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , + UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '客户定制功能上下架历史'; \ No newline at end of file From 8388888b9f759fe85af960153395f57547d5cb75 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 14 Aug 2020 16:31:57 +0800 Subject: [PATCH 034/119] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=B5=8B=E8=AF=95con?= =?UTF-8?q?troller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/CustomerController.java | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java index 4b8008ac9d..0369274a34 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java @@ -37,7 +37,6 @@ import com.epmet.dto.result.GridCountResultDTO; import com.epmet.dto.result.ValidCustomerResultDTO; import com.epmet.excel.CustomerExcel; import com.epmet.feign.GovOrgFeignClient; -import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.CustomerService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -66,8 +65,6 @@ public class CustomerController { @Autowired private GovOrgFeignClient govOrgFeignClient; - @Autowired - private GovOrgOpenFeignClient govOrgOpenFeignClient; @GetMapping("page") public Result> page(@RequestParam Map params) { @@ -282,14 +279,4 @@ public class CustomerController { ValidatorUtils.validateEntity(formDTO, CustomerIdFormDTO.Customer.class); return new Result().ok(customerService.getCustomer(formDTO)); } - - - @PostMapping("zxc") - public void getZxc(){ - CommonGridIdFormDTO commonGridId = new CommonGridIdFormDTO(); - commonGridId.setGridId("111"); - commonGridId.setUserId("111"); - Result> gridStaffs = govOrgOpenFeignClient.getGridStaffs(commonGridId); - System.out.println(gridStaffs); - } } From b26172ed45b099ee44395d29947d1a3c325d11ee Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Mon, 17 Aug 2020 10:28:31 +0800 Subject: [PATCH 035/119] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E5=AE=9A=E5=88=B6=E5=8A=9F=E8=83=BD=E4=B8=8A=E4=B8=8B=E6=9E=B6?= =?UTF-8?q?=E3=80=81=E5=AE=A2=E6=88=B7=E5=AE=9A=E5=88=B6=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=8E=A5=E5=8F=A3=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/FunctionShoppingHistoryDTO.java | 6 ++- .../form/UpdateCustomerFunctionFormDTO.java | 53 +++++++++++++++++++ .../dto/form/UpdateShoppingStatusFormDTO.java | 47 ++++++++++++++++ .../CustomerFunctionDetailController.java | 42 +++++++++++++-- .../epmet/dao/CustomerFunctionDetailDao.java | 22 ++++++++ .../CustomerFunctionDetailService.java | 27 +++++++++- .../CustomerFunctionDetailServiceImpl.java | 28 +++++++++- .../db/migration/V0.0.5__add_del_flag.sql | 1 + .../mapper/CustomerFunctionDetailDao.xml | 31 +++++++++++ 9 files changed, 250 insertions(+), 7 deletions(-) create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomerFunctionFormDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateShoppingStatusFormDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.5__add_del_flag.sql diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionShoppingHistoryDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionShoppingHistoryDTO.java index 9b1eea8a51..3426469343 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionShoppingHistoryDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionShoppingHistoryDTO.java @@ -83,4 +83,8 @@ public class FunctionShoppingHistoryDTO implements Serializable { */ private Date updatedTime; -} \ No newline at end of file + /** + * 删除标识(0.未删除 1.已删除) + */ + private Integer delFlag; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomerFunctionFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomerFunctionFormDTO.java new file mode 100644 index 0000000000..83800e2af5 --- /dev/null +++ b/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; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateShoppingStatusFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateShoppingStatusFormDTO.java new file mode 100644 index 0000000000..2a27cfbc18 --- /dev/null +++ b/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; +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java index 55b7f391f0..2c174d1c24 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java @@ -25,11 +25,12 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerFunctionDetailDTO; -import com.epmet.dto.FunctionDTO; 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; @@ -50,7 +51,7 @@ import java.util.Map; @RestController @RequestMapping("customerfunctiondetail") public class CustomerFunctionDetailController { - + @Autowired private CustomerFunctionDetailService customerFunctionDetailService; @@ -121,4 +122,37 @@ public class CustomerFunctionDetailController { return new Result>().ok(customerFunctionDetailService.resiAndWorkFunctionDetail(formDTO)); } -} \ No newline at end of file + /** + * 修改客户定制功能上下架 + * 修改上下架状态,保存上下架历史 + * + * @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); + } +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java index b3f4638322..7ee1a99567 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java @@ -20,6 +20,8 @@ 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; @@ -54,4 +56,24 @@ public interface CustomerFunctionDetailDao extends BaseDao 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); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java index a1ec9f6cf8..3dc099b9ca 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java @@ -19,8 +19,11 @@ package com.epmet.service; 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.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; @@ -102,4 +105,26 @@ public interface CustomerFunctionDetailService extends BaseService resiAndWorkFunctionDetail(FunctionDetailFromDTO formDTO); -} \ No newline at end of file + + /** + * 修改客户定制功能上下架 + * 修改上下架状态,保存上下架历史 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:17 2020-08-17 + **/ + Result updateShoppingStatus(UpdateShoppingStatusFormDTO formDTO); + + /** + * 客户定制功能修改 入参 + * 目前允许修改功能名称、大小图标 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:00 2020-08-17 + **/ + Result updateCustomerFunction(UpdateCustomerFunctionFormDTO formDTO); +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java index 1559d4122f..faa4fa72df 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java @@ -23,13 +23,18 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.CustomerFunctionDetailDao; import com.epmet.dto.CustomerFunctionDetailDTO; +import com.epmet.dto.FunctionShoppingHistoryDTO; 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 com.epmet.redis.CustomerFunctionDetailRedis; import com.epmet.service.CustomerFunctionDetailService; +import com.epmet.service.FunctionShoppingHistoryService; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -54,6 +59,9 @@ public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -120,4 +128,22 @@ public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl + + UPDATE customer_function_detail + SET + SHOPPING_STATUS = #{shoppingStatus}, + UPDATED_BY = #{userId}, + UPDATED_TIME = now() + WHERE + DEL_FLAG = '0' + AND CUSTOMER_ID = #{customerId} + AND FUNCTION_ID = #{functionId} + + + + UPDATE customer_function_detail + SET + + FUNCTION_NAME = #{functionName}, + + + ICON_LARGE_IMG = #{iconLargeImg}, + + + ICON_SMALL_IMG = #{iconSmallImg}, + + UPDATED_BY = #{userId}, + UPDATED_TIME = now() + WHERE + DEL_FLAG = '0' + AND CUSTOMER_ID = #{customerId} + AND FUNCTION_ID = #{functionId} + From c0f3654f2a94b0c9ab7d1d6af71d79c699df0063 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 17 Aug 2020 14:09:26 +0800 Subject: [PATCH 036/119] =?UTF-8?q?=E6=9C=BA=E5=85=B3=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=9F=A5=E8=AF=A2=EF=BC=8Cext=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E4=BF=AE=E6=94=B9=20url=EF=BC=8C=E6=B7=BB=E5=8A=A0=20?= =?UTF-8?q?epmet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap.yml | 2 +- .../epmet/dto/form/StaffSinAgencyFormDTO.java | 31 ++++++++++ .../com/epmet/constant/ModuleConstant.java | 2 + .../epmet/controller/OpenUpController.java | 21 ++++--- .../java/com/epmet/service/OpenUpService.java | 11 +++- .../epmet/service/impl/OpenUpServiceImpl.java | 60 ++++++++++++++----- .../src/main/resources/bootstrap.yml | 2 +- .../com/epmet/dto/form/AgencyIdFormDTO.java | 20 +++++++ .../epmet/feign/GovOrgOpenFeignClient.java | 15 ++++- .../GovOrgOpenFeignClientFallback.java | 5 ++ .../CustomerStaffAgencyController.java | 13 +++- .../com/epmet/dao/CustomerStaffAgencyDao.java | 8 +++ .../service/CustomerStaffAgencyService.java | 9 +++ .../impl/CustomerStaffAgencyServiceImpl.java | 18 ++++-- .../mapper/CustomerStaffAgencyDao.xml | 11 ++++ .../dto/result/StaffSinAgencyResultDTO.java | 42 +++++++++++++ 16 files changed, 235 insertions(+), 35 deletions(-) create mode 100644 epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinAgencyFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyIdFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffSinAgencyResultDTO.java diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 121e797b01..f3bd69d736 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -318,7 +318,7 @@ spring: uri: @gateway.routes.epmet-ext-server.url@ order: 34 predicates: - - Path=${server.servlet.context-path}/ext/** + - Path=${server.servlet.context-path}/epmet/ext/** filters: - StripPrefix=1 - CpAuth=true diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinAgencyFormDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinAgencyFormDTO.java new file mode 100644 index 0000000000..5e166ac342 --- /dev/null +++ b/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; +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java index 2743ae7afd..d8b34dc284 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java @@ -10,6 +10,8 @@ public interface ModuleConstant { String ERROR_GOV_ORG_DEPARTMENT = "调用gov_org服务查询【部门】下的所有工作人员失败"; + String ERROR_GOV_ORG_AGENCY = "调用gov_org服务查询【机关】下的所有工作人员失败"; + String ERROR_EPMET_USER = "调用epmet_user服务查询网格下的所有工作人员失败"; } diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java index 2fb0ad964a..68f854f8dc 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java @@ -2,14 +2,10 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.form.CommonGridIdFormDTO; -import com.epmet.dto.form.StaffSinDeptFormDTO; -import com.epmet.dto.form.StaffSinGridFormDTO; -import com.epmet.dto.form.UserIdsFormDTO; +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.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -17,7 +13,6 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.util.ArrayList; import java.util.List; /** @@ -55,4 +50,16 @@ public class OpenUpController { return new Result>().ok(openUpService.staffSinDept(formDTO)); } + /** + * @Description 机关工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/17 9:59 上午 + */ + @PostMapping("staffsinagency") + public Result> staffSinAgency(@RequestBody StaffSinAgencyFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, StaffSinAgencyFormDTO.StaffSinAgency.class); + return new Result>().ok(openUpService.staffSinAgency(formDTO)); + } + } diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java index 6ede09ec01..5ecbf7aedb 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java @@ -1,7 +1,9 @@ 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; @@ -27,6 +29,13 @@ public interface OpenUpService { * @author zxc * @date 2020/8/13 9:51 上午 */ - List staffSinDept( StaffSinDeptFormDTO formDTO); + List staffSinDept(StaffSinDeptFormDTO formDTO); + /** + * @Description 机关工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/17 9:59 上午 + */ + List staffSinAgency(StaffSinAgencyFormDTO formDTO); } diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java index 136fe2e55f..f90f0a0545 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java @@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.constant.ModuleConstant; import com.epmet.dto.CustomerAgencyDTO; 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; @@ -47,14 +48,7 @@ public class OpenUpServiceImpl implements OpenUpService { if (!gridStaffs.success()){ throw new RenException(ModuleConstant.ERROR_GOV_ORG_GRID); } - List userIds = gridStaffs.getData(); - UserIdsFormDTO userIdsForm = new UserIdsFormDTO(); - userIdsForm.setUserIds(userIds); - Result> staffInfoList = epmetUserOpenFeignClient.getStaffInfoList(userIdsForm); - if (!staffInfoList.success()){ - throw new RenException(ModuleConstant.ERROR_EPMET_USER); - } - return staffInfoList.getData(); + return this.getStaffList(gridStaffs.getData()); } /** @@ -71,14 +65,7 @@ public class OpenUpServiceImpl implements OpenUpService { if (!departmentStaffs.success()){ throw new RenException(ModuleConstant.ERROR_GOV_ORG_DEPARTMENT); } - List userIds = departmentStaffs.getData(); - UserIdsFormDTO userIdsForm = new UserIdsFormDTO(); - userIdsForm.setUserIds(userIds); - Result> staffInfoList = epmetUserOpenFeignClient.getStaffInfoList(userIdsForm); - if (!staffInfoList.success()){ - throw new RenException(ModuleConstant.ERROR_EPMET_USER); - } - List data = staffInfoList.getData(); + List data = this.getStaffList(departmentStaffs.getData()); List result = new ArrayList<>(); data.forEach(staff -> { StaffSinDeptResultDTO dept = new StaffSinDeptResultDTO(); @@ -87,4 +74,45 @@ public class OpenUpServiceImpl implements OpenUpService { }); return result; } + + /** + * @Description 机关工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/17 9:59 上午 + */ + @Override + public List staffSinAgency(StaffSinAgencyFormDTO formDTO) { + AgencyIdFormDTO agencyId = new AgencyIdFormDTO(); + agencyId.setAgencyId(formDTO.getAgencyId()); + Result> agencyStaffs = govOrgOpenFeignClient.getAgencyStaffs(agencyId); + if (!agencyStaffs.success()){ + throw new RenException(ModuleConstant.ERROR_GOV_ORG_AGENCY); + } + List staffList = this.getStaffList(agencyStaffs.getData()); + List 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 getStaffList(List userIds){ + UserIdsFormDTO userIdsForm = new UserIdsFormDTO(); + userIdsForm.setUserIds(userIds); + Result> staffInfoList = epmetUserOpenFeignClient.getStaffInfoList(userIdsForm); + if (!staffInfoList.success()){ + throw new RenException(ModuleConstant.ERROR_EPMET_USER); + } + return staffInfoList.getData(); + } + } diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml index c51f11149a..8f43acbf19 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml @@ -1,7 +1,7 @@ server: port: @server.port@ servlet: - context-path: /ext + context-path: /epmet/ext spring: main: diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyIdFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyIdFormDTO.java new file mode 100644 index 0000000000..44777f5886 --- /dev/null +++ b/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; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 361a3e5b76..dbd11097bd 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -191,7 +191,7 @@ public interface GovOrgOpenFeignClient { * @author zxc * @date 2020/8/13 10:46 上午 */ - @PostMapping(value = "/gov/org/customerstaffgrid/getgridstaffs") + @PostMapping(value = "/gov/org/customerstaffgrid/getgridstaffs",consumes = MediaType.APPLICATION_JSON_VALUE) Result> getGridStaffs(@RequestBody CommonGridIdFormDTO gridIdFormDTO); /** @@ -200,7 +200,7 @@ public interface GovOrgOpenFeignClient { * @author zxc * @date 2020/8/13 2:46 下午 */ - @PostMapping("/gov/org/customerstaffdepartment/getdepartmentstaffs") + @PostMapping(value = "/gov/org/customerstaffdepartment/getdepartmentstaffs",consumes = MediaType.APPLICATION_JSON_VALUE) Result> getDepartmentStaffs(@RequestBody DepartmentIdFormDTO formDTO); /** @@ -209,6 +209,15 @@ public interface GovOrgOpenFeignClient { * @author zxc * @date 2020/8/14 9:31 上午 */ - @PostMapping("/gov/org/customergrid/gridcount") + @PostMapping(value = "/gov/org/customergrid/gridcount",consumes = MediaType.APPLICATION_JSON_VALUE) Result selectGridCount(@RequestBody CustomerIdFormDTO customerIdFormDTO); + + /** + * @Description 查询机关下工作人员 + * @param formDTO + * @author zxc + * @date 2020/8/17 + */ + @PostMapping(value = "/gov/org/customerstaffagency/getagencystaffs",consumes = MediaType.APPLICATION_JSON_VALUE) + Result> getAgencyStaffs(@RequestBody AgencyIdFormDTO formDTO); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 370559ff57..1394cb2146 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -126,4 +126,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { public Result selectGridCount(CustomerIdFormDTO customerIdFormDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectGridCount", customerIdFormDTO); } + + @Override + public Result> getAgencyStaffs(AgencyIdFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyStaffs", formDTO); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java index a92d2d8826..9477758c71 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java @@ -28,6 +28,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.CustomerStaffAgencyDTO; +import com.epmet.dto.form.AgencyIdFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.CustomerGridFormDTO; @@ -111,7 +112,15 @@ public class CustomerStaffAgencyController { return customerStaffAgencyService.getLatestCustomer(userId); } - - + /** + * @Description 查询机关下工作人员 + * @param agencyIdFormDTO + * @author zxc + * @date 2020/8/17 10:14 上午 + */ + @PostMapping("getagencystaffs") + public Result> getAgencyStaffs(@RequestBody AgencyIdFormDTO agencyIdFormDTO){ + return new Result>().ok(customerStaffAgencyService.getAgencyStaffs(agencyIdFormDTO)); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java index 8cfef54079..ffc46fa725 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java @@ -100,4 +100,12 @@ public interface CustomerStaffAgencyDao extends BaseDao getAgencyStaffList(@Param("agencyId")String agencyId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java index 6691351505..8f6f47dfdb 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java +++ b/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 getAgencyStaffs(AgencyIdFormDTO agencyIdFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java index ba90138f12..241f9d9a67 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java +++ b/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 page(Map params) { @@ -213,4 +212,15 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl getAgencyStaffs(AgencyIdFormDTO agencyIdFormDTO) { + return customerStaffAgencyDao.getAgencyStaffList(agencyIdFormDTO.getAgencyId()); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml index 2d548065f3..3df433a5b6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml +++ b/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} + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffSinAgencyResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffSinAgencyResultDTO.java new file mode 100644 index 0000000000..93b650d538 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffSinAgencyResultDTO.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/17 9:25 上午 + */ +@Data +public class StaffSinAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = -3440415906710443002L; + + /** + * 工作人员Id + */ + private String staffId; + + /** + * 工作人员名称 + */ + private String staffName; + + /** + * 头像 + */ + private String headPhoto; + + /** + * 性别,1男2女0未知 + */ + private Integer gender; + + /** + * 角色列表 + */ + private List roleList; + +} From d46e5d5103789dd3052e492a009b93237b15e323 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 17 Aug 2020 14:21:35 +0800 Subject: [PATCH 037/119] =?UTF-8?q?agency=E5=88=A0=E9=99=A4=E6=9C=AA?= =?UTF-8?q?=E7=94=A8import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/CustomerStaffAgencyController.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java index 9477758c71..ad965efef7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java +++ b/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; @@ -29,12 +27,7 @@ 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.AgencyIdFormDTO; -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.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; From 03af4c982a583e0382e7e1849bf089fb27250f71 Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 17 Aug 2020 14:50:32 +0800 Subject: [PATCH 038/119] =?UTF-8?q?=E5=AF=B9=E5=A4=96=E6=8E=A5=E5=8F=A3=20?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=B7=A5=E4=BD=9C=E4=BA=BA=E5=91=98=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-ext/epmet-ext-client/pom.xml | 6 ++ .../epmet/dto/result/ExtRoleMapResultDTO.java | 26 ++++++ .../dto/result/ExtStaffInfoResultDTO.java | 82 +++++++++++++++++++ .../epmet/feign/GovOrgOpenFeignClient.java | 10 +++ .../GovOrgOpenFeignClientFallback.java | 5 ++ .../controller/CustomerAgencyController.java | 12 +++ .../java/com/epmet/dao/CustomerAgencyDao.java | 9 ++ .../epmet/service/CustomerAgencyService.java | 9 ++ .../impl/CustomerAgencyServiceImpl.java | 72 ++++++++++++++++ .../java/com/epmet/util/ModuleConstant.java | 2 + .../resources/mapper/CustomerAgencyDao.xml | 17 ++++ .../epmet/dto/form/CommonStaffIdFormDTO.java | 24 ++++++ .../controller/CustomerStaffController.java | 13 +++ .../java/com/epmet/dao/CustomerStaffDao.java | 9 ++ .../epmet/service/CustomerStaffService.java | 9 ++ .../impl/CustomerStaffServiceImpl.java | 23 ++++++ .../resources/mapper/CustomerStaffDao.xml | 46 +++++++++++ 17 files changed, 374 insertions(+) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtRoleMapResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffInfoResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonStaffIdFormDTO.java diff --git a/epmet-module/epmet-ext/epmet-ext-client/pom.xml b/epmet-module/epmet-ext/epmet-ext-client/pom.xml index edb8fb13a1..925703ab91 100644 --- a/epmet-module/epmet-ext/epmet-ext-client/pom.xml +++ b/epmet-module/epmet-ext/epmet-ext-client/pom.xml @@ -26,6 +26,12 @@ 3.6.0 compile + + com.epmet + epmet-user-client + 2.0.0 + compile + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtRoleMapResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtRoleMapResultDTO.java new file mode 100644 index 0000000000..fc2083b935 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtRoleMapResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName ExtRoleMapResultDTO + * @Auth wangc + * @Date 2020-08-17 09:19 + */ +@Data +public class ExtRoleMapResultDTO implements Serializable { + private static final long serialVersionUID = 4988555173286922503L; + + /** + * 角色key + * */ + private String roleKey; + + /** + * 角色名称 + * */ + private String roleName; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffInfoResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffInfoResultDTO.java new file mode 100644 index 0000000000..a0f76c8787 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffInfoResultDTO.java @@ -0,0 +1,82 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @ClassName ExtStaffInfoResultDTO + * @Auth wangc + * @Date 2020-08-17 09:14 + */ +@Data +public class ExtStaffInfoResultDTO implements Serializable { + private static final long serialVersionUID = 3874334777882476292L; + + /** + * 工作人员昵称 + * */ + private String nickname; + + /** + * 工作人员头像 + * */ + private String profile; + + /** + * + * */ + private String realName; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 客户名称 + * */ + private String customerName; + + /** + * 机关Id + * */ + private String agencyId; + + /** + * 机关名称 + * */ + private String agencyName; + + /** + * 机关路径Id + * */ + private String agencyIdPath; + + /** + * 机关路径名称 + * */ + private String agencyNamePath; + + /** + * 网格Id + * */ + private String gridId; + + /** + * 网格名称 + * */ + private String gridName; + + /** + * 是否管理员标识 1是0否 + * */ + private String adminFlag; + + /** + * 用户角色列表 + * */ + private List roleList; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index dbd11097bd..1694033b41 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -220,4 +220,14 @@ public interface GovOrgOpenFeignClient { */ @PostMapping(value = "/gov/org/customerstaffagency/getagencystaffs",consumes = MediaType.APPLICATION_JSON_VALUE) Result> getAgencyStaffs(@RequestBody AgencyIdFormDTO formDTO); + + /** + * @Description User模块调用gov-org查询工作人员所在机关的信息以及客户信息 + * @param result + * @return + * @author wangc + * @date 2020.08.17 14:11 + **/ + @PostMapping("/gov/org/customeragency/staffinfoext") + Result staffInfoExt(@RequestBody ExtStaffInfoResultDTO result); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 1394cb2146..c845039399 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -131,4 +131,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { public Result> getAgencyStaffs(AgencyIdFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyStaffs", formDTO); } + + @Override + public Result staffInfoExt(ExtStaffInfoResultDTO result) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "staffInfoExt", result); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 83250c4c17..c4cf4008e0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -193,4 +193,16 @@ public class CustomerAgencyController { Result querySponsorList(@PathVariable("staffId") String staffId){ return new Result().ok(customerAgencyService.querySponsorList(staffId)); } + + /** + * @Description 对外接口 获取工作人员基本信息 + * @param result ExtStaffInfoResultDTO.class + * @return Result + * @author wangc + * @date 2020.08.17 13:52 + **/ + @PostMapping("staffinfoext") + Result staffInfoExt(@RequestBody ExtStaffInfoResultDTO result){ + return new Result().ok(customerAgencyService.staffInfoExt(result)); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index 8a51d3ad19..4b22c60245 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -124,4 +124,13 @@ public interface CustomerAgencyDao extends BaseDao { * @Description 递归查询当前机关的下一级机关列表 **/ List selectAllSubAgency(@Param("subAgencyPids") String subAgencyPids); + + /** + * @Description 查询一个工作人员最近登录的网格以及机关信息 + * @param gridId + * @return + * @author wangc + * @date 2020.08.17 09:50 + **/ + ExtStaffInfoResultDTO selectAgencyAndGridInfoExt(@Param("gridId") String gridId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index cacba8512e..b6746c59f3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -178,4 +178,13 @@ public interface CustomerAgencyService extends BaseService * @Date 2020/7/23 20:50 **/ ActSponsorResultDTO querySponsorList(String staffId); + + /** + * @Description 查询工作人员的信息,多客户/单客户,epmet-plugin,对外开放调用 + * @param result + * @return + * @author wangc + * @date 2020.08.17 09:29 + **/ + ExtStaffInfoResultDTO staffInfoExt(ExtStaffInfoResultDTO result); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index e399d29b85..344e947135 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -39,6 +39,7 @@ import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.OperCrmFeignClient; import com.epmet.redis.CustomerAgencyRedis; import com.epmet.service.CustomerAgencyService; +import com.epmet.util.ModuleConstant; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -46,6 +47,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.lang.reflect.Field; import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; @@ -834,4 +836,74 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl customerResult = + operCrmFeignClient.getCustomerInfo(customerParam); + if(customerResult.success() && null != customerResult.getData()){ + result.setCustomerName(customerResult.getData().getCustomerName()); + } + checkFieldAndSetDefault(result); + return result; + } + + + + public void mergeObject(T origin, T destination) { + if (origin == null || destination == null) + return; + if (!origin.getClass().equals(destination.getClass())) + return; + + Field[] fields = origin.getClass().getDeclaredFields(); + for (int i = 0; i < fields.length; i++) { + try { + fields[i].setAccessible(true); + Object value = fields[i].get(origin); + if (null != value) { + fields[i].set(destination, value); + } + fields[i].setAccessible(false); + } catch (Exception e) { + + } + } + } + + + + public void checkFieldAndSetDefault(T origin) { + if (origin == null) + return; + Field[] fields = origin.getClass().getDeclaredFields(); + for (int i = 0; i < fields.length; i++) { + try { + fields[i].setAccessible(true); + Object value = fields[i].get(origin); + if (null == value && value.getClass().getName().equals("java.lang.String")) { + fields[i].set(origin, ModuleConstant.EMPTY_STR); + } + fields[i].setAccessible(false); + } catch (Exception e) { + + } + } + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ModuleConstant.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ModuleConstant.java index a1539be232..143d496aec 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ModuleConstant.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ModuleConstant.java @@ -71,4 +71,6 @@ public interface ModuleConstant { * 组织类型:网格 * */ String ORG_TYPE_GRID = "grid"; + + String EMPTY_STR = ""; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 61b9011343..ffcb626923 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -169,4 +169,21 @@ ORDER BY created_time DESC + + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonStaffIdFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonStaffIdFormDTO.java new file mode 100644 index 0000000000..95d8b74e9d --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonStaffIdFormDTO.java @@ -0,0 +1,24 @@ +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; + +/** + * @Description 工作人员Id + * @ClassName CommonStaffIdFormDTO + * @Auth wangc + * @Date 2020-08-17 10:28 + */ +@Data +public class CommonStaffIdFormDTO implements Serializable { + + private static final long serialVersionUID = -5093758817860808310L; + + public interface StaffIdGroup extends CustomerClientShowGroup{} + + @NotBlank(message = "工作人员Id不能为空" , groups = StaffIdGroup.class) + private String staffId; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index 8ed7c0727d..8d94810e84 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -333,4 +333,17 @@ public class CustomerStaffController { ValidatorUtils.validateEntity(formDTO); return new Result>().ok(customerStaffService.getStaffInfoList(formDTO)); } + + /** + * @Description 查找工作人员的信息 - 对外开放接口 + * @param staffParam + * @return + * @author wangc + * @date 2020.08.17 10:30 + **/ + @PostMapping("extstaffinfo") + public Result extStaffInfo(CommonStaffIdFormDTO staffParam){ + ValidatorUtils.validateEntity(staffParam, CommonStaffIdFormDTO.StaffIdGroup.class); + return new Result().ok(customerStaffService.extStaffInfo(staffParam)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index ce0ff406c7..fefa18a1d7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -153,4 +153,13 @@ public interface CustomerStaffDao extends BaseDao { * @date 2020/8/13 1:45 下午 */ List getStaffInfoList(@Param("userIds")List userIds); + + /** + * @Description 查询工作人员信息 (对外接口) + * @param staffId + * @return + * @author wangc + * @date 2020.08.17 13:26 + **/ + ExtStaffInfoResultDTO selectStaffInfoExt(@Param("staffId") String staffId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java index 1eb5e070e4..055d456159 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java @@ -266,4 +266,13 @@ public interface CustomerStaffService extends BaseService { * @date 2020/8/13 1:45 下午 */ List getStaffInfoList( UserIdsFormDTO formDTO); + + /** + * @Description 查找工作人员的信息 - 对外开放接口 + * @param staffParam + * @return + * @author wangc + * @date 2020.08.17 10:30 + **/ + ExtStaffInfoResultDTO extStaffInfo(CommonStaffIdFormDTO staffParam); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 2ff38361cb..162299581e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -576,4 +576,27 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl govOrgResult = + govOrgOpenFeignClient.staffInfoExt(result); + if(govOrgResult.success() && null != govOrgResult.getData()){ + return govOrgResult.getData(); + } + } + return null; + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index bcd20d8b96..5a8bc1743f 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -235,4 +235,50 @@ cs.user_id = #{userId} + + + + + + + + + + + + + + + + + \ No newline at end of file From f963928a0e6dd214f6b5cae8ba4925f82e26659c Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 17 Aug 2020 16:08:05 +0800 Subject: [PATCH 039/119] =?UTF-8?q?ext=20=E6=8F=90=E4=BA=A4=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/ExtGridResultDTO.java | 20 ++++++++++++++++ .../result/ExtStaffPermissionResultDTO.java | 23 +++++++++++++++++++ .../impl/CustomerAgencyServiceImpl.java | 8 +++++++ 3 files changed, 51 insertions(+) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java new file mode 100644 index 0000000000..ed36458a9f --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName ExtGridResultDTO + * @Auth wangc + * @Date 2020-08-17 15:28 + */ +@Data +public class ExtGridResultDTO implements Serializable { + private static final long serialVersionUID = -4531574240525562587L; + + private String gridId; + + private String gridName; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java new file mode 100644 index 0000000000..b74504ddcf --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @ClassName ExtStaffPermissionResultDTO + * @Auth wangc + * @Date 2020-08-17 15:24 + */ +@Data +public class ExtStaffPermissionResultDTO implements Serializable { + private static final long serialVersionUID = 2513553862809278219L; + + private String agencyId; + + private String agencyName; + + private List gridList; +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 344e947135..ba856bda8b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -860,6 +860,14 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl { + if(StringUtils.equals("root_manager",o.getRoleKey())){ + result.setAdminFlag(NumConstant.ONE_STR); + } + }); + } return result; } From 31d5fcc31f71dd888540e37da8d3a811375193cb Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 18 Aug 2020 09:10:29 +0800 Subject: [PATCH 040/119] =?UTF-8?q?=E6=9C=BA=E5=85=B3=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E4=BA=BA=E5=91=98=EF=BC=8C=E9=83=A8=E9=97=A8=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E4=BA=BA=E5=91=98=EF=BC=8C=E7=BD=91=E6=A0=BC=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/OpenUpServiceImpl.java | 12 ++++++++++-- .../java/com/epmet/feign/GovOrgOpenFeignClient.java | 8 ++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java index f90f0a0545..38120535b9 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java @@ -1,10 +1,10 @@ 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.CustomerAgencyDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.StaffSinAgencyResultDTO; import com.epmet.dto.result.StaffSinDeptResultDTO; @@ -12,7 +12,6 @@ import com.epmet.dto.result.StaffSinGridResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.OpenUpService; -import org.bouncycastle.math.raw.Mod; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -48,6 +47,9 @@ public class OpenUpServiceImpl implements OpenUpService { 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()); } @@ -65,6 +67,9 @@ public class OpenUpServiceImpl implements OpenUpService { if (!departmentStaffs.success()){ throw new RenException(ModuleConstant.ERROR_GOV_ORG_DEPARTMENT); } + if (departmentStaffs.getData().size() == NumConstant.ZERO){ + return new ArrayList<>(); + } List data = this.getStaffList(departmentStaffs.getData()); List result = new ArrayList<>(); data.forEach(staff -> { @@ -89,6 +94,9 @@ public class OpenUpServiceImpl implements OpenUpService { if (!agencyStaffs.success()){ throw new RenException(ModuleConstant.ERROR_GOV_ORG_AGENCY); } + if (agencyStaffs.getData().size() == NumConstant.ZERO){ + return new ArrayList<>(); + } List staffList = this.getStaffList(agencyStaffs.getData()); List result = new ArrayList<>(); staffList.forEach(staff -> { diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index dbd11097bd..2ada6a69a3 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -191,7 +191,7 @@ public interface GovOrgOpenFeignClient { * @author zxc * @date 2020/8/13 10:46 上午 */ - @PostMapping(value = "/gov/org/customerstaffgrid/getgridstaffs",consumes = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(value = "/gov/org/customerstaffgrid/getgridstaffs") Result> getGridStaffs(@RequestBody CommonGridIdFormDTO gridIdFormDTO); /** @@ -200,7 +200,7 @@ public interface GovOrgOpenFeignClient { * @author zxc * @date 2020/8/13 2:46 下午 */ - @PostMapping(value = "/gov/org/customerstaffdepartment/getdepartmentstaffs",consumes = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(value = "/gov/org/customerstaffdepartment/getdepartmentstaffs") Result> getDepartmentStaffs(@RequestBody DepartmentIdFormDTO formDTO); /** @@ -209,7 +209,7 @@ public interface GovOrgOpenFeignClient { * @author zxc * @date 2020/8/14 9:31 上午 */ - @PostMapping(value = "/gov/org/customergrid/gridcount",consumes = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(value = "/gov/org/customergrid/gridcount") Result selectGridCount(@RequestBody CustomerIdFormDTO customerIdFormDTO); /** @@ -218,6 +218,6 @@ public interface GovOrgOpenFeignClient { * @author zxc * @date 2020/8/17 */ - @PostMapping(value = "/gov/org/customerstaffagency/getagencystaffs",consumes = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(value = "/gov/org/customerstaffagency/getagencystaffs") Result> getAgencyStaffs(@RequestBody AgencyIdFormDTO formDTO); } From 4182141e1a6ba662fc96301ad5a9c5ba81b5b445 Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 18 Aug 2020 09:15:09 +0800 Subject: [PATCH 041/119] plugin staffINfo --- .../epmet/dto/result/ExtDeptResultDTO.java | 26 +++++++++++++++++++ .../epmet/dto/result/ExtGridResultDTO.java | 8 +++++- .../result/ExtStaffPermissionResultDTO.java | 21 ++++++++++++++- .../epmet/service/CustomerAgencyService.java | 9 +++++++ .../impl/CustomerAgencyServiceImpl.java | 17 ++++++++++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 10 +++++++ .../EpmetUserOpenFeignClientFallback.java | 5 ++++ .../StaffAgencyVisitedController.java | 13 ++++++++++ .../service/StaffAgencyVisitedService.java | 9 +++++++ .../impl/StaffAgencyVisitedServiceImpl.java | 16 ++++++++++++ 10 files changed, 132 insertions(+), 2 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtDeptResultDTO.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtDeptResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtDeptResultDTO.java new file mode 100644 index 0000000000..4b0d67ca35 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtDeptResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 部门信息 + * @ClassName ExtDeptResultDTO + * @Auth wangc + * @Date 2020-08-17 17:16 + */ +@Data +public class ExtDeptResultDTO implements Serializable { + private static final long serialVersionUID = 1792371558965832432L; + + /** + * 部门Id + * */ + private String deptId; + + /** + * 部门名称 + * */ + private String deptName; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java index ed36458a9f..018c298c50 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java @@ -5,7 +5,7 @@ import lombok.Data; import java.io.Serializable; /** - * @Description + * @Description 网格信息 * @ClassName ExtGridResultDTO * @Auth wangc * @Date 2020-08-17 15:28 @@ -14,7 +14,13 @@ import java.io.Serializable; public class ExtGridResultDTO implements Serializable { private static final long serialVersionUID = -4531574240525562587L; + /** + * 网格Id + * */ private String gridId; + /** + * 网格名称 + * */ private String gridName; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java index b74504ddcf..1083e7b8be 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java @@ -6,7 +6,7 @@ import java.io.Serializable; import java.util.List; /** - * @Description + * @Description 工作人员数据权限 * @ClassName ExtStaffPermissionResultDTO * @Auth wangc * @Date 2020-08-17 15:24 @@ -15,9 +15,28 @@ import java.util.List; public class ExtStaffPermissionResultDTO implements Serializable { private static final long serialVersionUID = 2513553862809278219L; + /** + * 直属机关Id + * */ private String agencyId; + /** + * 直属机关名称 + * */ private String agencyName; + /** + * 直属机关直属网格列表 + * */ private List gridList; + + /** + * 直属机关直属部门列表 + * */ + private List departmentList; + + /** + * 子集机关列表 + * */ + private List subAgencyList; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index b6746c59f3..62b527e6ba 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -187,4 +187,13 @@ public interface CustomerAgencyService extends BaseService * @date 2020.08.17 09:29 **/ ExtStaffInfoResultDTO staffInfoExt(ExtStaffInfoResultDTO result); + + /** + * @Description 根据staffId,查询当前这个用户的数据权限 + * @param staffId + * @return + * @author wangc + * @date 2020.08.17 17:30 + **/ + ExtStaffPermissionResultDTO staffPermissionExt(String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index ba856bda8b..f069bfcf2f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -871,6 +871,23 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl agency = + epmetUserOpenFeignClient.latestAgency(staffId); + + //2.根据此agencyId查询数据权限 + + return null; + } public void mergeObject(T origin, T destination) { diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index e627d868a9..993ce13ae6 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -268,4 +268,14 @@ public interface EpmetUserOpenFeignClient { */ @PostMapping("epmetuser/customerstaff/getstaffinfolist") Result> getStaffInfoList(@RequestBody UserIdsFormDTO formDTO); + + /** + * @Description 根绝staffId查询最近一次(既当前)登录到的AgencyId + * @param staffId + * @return + * @author wangc + * @date 2020.08.17 17:45 + **/ + @GetMapping("/epmet/staffagencyvisited/latestagency/{staffId}") + Result latestAgency(@PathVariable("staffId") String staffId); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index f434996933..25203c9549 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -188,4 +188,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result> getStaffInfoList(UserIdsFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffInfoList", formDTO); } + + @Override + public Result latestAgency(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "latestAgency", staffId); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java index 488a103ef0..69ffa0ebd8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java @@ -62,4 +62,17 @@ public class StaffAgencyVisitedController { return staffAgencyVisitedService.saveStaffLoginRecord(formDTO); } + + /** + * @Description 根绝staffId查询最近一次(既当前)登录到的AgencyId + * @param staffId + * @return + * @author wangc + * @date 2020.08.17 17:45 + **/ + @GetMapping(value = "latestagency/{staffId}") + public Result latestAgency(@PathVariable("staffId") String staffId){ + return new Result().ok(staffAgencyVisitedService.getLatestStaffAgencyId(staffId)); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java index 71622dfa4a..d70addb077 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java @@ -114,4 +114,13 @@ public interface StaffAgencyVisitedService extends BaseService Date: Tue, 18 Aug 2020 10:37:00 +0800 Subject: [PATCH 042/119] =?UTF-8?q?=E5=85=B3=E9=97=AD=E8=AF=9D=E9=A2=98?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B7=B2=E8=A7=A3=E5=86=B3=E6=9C=AA=E8=A7=A3?= =?UTF-8?q?=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resi/group/dto/topic/form/ResiTopicOperationFormDTO.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicOperationFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicOperationFormDTO.java index 3dffb22abe..47ca98ae7b 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicOperationFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicOperationFormDTO.java @@ -29,9 +29,6 @@ public class ResiTopicOperationFormDTO implements Serializable { /** * 是否解决(已解决 resolved,未解决 unresolved) */ - @NotBlank(message = "解决状态不能为空") private String closedStatus; - - } From bbf5b9188e7d258ef08b93bcb728b55c870d23fa Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 18 Aug 2020 10:44:59 +0800 Subject: [PATCH 043/119] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov-project-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/gov-project/gov-project-server/pom.xml | 2 +- .../oper-customize-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/oper-customize/oper-customize-server/pom.xml | 2 +- .../resi-group/resi-group-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/resi-group/resi-group-server/pom.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml index b676654e4b..c41495a74f 100644 --- a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml +++ b/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.41 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.42 ports: - "8102:8102" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-project/gov-project-server/pom.xml b/epmet-module/gov-project/gov-project-server/pom.xml index b9102ce049..82aafceac9 100644 --- a/epmet-module/gov-project/gov-project-server/pom.xml +++ b/epmet-module/gov-project/gov-project-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.41 + 0.3.42 gov-project com.epmet diff --git a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml index 21d31ea187..b24d1e6910 100644 --- a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml +++ b/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 # 使用现有网络 diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index d6ce7700ad..6951a3f92d 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.26 + 0.3.27 com.epmet oper-customize diff --git a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml index 82c760eeb0..29a259a5d2 100644 --- a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml +++ b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-group-server: container_name: resi-group-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/resi-group-server:0.3.65 + image: 192.168.1.130:10080/epmet-cloud-dev/resi-group-server:0.3.66 ports: - "8095:8095" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-group/resi-group-server/pom.xml b/epmet-module/resi-group/resi-group-server/pom.xml index f93bd8bc88..eaef30f6e7 100644 --- a/epmet-module/resi-group/resi-group-server/pom.xml +++ b/epmet-module/resi-group/resi-group-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.65 + 0.3.66 com.epmet resi-group From 183e22182bdbdca76ff5277a5254f66f5933f1e0 Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 18 Aug 2020 14:30:39 +0800 Subject: [PATCH 044/119] =?UTF-8?q?=E5=AF=B9=E5=A4=96=E6=8E=A5=E5=8F=A3=20?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E4=BA=BA=E5=91=98=E7=9A=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9D=83=E9=99=90=EF=BC=8C=E6=97=A2=E6=89=80=E5=9C=A8=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E4=BB=A5=E5=8F=8A=E4=B8=8B=E7=BA=A7=20ResiTopicOperat?= =?UTF-8?q?ionFormDTO=E5=8E=BB=E6=8E=89=E4=B8=8D=E5=BF=85=E8=A6=81?= =?UTF-8?q?=E7=9A=84@NotBlank?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/ExtStaffPermissionResultDTO.java | 7 +- .../controller/CustomerAgencyController.java | 12 ++++ .../java/com/epmet/dao/CustomerAgencyDao.java | 28 ++++++++ .../impl/CustomerAgencyServiceImpl.java | 14 +++- .../resources/mapper/CustomerAgencyDao.xml | 72 +++++++++++++++++++ .../topic/form/ResiTopicOperationFormDTO.java | 2 +- 6 files changed, 129 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java index 1083e7b8be..8408c42dbf 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.result; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.List; /** @@ -28,15 +29,15 @@ public class ExtStaffPermissionResultDTO implements Serializable { /** * 直属机关直属网格列表 * */ - private List gridList; + private List gridList = new ArrayList<>(); /** * 直属机关直属部门列表 * */ - private List departmentList; + private List departmentList = new ArrayList<>(); /** * 子集机关列表 * */ - private List subAgencyList; + private List subAgencyList = new ArrayList<>(); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index c4cf4008e0..eda5db2edf 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -205,4 +205,16 @@ public class CustomerAgencyController { Result staffInfoExt(@RequestBody ExtStaffInfoResultDTO result){ return new Result().ok(customerAgencyService.staffInfoExt(result)); } + + /** + * @Description 根据staffId,查询当前这个用户的数据权限,对外接口 + * @param staffId + * @return + * @author wangc + * @date 2020.08.17 17:30 + **/ + @PostMapping("permissionext/{staffId}") + Result staffPermissionExt(@PathVariable(value = "staffId") String staffId){ + return new Result().ok(customerAgencyService.staffPermissionExt(staffId)); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index 4b22c60245..26ec50ed8e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -133,4 +133,32 @@ public interface CustomerAgencyDao extends BaseDao { * @date 2020.08.17 09:50 **/ ExtStaffInfoResultDTO selectAgencyAndGridInfoExt(@Param("gridId") String gridId); + + /** + * @Description 根据agencyId查找指定机构的信息,直属网格、部门 + * @param agencyId + * @return + * @author wangc + * @date 2020.08.18 13:41 + **/ + ExtStaffPermissionResultDTO selectAgencyById(@Param("agencyId")String agencyId); + + /** + * @Description 根绝agencyId查找其下属机构的信息 + * @param pid + * @return + * @author wangc + * @date 2020.08.18 13:42 + **/ + List selectSubAgencyByPid(@Param("pid") String pid); + + /** + * @Description 根据agencyId查找指定机构直属的部门,将grid与dept分开是因为grid与dept的数量可能不等,造成重复数据无法去重 + * @param agencyId + * @return + * @author wangc + * @date 2020.08.18 13:42 + **/ + List selectDeptList(@Param("agencyId") String agencyId); + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index f069bfcf2f..69b292364e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -880,13 +880,23 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl agency = epmetUserOpenFeignClient.latestAgency(staffId); - + if(agency.success() && StringUtils.isNotBlank(agency.getData())){ //2.根据此agencyId查询数据权限 + ExtStaffPermissionResultDTO res = baseDao.selectAgencyById(agency.getData()); + return res; + }else{ + logger.error("com.epmet.service.impl.CustomerAgencyServiceImpl.staffPermissionExt,没有找到工作人员最近一次登陆的Agency信息,用户Id:{}",staffId); + ExtStaffPermissionResultDTO emptyResult = new ExtStaffPermissionResultDTO(); + checkFieldAndSetDefault(emptyResult); + return emptyResult; + } + + - return null; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index ffcb626923..93136b2e1a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -186,4 +186,76 @@ gridd.DEL_FLAG = '0' AND gridd.ID = #{gridId} + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicOperationFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicOperationFormDTO.java index 3dffb22abe..de32937a93 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicOperationFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicOperationFormDTO.java @@ -29,7 +29,7 @@ public class ResiTopicOperationFormDTO implements Serializable { /** * 是否解决(已解决 resolved,未解决 unresolved) */ - @NotBlank(message = "解决状态不能为空") + //@NotBlank(message = "解决状态不能为空") private String closedStatus; From 082250cb7dd335776a4fdfb825685c92bc53e7dd Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 18 Aug 2020 15:05:05 +0800 Subject: [PATCH 045/119] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=8F=82?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/FunctionDetailResultDTO.java | 4 ++-- .../impl/CustomerFunctionDetailServiceImpl.java | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionDetailResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionDetailResultDTO.java index debdfc6016..ebbcd3ea9b 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionDetailResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionDetailResultDTO.java @@ -44,7 +44,7 @@ public class FunctionDetailResultDTO implements Serializable { private String dispalyOrder; /** - * 自定义json(目前是空值) + * 自定义json(目前是空值)【集合对象经过urlencode转化】 */ - private ArrayList customerParameter; + private String customerParameter; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java index faa4fa72df..c1b20c5f75 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java @@ -21,6 +21,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; @@ -42,6 +44,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -125,6 +128,16 @@ public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl%s,所属端->%s", formDTO.getCustomerId(), formDTO.getClientType())); List list = baseDao.selectFunctionDetailList(formDTO); + try { + String join = String.join(",", new ArrayList<>()); + String customerParameter = java.net.URLEncoder.encode(join, "utf-8"); + list.forEach(l->{ + l.setCustomerParameter(customerParameter); + }); + } catch (Exception e) { + logger.error("CustomerFunctionDetailServiceImpl.resiAndWorkFunctionDetail->集合参数URLEncode失败"); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); + } return list; } From b905d4765e16acdafe0ea97b21d0697fd6d8e189 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 19 Aug 2020 00:38:40 +0800 Subject: [PATCH 046/119] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E8=AF=B7=E6=B1=82=E9=89=B4=E6=9D=83=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-commons-extapp-auth/pom.xml | 54 ++++++++++ .../annotation/ExternalAppRequestAuth.java | 32 ++++++ .../aspect/ExternalAppRequestAuthAspect.java | 99 +++++++++++++++++++ .../bean/ExternalAppRequestParam.java | 12 +++ .../tools/exception/EpmetErrorCode.java | 1 + .../epmet/commons/tools/redis/RedisKeys.java | 9 ++ epmet-commons/pom.xml | 1 + .../data-report/data-report-server/pom.xml | 5 + .../epmet/controller/test/TestController.java | 19 ++++ .../dto/form/ExternalAppAuthFormDTO.java | 18 ++++ .../dto/result/ExternalAppAuthResultDTO.java | 10 ++ .../EpmetCommonServiceOpenFeignClient.java | 13 ++- ...tCommonServiceOpenFeignClientFallback.java | 7 ++ .../common-service-server/pom.xml | 6 ++ .../controller/ExternalAppController.java | 39 ++++++++ .../java/com/epmet/dao/ExternalAppDao.java | 33 +++++++ .../com/epmet/dao/ExternalAppSecretDao.java | 43 ++++++++ .../com/epmet/entity/ExternalAppEntity.java | 51 ++++++++++ .../epmet/entity/ExternalAppSecretEntity.java | 51 ++++++++++ .../epmet/service/ExternalAppAuthService.java | 9 ++ .../service/ExternalAppSecretService.java | 28 ++++++ .../com/epmet/service/ExternalAppService.java | 27 +++++ .../impl/ExternalAppAuthServiceImpl.java | 83 ++++++++++++++++ .../impl/ExternalAppSecretServiceImpl.java | 31 ++++++ .../service/impl/ExternalAppServiceImpl.java | 33 +++++++ .../externalapp/ExtAppJwtTokenUtils.java | 92 +++++++++++++++++ .../main/resources/mapper/ExternalAppDao.xml | 19 ++++ .../resources/mapper/ExternalAppSecretDao.xml | 37 +++++++ 28 files changed, 861 insertions(+), 1 deletion(-) create mode 100644 epmet-commons/epmet-commons-extapp-auth/pom.xml create mode 100644 epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/annotation/ExternalAppRequestAuth.java create mode 100644 epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java create mode 100644 epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/bean/ExternalAppRequestParam.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/test/TestController.java create mode 100644 epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalAppAuthFormDTO.java create mode 100644 epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ExternalAppAuthResultDTO.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppSecretDao.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/ExternalAppEntity.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/ExternalAppSecretEntity.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppAuthService.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppSecretService.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppAuthServiceImpl.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppSecretServiceImpl.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppSecretDao.xml diff --git a/epmet-commons/epmet-commons-extapp-auth/pom.xml b/epmet-commons/epmet-commons-extapp-auth/pom.xml new file mode 100644 index 0000000000..de7060d57f --- /dev/null +++ b/epmet-commons/epmet-commons-extapp-auth/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + + + com.epmet + epmet-commons + 2.0.0 + + + epmet-commons-extapp-auth + jar + + + 6.0.17.Final + 3.7 + 1.3.3 + 2.6 + 4.6.1 + 4.1.0 + 2.9.9 + 1.2.60 + 2.8.6 + 1.11.3 + 1.18.4 + + + + + org.springframework.boot + spring-boot-starter-web + provided + + + org.springframework.boot + spring-boot-starter-aop + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + com.epmet + common-service-client + 2.0.0 + + + + + ${project.artifactId} + + + diff --git a/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/annotation/ExternalAppRequestAuth.java b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/annotation/ExternalAppRequestAuth.java new file mode 100644 index 0000000000..c71ca89816 --- /dev/null +++ b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/annotation/ExternalAppRequestAuth.java @@ -0,0 +1,32 @@ +/** + * Copyright 2018 人人开源 http://www.renren.io + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.epmet.commons.extappauth.annotation; + +import java.lang.annotation.*; + +/** + * 需要认证的外部请求 + * @Author wxz + * @Description + * @Date 2020/4/23 16:17 + **/ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface ExternalAppRequestAuth { + +} diff --git a/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java new file mode 100644 index 0000000000..db9dc79da3 --- /dev/null +++ b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java @@ -0,0 +1,99 @@ +package com.epmet.commons.extappauth.aspect; + + +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.ExternalAppAuthFormDTO; +import com.epmet.dto.result.ExternalAppAuthResultDTO; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import org.apache.commons.lang3.StringUtils; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.reflect.MethodSignature; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +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; +import java.lang.reflect.Parameter; + +/** + * 外部应用请求认证切面 + */ +@Aspect +@Component +@Order(100) +public class ExternalAppRequestAuthAspect { + + private static Logger logger = LoggerFactory.getLogger(ExternalAppRequestAuthAspect.class); + + public static final String ACCESS_TOKEN_HEADER_KEY = "access_token"; + public static final String APP_ID_HEADER_KEY = "appId"; + + @Autowired + private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + + /** + * 拦截加了ExternalRequestAuth注解的方法 + * + * @param point + * @throws Throwable + */ + @Before("@annotation(com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth)") + public void auth(JoinPoint point) throws Throwable { + HttpServletRequest request = getRequest(); + String token = request.getHeader(ACCESS_TOKEN_HEADER_KEY); + String appId = request.getHeader(APP_ID_HEADER_KEY); + + if (StringUtils.isAnyBlank(token, appId)) { + throw new RenException("请求头中的token和appId不能为空"); + } + + logger.info("外部应用请求认证拦截Aspect执行,appId:{}, token:{}", appId, token); + + ExternalAppAuthFormDTO form = new ExternalAppAuthFormDTO(); + form.setAppId(appId); + form.setToken(token); + Result result = commonServiceOpenFeignClient.externalAppAuth(form); + if (result == null) { + throw new RenException("调用external鉴权服务,返回null"); + } + if (!result.success()) { + throw new RenException(result.getInternalMsg()); + } + ExternalAppAuthResultDTO authResult = result.getData(); + if (!authResult.getSuccess()) { + throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_AUTH_ERROR.getCode(), + result.getData().getMessage()); + } + + + // header参数赋值 + MethodSignature signature = (MethodSignature) point.getSignature(); + Parameter[] parameters = signature.getMethod().getParameters(); + if (parameters != null && parameters.length != 0) { + for (int i = 0; i < parameters.length; i++) { + if (parameters[i].getType() == ExternalAppRequestParam.class) { + ExternalAppRequestParam requestParam = (ExternalAppRequestParam) point.getArgs()[i]; + requestParam.setAppId(appId); + requestParam.setCustomerId(authResult.getCustomerId()); + } + } + } + } + + public HttpServletRequest getRequest() { + RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); + ServletRequestAttributes sra = (ServletRequestAttributes) requestAttributes; + return sra.getRequest(); + } + +} diff --git a/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/bean/ExternalAppRequestParam.java b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/bean/ExternalAppRequestParam.java new file mode 100644 index 0000000000..97ebf3c2c6 --- /dev/null +++ b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/bean/ExternalAppRequestParam.java @@ -0,0 +1,12 @@ +package com.epmet.commons.extappauth.bean; + +import lombok.Data; + +/** + * 外部应用请求信息 + */ +@Data +public class ExternalAppRequestParam { + private String customerId; + private String appId; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index fbbeebccbf..716dc7f885 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -99,6 +99,7 @@ public enum EpmetErrorCode { OPER_ADD_CUSTOMER_MANAGER_ERROR(8706, "新增客户管理员失败"), OPER_UPLOAD_FILE_OVER_SIZE(8707, "文件体积过大"), OPER_UPLOAD_FILE_TYPE_ERROR(8708, "文件类型错误"), + OPER_EXTERNAL_APP_AUTH_ERROR(8709, "外部应用鉴权失败"), // 党建声音 前端提示 88段 DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"), diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index bf7c8f1a83..a5be29eb58 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -288,4 +288,13 @@ public class RedisKeys { public static String getVolunteerSmsCodeKey(String phone) { return String.format(rootPrefix+"smscode:regvolunteer:%s",phone); } + + /** + * 外部应用的secret key + * @param appId + * @return + */ + public static String getExternalAppSecretKey(String appId) { + return String.format(rootPrefix+"externalapp:secret:%s",appId); + } } diff --git a/epmet-commons/pom.xml b/epmet-commons/pom.xml index 3f25f5b1b5..d4b8e270b4 100644 --- a/epmet-commons/pom.xml +++ b/epmet-commons/pom.xml @@ -22,6 +22,7 @@ epmet-commons-tools-wx-ma epmet-commons-tools-wx-mp epmet-commons-service-call + epmet-commons-extapp-auth diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 7f96938c28..a859f98664 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -62,6 +62,11 @@ 0.3.1 + + com.epmet + epmet-commons-extapp-auth + 2.0.0 + diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/test/TestController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/test/TestController.java new file mode 100644 index 0000000000..a16df89c2a --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/test/TestController.java @@ -0,0 +1,19 @@ +package com.epmet.controller.test; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("test") +public class TestController { + + @ExternalAppRequestAuth + @RequestMapping("/test") + public Result test(ExternalAppRequestParam externalAppRequestParam, String ext) { + return new Result().ok("调用成功,客户信息:"+externalAppRequestParam); + } + +} diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalAppAuthFormDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalAppAuthFormDTO.java new file mode 100644 index 0000000000..2d6470db80 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalAppAuthFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.form; + +import lombok.Data; + +@Data +public class ExternalAppAuthFormDTO { + + /** + * 应用ID + */ + private String appId; + + /** + * token字符串 + */ + private String token; + +} diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ExternalAppAuthResultDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ExternalAppAuthResultDTO.java new file mode 100644 index 0000000000..ff7e76dd1e --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ExternalAppAuthResultDTO.java @@ -0,0 +1,10 @@ +package com.epmet.dto.result; + +import lombok.Data; + +@Data +public class ExternalAppAuthResultDTO { + private Boolean success; + private String message; + private String customerId; +} diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java index be5117fbf1..896dfde000 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java @@ -2,7 +2,9 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.ExternalAppAuthFormDTO; import com.epmet.dto.form.WorkDayFormDTO; +import com.epmet.dto.result.ExternalAppAuthResultDTO; import com.epmet.dto.result.WorkDayResultDTO; import com.epmet.feign.fallback.EpmetCommonServiceOpenFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; @@ -17,7 +19,8 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 10:28 */ -@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class) +//@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class) +@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class, url = "http://localhost:8103") public interface EpmetCommonServiceOpenFeignClient { /** * @param formDTO @@ -28,4 +31,12 @@ public interface EpmetCommonServiceOpenFeignClient { **/ @PostMapping("commonservice/workday/detentiondays") Result> detentionDays(@RequestBody List formDTO); + + /** + * 外部应用认证接口 + * @param formDTO + * @return + */ + @PostMapping("/commonservice/externalapp/auth") + Result externalAppAuth(@RequestBody ExternalAppAuthFormDTO formDTO); } diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java index 2a83a94bfc..555e502062 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java @@ -3,7 +3,9 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.ExternalAppAuthFormDTO; import com.epmet.dto.form.WorkDayFormDTO; +import com.epmet.dto.result.ExternalAppAuthResultDTO; import com.epmet.dto.result.WorkDayResultDTO; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import org.springframework.stereotype.Component; @@ -22,4 +24,9 @@ public class EpmetCommonServiceOpenFeignClientFallback implements EpmetCommonSer public Result> detentionDays(List formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "detentionDays", formDTO); } + + @Override + public Result externalAppAuth(ExternalAppAuthFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "externalAppAuth", formDTO); + } } diff --git a/epmet-module/epmet-common-service/common-service-server/pom.xml b/epmet-module/epmet-common-service/common-service-server/pom.xml index a46a1332ee..8b245c5d82 100644 --- a/epmet-module/epmet-common-service/common-service-server/pom.xml +++ b/epmet-module/epmet-common-service/common-service-server/pom.xml @@ -58,6 +58,12 @@ feign-httpclient 10.3.0 + + + io.jsonwebtoken + jjwt + 0.7.0 + diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java new file mode 100644 index 0000000000..98fa8e9fc9 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java @@ -0,0 +1,39 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.ExternalAppAuthFormDTO; +import com.epmet.dto.result.ExternalAppAuthResultDTO; +import com.epmet.service.ExternalAppAuthService; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +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; + +@RestController +@RequestMapping("/externalapp") +public class ExternalAppController { + + private static Logger logger = LoggerFactory.getLogger(ExternalAppController.class); + + @Autowired + private ExternalAppAuthService externalAppAuthService; + + @PostMapping("/auth") + public Result auth(@RequestBody ExternalAppAuthFormDTO formDTO) { + String appId = formDTO.getAppId(); + String token = formDTO.getToken(); + if (StringUtils.isAnyBlank(token, appId)) { + throw new RenException("请求头中的token和appId不能为空"); + } + + logger.info("外部应用请求认证拦截Aspect。appId:{}, token:{}", appId, token); + ExternalAppAuthResultDTO auth = externalAppAuthService.auth(appId, token); + return new Result().ok(auth); + } + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java new file mode 100644 index 0000000000..f07f428cfd --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ExternalAppEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 外部应用列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-18 + */ +@Mapper +public interface ExternalAppDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppSecretDao.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppSecretDao.java new file mode 100644 index 0000000000..f56aa08cb0 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppSecretDao.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ExternalAppSecretEntity; +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-18 + */ +@Mapper +public interface ExternalAppSecretDao extends BaseDao { + + /** + * 查询app对应的秘钥 + * @param appId + * @return + */ + ExternalAppSecretEntity getSecretsByAppId(@Param("appId") String appId); + +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/ExternalAppEntity.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/ExternalAppEntity.java new file mode 100644 index 0000000000..e4a4056108 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/ExternalAppEntity.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 外部应用列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("external_app") +public class ExternalAppEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * APP名字 + */ + private String appName; + + /** + * 客户ID + */ + private String customerId; + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/ExternalAppSecretEntity.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/ExternalAppSecretEntity.java new file mode 100644 index 0000000000..0977e12264 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/ExternalAppSecretEntity.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 外部应用秘钥列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("external_app_secret") +public class ExternalAppSecretEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * APP ID + */ + private String appId; + + /** + * 秘钥 + */ + private String secret; + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppAuthService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppAuthService.java new file mode 100644 index 0000000000..aff79d5f72 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppAuthService.java @@ -0,0 +1,9 @@ +package com.epmet.service; + +import com.epmet.dto.result.ExternalAppAuthResultDTO; + +public interface ExternalAppAuthService { + + ExternalAppAuthResultDTO auth(String appId, String token); + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppSecretService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppSecretService.java new file mode 100644 index 0000000000..7f6be4bd5a --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppSecretService.java @@ -0,0 +1,28 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + + +/** + * 外部应用秘钥列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-18 + */ +public interface ExternalAppSecretService { +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java new file mode 100644 index 0000000000..5799ea0abb --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java @@ -0,0 +1,27 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +/** + * 外部应用列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-18 + */ +public interface ExternalAppService { +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppAuthServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppAuthServiceImpl.java new file mode 100644 index 0000000000..52b82011c9 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppAuthServiceImpl.java @@ -0,0 +1,83 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.dao.ExternalAppSecretDao; +import com.epmet.dto.result.ExternalAppAuthResultDTO; +import com.epmet.entity.ExternalAppSecretEntity; +import com.epmet.service.ExternalAppAuthService; +import com.epmet.utils.externalapp.ExtAppJwtTokenUtils; +import io.jsonwebtoken.Claims; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class ExternalAppAuthServiceImpl implements ExternalAppAuthService { + + private static Logger logger = LoggerFactory.getLogger(ExternalAppAuthServiceImpl.class); + + @Autowired + private RedisUtils redisUtils; + + @Autowired + private ExtAppJwtTokenUtils jwtTokenUtils; + + @Autowired + private ExternalAppSecretDao externalAppSecretDao; + + @Override + public ExternalAppAuthResultDTO auth(String appId, String token) { + String secret; + if (StringUtils.isBlank(secret = getTokenByAppId(appId))) { + return fillAuthResult(false, String.format("根据AppId:%s没有找到对应的秘钥", appId), null); + } + + Claims claim; + try { + claim = jwtTokenUtils.getClaimByToken(token, secret); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error("解析token失败:{}", errorStackTrace); + return fillAuthResult(false, "解析token失败", null); + } + + String appIdIn = (String)claim.get("appId"); + String customerId = (String)claim.get("customerId"); + + if (!appId.equals(appIdIn)) { + logger.error("AppId不对应,token外部的:{}, token内部解析出来的:{}", appId, appIdIn); + return fillAuthResult(false, "Header中的AppId不匹配", null); + } + return fillAuthResult(true, "解析成功", customerId); + } + + /** + * 通过APP ID查询对应的秘钥 + * @param appId + * @return + */ + public String getTokenByAppId(String appId) { + String secret = (String)redisUtils.get(RedisKeys.getExternalAppSecretKey(appId)); + if (StringUtils.isBlank(secret)) { + ExternalAppSecretEntity secretEntity = externalAppSecretDao.getSecretsByAppId(appId); + if (secretEntity == null) { + return null; + } + secret = secretEntity.getSecret(); + redisUtils.set(RedisKeys.getExternalAppSecretKey(appId), secret); + } + return secret; + } + + public ExternalAppAuthResultDTO fillAuthResult(Boolean result, String message, String customerId) { + ExternalAppAuthResultDTO authResult = new ExternalAppAuthResultDTO(); + authResult.setSuccess(result); + authResult.setMessage(message); + authResult.setCustomerId(customerId); + return authResult; + } +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppSecretServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppSecretServiceImpl.java new file mode 100644 index 0000000000..567baf3fb2 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppSecretServiceImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.epmet.service.ExternalAppSecretService; +import org.springframework.stereotype.Service; +/** + * 外部应用秘钥列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-18 + */ +@Service +public class ExternalAppSecretServiceImpl implements ExternalAppSecretService { + +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java new file mode 100644 index 0000000000..1621e74e2d --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.epmet.service.ExternalAppService; +import org.springframework.stereotype.Service; + +/** + * 外部应用列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-18 + */ +@Service +public class ExternalAppServiceImpl implements ExternalAppService { + + +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java new file mode 100644 index 0000000000..8ef9a4cde4 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.epmet.utils.externalapp; + +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.SignatureAlgorithm; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * Jwt工具类 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Component +public class ExtAppJwtTokenUtils { + + private static final Logger logger = LoggerFactory.getLogger(ExtAppJwtTokenUtils.class); + + public Claims getClaimByToken(String token, String secret) { + return Jwts.parser() + .setSigningKey(secret) + .parseClaimsJws(token) + .getBody(); + } + + public Claims tryGetClaimByToken(String token, String secret) { + try { + return Jwts.parser() + .setSigningKey(secret) + .parseClaimsJws(token) + .getBody(); + } catch (Exception e) { + logger.debug("validate is token error, token = " + token, e); + return null; + } + } + + public String createToken(Map map, String secret) { + return Jwts.builder() + .setHeaderParam("typ", "JWT") + .setClaims(map) + .setIssuedAt(new Date()) +// .setExpiration(DateTime.now().plusSeconds(jwtProperties.getExpire()).toDate()) + .signWith(SignatureAlgorithm.HS512, secret) + .compact(); + } + +// /** +// * token是否过期 +// * +// * @return true:过期 +// */ +// public boolean isTokenExpired(Date expiration) { +// return expiration.before(new Date()); +// } + + public static void main(String[] args) { + genToken(); +// getClaim(); + } + + public static void genToken() { + HashMap claim = new HashMap<>(); + claim.put("appId", "1"); +// claim.put("customerId", "c1"); + + String abc = new ExtAppJwtTokenUtils().createToken(claim, "4a762660254c57996343f8ee42fbc0a6"); + System.out.println(abc); + } + + public static void getClaim() { + String token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHBJZCI6IjEiLCJjdXN0b21lcklkIjoiYzEiLCJpYXQiOjE1OTc3NDI2NTB9.09Vop0Nobg3LENAJoAZaCUKtgAjADAK48BS11ky3YdAp6h-cXYtGeqUxbgvE_4F6239rc7UE2fjxtEvMuWEJuA"; + + Claims claimByToken = new ExtAppJwtTokenUtils().getClaimByToken(token, "4a762660254c57996343f8ee42fbc0a6"); + System.out.println(claimByToken); + } + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml new file mode 100644 index 0000000000..8662bc5f97 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppSecretDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppSecretDao.xml new file mode 100644 index 0000000000..e207a36013 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppSecretDao.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 43e7e3f406b6f39ccc7b94756e7c9accb9256866 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 19 Aug 2020 09:23:44 +0800 Subject: [PATCH 047/119] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common-service-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/epmet-common-service/common-service-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml index 18920f1ad9..430a9a8dda 100644 --- a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: common-service-server: container_name: common-service-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/common-service-server:0.3.9 + image: 192.168.1.130:10080/epmet-cloud-dev/common-service-server:0.3.10 ports: - "8103:8103" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-common-service/common-service-server/pom.xml b/epmet-module/epmet-common-service/common-service-server/pom.xml index a46a1332ee..2b13593563 100644 --- a/epmet-module/epmet-common-service/common-service-server/pom.xml +++ b/epmet-module/epmet-common-service/common-service-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.9 + 0.3.10 com.epmet epmet-common-service From 9b80e654e9c29e7cb117707ad7646c0def5e3d15 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 19 Aug 2020 09:31:05 +0800 Subject: [PATCH 048/119] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index ee379a6b7a..dcbdbc44dc 100644 --- a/pom.xml +++ b/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + org.springframework.boot spring-boot-starter-parent From 0f47a87aefab9df12aa6444a1fab1acaa78f8812 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 19 Aug 2020 09:59:07 +0800 Subject: [PATCH 049/119] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E6=8F=90=E4=BA=A4-FeignClient#url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/feign/EpmetCommonServiceOpenFeignClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java index 896dfde000..d23de0c0e2 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java @@ -19,8 +19,8 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 10:28 */ -//@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class) -@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class, url = "http://localhost:8103") +@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class) +//@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class, url = "http://localhost:8103") public interface EpmetCommonServiceOpenFeignClient { /** * @param formDTO From 4376693053ac2f835e536eb79e436a92706f362f Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 19 Aug 2020 10:04:12 +0800 Subject: [PATCH 050/119] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common-service-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/epmet-common-service/common-service-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml index 18920f1ad9..d1b7844a39 100644 --- a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: common-service-server: container_name: common-service-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/common-service-server:0.3.9 + image: 192.168.1.130:10080/epmet-cloud-dev/common-service-server:0.3.11 ports: - "8103:8103" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-common-service/common-service-server/pom.xml b/epmet-module/epmet-common-service/common-service-server/pom.xml index 8b245c5d82..597eb77772 100644 --- a/epmet-module/epmet-common-service/common-service-server/pom.xml +++ b/epmet-module/epmet-common-service/common-service-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.9 + 0.3.11 com.epmet epmet-common-service From 3633df39b4c3f94d16b176caa8644b21616284a2 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 19 Aug 2020 10:13:36 +0800 Subject: [PATCH 051/119] =?UTF-8?q?=E5=8D=87=E7=BA=A7ext?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/epmet-ext/epmet-ext-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml index 58cd450f0f..6ea35c4e01 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ 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 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-ext-server:0.0.2 ports: - "8113:8113" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-ext/epmet-ext-server/pom.xml b/epmet-module/epmet-ext/epmet-ext-server/pom.xml index 5a9047f096..ab999ea3dc 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/pom.xml +++ b/epmet-module/epmet-ext/epmet-ext-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.1 + 0.0.2 com.epmet From 098605dae6d02feb077b28a854daf7c775a31a81 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 19 Aug 2020 10:14:55 +0800 Subject: [PATCH 052/119] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/OpenUpController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java index 68f854f8dc..1f29c98390 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java @@ -13,6 +13,7 @@ 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; /** From 66aa7bfba5c40ae540b33baf1cb0e01675064e36 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 19 Aug 2020 13:36:58 +0800 Subject: [PATCH 053/119] =?UTF-8?q?=E5=A4=96=E9=83=A8=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E9=89=B4=E6=9D=83=E5=A2=9E=E5=8A=A0=E6=97=B6=E9=97=B4=E6=88=B3?= =?UTF-8?q?=E5=88=A4=E6=96=AD=EF=BC=8C=E5=85=81=E8=AE=B85=E5=88=86?= =?UTF-8?q?=E9=92=9F=E4=B9=8B=E5=86=85=E7=9A=84=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ExternalAppAuthServiceImpl.java | 23 +++++++++++++++++++ .../externalapp/ExtAppJwtTokenUtils.java | 3 ++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppAuthServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppAuthServiceImpl.java index 52b82011c9..283b7b41ef 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppAuthServiceImpl.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppAuthServiceImpl.java @@ -29,6 +29,8 @@ public class ExternalAppAuthServiceImpl implements ExternalAppAuthService { @Autowired private ExternalAppSecretDao externalAppSecretDao; + private int diffMillins = 1000 * 60 * 5; + @Override public ExternalAppAuthResultDTO auth(String appId, String token) { String secret; @@ -47,6 +49,18 @@ public class ExternalAppAuthServiceImpl implements ExternalAppAuthService { String appIdIn = (String)claim.get("appId"); String customerId = (String)claim.get("customerId"); + Long timestamp = (Long)claim.get("ts"); + + //校验时间戳,允许5分钟误差 + if (StringUtils.isAnyBlank(appIdIn, customerId) || timestamp == null) { + logger.error("access token不完整。{},{},{}", appIdIn, customerId, timestamp); + return fillAuthResult(false, "access token不完整。", null); + } + + if (!validTimeStamp(timestamp)) { + logger.error("服务器存在时差过大,请求被拒绝", appId, appIdIn); + return fillAuthResult(false, "服务器存在时差过大,请求被拒绝", null); + } if (!appId.equals(appIdIn)) { logger.error("AppId不对应,token外部的:{}, token内部解析出来的:{}", appId, appIdIn); @@ -55,6 +69,15 @@ public class ExternalAppAuthServiceImpl implements ExternalAppAuthService { return fillAuthResult(true, "解析成功", customerId); } + private boolean validTimeStamp(Long timestamp) { + long now = System.currentTimeMillis(); +// System.out.println(new Date(timestamp)); + if (Math.abs(now - timestamp) > diffMillins) { + return false; + } + return true; + } + /** * 通过APP ID查询对应的秘钥 * @param appId diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java index 8ef9a4cde4..7355f867cd 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java @@ -76,7 +76,8 @@ public class ExtAppJwtTokenUtils { public static void genToken() { HashMap claim = new HashMap<>(); claim.put("appId", "1"); -// claim.put("customerId", "c1"); + claim.put("customerId", "c1"); + claim.put("ts", System.currentTimeMillis() - 1000 * 60 * 4); String abc = new ExtAppJwtTokenUtils().createToken(claim, "4a762660254c57996343f8ee42fbc0a6"); System.out.println(abc); From f6dfb8a4f8b7288c633fec0e63c70080ca62270b Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 19 Aug 2020 13:38:29 +0800 Subject: [PATCH 054/119] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common-service-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/epmet-common-service/common-service-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml index d1b7844a39..4ae7d2be99 100644 --- a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: common-service-server: container_name: common-service-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/common-service-server:0.3.11 + image: 192.168.1.130:10080/epmet-cloud-dev/common-service-server:0.3.12 ports: - "8103:8103" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-common-service/common-service-server/pom.xml b/epmet-module/epmet-common-service/common-service-server/pom.xml index 597eb77772..7075f4f328 100644 --- a/epmet-module/epmet-common-service/common-service-server/pom.xml +++ b/epmet-module/epmet-common-service/common-service-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.11 + 0.3.12 com.epmet epmet-common-service From 43ba212539edb7ebbcfd01a94be84914e4ed245d Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 19 Aug 2020 14:07:46 +0800 Subject: [PATCH 055/119] =?UTF-8?q?=E5=A2=9E=E5=8A=A0url=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E7=99=BD=E5=90=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/filter/CpAuthGatewayFilterFactory.java | 8 ++++++++ .../src/main/java/com/epmet/filter/CpProperty.java | 5 +++++ epmet-gateway/src/main/resources/bootstrap.yml | 6 ++++++ 3 files changed, 19 insertions(+) diff --git a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java index 7aec3a7f6f..43fbf6d0cb 100644 --- a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java +++ b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java @@ -208,11 +208,19 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory urls; + /** + * 白名单 + */ + private List urlWhiteList; + /** * 不处理token,直接通过 */ diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index c2105542bb..0e8c054d2e 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -427,6 +427,12 @@ epmet: - /gov/issue/** - /gov/project/** - /resi/home/** + - /data/report/** + + # url认证白名单,先判断白名单,在白名单中的url直接放行,不再判断上述需要认证的名单 + urlWhiteList: + - /data/report/test/test + swaggerUrls: jwt: From 33e1c53468f0fb3edfe991506ae566bfad7ee893 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 19 Aug 2020 14:09:39 +0800 Subject: [PATCH 056/119] =?UTF-8?q?=E5=A2=9E=E5=8A=A0url=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E7=99=BD=E5=90=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/deploy/docker-compose-dev.yml | 2 +- epmet-gateway/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-gateway/deploy/docker-compose-dev.yml b/epmet-gateway/deploy/docker-compose-dev.yml index de78c36557..82a1bb2c15 100644 --- a/epmet-gateway/deploy/docker-compose-dev.yml +++ b/epmet-gateway/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-gateway-server: container_name: epmet-gateway-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.31 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.32 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 3b7d156962..d595ba019c 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.31 + 0.3.32 com.epmet epmet-cloud From 9f7e267b461c46b798c525139088ba82c7d69e53 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 19 Aug 2020 15:08:38 +0800 Subject: [PATCH 057/119] =?UTF-8?q?=E5=A4=96=E9=83=A8=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E4=BF=AE=E6=94=B9=E8=AF=B7=E6=B1=82=E5=A4=B4?= =?UTF-8?q?=E7=9A=84key=E4=B8=BA=E9=A9=BC=E5=B3=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aspect/ExternalAppRequestAuthAspect.java | 2 +- .../dto/form/ExternalCustomerFormDTO.java | 15 ++++++ .../dto/result/ExternalCustomerResultDTO.java | 46 ++++++++++++++++++ .../controller/ExternalAppController.java | 5 ++ .../ExternalCustomerController.java | 47 +++++++++++++++++++ .../com/epmet/dao/ExternalCustomerDao.java | 41 ++++++++++++++++ .../epmet/entity/ExternalCustomerEntity.java | 46 ++++++++++++++++++ .../service/ExternalCustomerService.java | 11 +++++ .../impl/ExternalCustomerServiceImpl.java | 26 ++++++++++ .../externalapp/ExtAppJwtTokenUtils.java | 2 +- .../resources/mapper/ExternalCustomerDao.xml | 29 ++++++++++++ 11 files changed, 268 insertions(+), 2 deletions(-) create mode 100644 epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalCustomerFormDTO.java create mode 100644 epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ExternalCustomerResultDTO.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalCustomerController.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalCustomerDao.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/ExternalCustomerEntity.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalCustomerService.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalCustomerServiceImpl.java create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalCustomerDao.xml diff --git a/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java index db9dc79da3..e64f678937 100644 --- a/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java +++ b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java @@ -35,7 +35,7 @@ public class ExternalAppRequestAuthAspect { private static Logger logger = LoggerFactory.getLogger(ExternalAppRequestAuthAspect.class); - public static final String ACCESS_TOKEN_HEADER_KEY = "access_token"; + public static final String ACCESS_TOKEN_HEADER_KEY = "AccessToken"; public static final String APP_ID_HEADER_KEY = "appId"; @Autowired diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalCustomerFormDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalCustomerFormDTO.java new file mode 100644 index 0000000000..da8c394aea --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalCustomerFormDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; + +@Data +public class ExternalCustomerFormDTO { + + @Min(0) + private Integer pageNo; + + @Min(0) + private Integer pageSize; +} diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ExternalCustomerResultDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ExternalCustomerResultDTO.java new file mode 100644 index 0000000000..79e58686fe --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ExternalCustomerResultDTO.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +public class ExternalCustomerResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String id; + + /** + * 客户名称 + */ + private String customerName; + +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java index 98fa8e9fc9..1e627e5de8 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java @@ -23,6 +23,11 @@ public class ExternalAppController { @Autowired private ExternalAppAuthService externalAppAuthService; + /** + * 外部请求认证 + * @param formDTO + * @return + */ @PostMapping("/auth") public Result auth(@RequestBody ExternalAppAuthFormDTO formDTO) { String appId = formDTO.getAppId(); diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalCustomerController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalCustomerController.java new file mode 100644 index 0000000000..e5ae0ae464 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalCustomerController.java @@ -0,0 +1,47 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.ExternalAppAuthFormDTO; +import com.epmet.dto.form.ExternalCustomerFormDTO; +import com.epmet.dto.result.ExternalAppAuthResultDTO; +import com.epmet.service.ExternalAppAuthService; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +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 javax.validation.constraints.Min; + +/** + * 外部客户管理 + */ +@RestController +@RequestMapping("/externalcustomer") +public class ExternalCustomerController { + + private static Logger logger = LoggerFactory.getLogger(ExternalCustomerController.class); + + @Autowired + private ExternalAppAuthService externalAppAuthService; + + /** + * 外部客户管理 + * @return + */ + @PostMapping("/list") + public Result list(@RequestBody ExternalCustomerFormDTO form) { + ValidatorUtils.validateEntity(form); + Integer pageNo = form.getPageNo(); + Integer pageSize = form.getPageSize(); + + + return null; + } + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalCustomerDao.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalCustomerDao.java new file mode 100644 index 0000000000..b22be4caf9 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalCustomerDao.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ExternalCustomerResultDTO; +import com.epmet.entity.ExternalCustomerEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Mapper +public interface ExternalCustomerDao extends BaseDao { + + /** + * 列出客户基本信息 + * @return + */ + List listBaseInfo(); +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/ExternalCustomerEntity.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/ExternalCustomerEntity.java new file mode 100644 index 0000000000..fccfbbb6a1 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/ExternalCustomerEntity.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("external_customer") +public class ExternalCustomerEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户名称 + */ + private String customerName; + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalCustomerService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalCustomerService.java new file mode 100644 index 0000000000..bcc8d10cc6 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalCustomerService.java @@ -0,0 +1,11 @@ +package com.epmet.service; + +import com.epmet.dto.result.ExternalCustomerResultDTO; + +import java.util.List; + +public interface ExternalCustomerService { + + public List list(Integer pageNo, Integer pageSize); + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalCustomerServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalCustomerServiceImpl.java new file mode 100644 index 0000000000..9925841b0f --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalCustomerServiceImpl.java @@ -0,0 +1,26 @@ +package com.epmet.service.impl; + +import com.epmet.dao.ExternalCustomerDao; +import com.epmet.dto.result.ExternalCustomerResultDTO; +import com.epmet.service.ExternalCustomerService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class ExternalCustomerServiceImpl implements ExternalCustomerService { + + @Autowired + private ExternalCustomerDao externalCustomerDao; + + @Override + public List list(Integer pageNo, Integer pageSize) { + PageHelper.startPage(pageNo, pageSize); + List customers = externalCustomerDao.listBaseInfo(); + PageInfo pageInfo = new PageInfo<>(customers); + return null; + } +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java index 7355f867cd..1c3a326c75 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java @@ -75,7 +75,7 @@ public class ExtAppJwtTokenUtils { public static void genToken() { HashMap claim = new HashMap<>(); - claim.put("appId", "1"); + claim.put("appId", "227fb75ae4baa820755aaf43bf7f0a69"); claim.put("customerId", "c1"); claim.put("ts", System.currentTimeMillis() - 1000 * 60 * 4); diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalCustomerDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalCustomerDao.xml new file mode 100644 index 0000000000..9d59a01224 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalCustomerDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From cc67d269d48b3af7d2ce30465db01aa1c18799b6 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 19 Aug 2020 15:40:44 +0800 Subject: [PATCH 058/119] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=88=B3=E6=A0=A1=E9=AA=8C=EF=BC=8C=E4=BE=BF?= =?UTF-8?q?=E4=BA=8E=E8=B0=83=E8=AF=95=E3=80=82=E4=B8=8A=E7=BA=BF=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E6=89=93=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/ExternalAppAuthServiceImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppAuthServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppAuthServiceImpl.java index 283b7b41ef..822e654cbb 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppAuthServiceImpl.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppAuthServiceImpl.java @@ -57,10 +57,11 @@ public class ExternalAppAuthServiceImpl implements ExternalAppAuthService { return fillAuthResult(false, "access token不完整。", null); } - if (!validTimeStamp(timestamp)) { - logger.error("服务器存在时差过大,请求被拒绝", appId, appIdIn); - return fillAuthResult(false, "服务器存在时差过大,请求被拒绝", null); - } + // TODO +// if (!validTimeStamp(timestamp)) { +// logger.error("服务器存在时差过大,请求被拒绝", appId, appIdIn); +// return fillAuthResult(false, "服务器存在时差过大,请求被拒绝", null); +// } if (!appId.equals(appIdIn)) { logger.error("AppId不对应,token外部的:{}, token内部解析出来的:{}", appId, appIdIn); From c392477af4f2bbf28605f32a09d298f00ee25e36 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 19 Aug 2020 15:41:53 +0800 Subject: [PATCH 059/119] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common-service-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/epmet-common-service/common-service-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml index 4ae7d2be99..dcebebb14a 100644 --- a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: common-service-server: container_name: common-service-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/common-service-server:0.3.12 + image: 192.168.1.130:10080/epmet-cloud-dev/common-service-server:0.3.13 ports: - "8103:8103" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-common-service/common-service-server/pom.xml b/epmet-module/epmet-common-service/common-service-server/pom.xml index 7075f4f328..4bdfe6988b 100644 --- a/epmet-module/epmet-common-service/common-service-server/pom.xml +++ b/epmet-module/epmet-common-service/common-service-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.12 + 0.3.13 com.epmet epmet-common-service From 2d62693687e1ca310d82cddac5ae8e4e5fd37de3 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 19 Aug 2020 15:50:50 +0800 Subject: [PATCH 060/119] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=88=97=E8=A1=A8?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/UpdateCustomerFormDTO.java | 38 ++++++++++ .../dto/result/CustomerListResultDTO.java | 66 +++++++++++++++++ .../epmet/controller/CustomerController.java | 31 ++++++-- .../main/java/com/epmet/dao/CustomerDao.java | 14 ++-- .../com/epmet/service/CustomerService.java | 23 ++++-- .../service/impl/CustomerServiceImpl.java | 70 +++++++++++++++++-- .../src/main/resources/mapper/CustomerDao.xml | 17 +++++ .../dto/form/UpdateRootManageFormDTO.java | 31 ++++++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 10 +++ .../EpmetUserOpenFeignClientFallback.java | 5 ++ .../controller/CustomerStaffController.java | 13 ++++ .../java/com/epmet/dao/CustomerStaffDao.java | 10 +++ .../epmet/service/CustomerStaffService.java | 9 +++ .../impl/CustomerStaffServiceImpl.java | 11 +++ .../resources/mapper/CustomerStaffDao.xml | 14 ++++ 15 files changed, 346 insertions(+), 16 deletions(-) create mode 100644 epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/UpdateCustomerFormDTO.java create mode 100644 epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerListResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UpdateRootManageFormDTO.java diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/UpdateCustomerFormDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/UpdateCustomerFormDTO.java new file mode 100644 index 0000000000..e4627c7134 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/UpdateCustomerFormDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/19 10:53 + */ +@NoArgsConstructor +@Data +public class UpdateCustomerFormDTO implements Serializable { + + private static final long serialVersionUID = 1296290251616658023L; + /** + * 客户ID + */ + private String customerId; + /** + * 客户名 + */ + private String customerName; + /** + * logo + */ + private String logo; + /** + * 根管理员姓名 + */ + private String rootManageName; + /** + * 根管理员电话 + */ + private String rootManagePhone; +} diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerListResultDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerListResultDTO.java new file mode 100644 index 0000000000..3d08316bb9 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerListResultDTO.java @@ -0,0 +1,66 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/19 9:53 + */ +@NoArgsConstructor +@Data +public class CustomerListResultDTO implements Serializable { + + private static final long serialVersionUID = -2167406082548134982L; + /** + * 客户id + */ + private String customerId; + /** + * 客户名称 + */ + private String customerName; + /** + * 产品标题 显示在产品顶端的标题 + */ + private String title; + /** + * 有效期 + */ + private String validityTime; + /** + * 客户组织级别:0.省级,1市级,2.区县级,3.乡镇街道级 字典表key:organizationlevel + */ + private String organizationLevels; + /** + * 客户logo + */ + private String logo; + /** + * 客户允许创建的网格数 + */ + private Integer gridNumber; + /** + * 跟管理员姓名 + */ + private String rootManageName; + /** + * 跟管理员电话 + */ + private String rootManagePhone; + /** + * 省份 + */ + private String province; + /** + * 城市 + */ + private String city; + /** + * 区县 + */ + private String county; +} diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java index 0369274a34..a1ef57aaab 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java @@ -31,10 +31,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; 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.dto.result.*; import com.epmet.excel.CustomerExcel; import com.epmet.feign.GovOrgFeignClient; import com.epmet.service.CustomerService; @@ -279,4 +276,30 @@ public class CustomerController { ValidatorUtils.validateEntity(formDTO, CustomerIdFormDTO.Customer.class); return new Result().ok(customerService.getCustomer(formDTO)); } + + /** + * 获取crm客户列表 + * @author zhaoqifeng + * @date 2020/8/19 10:46 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("customerlist") + public Result> customerList(@RequestBody PageQueryFormDTO formDTO) { + List result = customerService.customerList(formDTO); + return new Result>().ok(result); + } + + /** + * 修改客户信息 + * @author zhaoqifeng + * @date 2020/8/19 15:23 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("updatecustomer") + public Result updateCustomer(@RequestBody UpdateCustomerFormDTO formDTO) { + customerService.updateCustomer(formDTO); + return new Result(); + } } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java index 6c21743bbb..b7aed8f55a 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java @@ -19,10 +19,7 @@ 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.dto.result.*; import com.epmet.entity.CustomerEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -92,4 +89,13 @@ public interface CustomerDao extends BaseDao { */ CustomerInfoResultDTO selectCustomerBasicInfo(@Param("customerId")String customerId); + /** + * 获取crm客户列表 + * @author zhaoqifeng + * @date 2020/8/19 10:17 + * @param customerName + * @return java.util.List + */ + List selectAllCustomerList(@Param("customerName") String customerName); + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java index cf32a13308..5953f53e64 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java @@ -22,10 +22,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; 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.dto.result.*; import com.epmet.entity.CustomerEntity; import org.springframework.web.bind.annotation.RequestBody; @@ -189,4 +186,22 @@ public interface CustomerService extends BaseService { * @date 2020/8/14 9:08 上午 */ CustomerInfoResultDTO getCustomer( CustomerIdFormDTO formDTO); + + /** + * 获取crm客户列表 + * @author zhaoqifeng + * @date 2020/8/19 10:12 + * @param formDTO + * @return com.epmet.dto.result.CustomerListResultDTO + */ + List customerList(PageQueryFormDTO formDTO); + + /** + * 客户基本信息修改 + * @author zhaoqifeng + * @date 2020/8/19 10:58 + * @param formDTO + * @return void + */ + void updateCustomer(UpdateCustomerFormDTO formDTO); } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java index 51364b48d9..a85bbadc5a 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java @@ -38,10 +38,7 @@ import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.CustomerEntity; -import com.epmet.feign.EpmetUserFeignClient; -import com.epmet.feign.GovOrgFeignClient; -import com.epmet.feign.GovOrgOpenFeignClient; -import com.epmet.feign.OperCustomizeFeignClient; +import com.epmet.feign.*; import com.epmet.redis.CustomerRedis; import com.epmet.service.CustomerService; import com.github.pagehelper.PageHelper; @@ -79,6 +76,8 @@ public class CustomerServiceImpl extends BaseServiceImpl page(Map params) { @@ -576,4 +575,67 @@ public class CustomerServiceImpl extends BaseServiceImpl customerList(PageQueryFormDTO formDTO) { + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()) + .doSelectPageInfo(() -> baseDao.selectAllCustomerList(formDTO.getCustomerName())); + List list = pageInfo.getList(); + if(null != list) { + list.forEach(dto -> { + // 根级组织 + Result customerRootAgencyRst = govOrgFeignClient.getCustomerRootAgency(dto.getCustomerId()); + if (!customerRootAgencyRst.success()) { + throw new RenException("查询客户详情:查询客户根级组织失败:".concat(customerRootAgencyRst.toString())); + } + CustomerAgencyDTO agency = customerRootAgencyRst.getData(); + + // 管理员 + GovStaffRoleResultDTO manager = new GovStaffRoleResultDTO(); + if (agency != null) { + StaffRoleFormDTO staffsInRoleForm = new StaffRoleFormDTO(); + staffsInRoleForm.setOrgId(agency.getId()); + staffsInRoleForm.setRoleKey(RoleKeyConstants.ROLE_KEY_ROOT_MANAGER); + Result> managersResult = epmetUserFeignClient.getStaffsInRole(staffsInRoleForm); + if (!managersResult.success() || null == managersResult.getData() || managersResult.getData().size() == NumConstant.ZERO) { + throw new RenException("查询客户详情:查询客户管理员失败:".concat(managersResult.toString())); + } + manager = managersResult.getData().get(NumConstant.ZERO); + dto.setProvince(agency.getProvince()); + dto.setCity(agency.getCity()); + dto.setCounty(agency.getDistrict()); + dto.setRootManageName(manager.getRealName()); + dto.setRootManagePhone(manager.getMobile()); + } + }); + } + return list; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateCustomer(UpdateCustomerFormDTO formDTO) { + CustomerEntity entity = new CustomerEntity(); + entity.setId(formDTO.getCustomerId()); + entity.setCustomerName(formDTO.getCustomerName()); + entity.setLogo(formDTO.getLogo()); + baseDao.updateById(entity); + if (StringUtils.isNotBlank(formDTO.getRootManageName()) || StringUtils.isNotBlank(formDTO.getRootManagePhone())) { + // 根级组织 + Result customerRootAgencyRst = govOrgFeignClient.getCustomerRootAgency(formDTO.getCustomerId()); + if (!customerRootAgencyRst.success() || null == customerRootAgencyRst.getData()) { + throw new RenException("客户基本信息修改:查询客户根级组织失败:".concat(customerRootAgencyRst.toString())); + } + CustomerAgencyDTO agency = customerRootAgencyRst.getData(); + UpdateRootManageFormDTO updateRootManageFormDTO = new UpdateRootManageFormDTO(); + updateRootManageFormDTO.setOrgId(agency.getId()); + updateRootManageFormDTO.setRoleKey(RoleKeyConstants.ROLE_KEY_ROOT_MANAGER); + updateRootManageFormDTO.setRootManageName(formDTO.getRootManageName()); + updateRootManageFormDTO.setRootManagePhone(formDTO.getRootManagePhone()); + Result rootManageResult = epmetUserOpenFeignClient.updateRootManage(updateRootManageFormDTO); + if (!rootManageResult.success()) { + throw new RenException("客户基本信息修改:修改根管理员信息失败:".concat(rootManageResult.toString())); + } + } + } + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml index 33c0dd52e2..46e35aa218 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml @@ -102,4 +102,21 @@ del_flag = 0 AND id = #{customerId} + + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UpdateRootManageFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UpdateRootManageFormDTO.java new file mode 100644 index 0000000000..9f30b5e4eb --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UpdateRootManageFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/19 14:20 + */ +@Data +public class UpdateRootManageFormDTO implements Serializable { + private static final long serialVersionUID = 3954225931981940018L; + /** + * 根组织ID + */ + private String orgId; + /** + * 角色key + */ + private String roleKey; + /** + * 根管理员姓名 + */ + private String rootManageName; + /** + * 根管理员电话 + */ + private String rootManagePhone; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 993ce13ae6..52de280ea0 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -278,4 +278,14 @@ public interface EpmetUserOpenFeignClient { **/ @GetMapping("/epmet/staffagencyvisited/latestagency/{staffId}") Result latestAgency(@PathVariable("staffId") String staffId); + + /** + * 修改根管理员信息 + * @author zhaoqifeng + * @date 2020/8/19 14:31 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("epmetuser/customerstaff/updaterootmanage") + Result updateRootManage(@RequestBody UpdateRootManageFormDTO formDTO); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 25203c9549..55856e42ea 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -193,4 +193,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result latestAgency(String staffId) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "latestAgency", staffId); } + + @Override + public Result updateRootManage(UpdateRootManageFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "updateRootManage", formDTO); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index 8d94810e84..a752e8b884 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -346,4 +346,17 @@ public class CustomerStaffController { ValidatorUtils.validateEntity(staffParam, CommonStaffIdFormDTO.StaffIdGroup.class); return new Result().ok(customerStaffService.extStaffInfo(staffParam)); } + + /** + * 修改根管理员信息 + * @author zhaoqifeng + * @date 2020/8/19 14:31 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("updaterootmanage") + public Result updateRootManage(@RequestBody UpdateRootManageFormDTO formDTO) { + customerStaffService.updateRootManage(formDTO); + return new Result(); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index fefa18a1d7..41c7a550e6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -162,4 +162,14 @@ public interface CustomerStaffDao extends BaseDao { * @date 2020.08.17 13:26 **/ ExtStaffInfoResultDTO selectStaffInfoExt(@Param("staffId") String staffId); + + /** + * 获取根管理员信息 + * @author zhaoqifeng + * @date 2020/8/19 14:14 + * @param orgId + * @param roleKey + * @return com.epmet.dto.CustomerStaffDTO + */ + CustomerStaffDTO selectRootManage(@Param("orgId") String orgId, @Param("roleKey") String roleKey); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java index 055d456159..3a49fc6f2d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java @@ -275,4 +275,13 @@ public interface CustomerStaffService extends BaseService { * @date 2020.08.17 10:30 **/ ExtStaffInfoResultDTO extStaffInfo(CommonStaffIdFormDTO staffParam); + + /** + * 修改根管理员信息 + * @author zhaoqifeng + * @date 2020/8/19 14:11 + * @param formDTO + * @return com.epmet.dto.CustomerStaffDTO + */ + void updateRootManage(UpdateRootManageFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 162299581e..0ebbbc0afa 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -599,4 +599,15 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl + + \ No newline at end of file From b6cff2739e37a6e0be58d1f01cc01ff56b324746 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 19 Aug 2020 16:21:26 +0800 Subject: [PATCH 061/119] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E9=89=B4=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/form/StaffSinAgencyFormDTO.java | 6 ------ .../main/java/com/epmet/dto/form/StaffSinDeptFormDTO.java | 6 ------ .../main/java/com/epmet/dto/form/StaffSinGridFormDTO.java | 6 ------ .../main/java/com/epmet/controller/OpenUpController.java | 4 ++++ 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinAgencyFormDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinAgencyFormDTO.java index 5e166ac342..0403bf52b1 100644 --- a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinAgencyFormDTO.java +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinAgencyFormDTO.java @@ -17,12 +17,6 @@ public class StaffSinAgencyFormDTO implements Serializable { //后端自己看 public interface StaffSinAgency{} - /** - * appId+customerId+时间戳加密secret - */ -// @NotBlank(message = "secret不能为空",groups = {StaffSinDept.class}) - private String accessToken; - /** * 机关Id */ diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinDeptFormDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinDeptFormDTO.java index b66de79686..3e69297c27 100644 --- a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinDeptFormDTO.java +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinDeptFormDTO.java @@ -17,12 +17,6 @@ public class StaffSinDeptFormDTO implements Serializable { //后端自己看 public interface StaffSinDept{} - /** - * appId+customerId+时间戳加密secret - */ -// @NotBlank(message = "secret不能为空",groups = {StaffSinDept.class}) - private String accessToken; - /** * 部门Id */ diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinGridFormDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinGridFormDTO.java index a694dfddb1..8b93d60979 100644 --- a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinGridFormDTO.java +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinGridFormDTO.java @@ -18,12 +18,6 @@ public class StaffSinGridFormDTO implements Serializable { //后端自己看 public interface StaffSinGrid{} - /** - * appId+customerId+时间戳加密secret - */ -// @NotBlank(message = "secret不能为空",groups = {StaffSinGrid.class}) - private String accessToken; - /** * 网格Id */ diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java index 1f29c98390..b5849f78dc 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java @@ -1,5 +1,6 @@ package com.epmet.controller; +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.*; @@ -33,6 +34,7 @@ public class OpenUpController { * @author zxc * @date 2020/8/13 9:42 上午 */ + @ExternalAppRequestAuth @PostMapping("staffsingrid") public Result> staffSinGrid(@RequestBody StaffSinGridFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, StaffSinGridFormDTO.StaffSinGrid.class); @@ -45,6 +47,7 @@ public class OpenUpController { * @author zxc * @date 2020/8/13 9:51 上午 */ + @ExternalAppRequestAuth @PostMapping("staffsindept") public Result> staffSinDept(@RequestBody StaffSinDeptFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, StaffSinDeptFormDTO.StaffSinDept.class); @@ -57,6 +60,7 @@ public class OpenUpController { * @author zxc * @date 2020/8/17 9:59 上午 */ + @ExternalAppRequestAuth @PostMapping("staffsinagency") public Result> staffSinAgency(@RequestBody StaffSinAgencyFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, StaffSinAgencyFormDTO.StaffSinAgency.class); From db5ffbe1633a91efd6d9e1c9974aea55ba75d97d Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 19 Aug 2020 16:24:08 +0800 Subject: [PATCH 062/119] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E9=89=B4=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-ext/epmet-ext-server/pom.xml | 31 +++---------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/epmet-module/epmet-ext/epmet-ext-server/pom.xml b/epmet-module/epmet-ext/epmet-ext-server/pom.xml index 5a9047f096..f6ffa2b775 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/pom.xml +++ b/epmet-module/epmet-ext/epmet-ext-server/pom.xml @@ -26,6 +26,11 @@ epmet-ext-client 2.0.0 + + com.epmet + epmet-commons-extapp-auth + 2.0.0 + com.epmet epmet-commons-tools @@ -133,38 +138,12 @@ 3.6.0 compile - - com.epmet - epmet-common-clienttoken - 2.0.0 - compile - - - com.epmet - oper-crm-client - 2.0.0 - compile - - - com.epmet - epmet-oss-client - 2.0.0 - compile - org.springframework spring-test 5.1.12.RELEASE compile - - - - com.aliyun - alibaba-dingtalk-service-sdk - 1.0.1 - - From 038aa4044132de698a9cc0e40116ab76942c6a99 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 19 Aug 2020 16:59:01 +0800 Subject: [PATCH 063/119] =?UTF-8?q?=E8=BF=90=E8=90=A5=E7=AB=AF=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E5=AE=9A=E5=88=B6=E5=8C=96=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/UpdateCustomerParameterFormDTO.java | 31 +++++ .../dto/result/CustomerInfoResultDTO.java | 10 +- .../com/epmet/constant/ModuleConstant.java | 8 ++ .../epmet/controller/CustomerController.java | 25 ++++ .../com/epmet/service/CustomerService.java | 17 ++- .../service/impl/CustomerServiceImpl.java | 61 +++++++++- .../src/main/resources/mapper/CustomerDao.xml | 3 +- .../com/epmet/dto/FunctionCustomizedDTO.java | 2 +- .../form/CustomerFunctionCollectFormDTO.java | 36 ++++++ .../form/updatedisplayorderListFormDTO.java | 36 ++++++ ...stomerFunctionCustomizedListResultDTO.java | 28 +++++ .../epmet/dto/result/CustomerResultDTO.java | 38 ++++++ .../epmet/dto/result/FunctionResultDTO.java | 74 ++++++++++++ .../CustomerFunctionDetailController.java | 44 ++++++- .../epmet/dao/CustomerFunctionDetailDao.java | 25 ++++ .../com/epmet/dao/FunctionCustomizedDao.java | 18 +++ .../epmet/excel/FunctionCustomizedExcel.java | 2 +- .../CustomerFunctionDetailService.java | 30 ++++- .../CustomerFunctionDetailServiceImpl.java | 108 ++++++++++++++++-- .../V0.0.4__add_customer_function_detail.sql | 4 +- .../mapper/CustomerFunctionDetailDao.xml | 74 ++++++++++++ .../mapper/FunctionCustomizedDao.xml | 32 ++++++ 22 files changed, 683 insertions(+), 23 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/UpdateCustomerParameterFormDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFunctionCollectFormDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/updatedisplayorderListFormDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFunctionCustomizedListResultDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerResultDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionResultDTO.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/UpdateCustomerParameterFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/UpdateCustomerParameterFormDTO.java new file mode 100644 index 0000000000..f522bfab50 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/UpdateCustomerParameterFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 修改客户网格数和有效期-接口入参 + * @Author sun + */ +@Data +public class UpdateCustomerParameterFormDTO implements Serializable { + + private static final long serialVersionUID = 4512080710854617599L; + /** + * 客户Id + */ + @NotBlank(message = "customerId不能为空",groups = {Customer.class}) + private String customerId; + /** + * 有效期 + */ + private String validityTime; + /** + * 最大允许创建网格数 + */ + private Integer gridNumber; + + public interface Customer{} +} diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoResultDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoResultDTO.java index c47b3514c2..95047cf9e9 100644 --- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoResultDTO.java +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoResultDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.result; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** * @Author zxc @@ -23,14 +24,19 @@ public class CustomerInfoResultDTO implements Serializable { */ private String customerName; + /** + * 有效期 + */ + private Date validityTime; + /** * 已创建网格数 */ - private Integer createGridNum; + private Integer createGridNumber; /** * 最大允许创建数 */ - private Integer maxGridNum; + private Integer maxGridNumber; } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/constant/ModuleConstant.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/constant/ModuleConstant.java index 3363344d1a..c78e0e799e 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/constant/ModuleConstant.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/constant/ModuleConstant.java @@ -8,4 +8,12 @@ public interface ModuleConstant { String ERROR_GOV_ORG_COUNT = "调用gov_org服务【查询客户下网格数量】失败"; + String SELECT_CUSTOMER_ERROR = "根据客户Id查询客户基本信息失败"; + + String GRID_NUMBER_ERROR = "最大网格数不能小于之前设定数"; + + String VALIDITY_TIME_ERROR = "客户有效期不能早于之前设定值"; + + String UPDATE_CUSTOMER_ERROR = "更新客户基本信息失败"; + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java index a1ef57aaab..6ad634df60 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java @@ -41,6 +41,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import java.text.ParseException; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -302,4 +303,28 @@ public class CustomerController { customerService.updateCustomer(formDTO); return new Result(); } + + /** + * @param formDTO + * @Description 获取客户最大网格数和有效期 + * @author sun + */ + @PostMapping("getcustomerparameter") + public Result getCustomerParameter(@RequestBody CustomerIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, CustomerIdFormDTO.Customer.class); + return new Result().ok(customerService.getCustomerParameter(formDTO)); + } + + /** + * @param formDTO + * @Description 修改客户网格数和有效期 + * @author sun + */ + @PostMapping("updatecustomerparameter") + public Result updateCustomerParameter(@RequestBody UpdateCustomerParameterFormDTO formDTO) throws ParseException { + ValidatorUtils.validateEntity(formDTO, UpdateCustomerParameterFormDTO.Customer.class); + customerService.updateCustomerParameter(formDTO); + return new Result(); + } + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java index 5953f53e64..b194421d06 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java @@ -24,8 +24,8 @@ import com.epmet.dto.CustomerDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.CustomerEntity; -import org.springframework.web.bind.annotation.RequestBody; +import java.text.ParseException; import java.util.List; import java.util.Map; @@ -204,4 +204,19 @@ public interface CustomerService extends BaseService { * @return void */ void updateCustomer(UpdateCustomerFormDTO formDTO); + + /** + * @param formDTO + * @Description 获取客户最大网格数和有效期 + * @author sun + */ + CustomerInfoResultDTO getCustomerParameter( CustomerIdFormDTO formDTO); + + /** + * @param formDTO + * @Description 修改客户网格数和有效期 + * @author sun + */ + void updateCustomerParameter(UpdateCustomerParameterFormDTO formDTO) throws ParseException; + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java index a85bbadc5a..673f676fd9 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java @@ -51,6 +51,8 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -571,7 +573,7 @@ public class CustomerServiceImpl extends BaseServiceImpl result = govOrgOpenFeignClient.selectGridCount(formDTO); + if (!result.success()){ + throw new RenException(ModuleConstant.ERROR_GOV_ORG_COUNT); + } + CustomerGridCountResultDTO resultDTO = result.getData(); + customerInfoResultDTO.setCreateGridNumber(resultDTO.getGridCount()); + + return customerInfoResultDTO; + } + + + /** + * @param formDTO + * @Description 修改客户网格数和有效期 + * @author sun + */ + @Override + public void updateCustomerParameter(UpdateCustomerParameterFormDTO formDTO) throws ParseException { + //1.查询客户基本信息 + CustomerEntity entity = baseDao.selectById(formDTO.getCustomerId()); + if (null == entity) { + throw new RenException(ModuleConstant.SELECT_CUSTOMER_ERROR); + } + //2.校验数据合格性 + if (entity.getGridNumber() > formDTO.getGridNumber()) { + throw new RenException(ModuleConstant.GRID_NUMBER_ERROR); + } + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); + Date dt1 = df.parse(formDTO.getValidityTime()); + Date dt2 = entity.getValidityTime(); + if (dt1.getTime() < dt2.getTime()) { + throw new RenException(ModuleConstant.VALIDITY_TIME_ERROR); + } + //3.更新数据 + CustomerEntity customerEntity = new CustomerEntity(); + customerEntity.setId(formDTO.getCustomerId()); + customerEntity.setGridNumber(formDTO.getGridNumber()); + customerEntity.setValidityTime(dt1); + if (baseDao.updateById(customerEntity) < NumConstant.ONE) { + throw new RenException(ModuleConstant.UPDATE_CUSTOMER_ERROR); + } + } + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml index 46e35aa218..b1d219013a 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml @@ -95,7 +95,8 @@ SELECT id AS customerId, customer_name AS customerName, - IFNULL( grid_number, 0 ) AS maxGridNum + IFNULL( grid_number, 0 ) AS maxGridNumber, + validity_time AS validityTime FROM customer WHERE diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedDTO.java index cd924cc5c5..9fb059d520 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedDTO.java @@ -96,7 +96,7 @@ public class FunctionCustomizedDTO implements Serializable { /** * 业务域名 */ - private String realmName; + private String domainName; /** * 来源app(政府端:gov、居民端:resi) diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFunctionCollectFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFunctionCollectFormDTO.java new file mode 100644 index 0000000000..b29c199c3a --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFunctionCollectFormDTO.java @@ -0,0 +1,36 @@ +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; + +/** + * @Description 运营端-定制功能采集-接口入参 + * @Author sun + */ +@Data +public class CustomerFunctionCollectFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 客户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 reason; + + public interface AddUserInternalGroup {} + + public interface AddUserShowGroup extends CustomerClientShowGroup {} + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/updatedisplayorderListFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/updatedisplayorderListFormDTO.java new file mode 100644 index 0000000000..c36d1b609e --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/updatedisplayorderListFormDTO.java @@ -0,0 +1,36 @@ +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; + +/** + * @Description 运营端-客户定制功能顺序修改-接口入参 + * @Author sun + */ +@Data +public class updatedisplayorderListFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 客户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 Integer displayOrder; + + public interface AddUserInternalGroup {} + + public interface AddUserShowGroup extends CustomerClientShowGroup {} + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFunctionCustomizedListResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFunctionCustomizedListResultDTO.java new file mode 100644 index 0000000000..4c38302f8d --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFunctionCustomizedListResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Description 运营端-客户定制功能列表-接口返参 + * @Author sun + */ +@Data +public class CustomerFunctionCustomizedListResultDTO implements Serializable { + private static final long serialVersionUID = 2971689193155710437L; + + + /** + * 默认功能列表 + */ + private List customerList = new ArrayList<>(); + + /** + * 定制功能列表 + */ + private List functionList = new ArrayList<>(); + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerResultDTO.java new file mode 100644 index 0000000000..bab2b06442 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerResultDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Description 运营端-客户定制功能列表-接口返参 + * @Author sun + */ +@Data +public class CustomerResultDTO implements Serializable { + private static final long serialVersionUID = 2971689193155710437L; + + /** + * 客户Id + */ + private String customerId; + /** + * 定制功能Id + */ + private String functionId; + /** + * 默认功能名称 + */ + private String customizedName; + /** + * 功能所属端(居民端:resi 工作端:work) + */ + private String fromApp; + /** + * 功能说明 + */ + private String functionExplain; + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionResultDTO.java new file mode 100644 index 0000000000..0fc6777bc1 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionResultDTO.java @@ -0,0 +1,74 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Description 运营端-客户定制功能列表-接口返参 + * @Author sun + */ +@Data +public class FunctionResultDTO implements Serializable { + private static final long serialVersionUID = 2971689193155710437L; + + /** + * 客户Id + */ + private String customerId; + /** + * 定制功能Id + */ + private String functionId; + /** + * 默认功能名称 + */ + private String customizedName; + /** + * 自定义功能名称 + */ + private String functionName; + /** + * 功能所属端(居民端:resi 工作端:work) + */ + private String fromApp; + /** + * 默认大图标 + */ + private String defaultLargeImg; + /** + * 自定义大图标 + */ + private String iconLargeImg; + /** + * 默认小图标 + */ + private String defaultSmallImg; + /** + * 自定义小图标 + */ + private String iconSmallImg; + /** + * 上下架(0:下架、1:上架) + */ + private Integer shoppingStatus; + /** + * 业务域名 + */ + private String domainName; + /** + * 外链地址 + */ + private String targetLink; + /** + * 排序 + */ + private Integer displayOrder; + /** + * 功能说明 + */ + private String functionExplain; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java index 2c174d1c24..42f69d00e2 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java @@ -28,9 +28,8 @@ 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.form.*; +import com.epmet.dto.result.CustomerFunctionCustomizedListResultDTO; import com.epmet.dto.result.FunctionDetailResultDTO; import com.epmet.excel.CustomerFunctionDetailExcel; import com.epmet.service.CustomerFunctionDetailService; @@ -155,4 +154,43 @@ public class CustomerFunctionDetailController { formDTO.setUserId(tokenDto.getUserId()); return customerFunctionDetailService.updateCustomerFunction(formDTO); } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 客户定制功能列表 + **/ + @PostMapping("customerfunctionlist") + public Result customerFunctionList(@LoginUser TokenDto tokenDto, @RequestBody CustomerFunctionListFormDTO formDTO) { + return new Result().ok(customerFunctionDetailService.customerFunctionList(formDTO.getCustomerId())); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 客户定制功能顺序修改 + **/ + @PostMapping("updatedisplayorder") + //public Result updateDisplayOrder(@LoginUser TokenDto tokenDto, @RequestParam("formDTO") List formDTO) { + public Result updateDisplayOrder(@LoginUser TokenDto tokenDto, @RequestBody(required = true) List formDTO) { + customerFunctionDetailService.updateDisplayOrder(tokenDto, formDTO); + return new Result(); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 定制功能采集 + **/ + @PostMapping("customerfunctioncollect") + public Result customerFunctionCollect(@LoginUser TokenDto tokenDto, @RequestBody CustomerFunctionCollectFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, CustomerFunctionCollectFormDTO.AddUserInternalGroup.class, CustomerFunctionCollectFormDTO.AddUserShowGroup.class); + customerFunctionDetailService.customerFunctionCollect(formDTO); + return new Result(); + } + + } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java index 7ee1a99567..1a6572179d 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java @@ -22,6 +22,7 @@ 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.CustomerResultDTO; import com.epmet.dto.result.FunctionDetailResultDTO; import com.epmet.entity.CustomerFunctionDetailEntity; import org.apache.ibatis.annotations.Mapper; @@ -76,4 +77,28 @@ public interface CustomerFunctionDetailDao extends BaseDao selectCustomerFunction(@Param("customerId") String customerId); + + /** + * @param list + * @return + * @Author sun + * @Description 批量更新客户定制功能排序号信息 + **/ + void updateFunctionDetailList(@Param("list") List list); + + /** + * @param customerId + * @return + * @Author sun + * @Description .查询客户当前已有定制功能最大排序号 + **/ + CustomerFunctionDetailDTO selectOrderByCustomerId(@Param("customerId") String customerId); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java index 34b32e48f1..907bfd1595 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java @@ -19,10 +19,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.CustomizedDTO; +import com.epmet.dto.FunctionCustomizedDTO; import com.epmet.dto.form.CommonFunctionIdFormDTO; import com.epmet.dto.form.FunctionCustomizedListFormDTO; import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; import com.epmet.dto.result.FunctionCustomizedListDTO; +import com.epmet.dto.result.FunctionResultDTO; import com.epmet.entity.FunctionCustomizedEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -98,4 +100,20 @@ public interface FunctionCustomizedDao extends BaseDao * @Date 13:26 2020-08-14 **/ void updateFunctionCustomized(FunctionCustomizedEntity entity); + + /** + * @param functionIds + * @return + * @Author sun + * @Description 获取不包含的定制功能列表 + **/ + List selectFunctionCustomizedList(@Param("functionIds") List functionIds); + + /** + * @param functionId + * @return + * @Author sun + * @Description 查询定制功能信息 + **/ + FunctionCustomizedDTO selectByFunctionId(@Param("functionId") String functionId); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedExcel.java index 786705a763..42cc63eaa9 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedExcel.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedExcel.java @@ -68,7 +68,7 @@ public class FunctionCustomizedExcel { private Date updatedTime; @Excel(name = "业务域名") - private String realmName; + private String domainName; @Excel(name = "来源app(政府端:gov、居民端:resi)") private String fromApp; diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java index 3dc099b9ca..7729d60bcd 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java @@ -19,11 +19,11 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerFunctionDetailDTO; -import com.epmet.dto.form.FunctionDetailFromDTO; -import com.epmet.dto.form.UpdateCustomerFunctionFormDTO; -import com.epmet.dto.form.UpdateShoppingStatusFormDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.CustomerFunctionCustomizedListResultDTO; import com.epmet.dto.result.FunctionDetailResultDTO; import com.epmet.entity.CustomerFunctionDetailEntity; @@ -127,4 +127,28 @@ public interface CustomerFunctionDetailService extends BaseService formDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 定制功能采集 + **/ + void customerFunctionCollect(CustomerFunctionCollectFormDTO formDTO); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java index c1b20c5f75..6a1cf4b69e 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java @@ -21,19 +21,26 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +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.dao.CustomerFunctionDetailDao; +import com.epmet.dao.FunctionCustomizedDao; +import com.epmet.dao.FunctionShoppingHistoryDao; import com.epmet.dto.CustomerFunctionDetailDTO; +import com.epmet.dto.FunctionCustomizedDTO; import com.epmet.dto.FunctionShoppingHistoryDTO; -import com.epmet.dto.form.FunctionDetailFromDTO; -import com.epmet.dto.form.UpdateCustomerFunctionFormDTO; -import com.epmet.dto.form.UpdateShoppingStatusFormDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.CustomerFunctionCustomizedListResultDTO; +import com.epmet.dto.result.CustomerResultDTO; import com.epmet.dto.result.FunctionDetailResultDTO; +import com.epmet.dto.result.FunctionResultDTO; import com.epmet.entity.CustomerFunctionDetailEntity; +import com.epmet.entity.FunctionShoppingHistoryEntity; import com.epmet.redis.CustomerFunctionDetailRedis; import com.epmet.service.CustomerFunctionDetailService; import com.epmet.service.FunctionShoppingHistoryService; @@ -44,10 +51,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; /** * 客户定制功能详情表 @@ -61,9 +66,12 @@ public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl page(Map params) { @@ -159,4 +167,88 @@ public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl customerList = baseDao.selectCustomerFunction(customerId); + resultDTO.setCustomerList(customerList); + + //2.获取客户未有定制功能列表 + List functionIds = customerList.stream().map(CustomerResultDTO::getFunctionId).collect(Collectors.toList()); + List functionList = functionCustomizedDao.selectFunctionCustomizedList(functionIds); + resultDTO.setFunctionList(functionList); + functionList.forEach(fl->{ + fl.setCustomerId(customerId); + }); + + return resultDTO; + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 客户定制功能顺序修改 + **/ + @Override + public void updateDisplayOrder(TokenDto tokenDto, List formDTO) { + //批量更新客户定制功能排序号信息 + List list = ConvertUtils.sourceToTarget(formDTO, CustomerFunctionDetailEntity.class); + list.forEach(l->{ + l.setUpdatedBy(tokenDto.getUserId()); + }); + baseDao.updateFunctionDetailList(list); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 定制功能采集 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void customerFunctionCollect(CustomerFunctionCollectFormDTO formDTO) { + //1.查询定制功能详细信息 + FunctionCustomizedDTO functionDTO = functionCustomizedDao.selectByFunctionId(formDTO.getFunctionId()); + if(functionDTO == null){ + throw new RenException("根据定制功能Id未查询到定制功能详细信息"); + } + + //2.查询客户当前已有定制功能最大排序号 + CustomerFunctionDetailDTO detailDTO = baseDao.selectOrderByCustomerId(formDTO.getCustomerId()); + int displayOrder = NumConstant.ONE; + if(null!=detailDTO&&null!=detailDTO.getDisplayOrder()){ + displayOrder += detailDTO.getDisplayOrder(); + } + //3.给客户初始定制功能数据 + CustomerFunctionDetailEntity entity = new CustomerFunctionDetailEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setFunctionId(formDTO.getFunctionId()); + entity.setFunctionName(functionDTO.getFunctionId()); + entity.setIconLargeImg(functionDTO.getIconLargeImg()); + entity.setIconSmallImg(functionDTO.getIconSmallImg()); + entity.setDomainName(functionDTO.getDomainName()); + entity.setTargetLink(functionDTO.getTargetLink()); + entity.setShoppingStatus(NumConstant.ONE); + entity.setDisplayOrder(displayOrder); + baseDao.insert(entity); + + //4.记录上下架操作日志 + FunctionShoppingHistoryEntity historyEntity = new FunctionShoppingHistoryEntity(); + historyEntity.setCustomerId(formDTO.getCustomerId()); + historyEntity.setFunctionId(functionDTO.getFunctionId()); + historyEntity.setShoppingStatus(NumConstant.ONE); + historyEntity.setReason(formDTO.getReason()); + functionShoppingHistoryDao.insert(historyEntity); + + } + } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql index 5e61ca48a2..1c40bddd4c 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql @@ -6,7 +6,7 @@ CREATE TABLE `customer_function_detail` ( `FUNCTION_NAME` varchar(128) NOT NULL COMMENT ''自定义功能名称'', `ICON_LARGE_IMG` varchar(128) NOT NULL COMMENT ''自定义大图标'', `ICON_SMALL_IMG` varchar(128) NOT NULL COMMENT ''自定义小图标'', - `DOMAIN_NAME` varchar(32) NOT NULL COMMENT ''自定义业务域名'', + `DOMAIN_NAME` varchar(32) NOT NULL COMMENT ''自定义业务域名(可设置多个 用分号分隔)'', `TARGET_LINK` varchar(128) NOT NULL COMMENT ''外链地址'', `SHOPPING_STATUS` int(11) NOT NULL COMMENT ''上架状态(0.下架 1.上架)'', `DISPLAY_ORDER` int(11) NOT NULL COMMENT ''自定义排序'', @@ -22,7 +22,7 @@ CREATE TABLE `customer_function_detail` ( ALTER TABLE `function_customized` ADD COLUMN `DOMAIN_NAME` VARCHAR (128) CHARACTER -SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '业务域名' AFTER `UPDATED_TIME`, +SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '业务域名(可设置多个 用分号分隔)' AFTER `UPDATED_TIME`, ADD COLUMN `FROM_APP` VARCHAR (32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '来源app(政府端:gov、居民端:resi)' AFTER `REALM_NAME`; diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml index f215a0d80e..ded8b1514d 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml @@ -49,6 +49,55 @@ cfd.display_order ASC + + + + UPDATE customer_function_detail SET @@ -80,4 +129,29 @@ AND CUSTOMER_ID = #{customerId} AND FUNCTION_ID = #{functionId} + + + UPDATE customer_function_detail + + + + + when customer_id = #{item.customerId} and function_id = #{item.functionId} then #{item.displayOrder} + + + + + + when customer_id = #{item.customerId} and function_id = #{item.functionId} then #{item.updatedBy} + + + + updated_time = now() + + WHERE + del_flag = '0' + + (customer_id = #{item.customerId} and function_id = #{item.functionId}) + + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml index f862114288..99cbf17b15 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml @@ -88,6 +88,38 @@ + + + + UPDATE function_customized SET From fffc5599eff045bc47b452380d6eacc01219dc9f Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 19 Aug 2020 17:16:33 +0800 Subject: [PATCH 064/119] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov-org/gov-org-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/gov-org/gov-org-server/pom.xml | 2 +- .../oper-crm/oper-crm-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/oper-crm/oper-crm-server/pom.xml | 2 +- .../oper-customize-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/oper-customize/oper-customize-server/pom.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml index c682941726..9f415bb98b 100644 --- a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.83 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.84 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index 4ed6f8392a..22edd8308d 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.83 + 0.3.84 com.epmet gov-org diff --git a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml index 108c608acc..9aefc298b6 100644 --- a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml +++ b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-crm-server: container_name: oper-crm-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/oper-crm-server:0.3.66 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-crm-server:0.3.67 ports: - "8090:8090" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-crm/oper-crm-server/pom.xml b/epmet-module/oper-crm/oper-crm-server/pom.xml index 4ae4fb79aa..57471a9ffb 100644 --- a/epmet-module/oper-crm/oper-crm-server/pom.xml +++ b/epmet-module/oper-crm/oper-crm-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.66 + 0.3.67 com.epmet oper-crm diff --git a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml index b24d1e6910..a06dc47c2e 100644 --- a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml +++ b/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.27 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.28 ports: - "8089:8089" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index 6951a3f92d..c71ac357d3 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.27 + 0.3.28 com.epmet oper-customize From 6d3d1f4e6af4a206485ef4336c919c8ff888fb86 Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 19 Aug 2020 17:36:50 +0800 Subject: [PATCH 065/119] ext-plugin --- .../epmet/controller/OpenUpController.java | 48 ++++++++++++++++--- .../epmet/feign/GovOrgOpenFeignClient.java | 14 +++++- .../GovOrgOpenFeignClientFallback.java | 5 ++ .../resources/mapper/CustomerAgencyDao.xml | 2 +- .../EpmetUserOpenFeignClientFallback.java | 5 ++ .../controller/CustomerStaffController.java | 2 +- 6 files changed, 65 insertions(+), 11 deletions(-) diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java index 1f29c98390..c79e8f4c19 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java @@ -1,17 +1,17 @@ package com.epmet.controller; +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.*; -import com.epmet.dto.result.StaffSinAgencyResultDTO; -import com.epmet.dto.result.StaffSinDeptResultDTO; -import com.epmet.dto.result.StaffSinGridResultDTO; +import com.epmet.dto.result.*; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; 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 org.springframework.web.bind.annotation.*; import java.util.List; @@ -26,6 +26,10 @@ public class OpenUpController { @Autowired private OpenUpService openUpService; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; /** * @Description 网格工作人员 被禁用的、未激活的不显示 @@ -63,4 +67,34 @@ public class OpenUpController { return new Result>().ok(openUpService.staffSinAgency(formDTO)); } + /** + * @Description 查找工作人员的信息 + * @param + * @return + * @author wangc + * @date 2020.08.17 10:30 + **/ + //@ExternalAppRequestAuth + @PostMapping("staffinfo") + public Result staffInfo(@LoginUser TokenDto token){ + CommonStaffIdFormDTO commonStaffIdFormDTO = new CommonStaffIdFormDTO(); + commonStaffIdFormDTO.setStaffId(token.getUserId()); + ValidatorUtils.validateEntity(commonStaffIdFormDTO, CommonStaffIdFormDTO.StaffIdGroup.class); + return epmetUserOpenFeignClient.extStaffInfo(commonStaffIdFormDTO); + } + + /** + * @Description 根据staffId,查询当前这个用户的数据权限 + * @param + * @return + * @author wangc + * @date 2020.08.17 17:30 + **/ + //@ExternalAppRequestAuth + @PostMapping("permission") + Result staffPermissionExt(@RequestBody CommonStaffIdFormDTO commonStaffIdFormDTO){ + ValidatorUtils.validateEntity(commonStaffIdFormDTO, CommonStaffIdFormDTO.StaffIdGroup.class); + return govOrgOpenFeignClient.staffPermissionExt(commonStaffIdFormDTO.getStaffId()); + } + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 2311670af0..09d38dca5f 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -19,8 +19,8 @@ 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) +@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class, url = "localhost:8092") +//@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class) public interface GovOrgOpenFeignClient { /** @@ -230,4 +230,14 @@ public interface GovOrgOpenFeignClient { **/ @PostMapping("/gov/org/customeragency/staffinfoext") Result staffInfoExt(@RequestBody ExtStaffInfoResultDTO result); + + /** + * @Description 根据staffId,查询当前这个用户的数据权限,对外接口 + * @param staffId + * @return + * @author wangc + * @date 2020.08.17 17:30 + **/ + @PostMapping("/gov/org/customeragency/permissionext/{staffId}") + Result staffPermissionExt(@PathVariable(value = "staffId") String staffId); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index c845039399..15ea830edb 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -136,4 +136,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { public Result staffInfoExt(ExtStaffInfoResultDTO result) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "staffInfoExt", result); } + + @Override + public Result staffPermissionExt(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "staffPermissionExt", staffId); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 93136b2e1a..c2fb090e3f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -175,7 +175,7 @@ gridd.GRID_NAME, agency.ID AS agencyId, agency.ORGANIZATION_NAME AS agencyName, - agency.PID AS agencyIdPath, + agency.PIDS AS agencyIdPath, agency.ALL_PARENT_NAME AS agencyNamePath, agency.CUSTOMER_ID AS customerId FROM diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 55856e42ea..66aede9450 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -198,4 +198,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result updateRootManage(UpdateRootManageFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "updateRootManage", formDTO); } + + @Override + public Result extStaffInfo(CommonStaffIdFormDTO staffParam) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "extStaffInfo", staffParam); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index a752e8b884..08ed13c97a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -342,7 +342,7 @@ public class CustomerStaffController { * @date 2020.08.17 10:30 **/ @PostMapping("extstaffinfo") - public Result extStaffInfo(CommonStaffIdFormDTO staffParam){ + public Result extStaffInfo(@RequestBody CommonStaffIdFormDTO staffParam){ ValidatorUtils.validateEntity(staffParam, CommonStaffIdFormDTO.StaffIdGroup.class); return new Result().ok(customerStaffService.extStaffInfo(staffParam)); } From ed1e049b93a580bfeb40b9dc61ea3a888e1f4fee Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 19 Aug 2020 18:19:46 +0800 Subject: [PATCH 066/119] USERopenFeign --- .../java/com/epmet/feign/EpmetUserOpenFeignClient.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 52de280ea0..3cb2a8128e 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -288,4 +288,14 @@ public interface EpmetUserOpenFeignClient { */ @PostMapping("epmetuser/customerstaff/updaterootmanage") Result updateRootManage(@RequestBody UpdateRootManageFormDTO formDTO); + + /** + * @Description 查找工作人员的信息 - 对外开放接口 + * @param staffParam + * @return + * @author wangc + * @date 2020.08.17 10:30 + **/ + @PostMapping("epmetuser/customerstaff/extstaffinfo") + Result extStaffInfo(@RequestBody CommonStaffIdFormDTO staffParam); } From 2501972b36402e5bddc12c43a337e3337443d87c Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 19 Aug 2020 18:23:16 +0800 Subject: [PATCH 067/119] =?UTF-8?q?=E5=AF=B9=E5=A4=96=E9=AA=8C=E7=AD=BE?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/OpenUpController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java index ccaf50f267..84c852d7c4 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java @@ -78,7 +78,7 @@ public class OpenUpController { * @author wangc * @date 2020.08.17 10:30 **/ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("staffinfo") public Result staffInfo(@LoginUser TokenDto token){ CommonStaffIdFormDTO commonStaffIdFormDTO = new CommonStaffIdFormDTO(); @@ -94,7 +94,7 @@ public class OpenUpController { * @author wangc * @date 2020.08.17 17:30 **/ - //@ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("permission") Result staffPermissionExt(@RequestBody CommonStaffIdFormDTO commonStaffIdFormDTO){ ValidatorUtils.validateEntity(commonStaffIdFormDTO, CommonStaffIdFormDTO.StaffIdGroup.class); From 3a4be332d47fa960052ef8a542280b482660a3c9 Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 19 Aug 2020 18:29:33 +0800 Subject: [PATCH 068/119] =?UTF-8?q?=E6=9B=B4=E6=96=B0ext=20user=20govorg?= =?UTF-8?q?=20crm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/epmet-ext/epmet-ext-server/pom.xml | 2 +- .../gov-org/gov-org-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/gov-org/gov-org-server/pom.xml | 2 +- .../oper-crm/oper-crm-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/oper-crm/oper-crm-server/pom.xml | 2 +- epmet-user/epmet-user-server/deploy/docker-compose-dev.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml index 6ea35c4e01..fee6ebedd5 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ 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.2 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-ext-server:0.0.3 ports: - "8113:8113" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-ext/epmet-ext-server/pom.xml b/epmet-module/epmet-ext/epmet-ext-server/pom.xml index 7548f528d1..1933c54170 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/pom.xml +++ b/epmet-module/epmet-ext/epmet-ext-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.2 + 0.0.3 com.epmet diff --git a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml index 9f415bb98b..0d0c46a2f5 100644 --- a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.84 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.85 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index 22edd8308d..5dd509619e 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.84 + 0.3.85 com.epmet gov-org diff --git a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml index 9aefc298b6..20e5ef557e 100644 --- a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml +++ b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-crm-server: container_name: oper-crm-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/oper-crm-server:0.3.67 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-crm-server:0.3.68 ports: - "8090:8090" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-crm/oper-crm-server/pom.xml b/epmet-module/oper-crm/oper-crm-server/pom.xml index 57471a9ffb..e5e4a6b01d 100644 --- a/epmet-module/oper-crm/oper-crm-server/pom.xml +++ b/epmet-module/oper-crm/oper-crm-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.67 + 0.3.68 com.epmet oper-crm diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml index 15c0789d48..183c16839c 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.118 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.119 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 0d7cdfa705..295a114a6c 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.118 + 0.3.119 com.epmet epmet-user From d5acd6292779cb1cb300dd54d826bdcc761561eb Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 19 Aug 2020 21:59:31 +0800 Subject: [PATCH 069/119] =?UTF-8?q?=E5=A4=96=E9=83=A8=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E5=A4=B1=E8=B4=A5=E9=94=99=E8=AF=AF=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/extappauth/aspect/ExternalAppRequestAuthAspect.java | 2 +- .../java/com/epmet/commons/tools/exception/EpmetErrorCode.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java index e64f678937..b4cfd11c27 100644 --- a/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java +++ b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java @@ -64,7 +64,7 @@ public class ExternalAppRequestAuthAspect { form.setToken(token); Result result = commonServiceOpenFeignClient.externalAppAuth(form); if (result == null) { - throw new RenException("调用external鉴权服务,返回null"); + throw new RenException("调用服务进行外部应用认证,返回null"); } if (!result.success()) { throw new RenException(result.getInternalMsg()); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 716dc7f885..e86296856e 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -99,7 +99,7 @@ public enum EpmetErrorCode { OPER_ADD_CUSTOMER_MANAGER_ERROR(8706, "新增客户管理员失败"), OPER_UPLOAD_FILE_OVER_SIZE(8707, "文件体积过大"), OPER_UPLOAD_FILE_TYPE_ERROR(8708, "文件类型错误"), - OPER_EXTERNAL_APP_AUTH_ERROR(8709, "外部应用鉴权失败"), + OPER_EXTERNAL_APP_AUTH_ERROR(8709, "外部应用认证失败"), // 党建声音 前端提示 88段 DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"), From c525168c7966f05edac28daca84c68ed5abc9df7 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Thu, 20 Aug 2020 09:14:42 +0800 Subject: [PATCH 070/119] =?UTF-8?q?=E8=BF=90=E8=90=A5=E7=AB=AF=E5=AE=9A?= =?UTF-8?q?=E5=88=B6=E5=8A=9F=E8=83=BD=E5=88=97=E8=A1=A8=EF=BC=8C=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/FunctionCustomizedListResultDTO.java | 2 +- .../com/epmet/service/impl/FunctionCustomizedServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListResultDTO.java index fc44d76d1a..2428e4d441 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListResultDTO.java @@ -23,7 +23,7 @@ public class FunctionCustomizedListResultDTO implements Serializable { /** * 列表内容 */ - private List listDTOS; + private List list; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java index 59ac2895c5..3be14ab486 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java @@ -231,7 +231,7 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl().ok(resultDTO); } From 2049fb5360691870bc7b0c9c9172989e6c53fbc4 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 20 Aug 2020 09:23:21 +0800 Subject: [PATCH 071/119] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oper-customize-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/oper-customize/oper-customize-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml index a06dc47c2e..ef4dddb9de 100644 --- a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml +++ b/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.28 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.29 ports: - "8089:8089" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index c71ac357d3..4338ef5139 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.28 + 0.3.29 com.epmet oper-customize From 42ae652d2ce276c82c1886c85888b8bb1dd89124 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 20 Aug 2020 10:06:01 +0800 Subject: [PATCH 072/119] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=AE=9A=E5=88=B6?= =?UTF-8?q?=E5=8C=96=E8=AE=BE=E7=BD=AE=E4=B8=9A=E5=8A=A1=E5=9F=9F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/CustomerController.java | 6 +- .../com/epmet/service/CustomerService.java | 2 +- .../service/impl/CustomerServiceImpl.java | 18 +++--- .../epmet/dto/form/CustomerDomainFormDTO.java | 16 +++++ .../epmet/dto/form/WebviewDomainFormDTO.java | 28 +++++++++ .../FunctionCustomizedController.java | 11 ++-- .../com/epmet/dao/FunctionCustomizedDao.java | 9 +++ .../service/FunctionCustomizedService.java | 14 +++-- .../impl/FunctionCustomizedServiceImpl.java | 59 +++++++++++++++++-- .../mapper/FunctionCustomizedDao.xml | 13 ++++ 10 files changed, 153 insertions(+), 23 deletions(-) create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerDomainFormDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/WebviewDomainFormDTO.java diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java index 6ad634df60..30bde5bb69 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java @@ -286,9 +286,9 @@ public class CustomerController { * @return com.epmet.commons.tools.utils.Result> */ @PostMapping("customerlist") - public Result> customerList(@RequestBody PageQueryFormDTO formDTO) { - List result = customerService.customerList(formDTO); - return new Result>().ok(result); + public Result customerList(@RequestBody PageQueryFormDTO formDTO) { + PageData result = customerService.customerList(formDTO); + return new Result().ok(result); } /** diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java index b194421d06..6749bd9763 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java @@ -194,7 +194,7 @@ public interface CustomerService extends BaseService { * @param formDTO * @return com.epmet.dto.result.CustomerListResultDTO */ - List customerList(PageQueryFormDTO formDTO); + PageData customerList(PageQueryFormDTO formDTO); /** * 客户基本信息修改 diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java index 673f676fd9..fdc8d2a240 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java @@ -578,7 +578,7 @@ public class CustomerServiceImpl extends BaseServiceImpl customerList(PageQueryFormDTO formDTO) { + public PageData customerList(PageQueryFormDTO formDTO) { PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()) .doSelectPageInfo(() -> baseDao.selectAllCustomerList(formDTO.getCustomerName())); List list = pageInfo.getList(); @@ -592,25 +592,29 @@ public class CustomerServiceImpl extends BaseServiceImpl> managersResult = epmetUserFeignClient.getStaffsInRole(staffsInRoleForm); - if (!managersResult.success() || null == managersResult.getData() || managersResult.getData().size() == NumConstant.ZERO) { + if (!managersResult.success()) { throw new RenException("查询客户详情:查询客户管理员失败:".concat(managersResult.toString())); } - manager = managersResult.getData().get(NumConstant.ZERO); + dto.setProvince(agency.getProvince()); dto.setCity(agency.getCity()); dto.setCounty(agency.getDistrict()); - dto.setRootManageName(manager.getRealName()); - dto.setRootManagePhone(manager.getMobile()); + if (null != managersResult.getData() && managersResult.getData().size() > NumConstant.ZERO) { + GovStaffRoleResultDTO manager = managersResult.getData().get(NumConstant.ZERO); + dto.setRootManageName(manager.getRealName()); + dto.setRootManagePhone(manager.getMobile()); + } + } }); } - return list; + pageInfo.setList(list); + return new PageData<>(pageInfo.getList(),pageInfo.getTotal()); } @Override diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerDomainFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerDomainFormDTO.java new file mode 100644 index 0000000000..a7c053df2c --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerDomainFormDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/19 16:13 + */ +@Data +public class CustomerDomainFormDTO implements Serializable { + private static final long serialVersionUID = 6766612197218605922L; + private String customerId; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/WebviewDomainFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/WebviewDomainFormDTO.java new file mode 100644 index 0000000000..dc951e1b7b --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/WebviewDomainFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/19 17:46 + */ +@Data +public class WebviewDomainFormDTO implements Serializable { + private static final long serialVersionUID = 8022056850984848597L; + /** + * 客户ID + */ + private String customerId; + /** + * 客户端类型 + */ + private String clientType; + /** + * 业务域名 + */ + private List webViewDomain; +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java index 1df9d0e568..fd82ce4fb6 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java @@ -26,10 +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.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.form.*; import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; import com.epmet.dto.result.FunctionCustomizedListResultDTO; import com.epmet.excel.FunctionCustomizedExcel; @@ -174,4 +171,10 @@ public class FunctionCustomizedController { ValidatorUtils.validateEntity(formDTO); return functionCustomizedService.functionCustomizedList(formDTO); } + + @PostMapping("customerdomainname") + public Result customerDomain(@RequestBody CustomerDomainFormDTO formDTO) { + functionCustomizedService.customerDomain(formDTO); + return new Result(); + } } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java index 907bfd1595..87a877214b 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java @@ -116,4 +116,13 @@ public interface FunctionCustomizedDao extends BaseDao * @Description 查询定制功能信息 **/ FunctionCustomizedDTO selectByFunctionId(@Param("functionId") String functionId); + + /** + * 获取业务域名 + * @author zhaoqifeng + * @date 2020/8/20 9:36 + * @param customerId + * @return java.util.List + */ + List selectDomains(@Param("customerId") String customerId); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java index 178c2d439b..a02b628755 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java @@ -21,10 +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.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.form.*; import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; import com.epmet.dto.result.FunctionCustomizedListResultDTO; import com.epmet.entity.FunctionCustomizedEntity; @@ -153,4 +150,13 @@ public interface FunctionCustomizedService extends BaseService functionCustomizedList(FunctionCustomizedListFormDTO formDTO); + + /** + * 设置业务域名 + * @author zhaoqifeng + * @date 2020/8/19 16:15 + * @param formDTO + * @return void + */ + void customerDomain(CustomerDomainFormDTO formDTO); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java index 3be14ab486..dc8a8ccd25 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java @@ -17,23 +17,24 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; 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.dao.CustomerFunctionDetailDao; import com.epmet.dao.FunctionCustomizedDao; import com.epmet.dto.CustomerFunctionDetailDTO; import com.epmet.dto.CustomizedDTO; 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.form.*; import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; import com.epmet.dto.result.FunctionCustomizedListResultDTO; import com.epmet.entity.CustomerFunctionDetailEntity; @@ -52,6 +53,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 定制功能 @@ -236,6 +238,55 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl().ok(resultDTO); } + @Override + public void customerDomain(CustomerDomainFormDTO formDTO) { + //获取业务域名 + List list = baseDao.selectDomains(formDTO.getCustomerId()); + List workDomains = new ArrayList<>(); + List resiDomains = new ArrayList<>(); + if (null != list) { + for(FunctionCustomizedDTO dto : list) { + if (StringUtils.isNotBlank(dto.getDomainName())) { + String[] domainNames = dto.getDomainName().split(";"); + if (("resi").equals(dto.getFromApp())) { + resiDomains.addAll(Arrays.asList(domainNames)); + } else { + workDomains.addAll(Arrays.asList(domainNames)); + } + } + } + } + + String domainUrl = "https://epmet-cloud.elinkservice.cn/api/third/code/setWebviewDomain"; + if(resiDomains.size() > NumConstant.ZERO) { + resiDomains = resiDomains.stream().distinct().collect(Collectors.toList()); + WebviewDomainFormDTO domainFormDTO = new WebviewDomainFormDTO(); + domainFormDTO.setCustomerId(formDTO.getCustomerId()); + domainFormDTO.setClientType("resi"); + domainFormDTO.setWebViewDomain(resiDomains); + String domainData = HttpClientManager.getInstance().sendPostByJSON(domainUrl, JSON.toJSONString(domainFormDTO)).getData(); + JSONObject domainObject = JSON.parseObject(domainData); + Result domainResult = ConvertUtils.mapToEntity(domainObject, Result.class); + if (!domainResult.success()) { + throw new RenException(domainResult.getCode(), domainResult.getInternalMsg()); + } + } + + if(workDomains.size() > NumConstant.ZERO) { + workDomains = workDomains.stream().distinct().collect(Collectors.toList()); + WebviewDomainFormDTO domainFormDTO = new WebviewDomainFormDTO(); + domainFormDTO.setCustomerId(formDTO.getCustomerId()); + domainFormDTO.setClientType("work"); + domainFormDTO.setWebViewDomain(workDomains); + String domainData = HttpClientManager.getInstance().sendPostByJSON(domainUrl, JSON.toJSONString(domainFormDTO)).getData(); + JSONObject domainObject = JSON.parseObject(domainData); + Result domainResult = ConvertUtils.mapToEntity(domainObject, Result.class); + if (!domainResult.success()) { + throw new RenException(domainResult.getCode(), domainResult.getInternalMsg()); + } + } + } + /** * 保存数据到 功能表 * @param formDTO diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml index 99cbf17b15..b9e44d268a 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml @@ -87,6 +87,19 @@ AND cu.FROM_APP = 'gov' + + SELECT + count(0) + FROM + external_app + WHERE + APP_NAME = #{appName} + AND CUSTOMER_ID = #{customerId} + + \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalCustomerDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalCustomerDao.xml index 9d59a01224..0e4d03d0cc 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalCustomerDao.xml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalCustomerDao.xml @@ -25,5 +25,21 @@ DEL_FLAG = 0 + + + + \ No newline at end of file From 321b9d740903a3c25eb5b41e81d410e91032a17c Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Thu, 20 Aug 2020 18:22:29 +0800 Subject: [PATCH 091/119] =?UTF-8?q?=E5=AE=9A=E5=88=B6=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=20=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/FunctionCustomizedServiceImpl.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java index 4e70b77f04..b5c599be12 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java @@ -178,6 +178,8 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl upCustomizedInfo = new ArrayList<>(); // 统一提示 不能进行修改的客户id StringBuilder tipCustomizedInfoUserId = new StringBuilder(); + // 如果客户全都是使用的自定义模板,则只修改 功能表、定制功能表 + int flag = 0; // 如果这个功能,被客户重新定义了,则不会修改 for (int i = 0; i < customizedId.size(); i++){ @@ -207,10 +209,17 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl NumConstant.ZERO){ // 5.1 修改 客户定制功能详情表 customerFunctionDetailService.updateBatchById(upCustomizedInfo); From 320a9dbc4cdbd58c292d554168d302b6344d2d8b Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 20 Aug 2020 23:28:41 +0800 Subject: [PATCH 092/119] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/ExternalAppFormDTO.java | 3 + .../dto/result/ExternalAppResultDTO.java | 12 ++- .../controller/ExternalAppController.java | 32 +++++++- .../java/com/epmet/dao/ExternalAppDao.java | 7 ++ .../com/epmet/service/ExternalAppService.java | 5 ++ .../service/impl/ExternalAppServiceImpl.java | 73 +++++++++++++++++-- .../main/resources/mapper/ExternalAppDao.xml | 34 +++++++++ 7 files changed, 158 insertions(+), 8 deletions(-) diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalAppFormDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalAppFormDTO.java index 9d416731d6..36a504a135 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalAppFormDTO.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalAppFormDTO.java @@ -19,4 +19,7 @@ public class ExternalAppFormDTO { @NotBlank(message = "缺少所属客户ID", groups = { AddExternalApp.class, UpdateExternalApp.class }) private String customerId; + private Integer pageNo = 1; + private Integer pageSize = 10; + } diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ExternalAppResultDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ExternalAppResultDTO.java index 7de7015a69..e4cf3fedb6 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ExternalAppResultDTO.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ExternalAppResultDTO.java @@ -5,7 +5,7 @@ import lombok.Data; @Data public class ExternalAppResultDTO { - public String id; + public String appId; /** * APP名字 */ @@ -16,4 +16,14 @@ public class ExternalAppResultDTO { */ private String customerId; + /** + * 客户名称 + */ + private String customerName; + + /** + * 秘钥 + */ + private String secret; + } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java index 47027649eb..976c4e4ef0 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java @@ -1,6 +1,7 @@ package com.epmet.controller; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.ExternalAppAuthFormDTO; @@ -18,8 +19,6 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import javax.validation.constraints.NotBlank; - @RestController @RequestMapping("/externalapp") public class ExternalAppController { @@ -67,4 +66,33 @@ public class ExternalAppController { return new Result().ok(dto); } + /** + * 修改应用 + * @param formDTO + * @return + */ + @PostMapping("/update") + public Result update(@RequestBody ExternalAppFormDTO formDTO) { + + ValidatorUtils.validateEntity(formDTO, ExternalAppFormDTO.UpdateExternalApp.class); + + String appId = formDTO.getAppId(); + String appName = formDTO.getAppName(); + String customerId = formDTO.getCustomerId(); + + ExternalAppResultDTO dto = externalAppService.updateById(appId, appName, customerId); + return new Result().ok(dto); + } + + /** + * 查询列表 + * @param formDTO + * @return + */ + @PostMapping("/list") + public Result> list(@RequestBody ExternalAppFormDTO formDTO) { + PageData page = externalAppService.listPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getCustomerId()); + return new Result>().ok(page); + } + } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java index f07ab43f75..73f6bd3407 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java @@ -18,10 +18,13 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ExternalAppResultDTO; import com.epmet.entity.ExternalAppEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 外部应用列表 * @@ -32,4 +35,8 @@ import org.apache.ibatis.annotations.Param; public interface ExternalAppDao extends BaseDao { Integer countByAppNameAndCustomerId(@Param("appName") String appName, @Param("customerId") String customerId); + + ExternalAppResultDTO getByNameAndCustomerId(@Param("appName") String appName, @Param("customerId") String customerId); + + List list(@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java index 0dfc3cc2d9..dff718695f 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java @@ -17,6 +17,7 @@ package com.epmet.service; +import com.epmet.commons.tools.page.PageData; import com.epmet.dto.result.ExternalAppResultDTO; /** @@ -27,4 +28,8 @@ import com.epmet.dto.result.ExternalAppResultDTO; */ public interface ExternalAppService { ExternalAppResultDTO add(String appName, String customerId); + + ExternalAppResultDTO updateById(String appId, String appName, String customerId); + + PageData listPage(Integer pageNo, Integer pageSize, String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java index bef41b455e..5f92de268e 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java @@ -19,13 +19,22 @@ package com.epmet.service.impl; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; import com.epmet.dao.ExternalAppDao; +import com.epmet.dao.ExternalAppSecretDao; import com.epmet.dao.ExternalCustomerDao; import com.epmet.dto.result.ExternalAppResultDTO; import com.epmet.entity.ExternalAppEntity; +import com.epmet.entity.ExternalAppSecretEntity; import com.epmet.service.ExternalAppService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.UUID; /** * 外部应用列表 @@ -39,9 +48,13 @@ public class ExternalAppServiceImpl implements ExternalAppService { @Autowired private ExternalAppDao externalAppDao; + @Autowired + private ExternalAppSecretDao externalAppSecretDao; + @Autowired private ExternalCustomerDao externalCustomerDao; + @Transactional @Override public ExternalAppResultDTO add(String appName, String customerId) { Integer count = externalAppDao.countByAppNameAndCustomerId(appName, customerId); @@ -55,16 +68,66 @@ public class ExternalAppServiceImpl implements ExternalAppService { EpmetErrorCode.OPER_EXTERNAL_CUSTOMER_NOT_EXISTS.getMsg()); } - ExternalAppEntity entity = new ExternalAppEntity(); - entity.setAppName(appName); - entity.setCustomerId(customerId); - externalAppDao.insert(entity); + // 应用表插入 + ExternalAppEntity appEntity = new ExternalAppEntity(); + appEntity.setAppName(appName); + appEntity.setCustomerId(customerId); + externalAppDao.insert(appEntity); + + // 秘钥表插入 + ExternalAppSecretEntity secretEntity = new ExternalAppSecretEntity(); + secretEntity.setAppId(appEntity.getId()); + secretEntity.setSecret(genSecret()); + externalAppSecretDao.insert(secretEntity); ExternalAppResultDTO dto = new ExternalAppResultDTO(); dto.setAppName(appName); dto.setCustomerId(customerId); - dto.setId(entity.getId()); + dto.setAppId(appEntity.getId()); return dto; } + /** + * 生成秘钥 + * @return + */ + private String genSecret() { + String part1 = UUID.randomUUID().toString(); + String part2 = UUID.randomUUID().toString(); + return part1.concat(part2).replace("-", ""); + } + + @Override + public ExternalAppResultDTO updateById(String appId, String appName, String customerId) { + ExternalAppEntity exists = externalAppDao.selectById(appId); + if (exists == null) { + throw new RenException(EpmetErrorCode.OPER_EXTERNAL_CUSTOMER_NOT_EXISTS.getCode(), + EpmetErrorCode.OPER_EXTERNAL_CUSTOMER_NOT_EXISTS.getMsg()); + } + + ExternalAppResultDTO byName = externalAppDao.getByNameAndCustomerId(appName, customerId); + if (byName != null && !byName.getAppId().equals(appId)) { + // 说明改了之后的名字跟当前客户内的其他应用重复 + throw new RenException(EpmetErrorCode.OPER_EXTERNAL_APP_EXISTS.getCode(), "应用名称重复"); + } + + exists.setAppName(appName); + exists.setCustomerId(customerId); + externalAppDao.updateById(exists); + + ExternalAppResultDTO resultDTO = new ExternalAppResultDTO(); + resultDTO.setAppId(appId); + resultDTO.setCustomerId(customerId); + resultDTO.setAppName(appName); + return resultDTO; + } + + @Override + public PageData listPage(Integer pageNo, Integer pageSize, String customerId) { + PageHelper.startPage(pageNo, pageSize); + List list = externalAppDao.list(customerId); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml index 6c4b308eb0..588f735da7 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml @@ -24,6 +24,40 @@ WHERE APP_NAME = #{appName} AND CUSTOMER_ID = #{customerId} + AND DEL_FLAG = 0 + + + + + From 3e8e37101a3206ffd0dd788f716a46516c1b8b37 Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 20 Aug 2020 23:30:45 +0800 Subject: [PATCH 093/119] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common-service-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/epmet-common-service/common-service-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml index dcebebb14a..57cf7430f4 100644 --- a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: common-service-server: container_name: common-service-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/common-service-server:0.3.13 + image: 192.168.1.130:10080/epmet-cloud-dev/common-service-server:0.3.14 ports: - "8103:8103" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-common-service/common-service-server/pom.xml b/epmet-module/epmet-common-service/common-service-server/pom.xml index e206dc871e..e95e11640b 100644 --- a/epmet-module/epmet-common-service/common-service-server/pom.xml +++ b/epmet-module/epmet-common-service/common-service-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.13 + 0.3.14 com.epmet epmet-common-service From be5ce96cce89e13710c282588d8f4215cea0c846 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 21 Aug 2020 09:07:33 +0800 Subject: [PATCH 094/119] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oper-customize-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/oper-customize/oper-customize-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml index 972c1139ff..1d68e11eda 100644 --- a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml +++ b/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.33 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.34 ports: - "8089:8089" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index 50cb5329e3..c1938c1861 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.33 + 0.3.34 com.epmet oper-customize From a013f2bfbd1acf2f1300ac4d6259c426fe3265d7 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 21 Aug 2020 09:19:41 +0800 Subject: [PATCH 095/119] =?UTF-8?q?=E6=89=93=E5=BC=80dev=E7=9A=84nacos?= =?UTF-8?q?=E6=B3=A8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/epmet-common-service/common-service-server/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-common-service/common-service-server/pom.xml b/epmet-module/epmet-common-service/common-service-server/pom.xml index 4c2122a905..597eb77772 100644 --- a/epmet-module/epmet-common-service/common-service-server/pom.xml +++ b/epmet-module/epmet-common-service/common-service-server/pom.xml @@ -113,7 +113,7 @@ 6379 123456 - false + true 122.152.200.70:8848 fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b From 803bcbb7f0c88adccea17ef2a433a771a87653e1 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 21 Aug 2020 09:20:44 +0800 Subject: [PATCH 096/119] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common-service-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/epmet-common-service/common-service-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml index 57cf7430f4..e9f1cd6a8d 100644 --- a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: common-service-server: container_name: common-service-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/common-service-server:0.3.14 + image: 192.168.1.130:10080/epmet-cloud-dev/common-service-server:0.3.15 ports: - "8103:8103" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-common-service/common-service-server/pom.xml b/epmet-module/epmet-common-service/common-service-server/pom.xml index d4ba00ce5b..db1f92cdcd 100644 --- a/epmet-module/epmet-common-service/common-service-server/pom.xml +++ b/epmet-module/epmet-common-service/common-service-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.14 + 0.3.15 com.epmet epmet-common-service From 671903ccfb86468f35bf6bd96a8297be676a6c12 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 21 Aug 2020 10:09:17 +0800 Subject: [PATCH 097/119] =?UTF-8?q?=E5=AE=9A=E5=88=B6=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E6=B7=BB=E5=8A=A0=E6=98=AF=E5=90=A6=E6=9C=89?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E4=BD=BF=E7=94=A8=E5=AD=97=E6=AE=B5=E3=80=81?= =?UTF-8?q?=E9=87=87=E9=9B=86=E4=B8=8D=E5=B1=95=E7=A4=BA=E4=B8=8B=E6=9E=B6?= =?UTF-8?q?=E7=9A=84=E5=AE=A2=E6=88=B7=E6=B2=A1=E6=9C=89=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E3=80=81=E6=95=B0=E6=8D=AE=E5=BA=93=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/FunctionCustomizedDetailResultDTO.java | 7 ++++++- .../service/impl/FunctionCustomizedServiceImpl.java | 10 ++++++++++ .../resources/db/migration/V0.0.5__add_del_flag.sql | 5 +++++ .../main/resources/mapper/FunctionCustomizedDao.xml | 3 ++- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java index b9f30936f9..e232ce5f2f 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java @@ -32,7 +32,7 @@ public class FunctionCustomizedDetailResultDTO implements Serializable { /** * 默认名称 */ - private String customizedName; + private String functionName; /** * 默认大图标 @@ -58,4 +58,9 @@ public class FunctionCustomizedDetailResultDTO implements Serializable { * 来源app(工作端:gov、居民端:resi) */ private String fromApp; + + /** + * 是否有客户在使用(0:否 1:是) + */ + private Integer isApply; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java index b5c599be12..6d75012e1e 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java @@ -144,7 +144,17 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl getFunctionCustomized(CommonFunctionIdFormDTO formDTO) { + //1.查询定制功能详情信息 FunctionCustomizedDetailResultDTO resultDTO = baseDao.getFunctionCustomizedByFunctionId(formDTO); + + //2.查询是否有客户在使用当前定制功能 + CustomerFunctionDetailEntity entity = customerFunctionDetailService.selectById(formDTO.getFunctionId()); + if (null == entity || null == entity.getFunctionId()) { + resultDTO.setIsApply(NumConstant.ZERO); + } else { + resultDTO.setIsApply(NumConstant.ONE); + } + return new Result().ok(resultDTO); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.5__add_del_flag.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.5__add_del_flag.sql index 73725ab557..e34bafd2b5 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.5__add_del_flag.sql +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.5__add_del_flag.sql @@ -1 +1,6 @@ ALTER TABLE function_shopping_history ADD ( DEL_FLAG INT ( 11 ) NOT NULL COMMENT '删除标识(0.未删除 1.已删除)'); + + +ALTER TABLE `customer_function_detail` +MODIFY COLUMN `DOMAIN_NAME` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '自定义业务域名(可设置多个 用分号分隔)' AFTER `ICON_SMALL_IMG`; + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml index b9e44d268a..e1ad29efb4 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml @@ -9,7 +9,7 @@ cu.FUNCTION_ID functionId, f.SHOPPING_STATUS shoppingStatus, f.FUNCTION_EXPLAIN functionExplain, - cu.CUSTOMIZED_NAME customizedName, + cu.CUSTOMIZED_NAME functionName, cu.ICON_LARGE_IMG iconLargeImg, cu.ICON_SMALL_IMG iconSmallImg, cu.TARGET_LINK targetLink, @@ -113,6 +113,7 @@ WHERE fc.DEL_FLAG = '0' AND f.DEL_FLAG = '0' + AND f.shopping_status = '1' fc.FUNCTION_ID != #{functionId} From aa0a2a5cbab7a049d75e8fea8d2beca07a1d721f Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 21 Aug 2020 10:10:49 +0800 Subject: [PATCH 098/119] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oper-customize-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/oper-customize/oper-customize-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml index 1d68e11eda..b7ed63ffe0 100644 --- a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml +++ b/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.34 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.35 ports: - "8089:8089" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index c1938c1861..d708d50d95 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.34 + 0.3.35 com.epmet oper-customize From 2596b5eef4b4b2440e8934efbfd479e5ea0374df Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 21 Aug 2020 10:33:06 +0800 Subject: [PATCH 099/119] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E5=9F=9F=E5=90=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/form/ModifyDomainFormDTO.java | 4 ++++ .../main/java/com/epmet/dto/form/WebviewDomainFormDTO.java | 4 ++++ .../main/java/com/epmet/service/impl/SettingServiceImpl.java | 3 ++- .../src/main/java/com/epmet/wxapi/enums/WxMaErrorMsgEnum.java | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ModifyDomainFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ModifyDomainFormDTO.java index d8b78838e4..600b4d6b83 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ModifyDomainFormDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ModifyDomainFormDTO.java @@ -22,6 +22,10 @@ public class ModifyDomainFormDTO implements Serializable { * 客户端类型 */ private String clientType; + /** + * 操作类型:add 添加,delete 删除,set 覆盖 + */ + private String action; /** * request 合法域名 */ diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/WebviewDomainFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/WebviewDomainFormDTO.java index dc951e1b7b..2518bb28b4 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/WebviewDomainFormDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/WebviewDomainFormDTO.java @@ -21,6 +21,10 @@ public class WebviewDomainFormDTO implements Serializable { * 客户端类型 */ private String clientType; + /** + * 操作类型:add 添加,delete 删除,set 覆盖 + */ + private String action; /** * 业务域名 */ diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/SettingServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/SettingServiceImpl.java index 134ab97c06..e66d9b086f 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/SettingServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/SettingServiceImpl.java @@ -33,6 +33,7 @@ public class SettingServiceImpl implements SettingService { throw new RenException("未授权"); } WxMaModifyDomainReq request = new WxMaModifyDomainReq(); + request.setAction(formDTO.getAction()); request.setDownloadDomain(formDTO.getDownloadDomain()); request.setRequestDomain(formDTO.getRequestDomain()); request.setWsRequestDomain(formDTO.getWsRequestDomain()); @@ -52,7 +53,7 @@ public class SettingServiceImpl implements SettingService { throw new RenException("未授权"); } WxMaSetWebviewDomainReq request = new WxMaSetWebviewDomainReq(); - request.setAction("set"); + request.setAction(formDTO.getAction()); request.setWebViewDomain(formDTO.getWebViewDomain()); //设置业务域名 WxResult setWebviewDomain = wxMaSettingService.setWebviewDomain(authInfo.getAuthorizerAccessToken(), request); diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/enums/WxMaErrorMsgEnum.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/enums/WxMaErrorMsgEnum.java index 0c12488f48..23e1077e7c 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/enums/WxMaErrorMsgEnum.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/enums/WxMaErrorMsgEnum.java @@ -354,6 +354,8 @@ public enum WxMaErrorMsgEnum { CODE_85062(85062, "手机号黑名单"), + CODE_85015(85015, "该账号不是小程序账号"), + CODE_85016(85016, "域名数量超过限制"), CODE_85017(85017, "没有新增域名,请确认小程序已经添加了域名或该域名是否没有在第三方平台添加"), From f9a85d2a9aeddde9555a7d76fa29aaba1e5f908a Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 21 Aug 2020 10:54:52 +0800 Subject: [PATCH 100/119] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E5=9F=9F=E5=90=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/form/WebviewDomainFormDTO.java | 4 ++++ .../com/epmet/service/impl/FunctionCustomizedServiceImpl.java | 1 + 2 files changed, 5 insertions(+) diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/WebviewDomainFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/WebviewDomainFormDTO.java index dc951e1b7b..2518bb28b4 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/WebviewDomainFormDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/WebviewDomainFormDTO.java @@ -21,6 +21,10 @@ public class WebviewDomainFormDTO implements Serializable { * 客户端类型 */ private String clientType; + /** + * 操作类型:add 添加,delete 删除,set 覆盖 + */ + private String action; /** * 业务域名 */ diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java index 6d75012e1e..e84ee6e617 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java @@ -282,6 +282,7 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl Date: Fri, 21 Aug 2020 11:00:10 +0800 Subject: [PATCH 101/119] =?UTF-8?q?oper-customize=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oper-customize-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/oper-customize/oper-customize-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml index b7ed63ffe0..42babced8e 100644 --- a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml +++ b/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.35 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.36 ports: - "8089:8089" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index d708d50d95..3077f1faf1 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.35 + 0.3.36 com.epmet oper-customize From fa100a283f6af186bba77bff2dabd8ce6985f520 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 21 Aug 2020 13:42:09 +0800 Subject: [PATCH 102/119] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E3=80=81=E5=AE=A2=E6=88=B7=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E6=96=B0=E7=9A=84=E9=BB=98=E8=AE=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/FunctionController.java | 19 ++++++++- .../com/epmet/service/FunctionService.java | 8 ++++ .../service/impl/FunctionServiceImpl.java | 42 +++++++++++++++++++ 3 files changed, 68 insertions(+), 1 deletion(-) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionController.java index ef7eec6d02..1862cb7ceb 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionController.java @@ -17,14 +17,16 @@ 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.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.FunctionDTO; import com.epmet.excel.FunctionExcel; import com.epmet.service.FunctionService; @@ -102,4 +104,19 @@ public class FunctionController { public Result> queryFunctionList() { return functionService.queryFunctionList(); } + + /** + * @param dto + * @return + * @Author sun + * @Description 默认功能新增 + **/ + @PostMapping("savefunction") + public Result saveFunction(@LoginUser TokenDto tokenDto, @RequestBody FunctionDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + functionService.saveFunction(dto); + return new Result(); + } + } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionService.java index 7717980531..04da335ca9 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionService.java @@ -102,4 +102,12 @@ public interface FunctionService extends BaseService { * @Date 2020/3/23 22:10 **/ Result> queryFunctionList(); + + /** + * @param dto + * @return + * @Author sun + * @Description 默认功能新增 + **/ + void saveFunction(FunctionDTO dto); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionServiceImpl.java index 65631c1b65..8c65c5e64a 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionServiceImpl.java @@ -20,20 +20,26 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.FunctionDao; +import com.epmet.dto.CustomerDTO; import com.epmet.dto.FunctionDTO; +import com.epmet.entity.CustomerFunctionEntity; import com.epmet.entity.FunctionEntity; +import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.redis.FunctionRedis; +import com.epmet.service.CustomerFunctionService; import com.epmet.service.FunctionService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -49,6 +55,10 @@ public class FunctionServiceImpl extends BaseServiceImpl page(Map params) { @@ -119,4 +129,36 @@ public class FunctionServiceImpl extends BaseServiceImpl>().ok(baseDao.selectFunctionList()); } + /** + * @param dto + * @return + * @Author sun + * @Description 默认功能新增 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void saveFunction(FunctionDTO dto) { + //1.调用oper-crm服务,查询有效客户列表 + Result> result = operCrmOpenFeignClient.getAllCustomerList(); + if(!result.success()){ + throw new RenException("调用oper_crm服务 获取有效客户列表失败"); + } + List list = result.getData(); + + //2.新增默认功能 + FunctionEntity functionEntity = ConvertUtils.sourceToTarget(dto, FunctionEntity.class); + insert(functionEntity); + + //3.为已有客户绑定新的默认功能关系 + List listEntity = new ArrayList<>(); + list.forEach(l->{ + CustomerFunctionEntity entity = new CustomerFunctionEntity(); + entity.setCustomerId(l.getId()); + entity.setFunctionId(functionEntity.getId()); + listEntity.add(entity); + }); + customerFunctionService.insertBatch(listEntity); + + } + } From 183932f995c80d376085d4f1b6e5a560db725ff5 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 21 Aug 2020 14:05:00 +0800 Subject: [PATCH 103/119] =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=BA=90-=E6=94=AF=E6=8C=81=E6=96=B9=E6=B3=95=E5=85=A5?= =?UTF-8?q?=E5=8F=82=E7=BA=A7=E5=88=AB=E7=9A=84=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datasource/annotation/DataSource.java | 10 +++++ .../datasource/aspect/DataSourceAspect.java | 42 ++++++++++++++++++- .../datasource/bean/DataSourceParam.java | 12 ++++++ 3 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/bean/DataSourceParam.java diff --git a/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/annotation/DataSource.java b/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/annotation/DataSource.java index 3a8ac1ae8f..e0675092c8 100644 --- a/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/annotation/DataSource.java +++ b/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/annotation/DataSource.java @@ -21,5 +21,15 @@ import java.lang.annotation.*; @Documented @Inherited public @interface DataSource { + /** + * 直接指定数据源名称 + * @return + */ String value() default ""; + + /** + * 是否从参数中获取数据源名称,优先级高于value + * @return + */ + boolean datasourceNameFromArg() default false; } diff --git a/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/aspect/DataSourceAspect.java b/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/aspect/DataSourceAspect.java index d636568425..45113847c6 100644 --- a/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/aspect/DataSourceAspect.java +++ b/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/aspect/DataSourceAspect.java @@ -9,7 +9,9 @@ package com.epmet.commons.dynamic.datasource.aspect; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.dynamic.datasource.bean.DataSourceParam; import com.epmet.commons.dynamic.datasource.config.DynamicContextHolder; +import org.apache.commons.lang3.StringUtils; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; @@ -22,6 +24,7 @@ import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; import java.lang.reflect.Method; +import java.lang.reflect.Parameter; /** * 多数据源,切面处理类 @@ -52,9 +55,9 @@ public class DataSourceAspect { if(targetDataSource != null || methodDataSource != null){ String value; if(methodDataSource != null){ - value = methodDataSource.value(); + value = getDatasourceName(methodDataSource, signature.getMethod().getParameters(), point.getArgs()); }else { - value = targetDataSource.value(); + value = getDatasourceName(targetDataSource, signature.getMethod().getParameters(), point.getArgs()); } DynamicContextHolder.push(value); @@ -68,4 +71,39 @@ public class DataSourceAspect { logger.debug("clean datasource"); } } + + /** + * 获取要用到的数据源名称 + * @param dataSource + * @return + */ + public String getDatasourceName(DataSource dataSource, Parameter[] methodParameters, Object[] methodArgValues) { + if (dataSource.datasourceNameFromArg()) { + // 1.从参数中动态获取数据源名称 + String datasourceNameFromParam = getDatasourceNameFromArg(methodParameters, methodArgValues); + if (StringUtils.isNotBlank(datasourceNameFromParam)) { + // 如果有DatasourceParam类型的参数并且设置了datasourceName值,那么返回这个值,否则使用硬编码的 + return datasourceNameFromParam; + } + } + // 2.硬编码指定数据源名称 + return dataSource.value(); + } + + /** + * 从参数中取数据源名称 + * @param parameters + * @param argsObject + * @return + */ + public String getDatasourceNameFromArg(Parameter[] parameters, Object[] argsObject) { + for (int i = 0; i < parameters.length; i++) { + if (parameters[i].getType() == DataSourceParam.class) { + DataSourceParam param = (DataSourceParam) argsObject[i]; + return param.getDatasourceName(); + } + } + + return null; + } } diff --git a/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/bean/DataSourceParam.java b/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/bean/DataSourceParam.java new file mode 100644 index 0000000000..19b5905588 --- /dev/null +++ b/epmet-commons/epmet-commons-dynamic-datasource/src/main/java/com/epmet/commons/dynamic/datasource/bean/DataSourceParam.java @@ -0,0 +1,12 @@ +package com.epmet.commons.dynamic.datasource.bean; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class DataSourceParam { + + private String datasourceName; + +} From e368e19ff2654c11fd9c6dc7879e99de75c4f552 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 21 Aug 2020 14:11:28 +0800 Subject: [PATCH 104/119] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E5=9F=9F=E5=90=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/FunctionCustomizedServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java index e84ee6e617..1020ed8ce6 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java @@ -287,6 +287,7 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl Date: Fri, 21 Aug 2020 14:14:07 +0800 Subject: [PATCH 105/119] =?UTF-8?q?oper-customize=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oper-customize-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/oper-customize/oper-customize-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml index 42babced8e..3b7127b0f4 100644 --- a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml +++ b/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.36 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.37 ports: - "8089:8089" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index 3077f1faf1..0cd9b6fb4a 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.36 + 0.3.37 com.epmet oper-customize From 703a591ab447a7978f8c815891e42cc1968b6b28 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 21 Aug 2020 14:16:12 +0800 Subject: [PATCH 106/119] =?UTF-8?q?third=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-third-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/epmet-third/epmet-third-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml index c0110e464b..70d8556c45 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.132 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.133 ports: - "8110:8110" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-third/epmet-third-server/pom.xml b/epmet-module/epmet-third/epmet-third-server/pom.xml index 6c703dd85f..1cf5691722 100644 --- a/epmet-module/epmet-third/epmet-third-server/pom.xml +++ b/epmet-module/epmet-third/epmet-third-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.132 + 0.0.133 com.epmet From 16864081cd7756985ee62b50af668c995bdd0b35 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 21 Aug 2020 15:50:04 +0800 Subject: [PATCH 107/119] =?UTF-8?q?=E5=A4=96=E9=83=A8=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=AE=A1=E7=90=86-=E5=88=97=E8=A1=A8=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E3=80=81=E6=96=B0=E5=A2=9E=E3=80=81=E4=BF=AE=E6=94=B9=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=BF=94=E5=9B=9E=E7=9A=84id=E6=94=B9=E4=B8=BAcustome?= =?UTF-8?q?rId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/ExternalCustomerResultDTO.java | 2 +- .../controller/ExternalCustomerController.java | 15 ++++++--------- .../epmet/service/ExternalCustomerService.java | 4 ++-- .../impl/ExternalCustomerServiceImpl.java | 16 ++++++++++++---- .../resources/mapper/ExternalCustomerDao.xml | 2 +- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ExternalCustomerResultDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ExternalCustomerResultDTO.java index 79e58686fe..177b49575b 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ExternalCustomerResultDTO.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ExternalCustomerResultDTO.java @@ -36,7 +36,7 @@ public class ExternalCustomerResultDTO implements Serializable { /** * 客户ID */ - private String id; + private String customerId; /** * 客户名称 diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalCustomerController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalCustomerController.java index 2817a2fae5..becc72c341 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalCustomerController.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalCustomerController.java @@ -5,7 +5,6 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.ExternalCustomerFormDTO; import com.epmet.dto.result.ExternalCustomerResultDTO; -import com.epmet.entity.ExternalCustomerEntity; import com.epmet.service.ExternalCustomerService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -15,8 +14,6 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import javax.validation.constraints.NotBlank; - /** * 外部客户管理 */ @@ -48,11 +45,11 @@ public class ExternalCustomerController { * @return */ @PostMapping("add") - public Result add(@RequestBody ExternalCustomerFormDTO formDTO) { + public Result add(@RequestBody ExternalCustomerFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, ExternalCustomerFormDTO.AddExternalCustomerGroup.class); String customerName = formDTO.getCustomerName(); - ExternalCustomerEntity result = externalCustomerService.add(customerName); - return new Result().ok(result); + ExternalCustomerResultDTO result = externalCustomerService.add(customerName); + return new Result().ok(result); } /** @@ -61,12 +58,12 @@ public class ExternalCustomerController { * @return */ @PostMapping("update") - public Result update(@RequestBody ExternalCustomerFormDTO formDTO) { + public Result update(@RequestBody ExternalCustomerFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, ExternalCustomerFormDTO.UpdateExternalCustomerGroup.class); String customerId = formDTO.getCustomerId(); String customerName = formDTO.getCustomerName(); - ExternalCustomerEntity result = externalCustomerService.update(customerId, customerName); - return new Result().ok(result); + ExternalCustomerResultDTO result = externalCustomerService.update(customerId, customerName); + return new Result().ok(result); } } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalCustomerService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalCustomerService.java index 6af116be98..25645bea0b 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalCustomerService.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalCustomerService.java @@ -8,7 +8,7 @@ public interface ExternalCustomerService { PageData listPage(Integer pageNo, Integer pageSize); - ExternalCustomerEntity add(String customerName); + ExternalCustomerResultDTO add(String customerName); - ExternalCustomerEntity update(String customerId, String customerName); + ExternalCustomerResultDTO update(String customerId, String customerName); } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalCustomerServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalCustomerServiceImpl.java index 8cfe32cf96..728e588e80 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalCustomerServiceImpl.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalCustomerServiceImpl.java @@ -31,7 +31,7 @@ public class ExternalCustomerServiceImpl implements ExternalCustomerService { } @Override - public ExternalCustomerEntity add(String customerName) { + public ExternalCustomerResultDTO add(String customerName) { Integer exitsCustomerCount = externalCustomerDao.countByCustomerName(customerName); if (exitsCustomerCount > 0) { throw new RenException(EpmetErrorCode.OPER_CUSTOMER_EXISTS.getCode(), "客户已存在"); @@ -39,11 +39,15 @@ public class ExternalCustomerServiceImpl implements ExternalCustomerService { ExternalCustomerEntity entity = new ExternalCustomerEntity(); entity.setCustomerName(customerName); externalCustomerDao.insert(entity); - return entity; + + ExternalCustomerResultDTO resultDTO = new ExternalCustomerResultDTO(); + resultDTO.setCustomerId(entity.getId()); + resultDTO.setCustomerName(customerName); + return resultDTO; } @Override - public ExternalCustomerEntity update(String customerId, String customerName) { + public ExternalCustomerResultDTO update(String customerId, String customerName) { ExternalCustomerEntity existsCustomer = externalCustomerDao.selectById(customerId); if (existsCustomer == null) { throw new RenException(EpmetErrorCode.OPER_EXTERNAL_CUSTOMER_NOT_EXISTS.getCode(), @@ -51,6 +55,10 @@ public class ExternalCustomerServiceImpl implements ExternalCustomerService { } existsCustomer.setCustomerName(customerName); externalCustomerDao.updateById(existsCustomer); - return existsCustomer; + + ExternalCustomerResultDTO resultDTO = new ExternalCustomerResultDTO(); + resultDTO.setCustomerId(customerId); + resultDTO.setCustomerName(customerName); + return resultDTO; } } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalCustomerDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalCustomerDao.xml index 0e4d03d0cc..3950f8d014 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalCustomerDao.xml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalCustomerDao.xml @@ -17,7 +17,7 @@ + + + \ No newline at end of file From 1231edfcecca1ff9be92efd60e59eb26b77e137e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 24 Aug 2020 10:42:23 +0800 Subject: [PATCH 113/119] =?UTF-8?q?=E4=BF=AE=E6=94=B9oper=5Fmenu=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0SHOW=5FFLAG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/OperMenuDTO.java | 4 ++++ .../main/java/com/epmet/dto/result/OperMenuDTO.java | 12 ++++++++++++ .../main/java/com/epmet/entity/OperMenuEntity.java | 4 ++++ .../db/migration/V0.0.2__OperMenuAddShowFlag.sql | 1 + 4 files changed, 21 insertions(+) create mode 100644 epmet-module/oper-access/oper-access-server/src/main/resources/db/migration/V0.0.2__OperMenuAddShowFlag.sql diff --git a/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/OperMenuDTO.java b/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/OperMenuDTO.java index a98dcff26b..7241cd6c03 100644 --- a/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/OperMenuDTO.java +++ b/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/OperMenuDTO.java @@ -117,4 +117,8 @@ public class OperMenuDTO extends TreeStringNode implements Serializ */ private String parentName; + /** + * 是否显示,1:显示 0不显示 + */ + private String showFlag; } \ No newline at end of file diff --git a/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/result/OperMenuDTO.java b/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/result/OperMenuDTO.java index 41f02723df..51cb785d10 100644 --- a/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/result/OperMenuDTO.java +++ b/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/result/OperMenuDTO.java @@ -74,6 +74,10 @@ public class OperMenuDTO extends TreeNode implements Serializable { @ApiModelProperty(value = "上级菜单名称") private String parentName; + /** + * 是否显示,1:显示 0不显示 + */ + private String showFlag; public void setName(String name) { this.name = name; @@ -155,4 +159,12 @@ public class OperMenuDTO extends TreeNode implements Serializable { public void setParentName(String parentName) { this.parentName = parentName; } + + public String getShowFlag() { + return showFlag; + } + + public void setShowFlag(String showFlag) { + this.showFlag = showFlag; + } } diff --git a/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/entity/OperMenuEntity.java b/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/entity/OperMenuEntity.java index 549246c970..80de2089f0 100644 --- a/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/entity/OperMenuEntity.java +++ b/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/entity/OperMenuEntity.java @@ -64,4 +64,8 @@ public class OperMenuEntity extends BaseEpmetEntity { @TableField(exist = false) private String parentName; + /** + * 是否显示,1:显示 0不显示 + */ + private String showFlag; } diff --git a/epmet-module/oper-access/oper-access-server/src/main/resources/db/migration/V0.0.2__OperMenuAddShowFlag.sql b/epmet-module/oper-access/oper-access-server/src/main/resources/db/migration/V0.0.2__OperMenuAddShowFlag.sql new file mode 100644 index 0000000000..e7494131cc --- /dev/null +++ b/epmet-module/oper-access/oper-access-server/src/main/resources/db/migration/V0.0.2__OperMenuAddShowFlag.sql @@ -0,0 +1 @@ +alter table oper_menu add COLUMN `SHOW_FLAG` varchar(1) NOT NULL DEFAULT '1' COMMENT '是否显示,1:显示 0不显示'; From 494cf72802ffc2953bd35a2b8c266850ccc14036 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 24 Aug 2020 10:59:28 +0800 Subject: [PATCH 114/119] =?UTF-8?q?=E4=BF=AE=E6=94=B9oper=5Fmenu=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0SHOW=5FFLAGv2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/OperMenuDTO.java | 2 +- .../src/main/java/com/epmet/dto/result/OperMenuDTO.java | 6 +++--- .../src/main/java/com/epmet/entity/OperMenuEntity.java | 2 +- .../db/migration/V0.0.3__OperMenuAddShowFlagV1.sql | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 epmet-module/oper-access/oper-access-server/src/main/resources/db/migration/V0.0.3__OperMenuAddShowFlagV1.sql diff --git a/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/OperMenuDTO.java b/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/OperMenuDTO.java index 7241cd6c03..cdbc9567c2 100644 --- a/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/OperMenuDTO.java +++ b/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/OperMenuDTO.java @@ -120,5 +120,5 @@ public class OperMenuDTO extends TreeStringNode implements Serializ /** * 是否显示,1:显示 0不显示 */ - private String showFlag; + private Integer showFlag; } \ No newline at end of file diff --git a/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/result/OperMenuDTO.java b/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/result/OperMenuDTO.java index 51cb785d10..f71e1f5adc 100644 --- a/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/result/OperMenuDTO.java +++ b/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/result/OperMenuDTO.java @@ -77,7 +77,7 @@ public class OperMenuDTO extends TreeNode implements Serializable { /** * 是否显示,1:显示 0不显示 */ - private String showFlag; + private Integer showFlag; public void setName(String name) { this.name = name; @@ -160,11 +160,11 @@ public class OperMenuDTO extends TreeNode implements Serializable { this.parentName = parentName; } - public String getShowFlag() { + public Integer getShowFlag() { return showFlag; } - public void setShowFlag(String showFlag) { + public void setShowFlag(Integer showFlag) { this.showFlag = showFlag; } } diff --git a/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/entity/OperMenuEntity.java b/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/entity/OperMenuEntity.java index 80de2089f0..b1f69647c7 100644 --- a/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/entity/OperMenuEntity.java +++ b/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/entity/OperMenuEntity.java @@ -67,5 +67,5 @@ public class OperMenuEntity extends BaseEpmetEntity { /** * 是否显示,1:显示 0不显示 */ - private String showFlag; + private Integer showFlag; } diff --git a/epmet-module/oper-access/oper-access-server/src/main/resources/db/migration/V0.0.3__OperMenuAddShowFlagV1.sql b/epmet-module/oper-access/oper-access-server/src/main/resources/db/migration/V0.0.3__OperMenuAddShowFlagV1.sql new file mode 100644 index 0000000000..e9764bc121 --- /dev/null +++ b/epmet-module/oper-access/oper-access-server/src/main/resources/db/migration/V0.0.3__OperMenuAddShowFlagV1.sql @@ -0,0 +1 @@ +alter table oper_menu MODIFY COLUMN `SHOW_FLAG` int(11) NOT NULL DEFAULT 1 COMMENT '是否显示,1:显示 0不显示'; \ No newline at end of file From 260b2023f5825813f5309b5209c95bbaf4d43c7d Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 24 Aug 2020 11:05:15 +0800 Subject: [PATCH 115/119] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/CodeServiceImpl.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java index ce3a43181d..020dcf8782 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java @@ -408,20 +408,23 @@ public class CodeServiceImpl implements CodeService { @Override public List reason(CodeCommonFormDTO formDTO) { List resultList = new ArrayList<>(); - - //获取上传代码信息 - CodeCustomerDTO codeCustomerDTO = codeCustomerService.get(formDTO.getCodeId()); + if (StringUtils.isNotBlank(formDTO.getCodeId())) { + //获取上传代码信息 + CodeCustomerDTO codeCustomerDTO = codeCustomerService.get(formDTO.getCodeId()); + formDTO.setCustomerId(codeCustomerDTO.getCustomerId()); + formDTO.setClientType(codeCustomerDTO.getClientType()); + } //是否授权 - if (!customerMpService.getAuthFlag(codeCustomerDTO.getCustomerId(), codeCustomerDTO.getClientType())) { + if (!customerMpService.getAuthFlag(formDTO.getCustomerId(), formDTO.getClientType())) { throw new RenException("未授权"); } - AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(codeCustomerDTO.getCustomerId(), codeCustomerDTO.getClientType()); + AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), formDTO.getClientType()); if (null == authInfo) { throw new RenException("未授权"); } //获取审核结果信息 - List codeAuditResultList = codeAuditResultService.getAuditFailedList(codeCustomerDTO.getCustomerId(), - codeCustomerDTO.getClientType()); + List codeAuditResultList = codeAuditResultService.getAuditFailedList(formDTO.getCustomerId(), + formDTO.getClientType()); codeAuditResultList.forEach(dto -> { ReasonResultDTO result = new ReasonResultDTO(); result.setReason(dto.getReason()); @@ -500,9 +503,9 @@ public class CodeServiceImpl implements CodeService { public PageData history(CodeCommonFormDTO formDTO) { PageHelper.startPage(formDTO.getPage(), formDTO.getLimit()); //获取上传代码信息 - CodeCustomerDTO code = codeCustomerService.get(formDTO.getCodeId()); +// CodeCustomerDTO code = codeCustomerService.get(formDTO.getCodeId()); //获取上传代码信息 - List list = codeOperationHistoryService.getHistoryList(code.getCustomerId(), code.getClientType()); + List list = codeOperationHistoryService.getHistoryList(formDTO.getCustomerId(), formDTO.getClientType()); PageInfo pageInfo = new PageInfo<>(list); return new PageData<>(list, pageInfo.getTotal()); } From f1bb8220f2582a376c057c02c4eaa2071f7b46e8 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 24 Aug 2020 11:05:17 +0800 Subject: [PATCH 116/119] =?UTF-8?q?sql=E8=84=9A=E6=9C=AC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V0.0.4__add_customer_function_detail.sql | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql index 1c40bddd4c..dc4c5eba53 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql @@ -1,23 +1,23 @@ DROP TABLE IF EXISTS `customer_function_detail`; CREATE TABLE `customer_function_detail` ( - `ID` varchar(64) NOT NULL COMMENT ''主键'', - `CUSTOMER_ID` varchar(64) NOT NULL COMMENT ''客户Id'', - `FUNCTION_ID` varchar(64) NOT NULL COMMENT ''功能Id'', - `FUNCTION_NAME` varchar(128) NOT NULL COMMENT ''自定义功能名称'', - `ICON_LARGE_IMG` varchar(128) NOT NULL COMMENT ''自定义大图标'', - `ICON_SMALL_IMG` varchar(128) NOT NULL COMMENT ''自定义小图标'', - `DOMAIN_NAME` varchar(32) NOT NULL COMMENT ''自定义业务域名(可设置多个 用分号分隔)'', - `TARGET_LINK` varchar(128) NOT NULL COMMENT ''外链地址'', - `SHOPPING_STATUS` int(11) NOT NULL COMMENT ''上架状态(0.下架 1.上架)'', - `DISPLAY_ORDER` int(11) NOT NULL COMMENT ''自定义排序'', - `DEL_FLAG` int(11) NOT NULL COMMENT ''删除标识(0.未删除 1.已删除)'', - `REVISION` int(11) NOT NULL COMMENT ''乐观锁'', - `CREATED_BY` varchar(32) NOT NULL COMMENT ''创建人'', - `CREATED_TIME` datetime NOT NULL COMMENT ''创建时间'', - `UPDATED_BY` varchar(32) NOT NULL COMMENT ''更新人'', - `UPDATED_TIME` datetime NOT NULL COMMENT ''更新时间'', + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `FUNCTION_ID` varchar(64) NOT NULL COMMENT '功能Id', + `FUNCTION_NAME` varchar(128) NOT NULL COMMENT '自定义功能名称', + `ICON_LARGE_IMG` varchar(128) NOT NULL COMMENT '自定义大图标', + `ICON_SMALL_IMG` varchar(128) NOT NULL COMMENT '自定义小图标', + `DOMAIN_NAME` varchar(32) NOT NULL COMMENT '自定义业务域名(可设置多个 用分号分隔)', + `TARGET_LINK` varchar(128) NOT NULL COMMENT '外链地址', + `SHOPPING_STATUS` int(11) NOT NULL COMMENT '上架状态(0.下架 1.上架)', + `DISPLAY_ORDER` int(11) NOT NULL COMMENT '自定义排序', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识(0.未删除 1.已删除)', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', PRIMARY KEY (`ID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT=''客户定制功能详情表''; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客户定制功能详情表'; From 311eece9f9e2c57b9b570c410716df19be605e3a Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 24 Aug 2020 11:08:39 +0800 Subject: [PATCH 117/119] =?UTF-8?q?third=E5=8D=87=E7=BA=A7=EF=BC=8C?= =?UTF-8?q?=E4=BB=A3=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=AE=A1=E7=90=86=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-third-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/epmet-third/epmet-third-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml index 70d8556c45..d4706c5733 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.133 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.134 ports: - "8110:8110" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-third/epmet-third-server/pom.xml b/epmet-module/epmet-third/epmet-third-server/pom.xml index 1cf5691722..c1fe6fbd85 100644 --- a/epmet-module/epmet-third/epmet-third-server/pom.xml +++ b/epmet-module/epmet-third/epmet-third-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.133 + 0.0.134 com.epmet From 129507c3a0b49fade5db23c8ffa0445910ee10ce Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 24 Aug 2020 11:59:29 +0800 Subject: [PATCH 118/119] =?UTF-8?q?sql=E8=84=9A=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/V0.0.4__add_customer_function_detail.sql | 10 +++++----- .../resources/db/migration/V0.0.5__add_del_flag.sql | 6 ------ 2 files changed, 5 insertions(+), 11 deletions(-) delete mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.5__add_del_flag.sql diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql index dc4c5eba53..e6110440d3 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql @@ -6,7 +6,7 @@ CREATE TABLE `customer_function_detail` ( `FUNCTION_NAME` varchar(128) NOT NULL COMMENT '自定义功能名称', `ICON_LARGE_IMG` varchar(128) NOT NULL COMMENT '自定义大图标', `ICON_SMALL_IMG` varchar(128) NOT NULL COMMENT '自定义小图标', - `DOMAIN_NAME` varchar(32) NOT NULL COMMENT '自定义业务域名(可设置多个 用分号分隔)', + `DOMAIN_NAME` varchar(128) NOT NULL COMMENT '自定义业务域名(可设置多个 用分号分隔)', `TARGET_LINK` varchar(128) NOT NULL COMMENT '外链地址', `SHOPPING_STATUS` int(11) NOT NULL COMMENT '上架状态(0.下架 1.上架)', `DISPLAY_ORDER` int(11) NOT NULL COMMENT '自定义排序', @@ -21,10 +21,9 @@ CREATE TABLE `customer_function_detail` ( -ALTER TABLE `function_customized` ADD COLUMN `DOMAIN_NAME` VARCHAR (128) CHARACTER -SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '业务域名(可设置多个 用分号分隔)' AFTER `UPDATED_TIME`, - ADD COLUMN `FROM_APP` VARCHAR (32) CHARACTER -SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '来源app(政府端:gov、居民端:resi)' AFTER `REALM_NAME`; +ALTER TABLE `function_customized` +ADD COLUMN `DOMAIN_NAME` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '业务域名(可设置多个 用分号分隔)' AFTER `UPDATED_TIME`, +ADD COLUMN `FROM_APP` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '来源app(政府端:gov、居民端:resi)' AFTER `DOMAIN_NAME`; DROP TABLE IF EXISTS `function_customized_visited`; @@ -54,6 +53,7 @@ CREATE TABLE function_shopping_history( FUNCTION_ID VARCHAR(64) NOT NULL COMMENT '功能Id' , SHOPPING_STATUS INT NOT NULL COMMENT '上下架状态 上架状态:0:下架、1:上架' , REASON VARCHAR(1024) NOT NULL COMMENT '理由' , + DEL_FLAG INT NOT NULL COMMENT '删除标识(0.未删除 1.已删除)' , REVISION INT NOT NULL COMMENT '乐观锁' , CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.5__add_del_flag.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.5__add_del_flag.sql deleted file mode 100644 index e34bafd2b5..0000000000 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.5__add_del_flag.sql +++ /dev/null @@ -1,6 +0,0 @@ -ALTER TABLE function_shopping_history ADD ( DEL_FLAG INT ( 11 ) NOT NULL COMMENT '删除标识(0.未删除 1.已删除)'); - - -ALTER TABLE `customer_function_detail` -MODIFY COLUMN `DOMAIN_NAME` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '自定义业务域名(可设置多个 用分号分隔)' AFTER `ICON_SMALL_IMG`; - From 26e4c91902242067b83655ef8b718e1f18d3bf97 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 24 Aug 2020 14:03:16 +0800 Subject: [PATCH 119/119] =?UTF-8?q?sql=E8=84=9A=E6=9C=AC=E5=88=A0=E9=99=A4?= =?UTF-8?q?drop=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.4__add_customer_function_detail.sql | 3 --- 1 file changed, 3 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql index e6110440d3..b792d95677 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql @@ -1,4 +1,3 @@ -DROP TABLE IF EXISTS `customer_function_detail`; CREATE TABLE `customer_function_detail` ( `ID` varchar(64) NOT NULL COMMENT '主键', `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', @@ -26,7 +25,6 @@ ADD COLUMN `DOMAIN_NAME` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_gen ADD COLUMN `FROM_APP` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '来源app(政府端:gov、居民端:resi)' AFTER `DOMAIN_NAME`; -DROP TABLE IF EXISTS `function_customized_visited`; CREATE TABLE function_customized_visited( ID VARCHAR(64) NOT NULL COMMENT '主键' , CUSTOMER_ID VARCHAR(32) NOT NULL COMMENT '客户ID' , @@ -46,7 +44,6 @@ CREATE TABLE function_customized_visited( ) COMMENT = '定制功能访问记录表 记录居民端、工作端那些人访问过定制功能以及访问的结果'; -DROP TABLE IF EXISTS `function_shopping_history`; CREATE TABLE function_shopping_history( ID VARCHAR(64) NOT NULL COMMENT '主键' , CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户Id' ,