Browse Source

12月29日晚更新

张世豪 3 weeks ago
parent
commit
0e9099da98
3 changed files with 48 additions and 48 deletions
  1. 22 22
      partReport.py
  2. 4 4
      report.py
  3. 22 22
      rongzhong.py

+ 22 - 22
partReport.py

@@ -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 = """

+ 4 - 4
report.py

@@ -103,14 +103,14 @@ def getInteractiveImg(x,y,label,x1,y1,label1,x2,y2,label2,url,name,xLabel,YLabel
     if len(x1) > 0 and len(y1) > 0:
         fig.add_trace(go.Scatter(x=x1, y=y1, mode='markers', name=label1, text=numArr.to_numpy(),
                                  marker=dict(
-                                    size=10,        # 点的大小
+                                    size=4,        # 点的大小
                                     color='red',    # 点的颜色
                                     symbol='hourglass'
                                 )))
     if len(x2) > 0 and len(y2) > 0:
         fig.add_trace(go.Scatter(x=x2, y=y2, mode='markers', name=label2, text=numArr.to_numpy(),
                                 marker=dict(
-                                    size=10,        # 点的大小
+                                    size=4,        # 点的大小
                                     color='green',    # 点的颜色
                                     symbol='triangle-up'  # 点的形状,这里设置为正方形
                                 )))
@@ -753,7 +753,7 @@ def getNAndC(data, url):
         text=data['原样品编号'].to_numpy(),
         mode='markers', name='有机质与全氮',
         marker=dict(
-            size=10,  # 点的大小
+            size=4,  # 点的大小
             color='blue',  # 点的颜色
         ))
     )
@@ -980,7 +980,7 @@ def manyTypes(data,url):
         text=data['原样品编号'].to_numpy(),
         mode='markers', name='全盐量与电导率相关关系',
         marker=dict(
-            size=10,  # 点的大小
+            size=4,  # 点的大小
             color='blue',  # 点的颜色
         ))
     )

+ 22 - 22
rongzhong.py

@@ -834,8 +834,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['编号']
@@ -968,28 +968,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')
     doc.add_heading('三、数据合理性审核', level=1)
     doc.add_heading('1、阈值法审核', level=2)
     # 插入表格