#7455 Mensagem adm
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@58531 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
99df4e433a
commit
9ed1d4d469
|
@ -0,0 +1,145 @@
|
|||
package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
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.zul.Paging;
|
||||
import org.zkoss.zul.Textbox;
|
||||
import org.zkoss.zul.api.Datebox;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Mensaje;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderMensaje;
|
||||
|
||||
@Controller("busquedaMensajeController")
|
||||
@Scope("prototype")
|
||||
public class BusquedaMensajeController extends MyGenericForwardComposer {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Autowired
|
||||
private transient PagedListWrapper<Mensaje> plwMensaje;
|
||||
|
||||
private MyListbox mensajeList;
|
||||
private Paging pagingMensaje;
|
||||
|
||||
private Datebox txtDataInicial;
|
||||
private Datebox txtDataFinal;
|
||||
private Textbox txtDescricao;
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
|
||||
super.doAfterCompose(comp);
|
||||
mensajeList.setItemRenderer(new RenderMensaje());
|
||||
|
||||
mensajeList.addEventListener("onDoubleClick", new EventListener() {
|
||||
|
||||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
Mensaje mensaje = (Mensaje) mensajeList.getSelected();
|
||||
verMensagem(mensaje);
|
||||
}
|
||||
});
|
||||
|
||||
refreshLista(false);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
private void verMensagem(Mensaje m) {
|
||||
if (m == null) {
|
||||
return;
|
||||
}
|
||||
Map args = new HashMap();
|
||||
args.put("mensaje", m);
|
||||
args.put("mensajeList", mensajeList);
|
||||
args.put("busquedaMensajeController", this);
|
||||
|
||||
openWindow("/gui/seguridad/editarMensaje.zul",
|
||||
Labels.getLabel("editarMensajeController.window.title"), args, MODAL);
|
||||
|
||||
}
|
||||
|
||||
public void refreshLista(Boolean validade) {
|
||||
HibernateSearchObject<Mensaje> sistemaBusqueda = new HibernateSearchObject<Mensaje>(Mensaje.class, pagingMensaje.getPageSize());
|
||||
|
||||
Date dataInicial = txtDataInicial.getValue();
|
||||
if (dataInicial != null) {
|
||||
sistemaBusqueda.addFilterEqual("fecIni", dataInicial);
|
||||
}
|
||||
|
||||
Date dataFinal = txtDataFinal.getValue();
|
||||
if (dataFinal != null) {
|
||||
sistemaBusqueda.addFilterEqual("fecFin", dataFinal);
|
||||
}
|
||||
|
||||
String descricao = txtDescricao.getText();
|
||||
if (!descricao.equals("")) {
|
||||
sistemaBusqueda.addFilterEqual("descripcion", descricao.trim());
|
||||
}
|
||||
|
||||
sistemaBusqueda.addSortDesc("fecIni");
|
||||
sistemaBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
||||
|
||||
plwMensaje.init(sistemaBusqueda, mensajeList, pagingMensaje);
|
||||
|
||||
if (validade && mensajeList.getData().length == 0) {
|
||||
try {
|
||||
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
|
||||
Labels.getLabel("busquedaMensajeController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
} catch (InterruptedException ex) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onClick$btnNovo(Event ev) {
|
||||
verMensagem(new Mensaje());
|
||||
}
|
||||
|
||||
public void onClick$btnPesquisa(Event ev) {
|
||||
refreshLista(true);
|
||||
}
|
||||
|
||||
public void onClick$btnRefresh(Event ev) {
|
||||
refreshLista(true);
|
||||
}
|
||||
|
||||
public Datebox getTxtDataInicial() {
|
||||
return txtDataInicial;
|
||||
}
|
||||
|
||||
public void setTxtDataInicial(Datebox txtDataInicial) {
|
||||
this.txtDataInicial = txtDataInicial;
|
||||
}
|
||||
|
||||
public Datebox getTxtDataFinal() {
|
||||
return txtDataFinal;
|
||||
}
|
||||
|
||||
public void setTxtDataFinal(Datebox txtDataFinal) {
|
||||
this.txtDataFinal = txtDataFinal;
|
||||
}
|
||||
|
||||
public Textbox getTxtDescricao() {
|
||||
return txtDescricao;
|
||||
}
|
||||
|
||||
public void setTxtDescricao(Textbox txtDescricao) {
|
||||
this.txtDescricao = txtDescricao;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,402 @@
|
|||
package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
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.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.Comboitem;
|
||||
import org.zkoss.zul.Datebox;
|
||||
import org.zkoss.zul.Messagebox;
|
||||
import org.zkoss.zul.Textbox;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.Mensaje;
|
||||
import com.rjconsultores.ventaboletos.entidad.MensajeEmpresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.MensajePuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.entidad.MensajeUsuario;
|
||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||
import com.rjconsultores.ventaboletos.service.MensajeEmpresaService;
|
||||
import com.rjconsultores.ventaboletos.service.MensajePuntaVentaService;
|
||||
import com.rjconsultores.ventaboletos.service.MensajeService;
|
||||
import com.rjconsultores.ventaboletos.service.MensajeUsuarioService;
|
||||
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.RenderMensajeEmpresa;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderMensajePuntoVenta;
|
||||
|
||||
@Controller("editarMensajeController")
|
||||
@Scope("prototype")
|
||||
public class EditarMensajeController extends MyGenericForwardComposer {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static Logger log = Logger.getLogger(EditarMensajeController.class);
|
||||
|
||||
@Autowired
|
||||
private MensajePuntaVentaService mensajePuntoVentaService;
|
||||
@Autowired
|
||||
private MensajeEmpresaService mensajeEmpresaVentaService;
|
||||
@Autowired
|
||||
private MensajeUsuarioService mensajeUsuarioService;
|
||||
@Autowired
|
||||
private MensajeService mensajeService;
|
||||
|
||||
private Mensaje mensaje;
|
||||
private Datebox txtDataInicial;
|
||||
private Datebox txtDataFinal;
|
||||
private Textbox txtDescricao;
|
||||
private Checkbox chcTipo;
|
||||
|
||||
private List<MensajeEmpresa> mensajeEmpresaToUpdate;
|
||||
private Combobox cmbEmpresa;
|
||||
private List<Empresa> lsEmpresa;
|
||||
private List<MensajeEmpresa> lsAddEmpresa;
|
||||
private MyListbox empresaList;
|
||||
|
||||
private List<MensajePuntoVenta> mensajePuntoVentasToUpdate;
|
||||
private Combobox cmbPuntoVenta;
|
||||
private List<MensajePuntoVenta> lsAddPuntoVenta;
|
||||
private MyListbox puntoVentaList;
|
||||
|
||||
private String descricaoOriginal;
|
||||
BusquedaMensajeController busquedaMensajeController;
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
|
||||
busquedaMensajeController = (BusquedaMensajeController) Executions.getCurrent().getArg().get("busquedaMensajeController");
|
||||
|
||||
lsEmpresa = UsuarioLogado.getUsuarioLogado().getEmpresa();
|
||||
mensajeEmpresaToUpdate = new ArrayList<MensajeEmpresa>();
|
||||
mensajePuntoVentasToUpdate = new ArrayList<MensajePuntoVenta>();
|
||||
|
||||
mensaje = (Mensaje) Executions.getCurrent().getArg().get("mensaje");
|
||||
|
||||
if (mensaje.getMensajesEmpresa() == null) {
|
||||
mensaje.setMensajesEmpresa(new ArrayList<MensajeEmpresa>());
|
||||
}
|
||||
if (mensaje.getMensajesPuntoVenda() == null) {
|
||||
mensaje.setMensajesPuntoVenda(new ArrayList<MensajePuntoVenta>());
|
||||
}
|
||||
|
||||
super.doAfterCompose(comp);
|
||||
|
||||
if (mensaje.getMensajeId() != null) {
|
||||
descricaoOriginal = mensaje.getDescripcion();
|
||||
chcTipo.setChecked(mensaje.getIndTipo());
|
||||
mensaje.setMensajesPuntoVenda(mensajePuntoVentaService.obtenerPorMensaje(mensaje));
|
||||
mensaje.setMensajesEmpresa(mensajeEmpresaVentaService.obtenerPorMensaje(mensaje));
|
||||
mensaje.setMensajesUsuario(mensajeUsuarioService.obtenerPorMensaje(mensaje));
|
||||
}
|
||||
|
||||
lsAddPuntoVenta = mensaje.getMensajesPuntoVenda();
|
||||
lsAddEmpresa = mensaje.getMensajesEmpresa();
|
||||
|
||||
empresaList.setItemRenderer(new RenderMensajeEmpresa());
|
||||
puntoVentaList.setItemRenderer(new RenderMensajePuntoVenta());
|
||||
|
||||
empresaList.setData(lsAddEmpresa);
|
||||
puntoVentaList.setData(lsAddPuntoVenta);
|
||||
}
|
||||
|
||||
public void onClick$btnSalvar(Event ev) throws InterruptedException, ParseException {
|
||||
txtDataFinal.getValue();
|
||||
txtDataInicial.getValue();
|
||||
txtDescricao.getValue();
|
||||
|
||||
SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
|
||||
Date dataAtual = format.parse(format.format(new Date()));
|
||||
|
||||
if (mensaje.getMensajeId() == null &&
|
||||
mensaje.getFecFin().before(dataAtual)) {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarMensajeController.MSG.dataFinalMenorDataAtual"),
|
||||
Labels.getLabel("editarMensajeController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
return;
|
||||
}
|
||||
if (mensaje.getFecFin().before(mensaje.getFecIni())) {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarMensajeController.MSG.dataFinalMenorDataInicial"),
|
||||
Labels.getLabel("editarMensajeController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
return;
|
||||
}
|
||||
if (empresaList.getItemCount() == 0 && puntoVentaList.getItemCount() == 0) {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarMensajeController.MSG.informarEmpresaPuntoVenta"),
|
||||
Labels.getLabel("editarMensajeController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
return;
|
||||
}
|
||||
if (mensaje.getMensajeId() != null
|
||||
&& !descricaoOriginal.equals(mensaje.getDescripcion())
|
||||
&& mensaje.getFecFin().before(dataAtual)) {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarMensajeController.MSG.alteracaoNaoPermitida"),
|
||||
Labels.getLabel("editarMensajeController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
return;
|
||||
}
|
||||
|
||||
mensaje.setIndTipo(chcTipo.isChecked());
|
||||
mensaje.setActivo(true);
|
||||
mensaje.setFecModif(new Date());
|
||||
mensaje.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
|
||||
if (mensaje.getMensajeId() != null
|
||||
&& !descricaoOriginal.equals(mensaje.getDescripcion())) {
|
||||
for (MensajeUsuario mu : mensaje.getMensajesUsuario()) {
|
||||
mu.setFecModif(new Date());
|
||||
mu.setUsuarioModifId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
mu.setFecLeido(null);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
mensajeService.suscribirActualizar(mensaje);
|
||||
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarMensajeController.MSG.suscribirOK"),
|
||||
Labels.getLabel("editarMensajeController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
|
||||
busquedaMensajeController.refreshLista(false);
|
||||
closeWindow();
|
||||
|
||||
} catch (Exception e) {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("MSG.Error"),
|
||||
Labels.getLabel("editarMensajeController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
|
||||
log.error("", e);
|
||||
}
|
||||
}
|
||||
|
||||
public void onClick$btnApagar(Event ev) throws InterruptedException {
|
||||
try {
|
||||
int opcao = Messagebox.show(
|
||||
Labels.getLabel("editarMensajeController.btnApagar.MSG.desejaApagarMensagem"),
|
||||
Labels.getLabel("editarMensajeController.window.title"),
|
||||
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
||||
|
||||
if (opcao == Messagebox.YES) {
|
||||
mensaje.setFecModif(new Date());
|
||||
mensaje.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
mensajeService.borrar(mensaje);
|
||||
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarMensajeController.btnApagar.MSG.borrarOK"),
|
||||
Labels.getLabel("editarMensajeController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
busquedaMensajeController.refreshLista(false);
|
||||
closeWindow();
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
log.error("", ex);
|
||||
|
||||
Messagebox.show(
|
||||
Labels.getLabel("MSG.Error"),
|
||||
Labels.getLabel("editarAidfController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void onClick$btnAdicionarEmpresa(Event ev) {
|
||||
Comboitem cbiEmpresa = cmbEmpresa.getSelectedItem();
|
||||
if (cbiEmpresa != null) {
|
||||
Empresa empresa = (Empresa) cbiEmpresa.getValue();
|
||||
MensajeEmpresa me = new MensajeEmpresa();
|
||||
Boolean existe = false;
|
||||
|
||||
for (MensajeEmpresa m : lsAddEmpresa) {
|
||||
if (m.getEmpresa().equals(empresa)) {
|
||||
existe = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!existe) {
|
||||
me.setActivo(true);
|
||||
me.setEmpresa(empresa);
|
||||
me.setFecModif(new Date());
|
||||
me.setMensaje(mensaje);
|
||||
me.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
lsAddEmpresa.add(me);
|
||||
empresaList.setData(lsAddEmpresa);
|
||||
}
|
||||
|
||||
cmbEmpresa.setSelectedItem(null);
|
||||
}
|
||||
}
|
||||
|
||||
public void onClick$btnRemoverEmpresa(Event ev) {
|
||||
MensajeEmpresa selected = (MensajeEmpresa) empresaList.getSelected();
|
||||
MensajeEmpresa toRemove = null;
|
||||
if (selected != null) {
|
||||
for (MensajeEmpresa m : lsAddEmpresa) {
|
||||
if (m.getEmpresa().equals(selected.getEmpresa())) {
|
||||
toRemove = m;
|
||||
}
|
||||
}
|
||||
|
||||
if (toRemove == null) {
|
||||
return;
|
||||
} else if (toRemove.getMensajeEmpresaId() != null) {
|
||||
toRemove.setActivo(false);
|
||||
toRemove.setFecModif(new Date());
|
||||
toRemove.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
mensajeEmpresaToUpdate.add(toRemove);
|
||||
}
|
||||
lsAddEmpresa.remove(toRemove);
|
||||
empresaList.setData(lsAddEmpresa);
|
||||
}
|
||||
}
|
||||
|
||||
public void onClick$btnAdicionarPuntoVenta(Event ev) {
|
||||
Comboitem cbiPuntoVenta = cmbPuntoVenta.getSelectedItem();
|
||||
if (cbiPuntoVenta != null) {
|
||||
PuntoVenta puntoVenta = (PuntoVenta) cbiPuntoVenta.getValue();
|
||||
MensajePuntoVenta mp = new MensajePuntoVenta();
|
||||
Boolean existe = false;
|
||||
|
||||
for (MensajePuntoVenta m : lsAddPuntoVenta) {
|
||||
if (m.getPuntoVenda().equals(puntoVenta)) {
|
||||
existe = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!existe) {
|
||||
mp.setActivo(true);
|
||||
mp.setPuntoVenda(puntoVenta);
|
||||
mp.setFecModif(new Date());
|
||||
mp.setMensaje(mensaje);
|
||||
mp.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
lsAddPuntoVenta.add(mp);
|
||||
puntoVentaList.setData(lsAddPuntoVenta);
|
||||
}
|
||||
|
||||
cmbPuntoVenta.setSelectedItem(null);
|
||||
}
|
||||
}
|
||||
|
||||
public void onClick$btnRemoverPuntoVenta(Event ev) {
|
||||
MensajePuntoVenta selected = (MensajePuntoVenta) puntoVentaList.getSelected();
|
||||
MensajePuntoVenta toRemove = null;
|
||||
if (selected != null) {
|
||||
for (MensajePuntoVenta m : lsAddPuntoVenta) {
|
||||
if (m.getPuntoVenda().equals(selected.getPuntoVenda())) {
|
||||
toRemove = m;
|
||||
}
|
||||
}
|
||||
|
||||
if (toRemove == null) {
|
||||
return;
|
||||
} else if (toRemove.getMensajePuntoVendaId() != null) {
|
||||
toRemove.setActivo(false);
|
||||
toRemove.setFecModif(new Date());
|
||||
toRemove.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
mensajePuntoVentasToUpdate.add(toRemove);
|
||||
}
|
||||
lsAddPuntoVenta.remove(toRemove);
|
||||
puntoVentaList.setData(lsAddPuntoVenta);
|
||||
}
|
||||
}
|
||||
|
||||
public Mensaje getMensaje() {
|
||||
return mensaje;
|
||||
}
|
||||
|
||||
public void setMensaje(Mensaje mensaje) {
|
||||
this.mensaje = mensaje;
|
||||
}
|
||||
|
||||
public List<Empresa> getLsEmpresa() {
|
||||
return lsEmpresa;
|
||||
}
|
||||
|
||||
public void setLsEmpresa(List<Empresa> lsEmpresa) {
|
||||
this.lsEmpresa = lsEmpresa;
|
||||
}
|
||||
|
||||
public Combobox getCmbEmpresa() {
|
||||
return cmbEmpresa;
|
||||
}
|
||||
|
||||
public void setCmbEmpresa(Combobox cmbEmpresa) {
|
||||
this.cmbEmpresa = cmbEmpresa;
|
||||
}
|
||||
|
||||
public MyListbox getEmpresaList() {
|
||||
return empresaList;
|
||||
}
|
||||
|
||||
public void setEmpresaList(MyListbox empresaList) {
|
||||
this.empresaList = empresaList;
|
||||
}
|
||||
|
||||
public Combobox getCmbPuntoVenta() {
|
||||
return cmbPuntoVenta;
|
||||
}
|
||||
|
||||
public void setCmbPuntoVenta(Combobox cmbPuntoVenta) {
|
||||
this.cmbPuntoVenta = cmbPuntoVenta;
|
||||
}
|
||||
|
||||
public MyListbox getPuntoVentaList() {
|
||||
return puntoVentaList;
|
||||
}
|
||||
|
||||
public void setPuntoVentaList(MyListbox puntoVentaList) {
|
||||
this.puntoVentaList = puntoVentaList;
|
||||
}
|
||||
|
||||
public Datebox getTxtDataInicial() {
|
||||
return txtDataInicial;
|
||||
}
|
||||
|
||||
public void setTxtDataInicial(Datebox txtDataInicial) {
|
||||
this.txtDataInicial = txtDataInicial;
|
||||
}
|
||||
|
||||
public Datebox getTxtDataFinal() {
|
||||
return txtDataFinal;
|
||||
}
|
||||
|
||||
public void setTxtDataFinal(Datebox txtDataFinal) {
|
||||
this.txtDataFinal = txtDataFinal;
|
||||
}
|
||||
|
||||
public Textbox getTxtDescricao() {
|
||||
return txtDescricao;
|
||||
}
|
||||
|
||||
public void setTxtDescricao(Textbox txtDescricao) {
|
||||
this.txtDescricao = txtDescricao;
|
||||
}
|
||||
|
||||
public Checkbox getChcTipo() {
|
||||
return chcTipo;
|
||||
}
|
||||
|
||||
public void setChcTipo(Checkbox chcTipo) {
|
||||
this.chcTipo = chcTipo;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad;
|
||||
|
||||
import org.zkoss.util.resource.Labels;
|
||||
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
|
||||
|
||||
public class ItemMenuMensaje extends DefaultItemMenuSistema {
|
||||
|
||||
public ItemMenuMensaje() {
|
||||
super("indexController.mniMensaje.label");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getClaveMenu() {
|
||||
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.MENU.MENSAJE";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ejecutar() {
|
||||
PantallaUtileria.openWindow("/gui/seguridad/busquedaMensaje.zul",
|
||||
Labels.getLabel("busquedaMensajeController.window.title"), getArgs(), desktop);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.ListitemRenderer;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Mensaje;
|
||||
|
||||
public class RenderMensaje implements ListitemRenderer {
|
||||
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
Mensaje mensaje = (Mensaje) o;
|
||||
SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
|
||||
|
||||
Listcell lc = new Listcell(mensaje.getMensajeId().toString());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(format.format(mensaje.getFecIni()));
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(format.format(mensaje.getFecFin()));
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(getDescricaoMensagem(mensaje.getDescripcion()));
|
||||
lc.setParent(lstm);
|
||||
|
||||
lstm.setAttribute("data", mensaje);
|
||||
}
|
||||
|
||||
private String getDescricaoMensagem(String descripcion) {
|
||||
|
||||
if (descripcion != null && descripcion.length() > 20) {
|
||||
return descripcion.substring(0, 20) + "...";
|
||||
}
|
||||
|
||||
return descripcion;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
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.MensajeEmpresa;
|
||||
|
||||
public class RenderMensajeEmpresa implements ListitemRenderer {
|
||||
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
MensajeEmpresa mensajeEmpresa = (MensajeEmpresa) o;
|
||||
|
||||
Listcell lc = new Listcell(mensajeEmpresa.getEmpresa().getEmpresaId().toString());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(mensajeEmpresa.getEmpresa().getNombempresa());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lstm.setAttribute("data", mensajeEmpresa);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
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.MensajePuntoVenta;
|
||||
|
||||
public class RenderMensajePuntoVenta implements ListitemRenderer {
|
||||
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
MensajePuntoVenta mensajePuntoVenta = (MensajePuntoVenta) o;
|
||||
|
||||
Listcell lc = new Listcell(mensajePuntoVenta.getPuntoVenda().getPuntoventaId().toString());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(mensajePuntoVenta.getPuntoVenda().getNombpuntoventa());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lstm.setAttribute("data", mensajePuntoVenta);
|
||||
}
|
||||
|
||||
}
|
|
@ -419,6 +419,10 @@
|
|||
<value>com.rjconsultores.ventaboletos.entidad.TarifaMinimaCategoria</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.FiscalAliquotaEmpresa</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.ComEmpConferencia</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.MensajePuntoVenta</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.MensajeEmpresa</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.MensajeUsuario</value>
|
||||
<value>com.rjconsultores.ventaboletos.entidad.Mensaje</value>
|
||||
</list>
|
||||
</property>
|
||||
|
||||
|
|
|
@ -2977,6 +2977,30 @@ editarUsuarioController.lhValidaPreimpreso.label=Valida formulário
|
|||
editarUsuarioController.chkCorteTurnoAutomatico.label = Cierre de caja automático
|
||||
editarUsuarioController.MSG.usuarioempresa = Es necesário informar al menos una empresa
|
||||
|
||||
#Mensaje
|
||||
indexController.mniMensaje.label = Mensagem
|
||||
busquedaMensajeController.window.title = Mensagem
|
||||
|
||||
busquedaMensajeController.id.label = ID
|
||||
busquedaMensajeController.dataInicial.label = Data Inicial
|
||||
busquedaMensajeController.dataFinal.label = Data Final
|
||||
busquedaMensajeController.descricao.label = Descrição
|
||||
busquedaMensajeController.agencias.label = Agências
|
||||
busquedaMensajeController.empresas.label = Empresas
|
||||
|
||||
editarMensajeController.window.title = Mensagem
|
||||
editarMensajeController.repetir.label = Repetir mesmo quando lido
|
||||
editarMensajeController.empresa.label = Empresa
|
||||
editarMensajeController.agencia.label = Agência
|
||||
|
||||
editarMensajeController.MSG.dataFinalMenorDataAtual = Data Final não pode ser menor do que a Data Atual
|
||||
editarMensajeController.MSG.dataFinalMenorDataInicial = Data Final não pode ser menor do que a Data Inicial
|
||||
editarMensajeController.MSG.informarEmpresaPuntoVenta = Favor informar pelo menos uma Agência ou uma Empresa
|
||||
editarMensajeController.MSG.alteracaoNaoPermitida = Não é permitido alterar o conteúdo da mensagem e não informar uma data final maior do que a data atual
|
||||
editarMensajeController.MSG.suscribirOK = Mensagem registrada com sucesso
|
||||
editarMensajeController.btnApagar.MSG.desejaApagarMensagem = Deseja apagar Mensagem?
|
||||
editarMensajeController.btnApagar.MSG.borrarOK = Mensagem apagada com sucesso
|
||||
|
||||
|
||||
#cREADO POR mANUEL
|
||||
|
||||
|
|
|
@ -3047,6 +3047,29 @@ editarUsuarioController.lhValidaPreimpreso.label=Valida Formulário
|
|||
editarUsuarioController.chkCorteTurnoAutomatico.label = Fechamento de Caixa Automático
|
||||
editarUsuarioController.MSG.usuarioempresa = É necessário informar pelo menos um empresa
|
||||
|
||||
#Mensaje
|
||||
indexController.mniMensaje.label = Mensagem
|
||||
busquedaMensajeController.window.title = Mensagem
|
||||
|
||||
busquedaMensajeController.id.label = ID
|
||||
busquedaMensajeController.dataInicial.label = Data Inicial
|
||||
busquedaMensajeController.dataFinal.label = Data Final
|
||||
busquedaMensajeController.descricao.label = Descrição
|
||||
busquedaMensajeController.agencias.label = Agências
|
||||
busquedaMensajeController.empresas.label = Empresas
|
||||
|
||||
editarMensajeController.window.title = Mensagem
|
||||
editarMensajeController.repetir.label = Repetir mesmo quando lido
|
||||
editarMensajeController.empresa.label = Empresa
|
||||
editarMensajeController.agencia.label = Agência
|
||||
|
||||
editarMensajeController.MSG.dataFinalMenorDataAtual = Data Final não pode ser menor do que a Data Atual
|
||||
editarMensajeController.MSG.dataFinalMenorDataInicial = Data Final não pode ser menor do que a Data Inicial
|
||||
editarMensajeController.MSG.informarEmpresaPuntoVenta = Favor informar pelo menos uma Agência ou uma Empresa
|
||||
editarMensajeController.MSG.alteracaoNaoPermitida = Não é permitido alterar o conteúdo da mensagem e não informar uma data final maior do que a data atual
|
||||
editarMensajeController.MSG.suscribirOK = Mensagem registrada com sucesso
|
||||
editarMensajeController.btnApagar.MSG.desejaApagarMensagem = Deseja apagar Mensagem?
|
||||
editarMensajeController.btnApagar.MSG.borrarOK = Mensagem apagada com sucesso
|
||||
|
||||
#cREADO POR mANUEL
|
||||
|
||||
|
|
|
@ -0,0 +1,85 @@
|
|||
<?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="winBusquedaMensaje"?>
|
||||
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||
|
||||
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||
<window id="winBusquedaMensaje"
|
||||
title="${c:l('busquedaMensajeController.window.title')}"
|
||||
apply="${busquedaMensajeController}" contentStyle="overflow:auto"
|
||||
height="400px" width="600px" border="normal">
|
||||
<toolbar>
|
||||
<button id="btnRefresh" image="/gui/img/refresh.png"
|
||||
width="35px"
|
||||
tooltiptext="${c:l('busquedaTipoEventoExtraController.btnRefresh.tooltiptext')}" />
|
||||
<separator orient="vertical" />
|
||||
<button id="btnNovo" image="/gui/img/add.png" width="35px"
|
||||
tooltiptext="${c:l('busquedaTipoEventoExtraController.btnNovo.tooltiptext')}" />
|
||||
<separator orient="vertical" />
|
||||
<button id="btnCerrar"
|
||||
onClick="winBusquedaMensaje.detach()"
|
||||
image="/gui/img/exit.png" width="35px"
|
||||
tooltiptext="${c:l('busquedaTipoEventoExtraController.btnCerrar.tooltiptext')}" />
|
||||
</toolbar>
|
||||
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="30%" />
|
||||
<column width="70%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('busquedaMensajeController.dataInicial.label')}" />
|
||||
<datebox id="txtDataInicial" width="40%"
|
||||
mold="rounded" format="dd/MM/yyyy" lenient="false"
|
||||
maxlength="10" />
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('busquedaMensajeController.dataFinal.label')}" />
|
||||
<datebox id="txtDataFinal" width="40%" mold="rounded"
|
||||
format="dd/MM/yyyy" lenient="false"
|
||||
maxlength="10" />
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('busquedaMensajeController.descricao.label')}" />
|
||||
<textbox id="txtDescricao" width="282px"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<toolbar>
|
||||
<button id="btnPesquisa" image="/gui/img/find.png"
|
||||
label="${c:l('busquedaTipoEventoExtraController.btnPesquisa.label')}" />
|
||||
</toolbar>
|
||||
|
||||
<paging id="pagingMensaje" pageSize="15" />
|
||||
<listbox id="mensajeList"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
vflex="true" multiple="false">
|
||||
<listhead sizable="true">
|
||||
|
||||
<listheader id="lhId" width="10%"
|
||||
image="/gui/img/builder.gif" sort="auto(mensajeId)"
|
||||
label="${c:l('busquedaMensajeController.id.label')}" />
|
||||
|
||||
<listheader
|
||||
image="/gui/img/builder.gif" sort="auto(fecIni)"
|
||||
label="${c:l('busquedaMensajeController.dataInicial.label')}" />
|
||||
|
||||
<listheader
|
||||
sort="auto(fecFin)"
|
||||
label="${c:l('busquedaMensajeController.dataFinal.label')}" />
|
||||
|
||||
<listheader
|
||||
sort="auto(descripcion)"
|
||||
label="${c:l('busquedaMensajeController.descricao.label')}" />
|
||||
|
||||
</listhead>
|
||||
</listbox>
|
||||
</window>
|
||||
</zk>
|
|
@ -0,0 +1,146 @@
|
|||
<?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="winEditarMensaje"?>
|
||||
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||
|
||||
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||
<window id="winEditarMensaje" border="normal"
|
||||
apply="${editarMensajeController}" width="600px" height="440px"
|
||||
contentStyle="overflow:auto"
|
||||
title="${c:l('editarMensajeController.window.title')}">
|
||||
<toolbar>
|
||||
<hbox spacing="5px" style="padding:1px" align="right">
|
||||
<button id="btnApagar" height="20"
|
||||
image="/gui/img/remove.png" width="35px"
|
||||
tooltiptext="${c:l('tooltiptext.btnEliminar')}" />
|
||||
<button id="btnSalvar" height="20"
|
||||
image="/gui/img/save.png" width="35px"
|
||||
tooltiptext="${c:l('tooltiptext.btnGuardar')}" />
|
||||
<button id="btnFechar" height="20"
|
||||
image="/gui/img/exit.png" width="35px"
|
||||
onClick="winEditarMensaje.detach()"
|
||||
tooltiptext="${c:l('tooltiptext.btnFechar')}" />
|
||||
</hbox>
|
||||
</toolbar>
|
||||
|
||||
|
||||
<tabbox id="tb">
|
||||
<tabs id="tabs">
|
||||
<tab id="tabDadosGerais"
|
||||
label="${c:l('indexController.mniMensaje.label')}" />
|
||||
<tab id="tabEmpresas"
|
||||
label="${c:l('busquedaMensajeController.empresas.label')}" />
|
||||
<tab id="tabAgencias"
|
||||
label="${c:l('busquedaMensajeController.agencias.label')}" />
|
||||
</tabs>
|
||||
<tabpanels>
|
||||
<tabpanel>
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="40%" />
|
||||
<column width="60%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('busquedaMensajeController.dataInicial.label')}" />
|
||||
<datebox id="txtDataInicial"
|
||||
width="40%" mold="rounded" format="dd/MM/yyyy" lenient="false"
|
||||
constraint="no empty" maxlength="10"
|
||||
value="@{winEditarMensaje$composer.mensaje.fecIni}" />
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('busquedaMensajeController.dataFinal.label')}" />
|
||||
<datebox id="txtDataFinal" width="40%"
|
||||
mold="rounded" format="dd/MM/yyyy" lenient="false"
|
||||
constraint="no empty" maxlength="10"
|
||||
value="@{winEditarMensaje$composer.mensaje.fecFin}" />
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('busquedaMensajeController.descricao.label')}" />
|
||||
<textbox id="txtDescricao" rows="5"
|
||||
cols="50" value="@{winEditarMensaje$composer.mensaje.descripcion}"
|
||||
constraint="no empty" />
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('editarMensajeController.repetir.label')}" />
|
||||
<checkbox id="chcTipo"
|
||||
value="@{winEditarMensaje$composer.mensaje.tipo}" />
|
||||
</row>
|
||||
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
</tabpanel>
|
||||
|
||||
<tabpanel>
|
||||
<grid fixedLayout="true">
|
||||
<rows>
|
||||
<row>
|
||||
<combobox id="cmbEmpresa"
|
||||
autodrop="false" mold="rounded" buttonVisible="true"
|
||||
width="90%" model="@{winEditarMensaje$composer.lsEmpresa}"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<toolbar>
|
||||
<button id="btnAdicionarEmpresa" height="20"
|
||||
image="/gui/img/add.png" width="35px" />
|
||||
<button id="btnRemoverEmpresa" height="20"
|
||||
image="/gui/img/remove.png" width="35px" />
|
||||
</toolbar>
|
||||
<listbox id="empresaList"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
height="250px">
|
||||
<listhead sizable="true">
|
||||
<listheader width="10%"
|
||||
label="${c:l('busquedaMensajeController.id.label')}" />
|
||||
<listheader
|
||||
label="${c:l('editarMensajeController.empresa.label')}" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
|
||||
</tabpanel>
|
||||
|
||||
<tabpanel>
|
||||
<grid fixedLayout="true">
|
||||
<rows>
|
||||
<row>
|
||||
<combobox id="cmbPuntoVenta"
|
||||
autodrop="false" mold="rounded" buttonVisible="true"
|
||||
width="90%"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<toolbar>
|
||||
<button id="btnAdicionarPuntoVenta" height="20"
|
||||
image="/gui/img/add.png" width="35px" />
|
||||
<button id="btnRemoverPuntoVenta" height="20"
|
||||
image="/gui/img/remove.png" width="35px" />
|
||||
</toolbar>
|
||||
|
||||
<listbox id="puntoVentaList"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
height="250px">
|
||||
<listhead sizable="true">
|
||||
<listheader width="10%"
|
||||
label="${c:l('busquedaMensajeController.id.label')}" />
|
||||
<listheader
|
||||
label="${c:l('editarMensajeController.agencia.label')}" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
</tabpanel>
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
</window>
|
||||
</zk>
|
Loading…
Reference in New Issue