Commit 3f64d2a5 authored by neo's avatar neo

[bugfix] fixed catche bb exception when period=-199

parent 97a03681
...@@ -74,13 +74,19 @@ public class BB extends FunctionBase implements FreeRefFunction { ...@@ -74,13 +74,19 @@ public class BB extends FunctionBase implements FreeRefFunction {
} }
for (int p = 1; p < formulaContext.getPeriod(); p++) { for (int p = 1; p < formulaContext.getPeriod(); p++) {
try {
returnEval = returnEval.add(bb(new BBParasBo(bo, p, curPeriod.getCurYear()), ec)); returnEval = returnEval.add(bb(new BBParasBo(bo, p, curPeriod.getCurYear()), ec));
} catch (Exception e) {
if (e instanceof FormulaException) {
LOGGER.warn("Formula Exception || {}", e.getMessage());
}
}
} }
return returnEval; return returnEval;
} else if (bo.getPeriod().intValue() == 0) { } else if (bo.getPeriod().intValue() == 0) {
cellValue = new BigDecimal(ec.getWorkbook().getSheet(ec.getWorkbook().getSheetIndex(bo.getReportCode())) cellValue = new BigDecimal(ec.getWorkbook().getSheet(ec.getWorkbook().getSheetIndex(bo.getReportCode()))
.getCell(bo.getRowIndex()-1, bo.getColumnIndex()-1).getNumericCellValue()); .getCell(bo.getRowIndex() - 1, bo.getColumnIndex() - 1).getNumericCellValue());
return cellValue; return cellValue;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment