perryhsu
2020-09-30 3ab47f8fdd1da2c97917c38b2510855d7c3963c4
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
package com.fgkj.controller;
 
import java.util.List;
 
import com.fgkj.mapper.UinfDaoFactory;
import com.fgkj.dto.BattInf;
import com.fgkj.dto.BattMap_information;
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.User_inf;
import com.fgkj.dto.User_log;
import com.fgkj.services.BattMap_informationService;
import com.fgkj.services.User_logService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
@RequestMapping("battMapInformation")
@RestController
@Api
public class BattMap_informationController{
 
    @Autowired
    private BattMap_informationService service;
    @Autowired
    private User_logService uservice;
 
    
    //9.1录入机房信息
    @PostMapping("/")
    public ServiceModel add(@RequestBody BattMap_information binfo){
        // BattMap_information binfo = getGson().fromJson(json, BattMap_information.class);
        ServiceModel model = service.add(binfo);
        {
            String msg="设置"+binfo.getStationName()+"在"+binfo.getAddress();
            User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Increase, msg);
            uservice.add(ulog);//将用户的操作记录下来
        }
 
        return model;
    }
    //9.1录入机房信息
    @PostMapping("dev")
    public ServiceModel addDev(@RequestBody BattMap_information binfo){
        // BattMap_information binfo = getGson().fromJson(json, BattMap_information.class);
        ServiceModel model = service.addDev(binfo);
 
        return model;
    }
    @PutMapping("/")
    public ServiceModel update(@RequestBody BattMap_information binfo){
        // BattMap_information binfo = getGson().fromJson(json, BattMap_information.class);
        ServiceModel model = service.update(binfo);
 
        return model;
    }
    //删除机房的位置信息
    @DeleteMapping("/")
    public ServiceModel del(@RequestBody BattMap_information binfo){
        // BattMap_information binfo = getGson().fromJson(json, BattMap_information.class);
        ServiceModel model = service.del(binfo);
        {
            String msg="删除"+binfo.getStationName()+"的位置";
            User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Delete, msg);
            uservice.add(ulog);//将用户的操作记录下来
        }
 
        return model;
    }
    
    //9.1百度地图定位查询电池组信息
    @GetMapping("all")
    public List searchAll(){
        List list = service.searchAll();
        return list;
    }
    //9.1地图上根据维护区查询机房经纬度
    @GetMapping("byInfo")
    public ServiceModel serchByInfo(@RequestBody BattMap_information binfo){
        // BattMap_information binfo = getGson().fromJson(json, BattMap_information.class);
        ServiceModel model = service.serchByInfo(binfo);
 
        return model;
    }
        
    
    //9.1百度地图定位根据省份查询所有该区域的机房
    @GetMapping("byCondition")
    public List serchByCondition(@RequestBody BattMap_information binfo){
        // BattMap_information binfo = getGson().fromJson(json, BattMap_information.class);
        List list = service.serchByCondition(binfo);
        return list;
    }
    
    //9.1机房详情显示机房具体落后和告警的信息(机房信息内容画图)
    @GetMapping("monNum")
    public List serchMonNum(@RequestBody BattMap_information binfo){
        // BattMap_information binfo = getGson().fromJson(json, BattMap_information.class);
        List list = service.serchMonNum(binfo);
        return list;
    }
    
    //9.1查询未添加物理信息的机房
    @GetMapping("notInBattMap")
    public ServiceModel serchNotInBattMap(){
        ServiceModel model = service.serchNotInBattMap();
 
        return model;
    }
    //9.1查询未添加物理信息的机房(用户管理的)
    @GetMapping("notInBattMapByUid")
    public ServiceModel serchNotInBattMapByUid() {
        User_inf uinf=(User_inf) ActionUtil.getUser();
        ServiceModel model = service.serchNotInBattMapByUid(uinf);
 
        return model;
    }
    //9.1查询已经添加物理信息的机房(用户管理的)
    @GetMapping("inBattMapByUid")
    public ServiceModel serchInBattMapByUid() {
        User_inf uinf=(User_inf) ActionUtil.getUser();
        ServiceModel model = service.serchInBattMapByUid(uinf);
 
        return model;
    }
    //9.1首页上查询已经添加物理信息的机房(用户管理的)  包括(告警总数落后总数延迟总数)
    @GetMapping("userManageStation")
    public List searchUserManageStation() {
        User_inf uinf=(User_inf) ActionUtil.getUser();
        List list = service.searchUserManageStation(uinf);
        return list;
    }
    
    //9.1电池寿命管理
    @GetMapping("byStationId")
    public ServiceModel serchByStationid(@RequestBody BattMap_information bmap){
        // BattMap_information bmap = getGson().fromJson(json, BattMap_information.class);
        ServiceModel model = service.serchByStationid(bmap);
 
        return model;
    } 
    
    //9.1查询机房所在的所有省份
    @GetMapping("stationName1")
      public ServiceModel serchStationName1(){
          ServiceModel model = service.serchStationName1();
 
          return model;
      }
      
      //9.1根据省份查询机房所在的所有城市
    @GetMapping("stationName2")
      public ServiceModel serchStationName2(@RequestBody BattMap_information bmap){
          // BattMap_information bmap = getGson().fromJson(json, BattMap_information.class);
          ServiceModel model = service.serchStationName2(bmap);
 
          return model;
      }
  //根据省/市/区县查询所有的站点
    @GetMapping("stationName3")
      public ServiceModel serchStationName3(@RequestBody BattInf binf){
          // BattInf binf = getGson().fromJson(json, BattInf.class);
          ServiceModel model = service.serchStationName3(binf);
 
          return model;
      }
      //9.1根据省份和城市查询机房所在的所有机房
    @GetMapping("stationName")
      public ServiceModel serchStationName(@RequestBody BattMap_information bmap){
          // BattMap_information bmap = getGson().fromJson(json, BattMap_information.class);
          ServiceModel model = service.serchStationName(bmap);
 
          return model;
      }
  //查询站点的经纬度
    @GetMapping("addressByStationName3")
      public ServiceModel serchAddressByStationName3(@RequestBody BattMap_information bmap){
          // BattMap_information bmap = getGson().fromJson(json, BattMap_information.class);
          ServiceModel model = service.serchAddressByStationName3(bmap);
 
          return model;
      }
    
 
    
    
}