|  |  | 
 |  |  |  | 
 |  |  | //参考:  https://easyexcel.opensource.alibaba.com/docs/current/quickstart/write | 
 |  |  | @Data | 
 |  |  | @HeadRowHeight(40)    //设置标题高度 | 
 |  |  | @HeadRowHeight(40) //设置标题高度 | 
 |  |  | @HeadFontStyle(fontName="宋体", fontHeightInPoints = 16) | 
 |  |  | @HeadStyle(wrapped = BooleanEnum.TRUE, shrinkToFit = BooleanEnum.TRUE, | 
 |  |  |         horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER, | 
 |  |  | 
 |  |  |         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)  //设置列宽 | 
 |  |  | @ColumnWidth(16) //设置列宽 | 
 |  |  | public class ExcelVo implements Converter<byte[]> { | 
 |  |  |     @ExcelProperty("编码") | 
 |  |  |     public String code ; //编码 | 
 |  |  | 
 |  |  |  | 
 |  |  |     public WriteCellData<?> convertToExcelData(byte[] value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { | 
 |  |  |         WriteCellData cellData = new WriteCellData()  ; | 
 |  |  |         List<ImageData> list = new ArrayList<>(); | 
 |  |  |         ImageData imd = new ImageData(); | 
 |  |  |         imd.setImage(value); | 
 |  |  |         imd.setImageType(ImageData.ImageType.PICTURE_TYPE_PICT); | 
 |  |  |         imd.setLeft(10); | 
 |  |  |         imd.setTop(10); | 
 |  |  |         imd.setRight(10); | 
 |  |  |         imd.setBottom(10); | 
 |  |  |         list.add(imd) ; | 
 |  |  |         cellData.setImageDataList(list); | 
 |  |  |         cellData.setType(CellDataTypeEnum.EMPTY); | 
 |  |  |         if(value != null && value.length >0){ | 
 |  |  |             List<ImageData> list = new ArrayList<>(); | 
 |  |  |             ImageData imd = new ImageData(); | 
 |  |  |             imd.setImage(value); | 
 |  |  |             imd.setImageType(ImageData.ImageType.PICTURE_TYPE_PICT); | 
 |  |  |             imd.setLeft(10); | 
 |  |  |             imd.setTop(10); | 
 |  |  |             imd.setRight(10); | 
 |  |  |             imd.setBottom(10); | 
 |  |  |             list.add(imd) ; | 
 |  |  |             cellData.setImageDataList(list); | 
 |  |  |             cellData.setType(CellDataTypeEnum.EMPTY); | 
 |  |  |         }else{ | 
 |  |  |             cellData.setStringValue(""); | 
 |  |  |             cellData.setType(CellDataTypeEnum.STRING); | 
 |  |  |         } | 
 |  |  |         return cellData; | 
 |  |  |     } | 
 |  |  |  |