|
@@ -308,8 +308,8 @@ def getphysicsReport(originData,data,type, changeFileUrl, saveFileUrl, check_1_
|
|
|
# del middData['原样品编号']
|
|
|
# check_1_data = pd.merge(check_1_data, middData, how='left', on='编号')
|
|
|
check_1_data = check_1_data.replace(np.nan, '')
|
|
|
- typeNotSame = check_1_data[check_1_data['土壤质地'] != check_1_data['土壤质地(判断)']]
|
|
|
- table_6_data = typeNotSame[['编号', '样品编号', '土壤质地', '土壤质地(判断)']]
|
|
|
+ #typeNotSame = check_1_data[check_1_data['土壤质地'] != check_1_data['土壤质地(判断)']]
|
|
|
+ #table_6_data = typeNotSame[['编号', '样品编号', '土壤质地', '土壤质地(判断)']]
|
|
|
allNeedData = pd.DataFrame({})
|
|
|
allNeedData['原样品编号'] = check_1_data['编号']
|
|
|
getSimpleDataNumber = pd.merge(allNeedData, physicsData[['原样品编号', '样品编号']], how='left', on="原样品编号")
|
|
@@ -497,28 +497,28 @@ def getphysicsReport(originData,data,type, changeFileUrl, saveFileUrl, check_1_
|
|
|
doc.add_heading('为避免数据量过多无法显示,请至数据保存文件夹中查看数据表:数据填报项审核结果.xlsx', level=4)
|
|
|
doc.add_heading('4、土壤质地填报规范性审核', level=2)
|
|
|
# 插入表6
|
|
|
- paragraph_6 = doc.add_paragraph()
|
|
|
- paragraph_6.add_run(f'表6:{areaName}土壤质地填报审核结果表').bold = True
|
|
|
- table_6 = doc.add_table(rows=len(table_6_data) + 1, cols=4, style='Light Shading Accent 1')
|
|
|
- paragraph_6.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
|
|
- table_6.alignment = WD_TABLE_ALIGNMENT.CENTER
|
|
|
+ # paragraph_6 = doc.add_paragraph()
|
|
|
+ # paragraph_6.add_run(f'表6:{areaName}土壤质地填报审核结果表').bold = True
|
|
|
+ # table_6 = doc.add_table(rows=len(table_6_data) + 1, cols=4, style='Light Shading Accent 1')
|
|
|
+ # paragraph_6.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
|
|
+ # table_6.alignment = WD_TABLE_ALIGNMENT.CENTER
|
|
|
# 提取结果表中数据
|
|
|
# 写入数据 土壤质地类型不一致的数据提取出来
|
|
|
- for i, row in enumerate(table_6.rows):
|
|
|
- for j, cell in enumerate(row.cells):
|
|
|
- # 获取单元格中的段落对象
|
|
|
- paragraph = cell.paragraphs[0]
|
|
|
- if i == 0:
|
|
|
- r = paragraph.add_run(str(table_6_data.columns[j]))
|
|
|
- r.font.bold = True
|
|
|
- else:
|
|
|
- r = paragraph.add_run(str(table_6_data.iloc[i - 1, j]))
|
|
|
- paragraph.alignment = WD_PARAGRAPH_ALIGNMENT.CENTER
|
|
|
- paragraph.paragraph_format.alignment = WD_TABLE_ALIGNMENT.CENTER # 对齐
|
|
|
- paragraph.paragraph_format.line_spacing = 1 # 段落行间距
|
|
|
- r.font.size = Pt(10.5)
|
|
|
- r.font.name = 'Times New Roman'
|
|
|
- r.element.rPr.rFonts.set(qn('w:eastAsia'), u'仿宋_GB2312')
|
|
|
+ # for i, row in enumerate(table_6.rows):
|
|
|
+ # for j, cell in enumerate(row.cells):
|
|
|
+ # # 获取单元格中的段落对象
|
|
|
+ # paragraph = cell.paragraphs[0]
|
|
|
+ # if i == 0:
|
|
|
+ # r = paragraph.add_run(str(table_6_data.columns[j]))
|
|
|
+ # r.font.bold = True
|
|
|
+ # else:
|
|
|
+ # r = paragraph.add_run(str(table_6_data.iloc[i - 1, j]))
|
|
|
+ # paragraph.alignment = WD_PARAGRAPH_ALIGNMENT.CENTER
|
|
|
+ # paragraph.paragraph_format.alignment = WD_TABLE_ALIGNMENT.CENTER # 对齐
|
|
|
+ # paragraph.paragraph_format.line_spacing = 1 # 段落行间距
|
|
|
+ # r.font.size = Pt(10.5)
|
|
|
+ # r.font.name = 'Times New Roman'
|
|
|
+ # r.element.rPr.rFonts.set(qn('w:eastAsia'), u'仿宋_GB2312')
|
|
|
|
|
|
doc.add_heading('三、数据合理性审核', level=1)
|
|
|
long_text4 = """
|