mitao
2024-04-19 b21c37b7899b17dede7773db3c799aab1063ae1c
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
package com.finance.web.controller.api.screen;
 
import com.finance.common.basic.PageDTO;
import com.finance.common.core.domain.R;
import com.finance.system.query.TransferPaymentScaleQuery;
import com.finance.system.service.ISysUserService;
import com.finance.system.vo.BasicDataVO;
import com.finance.system.vo.ProvinceStaticsVO;
import com.finance.system.vo.RiskAndTransferVO;
import com.finance.system.vo.RiskRankingVO;
import com.finance.system.vo.TransferPaymentScaleVO;
import com.finance.web.controller.service.ScreenService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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;
 
/**
 * @author mitao
 * @date 2024/4/15
 */
@Slf4j
@RestController
@RequestMapping("/screen")
@RequiredArgsConstructor
@Api(tags = "大屏财政运行总体接口")
public class ScreenGeneralController {
 
    private final ISysUserService sysUserService;
    private final ScreenService screenService;
 
    @ApiOperation("全省统计数")
    @GetMapping("/province-statics")
    public R<ProvinceStaticsVO> provinceStatics() {
        ProvinceStaticsVO vo = screenService.provinceStatics();
        return R.ok(vo);
    }
 
    @ApiOperation(value = "风险等级分布占比/得分分布/转移支付规模")
    @GetMapping("/risk-and-payment-scale")
    public R<RiskAndTransferVO> getRiskAndTransfer() {
        RiskAndTransferVO vo = null;
        try {
            vo = screenService.getRiskAndTransfer();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return R.ok(vo);
    }
 
    @ApiOperation("转移支付规模季度列表")
    @GetMapping("/quarter-list")
    public R<List<BasicDataVO>> quarterList() {
        return R.ok(screenService.quarterList());
    }
 
    @ApiOperation("转移支付规模分页查询")
    @PostMapping("/transfer-payment-scale-page")
    public R<PageDTO<TransferPaymentScaleVO>> transferPaymentScalePage(@Validated
    @RequestBody TransferPaymentScaleQuery query) {
        PageDTO<TransferPaymentScaleVO> page = screenService.transferPaymentScalePage(query);
        return R.ok(page);
    }
 
    @ApiOperation("区/县风险排名前十")
    @GetMapping("/risk-ranking")
    public R<List<RiskRankingVO>> riskRanking() {
        try {
            return R.ok(screenService.riskRanking());
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}