Fixes Bug #0009235
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@71674 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
62386d7235
commit
6484b292b7
|
@ -103,7 +103,7 @@ public class CalcularPeajeHibernateDAO extends GenericHibernateDAO<String, Strin
|
|||
.append(" tt.tra as tracomb, tt.orig as ttorig, tt.dest as ttdest, ")
|
||||
.append(" tt.tradesc as tracombdesc, tt.traorig as tracomborig, tt.tradest as tracombdest, ")
|
||||
.append(" tt.travia as tracombvia, tt.tracantkm as tracombcantkm, tt.tracantkmpago as tracombcantkmpago, ")
|
||||
.append(" tt.traactivo as tracombactivo, tt.trafecmodif as tracombfecmodif, tt.trausuario as tracombusuario ")
|
||||
.append(" tt.traactivo as tracombactivo, tt.trafecmodif as tracombfecmodif, tt.trausuario as tracombusuario, emp.NOMBEMPRESA, es.NOMBESTADO ")
|
||||
.append(" from ruta_secuencia rseqorig ")
|
||||
.append(" inner join tramo torig on torig.tramo_id = rseqorig.tramo_id and rseqorig.ruta_id = :rutaId ")
|
||||
.append(" inner join ruta_secuencia rseqdest on rseqorig.ruta_id = rseqdest.ruta_id ")
|
||||
|
@ -114,6 +114,10 @@ public class CalcularPeajeHibernateDAO extends GenericHibernateDAO<String, Strin
|
|||
.append(" inner join ciudad corig on corig.ciudad_id = porig.ciudad_id ")
|
||||
.append(" inner join estado eorig on eorig.estado_id = corig.estado_id ")
|
||||
.append(" inner join empresa_imposto eiorig on eiorig.empresa_id = e.empresa_id and eiorig.estado_id = eorig.estado_id ")
|
||||
|
||||
.append(" join empresa emp on emp.empresa_id = eiorig.empresa_id ")
|
||||
.append(" join estado es on eiorig.estado_id = es.estado_id ")
|
||||
|
||||
.append(" inner join tramo_tmp tt on torig.origen_id = tt.orig and tdest.destino_id = tt.dest ")
|
||||
.append(" where rseqorig.activo = 1 and torig.activo = 1 and rseqdest.activo = 1 and tdest.activo = 1 and re.activo = 1 and e.activo = 1 and porig.activo = 1 and corig.activo = 1 and eorig.activo = 1 ")
|
||||
.append("), caseta_tramo_da_ruta as ( ")
|
||||
|
@ -132,7 +136,7 @@ public class CalcularPeajeHibernateDAO extends GenericHibernateDAO<String, Strin
|
|||
.append("select distinct origen_tramo_inicial_seq, destino_tramo_final_seq, tramo_orig, tramo_dest, tracomb, ttorig, ttdest, ")
|
||||
.append(" tracombdesc, tracomborig, tracombdest, tracombvia, tracombcantkm, tracombcantkmpago, tracombactivo, ")
|
||||
.append(" tracombfecmodif, tracombusuario, rutacasetaid, rutasecuenciaid, casetapeaje_id, tramoid, casetapeajeid, ")
|
||||
.append(" desccaseta, importeida, importevuelta, caspactivo, caspfecmodif, caspusuario, icms ")
|
||||
.append(" desccaseta, importeida, importevuelta, caspactivo, caspfecmodif, caspusuario, icms, NOMBEMPRESA, NOMBESTADO ")
|
||||
.append("from mytable my ")
|
||||
.append(" inner join caseta_tramo_da_ruta ctr on ctr.numsecuencia between my.origen_tramo_inicial_seq and my.destino_tramo_final_seq ")
|
||||
.append(" order by tracomb ");
|
||||
|
@ -147,7 +151,7 @@ public class CalcularPeajeHibernateDAO extends GenericHibernateDAO<String, Strin
|
|||
}
|
||||
|
||||
// pra cada ruta obter as combinacoes de tramos, cada tramo com sua lista de casetaPeaje
|
||||
public int[] gerarSQLInserirPeajes(List<Ruta> lsRuta, OrgaoConcedente orgao, boolean usaICMS) {
|
||||
public int[] gerarSQLInserirPeajes(List<Ruta> lsRuta, OrgaoConcedente orgao, boolean usaICMS) throws Exception {
|
||||
boolean isOrgaoNull = orgao == null;
|
||||
List<String> updates = new ArrayList<String>();
|
||||
Set<PeajeVO> peajes = new HashSet<CalcularPeajeHibernateDAO.PeajeVO>();
|
||||
|
@ -181,6 +185,10 @@ public class CalcularPeajeHibernateDAO extends GenericHibernateDAO<String, Strin
|
|||
if (null != lsObj) {
|
||||
|
||||
for (Object arrObj : lsObj) {
|
||||
|
||||
if (((Object[]) arrObj)[27] == null) {
|
||||
throw new Exception (((Object[])arrObj)[28].toString() + " / " + ((Object[])arrObj)[29].toString());
|
||||
}
|
||||
BigDecimal bigKm = new BigDecimal(((Object[]) arrObj)[11].toString()) ;
|
||||
PeajeVO pvo = PeajeVO.create(ruta, orgao, (Object[]) arrObj, classeIndicePeajes, usaICMS, bigKm);
|
||||
// ATENCAO !!!
|
||||
|
|
Loading…
Reference in New Issue