|
@@ -3,7 +3,7 @@ package com.nokia.tsl_data.service;
|
|
import com.nokia.tsl_data.dao.HighQualityCountMapper;
|
|
import com.nokia.tsl_data.dao.HighQualityCountMapper;
|
|
import com.nokia.tsl_data.dao.MobileComplaintMapper;
|
|
import com.nokia.tsl_data.dao.MobileComplaintMapper;
|
|
import com.nokia.tsl_data.dao.SysDataDictionaryRepository;
|
|
import com.nokia.tsl_data.dao.SysDataDictionaryRepository;
|
|
-import com.nokia.tsl_data.properties.OutputProperties;
|
|
|
|
|
|
+import com.nokia.tsl_data.properties.TslDataProperties;
|
|
import com.nokia.tsl_data.util.excel.PoiUtil;
|
|
import com.nokia.tsl_data.util.excel.PoiUtil;
|
|
import com.nokia.tsl_data.util.excel.entity.CellRect;
|
|
import com.nokia.tsl_data.util.excel.entity.CellRect;
|
|
|
|
|
|
@@ -40,7 +40,7 @@ public class ReportServiceV1 {
|
|
@Autowired
|
|
@Autowired
|
|
private TslDataService tslDataService;
|
|
private TslDataService tslDataService;
|
|
@Autowired
|
|
@Autowired
|
|
- private OutputProperties outputProperties;
|
|
|
|
|
|
+ private TslDataProperties tslDataProperties;
|
|
@Autowired
|
|
@Autowired
|
|
private HighQualityCountMapper highQualityCountMapper;
|
|
private HighQualityCountMapper highQualityCountMapper;
|
|
@Autowired
|
|
@Autowired
|
|
@@ -63,9 +63,9 @@ public class ReportServiceV1 {
|
|
* 截图任务
|
|
* 截图任务
|
|
*/
|
|
*/
|
|
public void screenShotV2(String day) {
|
|
public void screenShotV2(String day) {
|
|
- String fileName = outputProperties.getOutputFileNamePrefix() + day + ".xlsx";
|
|
|
|
|
|
+ String fileName = tslDataProperties.getOutputFileNamePrefix() + day + ".xlsx";
|
|
// 输出文件路径 增加V2
|
|
// 输出文件路径 增加V2
|
|
- File file = Paths.get(outputProperties.getOutputPath(), "V2", day, fileName).toFile();
|
|
|
|
|
|
+ File file = Paths.get(tslDataProperties.getOutputPath(), "V2", day, fileName).toFile();
|
|
if (!file.exists()) {
|
|
if (!file.exists()) {
|
|
throw new RuntimeException(String.format("无法截图,文件%s不存在", file.getAbsolutePath()));
|
|
throw new RuntimeException(String.format("无法截图,文件%s不存在", file.getAbsolutePath()));
|
|
}
|
|
}
|
|
@@ -78,42 +78,42 @@ public class ReportServiceV1 {
|
|
String area = "A1:" + CellRect.getColumnName(dayOfMonth + 7) + "15";
|
|
String area = "A1:" + CellRect.getColumnName(dayOfMonth + 7) + "15";
|
|
screenShot = PoiUtil.screenShot(workbook.getSheet("管理端-移网质量类"), area, "微软雅黑");
|
|
screenShot = PoiUtil.screenShot(workbook.getSheet("管理端-移网质量类"), area, "微软雅黑");
|
|
ImageIO.write(screenShot, "png",
|
|
ImageIO.write(screenShot, "png",
|
|
- Paths.get(outputProperties.getOutputPath(), day, day + "-1-投诉率.png").toFile());
|
|
|
|
|
|
+ Paths.get(tslDataProperties.getOutputPath(), day, day + "-1-投诉率.png").toFile());
|
|
// 截图2
|
|
// 截图2
|
|
String area2 = "A1:" + CellRect.getColumnName(dayOfMonth + 7) + "15";
|
|
String area2 = "A1:" + CellRect.getColumnName(dayOfMonth + 7) + "15";
|
|
screenShot = PoiUtil.screenShot(workbook.getSheet("客户端-战略考核"), area2, "微软雅黑");
|
|
screenShot = PoiUtil.screenShot(workbook.getSheet("客户端-战略考核"), area2, "微软雅黑");
|
|
ImageIO.write(screenShot, "png",
|
|
ImageIO.write(screenShot, "png",
|
|
- Paths.get(outputProperties.getOutputPath(), day, day + "-2-客户端-战略考核.png").toFile());
|
|
|
|
|
|
+ Paths.get(tslDataProperties.getOutputPath(), day, day + "-2-客户端-战略考核.png").toFile());
|
|
// 截图3 每月1号不发送重复投诉率
|
|
// 截图3 每月1号不发送重复投诉率
|
|
if (!day.endsWith("01")) {
|
|
if (!day.endsWith("01")) {
|
|
screenShot = PoiUtil.screenShot(workbook.getSheet("管理端-重复投诉率"), "A1:G16", "微软雅黑");
|
|
screenShot = PoiUtil.screenShot(workbook.getSheet("管理端-重复投诉率"), "A1:G16", "微软雅黑");
|
|
ImageIO.write(screenShot, "png",
|
|
ImageIO.write(screenShot, "png",
|
|
- Paths.get(outputProperties.getOutputPath(), day, day + "-3-重复投诉率.png").toFile());
|
|
|
|
|
|
+ Paths.get(tslDataProperties.getOutputPath(), day, day + "-3-重复投诉率.png").toFile());
|
|
}
|
|
}
|
|
// 截图4 5
|
|
// 截图4 5
|
|
Sheet sheet = workbook.getSheet("投诉处理时长、超时工单概况");
|
|
Sheet sheet = workbook.getSheet("投诉处理时长、超时工单概况");
|
|
screenShot = PoiUtil.screenShot(sheet, "A1:D15", "微软雅黑");
|
|
screenShot = PoiUtil.screenShot(sheet, "A1:D15", "微软雅黑");
|
|
ImageIO.write(screenShot, "png",
|
|
ImageIO.write(screenShot, "png",
|
|
- Paths.get(outputProperties.getOutputPath(), day, day + "-4-超时工单.png").toFile());
|
|
|
|
|
|
+ Paths.get(tslDataProperties.getOutputPath(), day, day + "-4-超时工单.png").toFile());
|
|
screenShot = PoiUtil.screenShot(sheet, "G1:J14", "微软雅黑");
|
|
screenShot = PoiUtil.screenShot(sheet, "G1:J14", "微软雅黑");
|
|
ImageIO.write(screenShot, "png",
|
|
ImageIO.write(screenShot, "png",
|
|
- Paths.get(outputProperties.getOutputPath(), day, day + "-5-处理时长.png").toFile());
|
|
|
|
|
|
+ Paths.get(tslDataProperties.getOutputPath(), day, day + "-5-处理时长.png").toFile());
|
|
// 截图6
|
|
// 截图6
|
|
sheet = workbook.getSheet("客户端地市三率");
|
|
sheet = workbook.getSheet("客户端地市三率");
|
|
screenShot = PoiUtil.screenShot(sheet, "A1:J15", "微软雅黑");
|
|
screenShot = PoiUtil.screenShot(sheet, "A1:J15", "微软雅黑");
|
|
ImageIO.write(screenShot, "png",
|
|
ImageIO.write(screenShot, "png",
|
|
- Paths.get(outputProperties.getOutputPath(), day, day + "-6-地市三率.png").toFile());
|
|
|
|
|
|
+ Paths.get(tslDataProperties.getOutputPath(), day, day + "-6-地市三率.png").toFile());
|
|
// 截图7 8 9 区县三率
|
|
// 截图7 8 9 区县三率
|
|
sheet = workbook.getSheet("客户端区县三率");
|
|
sheet = workbook.getSheet("客户端区县三率");
|
|
screenShot = PoiUtil.screenShot(sheet, "A1:F32", "微软雅黑");
|
|
screenShot = PoiUtil.screenShot(sheet, "A1:F32", "微软雅黑");
|
|
ImageIO.write(screenShot, "png",
|
|
ImageIO.write(screenShot, "png",
|
|
- Paths.get(outputProperties.getOutputPath(), day, day + "-7-区县响应率.png").toFile());
|
|
|
|
|
|
+ Paths.get(tslDataProperties.getOutputPath(), day, day + "-7-区县响应率.png").toFile());
|
|
screenShot = PoiUtil.screenShot(sheet, "A1:F32", "微软雅黑");
|
|
screenShot = PoiUtil.screenShot(sheet, "A1:F32", "微软雅黑");
|
|
ImageIO.write(screenShot, "png",
|
|
ImageIO.write(screenShot, "png",
|
|
- Paths.get(outputProperties.getOutputPath(), day, day + "-8-区县满意度.png").toFile());
|
|
|
|
|
|
+ Paths.get(tslDataProperties.getOutputPath(), day, day + "-8-区县满意度.png").toFile());
|
|
screenShot = PoiUtil.screenShot(sheet, "A1:F32", "微软雅黑");
|
|
screenShot = PoiUtil.screenShot(sheet, "A1:F32", "微软雅黑");
|
|
ImageIO.write(screenShot, "png",
|
|
ImageIO.write(screenShot, "png",
|
|
- Paths.get(outputProperties.getOutputPath(), day, day + "-9-区县解决率.png").toFile());
|
|
|
|
|
|
+ Paths.get(tslDataProperties.getOutputPath(), day, day + "-9-区县解决率.png").toFile());
|
|
} catch (EncryptedDocumentException | IOException | ParseException e) {
|
|
} catch (EncryptedDocumentException | IOException | ParseException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
throw new RuntimeException(e.getMessage());
|
|
throw new RuntimeException(e.getMessage());
|
|
@@ -124,9 +124,9 @@ public class ReportServiceV1 {
|
|
* 生成报表,版本2,包含区县三率
|
|
* 生成报表,版本2,包含区县三率
|
|
*/
|
|
*/
|
|
public void generateReportV2(String day) {
|
|
public void generateReportV2(String day) {
|
|
- String fileName = outputProperties.getOutputFileNamePrefix() + day + ".xlsx";
|
|
|
|
|
|
+ String fileName = tslDataProperties.getOutputFileNamePrefix() + day + ".xlsx";
|
|
// 输出路径 增加 V2
|
|
// 输出路径 增加 V2
|
|
- File file = Paths.get(outputProperties.getOutputPath(), "V2", day).toFile();
|
|
|
|
|
|
+ File file = Paths.get(tslDataProperties.getOutputPath(), "V2", day).toFile();
|
|
if (!file.exists()) {
|
|
if (!file.exists()) {
|
|
boolean mkdirs = file.mkdirs();
|
|
boolean mkdirs = file.mkdirs();
|
|
System.out.println(mkdirs);
|
|
System.out.println(mkdirs);
|
|
@@ -166,8 +166,8 @@ public class ReportServiceV1 {
|
|
}
|
|
}
|
|
|
|
|
|
public void generateReportV1(String day) {
|
|
public void generateReportV1(String day) {
|
|
- String fileName = outputProperties.getOutputFileNamePrefix() + day + ".xlsx";
|
|
|
|
- File file = Paths.get(outputProperties.getOutputPath(), "V1", day).toFile();
|
|
|
|
|
|
+ String fileName = tslDataProperties.getOutputFileNamePrefix() + day + ".xlsx";
|
|
|
|
+ File file = Paths.get(tslDataProperties.getOutputPath(), "V1", day).toFile();
|
|
if (!file.exists()) {
|
|
if (!file.exists()) {
|
|
boolean mkdirs = file.mkdirs();
|
|
boolean mkdirs = file.mkdirs();
|
|
System.out.println(mkdirs);
|
|
System.out.println(mkdirs);
|