Fixes Bug #0009192
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@71385 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
e68493d3c2
commit
f2153c0e6f
|
@ -16,6 +16,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.TipoSeguro;
|
||||||
import com.rjconsultores.ventaboletos.dao.TarifaOficialDAO;
|
import com.rjconsultores.ventaboletos.dao.TarifaOficialDAO;
|
||||||
import com.rjconsultores.ventaboletos.dao.sqlbuilder.SQLBuilder;
|
import com.rjconsultores.ventaboletos.dao.sqlbuilder.SQLBuilder;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
@ -158,7 +159,7 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void copiarParaTarifa(VigenciaTarifa vigenciaTarifa, Integer usuarioId, Boolean calculaPegagio, Boolean calculaTarifa, Boolean calculaTaxaEmbarque, Boolean calculaSeguro, Empresa empresa, OrgaoConcedente orgaoConcedente) {
|
public void copiarParaTarifa(VigenciaTarifa vigenciaTarifa, Integer usuarioId, Boolean calculaPegagio, Boolean calculaTarifa, Boolean calculaTaxaEmbarque, Boolean calculaSeguro, Boolean calculaTPP, Empresa empresa, OrgaoConcedente orgaoConcedente) {
|
||||||
//Apago antes as tarifas que podem estar como activo =0
|
//Apago antes as tarifas que podem estar como activo =0
|
||||||
apagarTarifasInativas(vigenciaTarifa, empresa, orgaoConcedente);
|
apagarTarifasInativas(vigenciaTarifa, empresa, orgaoConcedente);
|
||||||
|
|
||||||
|
@ -170,7 +171,7 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
||||||
querySQL.setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP);
|
querySQL.setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP);
|
||||||
List<Map<String, Object>> dados = querySQL.list();
|
List<Map<String, Object>> dados = querySQL.list();
|
||||||
for (Map<String, Object> dado : dados) {
|
for (Map<String, Object> dado : dados) {
|
||||||
querySQL = getSession().createSQLQuery(sqlBuilder.getSQLAtualizarTarifaPorTarifaOfical(dado, usuarioId, calculaPegagio, calculaTarifa, calculaTaxaEmbarque, calculaSeguro));
|
querySQL = getSession().createSQLQuery(sqlBuilder.getSQLAtualizarTarifaPorTarifaOfical(dado, usuarioId, calculaPegagio, calculaTarifa, calculaTaxaEmbarque, calculaSeguro, calculaTPP));
|
||||||
querySQL.executeUpdate();
|
querySQL.executeUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -207,8 +208,14 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void atualizarSeguroPorKm(Integer rutaId, Integer orgaoId, Integer usuarioId) {
|
public void atualizarSeguroPorKm(Integer rutaId, Integer orgaoId, Integer usuarioId, TipoSeguro tipoSeguro) {
|
||||||
SQLQuery query = getSession().createSQLQuery(sqlBuilder.getSQLAtualizarSeguroPorKm(rutaId, usuarioId, orgaoId));
|
SQLQuery query = getSession().createSQLQuery(sqlBuilder.getSQLAtualizarSeguroPorKm(rutaId, usuarioId, orgaoId, tipoSeguro));
|
||||||
|
query.executeUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void atualizarPrecioPorTPP(Integer rutaId, Integer orgaoId, Integer usuarioId, TipoSeguro tipoSeguro) {
|
||||||
|
SQLQuery query = getSession().createSQLQuery(sqlBuilder.getSQLAtualizarPrecioPorTPP(rutaId, usuarioId, orgaoId, tipoSeguro));
|
||||||
query.executeUpdate();
|
query.executeUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,7 +226,7 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long obtenerCount(List<Empresa> lsEmpresaSelected){
|
public long obtenerCount(List<Empresa> lsEmpresaSelected) {
|
||||||
String query = " select count(*) from TarifaOficial ";
|
String query = " select count(*) from TarifaOficial ";
|
||||||
if (lsEmpresaSelected != null && !lsEmpresaSelected.isEmpty()) {
|
if (lsEmpresaSelected != null && !lsEmpresaSelected.isEmpty()) {
|
||||||
query += "WHERE tarifaOficialId IN ( ";
|
query += "WHERE tarifaOficialId IN ( ";
|
||||||
|
|
Loading…
Reference in New Issue