Rev 630 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 630 | Rev 631 | ||
|---|---|---|---|
| Line 17... | Line 17... | ||
| 17 | import br.com.ec.domain.dto.PosVendaDTO; |
17 | import br.com.ec.domain.dto.PosVendaDTO; |
| 18 | import br.com.ec.domain.dto.VendaDTO; |
18 | import br.com.ec.domain.dto.VendaDTO; |
| 19 | import br.com.ec.domain.model.PosVenda; |
19 | import br.com.ec.domain.model.PosVenda; |
| 20 | import br.com.ec.domain.model.tipos.TipoNpsPosVenda; |
20 | import br.com.ec.domain.model.tipos.TipoNpsPosVenda; |
| 21 | import br.com.ec.domain.model.tipos.TipoPeriodoConsulta; |
21 | import br.com.ec.domain.model.tipos.TipoPeriodoConsulta; |
| - | 22 | import br.com.ec.domain.model.tipos.TipoPosVendaAtivacao; |
|
| 22 | import br.com.ec.domain.service.LancamentoService; |
23 | import br.com.ec.domain.service.LancamentoService; |
| 23 | import br.com.ec.domain.service.NpsPosVendaService; |
24 | import br.com.ec.domain.service.NpsPosVendaService; |
| 24 | import br.com.ec.domain.service.PosVendaService; |
25 | import br.com.ec.domain.service.PosVendaService; |
| 25 | import br.com.ec.domain.service.TransferenciaService; |
26 | import br.com.ec.domain.service.TransferenciaService; |
| 26 | import br.com.ec.web.exception.VerificadorLancamentoException; |
27 | import br.com.ec.web.exception.VerificadorLancamentoException; |
| Line 37... | Line 38... | ||
| 37 | private PosVendaService posVendaService; |
38 | private PosVendaService posVendaService; |
| 38 | private NpsPosVendaService npsPosVendaService; |
39 | private NpsPosVendaService npsPosVendaService; |
| 39 | private LancamentoService lancamentoService; |
40 | private LancamentoService lancamentoService; |
| 40 | 41 | ||
| 41 | private PosVendaDTO posVendaSelecionado; |
42 | private PosVendaDTO posVendaSelecionado; |
| - | 43 | private String tipoPosVendaSelecionado; |
|
| 42 | 44 | ||
| 43 | public static class NpsItem { |
45 | public static class NpsItem { |
| 44 | private final int nota; |
46 | private final int nota; |
| 45 | private final String icone; |
47 | private final String icone; |
| 46 | private final String estrelas; |
48 | private final String estrelas; |
| Line 86... | Line 88... | ||
| 86 | public PosVendaDTO getPosVendaSelecionado() { |
88 | public PosVendaDTO getPosVendaSelecionado() { |
| 87 | return posVendaSelecionado; |
89 | return posVendaSelecionado; |
| 88 | }
|
90 | }
|
| 89 | public void setPosVendaSelecionado(PosVendaDTO posVendaSelecionado) { |
91 | public void setPosVendaSelecionado(PosVendaDTO posVendaSelecionado) { |
| 90 | this.posVendaSelecionado = posVendaSelecionado; |
92 | this.posVendaSelecionado = posVendaSelecionado; |
| - | 93 | }
|
|
| - | 94 | ||
| - | 95 | public String getTipoPosVendaSelecionado() { |
|
| - | 96 | return tipoPosVendaSelecionado; |
|
| - | 97 | }
|
|
| - | 98 | public void setTipoPosVendaSelecionado(String tipoPosVendaSelecionado) { |
|
| - | 99 | this.tipoPosVendaSelecionado = tipoPosVendaSelecionado; |
|
| 91 | }
|
100 | }
|
| 92 | 101 | ||
| 93 | /**************************************************/
|
102 | /**************************************************/
|
| 94 | 103 | ||
| 95 | public TipoPeriodoConsulta[] getTiposPeriodoConsulta() { |
104 | public TipoPeriodoConsulta[] getTiposPeriodoConsulta() { |
| Line 104... | Line 113... | ||
| 104 | setEntidade(posVendaService.consultarPosVendaEmAndamento()); |
113 | setEntidade(posVendaService.consultarPosVendaEmAndamento()); |
| 105 | }
|
114 | }
|
| 106 | }); |
115 | }); |
| 107 | }
|
116 | }
|
| 108 | 117 | ||
| 109 | public void selecionarPosVenda(PosVendaDTO posVenda/* , TipoPosVendaAtivacao tipoAtivacao */) { |
- | |
| - | 118 | public void detalharPosVendaAgradecimento(PosVendaDTO posVenda) { |
|
| 110 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
119 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
| 111 | public void execute() { |
120 | public void execute() { |
| 112 | // CONSULTAR DETALHES BASEANDO-SE NO TIPO DE ATIVACAO
|
- | |
| 113 | posVenda.getVendaDTO().setListaLancamentos(lancamentoService.consultarLancamentosDaVenda(posVenda.getVendaDTO().getSequencial())); |
121 | posVenda.getVendaDTO().setListaLancamentos(lancamentoService.consultarLancamentosDaVenda(posVenda.getVendaDTO().getSequencial())); |
| 114 | // CONSULTAR NPS PÓS-VENDA
|
- | |
| 115 | posVenda.setNpsPosVendaAgradecimento(npsPosVendaService.consultarPorPosVendaEeTipo(posVenda.getSequencial(), TipoNpsPosVenda.ATENDIMENTO_A.getValor())); |
122 | posVenda.setNpsPosVendaAgradecimento(npsPosVendaService.consultarPorPosVendaEeTipo(posVenda.getSequencial(), TipoNpsPosVenda.ATENDIMENTO_A.getValor())); |
| 116 | setPosVendaSelecionado(posVenda); |
123 | setPosVendaSelecionado(posVenda); |
| - | 124 | setTipoPosVendaSelecionado(TipoPosVendaAtivacao.AGRADECIMENTO_A1.getValor()); |
|
| - | 125 | preDetalhar(getEntidade()); |
|
| 117 | }
|
126 | }
|
| 118 | }); |
127 | }); |
| 119 | }
|
128 | }
|
| 120 | 129 | ||
| 121 | public void iniciarAtendimento() { |
130 | public void iniciarAtendimento() { |
| 122 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
131 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
| 123 | public void execute() { |
132 | public void execute() { |
| 124 | posVendaService.iniciarAtendimento(getPosVendaSelecionado()); |
133 | posVendaService.iniciarAtendimento(getPosVendaSelecionado()); |
| 125 | consultarPosVenda(); |
134 | consultarPosVenda(); |
| 126 | LancadorMensagem.lancarSucesso("PÓS-VENDA INICIADO COM SUCESSO"); |
- | |
| - | 135 | preConsultar(); |
|
| - | 136 | LancadorMensagem.lancarSucesso("PÓS-VENDA SALVO COM SUCESSO"); |
|
| 127 | }
|
137 | }
|
| 128 | }); |
138 | }); |
| 129 | }
|
139 | }
|
| 130 | 140 | ||
| 131 | }
|
141 | }
|