|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
package org.gcube.portlets.user.accountingdashboard.server.accounting;
|
|
|
|
|
|
|
|
|
|
import java.time.Instant;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.GregorianCalendar;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
|
|
|
@ -125,23 +125,14 @@ public class AccountingService {
|
|
|
|
|
"Invalid format: [dateStart=" + dateStart + ", dateEnd=" + dateEnd + "]");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GregorianCalendar dateFrom;
|
|
|
|
|
GregorianCalendar dateTo;
|
|
|
|
|
Instant dateFrom;
|
|
|
|
|
Instant dateTo;
|
|
|
|
|
try {
|
|
|
|
|
int yearS = Integer.parseInt(dateStart.substring(0, 4));
|
|
|
|
|
logger.debug("yearS: " + yearS);
|
|
|
|
|
int monthS = Integer.parseInt(dateStart.substring(5, 7)) - 1;
|
|
|
|
|
logger.debug("monthS: " + monthS);
|
|
|
|
|
int dayS = Integer.parseInt(dateStart.substring(8, 10));
|
|
|
|
|
logger.debug("dayS: " + dayS);
|
|
|
|
|
|
|
|
|
|
dateFrom = new GregorianCalendar(yearS, monthS, dayS);
|
|
|
|
|
|
|
|
|
|
int yearE = Integer.parseInt(dateEnd.substring(0, 4));
|
|
|
|
|
int monthE = Integer.parseInt(dateEnd.substring(5, 7)) - 1;
|
|
|
|
|
int dayE = Integer.parseInt(dateEnd.substring(8, 10));
|
|
|
|
|
dateTo = new GregorianCalendar(yearE, monthE, dayE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dateFrom=Instant.parse(dateStart+"T00:00:00.00Z");
|
|
|
|
|
|
|
|
|
|
dateTo=Instant.parse(dateEnd+"T00:00:00.00Z");
|
|
|
|
|
|
|
|
|
|
} catch (Throwable e) {
|
|
|
|
|
logger.error("Invalid date format: [dateStart=" + dateStart + ", dateEnd=" + dateEnd + "]");
|
|
|
|
|
throw new ServiceException(
|
|
|
|
@ -150,9 +141,9 @@ public class AccountingService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
logger.debug("getReportByScope(): [ScopeDescriptor=" + scopeDescriptor + ", dateFrom="
|
|
|
|
|
+ dateFrom.getTime() + ", dateTo=" + dateTo.getTime() + ", measureResolution="
|
|
|
|
|
+ dateFrom + ", dateTo=" + dateTo + ", measureResolution="
|
|
|
|
|
+ MeasureResolution.MONTHLY + "]");
|
|
|
|
|
Report report = dao.getReportByScope(scopeDescriptor, dateFrom.getTime(), dateTo.getTime(),
|
|
|
|
|
Report report = dao.getReportByScope(scopeDescriptor, dateFrom, dateTo,
|
|
|
|
|
MeasureResolution.MONTHLY);
|
|
|
|
|
|
|
|
|
|
logger.debug("Report: " + report);
|
|
|
|
|