郑永安
2023-06-19 7a6abd05683528032687c75e80e0bd2030a3e46c
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
package com.gkhy.safePlatform.riskCtrl.controller;
 
import com.gkhy.safePlatform.commons.vo.ResultVO;
import com.gkhy.safePlatform.riskCtrl.enums.ReportBizEnum;
import com.gkhy.safePlatform.riskCtrl.model.dto.resp.RiskMonthReportRespDTO;
import com.gkhy.safePlatform.riskCtrl.service.RiskReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import javax.validation.constraints.NotNull;
import java.util.List;
 
@RestController
@RequestMapping("riskCtrl/risk/report")
public class RiskReportController {
 
    @Autowired
    private RiskReportService riskReportService;
 
    @RequestMapping("/singleMonth/prevent")
    public Object getPreventMonthReport(@RequestParam(required = true)@NotNull Long depId,
                                 @RequestParam(required = true)@NotNull Integer year,
                                 @RequestParam(required = true)@NotNull Integer month){
        ResultVO<RiskMonthReportRespDTO> resultVO = riskReportService.getReportByMonth(depId, ReportBizEnum.PREVENT_RISK.getType(), year,
                month);
        return resultVO;
    }
 
    @RequestMapping("/singleMonth/emergency")
    public Object getEmergencyMonthReport(@RequestParam(required = true)@NotNull Long depId,
                                 @RequestParam(required = true)@NotNull Integer year,
                                 @RequestParam(required = true)@NotNull Integer month){
        ResultVO<RiskMonthReportRespDTO> resultVO = riskReportService.getReportByMonth(depId,
                ReportBizEnum.EMERGENCY_PRACTICE.getType(), year,
                month);
        return resultVO;
    }
 
    @RequestMapping("/singleMonth/incident")
    public Object getIncidentMonthReport(@RequestParam(required = true)@NotNull Long depId,
                                 @RequestParam(required = true)@NotNull Integer year,
                                 @RequestParam(required = true)@NotNull Integer month){
        ResultVO<RiskMonthReportRespDTO> resultVO = riskReportService.getReportByMonth(depId,
                ReportBizEnum.INCIDENT_COUNT.getType(), year,
                month);
        return resultVO;
    }
 
    //------------公司级报表------------------
    @RequestMapping("/singleMonth/prevent/company")
    public Object getPreventMonthReport(@RequestParam(required = true)@NotNull Integer year,
                                        @RequestParam(required = true)@NotNull Integer month){
        ResultVO<RiskMonthReportRespDTO> resultVO = riskReportService.getCompanyReportByMonth(ReportBizEnum.PREVENT_RISK.getType(), year, month);
        return resultVO;
    }
 
    @RequestMapping("/singleMonth/emergency/company")
    public Object getEmergencyMonthReport(@RequestParam(required = true)@NotNull Integer year,
                                          @RequestParam(required = true)@NotNull Integer month){
        ResultVO<RiskMonthReportRespDTO> resultVO = riskReportService.getCompanyReportByMonth(ReportBizEnum.EMERGENCY_PRACTICE.getType(), year, month);
        return resultVO;
    }
 
    @RequestMapping("/singleMonth/incident/company")
    public Object getIncidentMonthReport(@RequestParam(required = true)@NotNull Integer year,
                                         @RequestParam(required = true)@NotNull Integer month){
        ResultVO<RiskMonthReportRespDTO> resultVO = riskReportService.getCompanyReportByMonth(ReportBizEnum.INCIDENT_COUNT.getType(), year, month);
        return resultVO;
    }
 
    //------------指定年份报表------------------
 
    /**
     * 获取指定部门的指定年度双重预发隐患统计报表
     * @param depId
     * @param year
     * @param month
     * @return
     */
    @RequestMapping("/year/prevent/department")
    public Object getDepartmentYearPreventReport(@RequestParam(required = true)@NotNull Long depId,
                                                  @RequestParam(required = true)@NotNull Integer year,
                                                  @RequestParam(required = true)@NotNull Integer month){
        ResultVO<List<RiskMonthReportRespDTO>> resultVO = riskReportService.getDepartmentReportByYear(depId,
                ReportBizEnum.PREVENT_RISK.getType(), year);
        return resultVO;
    }
 
    /**
     * 获取指定部门的指定年度应急演练统计统计报表
     * @param depId
     * @param year
     * @param month
     * @return
     */
    @RequestMapping("/year/emergency/department")
    public Object getDepartmentYearEmergencyReport(@RequestParam(required = true)@NotNull Long depId,
                                                  @RequestParam(required = true)@NotNull Integer year,
                                                  @RequestParam(required = true)@NotNull Integer month){
        ResultVO<List<RiskMonthReportRespDTO>> resultVO = riskReportService.getDepartmentReportByYear(depId,
                ReportBizEnum.EMERGENCY_PRACTICE.getType(), year);
        return resultVO;
    }
 
    /**
     * 获取指定部门的指定年度事故统计报表
     * @param depId
     * @param year
     * @param month
     * @return
     */
    @RequestMapping("/year/incident/department")
    public Object getDepartmentYearIncidentReport(@RequestParam(required = true)@NotNull Long depId,
                                         @RequestParam(required = true)@NotNull Integer year,
                                         @RequestParam(required = true)@NotNull Integer month){
        ResultVO<List<RiskMonthReportRespDTO>> resultVO = riskReportService.getDepartmentReportByYear(depId,
                ReportBizEnum.INCIDENT_COUNT.getType(), year);
        return resultVO;
    }
 
