Author: tchemit Date: 2013-03-28 15:09:31 +0100 (Thu, 28 Mar 2013) New Revision: 701 Url: http://forge.codelutin.com/projects/tutti/repository/revisions/701 Log: fixes #2137: [CAPTURE] - Esp?\195?\168ces - Le poids total vrac n'est pas sauvegard?\195?\169 la premi?\195?\168re fois. 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 13:45:30 UTC (rev 700) +++ trunk/tutti-persistence/src/main/java/fr/ifremer/tutti/persistence/service/CatchBatchPersistenceServiceImpl.java 2013-03-28 14:09:31 UTC (rev 701) @@ -126,8 +126,7 @@ log.info("Loaded CatchBatch Vrac > Species : " + speciesBatch.getId()); } - result.setSpeciesTotalSampleSortedWeight(speciesBatch.getWeight()); - result.setSpeciesTotalSortedWeight(speciesBatch.getWeightBeforeSampling()); + result.setSpeciesTotalSortedWeight(speciesBatch.getWeight()); { // Vrac > Species > Inert @@ -160,8 +159,7 @@ log.info("Loaded CatchBatch Vrac > Benthos: " + benthosBatch.getId()); } - result.setBenthosTotalSampleSortedWeight(benthosBatch.getWeight()); - result.setBenthosTotalSortedWeight(benthosBatch.getWeightBeforeSampling()); + result.setBenthosTotalSortedWeight(benthosBatch.getWeight()); { // Vrac > Benthos > Inert @@ -340,6 +338,7 @@ batch = SortingBatch.Factory.newInstance(); target.getChildBatchs().add(batch); } + //FIXME-TC what is the point catchTotalSortedCarousselWeight and catchTotalSortedTremisWeight ? beanToEntitySortingBatch(target, target, batch, recorderDepartmentId, enumeration.PMFM_ID_SORTED_UNSORTED, enumeration.QUALITATIVE_VRAC_ID, source.getCatchTotalSortedCarousselWeight(), source.getCatchTotalSortedTremisWeight()); @@ -364,7 +363,8 @@ } beanToEntitySortingBatch(target, batch, speciesBatch, recorderDepartmentId, enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_SPECIES, - source.getSpeciesTotalSampleSortedWeight(), source.getSpeciesTotalSortedWeight()); + source.getSpeciesTotalSortedWeight(), + null); speciesBatch.setRankOrder((short) 1); { @@ -410,7 +410,8 @@ } beanToEntitySortingBatch(target, batch, benthosBatch, recorderDepartmentId, enumeration.PMFM_ID_SORTING_TYPE, enumeration.QUALITATIVE_ID_SORTING_TYPE_BENTHOS, - source.getBenthosTotalSampleSortedWeight(), source.getBenthosTotalSortedWeight()); + source.getBenthosTotalSortedWeight(), + null); benthosBatch.setRankOrder((short) 2); { 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 13:45:30 UTC (rev 700) +++ trunk/tutti-persistence/src/test/java/fr/ifremer/tutti/persistence/service/CatchBatchPersistenceServiceWriteTest.java 2013-03-28 14:09:31 UTC (rev 701) @@ -216,7 +216,6 @@ // Species { catchBatch.setSpeciesTotalSortedWeight(12f); - catchBatch.setSpeciesTotalSampleSortedWeight(8f); catchBatch.setSpeciesTotalLivingNotItemizedWeight(0.2f); catchBatch.setSpeciesTotalInertWeight(0.1f); } @@ -224,7 +223,6 @@ // Benthos { catchBatch.setBenthosTotalSortedWeight(24f); - catchBatch.setBenthosTotalSampleSortedWeight(16f); catchBatch.setBenthosTotalLivingNotItemizedWeight(0.4f); catchBatch.setBenthosTotalInertWeight(0.2f); } @@ -253,10 +251,11 @@ // ----------------------------------------------------------------------------- catchBatch.setCatchTotalSortedTremisWeight(null); catchBatch.setCatchTotalSortedCarousselWeight(null); - catchBatch.setSpeciesTotalSortedWeight(null); - catchBatch.setSpeciesTotalSampleSortedWeight(null); catchBatch.setCatchTotalUnsortedWeight(null); + catchBatch.setSpeciesTotalSortedWeight(null); catchBatch.setSpeciesTotalUnsortedWeight(null); + catchBatch.setBenthosTotalSortedWeight(null); + catchBatch.setBenthosTotalUnsortedWeight(null); assertSaveAndReloadCatchBatch(catchBatch, fishingOperationNoCatchBatch.getId()); } @@ -308,13 +307,11 @@ assertEquals(expectedCatchBatch.getCatchTotalSortedTremisWeight(), actualCatchBatch.getCatchTotalSortedTremisWeight()); assertEquals(expectedCatchBatch.getCatchTotalUnsortedWeight(), actualCatchBatch.getCatchTotalUnsortedWeight()); - assertEquals(expectedCatchBatch.getSpeciesTotalSampleSortedWeight(), actualCatchBatch.getSpeciesTotalSampleSortedWeight()); assertEquals(expectedCatchBatch.getSpeciesTotalSortedWeight(), actualCatchBatch.getSpeciesTotalSortedWeight()); assertEquals(expectedCatchBatch.getSpeciesTotalUnsortedWeight(), actualCatchBatch.getSpeciesTotalUnsortedWeight()); assertEquals(expectedCatchBatch.getSpeciesTotalInertWeight(), actualCatchBatch.getSpeciesTotalInertWeight()); assertEquals(expectedCatchBatch.getSpeciesTotalLivingNotItemizedWeight(), actualCatchBatch.getSpeciesTotalLivingNotItemizedWeight()); - assertEquals(expectedCatchBatch.getBenthosTotalSampleSortedWeight(), actualCatchBatch.getBenthosTotalSampleSortedWeight()); assertEquals(expectedCatchBatch.getBenthosTotalSortedWeight(), actualCatchBatch.getBenthosTotalSortedWeight()); assertEquals(expectedCatchBatch.getBenthosTotalUnsortedWeight(), actualCatchBatch.getBenthosTotalUnsortedWeight()); assertEquals(expectedCatchBatch.getBenthosTotalInertWeight(), actualCatchBatch.getBenthosTotalInertWeight());