Rev 631 | Rev 638 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 631 | Rev 636 | ||
|---|---|---|---|
| Line 18... | Line 18... | ||
| 18 | import br.com.ec.domain.model.tipos.TipoNpsPosVenda; |
18 | import br.com.ec.domain.model.tipos.TipoNpsPosVenda; |
| 19 | import br.com.ec.domain.service.NpsPosVendaService; |
19 | import br.com.ec.domain.service.NpsPosVendaService; |
| 20 | import br.com.ec.domain.service.PosVendaService; |
20 | import br.com.ec.domain.service.PosVendaService; |
| 21 | import br.com.ec.domain.service.VendaService; |
21 | import br.com.ec.domain.service.VendaService; |
| 22 | import br.com.ec.repository.PosVendaRepository; |
22 | import br.com.ec.repository.PosVendaRepository; |
| - | 23 | import br.com.ec.web.message.LancadorMensagem; |
|
| - | 24 | import br.com.ec.web.util.ConstantesWebHelper.Mensagem; |
|
| 23 | 25 | ||
| 24 | @Service |
26 | @Service |
| 25 | public class PosVendaServiceImpl extends AbstractService<PosVenda> implements PosVendaService { |
27 | public class PosVendaServiceImpl extends AbstractService<PosVenda> implements PosVendaService { |
| 26 | 28 | ||
| 27 | private PosVendaRepository posVendaRepository; |
29 | private PosVendaRepository posVendaRepository; |
| Line 74... | Line 76... | ||
| 74 | posVendaParaAlterar.setTipoFinalizacao(posVendaDTO.getTipoFinalizacao()); |
76 | posVendaParaAlterar.setTipoFinalizacao(posVendaDTO.getTipoFinalizacao()); |
| 75 | // NpsPosVendaDTO npsPosVendaDTO = npsPosVendaService.consultarPorPosVendaEeTipo(posVendaDTO.getSequencial(), TipoNpsPosVenda.ATENDIMENTO_A.getValor());
|
77 | // NpsPosVendaDTO npsPosVendaDTO = npsPosVendaService.consultarPorPosVendaEeTipo(posVendaDTO.getSequencial(), TipoNpsPosVenda.ATENDIMENTO_A.getValor());
|
| 76 | // NpsPosVenda npsPosVenda = npsPosVendaService.consultarPorId(new NpsPosVenda(npsPosVendaDTO.getSequencial()));
|
78 | // NpsPosVenda npsPosVenda = npsPosVendaService.consultarPorId(new NpsPosVenda(npsPosVendaDTO.getSequencial()));
|
| 77 | // npsPosVendaService.alterar(npsPosVenda);
|
79 | // npsPosVendaService.alterar(npsPosVenda);
|
| 78 | this.alterar(posVendaParaAlterar); |
80 | this.alterar(posVendaParaAlterar); |
| - | 81 | } catch (Exception e) { |
|
| - | 82 | throw new NegocioException(e.getMessage()); |
|
| - | 83 | }
|
|
| - | 84 | }
|
|
| - | 85 | ||
| - | 86 | @Override |
|
| - | 87 | public void finalizarAtendimento(PosVendaDTO posVendaDTO) { |
|
| - | 88 | try { |
|
| - | 89 | PosVenda posVendaParaFinalizar = this.consultarPorId(new PosVenda(posVendaDTO.getSequencial())); |
|
| - | 90 | if (VerificadorUtil.estaNulo(posVendaParaFinalizar.getDataInicio())) { |
|
| - | 91 | posVendaParaFinalizar.setDataInicio(DataUtils.getDataAtual()); |
|
| - | 92 | }
|
|
| - | 93 | posVendaParaFinalizar.setDataFinalizacao(DataUtils.getDataAtual()); |
|
| - | 94 | posVendaParaFinalizar.setObservacao(posVendaDTO.getObservacao()); |
|
| - | 95 | if (VerificadorUtil.estaNulo(posVendaDTO.getTipoFinalizacao())) { |
|
| - | 96 | throw new NegocioException("OBRIGATÓRIO INFORMAR O TIPO DE FINALIZAÇÃO"); |
|
| - | 97 | }
|
|
| - | 98 | posVendaParaFinalizar.setTipoFinalizacao(posVendaDTO.getTipoFinalizacao()); |
|
| - | 99 | // NpsPosVendaDTO npsPosVendaDTO = npsPosVendaService.consultarPorPosVendaEeTipo(posVendaDTO.getSequencial(), TipoNpsPosVenda.ATENDIMENTO_A.getValor());
|
|
| - | 100 | // NpsPosVenda npsPosVenda = npsPosVendaService.consultarPorId(new NpsPosVenda(npsPosVendaDTO.getSequencial()));
|
|
| - | 101 | // npsPosVendaService.alterar(npsPosVenda);
|
|
| - | 102 | this.alterar(posVendaParaFinalizar); |
|
| 79 | } catch (Exception e) { |
103 | } catch (Exception e) { |
| 80 | throw new NegocioException(e.getMessage()); |
104 | throw new NegocioException(e.getMessage()); |
| 81 | }
|
105 | }
|
| 82 | }
|
106 | }
|
| 83 | 107 | ||