【BUG】解决退款时找不到appkey的问题

This commit is contained in:
痴货 2024-09-14 19:19:13 +08:00
parent d0b60bf9b4
commit b48d0edef0
2 changed files with 3 additions and 2 deletions

View File

@ -37,7 +37,7 @@ public interface AfterSaleConvert {
@Mapping(target = "creator", ignore = true), @Mapping(target = "creator", ignore = true),
@Mapping(target = "updater", ignore = true), @Mapping(target = "updater", ignore = true),
}) })
AfterSaleDO convert(AppAfterSaleCreateReqVO createReqVO, TradeOrderItemDO tradeOrderItem); PayRefundCreateReqDTO convert(String userIp, AfterSaleDO afterSale);
@Mappings({ @Mappings({
@Mapping(source = "afterSale.orderId", target = "merchantOrderId"), @Mapping(source = "afterSale.orderId", target = "merchantOrderId"),

View File

@ -371,8 +371,9 @@ public class AfterSaleServiceImpl implements AfterSaleService {
@Override @Override
public void afterCommit() { public void afterCommit() {
// 创建退款单 // 创建退款单
PayRefundCreateReqDTO createReqDTO = AfterSaleConvert.INSTANCE.convert(userIp, afterSale, tradeOrderProperties) PayRefundCreateReqDTO createReqDTO = AfterSaleConvert.INSTANCE.convert(userIp, afterSale)
.setReason(StrUtil.format("退款【{}】", afterSale.getSpuName())); .setReason(StrUtil.format("退款【{}】", afterSale.getSpuName()));
createReqDTO.setAppKey(tradeOrderProperties.getPayAppKey());
Long payRefundId = payRefundApi.createRefund(createReqDTO); Long payRefundId = payRefundApi.createRefund(createReqDTO);
// 更新售后单的退款单号 // 更新售后单的退款单号
tradeAfterSaleMapper.updateById(new AfterSaleDO().setId(afterSale.getId()).setPayRefundId(payRefundId)); tradeAfterSaleMapper.updateById(new AfterSaleDO().setId(afterSale.getId()).setPayRefundId(payRefundId));