优化导出对象的子列表为空会出现[]问题(I60904)

pull/421/head
RuoYi 2022-11-11 10:35:32 +08:00
parent 62381f0472
commit 6a7f727f70
1 changed files with 4 additions and 0 deletions

View File

@ -911,6 +911,10 @@ public class ExcelUtil<T>
{
cellValue = RegExUtils.replaceFirst(cellValue, FORMULA_REGEX_STR, "\t$0");
}
if (value instanceof Collection && StringUtils.equals("[]", cellValue))
{
cellValue = StringUtils.EMPTY;
}
cell.setCellValue(StringUtils.isNull(cellValue) ? attr.defaultValue() : cellValue + attr.suffix());
}
else if (ColumnType.NUMERIC == attr.cellType())