gleimar 2013-02-05 20:13:00 +00:00
parent 0edc78d4c5
commit f841b0f402
4 changed files with 72 additions and 39 deletions

View File

@ -10,6 +10,8 @@ import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.Predicate;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
@ -782,19 +784,27 @@ public class EditarPuntoVentaController extends MyGenericForwardComposer {
cmbPessoa.getValue();
cmbTipoConta.getValue();
cmbPosicao.getValue();
if (puntoVenta.getPuntoventaId()== null) {
List<PuntoVenta> lsPuntoVenta = puntoVentaService.buscaPuntoVenta(txtNumPtoVta.getValue());
if (!lsPuntoVenta.isEmpty()) {
List<PuntoVenta> lsPuntoVenta = puntoVentaService.buscaPuntoVenta(txtNumPtoVta.getValue());
if (!lsPuntoVenta.isEmpty()) {
boolean exists = CollectionUtils.exists(lsPuntoVenta, new Predicate() {
@Override
public boolean evaluate(Object object) {
return ((PuntoVenta)object).getPuntoventaId().equals(puntoVenta.getPuntoventaId());
}
});
if (!exists){
Messagebox.show(
Labels.getLabel("editarPuntoVentaController.registroNumPtoVtaExiste"),
Labels.getLabel("editarPuntoVentaController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
return;
}
}
try {

View File

@ -12,6 +12,8 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.Predicate;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
@ -231,7 +233,7 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
public void doAfterCompose(Component comp) throws Exception {
lsClase = claseService.buscarTodosExceto(-1);
lsVia = viaService.obtenerTodos();
lsEmpresa = UsuarioLogado.getUsuarioLogado().getEmpresa();
lsEmpresa = UsuarioLogado.getUsuarioLogado().getEmpresa();
lsOrgaoConcedente = orgaoConcedenteService.obtenerTodos();
ruta = (Ruta) Executions.getCurrent().getArg().get("ruta");
@ -260,11 +262,11 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
} else {
rdNo.setChecked(true);
}
if(ruta.getIndSentidoIda() != null){
if(ruta.getIndSentidoIda()){
if (ruta.getIndSentidoIda() != null) {
if (ruta.getIndSentidoIda()) {
radIda.setChecked(true);
radVolta.setChecked(false);
}else{
} else {
radIda.setChecked(false);
radVolta.setChecked(true);
}
@ -589,17 +591,25 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
public void onClick$btnSalvar(Event ev) throws InterruptedException {
txtPrefixo.getValue();
if (ruta.getRutaId()== null) {
List<Ruta> lsRuta = rutaService.buscarNumRuta(txtNumRuta.getValue());
if (!lsRuta.isEmpty()) {
List<Ruta> lsRuta = rutaService.buscarNumRuta(txtNumRuta.getValue());
if (!lsRuta.isEmpty()) {
boolean exists = CollectionUtils.exists(lsRuta, new Predicate() {
@Override
public boolean evaluate(Object object) {
return ((Ruta) object).getRutaId().equals(ruta.getRutaId());
}
});
if (!exists) {
Messagebox.show(
Labels.getLabel("editarCatalogoDeRutaController.registroNumRutaExiste"),
Labels.getLabel("editarCatalogoDeRutaController.window.title"),
Messagebox.OK, Messagebox.EXCLAMATION);
return;
}
}
@ -631,7 +641,6 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
ruta.setClaseServicio((ClaseServicio) cmbClase.getSelectedItem().getValue());
ruta.setVentaOffLine(chkVentaOffLine.isChecked());
if (rdSi.isChecked()) {
ruta.setIndNombreObligatorio(Boolean.TRUE);
} else if (rdNo.isChecked()) {
@ -650,11 +659,11 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
rutaList.addItem(ruta);
Messagebox.show(Labels.getLabel(
"editarCatalogoDeRutaController.MSG.suscribirOK").concat(" ID: "
+ ruta.getRutaId().toString()),
Labels.getLabel("editarCatalogoDeRutaController.window.title"),
Messagebox.OK,
Messagebox.INFORMATION);
"editarCatalogoDeRutaController.MSG.suscribirOK").concat(" ID: "
+ ruta.getRutaId().toString()),
Labels.getLabel("editarCatalogoDeRutaController.window.title"),
Messagebox.OK,
Messagebox.INFORMATION);
closeWindow();
@ -671,10 +680,10 @@ public class EditarCatalogoDeRutaController extends MyGenericForwardComposer
rutaList.updateItem(ruta);
Messagebox.show(Labels.getLabel(
"editarCatalogoDeRutaController.MSG.suscribirOK").concat(" ID: "
+ ruta.getRutaId().toString()),
Labels.getLabel("editarCatalogoDeRutaController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
"editarCatalogoDeRutaController.MSG.suscribirOK").concat(" ID: "
+ ruta.getRutaId().toString()),
Labels.getLabel("editarCatalogoDeRutaController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
closeWindow();
}

View File

@ -119,31 +119,45 @@ public class BusquedaPricingController extends MyGenericForwardComposer {
calendar.setTime(fechaInicio.getValue());
calendar.set(Calendar.HOUR_OF_DAY,0);
calendar.set(Calendar.MINUTE,1);
calendar.set(Calendar.MINUTE,0);
calendar.set(Calendar.SECOND,0);
calendar.set(Calendar.MILLISECOND,0);
calendar1.setTime(fechaFin.getValue());
calendar1.set(Calendar.HOUR_OF_DAY,23);
calendar1.set(Calendar.MINUTE,59);
pricingSearch.addFilterGreaterOrEqual("pricingVigenciaList.fecinicioviaje", calendar.getTime()).addFilterLessOrEqual("pricingVigenciaList.fecfinviaje",calendar1.getTime());
calendar1.set(Calendar.SECOND,59);
calendar1.set(Calendar.MILLISECOND,999);
pricingSearch.addFilterGreaterOrEqual("pricingVigenciaList.fecinicioviaje", calendar.getTime());
pricingSearch.addFilterLessOrEqual("pricingVigenciaList.fecfinviaje",calendar1.getTime());
}else{
if (fechaInicio.getValue() != null){
calendar.setTime(fechaInicio.getValue());
calendar.set(Calendar.HOUR_OF_DAY,0);
calendar.set(Calendar.MINUTE,1);
calendar.set(Calendar.MINUTE,0);
calendar.set(Calendar.SECOND,0);
calendar1.setTime(fechaInicio.getValue());
calendar1.set(Calendar.HOUR_OF_DAY,23);
calendar1.set(Calendar.MINUTE,59);
calendar1.set(Calendar.SECOND,59);
pricingSearch.addFilterGreaterThan("pricingVigenciaList.fecinicioviaje", calendar.getTime()).addFilterLessThan("pricingVigenciaList.fecinicioviaje",calendar1.getTime());
}else if (fechaFin.getValue() != null){
calendar.setTime(fechaFin.getValue());
calendar.set(Calendar.HOUR_OF_DAY,23);
calendar.set(Calendar.MINUTE,59);
calendar.set(Calendar.HOUR_OF_DAY,0);
calendar.set(Calendar.MINUTE,0);
calendar.set(Calendar.SECOND,0);
calendar1.setTime(fechaFin.getValue());
calendar1.set(Calendar.HOUR_OF_DAY,23);
calendar1.set(Calendar.MINUTE,59);
calendar1.set(Calendar.SECOND,59);
pricingSearch.addFilterGreaterThan("pricingVigenciaList.fecfinviaje",calendar.getTime()).addFilterLessThan("pricingVigenciaList.fecfinviaje",calendar1.getTime());
}
}

View File

@ -7,7 +7,7 @@
# <controler>. <id>. <propiedade> = XXX
#Versao do VentaBoleto:
versao = ADM_20130201_1RC104
versao = ADM_20130205_1RC105
# MSG Defaut:
MSG.CONSTRAINT.PORCENTAGEM = Os valores devem estar entre 0 e 100