fixes bug #9485
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@72321 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
0a4e52f282
commit
9df105a41d
|
@ -9,7 +9,8 @@ import com.rjconsultores.ventaboletos.entidad.Ruta;
|
|||
import com.rjconsultores.ventaboletos.entidad.TarifaOficial;
|
||||
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
||||
import com.rjconsultores.ventaboletos.service.TarifaOficialService;
|
||||
public interface TarifaOficialDAO extends GenericDAO<TarifaOficial, Integer>{
|
||||
|
||||
public interface TarifaOficialDAO extends GenericDAO<TarifaOficial, Integer> {
|
||||
/**
|
||||
* See {@link TarifaOficialService#gerarTarifaPorCoeficiente(Integer, Integer)}
|
||||
* @param ruta
|
||||
|
@ -17,12 +18,12 @@ public interface TarifaOficialDAO extends GenericDAO<TarifaOficial, Integer>{
|
|||
* @param orgaoConcedenteId TODO
|
||||
* @return TODO
|
||||
*/
|
||||
public Integer gerarTarifaPorCoeficiente(Integer ruta, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||
|
||||
public Integer gerarTarifaPorCoeficiente(Integer ruta, Integer usuarioId, OrgaoConcedente orgaoConcedente, List<Integer> idsEmpresas);
|
||||
|
||||
public Integer gerarTarifaArtesp(Integer ruta, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||
|
||||
|
||||
public Integer gerarTabelaZerada(Integer ruta, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||
|
||||
|
||||
/**
|
||||
* See {@link TarifaOficialService#atualizarTarifaPorCoeficiente(Integer, Integer)}
|
||||
* @param rutaId
|
||||
|
@ -30,8 +31,8 @@ public interface TarifaOficialDAO extends GenericDAO<TarifaOficial, Integer>{
|
|||
* @param orgaoConcedenteId
|
||||
* @return TODO
|
||||
*/
|
||||
public Integer atualizarTarifaCoeficiente(Integer rutaId, Integer usuarioId, Integer orgaoConcedenteId);
|
||||
|
||||
public Integer atualizarTarifaCoeficiente(Integer rutaId, Integer usuarioId, OrgaoConcedente orgaoConcedenteId);
|
||||
|
||||
/**
|
||||
* See {@link TarifaOficialService#copiarParaTarifa(VigenciaTarifa)}
|
||||
* @param vigenciaTarifa
|
||||
|
@ -42,8 +43,8 @@ public interface TarifaOficialDAO extends GenericDAO<TarifaOficial, Integer>{
|
|||
* @param empresa Empresa
|
||||
* @param orgaoConcedente OrgaoConcedente
|
||||
*/
|
||||
public void copiarParaTarifa(VigenciaTarifa vigenciaTarifa, Integer usuarioId, Boolean calculaPegagio, Boolean calculaTarifa, Boolean calculaTaxaEmbarque, Boolean calculaSeguro, Boolean calculaTPP, 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);
|
||||
|
||||
/**
|
||||
* See {@link TarifaOficialService#atualizarTaxaEmbarque(Integer, Integer)}
|
||||
* @param rutaId
|
||||
|
@ -52,23 +53,23 @@ public interface TarifaOficialDAO extends GenericDAO<TarifaOficial, Integer>{
|
|||
* @param empresaId TODO
|
||||
*/
|
||||
public void atualizarTaxaEmbarque(List<Ruta> lsRuta, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||
|
||||
|
||||
/**
|
||||
* See {@link TarifaOficialService#atualizarSeguroPorKm(Integer, Integer, Integer)}
|
||||
* @param rutaId
|
||||
* @param orgaoId
|
||||
* @param usuarioId
|
||||
*/
|
||||
public void atualizarSeguroPorKm(Integer rutaId,Integer orgaoId,Integer usuarioId, TipoSeguro tipoSeguro) ;
|
||||
|
||||
public void atualizarSeguroPorKm(Integer rutaId, Integer orgaoId, Integer usuarioId, TipoSeguro tipoSeguro);
|
||||
|
||||
/**
|
||||
* See {@link TarifaOficialService#atualizarSeguroPorTarifa(Integer, Integer, Integer)}
|
||||
* @param rutaId
|
||||
* @param orgaoId
|
||||
* @param usuarioId
|
||||
*/
|
||||
public void atualizarSeguroPorTarifa(Integer rutaId, Integer orgaoId,Integer usuarioId);
|
||||
|
||||
public void atualizarSeguroPorTarifa(Integer rutaId, Integer orgaoId, Integer usuarioId);
|
||||
|
||||
/**
|
||||
* Aplica a regra de arredondamento para as tarifas do <EFBFBD>rg<EFBFBD>o concedente informado.<br/>
|
||||
*
|
||||
|
|
|
@ -40,9 +40,9 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
|||
}
|
||||
|
||||
@Override
|
||||
public Integer gerarTarifaPorCoeficiente(Integer rutaId, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas) {
|
||||
public Integer gerarTarifaPorCoeficiente(Integer rutaId, Integer usuarioId, OrgaoConcedente orgaoConcedente, List<Integer> idsEmpresas) {
|
||||
|
||||
String sql = sqlBuilder.getSQLGerarTarifaOficial(rutaId, usuarioId, orgaoConcedenteId, idsEmpresas);
|
||||
String sql = sqlBuilder.getSQLGerarTarifaOficial(rutaId, usuarioId, orgaoConcedente, idsEmpresas);
|
||||
|
||||
int qtd = getSession().createSQLQuery(sql).executeUpdate();
|
||||
|
||||
|
@ -70,15 +70,16 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
|||
}
|
||||
|
||||
@Override
|
||||
public Integer atualizarTarifaCoeficiente(Integer rutaId, Integer usuarioId, Integer orgaoConcedenteId) {
|
||||
public Integer atualizarTarifaCoeficiente(Integer rutaId, Integer usuarioId, OrgaoConcedente orgaoConcedente) {
|
||||
|
||||
String sql = sqlBuilder.getSQLAtualizarTarifaOficial(rutaId, usuarioId, orgaoConcedenteId);
|
||||
String sql = sqlBuilder.getSQLAtualizarTarifaOficial(rutaId, usuarioId, orgaoConcedente);
|
||||
|
||||
int qtd = getSession().createSQLQuery(sql).executeUpdate();
|
||||
|
||||
return qtd;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void limparTarifasOficiais(List<Empresa> lsEmpresaSelected) {
|
||||
|
||||
String query = "DELETE FROM TarifaOficial ";
|
||||
|
@ -162,7 +163,7 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
|||
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
|
||||
apagarTarifasInativas(vigenciaTarifa, empresa, orgaoConcedente);
|
||||
|
||||
|
||||
// Insiro as tarifas que não existem
|
||||
SQLQuery querySQL = getSession().createSQLQuery(sqlBuilder.getSQLInserirTarifaPelaTarifaOficial(vigenciaTarifa.getVigenciatarifaId(), usuarioId, empresa, orgaoConcedente));
|
||||
querySQL.executeUpdate();
|
||||
|
@ -218,7 +219,7 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
|||
SQLQuery query = getSession().createSQLQuery(sqlBuilder.getSQLAtualizarPrecioPorTPP(rutaId, usuarioId, orgaoId, tipoSeguro));
|
||||
query.executeUpdate();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void atualizarSeguroPorTarifa(Integer rutaId, Integer orgaoId, Integer usuarioId) {
|
||||
SQLQuery query = getSession().createSQLQuery(sqlBuilder.getSQLAtualizarSeguroPorTarifa(rutaId, usuarioId, orgaoId));
|
||||
|
@ -227,7 +228,7 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
|||
|
||||
@Override
|
||||
public long obtenerCount(List<Empresa> lsEmpresaSelected) {
|
||||
String query = " select count(*) from TarifaOficial ";
|
||||
String query = " select count(*) from TarifaOficial ";
|
||||
if (lsEmpresaSelected != null && !lsEmpresaSelected.isEmpty()) {
|
||||
query += "WHERE tarifaOficialId IN ( ";
|
||||
query += " SELECT t.tarifaOficialId FROM TarifaOficial t WHERE t.marca.empresa.empresaId IN (";
|
||||
|
@ -268,10 +269,11 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
|||
query.executeUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public void atualizarPedagio() {
|
||||
StringBuilder sql = new StringBuilder();
|
||||
|
||||
|
||||
if (ApplicationProperties.getInstance().artespPedagioIdaVoltaDivPor2()) {
|
||||
sql.append(" merge into tarifa_oficial ");
|
||||
sql.append(" using ");
|
||||
|
|
|
@ -7,7 +7,6 @@ import java.util.Map;
|
|||
import com.rjconsultores.ventaboletos.constantes.TipoSeguro;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||
import com.rjconsultores.ventaboletos.vo.caja.CajaVO;
|
||||
|
||||
/**
|
||||
* Interface que indica quais são os SQL nativos da aplicação.
|
||||
|
@ -22,14 +21,14 @@ import com.rjconsultores.ventaboletos.vo.caja.CajaVO;
|
|||
*/
|
||||
public interface SQLBuilder {
|
||||
|
||||
public String getSQLGerarTarifaOficial(Integer codRuta, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||
|
||||
public String getSQLGerarTarifaOficial(Integer codRuta, Integer usuarioId, OrgaoConcedente orgaoConcedente, List<Integer> idsEmpresas);
|
||||
|
||||
public String getSQLGerarTabelaZerada(Integer codRuta, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||
|
||||
public String getSQLAtualizarTarifaOficial(Integer rutaId, Integer usuarioId, Integer orgaoConcedenteId);
|
||||
|
||||
public String getSQLGerarTarifaOficialArtesp( Integer codRuta, Integer usuarioId,
|
||||
Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||
public String getSQLAtualizarTarifaOficial(Integer rutaId, Integer usuarioId, OrgaoConcedente orgaoConcedente);
|
||||
|
||||
public String getSQLGerarTarifaOficialArtesp(Integer codRuta, Integer usuarioId,
|
||||
Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||
|
||||
public String getAtualizarTaxaEmbarquePorKmParada(Integer rutaId, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||
|
||||
|
@ -52,9 +51,9 @@ public interface SQLBuilder {
|
|||
public String getSQLActualizarCorridaTramoFecHusoFecVerano();
|
||||
|
||||
public String getSQLBuscarCajaFecha(boolean yaCerrado, Date fechaDesde, Date fechaHasta);
|
||||
|
||||
|
||||
public String getSQLBuscarUsuariosCajaCerrado(Date fecha, String cveusuario, String turnoid);
|
||||
|
||||
|
||||
public String getSQLBuscarCajaCerrado(Integer usuarioId, Date fecha, String turnoid);
|
||||
|
||||
public String getSQLBuscarReceitasDespesasCaja(Integer usuarioId, Date fec);
|
||||
|
@ -63,7 +62,7 @@ public interface SQLBuilder {
|
|||
|
||||
public String getSQLAtualizarPrecioPorTPP(final Integer rutaId, final Integer usuarioId,
|
||||
final Integer orgaoConcedenteId, TipoSeguro tipoSeguro);
|
||||
|
||||
|
||||
/**
|
||||
* Venda Embarcada
|
||||
* @return Retorna a Query para a inserção dos valores da venda na tabela de Caja
|
||||
|
@ -78,6 +77,7 @@ public interface SQLBuilder {
|
|||
|
||||
/**
|
||||
* Venda Embarcada
|
||||
*
|
||||
* @return Retorna a Query para a inserção dos valores da venda na tabela de Boleto
|
||||
*/
|
||||
public String getSQLInserirBoletoVendaEmbarcada();
|
||||
|
|
|
@ -9,9 +9,10 @@ import com.rjconsultores.ventaboletos.constantes.Constantes;
|
|||
import com.rjconsultores.ventaboletos.constantes.TipoSeguro;
|
||||
import com.rjconsultores.ventaboletos.dao.sqlbuilder.SQLBuilder;
|
||||
import com.rjconsultores.ventaboletos.dao.util.DBUtil;
|
||||
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||
import com.rjconsultores.ventaboletos.enums.TipoFormapago;
|
||||
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
||||
|
||||
public class SQLBuilderOracle implements SQLBuilder {
|
||||
private static final Integer HORAS_NO_DIA = Integer.valueOf(24);
|
||||
|
@ -242,7 +243,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
|
||||
@Override
|
||||
public String getSQLGerarTarifaOficial(final Integer codRuta, final Integer usuarioId,
|
||||
final Integer orgaoConcedenteId, final List<Integer> idsEmpresas) {
|
||||
final OrgaoConcedente orgaoConcedente, final List<Integer> idsEmpresas) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(" INSERT ");
|
||||
|
@ -274,19 +275,25 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" select ");
|
||||
sb.append(" ");
|
||||
sb.append(" TARIFA_OFICIAL_SEQ.NEXTVAL, ");
|
||||
|
||||
sb.append(" ROUND( ");
|
||||
sb.append(" (coalesce(ct1.coeficiente,0) * coalesce(tc.kmcoeficiente1,0) + ");
|
||||
sb.append(" coalesce(ct2.coeficiente,0) * coalesce(tc.kmcoeficiente2,0) + ");
|
||||
sb.append(" coalesce(ct3.coeficiente,0) * coalesce(tc.kmcoeficiente3,0)) * ");
|
||||
sb.append(" case when e.icms is null then 1 else (1/(1-e.icms/100)) end ,2) ,");
|
||||
|
||||
sb.append(" ROUND( ");
|
||||
sb.append(" (coalesce(ct1.coeficiente,0) * coalesce(tc.kmcoeficiente1,0) + ");
|
||||
sb.append(" coalesce(ct2.coeficiente,0) * coalesce(tc.kmcoeficiente2,0) + ");
|
||||
sb.append(" coalesce(ct3.coeficiente,0) * coalesce(tc.kmcoeficiente3,0)) * ");
|
||||
sb.append(" case when e.icms is null then 1 else (1/(1-e.icms/100)) end ,2) ,");
|
||||
|
||||
|
||||
sb.append(" ROUND( ");
|
||||
sb.append(" (coalesce(ct1.coeficiente,0) * coalesce(tc.kmcoeficiente1,0) + ");
|
||||
sb.append(" coalesce(ct2.coeficiente,0) * coalesce(tc.kmcoeficiente2,0) + ");
|
||||
sb.append(" coalesce(ct3.coeficiente,0) * coalesce(tc.kmcoeficiente3,0)) * ");
|
||||
if (orgaoConcedente.getIndUtilizaICMS() != null && orgaoConcedente.getIndUtilizaICMS()) {
|
||||
sb.append(" case when e.icms is null then 1 else (1/(1-e.icms/100)) end ,2) ,");
|
||||
} else {
|
||||
sb.append(" 1, 2 ) ,");
|
||||
}
|
||||
sb.append(" ROUND( ");
|
||||
sb.append(" (coalesce(ct1.coeficiente,0) * coalesce(tc.kmcoeficiente1,0) + ");
|
||||
sb.append(" coalesce(ct2.coeficiente,0) * coalesce(tc.kmcoeficiente2,0) + ");
|
||||
sb.append(" coalesce(ct3.coeficiente,0) * coalesce(tc.kmcoeficiente3,0)) * ");
|
||||
if (orgaoConcedente.getIndUtilizaICMS() != null && orgaoConcedente.getIndUtilizaICMS()) {
|
||||
sb.append(" case when e.icms is null then 1 else (1/(1-e.icms/100)) end ,2) ,");
|
||||
} else {
|
||||
sb.append(" 1, 2 ) ,");
|
||||
}
|
||||
sb.append(" t.tramo_id, ");
|
||||
sb.append(" mc.marca_id, ");
|
||||
sb.append(" r.CLASESERVICIO_ID, ");
|
||||
|
@ -346,8 +353,8 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" and re.empresa_id in ( ").append(idsEmpresas.toString().substring(1, idsEmpresas.toString().length()-1)).append(" ) ");
|
||||
}
|
||||
sb.append(" and m.moneda_id = 1 ");
|
||||
if (orgaoConcedenteId != null && orgaoConcedenteId != -1) {
|
||||
sb.append(" and oc.orgaoconcedente_id = ").append(orgaoConcedenteId);
|
||||
if (orgaoConcedente != null && orgaoConcedente.getOrgaoConcedenteId() != null && orgaoConcedente.getOrgaoConcedenteId() != -1) {
|
||||
sb.append(" and oc.orgaoconcedente_id = ").append(orgaoConcedente.getOrgaoConcedenteId());
|
||||
}
|
||||
sb.append(" and ");
|
||||
sb.append(" (t.tramo_id, ");
|
||||
|
@ -364,7 +371,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
|
||||
@Override
|
||||
public String getSQLAtualizarTarifaOficial(final Integer rutaId, final Integer usuarioId,
|
||||
final Integer orgaoConcedenteId) {
|
||||
final OrgaoConcedente orgaoConcedente) {
|
||||
StringBuilder sb = new StringBuilder("");
|
||||
|
||||
sb.append("UPDATE TARIFA_OFICIAL SET PRECIO = ");
|
||||
|
@ -402,8 +409,8 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" and mc.marca_id <> -1 ");
|
||||
sb.append(" and tc.activo = 1 ");
|
||||
sb.append(" and m.moneda_id = 1 ");
|
||||
if (orgaoConcedenteId != null) {
|
||||
sb.append(" and oc.orgaoconcedente_id = ").append(orgaoConcedenteId);
|
||||
if (orgaoConcedente != null && orgaoConcedente.getOrgaoConcedenteId() != null) {
|
||||
sb.append(" and oc.orgaoconcedente_id = ").append(orgaoConcedente.getOrgaoConcedenteId());
|
||||
}
|
||||
sb.append(" and t.tramo_id = TARIFA_OFICIAL.tramo_id ");
|
||||
sb.append(" and mc.marca_id = TARIFA_OFICIAL.marca_id ");
|
||||
|
@ -420,8 +427,8 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
if (rutaId != null) {
|
||||
sb.append(" and ruta_id = ").append(rutaId);
|
||||
}
|
||||
if (orgaoConcedenteId != null) {
|
||||
sb.append(" and orgaoconcedente_id = ").append(orgaoConcedenteId);
|
||||
if (orgaoConcedente != null && orgaoConcedente.getOrgaoConcedenteId() != null) {
|
||||
sb.append(" and orgaoconcedente_id = ").append(orgaoConcedente.getOrgaoConcedenteId());
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
|
|
|
@ -24,7 +24,7 @@ import javax.persistence.TemporalType;
|
|||
@Entity
|
||||
@SequenceGenerator(name = "ORGAO_CONCEDENTE_SEQ", sequenceName = "ORGAO_CONCEDENTE_SEQ", allocationSize = 1)
|
||||
@Table(name = "ORGAO_CONCEDENTE")
|
||||
public class OrgaoConcedente implements Serializable {
|
||||
public class OrgaoConcedente implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
public final static Integer CODIGO_ARTESP = 21;
|
||||
|
@ -62,6 +62,8 @@ public class OrgaoConcedente implements Serializable {
|
|||
@JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID")
|
||||
@ManyToOne()
|
||||
private Categoria categoria;
|
||||
@Column(name = "INDUTILIZAICMS")
|
||||
private Boolean indUtilizaICMS;
|
||||
|
||||
@OneToMany(mappedBy = "orgaoConcedente", cascade = CascadeType.ALL)
|
||||
private List<ClasseIndicePeaje> classesIndicePeaje;
|
||||
|
@ -161,7 +163,7 @@ public class OrgaoConcedente implements Serializable {
|
|||
public void setIndicePeaje(BigDecimal indicePeaje) {
|
||||
this.indicePeaje = indicePeaje;
|
||||
}
|
||||
|
||||
|
||||
public Integer getIdadeIdoso() {
|
||||
return idadeIdoso;
|
||||
}
|
||||
|
@ -182,7 +184,7 @@ public class OrgaoConcedente implements Serializable {
|
|||
|
||||
public void setClassesIndicePeaje(List<ClasseIndicePeaje> classesIndicePeaje) {
|
||||
this.classesIndicePeaje = classesIndicePeaje;
|
||||
}
|
||||
}
|
||||
|
||||
public Integer getIdadeMinima() {
|
||||
return idadeMinima;
|
||||
|
@ -205,6 +207,14 @@ public class OrgaoConcedente implements Serializable {
|
|||
return descOrgao;
|
||||
}
|
||||
|
||||
public Boolean getIndUtilizaICMS() {
|
||||
return indUtilizaICMS;
|
||||
}
|
||||
|
||||
public void setIndUtilizaICMS(Boolean indUtilizaICMS) {
|
||||
this.indUtilizaICMS = indUtilizaICMS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
|
|
|
@ -31,7 +31,7 @@ public interface TarifaOficialService {
|
|||
* @param orgaoConcedenteId
|
||||
* @return A quantidade de registros afetadas
|
||||
*/
|
||||
public Integer gerarTarifaPorCoeficiente(Integer rutaId, Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||
public Integer gerarTarifaPorCoeficiente(Integer rutaId, OrgaoConcedente orgaoConcedente, List<Integer> idsEmpresas);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -50,7 +50,7 @@ public interface TarifaOficialService {
|
|||
* @param orgaoConcedenteId
|
||||
* @return - Quantidade de tarifas atualizadas
|
||||
*/
|
||||
public Integer atualizarTarifaPorCoeficiente(Integer rutaId, Integer orgaoConcedenteId);
|
||||
public Integer atualizarTarifaPorCoeficiente(Integer rutaId, OrgaoConcedente orgaoConcedente);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -62,8 +62,8 @@ public interface TarifaOficialService {
|
|||
* @param empresaId
|
||||
* @throws BusinessException
|
||||
*/
|
||||
public void gerarAtualizarTarifa(List<Ruta> lsRuta, Integer orgaoConcedenteId, List<Empresa> lsEmpresaSelected) throws BusinessException ;
|
||||
|
||||
public void gerarAtualizarTarifa(List<Ruta> lsRuta, OrgaoConcedente orgaoConcedenteId, List<Empresa> lsEmpresaSelected) throws BusinessException;
|
||||
|
||||
/**
|
||||
* Copia a tarifa oficial para a tabela de tarifa de acordo com a vigencia especificada.<br/>
|
||||
*
|
||||
|
@ -125,7 +125,7 @@ public interface TarifaOficialService {
|
|||
* See {@link TarifaOficialDAO#aplicarArredondamentoTarifa(Integer, Integer)}
|
||||
* @param orgaoConcedenteId -Se informado, será filtrado pelo orgão
|
||||
*/
|
||||
public void aplicarArredondamentoTarifa(Integer orgaoConcedenteId, Boolean taxaEmbarque) ;
|
||||
public void aplicarArredondamentoTarifa(Integer orgaoConcedenteId, Boolean taxaEmbarque);
|
||||
|
||||
public void actualizacion(TarifaOficial tarifaOficial);
|
||||
|
||||
|
|
|
@ -39,14 +39,14 @@ public class TarifaOficialServiceImpl implements TarifaOficialService {
|
|||
|
||||
@Override
|
||||
@Transactional
|
||||
public Integer gerarTarifaPorCoeficiente(Integer rutaId, Integer orgaoConcedenteId, List<Integer> idsEmpresas) {
|
||||
return tarifaOficialDAO.gerarTarifaPorCoeficiente(rutaId, UsuarioLogado.getUsuarioLogado().getUsuarioId(), orgaoConcedenteId, idsEmpresas);
|
||||
public Integer gerarTarifaPorCoeficiente(Integer rutaId, OrgaoConcedente orgaoConcedente, List<Integer> idsEmpresas) {
|
||||
return tarifaOficialDAO.gerarTarifaPorCoeficiente(rutaId, UsuarioLogado.getUsuarioLogado().getUsuarioId(), orgaoConcedente, idsEmpresas);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Integer atualizarTarifaPorCoeficiente(Integer rutaId, Integer orgaoConcedenteId) {
|
||||
return tarifaOficialDAO.atualizarTarifaCoeficiente(rutaId, UsuarioLogado.getUsuarioLogado().getUsuarioId(), orgaoConcedenteId);
|
||||
public Integer atualizarTarifaPorCoeficiente(Integer rutaId, OrgaoConcedente orgaoConcedente) {
|
||||
return tarifaOficialDAO.atualizarTarifaCoeficiente(rutaId, UsuarioLogado.getUsuarioLogado().getUsuarioId(), orgaoConcedente);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -58,8 +58,8 @@ public class TarifaOficialServiceImpl implements TarifaOficialService {
|
|||
|
||||
@Override
|
||||
@Transactional(rollbackFor = BusinessException.class)
|
||||
public void gerarAtualizarTarifa(List<Ruta> lsRuta, Integer orgaoConcedenteId, List<Empresa> lsEmpresaSelected) throws BusinessException {
|
||||
|
||||
public void gerarAtualizarTarifa(List<Ruta> lsRuta, OrgaoConcedente orgaoConcedente, List<Empresa> lsEmpresaSelected) throws BusinessException {
|
||||
|
||||
// Limpando a tabela de TARIFA_OFICIAL
|
||||
tarifaOficialDAO.limparTarifasOficiais(lsEmpresaSelected);
|
||||
|
||||
|
@ -79,19 +79,19 @@ public class TarifaOficialServiceImpl implements TarifaOficialService {
|
|||
Ruta r = lsRuta.get(x-1);
|
||||
rutaId = r.getRutaId();
|
||||
}
|
||||
|
||||
log.info("gerarAtualizarTarifa= rudaId:"+rutaId+";orgaoConcedenteId:"+orgaoConcedenteId+";empresaId:"+idsEmpresas);
|
||||
|
||||
//Gerando as tarifas pelo coeficiente
|
||||
if(orgaoConcedenteId ==null || orgaoConcedenteId != OrgaoConcedente.CODIGO_ARTESP){
|
||||
Integer qtdTarifaCoeficiente = gerarTarifaPorCoeficiente(rutaId, orgaoConcedenteId, idsEmpresas);
|
||||
log.info("qtdTarifaCoeficiente="+qtdTarifaCoeficiente);
|
||||
|
||||
log.info("gerarAtualizarTarifa= rudaId:" + rutaId + ";orgaoConcedenteId:" + orgaoConcedente.getOrgaoConcedenteId() + ";empresaId:" + idsEmpresas);
|
||||
|
||||
// Gerando as tarifas pelo coeficiente
|
||||
if (orgaoConcedente.getOrgaoConcedenteId() == null || orgaoConcedente.getOrgaoConcedenteId() != OrgaoConcedente.CODIGO_ARTESP) {
|
||||
Integer qtdTarifaCoeficiente = gerarTarifaPorCoeficiente(rutaId, orgaoConcedente, idsEmpresas);
|
||||
log.info("qtdTarifaCoeficiente=" + qtdTarifaCoeficiente);
|
||||
}
|
||||
|
||||
//Gerando as tarifas para ARTESP
|
||||
if(orgaoConcedenteId ==null || orgaoConcedenteId == OrgaoConcedente.CODIGO_ARTESP ){
|
||||
Integer qtdTarifaArtesp = tarifaOficialDAO.gerarTarifaArtesp(rutaId, UsuarioLogado.getUsuarioLogado().getUsuarioId(), orgaoConcedenteId, idsEmpresas);
|
||||
log.info("qtdTarifaArtesp="+qtdTarifaArtesp);
|
||||
|
||||
// Gerando as tarifas para ARTESP
|
||||
if (orgaoConcedente.getOrgaoConcedenteId() == null || orgaoConcedente.getOrgaoConcedenteId() == OrgaoConcedente.CODIGO_ARTESP) {
|
||||
Integer qtdTarifaArtesp = tarifaOficialDAO.gerarTarifaArtesp(rutaId, UsuarioLogado.getUsuarioLogado().getUsuarioId(), orgaoConcedente.getOrgaoConcedenteId(), idsEmpresas);
|
||||
log.info("qtdTarifaArtesp=" + qtdTarifaArtesp);
|
||||
}
|
||||
x--;
|
||||
}while(x > 0);
|
||||
|
|
Loading…
Reference in New Issue