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 6ce8c504
authored
Jul 25, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
根据工单的服务状态,选择使用计划时间或者实际时间
1 parent
2082a728
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
12 deletions
project-order/src/main/java/com/dituhui/pea/order/service/impl/EngineerGanttServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/EngineerGanttServiceImpl.java
View file @
6ce8c50
...
...
@@ -24,10 +24,8 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
@Autowired
private
CapacityEngineerStatDao
capacityEngineerStatDao
;
@Autowired
private
EngineerInfoDao
engineerInfoDao
;
@Autowired
private
EngineerUtils
engineerUtils
;
@Autowired
...
...
@@ -38,9 +36,11 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
private
String
getHourMinute
(
LocalDateTime
time
){
return
this
.
getHourMinute
(
time
,
0
);
}
private
String
getHourMinute
(
LocalDateTime
time
,
int
deltaMinute
){
return
DateUtils
.
formatDateTime
(
time
.
plusMinutes
(
deltaMinute
),
"HH:mm"
);
}
@Override
public
Result
<?>
getEngineersGanttList
(
EngineersGanttDTO
.
Request
reqDTO
)
{
// 按日期返回技术员们当天的服务甘特图,不需要翻页
...
...
@@ -59,8 +59,13 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
EngineersGanttDTO
.
Slot
slot
=
new
EngineersGanttDTO
.
Slot
();
// todo 需要根据订单时间和状态,采用expectXXXX或者actualXXXX
slot
.
setOrderId
(
e
.
getOrderId
());
slot
.
setBtime
(
getHourMinute
(
e
.
getPlanStartTime
()));
slot
.
setEtime
(
getHourMinute
(
e
.
getPlanEndTime
()));
if
(
checkOrderIsFinish
(
e
.
getServiceStatus
()))
{
slot
.
setBtime
(
getHourMinute
(
e
.
getActualStartTime
()));
slot
.
setEtime
(
getHourMinute
(
e
.
getActualEndTime
()));
}
else
{
slot
.
setBtime
(
getHourMinute
(
e
.
getPlanStartTime
()));
slot
.
setEtime
(
getHourMinute
(
e
.
getPlanEndTime
()));
}
slot
.
setTooltip
(
getOrderTips
(
e
.
getOrderId
()));
OrderSkillProjection
orderSkill
=
orderInfoDao
.
getOrderSkillCaptionByOrderId
(
e
.
getOrderId
());
if
(
orderSkill
!=
null
)
{
...
...
@@ -78,8 +83,13 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
if
(
e
.
getArriveElapsed
()
>
0
)
{
// 有在途,起止时间,分别是订单的开始时间减去在途时间、订单的开始时间
slot
=
new
EngineersGanttDTO
.
Slot
();
slot
.
setBtime
(
getHourMinute
(
e
.
getPlanStartTime
(),
-
e
.
getArriveElapsed
()));
slot
.
setEtime
(
getHourMinute
(
e
.
getPlanStartTime
()));
if
(
checkOrderIsFinish
(
e
.
getServiceStatus
()))
{
slot
.
setBtime
(
getHourMinute
(
e
.
getActualStartTime
(),
-
e
.
getArriveElapsed
()));
slot
.
setEtime
(
getHourMinute
(
e
.
getActualStartTime
()));
}
else
{
slot
.
setBtime
(
getHourMinute
(
e
.
getPlanStartTime
(),
-
e
.
getArriveElapsed
()));
slot
.
setEtime
(
getHourMinute
(
e
.
getPlanStartTime
()));
}
slot
.
setShapeSize
(
"mini"
);
slot
.
setBgColor
(
getColor
(
"ONWAY"
));
slots
.
add
(
slot
);
...
...
@@ -150,12 +160,6 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
}
}
public
Map
<
String
,
OrderInfoEntity
>
getOrdersByOrderIds
(
List
<
String
>
orderIds
)
{
List
<
OrderInfoEntity
>
orders
=
orderInfoDao
.
findAllByOrderIdIn
(
orderIds
);
return
orders
.
stream
().
collect
(
Collectors
.
toMap
(
OrderInfoEntity:
:
getOrderId
,
order
->
order
));
}
private
List
<
LabelValueDTO
>
getOrderTips
(
String
orderId
)
{
// log.info("==> getOrderTips: orderId[{}]", orderId);
OrderInfoEntity
order
=
orderInfoDao
.
getByOrderId
(
orderId
);
...
...
@@ -174,6 +178,10 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
return
tips
;
}
private
boolean
checkOrderIsFinish
(
String
serviceStatus
){
String
[]
array
=
{
"FINISHED"
,
"UNFINISHED"
};
return
Arrays
.
asList
(
array
).
contains
(
serviceStatus
);
}
private
String
getColor
(
String
colorType
){
String
[][]
bgColor
=
{
...
...
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