This commit is contained in:
2024-03-06 14:37:02 +08:00
parent c6ae5db182
commit 19620d6d09
3 changed files with 10 additions and 11 deletions

View File

@@ -693,12 +693,14 @@ public class OrderService {
if (CollectionUtils.isNotEmpty(orderRefundInfoList)) { if (CollectionUtils.isNotEmpty(orderRefundInfoList)) {
// 已退款金额 // 已退款金额
BigDecimal refunded = orderRefundInfoList.stream() BigDecimal refunded = orderRefundInfoList.stream()
.map(x -> new BigDecimal(x.getReverseAmt())) .map(x -> Objects.nonNull(x.getReverseAmt()) ? new BigDecimal(x.getReverseAmt()) : BigDecimal.ZERO)
.reduce(BigDecimal.ZERO,BigDecimal::add); .reduce(BigDecimal.ZERO,BigDecimal::add);
if (Objects.nonNull(orderBasicInfo.getPayAmount())) {
chargingAmount = orderBasicInfo.getPayAmount().subtract(refunded).toString(); chargingAmount = orderBasicInfo.getPayAmount().subtract(refunded).toString();
log.info("订单:{}, 已经存在退款记录:{}, 支付金额{}, 退款金额:{}, 重新计算消费金额为:{}", log.info("订单:{}, 已经存在退款记录:{}, 支付金额{}, 退款金额:{}, 重新计算消费金额为:{}",
orderBasicInfo.getOrderCode(), JSON.toJSONString(orderRefundInfoList), orderBasicInfo.getPayAmount(), refunded, chargingAmount); orderBasicInfo.getOrderCode(), JSON.toJSONString(orderRefundInfoList), orderBasicInfo.getPayAmount(), refunded, chargingAmount);
} }
}
// 组装交易记录数据 // 组装交易记录数据
TransactionRecordsData data = new TransactionRecordsData(); TransactionRecordsData data = new TransactionRecordsData();
@@ -721,8 +723,7 @@ public class OrderService {
try { try {
commonService.commonPushOrderInfo(orderBasicInfo); commonService.commonPushOrderInfo(orderBasicInfo);
} catch (Exception e) { } catch (Exception e) {
log.error("人工结算订单 推送第三方平台订单信息error, ", e); log.error("人工结算订单 推送第三方平台订单信息error, orderCode:{}", orderBasicInfo.getOrderCode(), e);
e.printStackTrace();
} }
}); });
return true; return true;

View File

@@ -430,7 +430,7 @@ public class DelayMerchantProgramLogic extends AbstractProgramLogic {
if (CollectionUtils.isNotEmpty(orderRefundInfoList)) { if (CollectionUtils.isNotEmpty(orderRefundInfoList)) {
// 已退款金额 // 已退款金额
BigDecimal refunded = orderRefundInfoList.stream() BigDecimal refunded = orderRefundInfoList.stream()
.map(x -> new BigDecimal(x.getReverseAmt())) .map(x -> Objects.nonNull(x.getReverseAmt()) ? new BigDecimal(x.getReverseAmt()) : BigDecimal.ZERO)
.reduce(BigDecimal.ZERO,BigDecimal::add); .reduce(BigDecimal.ZERO,BigDecimal::add);
if (refunded.compareTo(refundAmount) >= 0) { if (refunded.compareTo(refundAmount) >= 0) {
logger.info("执行订单退款-校验已退款金额orderCode:{}, 应退款金额:{}, 已经退款金额:{}, 不再执行退款", orderBasicInfo.getOrderCode(), refundAmount, refunded); logger.info("执行订单退款-校验已退款金额orderCode:{}, 应退款金额:{}, 已经退款金额:{}, 不再执行退款", orderBasicInfo.getOrderCode(), refundAmount, refunded);

View File

@@ -5,10 +5,7 @@ import com.jsowell.pile.vo.base.OrderAmountDetailVO;
import com.jsowell.pile.vo.base.OrderPeriodAmountVO; import com.jsowell.pile.vo.base.OrderPeriodAmountVO;
import com.jsowell.pile.vo.base.PileInfoVO; import com.jsowell.pile.vo.base.PileInfoVO;
import com.jsowell.pile.vo.uniapp.MemberVO; import com.jsowell.pile.vo.uniapp.MemberVO;
import lombok.AllArgsConstructor; import lombok.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.util.List; import java.util.List;
@@ -117,6 +114,7 @@ public class OrderDetailInfoVO {
@Setter @Setter
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder
public static class OrderRefundInfo{ public static class OrderRefundInfo{
private String paymentId; // 支付交易对象id private String paymentId; // 支付交易对象id
private String reverseId; // 支付撤销对象id private String reverseId; // 支付撤销对象id