Commit 91def266 authored by zengtianlai3's avatar zengtianlai3

Merge branch 'm33' into 'master'

进一步完善添加设备黑名单功能

See merge request !33
parents 5c80e391 e44231cc
...@@ -48,14 +48,13 @@ public class DeviceBlackServiceImpl extends ServiceImpl<DeviceBlackMapper, Devic ...@@ -48,14 +48,13 @@ public class DeviceBlackServiceImpl extends ServiceImpl<DeviceBlackMapper, Devic
throw new IotLicenseException(ResultCode.FAILED.getCode(),ResultCode.FAILED.getMsg()); throw new IotLicenseException(ResultCode.FAILED.getCode(),ResultCode.FAILED.getMsg());
} }
Map<String, DeviceVo> allDevice = deviceManager.getAllDevice(); Map<String, DeviceVo> allDevice = deviceManager.getAllDevice();
int count = 0; boolean flag = false;
for (DeviceVo deviceVo : allDevice.values()) { for (DeviceVo deviceVo : allDevice.values()) {
if (deviceVo.getDeviceId() == deviceId){ if (deviceVo.getDeviceId() == deviceId){
break; flag = true;
} }
count++;
} }
if (count == allDevice.size()) { if (!flag) {
throw new IotLicenseException(ResultCode.FAILED.getCode(),ResultCode.FAILED.getMsg()); throw new IotLicenseException(ResultCode.FAILED.getCode(),ResultCode.FAILED.getMsg());
} }
boolean res = deviceBlackMapper.addDeviceBlack(deviceId); boolean res = deviceBlackMapper.addDeviceBlack(deviceId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment