|
@@ -141,7 +141,7 @@ public class ReportCollectService {
|
|
|
public static final String STATUS_COMPLETED = "completed";
|
|
public static final String STATUS_COMPLETED = "completed";
|
|
|
public static final String STATUS_FAILED = "failed";
|
|
public static final String STATUS_FAILED = "failed";
|
|
|
|
|
|
|
|
- // ========================================================================
|
|
|
|
|
|
|
+// ========================================================================
|
|
|
// P0-3 ③ _解析自检 透传合并 —— guhe_v2 新版报告解析结果自检块四子键锚点
|
|
// P0-3 ③ _解析自检 透传合并 —— guhe_v2 新版报告解析结果自检块四子键锚点
|
|
|
// 采集回填层将解析结果中的 _解析自检 信息透传并入 health_report_drafts.collect_validation JSON。
|
|
// 采集回填层将解析结果中的 _解析自检 信息透传并入 health_report_drafts.collect_validation JSON。
|
|
|
// ========================================================================
|
|
// ========================================================================
|
|
@@ -159,6 +159,17 @@ public class ReportCollectService {
|
|
|
public static final List<String> SELF_CHECK_KEYS = Collections.unmodifiableList(Arrays.asList(
|
|
public static final List<String> SELF_CHECK_KEYS = Collections.unmodifiableList(Arrays.asList(
|
|
|
SELF_CHECK_PASS, SELF_CHECK_P0_ALERTS, SELF_CHECK_P1_HINTS, SELF_CHECK_ALERTS));
|
|
SELF_CHECK_PASS, SELF_CHECK_P0_ALERTS, SELF_CHECK_P1_HINTS, SELF_CHECK_ALERTS));
|
|
|
|
|
|
|
|
|
|
+ // ==================== P0-2 回退红线(S-cfc-424 health.report.guheV2AsyncRoute) ====================
|
|
|
|
|
+ // 谷禾新版解析与五维归因升级方案 v1.0 §3 P0-2 ③:
|
|
|
|
|
+ // guhe_v2 异步采集失败<b>不</b>做 Java 本地兜底(Java 无 guhe_v2 能力),
|
|
|
|
|
+ // 而是标记 parse_error + 通知用户「该报告格式暂不支持在线解析,可稍后重试或联系服务号」。
|
|
|
|
|
+
|
|
|
|
|
+ /** P0-2 回退红线:guhe_v2 失败用户提示(不做 Java 本地兜底,统一通知用户) */
|
|
|
|
|
+ public static final String FAILBACK_USER_NOTICE = "该报告格式暂不支持在线解析,可稍后重试或联系服务号";
|
|
|
|
|
+
|
|
|
|
|
+ /** P0-2:guhe_v2 指纹类型标识(32 键新版标准报告;与 ReportParserDispatchService.GUHE_V2_TYPE_ID 对齐) */
|
|
|
|
|
+ public static final String GUHE_V2_TYPE_ID = "gut_flora_guhe_v2";
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 提交异步采集任务。上传完成后调用,立即返回。
|
|
* 提交异步采集任务。上传完成后调用,立即返回。
|
|
|
*/
|
|
*/
|
|
@@ -241,11 +252,23 @@ public class ReportCollectService {
|
|
|
// 已知类型解析失败不再回退 opencode,改为登记退避重试(parse_error 记录失败原因),
|
|
// 已知类型解析失败不再回退 opencode,改为登记退避重试(parse_error 记录失败原因),
|
|
|
// 由 ReportCollectRetryTask 定时驱动重试,避免静默降级导致 foods 等数据缺失。
|
|
// 由 ReportCollectRetryTask 定时驱动重试,避免静默降级导致 foods 等数据缺失。
|
|
|
method = METHOD_LANGGRAPH_SCRIPT;
|
|
method = METHOD_LANGGRAPH_SCRIPT;
|
|
|
- LangGraphReportParseService.ParseOutcome outcome =
|
|
|
|
|
- langGraphReportParseService.parseByScriptWithReason(pdfPath, expectedIndicators);
|
|
|
|
|
|
|
+ boolean guheV2 = GUHE_V2_TYPE_ID.equals(typeId);
|
|
|
|
|
+ // P0-2 ②:guhe_v2 报告携带 reportFormatHint="guhe_v2",Python 侧路由到 extract_guhe_v2
|
|
|
|
|
+ LangGraphReportParseService.ParseOutcome outcome = guheV2
|
|
|
|
|
+ ? langGraphReportParseService.parseByScriptWithReason(
|
|
|
|
|
+ pdfPath, expectedIndicators, LangGraphReportParseService.GUHE_V2_HINT_VALUE)
|
|
|
|
|
+ : langGraphReportParseService.parseByScriptWithReason(pdfPath, expectedIndicators);
|
|
|
payload = outcome != null ? outcome.getPayload() : null;
|
|
payload = outcome != null ? outcome.getPayload() : null;
|
|
|
parseSelfCheck = outcome != null ? outcome.getSelfCheck() : null;
|
|
parseSelfCheck = outcome != null ? outcome.getSelfCheck() : null;
|
|
|
if (payload == null) {
|
|
if (payload == null) {
|
|
|
|
|
+ // P0-2 回退红线③:guhe_v2 失败<b>不</b>做 Java 本地兜底(Java 无此能力),
|
|
|
|
|
+ // 标记 parse_error + 通知用户「该报告格式暂不支持在线解析,可稍后重试或联系服务号」
|
|
|
|
|
+ if (guheV2) {
|
|
|
|
|
+ log.warn("guhe_v2 LangGraph 脚本解析失败,按 P0-2 回退红线标记失败 typeId={}, reason={}",
|
|
|
|
|
+ typeId, outcome != null ? outcome.getError() : "解析结果为空或无效");
|
|
|
|
|
+ healthReportDraftService.markCollectFailed(draftId, FAILBACK_USER_NOTICE);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
String reason = outcome != null && outcome.getError() != null
|
|
String reason = outcome != null && outcome.getError() != null
|
|
|
? outcome.getError() : "解析结果为空或无效";
|
|
? outcome.getError() : "解析结果为空或无效";
|
|
|
log.warn("已知类型 LangGraph 脚本解析失败,登记退避重试 typeId={}, reason={}", typeId, reason);
|
|
log.warn("已知类型 LangGraph 脚本解析失败,登记退避重试 typeId={}, reason={}", typeId, reason);
|