Rev 537 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 537 | Rev 538 | ||
|---|---|---|---|
| Line 7... | Line 7... | ||
| 7 | import javax.inject.Named; |
7 | import javax.inject.Named; |
| 8 | 8 | ||
| 9 | import org.springframework.context.annotation.Scope; |
9 | import org.springframework.context.annotation.Scope; |
| 10 | 10 | ||
| 11 | import br.com.ec.core.generic.GenericService; |
11 | import br.com.ec.core.generic.GenericService; |
| - | 12 | import br.com.ec.core.util.VerificadorUtil; |
|
| 12 | import br.com.ec.domain.dto.EstoqueAuditoriaDTO; |
13 | import br.com.ec.domain.dto.EstoqueAuditoriaDTO; |
| 13 | import br.com.ec.domain.dto.LojaDTO; |
14 | import br.com.ec.domain.dto.LojaDTO; |
| 14 | import br.com.ec.domain.dto.ProdutoDTO; |
15 | import br.com.ec.domain.dto.ProdutoDTO; |
| 15 | import br.com.ec.domain.dto.UsuarioDTO; |
16 | import br.com.ec.domain.dto.UsuarioDTO; |
| 16 | import br.com.ec.domain.model.EstoqueAuditoria; |
17 | import br.com.ec.domain.model.EstoqueAuditoria; |
| Line 62... | Line 63... | ||
| 62 | @Override |
63 | @Override |
| 63 | public void preCarregamento() { |
64 | public void preCarregamento() { |
| 64 | // parametrosConsultaEstampaDTO = new ParametrosConsultaEstampaDTO();
|
65 | // parametrosConsultaEstampaDTO = new ParametrosConsultaEstampaDTO();
|
| 65 | // prepararConsultaDemanda();
|
66 | // prepararConsultaDemanda();
|
| 66 | limparEntidade(); |
67 | limparEntidade(); |
| 67 | setAuditorias(estoqueAuditoriaService.consultarUltimasProducoes(50)); |
- | |
| 68 | }
|
68 | }
|
| 69 | 69 | ||
| 70 | @Override |
70 | @Override |
| 71 | public void limparEntidade() { |
71 | public void limparEntidade() { |
| 72 | setEntidade(new EstoqueAuditoria()); |
72 | setEntidade(new EstoqueAuditoria()); |
| Line 116... | Line 116... | ||
| 116 | public void setQuantidadeParaProduzir(Integer quantidadeParaProduzir) { |
116 | public void setQuantidadeParaProduzir(Integer quantidadeParaProduzir) { |
| 117 | this.quantidadeParaProduzir = quantidadeParaProduzir; |
117 | this.quantidadeParaProduzir = quantidadeParaProduzir; |
| 118 | }
|
118 | }
|
| 119 | 119 | ||
| 120 | public List<EstoqueAuditoriaDTO> getAuditorias() { |
120 | public List<EstoqueAuditoriaDTO> getAuditorias() { |
| - | 121 | if (VerificadorUtil.estaNulo(auditorias)) { |
|
| - | 122 | setAuditorias(estoqueAuditoriaService.consultarUltimasProducoes(50)); |
|
| - | 123 | }
|
|
| 121 | return auditorias; |
124 | return auditorias; |
| 122 | }
|
125 | }
|
| 123 | public void setAuditorias(List<EstoqueAuditoriaDTO> auditorias) { |
126 | public void setAuditorias(List<EstoqueAuditoriaDTO> auditorias) { |
| 124 | this.auditorias = auditorias; |
127 | this.auditorias = auditorias; |
| 125 | }
|
128 | }
|
| Line 148... | Line 151... | ||
| 148 | LojaDTO lojaMatriz = new LojaDTO(ConstantesSEC.Loja.SEQUENCIAL_MATRIZ_ESTOQUE_9); |
151 | LojaDTO lojaMatriz = new LojaDTO(ConstantesSEC.Loja.SEQUENCIAL_MATRIZ_ESTOQUE_9); |
| 149 | // verificarSeTemPerfilVendedorOuSuperior(getUsuarioParaContagemDTO());
|
152 | // verificarSeTemPerfilVendedorOuSuperior(getUsuarioParaContagemDTO());
|
| 150 | produtoService.realizarProducao(lojaMatriz, getProdutoParaProduzir(), getProdutoProduzido(), getQuantidadeParaProduzir(), |
153 | produtoService.realizarProducao(lojaMatriz, getProdutoParaProduzir(), getProdutoProduzido(), getQuantidadeParaProduzir(), |
| 151 | getUsuarioParaContagemDTO()); |
154 | getUsuarioParaContagemDTO()); |
| 152 | limparEntidade(); |
155 | limparEntidade(); |
| - | 156 | setAuditorias(estoqueAuditoriaService.consultarUltimasProducoes(50)); |
|
| 153 | LancadorMensagem.lancarSucesso("PRODUÇÃO REALIZADA COM SUCESSO"); |
157 | LancadorMensagem.lancarSucesso("PRODUÇÃO REALIZADA COM SUCESSO"); |
| 154 | }
|
158 | }
|
| 155 | }); |
159 | }); |
| 156 | }
|
160 | }
|
| - | 161 | ||
| - | 162 | public void excluirAuditoria(final Long sequencialAuditoria) { |
|
| - | 163 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
|
| - | 164 | public void execute() { |
|
| - | 165 | estoqueAuditoriaService.excluirAuditoria(sequencialAuditoria); |
|
| - | 166 | setAuditorias(estoqueAuditoriaService.consultarUltimasProducoes(50)); |
|
| - | 167 | adicionandoParametroArgsConfirmandoAcao(true); |
|
| - | 168 | LancadorMensagem.lancarSucesso("AUDITORIA EXCLUÍDA COM SUCESSO"); |
|
| - | 169 | }
|
|
| - | 170 | }); |
|
| - | 171 | }
|
|
| 157 | 172 | ||
| 158 | }
|
173 | }
|