fix(shipping-notice): 收口激活按 run_id 取 Run 修变量作用域
This commit is contained in:
1 parent
5746b1d220
commit
f67fa6f09f
1 file changed
+8
-4
@@ -870,8 +870,8 @@ def persist_order_extraction_result(
|
|||||||
# 该钩子此前从未接线,导致工作台队列(按 Stream.current_case_id 平铺)看不到任何
|
# 该钩子此前从未接线,导致工作台队列(按 Stream.current_case_id 平铺)看不到任何
|
||||||
# Case,单据永远不可见(回归 SNER-20261014-35E35017 → BB05A18B:9 Case 全部
|
# Case,单据永远不可见(回归 SNER-20261014-35E35017 → BB05A18B:9 Case 全部
|
||||||
# stream_id=NULL,工作台空白且停接收解析)。
|
# stream_id=NULL,工作台空白且停接收解析)。
|
||||||
if run.reparse_of_run_id is not None:
|
if run_id is not None:
|
||||||
from app.models import ShippingOrderReviewCase
|
from app.models import ShippingOrderProcessingRun, ShippingOrderReviewCase
|
||||||
from app.services.shipping_notice.candidate_service import (
|
from app.services.shipping_notice.candidate_service import (
|
||||||
is_current_reviewable_candidate,
|
is_current_reviewable_candidate,
|
||||||
)
|
)
|
||||||
@@ -881,8 +881,10 @@ def persist_order_extraction_result(
|
|||||||
run_is_reparse_successor_of_case,
|
run_is_reparse_successor_of_case,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
persisted_run = db.session.get(ShippingOrderProcessingRun, int(run_id))
|
||||||
|
if persisted_run is not None and persisted_run.reparse_of_run_id is not None:
|
||||||
reparse_cases = ShippingOrderReviewCase.query.filter(
|
reparse_cases = ShippingOrderReviewCase.query.filter(
|
||||||
ShippingOrderReviewCase.run_id == int(run.id),
|
ShippingOrderReviewCase.run_id == int(persisted_run.id),
|
||||||
ShippingOrderReviewCase.status != 'superseded',
|
ShippingOrderReviewCase.status != 'superseded',
|
||||||
ShippingOrderReviewCase.candidate_id.isnot(None),
|
ShippingOrderReviewCase.candidate_id.isnot(None),
|
||||||
).all()
|
).all()
|
||||||
@@ -901,7 +903,9 @@ def persist_order_extraction_result(
|
|||||||
)
|
)
|
||||||
if (
|
if (
|
||||||
current_case is not None
|
current_case is not None
|
||||||
and run_is_reparse_successor_of_case(run=run, current_case=current_case)
|
and run_is_reparse_successor_of_case(
|
||||||
|
run=persisted_run, current_case=current_case,
|
||||||
|
)
|
||||||
):
|
):
|
||||||
declared_source = int(current_case.id)
|
declared_source = int(current_case.id)
|
||||||
activate_review_case(
|
activate_review_case(
|
||||||
|
|||||||
Reference in new issue
Block a user