fixes bug#14606
dev:lucas qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@94468 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
8951fd7b0d
commit
08d4ccef8c
|
@ -33,6 +33,7 @@ import com.rjconsultores.ventaboletos.entidad.Marca;
|
|||
import com.rjconsultores.ventaboletos.entidad.OperadorEmbarcada;
|
||||
import com.rjconsultores.ventaboletos.entidad.OperadorEmbarcadaLinha;
|
||||
import com.rjconsultores.ventaboletos.entidad.OperadorEmbarcadaServico;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||
import com.rjconsultores.ventaboletos.entidad.RutaEmpresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.Usuario;
|
||||
|
@ -40,6 +41,7 @@ import com.rjconsultores.ventaboletos.service.ClaseServicioService;
|
|||
import com.rjconsultores.ventaboletos.service.MarcaService;
|
||||
import com.rjconsultores.ventaboletos.service.OperadorEmbarcadaService;
|
||||
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;
|
||||
|
@ -48,6 +50,7 @@ import com.rjconsultores.ventaboletos.web.utilerias.render.ItemRenderRutaOperado
|
|||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfiguracionCorrida;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRutasOperadorEmbarcada;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderSelecionarUsuario;
|
||||
import com.trg.search.Filter;
|
||||
|
||||
@Controller("editarOperadorEmbarcadaController")
|
||||
@Scope("prototype")
|
||||
|
@ -78,6 +81,7 @@ public class EditarOperadorEmbarcadaController extends MyGenericForwardComposer
|
|||
private Intbox txtNumeroServico;
|
||||
private Combobox cmbMarcaServicio;
|
||||
private Combobox cmbClaseServicioServico;
|
||||
private MyComboboxPuntoVenta cmbPuntoVenta;
|
||||
|
||||
private List<ItemRenderRutaOperadorEmbarcada> itensRutaList = new ArrayList<ItemRenderRutaOperadorEmbarcada>();
|
||||
private List<EsquemaCorrida> servicosSelecionados = new ArrayList<EsquemaCorrida>();
|
||||
|
@ -118,6 +122,7 @@ public class EditarOperadorEmbarcadaController extends MyGenericForwardComposer
|
|||
private transient PagedListWrapper<EsquemaCorrida> plwEsquemaCorrida;
|
||||
|
||||
private Button btnPesquisaUsuario;
|
||||
private Button btnApagar;
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
|
@ -138,6 +143,10 @@ public class EditarOperadorEmbarcadaController extends MyGenericForwardComposer
|
|||
|
||||
operadorEdicao = (OperadorEmbarcada) Executions.getCurrent().getArg().get("Operador");
|
||||
|
||||
if (operadorEdicao.getUsuario() == null) {
|
||||
btnApagar.setVisible(false);
|
||||
}
|
||||
|
||||
usuarioList.setItemRenderer( new RenderSelecionarUsuario());
|
||||
usuarioList.setMultiple(true);
|
||||
|
||||
|
@ -190,6 +199,14 @@ public class EditarOperadorEmbarcadaController extends MyGenericForwardComposer
|
|||
sistemaBusqueda.addFilterLike("claveUsuario", "%" + cveUsuario.trim().concat("%"));
|
||||
}
|
||||
|
||||
Comboitem puntoVentaSeleccionada = cmbPuntoVenta.getSelectedItem();
|
||||
|
||||
if (puntoVentaSeleccionada != null) {
|
||||
PuntoVenta puntoVenta = (PuntoVenta) puntoVentaSeleccionada.getValue();
|
||||
sistemaBusqueda.addFilterSome("usuarioUbicacionList", Filter.and(Filter.equal("puntoVenta", puntoVenta),
|
||||
Filter.equal("activo", Boolean.TRUE)));
|
||||
}
|
||||
|
||||
sistemaBusqueda.addSortAsc("claveUsuario");
|
||||
sistemaBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
||||
|
||||
|
@ -261,10 +278,19 @@ public class EditarOperadorEmbarcadaController extends MyGenericForwardComposer
|
|||
}
|
||||
|
||||
private void separarRutasRenderer(List<Ruta> rutasList, boolean selecionadas) {
|
||||
|
||||
// if (!linhaList.getItensSelecionados(ItemRenderRutaOperadorEmbarcada.class).isEmpty()) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// itensRutaList.clear();
|
||||
for(Ruta r : rutasList) {
|
||||
List<RutaEmpresa> listRutaEmpresa = rutaEmpresaDAO.obtenerPorRuta(r);
|
||||
|
||||
// itensRutaList.add(new ItemRenderRutaOperadorEmbarcada(r.getNumRuta(), r.getDescruta(), r.getClaseServicio().getDescclase(), r.getPrefixo(), listRutaEmpresa, r));
|
||||
|
||||
if(itensRutaList.isEmpty()) {
|
||||
itensRutaList.add(new ItemRenderRutaOperadorEmbarcada(r.getDescruta(), r.getClaseServicio().getDescclase(), r.getPrefixo(), listRutaEmpresa, r));
|
||||
itensRutaList.add(new ItemRenderRutaOperadorEmbarcada(r.getNumRuta(), r.getDescruta(), r.getClaseServicio().getDescclase(), r.getPrefixo(), listRutaEmpresa, r));
|
||||
} else {
|
||||
boolean adicionou = false;
|
||||
for(int i = 0 ; i < itensRutaList.size(); i++) {
|
||||
|
@ -284,11 +310,12 @@ public class EditarOperadorEmbarcadaController extends MyGenericForwardComposer
|
|||
}
|
||||
|
||||
if(!adicionou) {
|
||||
itensRutaList.add(new ItemRenderRutaOperadorEmbarcada(r.getDescruta(), r.getClaseServicio().getDescclase(), r.getPrefixo(), listRutaEmpresa, r));
|
||||
itensRutaList.add(new ItemRenderRutaOperadorEmbarcada(r.getNumRuta(), r.getDescruta(), r.getClaseServicio().getDescclase(), r.getPrefixo(), listRutaEmpresa, r));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// itemRutaSelecionados = linhaList.getItensSelecionados(ItemRenderRutaOperadorEmbarcada.class);
|
||||
if(selecionadas) {
|
||||
itemRutaSelecionados = itensRutaList;
|
||||
}
|
||||
|
@ -373,7 +400,7 @@ public class EditarOperadorEmbarcadaController extends MyGenericForwardComposer
|
|||
}
|
||||
|
||||
public void onSelect$linhaList(SelectEvent event) {
|
||||
if (event.getReference().getClass() == Listitem.class) {
|
||||
if (event != null && event.getReference() != null && event.getReference().getClass() == Listitem.class) {
|
||||
event.stopPropagation();
|
||||
Listitem item = (Listitem)event.getReference();
|
||||
ItemRenderRutaOperadorEmbarcada itemRuta = (ItemRenderRutaOperadorEmbarcada)linhaList.getListData().get(item.getIndex());
|
||||
|
@ -434,7 +461,7 @@ public class EditarOperadorEmbarcadaController extends MyGenericForwardComposer
|
|||
}
|
||||
|
||||
for(Usuario us : usuariosSelecionados) {
|
||||
OperadorEmbarcada operador = new OperadorEmbarcada();
|
||||
OperadorEmbarcada operador = operadorService.buscarOperadorEmbarcadaPorUsuario(us.getUsuarioId());
|
||||
|
||||
if(operadorEdicao != null && operadorEdicao.getUsuario() != null && us.getUsuarioId() == operadorEdicao.getUsuario().getUsuarioId()) {
|
||||
operador = operadorEdicao;
|
||||
|
@ -444,6 +471,11 @@ public class EditarOperadorEmbarcadaController extends MyGenericForwardComposer
|
|||
operador.setFecmodif(new Date());
|
||||
operador.setUsuario(us);
|
||||
|
||||
List<ItemRenderRutaOperadorEmbarcada> selected = linhaList.getItensSelecionados(ItemRenderRutaOperadorEmbarcada.class);
|
||||
if (selected != null && !selected.isEmpty()) {
|
||||
itemRutaSelecionados = selected;
|
||||
}
|
||||
|
||||
//Separa todas as rutas selecionadas
|
||||
List<Ruta> rutasSelecionadas = new ArrayList<Ruta>();
|
||||
for(ItemRenderRutaOperadorEmbarcada r :itemRutaSelecionados) {
|
||||
|
@ -520,6 +552,7 @@ public class EditarOperadorEmbarcadaController extends MyGenericForwardComposer
|
|||
}
|
||||
|
||||
public void onClick$btnPesquisaLinha(Event ev) {
|
||||
itensRutaList.clear();
|
||||
refreshListaLinha();
|
||||
}
|
||||
|
||||
|
@ -731,4 +764,13 @@ public class EditarOperadorEmbarcadaController extends MyGenericForwardComposer
|
|||
public void setEsquemaCorridaList(MyListbox esquemaCorridaList) {
|
||||
this.esquemaCorridaList = esquemaCorridaList;
|
||||
}
|
||||
|
||||
public MyComboboxPuntoVenta getCmbPuntoVenta() {
|
||||
return cmbPuntoVenta;
|
||||
}
|
||||
|
||||
public void setCmbPuntoVenta(MyComboboxPuntoVenta cmbPuntoVenta) {
|
||||
this.cmbPuntoVenta = cmbPuntoVenta;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,12 +15,14 @@ public class ItemRenderRutaOperadorEmbarcada implements Serializable {
|
|||
private String classe;
|
||||
private String prefixo;
|
||||
private String empresa;
|
||||
private String numRuta;
|
||||
|
||||
public ItemRenderRutaOperadorEmbarcada(String descricao, String classe, String prefixo, List<RutaEmpresa> empresas, Ruta ruta) {
|
||||
public ItemRenderRutaOperadorEmbarcada(String numRuta, String descricao, String classe, String prefixo, List<RutaEmpresa> empresas, Ruta ruta) {
|
||||
super();
|
||||
this.descricao = descricao;
|
||||
this.classe = classe;
|
||||
this.prefixo = prefixo;
|
||||
this.numRuta = numRuta;
|
||||
|
||||
this.empresa = "";
|
||||
int i = 0;
|
||||
|
@ -78,4 +80,12 @@ public class ItemRenderRutaOperadorEmbarcada implements Serializable {
|
|||
public void setListaRutas(List<Ruta> listaRutas) {
|
||||
this.listaRutas = listaRutas;
|
||||
}
|
||||
|
||||
public String getNumRuta() {
|
||||
return numRuta;
|
||||
}
|
||||
|
||||
public void setNumRuta(String numRuta) {
|
||||
this.numRuta = numRuta;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,10 +13,10 @@ public class RenderRutasOperadorEmbarcada implements ListitemRenderer {
|
|||
Listcell lc = new Listcell(ruta.getDescricao());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(ruta.getClasse());
|
||||
lc = new Listcell(ruta.getNumRuta());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(ruta.getPrefixo());
|
||||
lc = new Listcell(ruta.getClasse());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(ruta.getEmpresa());
|
||||
|
|
|
@ -60,16 +60,16 @@
|
|||
<listhead sizable="true">
|
||||
<listheader image="/gui/img/create_doc.gif"
|
||||
label="${c:l('busquedaOperadorEmbarcada.tabela.id')}" width="10%"
|
||||
sort="auto(usuarioId)"/>
|
||||
sort="auto(operadorEmbarcadaId)"/>
|
||||
<listheader image="/gui/img/create_doc.gif" width="20%"
|
||||
label="${c:l('busquedaOperadorEmbarcada.tabela.login')}"
|
||||
sort="auto(claveUsuario)"/>
|
||||
sort="auto(usuario.claveUsuario)"/>
|
||||
<listheader image="/gui/img/create_doc.gif"
|
||||
label="${c:l('busquedaOperadorEmbarcada.tabela.nome')}"
|
||||
sort="auto(empleado.cveEmpleado)"/>
|
||||
sort="auto(usuario.empleado.cveEmpleado)"/>
|
||||
<listheader image="/gui/img/create_doc.gif"
|
||||
label="${c:l('busquedaOperadorEmbarcada.tabela.puntoVenta')}" width="30%"
|
||||
sort="auto(nombusuario)"/>
|
||||
/>
|
||||
</listhead>
|
||||
</listbox>
|
||||
<paging id="pagingOperadores" pageSize="20" />
|
||||
|
|
|
@ -38,11 +38,12 @@
|
|||
<tabpanel id="tbUsuario" width="100%" height="395px">
|
||||
<grid fixedLayout="true" >
|
||||
<columns>
|
||||
<column width="7%" />
|
||||
<column width="2%" />
|
||||
<column width="8%" />
|
||||
<column width="5%" />
|
||||
<column width="20%" />
|
||||
<column width="10%" />
|
||||
<column />
|
||||
<column width="15%" />
|
||||
<column width="40%" />
|
||||
</columns>
|
||||
|
||||
<rows>
|
||||
|
@ -53,6 +54,13 @@
|
|||
<label value="${c:l('editarOperadorEmbarcada.login')}" />
|
||||
<textbox id="txtLogin" use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" width="97%" />
|
||||
|
||||
<label value="${c:l('busquedaOperadorEmbarcada.pontoVenda.label')}" />
|
||||
|
||||
<combobox id="cmbPuntoVenta"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta"
|
||||
mold="rounded" buttonVisible="true" width="90%"
|
||||
/>
|
||||
|
||||
<button id="btnPesquisaUsuario" image="/gui/img/find.png" label="${c:l('busquedaOperadorEmbarcada.btnPesquisa.label')}" width="95%"/>
|
||||
</row>
|
||||
</rows>
|
||||
|
@ -66,11 +74,11 @@
|
|||
|
||||
<listheader image="/gui/img/create_doc.gif" label="${c:l('busquedaOperadorEmbarcada.tabela.nome')}" sort="auto(nombusuario)" />
|
||||
|
||||
<listheader image="/gui/img/create_doc.gif" label="${c:l('busquedaOperadorEmbarcada.tabela.puntoVenta')}" width="30%" sort="auto(usuarioUbicacionList.puntoVenta.nombpuntoventa)" />
|
||||
<listheader image="/gui/img/create_doc.gif" label="${c:l('busquedaOperadorEmbarcada.tabela.puntoVenta')}" width="30%" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
|
||||
<paging id="pagingUsuario" pageSize="10000" />
|
||||
<paging id="pagingUsuario" pageSize="20" />
|
||||
|
||||
</tabpanel>
|
||||
|
||||
|
@ -120,13 +128,14 @@
|
|||
</rows>
|
||||
</grid>
|
||||
|
||||
<listbox mold="paging" pageSize="10000" id="linhaList" use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox" multiple="true" checkmark="true" width="100%" height="315px">
|
||||
<listbox mold="paging" pageSize="50" id="linhaList" use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox" multiple="true" checkmark="true" width="100%" height="315px">
|
||||
<listhead sizable="true">
|
||||
|
||||
<listheader image="/gui/img/create_doc.gif" label="${c:l('busquedaOperadorEmbarcada.tabela.descricao')}" sort="auto(descricao)" />
|
||||
|
||||
<listheader image="/gui/img/create_doc.gif" label="${c:l('busquedaOperadorEmbarcada.tabela.classe')}" width="15%" sort="auto(classe)" />
|
||||
<listheader image="/gui/img/create_doc.gif" label="${c:l('busquedaConfiguracionCorridaController.numRuta.label')}" width="15%" sort="auto(numRuta)" />
|
||||
|
||||
<listheader image="/gui/img/create_doc.gif" label="${c:l('busquedaOperadorEmbarcada.tabela.prefixo')}" width="15%" sort="auto(prefixo)" />
|
||||
<listheader image="/gui/img/create_doc.gif" label="${c:l('busquedaOperadorEmbarcada.tabela.classe')}" width="15%" sort="auto(classe)" />
|
||||
|
||||
<listheader image="/gui/img/create_doc.gif" label="${c:l('busquedaOperadorEmbarcada.tabela.empresa')}" width="15%" sort="auto(empresa)" />
|
||||
</listhead>
|
||||
|
@ -238,7 +247,7 @@
|
|||
sort="auto(statusCorrida)" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
<paging id="pagingEsquemaCorrida" pageSize="10000" />
|
||||
<paging id="pagingEsquemaCorrida" pageSize="50" />
|
||||
</tabpanel>
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
|
|
Loading…
Reference in New Issue