whycrzh
2021-01-28 9f05d9863af714b206bdfffe2096d60a942c9d23
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
package com.fgkj.controller;
 
import com.fgkj.dto.*;
import com.fgkj.services.Battalarm_dataService;
import com.fgkj.util.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
import javax.annotation.Resource;
 
@RequestMapping("battAlarmData")
@RestController
@Api(tags = "battAlarmData接口")
public class Battalarm_dataController{
 
    @Resource
    private Battalarm_dataService service=new Battalarm_dataService();
 
    // private Batt_Maint_Dealarm bmd;
    // private String bads;
    
    //3.1电池告警实时查询
    @GetMapping("byCondition")
    @ApiOperation(notes = "",value="电池告警实时查询")
    public ServiceModel serchByCondition(@RequestBody Batt_Maint_Dealarm bmd){
        User_inf uinf=(User_inf) ActionUtil.getUser();
        bmd.setUinf(uinf);
        ServiceModel model=service.serchByCondition(bmd);
        return model;
    }
    
    //3.2电池告警历史记录查询
    @GetMapping("byInfo")
    @ApiOperation(notes = "",value="电池告警历史记录查询")
    public ServiceModel serchByInfo(@RequestBody Batt_Maint_Dealarm bmd){
        // bmd = ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result, Batt_Maint_Dealarm.class);
        User_inf uinf=(User_inf) ActionUtil.getUser();
        bmd.setUinf(uinf);
        ServiceModel model=service.serchByInfo(bmd);
        return model;
    }
    
    //0.5查询实时告警数
    @GetMapping("alm")
    @ApiOperation(notes = "",value="查询实时告警数")
    public ServiceModel serchAlm(@RequestBody Batt_Maint_Dealarm bmd){
        User_inf uinf=(User_inf) ActionUtil.getUser();
        bmd.setUinf(uinf);
        ServiceModel model=service.serchAlm(bmd);
        return model;
    }
    
    //0.10实时告警记录总数查询
    @GetMapping("realTime")
    @ApiOperation(notes = "",value="实时告警记录总数查询")
    public ServiceModel serchRealTime(){
        User_inf uinf=(User_inf) ActionUtil.getUser();
        ServiceModel model=service.serchRealTime(uinf);
        return model;
    }
    
    /*// 3.1电池告警实时查询(确认告警)
    public ServiceModel update() {
        ServiceModel model=new ServiceModel();
        if(bads!=null && bads.length()>0){
            Gson gson=new Gson();
            List<Battalarm_data> list=gson.fromJson(bads, new TypeToken<List<Battalarm_data>>(){}.getType());
            model=service.update(list);
        }
        result=ActionUtil.tojson(model);
        return model;
    }*/
    // 3.1电池告警实时查询(确认告警)
    @PutMapping("/")
    @ApiOperation(notes = "",value="电池告警实时查询(确认告警)")
    public ServiceModel update(@RequestBody List<Battalarm_data> list) {
        /*if(bads!=null && bads.length()>0){
            Gson gson=new Gson();
            List<Battalarm_data> list=gson.fromJson(bads, new TypeToken<List<Battalarm_data>>(){}.getType());
            model=service.updatePro(list);
        }*/
        ServiceModel model=service.updatePro(list);
        return model;
    }
    /*// 3.1电池告警实时查询(取消告警)
    public ServiceModel cancelalarm() {
        ServiceModel model=new ServiceModel();
        if(bads!=null && bads.length()>0){
            Gson gson=new Gson();
            List<Battalarm_data> list=gson.fromJson(bads, new TypeToken<List<Battalarm_data>>(){}.getType());
            model=service.cancelalarm(list);
        }
        result=ActionUtil.tojson(model);
        return model;
    }*/
    // 3.1电池告警实时查询(取消告警)
    @PutMapping("/cancel")
    @ApiOperation(notes = "",value="电池告警实时查询(取消告警)")
    public ServiceModel cancelalarm(@RequestBody List<Battalarm_data> list) {
        /*ServiceModel model=new ServiceModel();
        if(bads!=null && bads.length()>0){
            Gson gson=new Gson();
            List<Battalarm_data> list=gson.fromJson(bads, new TypeToken<List<Battalarm_data>>(){}.getType());
            model=service.cancelalarmPro(list);
        }*/
        ServiceModel model=service.cancelalarmPro(list);
        return model;
    }
    //3.1/3.2电池告警查询(删除记录)
    @DeleteMapping("/")
    @ApiOperation(notes = "",value="电池告警查询(删除记录)")
    public ServiceModel delete(@RequestBody List<Battalarm_data> list) {
        /*ServiceModel model=new ServiceModel();
        if(bads!=null && bads.length()>0){
            Gson gson=new Gson();
            List<Battalarm_data> list=gson.fromJson(bads, new TypeToken<List<Battalarm_data>>(){}.getType());
            model=service.delete(list);
        }*/
        ServiceModel model=service.delete(list);
        return model;
    }
    
