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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
package com.fgkj.controller;
 
import com.fgkj.dto.*;
import com.fgkj.services.BattInfServices;
import com.fgkj.util.ActionUtil;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
 
@RequestMapping("battInf")
@RestController
@Api(tags = "battInf接口")
public class BattInfController{
 
    @Resource
    private BattInfServices service;
 
    // private BattInf bif;
    // private Batt_maintenance_inf bmaif;
    // private Batttestdata_inf btdif;
    // private User_inf uinf;
    //private Battalarm_data bdata;
 
    //添加新的电池组
    @PostMapping("/")
    @ApiOperation(notes = "",value="添加新的电池组")
    public ServiceModel add(@RequestBody List<BattInf> list) {
        // List<BattInf> list= getGson("yyyy-MM-dd").fromJson(json, new TypeToken<List<BattInf>>(){}.getType());
 
        return service.add(list);
    }
    //修改电池组信息
    @PutMapping("/")
    @ApiOperation(notes = "",value="修改电池组信息")
    public ServiceModel update(@RequestBody List<BattInf> list) {
        // List<BattInf> list= getGson("yyyy-MM-dd").fromJson(json, new TypeToken<List<BattInf>>(){}.getType());
        return service.update(list);
    }
    //修改电池信息配置(ip地址,掩码和网关)
    @PostMapping("/ip")
    @ApiOperation(notes = "",value="修改电池信息配置(ip地址,掩码和网关)")
    public ServiceModel updateIp(@RequestBody BattInf binf) {
        // BattInf binf= getGson("yyyy-MM-dd").fromJson(json, BattInf.class);
        //System.out.println(binf);
 
        return service.updateIp(binf);
    }
    //删除电池组
    @DeleteMapping("/")
    @ApiOperation(notes = "",value="删除电池组")
    public ServiceModel delete(@RequestBody List<BattInf> list) {
        // List<BattInf> list= getGson("yyyy-MM-dd").fromJson(json, new TypeToken<List<BattInf>>(){}.getType());
 
        return service.delete(list);
    }
    //根据维护区和机房名称查询电池组信息
    @GetMapping("inform")
    @ApiOperation(notes = "",value="维护区和机房名称查询电池组信息")
    public ServiceModel searchInform(@RequestBody Batt_Maint_Dealarm bmd) {
        // Batt_Maint_Dealarm bmd = getGson().fromJson(json, Batt_Maint_Dealarm.class);
 
        return service.searchInform(bmd);
    }
    //添加站点时返回最大的机房id,设备id,电池组id
    @GetMapping("maxId")
    @ApiOperation(notes = "",value="添加站点时返回最大的机房id,设备id,电池组id")
    public ServiceModel searchmaxId() {
 
        return service.searchmaxId();
    }
 
    @GetMapping("byCondition")
    @ApiOperation(notes = "查capstdolstd/moncount/serstd",value="battgroupid查机房名称和电池组名称")
    public ServiceModelOnce serchByCondition(@RequestBody BattInf bif) {
        return service.serchByCondition(bif);
    }
 
    @GetMapping("all")
    @ApiOperation(notes = "",value="all")
    public ServiceModel searchAll() {
        return service.searchAll();
    }
 
    /*@GetMapping("byBattGroupId")
    public ServiceModel serchByBattgroupId(@RequestBody BattInf bif){
        model=service.findByBattGroupId(bif);
        return model;
    }*/
 
    //根据电池id查询电池的基本信息
    @GetMapping("byBattGroupId")
    @ApiOperation(notes = "",value="电池id查询电池的基本信息")
    public ServiceModel searchBattBybattgroupid(@RequestBody BattInf bif){
 
        return service.searchBattBybattgroupid(bif);
    }
    
