r2151 - in trunk: wao-services/src/main/java/fr/ifremer/wao/services/service wao-web/src/main/webapp/WEB-INF/content/obsmer
Author: bleny Date: 2014-07-15 12:08:16 +0200 (Tue, 15 Jul 2014) New Revision: 2151 Url: http://forge.codelutin.com/projects/wao/repository/revisions/2151 Log: fixes #5413 add grand total pourcentage in observation days in sampling plan 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-07-15 09:37:47 UTC (rev 2150) +++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSamplingPlan.java 2014-07-15 10:08:16 UTC (rev 2151) @@ -55,6 +55,10 @@ */ protected Long observationTimesInDaysTotalEstimated; + protected Double observationTimesInDaysTotalRealRatio; + + protected Double observationTimesInDaysTotalEstimatedRatio; + public ObsMerSamplingPlan(List<Date> months, Collection<SamplingPlanFacadePart> facadeParts, Map<Date, SamplingPlanStatistics> totalsPerMonth, @@ -68,8 +72,24 @@ this.observationTimesInDaysTotalExpected = observationTimesInDaysTotalExpected; this.observationTimesInDaysTotalReal = observationTimesInDaysTotalReal; this.observationTimesInDaysTotalEstimated = observationTimesInDaysTotalEstimated; + if (observationTimesInDaysTotalExpected != null) { + if (observationTimesInDaysTotalReal != null) { + this.observationTimesInDaysTotalRealRatio = (double) observationTimesInDaysTotalReal / observationTimesInDaysTotalExpected; + } + if (observationTimesInDaysTotalEstimated != null) { + this.observationTimesInDaysTotalEstimatedRatio = (double) observationTimesInDaysTotalEstimated / observationTimesInDaysTotalExpected; + } + } } + public Double getObservationTimesInDaysTotalRealRatio() { + return observationTimesInDaysTotalRealRatio; + } + + public Double getObservationTimesInDaysTotalEstimatedRatio() { + return observationTimesInDaysTotalEstimatedRatio; + } + public Double getObservationTimesInDaysTotalExpected() { return observationTimesInDaysTotalExpected; } 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-07-15 09:37:47 UTC (rev 2150) +++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp 2014-07-15 10:08:16 UTC (rev 2151) @@ -599,6 +599,15 @@ / </s:if> <s:property value="#expected"/> <s:text name="wao.ui.misc.day"/> + + <s:if test="authenticatedWaoUser.authorizedToViewSamplingPlanReal"> + <span class="estimated<s:if test="#estimated < #expected"> lower-than-expected</s:if><s:if test="#estimated > #expected"> higher-than-expected</s:if>"> + <s:property value="samplingPlan.observationTimesInDaysTotalEstimatedRatio * 100" /> % + </span> + <span class="real<s:if test="#real < #expected"> lower-than-expected</s:if><s:if test="#real > #expected"> higher-than-expected</s:if>"> + <s:property value="samplingPlan.observationTimesInDaysTotalRealRatio * 100" /> % + </span> + </s:if> </td> <th colspan="${nbColumnsForOther}"></th> </tfoot>
participants (1)
-
bleny@users.forge.codelutin.com