Rev 425 | Rev 447 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 425 | Rev 446 | ||
|---|---|---|---|
| Line 16... | Line 16... | ||
| 16 | import br.com.ec.domain.model.nfe.TipoNotaFiscal; |
16 | import br.com.ec.domain.model.nfe.TipoNotaFiscal; |
| 17 | import br.com.ec.domain.service.EmissorRelatorioService; |
17 | import br.com.ec.domain.service.EmissorRelatorioService; |
| 18 | import br.com.ec.domain.service.NotaFiscalService; |
18 | import br.com.ec.domain.service.NotaFiscalService; |
| 19 | import br.com.ec.web.exception.VerificadorLancamentoException; |
19 | import br.com.ec.web.exception.VerificadorLancamentoException; |
| 20 | import br.com.ec.web.exception.VerificadorLancamentoException.CommandBean; |
20 | import br.com.ec.web.exception.VerificadorLancamentoException.CommandBean; |
| - | 21 | import br.com.ec.web.exception.VerificadorLancamentoException.CommandRelatorioStreamedContent; |
|
| 21 | import br.com.ec.web.generic.AbstractBean; |
22 | import br.com.ec.web.generic.AbstractBean; |
| 22 | import br.com.ec.web.message.LancadorMensagem; |
23 | import br.com.ec.web.message.LancadorMensagem; |
| 23 | import br.com.ec.web.util.TipoOperacao; |
24 | import br.com.ec.web.util.TipoOperacao; |
| 24 | 25 | ||
| 25 | @Named |
26 | @Named |
| Line 33... | Line 34... | ||
| 33 | 34 | ||
| 34 | private ParametrosConsultaNotaFiscal parametrosConsultaNotaFiscal; |
35 | private ParametrosConsultaNotaFiscal parametrosConsultaNotaFiscal; |
| 35 | private NotaFiscalConsultaPorDemanda lazy; |
36 | private NotaFiscalConsultaPorDemanda lazy; |
| 36 | 37 | ||
| 37 | private Long sequencialVendaParaVinculo; |
38 | private Long sequencialVendaParaVinculo; |
| - | 39 | private StreamedContent danfeNfePreVisualizacao; |
|
| 38 | private StreamedContent danfeNfe; |
40 | private StreamedContent danfeNfe; |
| 39 | 41 | ||
| 40 | @Inject |
42 | @Inject |
| 41 | public NotaFiscalBean(NotaFiscalConsultaPorDemanda lazy, NotaFiscalService notaFiscalService, EmissorRelatorioService emissorRelatorioService) { |
43 | public NotaFiscalBean(NotaFiscalConsultaPorDemanda lazy, NotaFiscalService notaFiscalService, EmissorRelatorioService emissorRelatorioService) { |
| 42 | this.lazy = lazy; |
44 | this.lazy = lazy; |
| Line 100... | Line 102... | ||
| 100 | public Long getSequencialVendaParaVinculo() { |
102 | public Long getSequencialVendaParaVinculo() { |
| 101 | return sequencialVendaParaVinculo; |
103 | return sequencialVendaParaVinculo; |
| 102 | }
|
104 | }
|
| 103 | public void setSequencialVendaParaVinculo(Long sequencialVendaParaVinculo) { |
105 | public void setSequencialVendaParaVinculo(Long sequencialVendaParaVinculo) { |
| 104 | this.sequencialVendaParaVinculo = sequencialVendaParaVinculo; |
106 | this.sequencialVendaParaVinculo = sequencialVendaParaVinculo; |
| - | 107 | }
|
|
| - | 108 | ||
| - | 109 | public StreamedContent getDanfeNfePreVisualizacao() { |
|
| - | 110 | return danfeNfePreVisualizacao; |
|
| - | 111 | }
|
|
| - | 112 | public void setDanfeNfePreVisualizacao(StreamedContent danfeNfePreVisualizacao) { |
|
| - | 113 | this.danfeNfePreVisualizacao = danfeNfePreVisualizacao; |
|
| 105 | }
|
114 | }
|
| 106 | 115 | ||
| 107 | public StreamedContent getDanfeNfe() { |
116 | public StreamedContent getDanfeNfe() { |
| 108 | return danfeNfe; |
117 | return danfeNfe; |
| 109 | }
|
118 | }
|
| Line 132... | Line 141... | ||
| 132 | }
|
141 | }
|
| 133 | }); |
142 | }); |
| 134 | }
|
143 | }
|
| 135 | 144 | ||
| 136 | public void emitirDanfeNfe(Long sequencialNotaFiscal) { |
145 | public void emitirDanfeNfe(Long sequencialNotaFiscal) { |
| - | 146 | setDanfeNfe(notaFiscalService.gerarDanfeNfe(sequencialNotaFiscal)); |
|
| - | 147 | }
|
|
| - | 148 | ||
| - | 149 | public void emitirDanfeNfePreVisualizacao(Long sequencialNotaFiscal) { |
|
| - | 150 | setDanfeNfePreVisualizacao(notaFiscalService.gerarDanfeNfePreVisualizacao(sequencialNotaFiscal)); |
|
| 137 | setDanfeNfe(notaFiscalService.gerarDanfeNfe(sequencialNotaFiscal)); |
151 | setDanfeNfe(notaFiscalService.gerarDanfeNfe(sequencialNotaFiscal)); |
| 138 | /*
|
152 | /*
|
| 139 | return new VerificadorLancamentoException().verificarLancamentoException(new CommandRelatorioStreamedContent() {
|
153 | return new VerificadorLancamentoException().verificarLancamentoException(new CommandRelatorioStreamedContent() {
|
| 140 | @Override
|
154 | @Override
|
| 141 | public StreamedContent execute() {
|
155 | public StreamedContent execute() {
|
| 142 | return notaFiscalService.gerarDanfeNfe(getEntidade().getSequencial());
|
156 | return notaFiscalService.gerarDanfeNfe(getEntidade().getSequencial());
|
| 143 | }
|
157 | }
|
| 144 | });
|
158 | });
|
| 145 | */
|
159 | */
|
| - | 160 | }
|
|
| - | 161 | ||
| - | 162 | public StreamedContent downloadNotaFiscal() { |
|
| - | 163 | return new VerificadorLancamentoException().verificarLancamentoException(new CommandRelatorioStreamedContent() { |
|
| - | 164 | @Override |
|
| - | 165 | public StreamedContent execute() { |
|
| - | 166 | return getDanfeNfe(); |
|
| - | 167 | }
|
|
| - | 168 | }); |
|
| 146 | }
|
169 | }
|
| 147 | 170 | ||
| 148 | public void emitirDanfeNfeTeste() { |
171 | public void emitirDanfeNfeTeste() { |
| 149 | Long sequencialNotaFiscal = new Long(168722); |
172 | Long sequencialNotaFiscal = new Long(168722); |
| - | 173 | setDanfeNfePreVisualizacao(notaFiscalService.gerarDanfeNfePreVisualizacao(sequencialNotaFiscal)); |
|
| 150 | setDanfeNfe(notaFiscalService.gerarDanfeNfe(sequencialNotaFiscal)); |
174 | setDanfeNfe(notaFiscalService.gerarDanfeNfe(sequencialNotaFiscal)); |
| 151 | }
|
175 | }
|
| 152 | 176 | ||
| 153 | /*
|
177 | /*
|
| 154 | private StreamedContent chart;
|
178 | private StreamedContent chart;
|