    //查询出当前存在内存中最大的设备的id(很重要**********)
    @GetMapping("maxDevId")
    @ApiOperation(notes = "",value="查询出当前存在内存中最大的设备的id(很重要**********)")
    public ServiceModel searchMaxdevId_binf(){
        return service.searchMaxdevId_binf();
    }
    
//----------根据StationName1(维护区) 查不重复的BattGroupName(蓄电池组)
    @GetMapping("byStationName1")
    @ApiOperation(notes = "",value="StationName1(维护区) 查不重复的BattGroupName(蓄电池组)")
    public ServiceModelOnce serchByStationName1(@RequestBody BattInf bif){
        return service.serchByStationName1(bif);
    }
//----------根据StationName1(维护区) 查不重复的StationName(站点)
    @GetMapping("byStationName")
    @ApiOperation(notes = "",value="StationName1(维护区) 查不重复的StationName(站点)")
    public ServiceModelOnce serchByStationName(@RequestBody BattInf bif){
        return service.serchByStationName(bif);
    }
    //----------根据StationName1(维护区) 查不重复的StationName(站点)不包含91000000一期设备
    @GetMapping("byStationNameWithout91")
    @ApiOperation(notes = "",value="StationName1(维护区) 查不重复的StationName(站点)不包含91000000一期设备")
    public ServiceModelOnce serchByStationNameNot91(@RequestBody BattInf bif){
        return service.serchByStationNameNot91(bif);
    }
//--查不重复的StationName1(维护区)
    @GetMapping("byStation")
    @ApiOperation(notes = "",value="查不重复的StationName1(维护区)")
    public ServiceModelOnce serchByStation(){
        return service.serchByStation();
    }
    //--查不重复的StationName1(维护区)不包含91000000一期设备
    @GetMapping("byStationWithout91")
    @ApiOperation(notes = "",value="查不重复的StationName1(维护区)不包含91000000一期设备")
    public ServiceModelOnce serchByStationNot91(){
        return service.serchByStationNot91();
    }
    //-----------查询所有的省份
    @GetMapping("allStationName1")
    @ApiOperation(notes = "",value="查询所有的省份")
    public ServiceModel serchAllStationName1(){
        User_inf uinf=(User_inf) ActionUtil.getUser();
        return service.serchAllStationName1(uinf);
    }
    // ----------查询所有的市
    @GetMapping("allStationName2")
    @ApiOperation(notes = "",value="查询所有的市")
    public ServiceModel serchAllStationName2(@RequestBody BattInf binf){
        User_inf uinf=(User_inf) ActionUtil.getUser();
        binf.setNum(uinf.getuId());
        return service.serchAllStationName2(binf);
    }
    //--查询所有的区县
    @GetMapping("allStationName5")
    @ApiOperation(notes = "",value="查询所有的区县")
    public ServiceModel serchAllStationName5(@RequestBody BattInf binf){
        User_inf uinf=(User_inf) ActionUtil.getUser();
        binf.setNum(uinf.getuId());
        return service.serchAllStationName5(binf);
    }
    //--查询所有的机房
    @GetMapping("allStationName")
    @ApiOperation(notes = "",value="查询所有的机房")
    public ServiceModel serchAllStationName(@RequestBody BattInf binf){
        User_inf uinf=(User_inf) ActionUtil.getUser();
        binf.setNum(uinf.getuId());
        return service.serchAllStationName(binf);
    }
 
    //--查询电池组信息
    @GetMapping("allBattInf")
    @ApiOperation(notes = "",value="查询电池组信息")
    public ServiceModel serchAllBattinf(@RequestBody BattInf binf){
 
        return service.serchAllBattinf(binf);
    }
    
    //----------根据StationName(站点) 查不重复的BattGroupName(蓄电池组)
    @GetMapping("byBattGroupName")
    @ApiOperation(notes = "",value="根据StationName(站点) 查不重复的BattGroupName(蓄电池组)")
    public ServiceModelOnce serchByBattGroupName(@RequestBody BattInf bif){
 
        return service.serchByBattGroupName(bif);
    }
    //查电池品牌
    @GetMapping("battProducer")
    @ApiOperation(notes = "",value="查电池品牌")
    public ServiceModelOnce serchByBattProducer(){
 
        return service.serchByBattProducer();
    }
    //查单体电压
    @GetMapping("monVolStd")
    @ApiOperation(notes = "",value="查单体电压")
    public ServiceModelOnce serchByMonVolStd(){
 
        return service.serchByMonVolStd();
    }
    //查电池容量
    @GetMapping("monCapStd")
    @ApiOperation(notes = "",value="查电池容量")
    public ServiceModelOnce serchByMonCapStd(){
 
        return service.serchByMonCapStd();
    }
    
