whycxzp
2025-03-27 fe09517300727fd547e9926c9ba407386715435d
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
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.service.CheckService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import javax.servlet.http.HttpServletRequest;
 
import static java.lang.Thread.sleep;
 
@RestController
@RequestMapping("check")
@Api(tags = "平台自检")
public class CheckController {
 
    @Autowired
    private CheckService checkService;
 
    @ApiOperation(value = "检查步骤")
    @GetMapping("checkStatus")
    public Response checkStatus(@RequestParam int deviceId,
                                @RequestParam int battGroupId,
                                @RequestParam int index,
                                @RequestParam int type, HttpServletRequest request){
        Response response = new Response<>();
 
        switch (type){
            //蓄电池远程核容装置无告警
            //检查项:设备实时告警
            case 1: {
                response = checkService.checkOne(request,deviceId);
            }
            break;
            //蓄电池组无告警
            //检查项:电池组实时告警
            case 2: {
                response = checkService.checkTwo(request,battGroupId);
             }
            break;
            //蓄电池组均处于浮充状态
            //检查项:设备下的两个电池组都处于均充状态
            case 3: {
                response = checkService.checkThree(request,deviceId);
            }
            break;
            //母联开关模式无告警
            //检查项: 空开状态 1和3 返回1,其他返回0
            case 4: {
                response = checkService.checkFour(request,deviceId);
            }
            break;
            //充电机直流输入无异常,无过欠压告警
            //检查项: 电池组告警中的在线电压告警
            case 5: {
                response = checkService.checkFive(request,battGroupId);
            }
            break;
            //切换箱接触器状态
            //对应电池组正负极全为1则正常
            case 6: {
                response = checkService.checkSix(request,deviceId,index);
            }
            break;
        }
        try {
            sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return response;
    }
 
}