certflow.config.models module

配置数据模型

使用 Pydantic 定义配置数据结构,提供类型验证和自动补全.

class certflow.config.models.RootConfig(*, app=<factory>, paths=<factory>, sales_plan=<factory>, certificate=<factory>, import_deduplication=<factory>, database=<factory>, logging=<factory>, ui=<factory>, color_mapping=<factory>, numbering=None, duplicate_check=None, unique_key=None, priority_rules=None, export=None, sales_plan_fill=None, field_fallbacks=None, field_fill_rules=None, sales_importer=None, qualified_list=None, import_mapping=None, export_debug=None, test_report=None, report=<factory>, printer=None, environment=None, colors=None, field_templates=None, print_templates=None, vba_import=None, completed_orders_backfill=None, query_page=<factory>, main_window=<factory>, window=<factory>, title_bar=<factory>, nav_buttons=<factory>, correction_queue=<factory>, welcome_page=<factory>, import_page=<factory>, log_page=<factory>, status_bar=<factory>, styles=<factory>, grouping=None, sorting=None, id_generator=None, production_status=None, import_config=None, import_placeholder=<factory>, bom_import=<factory>, sync=None, print=None, background=None, print_log_empty_markers=None, output=None, dictionary=<factory>, lookup_tables=<factory>, quarantine=<factory>, sort_rules=<factory>)[源代码]

基类:_StrictModel

根配置模型

所有配置的顶层容器,聚合所有子配置模块. 顶层已闭环为 extra='forbid'(任务 2.3 / §六 UI 域严格校验),未建模键触发 ValidationError,杜绝顶层键拼写错误/死配置静默失效;嵌套 UI 段结构由 UIConfigModel 顶层闸门二次把关(见 ui_config.py)。

参数:
app

应用基础配置

Type:

AppConfig

paths

路径配置

Type:

PathsConfig

sales_plan

销售计划配置

Type:

SalesPlanConfig

certificate

合格证配置

Type:

CertificateConfig

import_deduplication

导入去重配置

Type:

ImportDeduplicationConfig

database

数据库配置

Type:

DatabaseConfig

logging

日志配置

Type:

LoggingConfig

ui

UI配置

Type:

UIConfig

color_mapping

颜色映射配置

Type:

ColorMappingConfig

numbering

编号规则配置(V2)

Type:

NumberingConfig | None

duplicate_check

重复检查配置(V2)

Type:

DuplicateCheckConfig | None

unique_key

唯一键配置(V2)

Type:

UniqueKeyConfig | None

priority_rules

优先级规则配置(V2)

Type:

PriorityRulesConfig | None

export

导出配置(V2)

Type:

ExportConfig | None

sales_plan_fill

销售计划填充配置(V2)

Type:

SalesPlanFillConfig | None

field_fallbacks

字段回退链配置(V2)

Type:

dict[str, list[str]] | None

field_fill_rules

字段填充规则配置(V2)

Type:

dict[str, list[FieldFillRule]] | None

sales_importer

销售计划导入器配置(V2)

Type:

SalesImporterConfig | None

import_mapping

导入列映射配置(V2)

Type:

ImportMappingConfig | None

export_debug

导出调试配置(V2)

Type:

ExportDebugConfig | None

test_report

试压报告配置(V2)

Type:

TestReportConfig | None

printer

打印机配置(V2)

Type:

PrinterConfig | None

environment

环境信息配置(V2)

Type:

EnvironmentConfig | None

colors

颜色常量配置(V2)

Type:

ColorsConfig | None

vba_import

VBA导入配置(V2)

Type:

VBAImportConfig | None

id_generator

唯一键生成策略配置

Type:

IdGeneratorConfig | None

production_status

生产状态配置

Type:

ProductionStatusConfig | None

import_config

导入配置(与 QueryView 风格一致)

Type:

ImportConfig | None

sync

数据库同步配置(WebDAV)

Type:

SyncConfig | None

print

打印引擎配置

Type:

PrintConfig | None

background

底板预览配置

Type:

BackgroundConfig | None

print_log_empty_markers

打印日志空值默认标记配置

Type:

PrintLogEmptyMarkersConfig | None

model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

app: AppConfig
paths: PathsConfig
sales_plan: SalesPlanConfig
certificate: CertificateConfig
import_deduplication: ImportDeduplicationConfig
database: DatabaseConfig
logging: LoggingConfig
ui: UIConfig
color_mapping: ColorMappingConfig
numbering: NumberingConfig | None
duplicate_check: DuplicateCheckConfig | None
unique_key: UniqueKeyConfig | None
priority_rules: PriorityRulesConfig | None
export: ExportConfig | None
sales_plan_fill: SalesPlanFillConfig | None
field_fallbacks: dict[str, list[str]] | None
field_fill_rules: dict[str, list[FieldFillRule]] | None
sales_importer: SalesImporterConfig | None
qualified_list: dict[str, Any] | None
import_mapping: ImportMappingConfig | None
export_debug: ExportDebugConfig | None
test_report: TestReportConfig | None
report: dict[str, Any]
printer: PrinterConfig | None
environment: EnvironmentConfig | None
colors: ColorsConfig | None
field_templates: dict[str, Any] | None
print_templates: dict[str, Any] | None
vba_import: VBAImportConfig | None
completed_orders_backfill: CompletedOrdersBackfillConfig | None
query_page: dict[str, Any]
main_window: dict[str, Any]
window: dict[str, Any]
title_bar: dict[str, Any]
nav_buttons: list[Any]
correction_queue: dict[str, Any]
welcome_page: dict[str, Any]
import_page: dict[str, Any]
log_page: dict[str, Any]
status_bar: dict[str, Any]
styles: dict[str, Any]
grouping: GroupingConfig | None
sorting: SortingConfig | None
id_generator: IdGeneratorConfig | None
production_status: ProductionStatusConfig | None
import_config: ImportConfig | None
import_placeholder: ImportPlaceholderConfig | None
bom_import: BomImportConfig | None
sync: SyncConfig | None
print: PrintConfig | None
background: BackgroundConfig | None
print_log_empty_markers: PrintLogEmptyMarkersConfig | None
output: OutputConfig | None
dictionary: DictionaryConfig
lookup_tables: LookupTablesConfig
quarantine: QuarantineConfig
sort_rules: SortRulesConfig
classmethod validate_log_level(v)[源代码]

