Rev 450 | Rev 561 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 450 | Rev 452 | ||
|---|---|---|---|
| Line 3... | Line 3... | ||
| 3 | import java.util.Date; |
3 | import java.util.Date; |
| 4 | import java.util.List; |
4 | import java.util.List; |
| 5 | 5 | ||
| 6 | import org.springframework.stereotype.Service; |
6 | import org.springframework.stereotype.Service; |
| 7 | 7 | ||
| - | 8 | import br.com.ec.core.exception.NegocioException; |
|
| 8 | import br.com.ec.core.generic.AbstractService; |
9 | import br.com.ec.core.generic.AbstractService; |
| 9 | import br.com.ec.core.generic.GenericRepository; |
10 | import br.com.ec.core.generic.GenericRepository; |
| - | 11 | import br.com.ec.core.util.DataUtils; |
|
| - | 12 | import br.com.ec.core.util.VerificadorUtil; |
|
| 10 | import br.com.ec.core.validador.Validador; |
13 | import br.com.ec.core.validador.Validador; |
| 11 | import br.com.ec.domain.dto.AuditoriaVendaDTO; |
14 | import br.com.ec.domain.dto.AuditoriaVendaDTO; |
| 12 | import br.com.ec.domain.dto.FormaPagamentoDTO; |
15 | import br.com.ec.domain.dto.FormaPagamentoDTO; |
| 13 | import br.com.ec.domain.dto.consulta.ParametrosConsultaVendasDTO; |
16 | import br.com.ec.domain.dto.consulta.ParametrosConsultaVendasDTO; |
| 14 | import br.com.ec.domain.model.Venda; |
17 | import br.com.ec.domain.model.Venda; |
| Line 70... | Line 73... | ||
| 70 | return vendaRepository.obterValorProdutosUtilizadosEmVendas(parametrosConsultaVendas); |
73 | return vendaRepository.obterValorProdutosUtilizadosEmVendas(parametrosConsultaVendas); |
| 71 | }
|
74 | }
|
| 72 | 75 | ||
| 73 | @Override |
76 | @Override |
| 74 | public List<AuditoriaVendaDTO> consultarAuditoriaVenda(Date dataSelecionada, Long sequencialLojaSelecionada) { |
77 | public List<AuditoriaVendaDTO> consultarAuditoriaVenda(Date dataSelecionada, Long sequencialLojaSelecionada) { |
| 75 | // Não permitir data inferior a 2 meses
|
- | |
| 76 | - | ||
| - | 78 | if (VerificadorUtil.estaNulo(sequencialLojaSelecionada)) { |
|
| - | 79 | throw new NegocioException("Selecione a loja"); |
|
| - | 80 | }
|
|
| - | 81 | Integer diferencaDiasEntreDatas = DataUtils.calcularDiferenceEmDiasEntreDuasDatas(DataUtils.getDataAtual(), dataSelecionada); |
|
| - | 82 | if (diferencaDiasEntreDatas > 60) { |
|
| - | 83 | throw new NegocioException("Consulta indisponível"); |
|
| - | 84 | }
|
|
| 77 | return vendaRepository.consultarAuditoriaVenda(dataSelecionada, sequencialLojaSelecionada); |
85 | return vendaRepository.consultarAuditoriaVenda(dataSelecionada, sequencialLojaSelecionada); |
| 78 | }
|
86 | }
|
| 79 | 87 | ||
| 80 | /*
|
88 | /*
|
| 81 | private LancamentoService lancamentoService;
|
89 | private LancamentoService lancamentoService;
|