Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jenkins
order-group
Commits
a5af3940
Commit
a5af3940
authored
Mar 12, 2020
by
huvchao@126.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/20200309_1.9.1415_TAPD1007005'
parents
171229af
18e4f1c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
3 deletions
+27
-3
order-application-service/src/main/java/cn/freemud/service/delivery/ThirdDeliveryServiceImpl.java
+27
-3
No files found.
order-application-service/src/main/java/cn/freemud/service/delivery/ThirdDeliveryServiceImpl.java
View file @
a5af3940
...
@@ -30,13 +30,14 @@ import com.freemud.sdk.api.assortment.order.request.order.AssortmentUpdateDelive
...
@@ -30,13 +30,14 @@ import com.freemud.sdk.api.assortment.order.request.order.AssortmentUpdateDelive
import
com.freemud.sdk.api.assortment.order.request.order.UpdateDeliveryInfoByIdRequest
;
import
com.freemud.sdk.api.assortment.order.request.order.UpdateDeliveryInfoByIdRequest
;
import
com.freemud.sdk.api.assortment.order.response.order.OrderBaseResponse
;
import
com.freemud.sdk.api.assortment.order.response.order.OrderBaseResponse
;
import
com.freemud.sdk.api.assortment.order.service.OrderCenterSdkService
;
import
com.freemud.sdk.api.assortment.order.service.OrderCenterSdkService
;
import
com.google.common.collect.
ImmutableMap
;
import
com.google.common.collect.
Lists
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang.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
java.util.
Map
;
import
java.util.
List
;
/**
/**
* All rights Reserved, Designed By www.freemud.cn
* All rights Reserved, Designed By www.freemud.cn
...
@@ -112,8 +113,12 @@ public class ThirdDeliveryServiceImpl implements ThirdDeliveryService {
...
@@ -112,8 +113,12 @@ public class ThirdDeliveryServiceImpl implements ThirdDeliveryService {
// 订单已完成
// 订单已完成
sendPosService
(
deliveryStatus
,
posBaseRequestDto
);
sendPosService
(
deliveryStatus
,
posBaseRequestDto
);
}
else
if
(
deliveryStatus
==
DeliveryStatus
.
DELIVERYERROR
.
getCode
()
||
deliveryStatus
==
DeliveryStatus
.
DELIVERYCANCEL
.
getCode
())
{
}
else
if
(
deliveryStatus
==
DeliveryStatus
.
DELIVERYERROR
.
getCode
()
||
deliveryStatus
==
DeliveryStatus
.
DELIVERYCANCEL
.
getCode
())
{
// 取消外卖中台配送单 订单异常
// 取消外卖中台配送单 订单异常
partnerCancelOrder
(
request
.
getDeliveryId
());
// 如果 "配送单异常并且顾客更改配送地址" 不取消配送单
if
(!
isDeliveryAbnormalAndCustomerChangedAddress
(
request
))
{
partnerCancelOrder
(
request
.
getDeliveryId
());
}
// 运单异常,取消订单
// 运单异常,取消订单
posBaseRequestDto
.
setReason
(
"没有骑手接单"
);
posBaseRequestDto
.
setReason
(
"没有骑手接单"
);
posBaseRequestDto
.
setDeliveryId
(
request
.
getDeliveryId
());
posBaseRequestDto
.
setDeliveryId
(
request
.
getDeliveryId
());
...
@@ -132,6 +137,25 @@ public class ThirdDeliveryServiceImpl implements ThirdDeliveryService {
...
@@ -132,6 +137,25 @@ public class ThirdDeliveryServiceImpl implements ThirdDeliveryService {
return
ResponseUtil
.
success
();
return
ResponseUtil
.
success
();
}
}
/**
* 配送单异常并且顾客更改配送地址
*
* @return
*/
public
boolean
isDeliveryAbnormalAndCustomerChangedAddress
(
CallbackUrlRequestDto
request
)
{
if
(
DeliveryStatus
.
DELIVERYERROR
.
getCode
()
!=
request
.
getDeliveryStatus
())
return
false
;
if
(
StringUtils
.
isBlank
(
request
.
getRemark
()))
return
false
;
List
<
String
>
abnormalDesc
=
Lists
.
newArrayList
(
"顾客更改配送地址"
,
"顾客更改收货地址"
);
for
(
String
str
:
abnormalDesc
)
{
if
(
request
.
getRemark
().
contains
(
str
))
{
log
.
info
(
"isDeliveryAbnormalAndCustomerChangedAddress.true of {}"
,
JSONObject
.
toJSONString
(
request
));
return
true
;
}
}
return
false
;
}
@Override
@Override
public
BaseResponse
mallCallbackUrl
(
CallbackUrlRequestDto
request
)
{
public
BaseResponse
mallCallbackUrl
(
CallbackUrlRequestDto
request
)
{
return
ResponseUtil
.
success
();
return
ResponseUtil
.
success
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment