- 确认收货、退款逻辑

This commit is contained in:
sin 2019-05-08 21:18:49 +08:00
parent 26aaad24f8
commit 87574d5e7b
5 changed files with 61 additions and 9 deletions

View File

@ -42,4 +42,14 @@ public class AdminOrderReturnController {
public CommonResult refuse(@RequestParam("id") Integer id) { public CommonResult refuse(@RequestParam("id") Integer id) {
return orderReturnService.orderReturnRefuse(id); return orderReturnService.orderReturnRefuse(id);
} }
@PostMapping("confirm_commodity")
public CommonResult confirmCommodity(@RequestParam("id") Integer id) {
return orderReturnService.confirmReceipt(id);
}
@PostMapping("confirm_order")
public CommonResult confirmOrder(@RequestParam("id") Integer id) {
return orderReturnService.refund(id);
}
} }

View File

@ -66,4 +66,20 @@ public interface OrderReturnService {
* @return * @return
*/ */
CommonResult orderReturnRefuse(Integer id); CommonResult orderReturnRefuse(Integer id);
/**
* 订单退货 - 确认收货
*
* @param id
* @return
*/
CommonResult confirmReceipt(Integer id);
/**
* 订单退货 - 确认订单
*
* @param id
* @return
*/
CommonResult refund(Integer id);
} }

View File

@ -15,13 +15,17 @@ public enum OrderReturnStatusEnum {
* - 2申请成功 * - 2申请成功
* - 3申请失败 * - 3申请失败
* - 4退货中 * - 4退货中
* - 5退货成功 * - 5已收货
* - 6拒绝退款
* - 7退货成功
*/ */
RETURN_APPLICATION(1, "退货申请"), RETURN_APPLICATION(1, "退货申请"),
APPLICATION_SUCCESSFUL(2, "申请成功"), APPLICATION_SUCCESSFUL(2, "申请成功"),
APPLICATION_FAIL(3, "申请失败"), APPLICATION_FAIL(3, "申请失败"),
RETURN(4, "退货中"), RETURN_IN(4, "退货中"),
RETURN_SUCCESS(5, "退货成功"), ORDER_RECEIPT(5, "确认收货"),
REFUSE_REFUND(6, "拒绝退款"),
RETURN_SUCCESS(7, "退货成功"),
; ;
private final int value; private final int value;

View File

@ -89,7 +89,9 @@ public class OrderReturnDO extends BaseDO {
* - 2申请成功 * - 2申请成功
* - 3申请失败 * - 3申请失败
* - 4退货中 * - 4退货中
* - 5退货成功 * - 5已收货
* - 6拒绝退款
* - 7退货成功
*/ */
private Integer status; private Integer status;
} }

View File

@ -9,7 +9,6 @@ import cn.iocoder.mall.order.api.bo.OrderLastLogisticsInfoBO;
import cn.iocoder.mall.order.api.bo.OrderReturnInfoBO; import cn.iocoder.mall.order.api.bo.OrderReturnInfoBO;
import cn.iocoder.mall.order.api.bo.OrderReturnListBO; import cn.iocoder.mall.order.api.bo.OrderReturnListBO;
import cn.iocoder.mall.order.api.constant.OrderErrorCodeEnum; import cn.iocoder.mall.order.api.constant.OrderErrorCodeEnum;
import cn.iocoder.mall.order.api.constant.OrderReturnServiceTypeEnum;
import cn.iocoder.mall.order.api.constant.OrderReturnStatusEnum; import cn.iocoder.mall.order.api.constant.OrderReturnStatusEnum;
import cn.iocoder.mall.order.api.dto.OrderReturnApplyDTO; import cn.iocoder.mall.order.api.dto.OrderReturnApplyDTO;
import cn.iocoder.mall.order.api.dto.OrderReturnQueryDTO; import cn.iocoder.mall.order.api.dto.OrderReturnQueryDTO;
@ -150,10 +149,6 @@ public class OrderReturnServiceImpl implements OrderReturnService {
.error(OrderErrorCodeEnum.ORDER_RETURN_NOT_EXISTENT.getCode()); .error(OrderErrorCodeEnum.ORDER_RETURN_NOT_EXISTENT.getCode());
} }
// TODO: 2019/5/8 sin, 发送 MQ 消息申请退货成功!
// TODO: 2019/5/8 sin 退款支付系统退款
// TODO: 2019/5/8 sin 退货+退款退回商品签收后支付系统退款
orderReturnMapper.updateByOrderId( orderReturnMapper.updateByOrderId(
new OrderReturnDO() new OrderReturnDO()
.setId(id) .setId(id)
@ -176,4 +171,29 @@ public class OrderReturnServiceImpl implements OrderReturnService {
); );
return CommonResult.success(null); return CommonResult.success(null);
} }
@Override
public CommonResult confirmReceipt(Integer id) {
OrderReturnDO orderReturnDO = orderReturnMapper.selectById(id);
if (orderReturnDO == null) {
return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_RETURN_NOT_EXISTENT.getCode());
}
orderReturnMapper.updateByOrderId(
new OrderReturnDO()
.setId(id)
.setStatus(OrderReturnStatusEnum.ORDER_RECEIPT.getValue())
);
return CommonResult.success(null);
}
@Override
public CommonResult refund(Integer id) {
// TODO: 2019/5/8 sin, 发送 MQ 消息申请退货成功!
// TODO: 2019/5/8 sin 退款支付系统退款
// TODO: 2019/5/8 sin 退货+退款退回商品签收后支付系统退款
return null;
}
} }