Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe
Commits:
-
8b41a191
by Tony Chemit at 2023-01-03T14:29:58+01:00
2 changed files:
- core/api/dto/src/main/java/fr/ird/observe/dto/data/ps/observation/SetCatchDto.java
- core/persistence/java/src/main/java/fr/ird/observe/entities/data/ps/observation/SetCatchSpi.java
Changes:
| ... | ... | @@ -53,7 +53,7 @@ public class SetCatchDto extends GeneratedSetCatchDto { |
| 53 | 53 | * @return set of unsafe species used in catches
|
| 54 | 54 | */
|
| 55 | 55 | public Set<SpeciesReference> getUnsafeSpecies() {
|
| 56 | - return getCatches().stream().filter(CatchDto::isHasSample).map(CatchDto::getSpecies).collect(Collectors.toSet());
|
|
| 56 | + return getCatches().stream().filter(c -> c.isHasSample() || c.isHasRelease()).map(CatchDto::getSpecies).collect(Collectors.toSet());
|
|
| 57 | 57 | }
|
| 58 | 58 | |
| 59 | 59 | /**
|
| ... | ... | @@ -48,7 +48,7 @@ public class SetCatchSpi extends GeneratedSetCatchSpi { |
| 48 | 48 | childDto.setHasSample(hasSample);
|
| 49 | 49 | });
|
| 50 | 50 | }
|
| 51 | - // on cherche si il y a des libérations d'espèce sensibles
|
|
| 51 | + // is there some non target catch release?
|
|
| 52 | 52 | if (entity.isNonTargetCatchReleaseNotEmpty()) {
|
| 53 | 53 | // get usable species ids
|
| 54 | 54 | java.util.Set<String> speciesId = ToolkitId.ids(entity.getNonTargetCatchRelease().stream().map(NonTargetCatchRelease::getSpecies));
|