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