浏览代码

解绑查询关联关系

wangchao 4 年之前
父节点
当前提交
7b5bd7fc8f

+ 2 - 5
location-rescue-service/src/main/java/com/ai/bss/location/rescue/controller/DeviceManageController.java

4
import java.util.List;
4
import java.util.List;
5
import java.util.Map;
5
import java.util.Map;
6
6
7
import org.slf4j.Logger;
8
import org.slf4j.LoggerFactory;
9
import org.springframework.beans.factory.annotation.Autowired;
7
import org.springframework.beans.factory.annotation.Autowired;
10
import org.springframework.stereotype.Controller;
8
import org.springframework.stereotype.Controller;
11
import org.springframework.web.bind.annotation.RequestBody;
9
import org.springframework.web.bind.annotation.RequestBody;
17
import com.ai.bss.location.rescue.service.interfaces.DeviceManageService;
15
import com.ai.bss.location.rescue.service.interfaces.DeviceManageService;
18
import com.ai.bss.location.rescue.util.EbcConstant;
16
import com.ai.bss.location.rescue.util.EbcConstant;
19
import com.ai.bss.location.rescue.util.NorthboundInterfaceConstant;
17
import com.ai.bss.location.rescue.util.NorthboundInterfaceConstant;
20
import com.ai.bss.user.dto.UserDto;
21
18
22
/**
19
/**
23
 * 终端管理
20
 * 终端管理
213
	 */
210
	 */
214
	@ResponseBody
211
	@ResponseBody
215
	@RequestMapping("/queryAssociatInfo")
212
	@RequestMapping("/queryAssociatInfo")
216
	public Map<String, Object> queryAssociatInfo(@RequestBody Map<String, String> params) throws Exception {
217
		List<Map<String, Object>> userList = deviceManageService.queryAssociatInfo(params);
213
	public Map<String, Object> queryAssociatInfo(@RequestBody Map<String, Object> params) throws Exception {
214
		List<? extends Object> userList =  deviceManageService.queryAssociatInfo(params);
218
		Map<String, Object> result = new HashMap<String, Object>();
215
		Map<String, Object> result = new HashMap<String, Object>();
219
		result.put("result", userList);
216
		result.put("result", userList);
220
		return result;
217
		return result;

+ 2 - 1
location-rescue-service/src/main/java/com/ai/bss/location/rescue/controller/EquipmentManageController.java

98
	@ResponseBody
98
	@ResponseBody
99
	@RequestMapping("/modifyEquipmentInfo")
99
	@RequestMapping("/modifyEquipmentInfo")
100
	public CommonResponse<ResourceTool> modifyEquipmentInfo(@RequestBody CommonRequest<ResourceTool> resourceToolCommonRequest) throws Exception {
100
	public CommonResponse<ResourceTool> modifyEquipmentInfo(@RequestBody CommonRequest<ResourceTool> resourceToolCommonRequest) throws Exception {
101
			return equipmentManageService.modifyEquipmentInfo(resourceToolCommonRequest);
101
		resourceToolCommonRequest.getData().setWorkOrgId("0000");
102
		return equipmentManageService.modifyEquipmentInfo(resourceToolCommonRequest);
102
	}
103
	}
103
104
104
	/**
105
	/**

+ 57 - 23
location-rescue-service/src/main/java/com/ai/bss/location/rescue/service/impl/DeviceManageServiceImpl.java

5
import java.util.List;
5
import java.util.List;
6
import java.util.Map;
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
import org.slf4j.Logger;
12
import org.slf4j.Logger;
9
import org.slf4j.LoggerFactory;
13
import org.slf4j.LoggerFactory;
10
import org.springframework.beans.factory.annotation.Autowired;
14
import org.springframework.beans.factory.annotation.Autowired;
54
	@Autowired
58
	@Autowired
55
	ResourceToolCommand resourceToolCommand;
59
	ResourceToolCommand resourceToolCommand;
56
60
61
	@Autowired
62
	UserDtoQuery userDtoQuery;
63
64
65
57
	@Override
66
	@Override
58
	public Map<String, Object> queryPageDeviceInfo(Map<String, String> params, int pageNumber, int pageSize)
67
	public Map<String, Object> queryPageDeviceInfo(Map<String, String> params, int pageNumber, int pageSize)
59
			throws Exception {
68
			throws Exception {
308
317
309
	@Override
318
	@Override
310
	public Map<String, Object> queryBindDeviceInfo(Map<String, String> params) throws Exception {
319
	public Map<String, Object> queryBindDeviceInfo(Map<String, String> params) throws Exception {
320
		//组合中台需要的终端id list参数集合
311
		List<String> deviceIdList=new ArrayList<String>();
321
		List<String> deviceIdList=new ArrayList<String>();
312
		deviceIdList.add(params.get("deviceId"));
322
		deviceIdList.add(params.get("deviceId"));
313
		HashMap<String, Object> deviceIdListMap=new HashMap<String, Object>();
323
		HashMap<String, Object> deviceIdListMap=new HashMap<String, Object>();
314
		deviceIdListMap.put("deviceIdList", deviceIdList);
324
		deviceIdListMap.put("deviceIdList", deviceIdList);
315
		
316
		
317
		
325
		//定义返回参数map
326
		Map<String, Object> returnMap= new HashMap<>();
318
		// 终端与人员绑定
327
		// 终端与人员绑定
319
		CommonResponse<List<EmployeeTerminalRelaDto>> bindEmployeeInfoCommon = employeeTerminalRelaQuery
328
		CommonResponse<List<EmployeeTerminalRelaDto>> bindEmployeeInfoCommon = employeeTerminalRelaQuery
320
				.queryIndividualDevRela(new CommonRequest<List<String>>(deviceIdList));
329
				.queryIndividualDevRela(new CommonRequest<List<String>>(deviceIdList));
321
		List<EmployeeTerminalRelaDto> bindEmployeeInfoList = bindEmployeeInfoCommon.getData();
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
	@Override
356
	@Override
351
	}
371
	}
352
372
353
	@Override
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
		return null;
397
		return null;
364
	}
398
	}

+ 2 - 1
location-rescue-service/src/main/java/com/ai/bss/location/rescue/service/interfaces/DeviceManageService.java

3
import java.util.List;
3
import java.util.List;
4
import java.util.Map;
4
import java.util.Map;
5
5
6
import com.sun.org.apache.xpath.internal.objects.XString;
6
import org.springframework.web.bind.annotation.RequestBody;
7
import org.springframework.web.bind.annotation.RequestBody;
7
8
8
import com.ai.bss.characteristic.spec.model.CharacteristicSpecValue;
9
import com.ai.bss.characteristic.spec.model.CharacteristicSpecValue;
91
	* @return
92
	* @return
92
	* @throws Exception
93
	* @throws Exception
93
	*/
94
	*/
94
	List<Map<String, Object>> queryAssociatInfo(Map<String, String> params) throws Exception;
95
	List<? extends Object> queryAssociatInfo(Map<String, Object> params) throws Exception;
95
96
96
	/**
97
	/**
97
	 * 获取下拉列表的终端信息
98
	 * 获取下拉列表的终端信息