|
From: <de...@us...> - 2016-02-24 10:26:40
|
Revision: 9287
http://sourceforge.net/p/fudaa/svn/9287
Author: deniger
Date: 2016-02-24 10:26:38 +0000 (Wed, 24 Feb 2016)
Log Message:
-----------
CRUE-644
Modified Paths:
--------------
trunk/soft/fudaa-crue/crue-emh/src/main/java/org/fudaa/dodico/crue/metier/helper/ResPrtHelper.java
trunk/soft/fudaa-crue/crue-project/src/main/java/org/fudaa/dodico/crue/projet/report/data/ReportRunVariableKey.java
trunk/soft/fudaa-crue/crue-project/src/main/java/org/fudaa/dodico/crue/projet/report/data/ReportRunVariableTimeKey.java
trunk/soft/fudaa-crue/crue-project/src/main/java/org/fudaa/dodico/crue/projet/report/export/ReportExportProfilLongitudinal.java
trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/config/AbstractReportGrapheBuilder.java
trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/longitudinal/ReportLongitudinalGrapheBuilder.java
trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/longitudinal/ReportProfilLongitudinalTopComponent.java
trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/service/ReportResultProviderService.java
Modified: trunk/soft/fudaa-crue/crue-emh/src/main/java/org/fudaa/dodico/crue/metier/helper/ResPrtHelper.java
===================================================================
--- trunk/soft/fudaa-crue/crue-emh/src/main/java/org/fudaa/dodico/crue/metier/helper/ResPrtHelper.java 2016-02-24 10:25:04 UTC (rev 9286)
+++ trunk/soft/fudaa-crue/crue-emh/src/main/java/org/fudaa/dodico/crue/metier/helper/ResPrtHelper.java 2016-02-24 10:26:38 UTC (rev 9287)
@@ -2,7 +2,6 @@
import java.util.Arrays;
import java.util.List;
-import org.apache.commons.lang.StringUtils;
import org.fudaa.dodico.crue.config.ccm.CrueConfigMetierConstants;
/**
@@ -10,13 +9,17 @@
* @author GRESSIER
*/
public class ResPrtHelper {
-
+
public static List<String> getZiniVar() {
return Arrays.asList(CrueConfigMetierConstants.ZINI);
}
-
+
public static List<String> getQiniVar() {
return Arrays.asList(CrueConfigMetierConstants.QINI);
}
-
+
+ public static boolean isRPTIVariable(String varName) {
+ return CrueConfigMetierConstants.ZINI.equals(varName) || CrueConfigMetierConstants.QINI.equals(varName);
+ }
+
}
Modified: trunk/soft/fudaa-crue/crue-project/src/main/java/org/fudaa/dodico/crue/projet/report/data/ReportRunVariableKey.java
===================================================================
--- trunk/soft/fudaa-crue/crue-project/src/main/java/org/fudaa/dodico/crue/projet/report/data/ReportRunVariableKey.java 2016-02-24 10:25:04 UTC (rev 9286)
+++ trunk/soft/fudaa-crue/crue-project/src/main/java/org/fudaa/dodico/crue/projet/report/data/ReportRunVariableKey.java 2016-02-24 10:26:38 UTC (rev 9287)
@@ -70,6 +70,9 @@
public boolean isReadVariable() {
return ReportVariableTypeEnum.READ.equals(variable.getVariableType());
}
+ public boolean isRPTIVariable() {
+ return ReportVariableTypeEnum.RESULTAT_RPTI.equals(variable.getVariableType());
+ }
public boolean isReadOrVariable() {
return isReadVariable() || ReportVariableTypeEnum.FORMULE.equals(variable.getVariableType());
Modified: trunk/soft/fudaa-crue/crue-project/src/main/java/org/fudaa/dodico/crue/projet/report/data/ReportRunVariableTimeKey.java
===================================================================
--- trunk/soft/fudaa-crue/crue-project/src/main/java/org/fudaa/dodico/crue/projet/report/data/ReportRunVariableTimeKey.java 2016-02-24 10:25:04 UTC (rev 9286)
+++ trunk/soft/fudaa-crue/crue-project/src/main/java/org/fudaa/dodico/crue/projet/report/data/ReportRunVariableTimeKey.java 2016-02-24 10:26:38 UTC (rev 9287)
@@ -51,6 +51,9 @@
public boolean isLimitProfilVariable() {
return ReportVariableTypeEnum.LIMIT_PROFIL.equals(runVariableKey.getVariable().getVariableType());
}
+ public boolean isRPTIVariable() {
+ return ReportVariableTypeEnum.RESULTAT_RPTI.equals(runVariableKey.getVariable().getVariableType());
+ }
public boolean isReadVariable() {
return ReportVariableTypeEnum.READ.equals(runVariableKey.getVariable().getVariableType());
Modified: trunk/soft/fudaa-crue/crue-project/src/main/java/org/fudaa/dodico/crue/projet/report/export/ReportExportProfilLongitudinal.java
===================================================================
--- trunk/soft/fudaa-crue/crue-project/src/main/java/org/fudaa/dodico/crue/projet/report/export/ReportExportProfilLongitudinal.java 2016-02-24 10:25:04 UTC (rev 9286)
+++ trunk/soft/fudaa-crue/crue-project/src/main/java/org/fudaa/dodico/crue/projet/report/export/ReportExportProfilLongitudinal.java 2016-02-24 10:26:38 UTC (rev 9287)
@@ -3,7 +3,9 @@
*/
package org.fudaa.dodico.crue.projet.report.export;
+import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -55,7 +57,7 @@
}
@Override
- protected void writeInBook(Workbook wb, List<ReportRunVariableKey> variablesToExport, List<ResultatTimeKey> times) {
+ protected void writeInBook(Workbook wb, List<ReportRunVariableKey> variablesToExportInit, List<ResultatTimeKey> times) {
String sheetName = CtuluResource.CTULU.getString("Feuille {0}", CtuluLibString.getString(1));
ReportExcelFormatData formater = new ReportExcelFormatData(wb);
@@ -75,9 +77,9 @@
row.createCell(idx++).setCellValue(BusinessMessages.getString("prefix.sections"));
String currentRunName = this.resultService.getRunCourant().getRunKey().getDisplayName();
row.createCell(idx++).setCellValue(propertyXp.getDisplayNom() + BusinessMessages.ENTITY_SEPARATOR + currentRunName);
- final List<ReportRunVariableKey> variables = content.getProfilVariables();
+ final List<ReportRunVariableKey> profilVariables = content.getProfilVariables();
//les titres des limites de profils
- for (ReportRunVariableKey variable : variables) {
+ for (ReportRunVariableKey variable : profilVariables) {
if (ReportVariableTypeEnum.LIMIT_PROFIL.equals(variable.getVariable().getVariableType())) {
String displayName = displayNameById.get(variable.getVariableName());
if (StringUtils.isEmpty(displayName)) {
@@ -86,7 +88,22 @@
row.createCell(idx++).setCellValue(displayName + BusinessMessages.ENTITY_SEPARATOR + currentRunName);
}
}
- //les titres des variables
+
+ List<ReportRunVariableKey> variablesToExport = new ArrayList<>();
+ List<ReportRunVariableKey> variablesRPIToExport = new ArrayList<>();
+
+ //pour les valeur RPTI, il ne faut exporter qu'une seul fois par run.
+ for (ReportRunVariableKey variable : variablesToExportInit) {
+ if (variable.isRPTIVariable()) {
+ variablesRPIToExport.add(variable);
+ } else {
+ variablesToExport.add(variable);
+ }
+ }
+ for (ReportRunVariableKey variable : variablesRPIToExport) {
+ row.createCell(idx++).setCellValue(
+ variable.getVariable().getVariableDisplayName() + BusinessMessages.ENTITY_SEPARATOR + variable.getReportRunKey().getDisplayName());
+ }
for (ResultatTimeKey time : times) {
for (ReportRunVariableKey variable : variablesToExport) {
row.createCell(idx++).setCellValue(
@@ -128,7 +145,7 @@
Cell cell = row.createCell(idx++);
cell.setCellValue(reportLongitudinalPositionSection.getXpDisplay());
cell.setCellStyle(xpStyle);
- for (ReportRunVariableKey variable : variables) {
+ for (ReportRunVariableKey variable : profilVariables) {
if (ReportVariableTypeEnum.LIMIT_PROFIL.equals(variable.getVariable().getVariableType())) {
ItemEnum etiquette = limitHelper.getEtiquette(variable.getVariable().getVariableName());
LitNommeLimite limite = limitHelper.getLimite(variable.getVariable().getVariableName());
@@ -147,6 +164,18 @@
}
}
}
+
+ for (ReportRunVariableKey variable : variablesRPIToExport) {
+ Double value = resultService.getValue(variable, section.getNom());
+ cell = row.createCell(idx++);
+ if (value != null) {
+ cell.setCellValue(value.doubleValue());
+ final CellStyle style = formater.getStyle(resultService.getPropertyNature(variable.getVariableName()),
+ DecimalFormatEpsilonEnum.COMPARISON);
+ cell.setCellStyle(style);
+
+ }
+ }
for (ResultatTimeKey time : times) {
for (ReportRunVariableKey variable : variablesToExport) {
boolean isDz = ReportRunVariableHelper.isNatDzVar(variable.getVariable(), resultService);
Modified: trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/config/AbstractReportGrapheBuilder.java
===================================================================
--- trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/config/AbstractReportGrapheBuilder.java 2016-02-24 10:25:04 UTC (rev 9286)
+++ trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/config/AbstractReportGrapheBuilder.java 2016-02-24 10:26:38 UTC (rev 9287)
@@ -385,9 +385,13 @@
Object selectedKey = getSelectedKey();
CourbeComparator comparator = new CourbeComparator();
Collections.sort(externe, comparator);
- Collections.sort(internCourbes, comparator);
+ if (internCourbes != null) {
+ Collections.sort(internCourbes, comparator);
+ }
List<EGCourbeSimple> courbes = new ArrayList<EGCourbeSimple>();
- courbes.addAll(internCourbes);
+ if (internCourbes != null) {
+ courbes.addAll(internCourbes);
+ }
courbes.addAll(externe);
uiController.getEGGrapheSimpleModel().removeAllCurves(null);
uiController.getEGGrapheSimpleModel().addCourbes((EGCourbeSimple[]) courbes.toArray(new EGCourbeSimple[courbes.size()]), null);
Modified: trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/longitudinal/ReportLongitudinalGrapheBuilder.java
===================================================================
--- trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/longitudinal/ReportLongitudinalGrapheBuilder.java 2016-02-24 10:25:04 UTC (rev 9286)
+++ trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/longitudinal/ReportLongitudinalGrapheBuilder.java 2016-02-24 10:26:38 UTC (rev 9287)
@@ -113,7 +113,7 @@
Object key = ((CourbeModelWithKey) courbe.getModel()).getKey();
if (key != null && ReportRunVariableTimeKey.class.equals(key.getClass())) {
ReportRunVariableTimeKey reportKey = (ReportRunVariableTimeKey) key;
- if (!reportKey.isDefinedOnSelectedTimeStep() || reportKey.isLimitProfilVariable()) {
+ if (!reportKey.isDefinedOnSelectedTimeStep() || reportKey.isLimitProfilVariable() || reportKey.isRPTIVariable()) {
res.add(courbe);
}
}
Modified: trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/longitudinal/ReportProfilLongitudinalTopComponent.java
===================================================================
--- trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/longitudinal/ReportProfilLongitudinalTopComponent.java 2016-02-24 10:25:04 UTC (rev 9286)
+++ trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/longitudinal/ReportProfilLongitudinalTopComponent.java 2016-02-24 10:26:38 UTC (rev 9287)
@@ -172,8 +172,8 @@
}
}
// ajout Zini issu du RPTI
- List<String> varZIni = ResPrtHelper.getZiniVar();
- choosableVariables.addAll(varZIni);
+ choosableVariables.addAll(ResPrtHelper.getZiniVar());
+ choosableVariables.addAll(ResPrtHelper.getQiniVar());
return choosableVariables;
}
Modified: trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/service/ReportResultProviderService.java
===================================================================
--- trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/service/ReportResultProviderService.java 2016-02-24 10:25:04 UTC (rev 9286)
+++ trunk/soft/fudaa-crue/ui-report/src/main/java/org/fudaa/fudaa/crue/report/service/ReportResultProviderService.java 2016-02-24 10:26:38 UTC (rev 9287)
@@ -18,6 +18,7 @@
import org.fudaa.dodico.crue.metier.emh.ResultatTimeKey;
import org.fudaa.dodico.crue.metier.helper.DonPrtHelper;
import org.fudaa.dodico.crue.metier.helper.EMHHelper;
+import org.fudaa.dodico.crue.metier.helper.ResPrtHelper;
import org.fudaa.dodico.crue.metier.transformer.TransformerEMHHelper;
import org.fudaa.dodico.crue.projet.report.ReportResultProviderServiceContrat;
import org.fudaa.dodico.crue.projet.report.data.ReportExpressionHelper;
@@ -140,6 +141,9 @@
@Override
public ReportVariableKey createVariableKey(String varName) {
+ if (ResPrtHelper.isRPTIVariable(varName)) {
+ return new ReportVariableKey(ReportVariableTypeEnum.RESULTAT_RPTI, varName);
+ }
if (reportFormuleService.isFormule(varName)) {
return new ReportVariableKey(ReportVariableTypeEnum.FORMULE, varName);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|