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 01/39] =?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 02/39] =?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 03/39] =?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 04/39] =?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 05/39] =?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 06/39] =?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 07/39] =?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 08/39] =?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 09/39] =?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 10/39] =?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 11/39] =?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 12/39] =?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 13/39] =?UTF-8?q?=E5=AE=9A=E5=88=B6=E5=8A=9F=E8=83=BD-=20?= =?UTF-8?q?=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 14/39] =?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 15/39] =?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 16/39] =?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 17/39] =?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 18/39] =?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 19/39] =?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 20/39] =?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 21/39] =?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 22/39] =?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 23/39] =?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 24/39] =?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 25/39] =?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 26/39] =?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 27/39] =?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 28/39] =?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 29/39] =?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 30/39] =?UTF-8?q?third=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 --- .../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 31/39] =?UTF-8?q?third=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 --- .../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 32/39] =?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 33/39] =?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 34/39] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=B5=8B=E8=AF=95contr?= =?UTF-8?q?oller?= 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 35/39] =?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 36/39] =?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 37/39] =?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 31d5fcc31f71dd888540e37da8d3a811375193cb Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 18 Aug 2020 09:10:29 +0800 Subject: [PATCH 38/39] =?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 d9cb1ba8d0b558a186fdf7d3842bacdeb4512600 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 18 Aug 2020 10:37:00 +0800 Subject: [PATCH 39/39] =?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; - - }