git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@32323 d1611594-4594-4d17-8e1d-87c2c4800839
parent
7557b965fa
commit
eb50f75e4a
|
@ -65,6 +65,11 @@ public class PricingOcupaAntecipaServiceImpl implements PricingOcupaAntecipaServ
|
|||
|
||||
// removo o pricing que eu estou validando
|
||||
lsSalvos.remove(pricingOcupaAntecipa);
|
||||
|
||||
BigDecimal cantocupaini = pricingOcupaAntecipa.getOcupacioninicial();
|
||||
BigDecimal cantocupafin = pricingOcupaAntecipa.getOcupacionfinal();
|
||||
|
||||
boolean validaCantPorcentaje = ((cantocupaini != null) && (cantocupafin != null));
|
||||
|
||||
Integer cantasientosmin = pricingOcupaAntecipa.getCantasientosmin();
|
||||
Integer cantasientosmax = pricingOcupaAntecipa.getCantasientosmax();
|
||||
|
@ -75,14 +80,16 @@ public class PricingOcupaAntecipaServiceImpl implements PricingOcupaAntecipaServ
|
|||
Integer cantdiasmax = pricingOcupaAntecipa.getCantdiasmax();
|
||||
|
||||
boolean validaCantDias = ((cantdiasmin != null) && (cantdiasmax != null));
|
||||
|
||||
BigDecimal cantdiasini = pricingOcupaAntecipa.getOcupacioninicial();
|
||||
BigDecimal cantdiasfin = pricingOcupaAntecipa.getOcupacionfinal();
|
||||
|
||||
boolean validaCantPorcentaje = ((cantdiasini != null) && (cantdiasfin != null));
|
||||
|
||||
for (PricingOcupaAntecipa poa : lsSalvos) {
|
||||
|
||||
boolean traslapaCantPorcentaje = false;
|
||||
if (validaCantPorcentaje) {
|
||||
if ((poa.getOcupacioninicial() != null) && (poa.getOcupacionfinal() != null)) {
|
||||
traslapaCantPorcentaje = TraslaparUtil.intersectNum(poa.getOcupacioninicial(), poa.getOcupacionfinal(), cantocupaini, cantocupafin);
|
||||
}
|
||||
}
|
||||
|
||||
boolean traslapaCantAsiento = false;
|
||||
if (validaCantAsientos) {
|
||||
if ((poa.getCantasientosmin() != null) && (poa.getCantasientosmax() != null)) {
|
||||
|
@ -95,22 +102,16 @@ public class PricingOcupaAntecipaServiceImpl implements PricingOcupaAntecipaServ
|
|||
if ((poa.getCantdiasmin() != null) && (poa.getCantdiasmax() != null)) {
|
||||
traslapaCantDias = TraslaparUtil.intersectNum(poa.getCantdiasmin(), poa.getCantdiasmax(), cantdiasmin, cantdiasmax);
|
||||
}
|
||||
}
|
||||
|
||||
boolean traslapaCantPorcentaje = false;
|
||||
if (validaCantPorcentaje) {
|
||||
if ((poa.getOcupacioninicial() != null) && (poa.getOcupacionfinal() != null)) {
|
||||
traslapaCantPorcentaje = TraslaparUtil.intersectNum(poa.getOcupacioninicial(), poa.getOcupacionfinal(), cantdiasini, cantdiasfin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (traslapaCantAsiento || traslapaCantDias || traslapaCantPorcentaje) {
|
||||
if ((traslapaCantPorcentaje || traslapaCantAsiento ) && traslapaCantDias ){
|
||||
log.info("registro que traslapa PricingOcupaAntecipa id =" + poa.getPricingocupaantecipaId());
|
||||
|
||||
traslapa = true;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return traslapa;
|
||||
|
|
Loading…
Reference in New Issue