|
|
@ -108,8 +108,8 @@ public class DeviceController extends BaseController { |
|
|
tbClusterService.pushMsgToCore(new DeviceNameOrTypeUpdateMsg(savedDevice.getTenantId(), |
|
|
tbClusterService.pushMsgToCore(new DeviceNameOrTypeUpdateMsg(savedDevice.getTenantId(), |
|
|
savedDevice.getId(), savedDevice.getName(), savedDevice.getType()), null); |
|
|
savedDevice.getId(), savedDevice.getName(), savedDevice.getType()), null); |
|
|
|
|
|
|
|
|
sendNotificationMsgToEdgeService(savedDevice.getTenantId(), null, savedDevice.getId(), |
|
|
sendNotificationMsgToEdgeService(savedDevice.getTenantId(), savedDevice.getId(), |
|
|
EdgeEventType.DEVICE, device.getId() == null ? ActionType.ADDED : ActionType.UPDATED); |
|
|
device.getId() == null ? ActionType.ADDED : ActionType.UPDATED); |
|
|
|
|
|
|
|
|
logEntityAction(savedDevice.getId(), savedDevice, |
|
|
logEntityAction(savedDevice.getId(), savedDevice, |
|
|
savedDevice.getCustomerId(), |
|
|
savedDevice.getCustomerId(), |
|
|
@ -142,7 +142,7 @@ public class DeviceController extends BaseController { |
|
|
device.getCustomerId(), |
|
|
device.getCustomerId(), |
|
|
ActionType.DELETED, null, strDeviceId); |
|
|
ActionType.DELETED, null, strDeviceId); |
|
|
|
|
|
|
|
|
sendNotificationMsgToEdgeService(getTenantId(), null, deviceId, EdgeEventType.DEVICE, ActionType.DELETED); |
|
|
sendNotificationMsgToEdgeService(getTenantId(), deviceId, ActionType.DELETED); |
|
|
|
|
|
|
|
|
deviceStateService.onDeviceDeleted(device); |
|
|
deviceStateService.onDeviceDeleted(device); |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
@ -267,7 +267,7 @@ public class DeviceController extends BaseController { |
|
|
|
|
|
|
|
|
tbClusterService.pushMsgToCore(new DeviceCredentialsUpdateNotificationMsg(getCurrentUser().getTenantId(), deviceCredentials.getDeviceId()), null); |
|
|
tbClusterService.pushMsgToCore(new DeviceCredentialsUpdateNotificationMsg(getCurrentUser().getTenantId(), deviceCredentials.getDeviceId()), null); |
|
|
|
|
|
|
|
|
sendNotificationMsgToEdgeService(getTenantId(), null, device.getId(), EdgeEventType.DEVICE, ActionType.CREDENTIALS_UPDATED); |
|
|
sendNotificationMsgToEdgeService(getTenantId(), device.getId(), ActionType.CREDENTIALS_UPDATED); |
|
|
|
|
|
|
|
|
logEntityAction(device.getId(), device, |
|
|
logEntityAction(device.getId(), device, |
|
|
device.getCustomerId(), |
|
|
device.getCustomerId(), |
|
|
@ -518,7 +518,7 @@ public class DeviceController extends BaseController { |
|
|
savedDevice.getCustomerId(), |
|
|
savedDevice.getCustomerId(), |
|
|
ActionType.ASSIGNED_TO_EDGE, null, strDeviceId, strEdgeId, edge.getName()); |
|
|
ActionType.ASSIGNED_TO_EDGE, null, strDeviceId, strEdgeId, edge.getName()); |
|
|
|
|
|
|
|
|
sendNotificationMsgToEdgeService(getTenantId(), edgeId, savedDevice.getId(), EdgeEventType.DEVICE, ActionType.ASSIGNED_TO_EDGE); |
|
|
sendNotificationMsgToEdgeService(getTenantId(), edgeId, savedDevice.getId(), ActionType.ASSIGNED_TO_EDGE); |
|
|
|
|
|
|
|
|
return savedDevice; |
|
|
return savedDevice; |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
@ -549,7 +549,7 @@ public class DeviceController extends BaseController { |
|
|
device.getCustomerId(), |
|
|
device.getCustomerId(), |
|
|
ActionType.UNASSIGNED_FROM_EDGE, null, strDeviceId, edge.getId().toString(), edge.getName()); |
|
|
ActionType.UNASSIGNED_FROM_EDGE, null, strDeviceId, edge.getId().toString(), edge.getName()); |
|
|
|
|
|
|
|
|
sendNotificationMsgToEdgeService(getTenantId(), edgeId, savedDevice.getId(), EdgeEventType.DEVICE, ActionType.UNASSIGNED_FROM_EDGE); |
|
|
sendNotificationMsgToEdgeService(getTenantId(), edgeId, savedDevice.getId(), ActionType.UNASSIGNED_FROM_EDGE); |
|
|
|
|
|
|
|
|
return savedDevice; |
|
|
return savedDevice; |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
|