FIXES BUG #06952
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@51361 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
ece75a4040
commit
494fbbb6d7
|
@ -0,0 +1,11 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaContaBancaria;
|
||||
|
||||
public interface EmpresaContaBancariaDAO {
|
||||
|
||||
public EmpresaContaBancaria suscribir(EmpresaContaBancaria entidad);
|
||||
|
||||
public EmpresaContaBancaria actualizacion(EmpresaContaBancaria entidad);
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.EmpresaContaBancariaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaContaBancaria;
|
||||
|
||||
@Repository("empresaContaBancariaDAO")
|
||||
public class EmpresaContaBancariaHibernateDAO extends GenericHibernateDAO<EmpresaContaBancaria, Integer> implements EmpresaContaBancariaDAO {
|
||||
|
||||
@Autowired
|
||||
public EmpresaContaBancariaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmpresaContaBancaria suscribir(EmpresaContaBancaria entity) throws RuntimeException {
|
||||
|
||||
entity = super.suscribir(entity);
|
||||
|
||||
getSession().flush();
|
||||
return entity;
|
||||
}
|
||||
}
|
|
@ -154,7 +154,7 @@ public class InstiFinanceira implements Serializable {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.codigo;
|
||||
return this.nome +" - "+ this.codigo;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaContaBancaria;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
|
||||
public interface EmpresaContaBancariaService {
|
||||
|
||||
public EmpresaContaBancaria suscribirActualizacion(EmpresaContaBancaria entidad) throws BusinessException;
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.EmpresaContaBancariaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.EmpresaContaBancaria;
|
||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||
import com.rjconsultores.ventaboletos.service.EmpresaContaBancariaService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
@Service("empresaContaBancariaService")
|
||||
public class EmpresaContaBancariaServiceImpl implements EmpresaContaBancariaService {
|
||||
|
||||
@Autowired
|
||||
private EmpresaContaBancariaDAO empresaContaBancariaDAO;
|
||||
|
||||
@Transactional
|
||||
public EmpresaContaBancaria suscribirActualizacion(EmpresaContaBancaria entidad) throws BusinessException {
|
||||
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
if (entidad.getEmpresaContaBancariaId() == null) {
|
||||
|
||||
entidad = empresaContaBancariaDAO.suscribir(entidad);
|
||||
|
||||
// gerarMarca(entidad);
|
||||
|
||||
} else {
|
||||
entidad = empresaContaBancariaDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
return entidad;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue