|
@@ -59,6 +59,8 @@ public class ReportServiceV3 {
|
|
|
@Autowired
|
|
|
private ManagementDetailService managementDetailService;
|
|
|
@Autowired
|
|
|
+ private CemMobileExperienceListService cemMobileExperienceListService;
|
|
|
+ @Autowired
|
|
|
private WorkFlowService workFlowService;
|
|
|
@Autowired
|
|
|
private TslDataService tslDataService;
|
|
@@ -204,6 +206,13 @@ public class ReportServiceV3 {
|
|
|
Paths.get(file.getParentFile().getAbsolutePath(), "管理端-移网感知类-" + day + ".png").toFile());
|
|
|
}
|
|
|
// 截图 服请
|
|
|
+ sheet = workbook.getSheet("移网感知服务请求率");
|
|
|
+ if (sheet != null) {
|
|
|
+ area = "A1:" + CellRect.getColumnName(dayOfMonth + 7) + "15";
|
|
|
+ screenShot = PoiUtil.screenShot(sheet, area, "微软雅黑");
|
|
|
+ ImageIO.write(screenShot, "png",
|
|
|
+ Paths.get(file.getParentFile().getAbsolutePath(), "移网感知服务请求率-" + day + ".png").toFile());
|
|
|
+ }
|
|
|
// 截图 重复投诉
|
|
|
sheet = workbook.getSheet("管理端-重复投诉率");
|
|
|
if (sheet != null) {
|
|
@@ -249,8 +258,12 @@ public class ReportServiceV3 {
|
|
|
writeSheet1(workbookWrapper, day);
|
|
|
log.info("帐期 {} 管理端-移网感知类 sheet写入成功", day);
|
|
|
// 1.2 写入 服请情况
|
|
|
+ cemMobileExperienceListService.checkStatDayCount(day);
|
|
|
+ writeSheetServiceRequest(workbookWrapper, day);
|
|
|
+ log.info("帐期 {} 服务请求 sheet写入成功", day);
|
|
|
// 1.3 管理端-重复投诉率
|
|
|
writeSheetRepeatTs(workbookWrapper, day);
|
|
|
+ log.info("帐期 {} 管理端-重复投诉率 sheet写入成功", day);
|
|
|
// 1.4 写入 投诉处理时长、超时工单概况
|
|
|
writeSheet3(workbookWrapper, day);
|
|
|
log.info("帐期 {} 投诉处理时长、超时工单概况 sheet写入成功", day);
|
|
@@ -611,12 +624,14 @@ public class ReportServiceV3 {
|
|
|
// 计算天数
|
|
|
LocalDate date = LocalDate.parse(day, DateTimeFormatter.ofPattern("yyyyMMdd"));
|
|
|
int dayOfMonth = date.getDayOfMonth();
|
|
|
+ int monthOfYear = date.getMonthValue();
|
|
|
Sheet sheet = workbookWrapper.getWorkbook().createSheet(sheetName);
|
|
|
Row row;
|
|
|
Cell cell;
|
|
|
// 第一行 标题栏
|
|
|
cell = sheet.createRow(0).createCell(0);
|
|
|
- cell.setCellValue(day.substring(0, 4) + "年客服投诉清单各地市投诉率情况(" + sheetName + ")");
|
|
|
+ cell.setCellValue(day.substring(0, 4) + "年" + monthOfYear
|
|
|
+ + "客服投诉清单各地市投诉率情况(" + sheetName + ")");
|
|
|
cell.setCellStyle(workbookWrapper.getCellStyle4());
|
|
|
PoiUtil.addMergedRegion(sheet, 0, 0, 0, dayOfMonth + 7);
|
|
|
// 第二行 列名
|
|
@@ -721,6 +736,128 @@ public class ReportServiceV3 {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 服务请求数据
|
|
|
+ */
|
|
|
+ private void writeSheetServiceRequest(XSSFWorkbookWrapper workbookWrapper, String day) {
|
|
|
+ String sheetName = "移网感知服务请求率";
|
|
|
+ // 获取数据
|
|
|
+ Map<String, List<Object>> sheetData = cemMobileExperienceListService.getSheetData(day);
|
|
|
+ // 计算天数
|
|
|
+ LocalDate date = LocalDate.parse(day, DateTimeFormatter.ofPattern("yyyyMMdd"));
|
|
|
+ int dayOfMonth = date.getDayOfMonth();
|
|
|
+ int monthOfYear = date.getMonthValue();
|
|
|
+ Sheet sheet = workbookWrapper.getWorkbook().createSheet(sheetName);
|
|
|
+ Row row;
|
|
|
+ Cell cell;
|
|
|
+ // 第一行 标题栏
|
|
|
+ cell = sheet.createRow(0).createCell(0);
|
|
|
+ cell.setCellValue(day.substring(0, 4) + "年"
|
|
|
+ + monthOfYear + "月移网感知(服务请求)");
|
|
|
+ cell.setCellStyle(workbookWrapper.getCellStyle4());
|
|
|
+ PoiUtil.addMergedRegion(sheet, 0, 0, 0, dayOfMonth + 7);
|
|
|
+ // 第二行 列名
|
|
|
+ row = sheet.createRow(1);
|
|
|
+ cell = row.createCell(0);
|
|
|
+ cell.setCellValue("地市");
|
|
|
+ cell.setCellStyle(workbookWrapper.getCellStyle1());
|
|
|
+ for (int i = 1; i <= dayOfMonth; i++) {
|
|
|
+ cell = row.createCell(i);
|
|
|
+ cell.setCellValue(i + "日");
|
|
|
+ cell.setCellStyle(workbookWrapper.getCellStyle1());
|
|
|
+ }
|
|
|
+ cell = row.createCell(dayOfMonth + 1);
|
|
|
+ cell.setCellValue("服请总数");
|
|
|
+ cell.setCellStyle(workbookWrapper.getCellStyle1());
|
|
|
+ cell = row.createCell(dayOfMonth + 2);
|
|
|
+ cell.setCellValue("用户数");
|
|
|
+ cell.setCellStyle(workbookWrapper.getCellStyle1());
|
|
|
+ cell = row.createCell(dayOfMonth + 3);
|
|
|
+ cell.setCellValue("目前万投率");
|
|
|
+ cell.setCellStyle(workbookWrapper.getCellStyle1());
|
|
|
+ cell = row.createCell(dayOfMonth + 4);
|
|
|
+ cell.setCellValue("本月预测");
|
|
|
+ cell.setCellStyle(workbookWrapper.getCellStyle1());
|
|
|
+ cell = row.createCell(dayOfMonth + 5);
|
|
|
+ cell.setCellValue("目标值");
|
|
|
+ cell.setCellStyle(workbookWrapper.getCellStyle1());
|
|
|
+ cell = row.createCell(dayOfMonth + 6);
|
|
|
+ cell.setCellValue("与目标差距");
|
|
|
+ cell.setCellStyle(workbookWrapper.getCellStyle1());
|
|
|
+ cell = row.createCell(dayOfMonth + 7);
|
|
|
+ cell.setCellValue("地市");
|
|
|
+ cell.setCellStyle(workbookWrapper.getCellStyle1());
|
|
|
+ int rowNum = 2;
|
|
|
+ int cellNum = 0;
|
|
|
+ // 写入各地市数据
|
|
|
+ for (String area : sysDataDictionaryRepository.findAllCityName()) {
|
|
|
+ row = sheet.createRow(rowNum++);
|
|
|
+ // 写入A列的地市
|
|
|
+ cell = row.createCell(cellNum++);
|
|
|
+ cell.setCellValue(area);
|
|
|
+ cell.setCellStyle(workbookWrapper.getCellStyle1());
|
|
|
+ for (Object obj : sheetData.get(area)) {
|
|
|
+ cell = row.createCell(cellNum++);
|
|
|
+ cell.setCellValue(Double.parseDouble(obj.toString()));
|
|
|
+ cell.setCellStyle(workbookWrapper.getCellStyle1());
|
|
|
+ }
|
|
|
+ // 写入最后一列的地市
|
|
|
+ cell = row.createCell(cellNum);
|
|
|
+ cell.setCellValue(area);
|
|
|
+ cell.setCellStyle(workbookWrapper.getCellStyle1());
|
|
|
+ // cellNum复位
|
|
|
+ cellNum = 0;
|
|
|
+ }
|
|
|
+ // 写入全省数据
|
|
|
+ row = sheet.createRow(rowNum);
|
|
|
+ // 写入A列的地市
|
|
|
+ cell = row.createCell(cellNum++);
|
|
|
+ cell.setCellValue("全省");
|
|
|
+ cell.setCellStyle(workbookWrapper.getCellStyle1());
|
|
|
+ for (Object obj : sheetData.get("全省")) {
|
|
|
+ cell = row.createCell(cellNum++);
|
|
|
+ cell.setCellValue(Double.parseDouble(obj.toString()));
|
|
|
+ cell.setCellStyle(workbookWrapper.getCellStyle1());
|
|
|
+ }
|
|
|
+ // 写入最后一列的地市
|
|
|
+ cell = row.createCell(cellNum);
|
|
|
+ cell.setCellValue("全省");
|
|
|
+ cell.setCellStyle(workbookWrapper.getCellStyle1());
|
|
|
+ // 3-15行(2-14)dayOfMonth+2 - dayOfMonth+6是浮点数,设置为显示小数点后2位
|
|
|
+ for (int i = 2; i <= 14; i++) {
|
|
|
+ row = sheet.getRow(i);
|
|
|
+ for (int j = dayOfMonth + 2; j <= dayOfMonth + 6; j++) {
|
|
|
+ cell = row.getCell(j);
|
|
|
+ cell.setCellStyle(workbookWrapper.getCellStyle5());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 添加条件格式B15-V15
|
|
|
+ PoiUtil.setConditionalFormattingGreenToRed(sheet, rowNum, rowNum, 1, dayOfMonth);
|
|
|
+ // 添加条件格式(dayOfMonth+3)(3-14)
|
|
|
+ PoiUtil.setConditionalFormattingGreenToRed(sheet, 2, 13, dayOfMonth + 3, dayOfMonth + 3);
|
|
|
+ // 添加条件格式Z3-Z14
|
|
|
+ PoiUtil.setConditionalFormattingGreenToRed(sheet, 2, 13, dayOfMonth + 4, dayOfMonth + 4);
|
|
|
+ // 添加条件格式AB3-AB14
|
|
|
+ PoiUtil.setConditionalFormattingGreenToRed(sheet, 2, 13, dayOfMonth + 6, dayOfMonth + 6);
|
|
|
+ // 设置sheet的列宽
|
|
|
+ sheet.setColumnWidth(0, 1600);
|
|
|
+ for (int i = 1; i <= dayOfMonth; i++) {
|
|
|
+ sheet.setColumnWidth(i, 1300);
|
|
|
+ }
|
|
|
+ sheet.setColumnWidth(dayOfMonth + 1, 1700);
|
|
|
+ sheet.setColumnWidth(dayOfMonth + 2, 2100);
|
|
|
+ sheet.setColumnWidth(dayOfMonth + 3, 2100);
|
|
|
+ sheet.setColumnWidth(dayOfMonth + 4, 2100);
|
|
|
+ sheet.setColumnWidth(dayOfMonth + 5, 1700);
|
|
|
+ sheet.setColumnWidth(dayOfMonth + 6, 2100);
|
|
|
+ sheet.setColumnWidth(dayOfMonth + 7, 1600);
|
|
|
+
|
|
|
+ // 设置行高 15
|
|
|
+ for (int i = 0; i < rowNum; i++) {
|
|
|
+ sheet.getRow(i).setHeightInPoints(15F);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取一个 XSSFWorkbook 并初始化几个需要的格式
|
|
|
*/
|