fixes bug#20284
dev:thiago qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@103259 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
7046e6a9c0
commit
3c0c14c998
|
@ -22,8 +22,11 @@ import org.zkoss.zul.Comboitem;
|
||||||
import org.zkoss.zul.Paging;
|
import org.zkoss.zul.Paging;
|
||||||
import org.zkoss.zul.Textbox;
|
import org.zkoss.zul.Textbox;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.constantes.ConstantesFuncionSistema;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Custom;
|
import com.rjconsultores.ventaboletos.entidad.Custom;
|
||||||
import com.rjconsultores.ventaboletos.enums.SistemaEnum;
|
import com.rjconsultores.ventaboletos.enums.SistemaEnum;
|
||||||
|
import com.rjconsultores.ventaboletos.service.FuncionSistemaService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
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.paginacion.HibernateSearchObject;
|
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
|
||||||
|
@ -39,8 +42,14 @@ import com.trg.search.Search;
|
||||||
@Scope("prototype")
|
@Scope("prototype")
|
||||||
public class BusquedaCustomController extends MyGenericForwardComposer {
|
public class BusquedaCustomController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private transient PagedListWrapper<Custom> plwCustom;
|
private transient PagedListWrapper<Custom> plwCustom;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FuncionSistemaService funcionSistemaService;
|
||||||
|
|
||||||
private MyListbox customList;
|
private MyListbox customList;
|
||||||
private Paging pagingCustom;
|
private Paging pagingCustom;
|
||||||
private Textbox txtChave;
|
private Textbox txtChave;
|
||||||
|
@ -81,6 +90,13 @@ public class BusquedaCustomController extends MyGenericForwardComposer {
|
||||||
openWindow("/gui/catalogos/editarCustom.zul",
|
openWindow("/gui/catalogos/editarCustom.zul",
|
||||||
Labels.getLabel("customController.window.title"), args, MODAL);
|
Labels.getLabel("customController.window.title"), args, MODAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void verCustomUploadArquivo() {
|
||||||
|
Map args = new HashMap();
|
||||||
|
args.put("customList", customList);
|
||||||
|
openWindow("/gui/catalogos/editarCustomUploadArquivo.zul",
|
||||||
|
Labels.getLabel("customController.uploadArquivo.titulo"), args, MODAL);
|
||||||
|
}
|
||||||
|
|
||||||
private void refreshLista() {
|
private void refreshLista() {
|
||||||
HibernateSearchObject<Custom> customBusqueda = new HibernateSearchObject<Custom>(Custom.class,
|
HibernateSearchObject<Custom> customBusqueda = new HibernateSearchObject<Custom>(Custom.class,
|
||||||
|
@ -122,6 +138,10 @@ public class BusquedaCustomController extends MyGenericForwardComposer {
|
||||||
public void onClick$btnNovo(Event ev) {
|
public void onClick$btnNovo(Event ev) {
|
||||||
verCustom(new Custom());
|
verCustom(new Custom());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onClick$btnUpLoad(Event ev) {
|
||||||
|
verCustomUploadArquivo();
|
||||||
|
}
|
||||||
|
|
||||||
public PagedListWrapper<Custom> getPlwCustom() {
|
public PagedListWrapper<Custom> getPlwCustom() {
|
||||||
return plwCustom;
|
return plwCustom;
|
||||||
|
@ -178,5 +198,9 @@ public class BusquedaCustomController extends MyGenericForwardComposer {
|
||||||
public void setCustomBusqueda(Search customBusqueda) {
|
public void setCustomBusqueda(Search customBusqueda) {
|
||||||
this.customBusqueda = customBusqueda;
|
this.customBusqueda = customBusqueda;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean getExibirBtnUpload() {
|
||||||
|
return UsuarioLogado.getUsuarioLogado().isPermisoClave(ConstantesFuncionSistema.CLAVE_UPLOAD_ARQUIVO_CONFIGURACAO);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,163 @@
|
||||||
|
/*
|
||||||
|
* To change this template, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
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.media.Media;
|
||||||
|
import org.zkoss.util.resource.Labels;
|
||||||
|
import org.zkoss.zhtml.Fileupload;
|
||||||
|
import org.zkoss.zk.ui.Component;
|
||||||
|
import org.zkoss.zk.ui.Executions;
|
||||||
|
import org.zkoss.zk.ui.event.Event;
|
||||||
|
import org.zkoss.zul.Checkbox;
|
||||||
|
import org.zkoss.zul.Combobox;
|
||||||
|
import org.zkoss.zul.Label;
|
||||||
|
import org.zkoss.zul.Messagebox;
|
||||||
|
import org.zkoss.zul.api.Comboitem;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.enums.SistemaEnum;
|
||||||
|
import com.rjconsultores.ventaboletos.service.CustomService;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Wilian
|
||||||
|
*/
|
||||||
|
@Controller("editarCustomUploadArquivoController")
|
||||||
|
@Scope("prototype")
|
||||||
|
public class EditarCustomUploadArquivoController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CustomService customService;
|
||||||
|
|
||||||
|
private Combobox cmbSistema;
|
||||||
|
private List<SistemaEnum> lsSistemaEnum;
|
||||||
|
|
||||||
|
private MyListbox customList;
|
||||||
|
|
||||||
|
private Properties arquivo;
|
||||||
|
|
||||||
|
private Checkbox chkSubstituirExistente;
|
||||||
|
private Label lbNomeArquivo;
|
||||||
|
|
||||||
|
private static Logger log = Logger.getLogger(EditarCustomUploadArquivoController.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
|
super.doAfterCompose(comp);
|
||||||
|
|
||||||
|
customList = (MyListbox) Executions.getCurrent().getArg().get("customList");
|
||||||
|
lsSistemaEnum = Arrays.asList(SistemaEnum.values());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClick$btnSalvar(Event ev) throws InterruptedException {
|
||||||
|
try {
|
||||||
|
|
||||||
|
if(arquivo == null) {
|
||||||
|
Messagebox.show(
|
||||||
|
Labels.getLabel("customController.uploadArquivo.naoCarregado"),
|
||||||
|
Labels.getLabel("customController.uploadArquivo.titulo"),
|
||||||
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(getCmbSistema() == null || getCmbSistema().getSelectedItem() == null) {
|
||||||
|
Messagebox.show(
|
||||||
|
Labels.getLabel("customController.uploadArquivo.sistemaNaoInformado"),
|
||||||
|
Labels.getLabel("customController.uploadArquivo.titulo"),
|
||||||
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
chkSubstituirExistente.getValue();
|
||||||
|
|
||||||
|
int resp = Messagebox.show(
|
||||||
|
Labels.getLabel("customController.uploadArquivo.confirmar"),
|
||||||
|
Labels.getLabel("customController.uploadArquivo.titulo"),
|
||||||
|
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
||||||
|
|
||||||
|
if (resp == Messagebox.YES) {
|
||||||
|
Comboitem cbSistema = cmbSistema.getSelectedItem();
|
||||||
|
SistemaEnum sistemaEnum = (SistemaEnum) cbSistema.getValue();
|
||||||
|
|
||||||
|
customService.carregarArquivoProperties(sistemaEnum, arquivo, chkSubstituirExistente.isChecked());
|
||||||
|
|
||||||
|
Messagebox.show(
|
||||||
|
Labels.getLabel("customController.MSG.suscribirOK"),
|
||||||
|
Labels.getLabel("customController.uploadArquivo.titulo"),
|
||||||
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
|
||||||
|
closeWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} catch (Exception ex) {
|
||||||
|
log.error(ex.getMessage(), ex);
|
||||||
|
Messagebox.show(
|
||||||
|
Labels.getLabel("MSG.Error"),
|
||||||
|
Labels.getLabel("customController.uploadArquivo.titulo"),
|
||||||
|
Messagebox.OK, Messagebox.ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onClick$btnCarregarArquivo(Event ev) throws InterruptedException {
|
||||||
|
try {
|
||||||
|
Media mArquivoPropriedade = Fileupload.get();
|
||||||
|
|
||||||
|
lbNomeArquivo.setValue("");
|
||||||
|
arquivo = null;
|
||||||
|
if(mArquivoPropriedade != null) {
|
||||||
|
lbNomeArquivo.setValue(mArquivoPropriedade.getName());
|
||||||
|
arquivo = new Properties();
|
||||||
|
arquivo.load(mArquivoPropriedade.getStreamData());
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
log.error(ex.getMessage(), ex);
|
||||||
|
Messagebox.show(
|
||||||
|
Labels.getLabel("customController.uploadArquivo.arquivoInvalido"),
|
||||||
|
Labels.getLabel("customController.uploadArquivo.titulo"),
|
||||||
|
Messagebox.OK, Messagebox.ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public MyListbox getCustomList() {
|
||||||
|
return customList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomList(MyListbox customList) {
|
||||||
|
this.customList = customList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<SistemaEnum> getLsSistemaEnum() {
|
||||||
|
return lsSistemaEnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLsSistemaEnum(List<SistemaEnum> lsSistemaEnum) {
|
||||||
|
this.lsSistemaEnum = lsSistemaEnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Combobox getCmbSistema() {
|
||||||
|
return cmbSistema;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCmbSistema(Combobox cmbSistema) {
|
||||||
|
this.cmbSistema = cmbSistema;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Label getLbNomeArquivo() {
|
||||||
|
return lbNomeArquivo;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -8155,6 +8155,12 @@ customController.MSG.suscribirOK = Customização Registrada com Sucesso.
|
||||||
customController.MSG.borrarPergunta = Eliminar customização?
|
customController.MSG.borrarPergunta = Eliminar customização?
|
||||||
customController.MSG.borrarOK = Customização Excluida com Sucesso.
|
customController.MSG.borrarOK = Customização Excluida com Sucesso.
|
||||||
customController.MSG.modificar = Cuidado! Ao alterar este valor o sistema será modificado automaticamente.
|
customController.MSG.modificar = Cuidado! Ao alterar este valor o sistema será modificado automaticamente.
|
||||||
|
customController.uploadArquivo.titulo = Carregar Arquivo Propriedades
|
||||||
|
customController.uploadArquivo.naoCarregado = Arquivo Propriedades não carregado
|
||||||
|
customController.uploadArquivo.substituirExistente = Substituir Chaves existentes
|
||||||
|
customController.uploadArquivo.sistemaNaoInformado = Selecione o Sistema
|
||||||
|
customController.uploadArquivo.arquivoInvalido = Não foi possível carregar o arquivo de propriedades
|
||||||
|
customController.uploadArquivo.confirmar = Confirmar Arquivo de Propriedades?
|
||||||
|
|
||||||
#Relatorio BPe
|
#Relatorio BPe
|
||||||
relatorioBPeController.window.title = Relatório BPe
|
relatorioBPeController.window.title = Relatório BPe
|
||||||
|
|
|
@ -8703,7 +8703,7 @@ editarPtovtaAntifraudeController.window.title=Editar Chave Antifraude
|
||||||
|
|
||||||
# Custom
|
# Custom
|
||||||
customController.window.title = Customização Sistema
|
customController.window.title = Customização Sistema
|
||||||
customController.btnSalvar.tooltiptext = Guardar
|
customController.btnSalvar.tooltiptext = Salvar
|
||||||
customController.id.value=ID
|
customController.id.value=ID
|
||||||
customController.chave.value=Chave
|
customController.chave.value=Chave
|
||||||
customController.sistema.value=Sistema
|
customController.sistema.value=Sistema
|
||||||
|
@ -8718,6 +8718,12 @@ customController.MSG.suscribirOK = Customização Registrada com Sucesso.
|
||||||
customController.MSG.borrarPergunta = Eliminar customização?
|
customController.MSG.borrarPergunta = Eliminar customização?
|
||||||
customController.MSG.borrarOK = Customização Excluida com Sucesso.
|
customController.MSG.borrarOK = Customização Excluida com Sucesso.
|
||||||
customController.MSG.modificar = Cuidado! Ao alterar este valor o sistema será modificado automaticamente.
|
customController.MSG.modificar = Cuidado! Ao alterar este valor o sistema será modificado automaticamente.
|
||||||
|
customController.uploadArquivo.titulo = Carregar Arquivo Propriedades
|
||||||
|
customController.uploadArquivo.naoCarregado = Arquivo Propriedades não carregado
|
||||||
|
customController.uploadArquivo.substituirExistente = Substituir Chaves existentes
|
||||||
|
customController.uploadArquivo.sistemaNaoInformado = Selecione o Sistema
|
||||||
|
customController.uploadArquivo.arquivoInvalido = Não foi possível carregar o arquivo de propriedades
|
||||||
|
customController.uploadArquivo.confirmar = Confirmar Arquivo de Propriedades?
|
||||||
|
|
||||||
#Relatorio BPe
|
#Relatorio BPe
|
||||||
relatorioBPeController.window.title = Relatório BPe
|
relatorioBPeController.window.title = Relatório BPe
|
||||||
|
|
|
@ -14,6 +14,11 @@
|
||||||
<separator orient="vertical" />
|
<separator orient="vertical" />
|
||||||
<button id="btnNovo" image="/gui/img/add.png" width="35px"
|
<button id="btnNovo" image="/gui/img/add.png" width="35px"
|
||||||
tooltiptext="${c:l('customController.btnNovo.tooltiptext')}" />
|
tooltiptext="${c:l('customController.btnNovo.tooltiptext')}" />
|
||||||
|
<separator orient="vertical" visible="@{winBusquedaCustom$composer.exibirBtnUpload}"/>
|
||||||
|
<button id="btnUpLoad" height="20"
|
||||||
|
image="/gui/img/upload.png" width="35px"
|
||||||
|
tooltiptext="${c:l('customController.uploadArquivo.titulo')}"
|
||||||
|
visible="@{winBusquedaCustom$composer.exibirBtnUpload}"/>
|
||||||
<separator orient="vertical" />
|
<separator orient="vertical" />
|
||||||
<button id="btnCerrar" onClick="winBusquedaCustom.detach()" image="/gui/img/exit.png" width="35px"
|
<button id="btnCerrar" onClick="winBusquedaCustom.detach()" image="/gui/img/exit.png" width="35px"
|
||||||
tooltiptext="${c:l('customController.btnCerrar.tooltiptext')}"/>
|
tooltiptext="${c:l('customController.btnCerrar.tooltiptext')}"/>
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
width="900px" height="500x" contentStyle="overflow:auto"
|
width="900px" height="500x" contentStyle="overflow:auto"
|
||||||
title="${c:l('editarArticuloController.window.title')}">
|
title="${c:l('editarArticuloController.window.title')}">
|
||||||
<toolbar>
|
<toolbar>
|
||||||
<hbox spacing="5px" style="padding:1px" align="right">
|
<hbox spacing="3px" style="padding:1px" align="right">
|
||||||
<button id="btnApagar" height="20"
|
<button id="btnApagar" height="20"
|
||||||
image="/gui/img/remove.png" width="35px"
|
image="/gui/img/remove.png" width="35px"
|
||||||
tooltiptext="${c:l('customController.btnApagar.tooltiptext')}"/>
|
tooltiptext="${c:l('customController.btnApagar.tooltiptext')}"/>
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
<?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="winEditarCustomUploadArquivo"?>
|
||||||
|
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||||
|
|
||||||
|
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||||
|
<window id="winEditarCustomUploadArquivo" border="normal"
|
||||||
|
apply="${editarCustomUploadArquivoController}"
|
||||||
|
width="550px" height="500x" contentStyle="overflow:auto"
|
||||||
|
title="${c:l('customController.uploadArquivo.titulo')}">
|
||||||
|
<toolbar>
|
||||||
|
<hbox spacing="3px" style="padding:1px" align="right">
|
||||||
|
<button id="btnSalvar" height="20"
|
||||||
|
image="/gui/img/save.png" width="35px"
|
||||||
|
tooltiptext="${c:l('customController.btnSalvar.tooltiptext')}"/>
|
||||||
|
<button id="btnFechar" height="20"
|
||||||
|
image="/gui/img/exit.png" width="35px"
|
||||||
|
onClick="winEditarCustomUploadArquivo.detach()"
|
||||||
|
tooltiptext="${c:l('customController.btnFechar.tooltiptext')}"/>
|
||||||
|
</hbox>
|
||||||
|
</toolbar>
|
||||||
|
|
||||||
|
<grid fixedLayout="true">
|
||||||
|
<columns>
|
||||||
|
<column width="40%" />
|
||||||
|
<column width="60%" />
|
||||||
|
</columns>
|
||||||
|
<rows>
|
||||||
|
<row>
|
||||||
|
<button id="btnCarregarArquivo"
|
||||||
|
label="Carregar Arquivo"/>
|
||||||
|
<label id="lbNomeArquivo"/>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<label id="lbSistema" value="${c:l('customController.sistema.value')}"/>
|
||||||
|
<combobox id="cmbSistema"
|
||||||
|
mold="rounded" buttonVisible="true" width="300px"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||||
|
model="@{winEditarCustomUploadArquivo$composer.lsSistemaEnum}"/>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<label id="lbSubstituirExistente" value="${c:l('customController.uploadArquivo.substituirExistente')}"/>
|
||||||
|
<checkbox id="chkSubstituirExistente"
|
||||||
|
checked="true"/>
|
||||||
|
</row>
|
||||||
|
</rows>
|
||||||
|
</grid>
|
||||||
|
</window>
|
||||||
|
</zk>
|
Binary file not shown.
After Width: | Height: | Size: 465 B |
Loading…
Reference in New Issue