验证日志级别是否有效

参数:

v (LoggingConfig) -- 待验证的日志配置对象

返回:

验证通过的日志配置对象

返回类型:

LoggingConfig

抛出:

ValueError -- 当日志级别不在有效值范围内时抛出

class certflow.config.models.AppConfig(*, name='CertFlow', version='2.0.0', year=2026, organization='CertFlow Team', debug=False)[源代码]

基类:_StrictModel

应用基础配置模型

定义应用程序的基本信息,包括名称、版本、组织等元数据.

参数:
name

应用程序名称,默认为"CertFlow"

Type:

str

version

应用程序版本号,默认为"2.0.0"

Type:

str

year

版权年份,默认为2026

Type:

int

organization

组织名称,默认为"CertFlow Team"

Type:

str

debug

是否启用调试模式,默认为False

Type:

bool

model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str
version: str
year: int
organization: str
debug: bool
class certflow.config.models.PathsConfig(*, database=<factory>, temp=<factory>, logs='logs', resources='resources', templates=<factory>, sales_plan=None, qualified_list=None, nameplate_db=None, quality_cert=None, transfer_docs=None, backup=None, output=None, excel_layout=None, images=None, fonts=None, report_archive=<factory>, report_templates_dir='templates/reports')[源代码]

基类:_StrictModel

路径配置集合模型

聚合所有文件路径相关的配置,包括数据库、临时文件、日志等路径.

参数:
database

数据库路径配置

Type:

DatabasePaths

temp

临时文件路径配置

Type:

TempPaths

logs

日志文件目录,默认为"logs"

Type:

str

resources

资源文件目录,默认为"resources"

Type:

str

templates

模板文件路径配置

Type:

TemplatePaths

sales_plan

销售计划文件路径映射(V2)

Type:

dict[str, str] | None

qualified_list

合格清单文件路径映射(V2)

Type:

dict[str, str] | None

nameplate_db

铭牌数据库路径映射(V2)

Type:

dict[str, str] | None

quality_cert

质量证书路径映射(V2)

Type:

dict[str, str] | None

transfer_docs

交接文档路径映射(V2)

Type:

dict[str, str] | None

backup

备份文件路径映射(V2)

Type:

dict[str, str] | None

output

输出文件路径映射(V2)

Type:

dict[str, str] | None

excel_layout

Excel布局配置(V2)

Type:

dict[str, Any] | None

images

图片文件路径映射(V2)

Type:

dict[str, str] | None

model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

database: DatabasePaths
temp: TempPaths
logs: str
resources: str
templates: TemplatePaths
sales_plan: dict[str, str] | None
qualified_list: dict[str, str] | None
nameplate_db: dict[str, str] | None
quality_cert: dict[str, str] | None
transfer_docs: dict[str, str] | None
backup: dict[str, str] | None
output: dict[str, str] | None
excel_layout: dict[str, Any] | None
images: dict[str, str] | None
fonts: dict[str, Any] | None
report_archive: ReportArchiveConfig
report_templates_dir: str
class certflow.config.models.TemplatePaths(*, base='data/templates/', certificate_chinese='data/templates/中文合格证模板.xlsx', certificate_bilingual='data/templates/中英文合格证模板.xlsx', certificate_russian='', test_report_small='', test_report_medium='', quality_cert_file='', report_master='data/xlsx/各种报告的xlsx文件模板.xlsx')[源代码]

基类:_StrictModel

模板路径配置模型

定义各类模板文件的存储路径.

参数:
  • base (str)

  • certificate_chinese (str)

  • certificate_bilingual (str)

  • certificate_russian (str)

  • test_report_small (str)

  • test_report_medium (str)

  • quality_cert_file (str)

  • report_master (str)

base

模板文件根目录,默认为"data/templates/"

Type:

str

certificate_chinese

中文合格证模板路径

Type:

str

certificate_bilingual

中英文合格证模板路径

Type:

str

certificate_russian

俄文合格证模板路径

Type:

str

test_report_small

试压报告模板(少)路径

Type:

str

test_report_medium

试压报告模板(中)路径

Type:

str

quality_cert_file

质保书模板路径

Type:

str

report_master

