diff --git a/inspect-main/inspect-main-task/src/main/java/com/inspect/fegin/FeignBasedataAreaService.java b/inspect-main/inspect-main-task/src/main/java/com/inspect/fegin/FeignBasedataAreaService.java index 1ccad9e..62f4061 100644 --- a/inspect-main/inspect-main-task/src/main/java/com/inspect/fegin/FeignBasedataAreaService.java +++ b/inspect-main/inspect-main-task/src/main/java/com/inspect/fegin/FeignBasedataAreaService.java @@ -13,4 +13,7 @@ public interface FeignBasedataAreaService { @GetMapping({"/area/list"}) AjaxResult list(@RequestParam("baseDataArea") JSONObject var1); + + @GetMapping({"/montdata/evndata/evnList"}) + AjaxResult evnList(); } diff --git a/inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/IPatrolResultService.java b/inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/IPatrolResultService.java index 4b15b4a..786098f 100644 --- a/inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/IPatrolResultService.java +++ b/inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/IPatrolResultService.java @@ -83,6 +83,8 @@ public interface IPatrolResultService { List saveReport(PatrolTaskResultMain resultMain, List lineIds, Long currentLineId, List resultList, int aiQxNum, int csQxNum); + List saveReportLingzhou(PatrolTaskResultMain resultMain, List lineIds, Long currentLineId, List resultList, int aiQxNum, int csQxNum); + List saveReportV2(PatrolTaskResultMain patrolTaskResultMain, List patrolResultList); List selectResultRefByLineId(String lineId); diff --git a/inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/impl/PatrolResultServiceImpl.java b/inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/impl/PatrolResultServiceImpl.java index 5a2afa6..a242d45 100644 --- a/inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/impl/PatrolResultServiceImpl.java +++ b/inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/impl/PatrolResultServiceImpl.java @@ -1,6 +1,7 @@ package com.inspect.partrolresult.service.impl; import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.inspect.analysis.domain.AlgValue; import com.inspect.analysis.domain.AnalyseResPoint; @@ -11,6 +12,8 @@ import com.inspect.base.core.constant.AlgConstants; import com.inspect.base.core.exception.ServiceException; import com.inspect.base.core.utils.DateUtils; import com.inspect.base.core.utils.StringUtils; +import com.inspect.base.core.web.domain.AjaxResult; +import com.inspect.fegin.FeignBasedataAreaService; import com.inspect.img.domain.InspectionReportImg; import com.inspect.img.mapper.InspectionReportImgMapper; import com.inspect.insreport.domain.InspectionReport; @@ -27,6 +30,7 @@ import com.inspect.patrolresultdefault.mapper.PatrolResultDefaultValueMapper; import com.inspect.resultmain.domain.PatrolTaskResultMain; import com.inspect.resultmain.mapper.PatrolTaskResultMainMapper; import com.inspect.system.base.openDomain.BasedataEqpBookMoMain; +import com.inspect.system.base.openDomain.PatrolTaskDomain; import com.inspect.task.domain.PatrolData; import com.inspect.task.domain.PatrolTask; import com.inspect.task.mapper.PatrolTaskMapper; @@ -64,6 +68,8 @@ public class PatrolResultServiceImpl implements IPatrolResultService { private final InspectionReportDataMapper inspectionReportDataMapper; private final ResultAnalysisMapper resultAnalysisMapper; + private final FeignBasedataAreaService feignBasedataAreaService; + @Autowired private MessageUtils messageUtils; @@ -76,7 +82,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { AlgConstants.INFRA_CAMERA_REVERSE ));; - public PatrolResultServiceImpl(PatrolResultMapper patrolResultMapper, PatrolResultDefaultValueMapper patrolResultDefaultvalueMapper, PatrolTaskResultMainMapper patrolTaskResultMainMapper, PatrolTaskStatusMapper patrolTaskStatusMapper, PatrolTaskMapper patrolTaskMapper, InspectionReportMapper inspectionReportMapper, InspectionReportImgMapper inspectionReportImgMapper, InspectionReportDataMapper inspectionReportDataMapper, ResultAnalysisMapper resultAnalysisMapper) { + public PatrolResultServiceImpl(PatrolResultMapper patrolResultMapper, PatrolResultDefaultValueMapper patrolResultDefaultvalueMapper, PatrolTaskResultMainMapper patrolTaskResultMainMapper, PatrolTaskStatusMapper patrolTaskStatusMapper, PatrolTaskMapper patrolTaskMapper, InspectionReportMapper inspectionReportMapper, InspectionReportImgMapper inspectionReportImgMapper, InspectionReportDataMapper inspectionReportDataMapper, ResultAnalysisMapper resultAnalysisMapper, FeignBasedataAreaService feignBasedataAreaService) { this.patrolResultMapper = patrolResultMapper; this.patrolResultDefaultvalueMapper = patrolResultDefaultvalueMapper; this.patrolTaskResultMainMapper = patrolTaskResultMainMapper; @@ -86,6 +92,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { this.inspectionReportImgMapper = inspectionReportImgMapper; this.inspectionReportDataMapper = inspectionReportDataMapper; this.resultAnalysisMapper = resultAnalysisMapper; + this.feignBasedataAreaService = feignBasedataAreaService; } @@ -337,6 +344,26 @@ public class PatrolResultServiceImpl implements IPatrolResultService { return saveReportData(resultList, resultMain, lineIds, aiQxNum, csQxNum); } + @Transactional + public List saveReportLingzhou(PatrolTaskResultMain resultMain, List lineIds, Long currentLineId, List resultList, int aiQxNum, int csQxNum) { + long startTime = System.currentTimeMillis(); + List reportIds = new ArrayList<>(); +// String mainId = String.valueOf(resultMain.getLineId()); + for (Long lineId : lineIds) { + resultMain.setLineId(lineId); + resultMain.setCheckTime(new Date()); + resultMain.setFileStatus("1"); + this.patrolTaskResultMainMapper.updatePatrolTaskResultMain(resultMain); + this.patrolResultMapper.updatePatrolResultByMainId(String.valueOf(lineId)); + reportIds.addAll(saveReportDataLingzhou(resultList, resultMain, lineIds, aiQxNum, csQxNum)); + } + + PrintUtil.useTime("AMENDING DATA", startTime); + return reportIds; +// resultMain.setLineId(currentLineId); +// return saveReportData(resultList, resultMain, lineIds); + } + @Transactional public List saveReportV2(PatrolTaskResultMain resultMain, List resultList) { long startTime = System.currentTimeMillis(); @@ -432,6 +459,105 @@ public class PatrolResultServiceImpl implements IPatrolResultService { } } + public List saveReportDataLingzhou(List resultList, PatrolTaskResultMain resultMain, List lineIds, int aiQxNum, int csQxNum) { + long startTime = System.currentTimeMillis(); + String mainId = String.valueOf(resultMain.getLineId()); +// String analyseNum = statisticsAnalyseNum(lineIds, resultList.size()); +// String filterNum = statisticsAnalyseNumLingZhou(lineIds, "1"); + String AiNum = statisticsAnalyseNumLingZhou(lineIds, "0"); +// String[] nums = new String[]{AiNum, filterNum}; + String[] nums = new String[]{AiNum}; + startTime = PrintUtil.useTime("STATISTICS ANALYZE DATA", startTime); + if (resultList.isEmpty()) { + throw new ServiceException("LACK INSPECT RESULT: " + mainId); + } else { + PatrolResult patrolResult = resultList.stream().filter(item -> mainId.equals(item.getMainId())).findFirst().orElse(null); + assert patrolResult != null; + String taskCode = patrolResult.getTaskCode(); + String taskPatrolId = patrolResult.getTaskPatrolledId(); + List taskNames = resultList.stream().map(PatrolResult::getTaskName).distinct().collect(Collectors.toList()); + String taskName = StringUtils.join(taskNames, ","); + if (StringUtils.isEmpty(taskPatrolId)) { + throw new ServiceException("LACK PLAN ID: " + mainId); + } else { + List taskStatuses = this.patrolTaskStatusMapper.selectPatrolTaskStatusList(PatrolTaskStatus.builder().taskPatrolledId(taskPatrolId).build()); + startTime = PrintUtil.useTime("INQUIRY STATUS", startTime); + if (taskStatuses.isEmpty()) { + throw new ServiceException("LACKING STATUS: " + mainId); + } else { + PatrolTaskStatus taskStatus = taskStatuses.get(0); + List list = patrolTaskMapper.selectPatrolTaskList(PatrolTask.builder().taskCode(taskCode).build()); + startTime = PrintUtil.useTime("INQUIRY TASK PLAN", startTime); + if (list.isEmpty()) { + throw new ServiceException("TASK PLAN LOST: " + taskCode); + } else { + List reportIds = new ArrayList<>(); + PatrolTask task = list.get(0); +// List reports = inspectionReportMapper.selectInspectionReportList(new InspectionReport(mainId)); +// startTime = PrintUtil.useTime("INQUIRY TASK REPORT", startTime); +// InspectionReport report; +// if (!reports.isEmpty()) { +// report = reports.get(0); +// resetReport(report, analyseNum, mainId, task, taskStatus); +// inspectionReportMapper.updateInspectionReport(report); +// PrintUtil.useTime("MODIFY TASK REPORT", startTime); +// } else { + Map stationMap = patrolResultMapper.selectBasedataStation(); + String stationName = stationMap.get("station_name"); + String stationType = stationMap.get("station_type"); + String voltLevel = stationMap.get("volt_level"); + AjaxResult ajaxResult = feignBasedataAreaService.evnList(); + List jsonObjects = JSONObject.parseArray(JSON.toJSONString(ajaxResult.get("data")), JSONObject.class); + log.info("EVN LIST: " + jsonObjects); + List envoList = new ArrayList<>(); + for (JSONObject jsonObject : jsonObjects) { + String typeName = jsonObject.getString("typeName"); + String valueUnit = jsonObject.getString("valueUnit"); + if (StringUtils.isEmpty(valueUnit) || StringUtils.isEmpty(typeName)) { + continue; + } + envoList.add(typeName + ":" + valueUnit); + } + for (int i = 0; i < nums.length; i++) { + if ("0".equals(exportReportFlag) && i == 0 && aiQxNum == 0) { + continue; + } + if ("0".equals(exportReportFlag) && i == 1 && csQxNum == 0) { + continue; + } + List patrolResultRefs = patrolResultMapper.selectResultRefByLineIds(lineIds, String.valueOf(i)); + if (patrolResultRefs.isEmpty()) { + continue; + } + InspectionReport report = new InspectionReport(); + resetReport(report, nums[i], mainId, task, taskStatus); + report.setTaskId(String.valueOf(task.getTaskId())); + report.setEnvInfo(StringUtils.join(envoList,",")); + report.setTaskPatrolledId(taskPatrolId); + report.setInspectionTaskName(taskName); + report.setDescription(resultMain.getTaskResult()); + report.setCheckPerson(resultMain.getCheckPerson()); + report.setCheckTime(resultMain.getCheckTime()); + report.setStationName(stationName); + report.setVoltLevel(StringUtils.isEmpty(voltLevel) ? voltage : voltLevel); + report.setFilter(String.valueOf(i)); + report.setStationType(stationType); + inspectionReportMapper.insertInspectionReport(report); + PrintUtil.useTime("NEW TASK REPORT", startTime); + batchInsertReportData(String.valueOf(report.getLineId()), lineIds, String.valueOf(i), patrolResultRefs); + PrintUtil.useTime("BATCH INSERT DETAIL", startTime); + log.info("[ARCHIVE] reportId: {}", report.getLineId()); + Long lineId = report.getLineId(); + reportIds.add(lineId); + } +// } + return reportIds; + } + } + } + } + } + public List saveReportDataV2(List resultList, PatrolTaskResultMain resultMain) { long startTime = System.currentTimeMillis(); String mainId = String.valueOf(resultMain.getLineId()); @@ -867,6 +993,35 @@ public class PatrolResultServiceImpl implements IPatrolResultService { return String.format(messageUtils.get("缺陷总数:%d个"), totalNum); } + + public String statisticsAnalyseNumLingZhou(List lineIds, String filter) { + int okNum = 0; + int failNum = 0; + int confirmNum = 0; + List analyses = resultAnalysisMapper.selectResultAnalysisListByMainIdsNew(lineIds, filter); + int totalNum = analyses.size(); + log.info("lineIds:{},statisticsAnalyseNum analyses:{}", lineIds, analyses); + for (ResultAnalysis analyse : analyses) { + String resultType = analyse.getResultType(); + if (resultType.equals("0")) { + ++confirmNum; + } else if (resultType.equals("1")) { + ++okNum; + } else if (resultType.equals("2")) { + ++failNum; + } + } +// +// int lastNum = totalNum - failNum - confirmNum; +// if (lastNum != okNum) { +// okNum = lastNum; +// } + +// return String.format("总点位:%d个,已检点位:%d个,未检点位:0个,正常点位:%d个,异常点位:%d个,待人工确认点位:%d个。", totalNum, totalNum, okNum, failNum, confirmNum); + return String.format(messageUtils.get("本次任务巡视总点位:%d个,已检点位:%d个,未检点位:0个,正常点位:%d个,异常点位:%d个,缺陷点位:%d个。"), totalNum, totalNum, okNum, failNum, confirmNum); +// return String.format(messageUtils.get("缺陷总数:%d个"), totalNum); + } + public String statisticsAnalyseNumV2(String mainId, String filter) { int okNum = 0; int failNum = 0; 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 6b9253a..9e4bafd 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 @@ -266,6 +266,105 @@ public class PatrolTaskResultMainController extends BaseController { } + + @PostMapping({"/updateInfo"}) + public AjaxResult updateInfo_lingzhou( + @RequestBody PatrolTaskResultMain resultMain) { + List lineIds = resultMain.getLineIds(); + Long lineId = resultMain.getLineIds().get(0); + resultMain.setLineId(lineId); +// resultMain.setLineIds(lineIds); +// resultMain.setCheckPerson(checkPerson); +// resultMain.setTaskResult(taskResult); + String mainId = String.valueOf(lineId); + long startTime = System.currentTimeMillis(); +// logger.info("[ARCHIVE] Starting, Id: {}", mainId); + List longs = patrolTaskResultMainService.selectLineIdsByList(lineIds); + if (longs != null && longs.size() > 0) { + lineIds.addAll(longs); + } + lineIds = lineIds.stream().distinct().collect(Collectors.toList()); + + logger.info("---归档--lineIds size: {},lineIds:{}", lineIds.size(), lineIds); +// int analyseNum, collectNum; +// AtomicInteger modifyNum = new AtomicInteger(0); +// List resultList = patrolResultService.selectPatrolResultList(new PatrolResult(mainId)); + List resultList = patrolResultService.selectPatrolResultListByMainIds(lineIds); + if (resultList.isEmpty()) { + logger.error("[归档]失败, 数据采集中..."); + return AjaxResult.error("数据采集中请稍后...."); + } + ResultAnalysis resultAnalysis = new ResultAnalysis(); + int csQxNum = 0, aiQxNum = 0; + List taskPatrolledIds = resultList.stream().map(PatrolResult::getTaskPatrolledId).distinct().collect(Collectors.toList()); + for (String taskPatrolledId : taskPatrolledIds) { + resultAnalysis.setTaskPatrolledId(taskPatrolledId); + ResultAnalysis ras = patrolResultService.selectTaskAbnormalData(resultAnalysis); + csQxNum += ras.getCsQxNum(); + aiQxNum += ras.getAiQxNum(); + } + + if("0".equals(exportReportFlag) && 0 == aiQxNum) { + logger.error("[归档]没有缺陷数据, 无需归档!"); + return AjaxResult.error("没有缺陷数据, 无需归档!"); + } +// List patrolResultAuxList = iPatrolResultAuxService.selectPatrolResultAuxListByMainId(new PatrolResultAux(mainId)); +// List patrolResultAuxList = iPatrolResultAuxService.selectPatrolResultAuxListByMainIds(lineIds); +// for (PatrolResultAux aux : patrolResultAuxList) { +// resultList.forEach((item) -> { +// if (aux.getResultId().equals(String.valueOf(item.getLineId()))) { +// item.setValue(aux.getValue()); +// if (!"1".equals(item.getDataType())) { +// modifyNum.addAndGet(1); +// } +// } +// }); +// } + +// startTime = PrintUtil.useTime("INQUIRY MEND DATA", startTime); +// collectNum = resultList.size(); +// analyseNum = resultAnalysisService.selectResultAnalysisByMainId(lineId); +// analyseNum = resultAnalysisService.selectResultAnalysisByMainIds(lineIds); +// startTime = PrintUtil.useTime("INQUIRY ANALYZE DATA", startTime); +// logger.info("[ARCHIVE] Id: {}, collectNum: {}, analyseNum: {}, modifyNum:{}", mainId, collectNum, analyseNum, modifyNum.get()); + + // 使用CompletableFuture异步执行saveReport + int finalAiQxNum = aiQxNum; + int finalCsQxNum = csQxNum; + List finalLineIds = lineIds; + CompletableFuture> saveReportFuture = CompletableFuture.supplyAsync(() -> { + logger.info("[ARCHIVE] Start saving reports"); + return patrolResultService.saveReportLingzhou(resultMain, finalLineIds, lineId, resultList, finalAiQxNum, finalCsQxNum); + }, executor).exceptionally(ex -> { + logger.error("Report saving failed", ex); + return Collections.emptyList(); + }); + + // 当saveReport完成后,再异步处理所有导出任务 + saveReportFuture.thenAcceptAsync(reportIds -> { + logger.info("-----------[ARCHIVE] Saved export reportIds: {}", reportIds); + if (reportIds.isEmpty()) { + logger.warn("No reports to export"); + return; + } + // 为每个reportId创建异步导出任务 + CompletableFuture[] exportFutures = reportIds.stream() + .map(reportId -> CompletableFuture.runAsync(() -> { + logger.info("[EXPORT] Start export for reportId: {}", reportId); + exportExcelWordAndZipLingzhou(String.valueOf(reportId)); + }, executor)) + .toArray(CompletableFuture[]::new); + + }, executor).exceptionally(ex -> { + logger.error("Error occurred during saveReport: ", ex); + return null; + }); +// logger.info("-----------[ARCHIVE] EndTime: {}, reportIds: {}", DateUtil.now(), reportIds); + return toAjax(1); + + } + + @GetMapping({"/updateInfo_v2"}) public AjaxResult updateInfoV2(PatrolTaskResultMain resultMain) { String mainId = String.valueOf(resultMain.getLineId()); @@ -375,6 +474,34 @@ public class PatrolTaskResultMainController extends BaseController { return doc; } + private XWPFDocument getXWPFDocumentLingzhou(InspectionReport report, Map images) { + XWPFDocument doc = new XWPFDocument(); + + // 标题 + addTitle(doc, MessageUtils.get("巡视报告")); + + // 基本信息表格 + XWPFTable baseInfoTable = doc.createTable(7, 4); + baseInfoTable.setWidth("100%"); + + // 设置表格样式 + setTableStyle(baseInfoTable); + + // 填充基础信息 + fillBaseInfoLingzhou(baseInfoTable, report); + + + // 点位汇总 + List statusList = Arrays.asList(MessageUtils.get("异常"), MessageUtils.get("缺陷"), MessageUtils.get("正常")); +// List statusList = Collections.singletonList(MessageUtils.get("缺陷")); + for (String status : statusList) { + addStatusSectionLingzhou(doc, report, status, images); + } +// addQXStatusSection(doc, report, MessageUtils.get("缺陷"), images); +// addNormalStatusSection(doc, report, MessageUtils.get("正常"), images); + return doc; + } + private void addTitle(XWPFDocument doc, String title) { XWPFParagraph titlePara = doc.createParagraph(); titlePara.setAlignment(ParagraphAlignment.CENTER); @@ -413,6 +540,23 @@ public class PatrolTaskResultMainController extends BaseController { fillRowWithMerge(table, 6, MessageUtils.get("巡视结论"), report.getDescription(), 3); } + private void fillBaseInfoLingzhou(XWPFTable table, InspectionReport report) { + + 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, MessageUtils.get("巡视结论"), report.getDescription(), 3); + } + private void fillRow(XWPFTable table, int rowNum, String... values) { XWPFTableRow row = table.getRow(rowNum); for (int i = 0; i < values.length; i++) { @@ -561,6 +705,108 @@ public class PatrolTaskResultMainController extends BaseController { addEmptyParagraph(doc); } + private void addStatusSectionLingzhou(XWPFDocument doc, InspectionReport report, + String status, Map images) { +// addSectionHeader(doc, status + MessageUtils.get("点位汇总")); + addSectionHeader(doc, status + MessageUtils.get("汇总")); + + XWPFTable table = doc.createTable(1, 10); + table.setWidth("100%"); + + + // 创建表头 + String[] headers = {MessageUtils.get("编号"), 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); + CTP ctP = cell.getCTTc().sizeOfPArray() == 0 ? cell.getCTTc().addNewP() : cell.getCTTc().getPArray(0); + XWPFParagraph par = cell.getParagraph(ctP); + par.createRun().setText(headers[i]); + } + setTableHeaderStyle(table); + // 填充数据 + List dataList = report.getReportDatalist(); + if (dataList != null && dataList.size() > 0) { + // 填充数据 + dataList = dataList.stream() + .filter(d -> status.equals(d.getPointStatus())) + .collect(Collectors.toList()); + + for (InspectionReportData data : dataList) { + XWPFTableRow row = table.createRow(); + fillDataRowLingzhou(row, data, images); + } + } + addEmptyParagraph(doc); + } + + private void addQXStatusSection(XWPFDocument doc, InspectionReport report, + String status, Map images) { + addSectionHeader(doc, status + MessageUtils.get("点位汇总")); +// addSectionHeader(doc, status + MessageUtils.get("汇总")); + + XWPFTable table = doc.createTable(1, 10); + table.setWidth("100%"); + + + // 创建表头 + String[] headers = {MessageUtils.get("编号"), 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); + CTP ctP = cell.getCTTc().sizeOfPArray() == 0 ? cell.getCTTc().addNewP() : cell.getCTTc().getPArray(0); + XWPFParagraph par = cell.getParagraph(ctP); + par.createRun().setText(headers[i]); + } + setTableHeaderStyle(table); + // 填充数据 + List dataList = report.getReportDatalist(); + if(dataList != null && dataList.size() > 0) { + dataList = dataList.stream().filter(data -> status.equals(data.getPointStatus())).collect(Collectors.toList()); + // 填充数据行(除去表头第一行 + for (InspectionReportData data : dataList) { + XWPFTableRow row = table.createRow(); + fillQXDataRow(row, data, images); + } + } + addEmptyParagraph(doc); + } + + private void addNormalStatusSection(XWPFDocument doc, InspectionReport report, + String status, Map images) { + addSectionHeader(doc, status + MessageUtils.get("点位汇总")); +// addSectionHeader(doc, status + MessageUtils.get("汇总")); + + XWPFTable table = doc.createTable(1, 11); + table.setWidth("100%"); + + + // 创建表头 + String[] headers = {MessageUtils.get("编号"), MessageUtils.get("区域"), 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); + CTP ctP = cell.getCTTc().sizeOfPArray() == 0 ? cell.getCTTc().addNewP() : cell.getCTTc().getPArray(0); + XWPFParagraph par = cell.getParagraph(ctP); + par.createRun().setText(headers[i]); + } + setTableHeaderStyle(table); + // 填充数据 + List dataList = report.getReportDatalist(); + if(dataList != null && dataList.size() > 0) { + dataList = dataList.stream().filter(data -> status.equals(data.getPointStatus())).collect(Collectors.toList()); + // 填充数据行(除去表头第一行 + for (InspectionReportData data : dataList) { + XWPFTableRow row = table.createRow(); + fillNormalDataRow(row, data, images); + } + } + addEmptyParagraph(doc); + } + private void addSectionHeader(XWPFDocument doc, String text) { XWPFParagraph para = doc.createParagraph(); para.setSpacingBefore(200); // 段前间距 @@ -653,40 +899,137 @@ public class PatrolTaskResultMainController extends BaseController { } } - private void insertImageToCell(XWPFTableCell cell, byte[] imageData) { - if (imageData == null) return; + private void fillDataRowLingzhou(XWPFTableRow row, InspectionReportData data, + Map images) { + String[] values = { + String.valueOf(data.getCode()), + data.getArea(), + data.getEqName(), + data.getParts(), + data.getPointName(), + data.getDataSources(), + formatDateTime(data.getAcquisitionTime()), + data.getInspectionResults(), + data.getAlgName(), + "" // 图片占位 + }; - try (ByteArrayInputStream bis = new ByteArrayInputStream(imageData)) { + for (int i = 0; i < values.length; i++) { + XWPFTableCell cell = row.getTableCells().get(i); CTP ctP = cell.getCTTc().sizeOfPArray() == 0 ? cell.getCTTc().addNewP() : cell.getCTTc().getPArray(0); XWPFParagraph par = cell.getParagraph(ctP); - XWPFRun run = par.createRun(); - run.addPicture(bis, XWPFDocument.PICTURE_TYPE_JPEG, - "image.jpg", Units.toEMU(100), Units.toEMU(100)); - } catch (Exception e) { - e.printStackTrace(); + par.createRun().setText(values[i]); + setCellStyle(cell); } - } - - private void setCellStyle(XWPFTableCell cell) { - cell.setVerticalAlignment(XWPFTableCell.XWPFVertAlign.CENTER); + // 插入图片 + if (data.getReportImgList() != null) { + data.getReportImgList().stream() + .filter(img -> "0".equals(img.getImgType())) + .forEach(img -> insertImageToCell(row.getCell(9), + images.get(img.getImgSrc()))); + } + } - XWPFParagraph para = cell.getParagraphs().get(0); - para.setAlignment(ParagraphAlignment.CENTER); - para.setSpacingAfter(0); - para.setSpacingBefore(0); - XWPFRun run = para.getRuns().isEmpty() ? para.createRun() : para.getRuns().get(0); - run.setFontSize(9); - run.setFontFamily("宋体"); + private void fillQXDataRow(XWPFTableRow row, InspectionReportData data, + Map images) { + String[] values = { + String.valueOf(data.getCode()), + data.getArea(), + data.getEqName(), + data.getParts(), + data.getPointName(), + data.getDataSources(), + "", // 告警等级 + formatDateTime(data.getAcquisitionTime()), + data.getInspectionResults(), + data.getAlgName(), + "" // 图片占位 + }; - } + for (int i = 0; i < values.length; i++) { + XWPFTableCell cell = row.getTableCells().get(i); + CTP ctP = cell.getCTTc().sizeOfPArray() == 0 ? cell.getCTTc().addNewP() : cell.getCTTc().getPArray(0); + XWPFParagraph par = cell.getParagraph(ctP); + par.createRun().setText(values[i]); + setCellStyle(cell); + } - private void addEmptyParagraph(XWPFDocument doc) { - doc.createParagraph().createRun().addBreak(); + // 插入图片 + if (data.getReportImgList() != null) { + data.getReportImgList().stream() + .filter(img -> "0".equals(img.getImgType())) + .forEach(img -> insertImageToCell(row.getCell(10), + images.get(img.getImgSrc()))); + } } - private String formatDate(Date date) { - return date != null ? DateUtils.format(DateUtils.yyyyMMdd2, date) : ""; + private void fillNormalDataRow(XWPFTableRow row, InspectionReportData data, + Map images) { + String[] values = { + String.valueOf(data.getCode()), + data.getArea(), + data.getEqName(), + data.getParts(), + data.getPointName(), + data.getDataSources(), + formatDateTime(data.getAcquisitionTime()), + data.getInspectionResults(), + data.getAlgName(), + "" // 图片占位 + }; + + for (int i = 0; i < values.length; i++) { + XWPFTableCell cell = row.getTableCells().get(i); + CTP ctP = cell.getCTTc().sizeOfPArray() == 0 ? cell.getCTTc().addNewP() : cell.getCTTc().getPArray(0); + XWPFParagraph par = cell.getParagraph(ctP); + par.createRun().setText(values[i]); + setCellStyle(cell); + } + + // 插入图片 + if (data.getReportImgList() != null) { + data.getReportImgList().stream() + .filter(img -> "0".equals(img.getImgType())) + .forEach(img -> insertImageToCell(row.getCell(9), + images.get(img.getImgSrc()))); + } + } + + private void insertImageToCell(XWPFTableCell cell, byte[] imageData) { + if (imageData == null) return; + + try (ByteArrayInputStream bis = new ByteArrayInputStream(imageData)) { + CTP ctP = cell.getCTTc().sizeOfPArray() == 0 ? cell.getCTTc().addNewP() : cell.getCTTc().getPArray(0); + XWPFParagraph par = cell.getParagraph(ctP); + XWPFRun run = par.createRun(); + run.addPicture(bis, XWPFDocument.PICTURE_TYPE_JPEG, + "image.jpg", Units.toEMU(100), Units.toEMU(100)); + } catch (Exception e) { + e.printStackTrace(); + } + } + + + private void setCellStyle(XWPFTableCell cell) { + cell.setVerticalAlignment(XWPFTableCell.XWPFVertAlign.CENTER); + + XWPFParagraph para = cell.getParagraphs().get(0); + para.setAlignment(ParagraphAlignment.CENTER); + para.setSpacingAfter(0); + para.setSpacingBefore(0); + XWPFRun run = para.getRuns().isEmpty() ? para.createRun() : para.getRuns().get(0); + run.setFontSize(9); + run.setFontFamily("宋体"); + + } + + private void addEmptyParagraph(XWPFDocument doc) { + doc.createParagraph().createRun().addBreak(); + } + + private String formatDate(Date date) { + return date != null ? DateUtils.format(DateUtils.yyyyMMdd2, date) : ""; } private String formatDateTime(Date date) { @@ -888,6 +1231,134 @@ public class PatrolTaskResultMainController extends BaseController { } } + + public void exportExcelWordAndZipLingzhou(String lineId) { + List images = new ArrayList<>(); + Map imgSrcToFileNameMap = new HashMap<>(); + InspectionReport inspectionReport = + inspectionReportService.selectInspectionReportByLineId(Long.valueOf(lineId)); + InspectionReportData inspectionReportData = new InspectionReportData(); + inspectionReportData.setReportId(String.valueOf(inspectionReport.getLineId())); + List inspectionReportDataList = + inspectionReportDataService.selectInspectionReportDataList(inspectionReportData); + if (!inspectionReportDataList.isEmpty()) { + inspectionReport.setReportDatalist(inspectionReportDataList); + } else { + logger.info("--exportExcelWordAndZip------report lineId:{},filter:{} no report data!", lineId, inspectionReport.getFilter()); + return; + } + + for (InspectionReportData reportData : inspectionReportDataList) { + InspectionReportImg inspectionReportImg = new InspectionReportImg(); + inspectionReportImg.setReportInfoId(reportData.getLineId()); + List reportImgList = + inspectionReportImgService.selectInspectionReportImgList(inspectionReportImg); + reportData.setReportImgList(reportImgList); + + int imgIndex = 1; // 每个报告数据项下的图片索引 + for (InspectionReportImg reportImg : reportImgList) { + if (StringUtils.isNotEmpty(reportImg.getImgSrc()) && reportImg.getImgType().equals("0")) { + String originalImgSrc = reportImg.getImgSrc(); + images.add(originalImgSrc); + String pointName = reportData.getPointName(); + pointName = (pointName != null) ? pointName : "unnamed"; + // 提取文件扩展名 + String extension = ""; + int dotIndex = originalImgSrc.lastIndexOf('.'); + if (dotIndex > 0) { + extension = originalImgSrc.substring(dotIndex); + } + + // 生成唯一文件名(包含 lineId 防止重复) + String uniqueFileName = String.format("%s_%s_%s_%d%s", + originalImgSrc.split("_")[2], + pointName, + reportData.getLineId(), + imgIndex, + extension); + + imgSrcToFileNameMap.put(originalImgSrc, uniqueFileName); + imgIndex++; + } + } + } + + Map streamHashMap = new HashMap<>(); +// for (String algorithmBaseImagePath : images) { +// try { +// sftpClient.downLoad(algorithmBaseImagePath, (inputStream) -> { +// byte[] bytes = streamHashMap.get(algorithmBaseImagePath); +// byte[] byInputStream = getStringByInputStream(inputStream); +// if (bytes == null) { +// streamHashMap.put(algorithmBaseImagePath, byInputStream); +// } +// +// }); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } + images.parallelStream().forEach(imagePath -> { + byte[] shm = streamHashMap.get(imagePath); + byte[] bytes = downloadAndCompressImage(imagePath); + if (shm == null) { + streamHashMap.put(imagePath, bytes); + } + }); + + + + SXSSFWorkbook sxssfWorkbook = getSXSSFWorkbookLingzhou(inspectionReport, streamHashMap); + XWPFDocument wordDocument = getXWPFDocumentLingzhou(inspectionReport, streamHashMap); + logger.info("[ARCHIVE] hssfWorkbook: {}", sxssfWorkbook); + try { + String basePath = this.basePath + stationCode + "/Model/"; + Date startTime = inspectionReport.getInspectionStartTime() != null ? + inspectionReport.getInspectionStartTime() : new Date(); + String timestamp = DateUtils.format(DateUtils.yyyyMMddHHmmss2, startTime) + "_" + System.currentTimeMillis(); + String namePrefix = ""; + if ("1".equals(inspectionReport.getFilter())) { + namePrefix = MessageUtils.get("初筛") + "_"; + } else if ("0".equals(inspectionReport.getFilter())) { + namePrefix = MessageUtils.get("大模型") + "_"; + } + String reportName = namePrefix + inspectionReport.getInspectionTaskName() + "_" + timestamp; + // 上传媒体包 + CompletableFuture zipUploadFuture = CompletableFuture.runAsync(() -> { + uploadFile(basePath, reportName, ".zip", outputStream -> { + try (ZipOutputStream zipOut = new ZipOutputStream(outputStream)) { + for (Map.Entry entry : streamHashMap.entrySet()) { + String imagePath = entry.getKey(); + String pointFileName = imgSrcToFileNameMap.getOrDefault(imagePath, "unnamed"); + byte[] imageData = entry.getValue(); +// String fileName = new File(imagePath).getName(); + ZipEntry zipEntry = new ZipEntry(pointFileName); + zipOut.putNextEntry(zipEntry); + zipOut.write(imageData); + zipOut.closeEntry(); + } + } catch (IOException e) { + throw new RuntimeException("生成ZIP文件失败", e); + } + }); + }, executor); + // 上传Excel + CompletableFuture excelUploadFuture = CompletableFuture.runAsync(() -> { + uploadFile(basePath, reportName, ".xls", sxssfWorkbook::write); + }, executor); + // 上传Word + CompletableFuture wordUploadFuture = CompletableFuture.runAsync(() -> { + uploadFile(basePath, reportName, ".docx", wordDocument::write); + }, executor); + CompletableFuture.allOf(zipUploadFuture, excelUploadFuture, wordUploadFuture).whenComplete((v, t) -> { + inspectionReport.setFilePath(basePath + reportName + ".xls"); + inspectionReportService.updateInspectionReport(inspectionReport); + }); + } catch (Exception e) { + e.printStackTrace(); + } + } + private byte[] downloadAndCompressImage(String imagePath) { try { // 直接下载并压缩图片 @@ -1241,75 +1712,548 @@ public class PatrolTaskResultMainController extends BaseController { cella1.setCellStyle(colStyle); cella1 = rowa1.createCell(14); cella1.setCellStyle(colStyle); - InspectionReportData reportData1 = new InspectionReportData(); - reportData1.setReportId(inspectionReport.getLineId() + ""); - reportData1.setPointStatus(arr.getPointStatus()); - List objectArrayList = new ArrayList<>(); - if (inspectionReport.getReportDatalist() != null && !inspectionReport.getReportDatalist().isEmpty()) { - objectArrayList = inspectionReport.getReportDatalist(); - logger.info("[HSSF] STATISTICS RECORD Number: {}, Origin Number: {}", objectArrayList.size(), inspectionReport.getReportDatalist().size()); + InspectionReportData reportData1 = new InspectionReportData(); + reportData1.setReportId(inspectionReport.getLineId() + ""); + reportData1.setPointStatus(arr.getPointStatus()); + List objectArrayList = new ArrayList<>(); + if (inspectionReport.getReportDatalist() != null && !inspectionReport.getReportDatalist().isEmpty()) { + objectArrayList = inspectionReport.getReportDatalist(); + logger.info("[HSSF] STATISTICS RECORD Number: {}, Origin Number: {}", objectArrayList.size(), inspectionReport.getReportDatalist().size()); + } + + Iterator iterator1 = objectArrayList.iterator(); + while (true) { + while (true) { + if (!iterator1.hasNext()) { + continue label190; + } + + InspectionReportData brr = (InspectionReportData) iterator1.next(); + ++total; + InspectionReportImg inspectionReportImg = new InspectionReportImg(); + inspectionReportImg.setReportInfoId(brr.getLineId()); + List imgList = new ArrayList<>(); + if (brr.getReportImgList() != null && !brr.getReportImgList().isEmpty()) { + imgList = brr.getReportImgList(); + } + + CellRangeAddress cellRangeAddress1 = new CellRangeAddress(10 + total, 10 + total, 12, 14); + hssfSheet.addMergedRegion(cellRangeAddress1); + HSSFRow rowb1 = hssfSheet.createRow(10 + total); + if (!imgList.isEmpty()) { + rowb1.setHeight((short) 1000); + } + + cella1 = rowb1.createCell(0); + cella1.setCellValue((double) brr.getCode()); + cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(1); + cella1.setCellValue(brr.getArea()); + cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(2); + cella1.setCellValue(brr.getEqName()); + cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(3); + cella1.setCellValue(brr.getEqName()); + cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(4); + cella1.setCellValue(brr.getParts()); + cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(5); + cella1.setCellValue(brr.getPointName()); + cella1.setCellStyle(colStyle); + cella1 = rowb1.createCell(6); + cella1.setCellStyle(colStyle); + cella1 = rowb1.createCell(7); + cella1.setCellValue(brr.getDataSources()); + cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(8); + if (brr.getAcquisitionTime() != null) { + cella1.setCellValue(DateUtils.format(DateUtils.yyyyMMddHHmmss2, brr.getAcquisitionTime())); + } + + cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(9); + cella1.setCellValue(brr.getInspectionResults()); + cella1.setCellStyle(colStyle); + cella1 = rowb1.createCell(10); + cella1.setCellStyle(colStyle); + cella1 = rowb1.createCell(11); + cella1.setCellValue(brr.getAlgName()); + cella1.setCellStyle(colStyle2); + String str = ""; + cella1 = rowb1.createCell(12); + cella1.setCellValue(str); + cella1.setCellStyle(colStyle); + cella1 = rowb1.createCell(13); + cella1.setCellStyle(colStyle); + cella1 = rowb1.createCell(14); + cella1.setCellStyle(colStyle); + if (!imgList.isEmpty()) { + hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + imgList.size(), 0, 0)); + hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + imgList.size(), 1, 1)); + hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + imgList.size(), 2, 4)); + hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + imgList.size(), 5, 6)); + hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + imgList.size(), 7, 7)); + hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + imgList.size(), 8, 8)); + hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + imgList.size(), 9, 10)); + hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + imgList.size(), 11, 11)); + + for (InspectionReportImg o : imgList) { + ++total; + CellRangeAddress cellRangeAddress2 = new CellRangeAddress(10 + total, 10 + total, 12, 14); + hssfSheet.addMergedRegion(cellRangeAddress2); + rowb1 = hssfSheet.createRow(10 + total); + rowb1.setHeight((short) 1000); + cella1 = rowb1.createCell(0); + cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(1); + cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(2); + cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(3); + cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(4); + cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(5); + cella1.setCellStyle(colStyle); + cella1 = rowb1.createCell(6); + cella1.setCellStyle(colStyle); + cella1 = rowb1.createCell(7); + cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(8); + cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(9); + cella1.setCellStyle(colStyle); + cella1 = rowb1.createCell(10); + cella1.setCellStyle(colStyle); + cella1 = rowb1.createCell(11); + cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(12); + if (o.getImgType().equals("0")) { + try { + insertImage(hssfWorkbook, patriarch, images(o.getImg(), inputStreamMap), 10 + total, 0, 2); + } catch (Exception e) { + e.printStackTrace(); + } + } else { + String sheetName = o.getImgSrc(); + cella1.setCellFormula("HYPERLINK(\"" + sheetName + "\")"); + cella1.setCellStyle(colRight); + } + + cella1 = rowb1.createCell(13); + cella1.setCellStyle(colStyle); + cella1 = rowb1.createCell(14); + cella1.setCellStyle(colStyle); + } + } else { + hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 2, 4)); + hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 5, 6)); + hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 9, 10)); + } + } + } + } + + return hssfWorkbook; + } + + public SXSSFWorkbook getSXSSFWorkbook(InspectionReport inspectionReport, Map inputStreamMap) { + // 使用SXSSFWorkbook并设置行访问窗口大小(1000行) + SXSSFWorkbook wb = new SXSSFWorkbook(1000); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + SXSSFSheet sheet = wb.createSheet(System.currentTimeMillis() + ""); + CellStyle colStyle = createCellStyle((SXSSFWorkbook) wb, (short) 15, true, true); + CellStyle colStyle2 = createCellStylenoborder((SXSSFWorkbook) wb, (short) 15, true, true); + CellStyle colright = getColRight((SXSSFWorkbook) wb, (short) 10, true, false); + CellRangeAddress callRangeAddress01 = new CellRangeAddress(0, 0, 0, 14); + CellRangeAddress callRangeAddress02 = new CellRangeAddress(1, 1, 0, 3); + CellRangeAddress callRangeAddress03 = new CellRangeAddress(1, 1, 4, 7); + CellRangeAddress callRangeAddress04 = new CellRangeAddress(1, 1, 8, 11); + CellRangeAddress callRangeAddress05 = new CellRangeAddress(1, 1, 12, 14); + CellRangeAddress callRangeAddress21 = new CellRangeAddress(2, 2, 0, 3); + CellRangeAddress callRangeAddress22 = new CellRangeAddress(2, 2, 4, 7); + CellRangeAddress callRangeAddress23 = new CellRangeAddress(2, 2, 8, 11); + CellRangeAddress callRangeAddress24 = new CellRangeAddress(2, 2, 12, 14); + CellRangeAddress callRangeAddress31 = new CellRangeAddress(3, 3, 0, 3); + CellRangeAddress callRangeAddress32 = new CellRangeAddress(3, 3, 4, 7); + CellRangeAddress callRangeAddress33 = new CellRangeAddress(3, 3, 8, 11); + CellRangeAddress callRangeAddress34 = new CellRangeAddress(3, 3, 12, 14); + CellRangeAddress callRangeAddress41 = new CellRangeAddress(4, 4, 0, 3); + CellRangeAddress callRangeAddress42 = new CellRangeAddress(4, 4, 4, 7); + CellRangeAddress callRangeAddress43 = new CellRangeAddress(4, 4, 8, 11); + CellRangeAddress callRangeAddress44 = new CellRangeAddress(4, 4, 12, 14); + CellRangeAddress callRangeAddress51 = new CellRangeAddress(5, 5, 0, 3); + CellRangeAddress callRangeAddress52 = new CellRangeAddress(5, 5, 4, 7); + CellRangeAddress callRangeAddress53 = new CellRangeAddress(5, 5, 8, 11); + CellRangeAddress callRangeAddress54 = new CellRangeAddress(5, 5, 12, 14); + CellRangeAddress callRangeAddress61 = new CellRangeAddress(6, 7, 0, 3); + CellRangeAddress callRangeAddress62 = new CellRangeAddress(6, 7, 4, 14); + CellRangeAddress callRangeAddress71 = new CellRangeAddress(8, 8, 0, 3); + CellRangeAddress callRangeAddress72 = new CellRangeAddress(8, 8, 4, 14); + sheet.addMergedRegion(callRangeAddress01); + sheet.addMergedRegion(callRangeAddress02); + sheet.addMergedRegion(callRangeAddress03); + sheet.addMergedRegion(callRangeAddress04); + sheet.addMergedRegion(callRangeAddress05); + sheet.addMergedRegion(callRangeAddress21); + sheet.addMergedRegion(callRangeAddress22); + sheet.addMergedRegion(callRangeAddress23); + sheet.addMergedRegion(callRangeAddress24); + sheet.addMergedRegion(callRangeAddress31); + sheet.addMergedRegion(callRangeAddress32); + sheet.addMergedRegion(callRangeAddress33); + sheet.addMergedRegion(callRangeAddress34); + sheet.addMergedRegion(callRangeAddress41); + sheet.addMergedRegion(callRangeAddress42); + sheet.addMergedRegion(callRangeAddress43); + sheet.addMergedRegion(callRangeAddress44); + sheet.addMergedRegion(callRangeAddress51); + sheet.addMergedRegion(callRangeAddress52); + sheet.addMergedRegion(callRangeAddress53); + sheet.addMergedRegion(callRangeAddress54); + sheet.addMergedRegion(callRangeAddress61); + sheet.addMergedRegion(callRangeAddress62); + sheet.addMergedRegion(callRangeAddress71); + sheet.addMergedRegion(callRangeAddress72); + Row row0 = sheet.createRow(0); + row0.setHeight((short) 600); + Cell cell0 = row0.createCell(0); + cell0.setCellValue(MessageUtils.get("巡视报告")); + CellStyle stylea = wb.createCellStyle(); + stylea.setAlignment(HorizontalAlignment.CENTER); + stylea.setVerticalAlignment(VerticalAlignment.CENTER); + Font font = wb.createFont(); + font.setFontHeightInPoints((short) 20); + font.setFontHeight((short) 500); + font.setBold(true); + stylea.setFont(font); + cell0.setCellStyle(stylea); + Row row1 = sheet.createRow(1); + Cell cell11 = row1.createCell(0); + 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(MessageUtils.get("电压等级")); + cell13.setCellStyle(colStyle2); + Cell cell14 = row1.createCell(12); + cell14.setCellValue(inspectionReport.getVoltLevel()); + cell14.setCellStyle(colStyle2); + + for (int i = 0; i < 15; ++i) { + if (i != 0 && i != 4 && i != 8 && i != 12) { + cell14 = row1.createCell(i); + cell14.setCellStyle(colStyle2); + } + } + + Row row2 = sheet.createRow(2); + Cell cell21 = row2.createCell(0); + cell21.setCellValue(MessageUtils.get("巡视计划创建日期")); + cell21.setCellStyle(colStyle2); + Cell cell22 = row2.createCell(4); + if (inspectionReport.getInspectionDate() != null) { + cell22.setCellValue(sdf.format(inspectionReport.getInspectionDate())); + } + + cell22.setCellStyle(colStyle2); + Cell cell23 = row2.createCell(8); + cell23.setCellValue(MessageUtils.get("变电站类别")); + cell23.setCellStyle(colStyle2); + Cell cell24 = row2.createCell(12); + cell24.setCellValue(inspectionReport.getStationType()); + cell24.setCellStyle(colStyle2); + + for (int i = 0; i < 15; ++i) { + if (i != 0 && i != 4 && i != 8 && i != 12) { + cell14 = row2.createCell(i); + cell14.setCellStyle(colStyle2); + } + } + + Row row3 = sheet.createRow(3); + Cell cell31 = row3.createCell(0); + 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(MessageUtils.get("环境信息")); + cell33.setCellStyle(colStyle2); + Cell cell34 = row3.createCell(12); + cell34.setCellValue(inspectionReport.getEnvInfo()); + cell34.setCellStyle(colStyle2); + + for (int i = 0; i < 15; ++i) { + if (i != 0 && i != 4 && i != 8 && i != 12) { + cell14 = row3.createCell(i); + cell14.setCellStyle(colStyle2); + } + } + + Row row4 = sheet.createRow(4); + Cell cell41 = row4.createCell(0); + 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(MessageUtils.get("审核时间")); + cell43.setCellStyle(colStyle2); + Cell cell44 = row4.createCell(12); + cell44.setCellValue(DateUtil.formatDateTime(inspectionReport.getCheckTime())); + cell44.setCellStyle(colStyle2); + + for (int i = 0; i < 15; ++i) { + if (i != 0 && i != 4 && i != 8 && i != 12) { + cell14 = row4.createCell(i); + cell14.setCellStyle(colStyle2); + } + } + + Row row5 = sheet.createRow(5); + Cell cell51 = row5.createCell(0); + cell51.setCellValue(MessageUtils.get("巡视开始时间")); + cell51.setCellStyle(colStyle2); + Cell cell52 = row5.createCell(4); + if (inspectionReport.getInspectionStartTime() != null) { + cell52.setCellValue(DateUtil.formatDateTime(inspectionReport.getInspectionStartTime())); + } + + cell52.setCellStyle(colStyle2); + Cell cell53 = row5.createCell(8); + cell53.setCellValue(MessageUtils.get("巡视结束时间")); + cell53.setCellStyle(colStyle2); + Cell cell54 = row5.createCell(12); + if (inspectionReport.getInspectionEndTime() != null) { + cell54.setCellValue(DateUtil.formatDateTime(inspectionReport.getInspectionEndTime())); + } + + cell54.setCellStyle(colStyle2); + + for (int i = 0; i < 15; ++i) { + if (i != 0 && i != 4 && i != 8 && i != 12) { + cell14 = row5.createCell(i); + cell14.setCellStyle(colStyle2); + } + } + + Row row6 = sheet.createRow(6); + row6.setHeight((short) 1000); + Cell cell61 = row6.createCell(0); + cell61.setCellValue(MessageUtils.get("巡视统计")); + cell61.setCellStyle(colStyle2); + Cell cell62 = row6.createCell(4); + cell62.setCellValue(inspectionReport.getPatrolStatistics()); + cell62.setCellStyle(colStyle2); + + int i; + for (i = 0; i < 15; ++i) { + if (i != 0 && i != 4) { + cell14 = row6.createCell(i); + cell14.setCellStyle(colStyle2); + } + } + + row6 = sheet.createRow(7); + + for (i = 0; i < 15; ++i) { + cell14 = row6.createCell(i); + cell14.setCellStyle(colStyle2); + } + + Row row7 = sheet.createRow(8); + row7.setHeight((short) 1000); + Cell cell71 = row7.createCell(0); + cell71.setCellValue(MessageUtils.get("巡视结论")); + cell71.setCellStyle(colStyle2); + Cell cell72 = row7.createCell(4); + cell72.setCellValue(inspectionReport.getDescription()); + cell72.setCellStyle(colStyle2); + + //qinyl + for (int j = 0; j < 15; ++j) { + if (j != 0 && j != 4) { + cell14 = row7.createCell(j); + cell14.setCellStyle(colStyle2); + } + } + + InspectionReportData inspectionReportData = new InspectionReportData(); + List list = new ArrayList(); +// inspectionReportData.setPointStatus(MessageUtils.get("异常")); +// list.add(inspectionReportData); +// InspectionReportData inspection = new InspectionReportData(); +// inspection.setPointStatus(MessageUtils.get("待人工确认")); +// list.add(inspection); + InspectionReportData inection = new InspectionReportData(); + inection.setPointStatus(MessageUtils.get("正常")); + list.add(inection); + inspectionReportData.setPointStatus(MessageUtils.get("缺陷")); + list.add(inspectionReportData); + int total = 0; + + label186: + for (Iterator var74 = list.iterator(); var74.hasNext(); total += 2) { + InspectionReportData arr = (InspectionReportData) var74.next(); + SXSSFDrawing patriarch = sheet.createDrawingPatriarch(); + CellRangeAddress callRangeAddressa1 = new CellRangeAddress(9 + total, 9 + total, 0, 14); + sheet.addMergedRegion(callRangeAddressa1); + Row rowa1 = sheet.createRow(9 + total); + Cell cella1 = rowa1.createCell(0); + cella1.setCellValue(arr.getPointStatus() + MessageUtils.get("点位汇总")); + CellStyle styleab = wb.createCellStyle(); + styleab.setAlignment(HorizontalAlignment.CENTER); + styleab.setVerticalAlignment(VerticalAlignment.CENTER); + Font fonta = wb.createFont(); + fonta.setFontHeightInPoints((short) 20); + styleab.setFont(fonta); + cella1.setCellStyle(styleab); + + //qinyl + for (int j = 0; j < 15; ++j) { + if (j != 0) { + cell14 = rowa1.createCell(j); + cell14.setCellStyle(colStyle2); + } + } + + CellRangeAddress callRangeAddressa12 = new CellRangeAddress(10 + total, 10 + total, 12, 14); + sheet.addMergedRegion(callRangeAddressa12); + rowa1 = sheet.createRow(10 + total); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 2, 4)); + 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(MessageUtils.get("编号")); + cella1.setCellStyle(colStyle2); + cella1 = rowa1.createCell(1); + cella1.setCellValue(MessageUtils.get("区域")); + cella1.setCellStyle(colStyle2); + + cella1 = rowa1.createCell(2); + 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(MessageUtils.get("点位")); + cella1.setCellStyle(colStyle); + cella1 = rowa1.createCell(6); + cella1.setCellStyle(colStyle); + + cella1 = rowa1.createCell(7); + cella1.setCellValue(MessageUtils.get("数据来源")); + cella1.setCellStyle(colStyle2); + + cella1 = rowa1.createCell(8); + cella1.setCellValue(MessageUtils.get("采集时间")); + cella1.setCellStyle(colStyle2); + + cella1 = rowa1.createCell(9); + cella1.setCellValue(MessageUtils.get("巡视结果")); + cella1.setCellStyle(colStyle); + cella1 = rowa1.createCell(10); + cella1.setCellStyle(colStyle); + + cella1 = rowa1.createCell(11); + cella1.setCellValue(MessageUtils.get("算法类型")); + cella1.setCellStyle(colStyle2); + + cella1 = rowa1.createCell(12); + cella1.setCellValue(MessageUtils.get("巡视图像")); + cella1.setCellStyle(colStyle); + cella1 = rowa1.createCell(13); + cella1.setCellStyle(colStyle); + cella1 = rowa1.createCell(14); + cella1.setCellStyle(colStyle); + + InspectionReportData insa = new InspectionReportData(); + insa.setReportId(inspectionReport.getLineId() + ""); + insa.setPointStatus(arr.getPointStatus()); + List listarr = new ArrayList(); + if (inspectionReport.getReportDatalist() != null && inspectionReport.getReportDatalist().size() > 0) { + listarr = (List) inspectionReport.getReportDatalist().stream().filter((a) -> { + return arr.getPointStatus().equals(a.getPointStatus()); + }).collect(Collectors.toList()); } - Iterator iterator1 = objectArrayList.iterator(); + Iterator var85 = ((List) listarr).iterator(); + while (true) { while (true) { - if (!iterator1.hasNext()) { - continue label190; + if (!var85.hasNext()) { + continue label186; } - InspectionReportData brr = (InspectionReportData) iterator1.next(); + InspectionReportData brr = (InspectionReportData) var85.next(); ++total; InspectionReportImg inspectionReportImg = new InspectionReportImg(); - inspectionReportImg.setReportInfoId(brr.getLineId()); - List imgList = new ArrayList<>(); - if (brr.getReportImgList() != null && !brr.getReportImgList().isEmpty()) { + inspectionReportImg.setReportInfoId(brr.getLineId() + ""); + List imgList = new ArrayList(); + if (brr.getReportImgList() != null && brr.getReportImgList().size() > 0) { imgList = brr.getReportImgList(); } - CellRangeAddress cellRangeAddress1 = new CellRangeAddress(10 + total, 10 + total, 12, 14); - hssfSheet.addMergedRegion(cellRangeAddress1); - HSSFRow rowb1 = hssfSheet.createRow(10 + total); - if (!imgList.isEmpty()) { + CellRangeAddress callRangeAddressa4 = new CellRangeAddress(10 + total, 10 + total, 12, 14); + sheet.addMergedRegion(callRangeAddressa4); + Row rowb1 = sheet.createRow(10 + total); + if (((List) imgList).size() > 0) { rowb1.setHeight((short) 1000); } cella1 = rowb1.createCell(0); - cella1.setCellValue((double) brr.getCode()); + cella1.setCellValue((double) brr.getCode().longValue()); cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(1); cella1.setCellValue(brr.getArea()); cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(2); cella1.setCellValue(brr.getEqName()); cella1.setCellStyle(colStyle2); cella1 = rowb1.createCell(3); - cella1.setCellValue(brr.getEqName()); cella1.setCellStyle(colStyle2); cella1 = rowb1.createCell(4); - cella1.setCellValue(brr.getParts()); +// cella1.setCellValue(brr.getParts()); cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(5); cella1.setCellValue(brr.getPointName()); cella1.setCellStyle(colStyle); cella1 = rowb1.createCell(6); cella1.setCellStyle(colStyle); + cella1 = rowb1.createCell(7); cella1.setCellValue(brr.getDataSources()); cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(8); if (brr.getAcquisitionTime() != null) { - cella1.setCellValue(DateUtils.format(DateUtils.yyyyMMddHHmmss2, brr.getAcquisitionTime())); + cella1.setCellValue(DateUtil.formatDateTime(brr.getAcquisitionTime())); } - cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(9); cella1.setCellValue(brr.getInspectionResults()); cella1.setCellStyle(colStyle); cella1 = rowb1.createCell(10); cella1.setCellStyle(colStyle); + cella1 = rowb1.createCell(11); cella1.setCellValue(brr.getAlgName()); cella1.setCellStyle(colStyle2); + String str = ""; cella1 = rowb1.createCell(12); cella1.setCellValue(str); @@ -1318,21 +2262,24 @@ public class PatrolTaskResultMainController extends BaseController { cella1.setCellStyle(colStyle); cella1 = rowb1.createCell(14); cella1.setCellStyle(colStyle); - if (!imgList.isEmpty()) { - hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + imgList.size(), 0, 0)); - hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + imgList.size(), 1, 1)); - hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + imgList.size(), 2, 4)); - hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + imgList.size(), 5, 6)); - hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + imgList.size(), 7, 7)); - hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + imgList.size(), 8, 8)); - hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + imgList.size(), 9, 10)); - hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + imgList.size(), 11, 11)); + if (((List) imgList).size() > 0) { + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + ((List) imgList).size(), 0, 0)); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + ((List) imgList).size(), 1, 1)); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + ((List) imgList).size(), 2, 4)); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + ((List) imgList).size(), 5, 6)); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + ((List) imgList).size(), 7, 7)); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + ((List) imgList).size(), 8, 8)); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + ((List) imgList).size(), 9, 10)); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + ((List) imgList).size(), 11, 11)); + new ArrayList(); + Iterator var93 = ((List) imgList).iterator(); - for (InspectionReportImg o : imgList) { + while (var93.hasNext()) { + InspectionReportImg crr = (InspectionReportImg) var93.next(); ++total; - CellRangeAddress cellRangeAddress2 = new CellRangeAddress(10 + total, 10 + total, 12, 14); - hssfSheet.addMergedRegion(cellRangeAddress2); - rowb1 = hssfSheet.createRow(10 + total); + CellRangeAddress callRangeAddressb4 = new CellRangeAddress(10 + total, 10 + total, 12, 14); + sheet.addMergedRegion(callRangeAddressb4); + rowb1 = sheet.createRow(10 + total); rowb1.setHeight((short) 1000); cella1 = rowb1.createCell(0); cella1.setCellStyle(colStyle2); @@ -1359,16 +2306,16 @@ public class PatrolTaskResultMainController extends BaseController { cella1 = rowb1.createCell(11); cella1.setCellStyle(colStyle2); cella1 = rowb1.createCell(12); - if (o.getImgType().equals("0")) { + if (crr.getImgType().equals("0")) { try { - insertImage(hssfWorkbook, patriarch, images(o.getImg(), inputStreamMap), 10 + total, 0, 2); - } catch (Exception e) { - e.printStackTrace(); + insertImage(wb, patriarch, this.images(crr.getImg(), inputStreamMap), 10 + total, 0, 2); + } catch (Exception var97) { + var97.printStackTrace(); } } else { - String sheetName = o.getImgSrc(); + String sheetName = crr.getImgSrc(); cella1.setCellFormula("HYPERLINK(\"" + sheetName + "\")"); - cella1.setCellStyle(colRight); + cella1.setCellStyle(colright); } cella1 = rowb1.createCell(13); @@ -1377,18 +2324,18 @@ public class PatrolTaskResultMainController extends BaseController { cella1.setCellStyle(colStyle); } } else { - hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 2, 4)); - hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 5, 6)); - hssfSheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 9, 10)); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 2, 4)); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 5, 6)); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 9, 10)); } } } } - return hssfWorkbook; + return wb; } - public SXSSFWorkbook getSXSSFWorkbook(InspectionReport inspectionReport, Map inputStreamMap) { + public SXSSFWorkbook getSXSSFWorkbookLingzhou(InspectionReport inspectionReport, Map inputStreamMap) { // 使用SXSSFWorkbook并设置行访问窗口大小(1000行) SXSSFWorkbook wb = new SXSSFWorkbook(1000); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); @@ -1396,31 +2343,31 @@ public class PatrolTaskResultMainController extends BaseController { CellStyle colStyle = createCellStyle((SXSSFWorkbook) wb, (short) 15, true, true); CellStyle colStyle2 = createCellStylenoborder((SXSSFWorkbook) wb, (short) 15, true, true); CellStyle colright = getColRight((SXSSFWorkbook) wb, (short) 10, true, false); - CellRangeAddress callRangeAddress01 = new CellRangeAddress(0, 0, 0, 14); - CellRangeAddress callRangeAddress02 = new CellRangeAddress(1, 1, 0, 3); - CellRangeAddress callRangeAddress03 = new CellRangeAddress(1, 1, 4, 7); - CellRangeAddress callRangeAddress04 = new CellRangeAddress(1, 1, 8, 11); - CellRangeAddress callRangeAddress05 = new CellRangeAddress(1, 1, 12, 14); - CellRangeAddress callRangeAddress21 = new CellRangeAddress(2, 2, 0, 3); - CellRangeAddress callRangeAddress22 = new CellRangeAddress(2, 2, 4, 7); - CellRangeAddress callRangeAddress23 = new CellRangeAddress(2, 2, 8, 11); - CellRangeAddress callRangeAddress24 = new CellRangeAddress(2, 2, 12, 14); - CellRangeAddress callRangeAddress31 = new CellRangeAddress(3, 3, 0, 3); - CellRangeAddress callRangeAddress32 = new CellRangeAddress(3, 3, 4, 7); - CellRangeAddress callRangeAddress33 = new CellRangeAddress(3, 3, 8, 11); - CellRangeAddress callRangeAddress34 = new CellRangeAddress(3, 3, 12, 14); - CellRangeAddress callRangeAddress41 = new CellRangeAddress(4, 4, 0, 3); - CellRangeAddress callRangeAddress42 = new CellRangeAddress(4, 4, 4, 7); - CellRangeAddress callRangeAddress43 = new CellRangeAddress(4, 4, 8, 11); - CellRangeAddress callRangeAddress44 = new CellRangeAddress(4, 4, 12, 14); - CellRangeAddress callRangeAddress51 = new CellRangeAddress(5, 5, 0, 3); - CellRangeAddress callRangeAddress52 = new CellRangeAddress(5, 5, 4, 7); - CellRangeAddress callRangeAddress53 = new CellRangeAddress(5, 5, 8, 11); - CellRangeAddress callRangeAddress54 = new CellRangeAddress(5, 5, 12, 14); - CellRangeAddress callRangeAddress61 = new CellRangeAddress(6, 7, 0, 3); - CellRangeAddress callRangeAddress62 = new CellRangeAddress(6, 7, 4, 14); - CellRangeAddress callRangeAddress71 = new CellRangeAddress(8, 8, 0, 3); - CellRangeAddress callRangeAddress72 = new CellRangeAddress(8, 8, 4, 14); + CellRangeAddress callRangeAddress01 = new CellRangeAddress(0, 0, 0, 17); + CellRangeAddress callRangeAddress02 = new CellRangeAddress(1, 1, 0, 4); + CellRangeAddress callRangeAddress03 = new CellRangeAddress(1, 1, 5, 9); + CellRangeAddress callRangeAddress04 = new CellRangeAddress(1, 1, 10, 14); + CellRangeAddress callRangeAddress05 = new CellRangeAddress(1, 1, 15, 17); + CellRangeAddress callRangeAddress21 = new CellRangeAddress(2, 2, 0, 4); + CellRangeAddress callRangeAddress22 = new CellRangeAddress(2, 2, 5, 9); + CellRangeAddress callRangeAddress23 = new CellRangeAddress(2, 2, 10, 14); + CellRangeAddress callRangeAddress24 = new CellRangeAddress(2, 2, 15, 17); + CellRangeAddress callRangeAddress31 = new CellRangeAddress(3, 3, 0, 4); + CellRangeAddress callRangeAddress32 = new CellRangeAddress(3, 3, 5, 9); + CellRangeAddress callRangeAddress33 = new CellRangeAddress(3, 3, 10, 14); + CellRangeAddress callRangeAddress34 = new CellRangeAddress(3, 3, 15, 17); + CellRangeAddress callRangeAddress41 = new CellRangeAddress(4, 4, 0, 4); + CellRangeAddress callRangeAddress42 = new CellRangeAddress(4, 4, 5, 9); + CellRangeAddress callRangeAddress43 = new CellRangeAddress(4, 4, 10, 14); + CellRangeAddress callRangeAddress44 = new CellRangeAddress(4, 4, 15, 17); + CellRangeAddress callRangeAddress51 = new CellRangeAddress(5, 5, 0, 4); + CellRangeAddress callRangeAddress52 = new CellRangeAddress(5, 5, 5, 9); + CellRangeAddress callRangeAddress53 = new CellRangeAddress(5, 5, 10, 14); + CellRangeAddress callRangeAddress54 = new CellRangeAddress(5, 5, 15, 17); + CellRangeAddress callRangeAddress61 = new CellRangeAddress(6, 7, 0, 4); + CellRangeAddress callRangeAddress62 = new CellRangeAddress(6, 7, 5, 17); + CellRangeAddress callRangeAddress71 = new CellRangeAddress(8, 8, 0, 4); + CellRangeAddress callRangeAddress72 = new CellRangeAddress(8, 8, 5, 17); sheet.addMergedRegion(callRangeAddress01); sheet.addMergedRegion(callRangeAddress02); sheet.addMergedRegion(callRangeAddress03); @@ -1463,18 +2410,18 @@ public class PatrolTaskResultMainController extends BaseController { Cell cell11 = row1.createCell(0); cell11.setCellValue(MessageUtils.get("变电站")); cell11.setCellStyle(colStyle2); - Cell cell12 = row1.createCell(4); + Cell cell12 = row1.createCell(5); cell12.setCellValue(inspectionReport.getStationName()); cell12.setCellStyle(colStyle2); - Cell cell13 = row1.createCell(8); + Cell cell13 = row1.createCell(10); cell13.setCellValue(MessageUtils.get("电压等级")); cell13.setCellStyle(colStyle2); - Cell cell14 = row1.createCell(12); + Cell cell14 = row1.createCell(15); cell14.setCellValue(inspectionReport.getVoltLevel()); cell14.setCellStyle(colStyle2); - for (int i = 0; i < 15; ++i) { - if (i != 0 && i != 4 && i != 8 && i != 12) { + for (int i = 0; i < 18; ++i) { + if (i != 0 && i != 5 && i != 10 && i != 15) { cell14 = row1.createCell(i); cell14.setCellStyle(colStyle2); } @@ -1484,21 +2431,21 @@ public class PatrolTaskResultMainController extends BaseController { Cell cell21 = row2.createCell(0); cell21.setCellValue(MessageUtils.get("巡视计划创建日期")); cell21.setCellStyle(colStyle2); - Cell cell22 = row2.createCell(4); + Cell cell22 = row2.createCell(5); if (inspectionReport.getInspectionDate() != null) { cell22.setCellValue(sdf.format(inspectionReport.getInspectionDate())); } cell22.setCellStyle(colStyle2); - Cell cell23 = row2.createCell(8); + Cell cell23 = row2.createCell(10); cell23.setCellValue(MessageUtils.get("变电站类别")); cell23.setCellStyle(colStyle2); - Cell cell24 = row2.createCell(12); + Cell cell24 = row2.createCell(15); cell24.setCellValue(inspectionReport.getStationType()); cell24.setCellStyle(colStyle2); - for (int i = 0; i < 15; ++i) { - if (i != 0 && i != 4 && i != 8 && i != 12) { + for (int i = 0; i < 18; ++i) { + if (i != 0 && i != 5 && i != 10 && i != 15) { cell14 = row2.createCell(i); cell14.setCellStyle(colStyle2); } @@ -1508,18 +2455,18 @@ public class PatrolTaskResultMainController extends BaseController { Cell cell31 = row3.createCell(0); cell31.setCellValue(MessageUtils.get("巡视任务")); cell31.setCellStyle(colStyle2); - Cell cell32 = row3.createCell(4); + Cell cell32 = row3.createCell(5); cell32.setCellValue(inspectionReport.getInspectionTaskName()); cell32.setCellStyle(colStyle2); - Cell cell33 = row3.createCell(8); + Cell cell33 = row3.createCell(10); cell33.setCellValue(MessageUtils.get("环境信息")); cell33.setCellStyle(colStyle2); - Cell cell34 = row3.createCell(12); + Cell cell34 = row3.createCell(15); cell34.setCellValue(inspectionReport.getEnvInfo()); cell34.setCellStyle(colStyle2); - for (int i = 0; i < 15; ++i) { - if (i != 0 && i != 4 && i != 8 && i != 12) { + for (int i = 0; i < 18; ++i) { + if (i != 0 && i != 5 && i != 10 && i != 15) { cell14 = row3.createCell(i); cell14.setCellStyle(colStyle2); } @@ -1529,18 +2476,18 @@ public class PatrolTaskResultMainController extends BaseController { Cell cell41 = row4.createCell(0); cell41.setCellValue(MessageUtils.get("审核人")); cell41.setCellStyle(colStyle2); - Cell cell42 = row4.createCell(4); + Cell cell42 = row4.createCell(5); cell42.setCellValue(inspectionReport.getCheckPerson()); cell42.setCellStyle(colStyle2); - Cell cell43 = row4.createCell(8); + Cell cell43 = row4.createCell(10); cell43.setCellValue(MessageUtils.get("审核时间")); cell43.setCellStyle(colStyle2); - Cell cell44 = row4.createCell(12); + Cell cell44 = row4.createCell(15); cell44.setCellValue(DateUtil.formatDateTime(inspectionReport.getCheckTime())); cell44.setCellStyle(colStyle2); - for (int i = 0; i < 15; ++i) { - if (i != 0 && i != 4 && i != 8 && i != 12) { + for (int i = 0; i < 18; ++i) { + if (i != 0 && i != 5 && i != 10 && i != 15) { cell14 = row4.createCell(i); cell14.setCellStyle(colStyle2); } @@ -1550,24 +2497,24 @@ public class PatrolTaskResultMainController extends BaseController { Cell cell51 = row5.createCell(0); cell51.setCellValue(MessageUtils.get("巡视开始时间")); cell51.setCellStyle(colStyle2); - Cell cell52 = row5.createCell(4); + Cell cell52 = row5.createCell(5); if (inspectionReport.getInspectionStartTime() != null) { cell52.setCellValue(DateUtil.formatDateTime(inspectionReport.getInspectionStartTime())); } cell52.setCellStyle(colStyle2); - Cell cell53 = row5.createCell(8); + Cell cell53 = row5.createCell(10); cell53.setCellValue(MessageUtils.get("巡视结束时间")); cell53.setCellStyle(colStyle2); - Cell cell54 = row5.createCell(12); + Cell cell54 = row5.createCell(15); if (inspectionReport.getInspectionEndTime() != null) { cell54.setCellValue(DateUtil.formatDateTime(inspectionReport.getInspectionEndTime())); } cell54.setCellStyle(colStyle2); - for (int i = 0; i < 15; ++i) { - if (i != 0 && i != 4 && i != 8 && i != 12) { + for (int i = 0; i < 18; ++i) { + if (i != 0 && i != 5 && i != 10 && i != 15) { cell14 = row5.createCell(i); cell14.setCellStyle(colStyle2); } @@ -1578,13 +2525,13 @@ public class PatrolTaskResultMainController extends BaseController { Cell cell61 = row6.createCell(0); cell61.setCellValue(MessageUtils.get("巡视统计")); cell61.setCellStyle(colStyle2); - Cell cell62 = row6.createCell(4); + Cell cell62 = row6.createCell(5); cell62.setCellValue(inspectionReport.getPatrolStatistics()); cell62.setCellStyle(colStyle2); int i; - for (i = 0; i < 15; ++i) { - if (i != 0 && i != 4) { + for (i = 0; i < 18; ++i) { + if (i != 0 && i != 5) { cell14 = row6.createCell(i); cell14.setCellStyle(colStyle2); } @@ -1592,7 +2539,7 @@ public class PatrolTaskResultMainController extends BaseController { row6 = sheet.createRow(7); - for (i = 0; i < 15; ++i) { + for (i = 0; i < 18; ++i) { cell14 = row6.createCell(i); cell14.setCellStyle(colStyle2); } @@ -1602,13 +2549,13 @@ public class PatrolTaskResultMainController extends BaseController { Cell cell71 = row7.createCell(0); cell71.setCellValue(MessageUtils.get("巡视结论")); cell71.setCellStyle(colStyle2); - Cell cell72 = row7.createCell(4); + Cell cell72 = row7.createCell(5); cell72.setCellValue(inspectionReport.getDescription()); cell72.setCellStyle(colStyle2); //qinyl - for (int j = 0; j < 15; ++j) { - if (j != 0 && j != 4) { + for (int j = 0; j < 18; ++j) { + if (j != 0 && j != 5) { cell14 = row7.createCell(j); cell14.setCellStyle(colStyle2); } @@ -1616,14 +2563,14 @@ public class PatrolTaskResultMainController extends BaseController { InspectionReportData inspectionReportData = new InspectionReportData(); List list = new ArrayList(); -// inspectionReportData.setPointStatus(MessageUtils.get("异常")); -// list.add(inspectionReportData); + inspectionReportData.setPointStatus(MessageUtils.get("异常")); + list.add(inspectionReportData); // InspectionReportData inspection = new InspectionReportData(); // inspection.setPointStatus(MessageUtils.get("待人工确认")); // list.add(inspection); -// InspectionReportData inection = new InspectionReportData(); -// inection.setPointStatus(MessageUtils.get("正常")); -// list.add(inection); + InspectionReportData inection = new InspectionReportData(); + inection.setPointStatus(MessageUtils.get("正常")); + list.add(inection); inspectionReportData.setPointStatus(MessageUtils.get("缺陷")); list.add(inspectionReportData); int total = 0; @@ -1632,7 +2579,7 @@ public class PatrolTaskResultMainController extends BaseController { for (Iterator var74 = list.iterator(); var74.hasNext(); total += 2) { InspectionReportData arr = (InspectionReportData) var74.next(); SXSSFDrawing patriarch = sheet.createDrawingPatriarch(); - CellRangeAddress callRangeAddressa1 = new CellRangeAddress(9 + total, 9 + total, 0, 14); + CellRangeAddress callRangeAddressa1 = new CellRangeAddress(9 + total, 9 + total, 0, 17); sheet.addMergedRegion(callRangeAddressa1); Row rowa1 = sheet.createRow(9 + total); Cell cella1 = rowa1.createCell(0); @@ -1646,25 +2593,27 @@ public class PatrolTaskResultMainController extends BaseController { cella1.setCellStyle(styleab); //qinyl - for (int j = 0; j < 15; ++j) { + for (int j = 0; j < 18; ++j) { if (j != 0) { cell14 = rowa1.createCell(j); cell14.setCellStyle(colStyle2); } } - CellRangeAddress callRangeAddressa12 = new CellRangeAddress(10 + total, 10 + total, 12, 14); + CellRangeAddress callRangeAddressa12 = new CellRangeAddress(10 + total, 10 + total, 15, 17); sheet.addMergedRegion(callRangeAddressa12); rowa1 = sheet.createRow(10 + total); sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 2, 4)); - sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 5, 6)); - sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 9, 10)); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 5, 7)); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 8, 9)); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 12, 13)); cella1 = rowa1.createCell(0); cella1.setCellValue(MessageUtils.get("编号")); cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(1); cella1.setCellValue(MessageUtils.get("区域")); cella1.setCellStyle(colStyle2); + cella1 = rowa1.createCell(2); cella1.setCellValue(MessageUtils.get("设备")); cella1.setCellStyle(colStyle2); @@ -1672,32 +2621,47 @@ public class PatrolTaskResultMainController extends BaseController { cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(4); cella1.setCellStyle(colStyle2); + cella1 = rowa1.createCell(5); - cella1.setCellValue(MessageUtils.get("点位")); - cella1.setCellStyle(colStyle); + cella1.setCellValue(MessageUtils.get("部件")); + cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(6); - cella1.setCellStyle(colStyle); + cella1.setCellStyle(colStyle2); cella1 = rowa1.createCell(7); - cella1.setCellValue(MessageUtils.get("数据来源")); cella1.setCellStyle(colStyle2); + cella1 = rowa1.createCell(8); - cella1.setCellValue(MessageUtils.get("采集时间")); - cella1.setCellStyle(colStyle2); + cella1.setCellValue(MessageUtils.get("点位")); + cella1.setCellStyle(colStyle); cella1 = rowa1.createCell(9); - cella1.setCellValue(MessageUtils.get("巡视结果")); cella1.setCellStyle(colStyle); + cella1 = rowa1.createCell(10); - cella1.setCellStyle(colStyle); + cella1.setCellValue(MessageUtils.get("数据来源")); + cella1.setCellStyle(colStyle2); + cella1 = rowa1.createCell(11); - cella1.setCellValue(MessageUtils.get("算法类型")); + cella1.setCellValue(MessageUtils.get("识别时间")); cella1.setCellStyle(colStyle2); + cella1 = rowa1.createCell(12); - cella1.setCellValue(MessageUtils.get("巡视图像")); + cella1.setCellValue(MessageUtils.get("巡视结果")); cella1.setCellStyle(colStyle); cella1 = rowa1.createCell(13); cella1.setCellStyle(colStyle); + cella1 = rowa1.createCell(14); + cella1.setCellValue(MessageUtils.get("算法名称")); + cella1.setCellStyle(colStyle2); + + cella1 = rowa1.createCell(15); + cella1.setCellValue(MessageUtils.get("巡视图像")); + cella1.setCellStyle(colStyle); + cella1 = rowa1.createCell(16); + cella1.setCellStyle(colStyle); + cella1 = rowa1.createCell(17); cella1.setCellStyle(colStyle); + InspectionReportData insa = new InspectionReportData(); insa.setReportId(inspectionReport.getLineId() + ""); insa.setPointStatus(arr.getPointStatus()); @@ -1725,7 +2689,7 @@ public class PatrolTaskResultMainController extends BaseController { imgList = brr.getReportImgList(); } - CellRangeAddress callRangeAddressa4 = new CellRangeAddress(10 + total, 10 + total, 12, 14); + CellRangeAddress callRangeAddressa4 = new CellRangeAddress(10 + total, 10 + total, 15, 17); sheet.addMergedRegion(callRangeAddressa4); Row rowb1 = sheet.createRow(10 + total); if (((List) imgList).size() > 0) { @@ -1735,64 +2699,79 @@ public class PatrolTaskResultMainController extends BaseController { cella1 = rowb1.createCell(0); cella1.setCellValue((double) brr.getCode().longValue()); cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(1); cella1.setCellValue(brr.getArea()); cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(2); cella1.setCellValue(brr.getEqName()); cella1.setCellStyle(colStyle2); cella1 = rowb1.createCell(3); -// cella1.setCellValue(brr.getEqName()); cella1.setCellStyle(colStyle2); cella1 = rowb1.createCell(4); // cella1.setCellValue(brr.getParts()); cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(5); + cella1.setCellValue(brr.getParts()); + cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(6); + cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(7); + cella1.setCellStyle(colStyle2); + + cella1 = rowb1.createCell(8); cella1.setCellValue(brr.getPointName()); cella1.setCellStyle(colStyle); - cella1 = rowb1.createCell(6); + cella1 = rowb1.createCell(9); cella1.setCellStyle(colStyle); - cella1 = rowb1.createCell(7); + + cella1 = rowb1.createCell(10); cella1.setCellValue(brr.getDataSources()); cella1.setCellStyle(colStyle2); - cella1 = rowb1.createCell(8); + + cella1 = rowb1.createCell(11); if (brr.getAcquisitionTime() != null) { cella1.setCellValue(DateUtil.formatDateTime(brr.getAcquisitionTime())); } - cella1.setCellStyle(colStyle2); - cella1 = rowb1.createCell(9); + + cella1 = rowb1.createCell(12); cella1.setCellValue(brr.getInspectionResults()); cella1.setCellStyle(colStyle); - cella1 = rowb1.createCell(10); + cella1 = rowb1.createCell(13); cella1.setCellStyle(colStyle); - cella1 = rowb1.createCell(11); + + cella1 = rowb1.createCell(14); cella1.setCellValue(brr.getAlgName()); cella1.setCellStyle(colStyle2); + String str = ""; - cella1 = rowb1.createCell(12); + cella1 = rowb1.createCell(15); cella1.setCellValue(str); cella1.setCellStyle(colStyle); - cella1 = rowb1.createCell(13); + cella1 = rowb1.createCell(16); cella1.setCellStyle(colStyle); - cella1 = rowb1.createCell(14); + cella1 = rowb1.createCell(17); cella1.setCellStyle(colStyle); if (((List) imgList).size() > 0) { sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + ((List) imgList).size(), 0, 0)); sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + ((List) imgList).size(), 1, 1)); sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + ((List) imgList).size(), 2, 4)); - sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + ((List) imgList).size(), 5, 6)); - sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + ((List) imgList).size(), 7, 7)); - sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + ((List) imgList).size(), 8, 8)); - sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + ((List) imgList).size(), 9, 10)); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + ((List) imgList).size(), 5, 7)); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + ((List) imgList).size(), 8, 9)); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + ((List) imgList).size(), 10, 10)); sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + ((List) imgList).size(), 11, 11)); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + ((List) imgList).size(), 12, 13)); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total + ((List) imgList).size(), 14, 14)); new ArrayList(); Iterator var93 = ((List) imgList).iterator(); while (var93.hasNext()) { InspectionReportImg crr = (InspectionReportImg) var93.next(); ++total; - CellRangeAddress callRangeAddressb4 = new CellRangeAddress(10 + total, 10 + total, 12, 14); + CellRangeAddress callRangeAddressb4 = new CellRangeAddress(10 + total, 10 + total, 15, 17); sheet.addMergedRegion(callRangeAddressb4); rowb1 = sheet.createRow(10 + total); rowb1.setHeight((short) 1000); @@ -1821,6 +2800,12 @@ public class PatrolTaskResultMainController extends BaseController { cella1 = rowb1.createCell(11); cella1.setCellStyle(colStyle2); cella1 = rowb1.createCell(12); + cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(13); + cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(14); + cella1.setCellStyle(colStyle2); + cella1 = rowb1.createCell(15); if (crr.getImgType().equals("0")) { try { insertImage(wb, patriarch, this.images(crr.getImg(), inputStreamMap), 10 + total, 0, 2); @@ -1833,15 +2818,16 @@ public class PatrolTaskResultMainController extends BaseController { cella1.setCellStyle(colright); } - cella1 = rowb1.createCell(13); + cella1 = rowb1.createCell(16); cella1.setCellStyle(colStyle); - cella1 = rowb1.createCell(14); + cella1 = rowb1.createCell(17); cella1.setCellStyle(colStyle); } } else { sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 2, 4)); - sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 5, 6)); - sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 9, 10)); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 5, 7)); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 8, 9)); + sheet.addMergedRegion(new CellRangeAddress(10 + total, 10 + total, 12, 13)); } } } @@ -1937,7 +2923,7 @@ public class PatrolTaskResultMainController extends BaseController { int x2 = 1023; int y2 = 255; if (data != null && data.length != 0) { - XSSFClientAnchor anchor = new XSSFClientAnchor(x1, y1, x2, y2, (short) 12, row - 1, (short) 15, row + 1); + XSSFClientAnchor anchor = new XSSFClientAnchor(x1, y1, x2, y2, (short) 15, row - 1, (short) 17, row + 1); pa.createPicture(anchor, wb.addPicture(data, 5)); } } diff --git a/inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/domain/PatrolTaskResultMain.java b/inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/domain/PatrolTaskResultMain.java index 0be770e..043ed66 100644 --- a/inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/domain/PatrolTaskResultMain.java +++ b/inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/domain/PatrolTaskResultMain.java @@ -5,6 +5,7 @@ import com.inspect.base.core.web.domain.BaseEntity; import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Date; +import java.util.List; import lombok.Getter; import lombok.Setter; @@ -16,6 +17,8 @@ import org.apache.commons.lang3.builder.ToStringStyle; public class PatrolTaskResultMain extends BaseEntity { private static final long serialVersionUID = 1L; private Long lineId; + + private List lineIds; @Excel( name = "任务主表id" ) diff --git a/inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/mapper/PatrolTaskResultMainMapper.java b/inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/mapper/PatrolTaskResultMainMapper.java index 4c91aea..7c295c0 100644 --- a/inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/mapper/PatrolTaskResultMainMapper.java +++ b/inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/mapper/PatrolTaskResultMainMapper.java @@ -2,6 +2,7 @@ package com.inspect.resultmain.mapper; import com.inspect.resultmain.domain.PatrolTaskResultMain; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -27,4 +28,6 @@ public interface PatrolTaskResultMainMapper { List selectLineIds(Long lineId); + List selectLineIdsByList(@Param("lineIds") List lineIds); + } diff --git a/inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/service/IPatrolTaskResultMainService.java b/inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/service/IPatrolTaskResultMainService.java index 22c003e..c808410 100644 --- a/inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/service/IPatrolTaskResultMainService.java +++ b/inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/service/IPatrolTaskResultMainService.java @@ -25,4 +25,6 @@ public interface IPatrolTaskResultMainService { List selectLineIds(Long lineId); + List selectLineIdsByList(List lineIds); + } diff --git a/inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/service/impl/PatrolTaskResultMainServiceImpl.java b/inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/service/impl/PatrolTaskResultMainServiceImpl.java index 51cdc54..068ee74 100644 --- a/inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/service/impl/PatrolTaskResultMainServiceImpl.java +++ b/inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/service/impl/PatrolTaskResultMainServiceImpl.java @@ -61,4 +61,9 @@ public class PatrolTaskResultMainServiceImpl implements IPatrolTaskResultMainSer return this.patrolTaskResultMainMapper.selectLineIds(lineId); } + @Override + public List selectLineIdsByList(List lineIds) { + return this.patrolTaskResultMainMapper.selectLineIdsByList(lineIds); + } + } diff --git a/inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolTaskResultMainMapper.xml b/inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolTaskResultMainMapper.xml index 6f36e49..514b454 100644 --- a/inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolTaskResultMainMapper.xml +++ b/inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolTaskResultMainMapper.xml @@ -147,6 +147,18 @@ unified_task_patrolled_id in (select unified_task_patrolled_id from patrol_task_result_main where line_id = #{lineId}) + + diff --git a/inspect-main/inspect-main-task/src/main/resources/mapper/task/ResultAnalysisMapper.xml b/inspect-main/inspect-main-task/src/main/resources/mapper/task/ResultAnalysisMapper.xml index 74fe1aa..37306d4 100644 --- a/inspect-main/inspect-main-task/src/main/resources/mapper/task/ResultAnalysisMapper.xml +++ b/inspect-main/inspect-main-task/src/main/resources/mapper/task/ResultAnalysisMapper.xml @@ -142,7 +142,7 @@ diff --git a/inspect-metadata/src/main/java/com/inspect/metadata/montdata/controller/BasedataMontEvnDataController.java b/inspect-metadata/src/main/java/com/inspect/metadata/montdata/controller/BasedataMontEvnDataController.java index b447b9d..744dbcd 100644 --- a/inspect-metadata/src/main/java/com/inspect/metadata/montdata/controller/BasedataMontEvnDataController.java +++ b/inspect-metadata/src/main/java/com/inspect/metadata/montdata/controller/BasedataMontEvnDataController.java @@ -11,6 +11,7 @@ import com.inspect.common.log.enums.BizType; import com.inspect.common.security.annotation.RequiresPermissions; import java.util.List; +import java.util.Map; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; diff --git a/inspect-metadata/src/main/java/com/inspect/metadata/montdata/mapper/BasedataMontEvnDataMapper.java b/inspect-metadata/src/main/java/com/inspect/metadata/montdata/mapper/BasedataMontEvnDataMapper.java index 4b65ec3..bcbedc6 100644 --- a/inspect-metadata/src/main/java/com/inspect/metadata/montdata/mapper/BasedataMontEvnDataMapper.java +++ b/inspect-metadata/src/main/java/com/inspect/metadata/montdata/mapper/BasedataMontEvnDataMapper.java @@ -4,6 +4,7 @@ import com.inspect.metadata.montdata.domain.BasedataMontEvnData; import org.apache.ibatis.annotations.Mapper; import java.util.List; +import java.util.Map; @Mapper public interface BasedataMontEvnDataMapper { diff --git a/inspect-metadata/src/main/resources/mapper/montdata/BasedataMontEvnDataMapper.xml b/inspect-metadata/src/main/resources/mapper/montdata/BasedataMontEvnDataMapper.xml index 0df4766..d5c4f01 100644 --- a/inspect-metadata/src/main/resources/mapper/montdata/BasedataMontEvnDataMapper.xml +++ b/inspect-metadata/src/main/resources/mapper/montdata/BasedataMontEvnDataMapper.xml @@ -130,6 +130,6 @@ \ No newline at end of file