fix 标准拆分条款信息-导入 标题为空时自动填充了0。

This commit is contained in:
lijiarao
2024-08-26 17:55:59 +08:00
parent fe4b182d18
commit 0fc60e2f5f
@@ -2634,18 +2634,24 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
continue;
}
String cellValue = null;
String stringCellValue = cell.getStringCellValue();
if (!(CellType.NUMERIC == cell.getCellType() && HSSFDateUtil.isCellDateFormatted(cell))) {
//设置单元格类型
if (y == 0){
// 条文号精度丢失问题
try {
double numericCellValue = cell.getNumericCellValue();
BigDecimal bigDecimal = BigDecimal.valueOf(numericCellValue);
String str = String.valueOf(bigDecimal);
if (str.endsWith(".0")){
str = str.substring(0, str.length() - 2);
if (StringUtils.isNotBlank(stringCellValue)){
double numericCellValue = cell.getNumericCellValue();
BigDecimal bigDecimal = BigDecimal.valueOf(numericCellValue);
String str = String.valueOf(bigDecimal);
if (str.endsWith(".0")){
str = str.substring(0, str.length() - 2);
}
cell.setCellValue(str);
}else {
cell.setCellValue("");
}
cell.setCellValue(str);
} catch (Exception e) {
}
}
@@ -2663,7 +2669,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
cellValue = df.format(d);
}else {
cellValue = cell.getStringCellValue();
cellValue = stringCellValue;
}
}
//