Authored by tanling

订单

... ... @@ -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();
}
}
... ...
... ... @@ -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.updateByPrimaryKeySelective(buyerOrder);
buyerOrderMapper.updateByOrderCode(buyerOrder);
}
... ...
... ... @@ -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 updSellerOrder(OrderBuilder orderBuilder) {
private SellerOrder selectSellerOrder(OrderBuilder orderBuilder) {
SellerOrder sellerOrder = sellerOrderMapper.selectBySkup(orderBuilder.getSkup());
return sellerOrder;
}
... ...
... ... @@ -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();
... ...