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 7410c7b5
authored
Oct 18, 2023
by
huangjinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:分单接口筛选未匹配工程师和工作队
1 parent
f146707b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
project-order/src/main/java/com/dituhui/pea/order/service/impl/FendanServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/FendanServiceImpl.java
View file @
7410c7b
...
...
@@ -70,13 +70,22 @@ public class FendanServiceImpl implements FendanService {
}
//5:单个工程师或团队直接返回
List
<
OrgTeamEntity
>
teamList
=
orgTeamDao
.
findByTeamIdIn
(
teamIdList
);
Map
<
String
,
String
>
engineerInfoCodeTeamMapAll
=
teamEngineer
.
stream
().
collect
(
Collectors
.
toMap
(
OrgTeamEngineerEntity:
:
getEngineerCode
,
OrgTeamEngineerEntity:
:
getTeamId
));
//实际符合技能要求的工程师和工作队map
Map
<
String
,
String
>
engineerInfoCodeTeamMap
=
new
HashMap
<>();
Map
<
String
,
String
>
teamMapReality
=
new
HashMap
<>();
List
<
String
>
teamIdListReality
=
new
ArrayList
<>();
//过滤未匹配到技能的团队形成实际分单工程师和团队
for
(
EngineerInfoEntity
engineerInfoEntity
:
engineerInfoList
)
{
engineerInfoEntity
.
setCreateTime
(
null
);
engineerInfoEntity
.
setUpdateTime
(
null
);
engineerInfoCodeTeamMap
.
put
(
engineerInfoEntity
.
getEngineerCode
(),
engineerInfoCodeTeamMapAll
.
get
(
engineerInfoEntity
.
getEngineerCode
()));
teamMapReality
.
put
(
engineerInfoCodeTeamMapAll
.
get
(
engineerInfoEntity
.
getEngineerCode
()),
engineerInfoCodeTeamMapAll
.
get
(
engineerInfoEntity
.
getEngineerCode
()));
teamIdListReality
.
add
(
engineerInfoCodeTeamMapAll
.
get
(
engineerInfoEntity
.
getEngineerCode
()));
}
List
<
OrgTeamEntity
>
teamList
=
orgTeamDao
.
findByTeamIdIn
(
teamIdList
);
Map
<
String
,
String
>
engineerInfoCodeTeamMap
=
teamEngineer
.
stream
().
collect
(
Collectors
.
toMap
(
OrgTeamEngineerEntity:
:
getEngineerCode
,
OrgTeamEngineerEntity:
:
getTeamId
));
Map
<
String
,
OrgTeamEntity
>
teamMap
=
teamList
.
stream
().
collect
(
Collectors
.
toMap
(
OrgTeamEntity:
:
getTeamId
,
e
->
e
));
Map
<
String
,
OrgTeamEntity
>
teamMap
=
teamList
.
stream
().
filter
(
e
->
teamMapReality
.
containsKey
(
e
.
getTeamId
()))
.
collect
(
Collectors
.
toMap
(
OrgTeamEntity:
:
getTeamId
,
e
->
e
));
if
(
engineerInfoList
.
size
()
==
1
||
teamList
.
size
()
==
1
)
{
OrgTeamEntity
orgTeamEntity
=
engineerInfoList
.
size
()
!=
1
?
teamList
.
get
(
0
)
:
teamMap
.
get
(
engineerInfoCodeTeamMap
.
get
(
engineerInfoList
.
get
(
0
).
getEngineerCode
()));
...
...
@@ -87,7 +96,7 @@ public class FendanServiceImpl implements FendanService {
}
//5:所有分站/网点只有同一优先级直接返回
List
<
OrgGroupEntity
>
orgGroupList
=
orgGroupDao
.
findByTeamIdIn
(
teamIdList
);
List
<
OrgGroupEntity
>
orgGroupList
=
orgGroupDao
.
findByTeamIdIn
(
teamIdList
Reality
);
Set
<
Integer
>
categorySet
=
orgGroupList
.
stream
().
map
(
e
->
e
.
getCategory
()).
collect
(
Collectors
.
toSet
());
if
(
categorySet
.
size
()
==
1
)
{
for
(
EngineerInfoEntity
engineerInfoEntity
:
engineerInfoList
)
{
...
...
@@ -100,7 +109,8 @@ public class FendanServiceImpl implements FendanService {
}
//6:如果筛选出多个分站/网点,多级派单顺序的话进行优先级排序
Map
<
String
,
List
<
OrgTeamEngineerEntity
>>
orgTeamEngineerInfoCodeMap
=
teamEngineer
.
stream
().
collect
(
Collectors
.
groupingBy
(
OrgTeamEngineerEntity:
:
getTeamId
));
Map
<
String
,
List
<
OrgTeamEngineerEntity
>>
orgTeamEngineerInfoCodeMap
=
teamEngineer
.
stream
().
filter
(
e
->
engineerInfoCodeTeamMap
.
containsKey
(
e
.
getEngineerCode
())).
collect
(
Collectors
.
groupingBy
(
OrgTeamEngineerEntity:
:
getTeamId
));
Map
<
String
,
List
<
OrgTeamEntity
>>
orgTeamMap
=
teamList
.
stream
().
collect
(
Collectors
.
groupingBy
(
OrgTeamEntity:
:
getGroupId
));
for
(
OrgGroupEntity
orgGroup
:
orgGroupList
)
{
for
(
OrgTeamEntity
orgTeamEntity
:
orgTeamMap
.
get
(
orgGroup
.
getGroupId
()))
{
...
...
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