Commit 421756f9 authored by chase's avatar chase

修改税金公式定位不到数据行时数据的展示效果

parent 3006acfe
package pwc.taxtech.atms.vat.service.impl.report.functions;
import com.alibaba.fastjson.JSON;
import org.apache.commons.collections.CollectionUtils;
import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.WorkbookEvaluator;
import org.apache.poi.ss.formula.eval.*;
......@@ -138,6 +139,7 @@ public class FunctionBase {
dataSource.setPeriod(period);
dataSource.setProjectId(projectId);
SpringContextUtil.periodDataSourceMapper.insertSelective(dataSource);
if(CollectionUtils.isNotEmpty(dataSourceList)){
for (Object obj : dataSourceList) {
if (obj.getClass() == java.util.ArrayList.class) {
for (Object obj2 : (ArrayList<Object>) obj) {
......@@ -161,6 +163,17 @@ public class FunctionBase {
SpringContextUtil.periodDataSourceDetailMapper.insertSelective(dataSourceDetail);
}
}
}else{
PeriodDataSourceDetail dataSourceDetail = new PeriodDataSourceDetail();
dataSourceDetail.setId(SpringContextUtil.distributedIdService.nextId());
dataSourceDetail.setDataSourceId(dataSourceId);
dataSourceDetail.setDataSourceType(formulaDataSourceDetailType.getCode());
dataSourceDetail.setItemValue("{}");
dataSourceDetail.setPeriod(period);
dataSourceDetail.setProjectId(projectId);
SpringContextUtil.periodDataSourceDetailMapper.insertSelective(dataSourceDetail);
}
return dataSourceId;
}
......
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;
......@@ -56,6 +57,10 @@ public class WPTYPE extends FunctionBase implements FreeRefFunction {
cellTemplateDataList = agent.getCellTemplateByTypeAndIndex(formulaContext.getReportTemplateGroupId(),
formulaContext.getProjectId(), bo.getReportCode(), bo.getRowColumnIndex() - 1, bo.getTaxRate(), bo.getRevenueType(), bo.getTaxType(), bo.getColumnIndex() - 1,
formulaContext.getPeriod(), formulaContext.getOrganizationId(), queryDate, queryDate);
if(CollectionUtils.isEmpty(cellTemplateDataList)){
cellTemplateDataList = agent.getCellTemplateGroupDto(formulaContext.getReportTemplateGroupId(),
formulaContext.getProjectId(), bo.getReportCode(), ec.getRowIndex(), ec.getColumnIndex(), formulaContext.getPeriod());
}
MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.BB_CELL_TEMP_NULL);
for (CellTemplatePerGroupDto cellTemplateData : cellTemplateDataList) {
int index = ec.getWorkbook().getSheetIndex(bo.getReportCode());
......@@ -79,6 +84,8 @@ public class WPTYPE extends FunctionBase implements FreeRefFunction {
formulaContext.getProjectId());
saveFormulaBlock(formulaContext.getPeriod(), ec,
bo.getFormulaExpression(), cellValue, dataSourceId, formulaContext.getProjectId());
}
}
......
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