Commit 97a03681 authored by neo's avatar neo

[bugfix] bb not nedd to update config parsedformua

parent 66d37b22
......@@ -95,8 +95,8 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
addFunctionsToWorkbook(newWorkbook, formulaContext);
int sheetCount = newWorkbook.getNumberOfSheets();
List<Cell> otherFormulaCells=new ArrayList<>();
List<Cell> bbFormulaCells=new ArrayList<>();
List<Cell> otherFormulaCells = new ArrayList<>();
List<Cell> bbFormulaCells = new ArrayList<>();
for (int i = 0; i < sheetCount; i++) {
Sheet sheet = newWorkbook.getSheetAt(i);
......@@ -143,9 +143,9 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
if (StringUtils.isNotBlank(v.getFormula()) && !v.getFormula().contains("@")) {
cell.setCellFormula(v.getFormula());
logger.debug("formula:" + v.getFormula());
if(v.getFormula().startsWith("BB(")){
if (v.getFormula().startsWith("BB(")) {
bbFormulaCells.add(cell);
}else {
} else {
otherFormulaCells.add(cell);
}
//kv 公式处理
......@@ -160,10 +160,10 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
}
}
FormulaEvaluator evaluator = newWorkbook.getCreationHelper().createFormulaEvaluator();
otherFormulaCells.stream().forEach(m->{
otherFormulaCells.stream().forEach(m -> {
evaluator.evaluateFormulaCellEnum(m);
});
bbFormulaCells.stream().forEach(n->{
bbFormulaCells.stream().forEach(n -> {
evaluator.evaluateFormulaCellEnum(n);
});
......@@ -263,8 +263,10 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
//如果有正则匹配就进行更新公式解析
// if (isFind) {
periodCellTemplateConfig.setParsedFormula(resultFormula);
periodCellTemplateConfigMapper.updateByPrimaryKey(periodCellTemplateConfig);
if (!resultFormula.startsWith("BB(")) {//add by neo (bb do not nedd parsed formual)
periodCellTemplateConfig.setParsedFormula(resultFormula);
periodCellTemplateConfigMapper.updateByPrimaryKey(periodCellTemplateConfig);
}
// }
......@@ -285,7 +287,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
Row row = sheet.getRow(rowNum - 1);
if (row != null) {
Cell cell = row.getCell(colNum - 1);
if (cell != null) {
if (cell != null) {
//开始取值然后存放到DataSource
DataSource dataSource = new DataSource();
dataSource.setId(distributedIDService.nextId());
......
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