    //查询菜单        TODO
    @GetMapping("menu")
    @ApiOperation(notes = "TODO ",value="查询菜单")
    public ServiceModel findMenu(){
 
        return service.findMenu();
    }
    
    //判断新增的电池组是否存在
    @GetMapping("judgeBatt")
    @ApiOperation(notes = "",value="判断新增的电池组是否存在")
    public ServiceModel judgeBatt(@RequestBody BattInf binf){
 
        return service.judgeBatt(binf);
    }
 
    @GetMapping("byBattGroupId2")
    @ApiOperation(notes = "",value="byBattGroupId2")
    public ServiceModel findByBattGroupId(@RequestBody BattInf bif){
        ServiceModel model=service.findByBattGroupId(bif);
        return model;
    }
 
    //根据电池组id查询不重复的单体编号
    @GetMapping("monNumByBattGroupId")
    @ApiOperation(notes = "",value="电池组id查询不重复的单体编号")
    public ServiceModelOnce serchByMonNum(@RequestBody BattInf bif){
 
        return service.serchByMonNum(bif);
    }
    
    //5.3添加选取电池组或者机房或者维护区(未被应用)
    @Deprecated
    public ServiceModel serchBatt(@RequestBody BattInf bif) {
        // bif=ActionUtil.getGson("yyyy-MM-dd").fromJson(result,BattInf.class);
 
        return service.serchBatt(bif);
    }
 
    //6.4.7按地域和标称电压分组统计蓄电池组服役超期的数量
            /*
         * 区域层次放在stationid中
         * battgroupnum 中存放统计方式:年度统计为0 季度统计为1
         * moncount中存放统计季度:一季度为1 以此类推
         * monnum 中存放年份*/
    @GetMapping("beyondTime")
    @ApiOperation(notes = "区域层次放在stationid中 battgroupnum 中存放统计方式:年度统计为0 季度统计为1 moncount中存放统计季度:一季度为1 以此类推 monnum 中存放年份",value="按地域和标称电压分组统计蓄电池组服役超期的数量")
    public ServiceModel serchBeyondTime(@RequestBody BattInf bif){
        // bif=ActionUtil.getGson("yyyy-MM-dd").fromJson(result,BattInf.class);
 
        return service.serchBeyondTime(bif);
    }
    
    //6.4.8按地域和标称电压分组统计蓄电池组的数量(蓄电池组数量统计)
    @GetMapping("battGroupCountByMonVolStdGroup")
    @ApiOperation(notes = "",value="按地域和标称电压分组统计蓄电池组的数量(蓄电池组数量统计)")
    public ServiceModel serchByMonVolStdGroup(@RequestBody BattInf bif){
        // bif=ActionUtil.getGson("yyyy-MM-dd").fromJson(result,BattInf.class);
 
        return service.serchByMonVolStdGroup(bif);
    }
    
    //6.4.9按地域和标称电压分组统计蓄电池组品牌的数量(蓄电池供应商信息统计)
    @GetMapping("battProducerCountByBattProducerGroup")
    @ApiOperation(notes = "",value="按地域和标称电压分组统计蓄电池组品牌的数量(蓄电池供应商信息统计)")
    public ServiceModel serchByBattProducerGroup(@RequestBody BattInf bif){
        // bif=ActionUtil.getGson("yyyy-MM-dd").fromJson(result,BattInf.class);
 
        return service.serchByBattProducerGroup(bif);
    }
    
    //6.4.10按地域和标称电压分组统计蓄电池组使用时间(蓄电池投产年限统计)
    @GetMapping("battGroupTimeInUse")
    @ApiOperation(notes = "",value="按地域和标称电压分组统计蓄电池组使用时间(蓄电池投产年限统计)")
    public ServiceModel serchByBattInUseDateGroup(@RequestBody BattInf bif){
        // bif=ActionUtil.getGson("yyyy-MM-dd").fromJson(result,BattInf.class);
 
        return service.serchByBattInUseDateGroup(bif);
    }
    
    //1 根据机房id查询电池组id排序最小值
    @GetMapping("byIdLow")
    @ApiOperation(notes = "",value="机房id查询电池组id排序最小值")
    public ServiceModel serchByIdLow(@RequestBody BattInf bif){
        // bif=ActionUtil.getGson("yyyy-MM-dd").fromJson(result,BattInf.class);
 
        return service.serchByIdLow(bif);
    }
 
