Ignore:
Timestamp:
03/09/12 13:18:57 (12 years ago)
Author:
rboipsl
Message:

ajout realtime ecc ohp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ether_ndacc/trunk/service/implementation/com/ether/PlotServiceImpl.java

    r106 r405  
    6868                } 
    6969        } 
    70          
    71         @Transactional(readOnly = true)  
     70 
     71@Nullable 
     72        @Transactional(readOnly = true) 
     73        public List<String> getPlotsByDateByInstrumentByStationByType(@NotNull final String instrument, @NotNull String pdate, @NotNull String ft, @NotNull String station, @NotNull String type) 
     74                throws ServiceException 
     75        { 
     76                try { 
     77 
     78                        final DateFormat pFormatDate = new SimpleDateFormat(ft); 
     79                        String fdate; 
     80                        final String tt="yyyyMMdd"; 
     81                        if (ft.compareTo(tt) == 0) fdate="19700101"; 
     82                        else fdate = "1970"; 
     83 
     84                        if (pdate.compareTo(fdate) == 0 ) { 
     85                                final Date ldate = _plotDAO.getLastDateByInstrumentByStation(instrument,station); 
     86 
     87                                //ldate="20070101"; 
     88                                //ldate="20060101"; 
     89 
     90                                String s1="-", s2="", d1="01"; 
     91                                fdate=ldate.toString().replaceAll(s1,s2); 
     92 
     93                                s1=" 00:00:00.0"; 
     94                                fdate=fdate.replaceAll(s1,s2); 
     95                                fdate=fdate.substring(0,6); 
     96 
     97                                fdate=fdate.concat(d1); 
     98                                pdate=fdate; 
     99                        } 
     100                        else { 
     101                                fdate=pdate; 
     102                        } 
     103 
     104                        final Date pFormatDate_deb = pFormatDate.parse(fdate); 
     105                        Date pFormatDate_fin; 
     106                        if (ft.compareTo(tt) == 0) pFormatDate_fin = DateUtils.datesAddMonth(pFormatDate_deb,1); 
     107                        else pFormatDate_fin = DateUtils.datesAddYear(pFormatDate_deb,1); 
     108 
     109                        return _plotDAO.getPlotsByDateByInstrumentByStationByType(instrument, pFormatDate_deb, pFormatDate_fin, station, type); 
     110 
     111                } catch (ParseException e) { 
     112                        throw new ServiceException(ServiceException.ServiceCode.DATES_PARSE_ERROR, e); 
     113                } catch (PersistenceException e) { 
     114                        throw new ServiceException(ServiceException.ServiceCode.INSTRUMENT_ERROR, e); 
     115                } 
     116        } 
     117 
     118 
     119    @Transactional(readOnly = true) 
    72120        public List<String> getPlotsByDateByInstrument(@NotNull final String instrument, @NotNull String pdate, @NotNull String ft)  
    73121                throws ServiceException 
Note: See TracChangeset for help on using the changeset viewer.