fixed bug #7538 - correção exportação excel tarifa oficial: não era checado se dados não foram encontrados; tentava criar sheets com nomes iguais
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@56640 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
fe5387f659
commit
ec2ebd1514
|
@ -9,6 +9,7 @@ import java.io.FileInputStream;
|
|||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
@ -16,11 +17,18 @@ import java.util.List;
|
|||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.collections.Predicate;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.poi.hssf.usermodel.HSSFCell;
|
||||
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
||||
import org.apache.poi.hssf.usermodel.HSSFFont;
|
||||
import org.apache.poi.hssf.usermodel.HSSFRow;
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.zkoss.util.resource.Labels;
|
||||
import org.zkoss.zhtml.Filedownload;
|
||||
import org.zkoss.zhtml.Messagebox;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zul.Combobox;
|
||||
|
@ -53,13 +61,6 @@ import com.rjconsultores.ventaboletos.web.utilerias.render.RenderEmpresaModifica
|
|||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderMarca;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderMoneda;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTipoPuntoVenta;
|
||||
import java.math.BigInteger;
|
||||
import org.apache.poi.hssf.usermodel.HSSFCell;
|
||||
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
||||
import org.apache.poi.hssf.usermodel.HSSFFont;
|
||||
import org.apache.poi.hssf.usermodel.HSSFRow;
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -296,7 +297,6 @@ public class TarifaOficialExcelController extends MyGenericForwardComposer {
|
|||
|
||||
try {
|
||||
|
||||
|
||||
HSSFWorkbook wb = new HSSFWorkbook();
|
||||
|
||||
// fonte em negrito:
|
||||
|
@ -310,6 +310,13 @@ public class TarifaOficialExcelController extends MyGenericForwardComposer {
|
|||
lsAddRmvClaseServico, new ArrayList<Categoria>(), lsAddRmvEmpresas, lsAddRmvRutas,
|
||||
new ArrayList<TipoPuntoVenta>(), lsAddRmvVigenciaTarifa);
|
||||
|
||||
if(lsRutaCombinacion == null || lsRutaCombinacion.isEmpty()){
|
||||
Messagebox.show(Labels.getLabel("busquedaTarifaController.MSG.dadosVazios"),
|
||||
Labels.getLabel("editarTarifaController.window.title"),
|
||||
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||
return;
|
||||
}
|
||||
|
||||
HSSFSheet sheet1 = null;
|
||||
String ruta = "";
|
||||
int contRow = 0;
|
||||
|
@ -327,7 +334,16 @@ public class TarifaOficialExcelController extends MyGenericForwardComposer {
|
|||
sheetName = (obj[4].toString().concat(" (").concat(obj[12].toString()).concat(")"));
|
||||
}
|
||||
log.debug("Aba: " + sheetName);
|
||||
sheet1 = wb.createSheet(sheetName);
|
||||
|
||||
/*
|
||||
* sheets não podem ter nome > 31 caracteres, caso contrario é cortado
|
||||
* e corre o risco de serem criadas 2 sheets com mesmo nome, o que causa uma excessão.
|
||||
*/
|
||||
String nome = sheetName.replace(" ", "");
|
||||
if(nome.length() > 31){
|
||||
nome = " (".concat(obj[12].toString()).concat(")");
|
||||
}
|
||||
sheet1 = wb.createSheet(nome);
|
||||
contRow = 1;
|
||||
|
||||
HSSFRow rowCabecalho = sheet1.createRow(0);
|
||||
|
|
|
@ -2171,6 +2171,7 @@ busquedaTarifaController.MSG.claseServicio = No se encontró ningún registro co
|
|||
busquedaTarifaController.MSG.vigenciaTarifa = No se encontró ningún registro con esta vigencia
|
||||
busquedaTarifaController.MSG.categoria = No se encontró ningún registro con este tipo pasajero
|
||||
busquedaTarifaController.MSG.tipoPuntoVenta = No se encontró ningún registro con este canal de venta
|
||||
busquedaTarifaController.MSG.dadosVazios= Não foram encontrados dados para gerar o arquivo Excel
|
||||
|
||||
# Editar Tarifa:
|
||||
editarTarifaController.window.title = Tarifa
|
||||
|
|
|
@ -2217,6 +2217,7 @@ busquedaTarifaController.MSG.claseServicio = Não foi encontrado nenhum registro
|
|||
busquedaTarifaController.MSG.vigenciaTarifa = Não foi encontrado nenhum registro com essa vigência
|
||||
busquedaTarifaController.MSG.categoria = Não foi encontrado nenhum registro com esse tipo passageiro
|
||||
busquedaTarifaController.MSG.tipoPuntoVenta = Não foi encontrado nenhum registro com esse canal de Venda
|
||||
busquedaTarifaController.MSG.dadosVazios= Não foram encontrados dados para gerar o arquivo Excel
|
||||
|
||||
# Editar Tarifa:
|
||||
editarTarifaController.window.title = Tarifa
|
||||
|
|
Loading…
Reference in New Issue