mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Add fix for usage load performance
This commit is contained in:
commit
ababfc8100
@ -1093,10 +1093,10 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|||||||
}
|
}
|
||||||
|
|
||||||
public double generateCost(List<Device> allDevices, Timestamp startDate, Timestamp endDate, Cost tenantCost, List<Device> deviceStatusNotAvailable, double totalCost) throws DeviceManagementException {
|
public double generateCost(List<Device> allDevices, Timestamp startDate, Timestamp endDate, Cost tenantCost, List<Device> deviceStatusNotAvailable, double totalCost) throws DeviceManagementException {
|
||||||
|
List<DeviceStatus> deviceStatus;
|
||||||
for (Device device : allDevices) {
|
for (Device device : allDevices) {
|
||||||
long dateDiff = 0;
|
long dateDiff = 0;
|
||||||
device.setDeviceStatusInfo(getDeviceStatusHistory(device, null, endDate, true));
|
deviceStatus = getDeviceStatusHistory(device, null, endDate, true);
|
||||||
List<DeviceStatus> deviceStatus = device.getDeviceStatusInfo();
|
|
||||||
if (device.getEnrolmentInfo().getDateOfEnrolment() < startDate.getTime()) {
|
if (device.getEnrolmentInfo().getDateOfEnrolment() < startDate.getTime()) {
|
||||||
if (!deviceStatus.isEmpty() && (String.valueOf(deviceStatus.get(0).getStatus()).equals("REMOVED")
|
if (!deviceStatus.isEmpty() && (String.valueOf(deviceStatus.get(0).getStatus()).equals("REMOVED")
|
||||||
|| String.valueOf(deviceStatus.get(0).getStatus()).equals("DELETED"))) {
|
|| String.valueOf(deviceStatus.get(0).getStatus()).equals("DELETED"))) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user