This commit is contained in:
wyn
2026-05-26 19:02:37 +08:00
parent 3d6cfaaed1
commit 1fcd6a129d
4 changed files with 81 additions and 66 deletions

View File

@@ -1426,11 +1426,16 @@ class References extends Base
*
* POST/GET: p_article_id必填
*
* 返回 list 中每项含reference_no、p_refer_id、status数值
* 返回 list 中每项含reference_no、p_refer_id、progress_status数值
* total、pending、done、failed、pass、is_pass、last_updated_at、records
*
* status 数值含义:
* 分组状态字段 progress_status 数值含义(生命周期顺序)
* 0 = 待校验 1 = 校对中 2 = 校对完成 3 = 校对失败
*
* records[i].status 与分组同一套数值含义(但 record 不会出现 1=校对中):
* 0 = 待校验 2 = 校对完成 3 = 校对失败
*
* summary 用字符串键pending / checking / completed / failed
*/
public function referenceCheckProgressAI()
{
@@ -1467,8 +1472,8 @@ class References extends Base
* 返回字段p_article_id、status、total、pending、done、failed、progress_percent
* total —— 参考文献条数
* pending —— 该条参考文献仍有未跑完明细的数量(含"部分跑完"
* done —— 该条参考文献所有明细都 status=1 的数量
* failed —— 该条参考文献全部跑完且至少 1 条 status=2 的数量
* done —— 该条参考文献所有明细都 status=2(完成) 的数量
* failed —— 该条参考文献全部跑完且至少 1 条 status=3(失败) 的数量
* pending + done + failed = totalprogress_percent = (done+failed)/total
*
* 分组明细请走 referenceCheckProgressAI。

View File

@@ -49,7 +49,7 @@ class ReferenceCheck
return;
}
if (intval($row['status']) === 1) {
if (intval($row['status']) === ReferenceCheckService::RECORD_COMPLETED) {
$job->delete();
return;
}
@@ -100,7 +100,7 @@ class ReferenceCheck
$row = Db::name('article_reference_check_result')->where('id', $checkId)->find();
try {
(new ReferenceCheckService())->updateCheckResult($checkId, [
'status' => 2,
'status' => ReferenceCheckService::RECORD_FAILED,
'error_msg' => $msg,
]);
} catch (\Exception $e) {

View File

@@ -58,7 +58,7 @@ class ReferenceCheckTwo
return;
}
// if (intval($row['status']) === 1) {
// if (intval($row['status']) === ReferenceCheckService::RECORD_COMPLETED) {
// $job->delete();
// return;
// }
@@ -95,12 +95,12 @@ class ReferenceCheckTwo
: '[Crossref复核-无摘要]';
$reason = $tag . ' ' . (isset($llmResult['reason']) ? $llmResult['reason'] : '');
// LLM 通讯失败:写 status=2 并抛异常触发队列重试
// LLM 通讯失败:写 status=RECORD_FAILED(3) 并抛异常触发队列重试
if ($requestFailed) {
$svc->updateCheckResult($checkId, [
'confidence' => floatval($llmResult['confidence']),
'reason' => $reason,
'status' => 2,
'status' => ReferenceCheckService::RECORD_FAILED,
'error_msg' => isset($llmResult['reason']) ? $llmResult['reason'] : 'LLM request failed',
]);
throw new \RuntimeException(isset($llmResult['reason']) ? $llmResult['reason'] : 'LLM request failed');
@@ -111,7 +111,7 @@ class ReferenceCheckTwo
'is_match' => $canSupport ? 1 : 0,
'confidence' => floatval($llmResult['confidence']),
'reason' => $reason,
'status' => 1,
'status' => ReferenceCheckService::RECORD_COMPLETED,
'error_msg' => '',
]);
$this->oQueueJob->log("Crossref复核写入 id={$checkId} affected={$affected} can_support=" . ($canSupport ? 1 : 0) . " confidence=" . floatval($llmResult['confidence']));
@@ -148,7 +148,7 @@ class ReferenceCheckTwo
$row = Db::name('article_reference_check_result')->where('id', $checkId)->find();
try {
(new ReferenceCheckService())->updateCheckResult($checkId, [
'status' => 2,
'status' => ReferenceCheckService::RECORD_FAILED,
'error_msg' => $msg,
]);
} catch (\Exception $e) {