Commit c7166374 authored by chase's avatar chase

fix bug

parent f8d70cae
package pwc.taxtech.atms.vat.service.impl.report.functions;
import org.apache.commons.collections.CollectionUtils;
import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.StringEval;
......@@ -7,13 +8,11 @@ import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.dpo.CellTemplatePerGroupDto;
import pwc.taxtech.atms.dto.vatdto.TaxCellDataSourceDto;
import pwc.taxtech.atms.dto.vatdto.WPNAMEParasBo;
import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.exception.FormulaException;
import java.math.BigDecimal;
......@@ -57,7 +56,10 @@ public class WPNAME extends FunctionBase implements FreeRefFunction {
//根据目标列+名称定位数据行,再根据参数列+数据行定位sheet单元格
cellTemplateDataList = agent.getCellTemplateByNameAndIndex(formulaContext.getReportTemplateGroupId(),
formulaContext.getProjectId(), bo.getReportCode(), bo.getRowColumnIndex()-1,bo.getRowName(), bo.getColumnIndex() - 1, formulaContext.getPeriod());
MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.BB_CELL_TEMP_NULL);
// MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.BB_CELL_TEMP_NULL);
if(CollectionUtils.isEmpty(cellTemplateDataList)){
return cellValue;
}
cellTemplateData = cellTemplateDataList.get(0);
int index = ec.getWorkbook().getSheetIndex(bo.getReportCode());
cellValue = getCellValue(index, ec, formulaContext, agent, cellTemplateData.getRowIndex(), bo.getColumnIndex()-1,
......
......@@ -8,17 +8,14 @@ import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.dpo.CellTemplatePerGroupDto;
import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto;
import pwc.taxtech.atms.dto.vatdto.WPTYPEParasBo;
import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.exception.FormulaException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class WPTYPE extends FunctionBase implements FreeRefFunction {
......@@ -61,7 +58,10 @@ public class WPTYPE extends FunctionBase implements FreeRefFunction {
cellTemplateDataList = agent.getCellTemplateGroupDto(formulaContext.getReportTemplateGroupId(),
formulaContext.getProjectId(), bo.getReportCode(), ec.getRowIndex(), ec.getColumnIndex(), formulaContext.getPeriod());
}
MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.BB_CELL_TEMP_NULL);
// MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.BB_CELL_TEMP_NULL);
if(CollectionUtils.isEmpty(cellTemplateDataList)){
return cellValue;
}
for (CellTemplatePerGroupDto cellTemplateData : cellTemplateDataList) {
int index = ec.getWorkbook().getSheetIndex(bo.getReportCode());
BigDecimal curCellVal = getCellValue(index, ec, formulaContext, agent, cellTemplateData.getRowIndex(), bo.getColumnIndex() - 1,
......
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