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 0d7215d7
authored
Jul 12, 2023
by
王力
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_dispatch_filter0711' into 'develop'
Dev dispatch filter0711 See merge request !203
2 parents
5365be9a
6e4b5239
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
21 deletions
project-order/src/main/java/com/dituhui/pea/order/common/ListUtils.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/DispatchServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/EngineerServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/common/ListUtils.java
View file @
0d7215d
...
@@ -6,4 +6,8 @@ public class ListUtils {
...
@@ -6,4 +6,8 @@ public class ListUtils {
public
static
<
T
>
boolean
isNotEmpty
(
List
<
T
>
list
)
{
public
static
<
T
>
boolean
isNotEmpty
(
List
<
T
>
list
)
{
return
list
!=
null
&&
!
list
.
isEmpty
();
return
list
!=
null
&&
!
list
.
isEmpty
();
}
}
public
static
<
T
>
boolean
isEmpty
(
List
<
T
>
list
)
{
return
list
==
null
||
list
.
isEmpty
();
}
}
}
project-order/src/main/java/com/dituhui/pea/order/service/impl/DispatchServiceImpl.java
View file @
0d7215d
...
@@ -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
());
}
}
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/EngineerServiceImpl.java
View file @
0d7215d
...
@@ -155,9 +155,7 @@ public class EngineerServiceImpl implements EngineerService {
...
@@ -155,9 +155,7 @@ public class EngineerServiceImpl implements EngineerService {
Set
<
String
>
sInput
=
new
HashSet
<>(
skillGroupIds
);
Set
<
String
>
sInput
=
new
HashSet
<>(
skillGroupIds
);
Set
<
String
>
sDB
=
new
HashSet
<>(
engineerSkills
.
getOrDefault
(
engineerCode
,
new
ArrayList
<>()));
Set
<
String
>
sDB
=
new
HashSet
<>(
engineerSkills
.
getOrDefault
(
engineerCode
,
new
ArrayList
<>()));
log
.
info
(
"before sInput:{}, sDB:{}"
,
sInput
,
sDB
);
sInput
.
removeAll
(
sDB
);
sInput
.
removeAll
(
sDB
);
log
.
info
(
"after sInput:{}"
,
sInput
);
for
(
String
skillGroupId
:
sInput
)
{
for
(
String
skillGroupId
:
sInput
)
{
EngineerSkillGroup
e
=
new
EngineerSkillGroup
();
EngineerSkillGroup
e
=
new
EngineerSkillGroup
();
e
.
setEngineerCode
(
engineerCode
);
e
.
setEngineerCode
(
engineerCode
);
...
...
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