升级easypoi到v4.1.0,并解决poi包冲突问题
This commit is contained in:
@@ -31,7 +31,8 @@
|
|||||||
<mybatis-plus-boot-starter.version>3.1.2</mybatis-plus-boot-starter.version>
|
<mybatis-plus-boot-starter.version>3.1.2</mybatis-plus-boot-starter.version>
|
||||||
<aliyun-sdk-oss>3.4.2</aliyun-sdk-oss>
|
<aliyun-sdk-oss>3.4.2</aliyun-sdk-oss>
|
||||||
<qiniu-java-sdk>7.2.18</qiniu-java-sdk>
|
<qiniu-java-sdk>7.2.18</qiniu-java-sdk>
|
||||||
<easypoi.version>4.0.0</easypoi.version>
|
<easypoi.version>4.1.0</easypoi.version>
|
||||||
|
<poi.version>4.1.0</poi.version>
|
||||||
<spring-boot-admin.version>2.0.6</spring-boot-admin.version>
|
<spring-boot-admin.version>2.0.6</spring-boot-admin.version>
|
||||||
<velocity.version>1.7</velocity.version>
|
<velocity.version>1.7</velocity.version>
|
||||||
<commons-configuration.version>1.10</commons-configuration.version>
|
<commons-configuration.version>1.10</commons-configuration.version>
|
||||||
@@ -225,27 +226,21 @@
|
|||||||
<artifactId>qiniu-java-sdk</artifactId>
|
<artifactId>qiniu-java-sdk</artifactId>
|
||||||
<version>${qiniu-java-sdk}</version>
|
<version>${qiniu-java-sdk}</version>
|
||||||
</dependency>
|
</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>
|
||||||
<!-- easypoi -->
|
<!-- easypoi -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.afterturn</groupId>
|
<groupId>cn.afterturn</groupId>
|
||||||
<artifactId>easypoi-base</artifactId>
|
<artifactId>easypoi-base</artifactId>
|
||||||
<version>${easypoi.version}</version>
|
<version>${easypoi.version}</version>
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.google.guava</groupId>
|
|
||||||
<artifactId>guava</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.afterturn</groupId>
|
|
||||||
<artifactId>easypoi-web</artifactId>
|
|
||||||
<version>${easypoi.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.afterturn</groupId>
|
|
||||||
<artifactId>easypoi-annotation</artifactId>
|
|
||||||
<version>${easypoi.version}</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.baomidou</groupId>
|
<groupId>com.baomidou</groupId>
|
||||||
|
|||||||
@@ -63,15 +63,6 @@
|
|||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.afterturn</groupId>
|
|
||||||
<artifactId>easypoi-web</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.afterturn</groupId>
|
|
||||||
<artifactId>easypoi-annotation</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.micrometer</groupId>
|
<groupId>io.micrometer</groupId>
|
||||||
<artifactId>micrometer-registry-prometheus</artifactId>
|
<artifactId>micrometer-registry-prometheus</artifactId>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class SysUserExcel implements Serializable {
|
|||||||
@Excel(name = "手机号码", height = 20, width = 30, isImportField = "true_st")
|
@Excel(name = "手机号码", height = 20, width = 30, isImportField = "true_st")
|
||||||
private String mobile;
|
private String mobile;
|
||||||
|
|
||||||
@Excel(name = "学生性别", replace = { "男_0", "女_1" }, suffix = "生", isImportField = "true_st")
|
@Excel(name = "性别", replace = { "男_0", "女_1" }, isImportField = "true_st")
|
||||||
private Integer sex;
|
private Integer sex;
|
||||||
|
|
||||||
@Excel(name = "创建时间", format = CommonConstant.DATETIME_FORMAT, isImportField = "true_st", width = 20)
|
@Excel(name = "创建时间", format = CommonConstant.DATETIME_FORMAT, isImportField = "true_st", width = 20)
|
||||||
|
|||||||
@@ -54,6 +54,14 @@
|
|||||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.poi</groupId>
|
||||||
|
<artifactId>poi</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.poi</groupId>
|
||||||
|
<artifactId>poi-ooxml</artifactId>
|
||||||
|
</dependency>
|
||||||
<!-- easypoi -->
|
<!-- easypoi -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.afterturn</groupId>
|
<groupId>cn.afterturn</groupId>
|
||||||
|
|||||||
+3
-3
@@ -42,7 +42,7 @@ public class ExcelUtil {
|
|||||||
*/
|
*/
|
||||||
public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName
|
public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName
|
||||||
, boolean isCreateHeader, HttpServletResponse response) throws IOException {
|
, boolean isCreateHeader, HttpServletResponse response) throws IOException {
|
||||||
ExportParams exportParams = new ExportParams(title, sheetName);
|
ExportParams exportParams = new ExportParams(title, sheetName, ExcelType.XSSF);
|
||||||
exportParams.setCreateHeadRows(isCreateHeader);
|
exportParams.setCreateHeadRows(isCreateHeader);
|
||||||
defaultExport(list, pojoClass, fileName, response, exportParams);
|
defaultExport(list, pojoClass, fileName, response, exportParams);
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ public class ExcelUtil {
|
|||||||
*/
|
*/
|
||||||
public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName
|
public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName
|
||||||
, HttpServletResponse response) throws IOException {
|
, HttpServletResponse response) throws IOException {
|
||||||
defaultExport(list, pojoClass, fileName, response, new ExportParams(title, sheetName));
|
defaultExport(list, pojoClass, fileName, response, new ExportParams(title, sheetName, ExcelType.XSSF));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -93,7 +93,7 @@ public class ExcelUtil {
|
|||||||
|
|
||||||
private static void downLoadExcel(String fileName, HttpServletResponse response, Workbook workbook) throws IOException {
|
private static void downLoadExcel(String fileName, HttpServletResponse response, Workbook workbook) throws IOException {
|
||||||
response.setCharacterEncoding("UTF-8");
|
response.setCharacterEncoding("UTF-8");
|
||||||
response.setHeader("content-Type", "application/vnd.ms-excel");
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
|
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
|
||||||
workbook.write(response.getOutputStream());
|
workbook.write(response.getOutputStream());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,12 +150,12 @@
|
|||||||
$('#user-btn-export').click(function () {
|
$('#user-btn-export').click(function () {
|
||||||
var url = config.base_server + 'api-user/users/export?access_token='+config.getToken().access_token;
|
var url = config.base_server + 'api-user/users/export?access_token='+config.getToken().access_token;
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open('GET', url, true);
|
xhr.open('POST', url, true);
|
||||||
xhr.responseType = "blob";
|
xhr.responseType = "blob";
|
||||||
xhr.setRequestHeader("client_type", "DESKTOP_WEB");
|
xhr.setRequestHeader("client_type", "DESKTOP_WEB");
|
||||||
xhr.onload = function() {
|
xhr.onload = function() {
|
||||||
if (this.status == 200) {
|
if (this.status == 200) {
|
||||||
var fileName = "user.xls";
|
var fileName = "user.xlsx";
|
||||||
var blob = this.response;
|
var blob = this.response;
|
||||||
var a = document.createElement('a');
|
var a = document.createElement('a');
|
||||||
a.innerHTML = fileName;
|
a.innerHTML = fileName;
|
||||||
|
|||||||
Reference in New Issue
Block a user