diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java index d56c9fb99..7103332f8 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java @@ -1,8 +1,8 @@ /** * Copyright (c) 2018 人人开源 All rights reserved. - * + *

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

* 版权所有,侵权必究! */ @@ -75,4 +75,8 @@ public interface ServiceConstant { * websocket服务 */ String EPDC_WEBSOCKET_SERVER = "epdc-websocket-server"; + /** + * 绩效考核模块 + */ + String EPDC_KPI_SERVER = "epdc-kpi-server"; } diff --git a/esua-epdc/epdc-gateway/pom.xml b/esua-epdc/epdc-gateway/pom.xml index 70d3ca31d..57384ded8 100644 --- a/esua-epdc/epdc-gateway/pom.xml +++ b/esua-epdc/epdc-gateway/pom.xml @@ -120,6 +120,7 @@ http://127.0.0.1:9063 lb://epdc-websocket-server + lb://epdc-kpi-server false 47.104.224.45:8848 @@ -158,6 +159,7 @@ lb://epdc-demo-server lb://epdc-group-server lb://epdc-websocket-server + lb://epdc-kpi-server true @@ -191,6 +193,7 @@ lb://epdc-demo-server lb://epdc-group-server lb://epdc-websocket-server + lb://epdc-kpi-server 8 diff --git a/esua-epdc/epdc-gateway/src/main/resources/application.yml b/esua-epdc/epdc-gateway/src/main/resources/application.yml index b671dc490..cb98c62d6 100644 --- a/esua-epdc/epdc-gateway/src/main/resources/application.yml +++ b/esua-epdc/epdc-gateway/src/main/resources/application.yml @@ -138,6 +138,14 @@ spring: - Path=${server.servlet.context-path}/ws/** filters: - StripPrefix=1 + #绩效考核模块 + - id: epdc-kpi-server + uri: @gateway.routes.epdc-kpi-server.uri@ + order: 16 + predicates: + - Path=${server.servlet.context-path}/kpi/** + filters: + - StripPrefix=1 nacos: discovery: server-addr: @nacos.server-addr@ diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/pom.xml b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/pom.xml new file mode 100644 index 000000000..0e6be7261 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-client/pom.xml @@ -0,0 +1,15 @@ + + + + epdc-kpi + com.esua.epdc + 1.0.0 + + 4.0.0 + + epdc-kpi-client + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/pom.xml b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/pom.xml new file mode 100644 index 000000000..696114d91 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/pom.xml @@ -0,0 +1,169 @@ + + + + epdc-kpi + com.esua.epdc + 1.0.0 + + 4.0.0 + + epdc-kpi-server + + + com.esua.epdc + epdc-kpi-client + 1.0.0 + + + com.esua.epdc + epdc-commons-tools + 1.0.0 + + + com.esua.epdc + epdc-commons-mybatis + 1.0.0 + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework + spring-context-support + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + de.codecentric + spring-boot-admin-starter-client + ${spring.boot.admin.version} + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + com.spotify + docker-maven-plugin + + + + ${project.basedir}/src/main/java + + + + true + ${basedir}/src/main/resources + + **/application*.yml + **/*.properties + logback-spring.xml + registry.conf + + + + ${basedir}/src/main/resources + + **/application*.yml + **/*.properties + logback-spring.xml + registry.conf + + + + + + + + + dev + + true + + + dev + + 9987 + + 2 + 47.104.224.45 + 6379 + elink@888 + + + + + epdc + elink833066 + + false + 47.104.224.45:8848 + + + + + test + + test + + 9987 + + 2 + 47.104.224.45 + 6379 + elink@888 + + + + + epdc + elink833066 + + true + 47.104.224.45:8848 + + + + + prod + + prod + + 9987 + + 8 + 121.42.149.50 + 9001 + elink888 + + + + + epdc + elink833066 + + true + 172.31.171.61:9300 + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/epdc/esua/KpiApplication.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/epdc/esua/KpiApplication.java new file mode 100644 index 000000000..8032f1958 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/epdc/esua/KpiApplication.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.elink.epdc.esua; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; + +/** + * 绩效考核模块 + * + * @author work@yujt.net.cn + * @date 2019/11/26 09:13 + */ +@SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients +public class KpiApplication { + + public static void main(String[] args) { + SpringApplication.run(KpiApplication.class, args); + } + +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/epdc/esua/config/ModuleConfigImpl.java b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/epdc/esua/config/ModuleConfigImpl.java new file mode 100644 index 000000000..3dd8672dc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/java/com/elink/epdc/esua/config/ModuleConfigImpl.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.elink.epdc.esua.config; + +import com.elink.esua.epdc.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 "kpi"; + } +} diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/application.yml new file mode 100644 index 000000000..f754286a1 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/application.yml @@ -0,0 +1,88 @@ +server: + port: @server.port@ + servlet: + context-path: /kpi + +spring: + main: + allow-bean-definition-overriding: true + application: + name: epdc-kpi-server + # 环境 dev|test|prod + profiles: + active: dev + messages: + encoding: UTF-8 + basename: i18n/messages,i18n/messages_common + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + redis: + database: @spring.redis.index@ + host: @spring.redis.host@ + timeout: 30s + port: @spring.redis.port@ + password: @spring.redis.password@ + datasource: + druid: + 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@ + register-enabled: @nacos.register-enabled@ + alibaba: + seata: + tx-service-group: epdc-kpi-server-fescar-service-group + +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +feign: + hystrix: + enabled: true + httpclient: + enabled: true + +hystrix: + command: + default: + execution: + isolation: + thread: + timeoutInMilliseconds: 60000 #缺省为1000 + +ribbon: + ReadTimeout: 300000 + ConnectTimeout: 300000 + +mybatis-plus: + mapper-locations: classpath:/mapper/**/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.elink.esua.epdc.entity + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: ID_WORKER + #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" + 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' + diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/messages.properties b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/messages.properties new file mode 100644 index 000000000..fa686c6ce --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/messages.properties @@ -0,0 +1,3 @@ +#Default +100005001=token\u4E0D\u80FD\u4E3A\u7A7A +100005002=token\u5931\u6548\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55 \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/messages_en_US.properties b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/messages_en_US.properties new file mode 100644 index 000000000..274cb2bf6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/messages_en_US.properties @@ -0,0 +1,3 @@ +#English +100005001=Token cannot be empty +100005002=Token is invalid, please log in again \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/messages_zh_CN.properties b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/messages_zh_CN.properties new file mode 100644 index 000000000..7fa4392c3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/messages_zh_CN.properties @@ -0,0 +1,3 @@ +#\u7B80\u4F53\u4E2D\u6587 +100005001=token\u4E0D\u80FD\u4E3A\u7A7A +100005002=token\u5931\u6548\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55 \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/messages_zh_TW.properties b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/messages_zh_TW.properties new file mode 100644 index 000000000..a31a2407b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/messages_zh_TW.properties @@ -0,0 +1,3 @@ +#\u7E41\u4F53\u4E2D\u6587 +100005001=token\u4E0D\u80FD\u70BA\u7A7A +100005002=token\u5931\u6548\uFF0C\u8ACB\u91CD\u65B0\u767B\u9304 \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/validation.properties b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/validation.properties new file mode 100644 index 000000000..4392e7d7a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/validation.properties @@ -0,0 +1,3 @@ +#Default +api.mobile.require=\u624B\u673A\u53F7\u4E0D\u80FD\u4E3A\u7A7A +api.password.require=\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/validation_en_US.properties b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/validation_en_US.properties new file mode 100644 index 000000000..190187fc0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/validation_en_US.properties @@ -0,0 +1,3 @@ +#English +api.mobile.require=The phone number cannot be empty +api.password.require=Password cannot be empty \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/validation_zh_CN.properties b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/validation_zh_CN.properties new file mode 100644 index 000000000..830527147 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/validation_zh_CN.properties @@ -0,0 +1,3 @@ +#\u7B80\u4F53\u4E2D\u6587 +api.mobile.require=\u624B\u673A\u53F7\u4E0D\u80FD\u4E3A\u7A7A +api.password.require=\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/validation_zh_TW.properties b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/validation_zh_TW.properties new file mode 100644 index 000000000..9864e110b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/i18n/validation_zh_TW.properties @@ -0,0 +1,3 @@ +#\u7E41\u4F53\u4E2D\u6587 +api.mobile.require=\u624B\u6A5F\u865F\u4E0D\u80FD\u70BA\u7A7A +api.password.require=\u5BC6\u78BC\u4E0D\u80FD\u70BA\u7A7A \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/logback-spring.xml b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/logback-spring.xml new file mode 100644 index 000000000..66da8917f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/logback-spring.xml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%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} [%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} [%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} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/registry.conf b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/registry.conf new file mode 100644 index 000000000..bccc306f5 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/epdc-kpi-server/src/main/resources/registry.conf @@ -0,0 +1,21 @@ +registry { + # file 、nacos 、eureka、redis、zk、consul、etcd3、sofa + type = "nacos" + + nacos { + serverAddr = "@nacos.server-addr@" + namespace = "public" + cluster = "default" + } +} + +config { + # file、nacos 、apollo、zk、consul、etcd3 + type = "nacos" + + nacos { + serverAddr = "nacos.server-addr" + namespace = "public" + cluster = "default" + } +} diff --git a/esua-epdc/epdc-module/epdc-kpi/pom.xml b/esua-epdc/epdc-module/epdc-kpi/pom.xml new file mode 100644 index 000000000..067480b11 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-kpi/pom.xml @@ -0,0 +1,20 @@ + + + + epdc-module + com.esua.epdc + 1.0.0 + + 4.0.0 + + epdc-kpi + pom + + epdc-kpi-client + epdc-kpi-server + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/java/com/elink/esua/epdc/controller/OssController.java b/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/java/com/elink/esua/epdc/controller/OssController.java index b0012a429..b06953395 100644 --- a/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/java/com/elink/esua/epdc/controller/OssController.java +++ b/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/src/main/java/com/elink/esua/epdc/controller/OssController.java @@ -35,17 +35,12 @@ import io.swagger.annotations.ApiOperation; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import springfox.documentation.annotations.ApiIgnore; import sun.misc.BASE64Decoder; -import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; -import java.io.FileInputStream; -import java.io.IOException; -import java.net.URLEncoder; import java.util.Arrays; import java.util.Map; @@ -116,14 +111,13 @@ public class OssController { //上传文件 String extension = FilenameUtils.getExtension(file.getOriginalFilename()); String url = OssFactory.build().uploadSuffix(file.getBytes(), extension); - return ossService.afterUpload(url, file.getSize()); } /** * 下载阿里云oss服务器上的文件 * - * @param url 完整的访问链接 + * @param fileUrl 完整的访问链接 * @param response 浏览器返回 * @return void * @author work@yujt.net.cn diff --git a/esua-epdc/epdc-module/pom.xml b/esua-epdc/epdc-module/pom.xml index 1eb51a51c..179020534 100644 --- a/esua-epdc/epdc-module/pom.xml +++ b/esua-epdc/epdc-module/pom.xml @@ -28,6 +28,7 @@ epdc-demo epdc-group epdc-websocket + epdc-kpi