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
1b15143c
Commit
1b15143c
authored
Nov 08, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] fixed BB can add manual datasource
parent
160a3bfe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
2 deletions
+33
-2
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+16
-0
PeriodCellDataMapper.java
...n/java/pwc/taxtech/atms/vat/dao/PeriodCellDataMapper.java
+17
-2
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
View file @
1b15143c
...
...
@@ -641,6 +641,8 @@ public class ReportGeneratorImpl {
if
(!
parameter
.
isEmpty
())
{
List
<
PCTEntity
>
pctResults
=
periodCellDataMapper
.
queryByPCTs
(
parameter
,
projectId
);
List
<
PCTEntity
>
manuaPctResults
=
periodCellDataMapper
.
queryManualPCTs
(
parameter
,
projectId
);
Map
<
PCTEntity
,
BigDecimal
>
pctCache
=
new
HashMap
<>();
pctResults
.
forEach
(
m
->
{
BigDecimal
data
=
null
;
...
...
@@ -653,6 +655,20 @@ public class ReportGeneratorImpl {
pctCache
.
put
(
m
,
data
);
});
manuaPctResults
.
forEach
(
m
->
{
BigDecimal
data
=
null
;
try
{
data
=
new
BigDecimal
(
m
.
getData
());
}
catch
(
NumberFormatException
e
)
{
logger
.
warn
(
"number format ecption for parameter {}"
,
m
);
data
=
BigDecimal
.
ZERO
;
}
if
(!
pctCache
.
containsKey
(
m
))
pctCache
.
put
(
m
,
data
);
else
pctCache
.
get
(
m
).
add
(
data
);
});
configMapToPCTs
.
forEach
((
k
,
v
)
->
{
v
.
forEach
(
pctStr
->
{
List
<
PCTEntity
>
entities
=
formulaMapToPCT
.
get
(
pctStr
);
...
...
atms-dao/src/main/java/pwc/taxtech/atms/vat/dao/PeriodCellDataMapper.java
View file @
1b15143c
...
...
@@ -117,7 +117,7 @@ public interface PeriodCellDataMapper extends MyVatMapper {
@Select
(
"<script>"
+
"SELECT "
+
" R.PERIOD
, C.CELL_TEMPLATE_ID AS CELLTEMPLATEID, DATA
"
+
" R.PERIOD
as period, C.CELL_TEMPLATE_ID AS cellTemplateId, DATA as data
"
+
"FROM "
+
" PERIOD_CELL_DATA C, "
+
" PERIOD_REPORT R "
+
...
...
@@ -132,7 +132,22 @@ public interface PeriodCellDataMapper extends MyVatMapper {
"</script>"
)
List
<
PCTEntity
>
queryByPCTs
(
@Param
(
"list"
)
Set
<
PCTEntity
>
parameter
,
@Param
(
"projectId"
)
String
projectId
);
@Select
(
"<script>"
+
"SELECT "
+
" p.PERIOD AS period, "
+
" p.CELL_TEMPLATE_ID AS cellTemplateId, "
+
" p.AMOUNT AS data "
+
"FROM "
+
" PERIOD_DATA_SOURCE p "
+
"WHERE "
+
" PROJECT_ID = #{projectId} "
+
" <foreach item=\"item\" index=\"index\" collection=\"list\""
+
" open=\"(\" separator=\"OR\" close=\")\">"
+
" ( p.PERIOD=#{item.period} AND p.CELL_TEMPLATE_ID=#{item.cellTemplateId} )"
+
" </foreach>"
+
"</script>"
)
List
<
PCTEntity
>
queryManualPCTs
(
@Param
(
"list"
)
Set
<
PCTEntity
>
parameter
,
@Param
(
"projectId"
)
String
projectId
);
@Select
(
""
+
"SELECT "
+
" d.ID AS id, "
+
...
...
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