Просмотр исходного кода

fix(重新整理模块):
删除无用模块

18339543638 2 лет назад
Родитель
Сommit
1792a78eb0
98 измененных файлов с 412 добавлено и 3028 удалено
  1. 19 21
      tr-dependencies/pom.xml
  2. 1 0
      tr-modules-api/pom.xml
  3. 21 0
      tr-modules-api/tr-module-export-api/src/main/java/cn/tr/module/api/export/annotation/ExcelDict.java
  4. 27 0
      tr-modules-api/tr-module-system-api/src/main/java/cn/tr/module/api/sys/dict/SysDictApi.java
  5. 2 2
      tr-modules-api/tr-module-system-api/src/main/java/cn/tr/module/api/sys/log/annotation/OperateLog.java
  6. 2 4
      tr-modules-api/tr-module-system-api/src/main/java/cn/tr/module/api/sys/log/bo/OperateLogBO.java
  7. 1 1
      tr-modules-api/tr-module-system-api/src/main/java/cn/tr/module/api/sys/log/enums/LoginType.java
  8. 1 1
      tr-modules/pom.xml
  9. 11 1
      tr-modules/tr-module-export/pom.xml
  10. 27 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/core/converter/BooleanConverter.java
  11. 50 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/core/converter/DictCodeConverter.java
  12. 43 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/core/converter/DictItemConverter.java
  13. 36 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/core/dto/ExcelTemplateDescDTO.java
  14. 40 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/core/utils/ExcelTemplateDescUtil.java
  15. 0 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/mapper/SysExportRowMapper.java
  16. 0 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/mapper/SysExportSheetMapper.java
  17. 0 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/row/config/StdRowHandlerListener.java
  18. 0 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/row/dto/SysExportRowDTO.java
  19. 0 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/row/dto/SysExportRowQueryDTO.java
  20. 0 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/row/po/SysExportRowPO.java
  21. 0 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/row/repository/SysExportRowRepository.java
  22. 0 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/row/service/ISysExportRowService.java
  23. 0 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/row/service/impl/SysExportRowServiceImpl.java
  24. 0 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/sheet/config/HandleSheetConfig.java
  25. 26 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/sheet/controller/SysExportSheetController.java
  26. 0 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/sheet/dto/SysExportSheetDTO.java
  27. 0 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/sheet/dto/SysExportSheetQueryDTO.java
  28. 0 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/sheet/po/SysExportSheetPO.java
  29. 0 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/sheet/repository/SysExportSheetRepository.java
  30. 0 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/sheet/service/IExcelService.java
  31. 0 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/sheet/service/ISysExportSheetService.java
  32. 0 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/sheet/service/impl/ExcelServiceImpl.java
  33. 0 0
      tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/sheet/service/impl/SysExportSheetServiceImpl.java
  34. 0 0
      tr-modules/tr-module-export/src/main/resources/application-unit-test.yml
  35. 1 1
      tr-modules/tr-module-gen/src/main/resources/backend/Controller.java.btl
  36. 5 0
      tr-modules/tr-module-quartz/pom.xml
  37. 1 1
      tr-modules/tr-module-quartz/src/main/java/cn/tr/module/quartz/job/controller/SysJobController.java
  38. 1 1
      tr-modules/tr-module-quartz/src/main/java/cn/tr/module/quartz/jobLog/controller/SysJobLogController.java
  39. 0 10
      tr-modules/tr-module-system/pom.xml
  40. 1 1
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/constant/controller/SysConstantConfigController.java
  41. 1 1
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/constant/controller/SysConstantMenuController.java
  42. 1 1
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/dict/controller/SysDictController.java
  43. 1 1
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/dict/controller/SysDictItemController.java
  44. 49 0
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/dict/provider/SysDictProvider.java
  45. 12 6
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/log/aspect/OperateLogAspect.java
  46. 0 27
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/log/config/LoginConfig.java
  47. 1 1
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/log/mapper/SysLogMapper.java
  48. 1 1
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/numStrategy/controller/SysNumberingStrategyController.java
  49. 2 2
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/oauth2/controller/OAuth2ServerController.java
  50. 1 1
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/sms/controller/SysSmsChannelController.java
  51. 1 1
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/sms/controller/SysSmsLogController.java
  52. 1 1
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/sms/controller/SysSmsTempController.java
  53. 1 1
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/storage/controller/SysStorageConfigController.java
  54. 1 1
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/storage/controller/SysStorageRecordController.java
  55. 1 1
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/tenant/controller/SysTenantController.java
  56. 1 1
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/tenant/controller/SysTenantPackageController.java
  57. 1 1
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/controller/SysOrgController.java
  58. 1 2
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/controller/SysPortalController.java
  59. 1 1
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/controller/SysPositionController.java
  60. 1 1
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/controller/SysRoleController.java
  61. 1 1
      tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/controller/SysUserController.java
  62. 0 5
      tr-plugins/pom.xml
  63. 0 59
      tr-plugins/tr-spring-boot-starter-plugin-biz-excel/pom.xml
  64. 0 19
      tr-plugins/tr-spring-boot-starter-plugin-biz-excel/src/main/java/cn/tr/plugin/excel/TrExcelAutoConfiguration.java
  65. 0 188
      tr-plugins/tr-spring-boot-starter-plugin-biz-excel/src/main/java/cn/tr/plugin/excel/annotation/Excel.java
  66. 0 18
      tr-plugins/tr-spring-boot-starter-plugin-biz-excel/src/main/java/cn/tr/plugin/excel/annotation/Excels.java
  67. 0 19
      tr-plugins/tr-spring-boot-starter-plugin-biz-excel/src/main/java/cn/tr/plugin/excel/config/ExcelHandlerAdapter.java
  68. 0 1513
      tr-plugins/tr-spring-boot-starter-plugin-biz-excel/src/main/java/cn/tr/plugin/excel/config/ExcelHelper.java
  69. 0 36
      tr-plugins/tr-spring-boot-starter-plugin-biz-excel/src/main/java/cn/tr/plugin/excel/config/ExcelHelperFactory.java
  70. 0 46
      tr-plugins/tr-spring-boot-starter-plugin-biz-excel/src/main/java/cn/tr/plugin/excel/config/ExcelThreadFactory.java
  71. 0 1
      tr-plugins/tr-spring-boot-starter-plugin-biz-excel/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  72. 0 0
      tr-plugins/tr-spring-boot-starter-plugin-biz-excel/src/main/resources/base64
  73. 0 116
      tr-plugins/tr-spring-boot-starter-plugin-biz-excel/src/test/java/cn/tr/plugin/excel/ExcelTest.java
  74. 0 60
      tr-plugins/tr-spring-boot-starter-plugin-dict/pom.xml
  75. 0 24
      tr-plugins/tr-spring-boot-starter-plugin-dict/src/main/java/cn/tr/plugin/dict/TrDictAutoConfiguration.java
  76. 0 40
      tr-plugins/tr-spring-boot-starter-plugin-dict/src/main/java/cn/tr/plugin/dict/annotation/Dict.java
  77. 0 61
      tr-plugins/tr-spring-boot-starter-plugin-dict/src/main/java/cn/tr/plugin/dict/bo/DictBO.java
  78. 0 85
      tr-plugins/tr-spring-boot-starter-plugin-dict/src/main/java/cn/tr/plugin/dict/config/cache/DictManager.java
  79. 0 42
      tr-plugins/tr-spring-boot-starter-plugin-dict/src/main/java/cn/tr/plugin/dict/config/jackson/DictJacksonDeserializer.java
  80. 0 58
      tr-plugins/tr-spring-boot-starter-plugin-dict/src/main/java/cn/tr/plugin/dict/config/jackson/DictJacksonSerializer.java
  81. 0 17
      tr-plugins/tr-spring-boot-starter-plugin-dict/src/main/java/cn/tr/plugin/dict/constant/DictConstant.java
  82. 0 1
      tr-plugins/tr-spring-boot-starter-plugin-dict/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  83. 0 17
      tr-plugins/tr-spring-boot-starter-plugin-dict/src/main/resources/application-unit-test.yml
  84. 0 74
      tr-plugins/tr-spring-boot-starter-plugin-dict/src/test/java/cn/tr/plugin/dict/config/cache/CaffeineDictManagerTest.java
  85. 0 115
      tr-plugins/tr-spring-boot-starter-plugin-dict/src/test/java/cn/tr/plugin/dict/config/cache/RedisDictManagerTest.java
  86. 0 75
      tr-plugins/tr-spring-boot-starter-plugin-dict/src/test/java/cn/tr/plugin/dict/config/jackson/DictJacksonSerializerTest.java
  87. 0 40
      tr-plugins/tr-spring-boot-starter-plugin-flink/pom.xml
  88. 0 19
      tr-plugins/tr-spring-boot-starter-plugin-flink/src/main/java/cn/tr/plugin/flink/TrFlinkAutoConfiguration.java
  89. 0 1
      tr-plugins/tr-spring-boot-starter-plugin-flink/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  90. 0 46
      tr-plugins/tr-spring-boot-starter-plugin-flink/src/test/java/cn/tr/plugin/fink/FlinkTest.java
  91. 0 1
      tr-plugins/tr-spring-boot-starter-plugin-import-export/src/main/java/cn/tr/plugin/excel/CompositeExcelTemplateFacade.java
  92. 0 28
      tr-plugins/tr-spring-boot-starter-plugin-mq/pom.xml
  93. 0 43
      tr-plugins/tr-spring-boot-starter-plugin-operatelog/pom.xml
  94. 0 19
      tr-plugins/tr-spring-boot-starter-plugin-operatelog/src/main/java/cn/tr/plugin/operatelog/TrOperateLogAutoConfiguration.java
  95. 0 27
      tr-plugins/tr-spring-boot-starter-plugin-operatelog/src/main/java/cn/tr/plugin/operatelog/strategy/OperateStrategy.java
  96. 0 1
      tr-plugins/tr-spring-boot-starter-plugin-operatelog/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  97. 2 13
      tr-test/pom.xml
  98. 14 4
      tr-test/src/test/java/cn/tr/module/excel/CompositeExcelTemplateFacadeTest.java

+ 19 - 21
tr-dependencies/pom.xml

@@ -72,6 +72,8 @@
         <bus-rabbit.version>3.1.2</bus-rabbit.version>
 
         <easy-captcha.version>1.6.2</easy-captcha.version>
+
+        <easy-excel.version>3.3.1</easy-excel.version>
     </properties>
 
 
@@ -350,13 +352,6 @@
                 <version>${revision}</version>
             </dependency>
 
-            <!--字典插件-->
-            <dependency>
-                <groupId>cn.tr</groupId>
-                <artifactId>tr-spring-boot-starter-plugin-dict</artifactId>
-                <version>${revision}</version>
-            </dependency>
-
             <!--日志记录插件-->
             <dependency>
                 <groupId>cn.tr</groupId>
@@ -400,20 +395,6 @@
                 <version>${revision}</version>
             </dependency>
 
-            <!--表格插件-->
-            <dependency>
-                <groupId>cn.tr</groupId>
-                <artifactId>tr-spring-boot-starter-plugin-biz-excel</artifactId>
-                <version>${revision}</version>
-            </dependency>
-
-            <!--导入导出-->
-            <dependency>
-                <groupId>cn.tr</groupId>
-                <artifactId>tr-spring-boot-starter-plugin-import-export</artifactId>
-                <version>${revision}</version>
-            </dependency>
-
             <!--websocket插件-->
             <dependency>
                 <groupId>cn.tr</groupId>
@@ -456,6 +437,13 @@
                 <version>${revision}</version>
             </dependency>
 
+            <!--导出api模块-->
+            <dependency>
+                <groupId>cn.tr</groupId>
+                <artifactId>tr-module-export-api</artifactId>
+                <version>${revision}</version>
+            </dependency>
+
             <!--短信模块-->
             <dependency>
                 <groupId>cn.tr</groupId>
@@ -489,6 +477,16 @@
                 <artifactId>spring-cloud-starter-bus-amqp</artifactId>
                 <version>${bus-rabbit.version}</version>
             </dependency>
+
+
+
+
+
+            <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>easyexcel</artifactId>
+                <version>${easy-excel.version}</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 </project>

+ 1 - 0
tr-modules-api/pom.xml

@@ -13,6 +13,7 @@
     <packaging>pom</packaging>
     <modules>
         <module>tr-module-system-api</module>
+        <module>tr-module-export-api</module>
     </modules>
 
 

+ 21 - 0
tr-modules-api/tr-module-export-api/src/main/java/cn/tr/module/api/export/annotation/ExcelDict.java

@@ -0,0 +1,21 @@
+package cn.tr.module.api.export.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * @@interface : ExcelDict
+ * @Description :
+ * @Author : LF
+ * @Date: 2023年05月19日
+ */
+@Target(ElementType.FIELD)
+@Retention(RetentionPolicy.RUNTIME)
+@Inherited
+public @interface ExcelDict {
+    /**
+     * 字典码
+     * 1、导出时会根据字典码自动生成下拉菜单
+     * 2、导出时会根据字段值自动返回字典值
+     */
+    String dictCode() default "";
+}

+ 27 - 0
tr-modules-api/tr-module-system-api/src/main/java/cn/tr/module/api/sys/dict/SysDictApi.java

@@ -0,0 +1,27 @@
+package cn.tr.module.api.sys.dict;
+
+import cn.hutool.core.lang.Pair;
+import java.util.*;
+/**
+ * @ClassName : SysDictApi
+ * @Description :
+ * @Author : LF
+ * @Date: 2023年05月19日
+ */
+
+public interface SysDictApi {
+    /**
+     * 查找字典值
+     * @param dictCode 字典编码
+     * @param itemKey  键值对key
+     * @return
+     */
+    String findDictItem(String dictCode,String itemKey);
+
+    /**
+     * 找到字典码下的所有字典值
+     * @param dictCode
+     * @return
+     */
+    List<Pair<String,String>> findAllDictItemsByCode(String dictCode);
+}

+ 2 - 2
tr-plugins/tr-spring-boot-starter-plugin-operatelog/src/main/java/cn/tr/plugin/operatelog/annotation/OperateLog.java → tr-modules-api/tr-module-system-api/src/main/java/cn/tr/module/api/sys/log/annotation/OperateLog.java

@@ -1,6 +1,6 @@
-package cn.tr.plugin.operatelog.annotation;
+package cn.tr.module.api.sys.log.annotation;
 
-import cn.tr.plugin.operatelog.enums.LoginType;
+import cn.tr.module.api.sys.log.enums.LoginType;
 import io.swagger.annotations.ApiOperation;
 
 import java.lang.annotation.ElementType;

+ 2 - 4
tr-plugins/tr-spring-boot-starter-plugin-operatelog/src/main/java/cn/tr/plugin/operatelog/bo/OperateLogBO.java → tr-modules-api/tr-module-system-api/src/main/java/cn/tr/module/api/sys/log/bo/OperateLogBO.java

@@ -1,10 +1,8 @@
-package cn.tr.plugin.operatelog.bo;
+package cn.tr.module.api.sys.log.bo;
 
 import lombok.Data;
 
-import java.time.LocalDateTime;
 import java.util.Date;
-import java.util.Map;
 
 /**
  * 操作日志
@@ -60,7 +58,7 @@ public class OperateLogBO {
 
     /**
      * 日志类型
-     * {@link cn.tr.plugin.operatelog.enums.LoginType}
+     * {@link cn.tr.module.api.sys.log.enums.LoginType}
      */
     private String type;
 }

+ 1 - 1
tr-plugins/tr-spring-boot-starter-plugin-operatelog/src/main/java/cn/tr/plugin/operatelog/enums/LoginType.java → tr-modules-api/tr-module-system-api/src/main/java/cn/tr/module/api/sys/log/enums/LoginType.java

@@ -1,4 +1,4 @@
-package cn.tr.plugin.operatelog.enums;
+package cn.tr.module.api.sys.log.enums;
 
 import lombok.Getter;
 

+ 1 - 1
tr-modules/pom.xml

@@ -15,7 +15,7 @@
     <modules>
         <module>tr-module-system</module>
         <module>tr-module-gen</module>
-        <module>tr-module-import-export</module>
+        <module>tr-module-export</module>
         <module>tr-module-quartz</module>
     </modules>
 

+ 11 - 1
tr-modules/tr-module-import-export/pom.xml → tr-modules/tr-module-export/pom.xml

@@ -9,7 +9,7 @@
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>tr-module-import-export</artifactId>
+    <artifactId>tr-module-export</artifactId>
     <version>${revision}</version>
 
     <description>文件导出中心</description>
@@ -50,5 +50,15 @@
             <groupId>cn.tr</groupId>
             <artifactId>tr-spring-boot-starter-plugin-import-export</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>cn.tr</groupId>
+            <artifactId>tr-module-export-api</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>cn.tr</groupId>
+            <artifactId>tr-module-system-api</artifactId>
+        </dependency>
     </dependencies>
 </project>

+ 27 - 0
tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/core/converter/BooleanConverter.java

@@ -0,0 +1,27 @@
+package cn.tr.module.excel.core.converter;
+
+import com.alibaba.excel.converters.Converter;
+import com.alibaba.excel.metadata.GlobalConfiguration;
+import com.alibaba.excel.metadata.data.WriteCellData;
+import com.alibaba.excel.metadata.property.ExcelContentProperty;
+
+/**
+ * @ClassName : BooleanConverter
+ * @Description :
+ * @Author : LF
+ * @Date: 2023年05月19日
+ */
+
+public class BooleanConverter implements Converter<Boolean> {
+    @Override
+    public Class<Boolean> supportJavaTypeKey() {
+        return Boolean.class;
+    }
+
+    @Override
+    public WriteCellData<?> convertToExcelData(Boolean value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
+        WriteCellData<Object> cellData = new WriteCellData<>();
+        cellData.setStringValue(Boolean.TRUE.equals(value)?"是":"否");
+        return cellData;
+    }
+}

+ 50 - 0
tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/core/converter/DictCodeConverter.java

