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
ec6ec56c
Commit
ec6ec56c
authored
Mar 20, 2019
by
zhkwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CIT--ZC公式完善
parent
0ec02f5a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
ZC.java
...wc/taxtech/atms/vat/service/impl/report/functions/ZC.java
+14
-4
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/ZC.java
View file @
ec6ec56c
...
@@ -56,16 +56,20 @@ public class ZC extends FunctionBase implements FreeRefFunction {
...
@@ -56,16 +56,20 @@ public class ZC extends FunctionBase implements FreeRefFunction {
int
curYear
=
formulaContext
.
getYear
()
+
year
;
int
curYear
=
formulaContext
.
getYear
()
+
year
;
// String dbName =
// String dbName =
// SpringContextUtil.projectDao.getDbNameWithYearAndOrgId(formulaContext.getOrganizationId(), curYear);
// SpringContextUtil.projectDao.getDbNameWithYearAndOrgId(formulaContext.getOrganizationId(), curYear);
List
<
AssetDetailDataSourceDto
>
dataSource
=
new
ArrayList
<>();
BigDecimal
totalData
=
new
BigDecimal
(
"0"
);
try
{
List
<
CitAssetDetailResultDto
>
assetDetailResultDtos
=
List
<
CitAssetDetailResultDto
>
assetDetailResultDtos
=
SpringContextUtil
.
assetsListMapper
.
getCitAssetDetialResult
(
assetType
,
assetDetailType
);
SpringContextUtil
.
assetsListMapper
.
getCitAssetDetialResult
(
assetType
,
assetDetailType
);
if
(
assetDetailResultDtos
!=
null
&&
assetDetailResultDtos
.
size
()>
0
){
List
<
AssetDetailDataSourceDto
>
dataSource
=
new
ArrayList
<>();
System
.
out
.
println
(
assetDetailResultDtos
.
size
());
}
for
(
CitAssetDetailResultDto
x
:
assetDetailResultDtos
)
{
for
(
CitAssetDetailResultDto
x
:
assetDetailResultDtos
)
{
AssetDetailDataSourceDto
assetDetailDataSourceDto
=
new
AssetDetailDataSourceDto
();
AssetDetailDataSourceDto
assetDetailDataSourceDto
=
new
AssetDetailDataSourceDto
();
assetDetailDataSourceDto
.
setResultType
(
KeyValueConfigResultType
.
Accounting
.
getCode
());
assetDetailDataSourceDto
.
setResultType
(
KeyValueConfigResultType
.
Accounting
.
getCode
());
assetDetailDataSourceDto
.
setAssetNumber
(
x
.
getAssetsList
().
getAssetGroupName
());
assetDetailDataSourceDto
.
setAssetNumber
(
x
.
getAssetsList
().
getAssetGroupName
());
assetDetailDataSourceDto
.
setAssetGroupName
(
x
.
getAssetDetailGroup
().
getDetailGroupName
());
assetDetailDataSourceDto
.
setAssetGroupName
(
x
.
getAssetDetailGroup
().
getDetailGroupName
());
assetDetailDataSourceDto
.
setAssetDetailGroupName
(
x
.
getAssetDetailGroup
().
getDetailGroupName
());
assetDetailDataSourceDto
.
setAccountAcquisitionValue
(
FormulaHelper
.
roundValue
(
x
.
getAssetsList
().
getAccountAcquisitionValue
(),
KeyValueConfigResultType
.
Accounting
,
null
,
formulaContext
));
assetDetailDataSourceDto
.
setAccountAcquisitionValue
(
FormulaHelper
.
roundValue
(
x
.
getAssetsList
().
getAccountAcquisitionValue
(),
KeyValueConfigResultType
.
Accounting
,
null
,
formulaContext
));
assetDetailDataSourceDto
.
setAccountMonthDepreciationAmount
(
FormulaHelper
.
roundValue
(
x
.
getAssetsList
().
getAccountMonthDepreciationAmount
(),
KeyValueConfigResultType
.
Accounting
,
null
,
formulaContext
));
assetDetailDataSourceDto
.
setAccountMonthDepreciationAmount
(
FormulaHelper
.
roundValue
(
x
.
getAssetsList
().
getAccountMonthDepreciationAmount
(),
KeyValueConfigResultType
.
Accounting
,
null
,
formulaContext
));
assetDetailDataSourceDto
.
setAccountYearDepreciationAmount
(
FormulaHelper
.
roundValue
(
x
.
getAssetsList
().
getYearDepreciationAmount
(),
KeyValueConfigResultType
.
Accounting
,
null
,
formulaContext
));
assetDetailDataSourceDto
.
setAccountYearDepreciationAmount
(
FormulaHelper
.
roundValue
(
x
.
getAssetsList
().
getYearDepreciationAmount
(),
KeyValueConfigResultType
.
Accounting
,
null
,
formulaContext
));
...
@@ -90,7 +94,6 @@ public class ZC extends FunctionBase implements FreeRefFunction {
...
@@ -90,7 +94,6 @@ public class ZC extends FunctionBase implements FreeRefFunction {
.
thenComparing
(
AssetDetailDataSourceDto:
:
getAssetDetailGroupName
))
.
thenComparing
(
AssetDetailDataSourceDto:
:
getAssetDetailGroupName
))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
BigDecimal
totalData
=
new
BigDecimal
(
"0"
);
switch
(
dataType
)
{
switch
(
dataType
)
{
case
1
:
case
1
:
totalData
=
new
BigDecimal
(
dataSource
.
stream
().
mapToDouble
(
a
->
a
.
getAccountAcquisitionValue
().
doubleValue
()).
sum
());
totalData
=
new
BigDecimal
(
dataSource
.
stream
().
mapToDouble
(
a
->
a
.
getAccountAcquisitionValue
().
doubleValue
()).
sum
());
...
@@ -127,10 +130,17 @@ public class ZC extends FunctionBase implements FreeRefFunction {
...
@@ -127,10 +130,17 @@ public class ZC extends FunctionBase implements FreeRefFunction {
default
:
default
:
break
;
break
;
}
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
logger
.
error
(
"计算ZC公式报错"
);
return
new
NumberEval
(
0
);
}
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
(
0
,
ec
,
formulaExpression
,
totalData
,
dataSourceId
,
formulaContext
.
getProjectId
());
}
return
new
NumberEval
(
totalData
.
doubleValue
());
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