Bug lista de aidf nasTransferencia de estoque fixes bug#AL-3983' (!162) from AL-3983 into master

Reviewed-on: adm/ModelWeb#162
Reviewed-by: pinheiro <valdevir@rjconsultores.com.br>
master
fabio 2024-03-14 15:01:31 +00:00
commit eb547c38cf
9 changed files with 48 additions and 7 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.rjconsultores</groupId>
<artifactId>ModelWeb</artifactId>
<version>1.41.1</version>
<version>1.41.2</version>
<distributionManagement>
<repository>

View File

@ -25,5 +25,5 @@ public interface AidfDAO extends GenericDAO<Aidf, Long> {
public Boolean validarDocFiscalPorEstadoAgencia(Long idAidf, Integer especieId, String docFiscal, String formInicial, String formFinal, Estado estado, PuntoVenta agencia);
public List<Aidf> buscaAidfsPorEmpresasAgencia(List<Empresa> empresas, PuntoVenta pontoVenda);
public List<Aidf> buscaAidfsPorEmpresaAgencia(Empresa empresa, PuntoVenta pontoVenda);
}

View File

@ -3,8 +3,11 @@ package com.rjconsultores.ventaboletos.dao;
import java.util.List;
import com.rjconsultores.ventaboletos.entidad.AbastoBoleto;
import com.rjconsultores.ventaboletos.entidad.Aidf;
import com.rjconsultores.ventaboletos.entidad.DetAbastoBoleto;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.Estacion;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
public interface DetAbastoBoletoDAO extends GenericDAO<DetAbastoBoleto, Integer> {
@ -22,4 +25,6 @@ public interface DetAbastoBoletoDAO extends GenericDAO<DetAbastoBoleto, Integer>
public DetAbastoBoleto buscarPorAidf(Long aidfId, String folioInicial, String folioFinal);
public List<Aidf> buscarAidfsPorEmpresaAgencia(Empresa empresa, PuntoVenta origem);
}

View File

@ -121,11 +121,11 @@ public class AidfHibernateDAO extends GenericHibernateDAO<Aidf, Long> implements
}
@Override
public List<Aidf> buscaAidfsPorEmpresasAgencia(List<Empresa> empresas, PuntoVenta pontoVenda) {
public List<Aidf> buscaAidfsPorEmpresaAgencia(Empresa empresa, PuntoVenta pontoVenda) {
Criteria c = getSession().createCriteria(getPersistentClass());
c.add(Restrictions.eq("activo", Boolean.TRUE));
c.add(Restrictions.in("empresa", empresas));
c.add(Restrictions.eq("empresa", empresa));
c.add(Restrictions.eq("puntoVenta", pontoVenda));
return (List<Aidf>) c.list();

View File

@ -16,7 +16,9 @@ import com.rjconsultores.ventaboletos.dao.DetAbastoBoletoDAO;
import com.rjconsultores.ventaboletos.entidad.AbastoBoleto;
import com.rjconsultores.ventaboletos.entidad.Aidf;
import com.rjconsultores.ventaboletos.entidad.DetAbastoBoleto;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.Estacion;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
@Repository("detAbastoBoletoDAO")
public class DetAbastoBoletoHibernateDAO extends GenericHibernateDAO<DetAbastoBoleto, Integer>
@ -137,4 +139,27 @@ public class DetAbastoBoletoHibernateDAO extends GenericHibernateDAO<DetAbastoBo
return detAbastoBoletos.get(0);
}
@Override
public List<Aidf> buscarAidfsPorEmpresaAgencia(Empresa empresa, PuntoVenta origem) {
StringBuilder qs = new StringBuilder();
qs.append(" select distinct det.aidf ");
qs.append(" from DetAbastoBoleto det ");
qs.append(" where det.activo = 1 ");
qs.append(" and det.abastoBoleto.puntoventa.puntoventaId = :origem ");
if( empresa.getEmpresaId() != -1) {
qs.append(" and det.abastoBoleto.empresa.empresaId = :empresa ");
}
Query query = getSession().createQuery(qs.toString());
query.setInteger("origem", origem.getPuntoventaId());
if( empresa.getEmpresaId() != -1) {
query.setInteger("empresa", empresa.getEmpresaId());
}
List<Aidf> aidfs = query.list();
return aidfs;
}
}

View File

@ -29,7 +29,7 @@ public interface AidfService {
public List<Aidf> buscaAidfsPorEmpresas(List<Empresa> empresas);
public List<Aidf> buscaAidfsPorEmpresasAgencia(List<Empresa> empresas, PuntoVenta pontoVenda);
public List<Aidf> buscaAidfsPorEmpresaAgencia(Empresa empresa, PuntoVenta pontoVenda);
public Long validarDocFiscalSerieFormInicialFinal(Aidf entidad, Connection conn);

View File

@ -5,7 +5,9 @@ import java.util.List;
import com.rjconsultores.ventaboletos.entidad.AbastoBoleto;
import com.rjconsultores.ventaboletos.entidad.Aidf;
import com.rjconsultores.ventaboletos.entidad.DetAbastoBoleto;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.Estacion;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.exception.BusinessException;
public interface DetAbastoBoletoService extends GenericService<DetAbastoBoleto, Integer> {
@ -21,4 +23,6 @@ public interface DetAbastoBoletoService extends GenericService<DetAbastoBoleto,
public DetAbastoBoleto buscarPorAidf(Long aidfId, String folioInicial, String folioFinal);
public DetAbastoBoleto movimentaDetAbasto(Aidf aidf, AbastoBoleto abasto, String folioInicial, String folioFinal) throws BusinessException;
public List<Aidf> buscarAidfsPorEmpresaAgencia(Empresa empresa, PuntoVenta origem);
}

View File

@ -93,8 +93,8 @@ public class AidfServiceImpl implements AidfService {
return aidfDAO.buscaAidfsPorEmpresas(empresas);
}
public List<Aidf> buscaAidfsPorEmpresasAgencia(List<Empresa> empresas, PuntoVenta pontoVenda){
return aidfDAO.buscaAidfsPorEmpresasAgencia(empresas, pontoVenda);
public List<Aidf> buscaAidfsPorEmpresaAgencia(Empresa empresa, PuntoVenta pontoVenda){
return aidfDAO.buscaAidfsPorEmpresaAgencia(empresa, pontoVenda);
}
public List<AidfVo> obtenerAidfFromSerieDocfiscal(String serie, String docfiscal, Connection conn) {

View File

@ -11,7 +11,9 @@ import com.rjconsultores.ventaboletos.dao.DetAbastoBoletoDAO;
import com.rjconsultores.ventaboletos.entidad.AbastoBoleto;
import com.rjconsultores.ventaboletos.entidad.Aidf;
import com.rjconsultores.ventaboletos.entidad.DetAbastoBoleto;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.Estacion;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.exception.BusinessException;
import com.rjconsultores.ventaboletos.service.DetAbastoBoletoService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
@ -132,4 +134,9 @@ public class DetAbastoBoletoServiceImpl implements DetAbastoBoletoService {
return detAbastoBoletoDAO.buscarPorAidf(aidfId, folioInicial, folioFinal);
}
@Override
public List<Aidf> buscarAidfsPorEmpresaAgencia(Empresa empresa, PuntoVenta origem) {
return detAbastoBoletoDAO.buscarAidfsPorEmpresaAgencia(empresa, origem);
}
}