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 6e4b5239
authored
Jul 12, 2023
by
wangli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
1 parent
c3888f0c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
19 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 @
6e4b523
...
@@ -46,12 +46,11 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -46,12 +46,11 @@ public class DispatchServiceImpl implements DispatchService {
private
EngineerInfoMPDao
engineerInfoMPDao
;
private
EngineerInfoMPDao
engineerInfoMPDao
;
@Autowired
@Autowired
private
ProductCategoryMPDao
productCategory
MPDao
;
private
SkillInfoMPDao
skillInfo
MPDao
;
@Autowired
@Autowired
private
CapacityEngineerStatMPDao
capacityEngineerStatMPDao
;
private
CapacityEngineerStatMPDao
capacityEngineerStatMPDao
;
@Transactional
@Transactional
@Override
@Override
public
Result
<?>
getDispatchOrderList
(
DispatchOrderListReq
reqDTO
)
{
public
Result
<?>
getDispatchOrderList
(
DispatchOrderListReq
reqDTO
)
{
...
@@ -140,8 +139,11 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -140,8 +139,11 @@ public class DispatchServiceImpl implements DispatchService {
}
}
// 获取服务单/工单列表
// 获取服务单/工单列表
Map
<
String
,
List
<
OrderRequest
>>
orders
=
this
.
queryOrderRequestByOrderIds
(
new
ArrayList
<>(
orderIds
)).
stream
().
collect
(
Map
<
String
,
List
<
OrderRequest
>>
orders
=
new
HashMap
<>();
if
(!
orderIds
.
isEmpty
())
{
orders
=
orderRequestMPDao
.
selectByOrderIds
(
new
ArrayList
<>(
orderIds
)).
stream
().
collect
(
Collectors
.
groupingBy
(
OrderRequest:
:
getOrderId
));
Collectors
.
groupingBy
(
OrderRequest:
:
getOrderId
));
}
// 获取技术员已指派单列表
// 获取技术员已指派单列表
List
<
DispatchEngineerOrderListResp
.
EngineerInfo
>
egs
=
new
ArrayList
<>();
List
<
DispatchEngineerOrderListResp
.
EngineerInfo
>
egs
=
new
ArrayList
<>();
...
@@ -152,12 +154,14 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -152,12 +154,14 @@ public class DispatchServiceImpl implements DispatchService {
// 技术员已指派的订单列表
// 技术员已指派的订单列表
List
<
OrderAppointment
>
records
=
engineerOrders
.
getOrDefault
(
e
.
getEngineerCode
(),
new
ArrayList
<>());
List
<
OrderAppointment
>
records
=
engineerOrders
.
getOrDefault
(
e
.
getEngineerCode
(),
new
ArrayList
<>());
for
(
OrderAppointment
r
:
records
)
{
for
(
OrderAppointment
r
:
records
)
{
DispatchEngineerOrderListResp
.
OrderInfo
item
=
new
DispatchEngineerOrderListResp
.
OrderInfo
();
// 获取对应的工单信息
// 获取对应的工单信息
if
(
ListUtils
.
isEmpty
(
orders
.
get
(
r
.
getOrderId
()))){
continue
;
}
OrderRequest
o
=
orders
.
get
(
r
.
getOrderId
()).
get
(
0
);
OrderRequest
o
=
orders
.
get
(
r
.
getOrderId
()).
get
(
0
);
DispatchEngineerOrderListResp
.
OrderInfo
item
=
new
DispatchEngineerOrderListResp
.
OrderInfo
();
item
.
setOrderId
(
r
.
getOrderId
());
item
.
setOrderId
(
r
.
getOrderId
());
item
.
setCategory
(
String
.
format
(
"%s-%s"
,
o
.
getType
(),
o
.
getBrand
()));
item
.
setCategory
(
String
.
format
(
"%s-%s"
,
o
.
getType
(),
o
.
getBrand
()));
item
.
setSkill
(
o
.
getSkill
());
item
.
setSkill
(
o
.
getSkill
());
...
@@ -217,7 +221,7 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -217,7 +221,7 @@ public class DispatchServiceImpl implements DispatchService {
throw
new
BusinessException
(
"技术员不存在"
);
throw
new
BusinessException
(
"技术员不存在"
);
}
}
List
<
OrderRequest
>
orders
=
this
.
queryOrderReques
tByOrderIds
(
orderIds
);
List
<
OrderRequest
>
orders
=
orderRequestMPDao
.
selec
tByOrderIds
(
orderIds
);
if
(
orders
.
isEmpty
())
{
if
(
orders
.
isEmpty
())
{
throw
new
BusinessException
(
"订单号错误"
);
throw
new
BusinessException
(
"订单号错误"
);
}
}
...
@@ -297,16 +301,6 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -297,16 +301,6 @@ public class DispatchServiceImpl implements DispatchService {
return
orderRequestMPDao
.
selectList
(
lqw
);
return
orderRequestMPDao
.
selectList
(
lqw
);
}
}
private
List
<
OrderRequest
>
queryOrderRequestByOrderIds
(
List
<
String
>
orderIds
)
{
List
<
OrderRequest
>
orders
=
new
ArrayList
<>();
if
(
orderIds
.
isEmpty
())
{
return
orders
;
}
LambdaQueryWrapper
<
OrderRequest
>
lqw
=
new
LambdaQueryWrapper
<>();
lqw
.
in
(
OrderRequest:
:
getOrderId
,
orderIds
);
return
orderRequestMPDao
.
selectList
(
lqw
);
}
private
Map
<
String
,
List
<
OrderAppointment
>>
queryEngineerOrders
(
List
<
String
>
engineerCodes
,
String
date
)
{
private
Map
<
String
,
List
<
OrderAppointment
>>
queryEngineerOrders
(
List
<
String
>
engineerCodes
,
String
date
)
{
// 获取工程师服务单列表
// 获取工程师服务单列表
...
@@ -360,8 +354,8 @@ public class DispatchServiceImpl implements DispatchService {
...
@@ -360,8 +354,8 @@ public class DispatchServiceImpl implements DispatchService {
private
HashMap
<
String
,
Integer
>
querySkillTakeTime
()
{
private
HashMap
<
String
,
Integer
>
querySkillTakeTime
()
{
HashMap
<
String
,
Integer
>
map
=
new
HashMap
<>();
HashMap
<
String
,
Integer
>
map
=
new
HashMap
<>();
List
<
ProductCategory
>
records
=
productCategory
MPDao
.
selectList
(
null
);
List
<
SkillInfo
>
records
=
skillInfo
MPDao
.
selectList
(
null
);
for
(
ProductCategory
r
:
records
)
{
for
(
SkillInfo
r
:
records
)
{
String
key
=
String
.
format
(
"%s%s%sd"
,
r
.
getBrand
(),
r
.
getType
(),
r
.
getSkill
());
String
key
=
String
.
format
(
"%s%s%sd"
,
r
.
getBrand
(),
r
.
getType
(),
r
.
getSkill
());
map
.
put
(
key
,
r
.
getTakeTime
());
map
.
put
(
key
,
r
.
getTakeTime
());
}
}
...
...
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