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

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