From 08be30bda841df3af65428547186513a3d7b1f42 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期二, 27 十月 2026 17:47:56 +0800
Subject: [PATCH] feat(report): 完善报告退回流程及新增 PDF 预览功能 - 新增退回到报告审核环节,支持退回至检验任务或报告审核两种目标

---
 inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
index 3dde4b3..74f8661 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
@@ -45,6 +45,7 @@
 import com.ruoyi.inspect.pojo.*;
 import com.ruoyi.inspect.service.*;
 import com.ruoyi.inspect.util.HackLoopTableRenderPolicy;
+import com.ruoyi.inspect.util.ReportResultTableRenderPolicy;
 import com.ruoyi.inspect.util.PreserveReportPicturePlaceholderHandler;
 import com.ruoyi.inspect.util.ReportSignaturePictureUtils;
 import com.ruoyi.inspect.vo.InsOrderPlanTaskSwitchVo;
@@ -1855,11 +1856,13 @@
             }
 
             // 妫�楠屼汉鍛樻彁浜ゅ鏍告椂涓嶇敓鎴愭姤鍛婏紱鍏ㄩ儴璇曢獙瀹ゅ鏍搁�氳繃鍚庣敓鎴愭姤鍛娿��
-            if (report == null || StringUtils.isBlank(report.getUrl())) {
+            boolean returnedFromReport = report != null && Objects.equals(report.getIsPass(), 0);
+            if (report == null || StringUtils.isBlank(report.getUrl()) || returnedFromReport) {
                 this.generateReport(orderId, DETECTION_REPORT, writeUserId);
             }
             // 鐩寸粦妯℃澘璁㈠崟鍚屾椂鐢熸垚妫�楠屾姤鍛婏紝涓や唤鏂囦欢鍏辩敤鍚屼竴鏉″鎵硅褰曘��
-            if (directTemplateOrder && (report == null || StringUtils.isBlank(report.getInspectionUrl()))) {
+            if (directTemplateOrder && (report == null || StringUtils.isBlank(report.getInspectionUrl())
+                    || returnedFromReport)) {
                 this.generateReport(orderId, INSPECTION_REPORT, writeUserId);
             }
             report = insReportMapper.selectOne(Wrappers.<InsReport>lambdaQuery()
@@ -3747,7 +3750,7 @@
         }
         Configure configure = Configure.builder()
                 .bind("deviceList", new HackLoopTableRenderPolicy())
-                .bind("r", new HackLoopTableRenderPolicy(true))
+                .bind("r", new ReportResultTableRenderPolicy())
                 .setValidErrorHandler(new PreserveReportPicturePlaceholderHandler())
                 .useSpringEL(true)
                 .build();

--
Gitblit v1.9.3