gleimar 2017-02-13 19:00:55 +00:00
parent adfbd459dd
commit c4072eb0f6
2 changed files with 19 additions and 19 deletions

View File

@ -41,7 +41,7 @@ public interface ConferenciaComissaoService extends GenericService<Conferencia,
public LogConferencia obtenerLogConferenciaID(Long logconferenciaId);
public List<BoletoComissao> carregarBilhetesComissao(List<BoletoComissao> boletoComissaos, Conferencia conferencia, BoletoStatusComissao boletoStatusComissao) throws BusinessException;
public List<BoletoComissao> carregarBilhetesComissao(List<BoletoComissao> boletoComissaos, Conferencia conferencia, BoletoStatusComissao boletoStatusComissao, boolean carregarDadosFaltantes) throws BusinessException;
public List<OcdVO> carregarOcds(Conferencia conferencia) throws BusinessException;

View File

@ -170,7 +170,7 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
}
@Override
public List<BoletoComissao> carregarBilhetesComissao(List<BoletoComissao> boletoComissaos, Conferencia conferencia, BoletoStatusComissao boletoStatusComissao) throws BusinessException {
public List<BoletoComissao> carregarBilhetesComissao(List<BoletoComissao> boletoComissaos, Conferencia conferencia, BoletoStatusComissao boletoStatusComissao, boolean carregarDadosFaltantes) throws BusinessException {
if (boletoComissaos == null) {
boletoComissaos = conferenciaComissaoDAO.carregarBilhetesComissao(conferencia);
}
@ -188,16 +188,16 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
List<BoletoComissao> retorno = new ArrayList<BoletoComissao>();
switch (boletoStatusComissao) {
case BOLETOS_VENDIDOS:
retorno.addAll(carregarBilhetesVendidos(boletoComissaos, comEmpConferencia));
retorno.addAll(carregarBilhetesVendidos(boletoComissaos, comEmpConferencia, carregarDadosFaltantes));
break;
case BOLETO_MANUAL:
retorno.addAll(carregarBilhetesManuais(boletoComissaos, comEmpConferencia));
break;
case BOLETO_CANCELADO:
retorno.addAll(carregarBilhetesCancelados(boletoComissaos, comEmpConferencia));
retorno.addAll(carregarBilhetesCancelados(boletoComissaos, comEmpConferencia, carregarDadosFaltantes));
break;
case BOLETO_DEVOLVIDO:
retorno.addAll(carregarBilhetesDevolvidos(boletoComissaos, StringUtils.isNotBlank(conferencia.getNumfoliosistema()), comEmpConferencia));
retorno.addAll(carregarBilhetesDevolvidos(boletoComissaos, StringUtils.isNotBlank(conferencia.getNumfoliosistema()), comEmpConferencia, carregarDadosFaltantes));
break;
case GAP_VENDIDOS:
retorno.addAll(carregarBilhetesGapsVendidos(boletoComissaos, comEmpConferencia));
@ -229,10 +229,10 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
return boletos;
}
private Set<BoletoComissao> carregarBilhetesVendidos(List<BoletoComissao> boletoComissaos, ComEmpConferencia comEmpConferencia) {
private Set<BoletoComissao> carregarBilhetesVendidos(List<BoletoComissao> boletoComissaos, ComEmpConferencia comEmpConferencia, boolean carregarDadosFaltantes) {
Set<BoletoComissao> boletos = new HashSet<BoletoComissao>();
for (BoletoComissao boletoComissao : boletoComissaos) {
if (boletoComissao.isAbaBilheteVendido()) {
if (boletoComissao.isAbaBilheteVendido() || carregarDadosFaltantes) {
if (comEmpConferencia != null) {
boletoComissao.setExigeConferenciaAba(comEmpConferencia.getIndbilhetevendido());
@ -245,10 +245,10 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
return boletos;
}
private Set<BoletoComissao> carregarBilhetesCancelados(List<BoletoComissao> boletoComissaos, ComEmpConferencia comEmpConferencia) {
private Set<BoletoComissao> carregarBilhetesCancelados(List<BoletoComissao> boletoComissaos, ComEmpConferencia comEmpConferencia, boolean carregarDadosFaltantes) {
Set<BoletoComissao> boletos = new HashSet<BoletoComissao>();
for (BoletoComissao boletoComissao : boletoComissaos) {
if (boletoComissao.isAbaBilheteCancelado()) {
if (boletoComissao.isAbaBilheteCancelado() || carregarDadosFaltantes) {
if (comEmpConferencia != null) {
boletoComissao.setExigeConferenciaAba(comEmpConferencia.getIndbilhetecancelado());
@ -261,10 +261,10 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
return boletos;
}
private Set<BoletoComissao> carregarBilhetesDevolvidos(List<BoletoComissao> boletoComissaos, boolean pesquisa, ComEmpConferencia comEmpConferencia) {
private Set<BoletoComissao> carregarBilhetesDevolvidos(List<BoletoComissao> boletoComissaos, boolean pesquisa, ComEmpConferencia comEmpConferencia, boolean carregarDadosFaltantes) {
Set<BoletoComissao> boletos = new HashSet<BoletoComissao>();
for (BoletoComissao boletoComissao : boletoComissaos) {
if (boletoComissao.isAbaBilheteDevolvido()) {
if (boletoComissao.isAbaBilheteDevolvido() || carregarDadosFaltantes) {
boletoComissao.setExigeConferenciaDevolvido(boletoComissao.getIndcarboletosdevolvidosconf() != null && !boletoComissao.getIndcarboletosdevolvidosconf());
@ -695,7 +695,7 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
private boolean validaConferencia(Conferencia conferencia ) {
try {
List<BoletoComissao> boletosComissaos = carregarBilhetesComissao(null, conferencia, null);
List<BoletoComissao> boletosComissaos = carregarBilhetesComissao(null, conferencia, null, false);
if(boletosComissaos ==null || CollectionUtils.isEmpty(boletosComissaos)){
return false;
}
@ -743,7 +743,7 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
}
private boolean validaBilhetesManual(List<BoletoComissao> boletosComissaos, Conferencia conferencia ) throws BusinessException {
List<BoletoComissao> lsBilhetesManual = carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETO_MANUAL);
List<BoletoComissao> lsBilhetesManual = carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETO_MANUAL, false);
if(!CollectionUtils.isEmpty(lsBilhetesManual) && isBilhetesSemConferencia(lsBilhetesManual)){
return false;
}else{
@ -751,7 +751,7 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
}
}
private boolean validaBilhetesVendidos(List<BoletoComissao> boletosComissaos, Conferencia conferencia) throws BusinessException {
List<BoletoComissao> lsBilhetes = carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETOS_VENDIDOS);
List<BoletoComissao> lsBilhetes = carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETOS_VENDIDOS, false);
if(!CollectionUtils.isEmpty(lsBilhetes) && isBilhetesSemConferencia(lsBilhetes)){
return false;
@ -760,7 +760,7 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
}
}
private boolean validaBilhetesCancelados(List<BoletoComissao> boletosComissaos, Conferencia conferencia) throws BusinessException {
List<BoletoComissao> lsBilhetesCancelados = carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETO_CANCELADO);
List<BoletoComissao> lsBilhetesCancelados = carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETO_CANCELADO, false);
if(!CollectionUtils.isEmpty(lsBilhetesCancelados) && isBilhetesSemConferencia(lsBilhetesCancelados)){
return false;
}else{
@ -768,7 +768,7 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
}
}
private boolean validaBilhetesDevolvidos(List<BoletoComissao> boletosComissaos, Conferencia conferencia) throws BusinessException {
List<BoletoComissao> lsBilhetesDevolvidos = carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETO_DEVOLVIDO);
List<BoletoComissao> lsBilhetesDevolvidos = carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.BOLETO_DEVOLVIDO, false);
if(!CollectionUtils.isEmpty(lsBilhetesDevolvidos) && isBilhetesSemConferencia(lsBilhetesDevolvidos)){
return false;
}else{
@ -776,7 +776,7 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
}
}
private boolean validaBilhetesGap(List<BoletoComissao> boletosComissaos, Conferencia conferencia) throws BusinessException {
List<BoletoComissao> lsBilhetesGap = carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.GAP_VENDIDOS);
List<BoletoComissao> lsBilhetesGap = carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.GAP_VENDIDOS, false);
if(!CollectionUtils.isEmpty(lsBilhetesGap) && isBilhetesSemConferencia(lsBilhetesGap)){
return false;
}else{
@ -784,7 +784,7 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
}
}
private boolean validaBilhetesGapCancelados(List<BoletoComissao> boletosComissaos, Conferencia conferencia ) throws BusinessException {
List<BoletoComissao> lsBilhetesGapCancelados = carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.GAP_CANCELADO);
List<BoletoComissao> lsBilhetesGapCancelados = carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.GAP_CANCELADO, false);
if(!CollectionUtils.isEmpty(lsBilhetesGapCancelados) && isBilhetesSemConferencia(lsBilhetesGapCancelados)){
return false;
}else{
@ -793,7 +793,7 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
}
private boolean validaBilhetesGapDevolvidos(List<BoletoComissao> boletosComissaos, Conferencia conferencia) throws BusinessException {
List<BoletoComissao> lsBilhetesGapDevolvidos = carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.GAP_DEVOLVIDO);
List<BoletoComissao> lsBilhetesGapDevolvidos = carregarBilhetesComissao(boletosComissaos, conferencia, BoletoStatusComissao.GAP_DEVOLVIDO, false);
if(!CollectionUtils.isEmpty(lsBilhetesGapDevolvidos) && isBilhetesSemConferencia(lsBilhetesGapDevolvidos)){
return false;
}else{