Commit 4116029a authored by sherlock's avatar sherlock

xxfp bug

parent d978f2c9
...@@ -534,9 +534,9 @@ public class ReportGeneratorImpl { ...@@ -534,9 +534,9 @@ public class ReportGeneratorImpl {
if (result.isPresent()) { if (result.isPresent()) {
CellCalcInfoDto cellCalcInfoDto = new CellCalcInfoDto(); CellCalcInfoDto cellCalcInfoDto = new CellCalcInfoDto();
cellCalcInfoDto.setColumnIndex(Integer.parseInt(result.get().get("columnIndex").toString())); cellCalcInfoDto.setColumnIndex(Integer.parseInt(result.get().get("columnIndex").toString()));
cellCalcInfoDto.setColumnName(result.get().get("columnName").toString()); cellCalcInfoDto.setColumnName(result.get().get("columnName") == null ? "" : result.get().get("columnName").toString());
cellCalcInfoDto.setRowIndex(Integer.parseInt(result.get().get("rowIndex").toString())); cellCalcInfoDto.setRowIndex(Integer.parseInt(result.get().get("rowIndex").toString()));
cellCalcInfoDto.setRowName(result.get().get("rowName").toString()); cellCalcInfoDto.setRowName(result.get().get("rowName") == null ? "" : result.get().get("rowName").toString());
cellCalcInfoDto.setFormula(convertListToString(y.stream() cellCalcInfoDto.setFormula(convertListToString(y.stream()
.map(PeriodCellTemplateConfig::getFormula).collect(Collectors.toList()))); .map(PeriodCellTemplateConfig::getFormula).collect(Collectors.toList())));
cellCalcInfoDto.setParsedFormula(convertListToString(y.stream() cellCalcInfoDto.setParsedFormula(convertListToString(y.stream()
...@@ -546,7 +546,7 @@ public class ReportGeneratorImpl { ...@@ -546,7 +546,7 @@ public class ReportGeneratorImpl {
cellCalcInfoDto.setReportTemplateId(Long.parseLong(result.get().get("reportTemplateId").toString())); cellCalcInfoDto.setReportTemplateId(Long.parseLong(result.get().get("reportTemplateId").toString()));
cellCalcInfoDto.setDataType(Integer.parseInt(result.get().get("dataType").toString())); cellCalcInfoDto.setDataType(Integer.parseInt(result.get().get("dataType").toString()));
cellCalcInfoDto.setIsReadOnly(Boolean.valueOf(result.get().get("isReadOnly").toString())); cellCalcInfoDto.setIsReadOnly(Boolean.valueOf(result.get().get("isReadOnly").toString()));
cellCalcInfoDto.setComment(result.get().get("comment").toString()); cellCalcInfoDto.setComment(result.get().get("comment") == null ? "" : result.get().get("comment").toString());
cellCalcInfoDto.setConfigList(y.stream() cellCalcInfoDto.setConfigList(y.stream()
.map(PeriodCellTemplateConfigExtendDto::getPeriodCellTemplateConfig) .map(PeriodCellTemplateConfigExtendDto::getPeriodCellTemplateConfig)
.collect(Collectors.toList())); .collect(Collectors.toList()));
......
...@@ -170,7 +170,7 @@ public class FunctionBase { ...@@ -170,7 +170,7 @@ public class FunctionBase {
periodFormulaBlock.setReportId(0L); periodFormulaBlock.setReportId(0L);
periodFormulaBlock.setCellTemplateId(cellTemplateId); periodFormulaBlock.setCellTemplateId(cellTemplateId);
periodFormulaBlock.setFormulaExpression(formulaExpression); periodFormulaBlock.setFormulaExpression(formulaExpression);
periodFormulaBlock.setData(val.toString()); periodFormulaBlock.setData(val.setScale(2, BigDecimal.ROUND_HALF_UP).toString());
periodFormulaBlock.setDataSourceId(dataSourceId); periodFormulaBlock.setDataSourceId(dataSourceId);
periodFormulaBlock.setCreateBy("Admin"); periodFormulaBlock.setCreateBy("Admin");
periodFormulaBlock.setCreateTime(creatime); periodFormulaBlock.setCreateTime(creatime);
......
...@@ -48,7 +48,7 @@ public class XXFP extends FunctionBase implements FreeRefFunction { ...@@ -48,7 +48,7 @@ public class XXFP extends FunctionBase implements FreeRefFunction {
int period = getIntParam(args[3], ec); int period = getIntParam(args[3], ec);
String invoiceType = "004"; String invoiceType = "004";
String formulaExpression = "XXFP(\"" + taxRate + "\"," + invoiceType + "," + amountType + "," + period + ")"; String formulaExpression = "XXFP(\"" + taxRate + "\"," + invoiceTypeParam + "," + amountType + "," + period + ")";
logger.debug(formulaExpression); logger.debug(formulaExpression);
Integer curYear = formulaContext.getYear(); Integer curYear = formulaContext.getYear();
......
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