update 报告生成流程bug

This commit is contained in:
彭森 2022-01-11 14:15:26 +08:00
parent 47da6b991c
commit 5cf36c8ad4
2 changed files with 4 additions and 8 deletions

View File

@ -83,8 +83,6 @@ class ReportGenerator:
def __init__(self, **kwargs): def __init__(self, **kwargs):
# 文本数据 # 文本数据
self.text_model = kwargs['text_model'] self.text_model = kwargs['text_model']
# from static.test.test_data import demo
# self.model = demo
# 调用模板在临时报告文件夹中创建指定名称的PDF文档 # 调用模板在临时报告文件夹中创建指定名称的PDF文档
self.doc = MyDocTemplate(gen_pdf_path(name=kwargs['name'])) self.doc = MyDocTemplate(gen_pdf_path(name=kwargs['name']))
# 内容框 # 内容框

View File

@ -52,12 +52,10 @@ def handle_manufacturing_content(param1, param2):
elif section == '资质荣誉': elif section == '资质荣誉':
# 如果资质荣誉无数据只显示第三段,有数据则删除第三段 # 如果资质荣誉无数据只显示第三段,有数据则删除第三段
if len(report_data[num][p_value][section]) == 1: if len(report_data[num][p_value][section]) == 1:
del report_content[num]['章节内容'][c_num]['小节内容'][0] report_content[num]['章节内容'][c_num]['小节内容'] = list()
del report_content[num]['章节内容'][c_num]['小节内容'][1] insert_dict = dict()
del report_content[num]['章节内容'][c_num]['小节内容'][2] insert_dict['段落'] = '经查询,公司无技术、产品品质或品牌等方面的荣誉资质。'
del report_content[num]['章节内容'][c_num]['小节内容'][3] report_content[num]['章节内容'][c_num]['小节内容'].append(insert_dict)
del report_content[num]['章节内容'][c_num]['小节内容'][4]
del report_content[num]['章节内容'][c_num]['小节内容'][5]
else: else:
# 第一段数据 # 第一段数据
p_0 = report_content[num]['章节内容'][c_num]['小节内容'][0]['段落'] p_0 = report_content[num]['章节内容'][c_num]['小节内容'][0]['段落']