Compare commits

..

1 Commits

Author SHA1 Message Date
机智平 468f119331
Pre Merge pull request !446 from 机智平/master 2026-01-05 06:50:56 +00:00
1 changed files with 1 additions and 16 deletions

View File

@ -1003,7 +1003,7 @@ public class ExcelUtil<T>
String separator = attr.separator();
if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value))
{
cell.setCellStyle(createCellStyle(cell.getCellStyle(), dateFormat));
cell.getCellStyle().setDataFormat(this.wb.getCreationHelper().createDataFormat().getFormat(dateFormat));
cell.setCellValue(parseDateToStr(dateFormat, value));
}
else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value))
@ -1033,21 +1033,6 @@ public class ExcelUtil<T>
return cell;
}
/**
* 使
*
* @param cellStyle
* @param format
* @return CellStyle
*/
private CellStyle createCellStyle(CellStyle cellStyle, String format)
{
CellStyle style = wb.createCellStyle();
style.cloneStyleFrom(cellStyle);
style.setDataFormat(wb.getCreationHelper().createDataFormat().getFormat(format));
return style;
}
/**
* POI XSSFSheet
*