    //饼状图电池单体健康率
    @GetMapping("healthRate")
    @ApiOperation(notes = "",value="饼状图电池单体健康率")
    public ServiceModel serchGood(){
        User_inf uinf=(User_inf) ActionUtil.getUser();
        ServiceModel model = service.serchGood(uinf);//单体容量告警和单体告警告警
        return model;
    }
     //项目下方的滚动,查询最新电池告警(电池告警和设备告警筛选出最新的一条)(旧版本)
    @GetMapping("topAlm")
    @ApiOperation(notes = "",value="项目下方的滚动,查询最新电池告警(电池告警和设备告警筛选出最新的一条)(旧版本)")
    public ServiceModel serchTopAlm(){
        ServiceModel model=service.serchTopAlm();
        return model;
    }
    
     //项目下方的滚动,查询最新电池告警(电池告警和设备告警筛选出最新的五条)
    @GetMapping("topAlmTen")
    @ApiOperation(notes = "",value="项目下方的滚动,查询最新电池告警(电池告警和设备告警筛选出最新的五条)")
    public ServiceModel serchTopAlmTen(){
        User_inf uinf=(User_inf) ActionUtil.getUser();
        ServiceModel model=service.serchTopAlmTen(uinf);
        return model;
    }
    
    //点击项目下方的滚动,查询该条告警的实时信息
    @GetMapping("battAlarm")
    @ApiOperation(notes = "",value="点击项目下方的滚动,查询该条告警的实时信息")
    public ServiceModel serchBatt_alarm(@RequestBody Battalarm_data data){
        // Battalarm_data adata=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Battalarm_data.class);
        ServiceModel model=service.serchBatt_alarm(data);
        return model;
    }
    //3.1电池告警实时查询<***********跨域专用**************>
    @GetMapping("byCondition_ky")
    @ApiOperation(tags = "跨域", notes = "",value="电池告警实时查询 跨域访问")
    public ServiceModel serchByCondition_ky(@RequestBody BattInf binf){
        // BattInf binf=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class);
        ServiceModel model=service.serchByCondition_ky(binf);
        return model;
    }
    // 3.1电池告警实时查询(确认告警)<***********跨域专用**************>
    @PutMapping("/ky")
    @ApiOperation(tags = "跨域", notes = "",value="电池告警实时查询(确认告警) 跨域专用")
    public ServiceModel update_ky(@RequestBody List<Battalarm_data> list) {
        /*ServiceModel model=new ServiceModel();
        if(bads!=null && bads.length()>0){
            Gson gson=new Gson();
            List<Battalarm_data> list=gson.fromJson(bads, new TypeToken<List<Battalarm_data>>(){}.getType());
            model=service.updatePro(list);
        }*/
        ServiceModel model=service.updatePro(list);
        return model;
    }
    // 3.1电池告警实时查询(取消告警)<***********跨域专用**************>
    @PutMapping("/cancelAlarm_ky")
    @ApiOperation(tags = "跨域", notes = "",value="电池告警实时查询(取消告警) 跨域专用")
    public ServiceModel cancelalarm_ky(@RequestBody List<Battalarm_data> list) {
        /*ServiceModel model=new ServiceModel();
        if(bads!=null && bads.length()>0){
            Gson gson=new Gson();
            List<Battalarm_data> list=gson.fromJson(bads, new TypeToken<List<Battalarm_data>>(){}.getType());
            model=service.cancelalarmPro(list);
        }*/
        ServiceModel model=service.cancelalarmPro(list);
        return model;
    }
    //3.1/3.2电池告警查询(删除记录)<***********跨域专用**************>
    @DeleteMapping("/ky")
    @ApiOperation(tags = "跨域", notes = "",value="电池告警查询(删除记录) 跨域专用")
    public ServiceModel delete_ky(@RequestBody List<Battalarm_data> list) {
        /*ServiceModel model=new ServiceModel();
        if(bads!=null && bads.length()>0){
            Gson gson=new Gson();
            List<Battalarm_data> list=gson.fromJson(bads, new TypeToken<List<Battalarm_data>>(){}.getType());
            model=service.delete(list);
        }*/
        ServiceModel model=service.delete(list);
        return model;
    }
 
}