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 c29d74e4
authored
Jul 07, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-dingwf-0715' into develop
2 parents
786e0b3d
b6579940
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
project-order/src/main/java/com/dituhui/pea/order/dao/EngineerInfoDao.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrganizationServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/dao/EngineerInfoDao.java
View file @
c29d74e
...
...
@@ -14,4 +14,6 @@ public interface EngineerInfoDao extends JpaRepository<EngineerInfoEntity, Integ
List
<
EngineerInfoEntity
>
findByGroupId
(
String
groupId
);
List
<
EngineerInfoEntity
>
findByGroupIdIn
(
List
<
String
>
groupIds
);
List
<
EngineerInfoEntity
>
findByEngineerCodeIn
(
List
<
String
>
engineerCodes
);
}
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrganizationServiceImpl.java
View file @
c29d74e
...
...
@@ -112,18 +112,28 @@ public class OrganizationServiceImpl implements OrganizationService {
@Override
public
Result
<?>
getEngineersByLevel
(
String
levelType
,
String
levelValue
)
{
List
<
EngineerInfoEntity
>
engineers
=
null
;
assert
"group"
.
equals
(
levelType
)
||
"branch"
.
equals
(
levelType
)
||
"cluster"
.
equals
(
levelType
);
if
(
"group"
.
equals
(
levelType
))
{
engineers
=
engineerInfoDao
.
findByGroupId
(
levelType
);
}
else
if
(
"branch"
.
equals
(
levelType
))
{
List
<
String
>
groupIds
=
orgGroupDao
.
findAllByBranchId
(
levelValue
).
stream
()
List
<
String
>
groupIds
=
null
;
assert
"team"
.
equals
(
levelType
)
||
"group"
.
equals
(
levelType
)
||
"branch"
.
equals
(
levelType
)
||
"cluster"
.
equals
(
levelType
);
switch
(
levelType
)
{
case
"team"
:
List
<
String
>
engineerCodes
=
orgTeamEngineerDao
.
findAllByTeamId
(
levelValue
).
stream
()
.
map
(
OrgTeamEngineerEntity:
:
getEngineerCode
).
collect
(
Collectors
.
toList
());
engineers
=
engineerInfoDao
.
findByEngineerCodeIn
(
engineerCodes
);
break
;
case
"group"
:
engineers
=
engineerInfoDao
.
findByGroupId
(
levelValue
);
break
;
case
"branch"
:
groupIds
=
orgGroupDao
.
findAllByBranchId
(
levelValue
).
stream
()
.
map
(
OrgGroupEntity:
:
getGroupId
).
collect
(
Collectors
.
toList
());
engineers
=
engineerInfoDao
.
findByGroupIdIn
(
groupIds
);
}
else
{
break
;
default
:
// "cluster".equals(levelType)
List
<
String
>
groupIds
=
orgGroupDao
.
findAllByClusterId
(
levelValue
).
stream
()
groupIds
=
orgGroupDao
.
findAllByClusterId
(
levelValue
).
stream
()
.
map
(
OrgGroupEntity:
:
getGroupId
).
collect
(
Collectors
.
toList
());
engineers
=
engineerInfoDao
.
findByGroupIdIn
(
groupIds
);
break
;
}
List
<
OrganizationEngineersDTO
.
Engineer
>
engineers1
=
engineers
.
stream
().
map
(
entity
->
{
return
new
OrganizationEngineersDTO
.
Engineer
()
...
...
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