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,6 +9,7 @@ import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||||
import com.rjconsultores.ventaboletos.entidad.TarifaOficial;
|
import com.rjconsultores.ventaboletos.entidad.TarifaOficial;
|
||||||
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
||||||
import com.rjconsultores.ventaboletos.service.TarifaOficialService;
|
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)}
|
* See {@link TarifaOficialService#gerarTarifaPorCoeficiente(Integer, Integer)}
|
||||||
|
@ -17,7 +18,7 @@ public interface TarifaOficialDAO extends GenericDAO<TarifaOficial, Integer>{
|
||||||
* @param orgaoConcedenteId TODO
|
* @param orgaoConcedenteId TODO
|
||||||
* @return 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 gerarTarifaArtesp(Integer ruta, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||||
|
|
||||||
|
@ -30,7 +31,7 @@ public interface TarifaOficialDAO extends GenericDAO<TarifaOficial, Integer>{
|
||||||
* @param orgaoConcedenteId
|
* @param orgaoConcedenteId
|
||||||
* @return TODO
|
* @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)}
|
* See {@link TarifaOficialService#copiarParaTarifa(VigenciaTarifa)}
|
||||||
|
|
|
@ -40,9 +40,9 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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();
|
int qtd = getSession().createSQLQuery(sql).executeUpdate();
|
||||||
|
|
||||||
|
@ -70,15 +70,16 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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();
|
int qtd = getSession().createSQLQuery(sql).executeUpdate();
|
||||||
|
|
||||||
return qtd;
|
return qtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void limparTarifasOficiais(List<Empresa> lsEmpresaSelected) {
|
public void limparTarifasOficiais(List<Empresa> lsEmpresaSelected) {
|
||||||
|
|
||||||
String query = "DELETE FROM TarifaOficial ";
|
String query = "DELETE FROM TarifaOficial ";
|
||||||
|
@ -268,6 +269,7 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
||||||
query.executeUpdate();
|
query.executeUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public void atualizarPedagio() {
|
public void atualizarPedagio() {
|
||||||
StringBuilder sql = new StringBuilder();
|
StringBuilder sql = new StringBuilder();
|
||||||
|
|
|
@ -7,7 +7,6 @@ import java.util.Map;
|
||||||
import com.rjconsultores.ventaboletos.constantes.TipoSeguro;
|
import com.rjconsultores.ventaboletos.constantes.TipoSeguro;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
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.
|
* Interface que indica quais são os SQL nativos da aplicação.
|
||||||
|
@ -22,11 +21,11 @@ import com.rjconsultores.ventaboletos.vo.caja.CajaVO;
|
||||||
*/
|
*/
|
||||||
public interface SQLBuilder {
|
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 getSQLGerarTabelaZerada(Integer codRuta, Integer usuarioId, Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||||
|
|
||||||
public String getSQLAtualizarTarifaOficial(Integer rutaId, Integer usuarioId, Integer orgaoConcedenteId);
|
public String getSQLAtualizarTarifaOficial(Integer rutaId, Integer usuarioId, OrgaoConcedente orgaoConcedente);
|
||||||
|
|
||||||
public String getSQLGerarTarifaOficialArtesp(Integer codRuta, Integer usuarioId,
|
public String getSQLGerarTarifaOficialArtesp(Integer codRuta, Integer usuarioId,
|
||||||
Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
Integer orgaoConcedenteId, List<Integer> idsEmpresas);
|
||||||
|
@ -78,6 +77,7 @@ public interface SQLBuilder {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Venda Embarcada
|
* Venda Embarcada
|
||||||
|
*
|
||||||
* @return Retorna a Query para a inserção dos valores da venda na tabela de Boleto
|
* @return Retorna a Query para a inserção dos valores da venda na tabela de Boleto
|
||||||
*/
|
*/
|
||||||
public String getSQLInserirBoletoVendaEmbarcada();
|
public String getSQLInserirBoletoVendaEmbarcada();
|
||||||
|
|
|
@ -9,9 +9,10 @@ import com.rjconsultores.ventaboletos.constantes.Constantes;
|
||||||
import com.rjconsultores.ventaboletos.constantes.TipoSeguro;
|
import com.rjconsultores.ventaboletos.constantes.TipoSeguro;
|
||||||
import com.rjconsultores.ventaboletos.dao.sqlbuilder.SQLBuilder;
|
import com.rjconsultores.ventaboletos.dao.sqlbuilder.SQLBuilder;
|
||||||
import com.rjconsultores.ventaboletos.dao.util.DBUtil;
|
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.entidad.OrgaoConcedente;
|
||||||
import com.rjconsultores.ventaboletos.enums.TipoFormapago;
|
import com.rjconsultores.ventaboletos.enums.TipoFormapago;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
||||||
|
|
||||||
public class SQLBuilderOracle implements SQLBuilder {
|
public class SQLBuilderOracle implements SQLBuilder {
|
||||||
private static final Integer HORAS_NO_DIA = Integer.valueOf(24);
|
private static final Integer HORAS_NO_DIA = Integer.valueOf(24);
|
||||||
|
@ -242,7 +243,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSQLGerarTarifaOficial(final Integer codRuta, final Integer usuarioId,
|
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();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(" INSERT ");
|
sb.append(" INSERT ");
|
||||||
|
@ -279,14 +280,20 @@ public class SQLBuilderOracle implements SQLBuilder {
|
||||||
sb.append(" (coalesce(ct1.coeficiente,0) * coalesce(tc.kmcoeficiente1,0) + ");
|
sb.append(" (coalesce(ct1.coeficiente,0) * coalesce(tc.kmcoeficiente1,0) + ");
|
||||||
sb.append(" coalesce(ct2.coeficiente,0) * coalesce(tc.kmcoeficiente2,0) + ");
|
sb.append(" coalesce(ct2.coeficiente,0) * coalesce(tc.kmcoeficiente2,0) + ");
|
||||||
sb.append(" coalesce(ct3.coeficiente,0) * coalesce(tc.kmcoeficiente3,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) ,");
|
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(" ROUND( ");
|
||||||
sb.append(" (coalesce(ct1.coeficiente,0) * coalesce(tc.kmcoeficiente1,0) + ");
|
sb.append(" (coalesce(ct1.coeficiente,0) * coalesce(tc.kmcoeficiente1,0) + ");
|
||||||
sb.append(" coalesce(ct2.coeficiente,0) * coalesce(tc.kmcoeficiente2,0) + ");
|
sb.append(" coalesce(ct2.coeficiente,0) * coalesce(tc.kmcoeficiente2,0) + ");
|
||||||
sb.append(" coalesce(ct3.coeficiente,0) * coalesce(tc.kmcoeficiente3,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) ,");
|
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(" t.tramo_id, ");
|
||||||
sb.append(" mc.marca_id, ");
|
sb.append(" mc.marca_id, ");
|
||||||
sb.append(" r.CLASESERVICIO_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 re.empresa_id in ( ").append(idsEmpresas.toString().substring(1, idsEmpresas.toString().length()-1)).append(" ) ");
|
||||||
}
|
}
|
||||||
sb.append(" and m.moneda_id = 1 ");
|
sb.append(" and m.moneda_id = 1 ");
|
||||||
if (orgaoConcedenteId != null && orgaoConcedenteId != -1) {
|
if (orgaoConcedente != null && orgaoConcedente.getOrgaoConcedenteId() != null && orgaoConcedente.getOrgaoConcedenteId() != -1) {
|
||||||
sb.append(" and oc.orgaoconcedente_id = ").append(orgaoConcedenteId);
|
sb.append(" and oc.orgaoconcedente_id = ").append(orgaoConcedente.getOrgaoConcedenteId());
|
||||||
}
|
}
|
||||||
sb.append(" and ");
|
sb.append(" and ");
|
||||||
sb.append(" (t.tramo_id, ");
|
sb.append(" (t.tramo_id, ");
|
||||||
|
@ -364,7 +371,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSQLAtualizarTarifaOficial(final Integer rutaId, final Integer usuarioId,
|
public String getSQLAtualizarTarifaOficial(final Integer rutaId, final Integer usuarioId,
|
||||||
final Integer orgaoConcedenteId) {
|
final OrgaoConcedente orgaoConcedente) {
|
||||||
StringBuilder sb = new StringBuilder("");
|
StringBuilder sb = new StringBuilder("");
|
||||||
|
|
||||||
sb.append("UPDATE TARIFA_OFICIAL SET PRECIO = ");
|
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 mc.marca_id <> -1 ");
|
||||||
sb.append(" and tc.activo = 1 ");
|
sb.append(" and tc.activo = 1 ");
|
||||||
sb.append(" and m.moneda_id = 1 ");
|
sb.append(" and m.moneda_id = 1 ");
|
||||||
if (orgaoConcedenteId != null) {
|
if (orgaoConcedente != null && orgaoConcedente.getOrgaoConcedenteId() != null) {
|
||||||
sb.append(" and oc.orgaoconcedente_id = ").append(orgaoConcedenteId);
|
sb.append(" and oc.orgaoconcedente_id = ").append(orgaoConcedente.getOrgaoConcedenteId());
|
||||||
}
|
}
|
||||||
sb.append(" and t.tramo_id = TARIFA_OFICIAL.tramo_id ");
|
sb.append(" and t.tramo_id = TARIFA_OFICIAL.tramo_id ");
|
||||||
sb.append(" and mc.marca_id = TARIFA_OFICIAL.marca_id ");
|
sb.append(" and mc.marca_id = TARIFA_OFICIAL.marca_id ");
|
||||||
|
@ -420,8 +427,8 @@ public class SQLBuilderOracle implements SQLBuilder {
|
||||||
if (rutaId != null) {
|
if (rutaId != null) {
|
||||||
sb.append(" and ruta_id = ").append(rutaId);
|
sb.append(" and ruta_id = ").append(rutaId);
|
||||||
}
|
}
|
||||||
if (orgaoConcedenteId != null) {
|
if (orgaoConcedente != null && orgaoConcedente.getOrgaoConcedenteId() != null) {
|
||||||
sb.append(" and orgaoconcedente_id = ").append(orgaoConcedenteId);
|
sb.append(" and orgaoconcedente_id = ").append(orgaoConcedente.getOrgaoConcedenteId());
|
||||||
}
|
}
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
|
|
|
@ -62,6 +62,8 @@ public class OrgaoConcedente implements Serializable {
|
||||||
@JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID")
|
@JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID")
|
||||||
@ManyToOne()
|
@ManyToOne()
|
||||||
private Categoria categoria;
|
private Categoria categoria;
|
||||||
|
@Column(name = "INDUTILIZAICMS")
|
||||||
|
private Boolean indUtilizaICMS;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "orgaoConcedente", cascade = CascadeType.ALL)
|
@OneToMany(mappedBy = "orgaoConcedente", cascade = CascadeType.ALL)
|
||||||
private List<ClasseIndicePeaje> classesIndicePeaje;
|
private List<ClasseIndicePeaje> classesIndicePeaje;
|
||||||
|
@ -205,6 +207,14 @@ public class OrgaoConcedente implements Serializable {
|
||||||
return descOrgao;
|
return descOrgao;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean getIndUtilizaICMS() {
|
||||||
|
return indUtilizaICMS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndUtilizaICMS(Boolean indUtilizaICMS) {
|
||||||
|
this.indUtilizaICMS = indUtilizaICMS;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
|
|
|
@ -31,7 +31,7 @@ public interface TarifaOficialService {
|
||||||
* @param orgaoConcedenteId
|
* @param orgaoConcedenteId
|
||||||
* @return A quantidade de registros afetadas
|
* @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
|
* @param orgaoConcedenteId
|
||||||
* @return - Quantidade de tarifas atualizadas
|
* @return - Quantidade de tarifas atualizadas
|
||||||
*/
|
*/
|
||||||
public Integer atualizarTarifaPorCoeficiente(Integer rutaId, Integer orgaoConcedenteId);
|
public Integer atualizarTarifaPorCoeficiente(Integer rutaId, OrgaoConcedente orgaoConcedente);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -62,7 +62,7 @@ public interface TarifaOficialService {
|
||||||
* @param empresaId
|
* @param empresaId
|
||||||
* @throws BusinessException
|
* @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/>
|
* Copia a tarifa oficial para a tabela de tarifa de acordo com a vigencia especificada.<br/>
|
||||||
|
|
|
@ -39,14 +39,14 @@ public class TarifaOficialServiceImpl implements TarifaOficialService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public Integer gerarTarifaPorCoeficiente(Integer rutaId, Integer orgaoConcedenteId, List<Integer> idsEmpresas) {
|
public Integer gerarTarifaPorCoeficiente(Integer rutaId, OrgaoConcedente orgaoConcedente, List<Integer> idsEmpresas) {
|
||||||
return tarifaOficialDAO.gerarTarifaPorCoeficiente(rutaId, UsuarioLogado.getUsuarioLogado().getUsuarioId(), orgaoConcedenteId, idsEmpresas);
|
return tarifaOficialDAO.gerarTarifaPorCoeficiente(rutaId, UsuarioLogado.getUsuarioLogado().getUsuarioId(), orgaoConcedente, idsEmpresas);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public Integer atualizarTarifaPorCoeficiente(Integer rutaId, Integer orgaoConcedenteId) {
|
public Integer atualizarTarifaPorCoeficiente(Integer rutaId, OrgaoConcedente orgaoConcedente) {
|
||||||
return tarifaOficialDAO.atualizarTarifaCoeficiente(rutaId, UsuarioLogado.getUsuarioLogado().getUsuarioId(), orgaoConcedenteId);
|
return tarifaOficialDAO.atualizarTarifaCoeficiente(rutaId, UsuarioLogado.getUsuarioLogado().getUsuarioId(), orgaoConcedente);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -58,7 +58,7 @@ public class TarifaOficialServiceImpl implements TarifaOficialService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = BusinessException.class)
|
@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
|
// Limpando a tabela de TARIFA_OFICIAL
|
||||||
tarifaOficialDAO.limparTarifasOficiais(lsEmpresaSelected);
|
tarifaOficialDAO.limparTarifasOficiais(lsEmpresaSelected);
|
||||||
|
@ -80,17 +80,17 @@ public class TarifaOficialServiceImpl implements TarifaOficialService {
|
||||||
rutaId = r.getRutaId();
|
rutaId = r.getRutaId();
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info("gerarAtualizarTarifa= rudaId:"+rutaId+";orgaoConcedenteId:"+orgaoConcedenteId+";empresaId:"+idsEmpresas);
|
log.info("gerarAtualizarTarifa= rudaId:" + rutaId + ";orgaoConcedenteId:" + orgaoConcedente.getOrgaoConcedenteId() + ";empresaId:" + idsEmpresas);
|
||||||
|
|
||||||
// Gerando as tarifas pelo coeficiente
|
// Gerando as tarifas pelo coeficiente
|
||||||
if(orgaoConcedenteId ==null || orgaoConcedenteId != OrgaoConcedente.CODIGO_ARTESP){
|
if (orgaoConcedente.getOrgaoConcedenteId() == null || orgaoConcedente.getOrgaoConcedenteId() != OrgaoConcedente.CODIGO_ARTESP) {
|
||||||
Integer qtdTarifaCoeficiente = gerarTarifaPorCoeficiente(rutaId, orgaoConcedenteId, idsEmpresas);
|
Integer qtdTarifaCoeficiente = gerarTarifaPorCoeficiente(rutaId, orgaoConcedente, idsEmpresas);
|
||||||
log.info("qtdTarifaCoeficiente=" + qtdTarifaCoeficiente);
|
log.info("qtdTarifaCoeficiente=" + qtdTarifaCoeficiente);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gerando as tarifas para ARTESP
|
// Gerando as tarifas para ARTESP
|
||||||
if(orgaoConcedenteId ==null || orgaoConcedenteId == OrgaoConcedente.CODIGO_ARTESP ){
|
if (orgaoConcedente.getOrgaoConcedenteId() == null || orgaoConcedente.getOrgaoConcedenteId() == OrgaoConcedente.CODIGO_ARTESP) {
|
||||||
Integer qtdTarifaArtesp = tarifaOficialDAO.gerarTarifaArtesp(rutaId, UsuarioLogado.getUsuarioLogado().getUsuarioId(), orgaoConcedenteId, idsEmpresas);
|
Integer qtdTarifaArtesp = tarifaOficialDAO.gerarTarifaArtesp(rutaId, UsuarioLogado.getUsuarioLogado().getUsuarioId(), orgaoConcedente.getOrgaoConcedenteId(), idsEmpresas);
|
||||||
log.info("qtdTarifaArtesp=" + qtdTarifaArtesp);
|
log.info("qtdTarifaArtesp=" + qtdTarifaArtesp);
|
||||||
}
|
}
|
||||||
x--;
|
x--;
|
||||||
|
|
Loading…
Reference in New Issue