2
This commit is contained in:
commit
21d41acf50
732 files changed
+55672
-15251
No files matched your search
@@ -3,7 +3,8 @@ backend/app/services/voucher_check/config.py
|
||||
|
||||
用途:解析立账凭证检核环境变量与 ScheduleTask.job_params,校验目录模板与文件名规则。
|
||||
依赖:Flask current_app.config、core.errors.ValidationError。
|
||||
逻辑:runner / share_scanner / erp_repository / 新引擎启动前调用;非法配置抛 VOUCHER_CHECK.CONFIG_INVALID。
|
||||
逻辑:runner / share_scanner / erp_repository / 新引擎启动前调用;非法配置抛 VOUCHER_CHECK.CONFIG_INVALID;
|
||||
ERP 账号优先 VOUCHER_CHECK_ERP_*,否则 ERP_*,再回退 CONTRACT_PAYMENT_ERP_*。
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -184,7 +185,11 @@ def validate_directory_template(template: str) -> str:
|
||||
|
||||
|
||||
def _erp_settings() -> tuple[str, str, str, int]:
|
||||
"""读取 ERP 只读连接;密码只来自环境/配置,不写日志。"""
|
||||
"""
|
||||
读取 ERP 只读连接;密码只来自环境/配置,不写日志。
|
||||
|
||||
核心逻辑:VOUCHER_CHECK_ERP_* 优先,其次通用 ERP_*,再回退合同付款同一套只读账号。
|
||||
"""
|
||||
cfg = current_app.config if has_app_context() else {}
|
||||
erp_dsn = str(
|
||||
cfg.get("VOUCHER_CHECK_ERP_DSN")
|
||||
@@ -196,11 +201,19 @@ def _erp_settings() -> tuple[str, str, str, int]:
|
||||
erp_username = str(
|
||||
cfg.get("VOUCHER_CHECK_ERP_USERNAME")
|
||||
or os.getenv("VOUCHER_CHECK_ERP_USERNAME")
|
||||
or cfg.get("ERP_USERNAME")
|
||||
or os.getenv("ERP_USERNAME")
|
||||
or cfg.get("CONTRACT_PAYMENT_ERP_USERNAME")
|
||||
or os.getenv("CONTRACT_PAYMENT_ERP_USERNAME")
|
||||
or ""
|
||||
).strip()
|
||||
erp_password = str(
|
||||
cfg.get("VOUCHER_CHECK_ERP_PASSWORD")
|
||||
or os.getenv("VOUCHER_CHECK_ERP_PASSWORD")
|
||||
or cfg.get("ERP_PASSWORD")
|
||||
or os.getenv("ERP_PASSWORD")
|
||||
or cfg.get("CONTRACT_PAYMENT_ERP_PASSWORD")
|
||||
or os.getenv("CONTRACT_PAYMENT_ERP_PASSWORD")
|
||||
or ""
|
||||
)
|
||||
if not erp_dsn or not erp_username:
|
||||
@@ -208,6 +221,8 @@ def _erp_settings() -> tuple[str, str, str, int]:
|
||||
timeout = int(
|
||||
cfg.get("VOUCHER_CHECK_ERP_TIMEOUT_SECONDS")
|
||||
or os.getenv("VOUCHER_CHECK_ERP_TIMEOUT_SECONDS")
|
||||
or cfg.get("ERP_TIMEOUT_SECONDS")
|
||||
or os.getenv("ERP_TIMEOUT_SECONDS")
|
||||
or 30
|
||||
)
|
||||
return erp_dsn, erp_username, erp_password, max(1, timeout)
|
||||
|
||||
@@ -98,12 +98,26 @@ class SalesDmsClient:
|
||||
|
||||
@classmethod
|
||||
def ensure_configured(cls) -> None:
|
||||
"""配置缺失时在批次开始前失败,避免空扫被当成业务缺件。"""
|
||||
if not cls.is_configured():
|
||||
"""
|
||||
配置缺失时在批次开始前失败,并返回可操作的缺失项。
|
||||
核心逻辑:避免把空扫当成业务缺件;同时不能将任意凭据值写入错误响应。
|
||||
"""
|
||||
missing = [
|
||||
key
|
||||
for key, value in (
|
||||
("VOUCHER_CHECK_DMS_BASE_URL", cls.base_url()),
|
||||
("VOUCHER_CHECK_DMS_LIBRARY_ID", cls.library_id()),
|
||||
("VOUCHER_CHECK_DMS_ROOT_FOLDER_ID", cls.root_folder_id()),
|
||||
("VOUCHER_CHECK_DMS_USERNAME", cls.username()),
|
||||
("VOUCHER_CHECK_DMS_PASSWORD", cls.password()),
|
||||
)
|
||||
if not value
|
||||
]
|
||||
if missing:
|
||||
raise ValidationError(
|
||||
"未配置销售开票附件文档库根目录",
|
||||
"销售开票附件文档库配置不完整",
|
||||
code="VOUCHER_CHECK.CONFIG_INVALID",
|
||||
details={"missing": "VOUCHER_CHECK_DMS_ROOT_FOLDER_ID"},
|
||||
details={"missing": missing},
|
||||
)
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -3,7 +3,7 @@ backend/app/services/voucher_check/query_service.py
|
||||
|
||||
用途:查询检核批次列表、批次明细、兼容旧状态表,以及工作台强制重检入队。
|
||||
依赖:models.voucher_check、ScheduleRun、aggregator、schedule.queue_service。
|
||||
逻辑:优先读新引擎表;无引擎批次时回退旧 run_items / invoice_states;强制重检写入 run_options.mode=force_all。
|
||||
逻辑:优先读新引擎表;明细同时返回 invoice 行与 by_file_type;工作台可查企微发送记录;无引擎批次时回退旧 run_items / invoice_states;强制重检写入 run_options.mode=force_all。
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -12,10 +12,11 @@ from datetime import date, datetime
|
||||
from typing import Any
|
||||
|
||||
from app.core.errors import ConflictError, NotFoundError, ValidationError
|
||||
from app.models import ScheduleRun
|
||||
from app.models import ScheduleRun, ScheduleTask, User
|
||||
from app.models.voucher_check import (
|
||||
VoucherCheckFileResult,
|
||||
VoucherCheckInvoiceState,
|
||||
VoucherCheckNotification,
|
||||
VoucherCheckRun,
|
||||
VoucherCheckRunItem,
|
||||
)
|
||||
@@ -47,6 +48,7 @@ def _serialize_state(state: VoucherCheckInvoiceState) -> dict[str, Any]:
|
||||
|
||||
|
||||
def _serialize_run_item(item: VoucherCheckRunItem) -> dict[str, Any]:
|
||||
"""序列化旧批次 invoice 行,并带上缺件数量便于明细表展示。"""
|
||||
return {
|
||||
"id": item.id,
|
||||
"schedule_run_id": item.schedule_run_id,
|
||||
@@ -61,6 +63,7 @@ def _serialize_run_item(item: VoucherCheckRunItem) -> dict[str, Any]:
|
||||
"material_fingerprint": item.material_fingerprint,
|
||||
"matched_files": item.matched_files_json or {},
|
||||
"missing_materials": item.missing_materials_json or [],
|
||||
"missing_count": len(item.missing_materials_json or []),
|
||||
"error_code": item.error_code,
|
||||
"error_message": item.error_message,
|
||||
"checked_at": item.checked_at.isoformat() if item.checked_at else None,
|
||||
@@ -140,6 +143,37 @@ def _serialize_engine_run(run: VoucherCheckRun) -> dict[str, Any]:
|
||||
}
|
||||
|
||||
|
||||
def _serialize_schedule_fallback_run(run: ScheduleRun) -> dict[str, Any]:
|
||||
"""
|
||||
序列化尚未创建引擎批次的立账凭证排程记录。
|
||||
核心逻辑:配置或外部依赖在引擎建批前失败时,仍须在工作台展示失败原因,
|
||||
避免用户只能看到空列表而无法判断强制重检是否已执行。
|
||||
"""
|
||||
summary = run.response_summary_json if isinstance(run.response_summary_json, dict) else {}
|
||||
voucher_summary = summary.get("voucher_check") if isinstance(summary.get("voucher_check"), dict) else {}
|
||||
period_month, *_ = previous_period_bounds()
|
||||
return {
|
||||
"id": run.id,
|
||||
"schedule_run_id": run.id,
|
||||
"run_no": run.run_no,
|
||||
"profile_code": str(voucher_summary.get("profile_code") or "sales"),
|
||||
"period_month": str(voucher_summary.get("period") or period_month.strftime("%Y-%m")),
|
||||
"mode": str(voucher_summary.get("mode") or "incremental"),
|
||||
# 工作台按引擎状态筛选;排程在建批前失败统一映射为技术失败。
|
||||
"status": "technical_failed",
|
||||
"subject_count": int(run.total_count or 0),
|
||||
"archived_file_count": 0,
|
||||
"missing_file_count": 0,
|
||||
"missing_invoice_count": 0,
|
||||
"technical_error_count": 1 if run.status == "failed" else 0,
|
||||
"staged_file_count": 0,
|
||||
"skipped_file_count": int(run.skipped_count or 0),
|
||||
"started_at": run.started_at.isoformat() if run.started_at else None,
|
||||
"finished_at": run.finished_at.isoformat() if run.finished_at else None,
|
||||
"error_message": run.error_message,
|
||||
}
|
||||
|
||||
|
||||
def list_runs(
|
||||
*,
|
||||
period: str | None = None,
|
||||
@@ -148,7 +182,11 @@ def list_runs(
|
||||
page: int = 1,
|
||||
page_size: int = 50,
|
||||
) -> dict[str, Any]:
|
||||
"""工作台任务列表:按执行时间倒序返回引擎批次快照。"""
|
||||
"""
|
||||
工作台任务列表:按执行时间倒序返回引擎批次及建批前失败的排程记录。
|
||||
核心逻辑:正常场景读取 VoucherCheckRun 统计快照;若配置校验等错误发生在
|
||||
create_run 之前,则回退显示对应 ScheduleRun,保证强制重检结果可见。
|
||||
"""
|
||||
page = max(1, int(page or 1))
|
||||
page_size = max(1, min(int(page_size or 50), 200))
|
||||
q = VoucherCheckRun.query
|
||||
@@ -158,22 +196,68 @@ def list_runs(
|
||||
q = q.filter(VoucherCheckRun.profile_code == str(profile_code).strip())
|
||||
if status:
|
||||
q = q.filter(VoucherCheckRun.status == str(status).strip())
|
||||
total = q.count()
|
||||
rows = (
|
||||
q.order_by(VoucherCheckRun.id.desc())
|
||||
.offset((page - 1) * page_size)
|
||||
.limit(page_size)
|
||||
.all()
|
||||
engine_rows = q.order_by(VoucherCheckRun.id.desc()).all()
|
||||
engine_schedule_run_ids = {row.schedule_run_id for row in engine_rows if row.schedule_run_id}
|
||||
fallback_query = (
|
||||
ScheduleRun.query.join(ScheduleTask, ScheduleRun.schedule_task_id == ScheduleTask.id)
|
||||
.filter(
|
||||
ScheduleTask.platform_api_path == "accounting-voucher-check",
|
||||
ScheduleRun.status == "failed",
|
||||
)
|
||||
)
|
||||
if status and str(status).strip() != "technical_failed":
|
||||
fallback_rows: list[ScheduleRun] = []
|
||||
else:
|
||||
fallback_rows = fallback_query.order_by(ScheduleRun.id.desc()).all()
|
||||
fallback_rows = [
|
||||
row
|
||||
for row in fallback_rows
|
||||
if row.id not in engine_schedule_run_ids
|
||||
and (not period or _serialize_schedule_fallback_run(row)["period_month"] == parse_period_month(period).strftime("%Y-%m"))
|
||||
]
|
||||
merged = [_serialize_engine_run(row) for row in engine_rows]
|
||||
merged.extend(_serialize_schedule_fallback_run(row) for row in fallback_rows)
|
||||
merged.sort(key=lambda row: row.get("finished_at") or row.get("started_at") or "", reverse=True)
|
||||
total = len(merged)
|
||||
rows = merged[(page - 1) * page_size : page * page_size]
|
||||
return {
|
||||
"page": page,
|
||||
"page_size": page_size,
|
||||
"total": total,
|
||||
"items": [_serialize_engine_run(row) for row in rows],
|
||||
"items": rows,
|
||||
}
|
||||
|
||||
|
||||
def _engine_invoice_items(engine_run: VoucherCheckRun, *, result: str | None = None) -> list[dict[str, Any]]:
|
||||
def _serialize_file_type_rows(aggregated: dict[str, Any]) -> list[dict[str, Any]]:
|
||||
"""
|
||||
将聚合器的 by_file_type 转成工作台「按文件类型」表格行。
|
||||
核心逻辑:缺失占比 = 该类型缺件 invoice 数 / 本批主体总数。
|
||||
"""
|
||||
subject_count = int(aggregated.get("subject_count") or 0)
|
||||
by_type = aggregated.get("by_file_type") or {}
|
||||
rows: list[dict[str, Any]] = []
|
||||
for item in by_type.values():
|
||||
if not isinstance(item, dict):
|
||||
continue
|
||||
missing_invoices = int(item.get("missing_invoice_count") or 0)
|
||||
ratio = (missing_invoices / subject_count) if subject_count else 0.0
|
||||
rows.append(
|
||||
{
|
||||
"rule_code": item.get("rule_code"),
|
||||
"rule_name": item.get("rule_name"),
|
||||
"missing_file_count": int(item.get("missing_file_count") or 0),
|
||||
"missing_invoice_count": missing_invoices,
|
||||
"missing_ratio": round(ratio, 4),
|
||||
}
|
||||
)
|
||||
return rows
|
||||
|
||||
|
||||
def _engine_invoice_items(engine_run: VoucherCheckRun) -> tuple[list[dict[str, Any]], dict[str, Any]]:
|
||||
"""
|
||||
将单文件结果聚合成 invoice 行,并返回同一批的类型汇总。
|
||||
核心逻辑:按 invoice 汇总缺件材料;类型汇总来自聚合器,不受 invoice 行筛选影响。
|
||||
"""
|
||||
rows = (
|
||||
VoucherCheckFileResult.query.filter_by(run_id=engine_run.id)
|
||||
.order_by(VoucherCheckFileResult.invoice_no.asc(), VoucherCheckFileResult.id.asc())
|
||||
@@ -203,8 +287,6 @@ def _engine_invoice_items(engine_run: VoucherCheckRun, *, result: str | None = N
|
||||
"缺件": "missing",
|
||||
"待处理": "pending",
|
||||
}.get(str(excel_row.get("status") or ""), "pending")
|
||||
if result and mapped_status != result:
|
||||
continue
|
||||
items.append(
|
||||
{
|
||||
"id": 0,
|
||||
@@ -214,6 +296,7 @@ def _engine_invoice_items(engine_run: VoucherCheckRun, *, result: str | None = N
|
||||
"cells": excel_row.get("cells") or {},
|
||||
"status_label": excel_row.get("status"),
|
||||
"missing_materials": missing,
|
||||
"missing_count": len(missing),
|
||||
"folder_path": None,
|
||||
"folder_exists": False,
|
||||
"error_code": None,
|
||||
@@ -221,7 +304,7 @@ def _engine_invoice_items(engine_run: VoucherCheckRun, *, result: str | None = N
|
||||
"checked_at": engine_run.finished_at.isoformat() if engine_run.finished_at else None,
|
||||
}
|
||||
)
|
||||
return items
|
||||
return items, aggregated
|
||||
|
||||
|
||||
def list_run_items(
|
||||
@@ -231,7 +314,7 @@ def list_run_items(
|
||||
page: int = 1,
|
||||
page_size: int = 50,
|
||||
) -> dict[str, Any]:
|
||||
"""分页查询批次明细;优先返回新引擎按 invoice 聚合行。"""
|
||||
"""分页查询批次明细;优先返回新引擎按 invoice 聚合行,并附带按文件类型汇总。"""
|
||||
run = ScheduleRun.query.get(run_id)
|
||||
if not run:
|
||||
raise NotFoundError("批次不存在", code="VOUCHER_CHECK.RUN_NOT_FOUND")
|
||||
@@ -243,7 +326,10 @@ def list_run_items(
|
||||
.first()
|
||||
)
|
||||
if engine_run is not None:
|
||||
items = _engine_invoice_items(engine_run, result=str(result).strip() if result else None)
|
||||
items, aggregated = _engine_invoice_items(engine_run)
|
||||
result_filter = str(result).strip() if result else ""
|
||||
if result_filter:
|
||||
items = [row for row in items if row.get("result") == result_filter]
|
||||
total = len(items)
|
||||
sliced = items[(page - 1) * page_size : page * page_size]
|
||||
return {
|
||||
@@ -254,6 +340,8 @@ def list_run_items(
|
||||
"page_size": page_size,
|
||||
"total": total,
|
||||
"items": sliced,
|
||||
"subject_count": int(aggregated.get("subject_count") or 0),
|
||||
"by_file_type": _serialize_file_type_rows(aggregated),
|
||||
}
|
||||
q = VoucherCheckRunItem.query.filter_by(schedule_run_id=run_id)
|
||||
if result:
|
||||
@@ -272,6 +360,8 @@ def list_run_items(
|
||||
"page_size": page_size,
|
||||
"total": total,
|
||||
"items": [_serialize_run_item(r) for r in rows],
|
||||
"subject_count": 0,
|
||||
"by_file_type": [],
|
||||
}
|
||||
|
||||
|
||||
@@ -349,12 +439,129 @@ def list_states(
|
||||
}
|
||||
|
||||
|
||||
def list_notifications(
|
||||
*,
|
||||
period: str | None = None,
|
||||
send_status: str | None = None,
|
||||
page: int = 1,
|
||||
page_size: int = 50,
|
||||
) -> dict[str, Any]:
|
||||
"""
|
||||
分页查询企微缺件汇总发送记录。
|
||||
核心逻辑:以 voucher_check_notifications 为真相源,关联引擎批次取期间/批次号,并回填接收人姓名。
|
||||
"""
|
||||
page = max(1, int(page or 1))
|
||||
page_size = max(1, min(int(page_size or 50), 200))
|
||||
q = VoucherCheckNotification.query.join(
|
||||
VoucherCheckRun,
|
||||
VoucherCheckNotification.run_id == VoucherCheckRun.id,
|
||||
)
|
||||
if period:
|
||||
q = q.filter(VoucherCheckRun.period_month == parse_period_month(period))
|
||||
status_filter = str(send_status or "").strip()
|
||||
if status_filter:
|
||||
q = q.filter(VoucherCheckNotification.send_status == status_filter)
|
||||
total = q.count()
|
||||
rows = (
|
||||
q.order_by(VoucherCheckNotification.id.desc())
|
||||
.offset((page - 1) * page_size)
|
||||
.limit(page_size)
|
||||
.all()
|
||||
)
|
||||
engine_runs = {
|
||||
run.id: run
|
||||
for run in VoucherCheckRun.query.filter(
|
||||
VoucherCheckRun.id.in_([row.run_id for row in rows] or [0])
|
||||
).all()
|
||||
}
|
||||
schedule_ids = [
|
||||
engine_runs[row.run_id].schedule_run_id
|
||||
for row in rows
|
||||
if row.run_id in engine_runs and engine_runs[row.run_id].schedule_run_id
|
||||
]
|
||||
schedule_map = {
|
||||
item.id: item
|
||||
for item in ScheduleRun.query.filter(ScheduleRun.id.in_(schedule_ids or [0])).all()
|
||||
}
|
||||
recipient_ids: set[int] = set()
|
||||
for row in rows:
|
||||
for raw in row.recipient_user_ids_json or []:
|
||||
try:
|
||||
recipient_ids.add(int(raw))
|
||||
except (TypeError, ValueError):
|
||||
continue
|
||||
users = {
|
||||
user.id: user
|
||||
for user in (User.query.filter(User.id.in_(recipient_ids)).all() if recipient_ids else [])
|
||||
}
|
||||
items: list[dict[str, Any]] = []
|
||||
for row in rows:
|
||||
engine_run = engine_runs.get(row.run_id)
|
||||
summary = row.summary_json if isinstance(row.summary_json, dict) else {}
|
||||
names: list[str] = []
|
||||
for raw in row.recipient_user_ids_json or []:
|
||||
try:
|
||||
user = users.get(int(raw))
|
||||
except (TypeError, ValueError):
|
||||
user = None
|
||||
if user:
|
||||
names.append(str(user.real_name or user.username or user.id))
|
||||
schedule_run_id = engine_run.schedule_run_id if engine_run else None
|
||||
schedule_run = schedule_map.get(schedule_run_id) if schedule_run_id else None
|
||||
items.append(
|
||||
{
|
||||
"id": row.id,
|
||||
"run_id": row.run_id,
|
||||
"schedule_run_id": schedule_run_id,
|
||||
"run_no": (
|
||||
(engine_run.run_no if engine_run else None)
|
||||
or summary.get("run_no")
|
||||
or (schedule_run.run_no if schedule_run else None)
|
||||
),
|
||||
"period_month": (
|
||||
engine_run.period_month.strftime("%Y-%m")
|
||||
if engine_run and engine_run.period_month
|
||||
else summary.get("period")
|
||||
),
|
||||
"subject_count": int(
|
||||
(engine_run.subject_count if engine_run else None) or summary.get("subject_count") or 0
|
||||
),
|
||||
"missing_file_count": int(
|
||||
(engine_run.missing_file_count if engine_run else None)
|
||||
or summary.get("missing_file_count")
|
||||
or 0
|
||||
),
|
||||
"missing_invoice_count": int(
|
||||
(engine_run.missing_invoice_count if engine_run else None)
|
||||
or summary.get("missing_invoice_count")
|
||||
or 0
|
||||
),
|
||||
"send_status": row.send_status,
|
||||
"skip_reason": row.skip_reason,
|
||||
"excel_filename": row.excel_filename or (schedule_run.excel_file_name if schedule_run else None),
|
||||
"has_excel": bool(schedule_run and schedule_run.excel_file_name),
|
||||
"recipient_names": names,
|
||||
"sent_at": row.sent_at.isoformat() if row.sent_at else None,
|
||||
"created_at": row.created_at.isoformat() if row.created_at else None,
|
||||
}
|
||||
)
|
||||
return {
|
||||
"page": page,
|
||||
"page_size": page_size,
|
||||
"total": total,
|
||||
"items": items,
|
||||
}
|
||||
|
||||
|
||||
def enqueue_force_all_run(*, triggered_by_user_id: int | None) -> dict[str, Any]:
|
||||
"""
|
||||
将默认立账凭证排程以 force_all 入队,全量重检上一个自然月。
|
||||
核心逻辑:复用周批 ScheduleTask;已有 queued/running 时冲突失败,不覆盖进行中的批次。
|
||||
"""
|
||||
from app.services.schedule.queue_service import enqueue_manual_schedule_run
|
||||
from app.services.voucher_check.config import load_engine_config
|
||||
from app.services.voucher_check.dms_client import SalesDmsClient
|
||||
from app.services.voucher_check.profile_loader import ensure_published_profile, load_profile_definition
|
||||
from app.services.voucher_check.schedule_seed import ensure_default_voucher_check_schedule
|
||||
|
||||
task = ensure_default_voucher_check_schedule(commit=True)
|
||||
@@ -363,6 +570,11 @@ def enqueue_force_all_run(*, triggered_by_user_id: int | None) -> dict[str, Any]
|
||||
"未找到立账凭证检核排程任务",
|
||||
code="VOUCHER_CHECK.SCHEDULE_NOT_FOUND",
|
||||
)
|
||||
# [STEP 1] 入队前完成不依赖外部 IO 的配置预校验,避免 worker 失败后页面空白。
|
||||
config = load_engine_config(task.job_params if isinstance(task.job_params, dict) else {})
|
||||
profile = load_profile_definition(config.profile_code)
|
||||
ensure_published_profile(config.profile_code)
|
||||
SalesDmsClient.ensure_configured()
|
||||
run, job_id, created = enqueue_manual_schedule_run(
|
||||
task.id,
|
||||
triggered_by_user_id=triggered_by_user_id,
|
||||
|
||||
@@ -85,6 +85,7 @@ def run_voucher_check_batch(task: ScheduleTask, run: ScheduleRun) -> ScheduleExe
|
||||
"""
|
||||
执行立账凭证周批次。
|
||||
核心逻辑:上月 invoice × 必检规则扫描文档库类型目录,命中后复制到所有归档(同名跳过)。
|
||||
启动日志带 path=accounting-voucher-check,便于在全是 schedule 的 worker 输出中识别本任务。
|
||||
|
||||
Returns:
|
||||
ScheduleExecuteResult:(total, success, failed, skipped, details, errors, step_logs)
|
||||
@@ -95,6 +96,12 @@ def run_voucher_check_batch(task: ScheduleTask, run: ScheduleRun) -> ScheduleExe
|
||||
mode = options["mode"]
|
||||
single_invoice = options["invoice_no"]
|
||||
now = datetime.utcnow()
|
||||
current_app.logger.info(
|
||||
"[voucher-check] start name=%s path=accounting-voucher-check run_no=%s mode=%s",
|
||||
getattr(task, "name", None) or "立账凭证检核",
|
||||
run.run_no,
|
||||
mode,
|
||||
)
|
||||
|
||||
try:
|
||||
config = load_engine_config(task.job_params if isinstance(task.job_params, dict) else {})
|
||||
|
||||
Reference in new issue
Block a user