git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@20778 d1611594-4594-4d17-8e1d-87c2c4800839
parent
e0bbf101d0
commit
5d6a73688e
|
@ -20,8 +20,10 @@ 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.exception.BusinessException;
|
||||||
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.SeguroService;
|
||||||
import com.rjconsultores.ventaboletos.service.TarifaOficialService;
|
import com.rjconsultores.ventaboletos.service.TarifaOficialService;
|
||||||
import com.rjconsultores.ventaboletos.service.TaxaEmbarqueService;
|
import com.rjconsultores.ventaboletos.service.TaxaEmbarqueService;
|
||||||
import com.rjconsultores.ventaboletos.service.VigenciaTarifaService;
|
import com.rjconsultores.ventaboletos.service.VigenciaTarifaService;
|
||||||
|
@ -35,65 +37,76 @@ import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
@Scope("prototype")
|
@Scope("prototype")
|
||||||
public class GenerarTarifaOrgaoController extends MyGenericForwardComposer {
|
public class GenerarTarifaOrgaoController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
private static Logger log = Logger.getLogger(GenerarTarifaOrgaoController.class);
|
private static Logger log = Logger.getLogger(GenerarTarifaOrgaoController.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RutaService rutaService;
|
private RutaService rutaService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private VigenciaTarifaService vigenciaTarifaService;
|
private VigenciaTarifaService vigenciaTarifaService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TarifaOficialService tarifaOficialService;
|
private TarifaOficialService tarifaOficialService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private OrgaoConcedenteService orgaoConcedenteService;
|
private OrgaoConcedenteService orgaoConcedenteService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TaxaEmbarqueService taxaEmbarqueService;
|
private TaxaEmbarqueService taxaEmbarqueService;
|
||||||
private List<Ruta> lsRuta;
|
@Autowired
|
||||||
private List<OrgaoConcedente> lsOrgaoConcedente;
|
private SeguroService seguroService;
|
||||||
private Combobox cmbRuta;
|
private List<Ruta> lsRuta;
|
||||||
private Combobox cmbOrgaoConcedente;
|
private List<OrgaoConcedente> lsOrgaoConcedente;
|
||||||
private Checkbox chkTarifa;
|
private Combobox cmbRuta;
|
||||||
private Checkbox chkTaxaEmbarque;
|
private Combobox cmbOrgaoConcedente;
|
||||||
private Checkbox chkSeguro;
|
private Checkbox chkTarifa;
|
||||||
private Checkbox chkPedagio;
|
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 {
|
||||||
lsOrgaoConcedente = new ArrayList<OrgaoConcedente>();
|
lsOrgaoConcedente = new ArrayList<OrgaoConcedente>();
|
||||||
lsOrgaoConcedente.add(orgaoConcedenteService.obtenerID(3));
|
lsOrgaoConcedente.add(orgaoConcedenteService.obtenerID(3));
|
||||||
|
|
||||||
lsRuta = rutaService.obtenerTodos();
|
lsRuta = rutaService.obtenerTodos();
|
||||||
|
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onClick$btnGenerarVigencia(Event ev) throws InterruptedException {
|
public void onClick$btnGenerarVigencia(Event ev) throws InterruptedException {
|
||||||
cmbOrgaoConcedente.getValue();
|
cmbOrgaoConcedente.getValue();
|
||||||
|
|
||||||
|
Integer rutaId = null;
|
||||||
|
Integer orgaoConcedenteId = null;
|
||||||
|
|
||||||
Integer rutaId = null;
|
if (cmbRuta.getSelectedItem() != null) {
|
||||||
Integer orgaoConcedenteId = null;
|
rutaId = ((Ruta) cmbRuta.getSelectedItem().getValue()).getRutaId();
|
||||||
|
}
|
||||||
|
|
||||||
if (cmbRuta.getSelectedItem() != null){
|
if (cmbOrgaoConcedente.getSelectedItem() != null) {
|
||||||
rutaId=((Ruta)cmbRuta.getSelectedItem().getValue()).getRutaId();
|
orgaoConcedenteId = ((OrgaoConcedente) cmbOrgaoConcedente.getSelectedItem().getValue()).getOrgaoConcedenteId();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmbOrgaoConcedente.getSelectedItem() != null){
|
try {
|
||||||
orgaoConcedenteId=((OrgaoConcedente)cmbOrgaoConcedente.getSelectedItem().getValue()).getOrgaoConcedenteId();
|
if (chkTarifa.isChecked()) {
|
||||||
}
|
tarifaOficialService.gerarAtualizarTarifaPorCoeficiente(rutaId, orgaoConcedenteId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (chkTaxaEmbarque.isChecked()) {
|
||||||
|
taxaEmbarqueService.atualizarTaxaEmbarque(rutaId, orgaoConcedenteId);
|
||||||
|
}
|
||||||
|
|
||||||
if (chkTarifa.isChecked()){
|
if (chkSeguro.isChecked()) {
|
||||||
tarifaOficialService.gerarAtualizarTarifaPorCoeficiente(rutaId, orgaoConcedenteId);
|
seguroService.atualizarSeguroPorKm(rutaId, orgaoConcedenteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chkTaxaEmbarque.isChecked()){
|
Messagebox.show(Labels.getLabel("generarTarifaOrgaoController.MSG.suscribirOK"),
|
||||||
taxaEmbarqueService.atualizarTaxaEmbarque(rutaId, orgaoConcedenteId);
|
Labels.getLabel("indexController.mniGenerarTarifaOrgao.label"),
|
||||||
}
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
|
||||||
Messagebox.show(Labels.getLabel("generarTarifaOrgaoController.MSG.suscribirOK"),
|
} catch (BusinessException e) {
|
||||||
Labels.getLabel("indexController.mniGenerarTarifaOrgao.label"),
|
Messagebox.show(e.getLocalizedMessage(),
|
||||||
Messagebox.OK, Messagebox.INFORMATION);
|
Labels.getLabel("indexController.mniGenerarTarifaOrgao.label"),
|
||||||
}
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public List<Ruta> getLsRuta() {
|
public List<Ruta> getLsRuta() {
|
||||||
return lsRuta;
|
return lsRuta;
|
||||||
|
|
Loading…
Reference in New Issue