gleimar 2012-08-27 20:10:05 +00:00
parent 8b8710dadd
commit ce7a7c7484
2 changed files with 33 additions and 5 deletions

View File

@ -14,15 +14,16 @@ import org.springframework.stereotype.Controller;
import org.zkoss.util.resource.Labels; import org.zkoss.util.resource.Labels;
import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Combobox; import org.zkoss.zul.Combobox;
import org.zkoss.zul.Messagebox; import org.zkoss.zul.Messagebox;
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente; import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
import com.rjconsultores.ventaboletos.entidad.Ruta; import com.rjconsultores.ventaboletos.entidad.Ruta;
import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa;
import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService; import com.rjconsultores.ventaboletos.service.OrgaoConcedenteService;
import com.rjconsultores.ventaboletos.service.RutaService; import com.rjconsultores.ventaboletos.service.RutaService;
import com.rjconsultores.ventaboletos.service.TarifaOficialService; import com.rjconsultores.ventaboletos.service.TarifaOficialService;
import com.rjconsultores.ventaboletos.service.TaxaEmbarqueService;
import com.rjconsultores.ventaboletos.service.VigenciaTarifaService; import com.rjconsultores.ventaboletos.service.VigenciaTarifaService;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
@ -44,10 +45,16 @@ public class GenerarTarifaOrgaoController extends MyGenericForwardComposer {
private TarifaOficialService tarifaOficialService; private TarifaOficialService tarifaOficialService;
@Autowired @Autowired
private OrgaoConcedenteService orgaoConcedenteService; private OrgaoConcedenteService orgaoConcedenteService;
@Autowired
private TaxaEmbarqueService taxaEmbarqueService;
private List<Ruta> lsRuta; private List<Ruta> lsRuta;
private List<OrgaoConcedente> lsOrgaoConcedente; private List<OrgaoConcedente> lsOrgaoConcedente;
private Combobox cmbRuta; private Combobox cmbRuta;
private Combobox cmbOrgaoConcedente; private Combobox cmbOrgaoConcedente;
private Checkbox chkTarifa;
private Checkbox chkTaxaEmbarque;
private Checkbox chkSeguro;
private Checkbox chkPedagio;
@Override @Override
public void doAfterCompose(Component comp) throws Exception { public void doAfterCompose(Component comp) throws Exception {
@ -64,14 +71,26 @@ public class GenerarTarifaOrgaoController extends MyGenericForwardComposer {
Integer rutaId = null; Integer rutaId = null;
Integer orgaoConcedenteId = null;
if (cmbRuta.getSelectedItem() != null){ if (cmbRuta.getSelectedItem() != null){
rutaId=((Ruta)cmbRuta.getSelectedItem().getValue()).getRutaId(); rutaId=((Ruta)cmbRuta.getSelectedItem().getValue()).getRutaId();
} }
Integer qtd = tarifaOficialService.gerarAtualizarTarifaANTT(rutaId); if (cmbOrgaoConcedente.getSelectedItem() != null){
orgaoConcedenteId=((OrgaoConcedente)cmbOrgaoConcedente.getSelectedItem().getValue()).getOrgaoConcedenteId();
}
Messagebox.show(Labels.getLabel("generarTarifaOrgaoController.MSG.suscribirOK").concat(qtd.toString()),
if (chkTarifa.isChecked()){
tarifaOficialService.gerarAtualizarTarifaPorCoeficiente(rutaId, orgaoConcedenteId);
}
if (chkTaxaEmbarque.isChecked()){
taxaEmbarqueService.atualizarTaxaEmbarque(rutaId);
}
Messagebox.show(Labels.getLabel("generarTarifaOrgaoController.MSG.suscribirOK"),
Labels.getLabel("indexController.mniGenerarTarifaOrgao.label"), Labels.getLabel("indexController.mniGenerarTarifaOrgao.label"),
Messagebox.OK, Messagebox.INFORMATION); Messagebox.OK, Messagebox.INFORMATION);
} }

View File

@ -4,7 +4,7 @@
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="winGenerarTarifaOrgao"?> <?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="winGenerarTarifaOrgao"?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?> <?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul"> <zk>
<window id="winGenerarTarifaOrgao" border="normal" apply="${generarTarifaOrgaoController}" width="400px" height="457x" contentStyle="overflow:auto" <window id="winGenerarTarifaOrgao" border="normal" apply="${generarTarifaOrgaoController}" width="400px" height="457x" contentStyle="overflow:auto"
title="${c:l('generarTarifaController.window.title')}"> title="${c:l('generarTarifaController.window.title')}">
<toolbar> <toolbar>
@ -31,8 +31,17 @@
<combobox id="cmbOrgaoConcedente" constraint="no empty" mold="rounded" buttonVisible="true" width="99%" <combobox id="cmbOrgaoConcedente" constraint="no empty" mold="rounded" buttonVisible="true" width="99%"
model="@{winGenerarTarifaOrgao$composer.lsOrgaoConcedente}" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"/> model="@{winGenerarTarifaOrgao$composer.lsOrgaoConcedente}" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"/>
</row> </row>
<row>
<label value="${c:l('generarTarifaOrgaoController.labelComponente.value')}" />
<vbox>
<checkbox id="chkTarifa" label="${c:l('generarTarifaOrgaoController.labelComponenteTarifa.value')}" checked="true"/>
<checkbox id="chkTaxaEmbarque" label="${c:l('generarTarifaOrgaoController.labelComponenteTaxaEmbarque.value')}"/>
<checkbox id="chkSeguro" label="${c:l('generarTarifaOrgaoController.labelComponenteSeguro.value')}"/>
<checkbox id="chkPedagio" label="${c:l('generarTarifaOrgaoController.labelComponentePedagio.value')}"/>
</vbox>
</row>
</rows> </rows>
</grid> </grid>
</window> </window>
</zk> </zk>