Rev 624 | Rev 627 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 624 | Rev 625 | ||
|---|---|---|---|
| Line 14... | Line 14... | ||
| 14 | import br.com.ec.core.util.DataUtils; |
14 | import br.com.ec.core.util.DataUtils; |
| 15 | import br.com.ec.domain.dto.ClienteDTO; |
15 | import br.com.ec.domain.dto.ClienteDTO; |
| 16 | import br.com.ec.domain.dto.ComercialPosVendaDTO; |
16 | import br.com.ec.domain.dto.ComercialPosVendaDTO; |
| 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.tipos.TipoPeriodoConsulta; |
20 | import br.com.ec.domain.model.tipos.TipoPeriodoConsulta; |
| 20 | import br.com.ec.domain.service.LancamentoService; |
21 | import br.com.ec.domain.service.LancamentoService; |
| 21 | import br.com.ec.domain.service.PosVendaService; |
22 | import br.com.ec.domain.service.PosVendaService; |
| 22 | import br.com.ec.domain.service.TransferenciaService; |
23 | import br.com.ec.domain.service.TransferenciaService; |
| 23 | import br.com.ec.web.exception.VerificadorLancamentoException; |
24 | import br.com.ec.web.exception.VerificadorLancamentoException; |
| 24 | import br.com.ec.web.exception.VerificadorLancamentoException.CommandBean; |
25 | import br.com.ec.web.exception.VerificadorLancamentoException.CommandBean; |
| 25 | import br.com.ec.web.generic.AbstractBean; |
26 | import br.com.ec.web.generic.AbstractBean; |
| - | 27 | import br.com.ec.web.message.LancadorMensagem; |
|
| 26 | 28 | ||
| 27 | @Named |
29 | @Named |
| 28 | @Scope("view") |
30 | @Scope("view") |
| 29 | public class PosVendaBean extends AbstractBean<ComercialPosVendaDTO> implements Serializable { |
31 | public class PosVendaBean extends AbstractBean<ComercialPosVendaDTO> implements Serializable { |
| 30 | 32 | ||
| Line 32... | Line 34... | ||
| 32 | 34 | ||
| 33 | private PosVendaService posVendaService; |
35 | private PosVendaService posVendaService; |
| 34 | private LancamentoService lancamentoService; |
36 | private LancamentoService lancamentoService; |
| 35 | 37 | ||
| 36 | private PosVendaDTO posVendaSelecionado; |
38 | private PosVendaDTO posVendaSelecionado; |
| - | 39 | ||
| - | 40 | public static class NpsItem { |
|
| - | 41 | private final int nota; |
|
| - | 42 | private final String icone; |
|
| - | 43 | private final String estrelas; |
|
| - | 44 | ||
| - | 45 | public NpsItem(int nota, String icone, String estrelas) { |
|
| - | 46 | this.nota = nota; |
|
| - | 47 | this.icone = icone; |
|
| - | 48 | this.estrelas = estrelas; |
|
| - | 49 | }
|
|
| - | 50 | ||
| - | 51 | public int getNota() { return nota; } |
|
| - | 52 | public String getIcone() { return icone; } |
|
| - | 53 | public String getEstrelas() { return estrelas; } |
|
| - | 54 | }
|
|
| 37 | 55 | ||
| 38 | @Inject |
56 | @Inject |
| 39 | public PosVendaBean(PosVendaService posVendaService, LancamentoService lancamentoService) { |
57 | public PosVendaBean(PosVendaService posVendaService, LancamentoService lancamentoService) { |
| 40 | this.posVendaService = posVendaService; |
58 | this.posVendaService = posVendaService; |
| 41 | this.lancamentoService = lancamentoService; |
59 | this.lancamentoService = lancamentoService; |
| Line 93... | Line 111... | ||
| 93 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
111 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
| 94 | public void execute() { |
112 | public void execute() { |
| 95 | // CONSULTAR DETALHES BASEANDO-SE NO TIPO DE ATIVACAO
|
113 | // CONSULTAR DETALHES BASEANDO-SE NO TIPO DE ATIVACAO
|
| 96 | posVenda.getVendaDTO().setListaLancamentos(lancamentoService.consultarLancamentosDaVenda(posVenda.getVendaDTO().getSequencial())); |
114 | posVenda.getVendaDTO().setListaLancamentos(lancamentoService.consultarLancamentosDaVenda(posVenda.getVendaDTO().getSequencial())); |
| 97 | setPosVendaSelecionado(posVenda); |
115 | setPosVendaSelecionado(posVenda); |
| - | 116 | }
|
|
| - | 117 | }); |
|
| - | 118 | }
|
|
| - | 119 | ||
| - | 120 | public void iniciarSalvarPosVenda() { |
|
| - | 121 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
|
| - | 122 | public void execute() { |
|
| - | 123 | PosVenda posVendaParaAlterar = posVendaService.consultarPorId(new PosVenda(getPosVendaSelecionado().getSequencial())); |
|
| - | 124 | posVendaParaAlterar.setDataInicio(DataUtils.getDataAtual()); |
|
| - | 125 | posVendaParaAlterar.setObservacao(getPosVendaSelecionado().getObservacao()); |
|
| - | 126 | posVendaParaAlterar.setTipoFinalizacao(getPosVendaSelecionado().getTipoFinalizacao()); |
|
| - | 127 | posVendaService.alterar(posVendaParaAlterar); |
|
| - | 128 | LancadorMensagem.lancarSucesso("PÓS-VENDA INICIADO COM SUCESSO"); |
|
| 98 | }
|
129 | }
|
| 99 | }); |
130 | }); |
| 100 | }
|
131 | }
|
| 101 | 132 | ||
| 102 | private ComercialPosVendaDTO iniciarDados() { |
133 | private ComercialPosVendaDTO iniciarDados() { |
| Line 139... | Line 170... | ||
| 139 |
|
170 |
|
| 140 | comercialDTO.setListaPosVenda(listaPosVendaDTO);
|
171 | comercialDTO.setListaPosVenda(listaPosVendaDTO);
|
| 141 |
|
172 |
|
| 142 | return comercialDTO;
|
173 | return comercialDTO;
|
| 143 | */
|
174 | */
|
| 144 | }
|
- | |
| 145 | - | ||
| 146 | public void efetivarTransferencias() { |
- | |
| 147 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
- | |
| 148 | public void execute() { |
- | |
| 149 | }
|
- | |
| 150 | }); |
- | |
| 151 | }
|
175 | }
|
| 152 | 176 | ||
| 153 | }
|
177 | }
|