From 55f465d43de5aeb1b9bd1656e0e02ec7a9333426 Mon Sep 17 00:00:00 2001 From: valdevir Date: Thu, 9 Feb 2017 13:11:31 +0000 Subject: [PATCH] fixes bug #8371 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@65767 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../impl/ConferenciaComissaoServiceImpl.java | 87 ++++--------------- 1 file changed, 16 insertions(+), 71 deletions(-) diff --git a/src/com/rjconsultores/ventaboletos/service/impl/ConferenciaComissaoServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/ConferenciaComissaoServiceImpl.java index b94042715..8dd8332f1 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/ConferenciaComissaoServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/ConferenciaComissaoServiceImpl.java @@ -636,18 +636,7 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic List lsEmpresa = empresaService.obtenerTodos(); for (Empresa empresa : lsEmpresa) { lsPuntoVenta = puntoVentaService.buscaPuntoVentaEmpresa(empresa); - // Percorrer todos os pontos de venda de cada empresa - //TODO - Apagar este if ao final da implementação do mantis 8371. - //if(empresa.getEmpresaId() == 25){ - // System.out.println("teste"); - //} for (PuntoVenta puntoVenta : lsPuntoVenta) { - //TODO - Paras testes. Apagar este if e else ao final da implementação do mantis 8371. - //if(puntoVenta.getPuntoventaId() == 4 || "UBERABA".contains(puntoVenta.getNombpuntoventa())){ - // System.out.println("teste"); - //}else{ - // continue; - //} // Valida se cada ponto de venda tem ao menos uma ecf, caso tenha aborta o processo. Integer qtdadeECF = quantidadeECFPorPuntoVenta(empresa.getEmpresaId(), puntoVenta.getPuntoventaId()); if (qtdadeECF >= 1) { @@ -705,63 +694,44 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic private boolean validaConferencia(Conferencia conferencia ) { try { - //BigDecimal totalBilhetesManual = BigDecimal.ZERO; - //BigDecimal totalBilhetesVendidos = BigDecimal.ZERO; - //BigDecimal totalBilhetesCancelados = BigDecimal.ZERO; - //BigDecimal totalBilhetesDevolvidos = BigDecimal.ZERO; - //BigDecimal totalBilhetesGap = BigDecimal.ZERO; - //BigDecimal totalBilhetesGapCancelados = BigDecimal.ZERO; - //BigDecimal totalBilhetesGapDevolvidos = BigDecimal.ZERO; - //BigDecimal totalCreditosEventoFinanceiros = BigDecimal.ZERO; - //BigDecimal totalDebitosEventoFinanceiros = BigDecimal.ZERO; - //OcdVO ocdTotal = null; - //ListlsEventosFinanceiros = null; - List boletosComissaos = carregarBilhetesComissao(null, conferencia, null); - if(boletosComissaos ==null || CollectionUtils.isEmpty(boletosComissaos)){ - return false; - } - //totalBilhetesManual = validaBilhetesManual(boletosComissaos, conferencia); + + List boletosComissaos = carregarBilhetesComissao(null, conferencia, null); + if(boletosComissaos ==null || CollectionUtils.isEmpty(boletosComissaos)){ + return false; + } + if(!validaBilhetesManual(boletosComissaos, conferencia)){ return false; } - //totalBilhetesVendidos = validaBilhetesVendidos(boletosComissaos, conferencia); + if(!validaBilhetesVendidos(boletosComissaos, conferencia)){ return false; } - //totalBilhetesCancelados = validaBilhetesCancelados(boletosComissaos, conferencia); + if(!validaBilhetesCancelados(boletosComissaos, conferencia)){ return false; } - //totalBilhetesDevolvidos = validaBilhetesDevolvidos(boletosComissaos, conferencia); + if(!validaBilhetesDevolvidos(boletosComissaos, conferencia)){ return false; } - //totalBilhetesGap = validaBilhetesGap(boletosComissaos, conferencia); + if(!validaBilhetesGap(boletosComissaos, conferencia)){ return false; } - //totalBilhetesGapCancelados = validaBilhetesGapCancelados(boletosComissaos, conferencia); + if(!validaBilhetesGapCancelados(boletosComissaos, conferencia)){ return false; } - //totalBilhetesGapDevolvidos = validaBilhetesGapDevolvidos(boletosComissaos, conferencia); + if(!validaBilhetesGapDevolvidos(boletosComissaos, conferencia)){ return false; } - //lsEventosFinanceiros = validaEventosFinanceiros(boletosComissaos, conferencia); + if(!validaEventosFinanceiros(boletosComissaos, conferencia)){ return false; } - //else{ - // for (EventosFinanceirosVO eventoFinanceiro : lsEventosFinanceiros) { - // if (eventoFinanceiro.isCredito()) { - // totalCreditosEventoFinanceiros = totalCreditosEventoFinanceiros.add(eventoFinanceiro.getImpingreso()); - // } else { - // totalDebitosEventoFinanceiros = totalDebitosEventoFinanceiros.add(eventoFinanceiro.getImpingreso()); - // } - // } - //} - //ocdTotal = validaOcds(conferencia); + if(!validaOcds(conferencia)){ return false; } @@ -775,62 +745,49 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic private boolean validaBilhetesManual(List boletosComissaos, Conferencia conferencia ) throws BusinessException { List lsBilhetesManual = carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETO_MANUAL); if(!CollectionUtils.isEmpty(lsBilhetesManual) && isBilhetesSemConferencia(lsBilhetesManual)){ - //return null; return false; }else{ - //return totalizarBoletoComissao(lsBilhetesManual, IndStatusBoleto.V); return true; } } private boolean validaBilhetesVendidos(List boletosComissaos, Conferencia conferencia) throws BusinessException { List lsBilhetes = carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETOS_VENDIDOS); if(!CollectionUtils.isEmpty(lsBilhetes) && isBilhetesSemConferencia(lsBilhetes)){ - //return null; + return false; }else{ - //return totalizarBoletoComissao(lsBilhetes, IndStatusBoleto.V, IndStatusBoleto.T); return true; } } private boolean validaBilhetesCancelados(List boletosComissaos, Conferencia conferencia) throws BusinessException { List lsBilhetesCancelados = carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETO_CANCELADO); if(!CollectionUtils.isEmpty(lsBilhetesCancelados) && isBilhetesSemConferencia(lsBilhetesCancelados)){ - //return null; return false; }else{ return true; - //return totalizarBoletoComissao(lsBilhetesCancelados); } } private boolean validaBilhetesDevolvidos(List boletosComissaos, Conferencia conferencia) throws BusinessException { List lsBilhetesDevolvidos = carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETO_DEVOLVIDO); if(!CollectionUtils.isEmpty(lsBilhetesDevolvidos) && isBilhetesSemConferencia(lsBilhetesDevolvidos)){ - //return null; return false; }else{ - //Map totais = totalizarBoletoComissaoDevolvidosTrocaOcd(lsBilhetesDevolvidos); return true; - //return totais.get(BoletoStatusComissao.BOLETO_DEVOLVIDO); - } } private boolean validaBilhetesGap(List boletosComissaos, Conferencia conferencia) throws BusinessException { List lsBilhetesGap = carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.GAP_VENDIDOS); if(!CollectionUtils.isEmpty(lsBilhetesGap) && isBilhetesSemConferencia(lsBilhetesGap)){ - //return null; return false; }else{ - //return totalizarBoletoComissao(lsBilhetesGap, IndStatusBoleto.V, IndStatusBoleto.T); return true; } } private boolean validaBilhetesGapCancelados(List boletosComissaos, Conferencia conferencia ) throws BusinessException { List lsBilhetesGapCancelados = carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.GAP_CANCELADO); if(!CollectionUtils.isEmpty(lsBilhetesGapCancelados) && isBilhetesSemConferencia(lsBilhetesGapCancelados)){ - //return null; return false; }else{ - //return totalizarBoletoComissao(lsBilhetesGapCancelados); return true; } } @@ -838,38 +795,26 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic private boolean validaBilhetesGapDevolvidos(List boletosComissaos, Conferencia conferencia) throws BusinessException { List lsBilhetesGapDevolvidos = carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.GAP_DEVOLVIDO); if(!CollectionUtils.isEmpty(lsBilhetesGapDevolvidos) && isBilhetesSemConferencia(lsBilhetesGapDevolvidos)){ - //return null; return false; }else{ - //Map totais = totalizarBoletoComissaoDevolvidosTrocaOcd(lsBilhetesGapDevolvidos); return true; - //return totais.get(BoletoStatusComissao.BOLETO_DEVOLVIDO); } } private boolean validaEventosFinanceiros(List boletosComissaos, Conferencia conferencia) throws BusinessException { ListlsEventosFinanceiros = carregarEventosFinanceiros(conferencia); if(!CollectionUtils.isEmpty(lsEventosFinanceiros) && isEventosFinanceirosSemConferencia(lsEventosFinanceiros)) { - //return null; return false; } else { return true; - //return lsEventosFinanceiros; } } private boolean validaOcds(Conferencia conferencia) throws BusinessException { List lsOcds = carregarOcds(conferencia); if(!CollectionUtils.isEmpty(lsOcds) && isOcdSemConferencia(lsOcds)) { - //return null; return false; } else { - return true; - //return totalizarOcd(lsOcds); - + return true; } } - -// private void carregarResumo(List boletosComissaos, Conferencia conferencia, List lsEventosFinanceiros, BigDecimal totalBilhetesManual, BigDecimal totalBilhetesVendidos, BigDecimal totalBilhetesCancelados, BigDecimal totalBilhetesDevolvidos,BigDecimal totalBilhetesGap,BigDecimal totalBilhetesGapCancelados,BigDecimal totalBilhetesGapDevolvidos, BigDecimal totalCreditosEventoFinanceiros,BigDecimal totalDebitosEventoFinanceiros, OcdVO ocdTotal ) throws BusinessException { -// gerarResumo(conferencia, boletosComissaos, lsEventosFinanceiros, totalBilhetesManual, totalBilhetesVendidos, totalBilhetesCancelados, totalBilhetesDevolvidos, totalBilhetesGap, totalBilhetesGapCancelados, totalBilhetesGapDevolvidos, totalCreditosEventoFinanceiros, totalDebitosEventoFinanceiros, ocdTotal); -// } }