git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@21105 d1611594-4594-4d17-8e1d-87c2c4800839
parent
1b9bf8f414
commit
632cf7de02
|
@ -12,20 +12,19 @@ import org.springframework.stereotype.Controller;
|
||||||
import org.zkoss.zhtml.Filedownload;
|
import org.zkoss.zhtml.Filedownload;
|
||||||
import org.zkoss.zk.ui.Component;
|
import org.zkoss.zk.ui.Component;
|
||||||
import org.zkoss.zk.ui.event.Event;
|
import org.zkoss.zk.ui.event.Event;
|
||||||
|
import org.zkoss.zk.ui.event.InputEvent;
|
||||||
import org.zkoss.zul.Combobox;
|
import org.zkoss.zul.Combobox;
|
||||||
import org.zkoss.zul.Comboitem;
|
import org.zkoss.zul.Comboitem;
|
||||||
import org.zkoss.zul.Intbox;
|
import org.zkoss.zul.Intbox;
|
||||||
import org.zkoss.zul.Listcell;
|
|
||||||
import org.zkoss.zul.Listitem;
|
|
||||||
import org.zkoss.zul.ListitemRenderer;
|
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.vo.configuracioneccomerciales.ConfigCoordenadas;
|
||||||
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.RenderConfigLayoutImpressaoBoleto;
|
||||||
|
|
||||||
@Controller("configLayoutImpressaoBoletoController")
|
@Controller("configLayoutImpressaoBoletoController")
|
||||||
@Scope("prototype")
|
@Scope("prototype")
|
||||||
public class ConfigLayoutImpressaoBoletoController extends MyGenericForwardComposer
|
public class ConfigLayoutImpressaoBoletoController extends MyGenericForwardComposer {
|
||||||
implements ListitemRenderer {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
private MyListbox campoCoordenadasList;
|
private MyListbox campoCoordenadasList;
|
||||||
|
@ -33,13 +32,20 @@ public class ConfigLayoutImpressaoBoletoController extends MyGenericForwardCompo
|
||||||
private Intbox txtLinha;
|
private Intbox txtLinha;
|
||||||
private Intbox txtColuna;
|
private Intbox txtColuna;
|
||||||
private List<ConfigCoordenadas> lsConfigCoordenadas;
|
private List<ConfigCoordenadas> lsConfigCoordenadas;
|
||||||
|
private Integer linha;
|
||||||
|
private Integer coluna;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
|
linha = 0;
|
||||||
|
coluna = 0;
|
||||||
|
txtLinha.setValue(linha);
|
||||||
|
txtColuna.setValue(coluna);
|
||||||
|
|
||||||
lsConfigCoordenadas = new ArrayList<ConfigCoordenadas>();
|
lsConfigCoordenadas = new ArrayList<ConfigCoordenadas>();
|
||||||
|
|
||||||
campoCoordenadasList.setItemRenderer(this);
|
campoCoordenadasList.setItemRenderer(new RenderConfigLayoutImpressaoBoleto());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$btnSalvar(Event ev) throws IOException {
|
public void onClick$btnSalvar(Event ev) throws IOException {
|
||||||
|
@ -99,96 +105,21 @@ public class ConfigLayoutImpressaoBoletoController extends MyGenericForwardCompo
|
||||||
campoCoordenadasList.setData(lsConfigCoordenadas);
|
campoCoordenadasList.setData(lsConfigCoordenadas);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void onChanging$txtLayout(InputEvent ev) {
|
||||||
public void render(Listitem lstm, Object o) throws Exception {
|
if (ev.getValue().endsWith("\n")) {
|
||||||
ConfigCoordenadas configCoordenadas = (ConfigCoordenadas) o;
|
linha = linha + 1;
|
||||||
|
txtLinha.setValue(linha);
|
||||||
|
|
||||||
Listcell lc = new Listcell();
|
coluna = 0;
|
||||||
|
} else if (ev.getValue().endsWith(" ")) {
|
||||||
|
coluna = coluna + 1;
|
||||||
|
} else {
|
||||||
|
linha = 0;
|
||||||
|
coluna = 0;
|
||||||
|
|
||||||
lc = new Listcell(configCoordenadas.getLbCampo());
|
txtLinha.setValue(linha);
|
||||||
lc.setParent(lstm);
|
|
||||||
|
|
||||||
lc = new Listcell(configCoordenadas.getLinha().toString());
|
|
||||||
lc.setParent(lstm);
|
|
||||||
|
|
||||||
lc = new Listcell(configCoordenadas.getColuna().toString());
|
|
||||||
lc.setParent(lstm);
|
|
||||||
|
|
||||||
lstm.setAttribute("data", configCoordenadas);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ConfigCoordenadas {
|
txtColuna.setValue(coluna);
|
||||||
private String lbCampo;
|
|
||||||
private String campo;
|
|
||||||
private Integer linha;
|
|
||||||
private Integer coluna;
|
|
||||||
|
|
||||||
public ConfigCoordenadas() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLbCampo() {
|
|
||||||
return lbCampo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLbCampo(String lbCampo) {
|
|
||||||
this.lbCampo = lbCampo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCampo() {
|
|
||||||
return campo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCampo(String campo) {
|
|
||||||
this.campo = campo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getLinha() {
|
|
||||||
return linha;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLinha(Integer linha) {
|
|
||||||
this.linha = linha;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getColuna() {
|
|
||||||
return coluna;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setColuna(Integer coluna) {
|
|
||||||
this.coluna = coluna;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
final int prime = 31;
|
|
||||||
int result = 1;
|
|
||||||
result = prime * result + getOuterType().hashCode();
|
|
||||||
result = prime * result + ((campo == null) ? 0 : campo.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object obj) {
|
|
||||||
if (this == obj)
|
|
||||||
return true;
|
|
||||||
if (obj == null)
|
|
||||||
return false;
|
|
||||||
if (getClass() != obj.getClass())
|
|
||||||
return false;
|
|
||||||
ConfigCoordenadas other = (ConfigCoordenadas) obj;
|
|
||||||
if (!getOuterType().equals(other.getOuterType()))
|
|
||||||
return false;
|
|
||||||
if (campo == null) {
|
|
||||||
if (other.campo != null)
|
|
||||||
return false;
|
|
||||||
} else if (!campo.equals(other.campo))
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private ConfigLayoutImpressaoBoletoController getOuterType() {
|
|
||||||
return ConfigLayoutImpressaoBoletoController.this;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||||
|
|
||||||
|
import org.zkoss.zul.Listcell;
|
||||||
|
import org.zkoss.zul.Listitem;
|
||||||
|
import org.zkoss.zul.ListitemRenderer;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.vo.configuracioneccomerciales.ConfigCoordenadas;
|
||||||
|
|
||||||
|
public class RenderConfigLayoutImpressaoBoleto implements ListitemRenderer {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void render(Listitem lstm, Object o) throws Exception {
|
||||||
|
ConfigCoordenadas configCoordenadas = (ConfigCoordenadas) o;
|
||||||
|
|
||||||
|
Listcell lc = new Listcell();
|
||||||
|
|
||||||
|
lc = new Listcell(configCoordenadas.getLbCampo());
|
||||||
|
lc.setParent(lstm);
|
||||||
|
|
||||||
|
lc = new Listcell(configCoordenadas.getLinha().toString());
|
||||||
|
lc.setParent(lstm);
|
||||||
|
|
||||||
|
lc = new Listcell(configCoordenadas.getColuna().toString());
|
||||||
|
lc.setParent(lstm);
|
||||||
|
|
||||||
|
lstm.setAttribute("data", configCoordenadas);
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,7 +8,7 @@
|
||||||
<window id="winConfigLayoutImpressaoBoleto"
|
<window id="winConfigLayoutImpressaoBoleto"
|
||||||
title="Config Layout Impressão Boleto"
|
title="Config Layout Impressão Boleto"
|
||||||
apply="${configLayoutImpressaoBoletoController}"
|
apply="${configLayoutImpressaoBoletoController}"
|
||||||
contentStyle="overflow:auto" height="400px" width="400px"
|
contentStyle="overflow:auto" height="470px" width="800px"
|
||||||
border="normal">
|
border="normal">
|
||||||
<toolbar>
|
<toolbar>
|
||||||
<button id="btnSalvar" image="/gui/img/save.png"
|
<button id="btnSalvar" image="/gui/img/save.png"
|
||||||
|
@ -18,6 +18,19 @@
|
||||||
image="/gui/img/exit.png" width="35px" />
|
image="/gui/img/exit.png" width="35px" />
|
||||||
</toolbar>
|
</toolbar>
|
||||||
|
|
||||||
|
<hbox>
|
||||||
|
<grid fixedLayout="true">
|
||||||
|
<rows>
|
||||||
|
<row spans="2">
|
||||||
|
<label value="Layout" />
|
||||||
|
</row>
|
||||||
|
<row spans="2" align="center">
|
||||||
|
<textbox id="txtLayout" rows="23" cols="60" />
|
||||||
|
</row>
|
||||||
|
</rows>
|
||||||
|
</grid>
|
||||||
|
|
||||||
|
<vbox>
|
||||||
<grid fixedLayout="true">
|
<grid fixedLayout="true">
|
||||||
<columns>
|
<columns>
|
||||||
<column width="30%" />
|
<column width="30%" />
|
||||||
|
@ -28,23 +41,32 @@
|
||||||
<label value="Campo" />
|
<label value="Campo" />
|
||||||
<combobox id="cmbCampo">
|
<combobox id="cmbCampo">
|
||||||
<comboitem value="getOrigen" label="De" />
|
<comboitem value="getOrigen" label="De" />
|
||||||
<comboitem value="getDestino" label="Para" />
|
<comboitem value="getDestino"
|
||||||
|
label="Para" />
|
||||||
<comboitem value="getFolio"
|
<comboitem value="getFolio"
|
||||||
label="Número Bilhete" />
|
label="Número Bilhete" />
|
||||||
<comboitem value="getFecha" label="Data Viagem" />
|
<comboitem value="getFecha"
|
||||||
<comboitem value="getHora" label="Hora Viagem" />
|
label="Data Viagem" />
|
||||||
<comboitem value="getAsiento" label="Poltrona" />
|
<comboitem value="getHora"
|
||||||
<comboitem value="getAnden" label="Plataforma" />
|
label="Hora Viagem" />
|
||||||
<comboitem value="getPrecio" label="Tarifa" />
|
<comboitem value="getAsiento"
|
||||||
|
label="Poltrona" />
|
||||||
|
<comboitem value="getAnden"
|
||||||
|
label="Plataforma" />
|
||||||
|
<comboitem value="getPrecio"
|
||||||
|
label="Tarifa" />
|
||||||
<!-- <comboitem value="precio" label="Seguro" /> -->
|
<!-- <comboitem value="precio" label="Seguro" /> -->
|
||||||
<!-- <comboitem value="precio" label="Pedágio" /> -->
|
<!-- <comboitem value="precio" label="Pedágio" /> -->
|
||||||
<!-- <comboitem value="precio" label="Tarifa Embarque" /> -->
|
<!-- <comboitem value="precio" label="Tarifa Embarque" /> -->
|
||||||
<!-- <comboitem value="precio" label="Total" /> -->
|
<!-- <comboitem value="precio" label="Total" /> -->
|
||||||
<comboitem value="getFechaVenta"
|
<comboitem value="getFechaVenta"
|
||||||
label="Data Emissão" />
|
label="Data Emissão" />
|
||||||
<comboitem value="getEmpresa" label="Agência" />
|
<comboitem value="getEmpresa"
|
||||||
<comboitem value="getCveUsuario" label="Agente" />
|
label="Agência" />
|
||||||
<comboitem value="getCorrida" label="Serviço" />
|
<comboitem value="getCveUsuario"
|
||||||
|
label="Agente" />
|
||||||
|
<comboitem value="getCorrida"
|
||||||
|
label="Serviço" />
|
||||||
<!-- <comboitem value="corrida" label="Prefixo" /> -->
|
<!-- <comboitem value="corrida" label="Prefixo" /> -->
|
||||||
<!-- <comboitem value="LINHA" label="Linha" /> -->
|
<!-- <comboitem value="LINHA" label="Linha" /> -->
|
||||||
</combobox>
|
</combobox>
|
||||||
|
@ -61,8 +83,8 @@
|
||||||
</grid>
|
</grid>
|
||||||
|
|
||||||
<toolbar>
|
<toolbar>
|
||||||
<button id="btnAddCampoCoordenadas" image="/gui/img/add.png"
|
<button id="btnAddCampoCoordenadas"
|
||||||
width="35px" />
|
image="/gui/img/add.png" width="35px" />
|
||||||
<button id="btnRemoverCampoCoordenadas"
|
<button id="btnRemoverCampoCoordenadas"
|
||||||
image="/gui/img/remove.png" width="35px" />
|
image="/gui/img/remove.png" width="35px" />
|
||||||
</toolbar>
|
</toolbar>
|
||||||
|
@ -71,11 +93,15 @@
|
||||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||||
multiple="false">
|
multiple="false">
|
||||||
<listhead sizable="true">
|
<listhead sizable="true">
|
||||||
<listheader image="/gui/img/builder.gif" label="Campo" />
|
<listheader image="/gui/img/builder.gif"
|
||||||
<listheader image="/gui/img/builder.gif" label="Linha" />
|
label="Campo" />
|
||||||
|
<listheader image="/gui/img/builder.gif"
|
||||||
|
label="Linha" />
|
||||||
<listheader image="/gui/img/create_doc.gif"
|
<listheader image="/gui/img/create_doc.gif"
|
||||||
label="Coluna" />
|
label="Coluna" />
|
||||||
</listhead>
|
</listhead>
|
||||||
</listbox>
|
</listbox>
|
||||||
|
</vbox>
|
||||||
|
</hbox>
|
||||||
</window>
|
</window>
|
||||||
</zk>
|
</zk>
|
Loading…
Reference in New Issue