From 16690341c09aff4332fe663a098e548127446fc4 Mon Sep 17 00:00:00 2001 From: Dmytro <113462277+KizerovDmitriy@users.noreply.github.com> Date: Tue, 17 Dec 2024 14:50:29 +0200 Subject: [PATCH] sorted bags by capacity and rename columns titles (#1563) --- .../service/ubs/OrdersAdminsPageServiceImpl.java | 14 +++++++------- .../service/ubs/UBSClientServiceImpl.java | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/service/src/main/java/greencity/service/ubs/OrdersAdminsPageServiceImpl.java b/service/src/main/java/greencity/service/ubs/OrdersAdminsPageServiceImpl.java index f56fcdb67..4fce8da5b 100644 --- a/service/src/main/java/greencity/service/ubs/OrdersAdminsPageServiceImpl.java +++ b/service/src/main/java/greencity/service/ubs/OrdersAdminsPageServiceImpl.java @@ -162,7 +162,7 @@ public TableParamsDto getParametersForOrdersTable(String uuid) { new ColumnDTO(new TitleDto("select", "Вибір", "Select"), "", 20, true, true, false, 0, EditType.CHECKBOX, new ArrayList<>(), ""), - new ColumnDTO(new TitleDto("id", "Номер замовлення", "Order number"), "id", 20, true, false, false, + new ColumnDTO(new TitleDto("id", "№ замовлення", "Order №"), "id", 20, true, false, false, 1, EditType.READ_ONLY, new ArrayList<>(), ordersInfo), new ColumnDTO(new TitleDto(ORDER_STATUS, "Статус замовлення", "Order status"), ORDER_STATUS, 20, @@ -204,8 +204,8 @@ public TableParamsDto getParametersForOrdersTable(String uuid) { false, 15, EditType.READ_ONLY, new ArrayList<>(), exportAddress), new ColumnDTO( - new TitleDto(ADDRESS_COMMENT, "Коментар до адреси від клієнта", - "Comment to address from the client"), + new TitleDto(ADDRESS_COMMENT, "Коментар до адреси", + "Comment to address"), ADDRESS_COMMENT, 20, false, true, false, 16, EditType.INLINE, new ArrayList<>(), exportAddress), new ColumnDTO(new TitleDto("mixedWaste120L", "Мікс 120л", "Mix 120l"), "mixedWaste120L", @@ -225,7 +225,7 @@ public TableParamsDto getParametersForOrdersTable(String uuid) { EditType.READ_ONLY, new ArrayList<>(), orderDetails), new ColumnDTO(new TitleDto("totalOrderSum", "Сума замовлення", "Total order sum"), "totalOrderSum", 20, false, true, false, 18, EditType.READ_ONLY, new ArrayList<>(), orderDetails), - new ColumnDTO(new TitleDto("orderCertificateCode", "Номер сертифікату", "Order certificate code"), + new ColumnDTO(new TitleDto("orderCertificateCode", "№ сертифікату", "Order certificate code"), "orderCertificateCode", 20, false, true, false, 19, EditType.READ_ONLY, new ArrayList<>(), orderDetails), new ColumnDTO(new TitleDto("generalDiscount", "Загальна знижка", "General discount"), @@ -233,8 +233,8 @@ public TableParamsDto getParametersForOrdersTable(String uuid) { new ColumnDTO(new TitleDto("amountDue", "Сума до оплати", "Amount due"), "amountDue", 20, false, true, false, 21, EditType.READ_ONLY, new ArrayList<>(), orderDetails), new ColumnDTO( - new TitleDto(CLIENT_COMMENT, "Коментар до замовлення від клієнта", - "Comment to the order from the client"), + new TitleDto(CLIENT_COMMENT, "Коментар до замовлення", + "Comment to the order"), CLIENT_COMMENT, 20, false, true, false, 22, EditType.INLINE, new ArrayList<>(), ordersInfo), new ColumnDTO(new TitleDto("totalPayment", "Оплата", "Total payment"), @@ -245,7 +245,7 @@ public TableParamsDto getParametersForOrdersTable(String uuid) { false, true, true, 24, EditType.DATE, new ArrayList<>(), exportDetails), new ColumnDTO(new TitleDto(TIME_OF_EXPORT, "Час вивезення", "Time of export"), TIME_OF_EXPORT, 20, false, true, false, 25, EditType.TIME, new ArrayList<>(), exportDetails), - new ColumnDTO(new TitleDto("idOrderFromShop", "Номер замовлення з магазину", "Id order from shop"), + new ColumnDTO(new TitleDto("idOrderFromShop", "№ замовлення з магазину", "Id order from shop"), "idOrderFromShop", 20, false, true, false, 26, EditType.READ_ONLY, new ArrayList<>(), orderDetails), new ColumnDTO(new TitleDto(RECEIVING, "Станція приймання", "Receiving station"), diff --git a/service/src/main/java/greencity/service/ubs/UBSClientServiceImpl.java b/service/src/main/java/greencity/service/ubs/UBSClientServiceImpl.java index 42581426f..78d9201c8 100644 --- a/service/src/main/java/greencity/service/ubs/UBSClientServiceImpl.java +++ b/service/src/main/java/greencity/service/ubs/UBSClientServiceImpl.java @@ -457,7 +457,8 @@ private UserPointsAndAllBagsDto getUserPointsAndAllBagsDtoByTariffIdAndUserPoint Integer userPoints) { var bagTranslationDtoList = bagRepository.findAllActiveBagsByTariffsInfoId(tariffId).stream() .map(bag -> modelMapper.map(bag, BagTranslationDto.class)) - .collect(toList()); + .sorted(Comparator.comparing(BagTranslationDto::getCapacity).reversed()) + .toList(); return new UserPointsAndAllBagsDto(bagTranslationDtoList, userPoints); }