    //查询所有的机房
    @GetMapping("allStation")
    @ApiOperation(notes = "",value="查询所有的机房")
    public ServiceModel serchAllStation(){
        User_inf u = (User_inf)ActionUtil.getUser();
 
        return service.serchAllStation(u);
    }
    
    //搜索机房或电池组
    @GetMapping("stationOrBattGroup")
    @ApiOperation(notes = "",value="搜索机房或电池组")
    public ServiceModel serchStationOrBattgroup(@RequestBody BattInf binf){
        // BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
 
        return service.serchStationOrBattgroup(binf);
    }
    //根据机房id查询机房下的电池组信息
    @GetMapping("battByStationId")
    @ApiOperation(notes = "",value="机房id查询机房下的电池组信息")
    public ServiceModel serchBattByStation(@RequestBody BattInf binf){
        // BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
        // result = ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").toJson(model);
        return service.serchBattByStation(binf);
    }
    
    //查询所有的电池组数
    @GetMapping("battCount")
    @ApiOperation(notes = "",value="查询所有的电池组数")
    public ServiceModel serchAllBatt(){
        User_inf u = (User_inf)ActionUtil.getUser();
 
        return service.serchAllBatt(u);
    }
    //查站点下的所有设备名称
    @GetMapping("devNameByStationName3")
    @ApiOperation(notes = "",value="查站点下的所有设备名称")
    public ServiceModel searchDevByStationName3(@RequestBody BattInf binf){
        // BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
 
        return service.searchDevByStationName3(binf);
    }
    
    //首页上根据stationid查询电池组的机历卡
    @GetMapping("battAllInfoByStationId")
    @ApiOperation(notes = "",value="首页上根据stationid查询电池组的机历卡")
    public ServiceModel serchBattAllInfoByStationId(@RequestBody BattInf binf){
        // BattInf binf=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class);
 
        return service.serchBattAllInfoByStationId(binf);
    }
    //跨域访问获取所有电池组的信息<-------跨域----------->
    @GetMapping("inform_ky")
    @ApiOperation(tags = "跨域", notes = "",value="跨域访问获取所有电池组的信息")
    public ServiceModel searchInform_ky(){
        //isAllowHeaders();                            //允许跨域访问
 
        return service.searchInform_ky();
    }
    //添加新的电池组
    @PostMapping("ky")
    @ApiOperation(notes = "",value="添加新的电池组")
    public ServiceModel add_ky(@RequestBody List<BattInf> list) {
        // List<BattInf> list= getGson("yyyy-MM-dd").fromJson(json, new TypeToken<List<BattInf>>(){}.getType());
 
        return service.add(list);
    }
    //修改电池组信息<-------跨域----------->
    @PutMapping("ky")
    @ApiOperation(tags = "跨域", notes = "",value="修改电池组信息")
    public ServiceModel update_ky(@RequestBody List<BattInf> list) {
        // List<BattInf> list= getGson("yyyy-MM-dd").fromJson(json, new TypeToken<List<BattInf>>(){}.getType());
 
        return service.update(list);
    }
    //删除电池组<-------跨域----------->
    @DeleteMapping("ky")
    @ApiOperation(tags = "跨域", notes = "",value="删除电池组")
    public ServiceModel delete_ky(@RequestBody List<BattInf> list) {
        // List<BattInf> list= getGson("yyyy-MM-dd").fromJson(json, new TypeToken<List<BattInf>>(){}.getType());
 
        return service.delete(list);
    }
    
    //查询电池组信息<大屏显示>
    @GetMapping("battOnBigScreen")
    @ApiOperation(notes = "",value="查询电池组信息<大屏显示>")
    public ServiceModel serchBatt_DP(@RequestBody BattInf binf){
        // BattInf binf= getGson("yyyy-MM-dd").fromJson(json, BattInf.class);
 
        return service.serchBatt_DP(binf);
    }
    //紫晶山西——---机房列表
    @GetMapping("stationList")
    @ApiOperation(notes = "",value="紫晶山西——---机房列表")
    public ServiceModel searchStationList(){
 
        return service.searchStationList();
    }
 
}