Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe Commits: aca4d4c4 by tchemit at 2019-06-27T09:11:51Z [PS] Suppression de 2 champs - Closes #1337 - - - - - 13 changed files: - client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/observation/SetSeineUI.jaxx - dto/src/main/models/Observe-20-data-ps-observation.model - persistence/src/main/java/fr/ird/observe/binder/data/ps/observation/SetSeineEntityDtoBinder.java - persistence/src/main/models/Observe-20-data-ps-observation.model - persistence/src/main/resources/db/migration/7.3/02_ps_modify_data_tables-H2.sql - persistence/src/main/resources/db/migration/7.3/02_ps_modify_data_tables-PG.sql - services-local/src/main/java/fr/ird/observe/services/local/service/data/ps/observation/NonTargetCatchServiceLocal.java - services-local/src/main/java/fr/ird/observe/services/local/service/data/ps/observation/TargetCatchServiceLocal.java - test/src/main/resources/db/7.3/dataForTestLongline.sql.gz - test/src/main/resources/db/7.3/dataForTestSeine.sql.gz - test/src/main/resources/db/7.3/empty_h2.sql.gz - test/src/main/resources/db/7.3/empty_pg.sql.gz - test/src/main/resources/db/7.3/referentiel.sql.gz Changes: ===================================== client-core/src/main/java/fr/ird/observe/client/ui/content/data/ps/observation/SetSeineUI.jaxx ===================================== @@ -33,8 +33,6 @@ fr.ird.observe.client.ui.actions.content.data.ps.delete.DeleteSetSeineUIAction fr.ird.observe.client.ui.actions.content.data.ps.save.SaveSetSeineUIAction - fr.ird.observe.client.ui.util.BooleanEditor - org.nuiton.jaxx.widgets.number.NumberEditor org.nuiton.jaxx.widgets.select.BeanFilterableComboBox org.nuiton.jaxx.widgets.datetime.DateTimeEditor @@ -94,22 +92,6 @@ <NormalTextEditor id='supportVesselName'/> </cell> </row> - <row> - <cell anchor="west"> - <JLabel id='targetDiscardedLabel'/> - </cell> - <cell anchor='east' fill="both"> - <BooleanEditor id='targetDiscarded'/> - </cell> - </row> - <row> - <cell anchor="west"> - <JLabel id='nonTargetDiscardedLabel'/> - </cell> - <cell anchor='east' fill="both"> - <BooleanEditor id='nonTargetDiscarded'/> - </cell> - </row> <row> <cell anchor='west'> <JLabel id='schoolTypeLabel' styleClass="information"/> ===================================== dto/src/main/models/Observe-20-data-ps-observation.model ===================================== @@ -144,8 +144,6 @@ schoolTopDepth + {*:1} Integer schoolMeanDepth + {*:1} Integer schoolThickness + {*:1} Integer supportVesselName + {*:1} String -targetDiscarded + {*:1} Boolean -nonTargetDiscarded + {*:1} Boolean currentMeasureDepth + {*:1} Integer schoolType + {*:1} fr.ird.observe.dto.referential.ps.common.SchoolTypeReference targetCatchCompositionEstimatedByObserver + {*:1} boolean ===================================== persistence/src/main/java/fr/ird/observe/binder/data/ps/observation/SetSeineEntityDtoBinder.java ===================================== @@ -52,8 +52,6 @@ public class SetSeineEntityDtoBinder extends DataEntityDtoBinderSupport<SetSeine entity.setSchoolMeanDepth(dto.getSchoolMeanDepth()); entity.setSchoolThickness(dto.getSchoolThickness()); entity.setSupportVesselName(dto.getSupportVesselName()); - entity.setTargetDiscarded(dto.getTargetDiscarded()); - entity.setNonTargetDiscarded(dto.getNonTargetDiscarded()); entity.setCurrentMeasureDepth(dto.getCurrentMeasureDepth()); entity.setLastUpdateDate(dto.getLastUpdateDate()); entity.setTargetCatchCompositionEstimatedByObserver(dto.isTargetCatchCompositionEstimatedByObserver()); @@ -76,8 +74,6 @@ public class SetSeineEntityDtoBinder extends DataEntityDtoBinderSupport<SetSeine dto.setSchoolMeanDepth(entity.getSchoolMeanDepth()); dto.setSchoolThickness(entity.getSchoolThickness()); dto.setSupportVesselName(entity.getSupportVesselName()); - dto.setTargetDiscarded(entity.getTargetDiscarded()); - dto.setNonTargetDiscarded(entity.getNonTargetDiscarded()); dto.setCurrentMeasureDepth(entity.getCurrentMeasureDepth()); dto.setTargetCatchCompositionEstimatedByObserver(entity.isTargetCatchCompositionEstimatedByObserver()); dto.setTargetDiscardCatchCompositionEstimatedByObserver(entity.isTargetDiscardCatchCompositionEstimatedByObserver()); ===================================== persistence/src/main/models/Observe-20-data-ps-observation.model ===================================== @@ -151,8 +151,6 @@ schoolTopDepth + {*:1} Integer schoolMeanDepth + {*:1} Integer schoolThickness + {*:1} Integer supportVesselName + {*:1} String -targetDiscarded + {*:1} Boolean -nonTargetDiscarded + {*:1} Boolean currentMeasureDepth + {*:1} Integer schoolType + {*:1} referential.ps.common.SchoolType targetCatchCompositionEstimatedByObserver + {*:1} boolean ===================================== persistence/src/main/resources/db/migration/7.3/02_ps_modify_data_tables-H2.sql ===================================== @@ -40,3 +40,6 @@ ALTER TABLE ps_observation.TransmittingBuoy ADD CONSTRAINT fk_ps_observation_Tra CREATE INDEX idx_ps_observation_ObservedSystem_schoolType ON ps_observation.ObservedSystem(schoolType); CREATE INDEX idx_ps_observation_Set_schoolType ON ps_observation.Set(schoolType); CREATE INDEX idx_ps_observation_TransmittingBuoy_TransmittingBuoyOwnership ON ps_observation.TransmittingBuoy(TransmittingBuoyOwnership); + +ALTER TABLE ps_observation.Set DROP COLUMN targetDiscarded; +ALTER TABLE ps_observation.Set DROP COLUMN nonTargetDiscarded; \ No newline at end of file ===================================== persistence/src/main/resources/db/migration/7.3/02_ps_modify_data_tables-PG.sql ===================================== @@ -40,3 +40,6 @@ ALTER TABLE ps_observation.TransmittingBuoy ADD CONSTRAINT fk_ps_observation_Tra CREATE INDEX idx_ps_observation_ObservedSystem_schoolType ON ps_observation.ObservedSystem(schoolType); CREATE INDEX idx_ps_observation_Set_schoolType ON ps_observation.Set(schoolType); CREATE INDEX idx_ps_observation_TransmittingBuoy_TransmittingBuoyOwnership ON ps_observation.TransmittingBuoy(TransmittingBuoyOwnership); + +ALTER TABLE ps_observation.Set DROP COLUMN targetDiscarded; +ALTER TABLE ps_observation.Set DROP COLUMN nonTargetDiscarded; ===================================== services-local/src/main/java/fr/ird/observe/services/local/service/data/ps/observation/NonTargetCatchServiceLocal.java ===================================== @@ -90,18 +90,6 @@ public class NonTargetCatchServiceLocal extends ObserveServiceLocal implements N checkLastUpdateDate(entity, dto); SET_SEINE_NON_TARGET_SPI.copyDtoToEntity(dto, entity, getReferentialLocale()); - // mise a jour de la propriete nonTargetDiscarded sur la calée - - boolean nonTargetDiscarded = entity.getNonTargetCatch().stream() - .anyMatch(nonTargetCatch -> nonTargetCatch.getReasonForDiscard() != null); -// for (NonTargetCatch nonTargetCatch : entity.getNonTargetCatch()) { -// if (nonTargetCatch.getReasonForDiscard() != null) { -// // on a trouve un rejet de faune -// nonTargetDiscarded = true; -// break; -// } -// } - entity.setNonTargetDiscarded(nonTargetDiscarded); // on supprime les échantillons dont les espèces ne sont plus dans les captures if (entity.isNonTargetSampleNotEmpty()) { NonTargetSample nonTargetSample = entity.getNonTargetSample().iterator().next(); ===================================== services-local/src/main/java/fr/ird/observe/services/local/service/data/ps/observation/TargetCatchServiceLocal.java ===================================== @@ -109,17 +109,6 @@ public class TargetCatchServiceLocal extends ObserveServiceLocal implements Targ for (TargetCatch targetCatch : entity.getTargetCatch()) { targetCatch.setSetSeine(entity); } - // Calcul du champs SetSeine.targetDiscarded - boolean targetDiscarded; - if (discarded) { - // on est sur des captures il suffit que les données entrantes contiennent une capture - targetDiscarded = dto.sizeTargetCatch() > 0; - } else { - // on est sur des rejets il suffit que les autres données contiennent une capture - targetDiscarded = otherTargetCatches.size() > 0; - } - log.info("SetSeine " + entity.getTopiaId() + ", targetDiscarded: " + targetDiscarded); - entity.setTargetDiscarded(targetDiscarded); return saveEntity(entity); } ===================================== test/src/main/resources/db/7.3/dataForTestLongline.sql.gz ===================================== Binary files a/test/src/main/resources/db/7.3/dataForTestLongline.sql.gz and b/test/src/main/resources/db/7.3/dataForTestLongline.sql.gz differ ===================================== test/src/main/resources/db/7.3/dataForTestSeine.sql.gz ===================================== Binary files a/test/src/main/resources/db/7.3/dataForTestSeine.sql.gz and b/test/src/main/resources/db/7.3/dataForTestSeine.sql.gz differ ===================================== test/src/main/resources/db/7.3/empty_h2.sql.gz ===================================== Binary files a/test/src/main/resources/db/7.3/empty_h2.sql.gz and b/test/src/main/resources/db/7.3/empty_h2.sql.gz differ ===================================== test/src/main/resources/db/7.3/empty_pg.sql.gz ===================================== Binary files a/test/src/main/resources/db/7.3/empty_pg.sql.gz and b/test/src/main/resources/db/7.3/empty_pg.sql.gz differ ===================================== test/src/main/resources/db/7.3/referentiel.sql.gz ===================================== Binary files a/test/src/main/resources/db/7.3/referentiel.sql.gz and b/test/src/main/resources/db/7.3/referentiel.sql.gz differ View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/aca4d4c456c1429a92352aebd9db... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/aca4d4c456c1429a92352aebd9db... You're receiving this email because of your account on gitlab.com.
participants (1)
-
Tony CHEMIT