git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@20875 d1611594-4594-4d17-8e1d-87c2c4800839
parent
481e87e6be
commit
9da0fd314d
|
@ -18,6 +18,8 @@ import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
|
import org.apache.commons.collections.Predicate;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.apache.poi.ss.usermodel.Cell;
|
import org.apache.poi.ss.usermodel.Cell;
|
||||||
import org.apache.poi.ss.usermodel.CellStyle;
|
import org.apache.poi.ss.usermodel.CellStyle;
|
||||||
|
@ -341,11 +343,21 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose
|
||||||
lsAddRmvVigenciaTarifa = new ArrayList<VigenciaTarifa>();
|
lsAddRmvVigenciaTarifa = new ArrayList<VigenciaTarifa>();
|
||||||
|
|
||||||
// eliminando a opcao TODOS de tipo servicio:
|
// eliminando a opcao TODOS de tipo servicio:
|
||||||
Short shortMinus1 = -1;
|
CollectionUtils.filter(lsClaseServico, new Predicate() {
|
||||||
ClaseServicio claseServicioTodos = claseServicioService.obtenerID(shortMinus1);
|
|
||||||
if (claseServicioTodos != null) {
|
@Override
|
||||||
lsClaseServico.remove(claseServicioTodos);
|
public boolean evaluate(Object obj) {
|
||||||
}
|
return !( ((ClaseServicio)obj).getClaseservicioId().equals(ClaseServicio.TODOS));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// eliminando a opcao TODOS da marca:
|
||||||
|
CollectionUtils.filter(lsMarcas, new Predicate() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean evaluate(Object obj) {
|
||||||
|
return !( ((Marca)obj).getMarcaId().equals(Marca.TODOS));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
//Exibir botão para gerar tarifas automaticas
|
//Exibir botão para gerar tarifas automaticas
|
||||||
btnGerarTarifas.setVisible(ApplicationProperties.getInstance().generarTarifasAutomatica());
|
btnGerarTarifas.setVisible(ApplicationProperties.getInstance().generarTarifasAutomatica());
|
||||||
|
@ -356,66 +368,6 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validarTodos() {
|
|
||||||
Short shortMinus1 = -1;
|
|
||||||
|
|
||||||
ClaseServicio claseServicioTodos = claseServicioService.obtenerID(shortMinus1);
|
|
||||||
if (claseServicioTodos != null) {
|
|
||||||
if (lsClaseServico.contains(claseServicioTodos)) {
|
|
||||||
lsClaseServico = claseServicioService.obtenerTodos();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Marca marcaTodos = marcaService.obtenerID(shortMinus1);
|
|
||||||
if (marcaTodos != null) {
|
|
||||||
if (lsMarcas.contains(marcaTodos)) {
|
|
||||||
lsMarcas = marcaService.obtenerTodos();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TipoPuntoVenta tpvTodos = tipoPuntoVentaService.obtenerID(shortMinus1);
|
|
||||||
if (tpvTodos != null) {
|
|
||||||
if (lsTipoPuntoVenta.contains(tpvTodos)) {
|
|
||||||
lsTipoPuntoVenta = tipoPuntoVentaService.obtenerTodos();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Categoria categoriaTodos = categoriaService.obtenerID(-1);
|
|
||||||
if (categoriaTodos != null) {
|
|
||||||
if (lsCategoria.contains(categoriaTodos)) {
|
|
||||||
lsCategoria = categoriaService.obtenerTodos();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
VigenciaTarifa vigenciaTarifaTodos = vigenciaTarifaService.obtenerID(-1);
|
|
||||||
if (vigenciaTarifaTodos != null) {
|
|
||||||
if (lsVigenciaTarifa.contains(vigenciaTarifaTodos)) {
|
|
||||||
lsVigenciaTarifa = vigenciaTarifaService.obtenerTodos();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Moneda monedaTodos = monedaService.obtenerID(-1);
|
|
||||||
if (monedaTodos != null) {
|
|
||||||
if (lsMonedas.contains(monedaTodos)) {
|
|
||||||
lsMonedas = monedaService.obtenerTodos();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Empresa empresaTodos = empresaService.obtenerID(-1);
|
|
||||||
if (empresaTodos != null) {
|
|
||||||
if (lsEmpresas.contains(empresaTodos)) {
|
|
||||||
lsEmpresas = empresaService.obtenerTodos();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Ruta rutaTodos = rutaService.obtenerID(-1);
|
|
||||||
if (rutaTodos != null) {
|
|
||||||
if (lsRutas.contains(rutaTodos)) {
|
|
||||||
lsRutas = rutaService.obtenerTodos();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onClick$btnGerarExcel(Event ev) {
|
public void onClick$btnGerarExcel(Event ev) {
|
||||||
txtPorcentagem.getValue();
|
txtPorcentagem.getValue();
|
||||||
|
|
||||||
|
@ -450,9 +402,6 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TESTE:
|
|
||||||
//List<Tarifa> lsTarifa = tarifaService.obtenerTodos();
|
|
||||||
validarTodos();
|
|
||||||
List<Tarifa> lsTarifa = tarifaService.pesquisar(lsAddRmvMonedas, lsAddRmvMarcas,
|
List<Tarifa> lsTarifa = tarifaService.pesquisar(lsAddRmvMonedas, lsAddRmvMarcas,
|
||||||
lsAddRmvClaseServico, lsAddRmvCategoria, lsAddRmvEmpresas, lsAddRmvRutas,
|
lsAddRmvClaseServico, lsAddRmvCategoria, lsAddRmvEmpresas, lsAddRmvRutas,
|
||||||
lsAddRmvTipoPuntoVenta, lsAddRmvVigenciaTarifa);
|
lsAddRmvTipoPuntoVenta, lsAddRmvVigenciaTarifa);
|
||||||
|
@ -572,7 +521,7 @@ public class ModificacionMasivaTarifasController extends MyGenericForwardCompose
|
||||||
|
|
||||||
boolean success = (new File(nomeArquivo)).delete();
|
boolean success = (new File(nomeArquivo)).delete();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
log.error(ex);
|
log.error("Erro ao executar a exportação masiva",ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue