Răsfoiți Sursa

修复分类统计总数变成了累进总计的错误.

roo00 6 ani în urmă
părinte
comite
c6a031d859

+ 0 - 16
o2server/x_query_core_express/src/main/java/com/x/query/core/express/plan/Plan.java

@@ -318,22 +318,6 @@ public abstract class Plan extends GsonPropertyObject {
 				}
 				}
 				this.groupGrid = groupTable;
 				this.groupGrid = groupTable;
 			}
 			}
-			// /** stat 统计部分 */
-			// if ((null != this.calculate) && (this.calculate.available())) {
-			// logger.debug("开始数据统计.");
-			// if (BooleanUtils.isTrue(this.calculate.isGroup)) {
-			// CalculateGroupTable calculateGroupTable = this.calculateGroup();
-			// this.calculateGrid = calculateGroupTable;
-			// } else {
-			// CalculateRow calculateRow = this.calculate(table, calculate);
-			// this.calculateGrid = calculateRow;
-			// }
-			// if (StringUtils.isNotEmpty(this.afterCalculateGridScriptText)) {
-			// scriptEngine.put("calculateGrid", this.calculateGrid);
-			// scriptEngine.eval(this.afterCalculateGridScriptText);
-			// }
-			// logger.debug("数据统计完成.");
-			// }
 			/* 需要抽取单独的列 */
 			/* 需要抽取单独的列 */
 			if (ListTools.isNotEmpty(this.columnList)) {
 			if (ListTools.isNotEmpty(this.columnList)) {
 				this.columnGrid = new TreeList<Object>();
 				this.columnGrid = new TreeList<Object>();

+ 1 - 1
o2server/x_query_core_express/src/main/java/com/x/query/core/express/plan/StatPlan.java

@@ -221,11 +221,11 @@ public class StatPlan extends GsonPropertyObject {
 				en.getValue().selectList.stream().forEach(o -> {
 				en.getValue().selectList.stream().forEach(o -> {
 					/* 分类统计只能统计分类视图 */
 					/* 分类统计只能统计分类视图 */
 					if (!StringUtils.equals(o.column, en.getValue().group.column)) {
 					if (!StringUtils.equals(o.column, en.getValue().group.column)) {
-						List<Double> values = new ArrayList<>();
 						CalculateEntry calculateEntry = calculate.get(en.getKey());
 						CalculateEntry calculateEntry = calculate.get(en.getKey());
 						if (null != calculateEntry) {
 						if (null != calculateEntry) {
 							NumberFormat numberFormat = this.getNumberFormat(calculateEntry);
 							NumberFormat numberFormat = this.getNumberFormat(calculateEntry);
 							en.getValue().groupGrid.stream().forEach(r -> {
 							en.getValue().groupGrid.stream().forEach(r -> {
+								List<Double> values = new ArrayList<>();
 								CalculateGroupRow row = table.getRow(r.group);
 								CalculateGroupRow row = table.getRow(r.group);
 								if (null != row) {
 								if (null != row) {
 									CalculateCell cell = row.getCell(calculateEntry.id);
 									CalculateCell cell = row.getCell(calculateEntry.id);