New file |
| | |
| | | package com.dy.pmsProduct.schedule; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.*; |
| | | import com.alibaba.excel.converters.Converter; |
| | | import com.alibaba.excel.enums.BooleanEnum; |
| | | import com.alibaba.excel.enums.poi.BorderStyleEnum; |
| | | import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum; |
| | | import com.alibaba.excel.enums.poi.VerticalAlignmentEnum; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | //参考: https://easyexcel.opensource.alibaba.com/docs/current/quickstart/write |
| | | @Data |
| | | @HeadRowHeight(40) //设置标题高度 |
| | | @HeadFontStyle(fontName="宋体", fontHeightInPoints = 16) |
| | | @HeadStyle(wrapped = BooleanEnum.TRUE, shrinkToFit = BooleanEnum.TRUE, |
| | | horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER, |
| | | borderLeft = BorderStyleEnum.THIN, borderRight = BorderStyleEnum.THIN, borderTop = BorderStyleEnum.THIN, borderBottom = BorderStyleEnum.THIN, |
| | | leftBorderColor = 8, rightBorderColor = 8, topBorderColor = 8, bottomBorderColor = 8) //IndexedColors.BLACK |
| | | @ContentRowHeight(30) //设置内容高度 |
| | | @ContentFontStyle(fontName="宋体", fontHeightInPoints = 11) |
| | | @ContentStyle(wrapped = BooleanEnum.TRUE, shrinkToFit = BooleanEnum.TRUE, |
| | | horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER, |
| | | borderLeft = BorderStyleEnum.THIN, borderRight = BorderStyleEnum.THIN, borderTop = BorderStyleEnum.THIN, borderBottom = BorderStyleEnum.THIN, |
| | | leftBorderColor = 8, rightBorderColor = 8, topBorderColor = 8, bottomBorderColor = 8) //IndexedColors.BLACK |
| | | @ColumnWidth(16) //设置列宽 |
| | | public class ExcelVo implements Converter<byte[]> { |
| | | @ColumnWidth(0)//设置列宽为0,不显示 |
| | | @ExcelProperty("ID") |
| | | public String id ; |
| | | |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("用户名") |
| | | public String userName ; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("排班日期") |
| | | public String scheduleDate ; |
| | | |
| | | @ColumnWidth(28) |
| | | @ExcelProperty("创建时间") |
| | | public Date dt ; |
| | | |
| | | @ColumnWidth(40) |
| | | @ExcelProperty({"排班内容","任务计划"}) |
| | | public String planName ; |
| | | |
| | | @ColumnWidth(40) |
| | | @ExcelProperty({"排班内容","节点"}) |
| | | public String nodeName ; |
| | | |
| | | @ColumnWidth(40) |
| | | @ExcelProperty({"排班内容","工站"}) |
| | | public String stationName ; |
| | | |
| | | @ColumnWidth(40) |
| | | @ExcelProperty({"排班内容","工作内容"}) |
| | | public String workDetails ; |
| | | } |