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
6ea32431
Commit
6ea32431
authored
Nov 09, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] add munaul cell data and cell data source
parent
1e75eb4b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
4 deletions
+71
-4
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+71
-4
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
View file @
6ea32431
...
...
@@ -296,10 +296,6 @@ public class ReportGeneratorImpl {
for
(
int
ii
=
0
;
ii
<
dataSourceList
.
size
();
ii
++)
{
PeriodDataSource
dataSource
=
dataSourceList
.
get
(
ii
);
if
(
isMergeMunual
&&
dataSource
.
getType
().
intValue
()
==
10
)
{
cellData
.
setData
(
dataSource
.
getAmount
()
+
""
);
if
(
dataSourceList
.
size
()
==
1
)
cellData
.
setFormulaExp
(
dataSource
.
getAmount
()
+
""
);
}
PeriodCellDataSource
cellDataSource
=
new
PeriodCellDataSource
();
cellDataSource
.
setId
(
distributedIdService
.
nextId
());
cellDataSource
.
setCellTemplateId
(
tempPeriodCellTemplate
.
get
().
getCellTemplateId
());
...
...
@@ -315,6 +311,77 @@ public class ReportGeneratorImpl {
periodCellDataMapper
.
insertSelective
(
cellData
);
}
}
if
(
isMergeMunual
)
{
List
<
PeriodCellTemplateConfig
>
keyInCellTemplateConfigs
=
resources
.
getPeriodCellTemplateConfigs
().
stream
()
.
filter
(
a
->
a
.
getReportTemplateId
().
equals
(
templateId
)
&&
a
.
getDataSourceType
().
equals
(
CellDataSourceType
.
KeyIn
.
getCode
()))
.
collect
(
Collectors
.
toList
());
for
(
PeriodCellTemplateConfig
keyInCellTemplateConfig
:
keyInCellTemplateConfigs
)
{
PeriodDataSourceExample
dataSourceExample
=
new
PeriodDataSourceExample
();
dataSourceExample
.
createCriteria
().
andPeriodEqualTo
(
period
).
andProjectIdEqualTo
(
projectId
)
.
andCellTemplateIdEqualTo
(
keyInCellTemplateConfig
.
getCellTemplateId
()).
andTypeEqualTo
(
10
);
List
<
PeriodDataSource
>
dataSourceList
=
SpringContextUtil
.
periodDataSourceMapper
.
selectByExample
(
dataSourceExample
);
if
(!
dataSourceList
.
isEmpty
()
&&
dataSourceList
.
size
()
==
1
)
{
PeriodCellDataExample
cellDataExample
=
new
PeriodCellDataExample
();
cellDataExample
.
createCriteria
().
andPeriodEqualTo
(
period
).
andProjectIdEqualTo
(
projectId
)
.
andCellTemplateIdEqualTo
(
keyInCellTemplateConfig
.
getCellTemplateId
());
List
<
PeriodCellData
>
cellDataList
=
periodCellDataMapper
.
selectByExample
(
cellDataExample
);
if
(
cellDataList
.
size
()
==
1
)
{
PeriodCellData
cellData
=
cellDataList
.
get
(
0
);
PeriodDataSource
dataSource
=
dataSourceList
.
get
(
0
);
cellData
.
setData
(
dataSource
.
getAmount
()
+
""
);
if
(
StringUtils
.
isEmpty
(
cellData
.
getFormulaExp
().
trim
()))
cellData
.
setFormulaExp
(
dataSource
.
getAmount
()
+
""
);
PeriodCellDataSource
cellDataSource
=
new
PeriodCellDataSource
();
cellDataSource
.
setId
(
distributedIdService
.
nextId
());
cellDataSource
.
setCellTemplateId
(
keyInCellTemplateConfig
.
getCellTemplateId
());
cellDataSource
.
setCellDataId
(
cellData
.
getId
());
cellDataSource
.
setDataSourceId
(
dataSource
.
getId
());
cellDataSource
.
setCreateTime
(
new
Date
());
cellDataSource
.
setUpdateTime
(
new
Date
());
cellDataSource
.
setPeriod
(
period
);
cellDataSource
.
setProjectId
(
projectId
);
SpringContextUtil
.
periodCellDataSourceMapper
.
insertSelective
(
cellDataSource
);
periodCellDataMapper
.
updateByPrimaryKeySelective
(
cellData
);
}
else
if
(
cellDataList
.
isEmpty
()){
PeriodCellData
cellData
=
new
PeriodCellData
();
Long
cellDataId
=
distributedIdService
.
nextId
();
cellData
.
setId
(
cellDataId
);
cellData
.
setReportId
(
reportId
);
cellData
.
setCellTemplateId
(
keyInCellTemplateConfig
.
getCellTemplateId
());
cellData
.
setCreateBy
(
"Admin"
);
cellData
.
setCreateTime
(
new
Date
());
cellData
.
setUpdateBy
(
"Admin"
);
cellData
.
setUpdateTime
(
new
Date
());
cellData
.
setProjectId
(
projectId
);
cellData
.
setPeriod
(
period
);
PeriodDataSource
dataSource
=
dataSourceList
.
get
(
0
);
cellData
.
setData
(
dataSource
.
getAmount
()
+
""
);
cellData
.
setFormulaExp
(
dataSource
.
getAmount
()
+
""
);
PeriodCellDataSource
cellDataSource
=
new
PeriodCellDataSource
();
cellDataSource
.
setId
(
distributedIdService
.
nextId
());
cellDataSource
.
setCellTemplateId
(
keyInCellTemplateConfig
.
getCellTemplateId
());
cellDataSource
.
setCellDataId
(
cellData
.
getId
());
cellDataSource
.
setDataSourceId
(
dataSource
.
getId
());
cellDataSource
.
setCreateTime
(
new
Date
());
cellDataSource
.
setUpdateTime
(
new
Date
());
cellDataSource
.
setPeriod
(
period
);
cellDataSource
.
setProjectId
(
projectId
);
SpringContextUtil
.
periodCellDataSourceMapper
.
insertSelective
(
cellDataSource
);
periodCellDataMapper
.
insert
(
cellData
);
}
else
{
logger
.
warn
(
"should not be !!!"
);
}
}
}
}
}
}
catch
(
Exception
e
)
{
...
...
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