Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a85b65a7
authored
Jul 13, 2023
by
chamberone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 序列化问题修复
1 parent
ca625cb2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
21 deletions
project-interface/src/main/java/com/dituhui/pea/pojo/OrganizationDTO.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrganizationServiceImpl.java
project-interface/src/main/java/com/dituhui/pea/pojo/OrganizationDTO.java
View file @
a85b65a
...
...
@@ -18,14 +18,4 @@ public class OrganizationDTO {
*/
private
String
type
;
// 添加默认构造方法,否则反序列化会报错
public
OrganizationDTO
()
{
super
();
}
public
OrganizationDTO
(
String
id
,
String
name
,
String
type
)
{
this
.
id
=
id
;
this
.
name
=
name
;
this
.
type
=
type
;
}
}
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrganizationServiceImpl.java
View file @
a85b65a
...
...
@@ -178,32 +178,51 @@ public class OrganizationServiceImpl implements OrganizationService {
case
cluster:
List
<
OrgClusterEntity
>
clusters
=
orgClusterDao
.
findByClusterIdIn
(
organizationIds
);
if
(
CollectionUtils
.
isNotEmpty
(
clusters
))
{
return
clusters
.
stream
().
map
(
c
->
new
OrganizationDTO
(
c
.
getClusterId
(),
c
.
getName
(),
OrganizationType
.
cluster
.
getValue
()))
.
collect
(
Collectors
.
toList
());
return
clusters
.
stream
().
map
(
c
->
{
OrganizationDTO
organizationDTO
=
new
OrganizationDTO
();
organizationDTO
.
setId
(
c
.
getClusterId
());
organizationDTO
.
setName
(
c
.
getName
());
organizationDTO
.
setType
(
OrganizationType
.
cluster
.
getValue
());
return
organizationDTO
;
}).
collect
(
Collectors
.
toList
());
}
break
;
case
branch:
List
<
OrgBranchEntity
>
branchs
=
orgBranchDao
.
findByBranchIdIn
(
organizationIds
);
if
(
CollectionUtils
.
isNotEmpty
(
branchs
))
{
return
branchs
.
stream
().
map
(
c
->
new
OrganizationDTO
(
c
.
getBranchId
(),
c
.
getBranchName
(),
OrganizationType
.
branch
.
getValue
())).
collect
(
Collectors
.
toList
());
return
branchs
.
stream
().
map
(
c
->
{
OrganizationDTO
organizationDTO
=
new
OrganizationDTO
();
organizationDTO
.
setId
(
c
.
getBranchId
());
organizationDTO
.
setName
(
c
.
getBranchName
());
organizationDTO
.
setType
(
OrganizationType
.
branch
.
getValue
());
return
organizationDTO
;
}
).
collect
(
Collectors
.
toList
());
}
break
;
case
group:
List
<
OrgGroupEntity
>
groups
=
orgGroupDao
.
findByGroupIdIn
(
organizationIds
);
if
(
CollectionUtils
.
isNotEmpty
(
groups
))
{
return
groups
.
stream
().
map
(
c
->
new
OrganizationDTO
(
c
.
getGroupId
(),
c
.
getGroupName
(),
OrganizationType
.
group
.
getValue
()))
.
collect
(
Collectors
.
toList
());
return
groups
.
stream
().
map
(
c
->
{
OrganizationDTO
organizationDTO
=
new
OrganizationDTO
();
organizationDTO
.
setId
(
c
.
getGroupId
());
organizationDTO
.
setName
(
c
.
getGroupName
());
organizationDTO
.
setType
(
OrganizationType
.
group
.
getValue
());
return
organizationDTO
;
}).
collect
(
Collectors
.
toList
());
}
break
;
case
team:
List
<
OrgTeamEntity
>
teams
=
orgTeamDao
.
findByTeamIdIn
(
organizationIds
);
if
(
CollectionUtils
.
isNotEmpty
(
teams
))
{
return
teams
.
stream
()
.
map
(
c
->
new
OrganizationDTO
(
c
.
getTeamId
(),
c
.
getTeamName
(),
OrganizationType
.
team
.
getValue
()))
.
collect
(
Collectors
.
toList
());
return
teams
.
stream
().
map
(
c
->
{
OrganizationDTO
organizationDTO
=
new
OrganizationDTO
();
organizationDTO
.
setId
(
c
.
getTeamId
());
organizationDTO
.
setName
(
c
.
getTeamName
());
organizationDTO
.
setType
(
OrganizationType
.
team
.
getValue
());
return
organizationDTO
;
}).
collect
(
Collectors
.
toList
());
}
break
;
default
:
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment