From 7b00929102678468d35be9cebc73156ce4241080 Mon Sep 17 00:00:00 2001 From: frederico Date: Thu, 22 Sep 2016 20:37:51 +0000 Subject: [PATCH] fixed bug #8009 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@60583 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../tarifas/EditarCasetaPeajeController.java | 292 +++++++++--------- web/gui/tarifas/editarPracaPedagio.zul | 258 ++++++++-------- 2 files changed, 275 insertions(+), 275 deletions(-) diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarCasetaPeajeController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarCasetaPeajeController.java index 6e182ec5d..5c9859d79 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarCasetaPeajeController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarCasetaPeajeController.java @@ -55,18 +55,18 @@ public class EditarCasetaPeajeController extends MyGenericForwardComposer { private List lsCasetaPeajeExcepcion = new ArrayList();; private List casetaPeajeExcepcionToDelete = new ArrayList(); - private Datebox fecInicio; - private Datebox fecFin; - private Checkbox chkINDLUNES; - private Checkbox chkINDMARTES; - private Checkbox chkINDMIERCOLES; - private Checkbox chkINDJUEVES; - private Checkbox chkINDVIERNES; - private Checkbox chkINDSABADO; - private Checkbox chkINDDOMINGO; - private Timebox horaIni; - private Timebox horaFin; - private MyTextboxDecimal txtPreco; +// private Datebox fecInicio; +// private Datebox fecFin; +// private Checkbox chkINDLUNES; +// private Checkbox chkINDMARTES; +// private Checkbox chkINDMIERCOLES; +// private Checkbox chkINDJUEVES; +// private Checkbox chkINDVIERNES; +// private Checkbox chkINDSABADO; +// private Checkbox chkINDDOMINGO; +// private Timebox horaIni; +// private Timebox horaFin; +// private MyTextboxDecimal txtPreco; private CasetaPeajeExcepcion casetaPeajeExcepcion; @@ -78,9 +78,9 @@ public class EditarCasetaPeajeController extends MyGenericForwardComposer { lsCasetaPeajeExcepcion = casetaPeaje.getLsCasetaPeajeExcepcion(); super.doAfterCompose(comp); - - casetaPeajeExcepcionList.setItemRenderer(new RenderCasetaPeajeExcepcion()); - casetaPeajeExcepcionList.setData(lsCasetaPeajeExcepcion); +// +// casetaPeajeExcepcionList.setItemRenderer(new RenderCasetaPeajeExcepcion()); +// casetaPeajeExcepcionList.setData(lsCasetaPeajeExcepcion); if(casetaPeaje.getCasetaPeajeId() == null) { btnApagar.setVisible(Boolean.FALSE); @@ -117,9 +117,9 @@ public class EditarCasetaPeajeController extends MyGenericForwardComposer { casetaPeajeList.updateItem(casetaPeaje); } - if (!casetaPeajeExcepcionToDelete.isEmpty()) { - casetaPeajeService.deletarVigencias(casetaPeajeExcepcionToDelete); - } +// if (!casetaPeajeExcepcionToDelete.isEmpty()) { +// casetaPeajeService.deletarVigencias(casetaPeajeExcepcionToDelete); +// } Messagebox.show( Labels.getLabel("editarPracaPedagioController.MSG.suscribirOK"), @@ -164,113 +164,113 @@ public class EditarCasetaPeajeController extends MyGenericForwardComposer { } - public void onClick$btnAdicionarCasetaPeajeExcepcion(Event ev) throws InterruptedException{ - txtPreco.getValue(); - casetaPeajeExcepcion = new CasetaPeajeExcepcion(); - casetaPeajeExcepcion.setFecVentaIni(fecInicio.getValue()); - casetaPeajeExcepcion.setFecVentaFin(fecFin.getValue()); - casetaPeajeExcepcion.setINDDOMINGO(chkINDDOMINGO.isChecked()); - casetaPeajeExcepcion.setINDLUNES(chkINDLUNES.isChecked()); - casetaPeajeExcepcion.setINDMARTES(chkINDMARTES.isChecked()); - casetaPeajeExcepcion.setINDMIERCOLES(chkINDMIERCOLES.isChecked()); - casetaPeajeExcepcion.setINDVIERNES(chkINDVIERNES.isChecked()); - casetaPeajeExcepcion.setINDJUEVES(chkINDJUEVES.isChecked()); - casetaPeajeExcepcion.setINDSABADO(chkINDSABADO.isChecked()); - if(horaIni.getValue() == null){ - Calendar horaI=Calendar.getInstance(); - horaI.set(Calendar.getInstance().get(Calendar.YEAR), Calendar.getInstance().get(Calendar.MONTH), Calendar.getInstance().get(Calendar.DATE), 0, 0, 0); - horaIni.setValue(horaI.getTime()); - casetaPeajeExcepcion.setHoraIni(horaIni.getValue()); - }else{ - casetaPeajeExcepcion.setHoraIni(horaIni.getValue()); - } - if(horaFin.getValue() == null){ - Calendar horaF=Calendar.getInstance(); - horaF.set(Calendar.getInstance().get(Calendar.YEAR), Calendar.getInstance().get(Calendar.MONTH), Calendar.getInstance().get(Calendar.DATE), 23, 59, 59); - horaFin.setValue(horaF.getTime()); - casetaPeajeExcepcion.setHoraFin(horaFin.getValue()); - }else{ - casetaPeajeExcepcion.setHoraFin(horaFin.getValue()); - } - - if(!isDataValida(casetaPeajeExcepcion)){ - try { - Messagebox.show( - Labels.getLabel("editarExcepcionPeajeController.MSG.datasInconsistentes.value"), - Labels.getLabel("editarExcepcionPeajeController.window.title"), - Messagebox.OK, Messagebox.EXCLAMATION); - } catch (InterruptedException e) { - e.printStackTrace(); - } - return; - } - - if(!validaHoraFinal(casetaPeajeExcepcion)){ - try { - Messagebox.show( - Labels.getLabel("editarExcepcionPeajeController.MSG.horaInvalida.value"), - Labels.getLabel("editarExcepcionPeajeController.window.title"), - Messagebox.OK, Messagebox.EXCLAMATION); - } catch (InterruptedException e) { - e.printStackTrace(); - } - return; - } - if(!validaHoras(casetaPeajeExcepcion)){ - try { - Messagebox.show( - Labels.getLabel("editarExcepcionPeajeController.MSG.horasInconsistentes.value"), - Labels.getLabel("editarExcepcionPeajeController.window.title"), - Messagebox.OK, Messagebox.EXCLAMATION); - } catch (InterruptedException e) { - e.printStackTrace(); - } - return; - } - - casetaPeajeExcepcion.setPrecio(txtPreco.getValueDecimal()); - - if(lsCasetaPeajeExcepcion == null){ - lsCasetaPeajeExcepcion = new ArrayList(); - } - casetaPeajeExcepcion.setActivo(Boolean.TRUE); - casetaPeajeExcepcion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); - casetaPeajeExcepcion.setFecmodif(Calendar.getInstance().getTime()); - - if(!isCasetaPeajeExcepcionValida(casetaPeajeExcepcion)){ - try { - Messagebox.show( - Labels.getLabel("editarExcepcionPeajeController.MSG.conflitoVigencia.value"), - Labels.getLabel("editarExcepcionPeajeController.window.title"), - Messagebox.OK, Messagebox.EXCLAMATION); - } catch (InterruptedException e) { - e.printStackTrace(); - } - return; - } +// public void onClick$btnAdicionarCasetaPeajeExcepcion(Event ev) throws InterruptedException{ +// txtPreco.getValue(); +// casetaPeajeExcepcion = new CasetaPeajeExcepcion(); +// casetaPeajeExcepcion.setFecVentaIni(fecInicio.getValue()); +// casetaPeajeExcepcion.setFecVentaFin(fecFin.getValue()); +// casetaPeajeExcepcion.setINDDOMINGO(chkINDDOMINGO.isChecked()); +// casetaPeajeExcepcion.setINDLUNES(chkINDLUNES.isChecked()); +// casetaPeajeExcepcion.setINDMARTES(chkINDMARTES.isChecked()); +// casetaPeajeExcepcion.setINDMIERCOLES(chkINDMIERCOLES.isChecked()); +// casetaPeajeExcepcion.setINDVIERNES(chkINDVIERNES.isChecked()); +// casetaPeajeExcepcion.setINDJUEVES(chkINDJUEVES.isChecked()); +// casetaPeajeExcepcion.setINDSABADO(chkINDSABADO.isChecked()); +// if(horaIni.getValue() == null){ +// Calendar horaI=Calendar.getInstance(); +// horaI.set(Calendar.getInstance().get(Calendar.YEAR), Calendar.getInstance().get(Calendar.MONTH), Calendar.getInstance().get(Calendar.DATE), 0, 0, 0); +// horaIni.setValue(horaI.getTime()); +// casetaPeajeExcepcion.setHoraIni(horaIni.getValue()); +// }else{ +// casetaPeajeExcepcion.setHoraIni(horaIni.getValue()); +// } +// if(horaFin.getValue() == null){ +// Calendar horaF=Calendar.getInstance(); +// horaF.set(Calendar.getInstance().get(Calendar.YEAR), Calendar.getInstance().get(Calendar.MONTH), Calendar.getInstance().get(Calendar.DATE), 23, 59, 59); +// horaFin.setValue(horaF.getTime()); +// casetaPeajeExcepcion.setHoraFin(horaFin.getValue()); +// }else{ +// casetaPeajeExcepcion.setHoraFin(horaFin.getValue()); +// } +// +// if(!isDataValida(casetaPeajeExcepcion)){ +// try { +// Messagebox.show( +// Labels.getLabel("editarExcepcionPeajeController.MSG.datasInconsistentes.value"), +// Labels.getLabel("editarExcepcionPeajeController.window.title"), +// Messagebox.OK, Messagebox.EXCLAMATION); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } +// return; +// } +// +// if(!validaHoraFinal(casetaPeajeExcepcion)){ +// try { +// Messagebox.show( +// Labels.getLabel("editarExcepcionPeajeController.MSG.horaInvalida.value"), +// Labels.getLabel("editarExcepcionPeajeController.window.title"), +// Messagebox.OK, Messagebox.EXCLAMATION); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } +// return; +// } +// if(!validaHoras(casetaPeajeExcepcion)){ +// try { +// Messagebox.show( +// Labels.getLabel("editarExcepcionPeajeController.MSG.horasInconsistentes.value"), +// Labels.getLabel("editarExcepcionPeajeController.window.title"), +// Messagebox.OK, Messagebox.EXCLAMATION); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } +// return; +// } +// +// casetaPeajeExcepcion.setPrecio(txtPreco.getValueDecimal()); +// +// if(lsCasetaPeajeExcepcion == null){ +// lsCasetaPeajeExcepcion = new ArrayList(); +// } +// casetaPeajeExcepcion.setActivo(Boolean.TRUE); +// casetaPeajeExcepcion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); +// casetaPeajeExcepcion.setFecmodif(Calendar.getInstance().getTime()); +// +// if(!isCasetaPeajeExcepcionValida(casetaPeajeExcepcion)){ +// try { +// Messagebox.show( +// Labels.getLabel("editarExcepcionPeajeController.MSG.conflitoVigencia.value"), +// Labels.getLabel("editarExcepcionPeajeController.window.title"), +// Messagebox.OK, Messagebox.EXCLAMATION); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } +// return; +// } +// +// lsCasetaPeajeExcepcion.add(casetaPeajeExcepcion); +// if(null != lsCasetaPeajeExcepcion){ +// Collections.sort(lsCasetaPeajeExcepcion); +// } +// casetaPeajeExcepcion.setCasetaPeaje(casetaPeaje); +// casetaPeajeExcepcionList.setData(lsCasetaPeajeExcepcion); +// //casetaPeajeExcepcionService.suscribir(casetaPeajeExcepcion); +// limparInput(); +// } - lsCasetaPeajeExcepcion.add(casetaPeajeExcepcion); - if(null != lsCasetaPeajeExcepcion){ - Collections.sort(lsCasetaPeajeExcepcion); - } - casetaPeajeExcepcion.setCasetaPeaje(casetaPeaje); - casetaPeajeExcepcionList.setData(lsCasetaPeajeExcepcion); - //casetaPeajeExcepcionService.suscribir(casetaPeajeExcepcion); - limparInput(); - } - - public void onClick$btnRemoverCasetaPeajeExcepcion(Event ev) throws InterruptedException { - CasetaPeajeExcepcion cpe = (CasetaPeajeExcepcion) casetaPeajeExcepcionList.getSelected(); - if(cpe != null){ - cpe.setActivo(Boolean.FALSE); - cpe.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); - cpe.setFecmodif(Calendar.getInstance().getTime()); - lsCasetaPeajeExcepcion.remove(cpe); - Collections.sort(lsCasetaPeajeExcepcion); - casetaPeajeExcepcionList.setData(lsCasetaPeajeExcepcion); - casetaPeajeExcepcionService.borrar(cpe); - } - } +// public void onClick$btnRemoverCasetaPeajeExcepcion(Event ev) throws InterruptedException { +// CasetaPeajeExcepcion cpe = (CasetaPeajeExcepcion) casetaPeajeExcepcionList.getSelected(); +// if(cpe != null){ +// cpe.setActivo(Boolean.FALSE); +// cpe.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); +// cpe.setFecmodif(Calendar.getInstance().getTime()); +// lsCasetaPeajeExcepcion.remove(cpe); +// Collections.sort(lsCasetaPeajeExcepcion); +// casetaPeajeExcepcionList.setData(lsCasetaPeajeExcepcion); +// casetaPeajeExcepcionService.borrar(cpe); +// } +// } private boolean isDataValida(CasetaPeajeExcepcion cpe){ if( cpe.getFecVentaIni().after(cpe.getFecVentaFin())){ @@ -357,28 +357,28 @@ public class EditarCasetaPeajeController extends MyGenericForwardComposer { testDate.getTime() <= endDate.getTime(); } - private void limparInput() { - fecInicio.setConstraint(""); - fecInicio.setValue(null); - fecInicio.setConstraint("no empty"); - - fecFin.setConstraint(""); - fecFin.setValue(null); - fecFin.setConstraint("no empty"); - - chkINDDOMINGO.setChecked(false); - chkINDLUNES.setChecked(false); - chkINDMARTES.setChecked(false); - chkINDMIERCOLES.setChecked(false); - chkINDVIERNES.setChecked(false); - chkINDJUEVES.setChecked(false); - chkINDSABADO.setChecked(false); - horaIni.setText(""); - horaFin.setText(""); - txtPreco.setConstraint(""); - txtPreco.setValue(""); - txtPreco.setConstraint("no empty, no zero, no negative, /[0-9]+(\\,[0-9][0-9]?)?/"); - } +// private void limparInput() { +// fecInicio.setConstraint(""); +// fecInicio.setValue(null); +// fecInicio.setConstraint("no empty"); +// +// fecFin.setConstraint(""); +// fecFin.setValue(null); +// fecFin.setConstraint("no empty"); +// +// chkINDDOMINGO.setChecked(false); +// chkINDLUNES.setChecked(false); +// chkINDMARTES.setChecked(false); +// chkINDMIERCOLES.setChecked(false); +// chkINDVIERNES.setChecked(false); +// chkINDJUEVES.setChecked(false); +// chkINDSABADO.setChecked(false); +// horaIni.setText(""); +// horaFin.setText(""); +// txtPreco.setConstraint(""); +// txtPreco.setValue(""); +// txtPreco.setConstraint("no empty, no zero, no negative, /[0-9]+(\\,[0-9][0-9]?)?/"); +// } public MyTextbox getDescricaoPracaPedagio() { return descricaoPracaPedagio; diff --git a/web/gui/tarifas/editarPracaPedagio.zul b/web/gui/tarifas/editarPracaPedagio.zul index 00ef50a3d..fb41fb5f7 100644 --- a/web/gui/tarifas/editarPracaPedagio.zul +++ b/web/gui/tarifas/editarPracaPedagio.zul @@ -6,7 +6,7 @@ @@ -41,139 +41,139 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - -