zhangf
2024-05-08 0414ddb0b2b3a7199ae6181a770f97ac140dbd73
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
package com.gkhy.safePlatform.incidentManage.controller;
 
import com.gkhy.safePlatform.commons.enums.ResultCodes;
import com.gkhy.safePlatform.commons.vo.ResultVO;
import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentReportCountRespDTO;
import com.gkhy.safePlatform.incidentManage.model.dto.resp.AccidentStatisticDTO;
import com.gkhy.safePlatform.incidentManage.model.dto.resp.StatisticsDepLevelMonthAccidentRespDTO;
import com.gkhy.safePlatform.incidentManage.model.dto.resp.StatisticsDeptLevelYearAccidentRespDTO;
import com.gkhy.safePlatform.incidentManage.query.AccidentReportCountQuery;
import com.gkhy.safePlatform.incidentManage.query.IncidentManageCountQuery;
import com.gkhy.safePlatform.incidentManage.rpc.api.model.dto.req.IncidentManageCountRPCReq;
import com.gkhy.safePlatform.incidentManage.rpc.api.model.dto.resp.IncidentManageRPCResp;
import com.gkhy.safePlatform.incidentManage.service.AccidentCountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
@RestController
@RequestMapping("/accidentCount")
public class AccidentCountController {
 
    @Autowired
    private AccidentCountService accidentCountService;
 
 
    /**
     * 事故报告统计的rpc接口
     */
    @RequestMapping(value = "/accidentReport/count",method = RequestMethod.POST)
    public ResultVO<List<AccidentReportCountRespDTO>> countAccidentReport(@RequestBody AccidentReportCountQuery query){
        return accidentCountService.countAccidentReport(query);
    }
 
    /**
     * 事故报告统计的rpc接口
     */
    @RequestMapping(value = "/getCountByDeptId/count",method = RequestMethod.POST)
    public ResultVO<IncidentManageRPCResp> getCountByDeptId(@RequestBody IncidentManageCountRPCReq query){
        return accidentCountService.getCountByDeptId(query);
    }
 
    /**
     * 事故报告统计的rpc接口
     */
    @RequestMapping(value = "/getCountByDeptIds/count",method = RequestMethod.POST)
    public ResultVO<List<IncidentManageRPCResp>> getCountByDeptIds(@RequestBody IncidentManageCountRPCReq query){
        return accidentCountService.getCountByDeptIds(query);
    }
 
    @RequestMapping(value = "/getCountByDeptIdAndMonth/count",method = RequestMethod.POST)
    public StatisticsDepLevelMonthAccidentRespDTO getCountByDeptIdAndMonth(@RequestBody IncidentManageCountQuery query){
        return accidentCountService.getCountByDeptIdAndMonth(query);
    }
    @RequestMapping(value = "/getCountByDeptIdAndYear/count",method = RequestMethod.POST)
    public StatisticsDeptLevelYearAccidentRespDTO getCountByDeptIdAndYear(@RequestBody IncidentManageCountQuery query){
        return accidentCountService.getCountByDeptIdAndYear(query);
    }
 
    @RequestMapping(value = "/getCountByDeptIdsAndMonth/count",method = RequestMethod.POST)
    public List<StatisticsDepLevelMonthAccidentRespDTO> getCountByDeptIdsAndMonth(@RequestBody IncidentManageCountQuery query){
        return accidentCountService.getCountByDeptIdsAndMonth(query);
    }
    @RequestMapping(value = "/getCountByDeptIdsAndYear/count",method = RequestMethod.POST)
    public List<StatisticsDeptLevelYearAccidentRespDTO> getCountByDeptIdsAndYear(@RequestBody IncidentManageCountQuery query){
        return accidentCountService.getCountByDeptIdsAndYear(query);
    }
    /**
     * 事故统计,根据事故级别统计
     */
    @RequestMapping(value = "/accidentGrade/count",method = RequestMethod.GET)
    public ResultVO getCountByAccidentGrade(Integer year, Integer month){
        return new ResultVO<>(ResultCodes.OK,accidentCountService.getCountByAccidentGrade(year, month));
    }
 
}