Rev 629 | Rev 631 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 629 | Rev 630 | ||
|---|---|---|---|
| Line 78... | Line 78... | ||
| 78 | limparEntidade(); |
78 | limparEntidade(); |
| 79 | }
|
79 | }
|
| 80 | 80 | ||
| 81 | @Override |
81 | @Override |
| 82 | public void limparEntidade() { |
82 | public void limparEntidade() { |
| 83 | setEntidade(iniciarDados()); |
- | |
| - | 83 | consultarPosVenda(); |
|
| 84 | }
|
84 | }
|
| 85 | 85 | ||
| 86 | public PosVendaDTO getPosVendaSelecionado() { |
86 | public PosVendaDTO getPosVendaSelecionado() { |
| 87 | return posVendaSelecionado; |
87 | return posVendaSelecionado; |
| 88 | }
|
88 | }
|
| Line 99... | Line 99... | ||
| 99 | /**************************************************/
|
99 | /**************************************************/
|
| 100 | 100 | ||
| 101 | public void consultarPosVenda() { |
101 | public void consultarPosVenda() { |
| 102 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
102 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
| 103 | public void execute() { |
103 | public void execute() { |
| 104 | // iniciarDados();
|
- | |
| 105 | ComercialPosVendaDTO comercialDTO = new ComercialPosVendaDTO(); |
- | |
| 106 | List<PosVendaDTO> listaPosVendaDTO = new ArrayList<PosVendaDTO>(); |
- | |
| 107 | listaPosVendaDTO.addAll(posVendaService.consultarNaoFinalizadas()); |
- | |
| 108 | comercialDTO.setListaPosVenda(listaPosVendaDTO); |
- | |
| 109 | setEntidade(comercialDTO); |
- | |
| - | 104 | setEntidade(posVendaService.consultarPosVendaEmAndamento()); |
|
| 110 | }
|
105 | }
|
| 111 | }); |
106 | }); |
| 112 | }
|
107 | }
|
| 113 | 108 | ||
| 114 | public void selecionarPosVenda(PosVendaDTO posVenda/* , TipoPosVendaAtivacao tipoAtivacao */) { |
109 | public void selecionarPosVenda(PosVendaDTO posVenda/* , TipoPosVendaAtivacao tipoAtivacao */) { |
| 115 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
110 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
| 116 | public void execute() { |
111 | public void execute() { |
| 117 | // CONSULTAR DETALHES BASEANDO-SE NO TIPO DE ATIVACAO
|
112 | // CONSULTAR DETALHES BASEANDO-SE NO TIPO DE ATIVACAO
|
| 118 | posVenda.getVendaDTO().setListaLancamentos(lancamentoService.consultarLancamentosDaVenda(posVenda.getVendaDTO().getSequencial())); |
113 | posVenda.getVendaDTO().setListaLancamentos(lancamentoService.consultarLancamentosDaVenda(posVenda.getVendaDTO().getSequencial())); |
| 119 | // CONSULTAR NPS PÓS-VENDA
|
114 | // CONSULTAR NPS PÓS-VENDA
|
| 120 | posVenda.setNpsPosVendaAtendimento(npsPosVendaService.consultarPorPosVendaEeTipo(posVenda.getSequencial(), TipoNpsPosVenda.ATENDIMENTO_A.getValor())); |
- | |
| - | 115 | posVenda.setNpsPosVendaAgradecimento(npsPosVendaService.consultarPorPosVendaEeTipo(posVenda.getSequencial(), TipoNpsPosVenda.ATENDIMENTO_A.getValor())); |
|
| 121 | setPosVendaSelecionado(posVenda); |
116 | setPosVendaSelecionado(posVenda); |
| 122 | }
|
117 | }
|
| 123 | }); |
118 | }); |
| 124 | }
|
119 | }
|
| 125 | 120 | ||
| 126 | public void iniciarSalvarPosVenda() { |
- | |
| - | 121 | public void iniciarAtendimento() { |
|
| 127 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
122 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
| 128 | public void execute() { |
123 | public void execute() { |
| 129 | PosVenda posVendaParaAlterar = posVendaService.consultarPorId(new PosVenda(getPosVendaSelecionado().getSequencial())); |
- | |
| 130 | posVendaParaAlterar.setDataInicio(DataUtils.getDataAtual()); |
- | |
| 131 | posVendaParaAlterar.setObservacao(getPosVendaSelecionado().getObservacao()); |
- | |
| 132 | posVendaParaAlterar.setTipoFinalizacao(getPosVendaSelecionado().getTipoFinalizacao()); |
- | |
| 133 | posVendaService.alterar(posVendaParaAlterar); |
- | |
| - | 124 | posVendaService.iniciarAtendimento(getPosVendaSelecionado()); |
|
| - | 125 | consultarPosVenda(); |
|
| 134 | LancadorMensagem.lancarSucesso("PÓS-VENDA INICIADO COM SUCESSO"); |
126 | LancadorMensagem.lancarSucesso("PÓS-VENDA INICIADO COM SUCESSO"); |
| 135 | }
|
127 | }
|
| 136 | }); |
128 | }); |
| 137 | }
|
- | |
| 138 | - | ||
| 139 | private ComercialPosVendaDTO iniciarDados() { |
- | |
| 140 | ComercialPosVendaDTO comercialDTO = new ComercialPosVendaDTO(); |
- | |
| 141 | List<PosVendaDTO> listaPosVendaDTO = new ArrayList<PosVendaDTO>(); |
- | |
| 142 | listaPosVendaDTO.addAll(posVendaService.consultarNaoFinalizadas()); |
- | |
| 143 | comercialDTO.setListaPosVenda(listaPosVendaDTO); |
- | |
| 144 | return comercialDTO; |
- | |
| 145 | - | ||
| 146 | /*
|
- | |
| 147 | ComercialPosVendaDTO comercialDTO = new ComercialPosVendaDTO();
|
- | |
| 148 | List<PosVendaDTO> listaPosVendaDTO = new ArrayList<PosVendaDTO>();
|
- | |
| 149 |
|
- | |
| 150 | PosVendaDTO posVendaDTO = new PosVendaDTO();
|
- | |
| 151 | VendaDTO vendaDTO = new VendaDTO();
|
- | |
| 152 | vendaDTO.setSequencial(new Long(123456));
|
- | |
| 153 | Date data = DataUtils.acrescentarDias(new Date(), -5);
|
- | |
| 154 | vendaDTO.setDataVenda(data);
|
- | |
| 155 | ClienteDTO clienteDTO = new ClienteDTO();
|
- | |
| 156 | clienteDTO.setNome("BRUNO LOPES PEIXOTO");
|
- | |
| 157 | clienteDTO.setCpfCnpj("06256954459");
|
- | |
| 158 | clienteDTO.setContato("82996062514");
|
- | |
| 159 | vendaDTO.setCliente(clienteDTO);
|
- | |
| 160 | posVendaDTO.setVendaDTO(vendaDTO);
|
- | |
| 161 | posVendaDTO.setDataCadastro(data);
|
- | |
| 162 | listaPosVendaDTO.add(posVendaDTO);
|
- | |
| 163 |
|
- | |
| 164 | posVendaDTO = new PosVendaDTO();
|
- | |
| 165 | vendaDTO = new VendaDTO();
|
- | |
| 166 | vendaDTO.setSequencial(new Long(321654));
|
- | |
| 167 | vendaDTO.setDataVenda(new Date());
|
- | |
| 168 | clienteDTO = new ClienteDTO();
|
- | |
| 169 | clienteDTO.setNome("BÁRBARA ALVES");
|
- | |
| 170 | clienteDTO.setCpfCnpj("01234567890");
|
- | |
| 171 | clienteDTO.setContato("8299990000");
|
- | |
| 172 | vendaDTO.setCliente(clienteDTO);
|
- | |
| 173 | posVendaDTO.setVendaDTO(vendaDTO);
|
- | |
| 174 | posVendaDTO.setDataCadastro(new Date());
|
- | |
| 175 | listaPosVendaDTO.add(posVendaDTO);
|
- | |
| 176 |
|
- | |
| 177 | comercialDTO.setListaPosVenda(listaPosVendaDTO);
|
- | |
| 178 |
|
- | |
| 179 | return comercialDTO;
|
- | |
| 180 | */
|
- | |
| 181 | }
|
129 | }
|
| 182 | 130 | ||
| 183 | }
|
131 | }
|