2025-11-14 17:49:46 +08:00
|
|
|
|
package com.cdzy.operations.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import com.cdzy.common.enums.Code;
|
|
|
|
|
|
import com.cdzy.common.ex.EbikeException;
|
|
|
|
|
|
import com.cdzy.common.model.response.JsonResult;
|
|
|
|
|
|
import com.ebike.feign.clients.UserFeignClient;
|
|
|
|
|
|
import com.ebike.feign.model.dto.FeignEbikeRefundProcessDto;
|
2025-11-19 12:56:28 +08:00
|
|
|
|
import com.ebike.feign.model.dto.FeignEbikeRefundQueryDto;
|
2025-11-14 17:49:46 +08:00
|
|
|
|
import jakarta.annotation.Resource;
|
2025-11-19 12:56:28 +08:00
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
2025-11-14 17:49:46 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
2025-11-17 16:00:56 +08:00
|
|
|
|
* 退款审核 控制层。
|
2025-11-19 12:56:28 +08:00
|
|
|
|
*
|
2025-11-14 17:49:46 +08:00
|
|
|
|
* @author yanglei
|
|
|
|
|
|
* @since 2025-11-14 16:58
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
|
|
@RequestMapping("/ebikeRefundReview")
|
|
|
|
|
|
public class EbikeRefundReviewController {
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
private UserFeignClient userFeignClient;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 审核退款申请
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param processDto 退款处理信息
|
|
|
|
|
|
* @return 审核成功返回true,否则返回false
|
|
|
|
|
|
*/
|
|
|
|
|
|
@PostMapping("/reviewRefund")
|
|
|
|
|
|
public JsonResult<?> reviewRefund(@RequestBody FeignEbikeRefundProcessDto processDto) {
|
|
|
|
|
|
JsonResult<Boolean> jsonResult = userFeignClient.reviewRefund(processDto);
|
|
|
|
|
|
if (jsonResult.getCode() != Code.SUCCESS) {
|
|
|
|
|
|
throw new EbikeException("调用审核退款申请失败");
|
|
|
|
|
|
}
|
|
|
|
|
|
Boolean result = jsonResult.getData();
|
|
|
|
|
|
return JsonResult.success(result);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-19 12:56:28 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取用户退款列表
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param refundQueryDto 退款查询参数
|
|
|
|
|
|
* @return 退款列表
|
|
|
|
|
|
*/
|
|
|
|
|
|
@PostMapping("/queryRefundList")
|
|
|
|
|
|
public JsonResult<?> getRefundList(@RequestBody FeignEbikeRefundQueryDto refundQueryDto) {
|
|
|
|
|
|
JsonResult<?> jsonResult = userFeignClient.getRefundList(refundQueryDto);
|
|
|
|
|
|
if (jsonResult.getCode() != Code.SUCCESS) {
|
|
|
|
|
|
throw new EbikeException("获取退款审核列表失败");
|
|
|
|
|
|
}
|
|
|
|
|
|
return JsonResult.success(jsonResult.getData());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取退款订单详情
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param refundId 退款主键Id
|
|
|
|
|
|
* @return 退款订单详情
|
|
|
|
|
|
*/
|
|
|
|
|
|
@GetMapping("/refundOrderDetail/{refundId}")
|
|
|
|
|
|
JsonResult<?> refundOrderDetail(@PathVariable(name = "refundId") Long refundId) {
|
|
|
|
|
|
JsonResult<?> jsonResult = userFeignClient.refundOrderDetail(refundId);
|
|
|
|
|
|
if (jsonResult.getCode() != Code.SUCCESS) {
|
|
|
|
|
|
throw new EbikeException("获取退款详情失败");
|
|
|
|
|
|
}
|
|
|
|
|
|
return JsonResult.success(jsonResult.getData());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-14 17:49:46 +08:00
|
|
|
|
}
|