fixes bug#14580
dev:JULIO qua:juliana git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@95415 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
c32201c7e7
commit
6e49982eb7
|
@ -6,6 +6,7 @@ public class RelatorioEmbarqueLocalidadeBean {
|
||||||
private String horario;
|
private String horario;
|
||||||
private String linha;
|
private String linha;
|
||||||
private String classe;
|
private String classe;
|
||||||
|
private String prefixo;;
|
||||||
private Long embarques;
|
private Long embarques;
|
||||||
private Integer indexColun;
|
private Integer indexColun;
|
||||||
private Integer indexLinha;
|
private Integer indexLinha;
|
||||||
|
@ -65,6 +66,16 @@ public class RelatorioEmbarqueLocalidadeBean {
|
||||||
public void setClasse(String classe) {
|
public void setClasse(String classe) {
|
||||||
this.classe = classe;
|
this.classe = classe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String getPrefixo() {
|
||||||
|
return prefixo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrefixo(String prefixo) {
|
||||||
|
this.prefixo = prefixo;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
|
|
|
@ -106,8 +106,9 @@ public class RelatorioEmbarqueLocalidadeController extends MyGenericForwardCompo
|
||||||
|
|
||||||
private static final int NUM_LINHA_TITULO = 0;
|
private static final int NUM_LINHA_TITULO = 0;
|
||||||
private static final int NUM_LINHA_PERIODO = 1;
|
private static final int NUM_LINHA_PERIODO = 1;
|
||||||
|
private static final int NUM_FAIXA_HORARIA = 2;
|
||||||
private static final int NUM_LINHA_DATA_EMPRESA = 3;
|
private static final int NUM_LINHA_DATA_EMPRESA = 3;
|
||||||
private static final int NUM_LINHA_INICIO = 5;
|
private static final int NUM_LINHA_INICIO = 4;
|
||||||
|
|
||||||
private Empresa empresa;
|
private Empresa empresa;
|
||||||
private Ruta ruta;
|
private Ruta ruta;
|
||||||
|
@ -203,44 +204,55 @@ public class RelatorioEmbarqueLocalidadeController extends MyGenericForwardCompo
|
||||||
|
|
||||||
private void exportaExcel(Map<String, Map<String, List<RelatorioEmbarqueLocalidadeBean>>> datas) {
|
private void exportaExcel(Map<String, Map<String, List<RelatorioEmbarqueLocalidadeBean>>> datas) {
|
||||||
try {
|
try {
|
||||||
HSSFWorkbook wb = new HSSFWorkbook();
|
HSSFWorkbook wb = new HSSFWorkbook();
|
||||||
|
|
||||||
HSSFCellStyle estiloVerticalMerge = wb.createCellStyle();
|
HSSFSheet sheet1 = null;
|
||||||
estiloVerticalMerge.setVerticalAlignment(CellStyle.ALIGN_CENTER);
|
String dataAtual = DateUtil.getStringDate(new Date(),"dd-MM-yy");
|
||||||
|
sheet1 = wb.createSheet(dataAtual);
|
||||||
|
geraCabecalho(sheet1, dataAtual, wb);
|
||||||
|
|
||||||
HSSFFont font = wb.createFont();
|
HSSFFont font = wb.createFont();
|
||||||
HSSFCellStyle style = wb.createCellStyle();
|
HSSFCellStyle style = wb.createCellStyle();
|
||||||
font.setFontName(HSSFFont.FONT_ARIAL);
|
font.setFontName(HSSFFont.FONT_ARIAL);
|
||||||
font.setFontHeightInPoints((short) 10);
|
font.setFontHeightInPoints((short) 10);
|
||||||
font.setBoldweight(Font.BOLDWEIGHT_BOLD);
|
font.setBoldweight(Font.BOLDWEIGHT_BOLD);
|
||||||
|
font.setColor(HSSFColor.RED.index);
|
||||||
style.setFont(font);
|
style.setFont(font);
|
||||||
|
|
||||||
HSSFSheet sheet1 = null;
|
|
||||||
|
HSSFFont fonteTotal = wb.createFont();
|
||||||
|
fonteTotal.setColor(HSSFColor.RED.index);
|
||||||
|
HSSFCellStyle styleTotal = wb.createCellStyle();
|
||||||
|
styleTotal.setAlignment(HSSFCellStyle.ALIGN_CENTER);
|
||||||
|
styleTotal.setFont(fonteTotal);
|
||||||
|
|
||||||
int linha = NUM_LINHA_INICIO;
|
int linha = NUM_LINHA_INICIO;
|
||||||
HSSFRow row = null;
|
HSSFRow row = null;
|
||||||
String dataAtual = DateUtil.getStringDate(new Date(),"dd-MM-yy");
|
|
||||||
sheet1 = wb.createSheet(dataAtual);
|
|
||||||
geraCabecalho(sheet1, dataAtual, wb);
|
|
||||||
|
|
||||||
Map<String, Integer> linhas = new HashMap<String, Integer>();
|
Map<String, Integer> linhas = new HashMap<String, Integer>();
|
||||||
int totalGeral = 0;
|
int totalGeral = 0;
|
||||||
|
|
||||||
int linhaTotalizador = 6;
|
int linhaTotalizador = 6;
|
||||||
HSSFCell cellTotal = null;
|
HSSFCell cellTotal = null;
|
||||||
|
|
||||||
|
HSSFCellStyle estiloVerticalMerge = wb.createCellStyle();
|
||||||
|
estiloVerticalMerge.setAlignment(CellStyle.ALIGN_CENTER);
|
||||||
|
estiloVerticalMerge.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
|
||||||
|
|
||||||
for (RelatorioEmbarqueLocalidadeBean bean : ls) {
|
for (RelatorioEmbarqueLocalidadeBean bean : ls) {
|
||||||
|
|
||||||
int indexColun = mapAux.get(bean.getHorario());
|
int indexColun = mapAux.get(bean.getHorario());
|
||||||
|
|
||||||
if (!linhas.containsKey(bean.getLinha())) {
|
if (!linhas.containsKey(bean.getPrefixo()+bean.getLinha())) {
|
||||||
linhas.put(bean.getLinha(), linha);
|
linhas.put(bean.getPrefixo()+bean.getLinha(), linha);
|
||||||
row = sheet1.createRow(linha);
|
row = sheet1.createRow(linha);
|
||||||
linhaTotalizador = linha;
|
linhaTotalizador = linha;
|
||||||
linha++;
|
linha++;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
row = sheet1.getRow(linhas.get(bean.getLinha()));
|
row = sheet1.getRow(linhas.get(bean.getPrefixo()+bean.getLinha()));
|
||||||
linhaTotalizador = sheet1.getRow(linhas.get(bean.getLinha())).getRowNum();
|
linhaTotalizador = sheet1.getRow(linhas.get(bean.getPrefixo()+bean.getLinha())).getRowNum();
|
||||||
}
|
}
|
||||||
|
|
||||||
HSSFCell cellHorario = row.createCell(0);
|
HSSFCell cellHorario = row.createCell(0);
|
||||||
|
@ -249,39 +261,56 @@ public class RelatorioEmbarqueLocalidadeController extends MyGenericForwardCompo
|
||||||
cellTotal = row.createCell(mapAux.size() + 3);
|
cellTotal = row.createCell(mapAux.size() + 3);
|
||||||
|
|
||||||
row.createCell(indexColun).setCellValue(bean.getEmbarques());
|
row.createCell(indexColun).setCellValue(bean.getEmbarques());
|
||||||
row.createCell(0).setCellValue(bean.getLinha());
|
row.createCell(0).setCellValue(bean.getPrefixo());
|
||||||
row.createCell(1).setCellValue(bean.getClasse());
|
row.createCell(1).setCellValue(bean.getClasse());
|
||||||
|
row.createCell(2).setCellValue(bean.getLinha());
|
||||||
cellTotal.setCellStyle(estiloVerticalMerge);
|
cellTotal.setCellStyle(styleTotal);
|
||||||
String colluna;
|
String colluna;
|
||||||
String celTotal;
|
String celTotal;
|
||||||
colluna = CellReference.convertNumToColString(mapAux.size() + 2);
|
colluna = CellReference.convertNumToColString(mapAux.size() + 2);
|
||||||
celTotal = "SUM(D" + (linhaTotalizador + 1) + ":" + colluna + (linhaTotalizador + 1) + ")";
|
celTotal = "SUM(D" + (linhaTotalizador + 1) + ":" + colluna + (linhaTotalizador + 1) + ")";
|
||||||
row.createCell(mapAux.size() + 3).setCellValue(celTotal);
|
row.createCell(mapAux.size() + 3).setCellValue(celTotal);
|
||||||
cellTotal.setCellFormula(celTotal);
|
cellTotal.setCellFormula(celTotal);
|
||||||
cellTotal.setCellStyle(style);
|
|
||||||
|
|
||||||
totalGeral += bean.getEmbarques();
|
totalGeral += bean.getEmbarques();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
row = sheet1.createRow(linha);
|
row = sheet1.createRow(linha+3);
|
||||||
int qtdLinhas = linhas.size() + 5;
|
int qtdLinhas = linhas.size() + 4;
|
||||||
|
|
||||||
int somatorioColuna = 3;
|
int somatorioColuna = 3;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (int i = 3; i < mapAux.size() + 3; i++) {
|
for (int i = 3; i < mapAux.size() + 3; i++) {
|
||||||
|
|
||||||
String colluna = CellReference.convertNumToColString(i);
|
String colluna = CellReference.convertNumToColString(i);
|
||||||
cellTotal = row.createCell(somatorioColuna);
|
cellTotal = row.createCell(somatorioColuna);
|
||||||
cellTotal.setCellFormula("SUM(" + colluna + 6 + ":" + colluna + (qtdLinhas) + ")");
|
cellTotal.setCellFormula("SUM(" + colluna + 5 + ":" + colluna + (qtdLinhas) + ")");
|
||||||
cellTotal.setCellStyle(style);
|
cellTotal.setCellStyle(styleTotal);
|
||||||
somatorioColuna++;
|
somatorioColuna++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sheet1.addMergedRegion(new CellRangeAddress(
|
||||||
|
linha+3, // first row (0-based)
|
||||||
|
linha+3 , // last row (0-based)
|
||||||
|
0, // first column (0-based)
|
||||||
|
2 // last column (0-based)
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
|
HSSFCell cellTotalPorFaixaEtaria = row.createCell(0);
|
||||||
|
cellTotalPorFaixaEtaria.setCellValue("TOTAL POR FAIXA HORÁRIA");
|
||||||
|
cellTotalPorFaixaEtaria.setCellStyle(styleTotal);
|
||||||
|
|
||||||
HSSFCell cellTotalValue = row.createCell(total);
|
HSSFCell cellTotalValue = row.createCell(total);
|
||||||
cellTotalValue = row.createCell(mapAux.size() + 3);
|
cellTotalValue = row.createCell(mapAux.size() + 3);
|
||||||
cellTotalValue.setCellValue(totalGeral);
|
cellTotalValue.setCellValue(totalGeral);
|
||||||
cellTotalValue.setCellStyle(style);
|
cellTotalValue.setCellStyle(styleTotal);
|
||||||
|
|
||||||
linha = NUM_LINHA_INICIO;
|
linha = NUM_LINHA_INICIO;
|
||||||
|
|
||||||
|
@ -331,71 +360,59 @@ public class RelatorioEmbarqueLocalidadeController extends MyGenericForwardCompo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void geraCabecalhoTitulo(HSSFSheet sheet1, HSSFWorkbook wb) {
|
private void geraCabecalhoTitulo(HSSFSheet sheet1, HSSFWorkbook wb,Integer somaColuna, String nomeEmpresa) {
|
||||||
HSSFRow titulo = sheet1.createRow(NUM_LINHA_TITULO);
|
HSSFRow titulo = sheet1.createRow(NUM_LINHA_TITULO);
|
||||||
sheet1.addMergedRegion(new CellRangeAddress(
|
sheet1.addMergedRegion(new CellRangeAddress(
|
||||||
NUM_LINHA_TITULO, // first row (0-based)
|
NUM_LINHA_TITULO, // first row (0-based)
|
||||||
NUM_LINHA_TITULO, // last row (0-based)
|
NUM_LINHA_TITULO, // last row (0-based)
|
||||||
0, // first column (0-based)
|
0, // first column (0-based)
|
||||||
7 // last column (0-based)
|
somaColuna // last column (0-based)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HSSFFont fonte = wb.createFont();
|
HSSFFont fonteTitulo = wb.createFont();
|
||||||
fonte.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
|
fonteTitulo.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
|
||||||
HSSFCellStyle estilo = wb.createCellStyle();
|
fonteTitulo.setColor(HSSFColor.RED.index);
|
||||||
estilo.setFont(fonte);
|
// fonteTitulo.setFontHeight((short) 12);
|
||||||
|
HSSFCellStyle estilo = wb.createCellStyle();
|
||||||
titulo.createCell(0).setCellValue("EMBARQUE POR LOCALIDADE");
|
|
||||||
|
HSSFCell cell = titulo.createCell(0);
|
||||||
|
cell.setCellValue(nomeEmpresa);
|
||||||
|
HSSFCellStyle styleTitulo = wb.createCellStyle();
|
||||||
|
styleTitulo.setAlignment(HSSFCellStyle.ALIGN_CENTER);
|
||||||
|
styleTitulo.setFont(fonteTitulo);
|
||||||
|
|
||||||
|
cell.setCellStyle(styleTitulo);
|
||||||
titulo.setRowStyle(estilo);
|
titulo.setRowStyle(estilo);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void geraCabecalhoPeriodo(HSSFSheet sheet1) {
|
|
||||||
HSSFRow periodo = sheet1.createRow(NUM_LINHA_PERIODO);
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
|
|
||||||
|
|
||||||
sheet1.addMergedRegion(new CellRangeAddress(
|
private void geraCabecalhoPeriodo(HSSFSheet sheet1,HSSFWorkbook wb,Integer somaColuna) {
|
||||||
NUM_LINHA_PERIODO, // first row (0-based)
|
HSSFRow periodo = sheet1.createRow(NUM_LINHA_PERIODO);
|
||||||
NUM_LINHA_PERIODO, // last row (0-based)
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
|
||||||
0, // first column (0-based)
|
|
||||||
7 // last column (0-based)
|
|
||||||
));
|
|
||||||
periodo.createCell(0).setCellValue("Período: " + sdf.format(this.datInicial.getValue()) + " a " + sdf.format(this.datFinal.getValue()));
|
|
||||||
|
|
||||||
|
sheet1.addMergedRegion(new CellRangeAddress(
|
||||||
|
NUM_LINHA_PERIODO, // first row (0-based)
|
||||||
|
NUM_LINHA_PERIODO, // last row (0-based)
|
||||||
|
0, // first column (0-based)
|
||||||
|
somaColuna // last column (0-based)
|
||||||
|
));
|
||||||
|
HSSFCell cell = periodo.createCell(0);
|
||||||
|
cell.setCellValue("PASSAGEIRO TRANSPORTADO/Período: " + sdf.format(this.datInicial.getValue()) + " a " + sdf.format(this.datFinal.getValue()));
|
||||||
|
|
||||||
|
HSSFFont fontePeriodo= wb.createFont();
|
||||||
|
fontePeriodo.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
|
||||||
|
fontePeriodo.setFontHeight((short) 11);
|
||||||
|
|
||||||
|
HSSFCellStyle stylePeriodo = wb.createCellStyle();
|
||||||
|
stylePeriodo.setAlignment(HSSFCellStyle.ALIGN_CENTER);
|
||||||
|
cell.setCellStyle(stylePeriodo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void geraCabecalho(HSSFSheet sheet1, String dataAtual, HSSFWorkbook wb) {
|
||||||
|
|
||||||
private void geraCabecalho(HSSFSheet sheet1, String dataAtual, HSSFWorkbook wb) {
|
HSSFRow r1 = sheet1.createRow(NUM_LINHA_DATA_EMPRESA);
|
||||||
|
|
||||||
geraCabecalhoTitulo(sheet1, wb);
|
|
||||||
|
|
||||||
geraCabecalhoPeriodo(sheet1);
|
|
||||||
|
|
||||||
sheet1.addMergedRegion(new CellRangeAddress(
|
|
||||||
NUM_LINHA_DATA_EMPRESA, // first row (0-based)
|
|
||||||
NUM_LINHA_DATA_EMPRESA, // last row (0-based)
|
|
||||||
1, // first column (0-based)
|
|
||||||
7 // last column (0-based)
|
|
||||||
));
|
|
||||||
HSSFFont font = wb.createFont();
|
|
||||||
HSSFCellStyle style = wb.createCellStyle();
|
|
||||||
font.setFontName(HSSFFont.FONT_ARIAL);
|
|
||||||
font.setFontHeightInPoints((short) 10);
|
|
||||||
font.setBoldweight(Font.BOLDWEIGHT_BOLD);
|
|
||||||
style.setFont(font);
|
|
||||||
// Montando o Cabeçalho
|
|
||||||
HSSFRow r0 = sheet1.createRow(NUM_LINHA_DATA_EMPRESA);
|
|
||||||
|
|
||||||
if (empresa != null) {
|
|
||||||
r0.createCell(1).setCellValue("EMPRESA: " + empresa.getNombempresa());
|
|
||||||
r0.getCell(1).setCellStyle(style);
|
|
||||||
r0.createCell(1).setCellValue("EMPRESA: " + empresa.getNombempresa());
|
|
||||||
r0.getCell(1).setCellStyle(style);
|
|
||||||
font.setColor(HSSFColor.RED.index);
|
|
||||||
style.setFont(font);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
HSSFRow r1 = sheet1.createRow(NUM_LINHA_DATA_EMPRESA + 1);
|
|
||||||
List<RelatorioEmbarqueLocalidadeBean> lsAux = new ArrayList<RelatorioEmbarqueLocalidadeBean>();
|
List<RelatorioEmbarqueLocalidadeBean> lsAux = new ArrayList<RelatorioEmbarqueLocalidadeBean>();
|
||||||
|
|
||||||
mapAux = new HashMap<String, Integer>();
|
mapAux = new HashMap<String, Integer>();
|
||||||
|
@ -415,22 +432,83 @@ public class RelatorioEmbarqueLocalidadeController extends MyGenericForwardCompo
|
||||||
}
|
}
|
||||||
lsAux.add(bean);
|
lsAux.add(bean);
|
||||||
}
|
}
|
||||||
i = 3;
|
|
||||||
|
|
||||||
|
String valorEmpresa= empresa==null? "EMPRESA: TODOS" :"EMPRESA: " + empresa.getNombempresa();
|
||||||
|
|
||||||
|
geraCabecalhoTitulo(sheet1, wb, i, valorEmpresa);
|
||||||
|
|
||||||
|
geraCabecalhoPeriodo(sheet1, wb,i );
|
||||||
|
|
||||||
|
sheet1.addMergedRegion(new CellRangeAddress(
|
||||||
|
NUM_FAIXA_HORARIA, // first row (0-based)
|
||||||
|
NUM_FAIXA_HORARIA+1 , // last row (0-based)
|
||||||
|
0, // first column (0-based)
|
||||||
|
2 // last column (0-based)
|
||||||
|
));
|
||||||
|
|
||||||
|
HSSFFont fontCodigoNomeLinha = wb.createFont();
|
||||||
|
fontCodigoNomeLinha.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
|
||||||
|
|
||||||
|
|
||||||
|
HSSFCellStyle estiloCellCodigoNomeLinha = wb.createCellStyle();
|
||||||
|
estiloCellCodigoNomeLinha.setAlignment(HSSFCellStyle.ALIGN_CENTER);
|
||||||
|
estiloCellCodigoNomeLinha.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
|
||||||
|
estiloCellCodigoNomeLinha.setFont(fontCodigoNomeLinha);
|
||||||
|
|
||||||
|
HSSFRow periodo = sheet1.createRow(NUM_FAIXA_HORARIA);
|
||||||
|
HSSFCell cell = periodo.createCell(0);
|
||||||
|
cell.setCellValue("CÓDIGO- NOME DA LINHA");
|
||||||
|
cell.setCellStyle(estiloCellCodigoNomeLinha);
|
||||||
|
|
||||||
|
|
||||||
|
sheet1.addMergedRegion(new CellRangeAddress(
|
||||||
|
NUM_FAIXA_HORARIA, // first row (0-based)
|
||||||
|
NUM_FAIXA_HORARIA , // last row (0-based)
|
||||||
|
3, // first column (0-based)
|
||||||
|
i==3?3:i-1 // last column (0-based)
|
||||||
|
));
|
||||||
|
|
||||||
|
sheet1.addMergedRegion(new CellRangeAddress(
|
||||||
|
NUM_FAIXA_HORARIA, // first row (0-based)
|
||||||
|
NUM_FAIXA_HORARIA+1 , // last row (0-based)
|
||||||
|
i, // first column (0-based)
|
||||||
|
i // last column (0-based)
|
||||||
|
));
|
||||||
|
|
||||||
|
HSSFCell cell1 = periodo.createCell(3);
|
||||||
|
cell1.setCellValue("FAIXA HORÁRIA");
|
||||||
|
cell1.setCellStyle(estiloCellCodigoNomeLinha);
|
||||||
|
|
||||||
|
i = 3;
|
||||||
mapAux = new TreeMap<String, Integer>(map);
|
mapAux = new TreeMap<String, Integer>(map);
|
||||||
HSSFFont fontHorario = wb.createFont();
|
HSSFFont fontHorario = wb.createFont();
|
||||||
HSSFCellStyle styleHorario = wb.createCellStyle();
|
HSSFCellStyle styleHorario = wb.createCellStyle();
|
||||||
fontHorario.setColor(HSSFColor.BLACK.index);
|
|
||||||
fontHorario.setBoldweight(Font.BOLDWEIGHT_BOLD);
|
fontHorario.setBoldweight(Font.BOLDWEIGHT_BOLD);
|
||||||
styleHorario.setFont(fontHorario);
|
styleHorario.setFont(fontHorario);
|
||||||
|
styleHorario.setAlignment(HSSFCellStyle.ALIGN_CENTER);
|
||||||
|
styleHorario.setVerticalAlignment(HSSFCellStyle.ALIGN_CENTER);
|
||||||
|
|
||||||
for (Entry<String, Integer> bean : mapAux.entrySet()) {
|
for (Entry<String, Integer> bean : mapAux.entrySet()) {
|
||||||
r1.createCell(bean.getValue()).setCellValue(bean.getKey());
|
r1.createCell(bean.getValue()).setCellValue(bean.getKey());
|
||||||
r1.getCell(bean.getValue()).setCellStyle(styleHorario);
|
r1.getCell(bean.getValue()).setCellStyle(styleHorario);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
r1.createCell(i++).setCellValue("TOTAL");
|
|
||||||
r1.setRowStyle(styleHorario);
|
r1.setRowStyle(styleHorario);
|
||||||
|
|
||||||
|
HSSFCellStyle styleTituloTotal = wb.createCellStyle();
|
||||||
|
HSSFCell cellTituloTotal = periodo.createCell(i++);
|
||||||
|
cellTituloTotal.setCellValue("TOTAL");
|
||||||
|
styleTituloTotal.setAlignment(HSSFCellStyle.ALIGN_CENTER);
|
||||||
|
styleTituloTotal.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
|
||||||
|
|
||||||
|
HSSFFont fontTituloTotal = wb.createFont();
|
||||||
|
fontTituloTotal.setBoldweight(Font.BOLDWEIGHT_BOLD);
|
||||||
|
fontTituloTotal.setFontHeightInPoints((short) 10);
|
||||||
|
fontTituloTotal.setColor(HSSFColor.RED.index);
|
||||||
|
styleTituloTotal.setFont(fontTituloTotal);
|
||||||
|
cellTituloTotal.setCellStyle(styleTituloTotal);
|
||||||
|
|
||||||
total = i;
|
total = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -483,8 +561,8 @@ public class RelatorioEmbarqueLocalidadeController extends MyGenericForwardCompo
|
||||||
|
|
||||||
sql.append("select ");
|
sql.append("select ");
|
||||||
sql.append(" concat(concat(concat(TO_CHAR(b.fechorviaje,'HH24'), ':00'), ' a '),concat(TO_CHAR(b.fechorviaje,'HH24'), ':59')), ");
|
sql.append(" concat(concat(concat(TO_CHAR(b.fechorviaje,'HH24'), ':00'), ' a '),concat(TO_CHAR(b.fechorviaje,'HH24'), ':59')), ");
|
||||||
sql.append(" concat(concat(r.prefixo, ' '), r.descruta), cla.descclase, ");
|
sql.append(" r.descruta, cla.descclase, ");
|
||||||
sql.append(" count(b.boleto_id) ");
|
sql.append(" count(b.boleto_id), r.prefixo ");
|
||||||
sql.append("from ");
|
sql.append("from ");
|
||||||
sql.append(" boleto b ");
|
sql.append(" boleto b ");
|
||||||
sql.append(" inner join ruta r on r.ruta_id = b.ruta_id ");
|
sql.append(" inner join ruta r on r.ruta_id = b.ruta_id ");
|
||||||
|
@ -511,7 +589,7 @@ public class RelatorioEmbarqueLocalidadeController extends MyGenericForwardCompo
|
||||||
|
|
||||||
sql.append("group by ");
|
sql.append("group by ");
|
||||||
sql.append(" concat(concat(concat(TO_CHAR(b.fechorviaje,'HH24'), ':00'), ' a '),concat(TO_CHAR(b.fechorviaje,'HH24'), ':59')), ");
|
sql.append(" concat(concat(concat(TO_CHAR(b.fechorviaje,'HH24'), ':00'), ' a '),concat(TO_CHAR(b.fechorviaje,'HH24'), ':59')), ");
|
||||||
sql.append(" concat(concat(r.prefixo, ' '), r.descruta), cla.descclase ");
|
sql.append(" r.descruta, cla.descclase,r.prefixo ");
|
||||||
sql.append("order by ");
|
sql.append("order by ");
|
||||||
sql.append(" 1 ");
|
sql.append(" 1 ");
|
||||||
|
|
||||||
|
@ -529,6 +607,7 @@ public class RelatorioEmbarqueLocalidadeController extends MyGenericForwardCompo
|
||||||
bean.setLinha(rset.getString(2));
|
bean.setLinha(rset.getString(2));
|
||||||
bean.setClasse(rset.getString(3));
|
bean.setClasse(rset.getString(3));
|
||||||
bean.setEmbarques(rset.getLong(4));
|
bean.setEmbarques(rset.getLong(4));
|
||||||
|
bean.setPrefixo(rset.getString(5));
|
||||||
ls.add(bean);
|
ls.add(bean);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue