|
|
|
@ -12,6 +12,7 @@ import com.hai.common.utils.ResponseMsgUtil; |
|
|
|
|
import com.hai.entity.HighChildOrder; |
|
|
|
|
import com.hai.entity.HighOrder; |
|
|
|
|
import com.hai.entity.HighOrderRefund; |
|
|
|
|
import com.hai.enum_type.OrderStatusEnum; |
|
|
|
|
import com.hai.model.HighUserModel; |
|
|
|
|
import com.hai.model.ResponseData; |
|
|
|
|
import com.hai.order.model.CreateOrderChildModel; |
|
|
|
@ -21,10 +22,7 @@ import com.hai.order.model.ExportOrderRefundModel; |
|
|
|
|
import com.hai.order.service.OrderPaySuccessService; |
|
|
|
|
import com.hai.order.service.OrderRefundService; |
|
|
|
|
import com.hai.order.service.OrderService; |
|
|
|
|
import com.hai.order.type.OrderChildGoodsType; |
|
|
|
|
import com.hai.order.type.OrderChildStatus; |
|
|
|
|
import com.hai.order.type.OrderPayType; |
|
|
|
|
import com.hai.order.type.OrderRefundStatus; |
|
|
|
|
import com.hai.order.type.*; |
|
|
|
|
import com.hai.order.utils.OrderUtil; |
|
|
|
|
import com.web.config.SysConst; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
@ -72,7 +70,16 @@ public class OrderRefundController { |
|
|
|
|
if (body == null || StringUtils.isBlank(body.getString("orderNo"))) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单"); |
|
|
|
|
} |
|
|
|
|
orderService.refundOrder(body.getString("orderNo"), body.getString("remarks")); |
|
|
|
|
// 查询订单
|
|
|
|
|
HighOrder order = orderService.getOrderDetailByNo(body.getString("orderNo")); |
|
|
|
|
if (order == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单"); |
|
|
|
|
} |
|
|
|
|
if (!order.getOrderStatus().equals(OrderStatus.STATUS2.getNumber()) |
|
|
|
|
&& !order.getOrderStatus().equals(OrderStatus.STATUS3.getNumber())) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误"); |
|
|
|
|
} |
|
|
|
|
orderService.refundOrder(order, body.getString("remarks")); |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success("退款成功"); |
|
|
|
|
|
|
|
|
@ -122,7 +129,6 @@ public class OrderRefundController { |
|
|
|
|
if (userModel == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.USE_VISIT_ILLEGAL, ""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(orderRefundService.getRefundByRefundNo(refundOrderNo)); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|