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
5f8bf929
Commit
5f8bf929
authored
Nov 08, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "[Bugfix] fixed datasource re mapping each regenatrater"
This reverts commit
e28290f5
.
parent
02949c4b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
5 deletions
+38
-5
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+38
-5
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
5f8bf929
...
...
@@ -201,8 +201,13 @@ public class ReportServiceImpl {
.
andPeriodEqualTo
(
period
);
List
<
PeriodDataSource
>
periodDataSources
=
periodDataSourceMapper
.
selectByExample
(
periodDataSourceExample
);
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
<>();
if
(
isMergeManualData
)
{
periodDataSources
.
forEach
(
m
->
{
...
...
@@ -213,17 +218,36 @@ public class ReportServiceImpl {
}
});
if
(!
periodManualDsIds
.
isEmpty
())
{
PeriodCellDataSourceExample
periodCellDataSourceExample
=
new
PeriodCellDataSourceExample
();
periodCellDataSourceExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
)
.
andDataSourceIdIn
(
periodManualDsIds
);
List
<
PeriodCellDataSource
>
manualCellDataSource
=
periodCellDataSourceMapper
.
selectByExample
(
periodCellDataSourceExample
);
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
(
Lists
.
newArrayList
(
periodDsIds
));
periodDataSourceDetailMapper
.
deleteByExample
(
periodDataSourceDetailExample
);
periodDataSourceDetailMapper
.
deleteByExample
(
periodDataSourceDetailExample
);
PeriodCellDataSourceExample
periodCellDataSourceExample
=
new
PeriodCellDataSourceExample
();
periodCellDataSourceExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
);
periodCellDataSourceExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
)
.
andDataSourceIdIn
(
Lists
.
newArrayList
(
periodDsIds
));
periodCellDataSourceMapper
.
deleteByExample
(
periodCellDataSourceExample
);
...
...
@@ -233,12 +257,20 @@ public class ReportServiceImpl {
PeriodReportExample
periodReportExample
=
new
PeriodReportExample
();
periodReportExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
);
periodReportMapper
.
deleteByExample
(
periodReportExample
);
List
<
PeriodReport
>
reports
=
periodReportMapper
.
selectByExample
(
periodReportExample
);
List
<
Long
>
reportIds
=
Lists
.
newArrayList
(
Long
.
MAX_VALUE
);
reportIds
.
addAll
(
reports
.
stream
().
map
(
m
->
m
.
getId
()).
collect
(
Collectors
.
toList
()));
PeriodCellDataExample
periodCellDataExample
=
new
PeriodCellDataExample
();
periodCellDataExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
);
periodCellDataMapper
.
deleteByExample
(
periodCellDataExample
);
if
(
isMergeManualData
)
{
if
(
periodManualCellDataIds
.
isEmpty
())
periodManualCellDataIds
.
add
(
Long
.
MAX_VALUE
);
periodCellDataExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
).
andIdNotIn
(
periodManualCellDataIds
);
}
else
{
periodCellDataExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
period
);
}
periodCellDataMapper
.
deleteByExample
(
periodCellDataExample
);
periodReportMapper
.
deleteByExample
(
periodReportExample
);
}
...
...
@@ -487,6 +519,7 @@ public class ReportServiceImpl {
reportGenerator
.
updateWorkbookCaclsValueToDb
(
projectId
,
periodParam
,
workbook
,
resources
,
genJob
);
reportGenerator
.
updateManaCellDataWithNewReport
(
projectId
,
periodParam
);
genJob
.
setStatus
(
WrapPeriodJobDto
.
STATUS_END
);
periodJobMapper
.
updateByPrimaryKey
(
genJob
);
...
...
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