forked from github/dataease
Merge pull request #2757 from dataease/pr@dev@fix_email_task_view_number
fix(系统管理-定时报告): 定时报告发送视图数据包含无效小数
This commit is contained in:
commit
885851f64c
@ -104,7 +104,7 @@ public class ViewExportExcel {
|
||||
Object val = row.get(key);
|
||||
if (ObjectUtils.isEmpty(val))
|
||||
return StringUtils.EMPTY;
|
||||
return val.toString();
|
||||
return filterInvalidDecimal(val.toString());
|
||||
}).collect(Collectors.toList())).collect(Collectors.toList());
|
||||
result.setHeads(heads);
|
||||
result.setDatas(details);
|
||||
@ -112,4 +112,12 @@ public class ViewExportExcel {
|
||||
result.setSheetName(title);
|
||||
return result;
|
||||
}
|
||||
|
||||
private String filterInvalidDecimal(String sourceNumberStr) {
|
||||
if (StringUtils.isNotBlank(sourceNumberStr) && StringUtils.contains(sourceNumberStr, ".")) {
|
||||
sourceNumberStr = sourceNumberStr.replaceAll("0+?$", "");
|
||||
sourceNumberStr = sourceNumberStr.replaceAll("[.]$", "");
|
||||
}
|
||||
return sourceNumberStr;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user