Ignore:
Timestamp:
01/06/23 21:08:03 (23 months ago)
Author:
andrejtodorovski <82031894+andrejtodorovski@…>
Branches:
main
Children:
89865ae
Parents:
9dcbf44
Message:

Added all advanced reports, added bootstrap for every template

File:
1 edited

Legend:

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

    r9dcbf44 rcab5859  
    3737    private final DeliveryService deliveryService;
    3838    private final PartIsInStockInWarehouseRepository partIsInStockInWarehouseRepository;
     39    private final CarCategoryReportRepository carCategoryReportRepository;
     40    private final PartManufacturersReportRepository partManufacturersReportRepository;
     41    private final MostPurchasedPartRepository mostPurchasedPartRepository;
    3942    public HomeController(LoginService loginService, PartService partService, PartsForCarTypeAndCategoryRepository partsForCarTypeAndCategoryRepository, CarService carService, CategoryService categoryService, RepairShopReviewSummaryRepository repairShopReviewSummaryRepository, WarehouseRepository warehouseRepository,
    40                           OrderContainsPartRepository orderContainsPartRepository, OrderService orderService, UserService userService, DeliveriesInProgressRepository deliveriesInProgressRepository, DeliveryService deliveryService, PartIsInStockInWarehouseRepository partIsInStockInWarehouseRepository) {
     43                          OrderContainsPartRepository orderContainsPartRepository, OrderService orderService, UserService userService, DeliveriesInProgressRepository deliveriesInProgressRepository, DeliveryService deliveryService, PartIsInStockInWarehouseRepository partIsInStockInWarehouseRepository, CarCategoryReportRepository carCategoryReportRepository, PartManufacturersReportRepository partManufacturersReportRepository, MostPurchasedPartRepository mostPurchasedPartRepository) {
    4144        this.loginService = loginService;
    4245        this.partService = partService;
     
    5255        this.deliveryService = deliveryService;
    5356        this.partIsInStockInWarehouseRepository = partIsInStockInWarehouseRepository;
     57        this.carCategoryReportRepository = carCategoryReportRepository;
     58        this.partManufacturersReportRepository = partManufacturersReportRepository;
     59        this.mostPurchasedPartRepository = mostPurchasedPartRepository;
    5460    }
    5561
     
    231237        return "master-template";
    232238    }
     239    @GetMapping("/carCategoryReport")
     240    public String getCarCategoryInfo(Model model){
     241        model.addAttribute("data",carCategoryReportRepository.findAll());
     242        model.addAttribute("bodyContent","carCategoryReport");
     243        return "master-template";
     244    }
     245    @GetMapping("/partManufacturersReport")
     246    public String getPartManufacturersReport(Model model){
     247        model.addAttribute("data",partManufacturersReportRepository.findAll());
     248        model.addAttribute("bodyContent","partManufacturersReport");
     249        return "master-template";
     250
     251    }
     252    @GetMapping("/mostPurchasedPart")
     253    public String getMostPurchasedPart(Model model){
     254        model.addAttribute("data",mostPurchasedPartRepository.findAll());
     255        model.addAttribute("bodyContent","mostPurchasedPart");
     256        return "master-template";
     257    }
    233258}
Note: See TracChangeset for help on using the changeset viewer.