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 b291733d
authored
Jul 18, 2023
by
wangli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增teamIds筛选
1 parent
11f365bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
project-order/src/main/java/com/dituhui/pea/order/service/impl/DispatchServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/DispatchServiceImpl.java
View file @
b291733
...
@@ -126,20 +126,18 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -126,20 +126,18 @@ public class DispatchServiceImpl implements DispatchService {
public
Result
<?>
getDispatchEngineerOrderList
(
DispatchEngineerOrderListReq
reqDTO
)
throws
BusinessException
{
public
Result
<?>
getDispatchEngineerOrderList
(
DispatchEngineerOrderListReq
reqDTO
)
throws
BusinessException
{
// 派工台技术员预约单列表
// 派工台技术员预约单列表
// 获取技能耗时
HashMap
<
String
,
Integer
>
skillTakeTime
=
this
.
querySkillTakeTime
();
// 获取技能信息
// 获取技能信息
HashMap
<
String
,
SkillInfo
>
skillInfo
=
this
.
querySkillInfo
();
HashMap
<
String
,
SkillInfo
>
skillInfo
=
this
.
querySkillInfo
();
// 获取groupIds
// 获取groupIds
List
<
String
>
groupIds
=
this
.
queryOrgGroup
Ids
(
reqDTO
.
getLevelType
(),
reqDTO
.
getLevelValue
(),
reqDTO
.
getBranchIds
(),
List
<
String
>
teamIds
=
this
.
queryOrgTeam
Ids
(
reqDTO
.
getLevelType
(),
reqDTO
.
getLevelValue
(),
reqDTO
.
getBranchIds
(),
reqDTO
.
getGroupIds
(),
reqDTO
.
getTeamIds
());
reqDTO
.
getGroupIds
(),
reqDTO
.
getTeamIds
());
if
(
group
Ids
.
isEmpty
())
{
if
(
team
Ids
.
isEmpty
())
{
throw
new
BusinessException
(
"大区/分部/小组组织结构配置可能错误或缺失,请联系管理员/研发"
);
throw
new
BusinessException
(
"大区/分部/小组组织结构配置可能错误或缺失,请联系管理员/研发"
);
}
}
// 获取engineer列表
// 获取engineer列表
List
<
EngineerInfo
>
engineers
=
this
.
queryEngineers
(
group
Ids
,
reqDTO
.
getEngineerCodes
(),
reqDTO
.
getKey
());
List
<
EngineerInfo
>
engineers
=
this
.
queryEngineers
(
team
Ids
,
reqDTO
.
getEngineerCodes
(),
reqDTO
.
getKey
());
if
(
engineers
.
isEmpty
())
{
if
(
engineers
.
isEmpty
())
{
// 该group下没有技术员,返回空
// 该group下没有技术员,返回空
DispatchEngineerOrderListResp
res
=
new
DispatchEngineerOrderListResp
();
DispatchEngineerOrderListResp
res
=
new
DispatchEngineerOrderListResp
();
...
@@ -398,13 +396,16 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -398,13 +396,16 @@ public class DispatchServiceImpl implements DispatchService {
}
}
private
List
<
EngineerInfo
>
queryEngineers
(
List
<
String
>
group
Ids
,
List
<
String
>
engineerCodes
,
String
key
)
{
private
List
<
EngineerInfo
>
queryEngineers
(
List
<
String
>
team
Ids
,
List
<
String
>
engineerCodes
,
String
key
)
{
// 通过groupIds获取技术员列表
// 通过groupIds获取技术员列表
LambdaQueryWrapper
<
EngineerInfo
>
lqw
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
EngineerInfo
>
lqw
=
new
LambdaQueryWrapper
<>();
lqw
.
in
(
EngineerInfo:
:
getGroupId
,
groupIds
);
lqw
.
eq
(
EngineerInfo:
:
getBeanStatus
,
1
);
lqw
.
eq
(
EngineerInfo:
:
getBeanStatus
,
1
);
lqw
.
in
(
ListUtils
.
isNotEmpty
(
engineerCodes
),
EngineerInfo:
:
getEngineerCode
,
engineerCodes
);
lqw
.
in
(
ListUtils
.
isNotEmpty
(
engineerCodes
),
EngineerInfo:
:
getEngineerCode
,
engineerCodes
);
String
inTeamIds
=
teamIds
.
stream
().
map
(
Object:
:
toString
).
collect
(
Collectors
.
joining
(
","
));
String
sql
=
String
.
format
(
"select 1 from org_team_engineer ot where ot.engineer_code = engineer_info.engineer_code and ot.team_id in (%s)"
,
inTeamIds
);
lqw
.
exists
(
sql
);
if
(
StringUtils
.
isNotEmpty
(
key
))
{
if
(
StringUtils
.
isNotEmpty
(
key
))
{
lqw
.
and
(
w
->
lqw
.
and
(
w
->
w
.
like
(
EngineerInfo:
:
getPhone
,
key
)
w
.
like
(
EngineerInfo:
:
getPhone
,
key
)
...
@@ -418,7 +419,7 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -418,7 +419,7 @@ public class DispatchServiceImpl implements DispatchService {
return
engineerInfoMPDao
.
selectList
(
lqw
);
return
engineerInfoMPDao
.
selectList
(
lqw
);
}
}
private
List
<
String
>
queryOrg
Group
Ids
(
String
levelType
,
String
levelIds
,
List
<
String
>
branchIds
,
List
<
String
>
groupIds
,
List
<
String
>
teamIds
)
{
private
List
<
String
>
queryOrg
Team
Ids
(
String
levelType
,
String
levelIds
,
List
<
String
>
branchIds
,
List
<
String
>
groupIds
,
List
<
String
>
teamIds
)
{
LambdaQueryWrapper
<
OrgTeam
>
lqw
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
OrgTeam
>
lqw
=
new
LambdaQueryWrapper
<>();
lqw
.
eq
(
levelType
.
equals
(
"cluster"
),
OrgTeam:
:
getClusterId
,
levelIds
);
lqw
.
eq
(
levelType
.
equals
(
"cluster"
),
OrgTeam:
:
getClusterId
,
levelIds
);
lqw
.
eq
(
levelType
.
equals
(
"branch"
),
OrgTeam:
:
getBranchId
,
levelIds
);
lqw
.
eq
(
levelType
.
equals
(
"branch"
),
OrgTeam:
:
getBranchId
,
levelIds
);
...
@@ -427,8 +428,8 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -427,8 +428,8 @@ public class DispatchServiceImpl implements DispatchService {
lqw
.
in
(
ListUtils
.
isNotEmpty
(
groupIds
),
OrgTeam:
:
getGroupId
,
groupIds
);
lqw
.
in
(
ListUtils
.
isNotEmpty
(
groupIds
),
OrgTeam:
:
getGroupId
,
groupIds
);
lqw
.
in
(
ListUtils
.
isNotEmpty
(
teamIds
),
OrgTeam:
:
getTeamId
,
teamIds
);
lqw
.
in
(
ListUtils
.
isNotEmpty
(
teamIds
),
OrgTeam:
:
getTeamId
,
teamIds
);
List
<
OrgTeam
>
group
s
=
orgTeamMPDao
.
selectList
(
lqw
);
List
<
OrgTeam
>
team
s
=
orgTeamMPDao
.
selectList
(
lqw
);
return
groups
.
stream
().
map
(
OrgTeam:
:
getGroup
Id
).
collect
(
Collectors
.
toList
());
return
teams
.
stream
().
map
(
OrgTeam:
:
getTeam
Id
).
collect
(
Collectors
.
toList
());
}
}
private
HashMap
<
String
,
Integer
>
querySkillTakeTime
()
{
private
HashMap
<
String
,
Integer
>
querySkillTakeTime
()
{
...
...
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