Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ufo
/
yohoufo-fore
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
chenchao
5 years ago
Commit
33fc1b25ec1a8fd218cb8f3f50958dde55753797
1 parent
324e4e21
throw out exception if occur
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
28 deletions
order/src/main/java/com/yohoufo/order/service/impl/BuyerOrderMetaServiceImpl.java
order/src/main/java/com/yohoufo/order/service/impl/BuyerOrderMetaServiceImpl.java
View file @
33fc1b2
package
com
.
yohoufo
.
order
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.base.Throwables
;
import
com.yoho.error.ServiceError
;
import
com.yoho.error.exception.ServiceException
;
import
com.yohobuy.ufo.model.order.bo.CustomsClearanceResult
;
...
...
@@ -205,35 +204,30 @@ public class BuyerOrderMetaServiceImpl implements IBuyerOrderMetaService {
logger
.
warn
(
"BuyerOrderMeta4PlatformController updateDeliveryAddress not allow status {} param req is {}"
,
buyerOrder
.
getStatus
(),
req
);
throw
new
UfoServiceException
(
400
,
"订单状态不允许变更地址"
);
}
try
{
AddressInfo
changedAddress
=
JSONObject
.
parseObject
(
addressOfJson
,
AddressInfo
.
class
);
OrderAddressReq
orderAddressReq
=
OrderAddressReq
.
builder
()
.
address
(
changedAddress
.
getAddress
())
.
consignee
(
changedAddress
.
getConsignee
())
.
mobile
(
changedAddress
.
getMobile
())
.
fromPlatform
(
req
.
isFromPlatform
())
.
build
();
commomAddressService
.
checkAddressContent
(
orderAddressReq
);
AddressInfo
dbAddressInfo
=
getAddressInfo
(
buyerUid
,
orderCode
);
if
(
dbAddressInfo
==
null
){
logger
.
warn
(
"dbAddressInfo is null ,uid {} ,orderCode {}"
,
buyerUid
,
orderCode
);
throw
new
UfoServiceException
(
400
,
"找不到地址信息"
);
}
AddressInfo
hiddenAddressInDB
=
getHiddenAddressInfo
(
buyerUid
,
orderCode
);
if
(
hiddenAddressInDB
==
null
){
logger
.
warn
(
"hiddenAddressInDB is null ,uid {} ,orderCode {}"
,
buyerUid
,
orderCode
);
throw
new
UfoServiceException
(
400
,
"找不到地址信息"
);
}
return
updateDeliveryAddress
(
buyerUid
,
orderCode
,
changedAddress
,
dbAddressInfo
,
hiddenAddressInDB
,
req
.
isFromPlatform
());
}
catch
(
Exception
ex
){
logger
.
warn
(
"updateDeliveryAddressByErp occur exception req {} error {}"
,
req
,
Throwables
.
getStackTraceAsString
(
ex
));
AddressInfo
changedAddress
=
JSONObject
.
parseObject
(
addressOfJson
,
AddressInfo
.
class
);
OrderAddressReq
orderAddressReq
=
OrderAddressReq
.
builder
()
.
address
(
changedAddress
.
getAddress
())
.
consignee
(
changedAddress
.
getConsignee
())
.
mobile
(
changedAddress
.
getMobile
())
.
fromPlatform
(
req
.
isFromPlatform
())
.
build
();
commomAddressService
.
checkAddressContent
(
orderAddressReq
);
AddressInfo
dbAddressInfo
=
getAddressInfo
(
buyerUid
,
orderCode
);
if
(
dbAddressInfo
==
null
){
logger
.
warn
(
"dbAddressInfo is null ,uid {} ,orderCode {}"
,
buyerUid
,
orderCode
);
throw
new
UfoServiceException
(
400
,
"找不到地址信息"
);
}
AddressInfo
hiddenAddressInDB
=
getHiddenAddressInfo
(
buyerUid
,
orderCode
);
if
(
hiddenAddressInDB
==
null
){
logger
.
warn
(
"hiddenAddressInDB is null ,uid {} ,orderCode {}"
,
buyerUid
,
orderCode
);
throw
new
UfoServiceException
(
400
,
"找不到地址信息"
);
}
return
null
;
return
updateDeliveryAddress
(
buyerUid
,
orderCode
,
changedAddress
,
dbAddressInfo
,
hiddenAddressInDB
,
req
.
isFromPlatform
())
;
}
BuyerOrderMeta
getBuyerOrderMeta
(
int
uid
,
long
orderCode
,
String
metaKey
)
{
...
...
Please
register
or
login
to post a comment