branch feature/5923 updated (b2f3804 -> 237cadb)
This is an automated email from the git hooks/post-receive script. New change to branch feature/5923 in repository wao. See http://git.codelutin.com/wao.git from b2f3804 Dans la synthèse ObsMer on, montre le graphique du réalisé en jours de mers new 237cadb Suppression de code mort The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 237cadb462714e601e9ce75785b8035a7d8bebb3 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Feb 20 12:28:33 2015 +0100 Suppression de code mort Summary of changes: .../fr/ifremer/wao/entity/SampleRowTopiaDao.java | 51 ---------------------- 1 file changed, 51 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/5923 in repository wao. See http://git.codelutin.com/wao.git commit 237cadb462714e601e9ce75785b8035a7d8bebb3 Author: Brendan Le Ny <bleny@codelutin.com> Date: Fri Feb 20 12:28:33 2015 +0100 Suppression de code mort --- .../fr/ifremer/wao/entity/SampleRowTopiaDao.java | 51 ---------------------- 1 file changed, 51 deletions(-) diff --git a/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleRowTopiaDao.java b/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleRowTopiaDao.java index 892b4bd..8da79fa 100644 --- a/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleRowTopiaDao.java +++ b/wao-persistence/src/main/java/fr/ifremer/wao/entity/SampleRowTopiaDao.java @@ -21,7 +21,6 @@ package fr.ifremer.wao.entity; * #L% */ -import com.google.common.base.Function; import com.google.common.base.Optional; import com.google.common.collect.ImmutableMap; import fr.ifremer.wao.SampleRowsFilter; @@ -34,11 +33,7 @@ import org.nuiton.topia.persistence.TopiaEntity; import java.util.Calendar; import java.util.Date; -import java.util.HashMap; import java.util.List; -import java.util.Map; -import java.util.SortedMap; -import java.util.TreeMap; public class SampleRowTopiaDao extends AbstractSampleRowTopiaDao<SampleRow> { @@ -178,50 +173,4 @@ public class SampleRowTopiaDao extends AbstractSampleRowTopiaDao<SampleRow> { topiaHibernateSupport.getHibernateSession().evict(sampleRow); } - public SortedMap<Date, Integer> getExpectedObservationsByMonths(Date periodFromMonth, Date periodToMonth, SampleRowsFilter sampleRowFilter, Function<Date, Date> truncateToTimePeriodFunction) { - - HqlAndParametersBuilder<SampleRow> sampleRowsQuery = - toSampleRowHqlAndParametersBuilder(sampleRowFilter); - - ObsProgram obsProgram = sampleRowFilter.getObsProgram(); - String selectSumClause; - if (obsProgram.isObsMer() || obsProgram.isSclerochronology()) { - selectSumClause = "sum(sm.expectedTidesValue)"; - } else if (obsProgram.isObsVente()) { - selectSumClause = "sum(sm.expectedTidesValue * sr2.averageObservationsCount)"; - } else { - throw new UnsupportedOperationException(); - } - - String hql = "select sm.periodDate, " + selectSumClause + " " - + newFromClause("sr2") + " left join sr2.sampleMonth sm " - + "where sr2.topiaId in (select sr.topiaId " + sampleRowsQuery.getHql() + ") " - + " and sm.periodDate between :periodFromMonth2 and :periodToMonth2 " - + "group by sm.periodDate " - + "order by sm.periodDate"; - - Map<String, Object> hqlParameters = new HashMap<>(sampleRowsQuery.getHqlParameters()); - hqlParameters.put("periodFromMonth2", periodFromMonth); - hqlParameters.put("periodToMonth2", periodToMonth); - - if (log.isTraceEnabled()) { - log.trace("to compute expected tides value, will run query: " + hql + hqlParameters); - } - - List<Object[]> result = findAll(hql, hqlParameters); - - SortedMap<Date, Integer> expectedObservationsByMonths = new TreeMap<>(); - for (Object[] line : result) { - Date month = (Date) line[0]; - Date period = truncateToTimePeriodFunction.apply(month); - Integer expectedValue = expectedObservationsByMonths.get(period); - if (expectedValue == null) { - expectedValue = 0; - } - expectedValue += ((Long) line[1]).intValue(); - expectedObservationsByMonths.put(period, expectedValue); - } - - return expectedObservationsByMonths; - } } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm