|
|
@ -1878,7 +1878,6 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<DeviceSubscriptionData> requestedDevices = new ArrayList<>();
|
|
|
|
List<DeviceSubscriptionData> requestedDevices = new ArrayList<>();
|
|
|
|
String actionTriggeredFrom = "group";
|
|
|
|
|
|
|
|
int installedCount;
|
|
|
|
int installedCount;
|
|
|
|
int pendingCount;
|
|
|
|
int pendingCount;
|
|
|
|
int errorCount;
|
|
|
|
int errorCount;
|
|
|
@ -1891,32 +1890,32 @@ public class SubscriptionManagerImpl implements SubscriptionManager {
|
|
|
|
switch (request.getTabActionStatus()) {
|
|
|
|
switch (request.getTabActionStatus()) {
|
|
|
|
case "COMPLETED":
|
|
|
|
case "COMPLETED":
|
|
|
|
requestedDevices = installedDevices;
|
|
|
|
requestedDevices = installedDevices;
|
|
|
|
installedCount = subscriptionDAO.countSubscriptionsByStatus(appReleaseId, tenantId, request.getTabActionStatus(), actionTriggeredFrom);
|
|
|
|
installedCount = subscriptionDAO.countSubscriptionsByStatus(appReleaseId, tenantId, request.getTabActionStatus(), request.getActionType());
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "PENDING":
|
|
|
|
case "PENDING":
|
|
|
|
requestedDevices = pendingDevices;
|
|
|
|
requestedDevices = pendingDevices;
|
|
|
|
pendingCount = subscriptionDAO.countSubscriptionsByStatus(appReleaseId, tenantId, request.getTabActionStatus(), actionTriggeredFrom);
|
|
|
|
pendingCount = subscriptionDAO.countSubscriptionsByStatus(appReleaseId, tenantId, request.getTabActionStatus(), request.getActionType());
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "ERROR":
|
|
|
|
case "ERROR":
|
|
|
|
requestedDevices = errorDevices;
|
|
|
|
requestedDevices = errorDevices;
|
|
|
|
errorCount = subscriptionDAO.countSubscriptionsByStatus(appReleaseId, tenantId, request.getTabActionStatus(), actionTriggeredFrom);
|
|
|
|
errorCount = subscriptionDAO.countSubscriptionsByStatus(appReleaseId, tenantId, request.getTabActionStatus(), request.getActionType());
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "NEW":
|
|
|
|
case "NEW":
|
|
|
|
requestedDevices = newDevices;
|
|
|
|
requestedDevices = newDevices;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "SUBSCRIBED":
|
|
|
|
case "SUBSCRIBED":
|
|
|
|
requestedDevices = subscribedDevices;
|
|
|
|
requestedDevices = subscribedDevices;
|
|
|
|
subscribedCount = subscriptionDAO.countSubscriptionsByStatus(appReleaseId, tenantId, request.getTabActionStatus(), actionTriggeredFrom);
|
|
|
|
subscribedCount = subscriptionDAO.countSubscriptionsByStatus(appReleaseId, tenantId, request.getTabActionStatus(), request.getActionType());
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
groupDetailDTO.setDevices(new CategorizedSubscriptionResult(requestedDevices, request.getTabActionStatus()));
|
|
|
|
groupDetailDTO.setDevices(new CategorizedSubscriptionResult(requestedDevices, request.getTabActionStatus()));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
CategorizedSubscriptionResult categorizedSubscriptionResult;
|
|
|
|
CategorizedSubscriptionResult categorizedSubscriptionResult;
|
|
|
|
|
|
|
|
|
|
|
|
installedCount = subscriptionDAO.countSubscriptionsByStatus(appReleaseId, tenantId, "COMPLETED", actionTriggeredFrom);
|
|
|
|
installedCount = subscriptionDAO.countSubscriptionsByStatus(appReleaseId, tenantId, "COMPLETED", request.getActionType());
|
|
|
|
pendingCount = subscriptionDAO.countSubscriptionsByStatus(appReleaseId, tenantId, "PENDING", actionTriggeredFrom);
|
|
|
|
pendingCount = subscriptionDAO.countSubscriptionsByStatus(appReleaseId, tenantId, "PENDING", request.getActionType());
|
|
|
|
errorCount = subscriptionDAO.countSubscriptionsByStatus(appReleaseId, tenantId, "ERROR", actionTriggeredFrom);
|
|
|
|
errorCount = subscriptionDAO.countSubscriptionsByStatus(appReleaseId, tenantId, "ERROR", request.getActionType());
|
|
|
|
subscribedCount = subscriptionDAO.countSubscriptionsByStatus(appReleaseId, tenantId, "SUBSCRIBED", actionTriggeredFrom);
|
|
|
|
subscribedCount = subscriptionDAO.countSubscriptionsByStatus(appReleaseId, tenantId, "SUBSCRIBED", request.getActionType());
|
|
|
|
newCount = totalDeviceCount - (installedCount + pendingCount + errorCount + subscribedCount);
|
|
|
|
newCount = totalDeviceCount - (installedCount + pendingCount + errorCount + subscribedCount);
|
|
|
|
|
|
|
|
|
|
|
|
List<DeviceSubscriptionData> paginatedInstalledDevices = installedDevices.stream()
|
|
|
|
List<DeviceSubscriptionData> paginatedInstalledDevices = installedDevices.stream()
|
|
|
|