Skip to content

Commit

Permalink
Merge pull request #117 from erupts/develop
Browse files Browse the repository at this point in the history
1.10.13
  • Loading branch information
erupts authored Sep 4, 2022
2 parents 66d3d4d + dc78039 commit ecc0665
Show file tree
Hide file tree
Showing 51 changed files with 328 additions and 142 deletions.
11 changes: 1 addition & 10 deletions erupt-annotation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.10.12</version>
<version>1.10.13</version>
<relativePath>../pom.xml</relativePath>
</parent>

<dependencies>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>5.2.2</version>
<optional>true</optional>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package xyz.erupt.annotation.fun;

import org.apache.poi.ss.usermodel.Workbook;
import xyz.erupt.annotation.config.Comment;
import xyz.erupt.annotation.model.Row;
import xyz.erupt.annotation.query.Condition;
Expand Down Expand Up @@ -63,7 +62,7 @@ default void searchCondition(Map<String, Object> condition) {
}

@Comment("excel导出")
default void excelExport(@Comment("POI文档对象") Workbook wb) {
default void excelExport(@Comment("POI文档对象") Object workbook) {
}

@Deprecated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
@Transient
Tpl tpl() default @Tpl(path = "");

@Comment("tpl模板弹出层宽度")
String tplWidth() default "";

@Comment("按钮提交时,需要填写的表单信息")
Class<?> eruptClass() default void.class;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@EruptProperty(alias = "readOnly")
Readonly readonly() default @Readonly(add = false, edit = false);

@Comment("输入字段预期值的提示信息")
@Comment("表单提示信息")
String placeHolder() default "";

@Match("#value.dependField() != ''")
Expand Down
2 changes: 1 addition & 1 deletion erupt-cloud/erupt-cloud-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.10.12</version>
<version>1.10.13</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
33 changes: 33 additions & 0 deletions erupt-cloud/erupt-cloud-node-jpa/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>erupt-cloud-node-jpa</artifactId>
<packaging>jar</packaging>

<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.10.13</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<dependencies>
<dependency>
<groupId>xyz.erupt</groupId>
<artifactId>erupt-cloud-node</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>xyz.erupt</groupId>
<artifactId>erupt-jpa</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>xyz.erupt</groupId>
<artifactId>erupt-toolkit</artifactId>
<version>${project.parent.version}</version>
</dependency>
</dependencies>
</project>
2 changes: 1 addition & 1 deletion erupt-cloud/erupt-cloud-node/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.10.12</version>
<version>1.10.13</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion erupt-cloud/erupt-cloud-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.10.12</version>
<version>1.10.13</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
22 changes: 8 additions & 14 deletions erupt-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.10.12</version>
<version>1.10.13</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand All @@ -24,6 +24,11 @@
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
Expand All @@ -45,23 +50,12 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.9.0</version>
<version>2.9.1</version>
</dependency>
<dependency>
<groupId>org.fusesource.jansi</groupId>
<artifactId>jansi</artifactId>
<version>2.3.4</version>
</dependency>

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>5.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.2</version>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>com.github.oshi</groupId>
Expand Down
11 changes: 11 additions & 0 deletions erupt-core/src/main/java/xyz/erupt/core/config/MvcConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.GsonHttpMessageConverter;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.util.UrlPathHelper;
import xyz.erupt.core.constant.EruptConst;
import xyz.erupt.core.constant.EruptRestPath;
import xyz.erupt.core.prop.EruptProp;

import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
Expand Down Expand Up @@ -62,4 +65,12 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) {
}
}

@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
UrlPathHelper helper = new UrlPathHelper();
helper.setUrlDecode(false);
helper.setDefaultEncoding(StandardCharsets.UTF_8.name());
configurer.setUrlPathHelper(helper);
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package xyz.erupt.core.service;

