Changeset 60e9cc1 for src/main/java


Ignore:
Timestamp:
03/06/23 19:01:32 (21 months ago)
Author:
andrejtodorovski <82031894+andrejtodorovski@…>
Branches:
main
Children:
c79897f
Parents:
bba352b
Message:

Sredeni zabeleshki po diskusija

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/autopartz/controller/HomeController.java

    rbba352b r60e9cc1  
    2020import java.io.IOException;
    2121import java.util.ArrayList;
     22import java.util.Comparator;
    2223import java.util.List;
    2324import java.util.Objects;
     25import java.util.stream.Collectors;
    2426
    2527@Controller
     
    220222        Deliveryman dm = (Deliveryman) userService.findByUsername(request.getRemoteUser());
    221223        List<Delivery> deliveries = deliveryService.findAllByDeliverer(dm);
     224        deliveries = deliveries.stream().sorted((p1,p2)->p2.getOrder().getDate().compareTo(p1.getOrder().getDate())).collect(Collectors.toList());
    222225        model.addAttribute("bodyContent","myDeliveries");
    223226        model.addAttribute("deliveries",deliveries);
Note: See TracChangeset for help on using the changeset viewer.