julio 2017-05-26 20:53:49 +00:00
parent 7cef600296
commit 490f734bc7
4 changed files with 24 additions and 0 deletions

View File

@ -18,4 +18,6 @@ public interface AidfDAO extends GenericDAO<Aidf, Long> {
public List<Aidf> buscaAidfRMD(Integer empresaId, Integer estadoId);
public String buscaUltimoAidfRMDUtilizado(Long idAidf);
}

View File

@ -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();
}
}

View File

@ -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);
}

View File

@ -134,4 +134,9 @@ public class AidfServiceImpl implements AidfService {
return aidfDAO.buscaAidfRMD(empresaId, estadoId);
}
@Override
public String buscaUltimoAidfRMDUtilizado(Long idAidf) {
return aidfDAO.buscaUltimoAidfRMDUtilizado(idAidf);
}
}