郑永安
2023-09-19 69185134fcfaf913ea45f1255677225a2cc311a4
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
package com.gk.hotwork.doublePrevention.controller;
 
 
import com.gk.hotwork.Domain.Enum.ResultCodes;
import com.gk.hotwork.Domain.Vo.PageInfoExtension;
import com.gk.hotwork.Domain.Vo.ResultVO;
import com.gk.hotwork.doublePrevention.entity.dto.req.StatisticsInspectionCompletedReqDTO;
import com.gk.hotwork.doublePrevention.entity.dto.req.StatisticsInspectionTaskReqDTO;
import com.gk.hotwork.doublePrevention.entity.dto.req.StatisticsInspectorReqDTO;
import com.gk.hotwork.doublePrevention.entity.dto.req.StatisticsPreventDangerPageReqDTO;
import com.gk.hotwork.doublePrevention.service.StatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
import java.util.Map;
 
@RestController
@RequestMapping("prevent/riskEvent/statistics")
public class StatisticsController {
 
    @Autowired
    private StatisticsService statisticsService;
 
 
    /**
     * @Description: 巡检人员统计
     */
    @RequestMapping(value = "/inspectors", method = RequestMethod.POST)
    public ResultVO<List<Map>> inspectorsStatistics(@RequestBody StatisticsInspectorReqDTO reqDTO) {
        List<Map> result = statisticsService.selectInspectorsStatistics(reqDTO);
        return new ResultVO<>(ResultCodes.OK, result);
    }
 
 
    /**
     * @Description: 巡检完成统计
     */
    @RequestMapping(value = "/inspection-completed", method = RequestMethod.POST)
    public ResultVO<List<Map>> inspectionCompleted(@RequestBody StatisticsInspectionCompletedReqDTO reqDTO) {
        List<Map> result = statisticsService.selectInspectionCompleted(reqDTO);
        return new ResultVO<>(ResultCodes.OK, result);
    }
 
 
    /**
     * @Description: 巡检任务统计
     */
    @RequestMapping(value = "/inspection-task", method = RequestMethod.POST)
    public ResultVO<Map<String, List<Map>>> inspectionTask(@RequestBody StatisticsInspectionTaskReqDTO reqDTO) {
        Map<String, List<Map>> result = statisticsService.selectInspectionTask(reqDTO);
        return new ResultVO<>(ResultCodes.OK, result);
    }
 
 
    @RequestMapping(value = "/page", method = RequestMethod.POST)
    public ResultVO selectPage(@RequestBody StatisticsPreventDangerPageReqDTO reqDTO) {
        PageInfoExtension<Map> result = statisticsService.selectPreventDangerPage(reqDTO);
        return new ResultVO<>(ResultCodes.OK, result);
    }
 
    @RequestMapping(value = "/device/level",method = RequestMethod.POST)
    public ResultVO deviceLevel() {
        Map result= statisticsService.countDeviceEveryLevel();
        return new ResultVO<>(ResultCodes.OK, result);
    }
}