后端:完成退款逻辑
This commit is contained in:
@@ -2,7 +2,6 @@ package cn.iocoder.mall.order.api;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.order.api.dto.OrderReturnApplyDTO;
|
||||
import cn.iocoder.mall.order.api.dto.OrderReturnCreateDTO;
|
||||
|
||||
/**
|
||||
* 订单退货
|
||||
@@ -21,4 +20,16 @@ public interface OrderReturnService {
|
||||
*/
|
||||
CommonResult orderReturnApply(OrderReturnApplyDTO orderReturnApplyDTO);
|
||||
|
||||
/**
|
||||
* 更新退款成功
|
||||
*
|
||||
* 如果成功,则返回 success
|
||||
* 如果失败,则返回具体原因
|
||||
*
|
||||
* @param orderId 订单编号
|
||||
* @param refundPrice 退款金额
|
||||
* @return 支付结果
|
||||
*/
|
||||
String updateRefundSuccess(String orderId, Integer refundPrice);
|
||||
|
||||
}
|
||||
|
||||
@@ -52,4 +52,9 @@ public class OrderReturnServiceImpl implements OrderReturnService {
|
||||
orderReturnMapper.insert(orderReturnDO);
|
||||
return CommonResult.success(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String updateRefundSuccess(String orderId, Integer refundPrice) {
|
||||
return "success";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,9 +258,11 @@ public class OrderServiceImpl implements OrderService {
|
||||
}
|
||||
|
||||
// 标记优惠劵已使用
|
||||
CommonResult<Boolean> useCouponCardResult = couponService.useCouponCard(userId, orderCreateDTO.getCouponCardId());
|
||||
if (useCouponCardResult.isError()) {
|
||||
return CommonResult.error(useCouponCardResult);
|
||||
if (orderCreateDTO.getCouponCardId() != null) {
|
||||
CommonResult<Boolean> useCouponCardResult = couponService.useCouponCard(userId, orderCreateDTO.getCouponCardId());
|
||||
if (useCouponCardResult.isError()) {
|
||||
return CommonResult.error(useCouponCardResult);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO 芋艿,扣除库存
|
||||
|
||||
Reference in New Issue
Block a user