Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
0a2494a2
Commit
0a2494a2
authored
Apr 25, 2019
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_wzk' into 'dev_mysql'
Dev wzk See merge request root/atms!336
parents
ea1d1d24
65dd9937
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
7 deletions
+24
-7
ZC.java
...wc/taxtech/atms/vat/service/impl/report/functions/ZC.java
+24
-7
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/ZC.java
View file @
0a2494a2
...
...
@@ -6,11 +6,14 @@ import org.apache.poi.ss.formula.eval.ValueEval;
import
org.apache.poi.ss.formula.functions.FreeRefFunction
;
import
pwc.taxtech.atms.common.util.SpringContextUtil
;
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.FormulaDataSourceDetailType
;
import
pwc.taxtech.atms.constant.enums.FormulaDataSourceType
;
import
pwc.taxtech.atms.constant.enums.KeyValueConfigResultType
;
import
pwc.taxtech.atms.dpo.CitAssetDetailResultDto
;
import
pwc.taxtech.atms.dto.vatdto.AssetDetailDataSourceDto
;
import
pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto
;
import
pwc.taxtech.atms.vat.dpo.AssetDetailResultDto
;
import
java.math.BigDecimal
;
...
...
@@ -55,9 +58,10 @@ public class ZC extends FunctionBase implements FreeRefFunction {
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
{
CitAssetDetailResultDto
assetDetailResultDto
=
SpringContextUtil
.
assetsListMapper
.
getCitAssetDetialResult
(
assetType
,
assetDetailType
,
formulaContext
.
getProjectId
());
...
...
@@ -82,7 +86,17 @@ public class ZC extends FunctionBase implements FreeRefFunction {
// assetDetailDataSourceDto.setOperationType(EnumOperationType.Single.getCode());
// 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
){
switch
(
dataType
)
{
case
1
:
...
...
@@ -119,18 +133,21 @@ public class ZC extends FunctionBase implements FreeRefFunction {
break
;
}
}
dto
.
setAmount
(
totalData
);
dataSource
.
add
(
dto
);
return
new
NumberEval
(
totalData
.
doubleValue
());
}
catch
(
Exception
e
){
e
.
printStackTrace
();
logger
.
error
(
"计算ZC公式报错"
);
return
new
NumberEval
(
0
);
dto
.
setAmount
(
new
BigDecimal
(
"0.00"
));
return
new
NumberEval
(
0.00
);
}
finally
{
Long
dataSourceId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
AssetDetailDataSourceDto
,
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
());
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment