fixes bug #07317
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@55091 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
598ffe543f
commit
822db53a31
|
@ -18,9 +18,12 @@ import org.zkoss.zul.Intbox;
|
||||||
import org.zkoss.zul.Paging;
|
import org.zkoss.zul.Paging;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.AliasServico;
|
import com.rjconsultores.ventaboletos.entidad.AliasServico;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||||
|
import com.rjconsultores.ventaboletos.service.EsquemaCorridaService;
|
||||||
import com.rjconsultores.ventaboletos.service.RutaService;
|
import com.rjconsultores.ventaboletos.service.RutaService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
|
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
|
||||||
|
@ -36,6 +39,8 @@ public class BusquedaAliasServicoController extends MyGenericForwardComposer {
|
||||||
private transient PagedListWrapper<AliasServico> plwAliasServico;
|
private transient PagedListWrapper<AliasServico> plwAliasServico;
|
||||||
@Autowired
|
@Autowired
|
||||||
private RutaService rutaService;
|
private RutaService rutaService;
|
||||||
|
@Autowired
|
||||||
|
private EsquemaCorridaService esquemaCorridaService;
|
||||||
private List<Ruta> lsRutas;
|
private List<Ruta> lsRutas;
|
||||||
private MyListbox aliasServicoList;
|
private MyListbox aliasServicoList;
|
||||||
private Paging pagingAliasServico;
|
private Paging pagingAliasServico;
|
||||||
|
@ -54,7 +59,9 @@ public class BusquedaAliasServicoController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
lsRutas = rutaService.obtenerTodos();
|
List<Empresa> lsEmpresa = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
||||||
|
lsRutas = rutaService.buscarRutasPorEmpresas(lsEmpresa);
|
||||||
|
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
|
|
||||||
aliasServicoList.setItemRenderer(new RenderAliasServico());
|
aliasServicoList.setItemRenderer(new RenderAliasServico());
|
||||||
|
@ -112,6 +119,10 @@ public class BusquedaAliasServicoController extends MyGenericForwardComposer {
|
||||||
if (corridaId != null) {
|
if (corridaId != null) {
|
||||||
aliasServicoBusqueda.addFilterEqual("corridaId", corridaId);
|
aliasServicoBusqueda.addFilterEqual("corridaId", corridaId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lsRutas != null) {
|
||||||
|
aliasServicoBusqueda.addFilterIn("ruta", lsRutas);
|
||||||
|
}
|
||||||
|
|
||||||
aliasServicoBusqueda.addSortAsc("aliasServicoId");
|
aliasServicoBusqueda.addSortAsc("aliasServicoId");
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,10 @@ import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||||
import com.rjconsultores.ventaboletos.service.ClaseServicioService;
|
import com.rjconsultores.ventaboletos.service.ClaseServicioService;
|
||||||
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.EsquemaCorridaService;
|
||||||
import com.rjconsultores.ventaboletos.service.GrupoRutaService;
|
import com.rjconsultores.ventaboletos.service.GrupoRutaService;
|
||||||
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
|
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.RutaService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
|
@ -59,10 +61,15 @@ public class BusquedaCatalogoDeRutaController extends MyGenericForwardComposer {
|
||||||
private EmpresaService empresaService;
|
private EmpresaService empresaService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private GrupoRutaService grupoRutaService;
|
private GrupoRutaService grupoRutaService;
|
||||||
|
@Autowired
|
||||||
|
private EsquemaCorridaService esquemaCorridaService;
|
||||||
|
@Autowired
|
||||||
|
private RutaService rutaService;
|
||||||
private List<ClaseServicio> lsClaseServicio;
|
private List<ClaseServicio> lsClaseServicio;
|
||||||
private List<OrgaoConcedente> lsOrgaoConcedente;
|
private List<OrgaoConcedente> lsOrgaoConcedente;
|
||||||
private List<GrupoRuta> lsGrupoRuta;
|
private List<GrupoRuta> lsGrupoRuta;
|
||||||
private List<Empresa> lsEmpresa;
|
private List<Empresa> lsEmpresa;
|
||||||
|
private List<Ruta> lsRuta;
|
||||||
private MyListbox rutaList;
|
private MyListbox rutaList;
|
||||||
private Paging pagingRuta;
|
private Paging pagingRuta;
|
||||||
private Textbox txtNombre;
|
private Textbox txtNombre;
|
||||||
|
@ -81,6 +88,14 @@ public class BusquedaCatalogoDeRutaController extends MyGenericForwardComposer {
|
||||||
public void setLsEmpresa(List<Empresa> lsEmpresa) {
|
public void setLsEmpresa(List<Empresa> lsEmpresa) {
|
||||||
this.lsEmpresa = lsEmpresa;
|
this.lsEmpresa = lsEmpresa;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Ruta> getLsRuta() {
|
||||||
|
return lsRuta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLsRuta(List<Ruta> lsRuta) {
|
||||||
|
this.lsRuta = lsRuta;
|
||||||
|
}
|
||||||
|
|
||||||
public List<ClaseServicio> getLsClaseServicio() {
|
public List<ClaseServicio> getLsClaseServicio() {
|
||||||
return lsClaseServicio;
|
return lsClaseServicio;
|
||||||
|
@ -155,6 +170,18 @@ public class BusquedaCatalogoDeRutaController extends MyGenericForwardComposer {
|
||||||
} else {
|
} else {
|
||||||
rutaBusqueda.addFilterAll("lsRutaEmpresa", Filter.in("empresa.empresaId", getIdEmpresas(lsEmpresa)));
|
rutaBusqueda.addFilterAll("lsRutaEmpresa", Filter.in("empresa.empresaId", getIdEmpresas(lsEmpresa)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<Empresa> lsEmpresa = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
||||||
|
lsRuta = rutaService.buscarRutasPorEmpresas(lsEmpresa);
|
||||||
|
|
||||||
|
List<Integer> lsRutaIds = new ArrayList<Integer>();
|
||||||
|
for(Ruta r : lsRuta){
|
||||||
|
lsRutaIds.add(r.getRutaId());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lsRutaIds != null) {
|
||||||
|
rutaBusqueda.addFilterIn("rutaId", lsRutaIds);
|
||||||
|
}
|
||||||
|
|
||||||
rutaBusqueda.addFilterNotEqual("rutaId", -1);
|
rutaBusqueda.addFilterNotEqual("rutaId", -1);
|
||||||
if (txtId.getValue() != null) {
|
if (txtId.getValue() != null) {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional;
|
package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -19,11 +20,15 @@ import org.zkoss.zul.Paging;
|
||||||
import org.zkoss.zul.Textbox;
|
import org.zkoss.zul.Textbox;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.ConfRestricaoCanalVenta;
|
import com.rjconsultores.ventaboletos.entidad.ConfRestricaoCanalVenta;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||||
import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta;
|
import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta;
|
||||||
|
import com.rjconsultores.ventaboletos.service.EsquemaCorridaService;
|
||||||
import com.rjconsultores.ventaboletos.service.RutaService;
|
import com.rjconsultores.ventaboletos.service.RutaService;
|
||||||
import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService;
|
import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
|
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
|
||||||
|
@ -51,6 +56,17 @@ public class BusquedaConfRestricaoCanalVentaController extends MyGenericForwardC
|
||||||
private Combobox cmbRuta;
|
private Combobox cmbRuta;
|
||||||
private Textbox txtDescConf;
|
private Textbox txtDescConf;
|
||||||
private Intbox txtServico;
|
private Intbox txtServico;
|
||||||
|
private List<Empresa> lsEmpresa;
|
||||||
|
@Autowired
|
||||||
|
private EsquemaCorridaService esquemaCorridaService;
|
||||||
|
|
||||||
|
public List<Empresa> getLsEmpresa() {
|
||||||
|
return lsEmpresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLsEmpresa(List<Empresa> lsEmpresa) {
|
||||||
|
this.lsEmpresa = lsEmpresa;
|
||||||
|
}
|
||||||
|
|
||||||
public List<TipoPuntoVenta> getLsTipoPtoVta() {
|
public List<TipoPuntoVenta> getLsTipoPtoVta() {
|
||||||
return lsTipoPtoVta;
|
return lsTipoPtoVta;
|
||||||
|
@ -70,8 +86,10 @@ public class BusquedaConfRestricaoCanalVentaController extends MyGenericForwardC
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
|
lsEmpresa = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
||||||
lsTipoPtoVta = tipoPtoVtaService.obtenerTodos();
|
lsTipoPtoVta = tipoPtoVtaService.obtenerTodos();
|
||||||
lsRuta = rutaService.obtenerTodos();
|
List <Empresa> lsEmpresa = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
||||||
|
lsRuta = rutaService.buscarRutasPorEmpresas(lsEmpresa);
|
||||||
|
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
|
|
||||||
|
@ -102,6 +120,9 @@ public class BusquedaConfRestricaoCanalVentaController extends MyGenericForwardC
|
||||||
if (servicio != null) {
|
if (servicio != null) {
|
||||||
confRestricaoCanalVentaBusqueda.addFilterEqual("corridaId", servicio);
|
confRestricaoCanalVentaBusqueda.addFilterEqual("corridaId", servicio);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List <Integer> lsIdsCorridas = getIdsCorridasFromEmpresasUser(lsEmpresa);
|
||||||
|
confRestricaoCanalVentaBusqueda.addFilterIn("corridaId", lsIdsCorridas);
|
||||||
|
|
||||||
Comboitem cbiTipoPtoVta = cmbTipoPtoVta.getSelectedItem();
|
Comboitem cbiTipoPtoVta = cmbTipoPtoVta.getSelectedItem();
|
||||||
if (cbiTipoPtoVta != null) {
|
if (cbiTipoPtoVta != null) {
|
||||||
|
@ -168,4 +189,20 @@ public class BusquedaConfRestricaoCanalVentaController extends MyGenericForwardC
|
||||||
public void onClick$btnNovo(Event ev) {
|
public void onClick$btnNovo(Event ev) {
|
||||||
verConfRestricaoCanalVenta(new ConfRestricaoCanalVenta());
|
verConfRestricaoCanalVenta(new ConfRestricaoCanalVenta());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<Integer> getCorridasIds(List<EsquemaCorrida> esquemaCorridas){
|
||||||
|
List<Integer> ids = new ArrayList<Integer>();
|
||||||
|
for(int i = 0 ; i < esquemaCorridas.size() ; i ++){
|
||||||
|
ids.add((esquemaCorridas.get(i)).getNumCorrida());
|
||||||
|
}
|
||||||
|
return ids;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Integer> getIdsCorridasFromEmpresasUser(List<Empresa> lsEmpresa){
|
||||||
|
List<EsquemaCorrida> esquemaCorridas = new ArrayList<EsquemaCorrida>();
|
||||||
|
for(Empresa e : lsEmpresa){
|
||||||
|
esquemaCorridas.addAll(esquemaCorridaService.buscarPorEmpresaCorrida(e));
|
||||||
|
}
|
||||||
|
return getCorridasIds(esquemaCorridas);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ import org.zkoss.zul.Messagebox;
|
||||||
import com.rjconsultores.ventaboletos.entidad.ConfRestricaoCanalVenta;
|
import com.rjconsultores.ventaboletos.entidad.ConfRestricaoCanalVenta;
|
||||||
import com.rjconsultores.ventaboletos.entidad.ConfRestricaoExcecao;
|
import com.rjconsultores.ventaboletos.entidad.ConfRestricaoExcecao;
|
||||||
import com.rjconsultores.ventaboletos.entidad.ConfRestricaoPtovta;
|
import com.rjconsultores.ventaboletos.entidad.ConfRestricaoPtovta;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||||
|
@ -28,6 +29,7 @@ import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
import com.rjconsultores.ventaboletos.service.ConfRestricaoCanalVentaService;
|
import com.rjconsultores.ventaboletos.service.ConfRestricaoCanalVentaService;
|
||||||
import com.rjconsultores.ventaboletos.service.ConfRestricaoExcecaoService;
|
import com.rjconsultores.ventaboletos.service.ConfRestricaoExcecaoService;
|
||||||
import com.rjconsultores.ventaboletos.service.ConfRestricaoPtovtaService;
|
import com.rjconsultores.ventaboletos.service.ConfRestricaoPtovtaService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.EsquemaCorridaService;
|
||||||
import com.rjconsultores.ventaboletos.service.RutaService;
|
import com.rjconsultores.ventaboletos.service.RutaService;
|
||||||
import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService;
|
import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
@ -53,6 +55,8 @@ public class EditarConfRestricaoCanalVentaController extends MyGenericForwardCom
|
||||||
private ConfRestricaoExcecaoService confRestricaoExcecaoServide;
|
private ConfRestricaoExcecaoService confRestricaoExcecaoServide;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ConfRestricaoPtovtaService confRestricaoPtovtaService;
|
private ConfRestricaoPtovtaService confRestricaoPtovtaService;
|
||||||
|
@Autowired
|
||||||
|
private EsquemaCorridaService esquemaCorridaService;
|
||||||
|
|
||||||
private ConfRestricaoCanalVenta confRestricaoCanalVenta;
|
private ConfRestricaoCanalVenta confRestricaoCanalVenta;
|
||||||
private List<TipoPuntoVenta> lsTipoPtoVta;
|
private List<TipoPuntoVenta> lsTipoPtoVta;
|
||||||
|
@ -91,7 +95,8 @@ public class EditarConfRestricaoCanalVentaController extends MyGenericForwardCom
|
||||||
confRestricaoCanalVentaList = (MyListbox) Executions.getCurrent().getArg().get("confRestricaoCanalVentaList");
|
confRestricaoCanalVentaList = (MyListbox) Executions.getCurrent().getArg().get("confRestricaoCanalVentaList");
|
||||||
|
|
||||||
lsTipoPtoVta = tipoPtoVtaService.obtenerTodos();
|
lsTipoPtoVta = tipoPtoVtaService.obtenerTodos();
|
||||||
lsRuta = rutaService.obtenerTodos();
|
List <Empresa> lsEmpresa = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
||||||
|
lsRuta = rutaService.buscarRutasPorEmpresas(lsEmpresa);
|
||||||
|
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
|
|
||||||
|
|
|
@ -23,9 +23,11 @@ import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.EsquemaCorridaService;
|
||||||
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
|
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
|
||||||
import com.rjconsultores.ventaboletos.service.RutaService;
|
import com.rjconsultores.ventaboletos.service.RutaService;
|
||||||
import com.rjconsultores.ventaboletos.service.TarifaOficialService;
|
import com.rjconsultores.ventaboletos.service.TarifaOficialService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRutaDesc;
|
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRutaDesc;
|
||||||
|
@ -50,6 +52,8 @@ public class GenerarTarifaOrgaoController extends MyGenericForwardComposer {
|
||||||
private EmpresaService empresaService;
|
private EmpresaService empresaService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TarifaOficialDAO tarifaOficialDAO;
|
private TarifaOficialDAO tarifaOficialDAO;
|
||||||
|
@Autowired
|
||||||
|
private EsquemaCorridaService esquemaCorridaService;
|
||||||
|
|
||||||
private List<Ruta> lsRuta;
|
private List<Ruta> lsRuta;
|
||||||
private List<OrgaoConcedente> lsOrgaoConcedente;
|
private List<OrgaoConcedente> lsOrgaoConcedente;
|
||||||
|
@ -65,6 +69,15 @@ public class GenerarTarifaOrgaoController extends MyGenericForwardComposer {
|
||||||
private Checkbox chkPedagio;
|
private Checkbox chkPedagio;
|
||||||
private List<Ruta> listSelectedRutas;
|
private List<Ruta> listSelectedRutas;
|
||||||
private MyListbox selectedRutasList;
|
private MyListbox selectedRutasList;
|
||||||
|
private List<Empresa> lsEmpresaSelected;
|
||||||
|
|
||||||
|
public List<Empresa> getLsEmpresaSelected() {
|
||||||
|
return lsEmpresaSelected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLsEmpresaSelected(List<Empresa> lsEmpresaSelected) {
|
||||||
|
this.lsEmpresaSelected = lsEmpresaSelected;
|
||||||
|
}
|
||||||
|
|
||||||
public List<Ruta> getLsRuta() {
|
public List<Ruta> getLsRuta() {
|
||||||
return lsRuta;
|
return lsRuta;
|
||||||
|
@ -82,12 +95,13 @@ public class GenerarTarifaOrgaoController extends MyGenericForwardComposer {
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
lsOrgaoConcedente = orgaoConcedenteService.obtenerTodos();
|
lsOrgaoConcedente = orgaoConcedenteService.obtenerTodos();
|
||||||
lsRuta = rutaService.obtenerTodos();
|
lsEmpresa = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
||||||
lsEmpresa = empresaService.obtenerTodos();
|
lsRuta = rutaService.buscarRutasPorEmpresas(lsEmpresa);
|
||||||
|
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
selectedRutasList.setItemRenderer(new RenderRutaDesc());
|
selectedRutasList.setItemRenderer(new RenderRutaDesc());
|
||||||
listSelectedRutas = new ArrayList<Ruta>();
|
listSelectedRutas = new ArrayList<Ruta>();
|
||||||
|
lsEmpresaSelected = new ArrayList<Empresa>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$chkZerarTabela(Event ev)
|
public void onClick$chkZerarTabela(Event ev)
|
||||||
|
@ -118,19 +132,22 @@ public class GenerarTarifaOrgaoController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
public void onClick$btnGenerarVigencia(Event ev) throws InterruptedException {
|
public void onClick$btnGenerarVigencia(Event ev) throws InterruptedException {
|
||||||
cmbOrgaoConcedente.getValue();
|
cmbOrgaoConcedente.getValue();
|
||||||
|
|
||||||
List<Ruta> lsRuta = new ArrayList<Ruta>();
|
|
||||||
Integer orgaoConcedenteId = null;
|
Integer orgaoConcedenteId = null;
|
||||||
Integer empresaId = null;
|
|
||||||
|
|
||||||
lsRuta = listSelectedRutas;
|
|
||||||
|
|
||||||
if (cmbOrgaoConcedente.getSelectedItem() != null) {
|
if (cmbOrgaoConcedente.getSelectedItem() != null) {
|
||||||
orgaoConcedenteId = ((OrgaoConcedente) cmbOrgaoConcedente.getSelectedItem().getValue()).getOrgaoConcedenteId();
|
orgaoConcedenteId = ((OrgaoConcedente) cmbOrgaoConcedente.getSelectedItem().getValue()).getOrgaoConcedenteId();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmbEmpresa.getSelectedItem() != null){
|
if (cmbEmpresa.getSelectedItem() != null){
|
||||||
empresaId = ((Empresa)cmbEmpresa.getSelectedItem().getValue()).getEmpresaId();
|
lsEmpresaSelected = new ArrayList<Empresa>();
|
||||||
|
lsEmpresaSelected.add(((Empresa)cmbEmpresa.getSelectedItem().getValue()));
|
||||||
|
}else{
|
||||||
|
lsEmpresaSelected = lsEmpresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(listSelectedRutas == null || listSelectedRutas.isEmpty()){
|
||||||
|
listSelectedRutas = lsRuta;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (orgaoConcedenteId == null){
|
if (orgaoConcedenteId == null){
|
||||||
|
@ -148,17 +165,17 @@ public class GenerarTarifaOrgaoController extends MyGenericForwardComposer {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (chkTarifa.isChecked()) {
|
if (chkTarifa.isChecked()) {
|
||||||
tarifaOficialService.gerarAtualizarTarifa(lsRuta, orgaoConcedenteId, empresaId);
|
tarifaOficialService.gerarAtualizarTarifa(listSelectedRutas, orgaoConcedenteId, lsEmpresaSelected);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean gerarTabelaZerada = !chkTarifa.isChecked();
|
boolean gerarTabelaZerada = !chkTarifa.isChecked();
|
||||||
|
|
||||||
if (chkTaxaEmbarque.isChecked()) {
|
if (chkTaxaEmbarque.isChecked()) {
|
||||||
tarifaOficialService.atualizarTaxaEmbarque(lsRuta, orgaoConcedenteId,gerarTabelaZerada, empresaId);
|
tarifaOficialService.atualizarTaxaEmbarque(listSelectedRutas, orgaoConcedenteId,gerarTabelaZerada, lsEmpresaSelected);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chkSeguro.isChecked()) {
|
if (chkSeguro.isChecked()) {
|
||||||
tarifaOficialService.atualizarSeguro(lsRuta, orgaoConcedenteId);
|
tarifaOficialService.atualizarSeguro(listSelectedRutas, orgaoConcedenteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chkPedagio.isChecked()) {
|
if (chkPedagio.isChecked()) {
|
||||||
|
@ -181,7 +198,7 @@ public class GenerarTarifaOrgaoController extends MyGenericForwardComposer {
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
try{
|
try{
|
||||||
tarifaOficialService.gerarAtualizarTabelaZerada(lsRuta, orgaoConcedenteId, empresaId);
|
tarifaOficialService.gerarAtualizarTabelaZerada(listSelectedRutas, orgaoConcedenteId, lsEmpresaSelected);
|
||||||
|
|
||||||
Messagebox.show(Labels.getLabel("generarTarifaOrgaoController.MSG.suscribirOK"),
|
Messagebox.show(Labels.getLabel("generarTarifaOrgaoController.MSG.suscribirOK"),
|
||||||
Labels.getLabel("indexController.mniGenerarTarifaOrgao.label"),
|
Labels.getLabel("indexController.mniGenerarTarifaOrgao.label"),
|
||||||
|
|
|
@ -65,6 +65,7 @@ import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta;
|
||||||
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
||||||
import com.rjconsultores.ventaboletos.service.CategoriaService;
|
import com.rjconsultores.ventaboletos.service.CategoriaService;
|
||||||
import com.rjconsultores.ventaboletos.service.ClaseServicioService;
|
import com.rjconsultores.ventaboletos.service.ClaseServicioService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.EsquemaCorridaService;
|
||||||
import com.rjconsultores.ventaboletos.service.MarcaService;
|
import com.rjconsultores.ventaboletos.service.MarcaService;
|
||||||
import com.rjconsultores.ventaboletos.service.MonedaService;
|
import com.rjconsultores.ventaboletos.service.MonedaService;
|
||||||
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
|
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
|
||||||
|
@ -117,6 +118,8 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose
|
||||||
private VigenciaTarifaService vigenciaTarifaService;
|
private VigenciaTarifaService vigenciaTarifaService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private OrgaoConcedenteService orgaoConcedenteService;
|
private OrgaoConcedenteService orgaoConcedenteService;
|
||||||
|
@Autowired
|
||||||
|
private EsquemaCorridaService esquemaCorridaService;
|
||||||
private List<Marca> lsMarcas;
|
private List<Marca> lsMarcas;
|
||||||
private List<ClaseServicio> lsClaseServico;
|
private List<ClaseServicio> lsClaseServico;
|
||||||
private List<Moneda> lsMonedas;
|
private List<Moneda> lsMonedas;
|
||||||
|
@ -249,7 +252,7 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose
|
||||||
lsClaseServico = claseServicioService.obtenerTodos();
|
lsClaseServico = claseServicioService.obtenerTodos();
|
||||||
lsMonedas = monedaService.obtenerTodos();
|
lsMonedas = monedaService.obtenerTodos();
|
||||||
lsEmpresas = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
lsEmpresas = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
||||||
lsRutas = rutaService.obtenerTodos();
|
lsRutas = rutaService.buscarRutasPorEmpresas(lsEmpresas);
|
||||||
lsTipoPuntoVenta = tipoPuntoVentaService.obtenerTodos();
|
lsTipoPuntoVenta = tipoPuntoVentaService.obtenerTodos();
|
||||||
lsCategoria = categoriaService.obtenerTodos();
|
lsCategoria = categoriaService.obtenerTodos();
|
||||||
lsVigenciaTarifa = vigenciaTarifaService.obtenerTodos();
|
lsVigenciaTarifa = vigenciaTarifaService.obtenerTodos();
|
||||||
|
|
|
@ -47,6 +47,7 @@ import org.zkoss.zul.RowRenderer;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Ciudad;
|
import com.rjconsultores.ventaboletos.entidad.Ciudad;
|
||||||
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Marca;
|
import com.rjconsultores.ventaboletos.entidad.Marca;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Moneda;
|
import com.rjconsultores.ventaboletos.entidad.Moneda;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
|
@ -928,6 +929,16 @@ public class TarifaEscalaContorller extends MyGenericForwardComposer {
|
||||||
cmbRuta.setDisabled(Boolean.FALSE);
|
cmbRuta.setDisabled(Boolean.FALSE);
|
||||||
|
|
||||||
lsMarcas = marcaClaseServicioService.buscar(claseServicio);
|
lsMarcas = marcaClaseServicioService.buscar(claseServicio);
|
||||||
|
List<Empresa> lsEmpresa = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
||||||
|
List<Ruta> lsRutasValidas = rutaService.buscarRutasPorEmpresas(lsEmpresa);
|
||||||
|
lsRutas.retainAll(lsRutasValidas);
|
||||||
|
List<Marca> marcasRemover = new ArrayList<Marca>();
|
||||||
|
for(Marca m : lsMarcas){
|
||||||
|
if(!lsEmpresa.contains(m.getEmpresa())){
|
||||||
|
marcasRemover.add(m);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lsMarcas.removeAll(marcasRemover);
|
||||||
cmbMarca.setConstraint("");
|
cmbMarca.setConstraint("");
|
||||||
cmbMarca.setSelectedItem(null);
|
cmbMarca.setSelectedItem(null);
|
||||||
cmbMarca.setText(null);
|
cmbMarca.setText(null);
|
||||||
|
|
|
@ -12,10 +12,12 @@ import org.zkoss.zk.ui.Executions;
|
||||||
import org.zkoss.zk.ui.event.Event;
|
import org.zkoss.zk.ui.event.Event;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.AliasServico;
|
import com.rjconsultores.ventaboletos.entidad.AliasServico;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
import com.rjconsultores.ventaboletos.service.AliasServicoService;
|
import com.rjconsultores.ventaboletos.service.AliasServicoService;
|
||||||
import com.rjconsultores.ventaboletos.service.RutaService;
|
import com.rjconsultores.ventaboletos.service.RutaService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
|
|
||||||
|
@ -50,7 +52,8 @@ public class EditarAliasServicoController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
lsRutas = rutaService.obtenerTodos();
|
List<Empresa> lsEmpresa = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
||||||
|
lsRutas = rutaService.buscarRutasPorEmpresas(lsEmpresa);
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
|
|
||||||
aliasServico = (AliasServico) Executions.getCurrent().getArg().get("aliasServico");
|
aliasServico = (AliasServico) Executions.getCurrent().getArg().get("aliasServico");
|
||||||
|
|
Loading…
Reference in New Issue