- 确认收货、退款逻辑

pull/1/head
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) {
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
*/
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
* - 3
* - 4退
* - 5退
* - 5
* - 6退
* - 7退
*/
RETURN_APPLICATION(1, "退货申请"),
APPLICATION_SUCCESSFUL(2, "申请成功"),
APPLICATION_FAIL(3, "申请失败"),
RETURN(4, "退货中"),
RETURN_SUCCESS(5, "退货成功"),
RETURN_IN(4, "退货中"),
ORDER_RECEIPT(5, "确认收货"),
REFUSE_REFUND(6, "拒绝退款"),
RETURN_SUCCESS(7, "退货成功"),
;
private final int value;

View File

@ -89,7 +89,9 @@ public class OrderReturnDO extends BaseDO {
* - 2
* - 3
* - 4退
* - 5退
* - 5
* - 6退
* - 7退
*/
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.OrderReturnListBO;
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.dto.OrderReturnApplyDTO;
import cn.iocoder.mall.order.api.dto.OrderReturnQueryDTO;
@ -150,10 +149,6 @@ public class OrderReturnServiceImpl implements OrderReturnService {
.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(
new OrderReturnDO()
.setId(id)
@ -176,4 +171,29 @@ public class OrderReturnServiceImpl implements OrderReturnService {
);
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;
}
}