liurunyu
2025-02-10 a2d5f396dcee51917d333e42a977a544091e5389
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
package com.dy.pipIrrStatistics.largeScreen;
 
import com.dy.common.aop.SsoAop;
import com.dy.common.util.DateTime;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.voLargeScreen.VoBaseInfo;
import com.dy.pipIrrGlobal.voLargeScreen.VoCurrentInfo;
import com.dy.pipIrrGlobal.voLargeScreen.VoMonitorInfo;
import com.dy.pipIrrGlobal.voSpecial.VoTopXClient;
import com.dy.pipIrrGlobal.voSpecial.VoTopXIntake;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.Date;
import java.util.List;
 
/**
 * @Author: liurunyu
 * @Date: 2025/2/6 10:32
 * @Description
 */
@Slf4j
@Tag(name = "大屏展示", description = "大屏展示---统计信息")
@RestController
@RequestMapping(path = "ls4Statistics")
@SuppressWarnings("unchecked")//java版本越高,对泛型约束越严,所以配置SuppressWarnings("unchecked")
public class Ls4StatisticsCtrl {
 
    private Ls4StatisticsSv sv;
 
    @Autowired
    private void setSv(Ls4StatisticsSv sv) {
        this.sv = sv;
    }
 
 
    /**
     * 大屏展示---基本信息
     * @return 基本信息
     */
    @Operation(summary = "大屏展示", description = "基本信息")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "基本信息(BaseResponse.content:VoBaseInfo{})",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoBaseInfo.class))}
            )
    })
    @GetMapping(path = "baseInfo")
    @SsoAop()
    public BaseResponse<VoBaseInfo> baseInfo() {
        VoBaseInfo res = this.sv.baseInfo();
        return BaseResponseUtils.buildSuccess(res);
    }
 
 
    /**
     * 大屏展示---当前信息
     * @return 当前信息
     */
    @Operation(summary = "大屏展示", description = "当前信息")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "基本信息(BaseResponse.content:VoCurrentInfo{})",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoCurrentInfo.class))}
            )
    })
    @GetMapping(path = "currentInfo")
    @SsoAop()
    public BaseResponse<VoCurrentInfo> currentInfo() throws Exception {
        VoCurrentInfo res = this.sv.currentInfo();
        return BaseResponseUtils.buildSuccess(res);
    }
 
    /**
     * 大屏展示---监测信息
     * @return 监测信息
     * @param fromDt 开始日期(格式 yyyy-mm-dd)
     */
    @Operation(summary = "大屏展示", description = "监测信息")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "基本信息(BaseResponse.content:VoMonitorInfo{})",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoMonitorInfo.class))}
            )
    })
    @GetMapping(path = "monitorInfo")
    @SsoAop()
    public BaseResponse<VoMonitorInfo> monitorInfo(String fromDt) throws Exception {
        if(fromDt == null || fromDt.trim().equals("")){
            return BaseResponseUtils.buildException("开始日期不能为空");
        }
        Date startDt = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(fromDt + " 00:00:00");
        VoMonitorInfo res = this.sv.monitorInfo(startDt);
        return BaseResponseUtils.buildSuccess(res);
    }
 
 
 
    /**
     * 昨日农户用水前5名
     * @return 数据集合
     */
    @Operation(summary = "昨日农户用水前5名", description = "昨日农户用水前5名统计")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "昨日农户用水前5名统计(BaseResponse.content:[VoTopXClient{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoTopXClient.class))}
            )
    })
    @GetMapping(path = "top5ClientYesterday")
    @SsoAop()
    public BaseResponse<List<VoTopXClient>> top5ClientYesterday(){
        List<VoTopXClient> res = this.sv.top5ClientYesterday();
        return BaseResponseUtils.buildSuccess(res);
    }
 
    /**
     * 昨日取水口用水前5名
     * @return 数据集合
     */
    @Operation(summary = "昨日取水口用水前5名", description = "昨日取水口用水前5名统计")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "昨日取水口用水前5名统计(BaseResponse.content:[VoTopXIntake{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoTopXIntake.class))}
            )
    })
    @GetMapping(path = "top5IntakeYesterday")
    @SsoAop()
    public BaseResponse<List<VoTopXIntake>> top5IntakeYesterday(){
        List<VoTopXIntake> res = this.sv.top5IntakeYesterday();
        return BaseResponseUtils.buildSuccess(res);
    }
 
 
}