报告母版工作簿路径(T6 配置化,原硬编码 data/xlsx/*.xlsx)

Type:

str

base: str
certificate_chinese: str
certificate_bilingual: str
certificate_russian: str
test_report_small: str
test_report_medium: str
quality_cert_file: str
report_master: str
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.SalesPlanConfig(*, excel_config=<factory>, column_mapping=<factory>, header_detection=None, styled_import_columns=<factory>, header_row=2, data_start_row=3, required_fields=<factory>, valid_row_check=<factory>, pn_convert=<factory>, import_gate=<factory>, dual_field_mapping=<factory>)[源代码]

基类:_StrictModel

销售计划配置模型

定义销售计划Excel文件的解析规则,包括列映射、表头位置等.

参数:
excel_config

Excel 读取配置

Type:

ExcelReadConfig

column_mapping

列映射配置

Type:

ColumnMappingConfig

header_detection

表头自动检测配置

Type:

HeaderDetectionConfig | None

styled_import_columns

带格式导入时保留的列名列表

Type:

list[str]

header_row

表头所在行号(从1开始),默认为2

Type:

int

data_start_row

数据起始行号(从1开始),默认为3

Type:

int

required_fields

必填字段列表

Type:

list[str]

valid_row_check

有效行检查配置

Type:

ValidRowCheck

pn_convert

公称压力 Lb→MPa 换算(#30 P0 DN/PN 字典 DB 化)

Type:

PnConvertConfig

import_gate

导入门控(#30 P1 无单号行跳过/隔离/标黄)

Type:

ImportGateConfig

dual_field_mapping

双字段映射(合同信息 ↔ 合格证打印信息),蓝图 §4.2.1

Type:

DualFieldMappingConfig

model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

excel_config: ExcelReadConfig
column_mapping: ColumnMappingConfig
header_detection: HeaderDetectionConfig | None
styled_import_columns: list[str]
header_row: int
data_start_row: int
required_fields: list[str]
valid_row_check: ValidRowCheck
pn_convert: PnConvertConfig
import_gate: ImportGateConfig
dual_field_mapping: DualFieldMappingConfig
class certflow.config.models.ExcelReadConfig(*, sheet_name=0, header_row=1, skip_rows=None, use_cols=None)[源代码]

基类:_StrictModel

Excel 读取配置模型

定义 Excel 文件读取时的基本参数.

参数:
  • sheet_name (str | int)

  • header_row (int)

  • skip_rows (int | None)

  • use_cols (str | None)

sheet_name

工作表索引或名称,默认为 0

Type:

str | int

header_row

表头行号(0-indexed),默认为 1

Type:

int

skip_rows

跳过的行数,None 表示不跳过

Type:

int | None

use_cols

使用的列范围,None 表示全部

Type:

str | None

sheet_name: str | int
header_row: int
skip_rows: int | None
use_cols: str | None
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.HeaderDetectionConfig(*, enabled=True, keywords=<factory>, max_rows=20)[源代码]

基类:_StrictModel

表头自动检测配置模型

定义表头检测的启停和匹配规则.

参数:
enabled

是否启用表头自动检测

Type:

bool

keywords

用于匹配表头的关键词列表

Type:

list[str]

max_rows

最大扫描行数

Type:

int

enabled: bool
keywords: list[str]
max_rows: int
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.DualFieldMappingConfig(*, pairs=<factory>, import_mode='lazy')[源代码]

基类:_StrictModel

双字段映射配置(合同信息 ↔ 合格证打印信息),蓝图 §4.2.1。

参数:
pairs

contract→cert 字段对列表,每项 {contract, cert}

Type:

list[dict[str, str]]

import_mode

copy / override / lazy(默认 lazy,不破坏既有行为) - copy:合同值同时写入 cert_*(杜绝"改合同静默跟随"风险) - override:仅当 Excel 显式提供 cert 列时才写 cert_* - lazy:保持现状(cert_* 留空,打印时回退合同值)

Type:

str

pairs: list[dict[str, str]]
import_mode: str
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.SuffixRule(*, field=None, keywords, suffix, exclude=None)[源代码]

基类:_StrictModel

合格证后缀规则模型

根据关键词匹配规则生成证书编号后缀.

参数:
field

可选,指定匹配的字段名

Type:

str | None

keywords

触发该后缀的关键词列表

Type:

list[str]

suffix

匹配成功时使用的后缀字符串

Type:

str

exclude

可选,排除的关键词列表,匹配时不生成后缀

Type:

list[str] | None

field: str | None
keywords: list[str]
suffix: str
exclude: list[str] | None
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.CertificateConfig(*, prefix='CERT', date_format='%Y%m%d', format_template='{prefix}{date}{seq:04d}', suffix_rules=<factory>, defaults=<factory>, numbering=<factory>, issue_date_source='sync_numbering_ym', inspector_id=<factory>, print_duplicate_check=<factory>)[源代码]

基类:_StrictModel

合格证配置模型

定义合格证编号的生成规则.

参数:
  • prefix (str)

  • date_format (str)

  • format_template (str)

  • suffix_rules (list[SuffixRule])

  • defaults (dict[str, Any])

  • numbering (CertificateNumberingConfig)

  • issue_date_source (str)

  • inspector_id (InspectorIdConfig)

  • print_duplicate_check (PrintDuplicateCheckConfig)

prefix

证书编号前缀,默认为"CERT"

Type:

str

date_format

日期格式字符串,默认为"%Y%m%d"

Type:

str

format_template

编号格式模板,支持{prefix}、{date}、{seq}占位符

Type:

str

suffix_rules

后缀匹配规则列表

Type:

list[SuffixRule]

defaults

默认值字典

Type:

dict[str, Any]

numbering

编号时机与编码模式配置(步骤 6)

Type:

CertificateNumberingConfig

model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

prefix: str
date_format: str
format_template: str
suffix_rules: list[SuffixRule]
defaults: dict[str, Any]
numbering: CertificateNumberingConfig
issue_date_source: str
inspector_id: InspectorIdConfig
print_duplicate_check: PrintDuplicateCheckConfig
class certflow.config.models.ImportDeduplicationConfig(*, strategy='skip', check_within_file=True, check_against_db=True, unique_key_fields=<factory>, update_on_duplicate=True, monitored_fields=<factory>, on_collision='quarantine', duplicate_handling=None, unique_key_generation=None, field_normalization=None)[源代码]

基类:_StrictModel

导入去重配置模型

定义数据导入时的重复检测和处理策略.

参数:
strategy

去重策略,"skip"表示跳过重复项,"overwrite"表示覆盖

Type:

str

check_within_file

是否检查文件内重复,默认为True

Type:

bool

check_against_db

是否检查与数据库重复,默认为True

Type:

bool

unique_key_fields

用于判断唯一性的字段列表

Type:

list[str]

update_on_duplicate

重复时是否检测变更并更新,默认为True

Type:

bool

monitored_fields

监控变更的字段列表

Type:

list[str]

duplicate_handling

重复处理扩展配置(V2)

Type:

dict[str, Any] | None

unique_key_generation

唯一键生成配置(V2)

Type:

dict[str, Any] | None

field_normalization

字段规范化配置(V2)

Type:

dict[str, Any] | None

model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

strategy: str
check_within_file: bool
check_against_db: bool
unique_key_fields: list[str]
update_on_duplicate: bool
monitored_fields: list[str]
on_collision: str
duplicate_handling: dict[str, Any] | None
unique_key_generation: dict[str, Any] | None
field_normalization: dict[str, Any] | None
class certflow.config.models.DatabaseConfig(*, type='sqlite', echo=False, pool_size=5, max_overflow=10)[源代码]

基类:_StrictModel

数据库配置模型

定义数据库连接参数和行为.

参数:
type

数据库类型,默认为"sqlite"

Type:

str

echo

是否打印SQL语句日志,默认为False

Type:

bool

pool_size

数据库连接池大小,默认为5

Type:

int

max_overflow

连接池最大溢出连接数,默认为10

Type:

int

model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

type: str
echo: bool
pool_size: int
max_overflow: int
class certflow.config.models.LoggingConfig(*, level='INFO', file='logs/certflow.log', format='{time:YYYY-MM-DD HH:mm:ss} | {level: <8} | {name}:{function}:{line} - {message}', rotation='10 MB', retention='30 days', compression='zip', debug_modules=<factory>)[源代码]

基类:_StrictModel

日志配置模型

定义日志输出格式、轮转策略等参数.

参数:
level

日志级别,可选值为DEBUG、INFO、WARNING、ERROR、CRITICAL

Type:

str

file

日志文件路径,默认为"logs/certflow.log"

Type:

str

format

日志格式字符串

Type:

str

rotation

日志文件轮转条件,如"10 MB"表示10MB轮转

Type:

str

retention

日志保留时间,如"30 days"表示保留30天

Type:

str

compression

日志压缩格式,默认为"zip"

Type:

str

debug_modules

DEBUG 黑名单列表,支持模块名或"模块名:函数名"格式

Type:

list[str]

model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

level: str
file: str
format: str
rotation: str
retention: str
compression: str
debug_modules: list[str]
class certflow.config.models.UIConfig(*, window=<factory>, table=<factory>, status_bar=<factory>, query_page=<factory>, **extra_data)[源代码]

基类:_StrictModel

UI配置集合模型

聚合所有用户界面相关的配置.

参数:
  • window (WindowConfig)

  • table (TableConfig)

  • status_bar (StatusBarConfig)

  • query_page (dict)

  • extra_data (Any)

window

窗口配置

Type:

WindowConfig

table

表格配置

Type:

TableConfig

status_bar

状态栏配置

Type:

StatusBarConfig

query_page

查询页面配置(视图模板、操作符、字段映射等)

Type:

dict

model_config = {'extra': 'allow'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

window: WindowConfig
table: TableConfig
status_bar: StatusBarConfig
query_page: dict
class certflow.config.models.ColorMappingConfig(*, status_colors=<factory>, priority_colors=<factory>, vba_colors=None, font_color_to_shipping=None, bg_color_to_status=None, theme_font_colors=None, font_colors=None, bg_colors=None)[源代码]

基类:_StrictModel

颜色映射配置模型

定义状态和优先级到颜色的映射关系.

参数:
status_colors

状态到颜色的映射字典

Type:

dict[str, str]

priority_colors

优先级到颜色的映射字典

Type:

dict[str, str]

vba_colors

VBA颜色索引到颜色的映射(V2)

Type:

dict[int, str] | None

font_color_to_shipping

字体颜色到发货状态的映射(V2)

Type:

dict[int, str] | None

bg_color_to_status

背景颜色到状态的映射(V2)

Type:

dict[int, str] | None

theme_font_colors

THEME 字体颜色到状态的映射(V3)

Type:

dict[str, str] | None

font_colors

字体颜色 hex 字符串映射

Type:

dict[str, str] | None

bg_colors

背景颜色 hex 字符串映射

Type:

dict[str, str] | None

model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

status_colors: dict[str, str]
priority_colors: dict[str, str]
vba_colors: dict[int, str] | None
font_color_to_shipping: dict[int, str] | None
bg_color_to_status: dict[int, str] | None
theme_font_colors: dict[str, str] | None
font_colors: dict[str, str] | None
bg_colors: dict[str, str] | None
class certflow.config.models.NumberingConfig(*, prefix='V', format='{prefix}{year}{month}{seq:03d}{suffix}', suffixes=<factory>, auto_number_mode=None, suffix_rules=<factory>, no_cert_categories=<factory>, yellow_skip_enabled=False)[源代码]

基类:_StrictModel

编号规则配置模型(V2新增)

定义V2版本的自动编号生成规则.

参数:
prefix

编号前缀,默认为"V"

Type:

str

format

编号格式模板

Type:

str

suffixes

后缀映射字典

Type:

dict[str, str]

auto_number_mode

自动编号模式配置

Type:

dict[str, Any] | None

suffix_rules

后缀规则列表

Type:

list[NumberingSuffixRule]

no_cert_categories

免编号品类关键词(螺栓/密封圈等免出证铭牌件)

Type:

list[str]

yellow_skip_enabled

是否按源表黄底(65535)跳过编号(默认 False)

Type:

bool

prefix: str
format: str
suffixes: dict[str, str]
auto_number_mode: dict[str, Any] | None
suffix_rules: list[NumberingSuffixRule]
no_cert_categories: list[str]
yellow_skip_enabled: bool
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.NumberingSuffixRule(*, field=None, keywords=<factory>, suffix='', exclude=None)[源代码]

基类:_StrictModel

编号后缀规则模型(V2新增)

根据字段值或关键词匹配规则生成编号后缀.

参数:
field

用于匹配的字段名

Type:

str | None

keywords

触发该后缀的关键词列表

Type:

list[str]

suffix

匹配成功时使用的后缀字符串

Type:

str

exclude

排除的关键词列表,匹配时不生成后缀

Type:

list[str] | None

field: str | None
keywords: list[str]
suffix: str
exclude: list[str] | None
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.DuplicateCheckConfig(*, fields=<factory>)[源代码]

基类:_StrictModel

重复检查配置模型(V2新增)

定义数据重复检查的字段列表.

参数:

fields (list[str])

fields

用于重复检查的字段名列表

Type:

list[str]

fields: list[str]
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.UniqueKeyConfig(*, separator='|', date_to_serial=True, fields=<factory>, key_field_fallbacks=None, tiers=None, require_numbered=False)[源代码]

基类:_StrictModel

唯一标识规则配置模型(V2新增)

定义唯一键的生成规则.

参数:
separator

字段值连接符,默认为"|"

Type:

str

date_to_serial

是否将日期转换为序列号,默认为True

Type:

bool

fields

构成唯一键的字段列表(V2 旧格式,兼容保留)

Type:

list[UniqueKeyField]

key_field_fallbacks

唯一键字段的回退映射

Type:

dict[str, list[str]] | None

tiers

去重身份键分层字段(§9 落地待办①,单一真相源)

Type:

dict[str, UniqueKeyTier] | None

require_numbered

仅匹配已编号行才判重(565 行语义,§9 待办①)

Type:

bool

separator: str
date_to_serial: bool
fields: list[UniqueKeyField]
key_field_fallbacks: dict[str, list[str]] | None
tiers: dict[str, UniqueKeyTier] | None
require_numbered: bool
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.UniqueKeyField(*, name, required=False)[源代码]

基类:_StrictModel

唯一键字段模型(V2新增)

定义构成唯一键的字段及其约束.

参数:
name

字段名称

Type:

str

required

该字段是否为必填,默认为False

Type:

bool

name: str
required: bool
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.PriorityRulesConfig(*, high_threshold=10000, medium_threshold=5000, high_label='高', medium_label='中', low_label='低', high_color='#e74c3c', medium_color='#f39c12', low_color='#27ae60')[源代码]

基类:_StrictModel

优先级规则配置模型(V2新增)

定义基于金额的优先级判定规则和颜色.

参数:
  • high_threshold (int)

  • medium_threshold (int)

  • high_label (str)

  • medium_label (str)

  • low_label (str)

  • high_color (str)

  • medium_color (str)

  • low_color (str)

high_threshold

高优先级阈值,金额大于此值为高优先级,默认为10000

Type:

int

medium_threshold

中优先级阈值,金额大于此值为中优先级,默认为5000

Type:

int

high_label

高优先级标签,默认为"高"

Type:

str

medium_label

中优先级标签,默认为"中"

Type:

str

low_label

低优先级标签,默认为"低"

Type:

str

high_color

高优先级颜色(十六进制),默认为"#e74c3c"

Type:

str

medium_color

中优先级颜色(十六进制),默认为"#f39c12"

Type:

str

low_color

低优先级颜色(十六进制),默认为"#27ae60"

Type:

str

high_threshold: int
medium_threshold: int
high_label: str
medium_label: str
low_label: str
high_color: str
medium_color: str
low_color: str
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.ExportConfig(*, hyperlink_column=44, hyperlink_ref_prefix='AR', hyperlink_width=20, summary=None, access=None)[源代码]

基类:_StrictModel

导出配置模型(V2新增)

定义数据导出的格式和行为.

参数:
  • hyperlink_column (int)

  • hyperlink_ref_prefix (str)

  • hyperlink_width (int)

  • summary (dict[str, Any] | None)

  • access (ExportAccessConfig | None)

超链接所在列号(从1开始),默认为44

Type:

int

超链接引用前缀,默认为"AR"

Type:

str

超链接列宽度,默认为20字符

Type:

int

summary

汇总导出配置

Type:

dict[str, Any] | None

access

Access 导出开关(export.access.enabled)

Type:

ExportAccessConfig | None

model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

hyperlink_column: int
hyperlink_ref_prefix: str
hyperlink_width: int
summary: dict[str, Any] | None
access: ExportAccessConfig | None
class certflow.config.models.SalesImporterConfig(*, field_mapping=<factory>, color_columns=None, selection_info_columns=None)[源代码]

基类:_StrictModel

销售计划导入器配置模型(V2新增)

定义销售计划Excel导入的字段映射和颜色列配置.

参数:
field_mapping

字段映射字典,键为Excel列名,值为数据字段名

Type:

dict[str, str]

color_columns

颜色列配置

Type:

dict[str, Any] | None

selection_info_columns

选择信息列列表

Type:

list[str] | None

field_mapping: dict[str, str]
color_columns: dict[str, Any] | None
selection_info_columns: list[str] | None
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.VBAImportConfig(*, sales_plan_files=None, qualified_list=None, field_mapping=<factory>, color_mapping=None, duplicate_check_fields=None)[源代码]

基类:_StrictModel

VBA导入逻辑配置模型(V2新增)

定义VBA导入功能的文件路径、字段映射和重复检查规则.

参数:
sales_plan_files

销售计划文件路径映射

Type:

dict[str, str] | None

qualified_list

合格清单文件路径映射

Type:

dict[str, str] | None

field_mapping

字段映射字典

Type:

dict[str, str]

color_mapping

颜色映射配置

Type:

dict[str, Any] | None

duplicate_check_fields

重复检查字段列表

Type:

list[str] | None

sales_plan_files: dict[str, str] | None
qualified_list: dict[str, str] | None
field_mapping: dict[str, str]
color_mapping: dict[str, Any] | None
duplicate_check_fields: list[str] | None
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.PrintLayoutConfig(*, label_x=3, value_x=20, start_y=22, line_spacing=6.5, font_size=9, x_offset=14, y_offset=0)[源代码]

基类:_StrictModel

打印布局配置模型

定义打印坐标、偏移和字体大小.

参数:
label_x

标签 X 坐标

Type:

float

value_x

值 X 坐标

Type:

float

start_y

起始 Y 坐标

Type:

float

line_spacing

行间距

Type:

float

font_size

字体大小

Type:

float

x_offset

打印机物理偏移修正 (mm)

Type:

float

y_offset

打印机物理偏移修正 (mm)

Type:

float

label_x: float
value_x: float
start_y: float
line_spacing: float
font_size: float
x_offset: float
y_offset: float
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.PrintFontConfig(*, name='SimSun', weight=400)[源代码]

基类:_StrictModel

打印字体配置模型

参数:
name

字体名称

Type:

str

weight

字体粗细

Type:

int

name: str
weight: int
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.PrintFieldConfig(*, label, key, offset=0)[源代码]

基类:_StrictModel

打印字段配置模型

参数:
label

字段标签

Type:

str

key

字段键名

Type:

str

offset

偏移量

Type:

int

label: str
key: str
offset: int
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.TestReportConfig(*, company_name='', form_code='')[源代码]

基类:_StrictModel

试压报告配置模型(V2新增)

定义试压报告的相关配置.

参数:
  • company_name (str)

  • form_code (str)

company_name

公司名称

Type:

str

form_code

表单代码

Type:

str

company_name: str
form_code: str
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.PrinterConfig(*, default='')[源代码]

基类:_StrictModel

打印机配置模型(V2新增)

定义默认打印机设置.

参数:

default (str)

default

默认打印机名称

Type:

str

default: str
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.EnvironmentConfig(*, computer_name='${COMPUTERNAME:Unknown}', username='${USERNAME:Unknown}')[源代码]

基类:_StrictModel

环境信息配置模型(V2新增)

定义运行时环境信息,支持环境变量替换.

参数:
  • computer_name (str)

  • username (str)

computer_name

计算机名称,支持${COMPUTERNAME:Unknown}语法

Type:

str

username

用户名,支持${USERNAME:Unknown}语法

Type:

str

computer_name: str
username: str
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.ColorsConfig(*, yellow=65535, blue=16711680, red=255, green=65280, light_blue=15773696)[源代码]

基类:_StrictModel

颜色常量值配置模型(V2新增)

定义VBA中使用的颜色常量值.

参数:
yellow

黄色的RGB整数值,默认为65535

Type:

int

blue

蓝色的RGB整数值,默认为16711680

Type:

int

red

红色的RGB整数值,默认为255

Type:

int

green

绿色的RGB整数值,默认为65280

Type:

int

light_blue

浅蓝色的RGB整数值,默认为15773696

Type:

int

yellow: int
blue: int
red: int
green: int
light_blue: int
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.ImportMappingConfig(*, preprocessor=None, column_mapping=None, default_values=None)[源代码]

基类:_StrictModel

数据导入列映射配置模型(V2新增)

定义Excel导入时的预处理、列映射和默认值.

参数:
preprocessor

预处理器配置

Type:

dict[str, Any] | None

column_mapping

列映射规则列表

Type:

list[dict[str, Any]] | None

default_values

默认值映射

Type:

dict[str, str] | None

preprocessor: dict[str, Any] | None
column_mapping: list[dict[str, Any]] | None
default_values: dict[str, str] | None
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.GroupingConfig(*, group_keys=<factory>, group_keys_no_project=<factory>, numbering=<factory>)[源代码]

基类:_StrictModel

分组配置(V3新增)

第一层分组:按业务键分组,生成组内序号

参数:
group_keys: list[str]
group_keys_no_project: list[str]
numbering: GroupingNumberingConfig
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.GroupingNumberingConfig(*, use_global_prefix=True, prefix_format='G{:03d}', seq_format='{:03d}', separator='-', full_seq_field='group_seq', group_index_field='_group_index', group_key_field='_group_key')[源代码]

基类:_StrictModel

分组序号配置

参数:
  • use_global_prefix (bool)

  • prefix_format (str)

  • seq_format (str)

  • separator (str)

  • full_seq_field (str)

  • group_index_field (str)

  • group_key_field (str)

use_global_prefix: bool
prefix_format: str
seq_format: str
separator: str
full_seq_field: str
group_index_field: str
group_key_field: str
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.SortingConfig(*, keys=<factory>)[源代码]

基类:_StrictModel

排序配置(V3新增)

第二层排序:组内按产品键排序

参数:

keys (list[SortingKey])

keys: list[SortingKey]
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.SortingKey(*, field, order='asc')[源代码]

基类:_StrictModel

排序键配置(V3新增)

参数:
field: str
order: str
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.CompletedOrdersBackfillConfig(*, file_path='temp/excel/已完成工单【202601--202612】.xlsx', match_field='生产令号', source_field='供货类型', db_match_field='production_order_no', db_target_field='supply_type', overwrite_existing=False, backup_before_update=True, backup_suffix='_before_supply_type_backfill')[源代码]

基类:_StrictModel

已完成工单回填配置模型

定义从"已完成工单"Excel的月份工作表中读取"供货类型"字段并回填到数据库的规则。

核心设计:

  • 只处理月份工作表(2026-01~2026-12)

  • 按字段名称(列标题)匹配,不依赖列号/列字母

  • 通过 production_order_no 匹配(同一生产令号所有记录回填相同值)

参数:
  • file_path (str)

  • match_field (str)

  • source_field (str)

  • db_match_field (str)

  • db_target_field (str)

  • overwrite_existing (bool)

  • backup_before_update (bool)

  • backup_suffix (str)

file_path: str
match_field: str
source_field: str
db_match_field: str
db_target_field: str
overwrite_existing: bool
backup_before_update: bool
backup_suffix: str
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.ProductionStatusConfig(*, values=<factory>, default='待生产', ui_labels=None, transitions=None, auto_upgrade=None, inference_rules=None, query_keywords=None, ui=None, context_menu=None, shipped_actions=None)[源代码]

基类:_StrictModel

生产状态配置模型

所有状态值、图标、流转规则、自动升级规则均由此模型定义, 新增状态只需修改 config.yaml,无需改动任何代码.

参数:
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

values: list[str]
default: str
ui_labels: dict[str, ProductionStatusUILabel] | None
transitions: dict[str, list[str]] | None
auto_upgrade: list[ProductionStatusAutoUpgradeRule] | None
inference_rules: list[ProductionStatusInferenceRule] | None
query_keywords: dict[str, str] | None
ui: ProductionStatusUIConfig | None
context_menu: ProductionStatusContextMenu | None
shipped_actions: dict[str, Any] | None
class certflow.config.models.ProductionStatusUILabel(*, icon='', label='')[源代码]

基类:_StrictModel

生产状态 UI 标签模型

参数:
icon: str
label: str
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.ProductionStatusAutoUpgradeRule(*, condition, set_to=None, set_all_docs_done=None)[源代码]

基类:_StrictModel

自动升级规则模型

定义文档完成后自动升级生产状态的规则,按顺序匹配,命中即停止. condition 是 Python 表达式,可用变量: progress_percent, is_ready_to_ship, production_status.

参数:
  • condition (str)

  • set_to (str | None)

  • set_all_docs_done (bool | None)

condition: str
set_to: str | None
set_all_docs_done: bool | None
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.ProductionStatusInferenceRule(*, patterns, set_to)[源代码]

基类:_StrictModel

状态推断规则模型

从 execution_status 自由文本中通过正则匹配推断生产状态.

参数:
patterns: list[str]
set_to: str
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.ProductionStatusUIConfig(*, show_raw_execution_tooltip=True, show_icon_for_inferred=True, inferred_icon='📋')[源代码]

基类:_StrictModel

生产状态 UI 显示配置

参数:
  • show_raw_execution_tooltip (bool)

  • show_icon_for_inferred (bool)

  • inferred_icon (str)

show_raw_execution_tooltip: bool
show_icon_for_inferred: bool
inferred_icon: str
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.ProductionStatusContextMenu(*, view_raw_execution=None)[源代码]

基类:_StrictModel

生产状态右键菜单配置

参数:

view_raw_execution (dict[str, Any] | None)

view_raw_execution: dict[str, Any] | None
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.IdGeneratorConfig(*, empty_marker_prefix='【空白', new_data_fields=<factory>, old_data_fields=<factory>)[源代码]

基类:_StrictModel

唯一键生成策略配置模型

定义用于生成数据记录唯一键的字段组合和空值标记前缀.

参数:
empty_marker_prefix: str
new_data_fields: list[str]
old_data_fields: list[str]
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.ImportConfig(*, default_strategy='smart', auto_save=True, views=None)[源代码]

基类:_StrictModel

导入配置模型(与 QueryView 风格一致)

参数:
default_strategy: str
auto_save: bool
views: dict[str, ImportViewConfig] | None
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.ImportViewConfig(*, name='', icon='', required_fields=<factory>, columns=None)[源代码]

基类:_StrictModel

导入视图配置模型

参数:
name: str
icon: str
required_fields: list[str]
columns: list[ImportColumnConfig] | None
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.ImportColumnConfig(*, field, label, type=None, required=False)[源代码]

基类:_StrictModel

导入列配置模型

参数:
field: str
label: str
type: str | None
required: bool
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.ImportPlaceholderConfig(*, create_placeholder_dirs=False, skip_confirm_when_no_conflict=True)[源代码]

基类:_StrictModel

导入期占位目录配置(B0-4 — 批次0 B-CreateDIR/F 已定稿)

决策(2026-07-14):测试期整表批量导入会在测试机泛滥生成大量空订单目录, 故改为配置驱动开关、默认关闭。

参数:
  • create_placeholder_dirs (bool)

  • skip_confirm_when_no_conflict (bool)

create_placeholder_dirs

是否恢复 VBA 式导入期按订单组预建占位项目文件夹。 False(默认):导入只写 SQLite,绝不碰磁盘;下游写文件时由写端 os.makedirs(parents=True, exist_ok=True) 惰性建目录。 True:导入期按订单组(计划日期+订货单位+项目名称)预建空项目资料文件夹, 命名统一沿用 paths.report_archive.folder 的 pattern/tokens/兜底文本。

Type:

bool

model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

create_placeholder_dirs: bool
skip_confirm_when_no_conflict: bool
class certflow.config.models.PrintConfig[源代码]

基类:_StrictModel

打印引擎配置模型(合并后)

注意:与 certflow.config.print_config.RuntimePrintConfig``(运行时聚合类)同名, 本类为 pydantic 引擎配置模型,仅描述 ``print 段结构。

engine: str
default_printer: str
default_copies: int
default_template: str
escp: PrintEscpConfig | None
paper: dict[str, float] | None
layout: PrintLayoutConfig | None
font: PrintFontConfig | None
batch: PrintBatchConfig | None
print_fields: list[PrintFieldConfig] | None
preview: PrintPreviewConfig | None
guard: PrintGuardConfig | None
raw_capture: PrintRawCaptureConfig | None
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.PrintEscpConfig(*, x_offset=14, y_offset=0)[源代码]

基类:_StrictModel

ESC/P-K 打印配置

参数:
x_offset: float
y_offset: float
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.SyncConfig(*, webdav=None)[源代码]

基类:_StrictModel

数据库同步配置模型

参数:

webdav (SyncWebdavConfig | None)

webdav: SyncWebdavConfig | None
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.SyncWebdavConfig(*, url='', username='', password='', remote_path='/certflow.db')[源代码]

基类:_StrictModel

WebDAV 同步配置

参数:
url: str
username: str
password: str
remote_path: str
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.BackgroundConfig(*, show_in_preview=True, opacity=0.3, image_path='')[源代码]

基类:_StrictModel

底板预览配置模型

参数:
show_in_preview: bool
opacity: float
image_path: str
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.SalesPlanFillConfig(*, columns=None)[源代码]

基类:_StrictModel

销售计划批量填充配置模型

参数:

columns (list[SalesPlanFillColumn] | None)

columns: list[SalesPlanFillColumn] | None
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.SalesPlanFillColumn(*, name)[源代码]

基类:_StrictModel

销售计划填充列配置

参数:

name (str)

name: str
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.ExportDebugConfig(*, fields=None)[源代码]

基类:_StrictModel

导出调试配置模型

参数:

fields (list[ExportDebugField] | None)

fields: list[ExportDebugField] | None
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.ExportDebugField(*, field, use_fallback=False)[源代码]

基类:_StrictModel

导出调试字段配置

参数:
field: str
use_fallback: bool
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.FieldFillRule(*, source='auto', pattern='', transforms=None)[源代码]

基类:_StrictModel

单条字段填充规则

参数:
source: str
pattern: str
transforms: dict[str, FieldFillTransform] | None
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.FieldFillTransform(*, field='', transform='')[源代码]

基类:_StrictModel

字段填充转换规则

参数:
field: str
transform: str
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.PrintLogEmptyMarkersConfig(*, customer='【空白订货单位】', project_name='【空白项目名称】', product_name='【空白产品名称】', product_model='【空白产品型号】', dn='空白公称通径', pn='空白公称压力', medium='【空白适用介质】', temperature='【空白适用温度】', body_material='【未录入阀体材质】', stem_material='【未录入阀杆材质】', disc_material='【未录入启闭件材质】', tech_requirements='【空白技术要求】', equipment_no='【空白设备位号】', sub_project='【空白子项目】', sales_sn='【空白销售部产品编号】', category='【空白销售部种类】', weight='【空白销售部重量要求】', seq_no='【空白序号】', requisition_no='【空白营销部要货单号】', max_inlet_head='【空白】', max_boost_head='【空白】')[源代码]

基类:_StrictModel

打印日志空值默认标记配置模型

对应 VBA 将打印内容添加到Access数据库() 中的 Br(1..51) 赋值.

参数:
  • customer (str)

  • project_name (str)

  • product_name (str)

  • product_model (str)

  • dn (str)

  • pn (str)

  • medium (str)

  • temperature (str)

  • body_material (str)

  • stem_material (str)

  • disc_material (str)

  • tech_requirements (str)

  • equipment_no (str)

  • sub_project (str)

  • sales_sn (str)

  • category (str)

  • weight (str)

  • seq_no (str)

  • requisition_no (str)

  • max_inlet_head (str)

  • max_boost_head (str)

customer: str
project_name: str
product_name: str
product_model: str
dn: str
pn: str
medium: str
temperature: str
body_material: str
stem_material: str
disc_material: str
tech_requirements: str
equipment_no: str
sub_project: str
sales_sn: str
category: str
weight: str
seq_no: str
requisition_no: str
max_inlet_head: str
max_boost_head: str
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.OutputConfig(*, shared=<factory>, targets=<factory>, default_target='print', layout_groups=<factory>)[源代码]

基类:_StrictModel

统一输出总配置(output.*,驱动 OutputView)

参数:
shared: OutputSharedConfig
targets: dict[str, OutputTargetConfig]
default_target: str
layout_groups: list[LayoutGroupConfig]
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.OutputTargetConfig(*, engine='escp', controls=<factory>, run='', required_fields=<factory>, defaults=<factory>, dual_code=<factory>, options=<factory>)[源代码]

基类:_StrictModel

单个输出目标配置(output.targets.<name>)

参数:
engine: str
controls: list[str]
run: str
required_fields: list[str]
defaults: dict[str, Any]
dual_code: ScanDualCodeConfig
options: dict[str, Any]
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.HistoryBackfillConfig(*, enabled=True, source='print_logs', key=<factory>, fallback_fields=<factory>)[源代码]

基类:_StrictModel

历史回填兜底配置(output.shared.history_backfill,§11.2)

参数:
enabled: bool
source: str
key: list[str]
fallback_fields: list[str]
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class certflow.config.models.OutputSharedConfig(*, guard_ref='print.guard', history_backfill=<factory>)[源代码]

基类:_StrictModel

统一输出共享配置(output.shared)

参数:
guard_ref: str
history_backfill: HistoryBackfillConfig
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].