Le document suivant contient les résultats de l'inspection CPD CPD 5.5.1.
Fichier | Ligne |
---|---|
fr/paris/lutece/plugins/stock/modules/tickets/business/ProductStatisticDAO.java | 174 |
fr/paris/lutece/plugins/stock/modules/tickets/business/PurchaseStatisticDAO.java | 168 |
requeteSQL.append( ", product_statistic.year" ); Query query = getEM( ).createNativeQuery( requeteSQL.toString( ) ); List<Object> listeResultat = query.getResultList( ); List<ResultStatistic> listeResultStatistic = new ArrayList<ResultStatistic>( ); if ( listeResultat.size( ) > 0 ) { for ( Object ligneResultat : listeResultat ) { Object [ ] listeAttributs = (Object [ ]) ligneResultat; if ( ( listeAttributs [0] != null ) && ( listeAttributs [1] != null ) && ( listeAttributs [2] != null ) ) { ResultStatistic resultStatistic = new ResultStatistic( ); resultStatistic.setNumberResponse( Integer.decode( listeAttributs [0].toString( ) ) ); Calendar calendar = new GregorianCalendar( ); int nTimesUnit; if ( strTimesUnit.equals( "0" ) ) { nTimesUnit = Calendar.DAY_OF_YEAR; } else if ( strTimesUnit.equals( "1" ) ) { nTimesUnit = Calendar.WEEK_OF_YEAR; } else { nTimesUnit = Calendar.MONTH; } calendar.set( nTimesUnit, Integer.decode( listeAttributs [1].toString( ) ) ); calendar.set( Calendar.YEAR, Integer.decode( listeAttributs [2].toString( ) ) ); resultStatistic.setStatisticDate( new Timestamp( calendar.getTimeInMillis( ) ) ); listeResultStatistic.add( resultStatistic ); } } } return listeResultStatistic; } /** * {@inheritDoc} */ public Integer getCountProductsByDates( String strDateDebut, String strDateFin ) |
Fichier | Ligne |
---|---|
fr/paris/lutece/plugins/stock/modules/tickets/business/ProductStatistic.java | 126 |
fr/paris/lutece/plugins/stock/modules/tickets/business/PurchaseStatistic.java | 124 |
} /** * Return the product_statistic dayOfYear * * @return the dayOfYear */ @Column( name = "dayOfYear" ) public Integer getDayOfYear( ) { return _nDayOfYear; } /** * Set the product_statistic dayOfYear * * @param dayOfYear * the product_statistic dayOfYear */ public void setDayOfYear( Integer dayOfYear ) { _nDayOfYear = dayOfYear; } /** * Set the product_statistic week * * @param week * the product_statistic week */ public void setWeek( Integer week ) { _nWeek = week; } /** * Return the product_statistic week * * @return the week */ @Column( name = "week" ) public Integer getWeek( ) { return _nWeek; } /** * Set the product_statistic month * * @param month * the product_statistic month */ public void setMonth( Integer month ) { _nMonth = month; } /** * Return the product_statistic month * * @return the month */ @Column( name = "month" ) public Integer getMonth( ) { return _nMonth; } /** * Set the product_statistic year * * @param year * the product_statistic year */ public void setYear( Integer year ) { _nYear = year; } /** * Return the product_statistic year * * @return the year */ @Column( name = "year" ) public Integer getYear( ) { return _nYear; } /** * Set the product_statistic date * * @param date * the product_statistic date */ public void setDate( Timestamp date ) { _tDate = date; } /** * Return the product_statistic date * * @return the date */ @Column( name = "date" ) public Timestamp getDate( ) { return _tDate; } /** * Return the product * * @return the product */ @ManyToOne( fetch = FetchType.LAZY ) |
Fichier | Ligne |
---|---|
fr/paris/lutece/plugins/stock/modules/tickets/business/ShowDAO.java | 164 |
fr/paris/lutece/plugins/stock/modules/tickets/business/ShowDAO.java | 202 |
public List<Product> getCurrentProduct( List<String> orderList, PaginationProperties paginator ) { EntityManager em = getEM( ); CriteriaBuilder cb = em.getCriteriaBuilder( ); CriteriaQuery<Product> cq = cb.createQuery( Product.class ); Root<Product> root = cq.from( Product.class ); // predicates list List<Predicate> listPredicates = new ArrayList<Predicate>( ); // date end after current date Calendar calendar = new GregorianCalendar( ); calendar.set( GregorianCalendar.HOUR_OF_DAY, 23 ); calendar.set( GregorianCalendar.MINUTE, 59 ); calendar.set( GregorianCalendar.SECOND, 59 ); Join<Product, ProductAttributeDate> join = root.join( Product_.attributeDateList ); |
Fichier | Ligne |
---|---|
fr/paris/lutece/plugins/stock/modules/tickets/business/SeanceDAO.java | 191 |
fr/paris/lutece/plugins/stock/modules/tickets/business/SeanceDAO.java | 227 |
if ( ( offerId != null ) && ( offerId > 0 ) ) { listPredicates.add( cb.equal( product.get( Product_.id ), offerId ) ); } // Status not defined listPredicates.add( cb.or( cb.isNull( root.get( Offer_.statut ) ), cb.equal( root.get( Offer_.statut ), "" ) ) ); cq.where( listPredicates.toArray( new Predicate [ 0] ) ); return em.createQuery( cq ).getResultList( ); } |
Fichier | Ligne |
---|---|
fr/paris/lutece/plugins/stock/modules/tickets/business/ReservationFilter.java | 46 |
fr/paris/lutece/plugins/stock/modules/tickets/business/SeanceFilter.java | 46 |
{ private Timestamp _dateBegin; private Timestamp _dateEnd; private Timestamp _dateOr; private Timestamp _hour; /** * @param hour * the hour to set */ public void setHour( Timestamp hour ) { this._hour = hour; } /** * @return the hour */ public Timestamp getHour( ) { return _hour; } /** * Gets the date begin. * * @return the date begin */ public Timestamp getDateBegin( ) { return _dateBegin; } /** * Sets the date begin. * * @param dateBegin * the new date begin */ public void setDateBegin( Timestamp dateBegin ) { _dateBegin = dateBegin; } /** * Gets the date end. * * @return the date end */ public Timestamp getDateEnd( ) { return _dateEnd; } /** * Sets the date end. * * @param dateEnd * the new date end */ public void setDateEnd( Timestamp dateEnd ) { _dateEnd = dateEnd; } /** * Gets the date or. * * @return the date or */ public Timestamp getDateOr( ) { return _dateOr; } /** * Sets the date or. * * @param dateOr * the new date or */ public void setDateOr( Timestamp dateOr ) { _dateOr = dateOr; } } |