fixes bug #9910
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@74496 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
15f9649ebe
commit
6eed731646
|
@ -6,6 +6,7 @@ import java.io.InputStream;
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
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;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
@ -14,7 +15,6 @@ import org.zkoss.util.resource.Labels;
|
||||||
import org.zkoss.zhtml.Filedownload;
|
import org.zkoss.zhtml.Filedownload;
|
||||||
import org.zkoss.zk.ui.Component;
|
import org.zkoss.zk.ui.Component;
|
||||||
import org.zkoss.zk.ui.event.UploadEvent;
|
import org.zkoss.zk.ui.event.UploadEvent;
|
||||||
import org.zkoss.zul.Label;
|
|
||||||
import org.zkoss.zul.Messagebox;
|
import org.zkoss.zul.Messagebox;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
@ -33,9 +33,7 @@ public class ImportarClientesController extends MyGenericForwardComposer {
|
||||||
@Autowired
|
@Autowired
|
||||||
private EmpresaService emresaService;
|
private EmpresaService emresaService;
|
||||||
|
|
||||||
private Label lblQtdeClientesImportar;
|
|
||||||
private MyListbox empresasList;
|
private MyListbox empresasList;
|
||||||
private List<String[]> clientes;
|
|
||||||
private List<Empresa> lsEmpresa;
|
private List<Empresa> lsEmpresa;
|
||||||
private Empresa empresa;
|
private Empresa empresa;
|
||||||
|
|
||||||
|
@ -63,11 +61,18 @@ public class ImportarClientesController extends MyGenericForwardComposer {
|
||||||
reader.close();
|
reader.close();
|
||||||
|
|
||||||
String gravados = resultado[0];
|
String gravados = resultado[0];
|
||||||
Messagebox.show(gravados,
|
|
||||||
Labels.getLabel("importarClientesController.window.title"),
|
|
||||||
Messagebox.OK, Messagebox.INFORMATION);
|
|
||||||
|
|
||||||
String erros = resultado[1];
|
String erros = resultado[1];
|
||||||
|
if (StringUtils.isEmpty(erros)) {
|
||||||
|
Messagebox.show(gravados,
|
||||||
|
Labels.getLabel("importarClientesController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Messagebox.show(gravados,
|
||||||
|
Labels.getLabel("importarClientesController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
if (!erros.isEmpty()) {
|
if (!erros.isEmpty()) {
|
||||||
InputStream is = new ByteArrayInputStream(erros.getBytes());
|
InputStream is = new ByteArrayInputStream(erros.getBytes());
|
||||||
Filedownload.save(is, "application/txt", "erros_importacao.txt");
|
Filedownload.save(is, "application/txt", "erros_importacao.txt");
|
||||||
|
|
Loading…
Reference in New Issue