147 lines
4.7 KiB
Java
147 lines
4.7 KiB
Java
package com.cdzy.user.controller;
|
||
|
||
import com.cdzy.common.model.response.JsonResult;
|
||
import com.cdzy.user.model.dto.EbikeOrderRefundDto;
|
||
import com.cdzy.user.model.dto.EbikeTreadRecordDto;
|
||
import com.cdzy.user.model.vo.*;
|
||
import com.cdzy.user.service.EbikeRefundService;
|
||
import com.ebike.feign.model.dto.FeignEbikeRefundProcessDto;
|
||
import com.ebike.feign.model.dto.FeignEbikeRefundQueryDto;
|
||
import com.ebike.feign.model.vo.FeignEbikeRefundVo;
|
||
import com.mybatisflex.core.paginate.Page;
|
||
import jakarta.annotation.Resource;
|
||
import org.springframework.web.bind.annotation.*;
|
||
import org.springframework.web.multipart.MultipartFile;
|
||
|
||
/**
|
||
* 用户退款 控制层
|
||
*
|
||
* @author yanglei
|
||
* @since 2025-11-13 20:07
|
||
*/
|
||
|
||
@RestController
|
||
@RequestMapping("/ebikeRefund")
|
||
public class EbikeRefundController {
|
||
|
||
@Resource
|
||
private EbikeRefundService ebikeRefundService;
|
||
|
||
/**
|
||
* 退款申请
|
||
*
|
||
* @param ebikeRefundDto 退款信息
|
||
* @return 退款成功返回主键id,否则返回失败
|
||
*/
|
||
@PostMapping("/refundApply")
|
||
public JsonResult<?> refundApply(@RequestBody EbikeOrderRefundDto ebikeRefundDto) {
|
||
Long refundId = ebikeRefundService.refundApply(ebikeRefundDto);
|
||
return JsonResult.success(refundId);
|
||
}
|
||
|
||
/**
|
||
* 审核退款申请
|
||
*
|
||
* @param processDto 退款处理信息
|
||
* @return 审核成功返回true,否则返回false
|
||
*/
|
||
@PostMapping("/reviewRefund")
|
||
public JsonResult<?> reviewRefund(@RequestBody FeignEbikeRefundProcessDto processDto) {
|
||
boolean result = ebikeRefundService.refundReview(processDto);
|
||
return JsonResult.success(result);
|
||
}
|
||
|
||
/**
|
||
* 获取退款列表
|
||
*
|
||
* @param refundDto 查询条件
|
||
* @return 退款列表
|
||
*/
|
||
@PostMapping("/queryRefundList")
|
||
public JsonResult<?> queryRefundList(@RequestBody FeignEbikeRefundQueryDto refundDto) {
|
||
Page<FeignEbikeRefundVo> list = ebikeRefundService.queryRefundList(refundDto);
|
||
return JsonResult.success(list);
|
||
}
|
||
|
||
/**
|
||
* 退款订单详情
|
||
*
|
||
* @param refundId 退款id
|
||
* @return 退款详情
|
||
*/
|
||
@GetMapping("/refundOrderDetail/{refundId}")
|
||
public JsonResult<?> refundOrderDetail(@PathVariable(name = "refundId") Long refundId) {
|
||
EbikeRefundOrderDetailVo refundOrderDetailVo = ebikeRefundService.queryRefundOrderById(refundId);
|
||
return JsonResult.success(refundOrderDetailVo);
|
||
}
|
||
|
||
/**
|
||
* 退款申请订单详情
|
||
*
|
||
* @param orderId 订单id
|
||
* @return 订单详情
|
||
*/
|
||
@GetMapping("/refundApplyOrderDetail/{orderId}")
|
||
public JsonResult<?> refundApplyOrderDetail(@PathVariable(name = "orderId") Long orderId) {
|
||
EbikeRefundApplyOrderInfoVo refundApplyOrderInfoVo = ebikeRefundService.queryRefundApplyOrderById(orderId);
|
||
return JsonResult.success(refundApplyOrderInfoVo);
|
||
}
|
||
|
||
/**
|
||
* 退款申请用户交易记录
|
||
*
|
||
* @param userQueryDto 查询条件
|
||
*/
|
||
@PostMapping("/refundApplyTradeRecord")
|
||
public JsonResult<?> refundApplyTradeRecord(@RequestBody EbikeTreadRecordDto userQueryDto) {
|
||
Page<EbikeTransactionRecordVo> list = ebikeRefundService.queryRefundTradeRecordById(userQueryDto);
|
||
return JsonResult.success(list);
|
||
}
|
||
|
||
/**
|
||
* 退款申请用户退款记录
|
||
*
|
||
* @param userQueryDto 查询条件
|
||
*/
|
||
@PostMapping("/refundApplyRefundRecord")
|
||
public JsonResult<?> refundApplyRefundRecord(@RequestBody EbikeTreadRecordDto userQueryDto) {
|
||
Page<EbikeRefundApplyRefundRecordVo> list = ebikeRefundService.queryRefundRefundRecordById(userQueryDto);
|
||
return JsonResult.success(list);
|
||
}
|
||
|
||
/**
|
||
* 退款用户订单记录
|
||
*
|
||
* @param userQueryDto 查询条件
|
||
* @return 退款记录列表 List<OrderRecord>
|
||
*/
|
||
@PostMapping("/refundOrderRecords")
|
||
public JsonResult<?> refundOrderRecords(@RequestBody EbikeTreadRecordDto userQueryDto) {
|
||
Page<EbikeOrderRecordVo> list = ebikeRefundService.getRefundOrderRecords(userQueryDto);
|
||
return JsonResult.success(list);
|
||
}
|
||
|
||
/**
|
||
* 上传文件到minio
|
||
*
|
||
* @param multipartFile 文件
|
||
* @return 上传文件信息
|
||
*/
|
||
@PostMapping("uploadFile")
|
||
public JsonResult<?> uploadFile(@RequestParam("multipartFile") MultipartFile multipartFile) {
|
||
EbikeFaultFileVo ebikeAttachmentFileVo = ebikeRefundService.uploadFile(multipartFile);
|
||
return JsonResult.success(ebikeAttachmentFileVo);
|
||
}
|
||
|
||
/**
|
||
* 删除文件数据
|
||
*
|
||
* @param fileName 文件名称
|
||
*/
|
||
@PostMapping("deletedFile")
|
||
public JsonResult<?> deletedFile(@RequestParam("fileName") String fileName) {
|
||
ebikeRefundService.deletedFile(fileName);
|
||
return JsonResult.success();
|
||
}
|
||
}
|