1.字段模板注释
This commit is contained in:
parent
7751b36351
commit
eb05e825aa
|
@ -5,6 +5,7 @@ import com.alibaba.excel.metadata.Head;
|
||||||
import com.alibaba.excel.metadata.data.WriteCellData;
|
import com.alibaba.excel.metadata.data.WriteCellData;
|
||||||
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
|
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
|
||||||
import com.alibaba.excel.write.style.column.AbstractColumnWidthStyleStrategy;
|
import com.alibaba.excel.write.style.column.AbstractColumnWidthStyleStrategy;
|
||||||
|
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.hzya.frame.mdm.mdmModule.entity.vo.ExportExcelVO;
|
import com.hzya.frame.mdm.mdmModule.entity.vo.ExportExcelVO;
|
||||||
|
@ -52,6 +53,7 @@ public class ImportExcelController {
|
||||||
List<ExcelTemplateVO> demoData = new ArrayList<>();
|
List<ExcelTemplateVO> demoData = new ArrayList<>();
|
||||||
// 使用EasyExcel写入响应输出流
|
// 使用EasyExcel写入响应输出流
|
||||||
EasyExcel.write(response.getOutputStream(), ExcelTemplateVO.class)
|
EasyExcel.write(response.getOutputStream(), ExcelTemplateVO.class)
|
||||||
|
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
|
||||||
.sheet("表字段定义模版")
|
.sheet("表字段定义模版")
|
||||||
.doWrite(demoData);
|
.doWrite(demoData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ public class ExcelTemplateVO {
|
||||||
private String enName;
|
private String enName;
|
||||||
|
|
||||||
/** 字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME */
|
/** 字段类型 1、BIGINT 2、DECIMAL 3、VARCHAR 4、DATETIME */
|
||||||
@ExcelProperty(value = "字段类型", index = 2)
|
@ExcelProperty(value = "字段类型(1数字 2金额 3字符串 4日期)", index = 2)
|
||||||
private String filedType;
|
private String filedType;
|
||||||
|
|
||||||
@ExcelProperty(value = "长度", index = 3)
|
@ExcelProperty(value = "长度", index = 3)
|
||||||
|
@ -44,7 +44,7 @@ public class ExcelTemplateVO {
|
||||||
@ExcelProperty(value = "单元格宽度", index = 10)
|
@ExcelProperty(value = "单元格宽度", index = 10)
|
||||||
private String width;
|
private String width;
|
||||||
|
|
||||||
@ExcelProperty(value = "数据类型",index = 11)
|
@ExcelProperty(value = "数据类型(字段类型1/2 number 3 input radio textrea select treeselect 4 datepick)",index = 11)
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
@ExcelProperty(value= "必填",index = 12)
|
@ExcelProperty(value= "必填",index = 12)
|
||||||
|
|
Loading…
Reference in New Issue