whycrzg
2021-02-20 41af5517f84e8b5e2bc7db0718a51af268a83701
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
package com.fgkj.controller;
 
import com.fgkj.util.*;
 
import com.fgkj.dto.*;
import com.fgkj.mapper.UinfDaoFactory;
import com.fgkj.services.BattMap_informationService;
import com.fgkj.services.User_logService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
import javax.annotation.Resource;
 
@RequestMapping("battMapInformation")
@RestController
@Api(tags = "battMapInformation接口")
public class BattMap_informationController{
 
    @Resource
    private BattMap_informationService service;
    @Resource
    private User_logService uservice;
 
 
    //9.1录入机房信息
    @PostMapping("/")
    @ApiOperation(notes = "{ \"stationId\": \"1\", \"stationName\": \"s\", \"stationName3\": \"61850机房-2G\", \"address\": \" \", \"longitude\": 0.0, \"latitude\": 0.0, \"information\": \"f\", \"fBSDeviceId\": 0, \"stationName1\": \"湖北省\", \"stationName2\": \"武汉市\", \"stationName5\": \"东西湖区\" }",value="录入机房信息")
    public ServiceModel add(@RequestBody BattMap_information binfo){
        // BattMap_information binfo = getGson().fromJson(json, BattMap_information.class);
        ServiceModel model = service.add(binfo);
        if (model.getCode()==1)
        {
            String msg="设置"+binfo.getStationName()+"在"+binfo.getAddress();
            User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Increase, msg);
            uservice.add(ulog);//将用户的操作记录下来
        }
 
