MrShi
9 小时以前 e50954f0708ecbbc672352102ae3b24279d40cc1
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
package com.doumee.api.web;
 
import com.doumee.core.annotation.LoginRequired;
import com.doumee.core.annotation.LoginShopRequired;
import com.doumee.core.model.ApiResponse;
import com.doumee.dao.dto.WithdrawalDTO;
import com.doumee.dao.vo.RevenueStatisticsVO;
import com.doumee.service.business.RevenueService;
import com.doumee.service.business.WithdrawalOrdersService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2026/4/16 18:05
 */
@Api(tags = "钱包业务")
@RestController
@RequestMapping("/web/wallet")
public class WalletApi extends ApiController{
 
 
 
    @Autowired
    private WithdrawalOrdersService withdrawalOrdersService;
 
    @Autowired
    private RevenueService revenueService;
 
    @LoginRequired
    @ApiOperation(value = "司机提现申请", notes = "小程序端")
    @PostMapping("/driverApply")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse driverApply(@RequestBody @Validated WithdrawalDTO dto) {
        withdrawalOrdersService.applyDriverWithdrawal(dto, getMemberId());
        return ApiResponse.success("提现申请已提交");
    }
 
    @LoginShopRequired
    @ApiOperation(value = "门店提现申请", notes = "小程序端")
    @PostMapping("/shopApply")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "门店token值", required = true),
    })
    public ApiResponse shopApply(@RequestBody @Validated WithdrawalDTO dto) {
        withdrawalOrdersService.applyShopWithdrawal(dto, getShopId());
        return ApiResponse.success("提现申请已提交");
    }
 
    @LoginShopRequired
    @ApiOperation(value = "门店收益统计", notes = "当前登录门店的收益/提现统计")
    @GetMapping("/shopStatistics")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "门店token值", required = true)
    })
    public ApiResponse<RevenueStatisticsVO> shopStatistics() {
        return ApiResponse.success("查询成功", revenueService.getShopRevenueStatistics(getShopId()));
    }
 
    @LoginRequired
    @ApiOperation(value = "司机收益统计", notes = "当前登录司机的收益/提现统计")
    @GetMapping("/driverStatistics")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true)
    })
    public ApiResponse<RevenueStatisticsVO> driverStatistics() {
        return ApiResponse.success("查询成功", revenueService.getDriverRevenueStatistics(getMemberId()));
    }
 
}