Author: bleny Date: 2012-03-12 12:36:36 +0100 (Mon, 12 Mar 2012) New Revision: 1553 Url: http://forge.codelutin.com/repositories/revision/wao/1553 Log: Anomalie #960: Le forulaire de modification d'une ligne du plan d'?\195?\169chantillonnage sous ObsDeb est vide NPE pour les nouvelles lignes du plan sur ObsDeb suppression de code mort pour les nouvelles lignes Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java =================================================================== --- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java 2012-03-12 11:05:34 UTC (rev 1552) +++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceSamplingImpl.java 2012-03-12 11:36:36 UTC (rev 1553) @@ -99,7 +99,6 @@ import net.fortuna.ical4j.model.property.ProdId; import net.fortuna.ical4j.model.property.Uid; import net.fortuna.ical4j.model.property.Version; -import org.apache.commons.collections.CollectionUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateUtils; @@ -716,29 +715,10 @@ } } - // all rows must have a unique code, the code has a year as prefix - // like '2011_' so we must know on which year the row is active - - // the date from which year will be extracted (whatever the day of the year) - Date year; - - if (ObsProgram.OBSDEB.equals(newSampleRow.getObsProgram())) { - // this line has a precise day, let's take the - // year of this day - year = newSampleRow.getExpectedDate(); - } else { - if (CollectionUtils.isEmpty(newSampleRow.getSampleMonth())) { - // if the row has no sample months, we can't know - // we take current year by default - year = context.getCurrentDate(); - } else { - // if the row has sample months, take the first month - year = newSampleRow.getSampleMonth().get(0).getPeriodDate(); - } - } - - // now we have the year for prefix, let's get the whole new - // code (suffix depends on already used codes) + // On pré-définit un code pour la nouvelle ligne. + // au moment de la création d'une nouvelle ligne, on a aucune info donc + // on suppose que c'est pour l'année en cours + Date year = context.getCurrentDate(); String code = executeGetNewSampleRowCode(transaction, year); newSampleRow.setCode(code);
participants (1)
-
bleny@users.forge.codelutin.com