Resumo 0004878: Tela de Busca de Usuario - Adicionar novos filtros
Descrição Adicionar os filtros de Empresa e Agência nos cadastro de usuário git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@33489 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
14d80dda7d
commit
3f186fbbb5
|
@ -3,6 +3,7 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -20,9 +21,13 @@ import org.zkoss.zul.Comboitem;
|
|||
import org.zkoss.zul.Paging;
|
||||
import org.zkoss.zul.Textbox;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.Perfil;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.entidad.Usuario;
|
||||
import com.rjconsultores.ventaboletos.service.PerfilService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
|
||||
|
@ -52,6 +57,12 @@ public class BusquedaUsuarioController extends MyGenericForwardComposer {
|
|||
private Textbox txtCveEmpleado;
|
||||
private Combobox cmbPerfil;
|
||||
|
||||
private Combobox cmbEmpresa;
|
||||
private List<Empresa> lsEmpresas;
|
||||
|
||||
private List<PuntoVenta> lsPuntoVenta;
|
||||
private MyComboboxPuntoVenta cmbPuntoVenta;
|
||||
|
||||
public Textbox getTxtCveUsuario() {
|
||||
return txtCveUsuario;
|
||||
}
|
||||
|
@ -129,6 +140,9 @@ public class BusquedaUsuarioController extends MyGenericForwardComposer {
|
|||
public void doAfterCompose(Component comp) throws Exception {
|
||||
lsPerfil = perfilService.obtenerTodos();
|
||||
|
||||
lsEmpresas = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
||||
setLsPuntoVenta(new ArrayList<PuntoVenta>());
|
||||
|
||||
super.doAfterCompose(comp);
|
||||
|
||||
usuarioList.setItemRenderer(new RenderUsuario());
|
||||
|
@ -200,10 +214,33 @@ public class BusquedaUsuarioController extends MyGenericForwardComposer {
|
|||
Filter.and(Filter.equal("perfil", perfil),
|
||||
Filter.equal("activo", true)));
|
||||
}
|
||||
|
||||
|
||||
Filter filterEmpresas = Filter.in("empresa", lsEmpresas);
|
||||
|
||||
Comboitem itemEmpresa = cmbEmpresa.getSelectedItem();
|
||||
if (itemEmpresa != null) {
|
||||
Empresa empresa = (Empresa) itemEmpresa.getValue();
|
||||
filterEmpresas = Filter.equal("empresa", empresa);
|
||||
}
|
||||
|
||||
sistemaBusqueda.addFilterSome("usuarioEmpresaList",
|
||||
Filter.and(filterEmpresas,
|
||||
Filter.equal("activo", true)));
|
||||
|
||||
|
||||
Comboitem puntoVentaSeleccionada = cmbPuntoVenta.getSelectedItem();
|
||||
|
||||
if(puntoVentaSeleccionada != null){
|
||||
PuntoVenta puntoVenta = (PuntoVenta)puntoVentaSeleccionada.getValue();
|
||||
sistemaBusqueda.addFilterSome("usuarioUbicacionList",
|
||||
Filter.and(Filter.equal("puntoVenta", puntoVenta),
|
||||
Filter.equal("activo", true)));
|
||||
}
|
||||
|
||||
|
||||
sistemaBusqueda.addSortAsc("claveUsuario");
|
||||
sistemaBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
||||
|
||||
|
||||
plwFormaPago.init(sistemaBusqueda, usuarioList, pagingUsuario);
|
||||
|
||||
if (usuarioList.getData().length == 0) {
|
||||
|
@ -227,4 +264,36 @@ public class BusquedaUsuarioController extends MyGenericForwardComposer {
|
|||
public void onClick$btnNovo(Event ev) {
|
||||
verUsuario(new Usuario());
|
||||
}
|
||||
|
||||
public List<PuntoVenta> getLsPuntoVenta() {
|
||||
return lsPuntoVenta;
|
||||
}
|
||||
|
||||
public void setLsPuntoVenta(List<PuntoVenta> lsPuntoVenta) {
|
||||
this.lsPuntoVenta = lsPuntoVenta;
|
||||
}
|
||||
|
||||
public Combobox getCmbEmpresa() {
|
||||
return cmbEmpresa;
|
||||
}
|
||||
|
||||
public void setCmbEmpresa(Combobox cmbEmpresa) {
|
||||
this.cmbEmpresa = cmbEmpresa;
|
||||
}
|
||||
|
||||
public List<Empresa> getLsEmpresas() {
|
||||
return lsEmpresas;
|
||||
}
|
||||
|
||||
public void setLsEmpresas(List<Empresa> lsEmpresas) {
|
||||
this.lsEmpresas = lsEmpresas;
|
||||
}
|
||||
|
||||
public MyComboboxPuntoVenta getCmbPuntoVenta() {
|
||||
return cmbPuntoVenta;
|
||||
}
|
||||
|
||||
public void setCmbPuntoVenta(MyComboboxPuntoVenta cmbPuntoVenta) {
|
||||
this.cmbPuntoVenta = cmbPuntoVenta;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,8 +4,13 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Perfil;
|
||||
import com.rjconsultores.ventaboletos.entidad.Usuario;
|
||||
import com.rjconsultores.ventaboletos.entidad.UsuarioEmpresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.UsuarioUbicacion;
|
||||
|
||||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.ListitemRenderer;
|
||||
|
@ -46,6 +51,31 @@ public class RenderUsuario implements ListitemRenderer {
|
|||
}
|
||||
lc.setParent(lstm);
|
||||
}
|
||||
|
||||
List<UsuarioEmpresa> usuarioEmpresaList = usuario.getUsuarioEmpresaList();
|
||||
StringBuilder empresasBuilder = new StringBuilder();
|
||||
|
||||
if(!usuarioEmpresaList.isEmpty()){
|
||||
for(UsuarioEmpresa usuarioEmpresa : usuarioEmpresaList){
|
||||
empresasBuilder.append(usuarioEmpresa.getEmpresa().getNombempresa());
|
||||
empresasBuilder.append(" \\ ");
|
||||
}
|
||||
}
|
||||
|
||||
lc = new Listcell(empresasBuilder.toString());
|
||||
lc.setParent(lstm);
|
||||
|
||||
List<UsuarioUbicacion> usuarioUbicacionList = usuario.getUsuarioUbicacionList();
|
||||
StringBuilder ubicacionsBuilder = new StringBuilder();
|
||||
if(!usuarioUbicacionList.isEmpty()){
|
||||
for(UsuarioUbicacion usuarioUbicacion : usuarioUbicacionList){
|
||||
ubicacionsBuilder.append(usuarioUbicacion.getPuntoVenta().getNombpuntoventa());
|
||||
empresasBuilder.append(" \\ ");
|
||||
}
|
||||
}
|
||||
|
||||
lc = new Listcell(ubicacionsBuilder.toString());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lstm.setAttribute("data", usuario);
|
||||
}
|
||||
|
|
|
@ -2273,6 +2273,8 @@ busquedaUsuarioController.nombpaterno.label = Sobrenome Paterno
|
|||
busquedaUsuarioController.nombmaterno.label = Sobrenome Materno
|
||||
busquedaUsuarioController.perfil.label = Perfil
|
||||
busquedaUsuarioController.btnPesquisa.label = Pesquisa
|
||||
busquedaUsuarioController.empresa.label = Empresa
|
||||
busquedaUsuarioController.puntoventa.label = Ponto de Venda(Agência)
|
||||
|
||||
# Editar Usuário
|
||||
editarUsuarioController.window.title = Usuário
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||
<window id="winBusquedaUsuario" title="${c:l('busquedaUsuarioController.window.title')}"
|
||||
apply="${busquedaUsuarioController}" contentStyle="overflow:auto"
|
||||
height="450px" width="900px" border="normal" >
|
||||
height="500px" width="1200px" border="normal" >
|
||||
|
||||
<toolbar>
|
||||
<button id="btnRefresh" image="/gui/img/refresh.png" width="35px"
|
||||
|
@ -49,6 +49,20 @@
|
|||
<label value="${c:l('busquedaUsuarioController.nombmaterno.label')}" width="90%"/>
|
||||
<textbox id="txtNombMaterno" width="90%" use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" maxlength="20"/>
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('busquedaUsuarioController.empresa.label')}" />
|
||||
<combobox id="cmbEmpresa"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
width="70%" mold="rounded" buttonVisible="true"
|
||||
model="@{winBusquedaUsuario$composer.lsEmpresas}"/>
|
||||
<label
|
||||
value="${c:l('busquedaUsuarioController.puntoventa.label')}" />
|
||||
<combobox id="cmbPuntoVenta"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta"
|
||||
width="70%" mold="rounded" buttonVisible="true"
|
||||
model="@{winBusquedaUsuario$composer.lsPuntoVenta}"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
|
@ -59,7 +73,7 @@
|
|||
|
||||
<paging id="pagingUsuario" pageSize="20" />
|
||||
<listbox id="usuarioList" use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
multiple="false">
|
||||
multiple="false" width="1180px">
|
||||
<listhead sizable="true">
|
||||
<listheader image="/gui/img/create_doc.gif"
|
||||
label="${c:l('busquedaUsuarioController.lhId.label')}" width="50px"
|
||||
|
@ -80,8 +94,12 @@
|
|||
label="${c:l('busquedaUsuarioController.nombmaterno.label')}"
|
||||
sort="auto(nombmaterno)"/>
|
||||
<listheader image="/gui/img/create_doc.gif"
|
||||
label="${c:l('busquedaUsuarioController.perfil.label')}"
|
||||
/>
|
||||
label="${c:l('busquedaUsuarioController.perfil.label')}"/>
|
||||
<listheader image="/gui/img/create_doc.gif"
|
||||
label="${c:l('busquedaUsuarioController.empresa.label')}"/>
|
||||
<listheader image="/gui/img/create_doc.gif"
|
||||
label="${c:l('busquedaUsuarioController.puntoventa.label')}"/>
|
||||
|
||||
</listhead>
|
||||
</listbox>
|
||||
</window>
|
||||
|
|
Loading…
Reference in New Issue