退单
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user