| 
					
				 | 
			
			
				@@ -133,6 +133,9 @@ public class EgDeviceServiceImpl extends AbstractCrudService<EgDeviceMapper, EgD 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if(checkNameUnique(egDevice)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             throw new BusinessException("新增门禁门号设备'"+egDevice.getDeviceId()+","+egDevice.getEgNumber()+"'失败,设备已存在"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(checkDeviceNameUnique(egDevice)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            throw new BusinessException("新增门禁设备'"+egDevice.getDeviceName()+"'失败,设备已存在"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         egDevice.setDeviceUuid(UUIDUtils.uuid()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         egDevice.setCreateBy(SecurityUtils.getUsername()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -159,6 +162,9 @@ public class EgDeviceServiceImpl extends AbstractCrudService<EgDeviceMapper, EgD 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if(checkNameUnique(egDevice)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             throw new BusinessException("修改门禁门号设备'"+egDevice.getDeviceId()+","+egDevice.getEgNumber()+"'失败,设备已存在"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(checkDeviceNameUnique(egDevice)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            throw new BusinessException("新增门禁设备'"+egDevice.getDeviceName()+"'失败,设备已存在"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         egDevice.setUpdateBy(SecurityUtils.getUsername()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         egDevice.setUpdateTime(LocalDateTime.now()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -182,6 +188,9 @@ public class EgDeviceServiceImpl extends AbstractCrudService<EgDeviceMapper, EgD 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if(checkNameUnique(egDevice)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             throw new BusinessException("更新门禁设备附加功能'"+egDevice.getDeviceId()+"'失败,设备已存在"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(checkDeviceNameUnique(egDevice)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            throw new BusinessException("新增门禁设备'"+egDevice.getDeviceName()+"'失败,设备已存在"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         egDevice.setUpdateBy(SecurityUtils.getUsername()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         egDevice.setUpdateTime(LocalDateTime.now()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -217,6 +226,16 @@ public class EgDeviceServiceImpl extends AbstractCrudService<EgDeviceMapper, EgD 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return null != one && !Objects.equals(one.getId(),id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public boolean checkDeviceNameUnique(EgDevice egDevice){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Integer id = null == egDevice.getId() ? -1 : egDevice.getId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LambdaQueryWrapper<EgDevice> queryWrapper = Wrappers.lambdaQuery(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        queryWrapper.eq(EgDevice::getDeviceName,egDevice.getDeviceName()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .eq(EgDevice::getTenantId, SecurityUtils.getTenantId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        EgDevice one = this.getOne(queryWrapper); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return null != one && !Objects.equals(one.getId(),id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public Map<String,Object> control(String productCode, String deviceUuid, String commandCode, String commandValue, String domain, Long userId, String userName){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Integer tenantId; 
			 |