Merge branch 'master' into melhoria_enums
commit
51e5acf7d6
2
pom.xml
2
pom.xml
|
@ -3,7 +3,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>br.com.rjconsultores</groupId>
|
||||
<artifactId>ModelWeb</artifactId>
|
||||
<version>1.0.20</version>
|
||||
<version>1.0.22</version>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>rj-releases</id>
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaRuta;
|
||||
|
||||
public interface CategoriaRutaDAO extends GenericDAO<CategoriaRuta, Integer> {
|
||||
|
||||
public CategoriaRuta busquedaPorCategoriaCtrl(CategoriaCtrl categoriaCtrl);
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaRutaExcecao;
|
||||
|
||||
public interface CategoriaRutaExcecaoDAO extends GenericDAO<CategoriaRutaExcecao, Integer> {
|
||||
|
||||
public CategoriaRutaExcecao busquedaPorCategoriaCtrl(CategoriaCtrl categoriaCtrl);
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.CategoriaRutaExcecaoDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaRutaExcecao;
|
||||
|
||||
@Repository("categoriaRutaExcecaoDAO")
|
||||
|
||||
public class CategoriaRutaExcecaoHibernateDAO extends GenericHibernateDAO<CategoriaRutaExcecao, Integer> implements CategoriaRutaExcecaoDAO {
|
||||
|
||||
@Autowired
|
||||
public CategoriaRutaExcecaoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
public CategoriaRutaExcecao busquedaPorCategoriaCtrl(CategoriaCtrl categoriaCtrl) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("categoriaCtrl", categoriaCtrl));
|
||||
|
||||
return (CategoriaRutaExcecao) c.uniqueResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CategoriaRutaExcecao> obtenerTodos() {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.CategoriaRutaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaRuta;
|
||||
|
||||
@Repository("categoriaRutaDAO")
|
||||
|
||||
public class CategoriaRutaHibernateDAO extends GenericHibernateDAO<CategoriaRuta, Integer> implements CategoriaRutaDAO {
|
||||
|
||||
@Autowired
|
||||
public CategoriaRutaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
public CategoriaRuta busquedaPorCategoriaCtrl(CategoriaCtrl categoriaCtrl) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("categoriaCtrl", categoriaCtrl));
|
||||
|
||||
return (CategoriaRuta) c.uniqueResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CategoriaRuta> obtenerTodos() {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
}
|
|
@ -67,6 +67,7 @@ import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
|||
import com.rjconsultores.ventaboletos.enuns.AceiteBB;
|
||||
import com.rjconsultores.ventaboletos.enuns.BancoLayout;
|
||||
import com.rjconsultores.ventaboletos.enuns.TipoInscricaoPagador;
|
||||
import com.rjconsultores.ventaboletos.exception.ValidacaoRemessaException;
|
||||
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
||||
import com.rjconsultores.ventaboletos.utilerias.CustomEnum;
|
||||
|
||||
|
@ -233,7 +234,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
}
|
||||
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("Erro ao setar o valor de atraso do boleto "+tupla[0]+", favor entrar em contato com o suporte! ");
|
||||
throw new ValidacaoRemessaException("Erro ao setar o valor de atraso do boleto "+tupla[0]+", favor entrar em contato com o suporte! ");
|
||||
}
|
||||
|
||||
try{
|
||||
|
@ -249,13 +250,13 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
try{
|
||||
detalhe.setNumeroInscricaoPagador(tupla[19].toString().replaceAll("[^0-9]+", ""));
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O CNPJ do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O CNPJ do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
detalhe.setEnderecoCompletoPagador(tupla[21].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O Endereço do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O Endereço do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
|
@ -263,7 +264,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
detalhe.setCEP_Prefixo(cep.substring(0,5));
|
||||
detalhe.setCEP_Sufixo(cep.substring(5));
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O CEP do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O CEP do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
arquivoRemessaItem.addTitulo(detalhe);
|
||||
|
@ -419,7 +420,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
}
|
||||
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("Erro ao setar o valor de atraso do boleto "+tupla[0]+", favor entrar em contato com o suporte! ");
|
||||
throw new ValidacaoRemessaException("Erro ao setar o valor de atraso do boleto "+tupla[0]+", favor entrar em contato com o suporte! ");
|
||||
}
|
||||
|
||||
try{
|
||||
|
@ -433,37 +434,37 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
try{
|
||||
detalhe.setNumeroInscricao(tupla[19].toString().replaceAll("[^0-9]+", ""));
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("A inscrição do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("A inscrição do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
detalhe.setNumeroInscricaoSacado(tupla[28].toString().replaceAll("[^0-9]+", ""));
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O CNPJ do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O CNPJ do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
detalhe.setEnderecoSacado(tupla[21].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O Endereco do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O Endereco do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
detalhe.setBairroSacado(tupla[22].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O Bairro do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O Bairro do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
detalhe.setCidade(tupla[23].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("A Cidade do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("A Cidade do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
detalhe.setEstado(tupla[24].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O Estado do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O Estado do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
|
@ -471,7 +472,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
detalhe.setCepSacado(cep.substring(0,5));
|
||||
detalhe.setComplementoCepSacado(cep.substring(5));
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O CEP do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O CEP do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
arquivoRemessaItem.addTitulo(detalhe);
|
||||
|
@ -619,31 +620,31 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
try{
|
||||
detalhe.setEnderecoCompletoPagador(tupla[21].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O Endereço do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O Endereço do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
detalhe.setBairro(tupla[22].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O Bairro do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O Bairro do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
detalhe.setCidade(tupla[23].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("A cidade do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("A cidade do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
detalhe.setEstado(tupla[24].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O Estado do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O Estado do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
detalhe.setCnpj(Long.valueOf(tupla[19].toString().replaceAll("[^0-9]+", "")));
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O CNPJ do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O CNPJ do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
|
@ -651,7 +652,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
detalhe.setCepPrefixo(cep.substring(0,5));
|
||||
detalhe.setCepSufixo(cep.substring(5));
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O CEP do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O CEP do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
arquivoRemessaItem.addTitulo(detalhe);
|
||||
|
@ -757,8 +758,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
arquivoRemessaItem.setRodapeRemessa(new RodapeRemessaPadrao());
|
||||
|
||||
arquivoRemessa.addItem(arquivoRemessaItem);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DetalheObrigatorioItau detalhe = new DetalheObrigatorioItau();
|
||||
|
||||
|
@ -814,37 +814,37 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
try{
|
||||
detalhe.setNumeroInscricaoSacado(Long.valueOf(tupla[20].toString()));
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O CNPJ do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O CNPJ do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
detalhe.setLogradouroSacado(tupla[22].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O Logradouro do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O Logradouro do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
detalhe.setBairroSacado(tupla[23].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O Bairro do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O Bairro do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
detalhe.setCepSacado(tupla[24].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O CEP do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O CEP do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
detalhe.setCidade(tupla[25].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("A cidade do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("A cidade do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
detalhe.setEstado(tupla[26].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O Estado do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O Estado do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
arquivoRemessaItem.addTitulo(detalhe);
|
||||
|
@ -940,7 +940,6 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
cabecalhoRemessaBancoBrasil.setNumContaCorrente(tupla[6].toString());
|
||||
cabecalhoRemessaBancoBrasil.setDigContaCorrente(tupla[7].toString());
|
||||
cabecalhoRemessaBancoBrasil.setNumCarteira(tupla[8].toString());
|
||||
cabecalhoRemessaBancoBrasil.setNumVarCarteira(((BigDecimal) tupla[28]).toString());
|
||||
cabecalhoRemessaBancoBrasil.setNomeEmpresa(nomeEmpresa);
|
||||
cabecalhoRemessaBancoBrasil.setNumConvenio(codEmpresaBanco);
|
||||
|
||||
|
@ -952,14 +951,23 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
cabecalhoLoteRemessaBancoBrasil.setDigAgenciaConta(" ");
|
||||
cabecalhoLoteRemessaBancoBrasil.setNumContaCorrente(tupla[6].toString());
|
||||
cabecalhoLoteRemessaBancoBrasil.setDigContaCorrente(tupla[7].toString());
|
||||
cabecalhoLoteRemessaBancoBrasil.setNumCarteira(tupla[8].toString());
|
||||
cabecalhoLoteRemessaBancoBrasil.setNumVarCarteira(((BigDecimal) tupla[28]).toString());
|
||||
cabecalhoLoteRemessaBancoBrasil.setNumCarteira(tupla[8].toString());
|
||||
cabecalhoLoteRemessaBancoBrasil.setNomeEmpresa(nomeEmpresa);
|
||||
cabecalhoLoteRemessaBancoBrasil.setNumConvenio(codEmpresaBanco);
|
||||
cabecalhoLoteRemessaBancoBrasil.setDataGeracao(new Date());
|
||||
cabecalhoLoteRemessaBancoBrasil.setNumeroRemessa(idRemessa);
|
||||
cabecalhoLoteRemessaBancoBrasil.setRemessaTesteID("TS");
|
||||
//cabecalhoLoteRemessaBancoBrasil.setLoteServico(++loteCount);
|
||||
|
||||
try{
|
||||
cabecalhoRemessaBancoBrasil.setNumVarCarteira(((BigDecimal) tupla[28]).toString());
|
||||
cabecalhoLoteRemessaBancoBrasil.setNumVarCarteira(((BigDecimal) tupla[28]).toString());
|
||||
}catch(Exception e){
|
||||
throw new ValidacaoRemessaException(
|
||||
String.format(
|
||||
"A Variação Carteira da empresa %s está fora do padrão, favor corrigir",
|
||||
nomeEmpresa)
|
||||
);
|
||||
}
|
||||
|
||||
cabecalhoRemessaBancoBrasil.setCabecalhoLoteRemessaBancoBrasil(cabecalhoLoteRemessaBancoBrasil);
|
||||
|
||||
|
@ -1042,31 +1050,31 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
try{
|
||||
pagadorBancoBrasil.setNumeroInscricaoSacado(tupla[20].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O CNPJ do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O CNPJ do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
pagadorBancoBrasil.setLogradouroSacado(tupla[22].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O Logradouro do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O Logradouro do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
pagadorBancoBrasil.setBairroSacado(tupla[23].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O Bairro do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O Bairro do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
pagadorBancoBrasil.setCidade(tupla[25].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("A cidade do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("A cidade do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
pagadorBancoBrasil.setEstado(tupla[26].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O Estado do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O Estado do ponto de venda "+tupla[21]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
titulosBancoBrasil.setDetalheObrigatorioDadosPagadorBancoBrasil(pagadorBancoBrasil);
|
||||
|
@ -1199,10 +1207,10 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
}else {
|
||||
try{
|
||||
if( !(cabecalhoRemessaSicoob.getNumConvenio()).equals(codEmpresaBanco)) {
|
||||
throw new RuntimeException("O codigo de convênio não confere com o codigo do banco \r\n favor entrar em contato com o suporte! ");
|
||||
throw new ValidacaoRemessaException("O codigo de convênio não confere com o codigo do banco \r\n favor entrar em contato com o suporte! ");
|
||||
}
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("Houve um erro na montagem do cabeçalho do arquivo de remessa \r\n favor entrar em contato com o suporte! ");
|
||||
throw new ValidacaoRemessaException("Houve um erro na montagem do cabeçalho do arquivo de remessa \r\n favor entrar em contato com o suporte! ");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1273,31 +1281,31 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
try{
|
||||
pagadorSicoob.setNumeroInscricaoSacado(tupla[20].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O CNPJ do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O CNPJ do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
pagadorSicoob.setLogradouroSacado(tupla[22].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O Logradouro do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O Logradouro do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
pagadorSicoob.setBairroSacado(tupla[23].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O Bairro do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O Bairro do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
pagadorSicoob.setCidade(tupla[25].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("A cidade do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("A cidade do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
pagadorSicoob.setEstado(tupla[26].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O Estado do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O Estado do ponto de venda "+tupla[20]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
titulosSicoob.setDetalheObrigatorioDadosPagadorSicoob(pagadorSicoob);
|
||||
|
@ -1440,7 +1448,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
try{
|
||||
titulosCaixa.setNumeroInscricao(tupla[3].toString().replaceAll("[^0-9]+", ""));
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O CNPJ do ponto de venda "+tupla[15]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O CNPJ do ponto de venda "+tupla[15]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
String cep = "";
|
||||
|
@ -1455,31 +1463,31 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
try{
|
||||
titulosCaixa.setNumeroInscricaoSacado(tupla[14].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O CNPJ do ponto de venda "+tupla[15]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O CNPJ do ponto de venda "+tupla[15]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
titulosCaixa.setEnderecoSacado(tupla[16].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O Logradouro do ponto de venda "+tupla[15]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O Logradouro do ponto de venda "+tupla[15]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
titulosCaixa.setBairroSacado(tupla[17].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O Bairro do ponto de venda "+tupla[15]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O Bairro do ponto de venda "+tupla[15]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
titulosCaixa.setCidade(tupla[19].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("A cidade do ponto de venda "+tupla[15]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("A cidade do ponto de venda "+tupla[15]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
try{
|
||||
titulosCaixa.setEstado(tupla[20].toString());
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException("O Estado do ponto de venda "+tupla[15]+" está fora do padrão, favor corrigir");
|
||||
throw new ValidacaoRemessaException("O Estado do ponto de venda "+tupla[15]+" está fora do padrão, favor corrigir");
|
||||
}
|
||||
|
||||
titulosCaixa.setSacadorAvalista("");
|
||||
|
@ -1748,6 +1756,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
|||
int qtd = stmt.executeUpdate(qry.toString());
|
||||
con.commit();
|
||||
stmt.close();
|
||||
con.close();
|
||||
|
||||
return qtd==1;
|
||||
}
|
||||
|
|
|
@ -23,6 +23,9 @@ import javax.persistence.SequenceGenerator;
|
|||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import org.apache.commons.lang.BooleanUtils;
|
||||
|
||||
import org.hibernate.annotations.Parameter;
|
||||
import org.hibernate.annotations.Type;
|
||||
|
@ -30,7 +33,10 @@ import org.hibernate.annotations.Type;
|
|||
import com.rjconsultores.ventaboletos.enums.TipoDescontoBPe;
|
||||
import com.rjconsultores.ventaboletos.enums.TipoDescontoMonitrip;
|
||||
|
||||
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
|
||||
import br.com.rjconsultores.auditador.annotations.AuditarLista;
|
||||
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
|
||||
import br.com.rjconsultores.auditador.interfaces.Auditavel;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -38,8 +44,10 @@ import br.com.rjconsultores.auditador.annotations.AuditarLista;
|
|||
*/
|
||||
@Entity
|
||||
@SequenceGenerator(name = "CATEGORIA_SEQ", sequenceName = "CATEGORIA_SEQ", allocationSize = 1)
|
||||
@AuditarClasse(nome = "CATEGORIA", tela = "Altera<72><61>o de Categoria")
|
||||
@Table(name = "CATEGORIA")
|
||||
public class Categoria implements Serializable {
|
||||
public class Categoria implements Serializable, Auditavel<Categoria>{
|
||||
|
||||
public static Integer CATEGORIA_NORMAL = 1;
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
|
@ -61,8 +69,10 @@ public class Categoria implements Serializable {
|
|||
private Date fecmodif;
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
@AuditarLista(auditarEntidades = true, nome = "CategoriaDescuento")
|
||||
@OneToMany(mappedBy = "categoria", cascade = CascadeType.ALL)
|
||||
private List<CategoriaDescuento> categoriaDescuentoList;
|
||||
@AuditarLista(auditarEntidades = true, nome = "reservacionCategoriaList")
|
||||
@OneToMany(mappedBy = "categoria", cascade = CascadeType.ALL)
|
||||
private List<ReservacionCategoria> reservacionCategoriaList;
|
||||
|
||||
|
@ -110,6 +120,10 @@ public class Categoria implements Serializable {
|
|||
@Column(name = "INDEXIGEIDENTIDADE")
|
||||
private Boolean indExigeIdentidade;
|
||||
|
||||
@Transient
|
||||
@NaoAuditar
|
||||
private Categoria categoriaClone;
|
||||
|
||||
public Categoria() {
|
||||
}
|
||||
|
||||
|
@ -310,4 +324,22 @@ public class Categoria implements Serializable {
|
|||
this.indExigeIdentidade = indExigeIdentidade;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clonar() throws CloneNotSupportedException {
|
||||
|
||||
categoriaClone = new Categoria();
|
||||
categoriaClone = (Categoria) this.clone();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Categoria getCloneObject() throws CloneNotSupportedException {
|
||||
return categoriaClone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextoInclusaoExclusao() {
|
||||
return String.format("ID [%s]", getCategoriaId());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,14 @@ import javax.persistence.ManyToOne;
|
|||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import org.hibernate.Hibernate;
|
||||
|
||||
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
|
||||
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
|
||||
import br.com.rjconsultores.auditador.interfaces.Auditavel;
|
||||
|
||||
import javax.persistence.SequenceGenerator;
|
||||
|
||||
/**
|
||||
|
@ -24,9 +32,10 @@ import javax.persistence.SequenceGenerator;
|
|||
* @author Administrador
|
||||
*/
|
||||
@Entity
|
||||
@AuditarClasse(nome = "CategoriaClase", tela = "Alteração de Categoria Classe")
|
||||
@SequenceGenerator(name = "CATEGORIA_CLASE_SEQ", sequenceName = "CATEGORIA_CLASE_SEQ", allocationSize = 1)
|
||||
@Table(name = "CATEGORIA_CLASE")
|
||||
public class CategoriaClase implements Serializable {
|
||||
public class CategoriaClase implements Serializable, Auditavel<CategoriaClase> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
|
@ -47,6 +56,9 @@ public class CategoriaClase implements Serializable {
|
|||
@JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID")
|
||||
@ManyToOne
|
||||
private CategoriaCtrl categoriaCtrl;
|
||||
@Transient
|
||||
@NaoAuditar
|
||||
private CategoriaClase categoriaClaseClone;
|
||||
|
||||
public CategoriaClase() {
|
||||
}
|
||||
|
@ -132,4 +144,22 @@ public class CategoriaClase implements Serializable {
|
|||
public String toString() {
|
||||
return "com.rjconsultores.ventaboletos.entidad.CategoriaClase[categoriaclaseId=" + categoriaclaseId + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clonar() throws CloneNotSupportedException {
|
||||
categoriaClaseClone = new CategoriaClase();
|
||||
categoriaClaseClone = (CategoriaClase) this.clone();
|
||||
Hibernate.initialize(categoriaClaseClone.getCategoriaCtrl());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public CategoriaClase getCloneObject() throws CloneNotSupportedException {
|
||||
return categoriaClaseClone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextoInclusaoExclusao() {
|
||||
return String.format("ID [%s]", getClaseServicio().getDescclase());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ package com.rjconsultores.ventaboletos.entidad;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
|
@ -14,22 +15,29 @@ import javax.persistence.GenerationType;
|
|||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import org.hibernate.Hibernate;
|
||||
import org.hibernate.annotations.NotFound;
|
||||
import org.hibernate.annotations.NotFoundAction;
|
||||
|
||||
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
|
||||
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
|
||||
import br.com.rjconsultores.auditador.interfaces.Auditavel;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Administrador
|
||||
*/
|
||||
@Entity
|
||||
@AuditarClasse(nome = "CategoriaCorrida", tela = "Alteração de Categoria Corrida")
|
||||
@SequenceGenerator(name = "CATEGORIA_CORRIDA_SEQ", sequenceName = "CATEGORIA_CORRIDA_SEQ", allocationSize = 1)
|
||||
@Table(name = "CATEGORIA_CORRIDA")
|
||||
public class CategoriaCorrida implements Serializable {
|
||||
public class CategoriaCorrida implements Serializable, Auditavel<CategoriaCorrida> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
|
@ -52,6 +60,9 @@ public class CategoriaCorrida implements Serializable {
|
|||
@ManyToOne
|
||||
@NotFound(action=NotFoundAction.IGNORE)
|
||||
private CategoriaCtrl categoriaCtrl;
|
||||
@Transient
|
||||
@NaoAuditar
|
||||
private CategoriaCorrida categoriaCorridaClone;
|
||||
|
||||
public CategoriaCorrida() {
|
||||
}
|
||||
|
@ -138,4 +149,22 @@ public class CategoriaCorrida implements Serializable {
|
|||
public String toString() {
|
||||
return "com.rjconsultores.ventaboletos.entidad.CategoriaCorrida[categoriaCorrida=" + categoriaCorrida + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clonar() throws CloneNotSupportedException {
|
||||
categoriaCorridaClone = new CategoriaCorrida();
|
||||
categoriaCorridaClone = (CategoriaCorrida) this.clone();
|
||||
Hibernate.initialize(categoriaCorridaClone.getCategoriaCtrl());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public CategoriaCorrida getCloneObject() throws CloneNotSupportedException {
|
||||
return categoriaCorridaClone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextoInclusaoExclusao() {
|
||||
return String.format("ID [%s]", getCorridaCtrl().getCorridaId());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,18 +23,28 @@ import javax.persistence.SequenceGenerator;
|
|||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import org.apache.commons.lang.BooleanUtils;
|
||||
import org.hibernate.Hibernate;
|
||||
import org.hibernate.annotations.NotFound;
|
||||
import org.hibernate.annotations.NotFoundAction;
|
||||
|
||||
import br.com.rjconsultores.auditador.annotations.AuditarAtributo;
|
||||
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
|
||||
import br.com.rjconsultores.auditador.annotations.AuditarLista;
|
||||
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
|
||||
import br.com.rjconsultores.auditador.interfaces.Auditavel;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Administrador
|
||||
*/
|
||||
@Entity
|
||||
@SequenceGenerator(name = "CATEGORIA_CTRL_SEQ", sequenceName = "CATEGORIA_CTRL_SEQ", allocationSize = 1)
|
||||
@AuditarClasse(nome = "CategoriaCtrl", tela = "Alteração de Categoria")
|
||||
@Table(name = "CATEGORIA_CTRL")
|
||||
public class CategoriaCtrl implements Serializable, Cloneable {
|
||||
public class CategoriaCtrl implements Serializable, Cloneable, Auditavel<CategoriaCtrl>{
|
||||
|
||||
public final static Integer[] idsCategoriasNoVisible = {1};
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -50,29 +60,42 @@ public class CategoriaCtrl implements Serializable, Cloneable {
|
|||
private Boolean activo;
|
||||
@Column(name = "DESCRICAO")
|
||||
private String descricao;
|
||||
@AuditarAtributo(nome = "Ult.Modif")
|
||||
@Basic(optional = false)
|
||||
@Column(name = "FECMODIF")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date fecmodif;
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
@AuditarLista(auditarEntidades = true, nome = "categoriaDescuentoList")
|
||||
@OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL)
|
||||
private List<CategoriaDescuento> categoriaDescuentoList;
|
||||
@AuditarLista(auditarEntidades = true, nome = "categoriaClaseList")
|
||||
@OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL)
|
||||
private List<CategoriaClase> categoriaClaseList;
|
||||
@AuditarLista(auditarEntidades = true, nome = "categoriaMarcaList")
|
||||
@OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL)
|
||||
private List<CategoriaMarca> categoriaMarcaList;
|
||||
@AuditarLista(auditarEntidades = true, nome = "categoriaCorridaList")
|
||||
@OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL)
|
||||
@NotFound(action=NotFoundAction.IGNORE)
|
||||
private List<CategoriaCorrida> categoriaCorridaList;
|
||||
@AuditarLista(auditarEntidades = true, nome = "categoriaMercadoList")
|
||||
@OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL)
|
||||
private List<CategoriaMercado> categoriaMercadoList;
|
||||
@AuditarLista(auditarEntidades = true, nome = "categoriaOrgaoList")
|
||||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "categoriaCtrl")
|
||||
private List<CategoriaOrgao> categoriaOrgaoList;
|
||||
@AuditarLista(auditarEntidades = true, nome = "categoriaRutaList")
|
||||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "categoriaCtrl")
|
||||
private List<CategoriaRuta> categoriaRutaList;
|
||||
@AuditarLista(auditarEntidades = true, nome = "categoriaRutaExcecaoList")
|
||||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "categoriaCtrl")
|
||||
private List<CategoriaRutaExcecao> categoriaRutaExcecaoList;
|
||||
|
||||
@Transient
|
||||
@NaoAuditar
|
||||
private CategoriaCtrl categoriaCtrlClone;
|
||||
public CategoriaCtrl() {
|
||||
|
||||
}
|
||||
|
@ -368,4 +391,107 @@ public class CategoriaCtrl implements Serializable, Cloneable {
|
|||
}
|
||||
return lsCategoriaMercado;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void clonar() throws CloneNotSupportedException {
|
||||
categoriaCtrlClone = new CategoriaCtrl();
|
||||
categoriaCtrlClone = (CategoriaCtrl) this.clone();
|
||||
|
||||
if(this.getCategoriaDescuentoList() != null) {
|
||||
List<CategoriaDescuento> lsClones = new ArrayList<CategoriaDescuento>();
|
||||
for (CategoriaDescuento categoriaDescuento : this.getCategoriaDescuentoList()) {
|
||||
if(BooleanUtils.isTrue(categoriaDescuento.getActivo())) {
|
||||
categoriaDescuento.clonar();
|
||||
lsClones.add(categoriaDescuento.getCloneObject());
|
||||
}
|
||||
}
|
||||
categoriaCtrlClone.setCategoriaDescuentoList(lsClones);
|
||||
}
|
||||
if(this.getCategoriaOrgaoList() != null) {
|
||||
List<CategoriaOrgao> lsClones = new ArrayList<CategoriaOrgao>();
|
||||
for (CategoriaOrgao categoriaOrgao : this.getCategoriaOrgaoList()) {
|
||||
if(BooleanUtils.isTrue(categoriaOrgao.getActivo())) {
|
||||
categoriaOrgao.clonar();
|
||||
lsClones.add(categoriaOrgao.getCloneObject());
|
||||
}
|
||||
}
|
||||
categoriaCtrlClone.setCategoriaorgaoList(lsClones);
|
||||
}
|
||||
if(this.getCategoriaMarcaList() != null) {
|
||||
List<CategoriaMarca> lsClones = new ArrayList<CategoriaMarca>();
|
||||
for (CategoriaMarca categoriaMarca : this.getCategoriaMarcaList()) {
|
||||
if(BooleanUtils.isTrue(categoriaMarca.getActivo())) {
|
||||
categoriaMarca.clonar();
|
||||
lsClones.add(categoriaMarca.getCloneObject());
|
||||
}
|
||||
}
|
||||
categoriaCtrlClone.setCategoriaMarcaList(lsClones);
|
||||
}
|
||||
if(this.getCategoriaCorridaList() != null) {
|
||||
List<CategoriaCorrida> lsClones = new ArrayList<CategoriaCorrida>();
|
||||
for (CategoriaCorrida categoriaCorrida : this.getCategoriaCorridaList()) {
|
||||
if(BooleanUtils.isTrue(categoriaCorrida.getActivo())) {
|
||||
categoriaCorrida.clonar();
|
||||
lsClones.add(categoriaCorrida.getCloneObject());
|
||||
}
|
||||
}
|
||||
categoriaCtrlClone.setCategoriaCorridaList(lsClones);
|
||||
}
|
||||
|
||||
if(this.getCategoriaClaseList() != null) {
|
||||
List<CategoriaClase> lsClones = new ArrayList<CategoriaClase>();
|
||||
for (CategoriaClase categoriaClase : this.getCategoriaClaseList()) {
|
||||
if(BooleanUtils.isTrue(categoriaClase.getActivo())) {
|
||||
categoriaClase.clonar();
|
||||
lsClones.add(categoriaClase.getCloneObject());
|
||||
}
|
||||
}
|
||||
categoriaCtrlClone.setCategoriaClaseList(lsClones);
|
||||
}
|
||||
|
||||
if(this.getCategoriaRutaList() != null) {
|
||||
List<CategoriaRuta> lsClones = new ArrayList<CategoriaRuta>();
|
||||
for (CategoriaRuta categoriaRuta: this.getCategoriaRutaList()) {
|
||||
if(BooleanUtils.isTrue(categoriaRuta.getActivo())) {
|
||||
categoriaRuta.clonar();
|
||||
lsClones.add(categoriaRuta.getCloneObject());
|
||||
}
|
||||
}
|
||||
categoriaCtrlClone.setCategoriarutaList(lsClones);
|
||||
}
|
||||
|
||||
if(this.getCategoriaRutaExcecaoList() != null) {
|
||||
List<CategoriaRutaExcecao> lsClones = new ArrayList<CategoriaRutaExcecao>();
|
||||
for (CategoriaRutaExcecao categoriaRutaExcecacao: this.getCategoriaRutaExcecaoList()) {
|
||||
if(BooleanUtils.isTrue(categoriaRutaExcecacao.getActivo())) {
|
||||
categoriaRutaExcecacao.clonar();
|
||||
lsClones.add(categoriaRutaExcecacao.getCloneObject());
|
||||
}
|
||||
}
|
||||
categoriaCtrlClone.setCategoriarutaExcecaoList(lsClones);
|
||||
}
|
||||
|
||||
if(this.getCategoriaMercadoList() != null) {
|
||||
List<CategoriaMercado> lsClones = new ArrayList<CategoriaMercado>();
|
||||
for (CategoriaMercado categoriaMercado: this.getCategoriaMercadoList()) {
|
||||
if(BooleanUtils.isTrue(categoriaMercado.getActivo())) {
|
||||
categoriaMercado.clonar();
|
||||
lsClones.add(categoriaMercado.getCloneObject());
|
||||
}
|
||||
}
|
||||
categoriaCtrlClone.setCategoriaMercadoList(lsClones);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CategoriaCtrl getCloneObject() throws CloneNotSupportedException {
|
||||
return categoriaCtrlClone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextoInclusaoExclusao() {
|
||||
return String.format("ID [%s]", getCategoriactrlId());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -27,21 +27,30 @@ import javax.persistence.SequenceGenerator;
|
|||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import org.apache.commons.lang.BooleanUtils;
|
||||
import org.hibernate.Hibernate;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.rjconsultores.ventaboletos.enums.HorarioLiberacaoVendaPassagem;
|
||||
import com.rjconsultores.ventaboletos.enums.TipoPassagemCores;
|
||||
|
||||
import br.com.rjconsultores.auditador.annotations.AuditarAtributo;
|
||||
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
|
||||
import br.com.rjconsultores.auditador.annotations.AuditarLista;
|
||||
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
|
||||
import br.com.rjconsultores.auditador.interfaces.Auditavel;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Administrador
|
||||
*/
|
||||
@Entity
|
||||
@AuditarClasse(nome = "CategoriaDescuento", tela = "Alteração de Categoria Desconto")
|
||||
@SequenceGenerator(name = "CATEGORIA_DESCUENTO_SEQ", sequenceName = "CATEGORIA_DESCUENTO_SEQ", allocationSize = 1)
|
||||
@Table(name = "CATEGORIA_DESCUENTO")
|
||||
public class CategoriaDescuento implements Serializable {
|
||||
public class CategoriaDescuento implements Serializable, Auditavel<CategoriaDescuento> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
|
@ -49,6 +58,7 @@ public class CategoriaDescuento implements Serializable {
|
|||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "CATEGORIA_DESCUENTO_SEQ")
|
||||
@Column(name = "CATEGORIADESCUENTO_ID")
|
||||
private Integer categoriadescuentoId;
|
||||
@AuditarAtributo(nome = "Qtd Autorizada")
|
||||
@Column(name = "CANTAUTORIZADA")
|
||||
private Integer cantautorizada;
|
||||
@Column(name = "DESCUENTOPORC")
|
||||
|
@ -57,6 +67,7 @@ public class CategoriaDescuento implements Serializable {
|
|||
private BigDecimal descuentoimporte;
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
@AuditarAtributo(nome = "Ult.Modif")
|
||||
@Basic(optional = false)
|
||||
@Column(name = "FECMODIF")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
|
@ -69,6 +80,7 @@ public class CategoriaDescuento implements Serializable {
|
|||
@JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID")
|
||||
@ManyToOne
|
||||
private Categoria categoria;
|
||||
@NaoAuditar
|
||||
@OneToMany(mappedBy = "categoriaDescuento", cascade = CascadeType.ALL, fetch=FetchType.EAGER)
|
||||
private List<CategoriaPeriodo> categoriaPeriodoList;
|
||||
@Column(name = "INDIMPRIMEBOLETO")
|
||||
|
@ -237,6 +249,11 @@ public class CategoriaDescuento implements Serializable {
|
|||
@ManyToOne(cascade = CascadeType.ALL)
|
||||
private TipoOcupacion tipoOcupacion;
|
||||
|
||||
@Transient
|
||||
@NaoAuditar
|
||||
private CategoriaDescuento categoriaDescuentoClone;
|
||||
|
||||
|
||||
public enum DisponibilidadeFeriado {
|
||||
// Declaração dos enum
|
||||
GERARSEMPRE("SEMPRE", "S"),
|
||||
|
@ -991,4 +1008,33 @@ public class CategoriaDescuento implements Serializable {
|
|||
public void setTipoOcupacion(TipoOcupacion tipoOcupacion) {
|
||||
this.tipoOcupacion = tipoOcupacion;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void clonar() throws CloneNotSupportedException {
|
||||
categoriaDescuentoClone = new CategoriaDescuento();
|
||||
categoriaDescuentoClone = (CategoriaDescuento) this.clone();
|
||||
|
||||
if(this.getCategoriaPeriodoList() != null) {
|
||||
List<CategoriaPeriodo> lsClones = new ArrayList<CategoriaPeriodo>();
|
||||
for (CategoriaPeriodo categoriaPeriodo : this.getCategoriaPeriodoList()) {
|
||||
if(BooleanUtils.isTrue(categoriaPeriodo.getActivo())) {
|
||||
categoriaPeriodo.clonar();
|
||||
lsClones.add(categoriaPeriodo.getCloneObject());
|
||||
}
|
||||
}
|
||||
categoriaDescuentoClone.setCategoriaPeriodoList(lsClones);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CategoriaDescuento getCloneObject() throws CloneNotSupportedException {
|
||||
return categoriaDescuentoClone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextoInclusaoExclusao() {
|
||||
return String.format("ID [%s]", getCategoriadescuentoId());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,6 +17,14 @@ import javax.persistence.ManyToOne;
|
|||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import org.hibernate.Hibernate;
|
||||
|
||||
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
|
||||
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
|
||||
import br.com.rjconsultores.auditador.interfaces.Auditavel;
|
||||
|
||||
import javax.persistence.SequenceGenerator;
|
||||
|
||||
/**
|
||||
|
@ -24,9 +32,10 @@ import javax.persistence.SequenceGenerator;
|
|||
* @author Administrador
|
||||
*/
|
||||
@Entity
|
||||
@AuditarClasse(nome = "ReservacionPuntoVenta", tela = "Alteração de Marca de Categoria")
|
||||
@SequenceGenerator(name = "CATEGORIA_MARCA_SEQ", sequenceName = "CATEGORIA_MARCA_SEQ", allocationSize = 1)
|
||||
@Table(name = "CATEGORIA_MARCA")
|
||||
public class CategoriaMarca implements Serializable {
|
||||
public class CategoriaMarca implements Serializable, Auditavel<CategoriaMarca> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
|
@ -47,6 +56,10 @@ public class CategoriaMarca implements Serializable {
|
|||
@JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID")
|
||||
@ManyToOne
|
||||
private CategoriaCtrl categoriaCtrl;
|
||||
|
||||
@Transient
|
||||
@NaoAuditar
|
||||
private CategoriaMarca categoriaMarcaClone;
|
||||
|
||||
public CategoriaMarca() {
|
||||
}
|
||||
|
@ -133,4 +146,23 @@ public class CategoriaMarca implements Serializable {
|
|||
public String toString() {
|
||||
return "com.rjconsultores.ventaboletos.entidad.CategoriaMarca[categoriamarcaId=" + categoriamarcaId + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clonar() throws CloneNotSupportedException {
|
||||
categoriaMarcaClone = new CategoriaMarca();
|
||||
categoriaMarcaClone = (CategoriaMarca) this.clone();
|
||||
Hibernate.initialize(categoriaMarcaClone.getCategoriaCtrl());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public CategoriaMarca getCloneObject() throws CloneNotSupportedException {
|
||||
return categoriaMarcaClone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextoInclusaoExclusao() {
|
||||
return String.format("ID [%s]", getMarca().getDescmarca());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ package com.rjconsultores.ventaboletos.entidad;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
|
@ -14,19 +15,27 @@ import javax.persistence.GenerationType;
|
|||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import org.hibernate.Hibernate;
|
||||
|
||||
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
|
||||
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
|
||||
import br.com.rjconsultores.auditador.interfaces.Auditavel;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Administrador
|
||||
*/
|
||||
@Entity
|
||||
@AuditarClasse(nome = "CategoriaMercado", tela = "Alteração de Categoria Mercado")
|
||||
@SequenceGenerator(name = "CATEGORIA_MERCADO_SEQ", sequenceName = "CATEGORIA_MERCADO_SEQ", allocationSize = 1)
|
||||
@Table(name = "CATEGORIA_MERCADO")
|
||||
public class CategoriaMercado implements Serializable {
|
||||
public class CategoriaMercado implements Serializable,Auditavel<CategoriaMercado> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
|
@ -50,6 +59,9 @@ public class CategoriaMercado implements Serializable {
|
|||
@JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID")
|
||||
@ManyToOne
|
||||
private CategoriaCtrl categoriaCtrl;
|
||||
@Transient
|
||||
@NaoAuditar
|
||||
private CategoriaMercado categoriaMercadoClone;
|
||||
|
||||
public CategoriaMercado() {
|
||||
}
|
||||
|
@ -144,4 +156,22 @@ public class CategoriaMercado implements Serializable {
|
|||
public String toString() {
|
||||
return "com.rjconsultores.ventaboletos.entidad.CategoriaMercado[categoriamercadoId=" + categoriamercadoId + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clonar() throws CloneNotSupportedException {
|
||||
categoriaMercadoClone = new CategoriaMercado();
|
||||
categoriaMercadoClone = (CategoriaMercado) this.clone();
|
||||
Hibernate.initialize(categoriaMercadoClone.getCategoriaCtrl());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public CategoriaMercado getCloneObject() throws CloneNotSupportedException {
|
||||
return categoriaMercadoClone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextoInclusaoExclusao() {
|
||||
return String.format("ID [%s]", getOrigem().getCveparada()+"-"+getDestino().getCveparada());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -161,6 +161,6 @@ public class CategoriaOrgao implements Serializable, Auditavel<CategoriaOrgao>
|
|||
|
||||
@Override
|
||||
public String getTextoInclusaoExclusao() {
|
||||
return String.format("ID [%s]", getCategoriaorgaoId());
|
||||
return String.format("ID [%s]", getOrgao().getDescOrgao()+"-"+getOrgao().getOrgaoConcedenteId());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,16 @@ import javax.persistence.ManyToOne;
|
|||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import org.hibernate.Hibernate;
|
||||
|
||||
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||
|
||||
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
|
||||
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
|
||||
import br.com.rjconsultores.auditador.interfaces.Auditavel;
|
||||
|
||||
import javax.persistence.SequenceGenerator;
|
||||
|
||||
/**
|
||||
|
@ -24,9 +34,10 @@ import javax.persistence.SequenceGenerator;
|
|||
* @author Administrador
|
||||
*/
|
||||
@Entity
|
||||
@AuditarClasse(nome = "CategoriaDescuento", tela = "Alteração de Categoria Descuento Periodo")
|
||||
@SequenceGenerator(name = "CATEGORIA_PERIODO_SEQ", sequenceName = "CATEGORIA_PERIODO_SEQ", allocationSize = 1)
|
||||
@Table(name = "CATEGORIA_PERIODO")
|
||||
public class CategoriaPeriodo implements Serializable {
|
||||
public class CategoriaPeriodo implements Serializable, Auditavel<CategoriaPeriodo>{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
|
@ -51,6 +62,10 @@ public class CategoriaPeriodo implements Serializable {
|
|||
@JoinColumn(name = "CATEGORIADESCUENTO_ID", referencedColumnName = "CATEGORIADESCUENTO_ID")
|
||||
@ManyToOne
|
||||
private CategoriaDescuento categoriaDescuento;
|
||||
|
||||
@Transient
|
||||
@NaoAuditar
|
||||
private CategoriaPeriodo categoriaPeriodoClone;
|
||||
|
||||
public CategoriaPeriodo() {
|
||||
}
|
||||
|
@ -154,4 +169,20 @@ public class CategoriaPeriodo implements Serializable {
|
|||
public String toString() {
|
||||
return "com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo[categoriaperiodoId=" + categoriaperiodoId + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clonar() throws CloneNotSupportedException {
|
||||
categoriaPeriodoClone = new CategoriaPeriodo();
|
||||
categoriaPeriodoClone = (CategoriaPeriodo) this.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CategoriaPeriodo getCloneObject() throws CloneNotSupportedException {
|
||||
return categoriaPeriodoClone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextoInclusaoExclusao() {
|
||||
return String.format("ID [%s]", DateUtil.getStringDate(fecinicio, "dd/MM/yyyy HH:mm:ss") + " - "+ DateUtil.getStringDate(fecinicio, "dd/MM/yyyy HH:mm:ss")).trim();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,11 +16,19 @@ import javax.persistence.SequenceGenerator;
|
|||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import org.hibernate.Hibernate;
|
||||
|
||||
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
|
||||
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
|
||||
import br.com.rjconsultores.auditador.interfaces.Auditavel;
|
||||
|
||||
@Entity
|
||||
@AuditarClasse(nome = "CategoriaRuta", tela = "Alteração de Categoria de Linha")
|
||||
@SequenceGenerator(name = "CATEGORIA_RUTA_SEQ", sequenceName = "CATEGORIA_RUTA_SEQ", allocationSize = 1)
|
||||
@Table(name = "CATEGORIA_RUTA")
|
||||
public class CategoriaRuta implements Serializable {
|
||||
public class CategoriaRuta implements Serializable, Auditavel<CategoriaRuta> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
|
@ -48,6 +56,10 @@ public class CategoriaRuta implements Serializable {
|
|||
@JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID")
|
||||
@ManyToOne
|
||||
private CategoriaCtrl categoriaCtrl;
|
||||
|
||||
@Transient
|
||||
@NaoAuditar
|
||||
private CategoriaRuta categoriaRutaClone;
|
||||
|
||||
public CategoriaRuta() {
|
||||
}
|
||||
|
@ -159,4 +171,23 @@ public class CategoriaRuta implements Serializable {
|
|||
public String toString() {
|
||||
return "com.rjconsultores.ventaboletos.entidad.CategoriaOrgao[categoriaorgaoId=" + categoriarutaId + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clonar() throws CloneNotSupportedException {
|
||||
categoriaRutaClone = new CategoriaRuta();
|
||||
categoriaRutaClone = (CategoriaRuta) this.clone();
|
||||
Hibernate.initialize(categoriaRutaClone.getCategoriaCtrl());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public CategoriaRuta getCloneObject() throws CloneNotSupportedException {
|
||||
return categoriaRutaClone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextoInclusaoExclusao() {
|
||||
return String.format("ID [%s]", getRuta().getNumRuta());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,11 +15,19 @@ import javax.persistence.SequenceGenerator;
|
|||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import org.hibernate.Hibernate;
|
||||
|
||||
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
|
||||
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
|
||||
import br.com.rjconsultores.auditador.interfaces.Auditavel;
|
||||
|
||||
@Entity
|
||||
@AuditarClasse(nome = "CategoriaRutaExcecao", tela = "Alteração de Categoria Eexceção de linha")
|
||||
@SequenceGenerator(name = "CATEGORIA_RUTA_EXCECAO_SEQ", sequenceName = "CATEGORIA_RUTA_EXCECAO_SEQ", allocationSize = 1)
|
||||
@Table(name = "CATEGORIA_RUTA_EXCECAO")
|
||||
public class CategoriaRutaExcecao implements Serializable {
|
||||
public class CategoriaRutaExcecao implements Serializable, Auditavel<CategoriaRutaExcecao> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
|
@ -40,6 +48,9 @@ public class CategoriaRutaExcecao implements Serializable {
|
|||
@JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID")
|
||||
@ManyToOne
|
||||
private CategoriaCtrl categoriaCtrl;
|
||||
@Transient
|
||||
@NaoAuditar
|
||||
private CategoriaRutaExcecao categoriaRutaExcecaoClone;
|
||||
|
||||
public CategoriaRutaExcecao() {
|
||||
}
|
||||
|
@ -128,4 +139,23 @@ public class CategoriaRutaExcecao implements Serializable {
|
|||
public String toString() {
|
||||
return "com.rjconsultores.ventaboletos.entidad.CategoriaRutaExcecao[categoriaRutaExcecaoId=" + categoriaRutaExcecaoId + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clonar() throws CloneNotSupportedException {
|
||||
categoriaRutaExcecaoClone = new CategoriaRutaExcecao();
|
||||
categoriaRutaExcecaoClone = (CategoriaRutaExcecao) this.clone();
|
||||
Hibernate.initialize(categoriaRutaExcecaoClone.getCategoriaCtrl());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public CategoriaRutaExcecao getCloneObject() throws CloneNotSupportedException {
|
||||
return categoriaRutaExcecaoClone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextoInclusaoExclusao() {
|
||||
return String.format("ID [%s]", getRuta().getNumRuta());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ import org.hibernate.annotations.Type;
|
|||
|
||||
import com.rjconsultores.ventaboletos.enums.TipoClasseServicoBPe;
|
||||
|
||||
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
|
||||
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
|
||||
import br.com.rjconsultores.auditador.interfaces.Auditavel;
|
||||
|
||||
|
@ -36,6 +37,7 @@ import br.com.rjconsultores.auditador.interfaces.Auditavel;
|
|||
* @author Administrador
|
||||
*/
|
||||
@Entity
|
||||
@AuditarClasse(nome = "CategoriaDescuento", tela = "Alteração de Categoria Serviço")
|
||||
@SequenceGenerator(name = "CLASE_SERVICIO_SEQ", sequenceName = "CLASE_SERVICIO_SEQ", allocationSize = 1)
|
||||
@Table(name = "CLASE_SERVICIO")
|
||||
public class ClaseServicio implements Serializable, Auditavel<ClaseServicio> {
|
||||
|
|
|
@ -160,7 +160,7 @@ public class PtovtaCatInd implements Serializable, Auditavel<PtovtaCatInd> {
|
|||
|
||||
@Override
|
||||
public String getTextoInclusaoExclusao() {
|
||||
return String.format("ID [%s]", getPtovtaCategoriaId());
|
||||
return String.format("ID [%s]", getCategoria().getDesccategoria());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -17,6 +17,14 @@ import javax.persistence.ManyToOne;
|
|||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import org.hibernate.Hibernate;
|
||||
|
||||
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
|
||||
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
|
||||
import br.com.rjconsultores.auditador.interfaces.Auditavel;
|
||||
|
||||
import javax.persistence.SequenceGenerator;
|
||||
|
||||
/**
|
||||
|
@ -24,9 +32,10 @@ import javax.persistence.SequenceGenerator;
|
|||
* @author Administrador
|
||||
*/
|
||||
@Entity
|
||||
@AuditarClasse(nome = "ReservacionPuntoVenta", tela = "Alteração de Reserva Categoria")
|
||||
@SequenceGenerator(name = "RESERVACION_CATEGORIA_SEQ", sequenceName = "RESERVACION_CATEGORIA_SEQ", allocationSize = 1)
|
||||
@Table(name = "RESERVACION_CATEGORIA")
|
||||
public class ReservacionCategoria implements Serializable {
|
||||
public class ReservacionCategoria implements Serializable, Auditavel<ReservacionCategoria> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
|
@ -47,6 +56,9 @@ public class ReservacionCategoria implements Serializable {
|
|||
@JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID")
|
||||
@ManyToOne
|
||||
private Categoria categoria;
|
||||
@Transient
|
||||
@NaoAuditar
|
||||
private ReservacionCategoria reservacionCategoriaClone;
|
||||
|
||||
public ReservacionCategoria() {
|
||||
}
|
||||
|
@ -137,4 +149,24 @@ public class ReservacionCategoria implements Serializable {
|
|||
public String toString() {
|
||||
return "com.rjconsultores.ventaboletos.entidad.ReservacionCategoria[reservacioncategoriaId=" + reservacioncategoriaId + "]";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void clonar() throws CloneNotSupportedException {
|
||||
reservacionCategoriaClone = new ReservacionCategoria();
|
||||
reservacionCategoriaClone = (ReservacionCategoria) this.clone();
|
||||
Hibernate.initialize(reservacionCategoriaClone.getCategoria());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReservacionCategoria getCloneObject() throws CloneNotSupportedException {
|
||||
return reservacionCategoriaClone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTextoInclusaoExclusao() {
|
||||
return String.format("ID [%s]", getReservacioncategoriaId());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
package com.rjconsultores.ventaboletos.exception;
|
||||
|
||||
public class ValidacaoRemessaException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = -919934943159729995L;
|
||||
|
||||
public ValidacaoRemessaException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
}
|
|
@ -4,6 +4,8 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaClase;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||
|
||||
|
@ -14,4 +16,6 @@ import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
|||
public interface CategoriaClaseService extends GenericService<CategoriaClase, Integer> {
|
||||
|
||||
public CategoriaClase busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl);
|
||||
|
||||
void actualizacionAuditagem(List<CategoriaClase> lsCategoriaClase);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaMarca;
|
||||
|
||||
|
@ -14,4 +16,6 @@ import com.rjconsultores.ventaboletos.entidad.CategoriaMarca;
|
|||
public interface CategoriaMarcaService extends GenericService<CategoriaMarca, Integer> {
|
||||
|
||||
public CategoriaMarca busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl);
|
||||
|
||||
public void actualizacionAuditagem(List<CategoriaMarca> lsCategoriaMarca);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaMercado;
|
||||
|
||||
|
@ -14,4 +16,6 @@ import com.rjconsultores.ventaboletos.entidad.CategoriaMercado;
|
|||
public interface CategoriaMercadoService extends GenericService<CategoriaMercado, Integer> {
|
||||
|
||||
public CategoriaMercado busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl);
|
||||
|
||||
public void actualizacionAuditagem(List<CategoriaMercado> lsCategoriaMercado);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaOrgao;
|
||||
|
||||
public interface CategoriaOrgaoService extends GenericService<CategoriaOrgao, Integer> {
|
||||
|
||||
public CategoriaOrgao busquedaPorCategoriaCtrl(CategoriaCtrl categoriaCtrl);
|
||||
|
||||
public void actualizacionAuditagem(List<CategoriaOrgao> lsCategoriaOrgao);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaRutaExcecao;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Wallace
|
||||
*/
|
||||
public interface CategoriaRutaExcecaoService extends GenericService<CategoriaRutaExcecao, Integer> {
|
||||
|
||||
public CategoriaRutaExcecao busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl);
|
||||
|
||||
void actualizacionAuditagem(List<CategoriaRutaExcecao> lsCategoriaClase);
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaRuta;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Wallace
|
||||
*/
|
||||
public interface CategoriaRutaService extends GenericService<CategoriaRuta, Integer> {
|
||||
|
||||
public CategoriaRuta busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl);
|
||||
|
||||
void actualizacionAuditagem(List<CategoriaRuta> lsCategoriaClase);
|
||||
}
|
|
@ -4,16 +4,18 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.CategoriaClaseDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaClase;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||
import com.rjconsultores.ventaboletos.service.CategoriaClaseService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -64,4 +66,15 @@ public class CategoriaClaseServiceImpl implements CategoriaClaseService {
|
|||
public CategoriaClase busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl) {
|
||||
return categoriaClaseDAO.busquedaPoCategoriaCtrl(categoriaCtrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void actualizacionAuditagem(List<CategoriaClase> lsCategoriaClase) {
|
||||
for (CategoriaClase cc : lsCategoriaClase) {
|
||||
if(Boolean.TRUE.equals(cc.getActivo())) {
|
||||
continue;
|
||||
}
|
||||
categoriaClaseDAO.actualizacion(cc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,16 +4,19 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.CategoriaCorridaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCorrida;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||
import com.rjconsultores.ventaboletos.service.CategoriaCorridaService;
|
||||
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -24,6 +27,9 @@ public class CategoriaCorridaServiceImpl implements CategoriaCorridaService {
|
|||
|
||||
@Autowired
|
||||
private CategoriaCorridaDAO categoriaCorridaDAO;
|
||||
@Autowired
|
||||
private LogAuditoriaService logAuditoriaService;
|
||||
|
||||
|
||||
public List<CategoriaCorrida> obtenerTodos() {
|
||||
return categoriaCorridaDAO.obtenerTodos();
|
||||
|
@ -56,12 +62,12 @@ public class CategoriaCorridaServiceImpl implements CategoriaCorridaService {
|
|||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.FALSE);
|
||||
|
||||
|
||||
categoriaCorridaDAO.actualizacion(entidad);
|
||||
logAuditoriaService.auditarExclusao(entidad, null);
|
||||
}
|
||||
|
||||
public CategoriaCorrida busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl) {
|
||||
return categoriaCorridaDAO.busquedaPoCategoriaCtrl(categoriaCtrl);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@ import java.util.ArrayList;
|
|||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
@ -26,6 +28,7 @@ import com.rjconsultores.ventaboletos.entidad.CategoriaMercado;
|
|||
import com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo;
|
||||
import com.rjconsultores.ventaboletos.entidad.Constante;
|
||||
import com.rjconsultores.ventaboletos.service.CategoriaCtrlService;
|
||||
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
/**
|
||||
|
@ -48,10 +51,15 @@ public class CategoriaCtrlServiceImpl implements CategoriaCtrlService {
|
|||
|
||||
@Autowired
|
||||
private ConstanteDAO constanteDAO;
|
||||
@Autowired
|
||||
private LogAuditoriaService logAuditoriaService;
|
||||
private static Logger log = LoggerFactory.getLogger(CategoriaCtrlServiceImpl.class);
|
||||
|
||||
@Override
|
||||
public CategoriaCtrl obtenerID(Integer id) {
|
||||
|
||||
return categoriaCtrlDAO.obtenerID(id);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -61,7 +69,10 @@ public class CategoriaCtrlServiceImpl implements CategoriaCtrlService {
|
|||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return categoriaCtrlDAO.suscribir(entidad);
|
||||
entidad = categoriaCtrlDAO.suscribir(entidad);
|
||||
logAuditoriaService.auditar(null, entidad, entidad.getEmpresa() != null ? entidad.getEmpresa().getEmpresaId() : null);
|
||||
|
||||
return entidad;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -109,11 +120,23 @@ public class CategoriaCtrlServiceImpl implements CategoriaCtrlService {
|
|||
@Override
|
||||
@Transactional
|
||||
public CategoriaCtrl actualizacion(CategoriaCtrl entidad) {
|
||||
|
||||
CategoriaCtrl originalClone = null;
|
||||
try {
|
||||
originalClone = entidad.getCloneObject();
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("Erro ao clonar CategoriaCtrl: ",e);
|
||||
}
|
||||
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return categoriaCtrlDAO.actualizacion(entidad);
|
||||
entidad = categoriaCtrlDAO.actualizacion(entidad);
|
||||
logAuditoriaService.auditar(originalClone, entidad, null);
|
||||
|
||||
return entidad;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -151,6 +174,8 @@ public class CategoriaCtrlServiceImpl implements CategoriaCtrlService {
|
|||
entidad.setActivo(Boolean.FALSE);
|
||||
|
||||
categoriaCtrlDAO.actualizacion(entidad);
|
||||
logAuditoriaService.auditarExclusao(entidad, entidad.getEmpresa() != null ? entidad.getEmpresa().getEmpresaId() : null);
|
||||
|
||||
}
|
||||
|
||||
private CategoriaDescuento getCategoriaDescuentoAdulto(CategoriaCtrl categoriaCtrl) {
|
||||
|
|
|
@ -4,16 +4,22 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.CategoriaDescuentoDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaDescuento;
|
||||
import com.rjconsultores.ventaboletos.service.CategoriaDescuentoService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.CategoriaDescuentoDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaDescuento;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.service.CategoriaDescuentoService;
|
||||
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Administrador
|
||||
|
@ -23,13 +29,17 @@ public class CategoriaDescuentoServiceImpl implements CategoriaDescuentoService
|
|||
|
||||
@Autowired
|
||||
private CategoriaDescuentoDAO categoriaDescuentoDAO;
|
||||
private static Logger log = LoggerFactory.getLogger(CategoriaDescuentoServiceImpl.class);
|
||||
@Autowired
|
||||
private LogAuditoriaService logAuditoriaService;
|
||||
|
||||
|
||||
public List<CategoriaDescuento> obtenerTodos() {
|
||||
return categoriaDescuentoDAO.obtenerTodos();
|
||||
}
|
||||
|
||||
public CategoriaDescuento obtenerID(Integer id) {
|
||||
return categoriaDescuentoDAO.obtenerID(id);
|
||||
return categoriaDescuentoDAO.obtenerID(id);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
@ -37,17 +47,27 @@ public class CategoriaDescuentoServiceImpl implements CategoriaDescuentoService
|
|||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return categoriaDescuentoDAO.suscribir(entidad);
|
||||
entidad = categoriaDescuentoDAO.suscribir(entidad);
|
||||
logAuditoriaService.auditar(null, entidad, null);
|
||||
return entidad;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public CategoriaDescuento actualizacion(CategoriaDescuento entidad) {
|
||||
|
||||
CategoriaDescuento originalClone = null;
|
||||
try {
|
||||
originalClone = entidad.getCloneObject();
|
||||
} catch (Exception e) {
|
||||
log.error("Erro ao clonar TitularId",e);
|
||||
}
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return categoriaDescuentoDAO.actualizacion(entidad);
|
||||
entidad = categoriaDescuentoDAO.actualizacion(entidad);
|
||||
logAuditoriaService.auditar(originalClone, entidad, null);
|
||||
return entidad;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
@ -57,5 +77,7 @@ public class CategoriaDescuentoServiceImpl implements CategoriaDescuentoService
|
|||
entidad.setActivo(Boolean.FALSE);
|
||||
|
||||
categoriaDescuentoDAO.actualizacion(entidad);
|
||||
logAuditoriaService.auditarExclusao(entidad, null);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.CategoriaMarcaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCorrida;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaMarca;
|
||||
import com.rjconsultores.ventaboletos.service.CategoriaMarcaService;
|
||||
|
@ -63,4 +64,16 @@ public class CategoriaMarcaServiceImpl implements CategoriaMarcaService {
|
|||
public CategoriaMarca busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl) {
|
||||
return categoriaMarcaDAO.busquedaPoCategoriaCtrl(categoriaCtrl);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void actualizacionAuditagem(List<CategoriaMarca> lsCategoriaMarca) {
|
||||
|
||||
for (CategoriaMarca cc : lsCategoriaMarca) {
|
||||
if(cc.getActivo()) {
|
||||
continue;
|
||||
}
|
||||
categoriaMarcaDAO.actualizacion(cc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,16 +4,18 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.CategoriaMercadoDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaMercado;
|
||||
import com.rjconsultores.ventaboletos.service.CategoriaMercadoService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -63,4 +65,15 @@ public class CategoriaMercadoServiceImpl implements CategoriaMercadoService {
|
|||
public CategoriaMercado busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl) {
|
||||
return categoriaMercadoDAO.busquedaPoCategoriaCtrl(categoriaCtrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void actualizacionAuditagem(List<CategoriaMercado> lsCategoriaMercado) {
|
||||
for (CategoriaMercado cc : lsCategoriaMercado) {
|
||||
if(Boolean.TRUE.equals(cc.getActivo())) {
|
||||
continue;
|
||||
}
|
||||
categoriaMercadoDAO.actualizacion(cc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,16 +4,18 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.CategoriaOrgaoDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaOrgao;
|
||||
import com.rjconsultores.ventaboletos.service.CategoriaOrgaoService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
@Service("categoriaOrgaoService")
|
||||
|
@ -60,4 +62,16 @@ public class CategoriaOrgaoServiceImpl implements CategoriaOrgaoService {
|
|||
public CategoriaOrgao busquedaPorCategoriaCtrl(CategoriaCtrl categoriaCtrl) {
|
||||
return categoriaOrgaoDAO.busquedaPorCategoriaCtrl(categoriaCtrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void actualizacionAuditagem(List<CategoriaOrgao> lsCategoriaOrgao) {
|
||||
for (CategoriaOrgao cc : lsCategoriaOrgao) {
|
||||
if(Boolean.TRUE.equals(cc.getActivo())) {
|
||||
continue;
|
||||
}
|
||||
categoriaOrgaoDAO.actualizacion(cc);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.rjconsultores.ventaboletos.dao.CategoriaPeriodoDAO;
|
|||
import com.rjconsultores.ventaboletos.entidad.CategoriaDescuento;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo;
|
||||
import com.rjconsultores.ventaboletos.service.CategoriaPeriodoService;
|
||||
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
@ -24,6 +25,8 @@ public class CategoriaPeriodoServiceImpl implements CategoriaPeriodoService {
|
|||
|
||||
@Autowired
|
||||
private CategoriaPeriodoDAO categoriaPeriodoDAO;
|
||||
@Autowired
|
||||
private LogAuditoriaService logAuditoriaService;
|
||||
|
||||
public List<CategoriaPeriodo> obtenerTodos() {
|
||||
return categoriaPeriodoDAO.obtenerTodos();
|
||||
|
@ -38,8 +41,11 @@ public class CategoriaPeriodoServiceImpl implements CategoriaPeriodoService {
|
|||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
entidad = categoriaPeriodoDAO.suscribir(entidad);
|
||||
logAuditoriaService.auditar(null, entidad, entidad.getCategoriaDescuento().getCategoriaCtrl().getEmpresa() != null ? entidad.getCategoriaDescuento().getCategoriaCtrl().getEmpresa().getEmpresaId() : null);
|
||||
|
||||
return categoriaPeriodoDAO.suscribir(entidad);
|
||||
return entidad;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
@ -58,6 +64,8 @@ public class CategoriaPeriodoServiceImpl implements CategoriaPeriodoService {
|
|||
entidad.setActivo(Boolean.FALSE);
|
||||
|
||||
categoriaPeriodoDAO.actualizacion(entidad);
|
||||
logAuditoriaService.auditarExclusao(entidad, entidad.getCategoriaDescuento().getCategoriaCtrl().getEmpresa() != null ? entidad.getCategoriaDescuento().getCategoriaCtrl().getEmpresa().getEmpresaId() : null);
|
||||
|
||||
}
|
||||
|
||||
public List<CategoriaPeriodo> buscarPeriodoIntervalo(CategoriaPeriodo cPeriodo) {
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.CategoriaRutaExcecaoDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaRutaExcecao;
|
||||
import com.rjconsultores.ventaboletos.service.CategoriaRutaExcecaoService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Wallace
|
||||
*/
|
||||
@Service("categoriaRutaExcecaoService")
|
||||
public class CategoriaRutaExcecaoServiceImpl implements CategoriaRutaExcecaoService {
|
||||
|
||||
@Autowired
|
||||
private CategoriaRutaExcecaoDAO categoriaRutaExcecaoDAO;
|
||||
|
||||
public List<CategoriaRutaExcecao> obtenerTodos() {
|
||||
return categoriaRutaExcecaoDAO.obtenerTodos();
|
||||
}
|
||||
|
||||
public CategoriaRutaExcecao obtenerID(Integer id) {
|
||||
return categoriaRutaExcecaoDAO.obtenerID(id);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public CategoriaRutaExcecao suscribir(CategoriaRutaExcecao entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return categoriaRutaExcecaoDAO.suscribir(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public CategoriaRutaExcecao actualizacion(CategoriaRutaExcecao entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return categoriaRutaExcecaoDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void borrar(CategoriaRutaExcecao entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.FALSE);
|
||||
|
||||
categoriaRutaExcecaoDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
public CategoriaRutaExcecao busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl) {
|
||||
return categoriaRutaExcecaoDAO.busquedaPorCategoriaCtrl(categoriaCtrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void actualizacionAuditagem(List<CategoriaRutaExcecao> lsCategoriaRutaExcecao) {
|
||||
for (CategoriaRutaExcecao cc : lsCategoriaRutaExcecao) {
|
||||
if(Boolean.TRUE.equals(cc.getActivo())) {
|
||||
continue;
|
||||
}
|
||||
categoriaRutaExcecaoDAO.actualizacion(cc);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.CategoriaRutaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaRuta;
|
||||
import com.rjconsultores.ventaboletos.service.CategoriaRutaService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Wallace
|
||||
*/
|
||||
@Service("categoriaRutaService")
|
||||
public class CategoriaRutaServiceImpl implements CategoriaRutaService {
|
||||
|
||||
@Autowired
|
||||
private CategoriaRutaDAO categoriaRutaDAO;
|
||||
|
||||
public List< CategoriaRuta> obtenerTodos() {
|
||||
return categoriaRutaDAO.obtenerTodos();
|
||||
}
|
||||
|
||||
public CategoriaRuta obtenerID(Integer id) {
|
||||
return categoriaRutaDAO.obtenerID(id);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public CategoriaRuta suscribir( CategoriaRuta entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return categoriaRutaDAO.suscribir(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public CategoriaRuta actualizacion( CategoriaRuta entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return categoriaRutaDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void borrar( CategoriaRuta entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.FALSE);
|
||||
|
||||
|
||||
categoriaRutaDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
public CategoriaRuta busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl) {
|
||||
return categoriaRutaDAO.busquedaPorCategoriaCtrl(categoriaCtrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void actualizacionAuditagem(List<CategoriaRuta> lsCategoriaClase) {
|
||||
for ( CategoriaRuta cc : lsCategoriaClase) {
|
||||
if(Boolean.TRUE.equals(cc.getActivo())) {
|
||||
continue;
|
||||
}
|
||||
categoriaRutaDAO.actualizacion(cc);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,11 +7,16 @@ package com.rjconsultores.ventaboletos.service.impl;
|
|||
import com.rjconsultores.ventaboletos.dao.CategoriaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Categoria;
|
||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.service.CategoriaService;
|
||||
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
@ -25,31 +30,59 @@ public class CategoriaServiceImpl implements CategoriaService {
|
|||
|
||||
@Autowired
|
||||
private CategoriaDAO categoriaDAO;
|
||||
private static Logger log = LoggerFactory.getLogger(CategoriaServiceImpl.class);
|
||||
@Autowired
|
||||
private LogAuditoriaService logAuditoriaService;
|
||||
|
||||
|
||||
public List<Categoria> obtenerTodos() {
|
||||
return categoriaDAO.obtenerTodos();
|
||||
}
|
||||
|
||||
public Categoria obtenerID(Integer id) {
|
||||
return categoriaDAO.obtenerID(id);
|
||||
|
||||
Categoria categoria = categoriaDAO.obtenerID(id);
|
||||
try {
|
||||
categoria.clonar();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return categoria;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Categoria suscribir(Categoria entidad) {
|
||||
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return categoriaDAO.suscribir(entidad);
|
||||
entidad = categoriaDAO.suscribir(entidad);
|
||||
logAuditoriaService.auditar(null, entidad, null);
|
||||
|
||||
logAuditoriaService.auditar(null, entidad, null);
|
||||
return entidad;
|
||||
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Categoria actualizacion(Categoria entidad) {
|
||||
|
||||
Categoria originalClone = null;
|
||||
try {
|
||||
originalClone = entidad.getCloneObject();
|
||||
} catch (Exception e) {
|
||||
log.error("Erro ao clonar TitularId",e);
|
||||
}
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return categoriaDAO.actualizacion(entidad);
|
||||
entidad = categoriaDAO.actualizacion(entidad);
|
||||
logAuditoriaService.auditar(originalClone, entidad, null);
|
||||
return entidad;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
|
|
@ -9,6 +9,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
import com.rjconsultores.ventaboletos.dao.PtovtaCatIndDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.PtovtaCatInd;
|
||||
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
|
||||
import com.rjconsultores.ventaboletos.service.PtovtaCatIndService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
|
@ -17,6 +18,8 @@ public class PtovtaCatIndServiceImpl implements PtovtaCatIndService {
|
|||
|
||||
@Autowired
|
||||
private PtovtaCatIndDAO ptovtaCatIndDAO;
|
||||
@Autowired
|
||||
private LogAuditoriaService logAuditoriaService;
|
||||
|
||||
@Override
|
||||
public List<PtovtaCatInd> obtenerTodos() {
|
||||
|
@ -53,6 +56,8 @@ public class PtovtaCatIndServiceImpl implements PtovtaCatIndService {
|
|||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.FALSE);
|
||||
ptovtaCatIndDAO.actualizacion(entidad);
|
||||
logAuditoriaService.auditarExclusao(entidad, entidad.getEmpresa() != null ? entidad.getEmpresa().getEmpresaId() : null);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue