Commit 8815bb16 authored by neo's avatar neo

[bugfix] fixed period to cell data when insert to db

parent ab99eea9
...@@ -401,6 +401,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen ...@@ -401,6 +401,7 @@ public class ReportGeneratorImpl extends VatAbstractService implements ReportGen
cellData.setUpdateBy("Admin"); cellData.setUpdateBy("Admin");
cellData.setUpdateTime(createTime); cellData.setUpdateTime(createTime);
cellData.setProjectId(projectId); cellData.setProjectId(projectId);
cellData.setPeriod(period);
periodCellDataMapper.insertSelective(cellData); periodCellDataMapper.insertSelective(cellData);
//after insert celldata, insert the celldatasource for link celldata and datasource //after insert celldata, insert the celldatasource for link celldata and datasource
......
...@@ -141,7 +141,7 @@ public class BB extends FunctionBase implements FreeRefFunction { ...@@ -141,7 +141,7 @@ public class BB extends FunctionBase implements FreeRefFunction {
formulaContext.getReportTemplateGroupId(), bo.getColumnIndex() - 1, bo.getRowIndex() - 1, formulaContext.getReportTemplateGroupId(), bo.getColumnIndex() - 1, bo.getRowIndex() - 1,
formulaContext.getProjectId()); formulaContext.getProjectId());
saveFormulaBlock(formulaContext.getPeriod(), ec, saveFormulaBlock(formulaContext.getPeriod(), ec,
bo.expression(), bo.expressionData(), dataSourceId, formulaContext.getProjectId()); bo.expression(), bo.expressionData(), dataSourceId, formulaContext.getProjectId(),formulaContext.getReportId());
} }
} }
} }
......
...@@ -179,14 +179,14 @@ public class FunctionBase { ...@@ -179,14 +179,14 @@ public class FunctionBase {
} }
public void saveFormulaBlock(int period, OperationEvaluationContext ec, public void saveFormulaBlock(int period, OperationEvaluationContext ec,
String formulaExpression, String val, Long dataSourceId, String projectId) { String formulaExpression, String val, Long dataSourceId, String projectId, long reportId) {
Long cellTemplateId = getCellTemplateId(period, ec); Long cellTemplateId = getCellTemplateId(period, ec);
Date creatime = new Date(); Date creatime = new Date();
PeriodFormulaBlock periodFormulaBlock = new PeriodFormulaBlock(); PeriodFormulaBlock periodFormulaBlock = new PeriodFormulaBlock();
periodFormulaBlock.setProjectId(projectId); periodFormulaBlock.setProjectId(projectId);
periodFormulaBlock.setId(SpringContextUtil.distributedIdService.nextId()); periodFormulaBlock.setId(SpringContextUtil.distributedIdService.nextId());
periodFormulaBlock.setPeriod(period); periodFormulaBlock.setPeriod(period);
periodFormulaBlock.setReportId(0L); periodFormulaBlock.setReportId(reportId);
periodFormulaBlock.setCellTemplateId(cellTemplateId); periodFormulaBlock.setCellTemplateId(cellTemplateId);
periodFormulaBlock.setFormulaExpression(formulaExpression); periodFormulaBlock.setFormulaExpression(formulaExpression);
periodFormulaBlock.setData(val); periodFormulaBlock.setData(val);
......
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