r2284 - in trunk: wao-persistence/src/main/resources/db/migration wao-persistence/src/main/xmi wao-persistence/src/test/java/fr/ifremer/wao/entity wao-services/src/main/java/fr/ifremer/wao/services/service wao-services/src/main/java/fr/ifremer/wao/services/service/csv wao-web/src/main/webapp/WEB-INF/content/obsmer
Author: bleny Date: 2014-10-07 16:28:19 +0200 (Tue, 07 Oct 2014) New Revision: 2284 Url: http://forge.codelutin.com/projects/wao/repository/revisions/2284 Log: La dur?\195?\169e moyenne d'une mar?\195?\169e (ObsMer) passe en nombre entier (fixes #5117) Added: trunk/wao-persistence/src/main/resources/db/migration/V4_2__average_tide_time_to_int.sql Modified: trunk/wao-persistence/src/main/xmi/wao-model.properties trunk/wao-persistence/src/main/xmi/wao-model.zargo trunk/wao-persistence/src/test/java/fr/ifremer/wao/entity/SampleRowLogImplTest.java trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSamplingPlan.java trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSamplingPlanBuilder.java trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSamplingPlanService.java trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/csv/ObsMerObsVenteSamplingPlanImportExportModel.java trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp Added: trunk/wao-persistence/src/main/resources/db/migration/V4_2__average_tide_time_to_int.sql =================================================================== --- trunk/wao-persistence/src/main/resources/db/migration/V4_2__average_tide_time_to_int.sql (rev 0) +++ trunk/wao-persistence/src/main/resources/db/migration/V4_2__average_tide_time_to_int.sql 2014-10-07 14:28:19 UTC (rev 2284) @@ -0,0 +1,24 @@ +--- +-- #%L +-- Wao :: Persistence +-- %% +-- Copyright (C) 2009 - 2014 Ifremer +-- %% +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU Affero General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU Affero General Public License +-- along with this program. If not, see <http://www.gnu.org/licenses/>. +-- #L% +--- + + +-- On change le type de la colonne pour entier en arrondissant à l'entier supérieur +ALTER TABLE SampleRow ALTER COLUMN averageTideTime TYPE integer USING ceiling(averageTideTime); Modified: trunk/wao-persistence/src/main/xmi/wao-model.properties =================================================================== --- trunk/wao-persistence/src/main/xmi/wao-model.properties 2014-10-07 13:01:25 UTC (rev 2283) +++ trunk/wao-persistence/src/main/xmi/wao-model.properties 2014-10-07 14:28:19 UTC (rev 2284) @@ -21,7 +21,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # #L% ### -model.tagValue.version=4.1 +model.tagValue.version=4.2 model.tagValue.useEnumerationName=true # orderBy tagValues Modified: trunk/wao-persistence/src/main/xmi/wao-model.zargo =================================================================== (Binary files differ) Modified: trunk/wao-persistence/src/test/java/fr/ifremer/wao/entity/SampleRowLogImplTest.java =================================================================== --- trunk/wao-persistence/src/test/java/fr/ifremer/wao/entity/SampleRowLogImplTest.java 2014-10-07 13:01:25 UTC (rev 2283) +++ trunk/wao-persistence/src/test/java/fr/ifremer/wao/entity/SampleRowLogImplTest.java 2014-10-07 14:28:19 UTC (rev 2284) @@ -102,7 +102,7 @@ SampleRow newSampleRow = newEmptySampleRow(); // do some modifications - newSampleRow.setAverageTideTime(1.0); + newSampleRow.setAverageTideTime(1); newSampleRow.setProgramName("programName"); FishingZone fishingZone = new FishingZoneImpl(); fishingZone.setDistrictCode("IV"); Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSamplingPlan.java =================================================================== --- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSamplingPlan.java 2014-10-07 13:01:25 UTC (rev 2283) +++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSamplingPlan.java 2014-10-07 14:28:19 UTC (rev 2284) @@ -117,7 +117,7 @@ * <p/> * <strong>Note:</strong> can be null. */ - protected Double observationTimesInDaysExpected; + protected Integer observationTimesInDaysExpected; /** * Real times of observation in days. @@ -139,14 +139,14 @@ protected int nbObservants; - protected double averageTideTime; + protected int averageTideTime; protected Double appliedCoverageRate; public ObsMerSamplingPlanSampleRowPart(Locale locale, Map<Date, SamplingPlanStatistics> nbTidesPerMonth, SampleRow sampleRow, - Double observationTimesInDaysExpected, + Integer observationTimesInDaysExpected, Long observationTimesInDaysReal, Long observationTimesInDaysEstimated, long sampleRowContactCounts) { @@ -172,7 +172,7 @@ } - public Double getObservationTimesInDaysExpected() { + public Integer getObservationTimesInDaysExpected() { return observationTimesInDaysExpected; } @@ -200,7 +200,7 @@ return nbObservants; } - public double getAverageTideTime() { + public int getAverageTideTime() { return averageTideTime; } } Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSamplingPlanBuilder.java =================================================================== --- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSamplingPlanBuilder.java 2014-10-07 13:01:25 UTC (rev 2283) +++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSamplingPlanBuilder.java 2014-10-07 14:28:19 UTC (rev 2284) @@ -162,7 +162,7 @@ } public ObsMerSamplingPlanBuilder addSampleRow(SampleRow sampleRow, - Double observationTimesInDaysExpected, + Integer observationTimesInDaysExpected, Long observationTimesInDaysReal, Long observationTimesInDaysEstimated, long sampleRowContactCounts) { @@ -345,7 +345,7 @@ protected ObsMerSamplingPlan.SamplingPlanSampleRowPart addSampleRow(Locale locale, SampleRow row, Map<Date, ObsMerSamplingPlan.SamplingPlanStatistics> nbTidesPerMonth, - Double observationTimesInDaysExpected, + Integer observationTimesInDaysExpected, Long observationTimesInDaysReal, Long observationTimesInDaysEstimated, long sampleRowContactCounts) { Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSamplingPlanService.java =================================================================== --- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSamplingPlanService.java 2014-10-07 13:01:25 UTC (rev 2283) +++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSamplingPlanService.java 2014-10-07 14:28:19 UTC (rev 2284) @@ -105,7 +105,7 @@ for (SampleRow sampleRow : sampleRows) { // calcul effort plannifie - Double observationTimesInDaysExpected = + Integer observationTimesInDaysExpected = getObservationTimesInDayExpected(periodFrom, periodTo, sampleRow); @@ -144,13 +144,13 @@ * @param sampleRow la ligne à filtrer * @return l'effort plannifié calculé */ - protected double getObservationTimesInDayExpected(Date periodFrom, + protected int getObservationTimesInDayExpected(Date periodFrom, Date periodTo, SampleRow sampleRow) { Range<Date> period = Range.closed(periodFrom, periodTo); - double expected; + int expected; // On prend le nombre d'observation prévue pour cette ligne du plan // c'est à dire la somme des nombres d'observations prévues pour Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/csv/ObsMerObsVenteSamplingPlanImportExportModel.java =================================================================== --- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/csv/ObsMerObsVenteSamplingPlanImportExportModel.java 2014-10-07 13:01:25 UTC (rev 2283) +++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/csv/ObsMerObsVenteSamplingPlanImportExportModel.java 2014-10-07 14:28:19 UTC (rev 2284) @@ -222,7 +222,7 @@ } if (obsProgram == ObsProgram.OBSMER) { - modelBuilder.newColumnForImportExport("PLAN_DUREE_MOY", SampleRow.PROPERTY_AVERAGE_TIDE_TIME, Common.DOUBLE_PRIMITIVE); + modelBuilder.newColumnForImportExport("PLAN_DUREE_MOY", SampleRow.PROPERTY_AVERAGE_TIDE_TIME, Common.PRIMITIVE_INTEGER); modelBuilder.newColumnForImportExport("PLAN_NB_OBSERV", SampleRow.PROPERTY_NB_OBSERVANTS, Common.PRIMITIVE_INTEGER); modelBuilder.newColumnForImportExport("TAUX_COUVERTURE_APPLIQUE", SampleRow.PROPERTY_APPLIED_COVERAGE_RATE, Common.DOUBLE); } Modified: trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp =================================================================== --- trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp 2014-10-07 13:01:25 UTC (rev 2283) +++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp 2014-10-07 14:28:19 UTC (rev 2284) @@ -431,9 +431,9 @@ </s:if> </td> - <td><s:property value="averageTideTime" /></td> - <td><s:property value="nbObservants" /></td> - <td> + <td class="align-center"><s:property value="averageTideTime" /></td> + <td class="align-center"><s:property value="nbObservants" /></td> + <td class="align-center"> <s:if test="appliedCoverageRate"> <s:property value="appliedCoverageRate" />% </s:if>
participants (1)
-
bleny@users.forge.codelutin.com