fix: 修复沥青数据解析异常的问题

This commit is contained in:
han0
2024-06-03 17:32:01 +08:00
parent ae6212db49
commit f9ad0e89f7
2 changed files with 5 additions and 5 deletions

View File

@@ -60,8 +60,7 @@ public class AsphaltDomestic extends Model<AsphaltDomestic> {
var policy = Row.MissingCellPolicy.CREATE_NULL_AS_BLANK; var policy = Row.MissingCellPolicy.CREATE_NULL_AS_BLANK;
this.setName(row.getCell(0, policy).getStringCellValue()); this.setName(row.getCell(0, policy).getStringCellValue());
this.setPrice(BigDecimal.valueOf(row.getCell(1, policy).getNumericCellValue())); this.setPrice(BigDecimal.valueOf(row.getCell(1, policy).getNumericCellValue()));
this.setDate(row.getCell(2, policy).getLocalDateTimeCellValue().toLocalDate()); this.setDate(row.getCell(3, policy).getLocalDateTimeCellValue().toLocalDate());
this.setFrom(row.getCell(3, policy).getStringCellValue());
} }
public AsphaltDomestic update(AsphaltDomestic item) { public AsphaltDomestic update(AsphaltDomestic item) {

View File

@@ -53,9 +53,10 @@ public class AsphaltImported extends Model<AsphaltImported> {
public AsphaltImported () {} public AsphaltImported () {}
public AsphaltImported (Row row) { public AsphaltImported (Row row) {
this.setName(row.getCell(0).getStringCellValue()); var policy = Row.MissingCellPolicy.CREATE_NULL_AS_BLANK;
this.setPrice(BigDecimal.valueOf(row.getCell(1).getNumericCellValue())); this.setName(row.getCell(0, policy).getStringCellValue());
this.setDate(row.getCell(2).getLocalDateTimeCellValue().toLocalDate()); this.setPrice(BigDecimal.valueOf(row.getCell(1, policy).getNumericCellValue()));
this.setDate(row.getCell(2, policy).getLocalDateTimeCellValue().toLocalDate());
} }
public AsphaltImported update(AsphaltImported item) { public AsphaltImported update(AsphaltImported item) {