package com.ruoyi.web.controller.system;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.system.pojo.dto.FinanceFlowsDTO;
|
import com.ruoyi.system.pojo.dto.WithDrawAgreeDTO;
|
import com.ruoyi.system.pojo.dto.WithDrawRefuseDTO;
|
import com.ruoyi.system.pojo.dto.WithdrawPageDTO;
|
import com.ruoyi.system.pojo.vo.FinanceFlowsPageVO;
|
import com.ruoyi.system.pojo.vo.FinanceFlowsTopVO;
|
import com.ruoyi.system.pojo.vo.WithdrawPageVO;
|
import com.ruoyi.system.service.OrderService;
|
import com.ruoyi.system.service.WithdrawService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
|
@Slf4j
|
@RestController
|
@RequestMapping("/system/finance")
|
@Api( tags = "后台-财务管理")
|
public class FinanceController {
|
|
@Resource
|
private WithdrawService withdrawService;
|
@Resource
|
private OrderService orderService;
|
|
/**
|
* 财务流水-顶部
|
*/
|
@PostMapping("/top")
|
@ApiOperation(value = "财务流水-顶部")
|
@PreAuthorize("@ss.hasPermi('finance:flows')")
|
public R<FinanceFlowsTopVO> top(@RequestBody FinanceFlowsDTO dto){
|
return R.ok(orderService.financeTop(dto));
|
}
|
|
/**
|
* 财务流水-分页
|
*/
|
|
@PostMapping("/flows/page")
|
@ApiOperation(value = "财务流水-分页")
|
@PreAuthorize("@ss.hasPermi('finance:flows')")
|
public R<IPage<FinanceFlowsPageVO>> flowsPage(@RequestBody FinanceFlowsDTO dto){
|
return R.ok(orderService.flowsPage(dto));
|
}
|
|
/**
|
* 提现申请-分页
|
*/
|
@PostMapping("/withdraw/page")
|
@ApiOperation(value = "提现申请-分页")
|
@PreAuthorize("@ss.hasPermi('finance:apply')")
|
public R<IPage<WithdrawPageVO>> withdrawPage(@RequestBody WithdrawPageDTO dto){
|
return R.ok(withdrawService.withdrawPage(dto));
|
}
|
|
/**
|
* 同意
|
*/
|
|
@PutMapping("/withdraw/agree")
|
@ApiOperation(value = "提现申请-同意")
|
@PreAuthorize("@ss.hasPermi('finance:flows')")
|
public R<Void> agree(@RequestBody WithDrawAgreeDTO dto){
|
withdrawService.agree(dto);
|
return R.ok();
|
}
|
|
|
/**
|
* 拒绝
|
*/
|
@PutMapping("/withdraw/refuse")
|
@ApiOperation(value = "提现申请-拒绝")
|
@PreAuthorize("@ss.hasPermi('finance:flows')")
|
public R<Void> refuse(@RequestBody WithDrawRefuseDTO dto){
|
withdrawService.refuse(dto);
|
return R.ok();
|
}
|
}
|