|
@ -5,6 +5,10 @@ import java.util.HashMap;
|
5
|
5
|
import java.util.List;
|
6
|
6
|
import java.util.Map;
|
7
|
7
|
|
|
8
|
import com.ai.bss.components.common.model.PageBean;
|
|
9
|
import com.ai.bss.user.dto.UserDto;
|
|
10
|
import com.ai.bss.user.service.api.UserDtoQuery;
|
|
11
|
import com.sun.org.apache.xpath.internal.objects.XString;
|
8
|
12
|
import org.slf4j.Logger;
|
9
|
13
|
import org.slf4j.LoggerFactory;
|
10
|
14
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@ -54,6 +58,11 @@ public class DeviceManageServiceImpl implements DeviceManageService {
|
54
|
58
|
@Autowired
|
55
|
59
|
ResourceToolCommand resourceToolCommand;
|
56
|
60
|
|
|
61
|
@Autowired
|
|
62
|
UserDtoQuery userDtoQuery;
|
|
63
|
|
|
64
|
|
|
65
|
|
57
|
66
|
@Override
|
58
|
67
|
public Map<String, Object> queryPageDeviceInfo(Map<String, String> params, int pageNumber, int pageSize)
|
59
|
68
|
throws Exception {
|
|
@ -308,29 +317,40 @@ public class DeviceManageServiceImpl implements DeviceManageService {
|
308
|
317
|
|
309
|
318
|
@Override
|
310
|
319
|
public Map<String, Object> queryBindDeviceInfo(Map<String, String> params) throws Exception {
|
|
320
|
//组合中台需要的终端id list参数集合
|
311
|
321
|
List<String> deviceIdList=new ArrayList<String>();
|
312
|
322
|
deviceIdList.add(params.get("deviceId"));
|
313
|
323
|
HashMap<String, Object> deviceIdListMap=new HashMap<String, Object>();
|
314
|
324
|
deviceIdListMap.put("deviceIdList", deviceIdList);
|
315
|
|
|
316
|
|
|
317
|
|
|
|
325
|
//定义返回参数map
|
|
326
|
Map<String, Object> returnMap= new HashMap<>();
|
318
|
327
|
// 终端与人员绑定
|
319
|
328
|
CommonResponse<List<EmployeeTerminalRelaDto>> bindEmployeeInfoCommon = employeeTerminalRelaQuery
|
320
|
329
|
.queryIndividualDevRela(new CommonRequest<List<String>>(deviceIdList));
|
321
|
330
|
List<EmployeeTerminalRelaDto> bindEmployeeInfoList = bindEmployeeInfoCommon.getData();
|
322
|
|
|
323
|
|
|
324
|
|
|
325
|
|
// 终端与工具绑定
|
326
|
|
CommonResponse<PageInfo<Map<String, Object>>> bindToolInfoCommon = resourceToolQuery
|
327
|
|
.queryWorkToolsDevRela(new CommonRequest<HashMap<String, Object>>(deviceIdListMap));
|
328
|
|
List<Map<String, Object>> bindToolInfoList = bindToolInfoCommon.getData().getData();
|
329
|
|
|
330
|
|
|
331
|
|
|
332
|
|
|
333
|
|
return null;
|
|
331
|
|
|
332
|
if(!bindEmployeeInfoList.isEmpty()){
|
|
333
|
EmployeeTerminalRelaDto employeeTerminalRelaDto = bindEmployeeInfoList.get(0);
|
|
334
|
returnMap.put("deviceId",params.get("deviceId"));
|
|
335
|
returnMap.put("name",employeeTerminalRelaDto.getName());
|
|
336
|
returnMap.put("relaType",employeeTerminalRelaDto.getRelaType());
|
|
337
|
returnMap.put("employeeTerminalRelaId",employeeTerminalRelaDto.getEmployeeTerminalRelaId());
|
|
338
|
returnMap.put("code",employeeTerminalRelaDto.getCode());
|
|
339
|
returnMap.put("workEmployeeId",employeeTerminalRelaDto.getWorkEmployeeId());
|
|
340
|
returnMap.put("bindType",EbcConstant.BIND_DEVICE_TYPE_USER);
|
|
341
|
return returnMap;
|
|
342
|
}else{
|
|
343
|
// 终端与工具绑定
|
|
344
|
CommonResponse<PageInfo<Map<String, Object>>> bindToolInfoCommon = resourceToolQuery
|
|
345
|
.queryWorkToolsDevRela(new CommonRequest<HashMap<String, Object>>(deviceIdListMap));
|
|
346
|
List<Map<String, Object>> bindToolInfoList = bindToolInfoCommon.getData().getData();
|
|
347
|
if(!bindToolInfoList.isEmpty()){
|
|
348
|
Map<String, Object> stringObjectMap = bindToolInfoList.get(0);
|
|
349
|
returnMap.put("bindType",EbcConstant.BIND_DEVICE_TYPE_SHIP);
|
|
350
|
return stringObjectMap;
|
|
351
|
}
|
|
352
|
return null;
|
|
353
|
}
|
334
|
354
|
}
|
335
|
355
|
|
336
|
356
|
@Override
|
|
@ -351,14 +371,28 @@ public class DeviceManageServiceImpl implements DeviceManageService {
|
351
|
371
|
}
|
352
|
372
|
|
353
|
373
|
@Override
|
354
|
|
public List<Map<String, Object>> queryAssociatInfo(Map<String, String> params) throws Exception {
|
355
|
|
if (EbcConstant.BIND_DEVICE_TYPE_USER.equals(params.get("type"))) {
|
356
|
|
// 类型是用户,查询用户列表
|
357
|
|
|
358
|
|
|
359
|
|
} else if (EbcConstant.BIND_DEVICE_TYPE_SHIP.equals(params.get("type"))) {
|
360
|
|
// 类型是船舶,查询船舶列表
|
361
|
|
|
|
374
|
public List<? extends Object> queryAssociatInfo(Map<String, Object> params) throws Exception {
|
|
375
|
if (EbcConstant.BIND_DEVICE_TYPE_USER.equals(params.get("bindType"))) {
|
|
376
|
|
|
377
|
// 类型是用户,查询用户列表,模糊查询
|
|
378
|
UserDto userDto=new UserDto();
|
|
379
|
String username=(params.get("name")!=null||!"".equals(params.get("name")))?(String) params.get("name"):null;
|
|
380
|
userDto.setName(username);
|
|
381
|
userDto.setOrgCode("0000");
|
|
382
|
CommonRequest<UserDto> request = CommonRequest.<UserDto>builder().data(userDto).pageNumber(1).pageSize(15).build();
|
|
383
|
CommonResponse<List<UserDto>> listCommonResponse = userDtoQuery.queryWorkEmployeeByOrg(request);
|
|
384
|
List<UserDto> userDtoList = listCommonResponse.getData();
|
|
385
|
return userDtoList;
|
|
386
|
} else if (EbcConstant.BIND_DEVICE_TYPE_SHIP.equals(params.get("bindType"))) {
|
|
387
|
// 类型是船舶,查询船舶列表,模糊查询
|
|
388
|
// "workOrgId" : 组织ID
|
|
389
|
// "isAllowBindTerminal" : 该工具是否可绑定,'0'--不可绑定,'1' -- 可绑定
|
|
390
|
params.put("workOrgId", "0000");
|
|
391
|
params.put("isAllowBindTerminal", "0");
|
|
392
|
CommonRequest<HashMap<String, Object>> conditionMap = new CommonRequest<>((HashMap<String, Object>) params);
|
|
393
|
CommonResponse<PageInfo<Map<String, Object>>> pageInfoCommonResponse = resourceToolQuery.queryWorkToolByOrgAndBindFlag(conditionMap);
|
|
394
|
List<Map<String, Object>> shipList = pageInfoCommonResponse.getData().getData();
|
|
395
|
return shipList;
|
362
|
396
|
}
|
363
|
397
|
return null;
|
364
|
398
|
}
|