Skip to content

Commit

Permalink
重写表达式计算算法,大幅提高表达式计算性能
Browse files Browse the repository at this point in the history
  • Loading branch information
youseries committed Jul 4, 2018
1 parent 9ff37d6 commit 1576252
Show file tree
Hide file tree
Showing 3 changed files with 203 additions and 223 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import com.bstek.ureport.model.Column;
import com.bstek.ureport.model.Report;
import com.bstek.ureport.model.Row;
import com.bstek.ureport.utils.ElCalculator;
import com.bstek.ureport.utils.ElCompute;

/**
* @author Jacky.gao
Expand All @@ -54,7 +54,6 @@ public class Context {
private ReportBuilder reportBuilder;
private Map<String,Object> parameters;
private HideRowColumnBuilder hideRowColumnBuilder;
private ElCalculator elCalculator=new ElCalculator();
private List<Cell> existPageFunctionCells=new ArrayList<Cell>();
private Map<String,List<Cell>> unprocessedCellsMap = new HashMap<String,List<Cell>>();
private Map<Row,Map<Column,Cell>> blankCellsMap=new HashMap<Row,Map<Column,Cell>>();
Expand Down Expand Up @@ -268,7 +267,7 @@ public List<Cell> nextUnprocessedCells(){
}

public Object evalExpr(String expression){
return elCalculator.eval(expression);
return new ElCompute().doCompute(expression);
}

public boolean isCellPocessed(String cellName){
Expand Down
220 changes: 0 additions & 220 deletions ureport2-core/src/main/java/com/bstek/ureport/utils/ElCalculator.java

This file was deleted.

Loading

0 comments on commit 1576252

Please sign in to comment.