import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
Expand All @@ -18,6 +19,7 @@
* @author YuePeng
* date 2020-09-09
*/
@Slf4j
public class EruptApplication implements ImportBeanDefinitionRegistrar {

private static Class<?> primarySource;
Expand All @@ -38,6 +40,11 @@ public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, B
Class<?> clazz = ClassUtils.forName(importingClassMetadata.getClassName(), ClassUtils.getDefaultClassLoader());
Optional.ofNullable(clazz.getAnnotation(SpringBootApplication.class)).ifPresent(it -> primarySource = clazz);
EruptScan eruptScan = clazz.getAnnotation(EruptScan.class);
try {
Class.forName("org.springframework.boot.devtools.RemoteUrlPropertyExtractor");
log.error("spring-boot-devtools 与 erupt 同时存在会出现各种奇怪的问题,建议移除该依赖!!!");
} catch (ClassNotFoundException ignored) {
}
if (eruptScan.value().length == 0) {
scanPackage.add(clazz.getPackage().getName());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import xyz.erupt.annotation.fun.VLModel;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.core.exception.EruptFieldAnnotationException;
import xyz.erupt.core.exception.ExceptionAnsi;
import xyz.erupt.core.proxy.AnnotationProxy;
import xyz.erupt.core.proxy.EruptFieldProxy;
import xyz.erupt.core.proxy.ProxyContext;
Expand Down Expand Up @@ -64,7 +65,11 @@ public EruptFieldModel(Field field) {
case TAB_TABLE_ADD:
case TAB_TABLE_REFER:
case CHECKBOX:
this.fieldReturnName = ReflectUtil.getFieldGenericName(field).get(0);
try {
this.fieldReturnName = ReflectUtil.getFieldGenericName(field).get(0);
} catch (Exception e) {
throw ExceptionAnsi.styleEruptFieldException(this, "Component modification field is incorrect");
}
break;
}
this.eruptField = eruptFieldAnnotationProxy.newProxy(this.getEruptField(), null);
Expand Down
2 changes: 1 addition & 1 deletion erupt-data/erupt-elasticsearch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.10.12</version>
<version>1.10.13</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion erupt-data/erupt-jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.10.12</version>
<version>1.10.13</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package xyz.erupt.jpa.support;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.boot.Metadata;
import org.hibernate.engine.spi.SessionFactoryImplementor;
Expand All @@ -14,6 +15,7 @@

import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import java.lang.reflect.Field;
import java.util.Iterator;
import java.util.Optional;
Expand All @@ -24,6 +26,7 @@
* @author YuePeng
* date 2022/8/3 21:42
*/
@Slf4j
public class CommentIntegrator implements Integrator {

/**
Expand Down Expand Up @@ -79,10 +82,13 @@ private void processComment(Metadata metadata) {
*/
private void fieldComment(PersistentClass persistentClass, String columnName) {
try {
Field field = ReflectUtil.findClassField(persistentClass.getMappedClass(),columnName);
Field field = ReflectUtil.findClassField(persistentClass.getMappedClass(), columnName);
if (null == field) return;
if (field.isAnnotationPresent(EruptField.class)
&& !field.isAnnotationPresent(OneToOne.class)
&& !field.isAnnotationPresent(OneToMany.class)
&& !field.isAnnotationPresent(ManyToMany.class)) {
&& !field.isAnnotationPresent(ManyToMany.class)
) {
EruptField eruptField = field.getAnnotation(EruptField.class);
String comment = eruptField.edit().title();
if (StringUtils.isBlank(comment) && eruptField.views().length > 0) {
Expand All @@ -101,6 +107,8 @@ private void fieldComment(PersistentClass persistentClass, String columnName) {
}
}
} catch (SecurityException ignored) {
} catch (Exception e) {
log.warn(e.getMessage());
}
}

Expand Down
2 changes: 1 addition & 1 deletion erupt-data/erupt-mongodb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.10.12</version>
<version>1.10.13</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
42 changes: 42 additions & 0 deletions erupt-excel/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>erupt-excel</artifactId>
<name>erupt-excel</name>
<description>excel module</description>

<parent>
<groupId>xyz.erupt</groupId>
<artifactId>erupt</artifactId>
<version>1.10.13</version>
<relativePath>../pom.xml</relativePath>
</parent>

<properties>
<poi.version>5.2.2</poi.version>
</properties>

<dependencies>
<dependency>
<groupId>xyz.erupt</groupId>
<artifactId>erupt-core</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package xyz.erupt.excel;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import xyz.erupt.core.module.EruptModule;
import xyz.erupt.core.module.ModuleInfo;

/**
* @author YuePeng
* date 2021/3/28 18:51
*/
@Configuration
@ComponentScan
public class EruptExcelAutoConfiguration implements EruptModule {

@Override
public ModuleInfo info() {
return ModuleInfo.builder().name("erupt-excel").build();
}

}
Loading

0 comments on commit ecc0665

Please sign in to comment.