Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: ce3b613b by Tony Chemit at 2021-01-06T11:35:22+01:00 Valider tous les écrans du modèle LL - See #1665 Problème de restitution de la position sur la ligne LL-Observation-Catch/Tdr - - - - - 46bd55b1 by Tony Chemit at 2021-01-06T11:41:34+01:00 Peaufinage de la table ll_common.onboardprocessing 2 - Closes #1735 - - - - - 10 changed files: - models/persistence/src/main/java/fr/ird/observe/entities/data/ll/observation/SetImpl.java - models/persistence/src/main/resources/db/migration/8.0/60_ll_common_fill-common.sql - models/persistence/src/test/resources/fixtures/persistence/count-referential-longline.properties - models/persistence/src/test/resources/fixtures/persistence/entity-tables-count-referential.properties - tests/test/src/main/resources/db/8.0/dataForTestLongline.sql.gz - tests/test/src/main/resources/db/8.0/dataForTestSeine.sql.gz - tests/test/src/main/resources/db/8.0/empty_h2.sql.gz - tests/test/src/main/resources/db/8.0/empty_pg.sql.gz - tests/test/src/main/resources/db/8.0/referentiel.sql.gz - tests/test/src/main/resources/fixtures/global.properties Changes: ===================================== models/persistence/src/main/java/fr/ird/observe/entities/data/ll/observation/SetImpl.java ===================================== @@ -25,12 +25,15 @@ package fr.ird.observe.entities.data.ll.observation; import fr.ird.observe.dto.data.DataDto; import fr.ird.observe.dto.data.ll.observation.BasketReference; import fr.ird.observe.dto.data.ll.observation.BranchlineReference; +import fr.ird.observe.dto.data.ll.observation.LonglinePositionAware; import fr.ird.observe.dto.data.ll.observation.LonglinePositionContainerAware; import fr.ird.observe.dto.data.ll.observation.SectionReference; import fr.ird.observe.dto.referential.ReferentialLocale; +import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; +import java.util.Map; public class SetImpl extends SetAbstract { @@ -48,6 +51,8 @@ public class SetImpl extends SetAbstract { private void loadDtoReferenceParents(LonglinePositionContainerAware dto, ReferentialLocale referentialLocale) { List<SectionReference> sections = new LinkedList<>(); List<BasketReference> baskets = new LinkedList<>(); + Map<String, BasketReference> basketsParents = new LinkedHashMap<>(); + Map<String, BranchlineReference> branchlinesParents = new LinkedHashMap<>(); List<BranchlineReference> branchlines = new LinkedList<>(); getSection().forEach(section -> { section.setParentId(getTopiaId()); @@ -59,15 +64,31 @@ public class SetImpl extends SetAbstract { basket.setParentId(sectionId); BasketReference basketReference = basket.toReference(referentialLocale); baskets.add(basketReference); + basketsParents.put(basketId, basketReference); basket.getBranchline().forEach(branchline -> { branchline.setParentId(basketId); BranchlineReference branchlineReference = branchline.toReference(referentialLocale); branchlines.add(branchlineReference); + branchlinesParents.put(branchline.getTopiaId(), branchlineReference); }); }); }); dto.setSections(sections); dto.setBaskets(baskets); dto.setBranchlines(branchlines); + for (LonglinePositionAware datum : dto.getData()) { + BranchlineReference branchline = datum.getBranchline(); + if (branchline != null) { + BranchlineReference branchlineWithParentId = branchlinesParents.get(branchline.getId()); + datum.setBranchline(branchlineWithParentId); + } else { + BasketReference basket = datum.getBasket(); + if (basket != null) { + BasketReference basketWithParentId = basketsParents.get(basket.getId()); + datum.setBasket(basketWithParentId); + } + } + } + } } ===================================== models/persistence/src/main/resources/db/migration/8.0/60_ll_common_fill-common.sql ===================================== @@ -71,8 +71,7 @@ INSERT INTO ll_common.onboardprocessing(topiaid, topiaversion, topiacreatedate, INSERT INTO ll_common.onboardprocessing(topiaid, topiaversion, topiacreatedate, lastupdatedate, code, status, needcomment, uri, label1, label2, label3, label4, label5, label6, label7, label8, homeid) VALUES ('fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.22', 1, '2020-10-21 00:00:00', '2020-10-21 00:00:00', 'FILLET', 1, false, null, 'Filleted', 'Filet', 'Filleted #TODO', null, null, null, null, null, null); INSERT INTO ll_common.onboardprocessing(topiaid, topiaversion, topiacreatedate, lastupdatedate, code, status, needcomment, uri, label1, label2, label3, label4, label5, label6, label7, label8, homeid) VALUES ('fr.ird.referential.ll.common.OnBoardProcessing#1464000000000#0.23', 1, '2020-10-21 00:00:00', '2020-10-21 00:00:00', 'GIL', 1, false, null, 'Gilled', 'Sans branchies', 'Gilled #TODO', null, null, null, null, null, null); INSERT INTO ll_common.OnBoardProcessing(topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, label4, label5, label6, label7, label8) VALUES ('fr.ird.referential.ll.common.OnBoardProcessing#1609847952719#0.41927756421927587', 1, '2021-01-05 11:57:13.019', '2021-01-05 11:59:12.746', 'SALT', null, null, FALSE, 1, 'Salted', 'Salé', 'Salado', null, null, null, null, null); -INSERT INTO ll_common.OnBoardProcessing(topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, label4, label5, label6, label7, label8) VALUES ('fr.ird.referential.ll.common.OnBoardProcessing#1609848016239#0.8310203513100917', 1, '2021-01-05 11:59:25.268', '2021-01-05 12:00:16.241', 'LIVE', null, null, FALSE, 1, 'Kept alive', 'Gardé vivant', 'Mantenido vivo', null, null, null, null, null); -INSERT INTO ll_common.OnBoardProcessing(topiaid, topiaversion, topiacreatedate, lastupdatedate, code, uri, homeid, needcomment, status, label1, label2, label3, label4, label5, label6, label7, label8) VALUES ('fr.ird.referential.ll.common.OnBoardProcessing#1609848457257#0.12756593660166082', 1, '2021-01-05 12:00:19.234', '2021-01-05 12:07:37.259', 'DEAD', null, null, FALSE, 1, 'Kept dead', 'Conservé mort', 'Mantenido muerto', null, null, null, null, null); + INSERT INTO ll_common.linetype (topiaId, topiaVersion, topiaCreateDate, lastUpdateDate, status, needComment, code, label1, label2, label3) values ('fr.ird.referential.ll.common.LineType#1239832686157#0.9', 0, ${CURRENT_DATE}, ${CURRENT_TIMESTAMP}, 1, false, 'UNK', 'Unknown', 'Inconnu', 'Desconocido'); UPDATE ll_common.trip SET observationsAvailability = TRUE; ===================================== models/persistence/src/test/resources/fixtures/persistence/count-referential-longline.properties ===================================== @@ -47,6 +47,6 @@ ll_common.weightcategory=0 ll_landing.company=30 ll_landing.datasource=20 ll_common.triptype=2 -ll_common.onboardprocessing=16 +ll_common.onboardprocessing=14 ll_landing.conservation=3 ll_common.weightdeterminationmethod=0 ===================================== models/persistence/src/test/resources/fixtures/persistence/entity-tables-count-referential.properties ===================================== @@ -57,7 +57,7 @@ fr.ird.observe.entities.referential.ll.common.LightsticksType=2 fr.ird.observe.entities.referential.ll.common.LineType=9 fr.ird.observe.entities.referential.ll.common.MitigationType=15 fr.ird.observe.entities.referential.ll.common.ObservationMethod=2 -fr.ird.observe.entities.referential.ll.common.OnBoardProcessing=16 +fr.ird.observe.entities.referential.ll.common.OnBoardProcessing=14 fr.ird.observe.entities.referential.ll.common.SettingShape=6 fr.ird.observe.entities.referential.ll.common.TripType=2 fr.ird.observe.entities.referential.ll.common.VesselActivity=27 ===================================== tests/test/src/main/resources/db/8.0/dataForTestLongline.sql.gz ===================================== Binary files a/tests/test/src/main/resources/db/8.0/dataForTestLongline.sql.gz and b/tests/test/src/main/resources/db/8.0/dataForTestLongline.sql.gz differ ===================================== tests/test/src/main/resources/db/8.0/dataForTestSeine.sql.gz ===================================== Binary files a/tests/test/src/main/resources/db/8.0/dataForTestSeine.sql.gz and b/tests/test/src/main/resources/db/8.0/dataForTestSeine.sql.gz differ ===================================== tests/test/src/main/resources/db/8.0/empty_h2.sql.gz ===================================== Binary files a/tests/test/src/main/resources/db/8.0/empty_h2.sql.gz and b/tests/test/src/main/resources/db/8.0/empty_h2.sql.gz differ ===================================== tests/test/src/main/resources/db/8.0/empty_pg.sql.gz ===================================== Binary files a/tests/test/src/main/resources/db/8.0/empty_pg.sql.gz and b/tests/test/src/main/resources/db/8.0/empty_pg.sql.gz differ ===================================== tests/test/src/main/resources/db/8.0/referentiel.sql.gz ===================================== Binary files a/tests/test/src/main/resources/db/8.0/referentiel.sql.gz and b/tests/test/src/main/resources/db/8.0/referentiel.sql.gz differ ===================================== tests/test/src/main/resources/fixtures/global.properties ===================================== @@ -35,5 +35,5 @@ SPECIES_GROUP_ID=fr.ird.referential.common.SpeciesGroup#1239832683689#0.71201161 # for fr.ird.observe.spi.DbModelHelperTest REFERENCE_DATA_COUNT=53 # for fr.ird.observe.services.local.service.referential.differential.DifferentialModelTest -REFERENTIAL_COUNT=3034 +REFERENTIAL_COUNT=3032 ENTITIES_LIMIT_SIZE=100 View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/95738c1218839ce135799e340... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/-/compare/95738c1218839ce135799e340... You're receiving this email because of your account on gitlab.com.