lishifeng
2020-09-15 ce10677f47a14879424e7f562f78442cc03cfda1
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
import axios from "./axios";
import md5 from "js-md5";
 
/**
 * 初始化连接池
 * 无参
 */
export const initDBPool = () => {
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/LoginAction!initDBPool",
        data: null
    })
}
 
/**
 * 登录系统
 * 参数 "uinf.UName="+用户名+"&uinf.Upassword="+密码+"&uinf.UId="+是否记住密码(0,1)
 * 密码需要使用hex_md5加密
 */
export const login = (username, password) => {
    return axios({
        method: "post",
        url: '/yckj/' + `zijing_sx/LoginAction_login?uinf.UName=${username}&uinf.Upassword=${md5(password)}&uinf.UId=0`,
        data: null
    })
}
 
/**
 * 检测后台session
 * 无参
 */
export const checkLoginSession = () => {
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/LoginAction!getSessionByString",
        data: null
    })
}
 
 
/**
 * 查询省
 * 无参
 */
export const searchProvince = () => {
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/BattInfAction!serchAllStationName1",
        data: null
    })
}
 
 
/**
 * 查询市
 * 参数:json={"StationName1":"北京市"}
 */
export const searchCity = (params) => {
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/BattInfAction!serchAllStationName2",
        data: "json=" + JSON.stringify(params)
    })
}
 
/**
 * 查询区县
 * 参数:json = {"StationName1":"北京市","StationName2":"市辖区"}
 */
export const searchCounty = (params) => {
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/BattInfAction!serchAllStationName5",
        data: "json=" + JSON.stringify(params)
    })
}
 
/**
 * 查询机房停电信息
 * 无参
 */
export const searchPowerOff = () => {
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/BattPower_offAction!serchPowerOff",
        data: null
    })
}
 
 
/**
 * 查询电池组健康率
 * 无参
 */
export const searchBattGood = () => {
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/Battalarm_dataAction!serchGood",
        data: null
    })
}
 
/**
 * 添加地图上的机房
 * 参数:json={"StationName1":"", "StationName2":"", "StationName5":"","StationName3":""
 * "Address":"","longitude":"","latitude":"","information":""}
 */
export const addMapStation = (params) => {
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/BattMap_informationAction!add",
        data: "json=" + JSON.stringify(params)
    })
}
 
/* 设置站点名   无参*/
export const addMapSetdian = () => {
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/BattMap_informationAction!serchNotInBattMapByUid",
        data: null
    })
}
 
 
/**
 * 查询地图机房信息(结果中有机房的位置信息)
 * 参数:json = {"StationName1":"北京市","StationName2":"市辖区","StationName5":"海淀区"}
 */
export const searchMapStation = (params) => {
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/BattMap_informationAction!serchStationName3",
        data: "json=" + JSON.stringify(params)
    })
}
 
 
/**
 * 查询机房信息
 * 参数:json = {"StationName1":"北京市","StationName2":"市辖区","StationName5":"海淀区"}
 */
export const searchStation = (params) => {
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/BattInfAction!serchAllStationName",
        data: "json=" + JSON.stringify(params)
    })
}
 
 
 
/**
 * 查询电池组信息
 * 参数:json = {"StationName1":"北京市","StationName2":"市辖区","StationName5":"海淀区","StationName3":"紫晶科技机房"}
 */
export const searchBattInfo = (params) => {
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/BattInfAction!serchAllBattinf",
        data: "json=" + JSON.stringify(params)
    })
}
 
 
//----------------------------
/**
 * 查询已添加到地图的机房
 * 参数:json={"adata":{"alm_cleared_type":0,"alm_id":1},"bplan":{"discharge_reason":3}}
 */
export const searchMap = (params) => {
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/BattMap_informationAction!searchUserManageStation",
        data: "json=" + JSON.stringify(params)
    })
}
 
 
/**
 * 查询机房告警数,落后数和延时数
 * 参数:result={"StationId":"42070218"}
 */
export const searchRooms = (params) => {
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/BattInfAction!serchByIdLow",
        data: "result=" + JSON.stringify(params)
    })
}
 
 
/**
 * 删除地图上的机房
 * 参数:json={"num":141,"StationId":"42070545",
 * "StationName":"湖北省-武汉市-BTS-东西湖区-GDXG演示","StationName3":"",
 * "Address":"湖北省-武汉市-东西湖区-公园南路","longitude":114.252963,"latitude":30.646197,"information":"",
 * "FBSDeviceId":910000120}
 */
export const searchDeletRoom = (params) => {
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/BattMap_informationAction!del",
        data: "json=" + JSON.stringify(params)
    })
}
 
/**
 * 根据机房的id查询机房的经纬度
 * 参数:json={"StationName1":"北京市","StationName2":"市辖区","StationName3":"紫晶科技机房","StationName5":"海淀区"}
 */
export const searchRoomLocation = (params) => {
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/BattMap_informationAction!serchAddressByStationName3",
        data: "json=" + JSON.stringify(params)
    })
}
 
/**
 * 设置地图默认显示的中心坐标
 * 参数:json={"map_longitude":113.971219,"map_latitude":30.605035,"map_level":11}
 */
export const searchCoordinate = (params) => {
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/Positiomap_usrAction!add",
        data: "json=" + JSON.stringify(params)
    })
}
 
/**
 * 获取地图的中心坐标并将地图移动该坐标
 * 无参
 */
export const searchCoordinateMove = () => {
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/Positiomap_usrAction!serchByCondition",
        data: null
    })
}
 
 
/**
 * 查询页面中的导航
 * 无参
 */
export const addNavigation = () => {
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/CustompageAction!searchAll",
        data: null
    })
}
 
/**
 * 查询电池告警率
 * 无参
 */
export const searchAlarm = () => {
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/Battalarm_dataAction!serchAlm",
        data: "bmd.binf.StationName="
    });
}
 
/**
 * 查询电池状态
 * 无参
 */
export const searchBattState = () => {
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/Batt_rtstateAction!serchBattStateRate",
        data: null
    });
}
 
/**
 * 检测当前用户是否在其他未知登录
 * 无参
 * @return  查询结果
 */
export const checkUserLogin = ()=>{
    return axios({
        method: "post",
        url: "/yckj/zijing_sx/LoginAction_check",
        data: null
    });
}