[Suiviobsmer-commits] r681 - in trunk/wao-ui/src/main: java/fr/ifremer/wao/ui/pages webapp
Author: bleny Date: 2010-10-15 16:30:12 +0000 (Fri, 15 Oct 2010) New Revision: 681 Log: add synthesis render for third indicator Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Synthesis.java trunk/wao-ui/src/main/webapp/Synthesis.tml Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Synthesis.java =================================================================== --- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Synthesis.java 2010-10-15 16:11:20 UTC (rev 680) +++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Synthesis.java 2010-10-15 16:30:12 UTC (rev 681) @@ -258,10 +258,15 @@ // FIXME 20101015 bleny business code, should be moved in business + // computing level for indicator int totalNumberOfRealized = 0; int totalNumberOfPlanned = 0; for (Map.Entry<Date, Integer> entry : res.get(1).entrySet()) { + // res.get(1) contains number of realized + // while res.get(0) contains planned + Date date = entry.getKey(); + // both variables will contains planned and realized at the same date int numberOfRealized = entry.getValue(); int numberOfPlanned = res.get(0).get(date); @@ -359,6 +364,18 @@ if (boardingResult == null) { boardingResult = serviceSynthesis.getBoardingBoats( getCompanyForBoarding(), getFromDate()); + + // FIXME 20101015 bleny business code, should be moved in business + // computing level for indicator + int numberOfBoatWithOneBoarding = boardingResult.getData().get("1"); + int totalNumberOfBoarding = 0; + for (Integer numberOfBoarding : boardingResult.getData().values()) { + totalNumberOfBoarding += numberOfBoarding; + } + double rate = ((double) numberOfBoatWithOneBoarding / + (double) totalNumberOfBoarding) * 100.0; + activeIndicator = getActiveIndicator(); + activeIndicatorLevel = activeIndicator.getLevelForValue(rate); } return boardingResult; } @@ -406,6 +423,7 @@ serviceSynthesis.getNonComplianceBoardingIndicator(company); // FIXME 20101015 bleny business code, should be moved in business + // computing level for indicator double total = 0.0; int numberOfCompanies = nonComplianceBoarding.size(); for (Double compliance : nonComplianceBoarding.values()) { @@ -521,6 +539,8 @@ serviceSynthesis.getContactDataInputDateReactivity(company, getPeriodForAllegroReactivity()); + // FIXME 20101015 bleny business code, should be moved in business + // computing level for indicator double sumAverages = 0.0; for (ContactAverageReactivity reactivity : allegroReactivity) { sumAverages += reactivity.getResult(); Modified: trunk/wao-ui/src/main/webapp/Synthesis.tml =================================================================== --- trunk/wao-ui/src/main/webapp/Synthesis.tml 2010-10-15 16:11:20 UTC (rev 680) +++ trunk/wao-ui/src/main/webapp/Synthesis.tml 2010-10-15 16:30:12 UTC (rev 681) @@ -171,6 +171,10 @@ <strong>${boardingResult.maxBoardingBoat.name} (${boardingResult.maxBoardingBoat.immatriculation})</strong> </p> </t:if> + + <!-- now render a table with position on global synthesis --> + <br /> + <t:indicatorLevels t:indicator="activeIndicator" highlightLevel="activeIndicatorLevel" /> </div> </t:block> <!-- IND1 : NON_COMPLIANCE_BOARDING -->
participants (1)
-
bleny@users.labs.libre-entreprise.org