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 1bfbff2d
authored
Nov 01, 2023
by
Ren Ping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:排班结果详情修改
1 parent
ec9a22b3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
3 deletions
project-dispatch/src/main/java/com/dituhui/pea/dispatch/service/impl/ExtractServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/dto/ScheduleEngineerOverviewResp.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/ScheduleServiceImpl.java
project-dispatch/src/main/java/com/dituhui/pea/dispatch/service/impl/ExtractServiceImpl.java
View file @
1bfbff2
...
...
@@ -20,7 +20,6 @@ import org.springframework.transaction.annotation.Propagation;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.persistence.EntityManager
;
import
java.sql.SQLException
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
...
...
project-order/src/main/java/com/dituhui/pea/order/dto/ScheduleEngineerOverviewResp.java
View file @
1bfbff2
...
...
@@ -22,12 +22,30 @@ public class ScheduleEngineerOverviewResp {
private
String
skill
;
private
String
orderStatus
;
private
String
orderStatusName
;
/**
* 在途公里数
*/
private
Integer
distance
;
/**
* 上门时间
*/
private
String
arriveTime
;
private
String
timeType
;
/**
* 在途时间段
*/
private
String
expectArriveDuration
;
/**
* 实际到达时间
*/
private
String
arriveDuration
;
/**
* 计划工时
*/
private
String
expectWorkDuration
;
/**
* 工实际工时
*/
private
String
workDuration
;
}
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/ScheduleServiceImpl.java
View file @
1bfbff2
package
com
.
dituhui
.
pea
.
order
.
service
.
impl
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.LocalDateTimeUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.dituhui.pea.common.BusinessException
;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.order.common.DateUtils
;
import
com.dituhui.pea.order.common.ListUtils
;
import
com.dituhui.pea.order.common.TimeUtils
;
import
com.dituhui.pea.order.dao.*
;
...
...
@@ -21,6 +23,7 @@ import org.springframework.stereotype.Service;
import
javax.persistence.criteria.Predicate
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.temporal.ChronoUnit
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -209,8 +212,22 @@ public class ScheduleServiceImpl implements ScheduleService {
item
.
setOrderStatusName
(
""
);
item
.
setDistance
(
o
.
getArriveDistance
());
item
.
setTimeType
(
"auto"
);
item
.
setExpectArriveDuration
(
o
.
getArriveElapsed
()
+
"分钟"
);
item
.
setArriveTime
(
null
);
if
(
Objects
.
nonNull
(
o
.
getArriveElapsed
()))
{
String
btime
=
null
;
String
etime
=
null
;
if
(
checkOrderIsFinish
(
o
.
getServiceStatus
()))
{
btime
=
getHourMinute
(
o
.
getActualStartTime
(),
-
o
.
getArriveElapsed
());
etime
=
getHourMinute
(
o
.
getActualStartTime
());
}
else
{
btime
=
getHourMinute
(
o
.
getPlanStartTime
(),
-
o
.
getArriveElapsed
());
etime
=
getHourMinute
(
o
.
getPlanStartTime
());
}
//在途时间段
item
.
setExpectArriveDuration
(
String
.
format
(
"%s-%s"
,
btime
,
etime
));
}
item
.
setArriveTime
(
DateUtil
.
format
(
o
.
getActualStartTime
(),
"HH:mm"
));
item
.
setArriveDuration
(
null
);
if
(
ObjectUtil
.
isAllNotEmpty
(
o
.
getPlanStartTime
(),
o
.
getPlanEndTime
()))
{
item
.
setExpectWorkDuration
(
LocalDateTimeUtil
.
between
(
o
.
getPlanStartTime
(),
o
.
getPlanEndTime
(),
ChronoUnit
.
MINUTES
)
+
"分钟"
);
}
...
...
@@ -239,6 +256,19 @@ public class ScheduleServiceImpl implements ScheduleService {
return
Result
.
success
(
res
);
}
private
boolean
checkOrderIsFinish
(
String
serviceStatus
)
{
String
[]
array
=
{
"FINISHED"
,
"UNFINISHED"
};
return
Arrays
.
asList
(
array
).
contains
(
serviceStatus
);
}
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"
);
}
public
Page
<
OrgTeamEntity
>
queryOrgTeams
(
long
page
,
long
size
,
String
levelType
,
List
<
String
>
levelIds
)
{
Pageable
pageable
=
PageRequest
.
of
((
int
)
page
,
(
int
)
size
);
...
...
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