huliguo
2025-06-05 0a492b64ca1a4e40cc9ea56eddd1afe2c09a12b3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/FinanceController.java
@@ -1,11 +1,21 @@
package com.ruoyi.web.controller.system;
import com.ruoyi.system.mapper.WithdrawMapper;
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.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -17,28 +27,61 @@
    @Resource
    private WithdrawService withdrawService;
    @Resource
    private OrderService orderService;
    /**
     * 财务流水-顶部
     */
    @PostMapping("/top")
    @ApiOperation(value = "财务流水-顶部")
    @PreAuthorize("@ss.hasPermi('finance:flows')")
    public R<FinanceFlowsTopVO> top(){
        return R.ok(orderService.financeTop());
    }
    /**
     * 财务流水-分页
     */
    @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();
    }
}