|
@@ -829,8 +829,8 @@ def getReport(originData,data,changeFileUrl, saveFileUrl, check_1_data,
|
|
|
# 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['编号']
|
|
@@ -977,28 +977,28 @@ def getReport(originData,data,changeFileUrl, saveFileUrl, check_1_data,
|
|
|
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')
|
|
|
print(6)
|
|
|
doc.add_heading('三、数据合理性审核', level=1)
|
|
|
doc.add_heading('1、阈值法审核', level=2)
|
|
@@ -1997,6 +1997,7 @@ def saveFile():
|
|
|
partReport.getConventionalNutrientIndicators(originData,dealDataRes,'常规养分指标', changeFileUrl, saveFileUrl, table_1_data, table_3_data, table_5_data,table_8_data,table_10_data,table_12_data,table_14_data)
|
|
|
partReport.getChemicalIndicators(originData,dealDataRes,'一般化学性指标', changeFileUrl, saveFileUrl, table_1_data, table_3_data, table_5_data,table_8_data,table_10_data,table_12_data,table_14_data)
|
|
|
partReport.getHeavyMetalIndicators(originData,dealDataRes,'重金属指标', changeFileUrl, saveFileUrl, table_1_data, table_3_data, table_5_data,table_8_data,table_10_data,table_12_data,table_14_data)
|
|
|
+ print("审核报告已生成!")
|
|
|
show_info('审核报告已生成!')
|
|
|
except Exception as err:
|
|
|
print('err', err)
|