Go to most recent revision | Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 450 | blopes | 1 | package br.com.ec.controller; |
| 2 | |||
| 3 | import java.io.Serializable; |
||
| 4 | import java.util.Date; |
||
| 5 | import java.util.List; |
||
| 6 | |||
| 7 | import javax.inject.Inject; |
||
| 8 | import javax.inject.Named; |
||
| 9 | |||
| 10 | import org.apache.commons.httpclient.util.DateUtil; |
||
| 11 | import org.apache.commons.lang.time.DateUtils; |
||
| 12 | import org.springframework.context.annotation.Scope; |
||
| 13 | |||
| 14 | import br.com.ec.core.consulta.ParametrosConsulta; |
||
| 15 | import br.com.ec.core.generic.GenericService; |
||
| 16 | import br.com.ec.core.util.DataUtils; |
||
| 17 | import br.com.ec.domain.dto.AuditoriaVendaDTO; |
||
| 18 | import br.com.ec.domain.dto.LojaDTO; |
||
| 19 | import br.com.ec.domain.service.VendaService; |
||
| 20 | import br.com.ec.domain.shared.ConstantesSEC; |
||
| 21 | import br.com.ec.web.generic.AbstractBean; |
||
| 22 | import br.com.ec.web.util.DataUtil; |
||
| 23 | |||
| 24 | @Named |
||
| 25 | @Scope("view") |
||
| 26 | public class AuditoriaExternaBean extends AbstractBean<AuditoriaVendaDTO> implements Serializable { |
||
| 27 | |||
| 28 | private static final long serialVersionUID = 1L; |
||
| 29 | |||
| 30 | private VendaService vendaService; |
||
| 31 | |||
| 32 | private Date dataSelecionada; |
||
| 33 | private Long sequencialLojaSelecionada; |
||
| 34 | private List<AuditoriaVendaDTO> listaAuditoriaVendaDTO; |
||
| 35 | private List<LojaDTO> listaLojaDTO; |
||
| 36 | |||
| 37 | @Inject |
||
| 38 | public AuditoriaExternaBean(VendaService vendaService) { |
||
| 39 | this.vendaService = vendaService; |
||
| 40 | } |
||
| 41 | |||
| 42 | @Override |
||
| 43 | public void preCarregamento() { |
||
| 44 | entidade = new AuditoriaVendaDTO(); |
||
| 45 | parametrosConsulta = new ParametrosConsulta<AuditoriaVendaDTO>(); |
||
| 46 | parametrosConsulta.setEntidade(entidade); |
||
| 47 | setDataSelecionada(DataUtils.getDataAtual()); |
||
| 48 | } |
||
| 49 | |||
| 50 | @Override |
||
| 51 | public void limparEntidade() { |
||
| 52 | setEntidade(new AuditoriaVendaDTO()); |
||
| 53 | } |
||
| 54 | |||
| 55 | @Override |
||
| 56 | public GenericService<AuditoriaVendaDTO> getService() { |
||
| 57 | return null; |
||
| 58 | } |
||
| 59 | |||
| 60 | @Override |
||
| 61 | public AuditoriaVendaDTO getEntidade() { |
||
| 62 | return entidade; |
||
| 63 | } |
||
| 64 | |||
| 65 | @Override |
||
| 66 | public AuditoriaVendaDTO getId() { |
||
| 67 | return getEntidade(); |
||
| 68 | } |
||
| 69 | |||
| 70 | public Long getSequencialLojaSelecionada() { |
||
| 71 | return sequencialLojaSelecionada; |
||
| 72 | } |
||
| 73 | public void setSequencialLojaSelecionada(Long sequencialLojaSelecionada) { |
||
| 74 | this.sequencialLojaSelecionada = sequencialLojaSelecionada; |
||
| 75 | } |
||
| 76 | |||
| 77 | public Date getDataSelecionada() { |
||
| 78 | return dataSelecionada; |
||
| 79 | } |
||
| 80 | public void setDataSelecionada(Date dataSelecionada) { |
||
| 81 | this.dataSelecionada = dataSelecionada; |
||
| 82 | } |
||
| 83 | |||
| 84 | public List<AuditoriaVendaDTO> getListaAuditoriaVendaDTO() { |
||
| 85 | return listaAuditoriaVendaDTO; |
||
| 86 | } |
||
| 87 | public void setListaAuditoriaVendaDTO(List<AuditoriaVendaDTO> listaAuditoriaVendaDTO) { |
||
| 88 | this.listaAuditoriaVendaDTO = listaAuditoriaVendaDTO; |
||
| 89 | } |
||
| 90 | |||
| 91 | public List<LojaDTO> getListaLojaDTO() { |
||
| 92 | return listaLojaDTO; |
||
| 93 | } |
||
| 94 | public void setListaLojaDTO(List<LojaDTO> listaLojaDTO) { |
||
| 95 | this.listaLojaDTO = listaLojaDTO; |
||
| 96 | } |
||
| 97 | |||
| 98 | /***************************************************/ |
||
| 99 | |||
| 100 | public Long getSequencialLojaPatio() { |
||
| 101 | return ConstantesSEC.Loja.SEQUENCIAL_LOJA_PATIO_14; |
||
| 102 | } |
||
| 103 | |||
| 104 | public Long getSequencialQuiosquePatio() { |
||
| 105 | return ConstantesSEC.Loja.SEQUENCIAL_QUIOSQUE_PATIO_5; |
||
| 106 | } |
||
| 107 | |||
| 108 | public void consultarAuditoriaVenda() { |
||
| 109 | List<AuditoriaVendaDTO> lista = vendaService.consultarAuditoriaVenda(getDataSelecionada(), getSequencialLojaSelecionada()); |
||
| 110 | setListaAuditoriaVendaDTO(lista); |
||
| 111 | } |
||
| 112 | |||
| 113 | } |