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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
package com.dy.pipIrrRemote.records;
 
import com.dy.common.aop.SsoAop;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.voRm.VoClientAmountDay;
import com.dy.pipIrrGlobal.voRm.VoControllerAlarmState;
import com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay;
import com.dy.pipIrrGlobal.voSe.VoActiveCard;
import com.dy.pipIrrRemote.records.clientAmountDay.ClientAmountDayQueryVo;
import com.dy.pipIrrRemote.records.controllerAlarmState.ControllerAlarmStateQueryVo;
import com.dy.pipIrrRemote.records.intakeAmountDay.IntakeAmountDayQueryVo;
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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
/**
 * @author :WuZeYu
 * @Date :2024/7/22  20:00
 * @LastEditTime :2024/7/22  20:00
 * @Description
 */
@Slf4j
@Tag(name = "检测控制查询", description = "检测控制查询")
@RestController
@RequestMapping(path = "remoteRecords")
public class RecordsCtrl {
    @Autowired
    private RecordsSv recordsSv;
 
 
    /**
     * 根据指定条件获取控制器报警与状态列表(历史)
     *
     * @param vo 查询条件
     * @return 符合条件的控制器报警与状态列表(历史)
     */
    @Operation(summary = "获得一页控制器报警与状态记录", description = "返回一页控制器报警与状态数据")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回一页控制器报警与状态数据(BaseResponse.content:QueryResultVo[{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
    })
    @GetMapping(path = "/getControllerAlarmStateHistory")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoControllerAlarmState>>> getControllerAlarmStateHistory(@RequestBody ControllerAlarmStateQueryVo vo) {
        try {
            QueryResultVo<List<VoControllerAlarmState>> res = recordsSv.getControllerAlarmStateHistory(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取控制器报警与状态记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
 
 
 
    /**
     * 根据指定条件获取控制器报警与状态列表(最新)
     *
     * @param vo 查询条件
     * @return 符合条件的控制器报警与状态列表(最新)
     */
    @Operation(summary = "获得一页控制器报警与状态记录", description = "返回一页控制器报警与状态数据")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回一页控制器报警与状态数据(BaseResponse.content:QueryResultVo[{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
    })
    @GetMapping(path = "/getControllerAlarmStateLast")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoControllerAlarmState>>> getControllerAlarmStateLast(@RequestBody ControllerAlarmStateQueryVo vo) {
        try {
            QueryResultVo<List<VoControllerAlarmState>> res = recordsSv.getControllerAlarmStateLast(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取控制器记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
 
 
    /**
     * 根据指定条件获取农户日用水量统计列表(历史)
     *
     * @param vo 查询条件
     * @return 符合条件的农户日用水量统计列表(历史)
     */
    @Operation(summary = "获得一页农户日用水量统计记录", description = "返回一页农户日用水量统计数据")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回一页农户日用水量统计数据(BaseResponse.content:QueryResultVo[{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
    })
    @GetMapping(path = "/getClientAmountDayHistory")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoClientAmountDay>>> getClientAmountDayHistory(@RequestBody ClientAmountDayQueryVo vo) {
        try {
            QueryResultVo<List<VoClientAmountDay>> res = recordsSv.getClientAmountDayHistory(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取农户日用水量统计记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
 
 
    /**
     * 根据指定条件获取农户日用水量统计列表(最新)
     *
     * @param vo 查询条件
     * @return 符合条件的农户日用水量统计列表(最新)
     */
    @Operation(summary = "获得一页农户日用水量统计记录", description = "返回一页农户日用水量统计数据")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回一页农户日用水量统计数据(BaseResponse.content:QueryResultVo[{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
    })
    @GetMapping(path = "/getClientAmountDayLast")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoClientAmountDay>>> getClientAmountDayLast(@RequestBody ClientAmountDayQueryVo vo) {
        try {
            QueryResultVo<List<VoClientAmountDay>> res = recordsSv.getClientAmountDayLast(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取农户日用水量统计记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
 
 
    /**
     * 根据指定条件获取取水口日取水量漏损列表(历史)
     *
     * @param vo 查询条件
     * @return 符合条件的取水口日取水量漏损列表(历史)
     */
    @Operation(summary = "获得一页取水口日取水量漏损记录", description = "返回一页取水口日取水量漏损数据")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回一页取水口日取水量漏损数据(BaseResponse.content:QueryResultVo[{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
    })
    @GetMapping(path = "/getIntakeAmountDayHistory")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoIntakeAmountDay>>> getIntakeAmountDayHistory(@RequestBody IntakeAmountDayQueryVo vo) {
        try {
            QueryResultVo<List<VoIntakeAmountDay>> res = recordsSv.getIntakeAmountDayHistory(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取农户日用水量统计记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
 
    /**
     * 根据指定条件获取取水口日取水量漏损列表(最新)
     *
     * @param vo 查询条件
     * @return 符合条件的取水口日取水量漏损列表(最新)
     */
    @Operation(summary = "获得一页取水口日取水量漏损记录", description = "返回一页取水口日取水量漏损数据")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回一页取水口日取水量漏损数据(BaseResponse.content:QueryResultVo[{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = VoActiveCard.class))}
            )
    })
    @GetMapping(path = "/getIntakeAmountDayLast")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoIntakeAmountDay>>> getIntakeAmountDayLast(@RequestBody IntakeAmountDayQueryVo vo) {
        try {
            QueryResultVo<List<VoIntakeAmountDay>> res = recordsSv.getIntakeAmountDayLast(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取农户日用水量统计记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
}