@@ -0,0 +1,50 @@
+package cn.tr.module.excel.core.converter;
+
+import cn.hutool.core.lang.Pair;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.extra.spring.SpringUtil;
+import cn.tr.module.api.sys.dict.SysDictApi;
+import com.alibaba.excel.converters.Converter;
+import com.alibaba.excel.metadata.GlobalConfiguration;
+import com.alibaba.excel.metadata.data.WriteCellData;
+import com.alibaba.excel.metadata.property.ExcelContentProperty;
+
+import java.util.List;
+
+/**
+ * @ClassName : DictCodeConverter
+ * @Description : 字典编码转换器
+ * @Author : LF
+ * @Date: 2023年05月19日
+ */
+
+public class DictCodeConverter implements Converter<String> {
+    private final SysDictApi dictApi;
+    public DictCodeConverter() {
+        dictApi = SpringUtil.getBean(SysDictApi.class);
+    }
+
+    @Override
+    public Class<String> supportJavaTypeKey() {
+        return String.class;
+    }
+
+    @Override
+    public WriteCellData<?> convertToExcelData(String dictCode, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
+        WriteCellData<String> cellData = new WriteCellData<>();
+        if(StrUtil.isNotEmpty(dictCode)){
+            return cellData;
+        }
+        List<Pair<String, String>> items = dictApi.findAllDictItemsByCode(dictCode);
+        cellData.setStringValue(buildString(items));
+        return cellData;
+    }
+
+    private String buildString(List<Pair<String, String>> items){
+        StringBuilder result = new StringBuilder();
+        for (Pair<String, String> item : items) {
+            result.append("-").append(item.getKey()).append("(").append(item.getValue()).append(")").append("\n");
+        }
+        return result.toString();
+    }
+}

+ 43 - 0
tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/core/converter/DictItemConverter.java

@@ -0,0 +1,43 @@
+package cn.tr.module.excel.core.converter;
+
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.extra.spring.SpringUtil;
+import cn.tr.module.api.export.annotation.ExcelDict;
+import cn.tr.module.api.sys.dict.SysDictApi;
+import com.alibaba.excel.converters.Converter;
+import com.alibaba.excel.metadata.GlobalConfiguration;
+import com.alibaba.excel.metadata.data.WriteCellData;
+import com.alibaba.excel.metadata.property.ExcelContentProperty;
+
+/**
+ * @ClassName : DictItemConverter
+ * @Description : 字典值转换器
+ *                与{@link cn.tr.module.api.export.annotation.ExcelDict }一起结合使用
+ * @Author : LF
+ * @Date: 2023年05月19日
+ */
+
+public class DictItemConverter  implements Converter<String> {
+    private final SysDictApi dictApi;
+    public DictItemConverter() {
+        dictApi = SpringUtil.getBean(SysDictApi.class);
+    }
+    @Override
+    public Class<String> supportJavaTypeKey() {
+        return String.class;
+    }
+
+    @Override
+    public WriteCellData<?> convertToExcelData(String itemKey, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
+        WriteCellData<String> cellData = new WriteCellData<>();
+        if(StrUtil.isNotEmpty(itemKey)){
+            return cellData;
+        }
+        ExcelDict excelDict = contentProperty.getField().getAnnotation(ExcelDict.class);
+        if(excelDict==null||StrUtil.isEmpty(excelDict.dictCode())){
+            return cellData;
+        }
+        cellData.setStringValue(dictApi.findDictItem(excelDict.dictCode(), itemKey));
+        return cellData;
+    }
+}

+ 36 - 0
tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/core/dto/ExcelTemplateDescDTO.java

@@ -0,0 +1,36 @@
+package cn.tr.module.excel.core.dto;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import lombok.Data;
+import cn.tr.module.excel.core.converter.*;
+
+/**
+ * @ClassName : ExcelTemplateDescDTO
+ * @Description : 模板注释实体类
+ * @Author : LF
+ * @Date: 2023年05月19日
+ */
+@Data
+public class ExcelTemplateDescDTO {
+    @ExcelProperty("列名")
+    private String title;
+
+    @ExcelProperty("字段名")
+    private String fieldName;
+
+    @ExcelProperty(value = "是否为字典值",converter = BooleanConverter.class)
+    private Boolean dict;
+
+    @ExcelProperty(value = "是否必输",converter = BooleanConverter.class)
+    private Boolean addNeed;
+
+    @ExcelProperty("字典值")
+    private String dictCode;
+
+    @ExcelProperty(value = "备注",converter = DictCodeConverter.class)
+    private String remark;
+
+    public String getRemark() {
+        return Boolean.TRUE.equals(dict)?dictCode:remark;
+    }
+}

+ 40 - 0
tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/core/utils/ExcelTemplateDescUtil.java

@@ -0,0 +1,40 @@
+package cn.tr.module.excel.core.utils;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.tr.module.api.export.annotation.ExcelDict;
+import cn.tr.module.excel.core.dto.ExcelTemplateDescDTO;
+import com.alibaba.excel.annotation.ExcelProperty;
+import org.springframework.util.ReflectionUtils;
+import javax.validation.constraints.NotNull;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/**
+ * @ClassName : ExcelTemplateDescHelper
+ * @Description :
+ * @Author : LF
+ * @Date: 2023年05月19日
+ */
+public class ExcelTemplateDescUtil {
+    public static List<ExcelTemplateDescDTO> createExportTemplate(Class aClass){
+        List<ExcelTemplateDescDTO> result = new ArrayList<>();
+        ReflectionUtils.doWithFields(aClass,field -> {
+            ExcelProperty excelProperty = field.getAnnotation(ExcelProperty.class);
+            if(excelProperty==null){
+                return;
+            }
+            ExcelTemplateDescDTO desc = new ExcelTemplateDescDTO();
+            ExcelDict excelDict = field.getAnnotation(ExcelDict.class);
+            NotNull notNull = field.getAnnotation(NotNull.class);
+            desc.setTitle(CollectionUtil.getLast(Stream.of(excelProperty.value()).collect(Collectors.toList())));
+            desc.setFieldName(field.getName());
+            desc.setDict(excelDict!=null);
+            desc.setDictCode(excelDict!=null?excelDict.dictCode():null);
+            desc.setAddNeed(notNull!=null);
+            result.add(desc);
+        });
+        return result;
+    }
+}

+ 0 - 0
tr-modules/tr-module-import-export/src/main/java/cn/tr/module/excel/mapper/SysExportRowMapper.java → tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/mapper/SysExportRowMapper.java


+ 0 - 0
tr-modules/tr-module-import-export/src/main/java/cn/tr/module/excel/mapper/SysExportSheetMapper.java → tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/mapper/SysExportSheetMapper.java


+ 0 - 0
tr-modules/tr-module-import-export/src/main/java/cn/tr/module/excel/row/config/StdRowHandlerListener.java → tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/row/config/StdRowHandlerListener.java


+ 0 - 0
tr-modules/tr-module-import-export/src/main/java/cn/tr/module/excel/row/dto/SysExportRowDTO.java → tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/row/dto/SysExportRowDTO.java


+ 0 - 0
tr-modules/tr-module-import-export/src/main/java/cn/tr/module/excel/row/dto/SysExportRowQueryDTO.java → tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/row/dto/SysExportRowQueryDTO.java


+ 0 - 0
tr-modules/tr-module-import-export/src/main/java/cn/tr/module/excel/row/po/SysExportRowPO.java → tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/row/po/SysExportRowPO.java


+ 0 - 0
tr-modules/tr-module-import-export/src/main/java/cn/tr/module/excel/row/repository/SysExportRowRepository.java → tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/row/repository/SysExportRowRepository.java


+ 0 - 0
tr-modules/tr-module-import-export/src/main/java/cn/tr/module/excel/row/service/ISysExportRowService.java → tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/row/service/ISysExportRowService.java


+ 0 - 0
tr-modules/tr-module-import-export/src/main/java/cn/tr/module/excel/row/service/impl/SysExportRowServiceImpl.java → tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/row/service/impl/SysExportRowServiceImpl.java


+ 0 - 0
tr-modules/tr-module-import-export/src/main/java/cn/tr/module/excel/sheet/config/HandleSheetConfig.java → tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/sheet/config/HandleSheetConfig.java


+ 26 - 0
tr-modules/tr-module-import-export/src/main/java/cn/tr/module/excel/sheet/controller/SysExportSheetController.java → tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/sheet/controller/SysExportSheetController.java

@@ -1,16 +1,24 @@
 package cn.tr.module.excel.sheet.controller;
 
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.annotation.ExcelProperty;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import cn.tr.core.pojo.CommonResult;
 import lombok.AllArgsConstructor;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import lombok.Data;
+import lombok.NoArgsConstructor;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RestController;
 import cn.tr.module.excel.sheet.dto.SysExportSheetDTO;
 import cn.tr.module.excel.sheet.service.ISysExportSheetService;
 import cn.tr.plugin.mybatis.base.BaseController;
 import org.springframework.web.bind.annotation.*;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Collections;
