Commit 26e2aa6f authored by 赵啸非's avatar 赵啸非

修改设备激活

parent 4764690c
......@@ -201,7 +201,7 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
public void active(String deviceCode, Context context) {
DeviceEntity deviceEntity = this.selectOne(new DeviceQuery().deviceCode(deviceCode));
if (ObjectUtils.isEmpty(deviceEntity)) throw new AppException("当前设备不存在!");
if (deviceEntity.getDeviceStatus() != DeviceStatusEnum.未激活.getValue())
if (deviceEntity.getDeviceStatus() > DeviceStatusEnum.未激活.getValue())
throw new AppException("当前设备已激活!");
deviceEntity.setDeviceStatus(DeviceStatusEnum.离线.getValue());
deviceEntity.setEnabled(EnabledEnum.启用.getValue());
......
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