branch develop updated (90c3842 -> a4b5b34)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository wao. See http://git.codelutin.com/wao.git from 90c3842 [jgitflow-maven-plugin]Updating develop poms back to pre merge state adds 1322a83 Remaniement de la génération du graphique du planifié vs réalisé, on introduit un pattern Template Method et trois implémentations (une par programme) adds 49a6592 Factorisation de la déclaration du converter, on applique le même pour toutes les instances de JFreeChart adds b54359d Ajout de .chart sur toutes les images correspondantes et mise en place d'une marge adds b2f3804 Dans la synthèse ObsMer on, montre le graphique du réalisé en jours de mers adds 237cadb Suppression de code mort new 34567cf Dans la synthèse, on modifie le TemplateMethod pour pouvoir permettre de préciser un réalisé sur plusieurs mois new bed195a Récupération via cherry-pick, dans WaoUtils, de la méthode permettant de déduire le mois sur lequel compter le contact ObsMer new 3c6b59f Dans la synthèse, on compte désormais l'observation sur le mois avec le plus de jours de mer new 5f70e8a Correction d'un bogue dans le calcul du réalisé dans les synthèses new e77194d Merge branch 'feature/5923' into develop adds ecc4187 Lors du calcul du plan ObsMer, on ne se repose plus sur les données dénormalisées en base mais on calcul les nombres d'observations par mois en même temps que le nombre de jours par mois. En même temps, on corrige le mode de calcul en affectant la marée au mois ayant le plus de jours (testable-cl #6392) adds 6fa7fe7 Extraction, dans WaoUtils, de la méthode permettant de déduire le mois sur lequel compter le contact ObsMer new 16c5570 Merge branch 'feature/6392' into develop new a53a891 prototype pour un bouton pour tout sélectionner dans un filtre new a6d116c Bouton pour tout sélectionner dans les filtres et tout déselectionner (testable-client #6383) new fe97750 Merge branch 'feature/6393' into develop new da14b3b Ajout du code espèces cibles DCP (crevettes) (refs #6452) new a4b5b34 Merge branch 'feature/6452' into develop The 11 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit a4b5b3456ee123da4dc4e01775746b91e81ea1c6 Merge: fe97750 da14b3b Author: Brendan Le Ny <bleny@codelutin.com> Date: Thu Feb 26 16:31:06 2015 +0100 Merge branch 'feature/6452' into develop commit fe97750d19bf60fa3698bb449a5beed8a13533c0 Merge: 16c5570 a6d116c Author: Brendan Le Ny <bleny@codelutin.com> Date: Thu Feb 26 16:30:42 2015 +0100 Merge branch 'feature/6393' into develop commit 16c5570852110afeba4b666872766fccaabc82e9 Merge: e77194d 6fa7fe7 Author: Brendan Le Ny <bleny@codelutin.com> Date: Thu Feb 26 16:30:19 2015 +0100 Merge branch 'feature/6392' into develop commit e77194db2e306d4e01ec7c4d0988f6a62f5d973e Merge: 90c3842 5f70e8a Author: Brendan Le Ny <bleny@codelutin.com> Date: Thu Feb 26 16:28:58 2015 +0100 Merge branch 'feature/5923' into develop commit 5f70e8a69a94f1e9a8db876616e57031cb3b2477 Author: Brendan Le Ny <bleny@codelutin.com> Date: Thu Feb 26 15:16:14 2015 +0100 Correction d'un bogue dans le calcul du réalisé dans les synthèses commit 3c6b59f378f6bf90aa49835b838ad7cdeb216343 Author: Brendan Le Ny <bleny@codelutin.com> Date: Thu Feb 26 14:20:32 2015 +0100 Dans la synthèse, on compte désormais l'observation sur le mois avec le plus de jours de mer commit bed195a8206703ebefe63cdf52eb66d1557a1caf Author: Brendan Le Ny <bleny@codelutin.com> Date: Thu Feb 26 14:17:28 2015 +0100 Récupération via cherry-pick, dans WaoUtils, de la méthode permettant de déduire le mois sur lequel compter le contact ObsMer commit 34567cf2dc51164cbdf44bf93a2ebcddb5b839d2 Author: Brendan Le Ny <bleny@codelutin.com> Date: Thu Feb 26 12:23:34 2015 +0100 Dans la synthèse, on modifie le TemplateMethod pour pouvoir permettre de préciser un réalisé sur plusieurs mois commit a6d116c234e63f53d25ddb36ba95faddae8e800c Author: Brendan Le Ny <bleny@codelutin.com> Date: Tue Feb 24 16:44:15 2015 +0100 Bouton pour tout sélectionner dans les filtres et tout déselectionner (testable-client #6383) commit da14b3b183110522e1edfe49c17a57f9f9b7df32 Author: Brendan Le Ny <bleny@codelutin.com> Date: Tue Feb 24 10:11:24 2015 +0100 Ajout du code espèces cibles DCP (crevettes) (refs #6452) commit a53a89184f40c164cea6116c6067b1f60d7d6ced Author: Brendan Le Ny <bleny@codelutin.com> Date: Wed Jan 21 11:59:18 2015 +0100 prototype pour un bouton pour tout sélectionner dans un filtre Summary of changes: .../src/main/java/fr/ifremer/wao/WaoUtils.java | 17 + .../fr/ifremer/wao/entity/ContactTopiaDao.java | 32 +- .../fr/ifremer/wao/entity/SampleRowTopiaDao.java | 51 --- .../ifremer/wao/entity/TargetSpeciesDcfImpl.java | 2 +- .../i18n/wao-persistence_en_GB.properties | 1 + .../i18n/wao-persistence_fr_FR.properties | 1 + .../service/ObsMerSamplingPlanBuilder.java | 125 +++--- .../fr/ifremer/wao/services/service/Synthesis.java | 10 + .../wao/services/service/SynthesisService.java | 485 +++++++++++++++++---- .../service/administration/ReferentialService.java | 2 +- .../resources/i18n/wao-services_en_GB.properties | 1 + .../resources/i18n/wao-services_fr_FR.properties | 1 + .../web/converter/JFreeChartToImgTagConverter.java | 2 +- .../service/Synthesis-conversion.properties | 22 - .../src/main/resources/xwork-conversion.properties | 1 + .../src/main/webapp/WEB-INF/content/synthesis.jsp | 5 + wao-web/src/main/webapp/wao.css | 2 +- wao-web/src/main/webapp/wao.js | 23 + 18 files changed, 549 insertions(+), 234 deletions(-) delete mode 100644 wao-web/src/main/resources/fr/ifremer/wao/services/service/Synthesis-conversion.properties -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository wao. See http://git.codelutin.com/wao.git commit a53a89184f40c164cea6116c6067b1f60d7d6ced Author: Brendan Le Ny <bleny@codelutin.com> Date: Wed Jan 21 11:59:18 2015 +0100 prototype pour un bouton pour tout sélectionner dans un filtre --- wao-web/src/main/webapp/wao.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/wao-web/src/main/webapp/wao.js b/wao-web/src/main/webapp/wao.js index f2ec750..539d402 100644 --- a/wao-web/src/main/webapp/wao.js +++ b/wao-web/src/main/webapp/wao.js @@ -360,6 +360,11 @@ var OneFilterModel = function (filterMapping, filterModel) { $(self).trigger('selected-options-updated', [ self ]); }; + this.selectAll = function () { + var allOptions = this.options.slice(0); // copy + this.setSelectedOptions(allOptions); + }; + this.onFilterUpdated = function (filter) { var selectedOptions = []; var filterValues = WAO.getNestedPropertyValue(this.filterMapping.filterName, filter); @@ -407,6 +412,9 @@ var OneFilterView = function (oneFilterModel) { + ' <button type="button" class="btn btn-link close-button">' + ' <i class="fa fa-check"></i>' + ' </button>' + + ' <button type="button" class="btn btn-link select-all-button">' + + ' <i class="fa fa-anchor"></i>' + + ' </button>' + ' </span>' + ' </div>' + '</div>' @@ -421,6 +429,7 @@ var OneFilterView = function (oneFilterModel) { this.$openButton = this.$container.find('button.open-button'); this.$closeButton = this.$container.find('button.close-button'); + this.$selectAllButton = this.$container.find('button.select-all-button'); this.updateSelectedOptions(); @@ -541,6 +550,10 @@ var OneFilterController = function (filterMapping, filterModel, filterController self.model.setSelectedOptions(selectedOptions); }); + this.view.$selectAllButton.click(function () { + self.selectAll(); + }); + this.view.$closeButton.click(function () { self.close(); }); @@ -563,6 +576,10 @@ var OneFilterController = function (filterMapping, filterModel, filterController this.view.hide(); } + this.selectAll = function () { + this.model.selectAll(); + } + }; -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository wao. See http://git.codelutin.com/wao.git commit da14b3b183110522e1edfe49c17a57f9f9b7df32 Author: Brendan Le Ny <bleny@codelutin.com> Date: Tue Feb 24 10:11:24 2015 +0100 Ajout du code espèces cibles DCP (crevettes) (refs #6452) --- .../src/main/java/fr/ifremer/wao/entity/TargetSpeciesDcfImpl.java | 2 +- .../src/main/resources/i18n/wao-persistence_en_GB.properties | 1 + .../src/main/resources/i18n/wao-persistence_fr_FR.properties | 1 + .../ifremer/wao/services/service/administration/ReferentialService.java | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wao-persistence/src/main/java/fr/ifremer/wao/entity/TargetSpeciesDcfImpl.java b/wao-persistence/src/main/java/fr/ifremer/wao/entity/TargetSpeciesDcfImpl.java index a3f5558..34c2233 100644 --- a/wao-persistence/src/main/java/fr/ifremer/wao/entity/TargetSpeciesDcfImpl.java +++ b/wao-persistence/src/main/java/fr/ifremer/wao/entity/TargetSpeciesDcfImpl.java @@ -49,7 +49,7 @@ public class TargetSpeciesDcfImpl extends TargetSpeciesDcfAbstract { n("fr.ifremer.wao.entity.TargetSpeciesDcf.LPF"); n("fr.ifremer.wao.entity.TargetSpeciesDcf.MOL"); n("fr.ifremer.wao.entity.TargetSpeciesDcf.SPF"); - n("fr.ifremer.wao.entity.TerrestrialDivision"); + n("fr.ifremer.wao.entity.TargetSpeciesDcf.DCP"); n("fr.ifremer.wao.entity.TerrestrialLocation"); } diff --git a/wao-persistence/src/main/resources/i18n/wao-persistence_en_GB.properties b/wao-persistence/src/main/resources/i18n/wao-persistence_en_GB.properties index 9683525..d33c7f5 100644 --- a/wao-persistence/src/main/resources/i18n/wao-persistence_en_GB.properties +++ b/wao-persistence/src/main/resources/i18n/wao-persistence_en_GB.properties @@ -139,6 +139,7 @@ fr.ifremer.wao.entity.TargetSpeciesDcf.CEP=Cephalopods fr.ifremer.wao.entity.TargetSpeciesDcf.CRU=Crustacean fr.ifremer.wao.entity.TargetSpeciesDcf.CRW=Langouste fr.ifremer.wao.entity.TargetSpeciesDcf.CSJ=Scallop +fr.ifremer.wao.entity.TargetSpeciesDcf.DCP=Prawns fr.ifremer.wao.entity.TargetSpeciesDcf.DEF=Demersal species fr.ifremer.wao.entity.TargetSpeciesDcf.DWS=Deep water species fr.ifremer.wao.entity.TargetSpeciesDcf.FIF=Finfish diff --git a/wao-persistence/src/main/resources/i18n/wao-persistence_fr_FR.properties b/wao-persistence/src/main/resources/i18n/wao-persistence_fr_FR.properties index 24e763a..29da1ed 100644 --- a/wao-persistence/src/main/resources/i18n/wao-persistence_fr_FR.properties +++ b/wao-persistence/src/main/resources/i18n/wao-persistence_fr_FR.properties @@ -139,6 +139,7 @@ fr.ifremer.wao.entity.TargetSpeciesDcf.CEP=Céphalopodes fr.ifremer.wao.entity.TargetSpeciesDcf.CRU=Crustacés fr.ifremer.wao.entity.TargetSpeciesDcf.CRW=Langouste fr.ifremer.wao.entity.TargetSpeciesDcf.CSJ=Coquilles Saint-Jacques +fr.ifremer.wao.entity.TargetSpeciesDcf.DCP=Crevettes fr.ifremer.wao.entity.TargetSpeciesDcf.DEF=Espèces démersales fr.ifremer.wao.entity.TargetSpeciesDcf.DWS=Espèces d'eaux profondes fr.ifremer.wao.entity.TargetSpeciesDcf.FIF=Poissons diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/administration/ReferentialService.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/administration/ReferentialService.java index 01dee68..c8b0c2a 100644 --- a/wao-services/src/main/java/fr/ifremer/wao/services/service/administration/ReferentialService.java +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/administration/ReferentialService.java @@ -414,7 +414,7 @@ public class ReferentialService extends WaoServiceSupport { "TBB", "TBN", "TBS", "TMS"}; final String[] speciesCodesBase = {"ALG", "ANA", "CAT", "CRU", - "DEF", "DWS", "LPF", "MOL", "SPF", "FIF", "CEP"}; + "DEF", "DWS", "LPF", "MOL", "SPF", "FIF", "CEP", "DCP"}; long nbCodes = fishingGearDcfDao.count() + targetSpeciesDcfDao.count(); -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository wao. See http://git.codelutin.com/wao.git commit a6d116c234e63f53d25ddb36ba95faddae8e800c Author: Brendan Le Ny <bleny@codelutin.com> Date: Tue Feb 24 16:44:15 2015 +0100 Bouton pour tout sélectionner dans les filtres et tout déselectionner (testable-client #6383) --- wao-web/src/main/webapp/wao.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/wao-web/src/main/webapp/wao.js b/wao-web/src/main/webapp/wao.js index 539d402..2f789f6 100644 --- a/wao-web/src/main/webapp/wao.js +++ b/wao-web/src/main/webapp/wao.js @@ -361,8 +361,12 @@ var OneFilterModel = function (filterMapping, filterModel) { }; this.selectAll = function () { - var allOptions = this.options.slice(0); // copy - this.setSelectedOptions(allOptions); + if (this.selectedOptions.length === 0) { + var allOptions = this.options.slice(0); // copy + this.setSelectedOptions(allOptions); + } else { + this.setSelectedOptions([]); + } }; this.onFilterUpdated = function (filter) { @@ -413,7 +417,7 @@ var OneFilterView = function (oneFilterModel) { + ' <i class="fa fa-check"></i>' + ' </button>' + ' <button type="button" class="btn btn-link select-all-button">' - + ' <i class="fa fa-anchor"></i>' + + ' <i class="fa fa-asterisk"></i>' + ' </button>' + ' </span>' + ' </div>' @@ -578,6 +582,8 @@ var OneFilterController = function (filterMapping, filterModel, filterController this.selectAll = function () { this.model.selectAll(); + this.close(); + this.open(); } }; -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository wao. See http://git.codelutin.com/wao.git commit 34567cf2dc51164cbdf44bf93a2ebcddb5b839d2 Author: Brendan Le Ny <bleny@codelutin.com> Date: Thu Feb 26 12:23:34 2015 +0100 Dans la synthèse, on modifie le TemplateMethod pour pouvoir permettre de préciser un réalisé sur plusieurs mois --- .../wao/services/service/SynthesisService.java | 78 ++++++++++++---------- 1 file changed, 44 insertions(+), 34 deletions(-) diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/SynthesisService.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/SynthesisService.java index 10010be..20b426f 100644 --- a/wao-services/src/main/java/fr/ifremer/wao/services/service/SynthesisService.java +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/SynthesisService.java @@ -24,8 +24,12 @@ package fr.ifremer.wao.services.service; import com.google.common.base.MoreObjects; import com.google.common.base.Preconditions; import com.google.common.cache.Cache; +import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; +import com.google.common.collect.LinkedListMultimap; +import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimap; +import com.google.common.collect.Multimaps; import fr.ifremer.wao.ContactsFilter; import fr.ifremer.wao.SampleRowsFilter; import fr.ifremer.wao.WaoUtils; @@ -102,7 +106,7 @@ public class SynthesisService extends WaoServiceSupport { filter.setFilterOnObservationBeginDate(true); synthesis.getSampleRowIds().addAll(dao.getSampleRowsIds(filter)); - setExpectedVsActualObservationsByMonthsBarChartData(synthesis, filter); + setExpectedVsActualBarChartDatas(synthesis, filter); if (obsProgram.isObsMer()) { setComplianceBoardingIndicator(synthesis, filter); setDataReliability(synthesis, filter); @@ -215,7 +219,7 @@ public class SynthesisService extends WaoServiceSupport { * Un graphique avec, pour chaque mois, deux barres qui représentent l'effort demandé * vs l'effort réalisé. */ - protected void setExpectedVsActualObservationsByMonthsBarChartData(Synthesis synthesis, ContactsFilter filter) { + protected void setExpectedVsActualBarChartDatas(Synthesis synthesis, ContactsFilter filter) { Preconditions.checkArgument(filter.isFilterOnObservationBeginDate()); @@ -470,8 +474,8 @@ public class SynthesisService extends WaoServiceSupport { public JFreeChart getChart() { // définition de la fenêtre - Date periodFromMonth = truncateToTimePeriodFunction(periodFrom); - Date periodToMonth = truncateToTimePeriodFunction(periodTo); + Date periodFromMonth = truncateToTimePeriod(periodFrom); + Date periodToMonth = truncateToTimePeriod(periodTo); Range<Date> periodRange = Range.between(periodFromMonth, periodToMonth); @@ -480,7 +484,7 @@ public class SynthesisService extends WaoServiceSupport { for (SampleRow sampleRow : sampleRows) { for (SampleMonth sampleMonth : sampleRow.getSampleMonth()) { Date month = sampleMonth.getPeriodDate(); - Date period = truncateToTimePeriodFunction(month); + Date period = truncateToTimePeriod(month); if (periodRange.contains(period)) { Integer expected = MoreObjects.firstNonNull( expectedEffortByPeriods.get(period), @@ -496,17 +500,18 @@ public class SynthesisService extends WaoServiceSupport { } // Calcul du réalisé - SortedMap<Date, Integer> actualObservationsByPeriods = new TreeMap<>(); + ListMultimap<Date, Integer> actualObservationsByPeriods = LinkedListMultimap.create(); for (Contact contact : contacts) { Preconditions.checkState(sampleRows.contains(contact.getSampleRow())); - Date period = truncateToTimePeriodFunction(contact.getObservationBeginDate()); - if (periodRange.contains(period)) { - Integer count = MoreObjects.firstNonNull( - actualObservationsByPeriods.get(period), - 0); - count += getActual(contact); - actualObservationsByPeriods.put(period, count); + Map<Date, Integer> actualPerPeriods = getActualPerPeriods(contact); + for (Map.Entry<Date, Integer> entry : actualPerPeriods.entrySet()) { + Date period = entry.getKey(); + if (periodRange.contains(period)) { + Integer actual = entry.getValue(); + actualObservationsByPeriods.put(period, actual); + } } + actualObservationsByPeriods.putAll(Multimaps.forMap(actualPerPeriods)); } if (log.isDebugEnabled()) { @@ -527,9 +532,10 @@ public class SynthesisService extends WaoServiceSupport { } else { rowKey = I18n.l(locale, "wao.synthesis.estimated"); } - for (Map.Entry<Date, Integer> entry : actualObservationsByPeriods.entrySet()) { + + for (Map.Entry<Date, Collection<Integer>> entry : actualObservationsByPeriods.asMap().entrySet()) { Date period = entry.getKey(); - Integer actual = entry.getValue(); + Integer actual = WaoUtils.sum(entry.getValue()); dataset.setValue(actual, rowKey, formatPeriod(period)); } @@ -558,10 +564,7 @@ public class SynthesisService extends WaoServiceSupport { } - /** - * Combien il faut compter de réalisé pour ce contact. - */ - protected abstract int getActual(Contact contact); + protected abstract Map<Date, Integer> getActualPerPeriods(Contact contact); protected abstract String getValueAxisLabel(); @@ -573,7 +576,7 @@ public class SynthesisService extends WaoServiceSupport { /** * Pour une date, indique dans quelle période de temps elle se trouve (mois ? trimestre ?) */ - protected abstract Date truncateToTimePeriodFunction(Date period); + protected abstract Date truncateToTimePeriod(Date period); protected abstract String formatPeriod(Date period); @@ -594,7 +597,7 @@ public class SynthesisService extends WaoServiceSupport { * On est sur un découpage mensuel. */ @Override - protected Date truncateToTimePeriodFunction(Date period) { + protected Date truncateToTimePeriod(Date period) { return WaoUtils.truncateToMonth(period); } @@ -615,8 +618,9 @@ public class SynthesisService extends WaoServiceSupport { * Le réalisé est le nombre d'observation, on compte 1 observation pour 1 navire donc 1 pour chaque contact. */ @Override - protected int getActual(Contact contact) { - return 1; + protected Map<Date, Integer> getActualPerPeriods(Contact contact) { + Date month = truncateToTimePeriod(contact.getObservationBeginDate()); + return ImmutableMap.of(month, 1); } } @@ -637,7 +641,7 @@ public class SynthesisService extends WaoServiceSupport { * On est sur un découpage mensuel. */ @Override - protected Date truncateToTimePeriodFunction(Date period) { + protected Date truncateToTimePeriod(Date period) { return WaoUtils.truncateToMonth(period); } @@ -656,11 +660,15 @@ public class SynthesisService extends WaoServiceSupport { } /** - * Le réalisé est le nombre d'observation, on compte 1 observation pour 1 navire donc 1 pour chaque contact. + * Le réalisé est le de jours de mers pour chaque mois. */ @Override - protected int getActual(Contact contact) { - return contact.getObservationTimeInDays(); + protected Map<Date, Integer> getActualPerPeriods(Contact contact) { + Map<Date, Integer> observationDaysByMonthsForObservation = + WaoUtils.getObservationDaysByMonths( + contact.getObservationBeginDate(), + contact.getObservationEndDate()); + return observationDaysByMonthsForObservation; } } @@ -681,7 +689,7 @@ public class SynthesisService extends WaoServiceSupport { * On est sur un découpage mensuel. */ @Override - protected Date truncateToTimePeriodFunction(Date period) { + protected Date truncateToTimePeriod(Date period) { return WaoUtils.truncateToMonth(period); } @@ -703,8 +711,8 @@ public class SynthesisService extends WaoServiceSupport { * Le réalisé est le nombre d'observation, on compte 1 observation pour 1 navire donc 1 pour chaque contact. */ @Override - protected int getActual(Contact contact) { - return 1; + protected Map<Date, Integer> getActualPerPeriods(Contact contact) { + return ImmutableMap.of(truncateToTimePeriod(contact.getObservationBeginDate()), 1); } } @@ -725,7 +733,7 @@ public class SynthesisService extends WaoServiceSupport { * On est sur un découpage en trimestres. */ @Override - protected Date truncateToTimePeriodFunction(Date period) { + protected Date truncateToTimePeriod(Date period) { return WaoUtils.truncateToTrimester(period); } @@ -743,11 +751,13 @@ public class SynthesisService extends WaoServiceSupport { } /** - * Le réalisé est le nombre d'individus échantilonnés. + * Le réalisé est le nombre d'individus échantilonnés sur le trimestre. */ @Override - protected int getActual(Contact contact) { - return contact.getSampleSize(); + protected Map<Date, Integer> getActualPerPeriods(Contact contact) { + Date trimester = truncateToTimePeriod(contact.getObservationBeginDate()); + Integer actual = contact.getSampleSize(); + return ImmutableMap.of(trimester, actual); } } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository wao. See http://git.codelutin.com/wao.git commit bed195a8206703ebefe63cdf52eb66d1557a1caf Author: Brendan Le Ny <bleny@codelutin.com> Date: Thu Feb 26 14:17:28 2015 +0100 Récupération via cherry-pick, dans WaoUtils, de la méthode permettant de déduire le mois sur lequel compter le contact ObsMer --- .../src/main/java/fr/ifremer/wao/WaoUtils.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/wao-persistence/src/main/java/fr/ifremer/wao/WaoUtils.java b/wao-persistence/src/main/java/fr/ifremer/wao/WaoUtils.java index 0f6a1ce..0c1ebfd 100644 --- a/wao-persistence/src/main/java/fr/ifremer/wao/WaoUtils.java +++ b/wao-persistence/src/main/java/fr/ifremer/wao/WaoUtils.java @@ -274,4 +274,21 @@ public class WaoUtils { } }; } + + /** + * Retourne la clé qui a la plus grande valeur, en présences des valeurs égales, on privilégie + * les premières clés trouvées. + */ + public static <T> T getKeyWithHighestValue(Map<T, Integer> map) { + T keyWithHighestValue = null; + int maxObservationDays = 0; + for (Map.Entry<T, Integer> entry : map.entrySet()) { + T aKey = entry.getKey(); + Integer aObservationDays = entry.getValue(); + if (aObservationDays > maxObservationDays) { + keyWithHighestValue = aKey; + } + } + return keyWithHighestValue; + } } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository wao. See http://git.codelutin.com/wao.git commit 3c6b59f378f6bf90aa49835b838ad7cdeb216343 Author: Brendan Le Ny <bleny@codelutin.com> Date: Thu Feb 26 14:20:32 2015 +0100 Dans la synthèse, on compte désormais l'observation sur le mois avec le plus de jours de mer --- .../java/fr/ifremer/wao/services/service/SynthesisService.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/SynthesisService.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/SynthesisService.java index 20b426f..4596c1e 100644 --- a/wao-services/src/main/java/fr/ifremer/wao/services/service/SynthesisService.java +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/SynthesisService.java @@ -619,7 +619,13 @@ public class SynthesisService extends WaoServiceSupport { */ @Override protected Map<Date, Integer> getActualPerPeriods(Contact contact) { - Date month = truncateToTimePeriod(contact.getObservationBeginDate()); + // on calcule les jours de mers pour chaque mois + Map<Date, Integer> observationDaysByMonthsForObservation = + WaoUtils.getObservationDaysByMonths( + contact.getObservationBeginDate(), + contact.getObservationEndDate()); + // on prend le mois avec le plus de jours de mers pour compter 1 observation + Date month = WaoUtils.getKeyWithHighestValue(observationDaysByMonthsForObservation); return ImmutableMap.of(month, 1); } } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository wao. See http://git.codelutin.com/wao.git commit 5f70e8a69a94f1e9a8db876616e57031cb3b2477 Author: Brendan Le Ny <bleny@codelutin.com> Date: Thu Feb 26 15:16:14 2015 +0100 Correction d'un bogue dans le calcul du réalisé dans les synthèses --- .../wao/services/service/SynthesisService.java | 35 ++++++++++------------ 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/SynthesisService.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/SynthesisService.java index 4596c1e..b31e032 100644 --- a/wao-services/src/main/java/fr/ifremer/wao/services/service/SynthesisService.java +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/SynthesisService.java @@ -485,13 +485,11 @@ public class SynthesisService extends WaoServiceSupport { for (SampleMonth sampleMonth : sampleRow.getSampleMonth()) { Date month = sampleMonth.getPeriodDate(); Date period = truncateToTimePeriod(month); - if (periodRange.contains(period)) { - Integer expected = MoreObjects.firstNonNull( - expectedEffortByPeriods.get(period), - 0); - expected += getExpected(sampleMonth); - expectedEffortByPeriods.put(period, expected); - } + Integer expected = MoreObjects.firstNonNull( + expectedEffortByPeriods.get(period), + 0); + expected += getExpected(sampleMonth); + expectedEffortByPeriods.put(period, expected); } } @@ -504,13 +502,6 @@ public class SynthesisService extends WaoServiceSupport { for (Contact contact : contacts) { Preconditions.checkState(sampleRows.contains(contact.getSampleRow())); Map<Date, Integer> actualPerPeriods = getActualPerPeriods(contact); - for (Map.Entry<Date, Integer> entry : actualPerPeriods.entrySet()) { - Date period = entry.getKey(); - if (periodRange.contains(period)) { - Integer actual = entry.getValue(); - actualObservationsByPeriods.put(period, actual); - } - } actualObservationsByPeriods.putAll(Multimaps.forMap(actualPerPeriods)); } @@ -521,22 +512,28 @@ public class SynthesisService extends WaoServiceSupport { // Création du graphique DefaultCategoryDataset dataset = new DefaultCategoryDataset(); + // pour la barre représentant le planifié for (Map.Entry<Date, Integer> entry : expectedEffortByPeriods.entrySet()) { Date period = entry.getKey(); - Integer expected = entry.getValue(); - dataset.setValue(expected, I18n.l(locale, "wao.synthesis.planned"), formatPeriod(period)); + if (periodRange.contains(period)) { + Integer expected = entry.getValue(); + dataset.setValue(expected, I18n.l(locale, "wao.synthesis.planned"), formatPeriod(period)); + } } + + // pour la barre représentant l'estimé ou le réel String rowKey; if (realVsEstimated) { rowKey = I18n.l(locale, "wao.ui.samplingPlan.Actual"); } else { rowKey = I18n.l(locale, "wao.synthesis.estimated"); } - for (Map.Entry<Date, Collection<Integer>> entry : actualObservationsByPeriods.asMap().entrySet()) { Date period = entry.getKey(); - Integer actual = WaoUtils.sum(entry.getValue()); - dataset.setValue(actual, rowKey, formatPeriod(period)); + if (periodRange.contains(period)) { + Integer actual = WaoUtils.sum(entry.getValue()); + dataset.setValue(actual, rowKey, formatPeriod(period)); + } } // Axises -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository wao. See http://git.codelutin.com/wao.git commit e77194db2e306d4e01ec7c4d0988f6a62f5d973e Merge: 90c3842 5f70e8a Author: Brendan Le Ny <bleny@codelutin.com> Date: Thu Feb 26 16:28:58 2015 +0100 Merge branch 'feature/5923' into develop .../src/main/java/fr/ifremer/wao/WaoUtils.java | 17 + .../fr/ifremer/wao/entity/ContactTopiaDao.java | 32 +- .../fr/ifremer/wao/entity/SampleRowTopiaDao.java | 51 --- .../fr/ifremer/wao/services/service/Synthesis.java | 10 + .../wao/services/service/SynthesisService.java | 485 +++++++++++++++++---- .../resources/i18n/wao-services_en_GB.properties | 1 + .../resources/i18n/wao-services_fr_FR.properties | 1 + .../web/converter/JFreeChartToImgTagConverter.java | 2 +- .../service/Synthesis-conversion.properties | 22 - .../src/main/resources/xwork-conversion.properties | 1 + .../src/main/webapp/WEB-INF/content/synthesis.jsp | 5 + wao-web/src/main/webapp/wao.css | 2 +- 12 files changed, 451 insertions(+), 178 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository wao. See http://git.codelutin.com/wao.git commit 16c5570852110afeba4b666872766fccaabc82e9 Merge: e77194d 6fa7fe7 Author: Brendan Le Ny <bleny@codelutin.com> Date: Thu Feb 26 16:30:19 2015 +0100 Merge branch 'feature/6392' into develop .../service/ObsMerSamplingPlanBuilder.java | 125 ++++++++++++--------- 1 file changed, 71 insertions(+), 54 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository wao. See http://git.codelutin.com/wao.git commit fe97750d19bf60fa3698bb449a5beed8a13533c0 Merge: 16c5570 a6d116c Author: Brendan Le Ny <bleny@codelutin.com> Date: Thu Feb 26 16:30:42 2015 +0100 Merge branch 'feature/6393' into develop wao-web/src/main/webapp/wao.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository wao. See http://git.codelutin.com/wao.git commit a4b5b3456ee123da4dc4e01775746b91e81ea1c6 Merge: fe97750 da14b3b Author: Brendan Le Ny <bleny@codelutin.com> Date: Thu Feb 26 16:31:06 2015 +0100 Merge branch 'feature/6452' into develop .../src/main/java/fr/ifremer/wao/entity/TargetSpeciesDcfImpl.java | 2 +- .../src/main/resources/i18n/wao-persistence_en_GB.properties | 1 + .../src/main/resources/i18n/wao-persistence_fr_FR.properties | 1 + .../ifremer/wao/services/service/administration/ReferentialService.java | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm