Fixes bug #9449
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@75179 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
ed32ccb2e8
commit
d7068b331e
|
@ -90,5 +90,6 @@ public class Constantes {
|
||||||
public static final String DESCONTO_COMPONENTE_PRECO = "DESCONTO_COMPONENTE_PRECO";
|
public static final String DESCONTO_COMPONENTE_PRECO = "DESCONTO_COMPONENTE_PRECO";
|
||||||
|
|
||||||
public static final String TEMPO_LIMITE_PEN_PARAM_OCD = "TEMPO_LIMITE_PEN_PARAM_OCD";
|
public static final String TEMPO_LIMITE_PEN_PARAM_OCD = "TEMPO_LIMITE_PEN_PARAM_OCD";
|
||||||
|
|
||||||
|
public static final String CVESISTEMA_MOTIVO_CANCELAMENTO_ECF = "CANCELAMENTO_ECF";
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,4 +18,6 @@ public interface MotivoCancelacionDAO extends GenericDAO<MotivoCancelacion, Inte
|
||||||
public List<MotivoCancelacion> obtenerTodosTipoMotivoB();
|
public List<MotivoCancelacion> obtenerTodosTipoMotivoB();
|
||||||
|
|
||||||
public List<MotivoCancelacion> obtenerTodosEspecificos(Integer[] motivos);
|
public List<MotivoCancelacion> obtenerTodosEspecificos(Integer[] motivos);
|
||||||
|
|
||||||
|
public MotivoCancelacion findByCveSistema(String cveSistema) ;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,10 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.MotivoCancelacionDAO;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.MotivoCancelacion;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.hibernate.Criteria;
|
import org.hibernate.Criteria;
|
||||||
|
import org.hibernate.Query;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
import org.hibernate.criterion.Order;
|
import org.hibernate.criterion.Order;
|
||||||
import org.hibernate.criterion.Restrictions;
|
import org.hibernate.criterion.Restrictions;
|
||||||
|
@ -15,11 +15,15 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.MotivoCancelacionDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.MotivoCancelacion;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Rafius
|
* @author Rafius
|
||||||
*/
|
*/
|
||||||
@Repository("motivoCancelacionDAO")
|
@Repository("motivoCancelacionDAO")
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public class MotivoCancelacionHibernateDAO extends GenericHibernateDAO<MotivoCancelacion, Integer>
|
public class MotivoCancelacionHibernateDAO extends GenericHibernateDAO<MotivoCancelacion, Integer>
|
||||||
implements MotivoCancelacionDAO {
|
implements MotivoCancelacionDAO {
|
||||||
|
|
||||||
|
@ -28,7 +32,7 @@ public class MotivoCancelacionHibernateDAO extends GenericHibernateDAO<MotivoCan
|
||||||
setSessionFactory(factory);
|
setSessionFactory(factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MotivoCancelacion> obtenerTodos() {
|
public List<MotivoCancelacion> obtenerTodos() {
|
||||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
@ -63,4 +67,17 @@ public class MotivoCancelacionHibernateDAO extends GenericHibernateDAO<MotivoCan
|
||||||
|
|
||||||
return c.list();
|
return c.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MotivoCancelacion findByCveSistema(String cveSistema) {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append(" select mc");
|
||||||
|
sb.append(" from MotivoCancelacion mc");
|
||||||
|
sb.append(" where mc.cveSistema = :cveSistema");
|
||||||
|
sb.append(" and mc.activo=1");
|
||||||
|
|
||||||
|
Query miQry = getSession().createQuery(sb.toString());
|
||||||
|
miQry.setString("cveSistema", cveSistema);
|
||||||
|
|
||||||
|
return (MotivoCancelacion) miQry.uniqueResult();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,4 +20,6 @@ public interface MotivoCancelacionService extends GenericService<MotivoCancelaci
|
||||||
public List<MotivoCancelacion> obtenerTodosEspecificos(Integer[] motivos);
|
public List<MotivoCancelacion> obtenerTodosEspecificos(Integer[] motivos);
|
||||||
|
|
||||||
public boolean validaMotivoCancelacionConstante(MotivoCancelacion motivoCancelacion);
|
public boolean validaMotivoCancelacionConstante(MotivoCancelacion motivoCancelacion);
|
||||||
|
|
||||||
|
public MotivoCancelacion findByCveSistema(String cveSistema) ;
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,5 +78,9 @@ public class MotivoCancelacionServiceImpl implements MotivoCancelacionService {
|
||||||
else
|
else
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MotivoCancelacion findByCveSistema(String cveSistema) {
|
||||||
|
return motivoCancelacionDAO.findByCveSistema(cveSistema);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue