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 40969116
authored
Jul 18, 2023
by
王力
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_orderlist0717' into 'develop'
Dev orderlist0717 See merge request !253
2 parents
a94dc1ad
b291733d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
13 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/OrderAssignImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/DispatchServiceImpl.java
View file @
4096911
...
@@ -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
()
{
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderAssignImpl.java
View file @
4096911
...
@@ -70,7 +70,7 @@ public class OrderAssignImpl implements OrderAssign {
...
@@ -70,7 +70,7 @@ public class OrderAssignImpl implements OrderAssign {
String
date
=
TimeUtils
.
timestamp2DateTime
(
order
.
getExpectTimeBegin
(),
TimeUtils
.
DATE_GAP_FORMAT
);
String
date
=
TimeUtils
.
timestamp2DateTime
(
order
.
getExpectTimeBegin
(),
TimeUtils
.
DATE_GAP_FORMAT
);
// 获取
group内的小组成
员
// 获取
符合筛选条件的技术
员
List
<
String
>
engineerCodes
=
this
.
searchEngineerCodes
(
order
,
distance
,
key
,
recommend
);
List
<
String
>
engineerCodes
=
this
.
searchEngineerCodes
(
order
,
distance
,
key
,
recommend
);
List
<
EngineerInfo
>
engineers
=
engineerInfoMPDao
.
selectByEngineerCodes
(
engineerCodes
);
List
<
EngineerInfo
>
engineers
=
engineerInfoMPDao
.
selectByEngineerCodes
(
engineerCodes
);
...
@@ -306,13 +306,14 @@ public class OrderAssignImpl implements OrderAssign {
...
@@ -306,13 +306,14 @@ public class OrderAssignImpl implements OrderAssign {
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
}
/*
if (StringUtils.isEmpty(distance)) {
if (StringUtils.isEmpty(distance)) {
return new ArrayList<>(engineerCodes1);
return new ArrayList<>(engineerCodes1);
}
}
//进行距离匹配TODO
//进行距离匹配TODO
*/
return
n
ull
;
return
n
ew
ArrayList
<>(
engineerCodes1
)
;
}
}
private
Set
<
String
>
searchEngineerByRecommend
(
OrderRequest
order
,
String
recommend
)
{
private
Set
<
String
>
searchEngineerByRecommend
(
OrderRequest
order
,
String
recommend
)
{
...
...
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