KKSU
2024-07-08 871acd6b6a92b26f23fe72cf55ef1fcf2ba5a9b7
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
package cc.mrbird.febs.dapp.controller;
 
import cc.mrbird.febs.common.annotation.ControllerEndpoint;
import cc.mrbird.febs.common.controller.BaseController;
import cc.mrbird.febs.common.entity.FebsResponse;
import cc.mrbird.febs.common.entity.QueryRequest;
import cc.mrbird.febs.common.utils.FebsUtil;
import cc.mrbird.febs.dapp.entity.DappAccountMoneyChangeEntity;
import cc.mrbird.febs.dapp.entity.DappFundFlowEntity;
import cc.mrbird.febs.dapp.service.DappWalletService;
import cc.mrbird.febs.system.entity.User;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.validation.constraints.NotNull;
 
/**
 * @author 
 * @date 2022-03-22
 **/
@Slf4j
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping(value = "flow")
public class MemberMoneyFlowController extends BaseController {
 
    private final DappWalletService dappWalletService;
 
    @RequestMapping(value = "/fundFlow")
    public FebsResponse fundFlow(DappFundFlowEntity dappFundFlowEntity, QueryRequest request) {
        User currentUser = FebsUtil.getCurrentUser();
        if (currentUser.getDeptId() == null) {
            dappFundFlowEntity.setCurrentUser(currentUser.getUserId());
        }
        return new FebsResponse().success().data(getDataTable(dappWalletService.fundFlowInPage(dappFundFlowEntity, request)));
    }
 
    @RequestMapping(value = "accountMoneyChangeFlow")
    public FebsResponse accountMoneyChangeFlow(DappAccountMoneyChangeEntity record, QueryRequest request) {
        return new FebsResponse().success().data(getDataTable(dappWalletService.accountMoneyChangeInPage(record, request)));
    }
 
    /**
     * 提现转账列表-同意
     */
    @PostMapping("withdrawAgree/{id}")
    @ControllerEndpoint(operation = "提现转账列表-同意", exceptionMessage = "操作失败")
    public FebsResponse agreeWithdraw(@NotNull(message = "{required}") @PathVariable Long id) {
        return dappWalletService.agreeWithdraw(id);
    }
 
    /**
     * 提现转账列表-拒绝
     */
    @PostMapping("withdrawDisAgree/{id}")
    @ControllerEndpoint(operation = "提现转账列表-拒绝", exceptionMessage = "操作失败")
    public FebsResponse disagreeWithdraw(@NotNull(message = "{required}") @PathVariable Long id) {
        return dappWalletService.disagreeWithdraw(id);
    }
}