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
aaff167f
Commit
aaff167f
authored
Sep 30, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[bugfix] delete bpl template queyr
parent
07016aa9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
22 deletions
+34
-22
TemplateServiceImpl.java
...va/pwc/taxtech/atms/service/impl/TemplateServiceImpl.java
+34
-22
No files found.
atms-api/src/main/java/pwc/taxtech/atms/service/impl/TemplateServiceImpl.java
View file @
aaff167f
...
...
@@ -15,10 +15,22 @@ import pwc.taxtech.atms.dto.OperationResultDto;
import
pwc.taxtech.atms.dto.TemplateDto
;
import
pwc.taxtech.atms.dto.UpateNameParam
;
import
pwc.taxtech.atms.dto.vatdto.TemplateByGroupDto
;
import
pwc.taxtech.atms.entity.*
;
import
pwc.taxtech.atms.entity.CellTemplate
;
import
pwc.taxtech.atms.entity.CellTemplateExample
;
import
pwc.taxtech.atms.entity.Project
;
import
pwc.taxtech.atms.entity.ProjectExample
;
import
pwc.taxtech.atms.entity.Template
;
import
pwc.taxtech.atms.entity.TemplateExample
;
import
pwc.taxtech.atms.entity.TemplateGroup
;
import
pwc.taxtech.atms.entity.TemplateGroupExample
;
import
pwc.taxtech.atms.service.TemplateService
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
static
java
.
util
.
stream
.
Collectors
.
groupingBy
;
...
...
@@ -234,32 +246,32 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
@Override
public
OperationResultDto
<
List
<
TemplateByGroupDto
>>
getByGroupId
(
Long
templateGroupId
,
String
projectId
)
{
OperationResultDto
result
=
new
OperationResultDto
();
Long
bspl
=
getVatTemplateGroup
(
projectId
);
//
Long bspl = getVatTemplateGroup(projectId);
TemplateExample
example
=
new
TemplateExample
();
List
<
Long
>
ids
=
new
ArrayList
<>();
ids
.
add
(
templateGroupId
);
if
(!
bspl
.
equals
(
null
))
{
ids
.
add
(
bspl
);
}
//
if(!bspl.equals(null)) {
//
ids.add(bspl);
//
}
example
.
createCriteria
().
andTemplateGroupIdIn
(
ids
);
example
.
setOrderByClause
(
"order_index"
);
List
<
Template
>
templates
=
templateMapper
.
selectByExample
(
example
);
List
<
TemplateByGroupDto
>
wrappList
=
new
ArrayList
<>();
if
(
bspl
!=
null
)
{
TemplateByGroupDto
bsplGroup
=
new
TemplateByGroupDto
();
bsplGroup
.
setId
(
bspl
);
bsplGroup
.
setName
(
TemplateGroupType
.
FinancialReturn
.
name
());
List
<
TemplateDto
>
templateDtos
=
new
ArrayList
<>();
templates
.
stream
().
filter
(
x
->
x
.
getTemplateGroupId
().
equals
(
bspl
)).
collect
(
Collectors
.
toList
()).
forEach
(
a
->
{
TemplateDto
templateDto
=
new
TemplateDto
();
CommonUtils
.
copyProperties
(
a
,
templateDto
);
templateDtos
.
add
(
templateDto
);
});
bsplGroup
.
setChildren
(
templateDtos
);
bsplGroup
.
setOrderIndex
(
1
);
wrappList
.
add
(
bsplGroup
);
}
//
if (bspl != null) {
//
TemplateByGroupDto bsplGroup = new TemplateByGroupDto();
//
bsplGroup.setId(bspl);
//
bsplGroup.setName(TemplateGroupType.FinancialReturn.name());
//
List<TemplateDto> templateDtos = new ArrayList<>();
//
//
templates.stream().filter(x -> x.getTemplateGroupId().equals(bspl)).collect(Collectors.toList()).forEach(a -> {
//
TemplateDto templateDto = new TemplateDto();
//
CommonUtils.copyProperties(a, templateDto);
//
templateDtos.add(templateDto);
//
});
//
bsplGroup.setChildren(templateDtos);
//
bsplGroup.setOrderIndex(1);
//
wrappList.add(bsplGroup);
//
}
if
(
templateGroupId
!=
null
)
{
TemplateByGroupDto
taxReturnGroup
=
new
TemplateByGroupDto
();
...
...
@@ -276,7 +288,7 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
wrappList
.
add
(
taxReturnGroup
);
}
if
(
bspl
!=
null
||
templateGroupId
!=
null
)
{
if
(
templateGroupId
!=
null
)
{
result
.
setResult
(
true
);
result
.
setData
(
wrappList
);
}
else
{
...
...
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