...
|
...
|
@@ -1255,18 +1255,18 @@ public class PaymentServiceImpl implements IPaymentService { |
|
|
// 获取支付成功记录
|
|
|
OrdersPay ordersPay = ordersPayMapper.selectOrdersPay(orderInfo.getOrderCode(), orderInfo.getUid());
|
|
|
if(ordersPay == null || ordersPay.getAmount() == null){
|
|
|
logger.warn("refund paid record not exist.orderCode is {}", orderCode);
|
|
|
logger.warn("manual refund paid record not exist.orderCode is {}", orderCode);
|
|
|
throw new ServiceException(ServiceError.ORDER_HAS_NOT_PAID);
|
|
|
}
|
|
|
|
|
|
if(!CollectionUtils.isEmpty(ordersPayRefundMapper.selectByOrderCode(orderCode))) {
|
|
|
logger.warn("refund has success before .orderCode is {}", orderCode);
|
|
|
logger.warn("manual refund has success before .orderCode is {}", orderCode);
|
|
|
throw new ServiceException(400, "订单已经退款成功过!");
|
|
|
}
|
|
|
|
|
|
// 支付金额小于退款金额
|
|
|
if (ordersPay.getAmount().compareTo(amount) < 0) {
|
|
|
logger.warn("refund refundAmount {} > amount {}, orderCode is {}",
|
|
|
logger.warn("manual refund refundAmount {} > amount {}, orderCode is {}",
|
|
|
ordersPay.getAmount(), amount, orderCode);
|
|
|
throw new ServiceException(ServiceError.ORDER_REFUND_OVER_TOTAL_AMOUNT);
|
|
|
}
|
...
|
...
|
|