mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
cf-framework:dict移到starter-excel、升级easyexcel版本
This commit is contained in:
@@ -59,7 +59,7 @@
|
|||||||
<lombok.version>1.18.30</lombok.version>
|
<lombok.version>1.18.30</lombok.version>
|
||||||
<mapstruct.version>1.5.5.Final</mapstruct.version>
|
<mapstruct.version>1.5.5.Final</mapstruct.version>
|
||||||
<hutool.version>5.8.25</hutool.version>
|
<hutool.version>5.8.25</hutool.version>
|
||||||
<easyexcel.verion>3.3.3</easyexcel.verion>
|
<easyexcel.verion>4.0.3</easyexcel.verion>
|
||||||
<velocity.version>2.3</velocity.version>
|
<velocity.version>2.3</velocity.version>
|
||||||
<screw.version>1.0.5</screw.version>
|
<screw.version>1.0.5</screw.version>
|
||||||
<fastjson.version>1.2.83</fastjson.version>
|
<fastjson.version>1.2.83</fastjson.version>
|
||||||
@@ -75,7 +75,8 @@
|
|||||||
<!-- 三方云服务相关 -->
|
<!-- 三方云服务相关 -->
|
||||||
<okio.version>3.5.0</okio.version>
|
<okio.version>3.5.0</okio.version>
|
||||||
<okhttp3.version>4.11.0</okhttp3.version>
|
<okhttp3.version>4.11.0</okhttp3.version>
|
||||||
<commons-io.version>2.15.1</commons-io.version>
|
<commons-io.version>2.17.0</commons-io.version>
|
||||||
|
<commons-compress.version>1.27.1</commons-compress.version>
|
||||||
<minio.version>8.5.7</minio.version>
|
<minio.version>8.5.7</minio.version>
|
||||||
<aliyun-java-sdk-core.version>4.6.4</aliyun-java-sdk-core.version>
|
<aliyun-java-sdk-core.version>4.6.4</aliyun-java-sdk-core.version>
|
||||||
<aliyun-java-sdk-dysmsapi.version>2.2.1</aliyun-java-sdk-dysmsapi.version>
|
<aliyun-java-sdk-dysmsapi.version>2.2.1</aliyun-java-sdk-dysmsapi.version>
|
||||||
@@ -143,11 +144,6 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.cf.imes</groupId>
|
|
||||||
<artifactId>cf-spring-boot-starter-biz-dict</artifactId>
|
|
||||||
<version>${revision}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cf.imes</groupId>
|
<groupId>com.cf.imes</groupId>
|
||||||
<artifactId>cf-spring-boot-starter-biz-sms</artifactId>
|
<artifactId>cf-spring-boot-starter-biz-sms</artifactId>
|
||||||
@@ -539,6 +535,11 @@
|
|||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
<version>${commons-io.version}</version>
|
<version>${commons-io.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-compress</artifactId>
|
||||||
|
<version>${commons-compress.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.tika</groupId>
|
<groupId>org.apache.tika</groupId>
|
||||||
|
|||||||
@@ -1,56 +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>
|
|
||||||
<groupId>com.cf.imes</groupId>
|
|
||||||
<artifactId>cf-framework</artifactId>
|
|
||||||
<version>${revision}</version>
|
|
||||||
</parent>
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<artifactId>cf-spring-boot-starter-biz-dict</artifactId>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<name>${project.artifactId}</name>
|
|
||||||
<description>字典类型、数据</description>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.cf.imes</groupId>
|
|
||||||
<artifactId>cf-common</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Spring 核心 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- RPC 远程调用相关 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.cf.imes</groupId>
|
|
||||||
<artifactId>cf-spring-boot-starter-rpc</artifactId>
|
|
||||||
<optional>true</optional>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 业务组件 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.cf.imes</groupId>
|
|
||||||
<artifactId>cf-module-system-api</artifactId> <!-- 需要使用它,进行 Token 的校验 -->
|
|
||||||
<version>${revision}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 工具类相关 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.google.guava</groupId>
|
|
||||||
<artifactId>guava</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Test 测试相关 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.cf.imes</groupId>
|
|
||||||
<artifactId>cf-spring-boot-starter-test</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</project>
|
|
||||||
-49
@@ -1,49 +0,0 @@
|
|||||||
package com.cf.imes.framework.dict.core.util;
|
|
||||||
|
|
||||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
|
||||||
import com.cf.imes.framework.test.core.ut.BaseMockitoUnitTest;
|
|
||||||
import com.cf.imes.module.system.api.dict.DictDataApi;
|
|
||||||
import com.cf.imes.module.system.api.dict.dto.DictDataRespDTO;
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.mockito.Mock;
|
|
||||||
|
|
||||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
|
||||||
import static com.cf.imes.framework.test.core.util.RandomUtils.randomPojo;
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
||||||
import static org.mockito.Mockito.when;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@link DictFrameworkUtils} 的单元测试
|
|
||||||
*/
|
|
||||||
public class DictFrameworkUtilsTest extends BaseMockitoUnitTest {
|
|
||||||
|
|
||||||
@Mock
|
|
||||||
private DictDataApi dictDataApi;
|
|
||||||
|
|
||||||
@BeforeEach
|
|
||||||
public void setUp() {
|
|
||||||
DictFrameworkUtils.init(dictDataApi);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testGetDictDataLabel() {
|
|
||||||
// mock 数据
|
|
||||||
DictDataRespDTO dataRespDTO = randomPojo(DictDataRespDTO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus()));
|
|
||||||
// mock 方法
|
|
||||||
when(dictDataApi.getDictData(dataRespDTO.getDictType(), dataRespDTO.getValue())).thenReturn(success(dataRespDTO));
|
|
||||||
// 断言返回值
|
|
||||||
assertEquals(dataRespDTO.getLabel(), DictFrameworkUtils.getDictDataLabel(dataRespDTO.getDictType(), dataRespDTO.getValue()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testParseDictDataValue() {
|
|
||||||
// mock 数据
|
|
||||||
DictDataRespDTO resp = randomPojo(DictDataRespDTO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus()));
|
|
||||||
// mock 方法
|
|
||||||
when(dictDataApi.parseDictData(resp.getDictType(), resp.getLabel())).thenReturn(success(resp));
|
|
||||||
// 断言返回值
|
|
||||||
assertEquals(resp.getValue(), DictFrameworkUtils.parseDictDataValue(resp.getDictType(), resp.getLabel()));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -20,11 +20,24 @@
|
|||||||
<artifactId>cf-common</artifactId>
|
<artifactId>cf-common</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Spring 核心 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- RPC 远程调用相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.cf.imes</groupId>
|
||||||
|
<artifactId>cf-spring-boot-starter-rpc</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 业务组件 -->
|
<!-- 业务组件 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cf.imes</groupId>
|
<groupId>com.cf.imes</groupId>
|
||||||
<artifactId>cf-spring-boot-starter-biz-dict</artifactId>
|
<artifactId>cf-module-system-api</artifactId>
|
||||||
<optional>true</optional> <!-- 如果希望使用 @DictFormat 注解,需要引入该依赖 -->
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Web 相关 -->
|
<!-- Web 相关 -->
|
||||||
@@ -45,6 +58,16 @@
|
|||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>easyexcel</artifactId>
|
<artifactId>easyexcel</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-compress</artifactId> <!-- 解决 https://github.com/alibaba/easyexcel/issues/3954 问题 -->
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.guava</groupId>
|
||||||
|
<artifactId>guava</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -28,7 +28,6 @@
|
|||||||
<module>cf-spring-boot-starter-test</module>
|
<module>cf-spring-boot-starter-test</module>
|
||||||
|
|
||||||
<module>cf-spring-boot-starter-biz-operatelog</module>
|
<module>cf-spring-boot-starter-biz-operatelog</module>
|
||||||
<module>cf-spring-boot-starter-biz-dict</module>
|
|
||||||
<module>cf-spring-boot-starter-biz-sms</module>
|
<module>cf-spring-boot-starter-biz-sms</module>
|
||||||
|
|
||||||
<module>cf-spring-boot-starter-biz-pay</module>
|
<module>cf-spring-boot-starter-biz-pay</module>
|
||||||
|
|||||||
@@ -24,10 +24,6 @@
|
|||||||
<artifactId>cf-module-prod-executor-api</artifactId>
|
<artifactId>cf-module-prod-executor-api</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.cf.imes</groupId>
|
|
||||||
<artifactId>cf-spring-boot-starter-biz-dict</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!-- 业务组件 -->
|
<!-- 业务组件 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cf.imes</groupId>
|
<groupId>com.cf.imes</groupId>
|
||||||
@@ -216,10 +212,6 @@
|
|||||||
<groupId>com.cf.imes</groupId>
|
<groupId>com.cf.imes</groupId>
|
||||||
<artifactId>cf-spring-boot-starter-biz-data-permission</artifactId>
|
<artifactId>cf-spring-boot-starter-biz-data-permission</artifactId>
|
||||||
</include>
|
</include>
|
||||||
<include>
|
|
||||||
<groupId>com.cf.imes</groupId>
|
|
||||||
<artifactId>cf-spring-boot-starter-biz-dict</artifactId>
|
|
||||||
</include>
|
|
||||||
<include>
|
<include>
|
||||||
<groupId>com.cf.imes</groupId>
|
<groupId>com.cf.imes</groupId>
|
||||||
<artifactId>cf-spring-boot-starter-biz-operatelog</artifactId>
|
<artifactId>cf-spring-boot-starter-biz-operatelog</artifactId>
|
||||||
|
|||||||
@@ -30,10 +30,6 @@
|
|||||||
<artifactId>cf-module-prod-plan-api</artifactId>
|
<artifactId>cf-module-prod-plan-api</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.cf.imes</groupId>
|
|
||||||
<artifactId>cf-spring-boot-starter-biz-dict</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 业务组件 -->
|
<!-- 业务组件 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -227,10 +223,6 @@
|
|||||||
<groupId>com.cf.imes</groupId>
|
<groupId>com.cf.imes</groupId>
|
||||||
<artifactId>cf-spring-boot-starter-biz-id</artifactId>
|
<artifactId>cf-spring-boot-starter-biz-id</artifactId>
|
||||||
</include>
|
</include>
|
||||||
<include>
|
|
||||||
<groupId>com.cf.imes</groupId>
|
|
||||||
<artifactId>cf-spring-boot-starter-biz-dict</artifactId>
|
|
||||||
</include>
|
|
||||||
</includes>
|
</includes>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
@@ -273,7 +265,6 @@
|
|||||||
cf-spring-boot-starter-elasticsearch,
|
cf-spring-boot-starter-elasticsearch,
|
||||||
cf-module-prod-executor-api,
|
cf-module-prod-executor-api,
|
||||||
cf-spring-boot-starter-biz-id,
|
cf-spring-boot-starter-biz-id,
|
||||||
cf-spring-boot-starter-biz-dict,
|
|
||||||
cf-spring-boot-starter-test
|
cf-spring-boot-starter-test
|
||||||
</excludeArtifactIds>
|
</excludeArtifactIds>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@@ -50,10 +50,7 @@
|
|||||||
<groupId>com.cf.imes</groupId>
|
<groupId>com.cf.imes</groupId>
|
||||||
<artifactId>cf-spring-boot-starter-biz-sms</artifactId>
|
<artifactId>cf-spring-boot-starter-biz-sms</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.cf.imes</groupId>
|
|
||||||
<artifactId>cf-spring-boot-starter-biz-dict</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cf.imes</groupId>
|
<groupId>com.cf.imes</groupId>
|
||||||
<artifactId>cf-spring-boot-starter-biz-organ</artifactId>
|
<artifactId>cf-spring-boot-starter-biz-organ</artifactId>
|
||||||
@@ -247,10 +244,7 @@
|
|||||||
<groupId>com.cf.imes</groupId>
|
<groupId>com.cf.imes</groupId>
|
||||||
<artifactId>cf-module-system-api</artifactId>
|
<artifactId>cf-module-system-api</artifactId>
|
||||||
</include>
|
</include>
|
||||||
<include>
|
|
||||||
<groupId>com.cf.imes</groupId>
|
|
||||||
<artifactId>cf-spring-boot-starter-biz-dict</artifactId>
|
|
||||||
</include>
|
|
||||||
<include>
|
<include>
|
||||||
<groupId>com.cf.imes</groupId>
|
<groupId>com.cf.imes</groupId>
|
||||||
<artifactId>cf-spring-boot-starter-biz-ip</artifactId>
|
<artifactId>cf-spring-boot-starter-biz-ip</artifactId>
|
||||||
|
|||||||
Reference in New Issue
Block a user