        return model;
    }
 
 
    //9.1录入机房信息
    @PostMapping("dev")
    @ApiOperation(notes = "{ \"stationId\": \"1\", \"stationName\": \"s\", \"stationName3\": \"61850机房-2G\", \"address\": \" \", \"longitude\": 0.0, \"latitude\": 0.0, \"information\": \"f\", \"fBSDeviceId\": 0, \"stationName1\": \"湖北省\", \"stationName2\": \"武汉市\", \"stationName5\": \"东西湖区\" }",value="录入机房信息")
    public ServiceModel addDev(@RequestBody BattMap_information binfo){
        // BattMap_information binfo = getGson().fromJson(json, BattMap_information.class);
        ServiceModel model = service.addDev(binfo);
 
        return model;
    }
 
    @PutMapping("/")
    @ApiOperation(notes = "{ \"num\": \"38\", \"stationId\": \"111\", \"stationName\": \"s\", \"stationName3\": \"61850机房-2G\", \"address\": \" \", \"longitude\": 0.0, \"latitude\": 0.0, \"information\": \"f\", \"fBSDeviceId\": 0, \"stationName1\": \"湖北省\", \"stationName2\": \"武汉市\", \"stationName5\": \"东西湖区\" }",value="修改")
    public ServiceModel update(@RequestBody BattMap_information binfo){
        // BattMap_information binfo = getGson().fromJson(json, BattMap_information.class);
        ServiceModel model = service.update(binfo);
 
        return model;
    }
    //删除机房的位置信息
    @DeleteMapping("/")
    @ApiOperation(notes = "",value="删除机房的位置信息")
    public ServiceModel del(@ApiParam(value = "站点",required = true) @RequestParam String stationName,
                            @ApiParam(value = "机房",required = true) @RequestParam String stationName3,
                            @ApiParam(value = "经度",required = true) @RequestParam Double longitude,
                            @ApiParam(value = "纬度",required = true) @RequestParam Double latitude){
        BattMap_information binfo = new BattMap_information();
        binfo.setStationName3(stationName3);
        binfo.setLongitude(longitude);
        binfo.setLatitude(latitude);
        ServiceModel model = service.del(binfo);
        {
            String msg="删除"+stationName+"的位置";
            User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Delete, msg);
            uservice.add(ulog);//将用户的操作记录下来
        }
 
        return model;
    }
    
    //9.1百度地图定位查询电池组信息
    @GetMapping("all")
    @ApiOperation(notes = "",value="百度地图定位查询电池组信息")
    public List searchAll(){
        List list = service.searchAll();
        return list;
    }
    //9.1地图上根据维护区查询机房经纬度
    @PostMapping("byInfo")
    @ApiOperation(notes = "",value="地图上根据维护区查询机房经纬度")
    public ServiceModel serchByInfo(@RequestParam String stationId) {
        BattMap_information binfo = new BattMap_information();
        binfo.setStationId(stationId);
        ServiceModel model = service.serchByInfo(binfo);
 
        return model;
    }
        
    
    //9.1百度地图定位根据省份查询所有该区域的机房
    @GetMapping("byCondition")
    @ApiOperation(notes = "模糊查询",value="百度地图定位根据省份查询所有该区域的机房")
    public List serchByCondition(@RequestParam String address) {
        BattMap_information binfo = new BattMap_information();
        binfo.setAddress(address);
        List list = service.serchByCondition(binfo);
        return list;
    }
    
    //9.1机房详情显示机房具体落后和告警的信息(机房信息内容画图)
    @PostMapping("monNum")
    @ApiOperation(notes = "",value="机房详情显示机房具体落后和告警的信息(机房信息内容画图)")
    public List serchMonNum(@RequestParam String stationId) {
        BattMap_information binfo = new BattMap_information();
        binfo.setStationId(stationId);
        List list = service.serchMonNum(binfo);
        return list;
    }
    
    //9.1查询未添加物理信息的机房
    @GetMapping("notInBattMap")
    @ApiOperation(notes = "",value="查询未添加物理信息的机房")
    public ServiceModel serchNotInBattMap(){
        ServiceModel model = service.serchNotInBattMap();
 
        return model;
    }
    //9.1查询未添加物理信息的机房(用户管理的)
    @GetMapping("notInBattMapByUid")
    @ApiOperation(notes = "",value="查询未添加物理信息的机房(用户管理的)")
    public ServiceModel serchNotInBattMapByUid() {
        User_inf uinf=(User_inf) ActionUtil.getUser();
        ServiceModel model = service.serchNotInBattMapByUid(uinf);
 
        return model;
    }
    //9.1查询已经添加物理信息的机房(用户管理的)
    @GetMapping("inBattMapByUid")
    @ApiOperation(notes = "",value="查询已经添加物理信息的机房(用户管理的)")
    public ServiceModel serchInBattMapByUid() {
        User_inf uinf=(User_inf) ActionUtil.getUser();
        ServiceModel model = service.serchInBattMapByUid(uinf);
 
        return model;
    }
    //9.1首页上查询已经添加物理信息的机房(用户管理的)  包括(告警总数落后总数延迟总数)
    @GetMapping("userManageStation")
    @ApiOperation(notes = "code 告警总数;sum 落后总数;newsum 延时总数;msg 61850状态;msgN 设备id",value="首页上查询已经添加物理信息的机房(用户管理的)  包括(告警总数落后总数延迟总数)")
    public List searchUserManageStation() {
        User_inf uinf=(User_inf) ActionUtil.getUser();
        List list = service.searchUserManageStation(uinf);
        return list;
    }
    
    //9.1电池寿命管理
    @PostMapping("byStationId")
    @ApiOperation(notes = "",value="电池寿命管理")
    public ServiceModel serchByStationid(@RequestParam String stationId) {
        BattMap_information binfo = new BattMap_information();
        binfo.setStationId(stationId);
        ServiceModel model = service.serchByStationid(binfo);
 
        return model;
    } 
    
    //9.1查询机房所在的所有省份
    @GetMapping("stationName1")
    @ApiOperation(notes = "",value="查询机房所在的所有省份")
      public ServiceModel serchStationName1(){
          ServiceModel model = service.serchStationName1();
 
          return model;
      }
      
      //9.1根据省份查询机房所在的所有城市
    @PostMapping("stationName2")
    @ApiOperation(notes = "模糊查询",value="根据省份查询机房所在的所有城市")
      public ServiceModel serchStationName2(@RequestParam String address) {
        BattMap_information binfo = new BattMap_information();
        binfo.setAddress(address);
        ServiceModel model = service.serchStationName2(binfo);
 
        return model;
    }
  //根据省/市/区县查询所有的站点
    @PostMapping("stationName3")
    @ApiOperation(notes = "模糊查询 s1,s2,s5",value="根据省/市/区县查询所有的站点")
      public ServiceModel serchStationName3(@ApiParam(value = "省",required = true) @RequestParam String stationName1, @ApiParam(value = "市",required = true) @RequestParam String stationName2, @ApiParam(value = "区",required = true) @RequestParam String stationName5) {
        BattInf binf = new BattInf();
        binf.setStationName1(stationName1);
        binf.setStationName2(stationName2);
        binf.setStationName5(stationName5);
        ServiceModel model = service.serchStationName3(binf);
 
        return model;
    }
      //9.1根据省份和城市查询机房所在的所有机房
    @GetMapping("stationName")
    @ApiOperation(notes = "模糊查询",value="根据省份和城市查询机房所在的所有机房")
      public ServiceModel serchStationName(@RequestParam String address) {
        BattMap_information binfo = new BattMap_information();
        binfo.setAddress(address);
          ServiceModel model = service.serchStationName(binfo);
 
          return model;
      }
  //查询站点的经纬度
    @GetMapping("addressByStationName3")
    @ApiOperation(notes = "模糊查询",value="查询站点的经纬度")
      public ServiceModel serchAddressByStationName3(@RequestParam String stationName) {
        BattMap_information binfo = new BattMap_information();
        binfo.setStationName(stationName);
        ServiceModel model = service.serchAddressByStationName3(binfo);
 
        return model;
    }
 
 
 
 
}