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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
package com.finance.web.controller.api.screen;
 
import com.finance.common.core.domain.R;
import com.finance.common.core.domain.entity.SysUser;
import com.finance.common.utils.BeanUtils;
import com.finance.system.query.CalculateDetailQuery;
import com.finance.system.query.DeptCalculateDetailQuery;
import com.finance.system.service.ISysUserService;
import com.finance.system.service.TbScoreService;
import com.finance.system.vo.CurrentFieldsDetailVO;
import com.finance.system.vo.DataAnalysisVO;
import com.finance.system.vo.DeptCalculateDetailVO;
import com.finance.system.vo.DeptVO;
import com.finance.system.vo.QuestionVO;
import com.finance.system.vo.ScoreCalculateDetailVO;
import com.finance.web.controller.service.ScreenService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * @author mitao
 * @date 2024/4/15
 */
@Slf4j
@RestController
@RequestMapping("/screen")
@RequiredArgsConstructor
@Api(tags = "大屏分析评估系统接口")
public class ScreenInnerController {
 
    private final ISysUserService sysUserService;
    private final ScreenService screenService;
    private final TbScoreService tbScoreService;
 
    @ApiOperation("部门列表-区县下拉框")
    @GetMapping("/dept-list")
    @ApiImplicitParam(name = "areaCode", value = "市级区划代码", dataType = "String", dataTypeClass = String.class)
    public R<List<DeptVO>> deptList(String areaCode) {
        List<SysUser> list = screenService.getCountyList(areaCode);
        return R.ok(BeanUtils.copyList(list, DeptVO.class));
    }
 
    //    @ApiOperation(value = "监管发现问题")
    @GetMapping("/questions")
    public R<List<QuestionVO>> queryQuestions() {
        try {
            return R.ok(screenService.queryQuestions());
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
 
    @ApiOperation("数据分析系统页面数据")
    @GetMapping("/data")
    public R<DataAnalysisVO> getDataAnalysis(@RequestParam("areaCode") String areaCode) {
        try {
            return R.ok(screenService.getDataAnalysis(areaCode));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
 
    @ApiOperation("获取点击字段弹窗数据")
    @PostMapping("/fields-detail")
    public R<ScoreCalculateDetailVO> fieldsDetail(
            @Validated @RequestBody CalculateDetailQuery query) {
        return R.ok(screenService.fieldsDetail(query));
    }
 
    @ApiOperation("获取点击部门得分弹窗数据")
    @PostMapping("/dept-detail")
    public R<List<DeptCalculateDetailVO>> deptDetail(
            @Validated @RequestBody DeptCalculateDetailQuery query) {
        try {
            return R.ok(screenService.deptCalculateDetail(query));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
 
    @ApiOperation("查看原始数据")
    @GetMapping("/view-raw-data")
    public R<CurrentFieldsDetailVO> viewRawData(@RequestParam("areaCode") String areaCode) {
        try {
            return R.ok(screenService.viewRawData(areaCode));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}