wanggaokun 1 жил өмнө
parent
commit
de0ce17cf1

+ 13 - 21
eco-common/common-excel/src/main/java/org/eco/common/excel/utils/ExcelUtil.java

@@ -236,13 +236,7 @@ public class ExcelUtil {
      * @param os           输出流
      */
     public static void exportTemplate(List<Object> data, String templatePath, OutputStream os) {
-        ClassPathResource templateResource = new ClassPathResource(templatePath);
-        ExcelWriter excelWriter = EasyExcel.write(os)
-            .withTemplate(templateResource.getStream())
-            .autoCloseStream(false)
-            // 大数值自动转换 防止失真
-            .registerConverter(new ExcelBigNumberConvert())
-            .build();
+        ExcelWriter excelWriter = getExcelWriter(templatePath, os);
         WriteSheet writeSheet = EasyExcel.writerSheet().build();
         if (CollUtil.isEmpty(data)) {
             throw new IllegalArgumentException("数据为空");
@@ -254,6 +248,16 @@ public class ExcelUtil {
         excelWriter.finish();
     }
 
+    private static ExcelWriter getExcelWriter(String templatePath, OutputStream os) {
+        ClassPathResource templateResource = new ClassPathResource(templatePath);
+        return EasyExcel.write(os)
+            .withTemplate(templateResource.getStream())
+            .autoCloseStream(false)
+            // 大数值自动转换 防止失真
+            .registerConverter(new ExcelBigNumberConvert())
+            .build();
+    }
+
     /**
      * 多表多数据模板导出 模板格式为 {key.属性}
      *
@@ -305,13 +309,7 @@ public class ExcelUtil {
      * @param os           输出流
      */
     public static void exportTemplateMultiList(Map<String, Object> data, String templatePath, OutputStream os) {
-        ClassPathResource templateResource = new ClassPathResource(templatePath);
-        ExcelWriter excelWriter = EasyExcel.write(os)
-            .withTemplate(templateResource.getStream())
-            .autoCloseStream(false)
-            // 大数值自动转换 防止失真
-            .registerConverter(new ExcelBigNumberConvert())
-            .build();
+        ExcelWriter excelWriter = getExcelWriter(templatePath, os);
         WriteSheet writeSheet = EasyExcel.writerSheet().build();
         if (CollUtil.isEmpty(data)) {
             throw new IllegalArgumentException("数据为空");
@@ -339,13 +337,7 @@ public class ExcelUtil {
      * @param os           输出流
      */
     public static void exportTemplateMultiSheet(List<Map<String, Object>> data, String templatePath, OutputStream os) {
-        ClassPathResource templateResource = new ClassPathResource(templatePath);
-        ExcelWriter excelWriter = EasyExcel.write(os)
-            .withTemplate(templateResource.getStream())
-            .autoCloseStream(false)
-            // 大数值自动转换 防止失真
-            .registerConverter(new ExcelBigNumberConvert())
-            .build();
+        ExcelWriter excelWriter = getExcelWriter(templatePath, os);
         if (CollUtil.isEmpty(data)) {
             throw new IllegalArgumentException("数据为空");
         }

+ 1 - 1
eco-common/common-redis/pom.xml

@@ -17,7 +17,7 @@
     </description>
 
     <dependencies>
-        <!-- Km Common Core-->
+        <!-- eco Common Core-->
         <dependency>
             <groupId>org.eco</groupId>
             <artifactId>common-core</artifactId>

+ 1 - 1
eco-common/common-security/pom.xml

@@ -23,7 +23,7 @@
             <artifactId>common-core</artifactId>
         </dependency>
 
-        <!-- Km Common Redis-->
+        <!-- eco Common Redis-->
         <dependency>
             <groupId>org.eco</groupId>
             <artifactId>common-redis</artifactId>

+ 2 - 2
eco-extra/powerjob-server/src/main/resources/application-dev.properties

@@ -2,7 +2,7 @@ oms.env=dev
 ####### Database properties(Configure according to the the environment) #######
 #spring.datasource.remote.hibernate.properties.hibernate.dialect=tech.powerjob.server.persistence.config.dialect.PowerJobPGDialect
 #spring.datasource.core.driver-class-name=org.postgresql.Driver
-#spring.datasource.core.jdbc-url=jdbc:postgresql://localhost:5432/km?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
+#spring.datasource.core.jdbc-url=jdbc:postgresql://localhost:5432/eco?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
 #spring.datasource.core.username=postgres
 #spring.datasource.core.password=P3x0LG8jzyHRX59l
 ## DM数据库连接参数
@@ -14,7 +14,7 @@ spring.datasource.core.password=SYSDBA123
 ## MySQL数据库连接参数
 #spring.datasource.remote.hibernate.properties.hibernate.dialect=tech.powerjob.server.persistence.config.dialect.PowerJobPGDialect
 #spring.datasource.core.driver-class-name=com.mysql.cj.jdbc.Driver
-#spring.datasource.core.jdbc-url=jdbc:mysql://localhost:3306/km?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
+#spring.datasource.core.jdbc-url=jdbc:mysql://localhost:3306/eco?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
 #spring.datasource.core.username=root
 #spring.datasource.core.password=Root@369
 spring.datasource.core.maximum-pool-size=20

+ 1 - 1
eco-modules/system/src/main/java/org/eco/system/service/ISysRoleMenuService.java

@@ -4,7 +4,7 @@ import org.eco.system.domain.SysRoleMenu;
 import org.eco.common.orm.core.service.IBaseService;
 
 /**
- * km
+ * ISysRoleMenuService
  *
  * @author wgk
  */

+ 1 - 1
eco-modules/system/src/main/java/org/eco/system/service/ISysUserPostService.java

@@ -4,7 +4,7 @@ import org.eco.system.domain.SysUserPost;
 import org.eco.common.orm.core.service.IBaseService;
 
 /**
- * km
+ * ISysUserPostService
  *
  * @author wgk
  */

+ 1 - 2
eco-modules/system/src/main/java/org/eco/system/service/impl/SysUserPostServiceImpl.java

@@ -14,10 +14,9 @@ import java.util.Arrays;
 import static org.eco.system.domain.table.SysUserPostTableDef.SYS_USER_POST;
 
 /**
- * km
+ * SysUserPostServiceImpl
  *
  * @author wgk
- * @author wgk
  */
 @Service
 public class SysUserPostServiceImpl extends BaseServiceImpl<SysUserPostMapper, SysUserPost> implements ISysUserPostService {

+ 12 - 12
eco-start/src/main/resources/application-dev.yml

@@ -39,12 +39,12 @@ mybatis-flex:
       type: ${spring.datasource.type}
       # mysql数据库
       #      driver-class-name: com.mysql.cj.jdbc.Driver
-      #      url: jdbc:mysql://localhost:3306/km?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
+      #      url: jdbc:mysql://localhost:3306/eco?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
       #      username: root
       #      password: Root@369
       #postgresql数据库
 #      driver-class-name: org.postgresql.Driver
-#      url: jdbc:postgresql://localhost:5432/km?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
+#      url: jdbc:postgresql://localhost:5432/eco?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
 #      username: postgres
 #      password: P3x0LG8jzyHRX59l
       #DM8数据库
@@ -59,12 +59,12 @@ mybatis-flex:
 #      type: ${spring.datasource.type}
 #      # mysql数据库
 #      driver-class-name: com.mysql.cj.jdbc.Driver
-#      url: jdbc:mysql://localhost:3306/km?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
+#      url: jdbc:mysql://localhost:3306/eco?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
 #      username: root
 #      password: Root@369
 #      #postgresql数据库
 ##      driver-class-name: org.postgresql.Driver
-##      url: jdbc:postgresql://localhost:5432/km?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
+##      url: jdbc:postgresql://localhost:5432/eco?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
 ##      username: postgres
 ##      password: postgres@369
 
@@ -86,7 +86,7 @@ spring.data:
 
 redisson:
   # redis key前缀
-  keyPrefix: km
+  keyPrefix: eco
   # 线程池数量
   threads: 4
   # Netty线程池数量
@@ -94,7 +94,7 @@ redisson:
   # 单节点配置
   singleServerConfig:
     # 客户端名称
-    clientName: ${km.name}
+    clientName: ${eco.name}
     # 最小空闲连接数
     connectionMinimumIdleSize: 8
     # 连接池大小
@@ -106,23 +106,23 @@ redisson:
     # 发布和订阅连接池大小
     subscriptionConnectionPoolSize: 50
 
---- # 监控中心客户端配置
+--- # 监控中心客户端配置 false true
 spring.boot.admin.client:
   # 增加客户端开关
-  enabled: true
+  enabled: false
   url: http://localhost:9099/admin
   instance:
     service-host-type: IP
-  username: km
+  username: eco
   password: 123456
 
 --- # powerjob 配置
 powerjob:
   worker:
-    # 如何开启调度中心请查看文档教程
-    enabled: true
+    # 如何开启调度中心请查看文档教程 false true
+    enabled: false
     # 需要先在 powerjob 登录页执行应用注册后才能使用
-    app-name: km-worker
+    app-name: eco-worker
     # 28080 端口 随着主应用端口飘逸 避免集群冲突
     port: 2${server.port}
     protocol: http

+ 3 - 3
eco-start/src/main/resources/application-prod.yml

@@ -30,7 +30,7 @@ mybatis-flex:
       type: ${spring.datasource.type}
       # mysql数据库
       #      driver-class-name: com.mysql.cj.jdbc.Driver
-      #      url: jdbc:mysql://localhost:3306/km?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
+      #      url: jdbc:mysql://localhost:3306/eco?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
       #      username: root
       #      password: Root@369
       #postgresql数据库
@@ -45,12 +45,12 @@ mybatis-flex:
 #      type: ${spring.datasource.type}
 #      # mysql数据库
 #      driver-class-name: com.mysql.cj.jdbc.Driver
-#      url: jdbc:mysql://localhost:3306/km?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
+#      url: jdbc:mysql://localhost:3306/eco?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true
 #      username: root
 #      password: Root@369
 #      #postgresql数据库
 ##      driver-class-name: org.postgresql.Driver
-##      url: jdbc:postgresql://localhost:5432/km?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
+##      url: jdbc:postgresql://localhost:5432/eco?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
 ##      username: postgres
 ##      password: postgres@369
 

+ 10 - 10
eco-start/src/main/resources/application.yml

@@ -1,15 +1,15 @@
 # 项目相关配置
-km:
+eco:
   # 名称
-  name: KM
+  name: eco
   # 版本
   version: ${revision}
   # 版权年份
   copyrightYear: 2023 ~ 2024
   # 实例演示开关
   demoEnabled: true
-  # 文件路径 示例( Windows配置D:/km/uploadPath,Linux配置 /home/km/uploadPath)
-  profile: D:/km/uploadPath
+  # 文件路径 示例( Windows配置D:/eco/uploadPath,Linux配置 /home/eco/uploadPath)
+  profile: D:/eco/uploadPath
   # 获取ip地址开关
   addressEnabled: false
 
@@ -75,7 +75,7 @@ user:
 # Spring配置
 spring:
   application:
-    name: ${km.name}
+    name: ${eco.name}
   threads:
     # 启用JAVA21虚拟线程
     virtual:
@@ -210,16 +210,16 @@ springdoc:
   enable-spring-security: true
   info:
     # 标题
-    title: 'Km-Flex API Doc'
+    title: 'ECO API Doc'
     # 描述
-    description: 'Km-Flex SpringDoc demo'
+    description: 'eco SpringDoc demo'
     # 版本
-    version: '版本号: ${km.version}'
+    version: '版本号: ${eco.version}'
     # 作者信息
     contact:
-      name: km
+      name: eco
       email: 123434@qq.com
-      url: https://gitee.com/gaokunw/km
+      url: https://gitee.com/gaokunw/eco
   components:
     # 鉴权方式配置
     security-schemes:

+ 1 - 1
eco-start/src/main/resources/db/dm/V1_0_0_1__sys-init-dml.sql

@@ -45,7 +45,7 @@ VALUES (108150551736287232, 0, 1, '0,1', 'test2', 2, 'asd', '', null, '0', 2, 0,
 INSERT INTO "km"."sys_dept"("dept_id", "tenant_id", "parent_id", "ancestors", "dept_name", "order_num", "leader",
                             "phone", "email", "status", "version", "del_flag", "create_by", "create_time", "update_by",
                             "update_time")
-VALUES (1, 0, 0, '0', 'KM', 0, 'km-flex', '18888888888', 'dataprince@foxmail.com', '0', 5, 0, 1,
+VALUES (1, 0, 0, '0', 'eco', 0, 'eco', '18888888888', 'dataprince@foxmail.com', '0', 5, 0, 1,
         TO_DATE('2023-06-03 21:32:28.000000', 'YYYY-MM-DD HH24:MI:SS.FF'), 1,
         TO_DATE('2024-04-24 17:19:16.446000', 'YYYY-MM-DD HH24:MI:SS.FF'));
 

+ 1 - 1
script/bin/km.bat

@@ -2,7 +2,7 @@ rem 使用者应根据自身平台编码自行转换 防止乱码 例如 win使
 @echo off
 
 rem jar平级目录
-set AppName=km-admin.jar
+set AppName=eco-admin.jar
 
 rem JVM参数
 set JVM_OPTS="-Dname=%AppName%  -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Xlog:gc*,:time,tags,level -XX:+UseZGC"