r704 - in trunk/tutti-persistence/src: main/java/fr/ifremer/tutti/persistence/service main/xmi test/java/fr/ifremer/tutti/persistence/service
Author: tchemit Date: 2013-03-28 16:12:59 +0100 (Thu, 28 Mar 2013) New Revision: 704 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/704 Log: fixes #2225: [CAPTURE] Certains poids calcul?\195?\169s sont persist?\195?\169s Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CatchBatchPersistenceServiceImpl.java trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/CatchBatchPersistenceServiceWriteTest.java Modified: trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CatchBatchPersistenceServiceImpl.java =================================================================== --- trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CatchBatchPersistenceServiceImpl.java 2013-03-28 14:49:13 UTC (rev 703) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CatchBatchPersistenceServiceImpl.java 2013-03-28 15:12:59 UTC (rev 704) @@ -189,11 +189,10 @@ // Hors Vrac SortingBatch horsVracBatch = catchBatchDao.getSortingBatch(source.getChildBatchs(), "pmfmId", enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_HORS_VRAC_ID); - if (log.isInfoEnabled()) { - log.info("Loaded CatchBatch Hors Vrac: " + horsVracBatch.getId()); - } if (horsVracBatch != null) { - result.setCatchTotalUnsortedWeight(horsVracBatch.getWeight()); + if (log.isInfoEnabled()) { + log.info("Loaded CatchBatch Hors Vrac: " + horsVracBatch.getId()); + } { // Hors Vrac > Species SortingBatch speciesBatch = catchBatchDao.getSortingBatch(horsVracBatch.getChildBatchs(), @@ -203,7 +202,6 @@ if (log.isInfoEnabled()) { log.info("Loaded CatchBatch Hors Vrac> Species: " + speciesBatch.getId()); } - result.setSpeciesTotalUnsortedWeight(speciesBatch.getWeight()); } // Hors Vrac > Benthos @@ -215,7 +213,6 @@ if (log.isInfoEnabled()) { log.info("Loaded CatchBatch Hors Vrac> Benthos: " + benthosBatch.getId()); } - result.setBenthosTotalUnsortedWeight(benthosBatch.getWeight()); } // TODO : Plancton... @@ -395,7 +392,8 @@ } beanToEntityReferenceTaxonBatch(target, speciesBatch, inertBatch, recorderDepartmentId, enumeration.REFERENCE_TAXON_ID_INERT, - source.getSpeciesTotalInertWeight(), null); + source.getSpeciesTotalInertWeight(), + null); inertBatch.setRankOrder((short) 2); } @@ -431,7 +429,8 @@ } beanToEntityReferenceTaxonBatch(target, benthosBatch, aliveNotItemizedBatch, recorderDepartmentId, enumeration.REFERENCE_TAXON_ID_LIFE, - source.getBenthosTotalLivingNotItemizedWeight(), null); + source.getBenthosTotalLivingNotItemizedWeight(), + null); aliveNotItemizedBatch.setRankOrder((short) 1); // ----------------------------------------------------------------------------- @@ -445,7 +444,8 @@ } beanToEntityReferenceTaxonBatch(target, benthosBatch, inertBatch, recorderDepartmentId, enumeration.REFERENCE_TAXON_ID_INERT, - source.getBenthosTotalInertWeight(), null); + source.getBenthosTotalInertWeight(), + null); inertBatch.setRankOrder((short) 2); } @@ -464,7 +464,8 @@ } beanToEntitySortingBatch(target, target, batch, recorderDepartmentId, enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_HORS_VRAC_ID, - source.getCatchTotalUnsortedWeight(), null); + null, + null); batch.setRankOrder((short) 2); // Manage childs : @@ -486,7 +487,8 @@ } beanToEntitySortingBatch(target, batch, speciesBatch, recorderDepartmentId, enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES, - source.getSpeciesTotalUnsortedWeight(), null); + null, + null); speciesBatch.setRankOrder((short) 1); } @@ -501,7 +503,8 @@ } beanToEntitySortingBatch(target, batch, benthosBatch, recorderDepartmentId, enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS, - source.getBenthosTotalUnsortedWeight(), null); + null, + null); benthosBatch.setRankOrder((short) 2); } @@ -521,7 +524,8 @@ } beanToEntitySortingBatch(target, target, unsortedBatch, recorderDepartmentId, enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_UNSORTED_ID, - source.getCatchTotalRejectedWeight(), null); + source.getCatchTotalRejectedWeight(), + null); unsortedBatch.setRankOrder((short) 3); } Modified: trunk/tutti-persistence/src/main/xmi/tutti-persistence.zargo =================================================================== (Binary files differ) Modified: trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/CatchBatchPersistenceServiceWriteTest.java =================================================================== --- trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/CatchBatchPersistenceServiceWriteTest.java 2013-03-28 14:49:13 UTC (rev 703) +++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/CatchBatchPersistenceServiceWriteTest.java 2013-03-28 15:12:59 UTC (rev 704) @@ -227,19 +227,7 @@ catchBatch.setBenthosTotalInertWeight(0.2f); } } - // Hors Vrac : 10kg - { - catchBatch.setCatchTotalUnsortedWeight(10f); - // Species - { - catchBatch.setSpeciesTotalUnsortedWeight(10f); - } - // Benthos - { - catchBatch.setBenthosTotalUnsortedWeight(20f); - } - } // Rejet : 15kg catchBatch.setCatchTotalRejectedWeight(15f); @@ -251,11 +239,8 @@ // ----------------------------------------------------------------------------- catchBatch.setCatchTotalSortedTremisWeight(null); catchBatch.setCatchTotalSortedCarousselWeight(null); - catchBatch.setCatchTotalUnsortedWeight(null); catchBatch.setSpeciesTotalSortedWeight(null); - catchBatch.setSpeciesTotalUnsortedWeight(null); catchBatch.setBenthosTotalSortedWeight(null); - catchBatch.setBenthosTotalUnsortedWeight(null); assertSaveAndReloadCatchBatch(catchBatch, fishingOperationNoCatchBatch.getId()); } @@ -305,15 +290,12 @@ assertEquals(expectedCatchBatch.getCatchTotalWeight(), actualCatchBatch.getCatchTotalWeight()); assertEquals(expectedCatchBatch.getCatchTotalSortedCarousselWeight(), actualCatchBatch.getCatchTotalSortedCarousselWeight()); assertEquals(expectedCatchBatch.getCatchTotalSortedTremisWeight(), actualCatchBatch.getCatchTotalSortedTremisWeight()); - assertEquals(expectedCatchBatch.getCatchTotalUnsortedWeight(), actualCatchBatch.getCatchTotalUnsortedWeight()); assertEquals(expectedCatchBatch.getSpeciesTotalSortedWeight(), actualCatchBatch.getSpeciesTotalSortedWeight()); - assertEquals(expectedCatchBatch.getSpeciesTotalUnsortedWeight(), actualCatchBatch.getSpeciesTotalUnsortedWeight()); assertEquals(expectedCatchBatch.getSpeciesTotalInertWeight(), actualCatchBatch.getSpeciesTotalInertWeight()); assertEquals(expectedCatchBatch.getSpeciesTotalLivingNotItemizedWeight(), actualCatchBatch.getSpeciesTotalLivingNotItemizedWeight()); assertEquals(expectedCatchBatch.getBenthosTotalSortedWeight(), actualCatchBatch.getBenthosTotalSortedWeight()); - assertEquals(expectedCatchBatch.getBenthosTotalUnsortedWeight(), actualCatchBatch.getBenthosTotalUnsortedWeight()); assertEquals(expectedCatchBatch.getBenthosTotalInertWeight(), actualCatchBatch.getBenthosTotalInertWeight()); assertEquals(expectedCatchBatch.getBenthosTotalLivingNotItemizedWeight(), actualCatchBatch.getBenthosTotalLivingNotItemizedWeight()); }
participants (1)
-
tchemit@users.forge.codelutin.com