Browse Source

调了调宽度,加了个信息

master
zxc 3 years ago
parent
commit
b482e5582b
  1. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcDangerAreaImportExcel.java
  2. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcDangerAreaExcelImportListener.java
  3. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/ic_danger_area_template.xlsx

10
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcDangerAreaImportExcel.java

@ -1,6 +1,7 @@
package com.epmet.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@ -22,13 +23,16 @@ public class IcDangerAreaImportExcel {
@Data
public static class IcDangerAreaError{
@ExcelProperty("风险地区")
@ColumnWidth(30)
@ExcelProperty(value = "风险地区")
private String name;
@ExcelProperty("风险等级")
@ColumnWidth(20)
@ExcelProperty(value = "风险等级")
private String dangerLevel;
@ExcelProperty("错误信息")
@ColumnWidth(40)
@ExcelProperty(value = "错误信息")
private String errorInfo;
}
}

1
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcDangerAreaExcelImportListener.java

@ -105,6 +105,7 @@ public class IcDangerAreaExcelImportListener implements ReadListener<IcDangerAre
}
IcDangerAreaImportExcel.IcDangerAreaError errorRow = new IcDangerAreaImportExcel.IcDangerAreaError();
errorRow.setName(data.getAllName());
errorRow.setDangerLevel(data.getDangerLevel());
errorRow.setErrorInfo(errorMsg);
errorRows.add(errorRow);
}

BIN
epmet-user/epmet-user-server/src/main/resources/excel/ic_danger_area_template.xlsx

Binary file not shown.
Loading…
Cancel
Save