This commit is contained in:
wyn
2026-04-28 18:15:23 +08:00
parent 43d0340593
commit f50e17aa87
8 changed files with 113 additions and 22 deletions

View File

@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.peanut.common.utils.CopyUtils;
import com.peanut.common.utils.OrderUtils;
import com.peanut.config.Constants;
import com.peanut.modules.book.service.BookBuyConfigService;
import com.peanut.modules.book.service.BuyOrderService;
import com.peanut.modules.book.service.MyUserService;
@@ -81,6 +82,10 @@ public class AliPayServiceImpl implements AliPayService {
private TrainingClassService trainingClassService;
@Autowired
private AiVipLogService aiVipLogService;
@Autowired
private BuyOrderRefundService buyOrderRefundService;
@Autowired
private BuyOrderRefundLogService buyOrderRefundLogService;
@Override
public String pay(AlipayDTO payDto) {
@@ -367,7 +372,17 @@ public class AliPayServiceImpl implements AliPayService {
refund.setOutTradeNo(((Map)res.get("alipay_trade_refund_response")).get("out_trade_no").toString());
refund.setRefundFee(((Map)res.get("alipay_trade_refund_response")).get("refund_fee").toString());
refundOrderService.save(refund);
refundOrderService.businessOpt(order);
if (Constants.ORDER_STATUS_REFUND.equals(order.getOrderStatus())) {
BuyOrderRefund buyOrderRefund = buyOrderRefundService.getOne(new LambdaQueryWrapper<BuyOrderRefund>()
.eq(BuyOrderRefund::getOrderId, order.getOrderId())
.orderByDesc(BuyOrderRefund::getId)
.last("limit 1"));
if (buyOrderRefund != null) {
buyOrderRefundLogService.insertRefundLog(buyOrderRefund.getId(),3,1);
}
} else {
refundOrderService.businessOpt(order);
}
}
return resJson;
}