Commit b5a9d4d0 authored by zhkwei's avatar zhkwei

1、ZC公式fixbug;2、修改TAX PLATPAM为DIDI...

parent 6e3219ad
...@@ -6,11 +6,14 @@ import org.apache.poi.ss.formula.eval.ValueEval; ...@@ -6,11 +6,14 @@ import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction; import org.apache.poi.ss.formula.functions.FreeRefFunction;
import pwc.taxtech.atms.common.util.SpringContextUtil; import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.Constant; import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.constant.DataSourceName;
import pwc.taxtech.atms.constant.enums.EnumOperationType; import pwc.taxtech.atms.constant.enums.EnumOperationType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType; import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType; import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType;
import pwc.taxtech.atms.dpo.CitAssetDetailResultDto; import pwc.taxtech.atms.dpo.CitAssetDetailResultDto;
import pwc.taxtech.atms.dto.vatdto.AssetDetailDataSourceDto; import pwc.taxtech.atms.dto.vatdto.AssetDetailDataSourceDto;
import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto;
import pwc.taxtech.atms.vat.dpo.AssetDetailResultDto; import pwc.taxtech.atms.vat.dpo.AssetDetailResultDto;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -55,9 +58,10 @@ public class ZC extends FunctionBase implements FreeRefFunction { ...@@ -55,9 +58,10 @@ public class ZC extends FunctionBase implements FreeRefFunction {
int curYear = formulaContext.getYear() + year; int curYear = formulaContext.getYear() + year;
BigDecimal totalData = new BigDecimal("0"); BigDecimal totalData = new BigDecimal("0.00");
List<Object> dataSource = new ArrayList<>(); List<ReportCellDataSourceDto> dataSource = new ArrayList<>();
ReportCellDataSourceDto dto = new ReportCellDataSourceDto();
try { try {
CitAssetDetailResultDto assetDetailResultDto = CitAssetDetailResultDto assetDetailResultDto =
SpringContextUtil.assetsListMapper.getCitAssetDetialResult(assetType, assetDetailType,formulaContext.getProjectId()); SpringContextUtil.assetsListMapper.getCitAssetDetialResult(assetType, assetDetailType,formulaContext.getProjectId());
...@@ -82,7 +86,17 @@ public class ZC extends FunctionBase implements FreeRefFunction { ...@@ -82,7 +86,17 @@ public class ZC extends FunctionBase implements FreeRefFunction {
// assetDetailDataSourceDto.setOperationType(EnumOperationType.Single.getCode()); // assetDetailDataSourceDto.setOperationType(EnumOperationType.Single.getCode());
// dataSource.add(assetDetailDataSourceDto); // dataSource.add(assetDetailDataSourceDto);
// } // }
dataSource.add(assetDetailResultDto);
dto.setRowIndex(ec.getRowIndex());
dto.setColumnIndex(ec.getColumnIndex());
dto.setPeriod(formulaContext.getPeriod());
dto.setReportTemplateId(formulaContext.getReportTemplateGroupId().toString());
dto.setYear(formulaContext.getYear());
dto.setIsOnlyManualInput(Boolean.FALSE);
dto.setReportName(formulaContext.getReportTemplateGroupId().toString());
dto.setName(Constant.DataSourceName.AssetListDataSource);
// dto.setType(FormulaDataSourceType.AssetListSource.getCode());
if(assetDetailResultDto != null){ if(assetDetailResultDto != null){
switch (dataType) { switch (dataType) {
case 1: case 1:
...@@ -119,18 +133,21 @@ public class ZC extends FunctionBase implements FreeRefFunction { ...@@ -119,18 +133,21 @@ public class ZC extends FunctionBase implements FreeRefFunction {
break; break;
} }
} }
dto.setAmount(totalData);
dataSource.add(dto);
return new NumberEval(totalData.doubleValue());
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
logger.error("计算ZC公式报错"); logger.error("计算ZC公式报错");
return new NumberEval(0); dto.setAmount(new BigDecimal("0.00"));
return new NumberEval(0.00);
}finally { }finally {
Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSource), Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSource),
FormulaDataSourceDetailType.AssetDetailDataSourceDto, FormulaDataSourceDetailType.AssetDetailDataSourceDto,
totalData, formulaContext.getPeriod(), formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId()); totalData, formulaContext.getPeriod(), formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
saveFormulaBlock(0, ec, formulaExpression, totalData, dataSourceId, formulaContext.getProjectId()); saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, totalData, dataSourceId, formulaContext.getProjectId());
} }
return new NumberEval(totalData.doubleValue());
} }
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="nav-container" style="min-width:1435px"> <div class="nav-container" style="min-width:1435px">
<div class="nav-element-left" style="width:250px;text-align:left;font-size:17px;"> <div class="nav-element-left" style="width:250px;text-align:left;font-size:17px;">
<i class="fa fa-bullseye" style="color:red;font-size:22px;margin-right:10px"></i> <i class="fa fa-bullseye" style="color:red;font-size:22px;margin-right:10px"></i>
<span style="font-weight:bold;">TAX PLATFORM</span> <span style="font-weight:bold;">DIDI TAX SYSTEM</span>
</div> </div>
<!--<div class="nav-element-left"> <!--<div class="nav-element-left">
<a ui-sref="summary"> <a ui-sref="summary">
......
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