class="language-java"> public List<Map<String, Object>> queryAssociatInfo(Map<String, Object> params) throws Exception {
163
|
294
|
if (EbcConstant.bind_device_type_user.equals(params.get("type"))) {
|
|
@ -170,7 +301,7 @@ public class DeviceManageServiceImpl implements DeviceManageService {
|
170
|
301
|
}
|
171
|
302
|
return new ArrayList<Map<String, Object>>();
|
172
|
303
|
}
|
173
|
|
|
|
304
|
|
174
|
305
|
@Override
|
175
|
306
|
public Map<String, Object> verifyUserOrBoatAssociatInfo(Map<String, Object> params) throws Exception {
|
176
|
307
|
// 查询用户与终端关联表,如果有数据返回,无数据返回空
|
|
@ -178,59 +309,59 @@ public class DeviceManageServiceImpl implements DeviceManageService {
|
178
|
309
|
String.valueOf(params.get("PARTY_CODE")));
|
179
|
310
|
return userAndDeviceMap;
|
180
|
311
|
}
|
181
|
|
|
|
312
|
|
182
|
313
|
@Override
|
183
|
314
|
public boolean bindDevice(Map<String, Object> params) throws Exception {
|
184
|
315
|
int num = deviceManageDao.bindDevice(params, String.valueOf(params.get("type")));
|
185
|
316
|
return num > 0;
|
186
|
317
|
}
|
187
|
|
|
|
318
|
|
188
|
319
|
@Override
|
189
|
320
|
public boolean unbindDevice(Map<String, Object> params) throws Exception {
|
190
|
321
|
int num = deviceManageDao.unbindDevice(params);
|
191
|
322
|
return num > 0;
|
192
|
323
|
}
|
193
|
|
|
|
324
|
|
194
|
325
|
@Override
|
195
|
326
|
public List<Map<String, String>> queryCurrentDeviceLocationInfo(Map<String, Object> params) throws Exception {
|
196
|
327
|
// 获取已绑定的终端列表
|
197
|
328
|
List<Map<String, Object>> bindUserDeviceList = deviceManageDao.queryAllBindUser();
|
198
|
|
|
|
329
|
|
199
|
330
|
if (bindUserDeviceList == null || bindUserDeviceList.isEmpty()) {
|
200
|
331
|
return new ArrayList<Map<String, String>>();
|
201
|
332
|
}
|
202
|
|
|
|
333
|
|
203
|
334
|
List<String> deviceIdsList = new ArrayList<String>();
|
204
|
335
|
for (int i = 0; i < bindUserDeviceList.size(); i++) {
|
205
|
336
|
deviceIdsList.add(String.valueOf(bindUserDeviceList.get(i).get("DEVICE_ID")));
|
206
|
337
|
}
|
207
|
|
|
|
338
|
|
208
|
339
|
// 获取终端当前位置信息
|
209
|
340
|
List<Map<String, String>> list = deviceManageDao.queryCurrentDeviceLocationInfo(deviceIdsList);
|
210
|
|
|
|
341
|
|
211
|
342
|
if (list.isEmpty()) {
|
212
|
343
|
logger.info("未查询到设备位置信息");
|
213
|
344
|
return new ArrayList();
|
214
|
345
|
}
|
215
|
|
|
|
346
|
|
216
|
347
|
// 查询当前所有未关闭的求救信息
|
217
|
348
|
List<Map<String, Object>> alarmMapList = rescueDao.queryNoCloseRescueLog(null);
|
218
|
|
|
|
349
|
|
219
|
350
|
// 查询人员所在围栏信息
|
220
|
351
|
List<String> mapTagTypeList = new ArrayList<String>();
|
221
|
352
|
mapTagTypeList.add(EbcConstant.area_type_exclusion);
|
222
|
353
|
mapTagTypeList.add(EbcConstant.area_type_temporariness);
|
223
|
354
|
List<Map<String, Object>> areaViolationMapList = areaInOutRecordDao.getBeforeInAreaInfo(null, mapTagTypeList);
|
224
|
|
|
|
355
|
|
225
|
356
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DateUtil.NORM_DATETIME_PATTERN);
|
226
|
|
|
|
357
|
|
227
|
358
|
// 拼接返回数据
|
228
|
359
|
for (Map<String, String> map : list) {
|
229
|
360
|
String deviceId = map.get("deviceId");
|
230
|
361
|
map.put("locationStatus", EbcConstant.location_status_normal);// 定位状态
|
231
|
|
|
|
362
|
|
232
|
363
|
boolean flag = true;
|
233
|
|
|
|
364
|
|
234
|
365
|
// 人员名称
|
235
|
366
|
for (Map<String, Object> bindDeviceMap : bindUserDeviceList) {
|
236
|
367
|
if (deviceId.equals(String.valueOf(bindDeviceMap.get("DEVICE_ID")))) {
|
|
@ -239,7 +370,7 @@ public class DeviceManageServiceImpl implements DeviceManageService {
|
239
|
370
|
break;
|
240
|
371
|
}
|
241
|
372
|
}
|
242
|
|
|
|
373
|
|
243
|
374
|
// 离线信息
|
244
|
375
|
if (map.get("alarmType") != null && EbcConstant.alarm_type_offline_beidou == Integer
|
245
|
376
|
.parseInt(String.valueOf(map.get("alarmType")))) {
|
|
@ -247,23 +378,23 @@ public class DeviceManageServiceImpl implements DeviceManageService {
|
247
|
378
|
map.put("alarmType", EbcConstant.alarm_type_offline_ZH);// 报警类型
|
248
|
379
|
flag = false;
|
249
|
380
|
}
|
250
|
|
|
|
381
|
|
251
|
382
|
// 求救信息
|
252
|
383
|
if (flag && alarmMapList != null && !alarmMapList.isEmpty()) {
|
253
|
384
|
for (int i = 0; i < alarmMapList.size() && flag; i++) {
|
254
|
385
|
Map<String, Object> alarmMap = alarmMapList.get(i);
|
255
|
|
|
|
386
|
|
256
|
387
|
// 判断是救援者还是求救者
|
257
|
388
|
if (deviceId.equals(String.valueOf(alarmMap.get("DEVICE_ID")))) {
|
258
|
389
|
// 求救者
|
259
|
390
|
// 求救时间
|
260
|
391
|
String alarmDate = String.valueOf(alarmMap.get("CALLER_DATE"));
|
261
|
392
|
map.put("alarmDate", DateUtil.formatStrDate(alarmDate));
|
262
|
|
|
|
393
|
|
263
|
394
|
// 计算求救时长
|
264
|
395
|
int alarmLong = DateUtil.getDifferenceMinute(alarmDate, map.get("newDate"));
|
265
|
396
|
map.put("alarmLong", String.valueOf(alarmLong));
|
266
|
|
|
|
397
|
|
267
|
398
|
if (alarmMap.get("RESCUERS_ID") == null) {
|
268
|
399
|
// 未指派救援人员
|
269
|
400
|
map.put("isNewAlarm", EbcConstant.alarm_status_needassign);
|
|
@ -272,10 +403,10 @@ public class DeviceManageServiceImpl implements DeviceManageService {
|
272
|
403
|
map.put("isNewAlarm", EbcConstant.alarm_status_needclose);
|
273
|
404
|
// map.put("rescuerDeviceId", String.valueOf(alarmMap.get("RESCUER_DEVICE_ID")));//救援者的设备ID
|
274
|
405
|
}
|
275
|
|
|
|
406
|
|
276
|
407
|
// 求救记录ID
|
277
|
408
|
map.put("alarmLogId", String.valueOf(alarmMap.get("LOG_ID")));
|
278
|
|
|
|
409
|
|
279
|
410
|
// 定位状态
|
280
|
411
|
switch (String.valueOf(alarmMap.get("ALARM_TYPE"))) {
|
281
|
412
|
case EbcConstant.alarm_type_autosos_ZH:
|
|
@ -291,9 +422,9 @@ public class DeviceManageServiceImpl implements DeviceManageService {
|
291
|
422
|
default:
|
292
|
423
|
break;
|
293
|
424
|
}
|
294
|
|
|
|
425
|
|
295
|
426
|
flag = false;
|
296
|
|
|
|
427
|
|
297
|
428
|
} else if (deviceId.equals(String.valueOf(alarmMap.get("RESCUER_DEVICE_ID")))) {
|
298
|
429
|
// 救援者
|
299
|
430
|
map.put("locationStatus", EbcConstant.location_status_rescuer);// 定位状态
|
|
@ -302,13 +433,13 @@ public class DeviceManageServiceImpl implements DeviceManageService {
|
302
|
433
|
}
|
303
|
434
|
}
|
304
|
435
|
}
|
305
|
|
|
|
436
|
|
306
|
437
|
// 违规信息
|
307
|
438
|
if (flag && areaViolationMapList != null && !areaViolationMapList.isEmpty()) {
|
308
|
439
|
int maxMapTagGrade = 0; // 围栏优先级(电子围栏5>定点3>考勤1、作业1)
|
309
|
440
|
long minInAreaLong = System.currentTimeMillis();// 进入围栏最早的时间戳
|
310
|
441
|
Map<String, Object> areaInfoMap = null;// 用于计算时间的围栏信息
|
311
|
|
|
|
442
|
|
312
|
443
|
for (int i = 0; i < areaViolationMapList.size(); i++) {
|
313
|
444
|
Map<String, Object> areaViolationMap = areaViolationMapList.get(i);
|
314
|
445
|
if (deviceId.equals(String.valueOf(areaViolationMap.get("DEVICE_ID")))) {
|
|
@ -322,7 +453,7 @@ public class DeviceManageServiceImpl implements DeviceManageService {
|
322
|
453
|
mapTagGrade = 3;
|
323
|
454
|
break;
|
324
|
455
|
}
|
325
|
|
|
|
456
|
|
326
|
457
|
if (mapTagGrade == maxMapTagGrade) {
|
327
|
458
|
// 比较进入时长时间
|
328
|
459
|
long inAreaLong = simpleDateFormat.parse(String.valueOf(areaViolationMap.get("IN_DATE")))
|
|
@ -339,23 +470,23 @@ public class DeviceManageServiceImpl implements DeviceManageService {
|
339
|
470
|
}
|
340
|
471
|
}
|
341
|
472
|
}
|
342
|
|
|
|
473
|
|
343
|
474
|
// 判断是否违规
|
344
|
475
|
if (maxMapTagGrade == 5) {
|
345
|
476
|
// 进入电子围栏(禁区),需显示进入时间
|
346
|
477
|
map.put("inDate", simpleDateFormat.format(areaInfoMap.get("IN_DATE"))); // 进入时间
|
347
|
478
|
map.put("locationStatus", EbcConstant.location_status_exclusion); // 定位状态
|
348
|
|
|
|
479
|
|
349
|
480
|
} else if (maxMapTagGrade == 3) {
|
350
|
481
|
// 进入定点(限时),需计算是否超时
|
351
|
482
|
int fixedLong = DateUtil.getDifferenceMinute(String.valueOf(areaInfoMap.get("IN_DATE")),
|
352
|
483
|
map.get("newDate"));
|
353
|
|
|
|
484
|
|
354
|
485
|
if (fixedLong > 0) {
|
355
|
486
|
// 围栏要求定点时间
|
356
|
487
|
int residenceTimeLength = Integer
|
357
|
488
|
.parseInt(String.valueOf(areaInfoMap.get("RESIDENCE_TIME_LENGTH")));
|
358
|
|
|
|
489
|
|
359
|
490
|
if (residenceTimeLength <= fixedLong) {
|
360
|
491
|
// 已超时
|
361
|
492
|
map.put("locationStatus", EbcConstant.location_status_overtime);// 定位状态
|
|
@ -365,14 +496,14 @@ public class DeviceManageServiceImpl implements DeviceManageService {
|
365
|
496
|
}
|
366
|
497
|
}
|
367
|
498
|
}
|
368
|
|
|
|
499
|
|
369
|
500
|
return list;
|
370
|
501
|
}
|
371
|
|
|
|
502
|
|
372
|
503
|
@Override
|
373
|
504
|
public Map<String, Object> queryOneDeviceLocationInfo(Map<String, Object> params, int pageNum, int pageSize)
|
374
|
505
|
throws Exception {
|
375
|
|
/*Map<String,Object> resultMap<String,Object> = new HashMap<String,Object>();
|
|
506
|
Map<String,Object> resultMap<String,Object> = new HashMap<String,Object>();
|
376
|
507
|
String beginTime = null;// 开始时间
|
377
|
508
|
String endTime = null;// 结束时间
|
378
|
509
|
|
|
@ -415,8 +546,8 @@ public class DeviceManageServiceImpl implements DeviceManageService {
|
415
|
546
|
paramsMap.put("endTime", endTime);
|
416
|
547
|
|
417
|
548
|
resultMap<String,Object> = deviceManageDao.queryOneDeviceLocationInfo(paramsMap, pageNum, pageSize);
|
418
|
|
return resultMap<String,Object>;*/
|
|
549
|
return resultMap<String,Object>;
|
419
|
550
|
return null;
|
420
|
|
}
|
|
551
|
}*/
|
421
|
552
|
|
422
|
553
|
}
|
|
@ -4,10 +4,11 @@ package com.ai.bss.location.rescue.service.impl;
|
4
|
4
|
import com.ai.abc.api.model.CommonRequest;
|
5
|
5
|
import com.ai.abc.api.model.CommonResponse;
|
6
|
6
|
import com.ai.bss.components.common.model.PageInfo;
|
7
|
|
import com.ai.bss.location.rescue.dao.interfaces.DeviceManageDao;
|
8
|
7
|
import com.ai.bss.location.rescue.dao.interfaces.EquipmentManageDao;
|
9
|
8
|
import com.ai.bss.location.rescue.service.interfaces.EquipmentManageService;
|
10
|
9
|
|
|
10
|
import static org.junit.Assert.assertNotNull;
|
|
11
|
|
11
|
12
|
import java.util.*;
|
12
|
13
|
|
13
|
14
|
import com.ai.bss.work.tool.model.ResourceTool;
|
|
@ -29,9 +30,6 @@ public class EquipmentManageServiceImpl implements EquipmentManageService {
|
29
|
30
|
EquipmentManageDao equipmentManageDao;
|
30
|
31
|
|
31
|
32
|
@Autowired
|
32
|
|
DeviceManageDao deviceManageDao;
|
33
|
|
|
34
|
|
@Autowired
|
35
|
33
|
ResourceToolCommand resourceToolCommand;
|
36
|
34
|
|
37
|
35
|
@Autowired
|
|
@ -85,8 +83,9 @@ public class EquipmentManageServiceImpl implements EquipmentManageService {
|
85
|
83
|
List<Map<String, Object>> allEquipmentList = equipmentManageDao.queryAllEquipmentInfo(params);
|
86
|
84
|
|
87
|
85
|
// 获取已绑定船舶的信息
|
88
|
|
List<Map<String, Object>> bindInfoList = deviceManageDao.queryAllBindShip();
|
89
|
|
|
|
86
|
//List<Map<String, Object>> bindInfoList = deviceManageDao.queryAllBindShip();
|
|
87
|
List<Map<String, Object>> bindInfoList = null;
|
|
88
|
|
90
|
89
|
if (bindInfoList == null || bindInfoList.isEmpty()) {
|
91
|
90
|
return allEquipmentList;
|
92
|
91
|
}
|
|
@ -96,9 +95,11 @@ public class EquipmentManageServiceImpl implements EquipmentManageService {
|
96
|
95
|
for (Map<String, Object> bindInfoMap : bindInfoList) {
|
97
|
96
|
deviceIdsList.add(String.valueOf(bindInfoMap.get("DEVICE_ID")));
|
98
|
97
|
}
|
99
|
|
List<Map<String, String>> deviceLocationInfoList = deviceManageDao
|
100
|
|
.queryCurrentDeviceLocationInfo(deviceIdsList);
|
101
|
|
|
|
98
|
//List<Map<String, String>> deviceLocationInfoList = deviceManageDao
|
|
99
|
// .queryCurrentDeviceLocationInfo(deviceIdsList);
|
|
100
|
List<Map<String, String>> deviceLocationInfoList = null;
|
|
101
|
|
|
102
|
|
102
|
103
|
// 拼接船舶最新的位置信息
|
103
|
104
|
for (Map<String, Object> bindInfoMap : bindInfoList) {
|
104
|
105
|
String code = String.valueOf(bindInfoMap.get("CODE"));
|
|
@ -10,7 +10,6 @@ import org.slf4j.LoggerFactory;
|
10
|
10
|
import org.springframework.beans.factory.annotation.Autowired;
|
11
|
11
|
import org.springframework.stereotype.Service;
|
12
|
12
|
|
13
|
|
import com.ai.bss.location.rescue.dao.interfaces.DeviceManageDao;
|
14
|
13
|
import com.ai.bss.location.rescue.dao.interfaces.MapTagManageDao;
|
15
|
14
|
import com.ai.bss.location.rescue.service.interfaces.ReceiveSubscribeService;
|
16
|
15
|
import com.ai.bss.location.rescue.service.iotdata.ManageIotInAreaData;
|
|
@ -41,9 +40,6 @@ public class ReceiveSubscribeServiceImpl implements ReceiveSubscribeService {
|
41
|
40
|
@Autowired
|
42
|
41
|
MapTagManageDao mapTagManageDao;
|
43
|
42
|
|
44
|
|
@Autowired
|
45
|
|
DeviceManageDao deviceManageDao;
|
46
|
|
|
47
|
43
|
private ExecutorService cachedThreadPool = Executors.newCachedThreadPool();
|
48
|
44
|
|
49
|
45
|
@Override
|
|
@ -102,9 +98,9 @@ public class ReceiveSubscribeServiceImpl implements ReceiveSubscribeService {
|
102
|
98
|
*/
|
103
|
99
|
private void executeReceiveIotLocationData(Map<String, Object> params) throws Exception {
|
104
|
100
|
// 获取人员信息
|
105
|
|
Map<String, Object> bindInfoMap = deviceManageDao.queryOneBindUser(String.valueOf(params.get("deviceId")),
|
106
|
|
null);
|
107
|
|
|
|
101
|
//Map<String, Object> bindInfoMap = deviceManageDao.queryOneBindUser(String.valueOf(params.get("deviceId")),null);
|
|
102
|
Map<String, Object> bindInfoMap = null;
|
|
103
|
|
108
|
104
|
if (bindInfoMap == null) {
|
109
|
105
|
// 1、设备与工具(船)绑定
|
110
|
106
|
manageIotToolData.executeReceiveIotData(params);
|
|
@ -144,9 +140,9 @@ public class ReceiveSubscribeServiceImpl implements ReceiveSubscribeService {
|
144
|
140
|
*/
|
145
|
141
|
private void executeReceiveIotAlarmData(Map<String, Object> params) throws Exception {
|
146
|
142
|
// 获取人员信息
|
147
|
|
Map<String, Object> bindInfoMap = deviceManageDao.queryOneBindUser(String.valueOf(params.get("deviceId")),
|
148
|
|
null);
|
149
|
|
|
|
143
|
//Map<String, Object> bindInfoMap = deviceManageDao.queryOneBindUser(String.valueOf(params.get("deviceId")),null);
|
|
144
|
Map<String, Object> bindInfoMap =null;
|
|
145
|
|
150
|
146
|
if (bindInfoMap == null) {
|
151
|
147
|
// 设备未与人员绑定
|
152
|
148
|
logger.error("定位设备未与人员绑定");
|
|
@ -1,21 +1,20 @@
|
1
|
1
|
package com.ai.bss.location.rescue.service.impl;
|
2
|
2
|
|
3
|
3
|
|
4
|
|
import com.ai.bss.location.rescue.dao.interfaces.DeviceManageDao;
|
5
|
|
import com.ai.bss.location.rescue.dao.interfaces.RescueDao;
|
6
|
|
import com.ai.bss.location.rescue.service.interfaces.RescueService;
|
7
|
|
import com.ai.bss.location.rescue.util.DateUtil;
|
8
|
|
import com.ai.bss.location.rescue.util.EbcConstant;
|
|
4
|
import java.util.ArrayList;
|
|
5
|
import java.util.HashMap;
|
|
6
|
import java.util.List;
|
9
|
7
|
import java.util.Map;
|
|
8
|
|
10
|
9
|
import org.slf4j.Logger;
|
11
|
10
|
import org.slf4j.LoggerFactory;
|
12
|
11
|
import org.springframework.beans.factory.annotation.Autowired;
|
13
|
12
|
import org.springframework.stereotype.Service;
|
14
|
13
|
|
15
|
|
import java.util.ArrayList;
|
16
|
|
import java.util.HashMap;
|
17
|
|
import java.util.List;
|
18
|
|
import java.util.Map;
|
|
14
|
import com.ai.bss.location.rescue.dao.interfaces.RescueDao;
|
|
15
|
import com.ai.bss.location.rescue.service.interfaces.RescueService;
|
|
16
|
import com.ai.bss.location.rescue.util.DateUtil;
|
|
17
|
import com.ai.bss.location.rescue.util.EbcConstant;
|
19
|
18
|
|
20
|
19
|
@Service
|
21
|
20
|
public class RescueServiceImpl implements RescueService {
|
|
@ -24,8 +23,6 @@ public class RescueServiceImpl implements RescueService {
|
24
|
23
|
@Autowired
|
25
|
24
|
RescueDao rescueDao;
|
26
|
25
|
|
27
|
|
@Autowired
|
28
|
|
DeviceManageDao deviceManageDao;
|
29
|
26
|
|
30
|
27
|
@Override
|
31
|
28
|
public List<Map<String, Object>> queryListRescuerInfo(Map<String,Object> params, int pageNum, int pageSize) throws Exception {
|
|
@ -81,8 +78,10 @@ public class RescueServiceImpl implements RescueService {
|
81
|
78
|
}
|
82
|
79
|
|
83
|
80
|
// 获取终端当前位置信息
|
84
|
|
List<Map<String, String>> deviceList = deviceManageDao.queryCurrentDeviceLocationInfo(deviceIdsList);
|
85
|
|
|
|
81
|
//List<Map<String, String>> deviceList = deviceManageDao.queryCurrentDeviceLocationInfo(deviceIdsList);
|
|
82
|
List<Map<String, String>> deviceList =null;
|
|
83
|
|
|
84
|
|
86
|
85
|
if (deviceList.isEmpty()) {
|
87
|
86
|
logger.info("未查询到设备位置信息");
|
88
|
87
|
return new ArrayList();
|
|
@ -3,104 +3,140 @@ package com.ai.bss.location.rescue.service.interfaces;
|
3
|
3
|
import java.util.List;
|
4
|
4
|
import java.util.Map;
|
5
|
5
|
|
|
6
|
import com.ai.bss.characteristic.spec.model.CharacteristicSpecValue;
|
|
7
|
|
6
|
8
|
public interface DeviceManageService {
|
7
|
9
|
|
8
|
10
|
/**
|
9
|
11
|
* 分页查询终端信息
|
10
|
12
|
* @param params
|
11
|
|
* @param pageNum 当前页数
|
|
13
|
* @param pageNumber 当前页数
|
12
|
14
|
* @param pageSize 每页条数
|
13
|
15
|
* @return
|
14
|
16
|
* @throws Exception
|
15
|
17
|
*/
|
16
|
|
Map<String, Object> queryPageDeviceInfo(Map<String, Object> params, int pageNum, int pageSize) throws Exception;
|
|
18
|
Map<String, Object> queryPageDeviceInfo(Map<String, String> params, int pageNumber, int pageSize) throws Exception;
|
17
|
19
|
|
18
|
20
|
/**
|
19
|
|
* 获取下拉列表的终端信息
|
20
|
|
* @param params
|
21
|
|
* @param pageNum 当前页数
|
22
|
|
* @param pageSize 每页条数
|
|
21
|
* 获取终端类型下拉列表
|
23
|
22
|
* @return
|
24
|
|
* @throws Exception
|
25
|
23
|
*/
|
26
|
|
List<Map<String, String>> queryListDeviceInfo(Map<String, Object> params, int pageNum, int pageSize)
|
27
|
|
throws Exception;
|
28
|
|
|
29
|
|
/**
|
30
|
|
* 获取单个终端信息
|
31
|
|
* @param params
|
32
|
|
* @return
|
33
|
|
* @throws Exception
|
34
|
|
*/
|
35
|
|
Map<String, Object> queryOneDeviceInfo(Map<String, Object> params) throws Exception;
|
36
|
|
|
|
24
|
List<CharacteristicSpecValue> queryDeviceTypeList();
|
|
25
|
|
37
|
26
|
/**
|
38
|
|
* 新增终端信息
|
39
|
|
* @param params
|
40
|
|
* @return
|
41
|
|
* @throws Exception
|
42
|
|
*/
|
43
|
|
Map<String, String> addDeviceInfo(Map<String, Object> params) throws Exception;
|
|
27
|
* 获取单个终端信息
|
|
28
|
* @param params
|
|
29
|
* @return
|
|
30
|
* @throws Exception
|
|
31
|
*/
|
44
|
32
|
|
45
|
|
/**
|
46
|
|
* 修改终端信息
|
47
|
|
* @param params
|
48
|
|
* @return
|
49
|
|
* @throws Exception
|
50
|
|
*/
|
51
|
|
Map<String, String> modifyDeviceInfo(Map<String, Object> params) throws Exception;
|
|
33
|
Map<String, Object> queryOneDeviceInfo(Map<String, String> params) throws Exception;
|
52
|
34
|
|
53
|
|
/**
|
54
|
|
* 删除终端信息
|
55
|
|
* @param params
|
56
|
|
* @return
|
57
|
|
* @throws Exception
|
58
|
|
*/
|
59
|
|
Map<String, String> deleteDeviceInfo(Map<String, Object> params) throws Exception;
|
|
35
|
/**
|
|
36
|
* 新增终端信息
|
|
37
|
* @param params
|
|
38
|
* @return
|
|
39
|
* @throws Exception
|
|
40
|
*/
|
60
|
41
|
|
61
|
|
/**
|
62
|
|
* 绑定终端
|
63
|
|
* @param params
|
64
|
|
* @param type
|
65
|
|
* @return
|
66
|
|
* @throws Exception
|
67
|
|
*/
|
68
|
|
boolean bindDevice(Map<String, Object> params) throws Exception;
|
|
42
|
Map<String, String> addDeviceInfo(Map<String, String> params) throws Exception;
|
69
|
43
|
|
70
|
|
/**
|
71
|
|
* 解绑终端
|
72
|
|
* @param params
|
73
|
|
* @return
|
74
|
|
* @throws Exception
|
75
|
|
*/
|
76
|
|
boolean unbindDevice(Map<String, Object> params) throws Exception;
|
|
44
|
/**
|
|
45
|
* 修改终端信息
|
|
46
|
* @param params
|
|
47
|
* @return
|
|
48
|
* @throws Exception
|
|
49
|
*/
|
77
|
50
|
|
78
|
|
/**
|
79
|
|
* 获取人员或船舶的下拉列表数据
|
80
|
|
* @param params
|
81
|
|
* @return
|
82
|
|
* @throws Exception
|
83
|
|
*/
|
84
|
|
List<Map<String, Object>> queryAssociatInfo(Map<String, Object> params) throws Exception;
|
|
51
|
Map<String, String> modifyDeviceInfo(Map<String, String> params) throws Exception;
|
85
|
52
|
|
86
|
|
Map<String, Object> verifyUserOrBoatAssociatInfo(Map<String, Object> params) throws Exception;
|
|
53
|
/**
|
|
54
|
* 删除终端信息
|
|
55
|
* @param params
|
|
56
|
* @return
|
|
57
|
* @throws Exception
|
|
58
|
*/
|
|
59
|
Map<String, String> deleteDeviceInfo(Map<String, String> params) throws Exception;
|
87
|
60
|
|
88
|
|
/**
|
89
|
|
* 获取终端的最新事件
|
90
|
|
* @param params
|
91
|
|
* @return
|
92
|
|
* @throws Exception
|
93
|
|
*/
|
94
|
|
List<Map<String, String>> queryCurrentDeviceLocationInfo(Map<String, Object> params) throws Exception;
|
95
|
61
|
|
|
62
|
|
|
63
|
|
|
64
|
|
|
65
|
|
|
66
|
|
|
67
|
|
|
68
|
|
|
69
|
|
|
70
|
|
|
71
|
|
|
72
|
|
|
73
|
|
|
74
|
|
|
75
|
|
|
76
|
|
|
77
|
|
|
78
|
|
|
79
|
|
|
80
|
|
|
81
|
|
96
|
82
|
/**
|
97
|
|
* 按时间段获取终端的定位信息
|
|
83
|
* 获取下拉列表的终端信息
|
98
|
84
|
* @param params
|
99
|
85
|
* @param pageNum 当前页数
|
100
|
86
|
* @param pageSize 每页条数
|
101
|
87
|
* @return
|
102
|
88
|
* @throws Exception
|
103
|
89
|
*/
|
104
|
|
Map<String, Object> queryOneDeviceLocationInfo(Map<String, Object> params, int pageNum, int pageSize)
|
|
90
|
/*List<Map<String, String>> queryListDeviceInfo(Map<String, Object> params, int pageNum, int pageSize)
|
105
|
91
|
throws Exception;
|
|
92
|
|
|
93
|
*//**
|
|
94
|
* 绑定终端
|
|
95
|
* @param params
|
|
96
|
* @param type
|
|
97
|
* @return
|
|
98
|
* @throws Exception
|
|
99
|
*/
|
|
100
|
/*
|
|
101
|
boolean bindDevice(Map<String, Object> params) throws Exception;
|
|
102
|
|
|
103
|
*//**
|
|
104
|
* 解绑终端
|
|
105
|
* @param params
|
|
106
|
* @return
|
|
107
|
* @throws Exception
|
|
108
|
*/
|
|
109
|
/*
|
|
110
|
boolean unbindDevice(Map<String, Object> params) throws Exception;
|
|
111
|
|
|
112
|
*//**
|
|
113
|
* 获取人员或船舶的下拉列表数据
|
|
114
|
* @param params
|
|
115
|
* @return
|
|
116
|
* @throws Exception
|
|
117
|
*/
|
|
118
|
/*
|
|
119
|
List<Map<String, Object>> queryAssociatInfo(Map<String, Object> params) throws Exception;
|
|
120
|
|
|
121
|
Map<String, Object> verifyUserOrBoatAssociatInfo(Map<String, Object> params) throws Exception;
|
|
122
|
|
|
123
|
*//**
|
|
124
|
* 获取终端的最新事件
|
|
125
|
* @param params
|
|
126
|
* @return
|
|
127
|
* @throws Exception
|
|
128
|
*/
|
|
129
|
/*
|
|
130
|
List<Map<String, String>> queryCurrentDeviceLocationInfo(Map<String, Object> params) throws Exception;
|
|
131
|
|
|
132
|
*//**
|
|
133
|
* 按时间段获取终端的定位信息
|
|
134
|
* @param params
|
|
135
|
* @param pageNum 当前页数
|
|
136
|
* @param pageSize 每页条数
|
|
137
|
* @return
|
|
138
|
* @throws Exception
|
|
139
|
*//*
|
|
140
|
Map<String, Object> queryOneDeviceLocationInfo(Map<String, Object> params, int pageNum, int pageSize)
|
|
141
|
throws Exception;*/
|
106
|
142
|
}
|
|
@ -5,22 +5,19 @@ import java.util.Map;
|
5
|
5
|
|
6
|
6
|
import org.slf4j.Logger;
|
7
|
7
|
import org.slf4j.LoggerFactory;
|
8
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
9
|
8
|
import org.springframework.stereotype.Component;
|
10
|
9
|
|
11
|
|
import com.ai.bss.location.rescue.dao.interfaces.DeviceManageDao;
|
12
|
10
|
import com.ai.bss.location.rescue.util.MirrorSendDateUtil;
|
13
|
11
|
|
14
|
12
|
@Component
|
15
|
13
|
public class ManageIotToolData {
|
16
|
14
|
private static final Logger logger = LoggerFactory.getLogger(ManageIotToolData.class);
|
17
|
15
|
|
18
|
|
@Autowired
|
19
|
|
DeviceManageDao deviceManageDao;
|
20
|
16
|
|
21
|
17
|
public boolean executeReceiveIotData(Map<String,Object> params) throws Exception {
|
22
|
|
Map<String, Object> bindInfoMap = deviceManageDao.queryOneBindShip(String.valueOf(params.get("deviceId")), null);
|
23
|
|
|
|
18
|
//Map<String, Object> bindInfoMap = deviceManageDao.queryOneBindShip(String.valueOf(params.get("deviceId")), null);
|
|
19
|
Map<String, Object> bindInfoMap = null;
|
|
20
|
|
24
|
21
|
if (bindInfoMap == null) {
|
25
|
22
|
// 设备未绑定
|
26
|
23
|
logger.error("定位设备未绑定");
|
|
@ -7,38 +7,51 @@ package com.ai.bss.location.rescue.util;
|
7
|
7
|
*/
|
8
|
8
|
public class EbcConstant {
|
9
|
9
|
// 下拉列表最大查询条数
|
10
|
|
public static final int comboBox_maxNum = 20;
|
|
10
|
public static final int COMBOBOX_MAXNUM = 30;
|
11
|
11
|
|
12
|
12
|
// 每页默认查询条数
|
13
|
|
public static final int default_page_size = 20;
|
|
13
|
public static final int DEFAULT_PAGE_SIZE = 20;
|
14
|
14
|
|
15
|
15
|
// 轨迹回放单次查询条数
|
16
|
|
public static final int track_playback_size = 100;
|
|
16
|
public static final int TRACK_PLAYBACK_SIZE = 100;
|
17
|
17
|
|
18
|
18
|
// 经纬度的精度
|
19
|
|
public static final int coord_scale = 7;
|
20
|
|
|
21
|
|
// 终端的产品id
|
22
|
|
public static final String beidouDevice_product_id = "57700004344";
|
|
19
|
public static final int COORD_SCALE = 7;
|
23
|
20
|
|
24
|
21
|
// 终端的名称前缀
|
25
|
|
public static final String beidouDevice_name = "康派北斗定位器";
|
|
22
|
public static final String BEIDOUDEVICE_NAME = "康派北斗 - ";
|
26
|
23
|
|
27
|
24
|
// 全部终端(已关联和未关联)
|
28
|
|
public static final String bind_device_all = "0";
|
|
25
|
public static final String BIND_DEVICE_ALL = "0";
|
29
|
26
|
|
30
|
27
|
// 已关联终端
|
31
|
|
public static final String bind_device_ok = "1";
|
|
28
|
public static final String BIND_DEVICE_OK = "1";
|
32
|
29
|
|
33
|
30
|
// 未关联终端
|
34
|
|
public static final String bind_device_no = "2";
|
|
31
|
public static final String BIND_DEVICE_NO = "2";
|
35
|
32
|
|
36
|
33
|
// 终端和人员绑定
|
37
|
|
public static final String bind_device_type_user = "1";
|
|
34
|
public static final String BIND_DEVICE_TYPE_USER = "1";
|
38
|
35
|
|
39
|
36
|
// 终端和船舶绑定
|
40
|
|
public static final String bind_device_type_ship = "2";
|
|
37
|
public static final String BIND_DEVICE_TYPE_SHIP = "2";
|
41
|
38
|
|
|
39
|
//静态常量: 设备类型
|
|
40
|
public static final String BUSINESS_SPEC_PRODUCT_TYPE="PRODUCT_TYPE";
|
|
41
|
|
|
42
|
//静态常量: 围栏类型
|
|
43
|
public static final String BUSINESS_SPEC_MAP_AREA_TYPE="MAP_AREA_TYPE";
|
|
44
|
|
|
45
|
|
|
46
|
|
|
47
|
|
|
48
|
|
|
49
|
|
|
50
|
|
|
51
|
|
|
52
|
|
|
53
|
|
|
54
|
|
42
|
55
|
// 围栏标记类型:考勤区域
|
43
|
56
|
public static final String area_type_attendance = "1";
|
44
|
57
|
|