|
|
@@ -8,7 +8,6 @@ import se.citerus.dddsample.service.RoutingService;
|
|
8
|
8
|
import se.citerus.dddsample.service.dto.ItineraryCandidateDTO;
|
|
9
|
9
|
import se.citerus.dddsample.service.dto.LegDTO;
|
|
10
|
10
|
import se.citerus.dddsample.web.command.RegistrationCommand;
|
|
11
|
|
-import se.citerus.dddsample.web.command.RoutingCommand;
|
|
12
|
11
|
|
|
13
|
12
|
import javax.servlet.http.HttpServletRequest;
|
|
14
|
13
|
import javax.servlet.http.HttpServletResponse;
|
|
|
@@ -65,25 +64,8 @@ public final class CargoAdminController extends MultiActionController {
|
|
65
|
64
|
final Map<String, Object> map = new HashMap<String, Object>();
|
|
66
|
65
|
final TrackingId trackingId = new TrackingId(request.getParameter("trackingId"));
|
|
67
|
66
|
final List<ItineraryCandidateDTO> itineraries = routingService.calculatePossibleRoutes(trackingId, null);
|
|
68
|
|
- final List<RoutingCommand.ItineraryCandidateCommand> itineraryCandidates =
|
|
69
|
|
- new ArrayList<RoutingCommand.ItineraryCandidateCommand>();
|
|
70
|
|
-
|
|
71
|
|
- // TODO: eliminate the routing command altogether, use the DTOs in the view
|
|
72
|
|
- for (ItineraryCandidateDTO itinerary : itineraries) {
|
|
73
|
|
- final RoutingCommand.ItineraryCandidateCommand itineraryCandidateCommand =
|
|
74
|
|
- new RoutingCommand.ItineraryCandidateCommand();
|
|
75
|
|
- itineraryCandidateCommand.setTrackingId(trackingId.idString());
|
|
76
|
|
- itineraryCandidates.add(itineraryCandidateCommand);
|
|
77
|
|
- for (LegDTO leg : itinerary.getLegs()) {
|
|
78
|
|
- final RoutingCommand.LegCommand legCommand = new RoutingCommand.LegCommand();
|
|
79
|
|
- legCommand.setCarrierMovementId(leg.getCarrierMovementId());
|
|
80
|
|
- legCommand.setFromUnlocode(leg.getFrom());
|
|
81
|
|
- legCommand.setToUnlocode(leg.getTo());
|
|
82
|
|
- itineraryCandidateCommand.getLegs().add(legCommand);
|
|
83
|
|
- }
|
|
84
|
|
- }
|
|
85
|
67
|
|
|
86
|
|
- map.put("itineraryCandidates", itineraryCandidates);
|
|
|
68
|
+ map.put("itineraryCandidates", itineraries);
|
|
87
|
69
|
map.put("trackingId", trackingId.idString());
|
|
88
|
70
|
return map;
|
|
89
|
71
|
}
|