1. 调整 common 相关

This commit is contained in:
zhaowenyuan 2024-07-01 09:21:26 +08:00
parent ccb787514f
commit 1d2d50d17e
14 changed files with 97 additions and 36 deletions

View File

@ -44,7 +44,7 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.chushang</groupId> <groupId>com.chushang</groupId>
<artifactId>chushang-common-excel</artifactId> <artifactId>chushang-common-office</artifactId>
<version>${common.version}</version> <version>${common.version}</version>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -163,16 +163,17 @@ public class DataScopeAspect {
private Map<String, Object> getSqlParam(final JoinPoint joinPoint){ private Map<String, Object> getSqlParam(final JoinPoint joinPoint){
Object[] args = joinPoint.getArgs(); Object[] args = joinPoint.getArgs();
if (null == args || args.length == 0) return new HashMap<>(); if (null == args || args.length == 0) return new HashMap<>();
Object params = joinPoint.getArgs()[0]; Map<String, Object> sqlParam = new HashMap<>();
Map<String, Object> sqlParam; for (Object arg : args) {
if (StringUtils.isNotNull(params) && params instanceof BaseEntity) { if (!(arg instanceof BaseEntity || arg instanceof CommonParam)) {
BaseEntity baseEntity = (BaseEntity) params; continue;
}
if (arg instanceof BaseEntity baseEntity) {
sqlParam = baseEntity.getSqlParam(); sqlParam = baseEntity.getSqlParam();
} else if (StringUtils.isNotNull(params) && params instanceof CommonParam) {
CommonParam commonParam = (CommonParam) params;
sqlParam = commonParam.getSqlParam();
} else { } else {
return new HashMap<>(); CommonParam commonParam = (CommonParam) arg;
sqlParam = commonParam.getSqlParam();
}
} }
return sqlParam; return sqlParam;
} }

View File

@ -1,24 +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>chushang-common</artifactId>
<groupId>com.chushang</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>chushang-common-excel</artifactId>
<dependencies>
<dependency>
<groupId>com.chushang</groupId>
<artifactId>chushang-common-core</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,84 @@
<?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>chushang-common</artifactId>
<groupId>com.chushang</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>chushang-common-office</artifactId>
<description>
操作office 相关文件, word, excel 等
</description>
<dependencies>
<dependency>
<groupId>com.chushang</groupId>
<artifactId>chushang-common-core</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
</exclusion>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.15.0</version>
</dependency>
<dependency>
<groupId>com.deepoove</groupId>
<artifactId>poi-tl</artifactId>
<version>1.12.2</version>
<exclusions>
<exclusion>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-bridge</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
</exclusion>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>5.2.5</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.5</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>4.1.2</version>
</dependency>
</dependencies>
</project>

View File

@ -20,7 +20,7 @@
<module>chushang-common-data-scope</module> <module>chushang-common-data-scope</module>
<module>chushang-common-dict</module> <module>chushang-common-dict</module>
<module>chushang-common-easy-es</module> <module>chushang-common-easy-es</module>
<module>chushang-common-excel</module> <module>chushang-common-office</module>
<module>chushang-common-feign</module> <module>chushang-common-feign</module>
<module>chushang-common-job</module> <module>chushang-common-job</module>
<module>chushang-common-log</module> <module>chushang-common-log</module>