Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 346 | espaco | 1 | package br.com.ec.controller; |
| 2 | |||
| 3 | import java.io.Serializable; |
||
| 4 | |||
| 5 | import javax.inject.Inject; |
||
| 6 | import javax.inject.Named; |
||
| 7 | |||
| 8 | import org.springframework.context.annotation.Scope; |
||
| 9 | |||
| 10 | import br.com.ec.core.exception.NegocioException; |
||
| 11 | import br.com.ec.core.generic.GenericService; |
||
| 12 | import br.com.ec.core.util.VerificadorUtil; |
||
| 13 | import br.com.ec.domain.dto.ExtratoEntregasDTO; |
||
| 14 | import br.com.ec.domain.service.PedidoService; |
||
| 15 | import br.com.ec.web.exception.VerificadorLancamentoException; |
||
| 16 | import br.com.ec.web.exception.VerificadorLancamentoException.CommandBean; |
||
| 17 | import br.com.ec.web.generic.AbstractBean; |
||
| 18 | |||
| 19 | @Named |
||
| 20 | @Scope("view") |
||
| 21 | public class ExtratoEntregasBean extends AbstractBean<ExtratoEntregasDTO> implements Serializable { |
||
| 22 | |||
| 23 | private static final long serialVersionUID = 1L; |
||
| 24 | |||
| 25 | private PedidoService pedidoService; |
||
| 26 | |||
| 27 | @Inject |
||
| 28 | public ExtratoEntregasBean(PedidoService pedidoService) { |
||
| 29 | this.pedidoService = pedidoService; |
||
| 30 | } |
||
| 31 | |||
| 32 | @Override |
||
| 33 | public GenericService<ExtratoEntregasDTO> getService() { |
||
| 34 | return null; |
||
| 35 | } |
||
| 36 | |||
| 37 | @Override |
||
| 38 | public ExtratoEntregasDTO getId() { |
||
| 39 | return null; |
||
| 40 | } |
||
| 41 | |||
| 42 | @Override |
||
| 43 | public void preCarregamento() { |
||
| 44 | limparEntidade(); |
||
| 45 | } |
||
| 46 | |||
| 47 | @Override |
||
| 48 | public void limparEntidade() { |
||
| 49 | setEntidade(new ExtratoEntregasDTO()); |
||
| 50 | } |
||
| 51 | |||
| 52 | /*******************************************/ |
||
| 53 | |||
| 54 | public void consultarExtratoEntregas() { |
||
| 55 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
||
| 56 | public void execute() { |
||
| 57 | if (VerificadorUtil.estaNulo(getEntidade().getVigenciaDTO())) { |
||
| 58 | throw new NegocioException("SELECIONE A VIGÊNCIA"); |
||
| 59 | } |
||
| 60 | setEntidade(pedidoService.consultarExtratoEntregas(getEntidade())); |
||
| 61 | } |
||
| 62 | }); |
||
| 63 | } |
||
| 64 | |||
| 65 | } |