Rev 450 | Details | Compare with Previous | 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; |
||
| 452 | blopes | 21 | import br.com.ec.web.exception.VerificadorLancamentoException; |
| 22 | import br.com.ec.web.exception.VerificadorLancamentoException.CommandBean; |
||
| 450 | blopes | 23 | import br.com.ec.web.generic.AbstractBean; |
| 24 | import br.com.ec.web.util.DataUtil; |
||
| 25 | |||
| 26 | @Named |
||
| 27 | @Scope("view") |
||
| 28 | public class AuditoriaExternaBean extends AbstractBean<AuditoriaVendaDTO> implements Serializable { |
||
| 29 | |||
| 30 | private static final long serialVersionUID = 1L; |
||
| 31 | |||
| 32 | private VendaService vendaService; |
||
| 33 | |||
| 34 | private Date dataSelecionada; |
||
| 35 | private Long sequencialLojaSelecionada; |
||
| 36 | private List<AuditoriaVendaDTO> listaAuditoriaVendaDTO; |
||
| 37 | private List<LojaDTO> listaLojaDTO; |
||
| 38 | |||
| 39 | @Inject |
||
| 40 | public AuditoriaExternaBean(VendaService vendaService) { |
||
| 41 | this.vendaService = vendaService; |
||
| 42 | } |
||
| 43 | |||
| 44 | @Override |
||
| 45 | public void preCarregamento() { |
||
| 46 | entidade = new AuditoriaVendaDTO(); |
||
| 47 | parametrosConsulta = new ParametrosConsulta<AuditoriaVendaDTO>(); |
||
| 48 | parametrosConsulta.setEntidade(entidade); |
||
| 49 | setDataSelecionada(DataUtils.getDataAtual()); |
||
| 50 | } |
||
| 51 | |||
| 52 | @Override |
||
| 53 | public void limparEntidade() { |
||
| 54 | setEntidade(new AuditoriaVendaDTO()); |
||
| 55 | } |
||
| 56 | |||
| 57 | @Override |
||
| 58 | public GenericService<AuditoriaVendaDTO> getService() { |
||
| 59 | return null; |
||
| 60 | } |
||
| 61 | |||
| 62 | @Override |
||
| 63 | public AuditoriaVendaDTO getEntidade() { |
||
| 64 | return entidade; |
||
| 65 | } |
||
| 66 | |||
| 67 | @Override |
||
| 68 | public AuditoriaVendaDTO getId() { |
||
| 69 | return getEntidade(); |
||
| 70 | } |
||
| 71 | |||
| 72 | public Long getSequencialLojaSelecionada() { |
||
| 73 | return sequencialLojaSelecionada; |
||
| 74 | } |
||
| 75 | public void setSequencialLojaSelecionada(Long sequencialLojaSelecionada) { |
||
| 76 | this.sequencialLojaSelecionada = sequencialLojaSelecionada; |
||
| 77 | } |
||
| 78 | |||
| 79 | public Date getDataSelecionada() { |
||
| 80 | return dataSelecionada; |
||
| 81 | } |
||
| 82 | public void setDataSelecionada(Date dataSelecionada) { |
||
| 83 | this.dataSelecionada = dataSelecionada; |
||
| 84 | } |
||
| 85 | |||
| 86 | public List<AuditoriaVendaDTO> getListaAuditoriaVendaDTO() { |
||
| 87 | return listaAuditoriaVendaDTO; |
||
| 88 | } |
||
| 89 | public void setListaAuditoriaVendaDTO(List<AuditoriaVendaDTO> listaAuditoriaVendaDTO) { |
||
| 90 | this.listaAuditoriaVendaDTO = listaAuditoriaVendaDTO; |
||
| 91 | } |
||
| 92 | |||
| 93 | public List<LojaDTO> getListaLojaDTO() { |
||
| 94 | return listaLojaDTO; |
||
| 95 | } |
||
| 96 | public void setListaLojaDTO(List<LojaDTO> listaLojaDTO) { |
||
| 97 | this.listaLojaDTO = listaLojaDTO; |
||
| 98 | } |
||
| 99 | |||
| 100 | /***************************************************/ |
||
| 101 | |||
| 102 | public Long getSequencialLojaPatio() { |
||
| 103 | return ConstantesSEC.Loja.SEQUENCIAL_LOJA_PATIO_14; |
||
| 104 | } |
||
| 105 | |||
| 106 | public Long getSequencialQuiosquePatio() { |
||
| 107 | return ConstantesSEC.Loja.SEQUENCIAL_QUIOSQUE_PATIO_5; |
||
| 108 | } |
||
| 109 | |||
| 110 | public void consultarAuditoriaVenda() { |
||
| 452 | blopes | 111 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
| 112 | public void execute() { |
||
| 113 | setListaAuditoriaVendaDTO(vendaService.consultarAuditoriaVenda(getDataSelecionada(), getSequencialLojaSelecionada())); |
||
| 114 | } |
||
| 115 | }); |
||
| 116 | |||
| 450 | blopes | 117 | } |
| 118 | |||
| 119 | } |