fixes bug #8977
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@69366 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
7cef600296
commit
490f734bc7
|
@ -18,4 +18,6 @@ public interface AidfDAO extends GenericDAO<Aidf, Long> {
|
|||
|
||||
public List<Aidf> buscaAidfRMD(Integer empresaId, Integer estadoId);
|
||||
|
||||
public String buscaUltimoAidfRMDUtilizado(Long idAidf);
|
||||
|
||||
}
|
||||
|
|
|
@ -150,4 +150,19 @@ public class AidfHibernateDAO extends GenericHibernateDAO<Aidf, Long> implements
|
|||
return (List<Aidf>) query.list();
|
||||
}
|
||||
|
||||
public String buscaUltimoAidfRMDUtilizado(Long idAidf) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(" select max(foliormd) ");
|
||||
sb.append(" from boleto ");
|
||||
sb.append(" where activo = :activo ");
|
||||
sb.append(" and rmd_id = :rmdId ");
|
||||
|
||||
Query query = getSession().createSQLQuery(sb.toString());
|
||||
|
||||
query.setBoolean("activo", Boolean.TRUE);
|
||||
query.setLong("rmdId", idAidf);
|
||||
|
||||
return (String) query.uniqueResult();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,4 +39,6 @@ public interface AidfService {
|
|||
public Boolean validarVendaManual(Integer idTipo, String serie);
|
||||
|
||||
public List<Aidf> buscaAidfRMD(Integer empresaId, Integer estadoId);
|
||||
|
||||
public String buscaUltimoAidfRMDUtilizado(Long idAidf);
|
||||
}
|
||||
|
|
|
@ -134,4 +134,9 @@ public class AidfServiceImpl implements AidfService {
|
|||
return aidfDAO.buscaAidfRMD(empresaId, estadoId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String buscaUltimoAidfRMDUtilizado(Long idAidf) {
|
||||
return aidfDAO.buscaUltimoAidfRMDUtilizado(idAidf);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue