Commit 21bb51b9 authored by neo's avatar neo

[DEV] fixed cell list cacls catch exception

parent fd2f2d1d
......@@ -63,23 +63,27 @@ public class PSUM extends FunctionBase implements FreeRefFunction {
List<Object> dataSource) throws NoSuchFieldException, IllegalAccessException {
BigDecimal bigDecimal = new BigDecimal(0);
for (PCell pCell : pCells) {
List<CellTemplatePerGroupDto> cellTemplateDataList = agent.getCellTemplateGroupDto(formulaContext.getReportTemplateGroupId(),
formulaContext.getProjectId(), ec.getWorkbook().getSheetName(ec.getSheetIndex()), pCell.rowIndex-1,
pCell.columnIndex-1, formulaContext.getPeriod());
MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.PSUM_CELL_TEMP_NULL);
CellTemplatePerGroupDto cellTemplateData = cellTemplateDataList.get(0);
BigDecimal cellValue = getCellValue(ec,formulaContext,agent,pCell.rowIndex-1,pCell.columnIndex-1,
Long.parseLong(cellTemplateData.getCellTemplateId()));
ReportCellDataSourceDto dto = new ReportCellDataSourceDto();
dto.fixedWithGroup(cellTemplateData);
dto.setAmount(cellValue);
dto.setPeriod(formulaContext.getPeriod());
dto.setProjectId(formulaContext.getProjectId());
dto.setReportName(cellTemplateData.getReportCode());
dataSource.add(dto);
bigDecimal = bigDecimal.add(cellValue);
try {
List<CellTemplatePerGroupDto> cellTemplateDataList = agent.getCellTemplateGroupDto(formulaContext.getReportTemplateGroupId(),
formulaContext.getProjectId(), ec.getWorkbook().getSheetName(ec.getSheetIndex()), pCell.rowIndex - 1,
pCell.columnIndex - 1, formulaContext.getPeriod());
MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.PSUM_CELL_TEMP_NULL);
CellTemplatePerGroupDto cellTemplateData = cellTemplateDataList.get(0);
BigDecimal cellValue = getCellValue(ec, formulaContext, agent, pCell.rowIndex - 1, pCell.columnIndex - 1,
Long.parseLong(cellTemplateData.getCellTemplateId()));
ReportCellDataSourceDto dto = new ReportCellDataSourceDto();
dto.fixedWithGroup(cellTemplateData);
dto.setAmount(cellValue);
dto.setPeriod(formulaContext.getPeriod());
dto.setProjectId(formulaContext.getProjectId());
dto.setReportName(cellTemplateData.getReportCode());
dataSource.add(dto);
bigDecimal = bigDecimal.add(cellValue);
}catch (Exception e){
e.printStackTrace();
}
}
return bigDecimal.setScale(4, BigDecimal.ROUND_HALF_DOWN);
......
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