Commit fbbdfe5c by ping.wu

取消订单前校验是否部分退

parent 348930a4
...@@ -174,6 +174,8 @@ public enum ResponseResult { ...@@ -174,6 +174,8 @@ public enum ResponseResult {
PARTNER_ORDER_CANCEL_ERROR("45089", "取消订单失败"), PARTNER_ORDER_CANCEL_ERROR("45089", "取消订单失败"),
ORDER_DELIVERY_EDIT_FAILED("45090", "修改配送状态失败"), ORDER_DELIVERY_EDIT_FAILED("45090", "修改配送状态失败"),
PARTNER_CAN_NOT_CANCEL_ORDER("45091","订单已部分退款,不能取消"),
/** /**
* 支付 * 支付
*/ */
......
...@@ -254,6 +254,10 @@ public class OrderManagerAdapter { ...@@ -254,6 +254,10 @@ public class OrderManagerAdapter {
if (null == orderBean) { if (null == orderBean) {
return ResponseUtil.error(ResponseResult.ORDER_NOT_EXIST); return ResponseUtil.error(ResponseResult.ORDER_NOT_EXIST);
} }
BaseResponse verifyResponse = orderVerifyHandle.cancelOrder(orderBean);
if (ObjectUtils.notEqual(verifyResponse.getCode(), ResponseResult.SUCCESS.getCode())) {
return handleResponse(request, orderBean, verifyResponse);
}
BaseResponse<OrderManagerResponse> orderManagerResponse = orderBeanFactory.getOrderManagerService(orderBean).orderCancel(request, orderBean); BaseResponse<OrderManagerResponse> orderManagerResponse = orderBeanFactory.getOrderManagerService(orderBean).orderCancel(request, orderBean);
return handleResponse(request, orderBean, orderManagerResponse); return handleResponse(request, orderBean, orderManagerResponse);
} }
......
...@@ -663,4 +663,20 @@ public class OrderVerifyHandle { ...@@ -663,4 +663,20 @@ public class OrderVerifyHandle {
return ResponseUtil.success(); return ResponseUtil.success();
} }
/**
* 取消订单前校验是否部分退
*/
public BaseResponse cancelOrder(OrderBeanV1 orderBean){
//已取消的订单不能操作
if (ObjectUtils.equals(OrderStatusV1.CANCEL.getV2Code(), orderBean.getStatusV2())) {
return ResponseUtil.error(ResponseResult.ORDER_HAS_CANCELED);
}
//判断订单是否有申请退款且为部分退款
if (orderBean.getAfterSalesOrderResp() != null && orderBean.getAfterSalesOrderResp().getIsPartRefund()) {
return ResponseUtil.error(ResponseResult.PARTNER_CAN_NOT_CANCEL_ORDER);
}
return ResponseUtil.success();
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment