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 9f7a0b17
authored
Jul 14, 2023
by
wangli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
1 parent
61500134
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 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 @
9f7a0b1
...
...
@@ -40,6 +40,9 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
@Autowired
private
OrgGroupMPDao
orgGroupMPDao
;
@Autowired
private
OrderEventMPDao
orderEventMPDao
;
@Transactional
@Override
public
Result
<?>
getEngineerTimelines
(
String
engineerCode
,
String
date
){
...
...
@@ -49,16 +52,14 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
// 工程師信息
EngineerInfo
engineerInfo
=
engineerInfoMPDao
.
getByEngineerCode
(
engineerCode
);
// 获取工程师已完成的timeline数据
List
<
EngineerTimeline
>
timelines
=
this
.
engineerTimelines
(
engineerCode
,
date
);
// 获取工程师date日的订单数据
List
<
OrderAppointment
>
orders
=
orderAppointmentMPDao
.
selectByEngineerCodeAndDt
(
engineerCode
,
localDate
);
// 获取工程师已完成的timeline数据
List
<
String
>
orderIds
=
orders
.
stream
().
map
(
OrderAppointment:
:
getOrderId
).
collect
(
Collectors
.
toList
());
List
<
OrderEvent
>
timelines
=
this
.
engineerTimelines
(
orderIds
,
date
);
// 获取客户地址
List
<
String
>
orderIds
=
new
ArrayList
<>();
for
(
OrderAppointment
o:
orders
)
{
orderIds
.
add
(
o
.
getOrderId
());
}
HashMap
<
String
,
String
>
orderLocations
=
this
.
orderRequestsLocation
(
orderIds
);
// 获取配送站地址
...
...
@@ -74,20 +75,19 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
return
Result
.
success
(
res
);
}
private
List
<
EngineerTimeline
>
engineerTimelines
(
String
engineerCode
,
String
date
){
private
List
<
OrderEvent
>
engineerTimelines
(
List
<
String
>
orderIds
,
String
date
){
// 获取工程师timeline
List
<
String
>
events
=
Stream
.
of
(
"分站取还配件"
,
"已出发"
,
"加单"
).
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
EngineerTimeline
>
lqw
=
new
LambdaQueryWrapper
<>();
lqw
.
eq
(
EngineerTimeline:
:
getEngineerCode
,
engineerCode
);
lqw
.
ge
(
EngineerTimeline
:
:
getHappen
,
date
+
" 00:00:00"
);
lqw
.
le
(
EngineerTimeline
:
:
getHappen
,
date
+
" 23:59:59"
);
lqw
.
in
(
EngineerTimeline
:
:
getEvent
,
events
);
return
engineerTimeline
MPDao
.
selectList
(
lqw
);
LambdaQueryWrapper
<
OrderEvent
>
lqw
=
new
LambdaQueryWrapper
<>();
lqw
.
in
(
OrderEvent:
:
getOrderId
,
orderIds
);
lqw
.
ge
(
OrderEvent
:
:
getHappen
,
date
+
" 00:00:00"
);
lqw
.
le
(
OrderEvent
:
:
getHappen
,
date
+
" 23:59:59"
);
lqw
.
in
(
OrderEvent
:
:
getEvent
,
events
);
return
orderEvent
MPDao
.
selectList
(
lqw
);
}
private
HashMap
<
String
,
String
>
orderRequestsLocation
(
List
<
String
>
orderIds
)
{
// 获取客户地址location
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
LambdaQueryWrapper
<
OrderRequest
>
lqw
=
new
LambdaQueryWrapper
<>();
lqw
.
in
(
OrderRequest:
:
getOrderId
,
orderIds
);
...
...
@@ -123,14 +123,14 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
}
private
List
<
EnginnerTimelineResp
.
DynamicItem
>
packItems
(
List
<
EngineerTimeline
>
timelines
,
List
<
OrderAppointment
>
orders
,
HashMap
<
String
,
String
>
locations
,
String
warehouseLocation
)
{
private
List
<
EnginnerTimelineResp
.
DynamicItem
>
packItems
(
List
<
OrderEvent
>
timelines
,
List
<
OrderAppointment
>
orders
,
HashMap
<
String
,
String
>
locations
,
String
warehouseLocation
)
{
int
index
=
1
;
String
order_id
,
title
,
type
,
text
,
location
;
List
<
EnginnerTimelineResp
.
DynamicItem
>
items
=
new
ArrayList
<>();
Set
<
String
>
s
=
new
HashSet
<>();
for
(
EngineerTimeline
t:
timelines
){
for
(
OrderEvent
t:
timelines
){
EnginnerTimelineResp
.
DynamicItem
item
=
new
EnginnerTimelineResp
.
DynamicItem
();
if
(
t
.
getEvent
().
equals
(
"分站取还配件"
))
{
...
...
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