Go to most recent revision | Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 523 | blopes | 1 | package br.com.ec.controller; |
| 2 | |||
| 3 | import java.io.Serializable; |
||
| 4 | import java.util.List; |
||
| 5 | |||
| 6 | import javax.annotation.PostConstruct; |
||
| 7 | import javax.inject.Inject; |
||
| 8 | import javax.inject.Named; |
||
| 9 | |||
| 10 | import org.springframework.context.annotation.Scope; |
||
| 11 | |||
| 12 | import br.com.ec.core.generic.GenericService; |
||
| 13 | import br.com.ec.domain.dto.ConsolidacoesDTO; |
||
| 14 | import br.com.ec.domain.dto.VigenciaDTO; |
||
| 15 | import br.com.ec.domain.model.tipos.TipoProduto; |
||
| 16 | import br.com.ec.domain.service.TransferenciaService; |
||
| 17 | import br.com.ec.domain.service.VigenciaService; |
||
| 18 | import br.com.ec.web.exception.VerificadorLancamentoException; |
||
| 19 | import br.com.ec.web.exception.VerificadorLancamentoException.CommandBean; |
||
| 20 | import br.com.ec.web.generic.AbstractBean; |
||
| 21 | import br.com.ec.web.message.LancadorMensagem; |
||
| 22 | |||
| 23 | @Named |
||
| 24 | @Scope("view") |
||
| 25 | public class ConsolidacoesBean extends AbstractBean<ConsolidacoesDTO> implements Serializable { |
||
| 26 | |||
| 27 | private static final long serialVersionUID = 1L; |
||
| 28 | |||
| 29 | private List<VigenciaDTO> vigenciasDTO; |
||
| 30 | |||
| 31 | private VigenciaService vigenciaService; |
||
| 32 | |||
| 33 | @Inject |
||
| 34 | public ConsolidacoesBean(VigenciaService vigenciaService) { |
||
| 35 | this.vigenciaService = vigenciaService; |
||
| 36 | } |
||
| 37 | |||
| 38 | @Override |
||
| 39 | public GenericService<ConsolidacoesDTO> getService() { |
||
| 40 | return null; |
||
| 41 | } |
||
| 42 | |||
| 43 | @Override |
||
| 44 | public ConsolidacoesDTO getId() { |
||
| 45 | return null; |
||
| 46 | } |
||
| 47 | |||
| 48 | @Override |
||
| 49 | public void preCarregamento() { |
||
| 50 | limparEntidade(); |
||
| 51 | } |
||
| 52 | |||
| 53 | @Override |
||
| 54 | public void limparEntidade() { |
||
| 55 | setEntidade(new ConsolidacoesDTO()); |
||
| 56 | } |
||
| 57 | |||
| 58 | public List<VigenciaDTO> getVigenciasDTO() { |
||
| 59 | return vigenciasDTO; |
||
| 60 | } |
||
| 61 | public void setVigenciasDTO(List<VigenciaDTO> vigenciasDTO) { |
||
| 62 | this.vigenciasDTO = vigenciasDTO; |
||
| 63 | } |
||
| 64 | |||
| 65 | /**************************************************/ |
||
| 66 | |||
| 67 | @PostConstruct |
||
| 68 | private void iniciarConsolidacoes() { |
||
| 69 | setVigenciasDTO(vigenciaService.consultarVigenciasParaConsolidacao()); |
||
| 70 | setEntidade(new ConsolidacoesDTO()); |
||
| 71 | } |
||
| 72 | |||
| 73 | /**************************************************/ |
||
| 74 | |||
| 75 | public void consolidarEstoque() { |
||
| 76 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
||
| 77 | public void execute() { |
||
| 78 | LancadorMensagem.lancarSucesso("ESTOQUE CONSOLIDADO COM SUCESSO"); |
||
| 79 | } |
||
| 80 | }); |
||
| 81 | } |
||
| 82 | |||
| 83 | } |