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
5192642d
Commit
5192642d
authored
Apr 24, 2019
by
zhkwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、资产导入本年折旧额根据年限改动;2、ZC公式报错问题
parent
b72420dd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
44 deletions
+48
-44
AssetListServiceImpl.java
...a/pwc/taxtech/atms/service/impl/AssetListServiceImpl.java
+8
-0
ZC.java
...wc/taxtech/atms/vat/service/impl/report/functions/ZC.java
+39
-43
CitAssetsListMapper.java
...c/main/java/pwc/taxtech/atms/dao/CitAssetsListMapper.java
+1
-1
No files found.
atms-api/src/main/java/pwc/taxtech/atms/service/impl/AssetListServiceImpl.java
View file @
5192642d
...
@@ -571,6 +571,14 @@ public class AssetListServiceImpl extends BaseService {
...
@@ -571,6 +571,14 @@ public class AssetListServiceImpl extends BaseService {
for
(
CitAssetsList
citAsset:
assetsLists
){
for
(
CitAssetsList
citAsset:
assetsLists
){
//获取税务每月折旧额,(原值-残值)/税法折旧期间
//获取税务每月折旧额,(原值-残值)/税法折旧期间
citAsset
.
setTaxMonthDepreciationAmount
((
citAsset
.
getAcquisitionValue
().
subtract
(
citAsset
.
getResidualRate
())).
divide
(
new
BigDecimal
(
citAsset
.
getTaxDepreciationPeriod
()),
2
));
citAsset
.
setTaxMonthDepreciationAmount
((
citAsset
.
getAcquisitionValue
().
subtract
(
citAsset
.
getResidualRate
())).
divide
(
new
BigDecimal
(
citAsset
.
getTaxDepreciationPeriod
()),
2
));
//获取税务截止本年累计折旧额, 本年折旧期间* 每月折旧额
citAsset
.
setTaxToCurrentYearDepreciationAmount
(
citAsset
.
getTaxMonthDepreciationAmount
().
multiply
(
new
BigDecimal
(
citAsset
.
getTaxToCurrentYearDepreciationPeriod
())));
//获取税务本年折旧额, 截至本年累计折旧期间*每月折旧额
citAsset
.
setTaxCurrentYearDepreciationAmount
(
citAsset
.
getTaxMonthDepreciationAmount
().
multiply
(
new
BigDecimal
(
citAsset
.
getTaxYearDepreciationPeriod
())));
//获取累计差异, 截止本年累计折旧额(税务)- 截止本年累计折旧额(财务)
citAsset
.
setTotalDifferenceAmount
(
citAsset
.
getTaxToCurrentYearDepreciationAmount
().
subtract
(
citAsset
.
getAccountTotalDepreciationAmount
()));
//获取当年差异
citAsset
.
setYearDifferenceAmount
(
citAsset
.
getTaxCurrentYearDepreciationAmount
().
subtract
(
citAsset
.
getAccountYearDepreciationAmount
()));
assetListMapper
.
updateByPrimaryKeySelective
(
citAsset
);
assetListMapper
.
updateByPrimaryKeySelective
(
citAsset
);
}
}
return
null
;
return
null
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/ZC.java
View file @
5192642d
...
@@ -54,76 +54,72 @@ public class ZC extends FunctionBase implements FreeRefFunction {
...
@@ -54,76 +54,72 @@ public class ZC extends FunctionBase implements FreeRefFunction {
logger
.
debug
(
formulaExpression
);
logger
.
debug
(
formulaExpression
);
int
curYear
=
formulaContext
.
getYear
()
+
year
;
int
curYear
=
formulaContext
.
getYear
()
+
year
;
// String dbName =
// SpringContextUtil.projectDao.getDbNameWithYearAndOrgId(formulaContext.getOrganizationId(), curYear);
List
<
AssetDetailDataSourceDto
>
dataSource
=
new
ArrayList
<>();
BigDecimal
totalData
=
new
BigDecimal
(
"0"
);
BigDecimal
totalData
=
new
BigDecimal
(
"0"
);
List
<
Object
>
dataSource
=
new
ArrayList
<>();
try
{
try
{
List
<
CitAssetDetailResultDto
>
assetDetailResultDtos
=
CitAssetDetailResultDto
assetDetailResultDto
=
SpringContextUtil
.
assetsListMapper
.
getCitAssetDetialResult
(
assetType
,
assetDetailType
,
formulaContext
.
getProjectId
());
SpringContextUtil
.
assetsListMapper
.
getCitAssetDetialResult
(
assetType
,
assetDetailType
,
formulaContext
.
getProjectId
());
if
(
assetDetailResultDtos
!=
null
&&
assetDetailResultDtos
.
size
()>
0
){
// for (CitAssetDetailResultDto x : assetDetailResultDtos) {
System
.
out
.
println
(
assetDetailResultDtos
.
size
());
// if(x == null){
}
// continue;
for
(
CitAssetDetailResultDto
x
:
assetDetailResultDtos
)
{
// }
AssetDetailDataSourceDto
assetDetailDataSourceDto
=
new
AssetDetailDataSourceDto
();
// AssetDetailDataSourceDto assetDetailDataSourceDto = new AssetDetailDataSourceDto();
assetDetailDataSourceDto
.
setResultType
(
KeyValueConfigResultType
.
Accounting
.
getCode
());
// assetDetailDataSourceDto.setResultType(KeyValueConfigResultType.Accounting.getCode());
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));
assetDetailDataSourceDto
.
setAccountTotalepreciationAmount
(
FormulaHelper
.
roundValue
(
x
.
getAssetsList
().
getAccountTotalDepreciationAmount
(),
KeyValueConfigResultType
.
Accounting
,
null
,
formulaContext
));
// assetDetailDataSourceDto.setAccountTotalepreciationAmount(FormulaHelper.roundValue(x.getAssetsList().getAccountTotalDepreciationAmount(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto
.
setYearEndValue
(
FormulaHelper
.
roundValue
(
x
.
getAssetsList
().
getYearEndValue
(),
KeyValueConfigResultType
.
Accounting
,
null
,
formulaContext
));
// assetDetailDataSourceDto.setYearEndValue(FormulaHelper.roundValue(x.getAssetsList().getYearEndValue(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto
.
setTaxMonthDepreciationAmount
(
FormulaHelper
.
roundValue
(
x
.
getAssetsList
().
getTaxMonthDepreciationAmount
(),
KeyValueConfigResultType
.
Accounting
,
null
,
formulaContext
));
// assetDetailDataSourceDto.setTaxMonthDepreciationAmount(FormulaHelper.roundValue(x.getAssetsList().getTaxMonthDepreciationAmount(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto
.
setTaxToCurrentYearDepreciationAmount
(
FormulaHelper
.
roundValue
(
x
.
getAssetsList
().
getTaxToCurrentYearDepreciationAmount
(),
KeyValueConfigResultType
.
Accounting
,
null
,
formulaContext
));
// assetDetailDataSourceDto.setTaxToCurrentYearDepreciationAmount(FormulaHelper.roundValue(x.getAssetsList().getTaxToCurrentYearDepreciationAmount(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto
.
setTaxCurrentYearDepreciationAmount
(
FormulaHelper
.
roundValue
(
x
.
getAssetsList
().
getTaxCurrentYearDepreciationAmount
(),
KeyValueConfigResultType
.
Accounting
,
null
,
formulaContext
));
// assetDetailDataSourceDto.setTaxCurrentYearDepreciationAmount(FormulaHelper.roundValue(x.getAssetsList().getTaxCurrentYearDepreciationAmount(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto
.
setTotalDifferenceAmount
(
FormulaHelper
.
roundValue
(
x
.
getAssetsList
().
getTotalDifferenceAmount
(),
KeyValueConfigResultType
.
Accounting
,
null
,
formulaContext
));
// assetDetailDataSourceDto.setTotalDifferenceAmount(FormulaHelper.roundValue(x.getAssetsList().getTotalDifferenceAmount(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto
.
setYearDifferenceAmount
(
FormulaHelper
.
roundValue
(
x
.
getAssetsList
().
getYearDifferenceAmount
(),
KeyValueConfigResultType
.
Accounting
,
null
,
formulaContext
));
// assetDetailDataSourceDto.setYearDifferenceAmount(FormulaHelper.roundValue(x.getAssetsList().getYearDifferenceAmount(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto
.
setDataType
(
dataType
);
// assetDetailDataSourceDto.setDataType(dataType);
assetDetailDataSourceDto
.
setName
(
Constant
.
DataSourceName
.
AssetListDataSource
);
// assetDetailDataSourceDto.setName(Constant.DataSourceName.AssetListDataSource);
assetDetailDataSourceDto
.
setOperationType
(
EnumOperationType
.
Single
.
getCode
());
// assetDetailDataSourceDto.setOperationType(EnumOperationType.Single.getCode());
dataSource
.
add
(
assetDetailDataSourceDto
);
// dataSource.add(assetDetailDataSourceDto);
}
// }
dataSource
.
add
(
assetDetailResultDto
);
// dataSource = dataSource.stream()
if
(
assetDetailResultDto
!=
null
){
// .sorted(Comparator.comparing(AssetDetailDataSourceDto::getAssetGroupName)
// .thenComparing(AssetDetailDataSourceDto::getAssetDetailGroupName))
// .collect(Collectors.toList());
switch
(
dataType
)
{
switch
(
dataType
)
{
case
1
:
case
1
:
totalData
=
new
BigDecimal
(
dataSource
.
stream
().
mapToDouble
(
a
->
a
.
getAccountAcquisitionValue
().
doubleValue
()).
sum
()
);
totalData
=
assetDetailResultDto
.
getAssetsList
().
getAccountAcquisitionValue
(
);
break
;
break
;
case
2
:
case
2
:
totalData
=
new
BigDecimal
(
dataSource
.
stream
().
mapToDouble
(
a
->
a
.
getAccountYearDepreciationAmount
().
doubleValue
()).
sum
()
);
totalData
=
assetDetailResultDto
.
getAssetsList
().
getAccountYearDepreciationAmount
(
);
break
;
break
;
case
3
:
case
3
:
totalData
=
new
BigDecimal
(
dataSource
.
stream
().
mapToDouble
(
a
->
a
.
getAccountTotalepreciationAmount
().
doubleValue
()).
sum
()
);
totalData
=
assetDetailResultDto
.
getAssetsList
().
getAccountTotalDepreciationAmount
(
);
break
;
break
;
case
4
:
case
4
:
totalData
=
new
BigDecimal
(
dataSource
.
stream
().
mapToDouble
(
a
->
a
.
getAccountMonthDepreciationAmount
().
doubleValue
()).
sum
()
);
totalData
=
assetDetailResultDto
.
getAssetsList
().
getAccountMonthDepreciationAmount
(
);
break
;
break
;
case
5
:
case
5
:
totalData
=
new
BigDecimal
(
dataSource
.
stream
().
mapToDouble
(
a
->
a
.
getYearEndValue
().
doubleValue
()).
sum
()
);
totalData
=
assetDetailResultDto
.
getAssetsList
().
getYearEndValue
(
);
break
;
break
;
case
6
:
case
6
:
totalData
=
new
BigDecimal
(
dataSource
.
stream
().
mapToDouble
(
a
->
a
.
getTaxMonthDepreciationAmount
().
doubleValue
()).
sum
()
);
totalData
=
assetDetailResultDto
.
getAssetsList
().
getTaxMonthDepreciationAmount
(
);
break
;
break
;
case
7
:
case
7
:
totalData
=
new
BigDecimal
(
dataSource
.
stream
().
mapToDouble
(
a
->
a
.
getTaxToCurrentYearDepreciationAmount
().
doubleValue
()).
sum
()
);
totalData
=
assetDetailResultDto
.
getAssetsList
().
getTaxToCurrentYearDepreciationAmount
(
);
break
;
break
;
case
8
:
case
8
:
totalData
=
new
BigDecimal
(
dataSource
.
stream
().
mapToDouble
(
a
->
a
.
getTaxCurrentYearDepreciationAmount
().
doubleValue
()).
sum
()
);
totalData
=
assetDetailResultDto
.
getAssetsList
().
getTaxCurrentYearDepreciationAmount
(
);
break
;
break
;
case
9
:
case
9
:
dataSource
=
dataSource
.
stream
().
filter
(
a
->
a
.
getIsRetain
()
!=
null
&&
a
.
getIsRetain
()).
collect
(
Collectors
.
toList
());
totalData
=
assetDetailResultDto
.
getAssetsList
().
getTotalDifferenceAmount
();
totalData
=
new
BigDecimal
(
dataSource
.
stream
().
mapToDouble
(
a
->
a
.
getTotalDifferenceAmount
().
doubleValue
()).
sum
());
break
;
break
;
case
10
:
case
10
:
dataSource
=
dataSource
.
stream
().
filter
(
a
->
a
.
getIsRetain
()
!=
null
&&
a
.
getIsRetain
()).
collect
(
Collectors
.
toList
());
totalData
=
assetDetailResultDto
.
getAssetsList
().
getYearDifferenceAmount
();
totalData
=
new
BigDecimal
(
dataSource
.
stream
().
mapToDouble
(
a
->
a
.
getYearDifferenceAmount
().
doubleValue
()).
sum
());
break
;
break
;
default
:
default
:
break
;
break
;
}
}
}
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
logger
.
error
(
"计算ZC公式报错"
);
logger
.
error
(
"计算ZC公式报错"
);
...
...
atms-dao/src/main/java/pwc/taxtech/atms/dao/CitAssetsListMapper.java
View file @
5192642d
...
@@ -119,7 +119,7 @@ public interface CitAssetsListMapper extends MyMapper {
...
@@ -119,7 +119,7 @@ public interface CitAssetsListMapper extends MyMapper {
*/
*/
List
<
CitAssetEamMapping
>
getAssetEamMapping
(
CitAssetsList
citAsset
);
List
<
CitAssetEamMapping
>
getAssetEamMapping
(
CitAssetsList
citAsset
);
List
<
CitAssetDetailResultDto
>
getCitAssetDetialResult
(
@Param
(
"assetType"
)
Integer
assetType
,
CitAssetDetailResultDto
getCitAssetDetialResult
(
@Param
(
"assetType"
)
Integer
assetType
,
@Param
(
"assetDetailType"
)
Integer
assetDetailType
,
@Param
(
"assetDetailType"
)
Integer
assetDetailType
,
@Param
(
"projectId"
)
String
projectId
);
@Param
(
"projectId"
)
String
projectId
);
...
...
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