fixes bug 7755 - Alteração para deixar URL do Web Service configurada em banco
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@58283 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
629b448798
commit
f054d414da
|
@ -3,6 +3,8 @@ package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URL;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -12,6 +14,7 @@ import javax.xml.bind.JAXBContext;
|
||||||
import javax.xml.bind.JAXBException;
|
import javax.xml.bind.JAXBException;
|
||||||
import javax.xml.bind.Marshaller;
|
import javax.xml.bind.Marshaller;
|
||||||
import javax.xml.bind.PropertyException;
|
import javax.xml.bind.PropertyException;
|
||||||
|
import javax.xml.namespace.QName;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
|
@ -28,6 +31,7 @@ import com.rjconsultores.hstcajservice.ws.BilheteService;
|
||||||
import com.rjconsultores.hstcajservice.ws.BilheteServiceService;
|
import com.rjconsultores.hstcajservice.ws.BilheteServiceService;
|
||||||
import com.rjconsultores.hstcajservice.ws.Bilhetes;
|
import com.rjconsultores.hstcajservice.ws.Bilhetes;
|
||||||
import com.rjconsultores.hstcajservice.ws.ExportaIntegracaoWS;
|
import com.rjconsultores.hstcajservice.ws.ExportaIntegracaoWS;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Constante;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
import com.rjconsultores.ventaboletos.service.ConstanteService;
|
import com.rjconsultores.ventaboletos.service.ConstanteService;
|
||||||
|
@ -88,14 +92,14 @@ public class RelatorioErrosIntegracaoBGMController extends MyGenericForwardCompo
|
||||||
String puntoVentaInicial = ((PuntoVenta)cmbPuntoVentaInicial.getSelectedItem().getValue()).getNumPuntoVenta();
|
String puntoVentaInicial = ((PuntoVenta)cmbPuntoVentaInicial.getSelectedItem().getValue()).getNumPuntoVenta();
|
||||||
String puntoVentaFinal= ((PuntoVenta)cmbPuntoVentaFinal.getSelectedItem().getValue()).getNumPuntoVenta();
|
String puntoVentaFinal= ((PuntoVenta)cmbPuntoVentaFinal.getSelectedItem().getValue()).getNumPuntoVenta();
|
||||||
String empresa= ((Empresa)cmbEmpresa.getSelectedItem().getValue()).getEmpresaId().toString();
|
String empresa= ((Empresa)cmbEmpresa.getSelectedItem().getValue()).getEmpresaId().toString();
|
||||||
|
|
||||||
BilheteServiceService b = new BilheteServiceService();
|
configurarWebService();
|
||||||
bilheteService = b.getBilheteServicePort();
|
|
||||||
Bilhetes bilhetesInconsistentes = new Bilhetes();
|
Bilhetes bilhetesInconsistentes = new Bilhetes();
|
||||||
List<ExportaIntegracaoWS> bilhesteInconsistentesWebService = bilheteService.buscarBilhetesInconsistente(dataInicio, dataFim,
|
List<ExportaIntegracaoWS> bilhetesInconsistentesWebService = bilheteService.buscarBilhetesInconsistente(dataInicio, dataFim,
|
||||||
puntoVentaInicial, puntoVentaFinal, COD_EMPRESA_GRUPO, empresa, "");
|
puntoVentaInicial, puntoVentaFinal, COD_EMPRESA_GRUPO, empresa, "");
|
||||||
if(bilhesteInconsistentesWebService != null && bilhesteInconsistentesWebService.get(bilhesteInconsistentesWebService.size()-1).getRegistros() > 0){
|
if(bilhetesInconsistentesWebService != null && bilhetesInconsistentesWebService.get(bilhetesInconsistentesWebService.size()-1).getRegistros() > 0){
|
||||||
bilhetesInconsistentes.setBilhetes(bilhesteInconsistentesWebService);
|
bilhetesInconsistentes.setBilhetes(bilhetesInconsistentesWebService);
|
||||||
String fileName = gerarArquivoXML(bilhetesInconsistentes);
|
String fileName = gerarArquivoXML(bilhetesInconsistentes);
|
||||||
baixarArquivo(fileName);
|
baixarArquivo(fileName);
|
||||||
}else{
|
}else{
|
||||||
|
@ -110,6 +114,14 @@ public class RelatorioErrosIntegracaoBGMController extends MyGenericForwardCompo
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void configurarWebService() throws MalformedURLException {
|
||||||
|
URL baseUrl = com.rjconsultores.hstcajservice.ws.BilheteServiceService.class.getResource(".");
|
||||||
|
URL url = new URL(baseUrl, getUrlWebService());
|
||||||
|
BilheteServiceService bilheteServiceService = new BilheteServiceService(
|
||||||
|
url, new QName("http://ws.hstcajservice.rjconsultores.com/", "BilheteServiceService"));
|
||||||
|
bilheteService = bilheteServiceService.getBilheteServicePort();
|
||||||
|
}
|
||||||
|
|
||||||
private void baixarArquivo(String fileName) throws FileNotFoundException {
|
private void baixarArquivo(String fileName) throws FileNotFoundException {
|
||||||
FileInputStream inputStream;
|
FileInputStream inputStream;
|
||||||
File filez = new File(fileName);
|
File filez = new File(fileName);
|
||||||
|
@ -130,6 +142,14 @@ public class RelatorioErrosIntegracaoBGMController extends MyGenericForwardCompo
|
||||||
jaxbMarshaller.marshal(bilhetesInconsistentes, new File(fileName));
|
jaxbMarshaller.marshal(bilhetesInconsistentes, new File(fileName));
|
||||||
return fileName;
|
return fileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getUrlWebService() {
|
||||||
|
Constante constante = constanteService.buscarPorNomeConstante("WS_BGM");
|
||||||
|
if (constante == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return constante.getValorconstante();
|
||||||
|
}
|
||||||
|
|
||||||
public void onClick$btnExecutarRelatorio(Event ev) throws Exception{
|
public void onClick$btnExecutarRelatorio(Event ev) throws Exception{
|
||||||
executarRelatorio();
|
executarRelatorio();
|
||||||
|
|
Loading…
Reference in New Issue