Rev 596 | Rev 688 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 596 | Rev 686 | ||
|---|---|---|---|
| Line 33... | Line 33... | ||
| 33 | import br.com.ec.domain.model.tipos.TipoCupom; |
33 | import br.com.ec.domain.model.tipos.TipoCupom; |
| 34 | import br.com.ec.domain.model.tipos.TipoFrete; |
34 | import br.com.ec.domain.model.tipos.TipoFrete; |
| 35 | import br.com.ec.domain.model.tipos.TipoPersonalizacao; |
35 | import br.com.ec.domain.model.tipos.TipoPersonalizacao; |
| 36 | import br.com.ec.domain.model.tipos.TipoSituacaoPedido; |
36 | import br.com.ec.domain.model.tipos.TipoSituacaoPedido; |
| 37 | import br.com.ec.domain.service.bandeiracartao.BandeiraCartaoService; |
37 | import br.com.ec.domain.service.bandeiracartao.BandeiraCartaoService; |
| - | 38 | import br.com.ec.domain.service.cashback.CashbackService; |
|
| 38 | import br.com.ec.domain.service.cliente.ClienteService; |
39 | import br.com.ec.domain.service.cliente.ClienteService; |
| 39 | import br.com.ec.domain.service.conta.ContaService; |
40 | import br.com.ec.domain.service.conta.ContaService; |
| 40 | import br.com.ec.domain.service.cupom.CupomService; |
41 | import br.com.ec.domain.service.cupom.CupomService; |
| 41 | import br.com.ec.domain.service.email.impl.GerenciadorEmailImpl; |
42 | import br.com.ec.domain.service.email.impl.GerenciadorEmailImpl; |
| 42 | import br.com.ec.domain.service.estampa.EstampaService; |
43 | import br.com.ec.domain.service.estampa.EstampaService; |
| Line 82... | Line 83... | ||
| 82 | private NotaFiscalService notaFiscalService; |
83 | private NotaFiscalService notaFiscalService; |
| 83 | private CupomService cupomService; |
84 | private CupomService cupomService; |
| 84 | private LancamentoService lancamentoService; |
85 | private LancamentoService lancamentoService; |
| 85 | private PedidoService pedidoService; |
86 | private PedidoService pedidoService; |
| 86 | private EstampaService estampaService; |
87 | private EstampaService estampaService; |
| - | 88 | private CashbackService cashbackService; |
|
| 87 | private ContextoSeguranca contextoSeguranca; |
89 | private ContextoSeguranca contextoSeguranca; |
| 88 | 90 | ||
| 89 | private String codigoProduto; |
91 | private String codigoProduto; |
| 90 | private String codigoPedido; |
92 | private String codigoPedido; |
| 91 | private Lancamento lancamento; |
93 | private Lancamento lancamento; |
| Line 119... | Line 121... | ||
| 119 | public VendaBean(LojaService lojaService, VendaService vendaService, ProdutoService produtoService, ProdutoLojaService produtoLojaService, |
121 | public VendaBean(LojaService lojaService, VendaService vendaService, ProdutoService produtoService, ProdutoLojaService produtoLojaService, |
| 120 | VendedorService vendedorService, FormaPagamentoService formaPagamentoService, VendaFormaPagamentoService vendaFormaPagamentoService, |
122 | VendedorService vendedorService, FormaPagamentoService formaPagamentoService, VendaFormaPagamentoService vendaFormaPagamentoService, |
| 121 | BandeiraCartaoService bandeiraCartaoService, ParcelaService parcelaService, |
123 | BandeiraCartaoService bandeiraCartaoService, ParcelaService parcelaService, |
| 122 | ContaService contaAReceberService, ClienteService clienteService, ModeloService modeloService, |
124 | ContaService contaAReceberService, ClienteService clienteService, ModeloService modeloService, |
| 123 | NotaFiscalService notaFiscalService, CupomService cupomService, LancamentoService lancamentoService, PedidoService pedidoService, |
125 | NotaFiscalService notaFiscalService, CupomService cupomService, LancamentoService lancamentoService, PedidoService pedidoService, |
| 124 | EstampaService estampaService, ContextoSeguranca contextoSeguranca) { |
- | |
| - | 126 | EstampaService estampaService, CashbackService cashbackService, ContextoSeguranca contextoSeguranca) { |
|
| 125 | this.lojaService = lojaService; |
127 | this.lojaService = lojaService; |
| 126 | this.vendaService = vendaService; |
128 | this.vendaService = vendaService; |
| 127 | this.produtoService = produtoService; |
129 | this.produtoService = produtoService; |
| 128 | this.produtoLojaService = produtoLojaService; |
130 | this.produtoLojaService = produtoLojaService; |
| 129 | this.vendedorService = vendedorService; |
131 | this.vendedorService = vendedorService; |
| Line 137... | Line 139... | ||
| 137 | this.notaFiscalService = notaFiscalService; |
139 | this.notaFiscalService = notaFiscalService; |
| 138 | this.cupomService = cupomService; |
140 | this.cupomService = cupomService; |
| 139 | this.lancamentoService = lancamentoService; |
141 | this.lancamentoService = lancamentoService; |
| 140 | this.pedidoService = pedidoService; |
142 | this.pedidoService = pedidoService; |
| 141 | this.estampaService = estampaService; |
143 | this.estampaService = estampaService; |
| - | 144 | this.cashbackService = cashbackService; |
|
| 142 | this.contextoSeguranca = contextoSeguranca; |
145 | this.contextoSeguranca = contextoSeguranca; |
| 143 | }
|
146 | }
|
| 144 | 147 | ||
| 145 | @Override |
148 | @Override |
| 146 | public void preCarregamento() { |
149 | public void preCarregamento() { |
| Line 652... | Line 655... | ||
| 652 | FormaPagamento formaPagamento = formaPagamentoService.consultarPorId(new FormaPagamento(ConstantesSEC.FormasDePagamento.FORMAPAGAMENTO_CUPOM)); |
655 | FormaPagamento formaPagamento = formaPagamentoService.consultarPorId(new FormaPagamento(ConstantesSEC.FormasDePagamento.FORMAPAGAMENTO_CUPOM)); |
| 653 | VendaFormaPagamento vendaFormaPagamento = new VendaFormaPagamento(getEntidade(), formaPagamento); |
656 | VendaFormaPagamento vendaFormaPagamento = new VendaFormaPagamento(getEntidade(), formaPagamento); |
| 654 | vendaFormaPagamento.setValorPagamento(getValorPagamento()); |
657 | vendaFormaPagamento.setValorPagamento(getValorPagamento()); |
| 655 | vendaFormaPagamento.setCupom(getCupomSelecionado()); |
658 | vendaFormaPagamento.setCupom(getCupomSelecionado()); |
| 656 | adicionarPagamento(vendaFormaPagamento); |
659 | adicionarPagamento(vendaFormaPagamento); |
| - | 660 | }
|
|
| - | 661 | }); |
|
| - | 662 | }
|
|
| - | 663 | ||
| - | 664 | public void adicionarPagamentoComCashback() { |
|
| - | 665 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
|
| - | 666 | public void execute() { |
|
| - | 667 | FormaPagamento formaPagamento = formaPagamentoService.consultarPorId(new FormaPagamento(ConstantesSEC.FormasDePagamento.FORMAPAGAMENTO_CASHBACK_28)); |
|
| - | 668 | VendaFormaPagamento vendaFormaPagamento = new VendaFormaPagamento(getEntidade(), formaPagamento); |
|
| - | 669 | vendaFormaPagamento.setValorPagamento(getValorPagamento()); |
|
| - | 670 | retirarCashbackCliente(getEntidade().getCliente(), getValorPagamento()); |
|
| - | 671 | adicionarPagamento(vendaFormaPagamento); |
|
| - | 672 | }
|
|
| - | 673 | ||
| - | 674 | private void retirarCashbackCliente(Cliente cliente, Double valor) { |
|
| - | 675 | // cashbackService.utilizarCashback(cliente, valor);
|
|
| 657 | }
|
676 | }
|
| 658 | }); |
677 | }); |
| 659 | }
|
678 | }
|
| 660 | 679 | ||
| 661 | public void adicionarPagamento(final VendaFormaPagamento vendaFormaPagamento) { |
680 | public void adicionarPagamento(final VendaFormaPagamento vendaFormaPagamento) { |