Browse Source

#两票月度统计导出

zhongwei
yang_shj 7 months ago
parent
commit
eef3fe503c
  1. 12
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/CensServiceImpl.java

12
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/CensServiceImpl.java

@ -241,7 +241,7 @@ public class CensServiceImpl implements CensService {
} }
// 下载导出 // 下载导出
String filename = "两票统计报表"; String filename = "两票月度统计报表";
// 设置头信息 // 设置头信息
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
response.setContentType("application/vnd.ms-excel"); response.setContentType("application/vnd.ms-excel");
@ -269,12 +269,12 @@ public class CensServiceImpl implements CensService {
private void setFirstHeader(HSSFWorkbook hssWB, HSSFSheet sheet) { private void setFirstHeader(HSSFWorkbook hssWB, HSSFSheet sheet) {
// 第一行 // 第一行
HSSFRow fisrtRow = sheet.createRow(0); HSSFRow fisrtRow = sheet.createRow(0);
this.setTitileStyle(hssWB, fisrtRow, 4, true); this.setTitileStyle(hssWB, fisrtRow, 3, true);
// 第一个单元格 // 第一个单元格
HSSFCell headCell = fisrtRow.getCell(0); HSSFCell headCell = fisrtRow.getCell(0);
headCell.setCellValue("两票统计报表"); headCell.setCellValue("两票统计报表");
// 首行合并情况 // 首行合并情况
CellRangeAddress region1 = new CellRangeAddress(0, 0, (short) 0, (short) 4); CellRangeAddress region1 = new CellRangeAddress(0, 0, (short) 0, (short) 3);
sheet.addMergedRegion(region1); sheet.addMergedRegion(region1);
} }
@ -304,7 +304,7 @@ public class CensServiceImpl implements CensService {
private void setWorkHeader(HSSFWorkbook hssWB, HSSFSheet sheet) { private void setWorkHeader(HSSFWorkbook hssWB, HSSFSheet sheet) {
// 创建行 // 创建行
HSSFRow row_1 = sheet.createRow(1); HSSFRow row_1 = sheet.createRow(1);
this.setTitileStyle(hssWB, row_1, 4, true); this.setTitileStyle(hssWB, row_1, 3, true);
// 第一行 // 第一行
HSSFCell header_row_1_cell_1 = row_1.getCell(0); HSSFCell header_row_1_cell_1 = row_1.getCell(0);
header_row_1_cell_1.setCellValue("序号"); header_row_1_cell_1.setCellValue("序号");
@ -314,8 +314,6 @@ public class CensServiceImpl implements CensService {
header_row_1_cell_3.setCellValue("工作票数量"); header_row_1_cell_3.setCellValue("工作票数量");
HSSFCell header_row_1_cell_4 = row_1.getCell(3); HSSFCell header_row_1_cell_4 = row_1.getCell(3);
header_row_1_cell_4.setCellValue("操作票数量"); header_row_1_cell_4.setCellValue("操作票数量");
HSSFCell header_row_1_cell_5 = row_1.getCell(4);
header_row_1_cell_5.setCellValue("工作任务数量");
} }
/** /**
@ -381,7 +379,7 @@ public class CensServiceImpl implements CensService {
int size = censs.size(); int size = censs.size();
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
HSSFRow row = sheet.createRow(i + 2); HSSFRow row = sheet.createRow(i + 2);
this.setTitileStyle(hssWB, row, 19, false); this.setTitileStyle(hssWB, row, 3, false);
CensVo cens = censs.get(i); CensVo cens = censs.get(i);
// 序号 // 序号
HSSFCell header_row_cell_0 = row.getCell(0); HSSFCell header_row_cell_0 = row.getCell(0);

Loading…
Cancel
Save