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 99e21ea6
authored
Nov 22, 2023
by
huangjinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:指派插单公里换成米,订单筛选添加延误,超时
1 parent
e89c42fb
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
128 additions
and
19 deletions
project-interface/src/main/java/com/dituhui/pea/pojo/DistanceDTO.java
project-order/src/main/java/com/dituhui/pea/order/dao/OrderInfoDao.java
project-order/src/main/java/com/dituhui/pea/order/dto/OrderServiceListReq.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderInfoServiceImpl.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/OrderServiceListServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/utils/OrderUtil.java
project-interface/src/main/java/com/dituhui/pea/pojo/DistanceDTO.java
View file @
99e21ea
...
@@ -6,7 +6,7 @@ import lombok.Data;
...
@@ -6,7 +6,7 @@ import lombok.Data;
public
class
DistanceDTO
{
public
class
DistanceDTO
{
/**
/**
* 单位 公里
* 单位 米
*/
*/
float
dis
;
float
dis
;
/**
/**
...
...
project-order/src/main/java/com/dituhui/pea/order/dao/OrderInfoDao.java
View file @
99e21ea
...
@@ -82,27 +82,27 @@ public interface OrderInfoDao extends JpaRepository<OrderInfoEntity, Long>, JpaS
...
@@ -82,27 +82,27 @@ public interface OrderInfoDao extends JpaRepository<OrderInfoEntity, Long>, JpaS
@Query
(
value
=
"SELECT count(*) from order_info WHERE dt =:dt and (service_status ='INIT' or service_status ='CONTACTED') "
+
@Query
(
value
=
"SELECT count(*) from order_info WHERE dt =:dt and (service_status ='INIT' or service_status ='CONTACTED') "
+
"and DATE_
ADD(NOW(), INTERVAL 10 MINUTE) > expect_time_begin
and org_cluster_id = :orgCusterId"
,
nativeQuery
=
true
)
"and DATE_
SUB(NOW(), INTERVAL 10 MINUTE) > plan_start_time
and org_cluster_id = :orgCusterId"
,
nativeQuery
=
true
)
long
countDelayByDtAndOrgClusterId
(
LocalDate
dt
,
String
orgCusterId
);
long
countDelayByDtAndOrgClusterId
(
LocalDate
dt
,
String
orgCusterId
);
@Query
(
value
=
"SELECT count(*) from order_info WHERE dt =:dt and (service_status ='INIT' or service_status ='CONTACTED') "
+
@Query
(
value
=
"SELECT count(*) from order_info WHERE dt =:dt and (service_status ='INIT' or service_status ='CONTACTED') "
+
"and DATE_
ADD(NOW(), INTERVAL 10 MINUTE) > expect_time_begin
and org_group_id = :orgGroupId"
,
nativeQuery
=
true
)
"and DATE_
SUB(NOW(), INTERVAL 10 MINUTE) > plan_start_time
and org_group_id = :orgGroupId"
,
nativeQuery
=
true
)
long
countDelayByDtAndOrgGroupId
(
LocalDate
dt
,
String
orgGroupId
);
long
countDelayByDtAndOrgGroupId
(
LocalDate
dt
,
String
orgGroupId
);
@Query
(
value
=
"SELECT count(*) from order_info WHERE dt =:dt and (service_status ='INIT' or service_status ='CONTACTED') "
+
@Query
(
value
=
"SELECT count(*) from order_info WHERE dt =:dt and (service_status ='INIT' or service_status ='CONTACTED') "
+
"and DATE_
ADD(NOW(), INTERVAL 10 MINUTE) > expect_time_begin
and org_branch_id = :orgBranchId"
,
nativeQuery
=
true
)
"and DATE_
SUB(NOW(), INTERVAL 10 MINUTE) > plan_start_time
and org_branch_id = :orgBranchId"
,
nativeQuery
=
true
)
long
countDelayByDtAndOrgBranchId
(
LocalDate
dt
,
String
orgBranchId
);
long
countDelayByDtAndOrgBranchId
(
LocalDate
dt
,
String
orgBranchId
);
@Query
(
value
=
"SELECT count(*) from order_info WHERE dt =:dt and service_status ='STARTED' and actual_end_time is null "
+
@Query
(
value
=
"SELECT count(*) from order_info WHERE dt =:dt and service_status ='STARTED' and actual_end_time is null "
+
"and DATE_
ADD
(NOW(), INTERVAL 10 MINUTE) > plan_end_time and org_cluster_id = :orgCusterId"
,
nativeQuery
=
true
)
"and DATE_
SUB
(NOW(), INTERVAL 10 MINUTE) > plan_end_time and org_cluster_id = :orgCusterId"
,
nativeQuery
=
true
)
long
countOvertimeByDtAndOrgClusterId
(
LocalDate
dt
,
String
orgCusterId
);
long
countOvertimeByDtAndOrgClusterId
(
LocalDate
dt
,
String
orgCusterId
);
@Query
(
value
=
"SELECT count(*) from order_info WHERE dt =:dt and service_status ='STARTED' and actual_end_time is null "
+
@Query
(
value
=
"SELECT count(*) from order_info WHERE dt =:dt and service_status ='STARTED' and actual_end_time is null "
+
"and DATE_
ADD
(NOW(), INTERVAL 10 MINUTE) > plan_end_time and org_group_id = :orgGroupId"
,
nativeQuery
=
true
)
"and DATE_
SUB
(NOW(), INTERVAL 10 MINUTE) > plan_end_time and org_group_id = :orgGroupId"
,
nativeQuery
=
true
)
long
countOvertimeByDtAndOrgGroupId
(
LocalDate
dt
,
String
orgGroupId
);
long
countOvertimeByDtAndOrgGroupId
(
LocalDate
dt
,
String
orgGroupId
);
@Query
(
value
=
"SELECT count(*) from order_info WHERE dt =:dt and service_status ='STARTED' and actual_end_time is null "
+
@Query
(
value
=
"SELECT count(*) from order_info WHERE dt =:dt and service_status ='STARTED' and actual_end_time is null "
+
"and DATE_
ADD
(NOW(), INTERVAL 10 MINUTE) > plan_end_time and org_branch_id = :orgBranchId"
,
nativeQuery
=
true
)
"and DATE_
SUB
(NOW(), INTERVAL 10 MINUTE) > plan_end_time and org_branch_id = :orgBranchId"
,
nativeQuery
=
true
)
long
countOvertimeByDtAndOrgBranchId
(
LocalDate
dt
,
String
orgBranchId
);
long
countOvertimeByDtAndOrgBranchId
(
LocalDate
dt
,
String
orgBranchId
);
@Query
(
value
=
"from OrderInfoEntity where orderStatus <> 'CANCELED'"
@Query
(
value
=
"from OrderInfoEntity where orderStatus <> 'CANCELED'"
...
...
project-order/src/main/java/com/dituhui/pea/order/dto/OrderServiceListReq.java
View file @
99e21ea
...
@@ -43,4 +43,14 @@ public class OrderServiceListReq {
...
@@ -43,4 +43,14 @@ public class OrderServiceListReq {
* 服务状态
* 服务状态
*/
*/
private
List
<
String
>
serviceStatus
;
private
List
<
String
>
serviceStatus
;
/**
* 1所需工时、2创建时间、3预约单状态、4指派状态、5指派策略、6服务状态 默认2创建时间
*/
private
Integer
orderByField
=
2
;
/**
* 1正序、2倒序 默认2倒序
*/
private
Integer
orderBy
=
2
;
}
}
\ No newline at end of file
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderInfoServiceImpl.java
View file @
99e21ea
...
@@ -566,7 +566,7 @@ public class OrderInfoServiceImpl implements OrderInfoService {
...
@@ -566,7 +566,7 @@ public class OrderInfoServiceImpl implements OrderInfoService {
OrderInfoEntity
nestOrder
=
orderInfoDao
.
getByOrderId
(
nestOrderSegment
.
getOrderId
());
OrderInfoEntity
nestOrder
=
orderInfoDao
.
getByOrderId
(
nestOrderSegment
.
getOrderId
());
nestOrder
.
setArriveElapsed
(
roadTime
);
nestOrder
.
setArriveElapsed
(
roadTime
);
nestOrder
.
setArriveDistance
(
BigDecimal
.
valueOf
(
distanceDTO
.
getDis
()
*
1000
).
intValue
());
nestOrder
.
setArriveDistance
(
BigDecimal
.
valueOf
(
distanceDTO
.
getDis
()).
intValue
());
if
(
orderSegment
.
getStart
().
plusMinutes
(
takeTime
+
roadTime
).
compareTo
(
nestOrder
.
getPlanStartTime
())
>
0
)
{
if
(
orderSegment
.
getStart
().
plusMinutes
(
takeTime
+
roadTime
).
compareTo
(
nestOrder
.
getPlanStartTime
())
>
0
)
{
long
minutes
=
Duration
.
between
(
nestOrder
.
getPlanStartTime
(),
planStartTime
.
plusMinutes
(
skillInfo
.
getTakeTime
()
+
roadTime
)).
toMinutes
();
long
minutes
=
Duration
.
between
(
nestOrder
.
getPlanStartTime
(),
planStartTime
.
plusMinutes
(
skillInfo
.
getTakeTime
()
+
roadTime
)).
toMinutes
();
nestOrder
.
setPlanStartTime
(
nestOrder
.
getPlanStartTime
().
plusMinutes
(
minutes
));
nestOrder
.
setPlanStartTime
(
nestOrder
.
getPlanStartTime
().
plusMinutes
(
minutes
));
...
@@ -592,12 +592,12 @@ public class OrderInfoServiceImpl implements OrderInfoService {
...
@@ -592,12 +592,12 @@ public class OrderInfoServiceImpl implements OrderInfoService {
insertOrder
.
setPlanStartTime
(
planStartTime
);
insertOrder
.
setPlanStartTime
(
planStartTime
);
insertOrder
.
setPlanEndTime
(
planStartTime
.
plusMinutes
(
skillInfo
.
getTakeTime
()));
insertOrder
.
setPlanEndTime
(
planStartTime
.
plusMinutes
(
skillInfo
.
getTakeTime
()));
insertOrder
.
setArriveElapsed
(
roadTime
);
insertOrder
.
setArriveElapsed
(
roadTime
);
insertOrder
.
setArriveDistance
(
BigDecimal
.
valueOf
(
distanceDTO
.
getDis
()
*
1000
).
intValue
());
insertOrder
.
setArriveDistance
(
BigDecimal
.
valueOf
(
distanceDTO
.
getDis
()).
intValue
());
return
Result
.
success
(
insertOrder
);
return
Result
.
success
(
insertOrder
);
}
}
OrderInfoEntity
nestOrder
=
orderInfoDao
.
getByOrderId
(
nestOrderSegment
.
getOrderId
());
OrderInfoEntity
nestOrder
=
orderInfoDao
.
getByOrderId
(
nestOrderSegment
.
getOrderId
());
nestOrder
.
setArriveElapsed
(
roadTime
);
nestOrder
.
setArriveElapsed
(
roadTime
);
nestOrder
.
setArriveDistance
(
BigDecimal
.
valueOf
(
distanceDTO
.
getDis
()
*
1000
).
intValue
());
nestOrder
.
setArriveDistance
(
BigDecimal
.
valueOf
(
distanceDTO
.
getDis
()).
intValue
());
orderInfoDao
.
save
(
nestOrder
);
orderInfoDao
.
save
(
nestOrder
);
continue
;
continue
;
}
}
...
@@ -611,12 +611,12 @@ public class OrderInfoServiceImpl implements OrderInfoService {
...
@@ -611,12 +611,12 @@ public class OrderInfoServiceImpl implements OrderInfoService {
log
.
info
(
"【getRoadDistancePrev】结果------------->{}"
,
JsonUtil
.
toJson
(
roadResultPrev
));
log
.
info
(
"【getRoadDistancePrev】结果------------->{}"
,
JsonUtil
.
toJson
(
roadResultPrev
));
int
roadTimePrev
=
BigDecimal
.
valueOf
(
roadResultPrev
.
getResult
().
getTime
()).
divide
(
BigDecimal
.
valueOf
(
60
),
0
,
RoundingMode
.
HALF_UP
).
intValue
();
int
roadTimePrev
=
BigDecimal
.
valueOf
(
roadResultPrev
.
getResult
().
getTime
()).
divide
(
BigDecimal
.
valueOf
(
60
),
0
,
RoundingMode
.
HALF_UP
).
intValue
();
insertOrder
.
setArriveElapsed
(
roadTimePrev
);
insertOrder
.
setArriveElapsed
(
roadTimePrev
);
insertOrder
.
setArriveDistance
(
BigDecimal
.
valueOf
(
roadResultPrev
.
getResult
().
getDis
()
*
1000
).
intValue
());
insertOrder
.
setArriveDistance
(
BigDecimal
.
valueOf
(
roadResultPrev
.
getResult
().
getDis
()).
intValue
());
}
}
OrderInfoEntity
nestOrder
=
orderInfoDao
.
getByOrderId
(
orderSegment
.
getOrderId
());
OrderInfoEntity
nestOrder
=
orderInfoDao
.
getByOrderId
(
orderSegment
.
getOrderId
());
nestOrder
.
setArriveElapsed
(
roadTime
);
nestOrder
.
setArriveElapsed
(
roadTime
);
nestOrder
.
setArriveDistance
(
BigDecimal
.
valueOf
(
distanceDTO
.
getDis
()
*
1000
).
intValue
());
nestOrder
.
setArriveDistance
(
BigDecimal
.
valueOf
(
distanceDTO
.
getDis
()).
intValue
());
long
minutes
=
Duration
.
between
(
nestOrder
.
getPlanStartTime
(),
planStartTime
.
plusMinutes
(
skillInfo
.
getTakeTime
()
+
roadTime
)).
toMinutes
();
long
minutes
=
Duration
.
between
(
nestOrder
.
getPlanStartTime
(),
planStartTime
.
plusMinutes
(
skillInfo
.
getTakeTime
()
+
roadTime
)).
toMinutes
();
nestOrder
.
setPlanStartTime
(
nestOrder
.
getPlanStartTime
().
plusMinutes
(
minutes
));
nestOrder
.
setPlanStartTime
(
nestOrder
.
getPlanStartTime
().
plusMinutes
(
minutes
));
nestOrder
.
setPlanEndTime
(
nestOrder
.
getPlanEndTime
().
plusMinutes
(
minutes
));
nestOrder
.
setPlanEndTime
(
nestOrder
.
getPlanEndTime
().
plusMinutes
(
minutes
));
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderServiceDetailImpl.java
View file @
99e21ea
...
@@ -21,6 +21,7 @@ import com.dituhui.pea.order.entity.OrderInfoEntity;
...
@@ -21,6 +21,7 @@ import com.dituhui.pea.order.entity.OrderInfoEntity;
import
com.dituhui.pea.order.entity.OrgGroupEntity
;
import
com.dituhui.pea.order.entity.OrgGroupEntity
;
import
com.dituhui.pea.order.entity.SkillInfoEntity
;
import
com.dituhui.pea.order.entity.SkillInfoEntity
;
import
com.dituhui.pea.order.service.OrderServiceDetail
;
import
com.dituhui.pea.order.service.OrderServiceDetail
;
import
com.dituhui.pea.order.utils.OrderUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -82,7 +83,7 @@ public class OrderServiceDetailImpl implements OrderServiceDetail {
...
@@ -82,7 +83,7 @@ public class OrderServiceDetailImpl implements OrderServiceDetail {
res
.
setStatus
(
order
.
getOrderStatus
());
res
.
setStatus
(
order
.
getOrderStatus
());
res
.
setAppointmentStatus
(
order
.
getAppointmentStatus
());
res
.
setAppointmentStatus
(
order
.
getAppointmentStatus
());
res
.
setOrderStatus
(
order
.
getOrderStatus
());
res
.
setOrderStatus
(
order
.
getOrderStatus
());
res
.
setServiceStatus
(
order
.
getServiceStatus
(
));
res
.
setServiceStatus
(
OrderUtil
.
handleServiceStatus
(
order
));
res
.
setLocation
(
String
.
format
(
"%s,%s"
,
order
.
getX
(),
order
.
getY
()));
res
.
setLocation
(
String
.
format
(
"%s,%s"
,
order
.
getX
(),
order
.
getY
()));
res
.
setItems
(
items
);
res
.
setItems
(
items
);
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderServiceListServiceImpl.java
View file @
99e21ea
...
@@ -13,13 +13,16 @@ import com.dituhui.pea.order.dto.OrderServiceList;
...
@@ -13,13 +13,16 @@ import com.dituhui.pea.order.dto.OrderServiceList;
import
com.dituhui.pea.order.dto.OrderServiceListReq
;
import
com.dituhui.pea.order.dto.OrderServiceListReq
;
import
com.dituhui.pea.order.dto.OrderServiceListResp
;
import
com.dituhui.pea.order.dto.OrderServiceListResp
;
import
com.dituhui.pea.order.entity.*
;
import
com.dituhui.pea.order.entity.*
;
import
com.dituhui.pea.order.enums.ServiceStatusEnum
;
import
com.dituhui.pea.order.service.OrderServiceListService
;
import
com.dituhui.pea.order.service.OrderServiceListService
;
import
com.dituhui.pea.order.utils.OrderUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -61,7 +64,21 @@ public class OrderServiceListServiceImpl implements OrderServiceListService {
...
@@ -61,7 +64,21 @@ public class OrderServiceListServiceImpl implements OrderServiceListService {
lqw
.
in
(
StringUtils
.
isNotEmpty
(
reqDTO
.
getOrderId
()),
OrderInfo:
:
getOrderId
,
reqDTO
.
getOrderId
().
split
(
","
));
lqw
.
in
(
StringUtils
.
isNotEmpty
(
reqDTO
.
getOrderId
()),
OrderInfo:
:
getOrderId
,
reqDTO
.
getOrderId
().
split
(
","
));
}
}
lqw
.
eq
(
StringUtils
.
isNotEmpty
(
reqDTO
.
getPhone
()),
OrderInfo:
:
getPhone
,
reqDTO
.
getPhone
());
lqw
.
eq
(
StringUtils
.
isNotEmpty
(
reqDTO
.
getPhone
()),
OrderInfo:
:
getPhone
,
reqDTO
.
getPhone
());
lqw
.
in
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getServiceStatus
()),
OrderInfo:
:
getServiceStatus
,
reqDTO
.
getServiceStatus
());
if
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getServiceStatus
()))
{
List
<
String
>
serviceStatus
=
reqDTO
.
getServiceStatus
();
if
(
serviceStatus
.
contains
(
ServiceStatusEnum
.
DELAY
.
getCode
()))
{
serviceStatus
.
add
(
ServiceStatusEnum
.
INIT
.
getCode
());
serviceStatus
.
add
(
ServiceStatusEnum
.
CONTACTED
.
getCode
());
lqw
.
le
(
OrderInfo:
:
getPlanStartTime
,
LocalDateTime
.
now
().
minusMinutes
(
10
));
}
if
(
serviceStatus
.
contains
(
ServiceStatusEnum
.
UNFINISHED
.
getCode
()))
{
serviceStatus
.
add
(
ServiceStatusEnum
.
STARTED
.
getCode
());
lqw
.
isNotNull
(
OrderInfo:
:
getActualEndTime
);
lqw
.
le
(
OrderInfo:
:
getPlanEndTime
,
LocalDateTime
.
now
().
minusMinutes
(
10
));
}
serviceStatus
=
serviceStatus
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
lqw
.
in
(
OrderInfo:
:
getServiceStatus
,
serviceStatus
);
}
lqw
.
in
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getOrderStatus
()),
OrderInfo:
:
getOrderStatus
,
reqDTO
.
getOrderStatus
());
lqw
.
in
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getOrderStatus
()),
OrderInfo:
:
getOrderStatus
,
reqDTO
.
getOrderStatus
());
lqw
.
in
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getBranchIds
()),
OrderInfo:
:
getOrgBranchId
,
reqDTO
.
getBranchIds
());
lqw
.
in
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getBranchIds
()),
OrderInfo:
:
getOrgBranchId
,
reqDTO
.
getBranchIds
());
lqw
.
in
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getGroupIds
()),
OrderInfo:
:
getOrgGroupId
,
reqDTO
.
getGroupIds
());
lqw
.
in
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getGroupIds
()),
OrderInfo:
:
getOrgGroupId
,
reqDTO
.
getGroupIds
());
...
@@ -69,8 +86,7 @@ public class OrderServiceListServiceImpl implements OrderServiceListService {
...
@@ -69,8 +86,7 @@ public class OrderServiceListServiceImpl implements OrderServiceListService {
lqw
.
in
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getAppointmentType
()),
OrderInfo:
:
getAppointmentMethod
,
reqDTO
.
getAppointmentType
());
lqw
.
in
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getAppointmentType
()),
OrderInfo:
:
getAppointmentMethod
,
reqDTO
.
getAppointmentType
());
lqw
.
in
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getAppointmentStatus
()),
OrderInfo:
:
getAppointmentStatus
,
reqDTO
.
getAppointmentStatus
());
lqw
.
in
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getAppointmentStatus
()),
OrderInfo:
:
getAppointmentStatus
,
reqDTO
.
getAppointmentStatus
());
lqw
.
in
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getPriorities
()),
OrderInfo:
:
getBeanPriority
,
reqDTO
.
getPriorities
());
lqw
.
in
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getPriorities
()),
OrderInfo:
:
getBeanPriority
,
reqDTO
.
getPriorities
());
lqw
.
orderByDesc
(
OrderInfo:
:
getCreateTime
);
lqw
=
handleOrderBy
(
lqw
,
reqDTO
);
if
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getEngineerCodes
()))
{
if
(
ListUtils
.
isNotEmpty
(
reqDTO
.
getEngineerCodes
()))
{
lqw
.
and
(
w
->
lqw
.
and
(
w
->
w
.
in
(
OrderInfo:
:
getEngineerCode
,
reqDTO
.
getEngineerCodes
())
w
.
in
(
OrderInfo:
:
getEngineerCode
,
reqDTO
.
getEngineerCodes
())
...
@@ -149,7 +165,7 @@ public class OrderServiceListServiceImpl implements OrderServiceListService {
...
@@ -149,7 +165,7 @@ public class OrderServiceListServiceImpl implements OrderServiceListService {
record
.
setAppointmentType
(
o
.
getAppointmentMethod
());
record
.
setAppointmentType
(
o
.
getAppointmentMethod
());
record
.
setAppointmentStatus
(
o
.
getAppointmentStatus
());
record
.
setAppointmentStatus
(
o
.
getAppointmentStatus
());
record
.
setOrderStatus
(
o
.
getOrderStatus
());
record
.
setOrderStatus
(
o
.
getOrderStatus
());
record
.
setServiceStatus
(
o
.
getServiceStatus
(
));
record
.
setServiceStatus
(
OrderUtil
.
handleServiceStatus
(
o
));
record
.
setDispatcher
(
o
.
getDispatcher
());
record
.
setDispatcher
(
o
.
getDispatcher
());
record
.
setCreateTime
(
TimeUtils
.
IsoTimestamp2DateTime
(
o
.
getCreateTime
()));
record
.
setCreateTime
(
TimeUtils
.
IsoTimestamp2DateTime
(
o
.
getCreateTime
()));
...
@@ -195,6 +211,35 @@ public class OrderServiceListServiceImpl implements OrderServiceListService {
...
@@ -195,6 +211,35 @@ public class OrderServiceListServiceImpl implements OrderServiceListService {
}
}
/**
/**
* 处理订单排序
*
* @param lqw
* @param reqDTO
* @return
*/
private
LambdaQueryWrapper
<
OrderInfo
>
handleOrderBy
(
LambdaQueryWrapper
<
OrderInfo
>
lqw
,
OrderServiceListReq
reqDTO
)
{
if
(
reqDTO
.
getOrderByField
()
==
1
)
{
lqw
.
orderBy
(
true
,
reqDTO
.
getOrderBy
()
==
1
,
OrderInfo:
:
getTakeTime
);
}
if
(
reqDTO
.
getOrderByField
()
==
2
)
{
lqw
.
orderBy
(
true
,
reqDTO
.
getOrderBy
()
==
1
,
OrderInfo:
:
getCreateTime
);
}
if
(
reqDTO
.
getOrderByField
()
==
3
)
{
lqw
.
orderBy
(
true
,
reqDTO
.
getOrderBy
()
==
1
,
OrderInfo:
:
getOrderStatus
);
}
if
(
reqDTO
.
getOrderByField
()
==
4
)
{
lqw
.
orderBy
(
true
,
reqDTO
.
getOrderBy
()
==
1
,
OrderInfo:
:
getAppointmentStatus
);
}
if
(
reqDTO
.
getOrderByField
()
==
5
)
{
lqw
.
orderBy
(
true
,
reqDTO
.
getOrderBy
()
==
1
,
OrderInfo:
:
getAppointmentMethod
);
}
if
(
reqDTO
.
getOrderByField
()
==
6
)
{
lqw
.
orderBy
(
true
,
reqDTO
.
getOrderBy
()
==
1
,
OrderInfo:
:
getServiceStatus
);
}
return
lqw
;
}
/**
* 获取团队配件仓地址
* 获取团队配件仓地址
*
*
* @param orders
* @param orders
...
@@ -271,7 +316,7 @@ public class OrderServiceListServiceImpl implements OrderServiceListService {
...
@@ -271,7 +316,7 @@ public class OrderServiceListServiceImpl implements OrderServiceListService {
record
.
setAppointmentType
(
o
.
getAppointmentMethod
());
record
.
setAppointmentType
(
o
.
getAppointmentMethod
());
record
.
setAppointmentStatus
(
o
.
getAppointmentStatus
());
record
.
setAppointmentStatus
(
o
.
getAppointmentStatus
());
record
.
setOrderStatus
(
o
.
getOrderStatus
());
record
.
setOrderStatus
(
o
.
getOrderStatus
());
record
.
setServiceStatus
(
o
.
getServiceStatus
(
));
record
.
setServiceStatus
(
OrderUtil
.
handleServiceStatus
(
o
));
record
.
setDispatcher
(
o
.
getDispatcher
());
record
.
setDispatcher
(
o
.
getDispatcher
());
record
.
setCreateTime
(
TimeUtils
.
IsoLocalDateTime2String
(
o
.
getCreateTime
()));
record
.
setCreateTime
(
TimeUtils
.
IsoLocalDateTime2String
(
o
.
getCreateTime
()));
...
...
project-order/src/main/java/com/dituhui/pea/order/utils/OrderUtil.java
View file @
99e21ea
package
com
.
dituhui
.
pea
.
order
.
utils
;
package
com
.
dituhui
.
pea
.
order
.
utils
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.dituhui.pea.order.entity.OrderInfo
;
import
com.dituhui.pea.order.entity.OrderInfoEntity
;
import
com.dituhui.pea.order.entity.OrderInfoEntity
;
import
com.dituhui.pea.order.enums.OrderPeaTagsEnum
;
import
com.dituhui.pea.order.enums.OrderPeaTagsEnum
;
import
com.dituhui.pea.order.enums.ServiceStatusEnum
;
import
com.dituhui.pea.order.enums.ServiceStatusEnum
;
...
@@ -60,6 +61,57 @@ public class OrderUtil {
...
@@ -60,6 +61,57 @@ public class OrderUtil {
/**
/**
* 处理工单状态,主要处理以延迟和已超时
*
* @param order
* @return
*/
public
static
String
handleServiceStatus
(
OrderInfo
order
)
{
if
(
isDelay
(
order
))
{
return
ServiceStatusEnum
.
DELAY
.
getCode
();
}
if
(
isOvertime
(
order
))
{
return
ServiceStatusEnum
.
UNFINISHED
.
getCode
();
}
return
order
.
getServiceStatus
();
}
/**
* 判断订单是否是延迟订单
*
* @param order
* @return
*/
public
static
Boolean
isDelay
(
OrderInfo
order
)
{
if
(!
order
.
getServiceStatus
().
equals
(
ServiceStatusEnum
.
INIT
.
getCode
())
&&
!
order
.
getServiceStatus
().
equals
(
ServiceStatusEnum
.
CONTACTED
.
getCode
()))
{
return
false
;
}
if
(
order
.
getPlanStartTime
().
getTime
()
+
10
*
60
*
1000
<
System
.
currentTimeMillis
())
{
return
true
;
}
return
false
;
}
/**
* 判断订单是否是延迟订单
*
* @param order
* @return
*/
public
static
Boolean
isOvertime
(
OrderInfo
order
)
{
if
(!
order
.
getServiceStatus
().
equals
(
ServiceStatusEnum
.
STARTED
.
getCode
())
||
ObjectUtil
.
isNotNull
(
order
.
getActualEndTime
()))
{
return
false
;
}
if
(
order
.
getPlanEndTime
().
getTime
()
+
10
*
60
*
1000
<
System
.
currentTimeMillis
())
{
return
true
;
}
return
false
;
}
/**
* 判断订单是否是延迟订单
* 判断订单是否是延迟订单
*
*
* @param order
* @param order
...
@@ -69,7 +121,7 @@ public class OrderUtil {
...
@@ -69,7 +121,7 @@ public class OrderUtil {
if
(!
order
.
getServiceStatus
().
equals
(
ServiceStatusEnum
.
INIT
.
getCode
())
&&
!
order
.
getServiceStatus
().
equals
(
ServiceStatusEnum
.
CONTACTED
.
getCode
()))
{
if
(!
order
.
getServiceStatus
().
equals
(
ServiceStatusEnum
.
INIT
.
getCode
())
&&
!
order
.
getServiceStatus
().
equals
(
ServiceStatusEnum
.
CONTACTED
.
getCode
()))
{
return
false
;
return
false
;
}
}
if
(
order
.
get
ExpectTimeBegin
().
plusMinutes
(
10
).
isBefore
(
LocalDateTime
.
now
()))
{
if
(
order
.
get
PlanStartTime
().
plusMinutes
(
10
).
isBefore
(
LocalDateTime
.
now
()))
{
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
...
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