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 bc31c720
authored
Jul 28, 2023
by
chamberone
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://zhangguoping@gitlab.dituhui.com/bsh/project/pr…
…oject.git into develop
2 parents
4a0a8788
0811b007
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
24 deletions
project-order/src/main/java/com/dituhui/pea/order/service/impl/EngineerTimelineServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/EngineerTimelineServiceImpl.java
View file @
bc31c72
...
@@ -21,18 +21,12 @@ import java.util.stream.Stream;
...
@@ -21,18 +21,12 @@ import java.util.stream.Stream;
public
class
EngineerTimelineServiceImpl
implements
EngineerTimelineService
{
public
class
EngineerTimelineServiceImpl
implements
EngineerTimelineService
{
@Autowired
@Autowired
private
EngineerTimelineMPDao
engineerTimelineMPDao
;
private
OrderInfoMPDao
orderInfoMPDao
;
@Autowired
private
OrderAppointmentMPDao
orderAppointmentMPDao
;
@Autowired
@Autowired
private
EngineerInfoMPDao
engineerInfoMPDao
;
private
EngineerInfoMPDao
engineerInfoMPDao
;
@Autowired
@Autowired
private
OrderRequestMPDao
orderRequestMPDao
;
@Autowired
private
WarehouseInfoMPDao
warehouseInfoMPDao
;
private
WarehouseInfoMPDao
warehouseInfoMPDao
;
@Autowired
@Autowired
...
@@ -51,14 +45,14 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
...
@@ -51,14 +45,14 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
EngineerInfo
engineerInfo
=
engineerInfoMPDao
.
getByEngineerCode
(
engineerCode
);
EngineerInfo
engineerInfo
=
engineerInfoMPDao
.
getByEngineerCode
(
engineerCode
);
// 获取工程师date日的订单数据
// 获取工程师date日的订单数据
List
<
Order
Appointment
>
orders
=
orderAppointmentMPDao
.
selectByEngineerCodeAndDt
(
engineerCode
,
localDate
);
List
<
Order
Info
>
orders
=
this
.
selectEngineerOrders
(
engineerCode
,
localDate
);
// 获取工程师已完成的timeline数据
// 获取工程师已完成的timeline数据
List
<
String
>
orderIds
=
orders
.
stream
().
map
(
Order
Appointment
:
:
getOrderId
).
collect
(
Collectors
.
toList
());
List
<
String
>
orderIds
=
orders
.
stream
().
map
(
Order
Info
:
:
getOrderId
).
collect
(
Collectors
.
toList
());
List
<
OrderEvent
>
timelines
=
this
.
engineerTimelines
(
orderIds
,
date
);
List
<
OrderEvent
>
timelines
=
this
.
engineerTimelines
(
orderIds
,
date
);
// 获取客户地址
// 获取客户地址
HashMap
<
String
,
String
>
orderLocations
=
this
.
orderRequestsLocation
(
order
Id
s
);
HashMap
<
String
,
String
>
orderLocations
=
this
.
orderRequestsLocation
(
orders
);
// 获取配送站地址
// 获取配送站地址
String
branchId
=
this
.
getEngineerBranchId
(
engineerCode
);
String
branchId
=
this
.
getEngineerBranchId
(
engineerCode
);
...
@@ -73,6 +67,15 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
...
@@ -73,6 +67,15 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
return
Result
.
success
(
res
);
return
Result
.
success
(
res
);
}
}
private
List
<
OrderInfo
>
selectEngineerOrders
(
String
engineerCode
,
LocalDate
dt
){
LambdaQueryWrapper
<
OrderInfo
>
lqw
=
new
LambdaQueryWrapper
<>();
lqw
.
eq
(
OrderInfo:
:
getDt
,
dt
);
lqw
.
eq
(
OrderInfo:
:
getEngineerCode
,
engineerCode
);
lqw
.
ne
(
OrderInfo:
:
getAppointmentStatus
,
"INIT"
);
lqw
.
ne
(
OrderInfo:
:
getOrderStatus
,
"CANCEL"
);
return
orderInfoMPDao
.
selectList
(
lqw
);
}
private
List
<
OrderEvent
>
engineerTimelines
(
List
<
String
>
orderIds
,
String
date
){
private
List
<
OrderEvent
>
engineerTimelines
(
List
<
String
>
orderIds
,
String
date
){
// 获取工程师timeline
// 获取工程师timeline
List
<
String
>
events
=
Stream
.
of
(
"分站取还配件"
,
"已出发"
,
"加单"
).
collect
(
Collectors
.
toList
());
List
<
String
>
events
=
Stream
.
of
(
"分站取还配件"
,
"已出发"
,
"加单"
).
collect
(
Collectors
.
toList
());
...
@@ -84,13 +87,10 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
...
@@ -84,13 +87,10 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
return
orderEventMPDao
.
selectList
(
lqw
);
return
orderEventMPDao
.
selectList
(
lqw
);
}
}
private
HashMap
<
String
,
String
>
orderRequestsLocation
(
List
<
String
>
orderId
s
)
{
private
HashMap
<
String
,
String
>
orderRequestsLocation
(
List
<
OrderInfo
>
order
s
)
{
// 获取客户地址location
// 获取客户地址location
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
LambdaQueryWrapper
<
OrderRequest
>
lqw
=
new
LambdaQueryWrapper
<>();
for
(
OrderInfo
o:
orders
){
lqw
.
in
(
OrderRequest:
:
getOrderId
,
orderIds
);
List
<
OrderRequest
>
orders
=
orderRequestMPDao
.
selectList
(
lqw
);
for
(
OrderRequest
o:
orders
){
map
.
put
(
o
.
getOrderId
(),
String
.
format
(
"%s,%s"
,
o
.
getX
(),
o
.
getY
()));
map
.
put
(
o
.
getOrderId
(),
String
.
format
(
"%s,%s"
,
o
.
getX
(),
o
.
getY
()));
}
}
return
map
;
return
map
;
...
@@ -122,7 +122,7 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
...
@@ -122,7 +122,7 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
}
}
private
List
<
EngineerTimelineResp
.
DynamicItem
>
packItems
(
List
<
OrderEvent
>
timelines
,
List
<
Order
Appointment
>
orders
,
HashMap
<
String
,
String
>
locations
,
String
warehouseLocation
)
{
private
List
<
EngineerTimelineResp
.
DynamicItem
>
packItems
(
List
<
OrderEvent
>
timelines
,
List
<
Order
Info
>
orders
,
HashMap
<
String
,
String
>
locations
,
String
warehouseLocation
)
{
int
index
=
0
;
int
index
=
0
;
String
order_id
,
title
,
type
,
text
,
location
;
String
order_id
,
title
,
type
,
text
,
location
;
...
@@ -143,11 +143,7 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
...
@@ -143,11 +143,7 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
type
=
"other"
;
type
=
"other"
;
location
=
locations
.
get
(
t
.
getOrderId
());
location
=
locations
.
get
(
t
.
getOrderId
());
}
else
{
}
else
{
index
+=
1
;
continue
;
title
=
String
.
format
(
"第%d单出发"
,
index
);
text
=
String
.
format
(
"%d"
,
index
);
type
=
"order"
;
location
=
locations
.
get
(
t
.
getOrderId
());
}
}
item
.
setTitle
(
title
);
item
.
setTitle
(
title
);
item
.
setTime
(
TimeUtils
.
IsoTimestamp2DateTime
(
t
.
getHappen
()));
item
.
setTime
(
TimeUtils
.
IsoTimestamp2DateTime
(
t
.
getHappen
()));
...
@@ -161,15 +157,16 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
...
@@ -161,15 +157,16 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
s
.
add
(
t
.
getOrderId
()
+
t
.
getSuborderId
());
s
.
add
(
t
.
getOrderId
()
+
t
.
getSuborderId
());
}
}
for
(
OrderAppointment
o:
orders
){
List
<
OrderInfo
>
records
=
orders
.
stream
().
sorted
(
Comparator
.
comparing
(
OrderInfo:
:
getPlanStartTime
)).
collect
(
Collectors
.
toList
());
order_id
=
o
.
getOrderId
()
+
o
.
getSuborderId
();
for
(
OrderInfo
o:
records
){
order_id
=
o
.
getOrderId
()
+
o
.
getSubId
();
if
(
s
.
contains
(
order_id
))
{
if
(
s
.
contains
(
order_id
))
{
continue
;
continue
;
}
}
index
+=
1
;
index
+=
1
;
EngineerTimelineResp
.
DynamicItem
item
=
new
EngineerTimelineResp
.
DynamicItem
();
EngineerTimelineResp
.
DynamicItem
item
=
new
EngineerTimelineResp
.
DynamicItem
();
item
.
setTitle
(
String
.
format
(
"第%d单出发"
,
index
));
item
.
setTitle
(
String
.
format
(
"第%d单出发"
,
index
));
item
.
setTime
(
TimeUtils
.
IsoTimestamp2DateTime
(
o
.
get
Expect
StartTime
()));
item
.
setTime
(
TimeUtils
.
IsoTimestamp2DateTime
(
o
.
get
Plan
StartTime
()));
item
.
setStatus
(
0
);
item
.
setStatus
(
0
);
item
.
setText
(
String
.
format
(
"%d"
,
index
));
item
.
setText
(
String
.
format
(
"%d"
,
index
));
item
.
setLocation
(
locations
.
get
(
o
.
getOrderId
()));
item
.
setLocation
(
locations
.
get
(
o
.
getOrderId
()));
...
...
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