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
eeb82d4d
Commit
eeb82d4d
authored
Nov 08, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bugfix] fixed clean period cell data sources
parent
786164b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+20
-5
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
eeb82d4d
...
...
@@ -2,6 +2,7 @@ package pwc.taxtech.atms.vat.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Sets
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.ss.usermodel.FormulaEvaluator
;
import
org.apache.poi.ss.usermodel.Workbook
;
...
...
@@ -198,7 +199,12 @@ public class ReportServiceImpl {
periodDataSourceExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
)
.
andPeriodEqualTo
(
period
);
List
<
PeriodDataSource
>
periodDataSources
=
periodDataSourceMapper
.
selectByExample
(
periodDataSourceExample
);
List
<
Long
>
periodDsIds
=
Lists
.
newArrayList
(
Long
.
MAX_VALUE
);
PeriodCellDataSourceExample
allMappingExample
=
new
PeriodCellDataSourceExample
();
allMappingExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
);
List
<
PeriodCellDataSource
>
allPcds
=
periodCellDataSourceMapper
.
selectByExample
(
allMappingExample
);
Set
<
Long
>
periodDsIds
=
Sets
.
newHashSet
(
Long
.
MAX_VALUE
);
List
<
Long
>
periodManualDsIds
=
new
ArrayList
<>();
List
<
Long
>
periodManualCellDataIds
=
new
ArrayList
<>();
...
...
@@ -216,27 +222,36 @@ public class ReportServiceImpl {
periodCellDataSourceExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
)
.
andDataSourceIdIn
(
periodManualDsIds
);
List
<
PeriodCellDataSource
>
manualCellDataSource
=
periodCellDataSourceMapper
.
selectByExample
(
periodCellDataSourceExample
);
if
(!
manualCellDataSource
.
isEmpty
())
if
(!
manualCellDataSource
.
isEmpty
())
{
periodManualCellDataIds
.
addAll
(
manualCellDataSource
.
stream
().
map
(
PeriodCellDataSource:
:
getCellDataId
)
.
collect
(
Collectors
.
toList
()));
}
}
if
(!
allPcds
.
isEmpty
()){
List
<
Long
>
allPcdsIds
=
allPcds
.
stream
().
map
(
m
->
m
.
getDataSourceId
()).
collect
(
Collectors
.
toList
());
allPcdsIds
.
removeAll
(
periodManualDsIds
);
periodDsIds
.
addAll
(
allPcdsIds
);
}
}
else
{
periodDsIds
.
addAll
(
periodDataSources
.
stream
().
map
(
m
->
m
.
getId
()).
collect
(
Collectors
.
toList
()));
if
(!
allPcds
.
isEmpty
())
periodDsIds
.
addAll
(
allPcds
.
stream
().
map
(
m
->
m
.
getDataSourceId
()).
collect
(
Collectors
.
toList
()));
}
PeriodDataSourceDetailExample
periodDataSourceDetailExample
=
new
PeriodDataSourceDetailExample
();
periodDataSourceDetailExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
)
.
andDataSourceIdIn
(
periodDsIds
);
.
andDataSourceIdIn
(
Lists
.
newArrayList
(
periodDsIds
)
);
periodDataSourceDetailMapper
.
deleteByExample
(
periodDataSourceDetailExample
);
PeriodCellDataSourceExample
periodCellDataSourceExample
=
new
PeriodCellDataSourceExample
();
periodCellDataSourceExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
)
.
andDataSourceIdIn
(
periodDsIds
);
.
andDataSourceIdIn
(
Lists
.
newArrayList
(
periodDsIds
)
);
periodCellDataSourceMapper
.
deleteByExample
(
periodCellDataSourceExample
);
PeriodDataSourceExample
periodDataSourceDeleteExample
=
new
PeriodDataSourceExample
();
periodDataSourceDeleteExample
.
createCriteria
().
andIdIn
(
periodDsIds
);
periodDataSourceDeleteExample
.
createCriteria
().
andIdIn
(
Lists
.
newArrayList
(
periodDsIds
)
);
periodDataSourceMapper
.
deleteByExample
(
periodDataSourceDeleteExample
);
PeriodReportExample
periodReportExample
=
new
PeriodReportExample
();
...
...
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