whyclxw
2024-07-01 db23586fd744582cd8ee237c34ff29d9277009ee
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
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.service.BattAlarmHisService;
import com.whyc.service.BattAlarmService;
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 java.text.ParseException;
 
 
@RestController
@Api(tags = "电池实时告警")
@RequestMapping("battalarm")
public class BattAlarmController {
    @Autowired
    private BattAlarmService service;
 
    @Autowired
    private BattAlarmHisService hisService;
 
    @ApiOperation("查询电池告警")
    @GetMapping("getBattAlarm")
    public Response getBattAlarm(@RequestParam(required = false) int almLevel,@RequestParam String startTime,@RequestParam String endTime
                                ,@RequestParam int pageNum,@RequestParam int pageSize){
        Response res=service.getBattAlarm(almLevel,startTime,endTime,pageNum,pageSize);
        return res;
    }
 
    @ApiOperation("确认告警")
    @GetMapping("confirmAlarm")
    public Response confirmAlarm(@RequestParam int num){
        Response res=service.confirmAlarm(num);
        return res;
    }
    @ApiOperation("取消告警")
    @GetMapping("cancleAlarm")
    public Response cancleAlarm(@RequestParam int num){
        Response res=service.cancleAlarm(num);
        return res;
    }
 
    @ApiOperation("查询电池组历史时间告警")
    @GetMapping("getHisAlatm")
    public Response getHisAlatm(@RequestParam int binfId,@RequestParam String startTime,@RequestParam String endTime
            , @RequestParam int pageNum, @RequestParam int pageSize) throws ParseException, InterruptedException {
        Response res=hisService.getHisAlatm(binfId,startTime,endTime,pageNum,pageSize);
        return res;
    }
}