Commit b2b88c09 authored by chase's avatar chase

税金计算表功能代码

parent b2991ee2
......@@ -396,10 +396,26 @@ public class ReportServiceImpl extends BaseService {
if (r <= addRowIndex+1) {
String cellId = projectId+template.getId()+period+r+c;
if((r-1)>=0&&(r-1)<configIds.size()){
cellId += configIds.get(r-1);
cellId += configIds.get(configIds.size()-r);
}
Long cellTemplateId = Long.valueOf(cellId.hashCode());
cellTemplateId = cellTemplateId<0?cellTemplateId:(cellTemplateId*-1);
//更新手工数据源
PeriodDataSourceExample delExample = new PeriodDataSourceExample();
delExample.createCriteria().andProjectIdEqualTo(projectId)
.andPeriodEqualTo(period).andTypeEqualTo(10).andColumnIndexEqualTo(c).andRowIndexEqualTo(r);
PeriodDataSource dataSource = new DataSourceExtendDto();
dataSource.setColumnIndex(999);
dataSource.setRowIndex(999);
periodDataSourceMapper.updateByExampleSelective(dataSource, delExample);
PeriodDataSourceExample updateExample = new PeriodDataSourceExample();
updateExample.createCriteria().andProjectIdEqualTo(projectId)
.andPeriodEqualTo(period).andTypeEqualTo(10).andCellTemplateIdEqualTo(cellTemplateId);
dataSource = new DataSourceExtendDto();
dataSource.setColumnIndex(c);
dataSource.setRowIndex(r);
periodDataSourceMapper.updateByExampleSelective(dataSource,updateExample);
PeriodCellTemplate cellTemplate = new PeriodCellTemplate();
cellTemplate.setPeriod(period);
cellTemplate.setRowName(POIUtil.getCellFormulaString(cell));
......
......@@ -229,8 +229,10 @@ public class FunctionBase {
List<PeriodDataSource> dss = agent.queryManualDataSource(cellTemplateId, formulaContext.getProjectId(), formulaContext.getPeriod());
if (eval instanceof ErrorEval || eval == null || eval instanceof BlankEval) {
LOGGER.warn("[Formula_Exception] error eval for cell {} and error code {} and error String {}", cellTemplateId,
((ErrorEval) eval).getErrorCode(), ((ErrorEval) eval).getErrorString());
if(eval !=null && eval instanceof ErrorEval){
LOGGER.warn("[Formula_Exception] error eval for cell {} and error code {} and error String {}", cellTemplateId,
((ErrorEval) eval).getErrorCode(), ((ErrorEval) eval).getErrorString());
}
if (!dss.isEmpty()) return dss.get(0).getAmount();
} else {
String evalStr = OperandResolver.coerceValueToString(eval);
......
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