bug #7127
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@52998 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
f95e8224ba
commit
c43b676de5
|
@ -0,0 +1,155 @@
|
||||||
|
package com.rjconsultores.ventaboletos.web.gui.controladores.comissao;
|
||||||
|
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
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.zhtml.Messagebox;
|
||||||
|
import org.zkoss.zk.ui.Component;
|
||||||
|
import org.zkoss.zk.ui.event.Event;
|
||||||
|
import org.zkoss.zk.ui.event.EventListener;
|
||||||
|
import org.zkoss.zk.ui.event.InputEvent;
|
||||||
|
import org.zkoss.zk.ui.event.KeyEvent;
|
||||||
|
import org.zkoss.zul.Textbox;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.service.ConferenciaComissaoService;
|
||||||
|
import com.rjconsultores.ventaboletos.vo.comissao.EtiquetaMalote;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
|
|
||||||
|
@Scope("prototype")
|
||||||
|
@Controller("recebimentoMaloteController")
|
||||||
|
public class RecebimentoMaloteController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
|
private static Logger log = Logger.getLogger(RecebimentoMaloteController.class);
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ConferenciaComissaoService conferenciaComissaoService;
|
||||||
|
|
||||||
|
private EtiquetaMalote etiquetaMalote;
|
||||||
|
private Textbox txtCodigoBarras;
|
||||||
|
private Textbox txtEmpresa;
|
||||||
|
private Textbox txtPuntoVenta;
|
||||||
|
private Textbox txtDatasMalote;
|
||||||
|
private Textbox txtNumeroMalote;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
|
super.doAfterCompose(comp);
|
||||||
|
|
||||||
|
txtCodigoBarras.setCtrlKeys("#f10#f12#f3");
|
||||||
|
txtCodigoBarras.addEventListener("onChanging", new EventListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEvent(Event event) throws Exception {
|
||||||
|
if(event instanceof InputEvent) {
|
||||||
|
InputEvent inputEvent = (InputEvent) event;
|
||||||
|
if(inputEvent.getValue().length() == 35) {
|
||||||
|
pesquisa(inputEvent.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
txtCodigoBarras.addEventListener("onCtrlKey", new EventListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEvent(Event event) throws Exception {
|
||||||
|
if(event instanceof KeyEvent) {
|
||||||
|
KeyEvent keyEvent = (KeyEvent) event;
|
||||||
|
if(keyEvent.getKeyCode() == KeyEvent.F10) {
|
||||||
|
onClick$btnPesquisa(event);
|
||||||
|
} else if(keyEvent.getKeyCode() == KeyEvent.F12) {
|
||||||
|
onClick$btnConfirmar(event);
|
||||||
|
} else if(keyEvent.getKeyCode() == KeyEvent.F3) {
|
||||||
|
onClick$btnLimpar(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
txtCodigoBarras.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClick$btnPesquisa(Event ev) throws InterruptedException {
|
||||||
|
txtCodigoBarras.getValue();
|
||||||
|
pesquisa(txtCodigoBarras.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void pesquisa(String codigoBarras) throws InterruptedException {
|
||||||
|
try {
|
||||||
|
if(verificarCampos(codigoBarras)) {
|
||||||
|
etiquetaMalote = conferenciaComissaoService.decodificarEtiquetaMalote(codigoBarras);
|
||||||
|
txtEmpresa.setValue(etiquetaMalote.getNombempresa());
|
||||||
|
txtPuntoVenta.setValue(etiquetaMalote.getNombpuntoventa());
|
||||||
|
txtDatasMalote.setValue(etiquetaMalote.getDatasMalote());
|
||||||
|
txtNumeroMalote.setValue(etiquetaMalote.getNumeroMalote());
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
Messagebox.show(Labels.getLabel("MSG.Error"),
|
||||||
|
Labels.getLabel("recebimentoMaloteController.window.title"),
|
||||||
|
Messagebox.OK,Messagebox.ERROR);
|
||||||
|
}
|
||||||
|
txtCodigoBarras.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean verificarCampos(String codigoBarras) throws InterruptedException {
|
||||||
|
if(codigoBarras == null || codigoBarras.length() != 35) {
|
||||||
|
Messagebox.show(Labels.getLabel("recebimentoMaloteController.msg.erro.codigoBarrasInvalido"),
|
||||||
|
Labels.getLabel("recebimentoMaloteController.window.title"),
|
||||||
|
Messagebox.OK,Messagebox.ERROR);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClick$btnLimpar(Event ev) {
|
||||||
|
try {
|
||||||
|
limpar();
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void limpar() {
|
||||||
|
etiquetaMalote = new EtiquetaMalote();
|
||||||
|
txtCodigoBarras.setValue("");
|
||||||
|
txtDatasMalote.setValue("");
|
||||||
|
txtEmpresa.setValue("");
|
||||||
|
txtPuntoVenta.setValue("");
|
||||||
|
txtNumeroMalote.setValue("");
|
||||||
|
txtCodigoBarras.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClick$btnConfirmar(Event ev) throws InterruptedException {
|
||||||
|
try {
|
||||||
|
if(getEtiquetaMalote() != null) {
|
||||||
|
conferenciaComissaoService.confirmarChegadaMalote(getEtiquetaMalote());
|
||||||
|
Messagebox.show(Labels.getLabel("recebimentoMaloteController.msg.info.maloteRecebido"),
|
||||||
|
Labels.getLabel("recebimentoMaloteController.window.title"),
|
||||||
|
Messagebox.OK,Messagebox.INFORMATION);
|
||||||
|
limpar();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
Messagebox.show(Labels.getLabel("MSG.Error"),
|
||||||
|
Labels.getLabel("recebimentoMaloteController.window.title"),
|
||||||
|
Messagebox.OK,Messagebox.ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
txtCodigoBarras.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
public EtiquetaMalote getEtiquetaMalote() {
|
||||||
|
return etiquetaMalote;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEtiquetaMalote(EtiquetaMalote etiquetaMalote) {
|
||||||
|
this.etiquetaMalote = etiquetaMalote;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.comissao;
|
||||||
|
|
||||||
|
import org.zkoss.util.resource.Labels;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
|
||||||
|
|
||||||
|
public class ItemMenuRecebimentoMalote extends DefaultItemMenuSistema {
|
||||||
|
|
||||||
|
public ItemMenuRecebimentoMalote() {
|
||||||
|
super("indexController.mniRecebimentoMalote.label");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getClaveMenu() {
|
||||||
|
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.COMISSAO.MENU.RECEBIMENTOMALOTE";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void ejecutar() {
|
||||||
|
PantallaUtileria.openWindow("/gui/comissao/recebimentoMalote.zul",
|
||||||
|
Labels.getLabel("recebimentoMaloteController.window.title"), getArgs(), desktop);
|
||||||
|
}
|
||||||
|
}
|
|
@ -262,6 +262,7 @@ indexController.mniRelatorioVendasComissao.label = Reporte de Ventas Comisionist
|
||||||
indexController.mniRelatorioMovimentosAtraso.label = Reporte de Movimientos Retrasados
|
indexController.mniRelatorioMovimentosAtraso.label = Reporte de Movimientos Retrasados
|
||||||
indexController.mniRelatorioObservacaoBilhetes.label = Reporte Observación Boletos
|
indexController.mniRelatorioObservacaoBilhetes.label = Reporte Observación Boletos
|
||||||
indexController.mniRelatorioObservacaoEventosFinanceiros.label = Reporte Observación Eventos Financieros
|
indexController.mniRelatorioObservacaoEventosFinanceiros.label = Reporte Observación Eventos Financieros
|
||||||
|
indexController.mniRecebimentoMalote.label = Recebimento Malote
|
||||||
|
|
||||||
indexController.mniSubMenuClientePacote.label=Paquete
|
indexController.mniSubMenuClientePacote.label=Paquete
|
||||||
indexController.mniManutencaoPacote.label=Mantenimiento Paquete
|
indexController.mniManutencaoPacote.label=Mantenimiento Paquete
|
||||||
|
@ -6135,3 +6136,20 @@ relatorioArquivoBGMController.lbDataIni.value = Data Inicial
|
||||||
relatorioArquivoBGMController.lbDataFin.value = Data Final
|
relatorioArquivoBGMController.lbDataFin.value = Data Final
|
||||||
relatorioArquivoBGMController.lbEmpresa.value = Empresa
|
relatorioArquivoBGMController.lbEmpresa.value = Empresa
|
||||||
relatorioArquivoBGMController.lbPuntoVenta.value = Agência
|
relatorioArquivoBGMController.lbPuntoVenta.value = Agência
|
||||||
|
|
||||||
|
# Recebimento Malote
|
||||||
|
recebimentoMaloteController.window.title = Recebimento Malote
|
||||||
|
recebimentoMaloteController.btnConfirmar.label = Confirmar - F12
|
||||||
|
recebimentoMaloteController.btnLimpar.label = Limpiar - F3
|
||||||
|
recebimentoMaloteController.btnPesquisa.label = Búsqueda - F10
|
||||||
|
recebimentoMaloteController.lbCodigoBarras.label = Código de Barras
|
||||||
|
recebimentoMaloteController.lbNumeroMalote.value = Número Malote
|
||||||
|
recebimentoMaloteController.lbEmpresa.value = Empresa
|
||||||
|
recebimentoMaloteController.lbPuntoVenta.value = Ponto de Venda (Agência)
|
||||||
|
recebimentoMaloteController.lbDatasMalote.value = Fechas Malote
|
||||||
|
recebimentoMaloteController.lbDadosMalote.value = Dados do Malote
|
||||||
|
recebimentoMaloteController.msg.erro.codigoBarrasInvalido = Código de Barras inválido
|
||||||
|
recebimentoMaloteController.msg.erro.empresaNaoLocalizada = Empresa não foi localizada
|
||||||
|
recebimentoMaloteController.msg.erro.puntoVentaNaoLocalizado = Ponto de Venda (Agência) não foi localizado
|
||||||
|
recebimentoMaloteController.msg.info.maloteRecebido = Malote recebido com sucesso
|
||||||
|
recebimentoMaloteController.msg.info.maloteRecebido = Malotes recebidos com sucesso
|
|
@ -267,6 +267,7 @@ indexController.mniRelatorioVendasComissao.label = Relatório de Vendas de Comis
|
||||||
indexController.mniRelatorioMovimentosAtraso.label = Relatório de Movimentos em Atraso
|
indexController.mniRelatorioMovimentosAtraso.label = Relatório de Movimentos em Atraso
|
||||||
indexController.mniRelatorioObservacaoBilhetes.label = Relatório Observação Bilhetes
|
indexController.mniRelatorioObservacaoBilhetes.label = Relatório Observação Bilhetes
|
||||||
indexController.mniRelatorioObservacaoEventosFinanceiros.label = Relatório Observação Eventos Financeiros
|
indexController.mniRelatorioObservacaoEventosFinanceiros.label = Relatório Observação Eventos Financeiros
|
||||||
|
indexController.mniRecebimentoMalote.label = Recebimento Malote
|
||||||
|
|
||||||
indexController.mnSubMenuImpressaoFiscal.label=Impressão Fiscal
|
indexController.mnSubMenuImpressaoFiscal.label=Impressão Fiscal
|
||||||
indexController.mnSubMenuRelatorioImpressaoFiscal.label=Relatório Impressão Fiscal
|
indexController.mnSubMenuRelatorioImpressaoFiscal.label=Relatório Impressão Fiscal
|
||||||
|
@ -6271,3 +6272,19 @@ relatorioArquivoBGMController.lbDataIni.value = Data Inicial
|
||||||
relatorioArquivoBGMController.lbDataFin.value = Data Final
|
relatorioArquivoBGMController.lbDataFin.value = Data Final
|
||||||
relatorioArquivoBGMController.lbEmpresa.value = Empresa
|
relatorioArquivoBGMController.lbEmpresa.value = Empresa
|
||||||
relatorioArquivoBGMController.lbPuntoVenta.value = Agência
|
relatorioArquivoBGMController.lbPuntoVenta.value = Agência
|
||||||
|
|
||||||
|
# Recebimento Malote
|
||||||
|
recebimentoMaloteController.window.title = Recebimento Malote
|
||||||
|
recebimentoMaloteController.btnConfirmar.label = Confirmar - F12
|
||||||
|
recebimentoMaloteController.btnLimpar.label = Limpar - F3
|
||||||
|
recebimentoMaloteController.btnPesquisa.label = Pesquisar - F10
|
||||||
|
recebimentoMaloteController.lbCodigoBarras.label = Código de barras
|
||||||
|
recebimentoMaloteController.lbNumeroMalote.value = Número Malote
|
||||||
|
recebimentoMaloteController.lbEmpresa.value = Empresa
|
||||||
|
recebimentoMaloteController.lbPuntoVenta.value = Ponto de Venda (Agência)
|
||||||
|
recebimentoMaloteController.lbDatasMalote.value = Datas no Malote
|
||||||
|
recebimentoMaloteController.lbDadosMalote.value = Dados do Malote
|
||||||
|
recebimentoMaloteController.msg.erro.codigoBarrasInvalido = Código de Barras inválido
|
||||||
|
recebimentoMaloteController.msg.erro.empresaNaoLocalizada = Empresa não foi localizada
|
||||||
|
recebimentoMaloteController.msg.erro.puntoVentaNaoLocalizado = Ponto de Venda (Agência) não foi localizado
|
||||||
|
recebimentoMaloteController.msg.info.maloteRecebido = Malote recebido com sucesso
|
|
@ -0,0 +1,93 @@
|
||||||
|
<?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="winRecebimentoMalote"?>
|
||||||
|
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||||
|
|
||||||
|
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||||
|
<window id="winRecebimentoMalote"
|
||||||
|
title="${c:l('recebimentoMaloteController.window.title')}"
|
||||||
|
apply="${recebimentoMaloteController}"
|
||||||
|
contentStyle="overflow:auto" height="285px" width="500px"
|
||||||
|
border="normal">
|
||||||
|
<toolbar>
|
||||||
|
<button id="btnCerrar"
|
||||||
|
onClick="winRecebimentoMalote.detach()"
|
||||||
|
image="/gui/img/exit.png"
|
||||||
|
width="35px"
|
||||||
|
tooltiptext="${c:l('tooltiptext.btnFechar')}" />
|
||||||
|
</toolbar>
|
||||||
|
|
||||||
|
<grid fixedLayout="true">
|
||||||
|
<columns>
|
||||||
|
<column width="35%" />
|
||||||
|
<column width="65%" />
|
||||||
|
</columns>
|
||||||
|
<rows>
|
||||||
|
<row>
|
||||||
|
<label value="${c:l('recebimentoMaloteController.lbCodigoBarras.label')}" />
|
||||||
|
<textbox id="txtCodigoBarras"
|
||||||
|
width="95%"
|
||||||
|
maxlength="35"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
|
||||||
|
</row>
|
||||||
|
</rows>
|
||||||
|
</grid>
|
||||||
|
|
||||||
|
<toolbar>
|
||||||
|
<button id="btnPesquisa"
|
||||||
|
image="/gui/img/find.png"
|
||||||
|
label="${c:l('recebimentoMaloteController.btnPesquisa.label')}" />
|
||||||
|
<button id="btnLimpar"
|
||||||
|
image="/gui/img/eraser.png"
|
||||||
|
label="${c:l('recebimentoMaloteController.btnLimpar.label')}" />
|
||||||
|
</toolbar>
|
||||||
|
|
||||||
|
<grid fixedLayout="true">
|
||||||
|
<columns>
|
||||||
|
<column width="35%" />
|
||||||
|
<column width="65%" />
|
||||||
|
</columns>
|
||||||
|
<rows>
|
||||||
|
<row spans="2">
|
||||||
|
<label value="${c:l('recebimentoMaloteController.lbDadosMalote.value')}" />
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<label value="${c:l('recebimentoMaloteController.lbNumeroMalote.value')}" />
|
||||||
|
<textbox id="txtNumeroMalote"
|
||||||
|
width="95%"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
|
||||||
|
readonly="true" />
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<label value="${c:l('recebimentoMaloteController.lbEmpresa.value')}" />
|
||||||
|
<textbox id="txtEmpresa"
|
||||||
|
width="95%"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
|
||||||
|
readonly="true" />
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<label value="${c:l('recebimentoMaloteController.lbPuntoVenta.value')}" />
|
||||||
|
<textbox id="txtPuntoVenta"
|
||||||
|
width="95%"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
|
||||||
|
readonly="true" />
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<label value="${c:l('recebimentoMaloteController.lbDatasMalote.value')}" />
|
||||||
|
<textbox id="txtDatasMalote"
|
||||||
|
width="95%"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
|
||||||
|
readonly="true" />
|
||||||
|
</row>
|
||||||
|
</rows>
|
||||||
|
</grid>
|
||||||
|
|
||||||
|
<toolbar>
|
||||||
|
<button id="btnConfirmar"
|
||||||
|
image="/gui/img/ok.png"
|
||||||
|
label="${c:l('recebimentoMaloteController.btnConfirmar.label')}" />
|
||||||
|
</toolbar>
|
||||||
|
|
||||||
|
</window>
|
||||||
|
</zk>
|
Loading…
Reference in New Issue