    //---公司报表
 
    /**
     * 获取指定部门的指定年度双重预发隐患统计报表
     * @param year
     * @return
     */
    @RequestMapping("/year/prevent/company")
    public Object getCompanyYearPreventReport(@RequestParam(required = true)@NotNull Integer year){
        ResultVO<List<RiskMonthReportRespDTO>> resultVO = riskReportService.getCompanyReportByYear(ReportBizEnum.PREVENT_RISK.getType(), year);
        return resultVO;
    }
 
    /**
     * 获取指定部门的指定年度应急演练统计统计报表
     * @param year
     * @return
     */
    @RequestMapping("/year/emergency/company")
    public Object getCompanyYearEmergencyReport(@RequestParam(required = true)@NotNull Integer year){
        ResultVO<List<RiskMonthReportRespDTO>> resultVO =
                riskReportService.getCompanyReportByYear(ReportBizEnum.EMERGENCY_PRACTICE.getType(), year);
        return resultVO;
    }
 
    /**
     * 获取指定部门的指定年度事故统计报表
     * @param year
     * @return
     */
    @RequestMapping("/year/incident/company")
    public Object getCompanyYearIncidentReport(@RequestParam(required = true)@NotNull Integer year){
        ResultVO<List<RiskMonthReportRespDTO>> resultVO = riskReportService.getCompanyReportByYear(ReportBizEnum.INCIDENT_COUNT.getType(), year);
        return resultVO;
    }
 
    //------------------指定月份区间的报表-------------------
 
    /**
     * 获取指定部门的指定月份区间双重预发隐患统计报表
     * @param depId
     * @param beginYear
     * @param beginMonth
     * @param endYear
     * @param endMonth
     * @return
     */
    @RequestMapping("/multipleMonth/prevent/department")
    public Object getDepartmentMultipleMonthPreventReport(@RequestParam(required = true)@NotNull Long depId,
                                                 @RequestParam(required = true)@NotNull Integer beginYear,
                                                 @RequestParam(required = true)@NotNull Integer beginMonth,
                                                 @RequestParam(required = true)@NotNull Integer endYear,
                                                 @RequestParam(required = true)@NotNull Integer endMonth){
        ResultVO<List<RiskMonthReportRespDTO>> resultVO = riskReportService.getDepartmentReportByMultipleMonth(depId,
                ReportBizEnum.PREVENT_RISK.getType(), beginYear,beginMonth,endYear,endMonth);
        return resultVO;
    }
 
    /**
     * 获取指定部门的直属子部门在指定月份区间双重预发隐患统计报表
     * @param depId
     * @param beginYear
     * @param beginMonth
     * @param endYear
     * @param endMonth
     * @return
     */
    @RequestMapping("/multipleMonth/prevent/subDepartments")
    public Object getSubDepartmentMultipleMonthPreventReport(@RequestParam(required = true)@NotNull Long depId,
                                                          @RequestParam(required = true)@NotNull Integer beginYear,
                                                          @RequestParam(required = true)@NotNull Integer beginMonth,
                                                          @RequestParam(required = true)@NotNull Integer endYear,
                                                          @RequestParam(required = true)@NotNull Integer endMonth){
        ResultVO<List<RiskMonthReportRespDTO>> resultVO = riskReportService.getSubDepartmentReportByMultipleMonth(depId,
                ReportBizEnum.PREVENT_RISK.getType(), beginYear,beginMonth,endYear,endMonth);
        return resultVO;
    }
 
    /**
     * 获取指定部门的指定月份区间事故统计报表
     * @param depId
     * @param beginYear
     * @param beginMonth
     * @param endYear
     * @param endMonth
     * @return
     */
    @RequestMapping("/multipleMonth/incident/department")
    public Object getDepartmentMultipleMonthIncidentReport(@RequestParam(required = true)@NotNull Long depId,
                                                 @RequestParam(required = true)@NotNull Integer beginYear,
                                                 @RequestParam(required = true)@NotNull Integer beginMonth,
                                                 @RequestParam(required = true)@NotNull Integer endYear,
                                                 @RequestParam(required = true)@NotNull Integer endMonth){
        ResultVO<List<RiskMonthReportRespDTO>> resultVO = riskReportService.getDepartmentReportByMultipleMonth(depId,
                ReportBizEnum.INCIDENT_COUNT.getType(), beginYear,beginMonth,endYear,endMonth);
        return resultVO;
    }
 
    /**
     * 获取指定部门的指定月份区间应急演练统计报表
     * @param depId
     * @param beginYear
     * @param beginMonth
     * @param endYear
     * @param endMonth
     * @return
     */
    @RequestMapping("/multipleMonth/emergency/department")
    public Object getDepartmentMultipleMonthEmergencyReport(@RequestParam(required = true)@NotNull Long depId,
                                                  @RequestParam(required = true)@NotNull Integer beginYear,
                                                  @RequestParam(required = true)@NotNull Integer beginMonth,
                                                  @RequestParam(required = true)@NotNull Integer endYear,
                                                  @RequestParam(required = true)@NotNull Integer endMonth){
        ResultVO<List<RiskMonthReportRespDTO>> resultVO = riskReportService.getDepartmentReportByMultipleMonth(depId,
                ReportBizEnum.EMERGENCY_PRACTICE.getType(), beginYear,beginMonth,endYear,endMonth);
        return resultVO;
    }
 
 
 
}