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
7243be85
Commit
7243be85
authored
Sep 30, 2018
by
neo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_oracle' of code.tech.tax.asia.pwcinternal.com:root/atms into neo_jpa_withoutgen
parents
f33200a9
0c150a0e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
26 deletions
+40
-26
TemplateServiceImpl.java
...va/pwc/taxtech/atms/service/impl/TemplateServiceImpl.java
+40
-26
No files found.
atms-api/src/main/java/pwc/taxtech/atms/service/impl/TemplateServiceImpl.java
View file @
7243be85
...
@@ -15,10 +15,22 @@ import pwc.taxtech.atms.dto.OperationResultDto;
...
@@ -15,10 +15,22 @@ import pwc.taxtech.atms.dto.OperationResultDto;
import
pwc.taxtech.atms.dto.TemplateDto
;
import
pwc.taxtech.atms.dto.TemplateDto
;
import
pwc.taxtech.atms.dto.UpateNameParam
;
import
pwc.taxtech.atms.dto.UpateNameParam
;
import
pwc.taxtech.atms.dto.vatdto.TemplateByGroupDto
;
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
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
java.util.stream.Collectors
;
import
static
java
.
util
.
stream
.
Collectors
.
groupingBy
;
import
static
java
.
util
.
stream
.
Collectors
.
groupingBy
;
...
@@ -234,32 +246,32 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
...
@@ -234,32 +246,32 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
@Override
@Override
public
OperationResultDto
<
List
<
TemplateByGroupDto
>>
getByGroupId
(
Long
templateGroupId
,
String
projectId
)
{
public
OperationResultDto
<
List
<
TemplateByGroupDto
>>
getByGroupId
(
Long
templateGroupId
,
String
projectId
)
{
OperationResultDto
result
=
new
OperationResultDto
();
OperationResultDto
result
=
new
OperationResultDto
();
Long
bspl
=
getBSPL
TemplateGroup
(
projectId
);
// Long bspl = getVat
TemplateGroup(projectId);
TemplateExample
example
=
new
TemplateExample
();
TemplateExample
example
=
new
TemplateExample
();
List
<
Long
>
ids
=
new
ArrayList
<>();
List
<
Long
>
ids
=
new
ArrayList
<>();
ids
.
add
(
templateGroupId
);
ids
.
add
(
templateGroupId
);
if
(!
bspl
.
equals
(
null
))
{
//
if(!bspl.equals(null)) {
ids
.
add
(
bspl
);
//
ids.add(bspl);
}
//
}
example
.
createCriteria
().
andTemplateGroupIdIn
(
ids
);
example
.
createCriteria
().
andTemplateGroupIdIn
(
ids
);
example
.
setOrderByClause
(
"
order_index"
);
example
.
setOrderByClause
(
"order_index"
);
List
<
Template
>
templates
=
templateMapper
.
selectByExample
(
example
);
List
<
Template
>
templates
=
templateMapper
.
selectByExample
(
example
);
List
<
TemplateByGroupDto
>
wrappList
=
new
ArrayList
<>();
List
<
TemplateByGroupDto
>
wrappList
=
new
ArrayList
<>();
if
(
bspl
!=
null
)
{
//
if (bspl != null) {
TemplateByGroupDto
bsplGroup
=
new
TemplateByGroupDto
();
//
TemplateByGroupDto bsplGroup = new TemplateByGroupDto();
bsplGroup
.
setId
(
bspl
);
//
bsplGroup.setId(bspl);
bsplGroup
.
setName
(
TemplateGroupType
.
FinancialReturn
.
name
());
//
bsplGroup.setName(TemplateGroupType.FinancialReturn.name());
List
<
TemplateDto
>
templateDtos
=
new
ArrayList
<>();
//
List<TemplateDto> templateDtos = new ArrayList<>();
//
templates
.
stream
().
filter
(
x
->
x
.
getTemplateGroupId
().
equals
(
bspl
)).
collect
(
Collectors
.
toList
()).
forEach
(
a
->
{
//
templates.stream().filter(x -> x.getTemplateGroupId().equals(bspl)).collect(Collectors.toList()).forEach(a -> {
TemplateDto
templateDto
=
new
TemplateDto
();
//
TemplateDto templateDto = new TemplateDto();
CommonUtils
.
copyProperties
(
a
,
templateDto
);
//
CommonUtils.copyProperties(a, templateDto);
templateDtos
.
add
(
templateDto
);
//
templateDtos.add(templateDto);
});
//
});
bsplGroup
.
setChildren
(
templateDtos
);
//
bsplGroup.setChildren(templateDtos);
bsplGroup
.
setOrderIndex
(
1
);
//
bsplGroup.setOrderIndex(1);
wrappList
.
add
(
bsplGroup
);
//
wrappList.add(bsplGroup);
}
//
}
if
(
templateGroupId
!=
null
)
{
if
(
templateGroupId
!=
null
)
{
TemplateByGroupDto
taxReturnGroup
=
new
TemplateByGroupDto
();
TemplateByGroupDto
taxReturnGroup
=
new
TemplateByGroupDto
();
...
@@ -276,7 +288,7 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
...
@@ -276,7 +288,7 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
wrappList
.
add
(
taxReturnGroup
);
wrappList
.
add
(
taxReturnGroup
);
}
}
if
(
bspl
!=
null
||
templateGroupId
!=
null
)
{
if
(
templateGroupId
!=
null
)
{
result
.
setResult
(
true
);
result
.
setResult
(
true
);
result
.
setData
(
wrappList
);
result
.
setData
(
wrappList
);
}
else
{
}
else
{
...
@@ -285,7 +297,7 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
...
@@ -285,7 +297,7 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
return
result
;
return
result
;
}
}
private
Long
get
BSPL
TemplateGroup
(
String
projectId
)
{
private
Long
get
Vat
TemplateGroup
(
String
projectId
)
{
ProjectExample
example
=
new
ProjectExample
();
ProjectExample
example
=
new
ProjectExample
();
example
.
createCriteria
().
andIdEqualTo
(
projectId
);
example
.
createCriteria
().
andIdEqualTo
(
projectId
);
List
<
Project
>
projects
=
projectMapper
.
selectByExample
(
example
);
List
<
Project
>
projects
=
projectMapper
.
selectByExample
(
example
);
...
@@ -295,10 +307,12 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
...
@@ -295,10 +307,12 @@ public class TemplateServiceImpl extends AbstractService implements TemplateServ
}
}
List
<
TemplateGroup
>
allTemplateGroups
=
templateGroupMapper
.
selectByExample
(
new
TemplateGroupExample
());
List
<
TemplateGroup
>
allTemplateGroups
=
templateGroupMapper
.
selectByExample
(
new
TemplateGroupExample
());
Optional
<
TemplateGroup
>
bsplTemplateGroup
=
allTemplateGroups
.
stream
().
filter
(
a
->
a
.
getIndustryIds
().
equals
(
industryId
)
&&
a
.
getGroupType
().
equals
(
TemplateGroupType
.
FinancialReturn
.
getCode
())).
findFirst
();
Optional
<
TemplateGroup
>
bsplTemplateGroup
=
allTemplateGroups
.
stream
().
filter
(
a
->
a
.
getIndustryIds
().
equals
(
industryId
)
&&
a
.
getGroupType
().
equals
(
TemplateGroupType
.
TaxReturn
.
getCode
())).
findFirst
();
if
(!
bsplTemplateGroup
.
isPresent
())
{
if
(!
bsplTemplateGroup
.
isPresent
())
{
bsplTemplateGroup
=
allTemplateGroups
.
stream
().
filter
(
a
->
a
.
getIndustryIds
().
contains
(
industryId
.
get
())
&&
a
.
getGroupType
().
equals
(
TemplateGroupType
.
FinancialReturn
.
getCode
())).
findFirst
();
bsplTemplateGroup
=
allTemplateGroups
.
stream
().
filter
(
a
->
a
.
getIndustryIds
().
contains
(
industryId
.
get
())
&&
a
.
getGroupType
().
equals
(
TemplateGroupType
.
TaxReturn
.
getCode
())).
findFirst
();
}
}
if
(!
bsplTemplateGroup
.
isPresent
())
{
if
(!
bsplTemplateGroup
.
isPresent
())
{
...
...
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