From 4e7a59c400a57e889d9d9756a08afff956c49b60 Mon Sep 17 00:00:00 2001 From: wangguangyuan Date: Wed, 17 Dec 2025 17:18:11 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E7=A6=81=E7=94=A8=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspect/task/controller/PatrolTaskController.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/inspect-main/inspect-main-task/src/main/java/com/inspect/task/controller/PatrolTaskController.java b/inspect-main/inspect-main-task/src/main/java/com/inspect/task/controller/PatrolTaskController.java index 4510c22..193993d 100644 --- a/inspect-main/inspect-main-task/src/main/java/com/inspect/task/controller/PatrolTaskController.java +++ b/inspect-main/inspect-main-task/src/main/java/com/inspect/task/controller/PatrolTaskController.java @@ -54,6 +54,8 @@ import org.apache.poi.ss.usermodel.*; import org.apache.poi.xssf.streaming.SXSSFSheet; import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @@ -2684,6 +2686,9 @@ public class PatrolTaskController extends BaseController { private void exportExcelV2(HttpServletResponse response, List dataList) throws Exception { response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setHeader("Content-Disposition", "attachment; filename=\"task_export_" + System.currentTimeMillis() + ".xlsx\""); + response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); + response.setHeader("Pragma", "no-cache"); + response.setHeader("Expires", "0"); logger.info("[EXCEL]开始导出"); printMemoryInfo("开始导出"); @@ -2733,17 +2738,15 @@ public class PatrolTaskController extends BaseController { pathMap = null; } + response.setHeader("Transfer-Encoding", "chunked"); workbook.write(out); - // 清理临时文件 - workbook.dispose(); - printMemoryInfo("结束导出"); } catch (IOException e) { logger.error("导出异常:{}", e); printMemoryInfo("导出异常"); } finally { Path start = Paths.get(TEMP_DIR); Files.walk(start) - .filter(Files::isRegularFile) + .sorted(Comparator.reverseOrder()) .forEach(path -> { try { Files.deleteIfExists(path); From 0237db550e44ffda937260230797de2f57df6670 Mon Sep 17 00:00:00 2001 From: htjcAdmin Date: Wed, 17 Dec 2025 17:26:37 +0800 Subject: [PATCH 2/4] =?UTF-8?q?/*openAPI=E6=8E=A5=E5=8F=A3=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=89=93=E5=8D=B0=E8=A7=82=E5=AF=9F=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E6=9F=A5=E8=AF=A2=E8=80=97=E6=97=B6*/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../analysis/service/impl/AnalyseResponseServiceImpl.java | 3 ++- .../partrolresult/controller/PatrolResultController.java | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/service/impl/AnalyseResponseServiceImpl.java b/inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/service/impl/AnalyseResponseServiceImpl.java index dfdefd8..663e0f6 100644 --- a/inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/service/impl/AnalyseResponseServiceImpl.java +++ b/inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/service/impl/AnalyseResponseServiceImpl.java @@ -898,7 +898,8 @@ public class AnalyseResponseServiceImpl implements IAnalyseResponseService { // AlgValue algValue = selectAlgMap(objectId, analyseResPoint.getType()); // resultAnalysis.parseAlg(analyseResPoint.getType(), algValue, value, analyseResPoint.getDesc()); // } - if (resultAnalysisUtils.checkCode(analyseResPoint.getCode(), analyseResPoint.getDesc(), resultAnalysis)) { + if (resultAnalysisUtils.checkCode(analyseResPoint.getCode(), analyseResPoint.getDesc(), resultAnalysis) + || "2001".equals(analyseResPoint.getCode()) && "correction".equals(analyseResPoint.getType())) { AlgValue algValue = selectAlgMap(objectId, analyseResPoint.getType()); resultAnalysisUtils.parseAlg(analyseResPoint.getType(), algValue, value, analyseResPoint.getDesc(), resultAnalysis); } diff --git a/inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/controller/PatrolResultController.java b/inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/controller/PatrolResultController.java index ba6b84f..1eef8d6 100644 --- a/inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/controller/PatrolResultController.java +++ b/inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/controller/PatrolResultController.java @@ -2226,13 +2226,17 @@ public class PatrolResultController extends BaseController { PatrolResult patrolResult = new PatrolResult(); patrolResult.setCreateTime(newTime); List list = new ArrayList<>(); + long start = System.currentTimeMillis(); if ("1".equals(type)) { list = patrolResultService.selectOilResultValue(patrolResult); } + logger.info("openApi selectOilResultValue cost: {}ms", System.currentTimeMillis() - start); + start = System.currentTimeMillis(); if ("2".equals(type)) { list = patrolResultService.select6FsResultValue(patrolResult); } + logger.info("openApi select6FsResultValue cost: {}ms", System.currentTimeMillis() - start); for (ResultValue object : list) { object.setValue(object.formatValue(object.getValue())); From 22f9526410dd3e7294e2b9ad7981d2cf7875fb5c Mon Sep 17 00:00:00 2001 From: htjcAdmin Date: Fri, 19 Dec 2025 15:19:41 +0800 Subject: [PATCH 3/4] =?UTF-8?q?/*=E5=88=86=E5=90=88=E5=BC=80=E5=85=B3?= =?UTF-8?q?=E7=AE=97=E6=B3=95=E9=80=82=E9=85=8D*/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/AnalyseResponseServiceImpl.java | 111 +++++++++++++++++- 1 file changed, 110 insertions(+), 1 deletion(-) diff --git a/inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/service/impl/AnalyseResponseServiceImpl.java b/inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/service/impl/AnalyseResponseServiceImpl.java index 663e0f6..7317902 100644 --- a/inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/service/impl/AnalyseResponseServiceImpl.java +++ b/inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/service/impl/AnalyseResponseServiceImpl.java @@ -789,7 +789,19 @@ public class AnalyseResponseServiceImpl implements IAnalyseResponseService { List resultAnalysisList = new ArrayList<>(); StringJoiner valueJoiner = new StringJoiner(StringUtils.COMMA); StringJoiner validJoiner = new StringJoiner(StringUtils.COMMA); - for (AnalyseResPoint analyseResPoint : resItem.getResults()) { + + List analyseResPointList = resItem.getResults(); + if(!resItem.getResults().isEmpty()) { + AnalyseResPoint analyseResPoint = resItem.getResults().get(0); + String algType = analyseResPoint.getType(); + log.info("RESULT_MERGE algType: {}, analyseResPoint: {}", algType, analyseResPoint); + if("switch".equals(algType)) { + analyseResPointList = mergeAnalyseResItem(analyseResPointList); + log.info("RESULT_MERGE algType: {}, analyseResPointList: {}", algType, analyseResPointList); + } + } + + for (AnalyseResPoint analyseResPoint : analyseResPointList) { ResultAnalysis resultAnalysis = combineAnalyse(analyseResult, String.valueOf(patrolResult.getLineId()), resItem.getObjectId(), @@ -1008,4 +1020,101 @@ public class AnalyseResponseServiceImpl implements IAnalyseResponseService { return algValue; } + + public static final String mergeString = "{\n" + + "\t\"requestId\": \"b00f2fbd1fcc49c6a47ed2b3a77e5028\",\n" + + "\t\"resultsList\": [{\n" + + "\t\t\"objectId\": \"2079991\",\n" + + "\t\t\"results\": [{\n" + + "\t\t\t\"type\": \"switch\",\n" + + "\t\t\t\"value\": \"和\",\n" + + "\t\t\t\"code\": \"2000\",\n" + + "\t\t\t\"resImageUrl\": \"2/2025/12/12/1531/CCD/3038_R100-001_20251212140756.jpg\",\n" + + "\t\t\t\"pos\": [],\n" + + "\t\t\t\"conf\": 0.99,\n" + + "\t\t\t\"desc\": \"\",\n" + + "\t\t\t\"imageNormalUrlPath\": \"1/2025/08/29/1584/CCD/3038_R100-001_20250829123953.jpg\"\n" + + "\t\t}, {\n" + + "\t\t\t\"type\": \"switch\",\n" + + "\t\t\t\"value\": \"和\",\n" + + "\t\t\t\"code\": \"2000\",\n" + + "\t\t\t\"resImageUrl\": \"2/2025/12/12/1531/CCD/3038_R100-001_20251212140756.jpg\",\n" + + "\t\t\t\"pos\": [],\n" + + "\t\t\t\"conf\": 0.99,\n" + + "\t\t\t\"desc\": \"\",\n" + + "\t\t\t\"imageNormalUrlPath\": \"1/2025/08/29/1584/CCD/3038_R100-001_20250829123953.jpg\"\n" + + "\t\t}, {\n" + + "\t\t\t\"type\": \"switch\",\n" + + "\t\t\t\"value\": \"分\",\n" + + "\t\t\t\"code\": \"2000\",\n" + + "\t\t\t\"resImageUrl\": \"2/2025/12/12/1531/CCD/3038_R100-001_20251212140756.jpg\",\n" + + "\t\t\t\"pos\": [],\n" + + "\t\t\t\"conf\": 0.99,\n" + + "\t\t\t\"desc\": \"\",\n" + + "\t\t\t\"imageNormalUrlPath\": \"1/2025/08/29/1584/CCD/3038_R100-001_20250829123953.jpg\"\n" + + "\t\t}, {\n" + + "\t\t\t\"type\": \"switch\",\n" + + "\t\t\t\"value\": \"和\",\n" + + "\t\t\t\"code\": \"2000\",\n" + + "\t\t\t\"resImageUrl\": \"2/2025/12/12/1531/CCD/3038_R100-001_20251212140756.jpg\",\n" + + "\t\t\t\"pos\": [],\n" + + "\t\t\t\"conf\": 0.99,\n" + + "\t\t\t\"desc\": \"\",\n" + + "\t\t\t\"imageNormalUrlPath\": \"1/2025/08/29/1584/CCD/3038_R100-001_20250829123953.jpg\"\n" + + "\t\t}, {\n" + + "\t\t\t\"type\": \"switch\",\n" + + "\t\t\t\"value\": \"分\",\n" + + "\t\t\t\"code\": \"2000\",\n" + + "\t\t\t\"resImageUrl\": \"2/2025/12/12/1531/CCD/3038_R100-001_20251212140756.jpg\",\n" + + "\t\t\t\"pos\": [],\n" + + "\t\t\t\"conf\": 0.99,\n" + + "\t\t\t\"desc\": \"\",\n" + + "\t\t\t\"imageNormalUrlPath\": \"1/2025/08/29/1584/CCD/3038_R100-001_20250829123953.jpg\"\n" + + "\t\t}, {\n" + + "\t\t\t\"type\": \"switch\",\n" + + "\t\t\t\"value\": \"分\",\n" + + "\t\t\t\"code\": \"2000\",\n" + + "\t\t\t\"resImageUrl\": \"2/2025/12/12/1531/CCD/3038_R100-001_20251212140756.jpg\",\n" + + "\t\t\t\"pos\": [],\n" + + "\t\t\t\"conf\": 0.99,\n" + + "\t\t\t\"desc\": \"\",\n" + + "\t\t\t\"imageNormalUrlPath\": \"1/2025/08/29/1584/CCD/3038_R100-001_20250829123953.jpg\"\n" + + "\t\t}],\n" + + "\t\t\"algFactory\": \"yd\"\n" + + "\t}]\n" + + "}"; + + public static List mergeAnalyseResItem(List analyseResPointList) { + String mergedValue = analyseResPointList.stream() + .map(AnalyseResPoint::getValue) + .filter(Objects::nonNull) + .collect(Collectors.joining(StringUtils.COMMA)); + AnalyseResPoint first = analyseResPointList.get(0); + + AnalyseResPoint mergedPoint = new AnalyseResPoint(); + mergedPoint.setType(first.getType()); + mergedPoint.setCode(first.getCode()); + mergedPoint.setResImageUrl(first.getResImageUrl()); + mergedPoint.setImageNormalUrlPath(first.getImageNormalUrlPath()); + mergedPoint.setConf(first.getConf()); + mergedPoint.setDesc(first.getDesc()); + mergedPoint.setPos(first.getPos()); + mergedPoint.setValue(mergedValue); + + return Collections.singletonList(mergedPoint); + } + public static void main(String[] args) { + ObjectMapper mapper = new ObjectMapper(); + AnalyseResult analyseResult; + try { + analyseResult = mapper.readValue(mergeString, new TypeReference() { + }); + log.info("mergeAnalyseResItem analyseResult: {}", analyseResult); + List result = mergeAnalyseResItem(analyseResult.getResultsList().get(0).getResults()); + log.info("mergeAnalyseResItem result: {}", result); + } catch (Exception e) { + log.error("mergeAnalyseResItem exception", e); + } + } + } From d9c67ac42156fbc2fd569b965c3b056ae8d9ca4f Mon Sep 17 00:00:00 2001 From: htjcAdmin Date: Mon, 22 Dec 2025 14:19:43 +0800 Subject: [PATCH 4/4] =?UTF-8?q?/*swich=E5=88=86=E5=90=88=E5=BC=80=E5=85=B3?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=88=9D=E7=AD=9B=E6=A8=A1=E5=9E=8B=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E7=BB=93=E6=9E=9C=E6=94=BE=E8=A1=8C=E5=88=B0=E5=A4=A7?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B*/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../analysis/service/impl/AnalyseResponseServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/service/impl/AnalyseResponseServiceImpl.java b/inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/service/impl/AnalyseResponseServiceImpl.java index 7317902..0e55fec 100644 --- a/inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/service/impl/AnalyseResponseServiceImpl.java +++ b/inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/service/impl/AnalyseResponseServiceImpl.java @@ -188,6 +188,7 @@ public class AnalyseResponseServiceImpl implements IAnalyseResponseService { || "isolator".equals(algType) || "gis_meter".equals(algType) || "correction".equals(algType) + || "switch".equals(algType) ) ) { /*