+
 /**
  * 导入工作簿记录表控制器
  *
@@ -31,4 +39,22 @@ public class SysExportSheetController extends BaseController{
     public CommonResult<SysExportSheetDTO> findById(@PathVariable("id") String id){
         return CommonResult.success(sysExportSheetService.selectSysExportSheetById(id));
     }
+
+    public static void main(String[] args) throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
+        EasyExcel.write("C:\\Users\\JR\\Desktop\\test1.xls", User.class).inMemory(true).sheet(0,"模板")
+                .doWrite(Collections.singleton(User.class));
+    }
+
+
+    @AllArgsConstructor(staticName = "of")
+    @Data
+    @NoArgsConstructor
+    static class User{
+        @ExcelProperty("姓名")
+        private String name;
+        @ExcelProperty("生日")
+        private String  birthday;
+        @ExcelProperty("年龄")
+        private Integer age;
+    }
 }

+ 0 - 0
tr-modules/tr-module-import-export/src/main/java/cn/tr/module/excel/sheet/dto/SysExportSheetDTO.java → tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/sheet/dto/SysExportSheetDTO.java


+ 0 - 0
tr-modules/tr-module-import-export/src/main/java/cn/tr/module/excel/sheet/dto/SysExportSheetQueryDTO.java → tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/sheet/dto/SysExportSheetQueryDTO.java


+ 0 - 0
tr-modules/tr-module-import-export/src/main/java/cn/tr/module/excel/sheet/po/SysExportSheetPO.java → tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/sheet/po/SysExportSheetPO.java


+ 0 - 0
tr-modules/tr-module-import-export/src/main/java/cn/tr/module/excel/sheet/repository/SysExportSheetRepository.java → tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/sheet/repository/SysExportSheetRepository.java


+ 0 - 0
tr-modules/tr-module-import-export/src/main/java/cn/tr/module/excel/sheet/service/IExcelService.java → tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/sheet/service/IExcelService.java


+ 0 - 0
tr-modules/tr-module-import-export/src/main/java/cn/tr/module/excel/sheet/service/ISysExportSheetService.java → tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/sheet/service/ISysExportSheetService.java


+ 0 - 0
tr-modules/tr-module-import-export/src/main/java/cn/tr/module/excel/sheet/service/impl/ExcelServiceImpl.java → tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/sheet/service/impl/ExcelServiceImpl.java


+ 0 - 0
tr-modules/tr-module-import-export/src/main/java/cn/tr/module/excel/sheet/service/impl/SysExportSheetServiceImpl.java → tr-modules/tr-module-export/src/main/java/cn/tr/module/excel/sheet/service/impl/SysExportSheetServiceImpl.java


+ 0 - 0
tr-modules/tr-module-import-export/src/main/resources/application-unit-test.yml → tr-modules/tr-module-export/src/main/resources/application-unit-test.yml


+ 1 - 1
tr-modules/tr-module-gen/src/main/resources/backend/Controller.java.btl

@@ -19,7 +19,7 @@ import ${packageName}.${backendModuleName}.${busName}.dto.${className}QueryDTO;
 import java.util.*;
 import cn.tr.plugin.mybatis.base.BaseController;
 import org.springframework.web.bind.annotation.*;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
 import cn.tr.core.pojo.TableDataInfo;
 /**
  * ${functionName}控制器

+ 5 - 0
tr-modules/tr-module-quartz/pom.xml

@@ -51,6 +51,11 @@
             <artifactId>commons-lang3</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>cn.tr</groupId>
+            <artifactId>tr-module-system-api</artifactId>
+        </dependency>
+
         <dependency>
             <groupId>cn.tr</groupId>
             <artifactId>tr-spring-boot-starter-plugin-eventbus</artifactId>

+ 1 - 1
tr-modules/tr-module-quartz/src/main/java/cn/tr/module/quartz/job/controller/SysJobController.java

@@ -29,7 +29,7 @@ import cn.tr.module.quartz.job.dto.SysJobQueryDTO;
 import java.util.*;
 import cn.tr.plugin.mybatis.base.BaseController;
 import org.springframework.web.bind.annotation.*;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
 import cn.tr.core.pojo.TableDataInfo;
 /**
  * 定时任务调度表控制器

+ 1 - 1
tr-modules/tr-module-quartz/src/main/java/cn/tr/module/quartz/jobLog/controller/SysJobLogController.java

@@ -16,7 +16,7 @@ import cn.tr.module.quartz.jobLog.dto.SysJobLogQueryDTO;
 import java.util.*;
 import cn.tr.plugin.mybatis.base.BaseController;
 import org.springframework.web.bind.annotation.*;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
 import cn.tr.core.pojo.TableDataInfo;
 /**
  * 定时任务调度日志表控制器

+ 0 - 10
tr-modules/tr-module-system/pom.xml

@@ -13,11 +13,6 @@
     <version>${revision}</version>
 
     <dependencies>
-        <dependency>
-            <groupId>cn.tr</groupId>
-            <artifactId>tr-spring-boot-starter-plugin-dict</artifactId>
-        </dependency>
-
         <dependency>
             <groupId>cn.tr</groupId>
             <artifactId>tr-spring-boot-starter-plugin-numbering-strategy</artifactId>
@@ -44,11 +39,6 @@
             </exclusions>
         </dependency>
 
-        <dependency>
-            <groupId>cn.tr</groupId>
-            <artifactId>tr-spring-boot-starter-plugin-biz-excel</artifactId>
-        </dependency>
-
         <dependency>
             <groupId>cn.tr</groupId>
             <artifactId>tr-spring-boot-starter-plugin-satoken</artifactId>

+ 1 - 1
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/constant/controller/SysConstantConfigController.java

@@ -19,7 +19,7 @@ import cn.tr.module.sys.constant.dto.SysConstantConfigQueryDTO;
 import java.util.*;
 import cn.tr.plugin.mybatis.base.BaseController;
 import org.springframework.web.bind.annotation.*;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
 import cn.tr.core.pojo.TableDataInfo;
 /**
  * 常量配置控制器

+ 1 - 1
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/constant/controller/SysConstantMenuController.java

@@ -19,7 +19,7 @@ import cn.tr.module.sys.constant.dto.SysConstantMenuQueryDTO;
 import java.util.*;
 import cn.tr.plugin.mybatis.base.BaseController;
 import org.springframework.web.bind.annotation.*;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
 import cn.tr.core.pojo.TableDataInfo;
 /**
  * 常量菜单控制器

+ 1 - 1
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/dict/controller/SysDictController.java

@@ -9,7 +9,7 @@ import cn.tr.module.sys.dict.dto.SysDictDTO;
 import cn.tr.module.sys.dict.dto.SysDictQueryDTO;
 import cn.tr.module.sys.dict.service.ISysDictService;
 import cn.tr.plugin.mybatis.base.BaseController;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;

+ 1 - 1
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/dict/controller/SysDictItemController.java

@@ -12,7 +12,7 @@ import cn.tr.module.sys.dict.dto.SysDictItemSmallDTO;
 import cn.tr.module.sys.dict.service.ISysDictItemService;
 import cn.tr.module.sys.dict.service.ISysDictService;
 import cn.tr.plugin.mybatis.base.BaseController;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;

+ 49 - 0
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/dict/provider/SysDictProvider.java

@@ -0,0 +1,49 @@
+package cn.tr.module.sys.dict.provider;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.lang.Pair;
+import cn.hutool.core.util.StrUtil;
+import cn.tr.module.api.sys.dict.SysDictApi;
+import cn.tr.module.sys.dict.dto.SysDictItemSmallDTO;
+import cn.tr.module.sys.dict.service.ISysDictItemService;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @ClassName : SysDictProvider
+ * @Description :
+ * @Author : LF
+ * @Date: 2023年05月19日
+ */
+@Component
+@AllArgsConstructor
+public class SysDictProvider implements SysDictApi {
+    private final ISysDictItemService dictItemService;
+
+    @Override
+    public String findDictItem(String dictCode, String itemKey) {
+        List<SysDictItemSmallDTO> dictItems = dictItemService.selectDictItemsByDictCode(dictCode);
+        if(CollectionUtil.isNotEmpty(dictItems)){
+            for (SysDictItemSmallDTO dictItem : dictItems) {
+                if (StrUtil.equals(dictItem.getValue(), itemKey)) {
+                    return dictItem.getLabel();
+                }
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public List<Pair<String, String>> findAllDictItemsByCode(String dictCode) {
+        List<SysDictItemSmallDTO> dictItems = dictItemService.selectDictItemsByDictCode(dictCode);
+        if(CollectionUtil.isNotEmpty(dictItems)){
+            return dictItems.stream()
+                    .map(item-> Pair.of(item.getValue(),item.getLabel()))
+                    .collect(Collectors.toList());
+        }
+        return null;
+    }
+}

+ 12 - 6
tr-plugins/tr-spring-boot-starter-plugin-operatelog/src/main/java/cn/tr/plugin/operatelog/config/OperateLogAspect.java → tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/log/aspect/OperateLogAspect.java

@@ -1,4 +1,4 @@
-package cn.tr.plugin.operatelog.config;
+package cn.tr.module.sys.log.aspect;
 
 import cn.hutool.core.date.DateUnit;
 import cn.hutool.core.date.DateUtil;
@@ -11,12 +11,15 @@ import cn.tr.core.strategy.LoginUserStrategy;
 import cn.tr.core.utils.IpUtil;
 import cn.tr.core.utils.JsonUtils;
 import cn.tr.core.utils.ServletUtils;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
-import cn.tr.plugin.operatelog.bo.OperateLogBO;
-import cn.tr.plugin.operatelog.enums.LoginType;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
+import cn.tr.module.api.sys.log.bo.OperateLogBO;
+import cn.tr.module.api.sys.log.enums.LoginType;
+import cn.tr.module.sys.log.mapper.SysLogMapper;
+import cn.tr.module.sys.log.service.ISysLogService;
 import cn.tr.plugin.operatelog.strategy.OperateStrategy;
 import cn.tr.plugin.web.context.RequestContextHolder;
 import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.aspectj.lang.ProceedingJoinPoint;
 import org.aspectj.lang.annotation.Around;
@@ -27,12 +30,12 @@ import org.springframework.core.annotation.AnnotationUtils;
 import org.springframework.expression.ExpressionParser;
 import org.springframework.expression.spel.standard.SpelExpressionParser;
 import org.springframework.expression.spel.support.StandardEvaluationContext;
+import org.springframework.stereotype.Component;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.multipart.MultipartFile;
 
-import javax.security.auth.login.LoginContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.lang.annotation.Annotation;
@@ -50,7 +53,10 @@ import java.util.stream.IntStream;
  */
 @Aspect
 @Slf4j
+@Component
+@AllArgsConstructor
 public class OperateLogAspect {
+    private final ISysLogService logService;
     @Around("@annotation(operateLog)")
     // 兼容处理,只添加 @OperateLog 注解的情况
     public Object around(ProceedingJoinPoint joinPoint,
@@ -109,7 +115,7 @@ public class OperateLogAspect {
         // 补全方法信息
         fillMethodFields(log, joinPoint, operateLog, startTime, result, exception);
         // 异步记录日志
-        OperateStrategy.tr.saveLog(log);
+        logService.insertSysLog(SysLogMapper.INSTANCE.convertDto(log));
     }
 
 

+ 0 - 27
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/log/config/LoginConfig.java

@@ -1,27 +0,0 @@
-package cn.tr.module.sys.log.config;
-
-import cn.tr.module.sys.log.service.ISysLogService;
-import cn.tr.module.sys.log.mapper.SysLogMapper;
-import cn.tr.plugin.operatelog.strategy.OperateStrategy;
-import lombok.AllArgsConstructor;
-import org.springframework.context.annotation.Configuration;
-
-import javax.annotation.PostConstruct;
-
-/**
- * @ClassName : LoginConfig
- * @Description :
- * @Author : LF
- * @Date: 2023年04月18日
- */
-@Configuration
-@AllArgsConstructor
-public class LoginConfig {
-    private final ISysLogService logService;
-    @PostConstruct
-    public void init(){
-        OperateStrategy.tr.logSaveConsumer=log->{
-            logService.insertSysLog(SysLogMapper.INSTANCE.convertDto(log));
-        };
-    }
-}

+ 1 - 1
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/log/mapper/SysLogMapper.java

@@ -2,7 +2,7 @@ package cn.tr.module.sys.log.mapper;
 
 import cn.tr.module.sys.log.po.SysLogPO;
 import cn.tr.module.sys.log.dto.SysLogDTO;
-import cn.tr.plugin.operatelog.bo.OperateLogBO;
+import cn.tr.module.api.sys.log.bo.OperateLogBO;
 import org.mapstruct.Mapper;
 import org.mapstruct.factory.Mappers;
 

+ 1 - 1
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/numStrategy/controller/SysNumberingStrategyController.java

@@ -19,7 +19,7 @@ import cn.tr.module.sys.numStrategy.dto.SysNumberingStrategyQueryDTO;
 import java.util.*;
 import cn.tr.plugin.mybatis.base.BaseController;
 import org.springframework.web.bind.annotation.*;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
 import cn.tr.core.pojo.TableDataInfo;
 /**
  * 编号策略控制器

+ 2 - 2
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/oauth2/controller/OAuth2ServerController.java

@@ -19,8 +19,8 @@ import cn.tr.module.sys.oauth2.psw.operator.AbstractOAuth2PswUserOperator;
 import cn.tr.module.sys.oauth2.dto.OAuth2PswReqDTO;
 import cn.tr.module.sys.oauth2.dto.OAuth2RefreshDTO;
 import cn.tr.module.sys.oauth2.psw.operator.OAuth2PswUserOperatorManager;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
-import cn.tr.plugin.operatelog.enums.LoginType;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
+import cn.tr.module.api.sys.log.enums.LoginType;
 import cn.tr.plugin.security.context.LoginUserContextHolder;
 import cn.tr.plugin.security.utils.SaTokenUtils;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;

+ 1 - 1
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/sms/controller/SysSmsChannelController.java

@@ -20,7 +20,7 @@ import cn.tr.module.sys.sms.dto.SysSmsChannelQueryDTO;
 import java.util.*;
 import cn.tr.plugin.mybatis.base.BaseController;
 import org.springframework.web.bind.annotation.*;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
 /**
  * 短信渠道控制器
  *

+ 1 - 1
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/sms/controller/SysSmsLogController.java

@@ -17,7 +17,7 @@ import cn.tr.module.sys.sms.dto.SysSmsLogQueryDTO;
 import java.util.*;
 import cn.tr.plugin.mybatis.base.BaseController;
 import org.springframework.web.bind.annotation.*;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
 /**
  * 短信日志控制器
  *

+ 1 - 1
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/sms/controller/SysSmsTempController.java

@@ -12,7 +12,7 @@ import cn.tr.module.sys.sms.service.ISmsSendService;
 import cn.tr.module.sys.sms.service.ISysSmsTempService;
 import cn.tr.core.enums.CreateEnum;
 import cn.tr.plugin.mybatis.base.BaseController;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;

+ 1 - 1
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/storage/controller/SysStorageConfigController.java

@@ -19,7 +19,7 @@ import cn.tr.module.sys.storage.dto.SysStorageConfigQueryDTO;
 import java.util.*;
 import cn.tr.plugin.mybatis.base.BaseController;
 import org.springframework.web.bind.annotation.*;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
 import cn.tr.core.pojo.TableDataInfo;
 /**
  * 文件存储配置控制器

+ 1 - 1
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/storage/controller/SysStorageRecordController.java

@@ -19,7 +19,7 @@ import cn.tr.module.sys.storage.dto.SysStorageRecordQueryDTO;
 import java.util.*;
 import cn.tr.plugin.mybatis.base.BaseController;
 import org.springframework.web.bind.annotation.*;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
 import cn.tr.core.pojo.TableDataInfo;
 /**
  * 存储记录控制器

+ 1 - 1
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/tenant/controller/SysTenantController.java

@@ -3,7 +3,7 @@ package cn.tr.module.sys.tenant.controller;
 import cn.tr.module.sys.tenant.dto.SysTenantAddDTO;
 import cn.tr.module.sys.tenant.dto.SysTenantCommonDTO;
 import cn.tr.core.enums.CreateEnum;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.tr.core.validation.Insert;

+ 1 - 1
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/tenant/controller/SysTenantPackageController.java

@@ -5,7 +5,7 @@ import cn.tr.module.sys.tenant.dto.SysTenantPackageMenuAssignDTO;
 import cn.tr.module.sys.tenant.service.ISysTenantPackageMenuService;
 import cn.tr.module.sys.user.dto.SysMenuDTO;
 import cn.tr.core.enums.CreateEnum;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.tr.core.validation.Insert;

+ 1 - 1
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/controller/SysOrgController.java

@@ -10,7 +10,7 @@ import cn.tr.module.sys.user.dto.SysOrgQueryDTO;
 import cn.tr.module.sys.user.dto.SysOrgTreeDTO;
 import cn.tr.module.sys.user.service.ISysOrgService;
 import cn.tr.plugin.mybatis.base.BaseController;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;

+ 1 - 2
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/controller/SysPortalController.java

@@ -9,7 +9,7 @@ import cn.tr.module.sys.user.dto.*;
 import cn.tr.module.sys.user.service.ISysPortalMenuService;
 import cn.tr.module.sys.user.service.ISysPortalService;
 import cn.tr.plugin.mybatis.base.BaseController;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -18,7 +18,6 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.*;
-import java.util.stream.Collectors;
 
 /**
  * @ClassName : SysPortalController

+ 1 - 1
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/controller/SysPositionController.java

@@ -9,7 +9,7 @@ import cn.tr.module.sys.user.dto.SysPositionDTO;
 import cn.tr.module.sys.user.dto.SysPositionQueryDTO;
 import cn.tr.module.sys.user.service.ISysPositionService;
 import cn.tr.plugin.mybatis.base.BaseController;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;

+ 1 - 1
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/controller/SysRoleController.java

@@ -10,7 +10,7 @@ import cn.tr.core.enums.CreateEnum;
 import cn.tr.module.sys.user.service.ISysRoleMenuService;
 import cn.tr.module.sys.user.service.ISysRoleService;
 import cn.tr.plugin.mybatis.base.BaseController;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;

+ 1 - 1
tr-modules/tr-module-system/src/main/java/cn/tr/module/sys/user/controller/SysUserController.java

@@ -11,7 +11,7 @@ import cn.tr.module.sys.user.dto.SysUserQueryDTO;
 import cn.tr.module.sys.user.dto.SysValidateUsernameDTO;
 import cn.tr.module.sys.user.service.ISysUserService;
 import cn.tr.plugin.mybatis.base.BaseController;
-import cn.tr.plugin.operatelog.annotation.OperateLog;
+import cn.tr.module.api.sys.log.annotation.OperateLog;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.*;
 import lombok.AllArgsConstructor;

+ 0 - 5
tr-plugins/pom.xml

@@ -21,17 +21,12 @@
         <module>tr-spring-boot-starter-plugin-satoken</module>
         <module>tr-spring-boot-starter-plugin-biz-data-permission</module>
         <module>tr-spring-boot-starter-plugin-test</module>
-        <module>tr-spring-boot-starter-plugin-dict</module>
         <module>tr-spring-boot-starter-plugin-cache</module>
         <module>tr-spring-boot-starter-plugin-file</module>
-        <module>tr-spring-boot-starter-plugin-biz-excel</module>
         <module>tr-spring-boot-starter-plugin-websocket</module>
         <module>tr-spring-boot-starter-plugin-sms</module>
         <module>tr-spring-boot-starter-plugin-eventbus</module>
-        <module>tr-spring-boot-starter-plugin-mq</module>
-        <module>tr-spring-boot-starter-plugin-flink</module>
         <module>tr-spring-boot-starter-plugin-desensitize</module>
-        <module>tr-spring-boot-starter-plugin-operatelog</module>
         <module>tr-spring-boot-starter-plugin-doc</module>
         <module>tr-spring-boot-starter-plugin-mp-enhance-actable</module>
         <module>tr-spring-boot-starter-plugin-biz-bean-mapper</module>

+ 0 - 59
tr-plugins/tr-spring-boot-starter-plugin-biz-excel/pom.xml

@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>tr-plugins</artifactId>
-        <groupId>cn.tr</groupId>
-        <version>${revision}</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>tr-spring-boot-starter-plugin-biz-excel</artifactId>
-    <version>${revision}</version>
-    <packaging>jar</packaging>
-
-    <description>excel的导出</description>
-
-    <dependencies>
-        <dependency>
-            <groupId>cn.tr</groupId>
-            <artifactId>tr-spring-boot-starter-plugin-test</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>cn.tr</groupId>
-            <artifactId>tr-spring-boot-starter-plugin-file</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>cn.tr</groupId>
-            <artifactId>tr-spring-boot-starter-plugin-dict</artifactId>
-        </dependency>
-
-        <!-- Apache Lang3 -->
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-lang3</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>cn.tr</groupId>
-            <artifactId>tr-framework</artifactId>
-        </dependency>
-
-        <!-- excel工具 -->
-        <dependency>
-            <groupId>org.apache.poi</groupId>
-            <artifactId>poi-ooxml</artifactId>
-        </dependency>
-
-
-    </dependencies>
-</project>

+ 0 - 19
tr-plugins/tr-spring-boot-starter-plugin-biz-excel/src/main/java/cn/tr/plugin/excel/TrExcelAutoConfiguration.java

@@ -1,19 +0,0 @@
-package cn.tr.plugin.excel;
-
-import cn.tr.plugin.dict.config.cache.DictManager;
-import cn.tr.plugin.excel.config.ExcelHelperFactory;
-import org.springframework.context.annotation.Bean;
-
-/**
- * @ClassName : TrExcelAutoConfiguration
- * @Description : 自动注册excel导出配置
- * @Author : LF
- * @Date: 2023年03月13日
- */
-public class TrExcelAutoConfiguration {
-
-    @Bean
-    public ExcelHelperFactory excelHelperFactory(DictManager dictManager){
-        return new ExcelHelperFactory(dictManager);
-    }
-}

+ 0 - 188
tr-plugins/tr-spring-boot-starter-plugin-biz-excel/src/main/java/cn/tr/plugin/excel/annotation/Excel.java

@@ -1,188 +0,0 @@
-package cn.tr.plugin.excel.annotation;
-
-import cn.tr.plugin.excel.config.ExcelHandlerAdapter;
-import org.apache.poi.ss.usermodel.HorizontalAlignment;
-import org.apache.poi.ss.usermodel.IndexedColors;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.math.BigDecimal;
-
-/**
- * 自定义导出Excel数据注解
- * 
- * @author ruoyi
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.FIELD)
-public @interface Excel
-{
-    /**
-     * 导出时在excel中排序
-     */
-    public int sort() default Integer.MAX_VALUE;
-
-    /**
-     * 导出到Excel中的名字.
-     */
-    public String name() default "";
-
-    /**
-     * 日期格式, 如: yyyy-MM-dd
-     */
-    public String dateFormat() default "";
-
-    /**
-     * 当后边紧跟的单元格为空时,是否合并
-     */
-    public boolean mergeBlank() default false;
-
-    /**
-     * 当行数据一致时,合并行数据
-     */
-    public boolean mergeRowWhenSame() default false;
-
-    /**
-     * 字典码
-     */
-    public String dictCode() default "";
-
-    /**
-     * BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化)
-     */
-    public int scale() default -1;
-
-    /**
-     * BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
-     */
-    public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
-
-    /**
-     * 导出时在excel中每个列的高度 单位为字符
-     */
-    public double height() default 14;
-
-    /**
-     * 导出时在excel中每个列的宽 单位为字符
-     */
-    public double width() default 16;
-
-    /**
-     * 文字后缀,如% 90 变成90%
-     */
-    public String suffix() default "";
-
-    /**
-     * 当值为空时,字段的默认值
-     */
-    public String defaultValue() default "";
-
-    /**
-     * 提示信息
-     */
-    public String prompt() default "";
-
-    /**
-     * 设置只能选择不能输入的列内容.默认 与{@link Excel#dictCode()} 保持一致
-     */
-    public String[] combo() default {};
-
-    /**
-     * 是否需要纵向合并单元格,应对需求:含有list集合单元格)
-     */
-    public boolean needMerge() default false;
-
-    /**
-     * 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
-     */
-    public boolean isExport() default true;
-
-    /**
-     * 另一个类中的属性名称,支持多级获取,以小数点隔开
-     */
-    public String targetAttr() default "";
-
-    /**
-     * 是否自动统计数据,在最后追加一行统计数据总和
-     */
-    public boolean isStatistics() default false;
-
-    /**
-     * 导出类型(0数字 1字符串)
-     */
-    public ColumnType cellType() default ColumnType.STRING;
-
-    /**
-     * 导出列头背景色
-     */
-    public IndexedColors headerBackgroundColor() default IndexedColors.GREY_50_PERCENT;
-
-    /**
-     * 导出列头字体颜色
-     */
-    public IndexedColors headerColor() default IndexedColors.WHITE;
-
-    /**
-     * 导出单元格背景色
-     */
-    public IndexedColors backgroundColor() default IndexedColors.WHITE;
-
-    /**
-     * 导出单元格字体颜色
-     */
-    public IndexedColors color() default IndexedColors.BLACK;
-
-    /**
-     * 导出字段对齐方式
-     */
-    public HorizontalAlignment align() default HorizontalAlignment.CENTER;
-
-    /**
-     * 自定义数据处理器
-     */
-    public Class<?> handler() default ExcelHandlerAdapter.class;
-
-    /**
-     * 自定义数据处理器参数
-     */
-    public String[] args() default {};
-
-    /**
-     * 字段类型(0:导出导入;1:仅导出;2:仅导入)
-     */
-    Type type() default Type.ALL;
-
-    public enum Type
-    {
-        ALL(0), EXPORT(1), IMPORT(2);
-        private final int value;
-
-        Type(int value)
-        {
-            this.value = value;
-        }
-
-        public int value()
-        {
-            return this.value;
-        }
-    }
-
-    public enum ColumnType
-    {
-        NUMERIC(0), STRING(1), IMAGE(2),HYPERLINKS(3);
-        private final int value;
-
-        ColumnType(int value)
-        {
-            this.value = value;
-        }
-
-        public int value()
-        {
-            return this.value;
-        }
-    }
-}

+ 0 - 18
tr-plugins/tr-spring-boot-starter-plugin-biz-excel/src/main/java/cn/tr/plugin/excel/annotation/Excels.java

@@ -1,18 +0,0 @@
-package cn.tr.plugin.excel.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Excel注解集
- * 
- * @author ruoyi
- */
-@Target(ElementType.FIELD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Excels
-{
-    Excel[] value();
-}

+ 0 - 19
tr-plugins/tr-spring-boot-starter-plugin-biz-excel/src/main/java/cn/tr/plugin/excel/config/ExcelHandlerAdapter.java

@@ -1,19 +0,0 @@
-package cn.tr.plugin.excel.config;
-
-/**
- * Excel数据格式处理适配器
- * 
- * @author ruoyi
- */
-public interface
-ExcelHandlerAdapter {
-    /**
-     * 格式化
-     * 
-     * @param value 单元格数据值
-     * @param args excel注解args参数组
-     *
-     * @return 处理后的值
-     */
-    Object format(Object value, String[] args);
-}

+ 0 - 1513
tr-plugins/tr-spring-boot-starter-plugin-biz-excel/src/main/java/cn/tr/plugin/excel/config/ExcelHelper.java

@@ -1,1513 +0,0 @@
-package cn.tr.plugin.excel.config;
-
-import cn.hutool.core.collection.CollectionUtil;
-import cn.hutool.core.convert.Convert;
-import cn.hutool.core.lang.Pair;
-import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.core.util.ReflectUtil;
-import cn.hutool.core.util.StrUtil;
-import cn.tr.plugin.dict.bo.DictBO;
-import cn.tr.plugin.excel.annotation.Excel;
-import cn.tr.plugin.excel.annotation.Excel.*;
-import cn.tr.plugin.excel.annotation.Excels;
-import org.apache.commons.lang3.ArrayUtils;
-import org.apache.commons.lang3.RegExUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.reflect.FieldUtils;
-import org.apache.commons.lang3.time.DateUtils;
-import org.apache.poi.ss.usermodel.*;
-import org.apache.poi.ss.util.CellRangeAddress;
-import org.apache.poi.ss.util.CellRangeAddressList;
-import org.apache.poi.util.IOUtils;
-import org.apache.poi.xssf.streaming.SXSSFWorkbook;
-import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
-import org.apache.poi.xssf.usermodel.XSSFDataValidation;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import cn.hutool.core.date.DateUtil;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
-import java.math.BigDecimal;
-import java.text.DecimalFormat;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.*;
-import java.util.concurrent.LinkedBlockingDeque;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.function.BiFunction;
-import java.util.function.Function;
-import java.util.stream.Collectors;
-
-/**
- * Excel相关处理
- *
- * @author ruoyi
- */
-public class ExcelHelper<T> {
-    private static ThreadPoolExecutor threadPoolExecutor;
-    static {
-        int processors = Runtime.getRuntime().availableProcessors();
-        threadPoolExecutor=new ThreadPoolExecutor(
-                processors*2,
-                processors*2,
-                0,
-                TimeUnit.HOURS,
-                new LinkedBlockingDeque<>(Integer.MAX_VALUE),
-                new ExcelThreadFactory()
-        );
-    }
-    private static final Logger log = LoggerFactory.getLogger(ExcelHelper.class);
-
-    private static final String FORMULA_REGEX_STR = "=|-|\\+|@";
-
-    private static final String[] FORMULA_STR = { "=", "-", "+", "@" };
-
-    private static final String[] parsePatterns = {
-            "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
-            "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
-            "yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
-
-    /**
-     * 根据dictCode和dictValue获取dictLabel
-     */
-    private final BiFunction<String,String,String> dictCacheOperator;
-
-    /**
-     * 根据dictCode获取所有 {@link cn.tr.plugin.dict.bo.DictBO}
-     */
-    private final Function<String,List<DictBO>> dictCacheAllOperator;
-    /**
-     * Excel sheet最大行数,默认65536
-     */
-    private static final int sheetSize = 10000;
-
-    private int sheetNo;
-    /**
-     * 工作表名称
-     */
-    private String sheetName;
-
-    /**
-     * 导出类型(EXPORT:导出数据;IMPORT:导入模板)
-     */
-    private Type type;
-
-    /**
-     * 工作薄对象
-     */
-    private Workbook wb;
-
-    /**
-     * 工作表对象
-     */
-    private List<Sheet> sheets=new ArrayList<>();
-
-    /**
-     * 与工作表相对应的数据集合
-     */
-    private Map<Sheet, List<T>> sheetDataMap=new HashMap<>();
-
-    /**
-     * 工作表对象对应的当前行号
-     */
-    private Map<Sheet,AtomicInteger> rowNumMap=new HashMap<>();
-
-    /**
-     * 样式列表
-     */
-    private Map<String, CellStyle> styles;
-
-
-    /**
-     * 注解列表
-     */
-    private List<Object[]> fields;
-
-    /**
-     * 标题
-     */
-    private String title;
-
-    /**
-     * 最大高度
-     */
-    private short maxHeight;
-
-    /**
-     * 工作表合并后最后行数
-     */
-    private Map<Sheet, AtomicInteger> subMergedLastRowNumMap=new HashMap<>();
-
-    /**
-     * 工作表合并后开始行数
-     */
-    private Map<Sheet,AtomicInteger> subMergedFirstRowNumMap=new HashMap<>();
-
-    /**
-     * 对象的子列表方法
-     */
-    private Method subMethod;
-
-    /**
-     * 对象的子列表属性
-     */
-    private List<Field> subFields;
-
-    /**
-     * 统计列表
-     */
-    private Map<Integer, Double> statistics = new HashMap<Integer, Double>();
-
-    /**
-     * 数字格式
-     */
-    private static final DecimalFormat DOUBLE_FORMAT = new DecimalFormat("######0.00");
-
-    /**
-     * 实体对象
-     */
-    private Class<T> clazz;
-
-    /**
-     * 需要排除列属性
-     */
-    private String[] excludeFields;
-
-    protected ExcelHelper(Class<T> clazz,BiFunction<String,String,String> dictCacheOperator,Function<String,List<DictBO>> dictCacheAllOperator) {
-        this.clazz = clazz;
-        this.dictCacheAllOperator=dictCacheAllOperator;
-        this.dictCacheOperator=dictCacheOperator;
-    }
-
-    /**
-     * 隐藏Excel中列属性
-     *
-     * @param fields 列属性名 示例[单个"name"/多个"id","name"]
-     */
-    public void hideColumn(String... fields)
-    {
-        this.excludeFields = fields;
-    }
-
-    private void init(List<T> list, String sheetName, String title, Type type) {
-        if (list == null)
-        {
-            list = new ArrayList<T>();
-        }
-        List<List<T>> sheetDataList = CollectionUtil.split(list, sheetSize);
-        sheetNo =CollectionUtil.size(sheetDataList);
-        this.sheetName = sheetName;
-        this.type = type;
-        this.title = title;
-        createExcelField();
-        createWorkbook();
-        if(CollectionUtil.isNotEmpty(sheets)){
-            for (Sheet sheet : sheets) {
-                createTitle(sheet);
-                createSubHead(sheet);
-            }
-        }
-        for (int i = 0; i < sheetDataList.size(); i++) {
-            sheetDataMap.put(CollectionUtil.get(sheets,i),CollectionUtil.get(sheetDataList,i));
-        }
-    }
-
-    /**
-     * 创建excel第一行标题
-     */
-    private void createTitle(Sheet sheet) {
-        if (StringUtils.isNotEmpty(title)) {
-            incrementSheetIntValue(sheet,subMergedFirstRowNumMap);
-            incrementSheetIntValue(sheet,subMergedLastRowNumMap);
-            int titleLastCol = this.fields.size() - 1;
-            if (isSubList()) {
-                titleLastCol = titleLastCol + subFields.size() - 1;
-            }
-            Row titleRow = sheet.createRow(getAndIncrementSheetValue(sheet,rowNumMap));
-            titleRow.setHeightInPoints(30);
-            Cell titleCell = titleRow.createCell(0);
-            titleCell.setCellStyle(styles.get("title"));
-            titleCell.setCellValue(title);
-            sheet.addMergedRegion(new CellRangeAddress(titleRow.getRowNum(), titleRow.getRowNum(), titleRow.getRowNum(), titleLastCol));
-        }
-    }
-
-    /**
-     * 创建对象的子列表名称
-     */
-    public void createSubHead(Sheet sheet)
-    {
-        if (isSubList())
-        {
-            incrementSheetIntValue(sheet,subMergedFirstRowNumMap);
-            incrementSheetIntValue(sheet,subMergedLastRowNumMap);
-            int rownum = getAndIncrementSheetValue(sheet,rowNumMap);
-            Row subRow = sheet.createRow(rownum);
-            int excelNum = 0;
-            for (Object[] objects : fields)
-            {
-                Excel attr = (Excel) objects[1];
-                Cell headCell1 = subRow.createCell(excelNum);
-                headCell1.setCellValue(attr.name());
-                headCell1.setCellStyle(styles.get(StrUtil.format("header_{}_{}", attr.headerColor(), attr.headerBackgroundColor())));
-                excelNum++;
-            }
-            int headFirstRow = excelNum - 1;
-            int headLastRow = headFirstRow + subFields.size() - 1;
-            if (headLastRow > headFirstRow)
-            {
-                sheet.addMergedRegion(new CellRangeAddress(rownum, rownum, headFirstRow, headLastRow));
-            }
-        }
-    }
-
-    /**
-     * 对excel表单默认第一个索引名转换成list
-     *
-     * @param is 输入流
-     * @return 转换后集合
-     */
-    public List<T> importExcel(InputStream is) throws Exception
-    {
-        return importExcel(is, 0);
-    }
-
-    /**
-     * 对excel表单默认第一个索引名转换成list
-     *
-     * @param is 输入流
-     * @param titleNum 标题占用行数
-     * @return 转换后集合
-     */
-    public List<T> importExcel(InputStream is, int titleNum) throws Exception
-    {
-        return importExcel(StringUtils.EMPTY, is, titleNum);
-    }
-
-    /**
-     * 对excel表单指定表格索引名转换成list
-     *
-     * @param sheetName 表格索引名
-     * @param titleNum 标题占用行数
-     * @param is 输入流
-     * @return 转换后集合
-     */
-    public List<T> importExcel(String sheetName, InputStream is, int titleNum) throws Exception
-    {
-        this.type = Type.IMPORT;
-        this.wb = WorkbookFactory.create(is);
-        List<T> list = new ArrayList<T>();
-        // 如果指定sheet名,则取指定sheet中的内容 否则默认指向第1个sheet
-        Sheet sheet = StringUtils.isNotEmpty(sheetName) ? wb.getSheet(sheetName) : wb.getSheetAt(0);
-        if (sheet == null)
-        {
-            throw new IOException("文件sheet不存在");
-        }
-
-        // 获取最后一个非空行的行下标,比如总行数为n,则返回的为n-1
-        int rows = sheet.getLastRowNum();
-
-        if (rows > 0)
-        {
-            // 定义一个map用于存放excel列的序号和field.
-            Map<String, Integer> cellMap = new HashMap<String, Integer>();
-            // 获取表头
-            Row heard = sheet.getRow(titleNum);
-            for (int i = 0; i < heard.getPhysicalNumberOfCells(); i++)
-            {
-                Cell cell = heard.getCell(i);
-                if (ObjectUtil.isNotNull(cell))
-                {
-                    String value = this.getCellValue(heard, i).toString();
-                    cellMap.put(value, i);
-                }
-                else
-                {
-                    cellMap.put(null, i);
-                }
-            }
-            // 有数据时才处理 得到类的所有field.
-            List<Object[]> fields = this.getFields();
-            Map<Integer, Object[]> fieldsMap = new HashMap<Integer, Object[]>();
-            for (Object[] objects : fields)
-            {
-                Excel attr = (Excel) objects[1];
-                Integer column = cellMap.get(attr.name());
-                if (column != null)
-                {
-                    fieldsMap.put(column, objects);
-                }
-            }
-            for (int i = titleNum + 1; i <= rows; i++)
-            {
-                // 从第2行开始取数据,默认第一行是表头.
-                Row row = sheet.getRow(i);
-                // 判断当前行是否是空行
-                if (isRowEmpty(row))
-                {
-                    continue;
-                }
-                T entity = null;
-                for (Map.Entry<Integer, Object[]> entry : fieldsMap.entrySet())
-                {
-                    Object val = this.getCellValue(row, entry.getKey());
-
-                    // 如果不存在实例则新建.
-                    entity = (entity == null ? clazz.newInstance() : entity);
-                    // 从map中得到对应列的field.
-                    Field field = (Field) entry.getValue()[0];
-                    Excel attr = (Excel) entry.getValue()[1];
-                    // 取得类型,并根据对象类型设置值.
-                    Class<?> fieldType = field.getType();
-                    if (String.class == fieldType)
-                    {
-                        String s = Convert.toStr(val);
-                        if (StringUtils.endsWith(s, ".0"))
-                        {
-                            val = StringUtils.substringBefore(s, ".0");
-                        }
-                        else
-                        {
-                            String dateFormat = field.getAnnotation(Excel.class).dateFormat();
-                            if (StringUtils.isNotEmpty(dateFormat))
-                            {
-                                val = parseDateToStr(dateFormat, val);
-                            }
-                            else
-                            {
-                                val = Convert.toStr(val);
-                            }
-                        }
-                    }
-                    else if ((Integer.TYPE == fieldType || Integer.class == fieldType) && StringUtils.isNumeric(Convert.toStr(val)))
-                    {
-                        val = Convert.toInt(val);
-                    }
-                    else if ((Long.TYPE == fieldType || Long.class == fieldType) && StringUtils.isNumeric(Convert.toStr(val)))
-                    {
-                        val = Convert.toLong(val);
-                    }
-                    else if (Double.TYPE == fieldType || Double.class == fieldType)
-                    {
-                        val = Convert.toDouble(val);
-                    }
-                    else if (Float.TYPE == fieldType || Float.class == fieldType)
-                    {
-                        val = Convert.toFloat(val);
-                    }
-                    else if (BigDecimal.class == fieldType)
-                    {
-                        val = Convert.toBigDecimal(val);
-                    }
-                    else if (Date.class == fieldType)
-                    {
-                        if (val instanceof String)
-                        {
-                            val = DateUtils.parseDate(Convert.toStr(val),parsePatterns);
-                        }
-                        else if (val instanceof Double)
-                        {
-                            val = org.apache.poi.ss.usermodel.DateUtil.getJavaDate((Double) val);
-                        }
-                    }
-                    else if (Boolean.TYPE == fieldType || Boolean.class == fieldType)
-                    {
-                        val = Convert.toBool(val, false);
-                    }
-                    if (ObjectUtil.isNotNull(fieldType))
-                    {
-                        String propertyName = field.getName();
-                        if (StringUtils.isNotEmpty(attr.targetAttr()))
-                        {
-                            propertyName = field.getName() + "." + attr.targetAttr();
-                        }
-                        else if (StrUtil.isNotEmpty(attr.dictCode()))
-                        {
-                            val=dictCacheOperator.apply(attr.dictCode(),Convert.toStr(val));
-                        }
-                        else if (!attr.handler().equals(ExcelHandlerAdapter.class))
-                        {
-                            val = dataFormatHandlerAdapter(val, attr);
-                        }
-                        invokeSetter(entity, propertyName, val);
-                    }
-                }
-                list.add(entity);
-            }
-        }
-        return list;
-    }
-
-    /**
-     * 对list数据源将其里面的数据导入到excel表单
-     *
-     * @param response 返回数据
-     * @param list 导出数据集合
-     * @param sheetName 工作表的名称
-     * @param fileName 文件名称
-     * @return 结果
-     */
-    public void exportExcel(HttpServletResponse response, List<T> list, String sheetName,String fileName) throws IOException {
-        response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
-        response.setCharacterEncoding("utf-8");
-        exportExcel(response.getOutputStream(),fileName, list, sheetName, StringUtils.EMPTY);
-    }
-
-    /**
-     * 对list数据源将其里面的数据导入到excel表单
-     *
-     * @param outputStream 数据输出流
-     * @param list 导出数据集合
-     * @param sheetName 工作表的名称
-     * @param title 标题
-     * @return 结果
-     */
-    public void exportExcel(OutputStream outputStream ,String fileName,List<T> list, String sheetName, String title) throws IOException {
-        this.init(list, sheetName, title, Type.EXPORT);
-        threadPoolExecutor.submit(()->{
-        sheets.parallelStream().forEach(sheet -> { exportExcel(sheet,sheetDataMap.get(sheet)); });
-        try {
-            wb.write(outputStream);
-            //表格写入成功回调 将相应的下载任务置为成功 todo
-        }catch (Exception e){
-            //表格写入失败通知 将相应的下载任务置为失败并重新进入下载队列 todo
-        }finally {
-            IOUtils.closeQuietly(wb);
-        }
-        });
-    }
-
-    /**
-     * 对list数据源将其里面的数据导入到excel表单
-     *
-     * @return 结果
-     */
-    private void exportExcel(Sheet sheet,List<T> dataList) {
-        if(CollectionUtil.isEmpty(dataList)){
-            return;
-        }
-        try {
-            writeSheet(sheet,dataList);
-        }
-        catch (Exception e) {
-            e.printStackTrace();
-            log.error("导出Excel异常{}", e.getMessage());
-        }
-    }
-
-    /**
-     * 创建写入数据到Sheet
-     */
-    public void writeSheet(Sheet sheet,List<T> dataList) {
-        // 取出一共有多少个sheet.
-        // 产生一行
-        Row row = sheet.createRow(getAndIncrementSheetValue(sheet,rowNumMap));
-        int column = 0;
-        // 写入各个字段的列头名称
-        for (Object[] os : fields)
-        {
-            Field field = (Field) os[0];
-            Excel excel = (Excel) os[1];
-            if (Collection.class.isAssignableFrom(field.getType()))
-            {
-                for (Field subField : subFields)
-                {
-                    Excel subExcel = subField.getAnnotation(Excel.class);
-                    this.createHeadCell(sheet,subExcel, row, column++);
-                }
-            }
-            else
-            {
-                this.createHeadCell(sheet,excel, row, column++);
-            }
-        }
-        if (Type.EXPORT.equals(type))
-        {
-            fillExcelData(sheet,sheets.indexOf(sheet), row,dataList);
-            addStatisticsRow(sheet);
-        }
-    }
-
-    /**
-     * 向相应的工作表中填充excel数据
-     *
-     * @param index 序号
-     * @param row 单元格行
-     */
-    @SuppressWarnings("unchecked")
-    public void fillExcelData(Sheet sheet,int index, Row row,List<T> dataList)
-    {
-        int subMergedLastRowNum = getSheetIntValue(sheet,subMergedLastRowNumMap);
-        int subMergedFirstRowNum = getSheetIntValue(sheet,subMergedFirstRowNumMap);
-        AtomicInteger rowNo = getSheetValue(sheet,rowNumMap);
-        //上一个单元格的值  {"row",{"col",{"value","startRow"}}}
-        Map<Integer,Map<Integer, Pair<String,Integer>>> cellValueMap=new HashMap<>();
-        for (int i = 0; i <  CollectionUtil.size(dataList); i++)
-        {
-            if(i>1){
-                rowNo.incrementAndGet();
-            }else {
-                rowNo.addAndGet(i);
-            }
-            row = sheet.createRow(rowNo.get());
-            // 得到导出对象.
-            T vo = (T) dataList.get(i);
-            Collection<?> subList = null;
-            if (isSubList()) {
-                if (isSubListValue(vo))
-                {
-                    subList = getListCellValue(vo);
-                    subMergedLastRowNum = subMergedLastRowNum + subList.size();
-                }
-                else
-                {
-                    subMergedFirstRowNum++;
-                    subMergedLastRowNum++;
-                }
-            }
-            int column = 0;
-
-            //合并空格的开始列
-            int mergeBlankStartCol=-1;
-            Cell cell=null;
-            for (Object[] os : fields) {
-                Field field = (Field) os[0];
-                Excel excel = (Excel) os[1];
-                if (Collection.class.isAssignableFrom(field.getType()) && CollectionUtil.isNotEmpty(subList))
-                {
-                    boolean subFirst = false;
-                    for (Object obj : subList) {
-                        if (subFirst)
-                        {
-                            rowNo.incrementAndGet();
-                            row = sheet.createRow(rowNo.intValue());
-                        }
-                        List<Field> subFields = FieldUtils.getFieldsListWithAnnotation(obj.getClass(), Excel.class);
-                        int subIndex = 0;
-                        for (Field subField : subFields)
-                        {
-                            if (subField.isAnnotationPresent(Excel.class))
-                            {
-                                subField.setAccessible(true);
-                                Excel attr = subField.getAnnotation(Excel.class);
-                                cell=this.addCell(sheet,attr, row, (T) obj, subField, column + subIndex);
-                            }
-                            subIndex++;
-                        }
-                        subFirst = true;
-                    }
-                    subMergedFirstRowNum = subMergedFirstRowNum + subList.size();
-                }
-                else
-                {
-                    cell=this.addCell(sheet,excel, row, vo, field, column++);
-                }
-                String currentValue = cell.getStringCellValue();
-                currentValue=StrUtil.isNullOrUndefined(currentValue)?null:currentValue;
-                //合并空单元格
-                if(excel!=null){
-                    //当列相同时,合并列
-                    boolean mergeRowWhenSame = excel.mergeRowWhenSame();
-                    int rowIndex = cell.getRowIndex();
-                    int colIndex=cell.getColumnIndex();
-                    int startRowIndex=rowIndex;
-                    if(mergeRowWhenSame){
-                        //合并单元格
-                        //上一个单元格的内容
-                        //首个数据不行进行合并单元格计算,仅存储单元格的值
-                        if(i>0||i==CollectionUtil.size(dataList)-1){
-                            Pair<String, Integer> lastCell = cellValueMap.get(rowIndex - 1).get(colIndex);
-                            if(!ObjectUtil.equals(lastCell.getKey(),currentValue)){
-                                CellRangeAddress region  = new CellRangeAddress(lastCell.getValue(), startRowIndex-1, colIndex, colIndex);
-                                sheet.addMergedRegion(region);
-                            }else if(i==CollectionUtil.size(dataList)-1){
-                                CellRangeAddress region  = new CellRangeAddress(lastCell.getValue(), startRowIndex, colIndex, colIndex);
-                                sheet.addMergedRegion(region);
-                            }else {
-                                //内容相同,置换开始行数
-                                startRowIndex=lastCell.getValue();
-                            }
-                        }
-                    }else {
-                        //合并列和合并行不能同时出现
-                        boolean mergeBlank = excel.mergeBlank();
-                        //在同一行合并空格列
-                        if(colIndex>0){
-                            Pair<String, Integer> valuePair = cellValueMap.get(rowIndex).get(colIndex - 1);
-                            if((colIndex==CollectionUtil.size(fields)-1||!isEmptyValue(cell))
-                                    &&mergeBlankStartCol!=-1){
-
-                                if(isEmptyValue(cell)){
-                                    CellRangeAddress region  = new CellRangeAddress(rowIndex, rowIndex, mergeBlankStartCol, colIndex);
-                                    sheet.addMergedRegion(region);
-                                    mergeBlankStartCol=-1;
-                                }
-                                //当前单元格非空时,判断前一个单元格是否为空
-                                //前一个单元格为空
-                                else if(StrUtil.isEmpty(valuePair.getKey())){
-                                    CellRangeAddress region  = new CellRangeAddress(rowIndex, rowIndex, mergeBlankStartCol, colIndex-1);
-                                    sheet.addMergedRegion(region);
-                                    mergeBlankStartCol=-1;
-                                }
-                            }
-                        }
-                        if(mergeBlank){
-                            mergeBlankStartCol=colIndex;
-                        }
-                    }
-
-                    cellValueMap.compute(rowIndex, (k, colMap) -> {
-                        if (colMap == null) {
-                            colMap = new HashMap<>();
-                        }
-                        return colMap;
-                    }).put(colIndex, Pair.of(currentValue, startRowIndex));
-                }
-
-
-            }
-        }
-    }
-    private boolean isEmptyValue(Cell cell){
-        return StrUtil.isEmpty(cell.getStringCellValue())||StrUtil.isNullOrUndefined(cell.getStringCellValue());
-    }
-    /**
-     * 创建表格样式
-     *
-     * @param wb 工作薄对象
-     * @return 样式列表
-     */
-    private Map<String, CellStyle> createStyles(Workbook wb)
-    {
-        // 写入各条记录,每条记录对应excel表中的一行
-        Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
-        CellStyle style = wb.createCellStyle();
-        style.setAlignment(HorizontalAlignment.CENTER);
-        style.setVerticalAlignment(VerticalAlignment.CENTER);
-        Font titleFont = wb.createFont();
-        titleFont.setFontName("Arial");
-        titleFont.setFontHeightInPoints((short) 16);
-        titleFont.setBold(true);
-        style.setFont(titleFont);
-        styles.put("title", style);
-
-        style = wb.createCellStyle();
-        style.setAlignment(HorizontalAlignment.CENTER);
-        style.setVerticalAlignment(VerticalAlignment.CENTER);
-        style.setBorderRight(BorderStyle.THIN);
-        style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-        style.setBorderLeft(BorderStyle.THIN);
-        style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-        style.setBorderTop(BorderStyle.THIN);
-        style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-        style.setBorderBottom(BorderStyle.THIN);
-        style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-        Font dataFont = wb.createFont();
-        dataFont.setFontName("Arial");
-        dataFont.setFontHeightInPoints((short) 10);
-        style.setFont(dataFont);
-        styles.put("data", style);
-
-        style = wb.createCellStyle();
-        style.setAlignment(HorizontalAlignment.CENTER);
-        style.setVerticalAlignment(VerticalAlignment.CENTER);
-        Font totalFont = wb.createFont();
-        totalFont.setFontName("Arial");
-        totalFont.setFontHeightInPoints((short) 10);
-        style.setFont(totalFont);
-        styles.put("total", style);
-
-        styles.putAll(annotationHeaderStyles(wb, styles));
-
-        styles.putAll(annotationDataStyles(wb));
-
-        return styles;
-    }
-
-    /**
-     * 根据Excel注解创建表格头样式
-     *
-     * @param wb 工作薄对象
-     * @return 自定义样式列表
-     */
-    private Map<String, CellStyle> annotationHeaderStyles(Workbook wb, Map<String, CellStyle> styles)
-    {
-        Map<String, CellStyle> headerStyles = new HashMap<String, CellStyle>();
-        for (Object[] os : fields)
-        {
-            Excel excel = (Excel) os[1];
-            String key = StrUtil.format("header_{}_{}", excel.headerColor(), excel.headerBackgroundColor());
-            if (!headerStyles.containsKey(key))
-            {
-                CellStyle style = wb.createCellStyle();
-                style.cloneStyleFrom(styles.get("data"));
-                style.setAlignment(HorizontalAlignment.CENTER);
-                style.setVerticalAlignment(VerticalAlignment.CENTER);
-                style.setFillForegroundColor(excel.headerBackgroundColor().index);
-                style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
-                Font headerFont = wb.createFont();
-                headerFont.setFontName("Arial");
-                headerFont.setFontHeightInPoints((short) 10);
-                headerFont.setBold(true);
-                headerFont.setColor(excel.headerColor().index);
-                style.setFont(headerFont);
-                headerStyles.put(key, style);
-            }
-        }
-        return headerStyles;
-    }
-
-    /**
-     * 根据Excel注解创建表格列样式
-     *
-     * @param wb 工作薄对象
-     * @return 自定义样式列表
-     */
-    private Map<String, CellStyle> annotationDataStyles(Workbook wb)
-    {
-        Map<String, CellStyle> styles = new HashMap<String, CellStyle>();
-        for (Object[] os : fields)
-        {
-            Excel excel = (Excel) os[1];
-            String key = StrUtil.format("data_{}_{}_{}", excel.align(), excel.color(), excel.backgroundColor());
-            if (!styles.containsKey(key))
-            {
-                CellStyle style = wb.createCellStyle();
-                style.setAlignment(excel.align());
-                style.setVerticalAlignment(VerticalAlignment.CENTER);
-                style.setBorderRight(BorderStyle.THIN);
-                style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-                style.setBorderLeft(BorderStyle.THIN);
-                style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-                style.setBorderTop(BorderStyle.THIN);
-                style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-                style.setBorderBottom(BorderStyle.THIN);
-                style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
-                style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
-                style.setFillForegroundColor(excel.backgroundColor().getIndex());
-                Font dataFont = wb.createFont();
-                dataFont.setFontName("Arial");
-                dataFont.setFontHeightInPoints((short) 10);
-                dataFont.setColor(excel.color().index);
-                style.setFont(dataFont);
-                styles.put(key, style);
-            }
-        }
-        return styles;
-    }
-
-    /**
-     * 创建单元格
-     */
-    public Cell createHeadCell(Sheet sheet,Excel attr, Row row, int column)
-    {
-        // 创建列
-        Cell cell = row.createCell(column);
-        // 写入列信息
-        cell.setCellValue(attr.name());
-        setDataValidation(sheet,attr, row, column);
-        cell.setCellStyle(styles.get(StrUtil.format("header_{}_{}", attr.headerColor(), attr.headerBackgroundColor())));
-        if (isSubList())
-        {
-            // 填充默认样式,防止合并单元格样式失效
-            sheet.setDefaultColumnStyle(column, styles.get(StrUtil.format("data_{}_{}_{}", attr.align(), attr.color(), attr.backgroundColor())));
-            if (attr.needMerge())
-            {
-                int rownum = getSheetIntValue(sheet, rowNumMap);
-                sheet.addMergedRegion(new CellRangeAddress( rownum- 1, rownum, column, column));
-            }
-        }
-        return cell;
-    }
-
-    /**
-     * 设置单元格信息
-     *
-     * @param value 单元格值
-     * @param attr 注解相关
-     * @param cell 单元格信息
-     */
-    public void setCellVo(Object value, Excel attr, Cell cell)
-    {
-        if (ColumnType.STRING == attr.cellType())
-        {
-            String cellValue = Convert.toStr(value);
-            // 对于任何以表达式触发字符 =-+@开头的单元格,直接使用tab字符作为前缀,防止CSV注入。
-            if (StringUtils.startsWithAny(cellValue, FORMULA_STR))
-            {
-                cellValue = RegExUtils.replaceFirst(cellValue, FORMULA_REGEX_STR, "\t$0");
-            }
-            cell.setCellValue(ObjectUtil.isNull(cellValue) ? attr.defaultValue() : cellValue + attr.suffix());
-        }
-        else if (ColumnType.NUMERIC == attr.cellType())
-        {
-            if (ObjectUtil.isNotNull(value))
-            {
-                cell.setCellValue(StringUtils.contains(Convert.toStr(value), ".") ? Convert.toDouble(value) : Convert.toInt(value));
-            }
-        }
-        else if (ColumnType.IMAGE == attr.cellType())
-        {
-            ClientAnchor anchor = new XSSFClientAnchor(0, 0, 0, 0, (short) cell.getColumnIndex(), cell.getRow().getRowNum(), (short) (cell.getColumnIndex() + 1), cell.getRow().getRowNum() + 1);
-            String imagePath = Convert.toStr(value);
-            if (StringUtils.isNotEmpty(imagePath))
-            {
-                //todo 获取文件
-//                byte[] data = ImageUtils.getImage(imagePath);
-//                getDrawingPatriarch(cell.getSheet()).createPicture(anchor,
-//                        cell.getSheet().getWorkbook().addPicture(data, getImageType(data)));
-            }
-        }
-    }
-
-    /**
-     * 获取画布
-     */
-    public static Drawing<?> getDrawingPatriarch(Sheet sheet)
-    {
-        if (sheet.getDrawingPatriarch() == null)
-        {
-            sheet.createDrawingPatriarch();
-        }
-        return sheet.getDrawingPatriarch();
-    }
-
-    /**
-     * todo
-     * 获取图片类型,设置图片插入类型
-     */
-    public int getImageType(byte[] value)
-    {
-//        String type = FileTypeUtils.getFileExtendName(value);
-//        if ("JPG".equalsIgnoreCase(type))
-//        {
-//            return Workbook.PICTURE_TYPE_JPEG;
-//        }
-//        else if ("PNG".equalsIgnoreCase(type))
-//        {
-//            return Workbook.PICTURE_TYPE_PNG;
-//        }
-        return Workbook.PICTURE_TYPE_JPEG;
-    }
-
-    /**
-     * 创建表格样式
-     */
-    public void setDataValidation(Sheet sheet,Excel attr, Row row, int column)
-    {
-        if (attr.name().indexOf("注:") >= 0)
-        {
-            sheet.setColumnWidth(column, 6000);
-        }
-        else
-        {
-            // 设置列宽
-            sheet.setColumnWidth(column, (int) ((attr.width() + 0.72) * 256));
-        }
-        if (StringUtils.isNotEmpty(attr.prompt()) || attr.combo().length > 0)
-        {
-            // 提示信息或只能选择不能输入的列内容.
-            setPromptOrValidation(sheet, attr.combo(), attr.prompt(), 1, 100, column, column);
-        }else if(StrUtil.isNotEmpty(attr.dictCode())){
-            List<DictBO> dicts = dictCacheAllOperator.apply(attr.dictCode());
-            if(CollectionUtil.isNotEmpty(dicts)){
-                setPromptOrValidation(sheet,
-                        dicts.stream().map(DictBO::getLabel).collect(Collectors.toList()).toArray(new String[dicts.size()]),
-                        attr.prompt(), 1, 100, column, column);
-            }
-
-        }
-    }
-
-    /**
-     * 添加单元格
-     */
-    public Cell addCell(Sheet sheet,Excel attr, Row row, T vo, Field field, int column)
-    {
-        Cell cell = null;
-        try
-        {
-            // 设置行高
-            row.setHeight(maxHeight);
-            // 根据Excel中设置情况决定是否导出,有些情况需要保持为空,希望用户填写这一列.
-            if (attr.isExport())
-            {
-                // 创建cell
-                cell = row.createCell(column);
-                if (isSubListValue(vo) && getListCellValue(vo).size() > 1 && attr.needMerge())
-                {
-                    CellRangeAddress cellAddress = new CellRangeAddress(getSheetIntValue(sheet,subMergedFirstRowNumMap), getSheetIntValue(sheet,subMergedLastRowNumMap), column, column);
-                    sheet.addMergedRegion(cellAddress);
-                }
-                cell.setCellStyle(styles.get(StrUtil.format("data_{}_{}_{}", attr.align(), attr.color(), attr.backgroundColor())));
-
-                // 用于读取对象中的属性
-                Object value = getTargetValue(vo, field, attr);
-                String dateFormat = attr.dateFormat();
-                String dictCode = attr.dictCode();
-                if (StringUtils.isNotEmpty(dateFormat) && ObjectUtil.isNotNull(value))
-                {
-                    cell.setCellValue(parseDateToStr(dateFormat, value));
-                }
-                else if (StringUtils.isNotEmpty(dictCode) && ObjectUtil.isNotNull(value))
-                {
-                    cell.setCellValue(dictCacheOperator.apply(attr.dictCode(),Convert.toStr(value)));
-                }
-                else if (value instanceof BigDecimal && -1 != attr.scale())
-                {
-                    cell.setCellValue((((BigDecimal) value).setScale(attr.scale(), attr.roundingMode())).doubleValue());
-                }
-                else if (!attr.handler().equals(ExcelHandlerAdapter.class))
-                {
-                    cell.setCellValue(dataFormatHandlerAdapter(value, attr));
-                }
-                else
-                {
-                    // 设置列类型
-                    setCellVo(value, attr, cell);
-                }
-                addStatisticsData(column, Convert.toStr(value), attr);
-            }
-        }
-        catch (Exception e)
-        {
-            log.error("导出Excel失败{}", e);
-        }
-        return cell;
-    }
-
-    /**
-     * 设置 POI XSSFSheet 单元格提示或选择框
-     *
-     * @param sheet 表单
-     * @param textlist 下拉框显示的内容
-     * @param promptContent 提示内容
-     * @param firstRow 开始行
-     * @param endRow 结束行
-     * @param firstCol 开始列
-     * @param endCol 结束列
-     */
-    public void setPromptOrValidation(Sheet sheet, String[] textlist, String promptContent, int firstRow, int endRow,
-                                      int firstCol, int endCol)
-    {
-        DataValidationHelper helper = sheet.getDataValidationHelper();
-        DataValidationConstraint constraint = textlist.length > 0 ? helper.createExplicitListConstraint(textlist) : helper.createCustomConstraint("DD1");
-        CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol);
-        DataValidation dataValidation = helper.createValidation(constraint, regions);
-        if (StringUtils.isNotEmpty(promptContent))
-        {
-            // 如果设置了提示信息则鼠标放上去提示
-            dataValidation.createPromptBox("", promptContent);
-            dataValidation.setShowPromptBox(true);
-        }
-        // 处理Excel兼容性问题
-        if (dataValidation instanceof XSSFDataValidation)
-        {
-            dataValidation.setSuppressDropDownArrow(true);
-            dataValidation.setShowErrorBox(true);
-        }
-        else
-        {
-            dataValidation.setSuppressDropDownArrow(false);
-        }
-        sheet.addValidationData(dataValidation);
-    }
-
-    /**
-     * 反向解析值 男=0,女=1,未知=2
-     *
-     * @param propertyValue 参数值
-     * @param converterExp 翻译注解
-     * @param separator 分隔符
-     * @return 解析后值
-     */
-    public static String reverseByExp(String propertyValue, String converterExp, String separator)
-    {
-        StringBuilder propertyString = new StringBuilder();
-        String[] convertSource = converterExp.split(",");
-        for (String item : convertSource)
-        {
-            String[] itemArray = item.split("=");
-            if (StringUtils.containsAny(propertyValue, separator))
-            {
-                for (String value : propertyValue.split(separator))
-                {
-                    if (itemArray[1].equals(value))
-                    {
-                        propertyString.append(itemArray[0] + separator);
-                        break;
-                    }
-                }
-            }
-            else
-            {
-                if (itemArray[1].equals(propertyValue))
-                {
-                    return itemArray[0];
-                }
-            }
-        }
-        return StringUtils.stripEnd(propertyString.toString(), separator);
-    }
-
-    /**
-     * 数据处理器
-     *
-     * @param value 数据值
-     * @param excel 数据注解
-     * @return
-     */
-    public String dataFormatHandlerAdapter(Object value, Excel excel)
-    {
-        try
-        {
-            Object instance = excel.handler().newInstance();
-            Method formatMethod = excel.handler().getMethod("format", new Class[] { Object.class, String[].class });
-            value = formatMethod.invoke(instance, value, excel.args());
-        }
-        catch (Exception e)
-        {
-            log.error("不能格式化数据 " + excel.handler(), e.getMessage());
-        }
-        return Convert.toStr(value);
-    }
-
-    /**
-     * 合计统计信息
-     */
-    private void addStatisticsData(Integer index, String text, Excel entity)
-    {
-        if (entity != null && entity.isStatistics())
-        {
-            Double temp = 0D;
-            if (!statistics.containsKey(index))
-            {
-                statistics.put(index, temp);
-            }
-            try
-            {
-                temp = Double.valueOf(text);
-            }
-            catch (NumberFormatException e)
-            {
-            }
-            statistics.put(index, statistics.get(index) + temp);
-        }
-    }
-
-    /**
-     * 创建统计行
-     */
-    public void addStatisticsRow(Sheet sheet)
-    {
-        if (statistics.size() > 0)
-        {
-            Row row = sheet.createRow(sheet.getLastRowNum() + 1);
-            Set<Integer> keys = statistics.keySet();
-            Cell cell = row.createCell(0);
-            cell.setCellStyle(styles.get("total"));
-            cell.setCellValue("合计");
-
-            for (Integer key : keys)
-            {
-                cell = row.createCell(key);
-                cell.setCellStyle(styles.get("total"));
-                cell.setCellValue(DOUBLE_FORMAT.format(statistics.get(key)));
-            }
-            statistics.clear();
-        }
-    }
-
-    /**
-     * 获取bean中的属性值
-     *
-     * @param vo 实体对象
-     * @param field 字段
-     * @param excel 注解
-     * @return 最终的属性值
-     * @throws Exception
-     */
-    private Object getTargetValue(T vo, Field field, Excel excel) throws Exception
-    {
-        Object o = field.get(vo);
-        if (StringUtils.isNotEmpty(excel.targetAttr()))
-        {
-            String target = excel.targetAttr();
-            if (target.contains("."))
-            {
-                String[] targets = target.split("[.]");
-                for (String name : targets)
-                {
-                    o = getValue(o, name);
-                }
-            }
-            else
-            {
-                o = getValue(o, target);
-            }
-        }
-        return o;
-    }
-
-    /**
-     * 以类的属性的get方法方法形式获取值
-     *
-     * @param o
-     * @param name
-     * @return value
-     * @throws Exception
-     */
-    private Object getValue(Object o, String name) throws Exception
-    {
-        if (ObjectUtil.isNotNull(o) && StringUtils.isNotEmpty(name))
-        {
-            Class<?> clazz = o.getClass();
-            Field field = clazz.getDeclaredField(name);
-            field.setAccessible(true);
-            o = field.get(o);
-        }
-        return o;
-    }
-
-    /**
-     * 得到所有定义字段
-     */
-    private void createExcelField()
-    {
-        this.fields = getFields();
-        this.fields = this.fields.stream().sorted(Comparator.comparing(objects -> ((Excel) objects[1]).sort())).collect(Collectors.toList());
-        this.maxHeight = getRowHeight();
-    }
-
-    /**
-     * 获取字段注解信息
-     */
-    public List<Object[]> getFields()
-    {
-        List<Object[]> fields = new ArrayList<Object[]>();
-        List<Field> tempFields = new ArrayList<>();
-        tempFields.addAll(Arrays.asList(clazz.getSuperclass().getDeclaredFields()));
-        tempFields.addAll(Arrays.asList(clazz.getDeclaredFields()));
-        for (Field field : tempFields)
-        {
-            if (!ArrayUtils.contains(this.excludeFields, field.getName()))
-            {
-                // 单注解
-                if (field.isAnnotationPresent(Excel.class))
-                {
-                    Excel attr = field.getAnnotation(Excel.class);
-                    if (attr != null && (attr.type() == Type.ALL || attr.type() == type))
-                    {
-                        field.setAccessible(true);
-                        fields.add(new Object[] { field, attr });
-                    }
-                    if (Collection.class.isAssignableFrom(field.getType()))
-                    {
-                        subMethod = getSubMethod(field.getName(), clazz);
-                        ParameterizedType pt = (ParameterizedType) field.getGenericType();
-                        Class<?> subClass = (Class<?>) pt.getActualTypeArguments()[0];
-                        this.subFields = FieldUtils.getFieldsListWithAnnotation(subClass, Excel.class);
-                    }
-                }
-
-                // 多注解
-                if (field.isAnnotationPresent(Excels.class))
-                {
-                    Excels attrs = field.getAnnotation(Excels.class);
-                    Excel[] excels = attrs.value();
-                    for (Excel attr : excels)
-                    {
-                        if (attr != null && (attr.type() == Type.ALL || attr.type() == type))
-                        {
-                            field.setAccessible(true);
-                            fields.add(new Object[] { field, attr });
-                        }
-                    }
-                }
-            }
-        }
-        return fields;
-    }
-
-    /**
-     * 根据注解获取最大行高
-     */
-    public short getRowHeight()
-    {
-        double maxHeight = 0;
-        for (Object[] os : this.fields)
-        {
-            Excel excel = (Excel) os[1];
-            maxHeight = Math.max(maxHeight, excel.height());
-        }
-        return (short) (maxHeight * 20);
-    }
-
-    /**
-     * 创建一个工作簿
-     */
-    public void createWorkbook()
-    {
-        this.wb = new SXSSFWorkbook(1000);
-        this.styles = createStyles(wb);
-        createSheet(sheetNo);
-    }
-
-    /**
-     * 创建工作表
-     *
-     * @param sheetCount sheet数量
-     */
-    private void createSheet(int sheetCount) {
-        // 设置工作表的名称.
-        for (int i = 0; i < sheetCount; i++) {
-            sheets.add( wb.createSheet(sheetName + i));
-        }
-
-    }
-
-    /**
-     * 获取单元格值
-     *
-     * @param row 获取的行
-     * @param column 获取单元格列号
-     * @return 单元格值
-     */
-    private Object getCellValue(Row row, int column)
-    {
-        if (row == null)
-        {
-            return row;
-        }
-        Object val = "";
-        try
-        {
-            Cell cell = row.getCell(column);
-            if (ObjectUtil.isNotNull(cell))
-            {
-                if (cell.getCellType() == CellType.NUMERIC || cell.getCellType() == CellType.FORMULA)
-                {
-                    val = cell.getNumericCellValue();
-                    if (org.apache.poi.ss.usermodel.DateUtil.isCellDateFormatted(cell))
-                    {
-                        val = org.apache.poi.ss.usermodel.DateUtil.getJavaDate((Double) val); // POI Excel 日期格式转换
-                    }
-                    else
-                    {
-                        if ((Double) val % 1 != 0)
-                        {
-                            val = new BigDecimal(val.toString());
-                        }
-                        else
-                        {
-                            val = new DecimalFormat("0").format(val);
-                        }
-                    }
-                }
-                else if (cell.getCellType() == CellType.STRING)
-                {
-                    val = cell.getStringCellValue();
-                }
-                else if (cell.getCellType() == CellType.BOOLEAN)
-                {
-                    val = cell.getBooleanCellValue();
-                }
-                else if (cell.getCellType() == CellType.ERROR)
-                {
-                    val = cell.getErrorCellValue();
-                }
-
-            }
-        }
-        catch (Exception e)
-        {
-            return val;
-        }
-        return val;
-    }
-
-    /**
-     * 判断是否是空行
-     *
-     * @param row 判断的行
-     * @return
-     */
-    private boolean isRowEmpty(Row row)
-    {
-        if (row == null)
-        {
-            return true;
-        }
-        for (int i = row.getFirstCellNum(); i < row.getLastCellNum(); i++)
-        {
-            Cell cell = row.getCell(i);
-            if (cell != null && cell.getCellType() != CellType.BLANK)
-            {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    /**
-     * 格式化不同类型的日期对象
-     *
-     * @param dateFormat 日期格式
-     * @param val 被格式化的日期对象
-     * @return 格式化后的日期字符
-     */
-    public String parseDateToStr(String dateFormat, Object val)
-    {
-        if (val == null)
-        {
-            return "";
-        }
-        String str;
-        if (val instanceof Date)
-        {
-            str=DateUtil.format((Date) val,dateFormat);
-        }
-        else if (val instanceof LocalDateTime)
-        {
-            str=DateUtil.format((LocalDateTime) val,dateFormat);
-        }
-        else if (val instanceof LocalDate)
-        {
-            str= ((LocalDate) val).format(DateTimeFormatter.ofPattern(dateFormat));
-        }
-        else
-        {
-            str = val.toString();
-        }
-        return str;
-    }
-
-    /**
-     * 是否有对象的子列表
-     */
-    public boolean isSubList()
-    {
-        return ObjectUtil.isNotNull(subFields) && subFields.size() > 0;
-    }
-
-    /**
-     * 是否有对象的子列表,集合不为空
-     */
-    public boolean isSubListValue(T vo)
-    {
-        return ObjectUtil.isNotNull(subFields) && subFields.size() > 0 && ObjectUtil.isNotNull(getListCellValue(vo)) && getListCellValue(vo).size() > 0;
-    }
-
-    /**
-     * 获取集合的值
-     */
-    public Collection<?> getListCellValue(Object obj)
-    {
-        Object value;
-        try
-        {
-            value = subMethod.invoke(obj, new Object[] {});
-        }
-        catch (Exception e)
-        {
-            return new ArrayList<Object>();
-        }
-        return (Collection<?>) value;
-    }
-
-    /**
-     * 获取对象的子列表方法
-     *
-     * @param name 名称
-     * @param pojoClass 类对象
-     * @return 子列表方法
-     */
-    public Method getSubMethod(String name, Class<?> pojoClass)
-    {
-        StringBuffer getMethodName = new StringBuffer("get");
-        getMethodName.append(name.substring(0, 1).toUpperCase());
-        getMethodName.append(name.substring(1));
-        Method method = null;
-        try
-        {
-            method = pojoClass.getMethod(getMethodName.toString(), new Class[] {});
-        }
-        catch (Exception e)
-        {
-            log.error("获取对象异常{}", e.getMessage());
-        }
-        return method;
-    }
-
-    /**
-     * 调用Setter方法, 仅匹配方法名。
-     * 支持多级,如:对象名.对象名.方法
-     */
-    private static <E> void invokeSetter(Object obj, String propertyName, E value)
-    {
-        Object object = obj;
-        String[] names = StringUtils.split(propertyName, ".");
-        for (int i = 0; i < names.length; i++)
-        {
-            if (i < names.length - 1)
-            {
-                String getterMethodName = "get" + StringUtils.capitalize(names[i]);
-                object = ReflectUtil.invoke(object, getterMethodName, new Class[] {}, new Object[] {});
-            }
-            else
-            {
-                String setterMethodName = "set" + StringUtils.capitalize(names[i]);
-                ReflectUtil.invoke(object, setterMethodName, new Object[] { value });
-            }
-        }
-    }
-
-
-    private int incrementSheetIntValue(Sheet sheet, Map<Sheet,AtomicInteger> valueMap){
-        return valueMap.compute(sheet,(sh,count)->{
-            if(count==null){
-                return new AtomicInteger(0);
-            }else {
-                count.incrementAndGet();
-                return count;
-            }
-        }).get();
-    }
-
-    private int getAndIncrementSheetValue(Sheet sheet, Map<Sheet,AtomicInteger> valueMap){
-        return valueMap.compute(sheet,(sh,count)->{
-            if(count==null){
-                return new AtomicInteger(0);
-            }else {
-                return count;
-            }
-        }).getAndIncrement();
-    }
-
-    private AtomicInteger incrementSheetValue(Sheet sheet, Map<Sheet,AtomicInteger> valueMap){
-        return valueMap.compute(sheet,(sh,count)->{
-            if(count==null){
-                return new AtomicInteger(0);
-            }else {
-                count.incrementAndGet();
-                return count;
-            }
-        });
-    }
-
-    private int getSheetIntValue(Sheet sheet, Map<Sheet,AtomicInteger> valueMap){
-        return valueMap.compute(sheet,(sh,count)->count!=null?count:new AtomicInteger(0)).get();
-    }
-
-    private AtomicInteger getSheetValue(Sheet sheet, Map<Sheet,AtomicInteger> valueMap){
-        return valueMap.compute(sheet,(sh,count)->count!=null?count:new AtomicInteger(0));
-    }
-}

+ 0 - 36
tr-plugins/tr-spring-boot-starter-plugin-biz-excel/src/main/java/cn/tr/plugin/excel/config/ExcelHelperFactory.java

@@ -1,36 +0,0 @@
-package cn.tr.plugin.excel.config;
-
-import cn.tr.plugin.dict.bo.DictBO;
-import cn.tr.plugin.dict.config.cache.DictManager;
-import lombok.AllArgsConstructor;
-import java.util.*;
-import java.util.function.BiFunction;
-import java.util.function.Function;
-
-/**
- * @ClassName : ExcelHelperBuilder
- * @Description :
- * @Author : LF
- * @Date: 2023年03月13日
- */
-@AllArgsConstructor
-public class ExcelHelperFactory {
-    private final DictManager dictManager;
-
-    public <T> ExcelHelper create(Class<T> tClass){
-        BiFunction<String, String, String> dictOperator = new BiFunction<String, String, String>() {
-            @Override
-            public String apply(String dictCode, String dictValue) {
-                return dictManager.lookByDictCode(dictCode,dictValue).getLabel();
-            }
-        };
-
-        Function<String, List<DictBO>> dictAllOperator = new Function<String, List<DictBO>>() {
-            @Override
-            public List<DictBO> apply(String dictCode) {
-                return dictManager.lookAllByDictCode(dictCode);
-            }
-        };
-        return new ExcelHelper(tClass,dictOperator,dictAllOperator);
-    }
-}

+ 0 - 46
tr-plugins/tr-spring-boot-starter-plugin-biz-excel/src/main/java/cn/tr/plugin/excel/config/ExcelThreadFactory.java

@@ -1,46 +0,0 @@
-package cn.tr.plugin.excel.config;
-
-import org.jetbrains.annotations.NotNull;
-
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * @ClassName : ExcelThreadFactory
- * @Description :
- * @Author : LF
- * @Date: 2023年03月15日
- */
-public class ExcelThreadFactory  implements ThreadFactory {
-    private static final AtomicInteger poolNumber = new AtomicInteger(1);
-    private final ThreadGroup group;
-    private final AtomicInteger threadNumber = new AtomicInteger(1);
-    private final String namePrefix;
-
-    ExcelThreadFactory() {
-
-        SecurityManager s = System.getSecurityManager();
-        group = (s != null) ? s.getThreadGroup() :
-                Thread.currentThread().getThreadGroup();
-        namePrefix = "excel-export-" +
-                poolNumber.getAndIncrement() +
-                "-thread-";
-    }
-
-
-    @Override
-    public Thread newThread(@NotNull Runnable r) {
-        Thread t = new Thread(group, r,
-                namePrefix + threadNumber.getAndIncrement(),
-                0);
-        if (t.isDaemon()){
-            t.setDaemon(false);
-        }
-        if (t.getPriority() != Thread.NORM_PRIORITY){
-            t.setPriority(Thread.NORM_PRIORITY);
-        }
-        return t;
-    }
-
-
-}

+ 0 - 1
tr-plugins/tr-spring-boot-starter-plugin-biz-excel/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@@ -1 +0,0 @@
-cn.tr.plugin.excel.TrExcelAutoConfiguration

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
tr-plugins/tr-spring-boot-starter-plugin-biz-excel/src/main/resources/base64


+ 0 - 116
tr-plugins/tr-spring-boot-starter-plugin-biz-excel/src/test/java/cn/tr/plugin/excel/ExcelTest.java

@@ -1,116 +0,0 @@
-package cn.tr.plugin.excel;
-
-import cn.hutool.core.io.FileUtil;
-import cn.hutool.core.util.RandomUtil;
-import cn.tr.core.enums.IEnum;
-import cn.tr.plugin.dict.bo.DictBO;
-import cn.tr.plugin.dict.config.cache.DictManager;
-import cn.tr.plugin.excel.annotation.Excel;
-import cn.tr.plugin.excel.config.ExcelHelper;
-import cn.tr.plugin.excel.config.ExcelHelperFactory;
-import cn.tr.plugin.test.ut.BaseMockitoUnitTest;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.Getter;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-/**
- * @ClassName : ExcelTest
- * @Description :
- * @Author : LF
- * @Date: 2023年03月13日
- */
-
-public class ExcelTest extends BaseMockitoUnitTest {
-
-    private DictManager dictManager;
-
-    private ExcelHelperFactory excelHelperFactory;
-
-    private String pathPrefix="C:\\Users\\JR\\Desktop\\icon\\";
-    @BeforeEach
-    public void setUp(){
-        dictManager=new DictManager(new ConcurrentMapCacheManager());
-        excelHelperFactory=new ExcelHelperFactory(dictManager);
-        List<DictBO> dicts = Stream.of(Gender.values())
-                .map(gender -> {
-                    DictBO dict = new DictBO();
-                    dict.setValue(gender.getValue());
-                    dict.setLabel(gender.getLabel());
-                    return dict;
-                })
-                .collect(Collectors.toList());
-        dictManager.load("gender",dicts);
-    }
-
-
-    @Test
-    public void exportExcel() throws Exception {
-        File file = FileUtil.touch(pathPrefix + "111.xlsx");
-        ArrayList<User> users = new ArrayList<>();
-        for (int i = 0; i < 76; i++) {
-            users.add(User.of(i,
-                    "用户"+(i/10),
-                    RandomUtil.randomInt(10,40),
-                    RandomUtil.randomBoolean()?"--":null,
-                    RandomUtil.randomBoolean()?"--":null,
-                    RandomUtil.randomString("1234",1)
-                   ));
-        }
-        long currentTimeMillis = System.currentTimeMillis();
-        ExcelHelper excelHelper = excelHelperFactory.create(User.class);
-        FileOutputStream fileOutputStream = new FileOutputStream(file);
-        excelHelper.exportExcel(fileOutputStream,"111.xlsx",users,"测试","用户表单");
-        System.out.println("耗时============"+(System.currentTimeMillis() - currentTimeMillis));
-        while (true){}
-    }
-
-    @Data
-    @AllArgsConstructor(staticName = "of")
-    private static class User{
-        @Excel(name = "序号")
-        private Integer sort;
-
-        @Excel(name = "姓名",mergeRowWhenSame = true)
-        private String name;
-
-        @Excel(name = "年龄",suffix = "岁",mergeBlank = true)
-        private Integer age;
-
-
-        @Excel(name = "随机空格")
-        private String blank;
-
-
-        @Excel(name = "随机空格2")
-        private String blank1;
-
-        @Excel(name = "性别",dictCode = "gender",combo = {"男","女","未知"})
-        private String gender;
-
-
-
-
-
-    }
-
-    @Getter
-    @AllArgsConstructor
-    static enum Gender implements IEnum<String>{
-        man("1","男"),
-        woman("2","女"),
-        unkown("3","未知");
-        private String value;
-        private String label;
-
-    }
-}

+ 0 - 60
tr-plugins/tr-spring-boot-starter-plugin-dict/pom.xml

@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>tr-plugins</artifactId>
-        <groupId>cn.tr</groupId>
-        <version>${revision}</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>tr-spring-boot-starter-plugin-dict</artifactId>
-    <version>${revision}</version>
-    <packaging>jar</packaging>
-
-
-    <description>字典插件</description>
-
-    <dependencies>
-        <dependency>
-            <groupId>cn.tr</groupId>
-            <artifactId>tr-framework</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>cn.tr</groupId>
-            <artifactId>tr-spring-boot-starter-plugin-cache</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>cn.tr</groupId>
-            <artifactId>tr-spring-boot-starter-plugin-test</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.springframework.boot</groupId>
-                    <artifactId>spring-boot-starter-logging</artifactId>
-                </exclusion>
-            </exclusions>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>com.github.ben-manes.caffeine</groupId>
-            <artifactId>caffeine</artifactId>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-data-redis</artifactId>
-            <scope>provided</scope>
-        </dependency>
-    </dependencies>
-</project>

+ 0 - 24
tr-plugins/tr-spring-boot-starter-plugin-dict/src/main/java/cn/tr/plugin/dict/TrDictAutoConfiguration.java

@@ -1,24 +0,0 @@
-package cn.tr.plugin.dict;
-
-import cn.tr.plugin.dict.config.cache.DictManager;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.cache.CacheManager;
-import org.springframework.cache.annotation.EnableCaching;
-import org.springframework.context.annotation.Bean;
-
-/**
- * @ClassName : TrDictAutoConfiguration
- * @Description :
- * @Author : LF
- * @Date: 2023年03月07日
- */
-@Slf4j
-@EnableCaching
-public class TrDictAutoConfiguration {
-
-    @Bean
-    public DictManager dictManager(CacheManager cacheManager){
-        return  new DictManager(cacheManager);
-    }
-
-}

+ 0 - 40
tr-plugins/tr-spring-boot-starter-plugin-dict/src/main/java/cn/tr/plugin/dict/annotation/Dict.java

@@ -1,40 +0,0 @@
-package cn.tr.plugin.dict.annotation;
-
-import cn.tr.plugin.dict.config.jackson.DictJacksonDeserializer;
-import cn.tr.plugin.dict.config.jackson.DictJacksonSerializer;
-import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import org.springframework.core.annotation.AliasFor;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * @@interface : Dict
- * @Description : 字典编码,可通过此编码获取 字典值所对应的 {@link cn.tr.plugin.dict.bo.DictBO}
- * @Author : LF
- * @Date: 2023年03月06日
- */
-@Target({ElementType.FIELD,ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@JacksonAnnotationsInside
-@JsonDeserialize(using = DictJacksonDeserializer.class)
-@JsonSerialize(using = DictJacksonSerializer.class)
-public @interface Dict {
-    /**
-     * 字典编码
-     * @return
-     */
-    String value() default "";
-
-    /**
-     * 字典描述
-     * @return
-     */
-    String dictDesc() default "";
-
-
-}

+ 0 - 61
tr-plugins/tr-spring-boot-starter-plugin-dict/src/main/java/cn/tr/plugin/dict/bo/DictBO.java

@@ -1,61 +0,0 @@
-package cn.tr.plugin.dict.bo;
-
-import cn.tr.plugin.dict.constant.DictConstant;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
-
-import java.io.Serializable;
-
-/**
- * @ClassName : DictBO
- * @Description : 字典对象
- * @Author : LF
- * @Date: 2023年03月06日
- */
-@Builder
-@Accessors(chain = true)
-@Data
-public class DictBO implements Serializable {
-    private static final long serialVersionUID = 5142288478671327671L;
-    /**
-     * value值
-     */
-    private String value;
-
-    /**
-     * 标签名称
-     */
-    private String label;
-
-    /**
-     * 标签颜色
-     */
-    private String color;
-
-    /**
-     * 顺序
-     */
-    private Integer sort;
-
-    public DictBO(String value, String label, String color, Integer sort) {
-        this.value = value;
-        this.label = label;
-        this.color = color;
-        this.sort = sort;
-    }
-
-    public DictBO(String value, String label, String color) {
-        this(value, label,color,DictConstant.DICT_SORT_DEFAULT);
-    }
-
-    public DictBO(String value, String label) {
-        this(value, label,null,DictConstant.DICT_SORT_DEFAULT);
-    }
-
-    public DictBO() {
-        this(null, null,null,DictConstant.DICT_SORT_DEFAULT);
-    }
-}

+ 0 - 85
tr-plugins/tr-spring-boot-starter-plugin-dict/src/main/java/cn/tr/plugin/dict/config/cache/DictManager.java

@@ -1,85 +0,0 @@
-package cn.tr.plugin.dict.config.cache;
-
-import cn.hutool.core.collection.CollectionUtil;
-import cn.tr.core.enums.IEnum;
-import cn.tr.plugin.dict.bo.DictBO;
-import cn.tr.plugin.dict.constant.DictConstant;
-import lombok.AllArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.cache.Cache;
-import org.springframework.cache.CacheManager;
-
-import java.util.*;
-
-/**
- * @ClassName : DictManager
- * @Description : 字典管理器
- * @Author : LF
- * @Date: 2023年03月06日
- */
-@Slf4j
-@AllArgsConstructor
-public class DictManager {
-    private final CacheManager cacheManager;
-
-    public void load(String dictCode, List<DictBO> dictDetails){
-        Cache cache = getCache(dictCode);
-        Map<String, DictBO> result = Optional.ofNullable(getAllLabel(cache)).orElse(new HashMap<>());
-        dictDetails.forEach(detail->result.put(detail.getValue(),detail));
-        cache.put(DictConstant.DICT_KEY,result);
-    }
-
-    public void loadAll(Map<String,List<DictBO>> dictCodeMaps){
-        dictCodeMaps.forEach(this::load);
-    }
-
-    public List<DictBO> lookAllByDictCode(String dictCode){
-        Cache cache = getCache(dictCode);
-        Map<String, DictBO> result = getAllLabel(cache);
-        List<DictBO> dictBos = CollectionUtil.isEmpty(result) ? new ArrayList<>() : new ArrayList<>(result.values());
-        if (CollectionUtil.isNotEmpty(dictBos)) {
-            dictBos.sort((t1,t2)->t1.getSort().compareTo(t2.getSort()));
-        }
-        return dictBos;
-    }
-
-
-    public DictBO lookByDictCode(String dictCode,String value){
-        Cache cache = getCache(dictCode);
-        Map<String, DictBO> result = getAllLabel(cache);
-        return CollectionUtil.isEmpty(result)?new DictBO()
-                : Optional.ofNullable(result.get(value)).orElse(new DictBO());
-    }
-
-    public void evict(String dictCode,String value){
-        Cache cache = getCache(dictCode);
-        Map<String, DictBO> allLabel = getAllLabel(cache);
-        if(CollectionUtil.isNotEmpty(allLabel)){
-            allLabel.remove(value);
-            cache.put(DictConstant.DICT_KEY,allLabel);
-        }
-    }
-
-    public void clear(String dictCode){
-        getCache(dictCode)
-                .clear();
-    }
-
-    private Map<String, DictBO> getAllLabel(Cache cache){
-        return  cache.get(DictConstant.DICT_KEY, HashMap<String, DictBO>::new);
-    }
-
-    private Cache getCache(String key){
-        String cacheName = getCacheName(key);
-        Cache cache = cacheManager.getCache(cacheName);
-        if(cache==null){
-            log.error("cache:{} does not exist or could be not created",cacheName);
-            throw new NullPointerException("缓存异常,系统内部错误,请联系管理员");
-        }
-        return cache;
-    }
-
-    private String getCacheName(String key){
-        return DictConstant.DICT_CACHE+key;
-    }
-}

+ 0 - 42
tr-plugins/tr-spring-boot-starter-plugin-dict/src/main/java/cn/tr/plugin/dict/config/jackson/DictJacksonDeserializer.java

@@ -1,42 +0,0 @@
-package cn.tr.plugin.dict.config.jackson;
-
-import cn.hutool.core.util.ObjectUtil;
-import com.fasterxml.jackson.core.JacksonException;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.TreeNode;
-import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.node.NullNode;
-import com.fasterxml.jackson.databind.node.TextNode;
-import lombok.NoArgsConstructor;
-
-import java.io.IOException;
-
-/**
- * @ClassName : DictJacksonSerializer
- * @Description : 字典序列化类
- * @Author : LF
- * @Date: 2023年03月06日
- */
-@NoArgsConstructor
-public class DictJacksonDeserializer extends JsonDeserializer<String>  {
-
-    @Override
-    public String deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JacksonException {
-        TreeNode treeNode = p.getCodec().readTree(p);
-        if(ObjectUtil.isNull(treeNode)){
-            return p.getText();
-        }
-        try {
-            TreeNode result = treeNode.get("value");
-            if(result instanceof NullNode || result==null){
-                return p.getText();
-            }
-            if(result instanceof TextNode){
-                return ((TextNode) result).asText();
-            }
-            return result.toString();
-        }catch (Exception e){
-            return p.getText();
-        }
-    }
-}

+ 0 - 58
tr-plugins/tr-spring-boot-starter-plugin-dict/src/main/java/cn/tr/plugin/dict/config/jackson/DictJacksonSerializer.java

@@ -1,58 +0,0 @@
-package cn.tr.plugin.dict.config.jackson;
-
-
-import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.extra.spring.SpringUtil;
-import cn.tr.plugin.dict.annotation.Dict;
-import cn.tr.plugin.dict.bo.DictBO;
-import cn.tr.plugin.dict.config.cache.DictManager;
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.BeanProperty;
-import com.fasterxml.jackson.databind.JsonMappingException;
-import com.fasterxml.jackson.databind.JsonSerializer;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.ContextualSerializer;
-import lombok.AllArgsConstructor;
-import lombok.NoArgsConstructor;
-
-import java.io.IOException;
-
-/**
- * @ClassName : DictJacksonSerializer
- * @Description : 字典序列化类
- * @Author : LF
- * @Date: 2023年03月06日
- */
-@AllArgsConstructor
-@NoArgsConstructor
-public class DictJacksonSerializer extends JsonSerializer<String> implements ContextualSerializer {
-    private Dict dict;
-
-    @Override
-    public void serialize(String value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
-        DictManager dictManager = SpringUtil.getBean(DictManager.class);
-        DictBO dictBO = dictManager.lookByDictCode(dict.value(), value);
-        gen.writeObject(dictBO);
-    }
-
-
-    @Override
-    public JsonSerializer<?> createContextual(SerializerProvider serializerProvider, BeanProperty beanProperty) throws JsonMappingException {
-        if (beanProperty != null) {
-            // 为空直接跳过
-            if (ObjectUtil.equals(beanProperty.getType().getRawClass(), String.class)) {
-                // 非 String 类直接跳过
-                dict = beanProperty.getAnnotation(Dict.class);
-                if (dict == null) {
-                    dict = beanProperty.getContextAnnotation(Dict.class);
-                }
-                // 如果能得到注解,就将注解的 value 传入 DictJacksonSerializer
-                if (dict != null) {
-                    return new DictJacksonSerializer(dict);
-                }
-            }
-            return serializerProvider.findValueSerializer(beanProperty.getType(), beanProperty);
-        }
-        return serializerProvider.findNullValueSerializer(beanProperty);
-    }
-}

+ 0 - 17
tr-plugins/tr-spring-boot-starter-plugin-dict/src/main/java/cn/tr/plugin/dict/constant/DictConstant.java

@@ -1,17 +0,0 @@
-package cn.tr.plugin.dict.constant;
-
-/**
- * @Interface : DictConstant
- * @Description :
- * @Author : LF
- * @Date: 2023年03月06日
- */
-
-public interface DictConstant {
-    String DICT_CACHE="dict:";
-
-
-    String DICT_KEY="$key$";
-
-    Integer DICT_SORT_DEFAULT=9999;
-}

+ 0 - 1
tr-plugins/tr-spring-boot-starter-plugin-dict/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@@ -1 +0,0 @@
-cn.tr.plugin.dict.TrDictAutoConfiguration

+ 0 - 17
tr-plugins/tr-spring-boot-starter-plugin-dict/src/main/resources/application-unit-test.yml

@@ -1,17 +0,0 @@
-spring:
-  redis:
-    host: 192.168.100.32
-    password: 6E6985E1F7CB40F24A\.
-    port: 9736
-    database: 7
-    timeout: 30s
-    lettuce:
-      pool:
-        # 连接池中的最小空闲连接
-        min-idle: 16
-        # 连接池中的最大空闲连接
-        max-idle: 16
-        # 连接池的最大数据库连接数
-        max-active: 16
-        # #连接池最大阻塞等待时间(使用负值表示没有限制)
-        max-wait: -1ms

+ 0 - 74
tr-plugins/tr-spring-boot-starter-plugin-dict/src/test/java/cn/tr/plugin/dict/config/cache/CaffeineDictManagerTest.java

@@ -1,74 +0,0 @@
-package cn.tr.plugin.dict.config.cache;
-
-import cn.hutool.core.collection.CollectionUtil;
-import cn.tr.plugin.dict.bo.DictBO;
-import cn.tr.plugin.test.ut.BaseMockitoUnitTest;
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.springframework.cache.caffeine.CaffeineCacheManager;
-
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * @ClassName : DictMananerTest
- * @Description :
- * @Author : LF
- * @Date: 2023年03月06日
- */
-
-public class CaffeineDictManagerTest extends BaseMockitoUnitTest {
-    private DictManager dictManager;
-    @BeforeEach
-    public void setUp(){
-        dictManager=new DictManager(new CaffeineCacheManager());
-    }
-
-    @Test
-    public void testLoad(){
-        List<DictBO> dicts = Arrays.asList(new DictBO("t1", "测试1"));
-        dictManager.load("test",dicts);
-        List<DictBO> test = dictManager.lookAllByDictCode("test");
-        Assertions.assertEquals(CollectionUtil.size(test),1);
-        Assertions.assertEquals(test,dicts);
-    }
-
-    @Test
-    public void testLoadAll(){
-        List<DictBO> dicts = Arrays.asList(new DictBO("t1", "测试1"),new DictBO("t2", "测试2"));
-        dictManager.load("test",dicts);
-        List<DictBO> test = dictManager.lookAllByDictCode("test");
-        Assertions.assertEquals(CollectionUtil.size(test),2);
-        Assertions.assertEquals(test,dicts);
-    }
-
-    @Test
-    public void testLookByDictCode(){
-        List<DictBO> dicts = Arrays.asList(new DictBO("t1", "测试1"),new DictBO("t2", "测试2"));
-        dictManager.load("test",dicts);
-        DictBO dictBO = dictManager.lookByDictCode("test", "t1");
-        Assertions.assertEquals(dictBO.getLabel(),"测试1");
-    }
-
-    @Test
-    public void testEvict(){
-        List<DictBO> dicts = Arrays.asList(new DictBO("t1", "测试1"),new DictBO("t2", "测试2"));
-        dictManager.load("test",dicts);
-        DictBO dictBO = dictManager.lookByDictCode("test", "t1");
-        Assertions.assertEquals(dictBO.getLabel(),"测试1");
-        dictManager.evict("test","t1");
-        dictBO = dictManager.lookByDictCode("test", "t1");
-        Assertions.assertNull(dictBO.getValue());
-    }
-    @Test
-    public void testClear(){
-        List<DictBO> dicts = Arrays.asList(new DictBO("t1", "测试1"),new DictBO("t2", "测试2"));
-        dictManager.load("test",dicts);
-        List<DictBO> result = dictManager.lookAllByDictCode("test");
-        Assertions.assertEquals(CollectionUtil.size(result),2);
-        dictManager.clear("test");
-        result = dictManager.lookAllByDictCode("test");
-        Assertions.assertEquals(CollectionUtil.size(result),0);
-    }
-}

+ 0 - 115
tr-plugins/tr-spring-boot-starter-plugin-dict/src/test/java/cn/tr/plugin/dict/config/cache/RedisDictManagerTest.java

@@ -1,115 +0,0 @@
-package cn.tr.plugin.dict.config.cache;
-
-import cn.hutool.core.collection.CollectionUtil;
-import cn.tr.plugin.dict.bo.DictBO;
-import cn.tr.plugin.test.ut.BaseRedisUnitTest;
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.cache.CacheManager;
-import org.springframework.data.redis.cache.RedisCacheConfiguration;
-import org.springframework.data.redis.cache.RedisCacheManager;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.data.redis.serializer.RedisSerializationContext;
-
-import java.time.Duration;
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * @ClassName : RedisDictManangerTest
- * @Description :
- * @Author : LF
- * @Date: 2023年03月07日
- */
-
-public class RedisDictManagerTest extends BaseRedisUnitTest {
-    private DictManager dictManager;
-    @Autowired
-    private RedisTemplate redisTemplate;
-
-    @BeforeEach
-    public void init(){
-        dictManager=new DictManager(cacheManager(redisTemplate));
-        dictManager.clear("test");
-    }
-
-    public CacheManager cacheManager(RedisTemplate<String, Object> template) {
-
-        // 基本配置
-        RedisCacheConfiguration defaultCacheConfiguration =
-                RedisCacheConfiguration
-                        .defaultCacheConfig()
-                        // 设置key为String
-                        .serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(template.getStringSerializer()))
-                        // 设置value 为自动转Json的Object
-                        .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(template.getValueSerializer()))
-                        // 不缓存null
-                        .disableCachingNullValues()
-                        // 缓存数据保存1小时
-                        .entryTtl(Duration.ofHours(1));
-
-        // 够着一个redis缓存管理器
-        RedisCacheManager redisCacheManager =
-                RedisCacheManager.RedisCacheManagerBuilder
-                        // Redis 连接工厂
-                        .fromConnectionFactory(template.getConnectionFactory())
-                        // 缓存配置
-                        .cacheDefaults(defaultCacheConfiguration)
-                        // 配置同步修改或删除 put/evict
-                        .transactionAware()
-                        .build();
-
-        return redisCacheManager;
-    }
-
-    @Test
-    public void testLoad(){
-        List<DictBO> dicts = Arrays.asList(new DictBO("t1", "测试1"));
-        dictManager.load("test",dicts);
-        List<DictBO> test = dictManager.lookAllByDictCode("test");
-        Assertions.assertEquals(CollectionUtil.size(test),1);
-        Assertions.assertEquals(test,dicts);
-    }
-
-    @Test
-    public void testLoadAll(){
-        List<DictBO> dicts = Arrays.asList(new DictBO("t1", "测试1"),new DictBO("t2", "测试2"));
-        dictManager.load("test",dicts);
-        List<DictBO> test = dictManager.lookAllByDictCode("test");
-        Assertions.assertEquals(CollectionUtil.size(test),2);
-        Assertions.assertEquals(test,dicts);
-    }
-
-    @Test
-    public void testLookByDictCode(){
-        List<DictBO> dicts = Arrays.asList(new DictBO("t1", "测试1"),new DictBO("t2", "测试2"));
-        dictManager.load("test",dicts);
-        DictBO dictBO = dictManager.lookByDictCode("test", "t1");
-        Assertions.assertEquals(dictBO.getLabel(),"测试1");
-    }
-
-    @Test
-    public void testEvict(){
-        List<DictBO> dicts = Arrays.asList(new DictBO("t1", "测试1"),new DictBO("t2", "测试2"));
-        dictManager.load("test",dicts);
-        DictBO dictBO = dictManager.lookByDictCode("test", "t1");
-        Assertions.assertEquals(dictBO.getLabel(),"测试1");
-        dictManager.evict("test","t1");
-        dictBO = dictManager.lookByDictCode("test", "t1");
-        Assertions.assertNull(dictBO.getValue());
-    }
-    @Test
-    public void testClear(){
-        List<DictBO> dicts = Arrays.asList(new DictBO("t1", "测试1"),new DictBO("t2", "测试2"));
-        dictManager.load("test",dicts);
-        List<DictBO> result = dictManager.lookAllByDictCode("test");
-        Assertions.assertEquals(CollectionUtil.size(result),2);
-        dictManager.clear("test");
-        result = dictManager.lookAllByDictCode("test");
-        Assertions.assertEquals(CollectionUtil.size(result),0);
-    }
-
-
-}

+ 0 - 75
tr-plugins/tr-spring-boot-starter-plugin-dict/src/test/java/cn/tr/plugin/dict/config/jackson/DictJacksonSerializerTest.java

@@ -1,75 +0,0 @@
-package cn.tr.plugin.dict.config.jackson;
-
-import cn.hutool.extra.spring.SpringUtil;
-import cn.tr.plugin.dict.annotation.Dict;
-import cn.tr.plugin.dict.bo.DictBO;
-import cn.tr.plugin.dict.config.cache.DictManager;
-import cn.tr.plugin.test.ut.BaseMockitoUnitTest;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.mockito.*;
-import org.springframework.cache.caffeine.CaffeineCacheManager;
-import java.util.Arrays;
-
-/**
- * @ClassName : DictJacksonSerializerTest
- * @Description :
- * @Author : LF
- * @Date: 2023年03月07日
- */
-
-public class DictJacksonSerializerTest extends BaseMockitoUnitTest {
-
-    private ObjectMapper objectMapper=new ObjectMapper();
-
-    private DictManager dictManager;
-
-    @BeforeEach
-    public void setUp(){
-        dictManager=new DictManager(new CaffeineCacheManager());
-        MockedStatic<SpringUtil> mockedStatic = Mockito.mockStatic(SpringUtil.class);
-        mockedStatic.when(()->SpringUtil.getBean(Mockito.same(DictManager.class))).thenReturn(dictManager);
-
-    }
-
-
-    /**
-     * 序列化
-     * @throws JsonProcessingException
-     */
-    @Test
-    public void serializer() throws JsonProcessingException {
-        dictManager.load("gender", Arrays.asList(new DictBO("1","男"),new DictBO("2","女")));
-        User man = new User("1");
-        User woman = new User("2");
-        Assertions.assertEquals(objectMapper.writeValueAsString(man),"{\"gender\":{\"value\":\"1\",\"label\":\"男\",\"color\":null,\"sort\":9999}}");
-        Assertions.assertEquals(objectMapper.writeValueAsString(woman),"{\"gender\":{\"value\":\"2\",\"label\":\"女\",\"color\":null,\"sort\":9999}}");
-    }
-
-    /**
-     * 反序列化
-     */
-    @Test
-    public void deserializer() throws JsonProcessingException {
-        dictManager.load("gender", Arrays.asList(new DictBO("1","男"),new DictBO("2","女")));
-        User man = new User("1");
-        String json=objectMapper.writeValueAsString(man);
-        Assertions.assertEquals(objectMapper.writeValueAsString(man),"{\"gender\":{\"value\":\"1\",\"label\":\"男\",\"color\":null,\"sort\":9999}}");
-        User user = objectMapper.readValue(json, User.class);
-        Assertions.assertEquals(user.getGender(),"1");
-    }
-
-    @AllArgsConstructor
-    @Data
-    @NoArgsConstructor
-    static class User{
-        @Dict("gender")
-        String gender;
-    }
-}

+ 0 - 40
tr-plugins/tr-spring-boot-starter-plugin-flink/pom.xml

@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>tr-plugins</artifactId>
-        <groupId>cn.tr</groupId>
-        <version>${revision}</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>tr-spring-boot-starter-plugin-flink</artifactId>
-    <version>${revision}</version>
-    <packaging>jar</packaging>
-
-    <dependencies>
-        <dependency>
-            <groupId>cn.tr</groupId>
-            <artifactId>tr-framework</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.flink</groupId>
-            <artifactId>flink-streaming-java</artifactId>
-        </dependency>
-
-
-        <dependency>
-            <groupId>org.apache.flink</groupId>
-            <artifactId>flink-clients</artifactId>
-        </dependency>
-
-
-        <dependency>
-            <groupId>cn.tr</groupId>
-            <artifactId>tr-spring-boot-starter-plugin-test</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-</project>

+ 0 - 19
tr-plugins/tr-spring-boot-starter-plugin-flink/src/main/java/cn/tr/plugin/flink/TrFlinkAutoConfiguration.java

@@ -1,19 +0,0 @@
-package cn.tr.plugin.flink;
-
-import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
-import org.springframework.context.annotation.Bean;
-
-/**
- * @ClassName : TrFlinkAutoConfiguration
- * @Description :
- * @Author : LF
- * @Date: 2023年03月17日
- */
-public class TrFlinkAutoConfiguration {
-    @Bean
-    public StreamExecutionEnvironment executionEnvironmen(){
-        StreamExecutionEnvironment executionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment();
-
-        return executionEnvironment;
-    }
-}

+ 0 - 1
tr-plugins/tr-spring-boot-starter-plugin-flink/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@@ -1 +0,0 @@
-cn.tr.plugin.flink.TrFlinkAutoConfiguration

+ 0 - 46
tr-plugins/tr-spring-boot-starter-plugin-flink/src/test/java/cn/tr/plugin/fink/FlinkTest.java

@@ -1,46 +0,0 @@
-package cn.tr.plugin.fink;
-
-import cn.tr.plugin.test.ut.BaseMockitoUnitTest;
-import org.apache.flink.streaming.api.datastream.DataStreamSource;
-import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
-import org.apache.flink.streaming.api.functions.sink.SinkFunction;
-import org.apache.flink.streaming.api.functions.source.SourceFunction;
-import org.junit.jupiter.api.Test;
-
-import java.util.Arrays;
-
-/**
- * @ClassName : FlinkTest
- * @Description :
- * @Author : LF
- * @Date: 2023年03月17日
- */
-
-public class FlinkTest extends BaseMockitoUnitTest {
-    @Test
-    public void test() throws Exception {
-        StreamExecutionEnvironment ec = StreamExecutionEnvironment.getExecutionEnvironment();
-
-        DataStreamSource<Object> streamSource = ec.addSource(new SourceFunction<Object>() {
-            @Override
-            public void run(SourceContext<Object> ctx) throws Exception {
-                System.out.println("发送时间"+System.currentTimeMillis());
-                ctx.collect(Arrays.asList("1","2","3"));
-            }
-
-            @Override
-            public void cancel() {
-
-            }
-        });
-        streamSource.addSink(new SinkFunction<Object>() {
-            @Override
-            public void invoke(Object value, Context context) throws Exception {
-                System.out.println(value);
-                System.out.println("接收时间"+System.currentTimeMillis());
-            }
-        });
-
-        ec.execute();
-    }
-}

+ 0 - 1
tr-plugins/tr-spring-boot-starter-plugin-import-export/src/main/java/cn/tr/plugin/excel/CompositeExcelTemplateFacade.java

@@ -3,7 +3,6 @@ package cn.tr.plugin.excel;
 import cn.tr.core.context.SecurityContextHolder;
 import cn.tr.plugin.eventbus.annotation.Subscribe;
 import cn.tr.plugin.excel.im.*;
-import cn.tr.plugin.security.bo.UserLoginInfoBO;
 import cn.tr.plugin.security.context.LoginUserContextHolder;
 import lombok.AllArgsConstructor;
 

+ 0 - 28
tr-plugins/tr-spring-boot-starter-plugin-mq/pom.xml

@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>tr-plugins</artifactId>
-        <groupId>cn.tr</groupId>
-        <version>${revision}</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>tr-spring-boot-starter-plugin-mq</artifactId>
-    <version>${revision}</version>
-    <description>消息队列</description>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-amqp</artifactId>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.springframework.boot</groupId>
-                    <artifactId>spring-boot-starter-logging</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-    </dependencies>
-</project>

+ 0 - 43
tr-plugins/tr-spring-boot-starter-plugin-operatelog/pom.xml

@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>tr-plugins</artifactId>
-        <groupId>cn.tr</groupId>
-        <version>${revision}</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <version>${revision}</version>
-    <artifactId>tr-spring-boot-starter-plugin-operatelog</artifactId>
-    <description>操作日志记录</description>
-
-    <dependencies>
-        <dependency>
-            <groupId>cn.tr</groupId>
-            <artifactId>tr-framework</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-            <scope>provided</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-aop</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>cn.tr</groupId>
-            <artifactId>tr-spring-boot-starter-plugin-doc</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>cn.tr</groupId>
-            <artifactId>tr-spring-boot-starter-plugin-web</artifactId>
-        </dependency>
-    </dependencies>
-</project>

+ 0 - 19
tr-plugins/tr-spring-boot-starter-plugin-operatelog/src/main/java/cn/tr/plugin/operatelog/TrOperateLogAutoConfiguration.java

@@ -1,19 +0,0 @@
-package cn.tr.plugin.operatelog;
-
-import cn.tr.plugin.operatelog.config.OperateLogAspect;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * @ClassName : TrOperateLogAutoConfiguration
- * @Description :
- * @Author : LF
- * @Date: 2023年03月21日
- */
-public class TrOperateLogAutoConfiguration {
-
-    @Bean
-    public OperateLogAspect operateLogAspect(){
-        return new OperateLogAspect();
-    }
-}

+ 0 - 27
tr-plugins/tr-spring-boot-starter-plugin-operatelog/src/main/java/cn/tr/plugin/operatelog/strategy/OperateStrategy.java

@@ -1,27 +0,0 @@
-package cn.tr.plugin.operatelog.strategy;
-
-import cn.tr.plugin.operatelog.bo.OperateLogBO;
-
-import java.util.function.Consumer;
-
-/**
- * @ClassName : OperateStrategy
- * @Description :
- * @Author : LF
- * @Date: 2023年03月21日
- */
-
-public class OperateStrategy {
-    private OperateStrategy(){
-
-    }
-
-    public Consumer<OperateLogBO> logSaveConsumer= log->{};
-    public static OperateStrategy tr=new OperateStrategy();
-
-    public void saveLog(OperateLogBO log){
-        if(logSaveConsumer!=null){
-            logSaveConsumer.accept(log);
-        }
-    }
-}

+ 0 - 1
tr-plugins/tr-spring-boot-starter-plugin-operatelog/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@@ -1 +0,0 @@
-cn.tr.plugin.operatelog.TrOperateLogAutoConfiguration

+ 2 - 13
tr-test/pom.xml

@@ -32,12 +32,6 @@
             <artifactId>tr-spring-boot-starter-plugin-websocket</artifactId>
         </dependency>
 
-        <dependency>
-            <groupId>cn.tr</groupId>
-            <artifactId>tr-module-import-export</artifactId>
-            <version>0.0.9</version>
-        </dependency>
-
         <dependency>
             <groupId>org.redisson</groupId>
             <artifactId>redisson-spring-boot-starter</artifactId>
@@ -57,12 +51,7 @@
             <groupId>cn.tr</groupId>
             <artifactId>tr-spring-boot-starter-plugin-desensitize</artifactId>
         </dependency>
-
-        <dependency>
-            <groupId>cn.tr</groupId>
-            <artifactId>tr-spring-boot-starter-plugin-dict</artifactId>
-        </dependency>
-
+        
         <dependency>
             <groupId>cn.tr</groupId>
             <artifactId>tr-spring-boot-starter-plugin-doc</artifactId>
@@ -100,7 +89,7 @@
 
         <dependency>
             <groupId>cn.tr</groupId>
-            <artifactId>tr-module-import-export</artifactId>
+            <artifactId>tr-module-export</artifactId>
             <version>0.0.9</version>
         </dependency>
 

+ 14 - 4
tr-test/src/test/java/cn/tr/module/excel/CompositeExcelTemplateFacadeTest.java

@@ -4,7 +4,6 @@ import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.io.IoUtil;
 import cn.hutool.core.util.RandomUtil;
 import cn.hutool.poi.excel.ExcelUtil;
-import cn.hutool.poi.excel.ExcelWriter;
 import cn.tr.core.utils.JsonUtils;
 import cn.tr.module.excel.sheet.service.IExcelService;
 import cn.tr.plugin.eventbus.config.EventBus;
@@ -17,6 +16,9 @@ import cn.tr.plugin.excel.im.listener.RowHandlerListener;
 import cn.tr.plugin.security.bo.UserLoginInfoBO;
 import cn.tr.plugin.security.context.LoginUserContextHolder;
 import cn.tr.test.WebApplication;
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.ExcelWriter;
+import com.alibaba.excel.annotation.ExcelProperty;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
@@ -81,15 +83,23 @@ public class CompositeExcelTemplateFacadeTest {
         }
     }
 
+    @Test
+    public void exportTemplate(){
+
+        ExcelWriter build = EasyExcel.write("C:\\Users\\JR\\Desktop\\test1.xls", User.class)
+                .build();
+
+    }
+
     @AllArgsConstructor(staticName = "of")
     @Data
     @NoArgsConstructor
     static class User{
-        @Excel(name = "姓名")
+        @ExcelProperty("姓名")
         private String name;
-        @Excel(name = "生日")
+        @ExcelProperty("生日")
         private String  birthday;
-        @Excel(name = "年龄")
+        @ExcelProperty("年龄")
         private Integer age;
     }
 

Некоторые файлы не были показаны из-за большого количества измененных файлов