bug#13266
dev:lucas qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@89783 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
7eb6dd5027
commit
639c958a66
|
@ -10,12 +10,14 @@ import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Plaza;
|
import com.rjconsultores.ventaboletos.entidad.Plaza;
|
||||||
import com.rjconsultores.ventaboletos.entidad.TarifaMinima;
|
import com.rjconsultores.ventaboletos.entidad.TarifaMinima;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
|
||||||
import com.rjconsultores.ventaboletos.service.ClaseServicioService;
|
import com.rjconsultores.ventaboletos.service.ClaseServicioService;
|
||||||
import com.rjconsultores.ventaboletos.service.MarcaService;
|
import com.rjconsultores.ventaboletos.service.MarcaService;
|
||||||
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
|
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
|
||||||
import com.rjconsultores.ventaboletos.service.ParadaService;
|
import com.rjconsultores.ventaboletos.service.ParadaService;
|
||||||
import com.rjconsultores.ventaboletos.service.PlazaService;
|
import com.rjconsultores.ventaboletos.service.PlazaService;
|
||||||
import com.rjconsultores.ventaboletos.service.TarifaMinimaService;
|
import com.rjconsultores.ventaboletos.service.TarifaMinimaService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.VigenciaTarifaService;
|
||||||
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,13 @@ public class BusquedaTarifasMinimasController extends MyGenericForwardComposer {
|
||||||
private PlazaService plazaService;
|
private PlazaService plazaService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private OrgaoConcedenteService orgaoConcedenteService;
|
private OrgaoConcedenteService orgaoConcedenteService;
|
||||||
|
@Autowired
|
||||||
|
private VigenciaTarifaService vigenciaTarifaService;
|
||||||
private List<Marca> lsMarcas;
|
private List<Marca> lsMarcas;
|
||||||
private List<ClaseServicio> lsClaseServico;
|
private List<ClaseServicio> lsClaseServico;
|
||||||
private List<OrgaoConcedente> lsOrgaoConcedente;
|
private List<OrgaoConcedente> lsOrgaoConcedente;
|
||||||
private List<Plaza> lsPlaza;
|
private List<Plaza> lsPlaza;
|
||||||
|
private List<VigenciaTarifa> lsVigenciaTarifa;
|
||||||
private MyListbox tarifaMinimaList;
|
private MyListbox tarifaMinimaList;
|
||||||
private Paging pagingTarifaMinima;
|
private Paging pagingTarifaMinima;
|
||||||
private Combobox cmbMarca;
|
private Combobox cmbMarca;
|
||||||
|
@ -70,7 +75,99 @@ public class BusquedaTarifasMinimasController extends MyGenericForwardComposer {
|
||||||
private Combobox cmbDestino;
|
private Combobox cmbDestino;
|
||||||
private Combobox cmbClaseServicio;
|
private Combobox cmbClaseServicio;
|
||||||
private Combobox cmbOrgaoConcedente;
|
private Combobox cmbOrgaoConcedente;
|
||||||
|
private Combobox cmbVigencia;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
|
super.doAfterCompose(comp);
|
||||||
|
|
||||||
|
tarifaMinimaList.setItemRenderer(new RenderTarifaMinima());
|
||||||
|
tarifaMinimaList.addEventListener("onDoubleClick", new EventListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEvent(Event event) throws Exception {
|
||||||
|
TarifaMinima tf = (TarifaMinima) tarifaMinimaList.getSelected();
|
||||||
|
verTarifaMinima(tf);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
lsMarcas = marcaService.buscarMarcaPorEmpresa(UsuarioLogado.getUsuarioLogado().getEmpresa());
|
||||||
|
lsOrgaoConcedente = orgaoConcedenteService.obtenerTodos();
|
||||||
|
|
||||||
|
lsClaseServico = new ArrayList<ClaseServicio>();
|
||||||
|
lsClaseServico.add(null);
|
||||||
|
lsClaseServico.addAll(claseServicioService.obtenerTodos());
|
||||||
|
|
||||||
|
lsPlaza = new ArrayList<Plaza>();
|
||||||
|
lsPlaza.add(null);
|
||||||
|
lsPlaza.addAll(plazaService.obtenerTodos());
|
||||||
|
|
||||||
|
lsVigenciaTarifa = new ArrayList<VigenciaTarifa>();
|
||||||
|
lsVigenciaTarifa.add(null);
|
||||||
|
lsVigenciaTarifa.addAll(vigenciaTarifaService.obtenerTodos());
|
||||||
|
|
||||||
|
refreshLista();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void verTarifaMinima(TarifaMinima tf) {
|
||||||
|
if (tf == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map args = new HashMap();
|
||||||
|
args.put("tarifaMinima", tf);
|
||||||
|
args.put("tarifaMinimaList", tarifaMinimaList);
|
||||||
|
|
||||||
|
openWindow("/gui/tarifas/editarTarifasMinimas.zul",
|
||||||
|
Labels.getLabel("editarTarifaMinimaController.window.title"), args, MODAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshLista() {
|
||||||
|
HibernateSearchObject<TarifaMinima> tarifaMinimaBusqueda =
|
||||||
|
new HibernateSearchObject<TarifaMinima>(TarifaMinima.class, pagingTarifaMinima.getPageSize());
|
||||||
|
tarifaMinimaBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
||||||
|
|
||||||
|
OrgaoConcedente orgaoConcedente = (OrgaoConcedente) (cmbOrgaoConcedente.getSelectedItem() != null ? cmbOrgaoConcedente.getSelectedItem().getValue() : null);
|
||||||
|
if (orgaoConcedente != null) {
|
||||||
|
tarifaMinimaBusqueda.addFilterEqual("orgaoConcedente", orgaoConcedente);
|
||||||
|
}
|
||||||
|
|
||||||
|
Parada origem = (Parada) (cmbOrigem.getSelectedItem() != null ? cmbOrigem.getSelectedItem().getValue() : null);
|
||||||
|
if (origem != null) {
|
||||||
|
tarifaMinimaBusqueda.addFilterEqual("origem", origem);
|
||||||
|
}
|
||||||
|
Parada destino = (Parada) (cmbDestino.getSelectedItem() != null ? cmbDestino.getSelectedItem().getValue() : null);
|
||||||
|
if (destino != null) {
|
||||||
|
tarifaMinimaBusqueda.addFilterEqual("destino", destino);
|
||||||
|
}
|
||||||
|
Marca marca = (Marca) (cmbMarca.getSelectedItem() != null ? cmbMarca.getSelectedItem().getValue() : null);
|
||||||
|
if (marca != null) {
|
||||||
|
tarifaMinimaBusqueda.addFilterEqual("marca", marca);
|
||||||
|
}else{
|
||||||
|
tarifaMinimaBusqueda.addFilterIn("marca", lsMarcas);
|
||||||
|
}
|
||||||
|
ClaseServicio claseServicio = (ClaseServicio) (cmbClaseServicio.getSelectedItem() != null ? cmbClaseServicio.getSelectedItem().getValue() : null);
|
||||||
|
if (claseServicio != null) {
|
||||||
|
tarifaMinimaBusqueda.addFilterEqual("claseServicio", claseServicio);
|
||||||
|
}
|
||||||
|
|
||||||
|
VigenciaTarifa vigenciaTarifa = (VigenciaTarifa) (cmbVigencia.getSelectedItem() != null ? cmbVigencia.getSelectedItem().getValue() : null);
|
||||||
|
if (vigenciaTarifa != null) {
|
||||||
|
tarifaMinimaBusqueda.addFilterEqual("vigenciaTarifa", vigenciaTarifa);
|
||||||
|
}
|
||||||
|
|
||||||
|
plwTarifaMinima.init(tarifaMinimaBusqueda, tarifaMinimaList, pagingTarifaMinima);
|
||||||
|
|
||||||
|
if (tarifaMinimaList.getData().length == 0) {
|
||||||
|
try {
|
||||||
|
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
|
||||||
|
Labels.getLabel("busquedaTarifasMinimasController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Combobox getCmbClaseServicio() {
|
public Combobox getCmbClaseServicio() {
|
||||||
return cmbClaseServicio;
|
return cmbClaseServicio;
|
||||||
}
|
}
|
||||||
|
@ -179,87 +276,12 @@ public class BusquedaTarifasMinimasController extends MyGenericForwardComposer {
|
||||||
this.cmbOrgaoConcedente = cmbOrgaoConcedente;
|
this.cmbOrgaoConcedente = cmbOrgaoConcedente;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public List<VigenciaTarifa> getLsVigenciaTarifa() {
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
return lsVigenciaTarifa;
|
||||||
super.doAfterCompose(comp);
|
}
|
||||||
|
|
||||||
tarifaMinimaList.setItemRenderer(new RenderTarifaMinima());
|
|
||||||
tarifaMinimaList.addEventListener("onDoubleClick", new EventListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEvent(Event event) throws Exception {
|
|
||||||
TarifaMinima tf = (TarifaMinima) tarifaMinimaList.getSelected();
|
|
||||||
verTarifaMinima(tf);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
lsMarcas = marcaService.buscarMarcaPorEmpresa(UsuarioLogado.getUsuarioLogado().getEmpresa());
|
|
||||||
lsOrgaoConcedente = orgaoConcedenteService.obtenerTodos();
|
|
||||||
|
|
||||||
lsClaseServico = new ArrayList<ClaseServicio>();
|
|
||||||
lsClaseServico.add(null);
|
|
||||||
lsClaseServico.addAll(claseServicioService.obtenerTodos());
|
|
||||||
|
|
||||||
lsPlaza = new ArrayList<Plaza>();
|
|
||||||
lsPlaza.add(null);
|
|
||||||
lsPlaza.addAll(plazaService.obtenerTodos());
|
|
||||||
|
|
||||||
refreshLista();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void verTarifaMinima(TarifaMinima tf) {
|
|
||||||
if (tf == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Map args = new HashMap();
|
|
||||||
args.put("tarifaMinima", tf);
|
|
||||||
args.put("tarifaMinimaList", tarifaMinimaList);
|
|
||||||
|
|
||||||
openWindow("/gui/tarifas/editarTarifasMinimas.zul",
|
|
||||||
Labels.getLabel("editarTarifaMinimaController.window.title"), args, MODAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void refreshLista() {
|
|
||||||
HibernateSearchObject<TarifaMinima> tarifaMinimaBusqueda =
|
|
||||||
new HibernateSearchObject<TarifaMinima>(TarifaMinima.class, pagingTarifaMinima.getPageSize());
|
|
||||||
tarifaMinimaBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
|
||||||
|
|
||||||
OrgaoConcedente orgaoConcedente = (OrgaoConcedente) (cmbOrgaoConcedente.getSelectedItem() != null ? cmbOrgaoConcedente.getSelectedItem().getValue() : null);
|
|
||||||
if (orgaoConcedente != null) {
|
|
||||||
tarifaMinimaBusqueda.addFilterEqual("orgaoConcedente", orgaoConcedente);
|
|
||||||
}
|
|
||||||
|
|
||||||
Parada origem = (Parada) (cmbOrigem.getSelectedItem() != null ? cmbOrigem.getSelectedItem().getValue() : null);
|
|
||||||
if (origem != null) {
|
|
||||||
tarifaMinimaBusqueda.addFilterEqual("origem", origem);
|
|
||||||
}
|
|
||||||
Parada destino = (Parada) (cmbDestino.getSelectedItem() != null ? cmbDestino.getSelectedItem().getValue() : null);
|
|
||||||
if (destino != null) {
|
|
||||||
tarifaMinimaBusqueda.addFilterEqual("destino", destino);
|
|
||||||
}
|
|
||||||
Marca marca = (Marca) (cmbMarca.getSelectedItem() != null ? cmbMarca.getSelectedItem().getValue() : null);
|
|
||||||
if (marca != null) {
|
|
||||||
tarifaMinimaBusqueda.addFilterEqual("marca", marca);
|
|
||||||
}else{
|
|
||||||
tarifaMinimaBusqueda.addFilterIn("marca", lsMarcas);
|
|
||||||
}
|
|
||||||
ClaseServicio claseServicio = (ClaseServicio) (cmbClaseServicio.getSelectedItem() != null ? cmbClaseServicio.getSelectedItem().getValue() : null);
|
|
||||||
if (claseServicio != null) {
|
|
||||||
tarifaMinimaBusqueda.addFilterEqual("claseServicio", claseServicio);
|
|
||||||
}
|
|
||||||
|
|
||||||
plwTarifaMinima.init(tarifaMinimaBusqueda, tarifaMinimaList, pagingTarifaMinima);
|
|
||||||
|
|
||||||
if (tarifaMinimaList.getData().length == 0) {
|
|
||||||
try {
|
|
||||||
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
|
|
||||||
Labels.getLabel("busquedaTarifasMinimasController.window.title"),
|
|
||||||
Messagebox.OK, Messagebox.INFORMATION);
|
|
||||||
} catch (InterruptedException ex) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public void setLsVigenciaTarifa(List<VigenciaTarifa> lsVigenciaTarifa) {
|
||||||
|
this.lsVigenciaTarifa = lsVigenciaTarifa;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,6 +79,13 @@ public class RenderTarifaMinima implements ListitemRenderer {
|
||||||
lc = new Listcell("");
|
lc = new Listcell("");
|
||||||
}
|
}
|
||||||
lc.setParent(lstm);
|
lc.setParent(lstm);
|
||||||
|
|
||||||
|
if (tm.getVigenciaTarifa() != null) {
|
||||||
|
lc = new Listcell(tm.getVigenciaTarifa().toString());
|
||||||
|
} else {
|
||||||
|
lc = new Listcell("");
|
||||||
|
}
|
||||||
|
lc.setParent(lstm);
|
||||||
|
|
||||||
lstm.setAttribute("data", tm);
|
lstm.setAttribute("data", tm);
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,13 @@
|
||||||
mold="rounded" buttonVisible="true" width="90%"
|
mold="rounded" buttonVisible="true" width="90%"
|
||||||
model="@{winTarifaMinima$composer.lsClaseServico}"/>
|
model="@{winTarifaMinima$composer.lsClaseServico}"/>
|
||||||
</row>
|
</row>
|
||||||
|
<row>
|
||||||
|
<label value="${c:l('busquedaTarifaController.lhFeciniciovigencia.label')}"/>
|
||||||
|
<combobox id="cmbVigencia" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||||
|
disabled="false"
|
||||||
|
mold="rounded" buttonVisible="true" width="90%"
|
||||||
|
model="@{winTarifaMinima$composer.lsVigenciaTarifa}"/>
|
||||||
|
</row>
|
||||||
</rows>
|
</rows>
|
||||||
</grid>
|
</grid>
|
||||||
|
|
||||||
|
@ -90,6 +97,9 @@
|
||||||
<listheader id="lhMoneda" image="/gui/img/builder.gif" width="80px"
|
<listheader id="lhMoneda" image="/gui/img/builder.gif" width="80px"
|
||||||
label="${c:l('busquedaTarifasMinimasController.lhMoneda.label')}"
|
label="${c:l('busquedaTarifasMinimasController.lhMoneda.label')}"
|
||||||
sort="auto(moneda.descmoneda)"/>
|
sort="auto(moneda.descmoneda)"/>
|
||||||
|
<listheader id="lhVigencia" image="/gui/img/builder.gif" width="80px"
|
||||||
|
label="${c:l('busquedaTarifaController.lhFeciniciovigencia.label')}"
|
||||||
|
sort="auto(vigenciaTarifa.feciniciovigencia)"/>
|
||||||
</listhead>
|
</listhead>
|
||||||
</listbox>
|
</listbox>
|
||||||
</window>
|
</window>
|
||||||
|
|
Loading…
Reference in New Issue