|
@@ -20,6 +20,7 @@ import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
|
import org.apache.poi.ss.usermodel.Sheet;
|
|
|
import org.apache.poi.ss.usermodel.SheetConditionalFormatting;
|
|
|
+import org.apache.poi.ss.usermodel.VerticalAlignment;
|
|
|
import org.apache.poi.ss.util.CellRangeAddress;
|
|
|
import org.apache.poi.ss.util.RegionUtil;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
|
|
@@ -86,12 +87,13 @@ public class TslReportService {
|
|
|
CellRangeAddress rangeAddress;
|
|
|
XSSFDataFormat dataFormat = getWorkbook().createDataFormat();
|
|
|
XSSFFont font = getWorkbook().createFont();
|
|
|
- font.setFontName("等线");
|
|
|
+ font.setFontName("微软雅黑");
|
|
|
font.setFontHeightInPoints((short) 10);
|
|
|
- // 基本模式 等线 10号字 带全边框 水平居中
|
|
|
+ // 基本模式 微软雅黑 10号字 带全边框 水平居中
|
|
|
XSSFCellStyle baseStyle = getWorkbook().createCellStyle();
|
|
|
baseStyle.setFont(font);
|
|
|
baseStyle.setAlignment(HorizontalAlignment.CENTER);
|
|
|
+ baseStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
|
|
baseStyle.setBorderBottom(BorderStyle.THIN);
|
|
|
baseStyle.setBorderTop(BorderStyle.THIN);
|
|
|
baseStyle.setBorderLeft(BorderStyle.THIN);
|
|
@@ -101,11 +103,11 @@ public class TslReportService {
|
|
|
// 样式2 百分比 2位小数
|
|
|
XSSFCellStyle cellStyle2 = baseStyle.copy();
|
|
|
cellStyle2.setDataFormat(dataFormat.getFormat("0.00%"));
|
|
|
- // 样式3 自动换行 背景色FFE7E6E6
|
|
|
+ // 样式3 自动换行 背景色FFE7E6E6 FFAEAAAA
|
|
|
XSSFCellStyle cellStyle3 = baseStyle.copy();
|
|
|
- cellStyle3.setWrapText(true);
|
|
|
+ // cellStyle3.setWrapText(true);
|
|
|
XSSFColor color = new XSSFColor();
|
|
|
- color.setARGBHex("FFE7E6E6");
|
|
|
+ color.setARGBHex("FFAEAAAA");
|
|
|
cellStyle3.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
|
|
cellStyle3.setFillForegroundColor(color);
|
|
|
|
|
@@ -125,7 +127,7 @@ public class TslReportService {
|
|
|
cell.setCellValue("地市");
|
|
|
cell.setCellStyle(cellStyle3);
|
|
|
cell = row.createCell(1);
|
|
|
- cell.setCellValue("投诉问题解决满意率");
|
|
|
+ cell.setCellValue("满意率");
|
|
|
cell.setCellStyle(cellStyle3);
|
|
|
cell = row.createCell(2);
|
|
|
cell.setCellValue("达标值");
|
|
@@ -157,6 +159,20 @@ public class TslReportService {
|
|
|
rangeAddress = new CellRangeAddress(2, 13, 3, 3);
|
|
|
setConditionalFormatting2(sheet4, rangeAddress);
|
|
|
|
|
|
+ // 设置列宽 2048 1304 2048 2304
|
|
|
+ for (int i = 0; i < 4; i++) {
|
|
|
+ sheet4.setColumnWidth(i, 2848);
|
|
|
+ }
|
|
|
+ // sheet4.setColumnWidth(0, 2048);
|
|
|
+ // sheet4.setColumnWidth(1, 2304);
|
|
|
+ // sheet4.setColumnWidth(2, 2048);
|
|
|
+ // sheet4.setColumnWidth(3, 2804);
|
|
|
+
|
|
|
+ // 设置行高 15.0 15.0...
|
|
|
+ for (int i = 0; i < 15; i++) {
|
|
|
+ sheet4.getRow(i).setHeightInPoints(15.0F);
|
|
|
+ }
|
|
|
+
|
|
|
// 客户端-投诉问题解决率
|
|
|
row = sheet5.createRow(0);
|
|
|
cell = row.createCell(0);
|
|
@@ -171,7 +187,7 @@ public class TslReportService {
|
|
|
cell.setCellValue("地市");
|
|
|
cell.setCellStyle(cellStyle3);
|
|
|
cell = row.createCell(1);
|
|
|
- cell.setCellValue("投诉问题解决率");
|
|
|
+ cell.setCellValue("解决率");
|
|
|
cell.setCellStyle(cellStyle3);
|
|
|
cell = row.createCell(2);
|
|
|
cell.setCellValue("达标值");
|
|
@@ -203,6 +219,20 @@ public class TslReportService {
|
|
|
rangeAddress = new CellRangeAddress(2, 13, 3, 3);
|
|
|
setConditionalFormatting2(sheet5, rangeAddress);
|
|
|
|
|
|
+ // 设置列宽 2048 1304 2048 2304
|
|
|
+ for (int i = 0; i < 4; i++) {
|
|
|
+ sheet5.setColumnWidth(i, 2848);
|
|
|
+ }
|
|
|
+ // sheet5.setColumnWidth(0, 2048);
|
|
|
+ // sheet5.setColumnWidth(1, 2304);
|
|
|
+ // sheet5.setColumnWidth(2, 2048);
|
|
|
+ // sheet5.setColumnWidth(3, 2804);
|
|
|
+
|
|
|
+ // 设置行高 15.0 15.0...
|
|
|
+ for (int i = 0; i < 15; i++) {
|
|
|
+ sheet5.getRow(i).setHeightInPoints(15.0F);
|
|
|
+ }
|
|
|
+
|
|
|
// 客户端-投诉问题响应率
|
|
|
row = sheet6.createRow(0);
|
|
|
cell = row.createCell(0);
|
|
@@ -217,7 +247,7 @@ public class TslReportService {
|
|
|
cell.setCellValue("地市");
|
|
|
cell.setCellStyle(cellStyle3);
|
|
|
cell = row.createCell(1);
|
|
|
- cell.setCellValue("投诉问题响应率");
|
|
|
+ cell.setCellValue("响应率");
|
|
|
cell.setCellStyle(cellStyle3);
|
|
|
cell = row.createCell(2);
|
|
|
cell.setCellValue("达标值");
|
|
@@ -248,6 +278,20 @@ public class TslReportService {
|
|
|
// 设置条件格式D3-D14
|
|
|
rangeAddress = new CellRangeAddress(2, 13, 3, 3);
|
|
|
setConditionalFormatting2(sheet6, rangeAddress);
|
|
|
+
|
|
|
+ // 设置列宽 2048 1304 2048 2304
|
|
|
+ for (int i = 0; i < 4; i++) {
|
|
|
+ sheet6.setColumnWidth(i, 2848);
|
|
|
+ }
|
|
|
+ // sheet6.setColumnWidth(0, 2048);
|
|
|
+ // sheet6.setColumnWidth(1, 2304);
|
|
|
+ // sheet6.setColumnWidth(2, 2048);
|
|
|
+ // sheet6.setColumnWidth(3, 2848);
|
|
|
+
|
|
|
+ // 设置行高 15.0 15.0...
|
|
|
+ for (int i = 0; i < 15; i++) {
|
|
|
+ sheet6.getRow(i).setHeightInPoints(15.0F);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -274,12 +318,13 @@ public class TslReportService {
|
|
|
CellRangeAddress rangeAddress;
|
|
|
XSSFDataFormat dataFormat = getWorkbook().createDataFormat();
|
|
|
XSSFFont font = getWorkbook().createFont();
|
|
|
- font.setFontName("等线");
|
|
|
+ font.setFontName("微软雅黑");
|
|
|
font.setFontHeightInPoints((short) 10);
|
|
|
- // 基本模式 等线 10号字 带全边框 水平居中
|
|
|
+ // 基本模式 微软雅黑 10号字 带全边框 水平居中
|
|
|
XSSFCellStyle baseStyle = getWorkbook().createCellStyle();
|
|
|
baseStyle.setFont(font);
|
|
|
baseStyle.setAlignment(HorizontalAlignment.CENTER);
|
|
|
+ baseStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
|
|
baseStyle.setBorderBottom(BorderStyle.THIN);
|
|
|
baseStyle.setBorderTop(BorderStyle.THIN);
|
|
|
baseStyle.setBorderLeft(BorderStyle.THIN);
|
|
@@ -289,11 +334,11 @@ public class TslReportService {
|
|
|
// 样式2 百分比 2位小数
|
|
|
XSSFCellStyle cellStyle2 = baseStyle.copy();
|
|
|
cellStyle2.setDataFormat(dataFormat.getFormat("0.00%"));
|
|
|
- // 样式3 自动换行 背景色FFE7E6E6
|
|
|
+ // 样式3 自动换行 背景色FFE7E6E6 FFAEAAAA
|
|
|
XSSFCellStyle cellStyle3 = baseStyle.copy();
|
|
|
- cellStyle3.setWrapText(true);
|
|
|
+ // cellStyle3.setWrapText(true);
|
|
|
XSSFColor color = new XSSFColor();
|
|
|
- color.setARGBHex("FFE7E6E6");
|
|
|
+ color.setARGBHex("FFAEAAAA");
|
|
|
cellStyle3.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
|
|
cellStyle3.setFillForegroundColor(color);
|
|
|
// 样式4 小数 保留2位
|
|
@@ -395,22 +440,23 @@ public class TslReportService {
|
|
|
setConditionalFormatting(sheet, rangeAddress);
|
|
|
|
|
|
// 设置列宽 2048 2276*3 2048*3 2276*2 3612
|
|
|
- sheet.setColumnWidth(0, 2048);
|
|
|
- sheet.setColumnWidth(1, 2276);
|
|
|
- sheet.setColumnWidth(2, 2276);
|
|
|
- sheet.setColumnWidth(3, 2276);
|
|
|
- sheet.setColumnWidth(4, 2048);
|
|
|
- sheet.setColumnWidth(5, 2048);
|
|
|
- sheet.setColumnWidth(6, 2048);
|
|
|
- sheet.setColumnWidth(7, 2276);
|
|
|
- sheet.setColumnWidth(8, 2276);
|
|
|
- sheet.setColumnWidth(9, 3612);
|
|
|
+ for (int i = 0; i < 10; i++) {
|
|
|
+ sheet.setColumnWidth(i, 2848);
|
|
|
+ }
|
|
|
+ // sheet.setColumnWidth(0, 2848);
|
|
|
+ // sheet.setColumnWidth(1, 2276);
|
|
|
+ // sheet.setColumnWidth(2, 2276);
|
|
|
+ // sheet.setColumnWidth(3, 2276);
|
|
|
+ // sheet.setColumnWidth(4, 2048);
|
|
|
+ // sheet.setColumnWidth(5, 2048);
|
|
|
+ // sheet.setColumnWidth(6, 2048);
|
|
|
+ // sheet.setColumnWidth(7, 2276);
|
|
|
+ // sheet.setColumnWidth(8, 2276);
|
|
|
+ // sheet.setColumnWidth(9, 3612);
|
|
|
|
|
|
// 设置行高 14.25 25.5 14.25...
|
|
|
- sheet.getRow(0).setHeightInPoints(14.25F);
|
|
|
- sheet.getRow(1).setHeightInPoints(25.5F);
|
|
|
- for (int i = 2; i < 15; i++) {
|
|
|
- sheet.getRow(i).setHeightInPoints(14.25F);
|
|
|
+ for (int i = 0; i < 15; i++) {
|
|
|
+ sheet.getRow(i).setHeightInPoints(15.0F);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -428,7 +474,7 @@ public class TslReportService {
|
|
|
log.error("时间字符串解析失败--{}", day);
|
|
|
}
|
|
|
int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
|
|
|
- int monthOfYear = calendar.get(Calendar.MONTH);
|
|
|
+ int monthOfYear = calendar.get(Calendar.MONTH) + 1;
|
|
|
// 显示当前和前一天的对比
|
|
|
int preDayOfMonth = (dayOfMonth > 1) ? dayOfMonth - 1 : dayOfMonth;
|
|
|
|
|
@@ -438,13 +484,14 @@ public class TslReportService {
|
|
|
CellRangeAddress rangeAddress;
|
|
|
XSSFFont font;
|
|
|
XSSFDataFormat dataFormat = getWorkbook().createDataFormat();
|
|
|
- // 基本模式 等线 10号字 带全边框 水平居中
|
|
|
+ // 基本模式 微软雅黑 10号字 带全边框 水平居中
|
|
|
XSSFCellStyle baseStyle = getWorkbook().createCellStyle();
|
|
|
font = getWorkbook().createFont();
|
|
|
- font.setFontName("等线");
|
|
|
+ font.setFontName("微软雅黑");
|
|
|
font.setFontHeightInPoints((short) 10);
|
|
|
baseStyle.setFont(font);
|
|
|
baseStyle.setAlignment(HorizontalAlignment.CENTER);
|
|
|
+ baseStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
|
|
baseStyle.setBorderBottom(BorderStyle.THIN);
|
|
|
baseStyle.setBorderTop(BorderStyle.THIN);
|
|
|
baseStyle.setBorderLeft(BorderStyle.THIN);
|
|
@@ -454,11 +501,11 @@ public class TslReportService {
|
|
|
// 带边框 百分比 2位小数
|
|
|
XSSFCellStyle cellStyle2 = baseStyle.copy();
|
|
|
cellStyle2.setDataFormat(dataFormat.getFormat("0.00%"));
|
|
|
- // 等线 10号字 自动换行 背景色FFE7E6E6
|
|
|
+ // 微软雅黑 10号字 自动换行 背景色FFE7E6E6 FFAEAAAA
|
|
|
XSSFCellStyle cellStyle3 = baseStyle.copy();
|
|
|
- cellStyle3.setWrapText(true);
|
|
|
+ // cellStyle3.setWrapText(true);
|
|
|
XSSFColor color = new XSSFColor();
|
|
|
- color.setARGBHex("FFE7E6E6");
|
|
|
+ color.setARGBHex("FFAEAAAA");
|
|
|
cellStyle3.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
|
|
cellStyle3.setFillForegroundColor(color);
|
|
|
|
|
@@ -477,7 +524,7 @@ public class TslReportService {
|
|
|
cell.setCellValue("");
|
|
|
cell.setCellStyle(cellStyle3);
|
|
|
cell = row.createCell(1);
|
|
|
- cell.setCellValue("重复投诉工单数");
|
|
|
+ cell.setCellValue("工单数");
|
|
|
cell.setCellStyle(cellStyle3);
|
|
|
// 合并单元格 B2-C2
|
|
|
rangeAddress = new CellRangeAddress(1, 1, 1, 2);
|
|
@@ -513,7 +560,7 @@ public class TslReportService {
|
|
|
cell.setCellValue(String.format("%s月截止%s日", monthOfYear, dayOfMonth));
|
|
|
cell.setCellStyle(cellStyle3);
|
|
|
cell = row.createCell(5);
|
|
|
- cell.setCellValue("重复投诉工单数");
|
|
|
+ cell.setCellValue("工单数");
|
|
|
cell.setCellStyle(cellStyle3);
|
|
|
cell = row.createCell(6);
|
|
|
cell.setCellValue("重复投诉率");
|
|
@@ -563,15 +610,12 @@ public class TslReportService {
|
|
|
|
|
|
// 设置列宽2048
|
|
|
for (int i = 0; i <= 6; i++) {
|
|
|
- sheet.setColumnWidth(i, 2048);
|
|
|
+ sheet.setColumnWidth(i, 2848);
|
|
|
}
|
|
|
|
|
|
- // 设置行高 14.25 27.5 25.5 14.25 ...
|
|
|
- sheet.getRow(0).setHeightInPoints(14.25F);
|
|
|
- sheet.getRow(1).setHeightInPoints(27.5F);
|
|
|
- sheet.getRow(2).setHeightInPoints(25.5F);
|
|
|
- for (int i = 3; i < 16; i++) {
|
|
|
- sheet.getRow(i).setHeightInPoints(14.25F);
|
|
|
+ // 设置行高 15.0 ...
|
|
|
+ for (int i = 0; i < 16; i++) {
|
|
|
+ sheet.getRow(i).setHeightInPoints(15.0F);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -592,8 +636,9 @@ public class TslReportService {
|
|
|
|
|
|
XSSFCellStyle cellStyle1 = getWorkbook().createCellStyle();
|
|
|
cellStyle1.setAlignment(HorizontalAlignment.CENTER);
|
|
|
+ cellStyle1.setVerticalAlignment(VerticalAlignment.CENTER);
|
|
|
XSSFFont font = getWorkbook().createFont();
|
|
|
- font.setFontName("等线");
|
|
|
+ font.setFontName("微软雅黑");
|
|
|
font.setBold(false);
|
|
|
font.setFontHeightInPoints((short) 9);
|
|
|
cellStyle1.setFont(font);
|
|
@@ -603,6 +648,7 @@ public class TslReportService {
|
|
|
cellStyle1.setBorderRight(BorderStyle.THIN);
|
|
|
XSSFCellStyle cellStyle3 = getWorkbook().createCellStyle();
|
|
|
cellStyle3.setAlignment(HorizontalAlignment.CENTER);
|
|
|
+ cellStyle3.setVerticalAlignment(VerticalAlignment.CENTER);
|
|
|
cellStyle3.setFont(font);
|
|
|
cellStyle3.setBorderBottom(BorderStyle.THIN);
|
|
|
cellStyle3.setBorderTop(BorderStyle.THIN);
|
|
@@ -612,8 +658,9 @@ public class TslReportService {
|
|
|
cellStyle3.setDataFormat(format.getFormat("0.00"));
|
|
|
XSSFCellStyle cellStyle2 = getWorkbook().createCellStyle();
|
|
|
cellStyle2.setAlignment(HorizontalAlignment.CENTER);
|
|
|
+ cellStyle2.setVerticalAlignment(VerticalAlignment.CENTER);
|
|
|
font = getWorkbook().createFont();
|
|
|
- font.setFontName("等线");
|
|
|
+ font.setFontName("微软雅黑");
|
|
|
font.setBold(true);
|
|
|
font.setFontHeightInPoints((short) 9);
|
|
|
cellStyle2.setFont(font);
|