Rev 182 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | espaco | 1 | package br.com.ec.controller.managedbean; |
| 2 | |||
| 3 | import java.io.IOException; |
||
| 4 | import java.io.Serializable; |
||
| 5 | import java.util.ArrayList; |
||
| 6 | import java.util.Arrays; |
||
| 7 | import java.util.List; |
||
| 8 | |||
| 9 | import javax.faces.context.FacesContext; |
||
| 10 | import javax.inject.Inject; |
||
| 11 | import javax.inject.Named; |
||
| 12 | |||
| 13 | import org.primefaces.PrimeFaces; |
||
| 14 | import org.springframework.context.annotation.Scope; |
||
| 15 | |||
| 16 | import br.com.ec.controller.managedbean.consultademanda.NotaFiscalConsultaPorDemanda; |
||
| 17 | import br.com.ec.domain.dto.ParametrosConsultaNotaFiscalDTO; |
||
| 18 | import br.com.ec.domain.dto.ParametrosConsultaProdutoDTO; |
||
| 19 | import br.com.ec.domain.dto.nfce.NotaFiscalRemessaDTO; |
||
| 20 | import br.com.ec.domain.model.Fornecedor; |
||
| 21 | import br.com.ec.domain.model.Loja; |
||
| 22 | import br.com.ec.domain.model.NotaFiscal; |
||
| 23 | import br.com.ec.domain.model.NotaFiscalProduto; |
||
| 24 | import br.com.ec.domain.model.Pessoa; |
||
| 25 | import br.com.ec.domain.model.Produto; |
||
| 26 | import br.com.ec.domain.model.ProdutoLoja; |
||
| 27 | import br.com.ec.domain.model.tipos.TipoModeloNotaFiscal; |
||
| 28 | import br.com.ec.domain.model.tipos.TipoNotaFiscal; |
||
| 29 | import br.com.ec.domain.model.tipos.TipoRelatorio; |
||
| 30 | import br.com.ec.domain.service.emissor.notafiscal.EmissorNotaFiscalEletronicaService; |
||
| 31 | import br.com.ec.domain.service.notafiscal.NotaFiscalProdutoService; |
||
| 32 | import br.com.ec.domain.service.notafiscal.NotaFiscalService; |
||
| 33 | import br.com.ec.domain.service.pessoa.PessoaService; |
||
| 34 | import br.com.ec.domain.service.produto.ProdutoService; |
||
| 35 | import br.com.ec.domain.service.produtodaloja.ProdutoLojaService; |
||
| 36 | import br.edu.cesmac.core.generic.GenericService; |
||
| 37 | import br.edu.cesmac.core.util.DataUtils; |
||
| 38 | import br.edu.cesmac.core.util.VerificadorUtil; |
||
| 39 | import br.edu.cesmac.web.exception.VerificadorLancamentoException; |
||
| 40 | import br.edu.cesmac.web.exception.VerificadorLancamentoException.CommandBean; |
||
| 41 | import br.edu.cesmac.web.generic.AbstractBean; |
||
| 42 | import br.edu.cesmac.web.message.LancadorMensagem; |
||
| 43 | |||
| 44 | @Named |
||
| 45 | @Scope("view") |
||
| 46 | public class NotaFiscalBean extends AbstractBean<NotaFiscal> implements Serializable { |
||
| 47 | |||
| 48 | private static final long serialVersionUID = 1L; |
||
| 49 | |||
| 50 | private NotaFiscalService notaFiscalService; |
||
| 51 | private ProdutoService produtoService; |
||
| 52 | private NotaFiscalProdutoService notaFiscalProdutoService; |
||
| 53 | private EmissorNotaFiscalEletronicaService emissorNotaFiscalEletronicaService; |
||
| 54 | private PessoaService pessoaService; |
||
| 55 | private ProdutoLojaService produtoLojaService; |
||
| 56 | |||
| 57 | private String codigoProdutoRemessa; |
||
| 58 | private Produto produtoSelecionado; |
||
| 59 | private Integer quantidadeProdutoSelecionado; |
||
| 60 | private NotaFiscalRemessaDTO notaFiscalRemessa; |
||
| 61 | |||
| 62 | private Fornecedor fornecedorParaRemessa; |
||
| 63 | private Loja lojaParaRemessa; |
||
| 64 | |||
| 65 | private NotaFiscalConsultaPorDemanda lazy; |
||
| 66 | |||
| 67 | @Inject |
||
| 68 | public NotaFiscalBean(NotaFiscalService notaFiscalService, ProdutoService produtoService, NotaFiscalProdutoService notaFiscalProdutoService, |
||
| 69 | EmissorNotaFiscalEletronicaService emissorNotaFiscalEletronicaService, PessoaService pessoaService, NotaFiscalConsultaPorDemanda lazy, |
||
| 70 | ProdutoLojaService produtoLojaService) { |
||
| 71 | this.notaFiscalService = notaFiscalService; |
||
| 72 | this.produtoService = produtoService; |
||
| 73 | this.notaFiscalProdutoService = notaFiscalProdutoService; |
||
| 74 | this.emissorNotaFiscalEletronicaService = emissorNotaFiscalEletronicaService; |
||
| 75 | this.pessoaService = pessoaService; |
||
| 76 | this.lazy = lazy; |
||
| 77 | this.produtoLojaService = produtoLojaService; |
||
| 78 | } |
||
| 79 | |||
| 80 | @Override |
||
| 81 | public void preCarregamento() { |
||
| 82 | entidade = new NotaFiscal(); |
||
| 83 | parametrosConsulta = new ParametrosConsultaNotaFiscalDTO(); |
||
| 84 | parametrosConsulta.setEntidade(entidade); |
||
| 85 | } |
||
| 86 | |||
| 87 | @Override |
||
| 88 | public void limparEntidade() { |
||
| 89 | setEntidade(new NotaFiscal()); |
||
| 90 | } |
||
| 91 | |||
| 92 | @Override |
||
| 93 | public GenericService<NotaFiscal> getService() { |
||
| 94 | return notaFiscalService; |
||
| 95 | } |
||
| 96 | |||
| 97 | @Override |
||
| 98 | public NotaFiscal getEntidade() { |
||
| 99 | return entidade; |
||
| 100 | } |
||
| 101 | |||
| 102 | @Override |
||
| 103 | public NotaFiscal getId() { |
||
| 104 | return getEntidade(); |
||
| 105 | } |
||
| 106 | |||
| 107 | public String getCodigoProdutoRemessa() { |
||
| 108 | return codigoProdutoRemessa; |
||
| 109 | } |
||
| 110 | public void setCodigoProdutoRemessa(String codigoProdutoRemessa) { |
||
| 111 | this.codigoProdutoRemessa = codigoProdutoRemessa; |
||
| 112 | } |
||
| 113 | |||
| 114 | public Produto getProdutoSelecionado() { |
||
| 115 | return produtoSelecionado; |
||
| 116 | } |
||
| 117 | public void setProdutoSelecionado(Produto produtoSelecionado) { |
||
| 118 | this.produtoSelecionado = produtoSelecionado; |
||
| 119 | } |
||
| 120 | |||
| 121 | public Integer getQuantidadeProdutoSelecionado() { |
||
| 122 | return quantidadeProdutoSelecionado; |
||
| 123 | } |
||
| 124 | public void setQuantidadeProdutoSelecionado(Integer quantidadeProdutoSelecionado) { |
||
| 125 | this.quantidadeProdutoSelecionado = quantidadeProdutoSelecionado; |
||
| 126 | } |
||
| 127 | |||
| 128 | public NotaFiscalRemessaDTO getNotaFiscalRemessa() { |
||
| 129 | return notaFiscalRemessa; |
||
| 130 | } |
||
| 131 | public void setNotaFiscalRemessa(NotaFiscalRemessaDTO notaFiscalRemessa) { |
||
| 132 | this.notaFiscalRemessa = notaFiscalRemessa; |
||
| 133 | } |
||
| 134 | |||
| 135 | public Fornecedor getFornecedorParaRemessa() { |
||
| 136 | return fornecedorParaRemessa; |
||
| 137 | } |
||
| 138 | public void setFornecedorParaRemessa(Fornecedor fornecedorParaRemessa) { |
||
| 139 | this.fornecedorParaRemessa = fornecedorParaRemessa; |
||
| 140 | } |
||
| 141 | |||
| 142 | public Loja getLojaParaRemessa() { |
||
| 143 | return lojaParaRemessa; |
||
| 144 | } |
||
| 145 | public void setLojaParaRemessa(Loja lojaParaRemessa) { |
||
| 146 | this.lojaParaRemessa = lojaParaRemessa; |
||
| 147 | } |
||
| 148 | |||
| 149 | public NotaFiscalConsultaPorDemanda getLazy() { |
||
| 150 | prepararConsultaDemanda(); |
||
| 151 | return lazy; |
||
| 152 | } |
||
| 153 | public void setLazy(NotaFiscalConsultaPorDemanda lazy) { |
||
| 154 | this.lazy = lazy; |
||
| 155 | } |
||
| 156 | public void prepararConsultaDemanda() { |
||
| 157 | lazy.setarParametrosConsulta(getParametrosConsulta()); |
||
| 158 | } |
||
| 159 | |||
| 160 | public TipoNotaFiscal[] getTiposNotaFiscal() { |
||
| 161 | return TipoNotaFiscal.values(); |
||
| 162 | } |
||
| 163 | |||
| 164 | public void prepararParaCadastrarNFeRemessa() { |
||
| 165 | setNotaFiscalRemessa(new NotaFiscalRemessaDTO()); |
||
| 166 | preRealizar(); |
||
| 167 | } |
||
| 168 | |||
| 169 | /***************************************************************/ |
||
| 170 | |||
| 171 | @Override |
||
| 172 | public void cadastrar(final NotaFiscal notaFiscal) { |
||
| 173 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
||
| 174 | public void execute() { |
||
| 175 | notaFiscal.setDataHoraEmissao(DataUtils.getDataAtual()); |
||
| 176 | notaFiscal.setTipoNotaFiscal(TipoNotaFiscal.NFCE_EMITIDA.getValor()); |
||
| 177 | notaFiscal.setTipoModeloNotaFiscal(TipoModeloNotaFiscal.MODELO_NFCE_65.getValor()); |
||
| 178 | getService().cadastrar(notaFiscal); |
||
| 179 | limparEntidade(); |
||
| 180 | LancadorMensagem.lancarSucesso(getMensagens().get(IDENTIFICADOR_MENSAGEM_CADASTRADO_COM_SUCESSO)); |
||
| 181 | } |
||
| 182 | }); |
||
| 183 | } |
||
| 184 | |||
| 185 | @Override |
||
| 186 | public void excluir(final NotaFiscal notaFiscal) { |
||
| 187 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
||
| 188 | public void execute() { |
||
| 189 | getService().excluir(notaFiscal); |
||
| 190 | limparEntidade(); |
||
| 191 | LancadorMensagem.lancarSucesso(getMensagens().get(IDENTIFICADOR_MENSAGEM_EXCLUIDO_COM_SUCESSO)); |
||
| 192 | } |
||
| 193 | }); |
||
| 194 | } |
||
| 195 | |||
| 196 | public void cancelarNotaFiscal(final NotaFiscal notaFiscal) { |
||
| 197 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
||
| 198 | public void execute() { |
||
| 199 | LancadorMensagem.lancarSucesso("OPERAÇÃO NÃO IMPLEMENTADA"); |
||
| 200 | // notaFiscalService.cancelarNFCe(notaFiscal); |
||
| 201 | // LancadorMensagem.lancarSucesso("NOTA FISCAL CANCELADA COM SUCESSO"); |
||
| 202 | } |
||
| 203 | }); |
||
| 204 | } |
||
| 205 | |||
| 206 | public void detalharNotaFiscal(NotaFiscal notaFiscal) { |
||
| 207 | setEntidade(notaFiscalService.detalhar(notaFiscal)); |
||
| 208 | getEntidade().setListaNFRemessaProdutos(notaFiscalProdutoService.consultarProdutosDaNotaFiscal(getEntidade())); |
||
| 209 | } |
||
| 210 | |||
| 211 | public void iniciarNfeRemessa() { |
||
| 212 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
||
| 213 | public void execute() { |
||
| 214 | NotaFiscal notaFiscal = new NotaFiscal(); |
||
| 215 | notaFiscal.setTipoModeloNotaFiscal(TipoModeloNotaFiscal.MODELO_NFE_55.getValor()); |
||
| 216 | notaFiscal.setTipoNotaFiscal(TipoNotaFiscal.NFE_REMESSA.getValor()); |
||
| 217 | notaFiscal.setSerie(TipoNotaFiscal.NFE_REMESSA.getSerie()); |
||
| 218 | notaFiscal.setDataHoraEmissao(DataUtils.getDataAtual()); |
||
| 219 | notaFiscal.setPessoaJuridicaEmitente(getNotaFiscalRemessa().getLojaEmitente().getPessoaJuridica()); |
||
| 220 | notaFiscal.setPessoaJuridicaDestinatario(getNotaFiscalRemessa().getLojaDestino().getPessoaJuridica()); |
||
| 221 | notaFiscalService.alterar(notaFiscal); |
||
| 222 | getNotaFiscalRemessa().preencherDadosNotaFiscal(notaFiscal); |
||
| 223 | getNotaFiscalRemessa().setPessoaJuridicaEmitente(getNotaFiscalRemessa().getLojaEmitente().getPessoaJuridica()); |
||
| 224 | getNotaFiscalRemessa().setPessoaJuridicaDestinatario(getNotaFiscalRemessa().getLojaDestino().getPessoaJuridica()); |
||
| 225 | setCodigoProdutoRemessa(null); |
||
| 226 | LancadorMensagem.lancarSucesso("REMESSA INICIADA COM SUCESSO"); |
||
| 227 | } |
||
| 228 | }); |
||
| 229 | } |
||
| 230 | |||
| 231 | public void consultarNfeRemessa(final NotaFiscal nf) { |
||
| 232 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
||
| 233 | public void execute() { |
||
| 234 | preRealizar(); |
||
| 235 | setEntidade(notaFiscalService.detalhar(nf)); |
||
| 236 | getEntidade().setListaNFRemessaProdutos(notaFiscalProdutoService.consultarProdutosDaNotaFiscal(getEntidade())); |
||
| 237 | setNotaFiscalRemessa(new NotaFiscalRemessaDTO()); |
||
| 238 | getNotaFiscalRemessa().preencherDadosNotaFiscal(getEntidade()); |
||
| 239 | } |
||
| 240 | }); |
||
| 241 | } |
||
| 242 | |||
| 243 | public void escolherProduto() { |
||
| 244 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
||
| 245 | public void execute() { |
||
| 246 | Produto produtoConsultado = produtoService.consultarProdutoPorCodigoOuCodigoEAN(getCodigoProdutoRemessa()); |
||
| 247 | if (VerificadorUtil.estaNulo(produtoConsultado)) { |
||
| 248 | LancadorMensagem.lancarErro("Produto não encontrado!"); |
||
| 249 | } else { |
||
| 250 | setProdutoSelecionado(produtoConsultado); |
||
| 251 | setQuantidadeProdutoSelecionado(1); |
||
| 252 | PrimeFaces.current().ajax().addCallbackParam("confirmado", true); |
||
| 253 | } |
||
| 254 | } |
||
| 255 | }); |
||
| 256 | } |
||
| 257 | |||
| 258 | public void escolherProduto(Produto produto) { |
||
| 259 | setProdutoSelecionado(produto); |
||
| 260 | setQuantidadeProdutoSelecionado(1); |
||
| 261 | } |
||
| 262 | |||
| 263 | public void adicionarProduto() { |
||
| 264 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
||
| 265 | public void execute() { |
||
| 266 | NotaFiscalProduto notaFiscalRemessaProduto = new NotaFiscalProduto(); |
||
| 267 | notaFiscalRemessaProduto.setProduto(getProdutoSelecionado()); |
||
| 268 | notaFiscalRemessaProduto.setQuantidade(getQuantidadeProdutoSelecionado()); |
||
| 269 | notaFiscalRemessaProduto.setNotaFiscal(notaFiscalService.consultarPorId(getNotaFiscalRemessa().getNotaFiscal())); |
||
| 270 | notaFiscalProdutoService.cadastrar(notaFiscalRemessaProduto); |
||
| 271 | // verificarParametros(notaFiscalRemessaProduto); |
||
| 272 | consultarNfeRemessa(getNotaFiscalRemessa().getNotaFiscal()); |
||
| 273 | setCodigoProdutoRemessa(null); |
||
| 274 | LancadorMensagem.lancarSucesso("Produto adicionado, código: " + getProdutoSelecionado().getCodigoProdutoPadrao()); |
||
| 275 | } |
||
| 276 | }); |
||
| 277 | } |
||
| 278 | |||
| 279 | public void removerProduto(final NotaFiscalProduto notaFiscalProduto) { |
||
| 280 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
||
| 281 | public void execute() { |
||
| 282 | notaFiscalProdutoService.excluir(notaFiscalProduto); |
||
| 283 | consultarNfeRemessa(notaFiscalProduto.getNotaFiscal()); |
||
| 284 | LancadorMensagem.lancarSucesso("Produto removido com sucesso"); |
||
| 285 | } |
||
| 286 | }); |
||
| 287 | } |
||
| 288 | |||
| 289 | public void emitirNfeRemessa() { |
||
| 290 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
||
| 291 | public void execute() { |
||
| 292 | NotaFiscal notaFiscal = notaFiscalService.detalhar(getEntidade()); |
||
| 293 | notaFiscal.setPessoaJuridicaEmitente(pessoaService.detalharPessoa(notaFiscal.getPessoaJuridicaEmitente())); |
||
| 294 | notaFiscal.setPessoaJuridicaDestinatario(pessoaService.detalharPessoa(notaFiscal.getPessoaJuridicaDestinatario())); |
||
| 295 | notaFiscal.setListaNFRemessaProdutos(notaFiscalProdutoService.consultarProdutosDaNotaFiscal(getEntidade())); |
||
| 296 | emissorNotaFiscalEletronicaService.enviarNotaFiscalEletronicaRemessa(notaFiscal); |
||
| 297 | LancadorMensagem.lancarSucesso("NOTA FISCAL DE REMESSA: EMITIDA COM SUCESSO"); |
||
| 298 | } |
||
| 299 | }); |
||
| 300 | } |
||
| 301 | |||
| 302 | /* |
||
| 303 | private void verificarParametros(TransferenciaProduto transferenciaProduto) { |
||
| 304 | if (VerificadorUtil.estaNulo(transferenciaProduto.getQuantidadeTransferir()) || transferenciaProduto.getQuantidadeTransferir().equals(0)) { |
||
| 305 | throw new NegocioException("Obrigatório informar a quantidade para transferência."); |
||
| 306 | } |
||
| 307 | verificarSeProdutoJaFoiAdicionado(transferenciaProduto.getSequencialDoProduto()); |
||
| 308 | } |
||
| 309 | |||
| 310 | protected void verificarSeProdutoJaFoiAdicionado(Long sequencialProduto) { |
||
| 311 | if (getEntidade().verificarSeProdutoJaConstaNaLista(sequencialProduto)) { |
||
| 312 | throw new NegocioException("Produto já foi adicionando anteriormente!"); |
||
| 313 | } |
||
| 314 | } |
||
| 315 | */ |
||
| 316 | |||
| 317 | public void selecionarPessoaJuridica(final Pessoa pessoa) { |
||
| 318 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
||
| 319 | public void execute() { |
||
| 320 | getEntidade().setPessoaJuridicaEmitente(pessoa); |
||
| 321 | adicionandoParametroArgsConfirmandoAcao(true); |
||
| 322 | } |
||
| 323 | }); |
||
| 324 | } |
||
| 325 | |||
| 326 | public void retirarPessoaJuridica() { |
||
| 327 | getEntidade().setPessoaJuridicaEmitente(null); |
||
| 328 | } |
||
| 329 | |||
| 330 | // MÉTODO PARCIAL |
||
| 331 | public void adicionarEstoqueProdutos() { |
||
| 332 | // FORNECEDORES: "MULTILASER" 29, "VIVONA25" 25, "JBL HARMAN" 38, "HUSKY" 40, "BHX ENERGY" 37, "KINGO" 30, "GBMAX" 70, |
||
| 333 | // "GIFFY" 32, "RCELL" 34, "TTNT" 60, "YASIN" 68, "DL COMERCIO" 71 |
||
| 334 | /*1;"LOJA POÇO" |
||
| 335 | 2;"QUIOSQUE EXTRA" |
||
| 336 | 3;"QUIOSQUE HIPER" |
||
| 337 | 4;"LOJA VIVO" |
||
| 338 | 5;"QUIOSQUE PÁTIO" |
||
| 339 | 6;"LOJA MATRIZ" |
||
| 340 | 7;"FARMÁCIA" |
||
| 341 | 8;"LOJA MACEIÓ" |
||
| 342 | 9;"ESTOQUE" |
||
| 343 | 13;"QUIOSQUE ANTARES"*/ |
||
| 344 | |||
| 345 | // FORNECEDORES APTOS |
||
| 346 | // List<Integer> sequenciaisFornecedor = new ArrayList<>(Arrays.asList(29, 25, 38, 40, 37, 30, 70, 32, 34, 60, 68, 71)); |
||
| 347 | // List<Integer> sequenciaisFornecedor = new ArrayList<>(Arrays.asList(38)); |
||
| 348 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
||
| 349 | public void execute() { |
||
| 350 | ParametrosConsultaProdutoDTO parametrosConsultaProduto = new ParametrosConsultaProdutoDTO(); |
||
| 351 | parametrosConsultaProduto.setTipoRelatorioProduto(TipoRelatorio.PRODUTOS_COM_ESTOQUE.getValor()); |
||
| 352 | if (VerificadorUtil.naoEstaNulo(getLojaParaRemessa())) { |
||
| 353 | parametrosConsultaProduto.setLojaSelecionada(getLojaParaRemessa().getSequencial()); |
||
| 354 | } else { |
||
| 355 | LancadorMensagem.lancarErro("Selecione a loja do estoque"); |
||
| 356 | } |
||
| 357 | if (VerificadorUtil.naoEstaNulo(getFornecedorParaRemessa())) { |
||
| 358 | parametrosConsultaProduto.setFornecedor(getFornecedorParaRemessa()); |
||
| 359 | } else { |
||
| 360 | LancadorMensagem.lancarErro("Selecione o fornecedor"); |
||
| 361 | } |
||
| 362 | |||
| 363 | List<Produto> produtosAptos = produtoService.consultarProdutoPorParametros(parametrosConsultaProduto); |
||
| 364 | for (Produto produto : produtosAptos) { |
||
| 365 | ProdutoLoja produtoLoja = null; |
||
| 366 | if (VerificadorUtil.naoEstaNulo(getLojaParaRemessa())) { |
||
| 367 | produtoLoja = produtoLojaService.consultarProdutoLoja(produto, getLojaParaRemessa()); |
||
| 368 | } |
||
| 369 | NotaFiscalProduto notaFiscalProduto = new NotaFiscalProduto(); |
||
| 370 | notaFiscalProduto.setProduto(produto); |
||
| 371 | notaFiscalProduto.setQuantidade(produtoLoja.getQuantidadeEstoque()); |
||
| 372 | notaFiscalProduto.setNotaFiscal(getEntidade()); |
||
| 373 | notaFiscalProdutoService.cadastrar(notaFiscalProduto); |
||
| 374 | } |
||
| 375 | consultarNfeRemessa(getEntidade()); |
||
| 376 | } |
||
| 377 | }); |
||
| 378 | } |
||
| 379 | |||
| 380 | public void retirarEstoqueProdutos() { |
||
| 381 | for (NotaFiscalProduto notaFiscalProduto : getEntidade().getListaNFRemessaProdutos()) { |
||
| 382 | notaFiscalProdutoService.excluir(notaFiscalProduto); |
||
| 383 | } |
||
| 384 | consultarNfeRemessa(getEntidade()); |
||
| 385 | } |
||
| 386 | |||
| 387 | public void abrirLinkCaminhoQrcode() { |
||
| 388 | try { |
||
| 389 | FacesContext.getCurrentInstance().getExternalContext().redirect(getEntidade().getCaminhoQrcode()); |
||
| 390 | } catch (IOException e) { |
||
| 391 | e.printStackTrace(); |
||
| 392 | } |
||
| 393 | } |
||
| 394 | |||
| 395 | public static void main(String[] args) { |
||
| 396 | List<Integer> sequenciaisFornecedor = new ArrayList<>(Arrays.asList(29, 25, 38, 40, 37, 30, 70, 32, 34, 60, 68, 71)); |
||
| 397 | for (Integer sequencialFornecedor : sequenciaisFornecedor) { |
||
| 398 | System.out.println(sequencialFornecedor); |
||
| 399 | } |
||
| 400 | } |
||
| 401 | |||
| 402 | } |