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;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.ReservacionCtrl;
|
||||
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.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;
|
||||
|
@ -23,121 +19,135 @@ import org.zkoss.zk.ui.event.EventListener;
|
|||
import org.zkoss.zul.Datebox;
|
||||
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
|
||||
*/
|
||||
@Controller("busquedaConfiguracionReservacionController")
|
||||
@Scope("prototype")
|
||||
public class BusquedaConfiguracionReservacionController extends MyGenericForwardComposer {
|
||||
|
||||
@Autowired
|
||||
private transient PagedListWrapper<ReservacionCtrl> plwReservacionCtrl;
|
||||
private MyListbox reservacionCtrlList;
|
||||
private Paging pagingReservacionCtrl;
|
||||
private Datebox fecInicio;
|
||||
private Datebox fecFinal;
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Autowired
|
||||
private transient PagedListWrapper<ReservacionCtrl> plwReservacionCtrl;
|
||||
private MyListbox reservacionCtrlList;
|
||||
private Paging pagingReservacionCtrl;
|
||||
private Datebox fecInicio;
|
||||
private Datebox fecFinal;
|
||||
|
||||
public Paging getPagingReservacionCtrl() {
|
||||
return pagingReservacionCtrl;
|
||||
}
|
||||
public Paging getPagingReservacionCtrl() {
|
||||
return pagingReservacionCtrl;
|
||||
}
|
||||
|
||||
public void setPagingReservacionCtrl(Paging pagingReservacionCtrl) {
|
||||
this.pagingReservacionCtrl = pagingReservacionCtrl;
|
||||
}
|
||||
public void setPagingReservacionCtrl(Paging pagingReservacionCtrl) {
|
||||
this.pagingReservacionCtrl = pagingReservacionCtrl;
|
||||
}
|
||||
|
||||
public MyListbox getReservacionCtrlList() {
|
||||
return reservacionCtrlList;
|
||||
}
|
||||
public MyListbox getReservacionCtrlList() {
|
||||
return reservacionCtrlList;
|
||||
}
|
||||
|
||||
public void setReservacionCtrlList(MyListbox reservacionCtrlList) {
|
||||
this.reservacionCtrlList = reservacionCtrlList;
|
||||
}
|
||||
public void setReservacionCtrlList(MyListbox reservacionCtrlList) {
|
||||
this.reservacionCtrlList = reservacionCtrlList;
|
||||
}
|
||||
|
||||
public PagedListWrapper<ReservacionCtrl> getPlwReservacionCtrl() {
|
||||
return plwReservacionCtrl;
|
||||
}
|
||||
public PagedListWrapper<ReservacionCtrl> getPlwReservacionCtrl() {
|
||||
return plwReservacionCtrl;
|
||||
}
|
||||
|
||||
public void setPlwReservacionCtrl(PagedListWrapper<ReservacionCtrl> plwReservacionCtrl) {
|
||||
this.plwReservacionCtrl = plwReservacionCtrl;
|
||||
}
|
||||
public void setPlwReservacionCtrl(PagedListWrapper<ReservacionCtrl> plwReservacionCtrl) {
|
||||
this.plwReservacionCtrl = plwReservacionCtrl;
|
||||
}
|
||||
|
||||
public void onClick$btnPesquisa(Event ev) throws InterruptedException {
|
||||
pesquisarLista();
|
||||
}
|
||||
public void onClick$btnPesquisa(Event ev) throws InterruptedException {
|
||||
pesquisarLista();
|
||||
}
|
||||
|
||||
public void onClick$btnRefresh(Event ev) throws InterruptedException {
|
||||
refreshLista();
|
||||
}
|
||||
public void onClick$btnRefresh(Event ev) throws InterruptedException {
|
||||
refreshLista();
|
||||
}
|
||||
|
||||
public void onClick$btnNovo(Event ev) {
|
||||
verPeriodo(new ReservacionCtrl());
|
||||
}
|
||||
public void onClick$btnNovo(Event ev) {
|
||||
verPeriodo(new ReservacionCtrl());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
super.doAfterCompose(comp);
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
super.doAfterCompose(comp);
|
||||
|
||||
reservacionCtrlList.setItemRenderer(new RenderConfiguracionReservacion());
|
||||
reservacionCtrlList.addEventListener("onDoubleClick", new EventListener() {
|
||||
reservacionCtrlList.setItemRenderer(new RenderConfiguracionReservacion());
|
||||
reservacionCtrlList.addEventListener("onDoubleClick", new EventListener() {
|
||||
|
||||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
ReservacionCtrl rc = (ReservacionCtrl) reservacionCtrlList.getSelected();
|
||||
verPeriodo(rc);
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
ReservacionCtrl rc = (ReservacionCtrl) reservacionCtrlList.getSelected();
|
||||
verPeriodo(rc);
|
||||
}
|
||||
});
|
||||
|
||||
refreshLista();
|
||||
refreshLista();
|
||||
|
||||
fecInicio.focus();
|
||||
}
|
||||
fecInicio.focus();
|
||||
}
|
||||
|
||||
private void verPeriodo(ReservacionCtrl rc) {
|
||||
if (rc == null) {
|
||||
return;
|
||||
}
|
||||
private void verPeriodo(ReservacionCtrl rc) {
|
||||
if (rc == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Map args = new HashMap();
|
||||
args.put("reservacionCtrl", rc);
|
||||
args.put("reservacionCtrlList", reservacionCtrlList);
|
||||
Map args = new HashMap();
|
||||
args.put("reservacionCtrl", rc);
|
||||
args.put("reservacionCtrlList", reservacionCtrlList);
|
||||
|
||||
openWindow("/gui/configuraciones_comerciales/editarConfiguracionReservacion.zul",
|
||||
Labels.getLabel("editarConfiguracionReservacionController.window.title"), args, MODAL);
|
||||
}
|
||||
openWindow("/gui/configuraciones_comerciales/editarConfiguracionReservacion.zul",
|
||||
Labels.getLabel("editarConfiguracionReservacionController.window.title"), args, MODAL);
|
||||
}
|
||||
|
||||
private void refreshLista() throws InterruptedException {
|
||||
HibernateSearchObject<ReservacionCtrl> claseServicioBusqueda =
|
||||
new HibernateSearchObject<ReservacionCtrl>(ReservacionCtrl.class, pagingReservacionCtrl.getPageSize());
|
||||
private void refreshLista() throws InterruptedException {
|
||||
HibernateSearchObject<ReservacionCtrl> claseServicioBusqueda =
|
||||
new HibernateSearchObject<ReservacionCtrl>(ReservacionCtrl.class, pagingReservacionCtrl.getPageSize());
|
||||
|
||||
claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
||||
claseServicioBusqueda.addSortAsc("fecinicio");
|
||||
claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
||||
claseServicioBusqueda.addSortAsc("fecinicio");
|
||||
|
||||
plwReservacionCtrl.init(claseServicioBusqueda, reservacionCtrlList, pagingReservacionCtrl);
|
||||
}
|
||||
plwReservacionCtrl.init(claseServicioBusqueda, reservacionCtrlList, pagingReservacionCtrl);
|
||||
}
|
||||
|
||||
private void pesquisarLista() throws InterruptedException {
|
||||
HibernateSearchObject<ReservacionCtrl> claseServicioBusqueda =
|
||||
new HibernateSearchObject<ReservacionCtrl>(ReservacionCtrl.class, pagingReservacionCtrl.getPageSize());
|
||||
private void pesquisarLista() throws InterruptedException {
|
||||
HibernateSearchObject<ReservacionCtrl> claseServicioBusqueda =
|
||||
new HibernateSearchObject<ReservacionCtrl>(ReservacionCtrl.class, pagingReservacionCtrl.getPageSize());
|
||||
|
||||
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);
|
||||
}
|
||||
if (fecInicio.getValue() != null && fecFinal.getValue() != null) {
|
||||
|
||||
claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
||||
claseServicioBusqueda.addSortAsc("fecinicio");
|
||||
Date inicio = DateUtil.inicioFecha(fecInicio.getValue());
|
||||
Date fin = DateUtil.fimFecha(fecFinal.getValue());
|
||||
|
||||
plwReservacionCtrl.init(claseServicioBusqueda, reservacionCtrlList, pagingReservacionCtrl);
|
||||
claseServicioBusqueda.addFilterGreaterOrEqual("fecinicio", inicio);
|
||||
claseServicioBusqueda.addFilterLessOrEqual("fecfinal", fin);
|
||||
|
||||
if (reservacionCtrlList.getData().length == 0) {
|
||||
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
|
||||
Labels.getLabel("busquedaConfiguracionReservacionController.window.title"),
|
||||
Messagebox.OK, Messagebox.INFORMATION);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Messagebox.show(Labels.getLabel("busquedaConfiguracionReservacionController.periodo.label"),
|
||||
Labels.getLabel("busquedaConfiguracionReservacionController.window.title"),
|
||||
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];
|
||||
Calendar c = Calendar.getInstance();
|
||||
c.setTime(data);
|
||||
System.out.println(DateUtil.getFecInicio().getTime() + " " + c.getTime());
|
||||
Long tempo = DateUtil.getElapsedMinutos(DateUtil.getFecInicio().getTime(), c.getTime());
|
||||
long minutos = (tempo % 60);
|
||||
Integer horas = (tempo.intValue() / 60);
|
||||
|
|
Loading…
Reference in New Issue