Skip to content
Snippets Groups Projects
Commit 9d9d336a authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Fixed forecast search for multiple orgs in previous seasons

parent acfdc131
No related branches found
No related tags found
2 merge requests!22Develop,!18Spotit nordic map layers
...@@ -395,15 +395,26 @@ public class LogicService { ...@@ -395,15 +395,26 @@ public class LogicService {
@Produces("application/json;charset=UTF-8") @Produces("application/json;charset=UTF-8")
public Response getActiveForecastConfigurationsWithIncludeOrganizations( public Response getActiveForecastConfigurationsWithIncludeOrganizations(
@PathParam("organizationId") Integer organizationId, @PathParam("organizationId") Integer organizationId,
@QueryParam("includeOrganizationIds") String includeOrganizationIds @QueryParam("includeOrganizationIds") String includeOrganizationIds,
@QueryParam("from") String fromStr,
@QueryParam("to") String toStr
) )
{ {
Calendar cal = Calendar.getInstance(); Date from, to;
cal.setTime(SystemTime.getSystemTime()); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
cal.set(cal.get(Calendar.YEAR), Calendar.JANUARY, 1, 0, 0, 0); try{
Date from = cal.getTime(); from = format.parse(fromStr);
cal.set(cal.get(Calendar.YEAR), Calendar.DECEMBER, 31, 23, 0, 0); to = format.parse(toStr);
Date to = cal.getTime(); }
catch(ParseException | NullPointerException ex)
{
Calendar cal = Calendar.getInstance();
cal.setTime(SystemTime.getSystemTime());
cal.set(cal.get(Calendar.YEAR), Calendar.JANUARY, 1, 0, 0, 0);
from = cal.getTime();
cal.set(cal.get(Calendar.YEAR), Calendar.DECEMBER, 31, 23, 0, 0);
to = cal.getTime();
}
List<Integer> orgIds = new ArrayList<>(); List<Integer> orgIds = new ArrayList<>();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment