...
|
...
|
@@ -30,6 +30,7 @@ import com.yohoufo.order.service.cache.CacheKeyBuilder; |
|
|
import com.yohoufo.order.service.impl.SellerAddressService;
|
|
|
import com.yohoufo.order.service.proxy.InBoxFacade;
|
|
|
import com.yohoufo.order.service.proxy.OrderStatusFlowService;
|
|
|
import com.yohoufo.order.utils.BuyerOrderUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
...
|
...
|
@@ -78,21 +79,35 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { |
|
|
BuyerOrder buyerOrder = new BuyerOrder();
|
|
|
buyerOrder.setOrderCode(orderInfo.getOrderCode());
|
|
|
buyerOrder.setUid(uid);
|
|
|
buyerOrder.setStatus(OrderStatus.HAS_PAYED.getCode());
|
|
|
|
|
|
int orderStatusCode = OrderStatus.HAS_PAYED.getCode();
|
|
|
//门店订单支付后直接完成
|
|
|
if(BuyerOrderUtils.isOffline(orderInfo)) {
|
|
|
orderStatusCode = OrderStatus.DONE.getCode();
|
|
|
}
|
|
|
|
|
|
buyerOrder.setStatus(orderStatusCode);
|
|
|
|
|
|
buyerOrder.setUpdateTime(DateUtil.getCurrentTimeSecond());
|
|
|
int result = buyerOrderMapper.updateByOrderCode(buyerOrder);
|
|
|
//
|
|
|
if(result>0){
|
|
|
//记录状态信息
|
|
|
logger.info("in updateOrderStatusPaid record status change, orderCode {}", orderInfo.getOrderCode());
|
|
|
orderStatusFlowService.addAsy(orderInfo.getOrderCode(), OrderStatus.HAS_PAYED.getCode());
|
|
|
logger.info("in updateOrderStatusPaid record status change, orderCode {}, status: {}",
|
|
|
orderInfo.getOrderCode(), orderStatusCode);
|
|
|
orderStatusFlowService.addAsy(orderInfo.getOrderCode(), orderStatusCode);
|
|
|
}
|
|
|
orderInfo.setStatus(OrderStatus.HAS_PAYED.getCode());
|
|
|
orderInfo.setStatus(orderStatusCode);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void processAfterPay(OrderInfo orderInfo) {
|
|
|
if(BuyerOrderUtils.isOrderDone(orderInfo)) {
|
|
|
logger.info("order status is Done, orderCode: {}, uid: {}", orderInfo.getOrderCode(), orderInfo.getUid());
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
Integer uid = orderInfo.getUid();
|
|
|
Integer sellerUid = orderInfo.getSellerUid();
|
|
|
long orderCode = orderInfo.getOrderCode();
|
...
|
...
|
@@ -289,6 +304,7 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService { |
|
|
.amount(buyerOrder.getAmount())
|
|
|
.createTime(buyerOrder.getCreateTime())
|
|
|
.orderCodeType(OrderCodeType.BUYER_TYPE)
|
|
|
.attributes(buyerOrder.getAttributes())
|
|
|
.sourceStatus(buyerOrder.getStatus())
|
|
|
.payExpireTime(DelayTime.BUYER_ORDER_WAITING_PAY)
|
|
|
.build();
|
...
|
...
|
|