fixed bug #6735 - Incluidos orgãos concedentes com mesmos cálculo da antt. Alterado código para verificarem duas listas( ORGAOS_CONCEDENTES_CALCULO_ANTT e ORGAOS_CONCEDENTES_CALCULO_ARTESP) e caso sejam inseridos novos órgãos que sejam adicionados nessas listas e passarão a calcular conforme um desses órgãos principais.
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@48934 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
1c1425bfcb
commit
db428b2203
|
@ -1,5 +1,10 @@
|
||||||
package com.rjconsultores.ventaboletos.constantes;
|
package com.rjconsultores.ventaboletos.constantes;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
public class Constantes {
|
public class Constantes {
|
||||||
|
|
||||||
public static final Long FORMA_PAGO_RESERVA = new Long(94);
|
public static final Long FORMA_PAGO_RESERVA = new Long(94);
|
||||||
|
@ -18,6 +23,9 @@ public class Constantes {
|
||||||
public static Long TPV_RESERVACION_POR_INTERNET = new Long(16);
|
public static Long TPV_RESERVACION_POR_INTERNET = new Long(16);
|
||||||
public static Long TPV_POR_INTERNET = new Long(12);
|
public static Long TPV_POR_INTERNET = new Long(12);
|
||||||
public static Long TPV_AGENCIA_WEB = new Long(19);
|
public static Long TPV_AGENCIA_WEB = new Long(19);
|
||||||
|
|
||||||
|
public static List<Integer> ORGAOS_CONCEDENTES_CALCULO_ARTESP = new ArrayList<Integer>(Arrays.asList(new Integer[]{21})) ;
|
||||||
|
public static List<Integer> ORGAOS_CONCEDENTES_CALCULO_ANTT = new ArrayList<Integer>(Arrays.asList(new Integer[]{3,22,15}));
|
||||||
|
|
||||||
public static String CLAVE_EDITAR_COMISSAO = "COM.RJCONSULTORES.ADMINISTRACION.PUNTOVENTA.EDITARCOMISSAO";
|
public static String CLAVE_EDITAR_COMISSAO = "COM.RJCONSULTORES.ADMINISTRACION.PUNTOVENTA.EDITARCOMISSAO";
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.ResultSet;
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -16,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.constantes.Constantes;
|
||||||
import com.rjconsultores.ventaboletos.dao.CalcularPeajeDAO;
|
import com.rjconsultores.ventaboletos.dao.CalcularPeajeDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||||
|
@ -126,7 +126,7 @@ public class CalcularPeajeHibernateDAO extends GenericHibernateDAO<String, Strin
|
||||||
BigDecimal indice = orgao.getIndicePeaje();
|
BigDecimal indice = orgao.getIndicePeaje();
|
||||||
BigDecimal pedagioPuro = pvo.getImportePeaje();
|
BigDecimal pedagioPuro = pvo.getImportePeaje();
|
||||||
BigDecimal pedagioCalculado = BigDecimal.valueOf(0);
|
BigDecimal pedagioCalculado = BigDecimal.valueOf(0);
|
||||||
if(orgao.getOrgaoConcedenteId() == 21){ // 21 = artesp
|
if(Constantes.ORGAOS_CONCEDENTES_CALCULO_ARTESP.contains(orgao.getOrgaoConcedenteId())){ // 21 = artesp
|
||||||
if(qtdEixos == null || cantAsientos == null ){
|
if(qtdEixos == null || cantAsientos == null ){
|
||||||
int[] x ={-1,r.getRutaId()};
|
int[] x ={-1,r.getRutaId()};
|
||||||
return x;}else{
|
return x;}else{
|
||||||
|
@ -136,7 +136,7 @@ public class CalcularPeajeHibernateDAO extends GenericHibernateDAO<String, Strin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pedagioCalculado = BigDecimal.valueOf(((pedagioPuro.doubleValue() * qtdEixos) / indice.doubleValue()));
|
pedagioCalculado = BigDecimal.valueOf(((pedagioPuro.doubleValue() * qtdEixos) / indice.doubleValue()));
|
||||||
}else if(orgao.getOrgaoConcedenteId() == 3){// 3 = antt
|
}else if(Constantes.ORGAOS_CONCEDENTES_CALCULO_ANTT.contains(orgao.getOrgaoConcedenteId())){// 3 = antt
|
||||||
if(qtdEixos == null || cantAsientos == null ){
|
if(qtdEixos == null || cantAsientos == null ){
|
||||||
int[] x ={-1,r.getRutaId()};
|
int[] x ={-1,r.getRutaId()};
|
||||||
return x;}else{
|
return x;}else{
|
||||||
|
|
Loading…
Reference in New Issue