ref 12119:AccountingDashboard - Create a new Accounting Dashboard
https://support.d4science.org/issues/12119 Fixed time limits in charts git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/accounting-dashboard@169941 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
7788474aed
commit
4a082c602c
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue