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