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
tanling
6 years ago
Commit
ff5a438d003557804c537a841abb66812e15d642
1 parent
387bcbfb
订单
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
9 deletions
order/src/main/java/com/yohoufo/order/controller/PaymentController.java
order/src/main/java/com/yohoufo/order/service/BuyerOrderPaymentService.java
order/src/main/java/com/yohoufo/order/service/impl/SubmitOrderServiceImpl.java
order/src/main/java/com/yohoufo/order/service/pay/alipay/AlipayServiceAbstract.java
order/src/main/java/com/yohoufo/order/controller/PaymentController.java
View file @
ff5a438
...
...
@@ -99,7 +99,11 @@ public class PaymentController {
PayRefundBo
payRefundBo
=
paymentService
.
refund
(
request
);
return
new
ApiResponse
.
ApiResponseBuilder
().
code
(
PrepayResponse
.
SUCCESS
).
data
(
payRefundBo
).
message
(
"退款成功"
).
build
();
if
(
payRefundBo
.
getRefundStatus
()
==
RefundContant
.
PAYMENT_REFUND_RESULTCODE_SUCCESS
){
return
new
ApiResponse
.
ApiResponseBuilder
().
code
(
PrepayResponse
.
SUCCESS
).
data
(
payRefundBo
).
message
(
"退款成功"
).
build
();
}
else
{
return
new
ApiResponse
.
ApiResponseBuilder
().
code
(
PrepayResponse
.
FAILED
).
data
(
payRefundBo
).
message
(
"退款失败"
).
build
();
}
}
...
...
order/src/main/java/com/yohoufo/order/service/BuyerOrderPaymentService.java
View file @
ff5a438
...
...
@@ -141,10 +141,13 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
public
void
updatePayment
(
OrderInfo
orderInfo
,
int
payment
){
BuyerOrder
buyerOrder
=
new
BuyerOrder
();
buyerOrder
.
setOrderCode
(
orderInfo
.
getOrderCode
());
buyerOrder
.
setUid
(
orderInfo
.
getUid
());
// 更新预支付方式
buyerOrder
.
setPayment
(
orderInfo
.
getPayment
());
buyerOrder
.
setUpdateTime
(
DateUtil
.
getCurrentTimeSecond
());
buyerOrderMapper
.
updateBy
PrimaryKeySelectiv
e
(
buyerOrder
);
buyerOrderMapper
.
updateBy
OrderCod
e
(
buyerOrder
);
}
...
...
order/src/main/java/com/yohoufo/order/service/impl/SubmitOrderServiceImpl.java
View file @
ff5a438
...
...
@@ -10,7 +10,6 @@ import com.yohoufo.dal.order.*;
import
com.yohoufo.dal.order.model.*
;
import
com.yohoufo.order.common.ClientType
;
import
com.yohoufo.order.common.OrderStatus
;
import
com.yohoufo.order.common.SellerOrderStatus
;
import
com.yohoufo.order.common.SkupStatus
;
import
com.yohoufo.order.constants.MetaKey
;
import
com.yohoufo.order.model.dto.OrderBuilder
;
...
...
@@ -19,7 +18,6 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
@Service
public
class
SubmitOrderServiceImpl
implements
ISubmitOrderService
{
...
...
@@ -89,7 +87,6 @@ public class SubmitOrderServiceImpl implements ISubmitOrderService {
/**
* 1.更新 表seller_order_goods skup的状态为不可售
* 2.更新 表seller_order 状态为已经售出
* 3.插入订单 表buyer_order
* 4.插入订单商品 buyer_order_goods
* 5.插入收货地址 buyer_order_meta
...
...
@@ -98,8 +95,8 @@ public class SubmitOrderServiceImpl implements ISubmitOrderService {
// 1.表seller_order_goods ==> 不可售
SellerOrderGoods
sellerOrderGoods
=
updSellerOrderGoods
(
orderBuilder
);
// 2.更新 表seller_order 状态 ==> 已售出
SellerOrder
sellerOrder
=
updSellerOrder
(
orderBuilder
);
// 查询卖家订单
SellerOrder
sellerOrder
=
selectSellerOrder
(
orderBuilder
);
// 3.插入订单 表buyer_order
insertOrder
(
orderBuilder
,
sellerOrder
.
getUid
());
...
...
@@ -168,7 +165,7 @@ public class SubmitOrderServiceImpl implements ISubmitOrderService {
buyerOrderMapper
.
insert
(
buyerOrder
);
}
private
SellerOrder
upd
SellerOrder
(
OrderBuilder
orderBuilder
)
{
private
SellerOrder
select
SellerOrder
(
OrderBuilder
orderBuilder
)
{
SellerOrder
sellerOrder
=
sellerOrderMapper
.
selectBySkup
(
orderBuilder
.
getSkup
());
return
sellerOrder
;
}
...
...
order/src/main/java/com/yohoufo/order/service/pay/alipay/AlipayServiceAbstract.java
View file @
ff5a438
...
...
@@ -80,7 +80,7 @@ public abstract class AlipayServiceAbstract extends AbstractPayService {
public
PayQueryBo
payQuery
(
String
tradeNo
)
{
Map
<
String
,
String
>
queryParams
=
buildOpenApiQueryParams
(
tradeNo
);
String
respTxt
=
sendOpenApiRequest
(
tradeNo
,
queryParams
);
QueryBo
queryBo
=
JSON
.
parseObject
(
respTxt
,
QueryBo
.
class
);
QueryBo
queryBo
=
JSON
.
parseObject
(
JSONObject
.
toJSONString
(
JSON
.
parseObject
(
respTxt
).
getJSONObject
(
"alipay_trade_query_response"
))
,
QueryBo
.
class
);
// 查询结果转换成 共通的对象
PayQueryBo
payQueryBo
=
new
PayQueryBo
();
...
...
Please
register
or
login
to post a comment