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/resources/mapper/InsSampleMapper.xml |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/inspect-server/src/main/resources/mapper/InsSampleMapper.xml b/inspect-server/src/main/resources/mapper/InsSampleMapper.xml
index 60b24f3..7abb16d 100644
--- a/inspect-server/src/main/resources/mapper/InsSampleMapper.xml
+++ b/inspect-server/src/main/resources/mapper/InsSampleMapper.xml
@@ -195,6 +195,13 @@
             ELSE ios.ins_state
         END AS ins_state,
         ios.verify_tell,
+        CASE WHEN ios.ins_state = 4 AND a.report_is_pass = 0 THEN (
+            SELECT rr.from_stage
+            FROM ins_report_return_record rr
+            WHERE rr.ins_order_id = a.id AND rr.target_stage = 'INSPECTION_TASK'
+            ORDER BY rr.id DESC
+            LIMIT 1
+        ) ELSE NULL END AS report_return_source,
         verify_user
         FROM
         (
@@ -240,6 +247,7 @@
         io.type_source,
         io.ifs_inventory_id,
         ira.id ins_report_id,
+        ira.is_pass report_is_pass,
         ira.url,
         ira.url_s,
         ira.temp_url_pdf,

--
Gitblit v1.9.3