Browse Source

excel模板导出

master
liuchen864 6 months ago
parent
commit
17ef61529e
  1. 7
      pom.xml
  2. 6
      win-admin/pom.xml
  3. 820
      win-admin/src/main/java/com/win/web/controller/base/ExcelController.java
  4. 2
      win-admin/src/main/resources/application.yml
  5. BIN
      win-admin/src/main/resources/changchun.xls
  6. BIN
      win-admin/src/main/resources/foshan_qingdao.xls
  7. BIN
      win-admin/src/main/resources/guowai1.xls
  8. BIN
      win-admin/src/main/resources/guowai2.xlsx
  9. 2
      win-framework/src/main/java/com/win/framework/config/SecurityConfig.java

7
pom.xml

@ -220,6 +220,13 @@
<version>${win.version}</version>
</dependency>
<!-- easyexcel工具类-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.3.4</version>
</dependency>
</dependencies>
</dependencyManagement>

6
win-admin/pom.xml

@ -47,6 +47,12 @@
<groupId>com.win</groupId>
<artifactId>win-generator</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel-core</artifactId>
<version>3.3.4</version>
<scope>compile</scope>
</dependency>
</dependencies>

820
win-admin/src/main/java/com/win/web/controller/base/ExcelController.java

File diff suppressed because one or more lines are too long

2
win-admin/src/main/resources/application.yml

@ -25,7 +25,7 @@ win:
# 实例演示开关
demoEnabled: true
# 文件路径 示例( Windows配置D:/win/uploadPath,Linux配置 /home/win/uploadPath)
profile: /opt/uploadPath
profile: D:/win/uploadPath
# 获取ip地址开关
addressEnabled: false
# 验证码类型 math 数组计算 char 字符验证

BIN
win-admin/src/main/resources/changchun.xls

Binary file not shown.

BIN
win-admin/src/main/resources/foshan_qingdao.xls

Binary file not shown.

BIN
win-admin/src/main/resources/guowai1.xls

Binary file not shown.

BIN
win-admin/src/main/resources/guowai2.xlsx

Binary file not shown.

2
win-framework/src/main/java/com/win/framework/config/SecurityConfig.java

@ -112,7 +112,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
// 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
//.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs").permitAll()
.antMatchers("/command/**", "/shell/**").permitAll()
.antMatchers("/command/**", "/shell/**", "/excel/**").permitAll()
// 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated()
.and()

Loading…
Cancel
Save