Sort timesheet entries descending by date in bound users service
FEA: ItEr77S14BoundUsersWebServices
This commit is contained in:
parent
ecb4fa8048
commit
e29e7c7d60
1 changed files with 4 additions and 1 deletions
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
package org.libreplan.ws.boundusers.impl;
|
package org.libreplan.ws.boundusers.impl;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
|
|
@ -87,6 +88,7 @@ public class BoundUserServiceREST implements IBoundUserService {
|
||||||
@GET
|
@GET
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
@Path("/timesheets/{task-code}/")
|
@Path("/timesheets/{task-code}/")
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public Response getTimesheetEntriesByTask(
|
public Response getTimesheetEntriesByTask(
|
||||||
@PathParam("task-code") String taskCode) {
|
@PathParam("task-code") String taskCode) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -96,7 +98,8 @@ public class BoundUserServiceREST implements IBoundUserService {
|
||||||
.getBoundResourceFromSession());
|
.getBoundResourceFromSession());
|
||||||
List<WorkReportLine> workReportLines = workReportLineDAO
|
List<WorkReportLine> workReportLines = workReportLineDAO
|
||||||
.findByOrderElementAndWorkReports(orderElement, workReports);
|
.findByOrderElementAndWorkReports(orderElement, workReports);
|
||||||
|
Collections.sort(workReportLines);
|
||||||
|
Collections.reverse(workReportLines);
|
||||||
PersonalTimesheetEntryListDTO dto = PersonalTimesheetEntryConverter
|
PersonalTimesheetEntryListDTO dto = PersonalTimesheetEntryConverter
|
||||||
.toDTO(workReportLines);
|
.toDTO(workReportLines);
|
||||||
return Response.ok(dto).build();
|
return Response.ok(dto).build();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue