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 feed90ad
authored
Nov 14, 2023
by
刘鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 预约单统计接口
1 parent
e24f9c0f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
project-order/src/main/java/com/dituhui/pea/order/service/impl/PeaOuterAPIServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/PeaOuterAPIServiceImpl.java
View file @
feed90a
...
...
@@ -4,6 +4,7 @@ import com.dituhui.pea.common.BusinessException;
import
com.dituhui.pea.enums.StatusCodeEnum
;
import
com.dituhui.pea.order.common.SaasUtils
;
import
com.dituhui.pea.order.common.Stapial4jUtil
;
import
com.dituhui.pea.order.common.jackson.DateTimeUtil
;
import
com.dituhui.pea.order.common.jackson.DateUtil
;
import
com.dituhui.pea.order.dao.EngineerInfoDao
;
import
com.dituhui.pea.order.dao.EngineerSkillGroupDao
;
...
...
@@ -34,6 +35,7 @@ import org.locationtech.spatial4j.shape.Rectangle;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.time.Duration
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
...
...
@@ -226,7 +228,8 @@ public class PeaOuterAPIServiceImpl implements PeaOuterAPIService {
result
.
setEngineerCode
(
engineerCode
);
result
.
setDate
(
DateUtil
.
toDate
(
localDate
));
List
<
OrderInfoEntity
>
finishedOrder
=
orderInfoDao
.
findByServiceStatusAndEngineerCode
(
"INIT"
,
engineerCode
);
// 查询工程师指定日期的工单
List
<
OrderInfoEntity
>
finishedOrder
=
orderInfoDao
.
getEngineerDateOrder
(
engineerCode
,
DateTimeUtil
.
formatDate
(
localDate
));
List
<
OrderDTO
.
AppointmentOrderResult
>
collect
=
Optional
.
ofNullable
(
finishedOrder
).
orElse
(
Collections
.
emptyList
())
.
stream
()
.
map
(
this
::
order2AppointmentOrderResult
)
...
...
@@ -241,11 +244,11 @@ public class PeaOuterAPIServiceImpl implements PeaOuterAPIService {
result
.
setOrderId
(
orderInfo
.
getOrderId
());
result
.
setOrderStatus
(
orderInfo
.
getServiceStatus
());
result
.
setPlanBeginTime
(
DateUtil
.
toDate
(
orderInfo
.
getPlanStartTime
()));
// result.setPlanDistance(
);
result
.
setPlanDistance
(
orderInfo
.
getArriveDistance
()
);
result
.
setPlanDuration
(
orderInfo
.
getTakeTime
()
*
60
);
if
(
Objects
.
nonNull
(
orderInfo
.
getActualStartTime
()))
{
result
.
setActualBeginTime
(
DateUtil
.
toDate
(
orderInfo
.
getActualStartTime
()));
result
.
setActualDuration
(
orderInfo
.
getArriveElapsed
()
*
60
);
result
.
setActualDuration
(
(
int
)
Duration
.
between
(
orderInfo
.
getActualStartTime
(),
orderInfo
.
getActualEndTime
()).
abs
().
toSeconds
()
);
result
.
setActualDistance
(
orderInfo
.
getArriveDistance
());
}
...
...
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