diff --git a/inspect-main/inspect-main-task/src/main/java/com/inspect/insreport/controller/InspectionReportController.java b/inspect-main/inspect-main-task/src/main/java/com/inspect/insreport/controller/InspectionReportController.java index c261e7a..628a7dc 100644 --- a/inspect-main/inspect-main-task/src/main/java/com/inspect/insreport/controller/InspectionReportController.java +++ b/inspect-main/inspect-main-task/src/main/java/com/inspect/insreport/controller/InspectionReportController.java @@ -16,6 +16,7 @@ import com.inspect.insreport.domain.InspectionReport; import com.inspect.insreport.service.IInspectionReportService; import com.inspect.insreportdata.domain.InspectionReportData; import com.inspect.insreportdata.service.IInspectionReportDataService; +import com.inspect.message.MessageUtils; import com.inspect.taskftp.domain.PatrolTaskFtp; import com.inspect.taskftp.service.IPatrolTaskFtpService; @@ -58,6 +59,7 @@ import org.apache.poi.ss.usermodel.BorderStyle; import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.VerticalAlignment; import org.apache.poi.ss.util.CellRangeAddress; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; @@ -74,6 +76,9 @@ public class InspectionReportController extends BaseController { private final SftpClient sftpClient; private final IPatrolTaskFtpService patrolTaskFtpService; + @Autowired + private MessageUtils MessageUtils; + public InspectionReportController(IInspectionReportService inspectionReportService, IInspectionReportDataService inspectionReportDataService, IInspectionReportImgService inspectionReportImgService, SftpClient sftpClient, IPatrolTaskFtpService patrolTaskFtpService) { this.inspectionReportService = inspectionReportService; this.inspectionReportDataService = inspectionReportDataService; @@ -281,7 +286,7 @@ public class InspectionReportController extends BaseController { HSSFRow row0 = sheet.createRow(0); row0.setHeight((short) 600); HSSFCell cell0 = row0.createCell(0); - cell0.setCellValue("巡视报告"); + cell0.setCellValue(MessageUtils.get("巡视报告")); HSSFCellStyle hssfCellStyle = wb.createCellStyle(); hssfCellStyle.setAlignment(HorizontalAlignment.CENTER); hssfCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); @@ -293,13 +298,13 @@ public class InspectionReportController extends BaseController { cell0.setCellStyle(hssfCellStyle); HSSFRow row1 = sheet.createRow(1); HSSFCell cell11 = row1.createCell(0); - cell11.setCellValue("变电站"); + cell11.setCellValue(MessageUtils.get("变电站")); cell11.setCellStyle(colStyle2); HSSFCell cell12 = row1.createCell(4); cell12.setCellValue(inspectionReport.getStationName()); cell12.setCellStyle(colStyle2); HSSFCell cell13 = row1.createCell(8); - cell13.setCellValue("电压等级"); + cell13.setCellValue(MessageUtils.get("电压等级")); cell13.setCellStyle(colStyle2); HSSFCell cell14 = row1.createCell(12); cell14.setCellValue(inspectionReport.getVoltLevel()); @@ -314,7 +319,7 @@ public class InspectionReportController extends BaseController { HSSFRow row2 = sheet.createRow(2); HSSFCell cell21 = row2.createCell(0); - cell21.setCellValue("巡视计划创建日期"); + cell21.setCellValue(MessageUtils.get("巡视计划创建日期")); cell21.setCellStyle(colStyle2); HSSFCell cell22 = row2.createCell(4); if (inspectionReport.getInspectionDate() != null) { @@ -323,7 +328,7 @@ public class InspectionReportController extends BaseController { cell22.setCellStyle(colStyle2); HSSFCell cell23 = row2.createCell(8); - cell23.setCellValue("变电站类别"); + cell23.setCellValue(MessageUtils.get("变电站类别")); cell23.setCellStyle(colStyle2); HSSFCell cell24 = row2.createCell(12); cell24.setCellValue(inspectionReport.getStationType()); @@ -338,7 +343,7 @@ public class InspectionReportController extends BaseController { HSSFRow row3 = sheet.createRow(3); HSSFCell cell31 = row3.createCell(0); - cell31.setCellValue("巡视任务"); + cell31.setCellValue(MessageUtils.get("巡视任务")); cell31.setCellStyle(colStyle2); HSSFCell cell32 = row3.createCell(4); cell32.setCellValue(inspectionReport.getInspectionTaskName()); @@ -359,13 +364,13 @@ public class InspectionReportController extends BaseController { HSSFRow row4 = sheet.createRow(4); HSSFCell cell41 = row4.createCell(0); - cell41.setCellValue("审核人"); + cell41.setCellValue(MessageUtils.get("审核人")); cell41.setCellStyle(colStyle2); HSSFCell cell42 = row4.createCell(4); cell42.setCellValue(inspectionReport.getCheckPerson()); cell42.setCellStyle(colStyle2); HSSFCell cell43 = row4.createCell(8); - cell43.setCellValue("审核时间"); + cell43.setCellValue(MessageUtils.get("审核时间")); cell43.setCellStyle(colStyle2); HSSFCell cell44 = row4.createCell(12); cell44.setCellValue(DateUtils.format(DateUtils.yyyyMMddHHmmss2, inspectionReport.getCheckTime())); @@ -380,7 +385,7 @@ public class InspectionReportController extends BaseController { HSSFRow row5 = sheet.createRow(5); HSSFCell cell51 = row5.createCell(0); - cell51.setCellValue("巡视开始时间"); + cell51.setCellValue(MessageUtils.get("巡视开始时间")); cell51.setCellStyle(colStyle2); HSSFCell cell52 = row5.createCell(4); if (inspectionReport.getInspectionStartTime() != null) { @@ -389,7 +394,7 @@ public class InspectionReportController extends BaseController { cell52.setCellStyle(colStyle2); HSSFCell cell53 = row5.createCell(8); - cell53.setCellValue("巡视结束时间"); + cell53.setCellValue(MessageUtils.get("巡视结束时间")); cell53.setCellStyle(colStyle2); HSSFCell cell54 = row5.createCell(12); if (inspectionReport.getInspectionEndTime() != null) { @@ -408,7 +413,7 @@ public class InspectionReportController extends BaseController { HSSFRow row6 = sheet.createRow(6); row6.setHeight((short) 1000); HSSFCell cell61 = row6.createCell(0); - cell61.setCellValue("巡视统计"); + cell61.setCellValue(MessageUtils.get("巡视统计")); cell61.setCellStyle(colStyle2); HSSFCell cell62 = row6.createCell(4); cell62.setCellValue(inspectionReport.getPatrolStatistics()); @@ -432,7 +437,7 @@ public class InspectionReportController extends BaseController { HSSFRow row7 = sheet.createRow(8); row7.setHeight((short) 1000); HSSFCell cell71 = row7.createCell(0); - cell71.setCellValue("巡视结论"); + cell71.setCellValue(MessageUtils.get("巡视结论")); cell71.setCellStyle(colStyle2); HSSFCell cell72 = row7.createCell(4); cell72.setCellValue(inspectionReport.getDescription()); @@ -447,13 +452,13 @@ public class InspectionReportController extends BaseController { InspectionReportData inspectionReportData = new InspectionReportData(); List list = new ArrayList<>(); - inspectionReportData.setPointStatus("异常"); + inspectionReportData.setPointStatus(MessageUtils.get("异常")); list.add(inspectionReportData); InspectionReportData inspection = new InspectionReportData(); - inspection.setPointStatus("待人工确认"); + inspection.setPointStatus(MessageUtils.get("待人工确认")); list.add(inspection); InspectionReportData inspectionReportData1 = new InspectionReportData(); - inspectionReportData1.setPointStatus("正常"); + inspectionReportData1.setPointStatus(MessageUtils.get("正常")); list.add(inspectionReportData1); int total = 0; HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); @@ -465,7 +470,7 @@ public class InspectionReportController extends BaseController { sheet.addMergedRegion(cellRangeAddress1); HSSFRow rowa1 = sheet.createRow(9 + total); HSSFCell cella1 = rowa1.createCell(0); - cella1.setCellValue(arr.getPointStatus() + "点位汇总"); + cella1.setCellValue(arr.getPointStatus() + MessageUtils.get("点位汇总")); HSSFCellStyle cellStyle = wb.createCellStyle(); cellStyle.setAlignment(HorizontalAlignment.CENTER); cellStyle.setVerticalAlignment(VerticalAlignment.CENTER); @@ -487,41 +492,41 @@ public class InspectionReportController extends BaseController { sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 5, 6)); sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 9, 10)); cella1 = rowa1.createCell(0); - cella1.setCellValue("编号"); + cella1.setCellValue(MessageUtils.get("编号")); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(1); - cella1.setCellValue("区域"); + cella1.setCellValue(MessageUtils.get("区域")); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(2); - cella1.setCellValue("间隔"); + cella1.setCellValue(MessageUtils.get("间隔")); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(3); - cella1.setCellValue("设备"); + cella1.setCellValue(MessageUtils.get("设备")); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(4); - cella1.setCellValue("部件"); + cella1.setCellValue(MessageUtils.get("部件")); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(5); - cella1.setCellValue("点位"); + cella1.setCellValue(MessageUtils.get("点位")); cella1.setCellStyle(colStyle); cella1 = rowa1.createCell(6); cella1.setCellStyle(colStyle); cella1 = rowa1.createCell(7); - cella1.setCellValue("数据来源"); + cella1.setCellValue(MessageUtils.get("数据来源")); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(8); - cella1.setCellValue("采集时间"); + cella1.setCellValue(MessageUtils.get("采集时间")); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(9); - cella1.setCellValue("巡视结果"); + cella1.setCellValue(MessageUtils.get("巡视结果")); cella1.setCellStyle(colStyle); cella1 = rowa1.createCell(10); cella1.setCellStyle(colStyle); cella1 = rowa1.createCell(11); - cella1.setCellValue("点位状态"); + cella1.setCellValue(MessageUtils.get("点位状态")); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(12); - cella1.setCellValue("巡视图像"); + cella1.setCellValue(MessageUtils.get("巡视图像")); cella1.setCellStyle(colStyle); cella1 = rowa1.createCell(13); cella1.setCellStyle(colStyle); diff --git a/inspect-main/inspect-main-task/src/main/java/com/inspect/message/MessageUtils.java b/inspect-main/inspect-main-task/src/main/java/com/inspect/message/MessageUtils.java new file mode 100644 index 0000000..33adb20 --- /dev/null +++ b/inspect-main/inspect-main-task/src/main/java/com/inspect/message/MessageUtils.java @@ -0,0 +1,86 @@ +package com.inspect.message; + +import com.inspect.task.mapper.PatrolTaskMapper; +import com.inspect.task.service.IPatrolTaskService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class MessageUtils { + + final private Logger log = LoggerFactory.getLogger(MessageUtils.class); + + @Autowired + private IPatrolTaskService patrolTaskService; + + public String get(String key) { + String language = patrolTaskService.selectConfigByKey("LANGUAGE"); + log.info("language:{}, key:{}", language, key); + if(language == null || !language.equalsIgnoreCase("en")) { + return key; + } else { + switch (key) { + case "巡视报告": + return "Inspection Report"; + case "变电站": + return "Substation"; + case "电压等级": + return "Voltage level"; + case "巡视计划创建日期": + return "Inspection plan creation date"; + case "变电站类别": + return "Substation category"; + case "巡视任务": + return "Inspection task"; + case "环境信息": + return "environmental information"; + case "审核人": + return "reviewer"; + case "审核时间": + return "Audit time"; + case "巡视开始时间": + return "Inspection start time"; + case "巡视结束时间": + return "Inspection end time"; + case "巡视统计": + return "Inspection statistics"; + case "巡视结论": + return "Inspection conclusion"; + case "异常": + return "Abnormal"; + case "待人工确认": + return "Manual confirmation"; + case "正常": + return "Normal"; + case "点位汇总": + return "Point Summary"; + case "编号": + return "Number"; + case "区域": + return "Region"; + case "间隔": + return "Bay"; + case "设备": + return "Device"; + case "部件": + return "Component"; + case "点位": + return "Point"; + case "数据来源": + return "Data sources"; + case "采集时间": + return "Collection time"; + case "巡视结果": + return "Inspection results"; + case "点位状态": + return "Point status"; + case "巡视图像": + return "Patrol image"; + default: + return key; + } + } + } +} diff --git a/inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/controller/PatrolTaskResultMainController.java b/inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/controller/PatrolTaskResultMainController.java index f85f3ea..45b785d 100644 --- a/inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/controller/PatrolTaskResultMainController.java +++ b/inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/controller/PatrolTaskResultMainController.java @@ -19,6 +19,7 @@ import com.inspect.insreport.domain.InspectionReport; import com.inspect.insreport.service.IInspectionReportService; import com.inspect.insreportdata.domain.InspectionReportData; import com.inspect.insreportdata.service.IInspectionReportDataService; +import com.inspect.message.MessageUtils; import com.inspect.partrolresult.domain.PatrolResult; import com.inspect.partrolresult.service.IPatrolResultService; import com.inspect.partrolresult.util.PrintUtil; @@ -63,6 +64,7 @@ import org.apache.poi.xssf.streaming.SXSSFSheet; import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.apache.poi.xwpf.usermodel.*; import org.openxmlformats.schemas.wordprocessingml.x2006.main.*; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; @@ -88,6 +90,9 @@ public class PatrolTaskResultMainController extends BaseController { private final SftpClient sftpClient; private final IPatrolResultAuxService iPatrolResultAuxService; + @Autowired + private MessageUtils MessageUtils; + public PatrolTaskResultMainController(IPatrolTaskInfoService patrolTaskInfoService, IPatrolTaskResultMainService patrolTaskResultMainService, IPatrolResultService patrolResultService, IInspectionReportDataService inspectionReportDataService, IInspectionReportImgService inspectionReportImgService, IResultAnalysisService resultAnalysisService, IInspectionReportService inspectionReportService, IPatrolTaskService patrolTaskService, IPatrolTaskStatusService patrolTaskStatusService, SftpClient sftpClient, IPatrolResultAuxService iPatrolResultAuxService) { this.patrolTaskInfoService = patrolTaskInfoService; this.patrolTaskResultMainService = patrolTaskResultMainService; @@ -272,7 +277,7 @@ public class PatrolTaskResultMainController extends BaseController { XWPFDocument doc = new XWPFDocument(); // 标题 - addTitle(doc, "巡视报告"); + addTitle(doc, MessageUtils.get("巡视报告")); // 基本信息表格 XWPFTable baseInfoTable = doc.createTable(7, 4); @@ -286,7 +291,7 @@ public class PatrolTaskResultMainController extends BaseController { // 点位汇总 - List statusList = Arrays.asList("异常", "待人工确认", "正常"); + List statusList = Arrays.asList(MessageUtils.get("异常"), MessageUtils.get("待人工确认"), MessageUtils.get("正常")); for (String status : statusList) { addStatusSection(doc, report, status, images); } @@ -317,19 +322,19 @@ public class PatrolTaskResultMainController extends BaseController { private void fillBaseInfo(XWPFTable table, InspectionReport report) { - fillRow(table, 0, "变电站", report.getStationName(), "电压等级", report.getVoltLevel()); - fillRow(table, 1, "巡视计划创建日期", formatDate(report.getInspectionDate()), - "变电站类别", report.getStationType()); - fillRow(table, 2, "巡视任务", report.getInspectionTaskName(), - "环境信息", report.getEnvInfo()); - fillRow(table, 3, "审核人", report.getCheckPerson(), - "审核时间", formatDateTime(report.getCheckTime())); - fillRow(table, 4, "巡视开始时间", formatDateTime(report.getInspectionStartTime()), - "巡视结束时间", formatDateTime(report.getInspectionEndTime())); - fillRowWithMerge(table, 5, "巡视统计", report.getPatrolStatistics(), 3); + fillRow(table, 0, MessageUtils.get("变电站"), report.getStationName(), MessageUtils.get("电压等级"), report.getVoltLevel()); + fillRow(table, 1, MessageUtils.get("巡视计划创建日期"), formatDate(report.getInspectionDate()), + MessageUtils.get("变电站类别"), report.getStationType()); + fillRow(table, 2, MessageUtils.get("巡视任务"), report.getInspectionTaskName(), + MessageUtils.get("环境信息"), report.getEnvInfo()); + fillRow(table, 3, MessageUtils.get("审核人"), report.getCheckPerson(), + MessageUtils.get("审核时间"), formatDateTime(report.getCheckTime())); + fillRow(table, 4, MessageUtils.get("巡视开始时间"), formatDateTime(report.getInspectionStartTime()), + MessageUtils.get("巡视结束时间"), formatDateTime(report.getInspectionEndTime())); + fillRowWithMerge(table, 5, MessageUtils.get("巡视统计"), report.getPatrolStatistics(), 3); // 新增:巡视结论(合并右侧3列) - fillRowWithMerge(table, 6, "巡视结论", report.getDescription(), 3); + fillRowWithMerge(table, 6, MessageUtils.get("巡视结论"), report.getDescription(), 3); } private void fillRow(XWPFTable table, int rowNum, String... values) { @@ -452,15 +457,15 @@ public class PatrolTaskResultMainController extends BaseController { private void addStatusSection(XWPFDocument doc, InspectionReport report, String status, Map images) { - addSectionHeader(doc, status + "点位汇总"); + addSectionHeader(doc, status + MessageUtils.get("点位汇总")); XWPFTable table = doc.createTable(1, 9); table.setWidth("100%"); // 创建表头 - String[] headers = {"编号", "区域", "设备", "点位", "数据来源", - "采集时间", "巡视结果", "点位状态", "巡视图像"}; + String[] headers = {MessageUtils.get("编号"), MessageUtils.get("区域"), MessageUtils.get("设备"), MessageUtils.get("点位"), MessageUtils.get("数据来源"), + MessageUtils.get("采集时间"), MessageUtils.get("巡视结果"), MessageUtils.get("点位状态"), MessageUtils.get("巡视图像")}; XWPFTableRow headerRow = table.getRow(0); for (int i = 0; i < headers.length; i++) { XWPFTableCell cell = headerRow.getCell(i); @@ -867,7 +872,7 @@ public class PatrolTaskResultMainController extends BaseController { HSSFRow hssRow = hssfSheet.createRow(0); hssRow.setHeight((short) 600); HSSFCell cell0 = hssRow.createCell(0); - cell0.setCellValue("巡视报告"); + cell0.setCellValue(MessageUtils.get("巡视报告")); HSSFCellStyle hssfCellStyle = hssfWorkbook.createCellStyle(); hssfCellStyle.setAlignment(HorizontalAlignment.CENTER); hssfCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); @@ -879,13 +884,13 @@ public class PatrolTaskResultMainController extends BaseController { cell0.setCellStyle(hssfCellStyle); HSSFRow row1 = hssfSheet.createRow(1); HSSFCell cell11 = row1.createCell(0); - cell11.setCellValue("变电站"); + cell11.setCellValue(MessageUtils.get("变电站")); cell11.setCellStyle(colStyle2); HSSFCell cell12 = row1.createCell(4); cell12.setCellValue(inspectionReport.getStationName()); cell12.setCellStyle(colStyle2); HSSFCell cell13 = row1.createCell(8); - cell13.setCellValue("电压等级"); + cell13.setCellValue(MessageUtils.get("电压等级")); cell13.setCellStyle(colStyle2); HSSFCell cell14 = row1.createCell(12); cell14.setCellValue(inspectionReport.getVoltLevel()); @@ -899,7 +904,7 @@ public class PatrolTaskResultMainController extends BaseController { HSSFRow hssfRow2 = hssfSheet.createRow(2); HSSFCell cell21 = hssfRow2.createCell(0); - cell21.setCellValue("巡视计划创建日期"); + cell21.setCellValue(MessageUtils.get("巡视计划创建日期")); cell21.setCellStyle(colStyle2); HSSFCell cell22 = hssfRow2.createCell(4); if (inspectionReport.getInspectionDate() != null) { @@ -908,7 +913,7 @@ public class PatrolTaskResultMainController extends BaseController { cell22.setCellStyle(colStyle2); HSSFCell cell23 = hssfRow2.createCell(8); - cell23.setCellValue("变电站类别"); + cell23.setCellValue(MessageUtils.get("变电站类别")); cell23.setCellStyle(colStyle2); HSSFCell cell24 = hssfRow2.createCell(12); cell24.setCellValue(inspectionReport.getStationType()); @@ -923,13 +928,13 @@ public class PatrolTaskResultMainController extends BaseController { HSSFRow hssfRow3 = hssfSheet.createRow(3); HSSFCell cell31 = hssfRow3.createCell(0); - cell31.setCellValue("巡视任务"); + cell31.setCellValue(MessageUtils.get("巡视任务")); cell31.setCellStyle(colStyle2); HSSFCell cell32 = hssfRow3.createCell(4); cell32.setCellValue(inspectionReport.getInspectionTaskName()); cell32.setCellStyle(colStyle2); HSSFCell cell33 = hssfRow3.createCell(8); - cell33.setCellValue("环境信息"); + cell33.setCellValue(MessageUtils.get("环境信息")); cell33.setCellStyle(colStyle2); HSSFCell cell34 = hssfRow3.createCell(12); cell34.setCellValue(inspectionReport.getEnvInfo()); @@ -943,13 +948,13 @@ public class PatrolTaskResultMainController extends BaseController { HSSFRow hssfRow4 = hssfSheet.createRow(4); HSSFCell cell41 = hssfRow4.createCell(0); - cell41.setCellValue("审核人"); + cell41.setCellValue(MessageUtils.get("审核人")); cell41.setCellStyle(colStyle2); HSSFCell cell42 = hssfRow4.createCell(4); cell42.setCellValue(inspectionReport.getCheckPerson()); cell42.setCellStyle(colStyle2); HSSFCell cell43 = hssfRow4.createCell(8); - cell43.setCellValue("审核时间"); + cell43.setCellValue(MessageUtils.get("审核时间")); cell43.setCellStyle(colStyle2); HSSFCell cell44 = hssfRow4.createCell(12); cell44.setCellValue(DateUtils.format(DateUtils.yyyyMMddHHmmss2, inspectionReport.getCheckTime())); @@ -964,7 +969,7 @@ public class PatrolTaskResultMainController extends BaseController { HSSFRow hssfRow5 = hssfSheet.createRow(5); HSSFCell cell51 = hssfRow5.createCell(0); - cell51.setCellValue("巡视开始时间"); + cell51.setCellValue(MessageUtils.get("巡视开始时间")); cell51.setCellStyle(colStyle2); HSSFCell cell52 = hssfRow5.createCell(4); if (inspectionReport.getInspectionStartTime() != null) { @@ -973,7 +978,7 @@ public class PatrolTaskResultMainController extends BaseController { cell52.setCellStyle(colStyle2); HSSFCell cell53 = hssfRow5.createCell(8); - cell53.setCellValue("巡视结束时间"); + cell53.setCellValue(MessageUtils.get("巡视结束时间")); cell53.setCellStyle(colStyle2); HSSFCell cell54 = hssfRow5.createCell(12); if (inspectionReport.getInspectionEndTime() != null) { @@ -992,7 +997,7 @@ public class PatrolTaskResultMainController extends BaseController { HSSFRow hssfRow6 = hssfSheet.createRow(6); hssfRow6.setHeight((short) 1000); HSSFCell cell61 = hssfRow6.createCell(0); - cell61.setCellValue("巡视统计"); + cell61.setCellValue(MessageUtils.get("巡视统计")); cell61.setCellStyle(colStyle2); HSSFCell cell62 = hssfRow6.createCell(4); cell62.setCellValue(inspectionReport.getPatrolStatistics()); @@ -1016,7 +1021,7 @@ public class PatrolTaskResultMainController extends BaseController { HSSFRow hssfRow7 = hssfSheet.createRow(8); hssfRow7.setHeight((short) 1000); HSSFCell cell71 = hssfRow7.createCell(0); - cell71.setCellValue("巡视结论"); + cell71.setCellValue(MessageUtils.get("巡视结论")); cell71.setCellStyle(colStyle2); HSSFCell cell72 = hssfRow7.createCell(4); cell72.setCellValue(inspectionReport.getDescription()); @@ -1031,13 +1036,13 @@ public class PatrolTaskResultMainController extends BaseController { InspectionReportData inspectionReportData = new InspectionReportData(); List list = new ArrayList<>(); - inspectionReportData.setPointStatus("异常"); + inspectionReportData.setPointStatus(MessageUtils.get("异常")); list.add(inspectionReportData); InspectionReportData inspection = new InspectionReportData(); - inspection.setPointStatus("待人工确认"); + inspection.setPointStatus(MessageUtils.get("待人工确认")); list.add(inspection); InspectionReportData reportData = new InspectionReportData(); - reportData.setPointStatus("正常"); + reportData.setPointStatus(MessageUtils.get("正常")); list.add(reportData); int total = 0; HSSFPatriarch patriarch = hssfSheet.createDrawingPatriarch(); @@ -1049,7 +1054,7 @@ public class PatrolTaskResultMainController extends BaseController { hssfSheet.addMergedRegion(cellRangeAddress); HSSFRow rowa1 = hssfSheet.createRow(9 + total); HSSFCell cella1 = rowa1.createCell(0); - cella1.setCellValue(arr.getPointStatus() + "点位汇总"); + cella1.setCellValue(arr.getPointStatus() + MessageUtils.get("点位汇总")); HSSFCellStyle hssfCellStyle1 = hssfWorkbook.createCellStyle(); hssfCellStyle1.setAlignment(HorizontalAlignment.CENTER); hssfCellStyle1.setVerticalAlignment(VerticalAlignment.CENTER); @@ -1073,39 +1078,39 @@ public class PatrolTaskResultMainController extends BaseController { hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 5, 6)); hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 9, 10)); cella1 = rowa1.createCell(0); - cella1.setCellValue("编号"); + cella1.setCellValue(MessageUtils.get("编号")); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(1); - cella1.setCellValue("区域"); + cella1.setCellValue(MessageUtils.get("区域")); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(2); - cella1.setCellValue("设备"); + cella1.setCellValue(MessageUtils.get("设备")); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(3); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(4); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(5); - cella1.setCellValue("点位"); + cella1.setCellValue(MessageUtils.get("点位")); cella1.setCellStyle(colStyle); cella1 = rowa1.createCell(6); cella1.setCellStyle(colStyle); cella1 = rowa1.createCell(7); - cella1.setCellValue("数据来源"); + cella1.setCellValue(MessageUtils.get("数据来源")); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(8); - cella1.setCellValue("采集时间"); + cella1.setCellValue(MessageUtils.get("采集时间")); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(9); - cella1.setCellValue("巡视结果"); + cella1.setCellValue(MessageUtils.get("巡视结果")); cella1.setCellStyle(colStyle); cella1 = rowa1.createCell(10); cella1.setCellStyle(colStyle); cella1 = rowa1.createCell(11); - cella1.setCellValue("点位状态"); + cella1.setCellValue(MessageUtils.get("点位状态")); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(12); - cella1.setCellValue("巡视图像"); + cella1.setCellValue(MessageUtils.get("巡视图像")); cella1.setCellStyle(colStyle); cella1 = rowa1.createCell(13); cella1.setCellStyle(colStyle); @@ -1318,7 +1323,7 @@ public class PatrolTaskResultMainController extends BaseController { Row row0 = sheet.createRow(0); row0.setHeight((short) 600); Cell cell0 = row0.createCell(0); - cell0.setCellValue("巡视报告"); + cell0.setCellValue(MessageUtils.get("巡视报告")); CellStyle stylea = wb.createCellStyle(); stylea.setAlignment(HorizontalAlignment.CENTER); stylea.setVerticalAlignment(VerticalAlignment.CENTER); @@ -1330,13 +1335,13 @@ public class PatrolTaskResultMainController extends BaseController { cell0.setCellStyle(stylea); Row row1 = sheet.createRow(1); Cell cell11 = row1.createCell(0); - cell11.setCellValue("变电站"); + cell11.setCellValue(MessageUtils.get("变电站")); cell11.setCellStyle(colStyle2); Cell cell12 = row1.createCell(4); cell12.setCellValue(inspectionReport.getStationName()); cell12.setCellStyle(colStyle2); Cell cell13 = row1.createCell(8); - cell13.setCellValue("电压等级"); + cell13.setCellValue(MessageUtils.get("电压等级")); cell13.setCellStyle(colStyle2); Cell cell14 = row1.createCell(12); cell14.setCellValue(inspectionReport.getVoltLevel()); @@ -1351,7 +1356,7 @@ public class PatrolTaskResultMainController extends BaseController { Row row2 = sheet.createRow(2); Cell cell21 = row2.createCell(0); - cell21.setCellValue("巡视计划创建日期"); + cell21.setCellValue(MessageUtils.get("巡视计划创建日期")); cell21.setCellStyle(colStyle2); Cell cell22 = row2.createCell(4); if (inspectionReport.getInspectionDate() != null) { @@ -1360,7 +1365,7 @@ public class PatrolTaskResultMainController extends BaseController { cell22.setCellStyle(colStyle2); Cell cell23 = row2.createCell(8); - cell23.setCellValue("变电站类别"); + cell23.setCellValue(MessageUtils.get("变电站类别")); cell23.setCellStyle(colStyle2); Cell cell24 = row2.createCell(12); cell24.setCellValue(inspectionReport.getStationType()); @@ -1375,13 +1380,13 @@ public class PatrolTaskResultMainController extends BaseController { Row row3 = sheet.createRow(3); Cell cell31 = row3.createCell(0); - cell31.setCellValue("巡视任务"); + cell31.setCellValue(MessageUtils.get("巡视任务")); cell31.setCellStyle(colStyle2); Cell cell32 = row3.createCell(4); cell32.setCellValue(inspectionReport.getInspectionTaskName()); cell32.setCellStyle(colStyle2); Cell cell33 = row3.createCell(8); - cell33.setCellValue("环境信息"); + cell33.setCellValue(MessageUtils.get("环境信息")); cell33.setCellStyle(colStyle2); Cell cell34 = row3.createCell(12); cell34.setCellValue(inspectionReport.getEnvInfo()); @@ -1396,13 +1401,13 @@ public class PatrolTaskResultMainController extends BaseController { Row row4 = sheet.createRow(4); Cell cell41 = row4.createCell(0); - cell41.setCellValue("审核人"); + cell41.setCellValue(MessageUtils.get("审核人")); cell41.setCellStyle(colStyle2); Cell cell42 = row4.createCell(4); cell42.setCellValue(inspectionReport.getCheckPerson()); cell42.setCellStyle(colStyle2); Cell cell43 = row4.createCell(8); - cell43.setCellValue("审核时间"); + cell43.setCellValue(MessageUtils.get("审核时间")); cell43.setCellStyle(colStyle2); Cell cell44 = row4.createCell(12); cell44.setCellValue(DateUtil.formatDateTime(inspectionReport.getCheckTime())); @@ -1417,7 +1422,7 @@ public class PatrolTaskResultMainController extends BaseController { Row row5 = sheet.createRow(5); Cell cell51 = row5.createCell(0); - cell51.setCellValue("巡视开始时间"); + cell51.setCellValue(MessageUtils.get("巡视开始时间")); cell51.setCellStyle(colStyle2); Cell cell52 = row5.createCell(4); if (inspectionReport.getInspectionStartTime() != null) { @@ -1426,7 +1431,7 @@ public class PatrolTaskResultMainController extends BaseController { cell52.setCellStyle(colStyle2); Cell cell53 = row5.createCell(8); - cell53.setCellValue("巡视结束时间"); + cell53.setCellValue(MessageUtils.get("巡视结束时间")); cell53.setCellStyle(colStyle2); Cell cell54 = row5.createCell(12); if (inspectionReport.getInspectionEndTime() != null) { @@ -1445,7 +1450,7 @@ public class PatrolTaskResultMainController extends BaseController { Row row6 = sheet.createRow(6); row6.setHeight((short) 1000); Cell cell61 = row6.createCell(0); - cell61.setCellValue("巡视统计"); + cell61.setCellValue(MessageUtils.get("巡视统计")); cell61.setCellStyle(colStyle2); Cell cell62 = row6.createCell(4); cell62.setCellValue(inspectionReport.getPatrolStatistics()); @@ -1469,7 +1474,7 @@ public class PatrolTaskResultMainController extends BaseController { Row row7 = sheet.createRow(8); row7.setHeight((short) 1000); Cell cell71 = row7.createCell(0); - cell71.setCellValue("巡视结论"); + cell71.setCellValue(MessageUtils.get("巡视结论")); cell71.setCellStyle(colStyle2); Cell cell72 = row7.createCell(4); cell72.setCellValue(inspectionReport.getDescription()); @@ -1485,13 +1490,13 @@ public class PatrolTaskResultMainController extends BaseController { InspectionReportData inspectionReportData = new InspectionReportData(); List list = new ArrayList(); - inspectionReportData.setPointStatus("异常"); + inspectionReportData.setPointStatus(MessageUtils.get("异常")); list.add(inspectionReportData); InspectionReportData inspection = new InspectionReportData(); - inspection.setPointStatus("待人工确认"); + inspection.setPointStatus(MessageUtils.get("待人工确认")); list.add(inspection); InspectionReportData inection = new InspectionReportData(); - inection.setPointStatus("正常"); + inection.setPointStatus(MessageUtils.get("正常")); list.add(inection); int total = 0; @@ -1503,7 +1508,7 @@ public class PatrolTaskResultMainController extends BaseController { sheet.addMergedRegion(callRangeAddressa1); Row rowa1 = sheet.createRow(9 + total); Cell cella1 = rowa1.createCell(0); - cella1.setCellValue(arr.getPointStatus() + "点位汇总"); + cella1.setCellValue(arr.getPointStatus() + MessageUtils.get("点位汇总")); CellStyle styleab = wb.createCellStyle(); styleab.setAlignment(HorizontalAlignment.CENTER); styleab.setVerticalAlignment(VerticalAlignment.CENTER); @@ -1527,39 +1532,39 @@ public class PatrolTaskResultMainController extends BaseController { sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 5, 6)); sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 9, 10)); cella1 = rowa1.createCell(0); - cella1.setCellValue("编号"); + cella1.setCellValue(MessageUtils.get("编号")); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(1); - cella1.setCellValue("区域"); + cella1.setCellValue(MessageUtils.get("区域")); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(2); - cella1.setCellValue("设备"); + cella1.setCellValue(MessageUtils.get("设备")); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(3); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(4); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(5); - cella1.setCellValue("点位"); + cella1.setCellValue(MessageUtils.get("点位")); cella1.setCellStyle(colStyle); cella1 = rowa1.createCell(6); cella1.setCellStyle(colStyle); cella1 = rowa1.createCell(7); - cella1.setCellValue("数据来源"); + cella1.setCellValue(MessageUtils.get("数据来源")); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(8); - cella1.setCellValue("采集时间"); + cella1.setCellValue(MessageUtils.get("采集时间")); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(9); - cella1.setCellValue("巡视结果"); + cella1.setCellValue(MessageUtils.get("巡视结果")); cella1.setCellStyle(colStyle); cella1 = rowa1.createCell(10); cella1.setCellStyle(colStyle); cella1 = rowa1.createCell(11); - cella1.setCellValue("点位状态"); + cella1.setCellValue(MessageUtils.get("点位状态")); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(12); - cella1.setCellValue("巡视图像"); + cella1.setCellValue(MessageUtils.get("巡视图像")); cella1.setCellStyle(colStyle); cella1 = rowa1.createCell(13); cella1.setCellStyle(colStyle);