springboot集成autopoi实现excel报表导入导出功能

时间:2025-04-01 08:46:09
<dependencies> <dependency> <groupId></groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId></groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId></groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <!-- 添加mybatis依赖--> <dependency> <groupId></groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.2.0</version> <!-- 添加mysql驱动--> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> <!-- autopoi依赖--> <dependency> <groupId></groupId> <artifactId>autopoi-web</artifactId> <version>1.2.2</version> <exclusions> <exclusion> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> </exclusion> </exclusions> </dependency> <!-- lombok依赖--> <dependency> <groupId></groupId> <artifactId>lombok</artifactId> </dependency> </dependencies> <build> <!--让idea编译src/main/java目录下的xml文件--> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> </resource> </resources> <plugins> <plugin> <groupId></groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>