From 87574d5e7bee1211fa95f94db564796715ac9dcb Mon Sep 17 00:00:00 2001 From: sin <2943460818@qq.com> Date: Wed, 8 May 2019 21:18:49 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E7=A1=AE=E8=AE=A4=E6=94=B6=E8=B4=A7?= =?UTF-8?q?=E3=80=81=E9=80=80=E6=AC=BE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admins/AdminOrderReturnController.java | 10 +++++++ .../mall/order/api/OrderReturnService.java | 16 ++++++++++ .../api/constant/OrderReturnStatusEnum.java | 10 +++++-- .../order/biz/dataobject/OrderReturnDO.java | 4 ++- .../biz/service/OrderReturnServiceImpl.java | 30 +++++++++++++++---- 5 files changed, 61 insertions(+), 9 deletions(-) diff --git a/order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/admins/AdminOrderReturnController.java b/order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/admins/AdminOrderReturnController.java index 080beb3d4..f373c390c 100644 --- a/order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/admins/AdminOrderReturnController.java +++ b/order/order-application/src/main/java/cn/iocoder/mall/order/application/controller/admins/AdminOrderReturnController.java @@ -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); + } } diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderReturnService.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderReturnService.java index c598d8fbe..55870b084 100644 --- a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderReturnService.java +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/OrderReturnService.java @@ -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); } diff --git a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/OrderReturnStatusEnum.java b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/OrderReturnStatusEnum.java index 8b37f22fe..383e6fcca 100644 --- a/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/OrderReturnStatusEnum.java +++ b/order/order-service-api/src/main/java/cn/iocoder/mall/order/api/constant/OrderReturnStatusEnum.java @@ -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; diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderReturnDO.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderReturnDO.java index ac138ac77..90a27a524 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderReturnDO.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderReturnDO.java @@ -89,7 +89,9 @@ public class OrderReturnDO extends BaseDO { * - 2、申请成功 * - 3、申请失败 * - 4、退货中 - * - 5、退货成功 + * - 5、已收货 + * - 6、拒绝退款 + * - 7、退货成功 */ private Integer status; } diff --git a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderReturnServiceImpl.java b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderReturnServiceImpl.java index 7dd3e1bac..0568ca75b 100644 --- a/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderReturnServiceImpl.java +++ b/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderReturnServiceImpl.java @@ -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; + } }