Gravação de Data/Hora de Reserva na ADM (fixed bug #5354)
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@35759 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
46fd4d3a44
commit
e32ac4b9fd
|
@ -4,14 +4,10 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales;
|
package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.ReservacionCtrl;
|
import java.util.Date;
|
||||||
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.RenderConfiguracionReservacion;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
@ -23,6 +19,14 @@ import org.zkoss.zk.ui.event.EventListener;
|
||||||
import org.zkoss.zul.Datebox;
|
import org.zkoss.zul.Datebox;
|
||||||
import org.zkoss.zul.Paging;
|
import org.zkoss.zul.Paging;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ReservacionCtrl;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||||
|
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.RenderConfiguracionReservacion;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Rafius
|
* @author Rafius
|
||||||
|
@ -31,113 +35,119 @@ import org.zkoss.zul.Paging;
|
||||||
@Scope("prototype")
|
@Scope("prototype")
|
||||||
public class BusquedaConfiguracionReservacionController extends MyGenericForwardComposer {
|
public class BusquedaConfiguracionReservacionController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
@Autowired
|
private static final long serialVersionUID = 1L;
|
||||||
private transient PagedListWrapper<ReservacionCtrl> plwReservacionCtrl;
|
@Autowired
|
||||||
private MyListbox reservacionCtrlList;
|
private transient PagedListWrapper<ReservacionCtrl> plwReservacionCtrl;
|
||||||
private Paging pagingReservacionCtrl;
|
private MyListbox reservacionCtrlList;
|
||||||
private Datebox fecInicio;
|
private Paging pagingReservacionCtrl;
|
||||||
private Datebox fecFinal;
|
private Datebox fecInicio;
|
||||||
|
private Datebox fecFinal;
|
||||||
|
|
||||||
public Paging getPagingReservacionCtrl() {
|
public Paging getPagingReservacionCtrl() {
|
||||||
return pagingReservacionCtrl;
|
return pagingReservacionCtrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPagingReservacionCtrl(Paging pagingReservacionCtrl) {
|
public void setPagingReservacionCtrl(Paging pagingReservacionCtrl) {
|
||||||
this.pagingReservacionCtrl = pagingReservacionCtrl;
|
this.pagingReservacionCtrl = pagingReservacionCtrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MyListbox getReservacionCtrlList() {
|
public MyListbox getReservacionCtrlList() {
|
||||||
return reservacionCtrlList;
|
return reservacionCtrlList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReservacionCtrlList(MyListbox reservacionCtrlList) {
|
public void setReservacionCtrlList(MyListbox reservacionCtrlList) {
|
||||||
this.reservacionCtrlList = reservacionCtrlList;
|
this.reservacionCtrlList = reservacionCtrlList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PagedListWrapper<ReservacionCtrl> getPlwReservacionCtrl() {
|
public PagedListWrapper<ReservacionCtrl> getPlwReservacionCtrl() {
|
||||||
return plwReservacionCtrl;
|
return plwReservacionCtrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPlwReservacionCtrl(PagedListWrapper<ReservacionCtrl> plwReservacionCtrl) {
|
public void setPlwReservacionCtrl(PagedListWrapper<ReservacionCtrl> plwReservacionCtrl) {
|
||||||
this.plwReservacionCtrl = plwReservacionCtrl;
|
this.plwReservacionCtrl = plwReservacionCtrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$btnPesquisa(Event ev) throws InterruptedException {
|
public void onClick$btnPesquisa(Event ev) throws InterruptedException {
|
||||||
pesquisarLista();
|
pesquisarLista();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$btnRefresh(Event ev) throws InterruptedException {
|
public void onClick$btnRefresh(Event ev) throws InterruptedException {
|
||||||
refreshLista();
|
refreshLista();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$btnNovo(Event ev) {
|
public void onClick$btnNovo(Event ev) {
|
||||||
verPeriodo(new ReservacionCtrl());
|
verPeriodo(new ReservacionCtrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
|
|
||||||
reservacionCtrlList.setItemRenderer(new RenderConfiguracionReservacion());
|
reservacionCtrlList.setItemRenderer(new RenderConfiguracionReservacion());
|
||||||
reservacionCtrlList.addEventListener("onDoubleClick", new EventListener() {
|
reservacionCtrlList.addEventListener("onDoubleClick", new EventListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEvent(Event event) throws Exception {
|
public void onEvent(Event event) throws Exception {
|
||||||
ReservacionCtrl rc = (ReservacionCtrl) reservacionCtrlList.getSelected();
|
ReservacionCtrl rc = (ReservacionCtrl) reservacionCtrlList.getSelected();
|
||||||
verPeriodo(rc);
|
verPeriodo(rc);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
refreshLista();
|
refreshLista();
|
||||||
|
|
||||||
fecInicio.focus();
|
fecInicio.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void verPeriodo(ReservacionCtrl rc) {
|
private void verPeriodo(ReservacionCtrl rc) {
|
||||||
if (rc == null) {
|
if (rc == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map args = new HashMap();
|
Map args = new HashMap();
|
||||||
args.put("reservacionCtrl", rc);
|
args.put("reservacionCtrl", rc);
|
||||||
args.put("reservacionCtrlList", reservacionCtrlList);
|
args.put("reservacionCtrlList", reservacionCtrlList);
|
||||||
|
|
||||||
openWindow("/gui/configuraciones_comerciales/editarConfiguracionReservacion.zul",
|
openWindow("/gui/configuraciones_comerciales/editarConfiguracionReservacion.zul",
|
||||||
Labels.getLabel("editarConfiguracionReservacionController.window.title"), args, MODAL);
|
Labels.getLabel("editarConfiguracionReservacionController.window.title"), args, MODAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshLista() throws InterruptedException {
|
private void refreshLista() throws InterruptedException {
|
||||||
HibernateSearchObject<ReservacionCtrl> claseServicioBusqueda =
|
HibernateSearchObject<ReservacionCtrl> claseServicioBusqueda =
|
||||||
new HibernateSearchObject<ReservacionCtrl>(ReservacionCtrl.class, pagingReservacionCtrl.getPageSize());
|
new HibernateSearchObject<ReservacionCtrl>(ReservacionCtrl.class, pagingReservacionCtrl.getPageSize());
|
||||||
|
|
||||||
claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
||||||
claseServicioBusqueda.addSortAsc("fecinicio");
|
claseServicioBusqueda.addSortAsc("fecinicio");
|
||||||
|
|
||||||
plwReservacionCtrl.init(claseServicioBusqueda, reservacionCtrlList, pagingReservacionCtrl);
|
plwReservacionCtrl.init(claseServicioBusqueda, reservacionCtrlList, pagingReservacionCtrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void pesquisarLista() throws InterruptedException {
|
private void pesquisarLista() throws InterruptedException {
|
||||||
HibernateSearchObject<ReservacionCtrl> claseServicioBusqueda =
|
HibernateSearchObject<ReservacionCtrl> claseServicioBusqueda =
|
||||||
new HibernateSearchObject<ReservacionCtrl>(ReservacionCtrl.class, pagingReservacionCtrl.getPageSize());
|
new HibernateSearchObject<ReservacionCtrl>(ReservacionCtrl.class, pagingReservacionCtrl.getPageSize());
|
||||||
|
|
||||||
if (fecInicio.getValue() != null && fecFinal.getValue() != null) {
|
if (fecInicio.getValue() != null && fecFinal.getValue() != null) {
|
||||||
claseServicioBusqueda.addFilterGreaterOrEqual("fecinicio", fecInicio.getValue());
|
|
||||||
claseServicioBusqueda.addFilterLessOrEqual("fecfinal", fecFinal.getValue());
|
|
||||||
} else {
|
|
||||||
Messagebox.show(Labels.getLabel("busquedaConfiguracionReservacionController.periodo.label"),
|
|
||||||
Labels.getLabel("busquedaConfiguracionReservacionController.window.title"),
|
|
||||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
|
||||||
}
|
|
||||||
|
|
||||||
claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
Date inicio = DateUtil.inicioFecha(fecInicio.getValue());
|
||||||
claseServicioBusqueda.addSortAsc("fecinicio");
|
Date fin = DateUtil.fimFecha(fecFinal.getValue());
|
||||||
|
|
||||||
plwReservacionCtrl.init(claseServicioBusqueda, reservacionCtrlList, pagingReservacionCtrl);
|
claseServicioBusqueda.addFilterGreaterOrEqual("fecinicio", inicio);
|
||||||
|
claseServicioBusqueda.addFilterLessOrEqual("fecfinal", fin);
|
||||||
|
|
||||||
if (reservacionCtrlList.getData().length == 0) {
|
} else {
|
||||||
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
|
Messagebox.show(Labels.getLabel("busquedaConfiguracionReservacionController.periodo.label"),
|
||||||
Labels.getLabel("busquedaConfiguracionReservacionController.window.title"),
|
Labels.getLabel("busquedaConfiguracionReservacionController.window.title"),
|
||||||
Messagebox.OK, Messagebox.INFORMATION);
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
||||||
|
claseServicioBusqueda.addSortAsc("fecinicio");
|
||||||
|
|
||||||
|
plwReservacionCtrl.init(claseServicioBusqueda, reservacionCtrlList, pagingReservacionCtrl);
|
||||||
|
|
||||||
|
if (reservacionCtrlList.getData().length == 0) {
|
||||||
|
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
|
||||||
|
Labels.getLabel("busquedaConfiguracionReservacionController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -74,7 +74,6 @@ public class RenderConfiguracionReservacion implements ListitemRenderer {
|
||||||
String[] horaMinuto = new String[2];
|
String[] horaMinuto = new String[2];
|
||||||
Calendar c = Calendar.getInstance();
|
Calendar c = Calendar.getInstance();
|
||||||
c.setTime(data);
|
c.setTime(data);
|
||||||
System.out.println(DateUtil.getFecInicio().getTime() + " " + c.getTime());
|
|
||||||
Long tempo = DateUtil.getElapsedMinutos(DateUtil.getFecInicio().getTime(), c.getTime());
|
Long tempo = DateUtil.getElapsedMinutos(DateUtil.getFecInicio().getTime(), c.getTime());
|
||||||
long minutos = (tempo % 60);
|
long minutos = (tempo % 60);
|
||||||
Integer horas = (tempo.intValue() / 60);
|
Integer horas = (tempo.intValue() / 60);
|
||||||
|
|
Loading…
Reference in New Issue