git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@20786 d1611594-4594-4d17-8e1d-87c2c4800839
parent
9d0b54f20e
commit
3c146731ef
|
@ -1,14 +1,7 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import com.rjconsultores.ventaboletos.service.SeguroKmService;
|
||||
|
||||
|
||||
public interface SeguroKmDAO {
|
||||
/**
|
||||
* See {@link SeguroKmService#atualizarSeguroPorKm(Integer, Integer, Integer)}
|
||||
* @param rutaId
|
||||
* @param orgaoId
|
||||
* @param usuarioId
|
||||
*/
|
||||
public void atualizarSeguroPorKm(Integer rutaId,Integer orgaoId,Integer usuarioId) ;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.SeguroTarifa;
|
||||
|
||||
public interface SeguroTarifaDAO {
|
||||
/**
|
||||
* See {@link SeguroTarifa#atualizarSeguroPorTarifa(Integer, Integer, Integer)}
|
||||
* @param rutaId
|
||||
* @param orgaoId
|
||||
* @param usuarioId
|
||||
*/
|
||||
public void atualizarSeguroPorTarifa(Integer rutaId, Integer orgaoId,Integer usuarioId);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.SeguroTarifa;
|
||||
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
||||
import com.rjconsultores.ventaboletos.service.SeguroKmService;
|
||||
import com.rjconsultores.ventaboletos.service.TarifaOficialService;
|
||||
|
||||
|
||||
|
@ -37,4 +39,20 @@ public interface TarifaOficialDAO {
|
|||
* @param orgaoConcedenteId TODO
|
||||
*/
|
||||
public void atualizarTaxaEmbarque(Integer rutaId, Integer usuarioId, Integer orgaoConcedenteId);
|
||||
|
||||
/**
|
||||
* See {@link TarifaOficialService#atualizarSeguroPorKm(Integer, Integer, Integer)}
|
||||
* @param rutaId
|
||||
* @param orgaoId
|
||||
* @param usuarioId
|
||||
*/
|
||||
public void atualizarSeguroPorKm(Integer rutaId,Integer orgaoId,Integer usuarioId) ;
|
||||
|
||||
/**
|
||||
* See {@link TarifaOficialService#atualizarSeguroPorTarifa(Integer, Integer, Integer)}
|
||||
* @param rutaId
|
||||
* @param orgaoId
|
||||
* @param usuarioId
|
||||
*/
|
||||
public void atualizarSeguroPorTarifa(Integer rutaId, Integer orgaoId,Integer usuarioId);
|
||||
}
|
||||
|
|
|
@ -13,18 +13,10 @@ import com.rjconsultores.ventaboletos.entidad.SeguroKm;
|
|||
@Repository("seguroKmDAO")
|
||||
public class SeguroKmHibernateDAO extends GenericHibernateDAO<SeguroKm, Integer> implements SeguroKmDAO {
|
||||
|
||||
@Autowired
|
||||
private SQLBuilder sqlBuilder;
|
||||
|
||||
@Autowired
|
||||
public SeguroKmHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void atualizarSeguroPorKm(Integer rutaId, Integer orgaoId, Integer usuarioId) {
|
||||
SQLQuery query = getSession().createSQLQuery(sqlBuilder.getSQLAtualizarSeguroPorKm(rutaId, usuarioId, orgaoId));
|
||||
query.executeUpdate();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,30 +1,19 @@
|
|||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import org.hibernate.SQLQuery;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.SeguroTarifaDAO;
|
||||
import com.rjconsultores.ventaboletos.dao.sqlbuilder.SQLBuilder;
|
||||
import com.rjconsultores.ventaboletos.entidad.SeguroTarifa;
|
||||
|
||||
@Repository("seguroTarifaDAO")
|
||||
public class SeguroTarifaHibernateDAO extends GenericHibernateDAO<SeguroTarifa, Integer> implements SeguroTarifaDAO {
|
||||
|
||||
@Autowired
|
||||
private SQLBuilder sqlBuilder;
|
||||
|
||||
@Autowired
|
||||
public SeguroTarifaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void atualizarSeguroPorTarifa(Integer rutaId, Integer orgaoId, Integer usuarioId) {
|
||||
SQLQuery query = getSession().createSQLQuery(sqlBuilder.getSQLAtualizarSeguroPorTarifa(rutaId, usuarioId, orgaoId));
|
||||
query.executeUpdate();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -128,4 +128,16 @@ public class TarifaOficialHibernateDAO extends GenericHibernateDAO<TarifaOficial
|
|||
query = getSession().createSQLQuery(sqlBuilder.getSQLAtualizarTaxaEmbarquePorParadaFixo(rutaId, usuarioId, orgaoConcedenteId));
|
||||
query.executeUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void atualizarSeguroPorKm(Integer rutaId, Integer orgaoId, Integer usuarioId) {
|
||||
SQLQuery query = getSession().createSQLQuery(sqlBuilder.getSQLAtualizarSeguroPorKm(rutaId, usuarioId, orgaoId));
|
||||
query.executeUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void atualizarSeguroPorTarifa(Integer rutaId, Integer orgaoId, Integer usuarioId) {
|
||||
SQLQuery query = getSession().createSQLQuery(sqlBuilder.getSQLAtualizarSeguroPorTarifa(rutaId, usuarioId, orgaoId));
|
||||
query.executeUpdate();
|
||||
}
|
||||
}
|
|
@ -1,15 +1,6 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
|
||||
public interface SeguroKmService {
|
||||
|
||||
/**
|
||||
* Atualiza o seguro de acordo a kilometragem do trecho
|
||||
*
|
||||
* @param rutaId - Se informado, será filtrado pela ruta
|
||||
* @param orgaoId -Campo obrigatório
|
||||
*/
|
||||
public void atualizarSeguroPorKm(Integer rutaId,Integer orgaoId) throws BusinessException;
|
||||
|
||||
}
|
||||
|
|
|
@ -4,13 +4,4 @@ import com.rjconsultores.ventaboletos.exception.BusinessException;
|
|||
|
||||
public interface SeguroTarifaService {
|
||||
|
||||
/**
|
||||
* Atualiza o seguro de acordo o valor da tarifa
|
||||
*
|
||||
* @param rutaId - Se informado, será filtrado pela ruta
|
||||
* @param orgaoId -Campo obrigatório
|
||||
*
|
||||
*/
|
||||
public void atualizarSeguroPorTarifa(Integer rutaId, Integer orgaoId) throws BusinessException;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
|
||||
|
||||
public interface TarifaOficialService {
|
||||
|
@ -66,5 +67,35 @@ public interface TarifaOficialService {
|
|||
* @param orgaoConcedenteId TODO
|
||||
*/
|
||||
public void atualizarTaxaEmbarque(Integer rutaId, Integer orgaoConcedenteId);
|
||||
|
||||
|
||||
/**
|
||||
* Atualiza o seguro de acordo a kilometragem do trecho
|
||||
*
|
||||
* @param rutaId - Se informado, será filtrado pela ruta
|
||||
* @param orgaoId -Campo obrigatório
|
||||
*/
|
||||
public void atualizarSeguroPorKm(Integer rutaId,Integer orgaoId) throws BusinessException;
|
||||
|
||||
/**
|
||||
* Atualiza o seguro de acordo o valor da tarifa
|
||||
*
|
||||
* @param rutaId - Se informado, será filtrado pela ruta
|
||||
* @param orgaoId -Campo obrigatório
|
||||
*
|
||||
*/
|
||||
public void atualizarSeguroPorTarifa(Integer rutaId, Integer orgaoId) throws BusinessException;
|
||||
|
||||
|
||||
/**
|
||||
* Executa tanto o {@link #atualizarSeguroPorKm(Integer, Integer)} quanto {@link #atualizarSeguroPorTarifa(Integer, Integer)}
|
||||
*
|
||||
* @param rutaId
|
||||
* @param orgaoId
|
||||
* @throws BusinessException
|
||||
*/
|
||||
public void atualizarSeguro(Integer rutaId, Integer orgaoId) throws BusinessException;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -14,17 +14,4 @@ public class SeguroServiceKmImpl implements SeguroKmService{
|
|||
|
||||
@Autowired
|
||||
private SeguroKmDAO seguroKmDAO;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void atualizarSeguroPorKm(Integer rutaId, Integer orgaoId) throws BusinessException {
|
||||
|
||||
if (orgaoId == null){
|
||||
throw new BusinessException("SeguroServiceImpl.msg.validacion.orgaoObligatorio");
|
||||
}
|
||||
|
||||
seguroKmDAO.atualizarSeguroPorKm(rutaId, orgaoId, UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,9 +4,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.SeguroTarifaDAO;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
import com.rjconsultores.ventaboletos.service.SeguroTarifaService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
@Service("seguroTarifaService")
|
||||
public class SeguroTarifaServiceImpl implements SeguroTarifaService {
|
||||
|
@ -14,13 +12,6 @@ public class SeguroTarifaServiceImpl implements SeguroTarifaService {
|
|||
@Autowired
|
||||
private SeguroTarifaDAO seguroTarifaDAO;
|
||||
|
||||
@Override
|
||||
public void atualizarSeguroPorTarifa(Integer rutaId, Integer orgaoId) throws BusinessException {
|
||||
if (orgaoId == null){
|
||||
throw new BusinessException("SeguroServiceImpl.msg.validacion.orgaoObligatorio");
|
||||
}
|
||||
|
||||
seguroTarifaDAO.atualizarSeguroPorTarifa(rutaId, orgaoId, UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
import com.rjconsultores.ventaboletos.dao.TarifaOficialDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
import com.rjconsultores.ventaboletos.service.TarifaOficialService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
|
@ -48,5 +49,38 @@ public class TarifaOficialServiceImpl implements TarifaOficialService {
|
|||
public void atualizarTaxaEmbarque(Integer rutaId, Integer orgaoConcedenteId) {
|
||||
tarifaOficialDAO.atualizarTaxaEmbarque(rutaId, UsuarioLogado.getUsuarioLogado().getUsuarioId(), orgaoConcedenteId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void atualizarSeguroPorKm(Integer rutaId, Integer orgaoId) throws BusinessException {
|
||||
|
||||
if (orgaoId == null){
|
||||
throw new BusinessException("TarifaOficialServiceImpl.msg.validacion.orgaoObligatorio");
|
||||
}
|
||||
|
||||
tarifaOficialDAO.atualizarSeguroPorKm(rutaId, orgaoId, UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void atualizarSeguroPorTarifa(Integer rutaId, Integer orgaoId) throws BusinessException {
|
||||
if (orgaoId == null){
|
||||
throw new BusinessException("TarifaOficialServiceImpl.msg.validacion.orgaoObligatorio");
|
||||
}
|
||||
|
||||
tarifaOficialDAO.atualizarSeguroPorTarifa(rutaId, orgaoId, UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void atualizarSeguro(Integer rutaId, Integer orgaoId) throws BusinessException {
|
||||
if (orgaoId == null){
|
||||
throw new BusinessException("TarifaOficialServiceImpl.msg.validacion.orgaoObligatorio");
|
||||
}
|
||||
|
||||
atualizarSeguroPorKm(rutaId, orgaoId);
|
||||
atualizarSeguroPorTarifa(rutaId, orgaoId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue