liujie
2025-07-17 c196e41a7c9f2bd845d189486069c416eca9c968
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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();
    }
}