- 添加 接受退货

- 添加 拒绝退货
This commit is contained in:
sin 2019-05-08 20:00:48 +08:00
parent b5078b3ffe
commit 26aaad24f8
6 changed files with 59 additions and 9 deletions

View File

@ -35,7 +35,11 @@ public class AdminOrderReturnController {
@PostMapping("agree")
public CommonResult agree(@RequestParam("id") Integer id) {
CommonResult commonResult = orderReturnService.agree(id);
return commonResult;
return orderReturnService.orderReturnAgree(id);
}
@PostMapping("refuse")
public CommonResult refuse(@RequestParam("id") Integer id) {
return orderReturnService.orderReturnRefuse(id);
}
}

View File

@ -50,4 +50,20 @@ public interface OrderReturnService {
* @return
*/
CommonResult<OrderReturnListBO> orderReturnList(OrderReturnQueryDTO queryDTO);
/**
* 订单退货 - 接受
*
* @param id
* @return
*/
CommonResult orderReturnAgree(Integer id);
/**
* 订单退货 - 拒绝
*
* @param id
* @return
*/
CommonResult orderReturnRefuse(Integer id);
}

View File

@ -34,6 +34,7 @@ public enum OrderErrorCodeEnum {
// 订单退货
ORDER_RETURN_NO_RETURN_APPLY(1008000400, "未退货申请"),
ORDER_RETURN_NOT_EXISTENT(1008000401, "退货订单不存在"),
// ========== 购物车 ==========
CARD_ITEM_NOT_FOUND(1008003000, "购物车项不存在"),

View File

@ -6,7 +6,7 @@ package cn.iocoder.mall.order.api.constant;
* @author Sin
* @time 2019-04-27 11:53
*/
public enum OrderReturnReturnTypeEnum {
public enum OrderReturnServiceTypeEnum {
/**
* 状态
@ -21,7 +21,7 @@ public enum OrderReturnReturnTypeEnum {
private final String name;
OrderReturnReturnTypeEnum(int value, String name) {
OrderReturnServiceTypeEnum(int value, String name) {
this.value = value;
this.name = name;
}

View File

@ -18,8 +18,10 @@ public enum OrderReturnStatusEnum {
* - 5退货成功
*/
RETURN_APPLICATION(1, "退货申请"),
APPLICATION_SUCCESSFUL(1, "申请成功"),
APPLICATION_FAIL(1, "申请失败"),
APPLICATION_SUCCESSFUL(2, "申请成功"),
APPLICATION_FAIL(3, "申请失败"),
RETURN(4, "退货中"),
RETURN_SUCCESS(5, "退货成功"),
;
private final int value;

View File

@ -9,6 +9,7 @@ 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;
@ -142,11 +143,37 @@ public class OrderReturnServiceImpl implements OrderReturnService {
}
@Override
public CommonResult agree(Integer id) {
public CommonResult orderReturnAgree(Integer id) {
OrderReturnDO orderReturnDO = orderReturnMapper.selectById(id);
if (orderReturnDO == null) {
return ServiceExceptionUtil
.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)
.setStatus(OrderReturnStatusEnum.APPLICATION_SUCCESSFUL.getValue())
);
return CommonResult.success(null);
}
return null;
@Override
public CommonResult orderReturnRefuse(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.APPLICATION_FAIL.getValue())
);
return CommonResult.success(null);
}
}