From bdfaef3365db9a9f471fb29c87f538c0f55e2a8f Mon Sep 17 00:00:00 2001 From: Jan Date: Sun, 18 Jan 2026 18:11:22 +0100 Subject: [PATCH 01/67] Fixed isWeightExceeded value in database. Fixed shipping freqency rounding in database --- .../execution/CalculationExecutionService.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/avatic/lcc/service/calculation/execution/CalculationExecutionService.java b/src/main/java/de/avatic/lcc/service/calculation/execution/CalculationExecutionService.java index db12325..46bbc2b 100644 --- a/src/main/java/de/avatic/lcc/service/calculation/execution/CalculationExecutionService.java +++ b/src/main/java/de/avatic/lcc/service/calculation/execution/CalculationExecutionService.java @@ -142,12 +142,14 @@ public class CalculationExecutionService { CalculationJobDestination destinationCalculationJob = new CalculationJobDestination(); boolean hasMainRun = true; BigDecimal leadTime = null; + boolean isWeightExceeded = false; if (destination.getD2d()) { selectedContainerCalculation = containerCalculationService.doCalculation(setId, premiseToHuService.createHuFromPremise(premise), ContainerType.FEU, premise.getHuMixable(), premise.getHuStackable()); sections = List.of(new SectionInfo(null, routeSectionCostCalculationService.doD2dCalculation(setId, periodId, premise, destination, selectedContainerCalculation), selectedContainerCalculation)); leadTime = BigDecimal.valueOf(destination.getLeadTimeD2d()); usedContainerType = ContainerType.FEU; + isWeightExceeded = sections.getFirst().result().isWeightPrice(); } else { var bestContainerTypeResult = getSectionsFromBestContainerType(setId, periodId, destination, premise); sections = bestContainerTypeResult.sections; @@ -162,6 +164,17 @@ public class CalculationExecutionService { s.result().setPreRun(false); s.result().setPostRun(false); }); + + var containerSections = sections.stream().filter(s -> s.section().getRateType() != RateType.MATRIX).toList(); + + if(containerSections.size() > 1) { + isWeightExceeded = containerSections.stream().anyMatch(s -> s.result().isWeightPrice()); + } else { + isWeightExceeded = sections.getFirst().result().isWeightPrice(); + } + + } else { + isWeightExceeded = sections.stream().map(SectionInfo::result).filter(CalculationJobRouteSection::getMainRun).anyMatch(CalculationJobRouteSection::isWeightPrice); } selectedContainerCalculation = bestContainerTypeResult.selectedContainerCalculation; @@ -207,7 +220,7 @@ public class CalculationExecutionService { destinationCalculationJob.setAnnualCustomCost(customCost.getAnnualCost()); destinationCalculationJob.setAnnualTransportationCost(sections.stream().map(SectionInfo::result).map(CalculationJobRouteSection::getAnnualCost).reduce(BigDecimal.ZERO, BigDecimal::add)); - destinationCalculationJob.setTransportWeightExceeded(sections.stream().map(SectionInfo::result).filter(CalculationJobRouteSection::getMainRun).anyMatch(CalculationJobRouteSection::isWeightPrice)); + destinationCalculationJob.setTransportWeightExceeded(isWeightExceeded); destinationCalculationJob.setLayerCount(sections.getFirst().containerResult().getLayer()); destinationCalculationJob.setLayerStructure(null); //TODO generate layer structure destinationCalculationJob.setHuCount(sections.getFirst().containerResult().getHuUnitCount()); @@ -216,7 +229,7 @@ public class CalculationExecutionService { double huAnnualAmount = BigDecimal.valueOf(destination.getAnnualAmount()).divide(BigDecimal.valueOf(premise.getHuUnitCount()),4, RoundingMode.UP ).doubleValue(); - destinationCalculationJob.setShippingFrequency(Double.valueOf(shippingFrequencyCalculationService.doCalculation(setId, huAnnualAmount, selectedContainerCalculation.getHuPerContainer(),!premise.getHuMixable())).intValue()); + destinationCalculationJob.setShippingFrequency((int) Math.round(shippingFrequencyCalculationService.doCalculation(setId, huAnnualAmount, selectedContainerCalculation.getHuPerContainer(), !premise.getHuMixable()))); var commonCost = destinationCalculationJob.getAnnualHandlingCost() .add(destinationCalculationJob.getAnnualDisposalCost()) -- 2.45.3 From b5f2df8be755d4d739df37e4661ea52bf538b215 Mon Sep 17 00:00:00 2001 From: Jan Date: Sun, 18 Jan 2026 18:15:45 +0100 Subject: [PATCH 02/67] Rename `helppages-change` event to `pages-change` in Pagination component. --- src/frontend/src/components/UI/Pagination.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/components/UI/Pagination.vue b/src/frontend/src/components/UI/Pagination.vue index e123b5e..7a9e691 100644 --- a/src/frontend/src/components/UI/Pagination.vue +++ b/src/frontend/src/components/UI/Pagination.vue @@ -90,7 +90,7 @@ export default { default: 5 } }, - emits: ['helppages-change'], + emits: ['pages-change'], computed: { visiblePages() { const delta = Math.floor(this.maxVisiblePages / 2); @@ -130,7 +130,7 @@ export default { methods: { goToPage(pageNumber) { if (pageNumber >= 1 && pageNumber <= this.pageCount && pageNumber !== this.page) { - this.$emit('helppages-change', pageNumber); + this.$emit('pages-change', pageNumber); } } } -- 2.45.3 From 11d32a665e2283da7bcb709861e1fd4ad79a2f97 Mon Sep 17 00:00:00 2001 From: Jan Date: Sun, 18 Jan 2026 18:37:07 +0100 Subject: [PATCH 03/67] Rename `pages-change` event to `page-change` in Pagination component and update related references. --- src/frontend/src/components/UI/Pagination.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/frontend/src/components/UI/Pagination.vue b/src/frontend/src/components/UI/Pagination.vue index 7a9e691..f915baa 100644 --- a/src/frontend/src/components/UI/Pagination.vue +++ b/src/frontend/src/components/UI/Pagination.vue @@ -10,7 +10,7 @@ Previous - +