FIXES BUG #6482
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@46282 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
ebbcceab2e
commit
6b9a6fc7a1
|
@ -6,11 +6,13 @@ package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas;
|
|||
|
||||
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
||||
import com.rjconsultores.ventaboletos.entidad.Marca;
|
||||
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
import com.rjconsultores.ventaboletos.entidad.Plaza;
|
||||
import com.rjconsultores.ventaboletos.entidad.TarifaMinima;
|
||||
import com.rjconsultores.ventaboletos.service.ClaseServicioService;
|
||||
import com.rjconsultores.ventaboletos.service.MarcaService;
|
||||
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
|
||||
import com.rjconsultores.ventaboletos.service.ParadaService;
|
||||
import com.rjconsultores.ventaboletos.service.PlazaService;
|
||||
import com.rjconsultores.ventaboletos.service.TarifaMinimaService;
|
||||
|
@ -55,8 +57,11 @@ public class BusquedaTarifasMinimasController extends MyGenericForwardComposer {
|
|||
private TarifaMinimaService tarifaMinimaService;
|
||||
@Autowired
|
||||
private PlazaService plazaService;
|
||||
@Autowired
|
||||
private OrgaoConcedenteService orgaoConcedenteService;
|
||||
private List<Marca> lsMarcas;
|
||||
private List<ClaseServicio> lsClaseServico;
|
||||
private List<OrgaoConcedente> lsOrgaoConcedente;
|
||||
private List<Plaza> lsPlaza;
|
||||
private MyListbox tarifaMinimaList;
|
||||
private Paging pagingTarifaMinima;
|
||||
|
@ -64,6 +69,7 @@ public class BusquedaTarifasMinimasController extends MyGenericForwardComposer {
|
|||
private Combobox cmbOrigem;
|
||||
private Combobox cmbDestino;
|
||||
private Combobox cmbClaseServicio;
|
||||
private Combobox cmbOrgaoConcedente;
|
||||
|
||||
public Combobox getCmbClaseServicio() {
|
||||
return cmbClaseServicio;
|
||||
|
@ -157,6 +163,22 @@ public class BusquedaTarifasMinimasController extends MyGenericForwardComposer {
|
|||
verTarifaMinima(new TarifaMinima());
|
||||
}
|
||||
|
||||
public List<OrgaoConcedente> getLsOrgaoConcedente() {
|
||||
return lsOrgaoConcedente;
|
||||
}
|
||||
|
||||
public void setLsOrgaoConcedente(List<OrgaoConcedente> lsOrgaoConcedente) {
|
||||
this.lsOrgaoConcedente = lsOrgaoConcedente;
|
||||
}
|
||||
|
||||
public Combobox getCmbOrgaoConcedente() {
|
||||
return cmbOrgaoConcedente;
|
||||
}
|
||||
|
||||
public void setCmbOrgaoConcedente(Combobox cmbOrgaoConcedente) {
|
||||
this.cmbOrgaoConcedente = cmbOrgaoConcedente;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
super.doAfterCompose(comp);
|
||||
|
@ -172,6 +194,7 @@ public class BusquedaTarifasMinimasController extends MyGenericForwardComposer {
|
|||
});
|
||||
|
||||
lsMarcas = marcaService.buscarMarcaPorEmpresa(UsuarioLogado.getUsuarioLogado().getEmpresa());
|
||||
lsOrgaoConcedente = orgaoConcedenteService.obtenerTodos();
|
||||
|
||||
lsClaseServico = new ArrayList<ClaseServicio>();
|
||||
lsClaseServico.add(null);
|
||||
|
@ -202,6 +225,11 @@ public class BusquedaTarifasMinimasController extends MyGenericForwardComposer {
|
|||
new HibernateSearchObject<TarifaMinima>(TarifaMinima.class, pagingTarifaMinima.getPageSize());
|
||||
tarifaMinimaBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
||||
|
||||
OrgaoConcedente orgaoConcedente = (OrgaoConcedente) (cmbOrgaoConcedente.getSelectedItem() != null ? cmbOrgaoConcedente.getSelectedItem().getValue() : null);
|
||||
if (orgaoConcedente != null) {
|
||||
tarifaMinimaBusqueda.addFilterEqual("orgaoConcedente", orgaoConcedente);
|
||||
}
|
||||
|
||||
Parada origem = (Parada) (cmbOrigem.getSelectedItem() != null ? cmbOrigem.getSelectedItem().getValue() : null);
|
||||
if (origem != null) {
|
||||
tarifaMinimaBusqueda.addFilterEqual("origem", origem);
|
||||
|
|
|
@ -7,12 +7,14 @@ package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas;
|
|||
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
||||
import com.rjconsultores.ventaboletos.entidad.Marca;
|
||||
import com.rjconsultores.ventaboletos.entidad.Moneda;
|
||||
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
import com.rjconsultores.ventaboletos.entidad.Plaza;
|
||||
import com.rjconsultores.ventaboletos.entidad.TarifaMinima;
|
||||
import com.rjconsultores.ventaboletos.service.ClaseServicioService;
|
||||
import com.rjconsultores.ventaboletos.service.MarcaService;
|
||||
import com.rjconsultores.ventaboletos.service.MonedaService;
|
||||
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
|
||||
import com.rjconsultores.ventaboletos.service.ParadaService;
|
||||
import com.rjconsultores.ventaboletos.service.PlazaService;
|
||||
import com.rjconsultores.ventaboletos.service.TarifaMinimaService;
|
||||
|
@ -21,8 +23,10 @@ import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada;
|
|||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
|
@ -55,6 +59,8 @@ public class EditarTarifaMinimaController extends MyGenericForwardComposer {
|
|||
private PlazaService plazaService;
|
||||
@Autowired
|
||||
private MonedaService monedaService;
|
||||
@Autowired
|
||||
private OrgaoConcedenteService orgaoConcedenteService;
|
||||
private List<Moneda> lsMoneda;
|
||||
private List<Marca> lsMarcas;
|
||||
private List<ClaseServicio> lsClaseServico;
|
||||
|
@ -66,9 +72,11 @@ public class EditarTarifaMinimaController extends MyGenericForwardComposer {
|
|||
private Combobox cmbClaseServicio;
|
||||
private Combobox cmbMoneda;
|
||||
private Combobox cmbPlaza;
|
||||
private Combobox cmbOrgaoConcedente;
|
||||
private TarifaMinima tarifaMinima;
|
||||
private Button btnApagar;
|
||||
private MyTextboxDecimal txtImportancia;
|
||||
private List<OrgaoConcedente> lsOrgaoConcedente;
|
||||
private static Logger log = Logger.getLogger(EditarTarifaMinimaController.class);
|
||||
|
||||
public List<Moneda> getLsMoneda() {
|
||||
|
@ -167,6 +175,14 @@ public class EditarTarifaMinimaController extends MyGenericForwardComposer {
|
|||
this.cmbPlaza = cmbPlaza;
|
||||
}
|
||||
|
||||
public Combobox getCmbOrgaoConcedente() {
|
||||
return cmbOrgaoConcedente;
|
||||
}
|
||||
|
||||
public void setCmbOrgaoConcedente(Combobox cmbOrgaoConcedente) {
|
||||
this.cmbOrgaoConcedente = cmbOrgaoConcedente;
|
||||
}
|
||||
|
||||
public MyListbox getTarifaMinimaList() {
|
||||
return tarifaMinimaList;
|
||||
}
|
||||
|
@ -198,6 +214,7 @@ public class EditarTarifaMinimaController extends MyGenericForwardComposer {
|
|||
tarifaMinima = (TarifaMinima) Executions.getCurrent().getArg().get("tarifaMinima");
|
||||
tarifaMinimaList = (MyListbox) Executions.getCurrent().getArg().get("tarifaMinimaList");
|
||||
|
||||
lsOrgaoConcedente = orgaoConcedenteService.obtenerTodos();
|
||||
lsMoneda = monedaService.obtenerTodos();
|
||||
lsMarcas = marcaService.buscarMarcaPorEmpresa(UsuarioLogado.getUsuarioLogado().getEmpresa());
|
||||
lsClaseServico = claseServicioService.obtenerTodos();
|
||||
|
@ -218,13 +235,19 @@ public class EditarTarifaMinimaController extends MyGenericForwardComposer {
|
|||
cmbOrigem.getValue(true);
|
||||
cmbDestino.getValue(true);
|
||||
cmbClaseServicio.getValue();
|
||||
cmbOrgaoConcedente.getValue();
|
||||
|
||||
tarifaMinima.setFecmodif(Calendar.getInstance().getTime());
|
||||
tarifaMinima.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
tarifaMinima.setActivo(Boolean.TRUE);
|
||||
|
||||
try {
|
||||
if (tarifaMinima.getMoneda() == null) {
|
||||
if (tarifaMinima.getOrgaoConcedente() == null) {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.orgao"),
|
||||
Labels.getLabel("editarTarifaMinimaController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
}else if (tarifaMinima.getMoneda() == null) {
|
||||
Messagebox.show(
|
||||
Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.moneda"),
|
||||
Labels.getLabel("editarTarifaMinimaController.window.title"),
|
||||
|
@ -263,9 +286,9 @@ public class EditarTarifaMinimaController extends MyGenericForwardComposer {
|
|||
|
||||
} else {
|
||||
if (tarifaMinima.getTarifaminimaId() == null) {
|
||||
List<TarifaMinima> lsTM = tarifaMinimaService.pesquisar(txtImportancia.getValueDecimal(),
|
||||
List<TarifaMinima> lsTM = tarifaMinimaService.pesquisar(
|
||||
tarifaMinima.getMoneda(), tarifaMinima.getPlaza(), tarifaMinima.getMarca(),
|
||||
tarifaMinima.getOrigem(), tarifaMinima.getDestino(), tarifaMinima.getClaseServicio());
|
||||
tarifaMinima.getOrigem(), tarifaMinima.getDestino(), tarifaMinima.getClaseServicio(),tarifaMinima.getOrgaoConcedente() );
|
||||
|
||||
if (lsTM.isEmpty()) {
|
||||
tarifaMinimaService.suscribir(tarifaMinima);
|
||||
|
@ -332,4 +355,12 @@ public class EditarTarifaMinimaController extends MyGenericForwardComposer {
|
|||
log.error(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public List<OrgaoConcedente> getLsOrgaoConcedente() {
|
||||
return lsOrgaoConcedente;
|
||||
}
|
||||
|
||||
public void setLsOrgaoConcedente(List<OrgaoConcedente> lsOrgaoConcedente) {
|
||||
this.lsOrgaoConcedente = lsOrgaoConcedente;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,6 +38,13 @@ public class RenderTarifaMinima implements ListitemRenderer {
|
|||
}
|
||||
lc.setParent(lstm);
|
||||
|
||||
if (tm.getOrgaoConcedente() != null) {
|
||||
lc = new Listcell(tm.getOrgaoConcedente().getDescOrgao());
|
||||
} else {
|
||||
lc = new Listcell("");
|
||||
}
|
||||
lc.setParent(lstm);
|
||||
|
||||
if (tm.getOrigem() != null) {
|
||||
lc = new Listcell(tm.getOrigem().getDescparada());
|
||||
} else {
|
||||
|
|
|
@ -1873,6 +1873,7 @@ busquedaTarifasMinimasController.lhDestino.label = Destino
|
|||
busquedaTarifasMinimasController.lhClaseServicio.label = Clase de servicio
|
||||
busquedaTarifasMinimasController.lhPlaza.label = Plaza
|
||||
busquedaTarifasMinimasController.lhMoneda.label = Moneda
|
||||
busquedaTarifasMinimasController.lhOrgao.label = Órgão Concedente
|
||||
|
||||
# Editar Tarifas MÃnimas
|
||||
editarTarifaMinimaController.window.title = Tarifa mínima
|
||||
|
@ -1887,6 +1888,7 @@ editarTarifaMinimaController.btnFechar.MSG.plaza = Necesita informar una plaza
|
|||
editarTarifaMinimaController.btnFechar.MSG.marca = Necesita informar una marca
|
||||
editarTarifaMinimaController.btnFechar.MSG.origen = Necesita informar un origen
|
||||
editarTarifaMinimaController.btnFechar.MSG.destino = Necesita informar un destino
|
||||
editarTarifaMinimaController.btnFechar.MSG.orgao = Necessita informar um Órgão Concedente
|
||||
editarTarifaMinimaController.btnFechar.MSG.tipo = Necesita informar un tipo de clase
|
||||
|
||||
# Búsqueda de Tarifas:
|
||||
|
|
|
@ -1913,6 +1913,7 @@ busquedaTarifasMinimasController.lhDestino.label = Destino
|
|||
busquedaTarifasMinimasController.lhClaseServicio.label = Tipo de Classe
|
||||
busquedaTarifasMinimasController.lhPlaza.label = Praça
|
||||
busquedaTarifasMinimasController.lhMoneda.label = Moeda
|
||||
busquedaTarifasMinimasController.lhOrgao.label = Órgão Concedente
|
||||
|
||||
# Editar Tarifas Mínimas
|
||||
editarTarifaMinimaController.window.title = Tarifa Mínima
|
||||
|
@ -1927,6 +1928,7 @@ editarTarifaMinimaController.btnFechar.MSG.plaza = Necessita informar uma praça
|
|||
editarTarifaMinimaController.btnFechar.MSG.marca = Necessita informar uma marca
|
||||
editarTarifaMinimaController.btnFechar.MSG.origen = Necessita informar um origem
|
||||
editarTarifaMinimaController.btnFechar.MSG.destino = Necessita informar um destino
|
||||
editarTarifaMinimaController.btnFechar.MSG.orgao = Necessita informar um Órgão Concedente
|
||||
editarTarifaMinimaController.btnFechar.MSG.tipo = Necessita informar um tipo de classe
|
||||
|
||||
# Pesquisa de Tarifas:
|
||||
|
|
|
@ -25,6 +25,13 @@
|
|||
<column width="80%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('busquedaTarifasMinimasController.lhOrgao.label')}" />
|
||||
<combobox id="cmbOrgaoConcedente" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
mold="rounded" buttonVisible="true" width="90%"
|
||||
model="@{winTarifaMinima$composer.lsOrgaoConcedente}"/>
|
||||
</row>
|
||||
<row>
|
||||
<label value="${c:l('busquedaTarifasMinimasController.lhMarca.label')}"/>
|
||||
<combobox id="cmbMarca" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
|
@ -59,12 +66,15 @@
|
|||
<listhead sizable="true">
|
||||
<listheader width="50px" image="/gui/img/builder.gif" label="${c:l('lb.id')}"
|
||||
sort="auto(tarifaminimaId)"/>
|
||||
<listheader id="lhImportetarifa" image="/gui/img/builder.gif" align="right"
|
||||
<listheader id="lhImportetarifa" image="/gui/img/builder.gif" align="right" width="80px"
|
||||
label="${c:l('busquedaTarifasMinimasController.lhImportetarifa.label')}"
|
||||
sort="auto(importetarifa)"/>
|
||||
<listheader id="lhMarca" image="/gui/img/builder.gif"
|
||||
label="${c:l('busquedaTarifasMinimasController.lhMarca.label')}"
|
||||
sort="auto(marca.descmarca)"/>
|
||||
<listheader id="lhOrgaoConcedente" image="/gui/img/builder.gif" width="140px"
|
||||
label="${c:l('busquedaTarifasMinimasController.lhOrgao.label')}"
|
||||
sort="auto(orgaoConcedente.descOrgao)"/>
|
||||
<listheader id="lhOrigem" image="/gui/img/builder.gif"
|
||||
label="${c:l('busquedaTarifasMinimasController.lhOrigem.label')}"
|
||||
sort="auto(origem.descparada)"/>
|
||||
|
@ -77,7 +87,7 @@
|
|||
<listheader id="lhPlaza" image="/gui/img/builder.gif"
|
||||
label="${c:l('busquedaTarifasMinimasController.lhPlaza.label')}"
|
||||
sort="auto(plaza.nombplaza)"/>
|
||||
<listheader id="lhMoneda" image="/gui/img/builder.gif"
|
||||
<listheader id="lhMoneda" image="/gui/img/builder.gif" width="80px"
|
||||
label="${c:l('busquedaTarifasMinimasController.lhMoneda.label')}"
|
||||
sort="auto(moneda.descmoneda)"/>
|
||||
</listhead>
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
</row>
|
||||
<row>
|
||||
<label value="${c:l('busquedaTarifasMinimasController.lhMoneda.label')}"/>
|
||||
<combobox id="cmbMoneda" constraint="no empty"
|
||||
<combobox id="cmbMoneda" constraint="no empty, no negative"
|
||||
mold="rounded" buttonVisible="true" width="90%"
|
||||
model="@{winEditarTarifaMinima$composer.lsMoneda}"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
|
@ -61,6 +61,15 @@
|
|||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
selectedItem="@{winEditarTarifaMinima$composer.tarifaMinima.marca}"/>
|
||||
</row>
|
||||
<row>
|
||||
<label
|
||||
value="${c:l('modificacionMasivaTarifasController.orgaoConcedente.label')}" />
|
||||
<combobox id="cmbOrgaoConcedente" mold="rounded"
|
||||
buttonVisible="true" width="90%" constraint="no empty"
|
||||
model="@{winEditarTarifaMinima$composer.lsOrgaoConcedente}"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||
selectedItem="@{winEditarTarifaMinima$composer.tarifaMinima.orgaoConcedente}"/>
|
||||
</row>
|
||||
<row>
|
||||
<label value="${c:l('busquedaTarifasMinimasController.lhOrigem.label')}"/>
|
||||
<combobox id="cmbOrigem" constraint="no empty"
|
||||
|
|
Loading…
Reference in New Issue