Merge branch 'master' into melhoria_enums
commit
51e5acf7d6
2
pom.xml
2
pom.xml
|
@ -3,7 +3,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>br.com.rjconsultores</groupId>
|
<groupId>br.com.rjconsultores</groupId>
|
||||||
<artifactId>ModelWeb</artifactId>
|
<artifactId>ModelWeb</artifactId>
|
||||||
<version>1.0.20</version>
|
<version>1.0.22</version>
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
<id>rj-releases</id>
|
<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.AceiteBB;
|
||||||
import com.rjconsultores.ventaboletos.enuns.BancoLayout;
|
import com.rjconsultores.ventaboletos.enuns.BancoLayout;
|
||||||
import com.rjconsultores.ventaboletos.enuns.TipoInscricaoPagador;
|
import com.rjconsultores.ventaboletos.enuns.TipoInscricaoPagador;
|
||||||
|
import com.rjconsultores.ventaboletos.exception.ValidacaoRemessaException;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.CustomEnum;
|
import com.rjconsultores.ventaboletos.utilerias.CustomEnum;
|
||||||
|
|
||||||
|
@ -233,7 +234,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
||||||
}
|
}
|
||||||
|
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
|
@ -249,13 +250,13 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
||||||
try{
|
try{
|
||||||
detalhe.setNumeroInscricaoPagador(tupla[19].toString().replaceAll("[^0-9]+", ""));
|
detalhe.setNumeroInscricaoPagador(tupla[19].toString().replaceAll("[^0-9]+", ""));
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
detalhe.setEnderecoCompletoPagador(tupla[21].toString());
|
detalhe.setEnderecoCompletoPagador(tupla[21].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
|
@ -263,7 +264,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
||||||
detalhe.setCEP_Prefixo(cep.substring(0,5));
|
detalhe.setCEP_Prefixo(cep.substring(0,5));
|
||||||
detalhe.setCEP_Sufixo(cep.substring(5));
|
detalhe.setCEP_Sufixo(cep.substring(5));
|
||||||
}catch(Exception e){
|
}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);
|
arquivoRemessaItem.addTitulo(detalhe);
|
||||||
|
@ -419,7 +420,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
||||||
}
|
}
|
||||||
|
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
|
@ -433,37 +434,37 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
||||||
try{
|
try{
|
||||||
detalhe.setNumeroInscricao(tupla[19].toString().replaceAll("[^0-9]+", ""));
|
detalhe.setNumeroInscricao(tupla[19].toString().replaceAll("[^0-9]+", ""));
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
detalhe.setNumeroInscricaoSacado(tupla[28].toString().replaceAll("[^0-9]+", ""));
|
detalhe.setNumeroInscricaoSacado(tupla[28].toString().replaceAll("[^0-9]+", ""));
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
detalhe.setEnderecoSacado(tupla[21].toString());
|
detalhe.setEnderecoSacado(tupla[21].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
detalhe.setBairroSacado(tupla[22].toString());
|
detalhe.setBairroSacado(tupla[22].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
detalhe.setCidade(tupla[23].toString());
|
detalhe.setCidade(tupla[23].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
detalhe.setEstado(tupla[24].toString());
|
detalhe.setEstado(tupla[24].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
|
@ -471,7 +472,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
||||||
detalhe.setCepSacado(cep.substring(0,5));
|
detalhe.setCepSacado(cep.substring(0,5));
|
||||||
detalhe.setComplementoCepSacado(cep.substring(5));
|
detalhe.setComplementoCepSacado(cep.substring(5));
|
||||||
}catch(Exception e){
|
}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);
|
arquivoRemessaItem.addTitulo(detalhe);
|
||||||
|
@ -619,31 +620,31 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
||||||
try{
|
try{
|
||||||
detalhe.setEnderecoCompletoPagador(tupla[21].toString());
|
detalhe.setEnderecoCompletoPagador(tupla[21].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
detalhe.setBairro(tupla[22].toString());
|
detalhe.setBairro(tupla[22].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
detalhe.setCidade(tupla[23].toString());
|
detalhe.setCidade(tupla[23].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
detalhe.setEstado(tupla[24].toString());
|
detalhe.setEstado(tupla[24].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
detalhe.setCnpj(Long.valueOf(tupla[19].toString().replaceAll("[^0-9]+", "")));
|
detalhe.setCnpj(Long.valueOf(tupla[19].toString().replaceAll("[^0-9]+", "")));
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
|
@ -651,7 +652,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
||||||
detalhe.setCepPrefixo(cep.substring(0,5));
|
detalhe.setCepPrefixo(cep.substring(0,5));
|
||||||
detalhe.setCepSufixo(cep.substring(5));
|
detalhe.setCepSufixo(cep.substring(5));
|
||||||
}catch(Exception e){
|
}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);
|
arquivoRemessaItem.addTitulo(detalhe);
|
||||||
|
@ -757,8 +758,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
||||||
arquivoRemessaItem.setRodapeRemessa(new RodapeRemessaPadrao());
|
arquivoRemessaItem.setRodapeRemessa(new RodapeRemessaPadrao());
|
||||||
|
|
||||||
arquivoRemessa.addItem(arquivoRemessaItem);
|
arquivoRemessa.addItem(arquivoRemessaItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DetalheObrigatorioItau detalhe = new DetalheObrigatorioItau();
|
DetalheObrigatorioItau detalhe = new DetalheObrigatorioItau();
|
||||||
|
|
||||||
|
@ -814,37 +814,37 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
||||||
try{
|
try{
|
||||||
detalhe.setNumeroInscricaoSacado(Long.valueOf(tupla[20].toString()));
|
detalhe.setNumeroInscricaoSacado(Long.valueOf(tupla[20].toString()));
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
detalhe.setLogradouroSacado(tupla[22].toString());
|
detalhe.setLogradouroSacado(tupla[22].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
detalhe.setBairroSacado(tupla[23].toString());
|
detalhe.setBairroSacado(tupla[23].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
detalhe.setCepSacado(tupla[24].toString());
|
detalhe.setCepSacado(tupla[24].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
detalhe.setCidade(tupla[25].toString());
|
detalhe.setCidade(tupla[25].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
detalhe.setEstado(tupla[26].toString());
|
detalhe.setEstado(tupla[26].toString());
|
||||||
}catch(Exception e){
|
}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);
|
arquivoRemessaItem.addTitulo(detalhe);
|
||||||
|
@ -940,7 +940,6 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
||||||
cabecalhoRemessaBancoBrasil.setNumContaCorrente(tupla[6].toString());
|
cabecalhoRemessaBancoBrasil.setNumContaCorrente(tupla[6].toString());
|
||||||
cabecalhoRemessaBancoBrasil.setDigContaCorrente(tupla[7].toString());
|
cabecalhoRemessaBancoBrasil.setDigContaCorrente(tupla[7].toString());
|
||||||
cabecalhoRemessaBancoBrasil.setNumCarteira(tupla[8].toString());
|
cabecalhoRemessaBancoBrasil.setNumCarteira(tupla[8].toString());
|
||||||
cabecalhoRemessaBancoBrasil.setNumVarCarteira(((BigDecimal) tupla[28]).toString());
|
|
||||||
cabecalhoRemessaBancoBrasil.setNomeEmpresa(nomeEmpresa);
|
cabecalhoRemessaBancoBrasil.setNomeEmpresa(nomeEmpresa);
|
||||||
cabecalhoRemessaBancoBrasil.setNumConvenio(codEmpresaBanco);
|
cabecalhoRemessaBancoBrasil.setNumConvenio(codEmpresaBanco);
|
||||||
|
|
||||||
|
@ -952,14 +951,23 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
||||||
cabecalhoLoteRemessaBancoBrasil.setDigAgenciaConta(" ");
|
cabecalhoLoteRemessaBancoBrasil.setDigAgenciaConta(" ");
|
||||||
cabecalhoLoteRemessaBancoBrasil.setNumContaCorrente(tupla[6].toString());
|
cabecalhoLoteRemessaBancoBrasil.setNumContaCorrente(tupla[6].toString());
|
||||||
cabecalhoLoteRemessaBancoBrasil.setDigContaCorrente(tupla[7].toString());
|
cabecalhoLoteRemessaBancoBrasil.setDigContaCorrente(tupla[7].toString());
|
||||||
cabecalhoLoteRemessaBancoBrasil.setNumCarteira(tupla[8].toString());
|
cabecalhoLoteRemessaBancoBrasil.setNumCarteira(tupla[8].toString());
|
||||||
cabecalhoLoteRemessaBancoBrasil.setNumVarCarteira(((BigDecimal) tupla[28]).toString());
|
|
||||||
cabecalhoLoteRemessaBancoBrasil.setNomeEmpresa(nomeEmpresa);
|
cabecalhoLoteRemessaBancoBrasil.setNomeEmpresa(nomeEmpresa);
|
||||||
cabecalhoLoteRemessaBancoBrasil.setNumConvenio(codEmpresaBanco);
|
cabecalhoLoteRemessaBancoBrasil.setNumConvenio(codEmpresaBanco);
|
||||||
cabecalhoLoteRemessaBancoBrasil.setDataGeracao(new Date());
|
cabecalhoLoteRemessaBancoBrasil.setDataGeracao(new Date());
|
||||||
cabecalhoLoteRemessaBancoBrasil.setNumeroRemessa(idRemessa);
|
cabecalhoLoteRemessaBancoBrasil.setNumeroRemessa(idRemessa);
|
||||||
cabecalhoLoteRemessaBancoBrasil.setRemessaTesteID("TS");
|
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);
|
cabecalhoRemessaBancoBrasil.setCabecalhoLoteRemessaBancoBrasil(cabecalhoLoteRemessaBancoBrasil);
|
||||||
|
|
||||||
|
@ -1042,31 +1050,31 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
||||||
try{
|
try{
|
||||||
pagadorBancoBrasil.setNumeroInscricaoSacado(tupla[20].toString());
|
pagadorBancoBrasil.setNumeroInscricaoSacado(tupla[20].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
pagadorBancoBrasil.setLogradouroSacado(tupla[22].toString());
|
pagadorBancoBrasil.setLogradouroSacado(tupla[22].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
pagadorBancoBrasil.setBairroSacado(tupla[23].toString());
|
pagadorBancoBrasil.setBairroSacado(tupla[23].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
pagadorBancoBrasil.setCidade(tupla[25].toString());
|
pagadorBancoBrasil.setCidade(tupla[25].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
pagadorBancoBrasil.setEstado(tupla[26].toString());
|
pagadorBancoBrasil.setEstado(tupla[26].toString());
|
||||||
}catch(Exception e){
|
}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);
|
titulosBancoBrasil.setDetalheObrigatorioDadosPagadorBancoBrasil(pagadorBancoBrasil);
|
||||||
|
@ -1199,10 +1207,10 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
||||||
}else {
|
}else {
|
||||||
try{
|
try{
|
||||||
if( !(cabecalhoRemessaSicoob.getNumConvenio()).equals(codEmpresaBanco)) {
|
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){
|
}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{
|
try{
|
||||||
pagadorSicoob.setNumeroInscricaoSacado(tupla[20].toString());
|
pagadorSicoob.setNumeroInscricaoSacado(tupla[20].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
pagadorSicoob.setLogradouroSacado(tupla[22].toString());
|
pagadorSicoob.setLogradouroSacado(tupla[22].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
pagadorSicoob.setBairroSacado(tupla[23].toString());
|
pagadorSicoob.setBairroSacado(tupla[23].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
pagadorSicoob.setCidade(tupla[25].toString());
|
pagadorSicoob.setCidade(tupla[25].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
pagadorSicoob.setEstado(tupla[26].toString());
|
pagadorSicoob.setEstado(tupla[26].toString());
|
||||||
}catch(Exception e){
|
}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);
|
titulosSicoob.setDetalheObrigatorioDadosPagadorSicoob(pagadorSicoob);
|
||||||
|
@ -1440,7 +1448,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
||||||
try{
|
try{
|
||||||
titulosCaixa.setNumeroInscricao(tupla[3].toString().replaceAll("[^0-9]+", ""));
|
titulosCaixa.setNumeroInscricao(tupla[3].toString().replaceAll("[^0-9]+", ""));
|
||||||
}catch(Exception e){
|
}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 = "";
|
String cep = "";
|
||||||
|
@ -1455,31 +1463,31 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
||||||
try{
|
try{
|
||||||
titulosCaixa.setNumeroInscricaoSacado(tupla[14].toString());
|
titulosCaixa.setNumeroInscricaoSacado(tupla[14].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
titulosCaixa.setEnderecoSacado(tupla[16].toString());
|
titulosCaixa.setEnderecoSacado(tupla[16].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
titulosCaixa.setBairroSacado(tupla[17].toString());
|
titulosCaixa.setBairroSacado(tupla[17].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
titulosCaixa.setCidade(tupla[19].toString());
|
titulosCaixa.setCidade(tupla[19].toString());
|
||||||
}catch(Exception e){
|
}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{
|
try{
|
||||||
titulosCaixa.setEstado(tupla[20].toString());
|
titulosCaixa.setEstado(tupla[20].toString());
|
||||||
}catch(Exception e){
|
}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("");
|
titulosCaixa.setSacadorAvalista("");
|
||||||
|
@ -1748,6 +1756,7 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO<Fechament
|
||||||
int qtd = stmt.executeUpdate(qry.toString());
|
int qtd = stmt.executeUpdate(qry.toString());
|
||||||
con.commit();
|
con.commit();
|
||||||
stmt.close();
|
stmt.close();
|
||||||
|
con.close();
|
||||||
|
|
||||||
return qtd==1;
|
return qtd==1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,9 @@ import javax.persistence.SequenceGenerator;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
import javax.persistence.TemporalType;
|
||||||
|
import javax.persistence.Transient;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.BooleanUtils;
|
||||||
|
|
||||||
import org.hibernate.annotations.Parameter;
|
import org.hibernate.annotations.Parameter;
|
||||||
import org.hibernate.annotations.Type;
|
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.TipoDescontoBPe;
|
||||||
import com.rjconsultores.ventaboletos.enums.TipoDescontoMonitrip;
|
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.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
|
@Entity
|
||||||
@SequenceGenerator(name = "CATEGORIA_SEQ", sequenceName = "CATEGORIA_SEQ", allocationSize = 1)
|
@SequenceGenerator(name = "CATEGORIA_SEQ", sequenceName = "CATEGORIA_SEQ", allocationSize = 1)
|
||||||
|
@AuditarClasse(nome = "CATEGORIA", tela = "Altera<72><61>o de Categoria")
|
||||||
@Table(name = "CATEGORIA")
|
@Table(name = "CATEGORIA")
|
||||||
public class Categoria implements Serializable {
|
public class Categoria implements Serializable, Auditavel<Categoria>{
|
||||||
|
|
||||||
public static Integer CATEGORIA_NORMAL = 1;
|
public static Integer CATEGORIA_NORMAL = 1;
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@Id
|
@Id
|
||||||
|
@ -61,8 +69,10 @@ public class Categoria implements Serializable {
|
||||||
private Date fecmodif;
|
private Date fecmodif;
|
||||||
@Column(name = "USUARIO_ID")
|
@Column(name = "USUARIO_ID")
|
||||||
private Integer usuarioId;
|
private Integer usuarioId;
|
||||||
|
@AuditarLista(auditarEntidades = true, nome = "CategoriaDescuento")
|
||||||
@OneToMany(mappedBy = "categoria", cascade = CascadeType.ALL)
|
@OneToMany(mappedBy = "categoria", cascade = CascadeType.ALL)
|
||||||
private List<CategoriaDescuento> categoriaDescuentoList;
|
private List<CategoriaDescuento> categoriaDescuentoList;
|
||||||
|
@AuditarLista(auditarEntidades = true, nome = "reservacionCategoriaList")
|
||||||
@OneToMany(mappedBy = "categoria", cascade = CascadeType.ALL)
|
@OneToMany(mappedBy = "categoria", cascade = CascadeType.ALL)
|
||||||
private List<ReservacionCategoria> reservacionCategoriaList;
|
private List<ReservacionCategoria> reservacionCategoriaList;
|
||||||
|
|
||||||
|
@ -110,6 +120,10 @@ public class Categoria implements Serializable {
|
||||||
@Column(name = "INDEXIGEIDENTIDADE")
|
@Column(name = "INDEXIGEIDENTIDADE")
|
||||||
private Boolean indExigeIdentidade;
|
private Boolean indExigeIdentidade;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
@NaoAuditar
|
||||||
|
private Categoria categoriaClone;
|
||||||
|
|
||||||
public Categoria() {
|
public Categoria() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,4 +324,22 @@ public class Categoria implements Serializable {
|
||||||
this.indExigeIdentidade = indExigeIdentidade;
|
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.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
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;
|
import javax.persistence.SequenceGenerator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,9 +32,10 @@ import javax.persistence.SequenceGenerator;
|
||||||
* @author Administrador
|
* @author Administrador
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
|
@AuditarClasse(nome = "CategoriaClase", tela = "Alteração de Categoria Classe")
|
||||||
@SequenceGenerator(name = "CATEGORIA_CLASE_SEQ", sequenceName = "CATEGORIA_CLASE_SEQ", allocationSize = 1)
|
@SequenceGenerator(name = "CATEGORIA_CLASE_SEQ", sequenceName = "CATEGORIA_CLASE_SEQ", allocationSize = 1)
|
||||||
@Table(name = "CATEGORIA_CLASE")
|
@Table(name = "CATEGORIA_CLASE")
|
||||||
public class CategoriaClase implements Serializable {
|
public class CategoriaClase implements Serializable, Auditavel<CategoriaClase> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@Id
|
@Id
|
||||||
|
@ -47,6 +56,9 @@ public class CategoriaClase implements Serializable {
|
||||||
@JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID")
|
@JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID")
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private CategoriaCtrl categoriaCtrl;
|
private CategoriaCtrl categoriaCtrl;
|
||||||
|
@Transient
|
||||||
|
@NaoAuditar
|
||||||
|
private CategoriaClase categoriaClaseClone;
|
||||||
|
|
||||||
public CategoriaClase() {
|
public CategoriaClase() {
|
||||||
}
|
}
|
||||||
|
@ -132,4 +144,22 @@ public class CategoriaClase implements Serializable {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "com.rjconsultores.ventaboletos.entidad.CategoriaClase[categoriaclaseId=" + categoriaclaseId + "]";
|
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.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import javax.persistence.Basic;
|
import javax.persistence.Basic;
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
@ -14,22 +15,29 @@ import javax.persistence.GenerationType;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
import javax.persistence.JoinColumn;
|
import javax.persistence.JoinColumn;
|
||||||
import javax.persistence.ManyToOne;
|
import javax.persistence.ManyToOne;
|
||||||
|
import javax.persistence.SequenceGenerator;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
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.NotFound;
|
||||||
import org.hibernate.annotations.NotFoundAction;
|
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
|
* @author Administrador
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
|
@AuditarClasse(nome = "CategoriaCorrida", tela = "Alteração de Categoria Corrida")
|
||||||
@SequenceGenerator(name = "CATEGORIA_CORRIDA_SEQ", sequenceName = "CATEGORIA_CORRIDA_SEQ", allocationSize = 1)
|
@SequenceGenerator(name = "CATEGORIA_CORRIDA_SEQ", sequenceName = "CATEGORIA_CORRIDA_SEQ", allocationSize = 1)
|
||||||
@Table(name = "CATEGORIA_CORRIDA")
|
@Table(name = "CATEGORIA_CORRIDA")
|
||||||
public class CategoriaCorrida implements Serializable {
|
public class CategoriaCorrida implements Serializable, Auditavel<CategoriaCorrida> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@Id
|
@Id
|
||||||
|
@ -52,6 +60,9 @@ public class CategoriaCorrida implements Serializable {
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@NotFound(action=NotFoundAction.IGNORE)
|
@NotFound(action=NotFoundAction.IGNORE)
|
||||||
private CategoriaCtrl categoriaCtrl;
|
private CategoriaCtrl categoriaCtrl;
|
||||||
|
@Transient
|
||||||
|
@NaoAuditar
|
||||||
|
private CategoriaCorrida categoriaCorridaClone;
|
||||||
|
|
||||||
public CategoriaCorrida() {
|
public CategoriaCorrida() {
|
||||||
}
|
}
|
||||||
|
@ -138,4 +149,22 @@ public class CategoriaCorrida implements Serializable {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "com.rjconsultores.ventaboletos.entidad.CategoriaCorrida[categoriaCorrida=" + categoriaCorrida + "]";
|
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.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
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.NotFound;
|
||||||
import org.hibernate.annotations.NotFoundAction;
|
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
|
* @author Administrador
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@SequenceGenerator(name = "CATEGORIA_CTRL_SEQ", sequenceName = "CATEGORIA_CTRL_SEQ", allocationSize = 1)
|
@SequenceGenerator(name = "CATEGORIA_CTRL_SEQ", sequenceName = "CATEGORIA_CTRL_SEQ", allocationSize = 1)
|
||||||
|
@AuditarClasse(nome = "CategoriaCtrl", tela = "Alteração de Categoria")
|
||||||
@Table(name = "CATEGORIA_CTRL")
|
@Table(name = "CATEGORIA_CTRL")
|
||||||
public class CategoriaCtrl implements Serializable, Cloneable {
|
public class CategoriaCtrl implements Serializable, Cloneable, Auditavel<CategoriaCtrl>{
|
||||||
|
|
||||||
public final static Integer[] idsCategoriasNoVisible = {1};
|
public final static Integer[] idsCategoriasNoVisible = {1};
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
@ -50,29 +60,42 @@ public class CategoriaCtrl implements Serializable, Cloneable {
|
||||||
private Boolean activo;
|
private Boolean activo;
|
||||||
@Column(name = "DESCRICAO")
|
@Column(name = "DESCRICAO")
|
||||||
private String descricao;
|
private String descricao;
|
||||||
|
@AuditarAtributo(nome = "Ult.Modif")
|
||||||
@Basic(optional = false)
|
@Basic(optional = false)
|
||||||
@Column(name = "FECMODIF")
|
@Column(name = "FECMODIF")
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Date fecmodif;
|
private Date fecmodif;
|
||||||
@Column(name = "USUARIO_ID")
|
@Column(name = "USUARIO_ID")
|
||||||
private Integer usuarioId;
|
private Integer usuarioId;
|
||||||
|
@AuditarLista(auditarEntidades = true, nome = "categoriaDescuentoList")
|
||||||
@OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL)
|
@OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL)
|
||||||
private List<CategoriaDescuento> categoriaDescuentoList;
|
private List<CategoriaDescuento> categoriaDescuentoList;
|
||||||
|
@AuditarLista(auditarEntidades = true, nome = "categoriaClaseList")
|
||||||
@OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL)
|
@OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL)
|
||||||
private List<CategoriaClase> categoriaClaseList;
|
private List<CategoriaClase> categoriaClaseList;
|
||||||
|
@AuditarLista(auditarEntidades = true, nome = "categoriaMarcaList")
|
||||||
@OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL)
|
@OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL)
|
||||||
private List<CategoriaMarca> categoriaMarcaList;
|
private List<CategoriaMarca> categoriaMarcaList;
|
||||||
|
@AuditarLista(auditarEntidades = true, nome = "categoriaCorridaList")
|
||||||
@OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL)
|
@OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL)
|
||||||
@NotFound(action=NotFoundAction.IGNORE)
|
@NotFound(action=NotFoundAction.IGNORE)
|
||||||
private List<CategoriaCorrida> categoriaCorridaList;
|
private List<CategoriaCorrida> categoriaCorridaList;
|
||||||
|
@AuditarLista(auditarEntidades = true, nome = "categoriaMercadoList")
|
||||||
@OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL)
|
@OneToMany(mappedBy = "categoriaCtrl", cascade = CascadeType.ALL)
|
||||||
private List<CategoriaMercado> categoriaMercadoList;
|
private List<CategoriaMercado> categoriaMercadoList;
|
||||||
|
@AuditarLista(auditarEntidades = true, nome = "categoriaOrgaoList")
|
||||||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "categoriaCtrl")
|
@OneToMany(cascade = CascadeType.ALL, mappedBy = "categoriaCtrl")
|
||||||
private List<CategoriaOrgao> categoriaOrgaoList;
|
private List<CategoriaOrgao> categoriaOrgaoList;
|
||||||
|
@AuditarLista(auditarEntidades = true, nome = "categoriaRutaList")
|
||||||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "categoriaCtrl")
|
@OneToMany(cascade = CascadeType.ALL, mappedBy = "categoriaCtrl")
|
||||||
private List<CategoriaRuta> categoriaRutaList;
|
private List<CategoriaRuta> categoriaRutaList;
|
||||||
|
@AuditarLista(auditarEntidades = true, nome = "categoriaRutaExcecaoList")
|
||||||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "categoriaCtrl")
|
@OneToMany(cascade = CascadeType.ALL, mappedBy = "categoriaCtrl")
|
||||||
private List<CategoriaRutaExcecao> categoriaRutaExcecaoList;
|
private List<CategoriaRutaExcecao> categoriaRutaExcecaoList;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
@NaoAuditar
|
||||||
|
private CategoriaCtrl categoriaCtrlClone;
|
||||||
public CategoriaCtrl() {
|
public CategoriaCtrl() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -368,4 +391,107 @@ public class CategoriaCtrl implements Serializable, Cloneable {
|
||||||
}
|
}
|
||||||
return lsCategoriaMercado;
|
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.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
import javax.persistence.TemporalType;
|
||||||
|
import javax.persistence.Transient;
|
||||||
|
|
||||||
import org.apache.commons.lang.BooleanUtils;
|
import org.apache.commons.lang.BooleanUtils;
|
||||||
|
import org.hibernate.Hibernate;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.enums.HorarioLiberacaoVendaPassagem;
|
import com.rjconsultores.ventaboletos.enums.HorarioLiberacaoVendaPassagem;
|
||||||
import com.rjconsultores.ventaboletos.enums.TipoPassagemCores;
|
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
|
* @author Administrador
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
|
@AuditarClasse(nome = "CategoriaDescuento", tela = "Alteração de Categoria Desconto")
|
||||||
@SequenceGenerator(name = "CATEGORIA_DESCUENTO_SEQ", sequenceName = "CATEGORIA_DESCUENTO_SEQ", allocationSize = 1)
|
@SequenceGenerator(name = "CATEGORIA_DESCUENTO_SEQ", sequenceName = "CATEGORIA_DESCUENTO_SEQ", allocationSize = 1)
|
||||||
@Table(name = "CATEGORIA_DESCUENTO")
|
@Table(name = "CATEGORIA_DESCUENTO")
|
||||||
public class CategoriaDescuento implements Serializable {
|
public class CategoriaDescuento implements Serializable, Auditavel<CategoriaDescuento> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@Id
|
@Id
|
||||||
|
@ -49,6 +58,7 @@ public class CategoriaDescuento implements Serializable {
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "CATEGORIA_DESCUENTO_SEQ")
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "CATEGORIA_DESCUENTO_SEQ")
|
||||||
@Column(name = "CATEGORIADESCUENTO_ID")
|
@Column(name = "CATEGORIADESCUENTO_ID")
|
||||||
private Integer categoriadescuentoId;
|
private Integer categoriadescuentoId;
|
||||||
|
@AuditarAtributo(nome = "Qtd Autorizada")
|
||||||
@Column(name = "CANTAUTORIZADA")
|
@Column(name = "CANTAUTORIZADA")
|
||||||
private Integer cantautorizada;
|
private Integer cantautorizada;
|
||||||
@Column(name = "DESCUENTOPORC")
|
@Column(name = "DESCUENTOPORC")
|
||||||
|
@ -57,6 +67,7 @@ public class CategoriaDescuento implements Serializable {
|
||||||
private BigDecimal descuentoimporte;
|
private BigDecimal descuentoimporte;
|
||||||
@Column(name = "ACTIVO")
|
@Column(name = "ACTIVO")
|
||||||
private Boolean activo;
|
private Boolean activo;
|
||||||
|
@AuditarAtributo(nome = "Ult.Modif")
|
||||||
@Basic(optional = false)
|
@Basic(optional = false)
|
||||||
@Column(name = "FECMODIF")
|
@Column(name = "FECMODIF")
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
@ -69,6 +80,7 @@ public class CategoriaDescuento implements Serializable {
|
||||||
@JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID")
|
@JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID")
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Categoria categoria;
|
private Categoria categoria;
|
||||||
|
@NaoAuditar
|
||||||
@OneToMany(mappedBy = "categoriaDescuento", cascade = CascadeType.ALL, fetch=FetchType.EAGER)
|
@OneToMany(mappedBy = "categoriaDescuento", cascade = CascadeType.ALL, fetch=FetchType.EAGER)
|
||||||
private List<CategoriaPeriodo> categoriaPeriodoList;
|
private List<CategoriaPeriodo> categoriaPeriodoList;
|
||||||
@Column(name = "INDIMPRIMEBOLETO")
|
@Column(name = "INDIMPRIMEBOLETO")
|
||||||
|
@ -237,6 +249,11 @@ public class CategoriaDescuento implements Serializable {
|
||||||
@ManyToOne(cascade = CascadeType.ALL)
|
@ManyToOne(cascade = CascadeType.ALL)
|
||||||
private TipoOcupacion tipoOcupacion;
|
private TipoOcupacion tipoOcupacion;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
@NaoAuditar
|
||||||
|
private CategoriaDescuento categoriaDescuentoClone;
|
||||||
|
|
||||||
|
|
||||||
public enum DisponibilidadeFeriado {
|
public enum DisponibilidadeFeriado {
|
||||||
// Declaração dos enum
|
// Declaração dos enum
|
||||||
GERARSEMPRE("SEMPRE", "S"),
|
GERARSEMPRE("SEMPRE", "S"),
|
||||||
|
@ -991,4 +1008,33 @@ public class CategoriaDescuento implements Serializable {
|
||||||
public void setTipoOcupacion(TipoOcupacion tipoOcupacion) {
|
public void setTipoOcupacion(TipoOcupacion tipoOcupacion) {
|
||||||
this.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.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
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;
|
import javax.persistence.SequenceGenerator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,9 +32,10 @@ import javax.persistence.SequenceGenerator;
|
||||||
* @author Administrador
|
* @author Administrador
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
|
@AuditarClasse(nome = "ReservacionPuntoVenta", tela = "Alteração de Marca de Categoria")
|
||||||
@SequenceGenerator(name = "CATEGORIA_MARCA_SEQ", sequenceName = "CATEGORIA_MARCA_SEQ", allocationSize = 1)
|
@SequenceGenerator(name = "CATEGORIA_MARCA_SEQ", sequenceName = "CATEGORIA_MARCA_SEQ", allocationSize = 1)
|
||||||
@Table(name = "CATEGORIA_MARCA")
|
@Table(name = "CATEGORIA_MARCA")
|
||||||
public class CategoriaMarca implements Serializable {
|
public class CategoriaMarca implements Serializable, Auditavel<CategoriaMarca> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@Id
|
@Id
|
||||||
|
@ -47,6 +56,10 @@ public class CategoriaMarca implements Serializable {
|
||||||
@JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID")
|
@JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID")
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private CategoriaCtrl categoriaCtrl;
|
private CategoriaCtrl categoriaCtrl;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
@NaoAuditar
|
||||||
|
private CategoriaMarca categoriaMarcaClone;
|
||||||
|
|
||||||
public CategoriaMarca() {
|
public CategoriaMarca() {
|
||||||
}
|
}
|
||||||
|
@ -133,4 +146,23 @@ public class CategoriaMarca implements Serializable {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "com.rjconsultores.ventaboletos.entidad.CategoriaMarca[categoriamarcaId=" + categoriamarcaId + "]";
|
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.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import javax.persistence.Basic;
|
import javax.persistence.Basic;
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
@ -14,19 +15,27 @@ import javax.persistence.GenerationType;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
import javax.persistence.JoinColumn;
|
import javax.persistence.JoinColumn;
|
||||||
import javax.persistence.ManyToOne;
|
import javax.persistence.ManyToOne;
|
||||||
|
import javax.persistence.SequenceGenerator;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
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
|
* @author Administrador
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
|
@AuditarClasse(nome = "CategoriaMercado", tela = "Alteração de Categoria Mercado")
|
||||||
@SequenceGenerator(name = "CATEGORIA_MERCADO_SEQ", sequenceName = "CATEGORIA_MERCADO_SEQ", allocationSize = 1)
|
@SequenceGenerator(name = "CATEGORIA_MERCADO_SEQ", sequenceName = "CATEGORIA_MERCADO_SEQ", allocationSize = 1)
|
||||||
@Table(name = "CATEGORIA_MERCADO")
|
@Table(name = "CATEGORIA_MERCADO")
|
||||||
public class CategoriaMercado implements Serializable {
|
public class CategoriaMercado implements Serializable,Auditavel<CategoriaMercado> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@Id
|
@Id
|
||||||
|
@ -50,6 +59,9 @@ public class CategoriaMercado implements Serializable {
|
||||||
@JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID")
|
@JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID")
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private CategoriaCtrl categoriaCtrl;
|
private CategoriaCtrl categoriaCtrl;
|
||||||
|
@Transient
|
||||||
|
@NaoAuditar
|
||||||
|
private CategoriaMercado categoriaMercadoClone;
|
||||||
|
|
||||||
public CategoriaMercado() {
|
public CategoriaMercado() {
|
||||||
}
|
}
|
||||||
|
@ -144,4 +156,22 @@ public class CategoriaMercado implements Serializable {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "com.rjconsultores.ventaboletos.entidad.CategoriaMercado[categoriamercadoId=" + categoriamercadoId + "]";
|
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
|
@Override
|
||||||
public String getTextoInclusaoExclusao() {
|
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.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
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;
|
import javax.persistence.SequenceGenerator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,9 +34,10 @@ import javax.persistence.SequenceGenerator;
|
||||||
* @author Administrador
|
* @author Administrador
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
|
@AuditarClasse(nome = "CategoriaDescuento", tela = "Alteração de Categoria Descuento Periodo")
|
||||||
@SequenceGenerator(name = "CATEGORIA_PERIODO_SEQ", sequenceName = "CATEGORIA_PERIODO_SEQ", allocationSize = 1)
|
@SequenceGenerator(name = "CATEGORIA_PERIODO_SEQ", sequenceName = "CATEGORIA_PERIODO_SEQ", allocationSize = 1)
|
||||||
@Table(name = "CATEGORIA_PERIODO")
|
@Table(name = "CATEGORIA_PERIODO")
|
||||||
public class CategoriaPeriodo implements Serializable {
|
public class CategoriaPeriodo implements Serializable, Auditavel<CategoriaPeriodo>{
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@Id
|
@Id
|
||||||
|
@ -51,6 +62,10 @@ public class CategoriaPeriodo implements Serializable {
|
||||||
@JoinColumn(name = "CATEGORIADESCUENTO_ID", referencedColumnName = "CATEGORIADESCUENTO_ID")
|
@JoinColumn(name = "CATEGORIADESCUENTO_ID", referencedColumnName = "CATEGORIADESCUENTO_ID")
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private CategoriaDescuento categoriaDescuento;
|
private CategoriaDescuento categoriaDescuento;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
@NaoAuditar
|
||||||
|
private CategoriaPeriodo categoriaPeriodoClone;
|
||||||
|
|
||||||
public CategoriaPeriodo() {
|
public CategoriaPeriodo() {
|
||||||
}
|
}
|
||||||
|
@ -154,4 +169,20 @@ public class CategoriaPeriodo implements Serializable {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo[categoriaperiodoId=" + categoriaperiodoId + "]";
|
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.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
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
|
@Entity
|
||||||
|
@AuditarClasse(nome = "CategoriaRuta", tela = "Alteração de Categoria de Linha")
|
||||||
@SequenceGenerator(name = "CATEGORIA_RUTA_SEQ", sequenceName = "CATEGORIA_RUTA_SEQ", allocationSize = 1)
|
@SequenceGenerator(name = "CATEGORIA_RUTA_SEQ", sequenceName = "CATEGORIA_RUTA_SEQ", allocationSize = 1)
|
||||||
@Table(name = "CATEGORIA_RUTA")
|
@Table(name = "CATEGORIA_RUTA")
|
||||||
public class CategoriaRuta implements Serializable {
|
public class CategoriaRuta implements Serializable, Auditavel<CategoriaRuta> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@Id
|
@Id
|
||||||
|
@ -48,6 +56,10 @@ public class CategoriaRuta implements Serializable {
|
||||||
@JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID")
|
@JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID")
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private CategoriaCtrl categoriaCtrl;
|
private CategoriaCtrl categoriaCtrl;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
@NaoAuditar
|
||||||
|
private CategoriaRuta categoriaRutaClone;
|
||||||
|
|
||||||
public CategoriaRuta() {
|
public CategoriaRuta() {
|
||||||
}
|
}
|
||||||
|
@ -159,4 +171,23 @@ public class CategoriaRuta implements Serializable {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "com.rjconsultores.ventaboletos.entidad.CategoriaOrgao[categoriaorgaoId=" + categoriarutaId + "]";
|
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.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
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
|
@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)
|
@SequenceGenerator(name = "CATEGORIA_RUTA_EXCECAO_SEQ", sequenceName = "CATEGORIA_RUTA_EXCECAO_SEQ", allocationSize = 1)
|
||||||
@Table(name = "CATEGORIA_RUTA_EXCECAO")
|
@Table(name = "CATEGORIA_RUTA_EXCECAO")
|
||||||
public class CategoriaRutaExcecao implements Serializable {
|
public class CategoriaRutaExcecao implements Serializable, Auditavel<CategoriaRutaExcecao> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@Id
|
@Id
|
||||||
|
@ -40,6 +48,9 @@ public class CategoriaRutaExcecao implements Serializable {
|
||||||
@JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID")
|
@JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID")
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private CategoriaCtrl categoriaCtrl;
|
private CategoriaCtrl categoriaCtrl;
|
||||||
|
@Transient
|
||||||
|
@NaoAuditar
|
||||||
|
private CategoriaRutaExcecao categoriaRutaExcecaoClone;
|
||||||
|
|
||||||
public CategoriaRutaExcecao() {
|
public CategoriaRutaExcecao() {
|
||||||
}
|
}
|
||||||
|
@ -128,4 +139,23 @@ public class CategoriaRutaExcecao implements Serializable {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "com.rjconsultores.ventaboletos.entidad.CategoriaRutaExcecao[categoriaRutaExcecaoId=" + categoriaRutaExcecaoId + "]";
|
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 com.rjconsultores.ventaboletos.enums.TipoClasseServicoBPe;
|
||||||
|
|
||||||
|
import br.com.rjconsultores.auditador.annotations.AuditarClasse;
|
||||||
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
|
import br.com.rjconsultores.auditador.annotations.NaoAuditar;
|
||||||
import br.com.rjconsultores.auditador.interfaces.Auditavel;
|
import br.com.rjconsultores.auditador.interfaces.Auditavel;
|
||||||
|
|
||||||
|
@ -36,6 +37,7 @@ import br.com.rjconsultores.auditador.interfaces.Auditavel;
|
||||||
* @author Administrador
|
* @author Administrador
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
|
@AuditarClasse(nome = "CategoriaDescuento", tela = "Alteração de Categoria Serviço")
|
||||||
@SequenceGenerator(name = "CLASE_SERVICIO_SEQ", sequenceName = "CLASE_SERVICIO_SEQ", allocationSize = 1)
|
@SequenceGenerator(name = "CLASE_SERVICIO_SEQ", sequenceName = "CLASE_SERVICIO_SEQ", allocationSize = 1)
|
||||||
@Table(name = "CLASE_SERVICIO")
|
@Table(name = "CLASE_SERVICIO")
|
||||||
public class ClaseServicio implements Serializable, Auditavel<ClaseServicio> {
|
public class ClaseServicio implements Serializable, Auditavel<ClaseServicio> {
|
||||||
|
|
|
@ -160,7 +160,7 @@ public class PtovtaCatInd implements Serializable, Auditavel<PtovtaCatInd> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTextoInclusaoExclusao() {
|
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.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
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;
|
import javax.persistence.SequenceGenerator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,9 +32,10 @@ import javax.persistence.SequenceGenerator;
|
||||||
* @author Administrador
|
* @author Administrador
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
|
@AuditarClasse(nome = "ReservacionPuntoVenta", tela = "Alteração de Reserva Categoria")
|
||||||
@SequenceGenerator(name = "RESERVACION_CATEGORIA_SEQ", sequenceName = "RESERVACION_CATEGORIA_SEQ", allocationSize = 1)
|
@SequenceGenerator(name = "RESERVACION_CATEGORIA_SEQ", sequenceName = "RESERVACION_CATEGORIA_SEQ", allocationSize = 1)
|
||||||
@Table(name = "RESERVACION_CATEGORIA")
|
@Table(name = "RESERVACION_CATEGORIA")
|
||||||
public class ReservacionCategoria implements Serializable {
|
public class ReservacionCategoria implements Serializable, Auditavel<ReservacionCategoria> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@Id
|
@Id
|
||||||
|
@ -47,6 +56,9 @@ public class ReservacionCategoria implements Serializable {
|
||||||
@JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID")
|
@JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID")
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Categoria categoria;
|
private Categoria categoria;
|
||||||
|
@Transient
|
||||||
|
@NaoAuditar
|
||||||
|
private ReservacionCategoria reservacionCategoriaClone;
|
||||||
|
|
||||||
public ReservacionCategoria() {
|
public ReservacionCategoria() {
|
||||||
}
|
}
|
||||||
|
@ -137,4 +149,24 @@ public class ReservacionCategoria implements Serializable {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "com.rjconsultores.ventaboletos.entidad.ReservacionCategoria[reservacioncategoriaId=" + reservacioncategoriaId + "]";
|
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;
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.CategoriaClase;
|
import com.rjconsultores.ventaboletos.entidad.CategoriaClase;
|
||||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||||
|
|
||||||
|
@ -14,4 +16,6 @@ import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||||
public interface CategoriaClaseService extends GenericService<CategoriaClase, Integer> {
|
public interface CategoriaClaseService extends GenericService<CategoriaClase, Integer> {
|
||||||
|
|
||||||
public CategoriaClase busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl);
|
public CategoriaClase busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl);
|
||||||
|
|
||||||
|
void actualizacionAuditagem(List<CategoriaClase> lsCategoriaClase);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.service;
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||||
import com.rjconsultores.ventaboletos.entidad.CategoriaMarca;
|
import com.rjconsultores.ventaboletos.entidad.CategoriaMarca;
|
||||||
|
|
||||||
|
@ -14,4 +16,6 @@ import com.rjconsultores.ventaboletos.entidad.CategoriaMarca;
|
||||||
public interface CategoriaMarcaService extends GenericService<CategoriaMarca, Integer> {
|
public interface CategoriaMarcaService extends GenericService<CategoriaMarca, Integer> {
|
||||||
|
|
||||||
public CategoriaMarca busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl);
|
public CategoriaMarca busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl);
|
||||||
|
|
||||||
|
public void actualizacionAuditagem(List<CategoriaMarca> lsCategoriaMarca);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.service;
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||||
import com.rjconsultores.ventaboletos.entidad.CategoriaMercado;
|
import com.rjconsultores.ventaboletos.entidad.CategoriaMercado;
|
||||||
|
|
||||||
|
@ -14,4 +16,6 @@ import com.rjconsultores.ventaboletos.entidad.CategoriaMercado;
|
||||||
public interface CategoriaMercadoService extends GenericService<CategoriaMercado, Integer> {
|
public interface CategoriaMercadoService extends GenericService<CategoriaMercado, Integer> {
|
||||||
|
|
||||||
public CategoriaMercado busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl);
|
public CategoriaMercado busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl);
|
||||||
|
|
||||||
|
public void actualizacionAuditagem(List<CategoriaMercado> lsCategoriaMercado);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
package com.rjconsultores.ventaboletos.service;
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||||
import com.rjconsultores.ventaboletos.entidad.CategoriaOrgao;
|
import com.rjconsultores.ventaboletos.entidad.CategoriaOrgao;
|
||||||
|
|
||||||
public interface CategoriaOrgaoService extends GenericService<CategoriaOrgao, Integer> {
|
public interface CategoriaOrgaoService extends GenericService<CategoriaOrgao, Integer> {
|
||||||
|
|
||||||
public CategoriaOrgao busquedaPorCategoriaCtrl(CategoriaCtrl categoriaCtrl);
|
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;
|
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.dao.CategoriaClaseDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.CategoriaClase;
|
import com.rjconsultores.ventaboletos.entidad.CategoriaClase;
|
||||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||||
import com.rjconsultores.ventaboletos.service.CategoriaClaseService;
|
import com.rjconsultores.ventaboletos.service.CategoriaClaseService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
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) {
|
public CategoriaClase busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl) {
|
||||||
return categoriaClaseDAO.busquedaPoCategoriaCtrl(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;
|
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.dao.CategoriaCorridaDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCorrida;
|
import com.rjconsultores.ventaboletos.entidad.CategoriaCorrida;
|
||||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||||
import com.rjconsultores.ventaboletos.service.CategoriaCorridaService;
|
import com.rjconsultores.ventaboletos.service.CategoriaCorridaService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
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
|
@Autowired
|
||||||
private CategoriaCorridaDAO categoriaCorridaDAO;
|
private CategoriaCorridaDAO categoriaCorridaDAO;
|
||||||
|
@Autowired
|
||||||
|
private LogAuditoriaService logAuditoriaService;
|
||||||
|
|
||||||
|
|
||||||
public List<CategoriaCorrida> obtenerTodos() {
|
public List<CategoriaCorrida> obtenerTodos() {
|
||||||
return categoriaCorridaDAO.obtenerTodos();
|
return categoriaCorridaDAO.obtenerTodos();
|
||||||
|
@ -56,12 +62,12 @@ public class CategoriaCorridaServiceImpl implements CategoriaCorridaService {
|
||||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
entidad.setActivo(Boolean.FALSE);
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
|
||||||
|
|
||||||
categoriaCorridaDAO.actualizacion(entidad);
|
categoriaCorridaDAO.actualizacion(entidad);
|
||||||
|
logAuditoriaService.auditarExclusao(entidad, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CategoriaCorrida busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl) {
|
public CategoriaCorrida busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl) {
|
||||||
return categoriaCorridaDAO.busquedaPoCategoriaCtrl(categoriaCtrl);
|
return categoriaCorridaDAO.busquedaPoCategoriaCtrl(categoriaCtrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,8 @@ import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
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.CategoriaPeriodo;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Constante;
|
import com.rjconsultores.ventaboletos.entidad.Constante;
|
||||||
import com.rjconsultores.ventaboletos.service.CategoriaCtrlService;
|
import com.rjconsultores.ventaboletos.service.CategoriaCtrlService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -48,10 +51,15 @@ public class CategoriaCtrlServiceImpl implements CategoriaCtrlService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ConstanteDAO constanteDAO;
|
private ConstanteDAO constanteDAO;
|
||||||
|
@Autowired
|
||||||
|
private LogAuditoriaService logAuditoriaService;
|
||||||
|
private static Logger log = LoggerFactory.getLogger(CategoriaCtrlServiceImpl.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CategoriaCtrl obtenerID(Integer id) {
|
public CategoriaCtrl obtenerID(Integer id) {
|
||||||
|
|
||||||
return categoriaCtrlDAO.obtenerID(id);
|
return categoriaCtrlDAO.obtenerID(id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -61,7 +69,10 @@ public class CategoriaCtrlServiceImpl implements CategoriaCtrlService {
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
entidad.setActivo(Boolean.TRUE);
|
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
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public CategoriaCtrl actualizacion(CategoriaCtrl entidad) {
|
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.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
entidad.setActivo(Boolean.TRUE);
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
entidad = categoriaCtrlDAO.actualizacion(entidad);
|
||||||
return categoriaCtrlDAO.actualizacion(entidad);
|
logAuditoriaService.auditar(originalClone, entidad, null);
|
||||||
|
|
||||||
|
return entidad;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -151,6 +174,8 @@ public class CategoriaCtrlServiceImpl implements CategoriaCtrlService {
|
||||||
entidad.setActivo(Boolean.FALSE);
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
|
||||||
categoriaCtrlDAO.actualizacion(entidad);
|
categoriaCtrlDAO.actualizacion(entidad);
|
||||||
|
logAuditoriaService.auditarExclusao(entidad, entidad.getEmpresa() != null ? entidad.getEmpresa().getEmpresaId() : null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private CategoriaDescuento getCategoriaDescuentoAdulto(CategoriaCtrl categoriaCtrl) {
|
private CategoriaDescuento getCategoriaDescuentoAdulto(CategoriaCtrl categoriaCtrl) {
|
||||||
|
|
|
@ -4,16 +4,22 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.service.impl;
|
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.Calendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
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
|
* @author Administrador
|
||||||
|
@ -23,13 +29,17 @@ public class CategoriaDescuentoServiceImpl implements CategoriaDescuentoService
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private CategoriaDescuentoDAO categoriaDescuentoDAO;
|
private CategoriaDescuentoDAO categoriaDescuentoDAO;
|
||||||
|
private static Logger log = LoggerFactory.getLogger(CategoriaDescuentoServiceImpl.class);
|
||||||
|
@Autowired
|
||||||
|
private LogAuditoriaService logAuditoriaService;
|
||||||
|
|
||||||
|
|
||||||
public List<CategoriaDescuento> obtenerTodos() {
|
public List<CategoriaDescuento> obtenerTodos() {
|
||||||
return categoriaDescuentoDAO.obtenerTodos();
|
return categoriaDescuentoDAO.obtenerTodos();
|
||||||
}
|
}
|
||||||
|
|
||||||
public CategoriaDescuento obtenerID(Integer id) {
|
public CategoriaDescuento obtenerID(Integer id) {
|
||||||
return categoriaDescuentoDAO.obtenerID(id);
|
return categoriaDescuentoDAO.obtenerID(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
|
@ -37,17 +47,27 @@ public class CategoriaDescuentoServiceImpl implements CategoriaDescuentoService
|
||||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
entidad.setActivo(Boolean.TRUE);
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
entidad = categoriaDescuentoDAO.suscribir(entidad);
|
||||||
return categoriaDescuentoDAO.suscribir(entidad);
|
logAuditoriaService.auditar(null, entidad, null);
|
||||||
|
return entidad;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public CategoriaDescuento actualizacion(CategoriaDescuento entidad) {
|
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.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
entidad.setActivo(Boolean.TRUE);
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
return categoriaDescuentoDAO.actualizacion(entidad);
|
entidad = categoriaDescuentoDAO.actualizacion(entidad);
|
||||||
|
logAuditoriaService.auditar(originalClone, entidad, null);
|
||||||
|
return entidad;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
|
@ -57,5 +77,7 @@ public class CategoriaDescuentoServiceImpl implements CategoriaDescuentoService
|
||||||
entidad.setActivo(Boolean.FALSE);
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
|
||||||
categoriaDescuentoDAO.actualizacion(entidad);
|
categoriaDescuentoDAO.actualizacion(entidad);
|
||||||
|
logAuditoriaService.auditarExclusao(entidad, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
package com.rjconsultores.ventaboletos.service.impl;
|
package com.rjconsultores.ventaboletos.service.impl;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.CategoriaMarcaDAO;
|
import com.rjconsultores.ventaboletos.dao.CategoriaMarcaDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.CategoriaCorrida;
|
||||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||||
import com.rjconsultores.ventaboletos.entidad.CategoriaMarca;
|
import com.rjconsultores.ventaboletos.entidad.CategoriaMarca;
|
||||||
import com.rjconsultores.ventaboletos.service.CategoriaMarcaService;
|
import com.rjconsultores.ventaboletos.service.CategoriaMarcaService;
|
||||||
|
@ -63,4 +64,16 @@ public class CategoriaMarcaServiceImpl implements CategoriaMarcaService {
|
||||||
public CategoriaMarca busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl) {
|
public CategoriaMarca busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl) {
|
||||||
return categoriaMarcaDAO.busquedaPoCategoriaCtrl(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;
|
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.dao.CategoriaMercadoDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||||
import com.rjconsultores.ventaboletos.entidad.CategoriaMercado;
|
import com.rjconsultores.ventaboletos.entidad.CategoriaMercado;
|
||||||
import com.rjconsultores.ventaboletos.service.CategoriaMercadoService;
|
import com.rjconsultores.ventaboletos.service.CategoriaMercadoService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
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) {
|
public CategoriaMercado busquedaPoCategoriaCtrl(CategoriaCtrl categoriaCtrl) {
|
||||||
return categoriaMercadoDAO.busquedaPoCategoriaCtrl(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;
|
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.dao.CategoriaOrgaoDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||||
import com.rjconsultores.ventaboletos.entidad.CategoriaOrgao;
|
import com.rjconsultores.ventaboletos.entidad.CategoriaOrgao;
|
||||||
import com.rjconsultores.ventaboletos.service.CategoriaOrgaoService;
|
import com.rjconsultores.ventaboletos.service.CategoriaOrgaoService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
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")
|
@Service("categoriaOrgaoService")
|
||||||
|
@ -60,4 +62,16 @@ public class CategoriaOrgaoServiceImpl implements CategoriaOrgaoService {
|
||||||
public CategoriaOrgao busquedaPorCategoriaCtrl(CategoriaCtrl categoriaCtrl) {
|
public CategoriaOrgao busquedaPorCategoriaCtrl(CategoriaCtrl categoriaCtrl) {
|
||||||
return categoriaOrgaoDAO.busquedaPorCategoriaCtrl(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.CategoriaDescuento;
|
||||||
import com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo;
|
import com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo;
|
||||||
import com.rjconsultores.ventaboletos.service.CategoriaPeriodoService;
|
import com.rjconsultores.ventaboletos.service.CategoriaPeriodoService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -24,6 +25,8 @@ public class CategoriaPeriodoServiceImpl implements CategoriaPeriodoService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private CategoriaPeriodoDAO categoriaPeriodoDAO;
|
private CategoriaPeriodoDAO categoriaPeriodoDAO;
|
||||||
|
@Autowired
|
||||||
|
private LogAuditoriaService logAuditoriaService;
|
||||||
|
|
||||||
public List<CategoriaPeriodo> obtenerTodos() {
|
public List<CategoriaPeriodo> obtenerTodos() {
|
||||||
return categoriaPeriodoDAO.obtenerTodos();
|
return categoriaPeriodoDAO.obtenerTodos();
|
||||||
|
@ -38,8 +41,11 @@ public class CategoriaPeriodoServiceImpl implements CategoriaPeriodoService {
|
||||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
entidad.setActivo(Boolean.TRUE);
|
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
|
@Transactional
|
||||||
|
@ -58,6 +64,8 @@ public class CategoriaPeriodoServiceImpl implements CategoriaPeriodoService {
|
||||||
entidad.setActivo(Boolean.FALSE);
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
|
||||||
categoriaPeriodoDAO.actualizacion(entidad);
|
categoriaPeriodoDAO.actualizacion(entidad);
|
||||||
|
logAuditoriaService.auditarExclusao(entidad, entidad.getCategoriaDescuento().getCategoriaCtrl().getEmpresa() != null ? entidad.getCategoriaDescuento().getCategoriaCtrl().getEmpresa().getEmpresaId() : null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<CategoriaPeriodo> buscarPeriodoIntervalo(CategoriaPeriodo cPeriodo) {
|
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.dao.CategoriaDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Categoria;
|
import com.rjconsultores.ventaboletos.entidad.Categoria;
|
||||||
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
import com.rjconsultores.ventaboletos.service.CategoriaService;
|
import com.rjconsultores.ventaboletos.service.CategoriaService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
@ -25,31 +30,59 @@ public class CategoriaServiceImpl implements CategoriaService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private CategoriaDAO categoriaDAO;
|
private CategoriaDAO categoriaDAO;
|
||||||
|
private static Logger log = LoggerFactory.getLogger(CategoriaServiceImpl.class);
|
||||||
|
@Autowired
|
||||||
|
private LogAuditoriaService logAuditoriaService;
|
||||||
|
|
||||||
|
|
||||||
public List<Categoria> obtenerTodos() {
|
public List<Categoria> obtenerTodos() {
|
||||||
return categoriaDAO.obtenerTodos();
|
return categoriaDAO.obtenerTodos();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Categoria obtenerID(Integer id) {
|
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
|
@Transactional
|
||||||
public Categoria suscribir(Categoria entidad) {
|
public Categoria suscribir(Categoria entidad) {
|
||||||
|
|
||||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
entidad.setActivo(Boolean.TRUE);
|
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
|
@Transactional
|
||||||
public Categoria actualizacion(Categoria entidad) {
|
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.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
entidad.setActivo(Boolean.TRUE);
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
return categoriaDAO.actualizacion(entidad);
|
entidad = categoriaDAO.actualizacion(entidad);
|
||||||
|
logAuditoriaService.auditar(originalClone, entidad, null);
|
||||||
|
return entidad;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
|
|
|
@ -9,6 +9,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.PtovtaCatIndDAO;
|
import com.rjconsultores.ventaboletos.dao.PtovtaCatIndDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.PtovtaCatInd;
|
import com.rjconsultores.ventaboletos.entidad.PtovtaCatInd;
|
||||||
|
import com.rjconsultores.ventaboletos.service.LogAuditoriaService;
|
||||||
import com.rjconsultores.ventaboletos.service.PtovtaCatIndService;
|
import com.rjconsultores.ventaboletos.service.PtovtaCatIndService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
|
@ -17,6 +18,8 @@ public class PtovtaCatIndServiceImpl implements PtovtaCatIndService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PtovtaCatIndDAO ptovtaCatIndDAO;
|
private PtovtaCatIndDAO ptovtaCatIndDAO;
|
||||||
|
@Autowired
|
||||||
|
private LogAuditoriaService logAuditoriaService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PtovtaCatInd> obtenerTodos() {
|
public List<PtovtaCatInd> obtenerTodos() {
|
||||||
|
@ -53,6 +56,8 @@ public class PtovtaCatIndServiceImpl implements PtovtaCatIndService {
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
entidad.setActivo(Boolean.FALSE);
|
entidad.setActivo(Boolean.FALSE);
|
||||||
ptovtaCatIndDAO.actualizacion(entidad);
|
ptovtaCatIndDAO.actualizacion(entidad);
|
||||||
|
logAuditoriaService.auditarExclusao(entidad, entidad.getEmpresa() != null ? entidad.getEmpresa().getEmpresaId() : null);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue