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 5022be8c
authored
Jun 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
8cdcaaa1
6275f5cc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
25 deletions
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderAssignImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderServiceDetailImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/ScheduleServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderAssignImpl.java
View file @
5022be8
...
...
@@ -86,8 +86,8 @@ public class OrderAssignImpl implements OrderAssign {
item
.
setDistanceDesc
(
"15.5公里"
);
item
.
setTimeDesc
(
"520分钟"
);
item
.
setDesc
(
String
.
format
(
"将被插入在第%d单,受此影响原第%d单变化第%d单,第3单将增加5公里路程,比预计晚到30分钟,建议调整;"
,
rr
.
index
+
1
,
rr
.
index
+
1
,
rr
.
index
+
2
));
item
.
setStartTime
(
"08:00"
);
item
.
setEndTime
(
"18:00"
);
item
.
setStartTime
(
String
.
format
(
"%s 08:00:00"
,
date
)
);
item
.
setEndTime
(
String
.
format
(
"%s 18:00:00"
,
date
)
);
item
.
setOrders
(
this
.
packTimelines
(
orderAppointments
,
orderTips
));
items
.
add
(
item
);
...
...
@@ -168,8 +168,8 @@ public class OrderAssignImpl implements OrderAssign {
item
.
setOrderId
(
order
.
getOrderId
());
item
.
setPreStatus
(
order
.
getPreStatus
());
item
.
setAppointmentStatus
(
order
.
getStatus
());
item
.
setStartTime
(
TimeUtils
.
timestamp2DateTime
(
order
.
getExpectStartTime
(),
"HH:mm"
));
item
.
setEndTime
(
TimeUtils
.
timestamp2DateTime
(
order
.
getExpectEndTime
(),
"HH:mm"
));
item
.
setStartTime
(
TimeUtils
.
IsoTimestamp2DateTime
(
order
.
getExpectStartTime
()
));
item
.
setEndTime
(
TimeUtils
.
IsoTimestamp2DateTime
(
order
.
getExpectEndTime
()
));
item
.
setTips
(
orderTips
.
getOrDefault
(
order
.
getOrderId
(),
empty
));
items
.
add
(
item
);
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderServiceDetailImpl.java
View file @
5022be8
...
...
@@ -315,7 +315,7 @@ public class OrderServiceDetailImpl implements OrderServiceDetail {
items
.
add
(
this
.
packOrderItem
(
"服务"
,
order
.
getSkill
()));
items
.
add
(
this
.
packOrderItem
(
"故障描述"
,
order
.
getFaultDescribe
()));
items
.
add
(
this
.
packOrderItem
(
"备注"
,
order
.
getApplyNote
()));
items
.
add
(
this
.
packOrderItem
(
"意向时间"
,
""
));
items
.
add
(
this
.
packOrderItem
(
"意向时间"
,
TimeUtils
.
IsoTimestamp2DateTime
(
order
.
getExpectTimeBegin
())
));
items
.
add
(
this
.
packOrderItem
(
"时间要求"
,
order
.
getExpectTimeDesc
()));
items
.
add
(
this
.
packOrderItem
(
"预约方式"
,
order
.
getSource
()));
return
items
;
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/ScheduleServiceImpl.java
View file @
5022be8
...
...
@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
...
...
@@ -62,11 +63,12 @@ public class ScheduleServiceImpl implements ScheduleService {
List
<
OrderRequest
>
orders
=
this
.
queryOrderRequests
(
t
.
getTeamId
(),
date
);
team
.
setOrder
(
this
.
getTeamOrderSum
(
orders
));
List
<
ScheduleOverviewResp
.
Item
>
children
=
new
ArrayList
<>();
if
(
orders
==
null
||
orders
.
isEmpty
())
{
team
.
setChildren
(
children
);
teams
.
add
(
team
);
continue
;
// 技术员指派单列表
Map
<
String
,
List
<
OrderAppointment
>>
engineerOrders
=
new
HashMap
<>();
if
(
orders
!=
null
&&
!
orders
.
isEmpty
())
{
List
<
String
>
orderRequestIds
=
orders
.
stream
().
map
(
OrderRequest:
:
getOrderId
).
collect
(
Collectors
.
toList
());
List
<
OrderAppointment
>
orderAppointments
=
this
.
queryOrderAppointments
(
orderRequestIds
,
date
);
engineerOrders
=
orderAppointments
.
stream
().
collect
(
Collectors
.
groupingBy
(
OrderAppointment:
:
getEngineerCode
));
}
// 获取team技术员列表
...
...
@@ -76,16 +78,15 @@ public class ScheduleServiceImpl implements ScheduleService {
List
<
EngineerInfo
>
engineerInfoList
=
engineerInfoMPDao
.
selectByGroupId
(
t
.
getGroupId
());
Map
<
String
,
List
<
EngineerInfo
>>
engineers
=
engineerInfoList
.
stream
().
collect
(
Collectors
.
groupingBy
(
EngineerInfo:
:
getEngineerCode
));
// 获取技术员对应的订单
List
<
String
>
orderRequestIds
=
orders
.
stream
().
map
(
OrderRequest:
:
getOrderId
).
collect
(
Collectors
.
toList
());
List
<
OrderAppointment
>
orderAppointments
=
this
.
queryOrderAppointments
(
orderRequestIds
,
date
);
Map
<
String
,
List
<
OrderAppointment
>>
engineerOrders
=
orderAppointments
.
stream
().
collect
(
Collectors
.
groupingBy
(
OrderAppointment:
:
getEngineerCode
));
List
<
ScheduleOverviewResp
.
Item
>
children
=
new
ArrayList
<>();
for
(
Map
.
Entry
<
String
,
List
<
EngineerInfo
>>
entry
:
engineers
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
List
<
OrderAppointment
>>
entry
:
engineerOrders
.
entrySet
())
{
ScheduleOverviewResp
.
Item
child
=
new
ScheduleOverviewResp
.
Item
();
String
engineerCode
=
entry
.
getKey
();
List
<
String
>
orderIds
=
entry
.
getValue
().
stream
().
map
(
OrderAppointment:
:
getOrderId
).
collect
(
Collectors
.
toList
());
EngineerInfo
engineerInfo
=
entry
.
getValue
().
get
(
0
);
List
<
String
>
orderIds
=
engineerOrders
.
getOrDefault
(
engineerCode
,
new
ArrayList
<>()).
stream
().
map
(
OrderAppointment:
:
getOrderId
).
collect
(
Collectors
.
toList
());
List
<
OrderRequest
>
orders2
=
new
ArrayList
<>();
for
(
OrderRequest
o
:
orders
)
{
...
...
@@ -94,20 +95,16 @@ public class ScheduleServiceImpl implements ScheduleService {
}
}
// 设置技术员姓名
List
<
EngineerInfo
>
es
=
engineers
.
get
(
engineerCode
);
if
(
es
==
null
||
es
.
isEmpty
())
{
child
.
setName
(
engineerCode
);
}
else
{
child
.
setName
(
es
.
get
(
0
).
getName
());
}
child
.
setName
(
engineerInfo
.
getName
());
child
.
setValue
(
engineerCode
);
child
.
setLevel
(
"engineer"
);
child
.
setOrder
(
this
.
getTeamOrderSum
(
orders2
));
child
.
setOrderDesc
(
Integer
.
toString
(
orders2
.
size
()));
child
.
setDistanceDesc
(
""
);
children
.
add
(
child
);
}
team
.
setChildren
(
children
);
team
.
setOrderDesc
(
String
.
format
(
"人均:%d"
,
orders
.
size
()
/
teamEngineers
.
size
()));
...
...
@@ -194,8 +191,8 @@ public class ScheduleServiceImpl implements ScheduleService {
ScheduleEngineerOverviewResp
res
=
new
ScheduleEngineerOverviewResp
();
res
.
setTitle
(
String
.
format
(
"%s_%s"
,
groupName
,
engineer
.
getName
()));
res
.
setEngineerCode
(
engineerCode
);
res
.
setStartTime
(
"08:00"
);
// TODO
res
.
setEndTime
(
"18:00"
);
res
.
setStartTime
(
String
.
format
(
"%s 08:00:00"
,
date
)
);
// TODO
res
.
setEndTime
(
String
.
format
(
"%s 18:00:00"
,
date
)
);
res
.
setDynamics
(
dynamics
);
res
.
setOrders
(
timelines
);
res
.
setOrderDetails
(
orders
);
...
...
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