This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository tutti. See http://git.codelutin.com/tutti.git commit bbb6d034e3b104e4eb4acb9297cee3fec93523bb Author: Tony CHEMIT <chemit@codelutin.com> Date: Sat Aug 23 15:42:50 2014 +0200 fixes #5175: [EXPORT GENERIQUE] la numérotation des lots Hors vrac dans Num_Ordre_V_HV_H2 à partir de 1001 n'est pas active --- .../service/export/generic/CatchExportModel.java | 55 +++++++++++++++------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/tutti-service/src/main/java/fr/ifremer/tutti/service/export/generic/CatchExportModel.java b/tutti-service/src/main/java/fr/ifremer/tutti/service/export/generic/CatchExportModel.java index 46c45ac..7f10062 100644 --- a/tutti-service/src/main/java/fr/ifremer/tutti/service/export/generic/CatchExportModel.java +++ b/tutti-service/src/main/java/fr/ifremer/tutti/service/export/generic/CatchExportModel.java @@ -144,7 +144,8 @@ public class CatchExportModel extends TuttiCsvUtil.AbstractTuttiExportModel<Catc row, rows, speciesBatch, - totalBatchWeight); + totalBatchWeight, + vracBatch); } for (BenthosBatch benthosBatch : rootBenthosBatch.getChildren()) { @@ -175,7 +176,8 @@ public class CatchExportModel extends TuttiCsvUtil.AbstractTuttiExportModel<Catc row, rows, benthosBatch, - totalBatchWeight); + totalBatchWeight, + vracBatch); } // compute final raising factor @@ -223,12 +225,25 @@ public class CatchExportModel extends TuttiCsvUtil.AbstractTuttiExportModel<Catc CatchExportRow currentRow, List<CatchExportRow> rows, SpeciesBatch speciesBatch, - float totalBatchWeight) { + float totalBatchWeight, + boolean vracBatch) { currentRow.addComment(speciesBatch.getComment()); Integer number = TuttiEntities.getValueOrComputedValue(speciesBatch.getNumber(), speciesBatch.getComputedNumber()); + + Integer rankOrder = speciesBatch.getRankOrder(); + + if (!vracBatch && currentRow.getSampleCategory().isEmpty()) { + + //FIXME Remove this when improve export for import + // See http://forge.codelutin.com/issues/5175 + // Add 1000 to each hors-vrac batch rankOrder + + rankOrder += 1000; + } + addBatchSampleCategory(currentRow, speciesBatch.getSampleCategoryId(), speciesBatch.getSampleCategoryValue(), @@ -236,7 +251,7 @@ public class CatchExportModel extends TuttiCsvUtil.AbstractTuttiExportModel<Catc speciesBatch.getSampleCategoryComputedWeight(), speciesBatch.getWeight(), number, - speciesBatch.getRankOrder()); + rankOrder); if (speciesBatch.isChildBatchsEmpty()) { @@ -317,8 +332,8 @@ public class CatchExportModel extends TuttiCsvUtil.AbstractTuttiExportModel<Catc childRow, rows, childBatch, - totalBatchWeight - ); + totalBatchWeight, + vracBatch); ExportSampleCategory exportSampleCategory = childRow.getSampleCategory().get(categoryIndex); if (exportSampleCategory != null) { float categoryWeight = TuttiEntities.getValueOrComputedValue( @@ -335,7 +350,8 @@ public class CatchExportModel extends TuttiCsvUtil.AbstractTuttiExportModel<Catc CatchExportRow currentRow, List<CatchExportRow> rows, BenthosBatch benthosBatch, - final float totalBatchWeight) { + float totalBatchWeight, + boolean vracBatch) { currentRow.addComment(benthosBatch.getComment()); @@ -343,6 +359,17 @@ public class CatchExportModel extends TuttiCsvUtil.AbstractTuttiExportModel<Catc benthosBatch.getNumber(), benthosBatch.getComputedNumber()); + Integer rankOrder = benthosBatch.getRankOrder(); + + if (!vracBatch && currentRow.getSampleCategory().isEmpty()) { + + //FIXME Remove this when improve export for import + // See http://forge.codelutin.com/issues/5175 + // Add 1000 to each hors-vrac batch rank-order + + rankOrder += 1000; + } + addBatchSampleCategory(currentRow, benthosBatch.getSampleCategoryId(), benthosBatch.getSampleCategoryValue(), @@ -350,16 +377,7 @@ public class CatchExportModel extends TuttiCsvUtil.AbstractTuttiExportModel<Catc benthosBatch.getSampleCategoryComputedWeight(), benthosBatch.getWeight(), number, - benthosBatch.getRankOrder()); - - if (currentRow.getSampleCategory().size() == 1) { - - //FIXME Remove this when improve export for import - // See https://forge.codelutin.com/issues/4923 - ExportSampleCategory exportSampleCategory = currentRow.getSampleCategory().get(0); - Integer rankOrder = exportSampleCategory.getRankOrder(); - exportSampleCategory.setRankOrder(100 + rankOrder); - } + rankOrder); if (benthosBatch.isChildBatchsEmpty()) { @@ -440,7 +458,8 @@ public class CatchExportModel extends TuttiCsvUtil.AbstractTuttiExportModel<Catc childRow, rows, childBatch, - totalBatchWeight); + totalBatchWeight, + vracBatch); ExportSampleCategory exportSampleCategory = childRow.getSampleCategory().get(categoryIndex); float categoryWeight = TuttiEntities.getValueOrComputedValue( exportSampleCategory.getCategoryWeight(), -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.