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 886408fb
authored
Jul 14, 2023
by
王力
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_engineer_work_dynamics' into 'develop'
修改 See merge request !230
2 parents
8efe9de5
9f7a0b17
Show 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 @
886408f
...
@@ -40,6 +40,9 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
...
@@ -40,6 +40,9 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
@Autowired
@Autowired
private
OrgGroupMPDao
orgGroupMPDao
;
private
OrgGroupMPDao
orgGroupMPDao
;
@Autowired
private
OrderEventMPDao
orderEventMPDao
;
@Transactional
@Transactional
@Override
@Override
public
Result
<?>
getEngineerTimelines
(
String
engineerCode
,
String
date
){
public
Result
<?>
getEngineerTimelines
(
String
engineerCode
,
String
date
){
...
@@ -49,16 +52,14 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
...
@@ -49,16 +52,14 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
// 工程師信息
// 工程師信息
EngineerInfo
engineerInfo
=
engineerInfoMPDao
.
getByEngineerCode
(
engineerCode
);
EngineerInfo
engineerInfo
=
engineerInfoMPDao
.
getByEngineerCode
(
engineerCode
);
// 获取工程师已完成的timeline数据
List
<
EngineerTimeline
>
timelines
=
this
.
engineerTimelines
(
engineerCode
,
date
);
// 获取工程师date日的订单数据
// 获取工程师date日的订单数据
List
<
OrderAppointment
>
orders
=
orderAppointmentMPDao
.
selectByEngineerCodeAndDt
(
engineerCode
,
localDate
);
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
);
HashMap
<
String
,
String
>
orderLocations
=
this
.
orderRequestsLocation
(
orderIds
);
// 获取配送站地址
// 获取配送站地址
...
@@ -74,20 +75,19 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
...
@@ -74,20 +75,19 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
return
Result
.
success
(
res
);
return
Result
.
success
(
res
);
}
}
private
List
<
EngineerTimeline
>
engineerTimelines
(
String
engineerCode
,
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
());
LambdaQueryWrapper
<
EngineerTimeline
>
lqw
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
OrderEvent
>
lqw
=
new
LambdaQueryWrapper
<>();
lqw
.
eq
(
EngineerTimeline:
:
getEngineerCode
,
engineerCode
);
lqw
.
in
(
OrderEvent:
:
getOrderId
,
orderIds
);
lqw
.
ge
(
EngineerTimeline
:
:
getHappen
,
date
+
" 00:00:00"
);
lqw
.
ge
(
OrderEvent
:
:
getHappen
,
date
+
" 00:00:00"
);
lqw
.
le
(
EngineerTimeline
:
:
getHappen
,
date
+
" 23:59:59"
);
lqw
.
le
(
OrderEvent
:
:
getHappen
,
date
+
" 23:59:59"
);
lqw
.
in
(
EngineerTimeline
:
:
getEvent
,
events
);
lqw
.
in
(
OrderEvent
:
:
getEvent
,
events
);
return
engineerTimeline
MPDao
.
selectList
(
lqw
);
return
orderEvent
MPDao
.
selectList
(
lqw
);
}
}
private
HashMap
<
String
,
String
>
orderRequestsLocation
(
List
<
String
>
orderIds
)
{
private
HashMap
<
String
,
String
>
orderRequestsLocation
(
List
<
String
>
orderIds
)
{
// 获取客户地址location
// 获取客户地址location
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
LambdaQueryWrapper
<
OrderRequest
>
lqw
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
OrderRequest
>
lqw
=
new
LambdaQueryWrapper
<>();
lqw
.
in
(
OrderRequest:
:
getOrderId
,
orderIds
);
lqw
.
in
(
OrderRequest:
:
getOrderId
,
orderIds
);
...
@@ -123,14 +123,14 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
...
@@ -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
;
int
index
=
1
;
String
order_id
,
title
,
type
,
text
,
location
;
String
order_id
,
title
,
type
,
text
,
location
;
List
<
EnginnerTimelineResp
.
DynamicItem
>
items
=
new
ArrayList
<>();
List
<
EnginnerTimelineResp
.
DynamicItem
>
items
=
new
ArrayList
<>();
Set
<
String
>
s
=
new
HashSet
<>();
Set
<
String
>
s
=
new
HashSet
<>();
for
(
EngineerTimeline
t:
timelines
){
for
(
OrderEvent
t:
timelines
){
EnginnerTimelineResp
.
DynamicItem
item
=
new
EnginnerTimelineResp
.
DynamicItem
();
EnginnerTimelineResp
.
DynamicItem
item
=
new
EnginnerTimelineResp
.
DynamicItem
();
if
(
t
.
getEvent
().
equals
(
"分站取还配件"
))
{
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