-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refonte des segments - ajout du critère de maillage et implémentation…
… selon méthodologie EFCA (#3920) ## Linked issues - [x] Resolve #3912 - [x] Resolve #3913 - [x] Resolve #3918 - [x] Resolve #3919 - [x] Resolve #3980 - [ ] Ajouter le maillage dans le formulaire de PNO manuel - [x] Ajouter le type `scip_species_type` dans la table `species` (migration/pipeline) - [ ] Cas limite : espèce à 0 kg pour les cas où on sait qu'un navire cible une espèce mais l'espère n'est pas à bord au moment du contrôle - [x] back : https://github.com/MTES-MCT/monitorfish/pull/3920/files#diff-3a06becd8bf849c4d6f39e570c5846bd989138c508d6406cf0540bd5f099b878R72 - [ ] pipeline
- Loading branch information
Showing
117 changed files
with
17,503 additions
and
15,479 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/fleet_segment/ScipSpeciesType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.entities.fleet_segment | ||
|
||
enum class ScipSpeciesType { | ||
PELAGIC, | ||
DEMERSAL, | ||
TUNA, | ||
OTHER, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/domain/entities/species/Species.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.entities.species | ||
|
||
data class Species(val code: String, val name: String) | ||
import fr.gouv.cnsp.monitorfish.domain.entities.fleet_segment.ScipSpeciesType | ||
|
||
data class Species( | ||
val code: String, | ||
val name: String, | ||
val scipSpeciesType: ScipSpeciesType?, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 15 additions & 8 deletions
23
...kotlin/fr/gouv/cnsp/monitorfish/domain/use_cases/dtos/CreateOrUpdateFleetSegmentFields.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.use_cases.dtos | ||
|
||
import fr.gouv.cnsp.monitorfish.domain.entities.fleet_segment.ScipSpeciesType | ||
|
||
data class CreateOrUpdateFleetSegmentFields( | ||
var segment: String? = null, | ||
var segmentName: String? = null, | ||
var gears: List<String>? = null, | ||
var faoAreas: List<String>? = null, | ||
var targetSpecies: List<String>? = null, | ||
var bycatchSpecies: List<String>? = null, | ||
var impactRiskFactor: Double? = null, | ||
var year: Int? = null, | ||
val segment: String? = null, | ||
val segmentName: String? = null, | ||
val gears: List<String>? = null, | ||
val faoAreas: List<String>? = null, | ||
val targetSpecies: List<String>? = null, | ||
val mainScipSpeciesType: ScipSpeciesType? = null, | ||
val maxMesh: Double? = null, | ||
val minMesh: Double? = null, | ||
val minShareOfTargetSpecies: Double? = null, | ||
val priority: Double? = null, | ||
val vesselTypes: List<String>? = null, | ||
val impactRiskFactor: Double? = null, | ||
val year: Int? = null, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...r/gouv/cnsp/monitorfish/domain/use_cases/fleet_segment/ComputeFleetSegmentsFromControl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.use_cases.fleet_segment | ||
|
||
import fr.gouv.cnsp.monitorfish.config.UseCase | ||
import fr.gouv.cnsp.monitorfish.domain.entities.fleet_segment.FleetSegment | ||
import fr.gouv.cnsp.monitorfish.domain.entities.mission.mission_actions.GearControl | ||
import fr.gouv.cnsp.monitorfish.domain.entities.mission.mission_actions.SpeciesControl | ||
import fr.gouv.cnsp.monitorfish.domain.repositories.SpeciesRepository | ||
import org.slf4j.LoggerFactory | ||
|
||
@UseCase | ||
class ComputeFleetSegmentsFromControl( | ||
private val computeFleetSegments: ComputeFleetSegments, | ||
private val speciesRepository: SpeciesRepository, | ||
) { | ||
private val logger = LoggerFactory.getLogger(ComputeFleetSegmentsFromControl::class.java) | ||
|
||
fun execute( | ||
vesselId: Int, | ||
faoAreas: List<String>, | ||
gears: List<GearControl>, | ||
species: List<SpeciesControl>, | ||
): List<FleetSegment> { | ||
val allSpecies = speciesRepository.findAll() | ||
|
||
val speciesCatches = getSpeciesCatchesForSegmentCalculation(faoAreas, gears, species, allSpecies) | ||
|
||
return computeFleetSegments.execute(vesselId, speciesCatches) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...cnsp/monitorfish/domain/use_cases/fleet_segment/dtos/SpeciesCatchForSegmentCalculation.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package fr.gouv.cnsp.monitorfish.domain.use_cases.fleet_segment.dtos | ||
|
||
import fr.gouv.cnsp.monitorfish.domain.entities.fleet_segment.ScipSpeciesType | ||
|
||
data class SpeciesCatchForSegmentCalculation( | ||
val mesh: Double?, | ||
val weight: Double, | ||
val gear: String?, | ||
val species: String?, | ||
val faoArea: String, | ||
val scipSpeciesType: ScipSpeciesType?, | ||
) |
Oops, something went wrong.