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
79b3576e
Commit
79b3576e
authored
Nov 27, 2018
by
eddie.woo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
c6a1e283
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
88 deletions
+61
-88
ReportAnalysisService.java
.../pwc/taxtech/atms/service/impl/ReportAnalysisService.java
+34
-18
vat-model-analysis.ctrl.js
...alyzeReport/vat-model-analysis/vat-model-analysis.ctrl.js
+18
-69
vat-model-analysis.html
.../analyzeReport/vat-model-analysis/vat-model-analysis.html
+9
-1
No files found.
atms-api/src/main/java/pwc/taxtech/atms/service/impl/ReportAnalysisService.java
View file @
79b3576e
package
pwc
.
taxtech
.
atms
.
service
.
impl
;
import
com.google.common.collect.Lists
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.math.NumberUtils
;
import
org.springframework.stereotype.Service
;
...
...
@@ -24,7 +25,12 @@ import pwc.taxtech.atms.vat.entity.*;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.function.Function
;
import
java.util.function.Predicate
;
import
java.util.stream.Collectors
;
@Service
public
class
ReportAnalysisService
extends
BaseService
{
...
...
@@ -160,39 +166,44 @@ public class ReportAnalysisService extends BaseService {
* 根据借贷方向获取TB表科目的发生额
*/
public
BigDecimal
getTbValueByDirection
(
String
code
,
String
projectId
,
Integer
period
)
{
BigDecimal
result
=
BigDecimal
.
ZERO
;
try
{
if
(
StringUtils
.
isBlank
(
projectId
))
{
return
BigDecimal
.
ZERO
;
return
result
;
}
Project
project
=
projectMapper
.
selectByPrimaryKey
(
projectId
);
if
(
null
==
project
)
{
return
BigDecimal
.
ZERO
;
return
result
;
}
AccountMappingExample
example
=
new
AccountMappingExample
();
example
.
createCriteria
().
andOrganizationIdEqualTo
(
project
.
getOrganizationId
())
.
andEnterpriseAccountSetIdEqualTo
(
project
.
getEnterpriseAccountSetId
())
.
andIndustryIdEqualTo
(
project
.
getIndustryId
());
Optional
<
AccountMapping
>
mappingOptional
=
accountMappingMapper
.
selectByExample
(
example
).
stream
().
findFirst
();
if
(!
mappingOptional
.
isPresent
())
{
return
BigDecimal
.
ZERO
;
.
andIndustryIdEqualTo
(
project
.
getIndustryId
()).
andStandardAccountCodeEqualTo
(
code
);
List
<
AccountMapping
>
mappingList
=
accountMappingMapper
.
selectByExample
(
example
).
stream
()
.
filter
(
distinctByKey
(
AccountMapping:
:
getEnterpriseAccountCode
)).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
mappingList
))
{
return
result
;
}
Optional
<
StandardAccount
>
accountOptional
=
standardAccountDao
.
getByCodeAndIndustryId
(
mappingOptional
.
get
().
getStandardAccountCode
(),
mappingOptional
.
get
().
getIndustryId
())
.
stream
().
findFirst
();
Optional
<
GlBalance
>
optional
=
glBalanceDao
.
get
(
code
,
project
.
getClientCode
(),
project
.
getYear
()
+
"-"
+
period
);
BigDecimal
val
;
if
(
optional
.
isPresent
())
{
if
(
accountOptional
.
get
().
getDirection
()
==
StdAccountEnum
.
Direction
.
Debit
.
getCode
())
{
val
=
optional
.
get
().
getPtdDr
();
}
else
{
val
=
optional
.
get
().
getPtdCr
();
for
(
AccountMapping
mapping
:
mappingList
)
{
Optional
<
StandardAccount
>
accountOptional
=
standardAccountDao
.
getByCodeAndIndustryId
(
mapping
.
getStandardAccountCode
(),
mapping
.
getIndustryId
()).
stream
().
findFirst
();
Optional
<
GlBalance
>
optional
=
glBalanceDao
.
get
(
code
,
project
.
getClientCode
(),
project
.
getYear
()
+
"-"
+
(
period
<
10
?
"0"
+
period
:
period
));
BigDecimal
val
;
if
(
optional
.
isPresent
())
{
if
(
accountOptional
.
get
().
getDirection
()
==
StdAccountEnum
.
Direction
.
Debit
.
getCode
())
{
val
=
optional
.
get
().
getPtdDr
();
}
else
{
val
=
optional
.
get
().
getPtdCr
();
}
result
=
result
.
add
(
val
);
}
return
val
;
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"getTbValueByDirection error."
,
e
);
}
return
BigDecimal
.
ZERO
;
return
result
;
}
/**
...
...
@@ -239,4 +250,9 @@ public class ReportAnalysisService extends BaseService {
}
return
BigDecimal
.
ZERO
;
}
private
static
<
T
>
Predicate
<
T
>
distinctByKey
(
Function
<?
super
T
,
?>
keyExtractor
)
{
Map
<
Object
,
Boolean
>
seen
=
new
ConcurrentHashMap
<>();
return
t
->
seen
.
putIfAbsent
(
keyExtractor
.
apply
(
t
),
Boolean
.
TRUE
)
==
null
;
}
}
atms-web/src/main/webapp/app/vat/analyzeReport/vat-model-analysis/vat-model-analysis.ctrl.js
View file @
79b3576e
...
...
@@ -41,6 +41,8 @@ vatModule.controller('VatModelAnalysisController', ['$scope', '$translate', '$ui
}
},
legend
:
{
type
:
'scroll'
,
bottom
:
10
,
data
:
yArray
},
xAxis
:
[
...
...
@@ -55,7 +57,7 @@ vatModule.controller('VatModelAnalysisController', ['$scope', '$translate', '$ui
yAxis
:
[
{
type
:
'value'
,
name
:
yArray
[
0
]
,
name
:
'金额'
,
// min: 0,
// max: 250,
position
:
'right'
,
...
...
@@ -72,31 +74,13 @@ vatModule.controller('VatModelAnalysisController', ['$scope', '$translate', '$ui
},
{
type
:
'value'
,
name
:
yArray
[
1
],
// min: 0,
// max: 250,
position
:
'right'
,
offset
:
80
,
axisLine
:
{
lineStyle
:
{
color
:
colors
[
1
]
}
},
axisLabel
:
{
formatter
:
function
(
val
)
{
return
formatNum
(
val
);
}
}
},
{
type
:
'value'
,
name
:
yArray
[
2
],
name
:
'占比'
,
// min: 0,
// max: 25,
position
:
'left'
,
axisLine
:
{
lineStyle
:
{
color
:
colors
[
2
]
color
:
colors
[
1
]
}
},
axisLabel
:
{
...
...
@@ -115,13 +99,12 @@ vatModule.controller('VatModelAnalysisController', ['$scope', '$translate', '$ui
{
name
:
yArray
[
1
],
type
:
'bar'
,
yAxisIndex
:
1
,
data
:
res
.
data
.
income
},
{
name
:
yArray
[
2
],
type
:
'line'
,
yAxisIndex
:
2
,
yAxisIndex
:
1
,
data
:
res
.
data
.
rate
}
]
...
...
@@ -209,6 +192,8 @@ vatModule.controller('VatModelAnalysisController', ['$scope', '$translate', '$ui
}
},
legend
:
{
type
:
'scroll'
,
bottom
:
10
,
data
:
yArray
},
xAxis
:
[
...
...
@@ -223,7 +208,7 @@ vatModule.controller('VatModelAnalysisController', ['$scope', '$translate', '$ui
yAxis
:
[
{
type
:
'value'
,
name
:
yArray
[
0
]
,
name
:
'金额'
,
// min: 0,
// max: 250,
position
:
'right'
,
...
...
@@ -240,31 +225,13 @@ vatModule.controller('VatModelAnalysisController', ['$scope', '$translate', '$ui
},
{
type
:
'value'
,
name
:
yArray
[
1
],
// min: 0,
// max: 250,
position
:
'right'
,
offset
:
80
,
axisLine
:
{
lineStyle
:
{
color
:
colors
[
1
]
}
},
axisLabel
:
{
formatter
:
function
(
val
)
{
return
formatNum
(
val
);
}
}
},
{
type
:
'value'
,
name
:
yArray
[
2
],
name
:
'占比'
,
// min: 0,
// max: 25,
position
:
'left'
,
axisLine
:
{
lineStyle
:
{
color
:
colors
[
2
]
color
:
colors
[
1
]
}
},
axisLabel
:
{
...
...
@@ -283,13 +250,12 @@ vatModule.controller('VatModelAnalysisController', ['$scope', '$translate', '$ui
{
name
:
yArray
[
1
],
type
:
'bar'
,
yAxisIndex
:
1
,
data
:
res
.
data
.
income
},
{
name
:
yArray
[
2
],
type
:
'line'
,
yAxisIndex
:
2
,
yAxisIndex
:
1
,
data
:
res
.
data
.
rate
}
]
...
...
@@ -329,6 +295,8 @@ vatModule.controller('VatModelAnalysisController', ['$scope', '$translate', '$ui
}
},
legend
:
{
type
:
'scroll'
,
bottom
:
10
,
data
:
yArray
},
xAxis
:
[
...
...
@@ -343,7 +311,7 @@ vatModule.controller('VatModelAnalysisController', ['$scope', '$translate', '$ui
yAxis
:
[
{
type
:
'value'
,
name
:
yArray
[
0
]
,
name
:
'金额'
,
// min: 0,
// max: 250,
position
:
'right'
,
...
...
@@ -360,31 +328,13 @@ vatModule.controller('VatModelAnalysisController', ['$scope', '$translate', '$ui
},
{
type
:
'value'
,
name
:
yArray
[
1
],
// min: 0,
// max: 250,
position
:
'right'
,
offset
:
80
,
axisLine
:
{
lineStyle
:
{
color
:
colors
[
1
]
}
},
axisLabel
:
{
formatter
:
function
(
val
)
{
return
formatNum
(
val
);
}
}
},
{
type
:
'value'
,
name
:
yArray
[
2
],
name
:
'占比'
,
// min: 0,
// max: 25,
position
:
'left'
,
axisLine
:
{
lineStyle
:
{
color
:
colors
[
2
]
color
:
colors
[
1
]
}
},
axisLabel
:
{
...
...
@@ -403,13 +353,12 @@ vatModule.controller('VatModelAnalysisController', ['$scope', '$translate', '$ui
{
name
:
yArray
[
1
],
type
:
'bar'
,
yAxisIndex
:
1
,
data
:
res
.
data
.
income
},
{
name
:
yArray
[
2
],
type
:
'line'
,
yAxisIndex
:
2
,
yAxisIndex
:
1
,
data
:
res
.
data
.
rate
}
]
...
...
atms-web/src/main/webapp/app/vat/analyzeReport/vat-model-analysis/vat-model-analysis.html
View file @
79b3576e
<div
class=
"vat-model-analysis "
>
<div
class=
"col-lg-12 col-md-12"
style=
"margin-top:20px;"
>
<div
class=
"col-lg-12 col-md-12"
style=
"margin-top:20px;
height: 100%;overflow:scroll
"
>
<div
class=
"row"
>
<div
class=
"col-lg-5 col-md-5"
>
<div
id=
"burdenRateDiv"
name=
"p_chart"
></div>
...
...
@@ -17,6 +17,14 @@
<div
id=
"incomeVolatilityDiv"
name=
"p_chart"
></div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-lg-5 col-md-5"
>
<div
id=
"vatIncomeRateDiv"
name=
"p_chart"
></div>
</div>
<div
class=
"col-lg-5 col-md-5 col-md-offset-1 col-lg-offset-1"
>
<div
id=
"vatIncomeLineDiv"
name=
"p_chart"
></div>
</div>
</div>
</div>
<style>
...
...
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