r1772 - in trunk: wao-services/src/main/java/fr/ifremer/wao/services/service wao-web/src/main/webapp/WEB-INF/content/obsmer
Author: tchemit Date: 2014-03-28 11:24:41 +0100 (Fri, 28 Mar 2014) New Revision: 1772 Url: http://forge.codelutin.com/projects/wao/repository/revisions/1772 Log: refs #4483 add esitmated and real ratio Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSamplingPlan.java trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp 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-03-28 09:59:05 UTC (rev 1771) +++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSamplingPlan.java 2014-03-28 10:24:41 UTC (rev 1772) @@ -138,11 +138,16 @@ return result; } - public String getTotalRatio(Date month) { - String result = totalsPerMonth.get(month).getRatio("-"); + public String getTotalRealRatio(Date month) { + String result = totalsPerMonth.get(month).getRealRatio("-"); return result; } + public String getTotalEstimatedRatio(Date month) { + String result = totalsPerMonth.get(month).getRealRatio("-"); + return result; + } + public Integer getHighTotalExpected() { return highTotals.getNbTidesExpected(); } @@ -155,11 +160,16 @@ return highTotals.getNbTidesEstimated(); } - public String getHighTotalRatio() { - String ratio = highTotals.getRatio(""); + public String getHighTotalRealRatio() { + String ratio = highTotals.getRealRatio(""); return ratio; } + public String getHighTotalEstimatedRatio() { + String ratio = highTotals.getEstimatedRatio(""); + return ratio; + } + public SampleRowsFilterValues getFilterValues() { return filterValues; } @@ -520,11 +530,16 @@ return result; } - public String getTotalPercentage() { - String result = totalTides.getRatio("-"); + public String getTotalRealPercentage() { + String result = totalTides.getRealRatio("-"); return result; } + public String getTotalEstimatedPercentage() { + String result = totalTides.getEstimatedRatio("-"); + return result; + } + public String getFishingZones() { return fishingZones; } @@ -593,7 +608,7 @@ return nbTidesEstimated; } - public String getRatio(String defaultValue) { + public String getRealRatio(String defaultValue) { String ratio = defaultValue; if (nbTidesExpected != null && nbTidesExpected > 0 && nbTidesReal != null && nbTidesReal > 0) { @@ -603,5 +618,15 @@ return ratio; } + public String getEstimatedRatio(String defaultValue) { + String ratio = defaultValue; + if (nbTidesExpected != null && nbTidesExpected > 0 && + nbTidesEstimated != null && nbTidesEstimated > 0) { + double percent = ((double) nbTidesEstimated / nbTidesExpected); + ratio = NumberFormat.getPercentInstance().format(percent); + } + return ratio; + } + } } 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-03-28 09:59:05 UTC (rev 1771) +++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp 2014-03-28 10:24:41 UTC (rev 1772) @@ -355,7 +355,13 @@ <s:property value="totalTidesExpected" /> <s:if test="authenticatedWaoUser.authorizedToViewSamplingPlanReal"> - (<s:property value="totalPercentage" />) + <span class="estimated"> + (<s:property value="totalEstimatedPercentage" />) + </span> + <span class="real"> + (<s:property value="totalRealPercentage" />) + </span> + </s:if> </td> <td class="effort"> @@ -479,7 +485,13 @@ </s:if> <s:property value="#expected"/> <s:if test="authenticatedWaoUser.authorizedToViewSamplingPlanReal"> - <s:property value="samplingPlan.getTotalRatio(#month)"/> + <span class="estimated"> + <s:property value="samplingPlan.getTotalEstimatedRatio(#month)"/> + </span> + <span class="real"> + <s:property value="samplingPlan.getTotalRealRatio(#month)"/> + </span> + </s:if> </td> </s:iterator> @@ -498,7 +510,13 @@ </s:if> <s:property value="#expected"/> <s:if test="authenticatedWaoUser.authorizedToViewSamplingPlanReal"> - <s:property value="samplingPlan.highTotalRatio" /> + <span class="estimated"> + <s:property value="samplingPlan.highTotalEstimatedRatio"/> + </span> + <span class="real"> + <s:property value="samplingPlan.highTotalRealRatio"/> + </span> + </s:if> </td> <td class="effort">
participants (1)
-
tchemit@users.forge.codelutin.com