certflow.services.report_migration package¶
Submodules¶
- certflow.services.report_migration.material_provider module
- certflow.services.report_migration.report_fill_engine module
ProductRecordProductRecord.序号ProductRecord.产品名称ProductRecord.产品型号ProductRecord.规格ProductRecord.数量ProductRecord.产品编号ProductRecord.试验标准ProductRecord.壳体压力ProductRecord.壳体时间ProductRecord.上密封压力ProductRecord.上密封时间ProductRecord.密封压力ProductRecord.密封时间ProductRecord.结果ProductRecord.适用温度ProductRecord.生产令号ProductRecord.partsProductRecord.待核对明细
copy_cell_style()merge_cells_safe()copy_block_styles()ZhiBaoShuSpecZhiBaoShuSpec.nameZhiBaoShuSpec.kZhiBaoShuSpec.单条行数ZhiBaoShuSpec.page_row_countZhiBaoShuSpec.page_col_countZhiBaoShuSpec.title_rowsZhiBaoShuSpec.product_startZhiBaoShuSpec.material_header_rowsZhiBaoShuSpec.material_startZhiBaoShuSpec.footer_rowsZhiBaoShuSpec.has_materialZhiBaoShuSpec.date_rowZhiBaoShuSpec.date_colZhiBaoShuSpec.number_rowZhiBaoShuSpec.number_colZhiBaoShuSpec.number_prefixZhiBaoShuSpec.report_codeZhiBaoShuSpec.date_labelZhiBaoShuSpec.date_fmtZhiBaoShuSpec.product_row_spanZhiBaoShuSpec.product_blockZhiBaoShuSpec.caizhiZhiBaoShuSpec.product_colsZhiBaoShuSpec.product_mergesZhiBaoShuSpec.material_cols
ReportFillEngine
- certflow.services.report_migration.report_template_spec module
zhibaoshu_6hang()zhibaoshu_5hang()zhibaoshu_9hang_biaozhunhao()zhibaoshu_9hang_bianhao_biaozhun()zhibaoshu_9hang_bianhao_biaozhun_wendu()zhibaoshu_9hang()shiyan_report_zhong()shiyan_report_shao()shiyan_report_zhongwen_shao()shiyan_report_zhongying()caizhi_1hang()caizhi_2hang()caizhi_3hang()
Module contents¶
报告迁移引擎(批次4 / B4-3)。
把 VBA 的「Excel 模板 → 坐标填值 → 分页」复现为 PySide6 原生实现:
report_fill_engine:泛型填充+分页引擎(openpyxl,cell-by-cell 写值, 绕开 VBA 解合并/重合并 hack)。report_template_spec:12 套「字段→坐标」模板规格(ZhiBaoShuSpec)。material_provider:质保书材质块的可插拔解析器(阀体/阀杆/启闭件)。
本包为纯 openpyxl 实现,不依赖 PySide,可在无头环境直接测试。
下游由 certflow.services.report_output_service.ReportOutputService 接管
(双存根 xlsx+pdf、印章、VBA 同款文件夹命名、报告目录索引)。
- class certflow.services.report_migration.ReportFillEngine(provider, material_annotation=False)[源代码]¶
基类:
object- 参数:
provider (MaterialProvider)
material_annotation (bool)
- class certflow.services.report_migration.ZhiBaoShuSpec(name: 'str', k: 'int', 单条行数: 'int', page_row_count: 'int', page_col_count: 'int', title_rows: 'tuple[int, int]'=(1, 4), product_start: 'int' = 5, material_header_rows: 'tuple[int, int]'=(11, 13), material_start: 'int' = 14, footer_rows: 'tuple[int, int]'=(27, 29), has_material: 'bool' = True, date_row: 'int' = 2, date_col: 'int' = 8, number_row: 'int' = 2, number_col: 'int' = 15, number_prefix: 'str' = 'C/1 编号:', report_code: 'str' = '9.1-13', date_label: 'str' = '日期:', date_fmt: 'str' = '%Y.%m.%d', product_row_span: 'int' = 1, product_block: 'bool' = True, caizhi: 'bool' = False, product_cols: 'dict[str, int]'=<factory>, product_merges: 'dict[str, tuple[int, int]]'=<factory>, material_cols: 'dict[str, int]'=<factory>)[源代码]¶
基类:
object- 参数:
name (str)
k (int)
单条行数 (int)
page_row_count (int)
page_col_count (int)
product_start (int)
material_start (int)
has_material (bool)
date_row (int)
date_col (int)
number_row (int)
number_col (int)
number_prefix (str)
report_code (str)
date_label (str)
date_fmt (str)
product_row_span (int)
product_block (bool)
caizhi (bool)
- certflow.services.report_migration.zhibaoshu_9hang_biaozhunhao()[源代码]¶
质保书9行【只有标准号】:仅写标准号(无出厂编号列,试验标准在 col8),单号前缀 C/0。
- 返回类型:
- certflow.services.report_migration.zhibaoshu_9hang_bianhao_biaozhun()[源代码]¶
质保书9行【有编号与标准】:出厂编号(col8) + 标准号(col10),单号前缀 C/1。
- 返回类型:
- certflow.services.report_migration.zhibaoshu_9hang_bianhao_biaozhun_wendu()[源代码]¶
质保书9行【有编号与标准及温度】:出厂编号 + 标准号 + 适用温度(col12),单号前缀 C/1。
- 返回类型:
- certflow.services.report_migration.shiyan_report_zhongwen_shao()[源代码]¶
中英文试压报告模板-少:双语表头,每页 13 台,无材质块。
- 返回类型:
- certflow.services.report_migration.shiyan_report_zhongying()[源代码]¶
试压(中英):双语,每产品占 2 行(合并),每页 10 台,无材质块。
报告单号代号 8.2-20(区别于质保书/中英文试压的 9.1-13);日期格只存日期本身。
- 返回类型: