Browse Source

修改目录结构

pull/2317/head
Jiaju Zhuang 3 years ago
parent
commit
b810b5c138
  1. 2
      easyexcel-core/src/main/java/com/alibaba/excel/read/listener/ModelBuildEventListener.java
  2. 6
      easyexcel-core/src/main/java/com/alibaba/excel/util/BeanMapUtils.java
  3. 2
      easyexcel-core/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java
  4. 4
      easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/Xls03Test.java
  5. 31
      pom.xml

2
easyexcel-core/src/main/java/com/alibaba/excel/read/listener/ModelBuildEventListener.java

@ -15,8 +15,8 @@ import com.alibaba.excel.util.ClassUtils;
import com.alibaba.excel.util.ConverterUtils; import com.alibaba.excel.util.ConverterUtils;
import com.alibaba.excel.util.MapUtils; import com.alibaba.excel.util.MapUtils;
import net.sf.cglib.beans.BeanMap;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.cglib.beans.BeanMap;
/** /**
* Convert to the object the user needs * Convert to the object the user needs

6
easyexcel-core/src/main/java/com/alibaba/excel/util/BeanMapUtils.java

@ -23,9 +23,9 @@ public class BeanMapUtils {
*/ */
public static BeanMap create(Object bean) { public static BeanMap create(Object bean) {
BeanMap.Generator gen = new BeanMap.Generator(); BeanMap.Generator gen = new BeanMap.Generator();
//gen.setBean(student); gen.setBean(bean);
//gen.setContextClass(Student.class); gen.setContextClass(bean.getClass());
BeanMap beanMap = gen.create(); gen.setNamingPolicy(EasyExcelNamingPolicy.INSTANCE);
return gen.create(); return gen.create();
} }

2
easyexcel-core/src/main/java/com/alibaba/excel/write/executor/ExcelWriteAddExecutor.java

@ -25,10 +25,10 @@ import com.alibaba.excel.write.metadata.RowData;
import com.alibaba.excel.write.metadata.holder.WriteHolder; import com.alibaba.excel.write.metadata.holder.WriteHolder;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import net.sf.cglib.beans.BeanMap;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Row;
import org.springframework.cglib.beans.BeanMap;
/** /**
* Add the data into excel * Add the data into excel

4
easyexcel-core/src/test/java/com/alibaba/easyexcel/test/temp/Xls03Test.java

@ -6,12 +6,12 @@ import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.util.BeanMapUtils; import com.alibaba.excel.util.BeanMapUtils;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import net.sf.cglib.beans.BeanMap;
import net.sf.cglib.core.DebuggingClassWriter;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.cglib.beans.BeanMap;
import org.springframework.cglib.core.DebuggingClassWriter;
/** /**
* 临时测试 * 临时测试

31
pom.xml

@ -385,6 +385,37 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<!-- Packaging spring's cglib -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<filters>
<filter>
<artifact>org.springframework:spring-core</artifact>
<includes>
<include>org/springframework/asm/**</include>
<include>org/springframework/cglib/**</include>
</includes>
</filter>
</filters>
<relocations>
<relocation>
<pattern>org.springframework</pattern>
<shadedPattern>com.alibaba.easyexcel.support</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

Loading…
Cancel
Save