0010918: ESPEC01- Restrição Venda Internet por Valor
fixes bug#0010918 dev:Leo qua:Wally git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@85919 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
ef628e534d
commit
dbbbe3568b
|
@ -0,0 +1,151 @@
|
|||
package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.zkoss.util.resource.Labels;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zul.Combobox;
|
||||
import org.zkoss.zul.Messagebox;
|
||||
import org.zkoss.zul.Textbox;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.ConfRestricaoVendaWeb;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.service.ConfRestricaoVendaWebService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfRestricaoVendaWeb;
|
||||
|
||||
@Controller("confRestricaoCanalVentaEmpValMinController")
|
||||
@Scope("prototype")
|
||||
public class ConfRestricaoCanalVentaEmpValMinController extends MyGenericForwardComposer {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private List<Empresa> lsEmpresa;
|
||||
private Textbox txtValorMinimo;
|
||||
private Combobox cmbEmpresaVendaWeb;
|
||||
private Empresa empresa;
|
||||
private List<ConfRestricaoVendaWeb> lsConfRestricaoVendaWeb;
|
||||
private MyListbox confRestricaoVendaWebDataList;
|
||||
|
||||
@Autowired
|
||||
private ConfRestricaoVendaWebService confRestricaoVendaWebService;
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
|
||||
lsEmpresa = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
||||
super.doAfterCompose(comp);
|
||||
confRestricaoVendaWebDataList.setItemRenderer(new RenderConfRestricaoVendaWeb());
|
||||
|
||||
lsConfRestricaoVendaWeb = confRestricaoVendaWebService.obtenerTodos();
|
||||
confRestricaoVendaWebDataList.setData(lsConfRestricaoVendaWeb);
|
||||
|
||||
}
|
||||
|
||||
public void onClick$btnAddRestricaoVendaWeb(Event ev) throws InterruptedException {
|
||||
String valorMinimo = txtValorMinimo.getValue();
|
||||
if (valorMinimo != null && !valorMinimo.equals("")) {
|
||||
ConfRestricaoVendaWeb confRestricaoVendaWeb = new ConfRestricaoVendaWeb();
|
||||
confRestricaoVendaWeb.setActivo(Boolean.TRUE);
|
||||
confRestricaoVendaWeb.setFecmodif(Calendar.getInstance().getTime());
|
||||
confRestricaoVendaWeb.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
confRestricaoVendaWeb.setValor(new Double(valorMinimo.replace(',', '.')));
|
||||
confRestricaoVendaWeb.setEmpresa(empresa);
|
||||
|
||||
|
||||
ConfRestricaoVendaWeb remover = new ConfRestricaoVendaWeb();
|
||||
for(ConfRestricaoVendaWeb c : lsConfRestricaoVendaWeb ){
|
||||
if(c.getEmpresa().getNombempresa().equals(confRestricaoVendaWeb.getEmpresa().getNombempresa())){
|
||||
remover = c;
|
||||
}
|
||||
}
|
||||
if(remover.getEmpresa() != null){
|
||||
if(remover.getEmpresa().getEmpresaId()!= null){
|
||||
confRestricaoVendaWebService.borrar(remover);
|
||||
}
|
||||
lsConfRestricaoVendaWeb.remove(remover);
|
||||
}
|
||||
lsConfRestricaoVendaWeb.add(confRestricaoVendaWeb);
|
||||
confRestricaoVendaWebDataList.setData(lsConfRestricaoVendaWeb);
|
||||
} else {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarConfRestricaoCanalVentaController.MSG.informeValor"),
|
||||
Labels.getLabel("editarConfRestricaoCanalVentaController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
}
|
||||
}
|
||||
|
||||
public void onClick$btnRemoveRestricaoVendaWeb(Event ev) throws InterruptedException {
|
||||
ConfRestricaoVendaWeb rVendaWeb = (ConfRestricaoVendaWeb) confRestricaoVendaWebDataList.getSelected();
|
||||
if (rVendaWeb != null) {
|
||||
//Para evitar erro na hora de excluir registros da lista de um registro copiado
|
||||
if(rVendaWeb.getConfRestricaoVendaWebId() != null) {
|
||||
confRestricaoVendaWebService.borrar(rVendaWeb);
|
||||
}
|
||||
lsConfRestricaoVendaWeb.remove(rVendaWeb);
|
||||
confRestricaoVendaWebDataList.setData(lsConfRestricaoVendaWeb);
|
||||
} else {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarConfRestricaoCanalVentaController.MSG.selecionarrestricaoVendaWeb"),
|
||||
Labels.getLabel("editarConfRestricaoCanalVentaController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
}
|
||||
}
|
||||
|
||||
public void onClick$btnSalvar2(Event ev) throws InterruptedException {
|
||||
|
||||
if(!lsConfRestricaoVendaWeb.isEmpty()){
|
||||
for(ConfRestricaoVendaWeb c :lsConfRestricaoVendaWeb){
|
||||
if(c.getConfRestricaoVendaWebId()== null){
|
||||
confRestricaoVendaWebService.suscribir(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarConfRestricaoCanalVentaController.MSG.suscribirOK"),
|
||||
Labels.getLabel("editarConfRestricaoCanalVentaController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
closeWindow();
|
||||
}
|
||||
|
||||
|
||||
public List<Empresa> getLsEmpresa() {
|
||||
return lsEmpresa;
|
||||
}
|
||||
|
||||
public void setLsEmpresa(List<Empresa> lsEmpresa) {
|
||||
this.lsEmpresa = lsEmpresa;
|
||||
}
|
||||
|
||||
public Textbox getTxtValorMinimo() {
|
||||
return txtValorMinimo;
|
||||
}
|
||||
|
||||
public void setTxtValorMinimo(Textbox txtValorMinimo) {
|
||||
this.txtValorMinimo = txtValorMinimo;
|
||||
}
|
||||
|
||||
public Combobox getCmbEmpresaVendaWeb() {
|
||||
return cmbEmpresaVendaWeb;
|
||||
}
|
||||
|
||||
public void setCmbEmpresaVendaWeb(Combobox cmbEmpresaVendaWeb) {
|
||||
this.cmbEmpresaVendaWeb = cmbEmpresaVendaWeb;
|
||||
}
|
||||
|
||||
public Empresa getEmpresa() {
|
||||
return empresa;
|
||||
}
|
||||
|
||||
public void setEmpresa(Empresa empresa) {
|
||||
this.empresa = empresa;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional;
|
||||
|
||||
import org.zkoss.util.resource.Labels;
|
||||
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
|
||||
|
||||
public class ItemMenuConfRestricaoCanalVentaEmpresaValorMinimo extends DefaultItemMenuSistema {
|
||||
|
||||
public ItemMenuConfRestricaoCanalVentaEmpresaValorMinimo() {
|
||||
super("indexController.mniConfRestricaoCanalVentaEmpValMin.label");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getClaveMenu() {
|
||||
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.CONFRESTRICAOCANALVENTAEMPRESAVALORMIN";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ejecutar() {
|
||||
PantallaUtileria.openWindow("/gui/esquema_operacional/confRestricaoCanalVentaEmpValMin.zul",
|
||||
Labels.getLabel("confRestricaoCanalVentaWebController.window.title"), getArgs() ,desktop);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional;
|
||||
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
|
||||
|
||||
public class SubMenuConfRestricaoCanalVenta extends DefaultItemMenuSistema {
|
||||
|
||||
public SubMenuConfRestricaoCanalVenta() {
|
||||
super("indexController.mniConfRestricaoCanalVenta.label");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getClaveMenu() {
|
||||
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.CONFRESTRICAOCANALVENTA";
|
||||
}
|
||||
|
||||
}
|
|
@ -84,7 +84,9 @@ esquemaOperacional.corrida=com.rjconsultores.ventaboletos.web.utilerias.menu.ite
|
|||
esquemaOperacional.paramConexion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuParamConexion
|
||||
esquemaOperacional.conexion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuConexion
|
||||
esquemaOperacional.generacionCorrida=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuGeneracionCorrida
|
||||
esquemaOperacional.confrestricaocanalventa=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuConfRestricaoCanalVenta
|
||||
esquemaOperacional.confrestricaocanalventa=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.SubMenuConfRestricaoCanalVenta
|
||||
esquemaOperacional.confrestricaocanalventa.itemMenu=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuConfRestricaoCanalVenta
|
||||
esquemaOperacional.confrestricaocanalventa.itemMenuEmpValMin=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuConfRestricaoCanalVentaEmpresaValorMinimo
|
||||
esquemaOperacional.selecionarservicosgerar=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemSelecionarServicosGerar
|
||||
esquemaOperacional.atualizacorridafechusofecverano=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemAtualizaCorridaFecHusoFecVerano
|
||||
esquemaOperacional.geracaoArquivoEMTU=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemGeracaoArquivoEMTU
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
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.entidad.ConfRestricaoVendaWeb;
|
||||
|
||||
public class RenderConfRestricaoVendaWeb implements ListitemRenderer {
|
||||
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
ConfRestricaoVendaWeb cvw = (ConfRestricaoVendaWeb) o;
|
||||
|
||||
|
||||
if (cvw != null) {
|
||||
Listcell lc = new Listcell(cvw.getEmpresa() == null ? "": cvw.getEmpresa().getNombempresa().toString());
|
||||
lc.setParent(lstm);
|
||||
lc = new Listcell(cvw.getValor().toString());
|
||||
lc.setParent(lstm);
|
||||
}
|
||||
|
||||
lstm.setAttribute("data", cvw);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -95,6 +95,8 @@
|
|||
</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.ConfRestricaoPtovta
|
||||
</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.ConfRestricaoVendaWeb
|
||||
</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.Convenio</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.ConvenioDet</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.Constante</value>
|
||||
|
|
|
@ -227,6 +227,7 @@ indexController.mniMantenimientoMovimientos.label = Mantenimiento de movimientos
|
|||
indexController.mniEnvioNomina.label = Envio a Nomina
|
||||
indexController.mniPtovtaEmpresa.label = Punto de venta empresa
|
||||
indexController.mniConfRestricaoCanalVenta.label = Bloqueo de tramos por canal de venta
|
||||
indexController.mniConfRestricaoCanalVentaEmpValMin.label = Bloqueio de Trechos p/ Canal de Venda Web
|
||||
indexController.mniSelecionarServicosGerar.label = Seleccionar corridas a generar
|
||||
indexController.mniCasetaPeaje.label = Caseta Peaje
|
||||
indexController.mniGeracaoArquivoEMTU.label = Geração Arquivo EMTU
|
||||
|
@ -5545,6 +5546,13 @@ editarConfRestricaoCanalVentaController.MSG.restricaoPtovta = Informe lo punto d
|
|||
editarConfRestricaoCanalVentaController.MSG.restricaoPtovtaJaCadastrada=Punto de venta ya registrado.
|
||||
editarConfRestricaoCanalVentaController.MSG.selecionarrestricaoPtovta = Seleccione uno punto de venta.
|
||||
editarConfRestricaoCanalVentaController.MSG.bloqueoExistente = Bloqueo ya existente.
|
||||
editarConfRestricaoCanalVentaController.aba.vendaWeb = Bloqueio Venda Web por valor
|
||||
editarConfRestricaoCanalVentaController.aba.vendaWeb.empresa = Empresa
|
||||
editarConfRestricaoCanalVentaController.aba.vendaWeb.valorMinimo = Valor mínimo
|
||||
editarConfRestricaoCanalVentaController.aba.vendaWeb.valor = Valor
|
||||
editarConfRestricaoCanalVentaController.MSG.selecionarrestricaoVendaWeb = Seleccione registro.
|
||||
editarConfRestricaoCanalVentaController.MSG.informeValor = Informe um valor.
|
||||
confRestricaoCanalVentaWebController.window.title = Bloqueio de Trechos por Canal de Venda Web
|
||||
|
||||
# Busqueda Orgao Concedente
|
||||
busquedaOrgaoConcedenteController.window.title = Instituición concedente
|
||||
|
|
|
@ -236,6 +236,7 @@ indexController.mniMantenimientoMovimientos.label = Manutenção de Movimentos
|
|||
indexController.mniEnvioNomina.label = Envio a Nomina
|
||||
indexController.mniPtovtaEmpresa.label = Ponto de Venda Empresa
|
||||
indexController.mniConfRestricaoCanalVenta.label = Bloqueio de Trechos p/ Canal de Venda
|
||||
indexController.mniConfRestricaoCanalVentaEmpValMin.label = Bloqueio de Trechos p/ Canal de Venda Web
|
||||
indexController.mniSelecionarServicosGerar.label = Selecionar Serviços a Gerar
|
||||
indexController.mniAtualizarCorridaFecHusoFecVerano.label = Atualizar Ser. por Fuso e H. de Verão
|
||||
indexController.mniGeracaoArquivoEMTU.label = Geração Arquivo EMTU
|
||||
|
@ -5788,6 +5789,13 @@ editarConfRestricaoCanalVentaController.MSG.selecionarrestricaoPtovta = Selecion
|
|||
editarConfRestricaoCanalVentaController.MSG.bloqueoExistente = Bloqueio já existente.
|
||||
editarConfRestricaoCanalVentaController.MSG.vigenciaInvalida = Data inicial de vigência não pode ser maior do que a data final.
|
||||
editarConfRestricaoCanalVentaController.MSG.cloneOK = Restrição Gerada com Sucesso.
|
||||
editarConfRestricaoCanalVentaController.aba.vendaWeb = Bloqueio Venda Web por valor
|
||||
editarConfRestricaoCanalVentaController.aba.vendaWeb.empresa = Empresa
|
||||
editarConfRestricaoCanalVentaController.aba.vendaWeb.valorMinimo = Valor mínimo
|
||||
editarConfRestricaoCanalVentaController.aba.vendaWeb.valor = Valor
|
||||
editarConfRestricaoCanalVentaController.MSG.selecionarrestricaoVendaWeb = Seleccione registro.
|
||||
editarConfRestricaoCanalVentaController.MSG.informeValor = Informe um valor.
|
||||
confRestricaoCanalVentaWebController.window.title = Bloqueio de Trechos por Canal de Venda Web
|
||||
|
||||
# Busqueda Orgao Concedente
|
||||
editarOrgaoConcedenteController.MSG.classeExistente=Existe um índice de pedágio para a classe selecionada!
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?page contentType="text/html;charset=UTF-8"?>
|
||||
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="winConfRestricaoCanalVentaEmpValMin"?>
|
||||
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||
|
||||
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||
<window id="winConfRestricaoCanalVentaEmpValMin"
|
||||
title="${c:l('confRestricaoCanalVentaController.window.title')}"
|
||||
apply="${confRestricaoCanalVentaEmpValMinController}"
|
||||
contentStyle="overflow:auto" height="550px" width="950px"
|
||||
border="normal">
|
||||
<toolbar>
|
||||
<button id="btnSalvar2" height="20"
|
||||
image="/gui/img/save.png" width="35px"
|
||||
tooltiptext="${c:l('editarConfRestricaoCanalVentaController.btnSalvar.tooltiptext')}" />
|
||||
<button id="btnAddRestricaoVendaWeb" height="20"
|
||||
image="/gui/img/add.png" width="35px" />
|
||||
<button id="btnRemoveRestricaoVendaWeb" height="20"
|
||||
image="/gui/img/remove.png" width="35px"/>
|
||||
|
||||
</toolbar>
|
||||
|
||||
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="20%" />
|
||||
<column width="80%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarConfRestricaoCanalVentaController.aba.vendaWeb.empresa')}" />
|
||||
<combobox id="cmbEmpresaVendaWeb" readonly="true"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta"
|
||||
mold="rounded" buttonVisible="true" width="90%"
|
||||
selectedItem="@{winConfRestricaoCanalVentaEmpValMin$composer.empresa}"
|
||||
model="@{winConfRestricaoCanalVentaEmpValMin$composer.lsEmpresa}"/>
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarConfRestricaoCanalVentaController.aba.vendaWeb.valorMinimo')}" />
|
||||
<textbox id="txtValorMinimo" width="90%" mold="rounded" constraint="no empty, no zero, no negative, /[0-9]+(\,[0-9][0-9]?)?/ "
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal" precision="6" scale="2"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<separator orient="horizontal" />
|
||||
<listbox id="confRestricaoVendaWebDataList"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
multiple="false" checkmark="false" tooltiptext="">
|
||||
<listhead sizable="true">
|
||||
<listheader id="headEmpresa" width="60%"
|
||||
label="${c:l('editarConfRestricaoCanalVentaController.aba.vendaWeb.empresa')}"/>
|
||||
<listheader id="headValor" width="40%"
|
||||
label="${c:l('editarConfRestricaoCanalVentaController.aba.vendaWeb.valor')}"/>
|
||||
</listhead>
|
||||
</listbox>
|
||||
|
||||
|
||||
|
||||
|
||||
</window>
|
||||
</zk>
|
Loading…
Reference in New Issue