|
@@ -349,7 +349,7 @@ def checkData(fileUrl):
|
|
resData = resData.reset_index(drop=True)
|
|
resData = resData.reset_index(drop=True)
|
|
resData['审核结果'] = table_1_res['审核结果']
|
|
resData['审核结果'] = table_1_res['审核结果']
|
|
global table_1_data
|
|
global table_1_data
|
|
- table_1_data_res = resData[resData['土壤质地'] != resData['土壤类型(判断)']]
|
|
|
|
|
|
+ table_1_data_res = resData[resData['土壤质地'] != resData['土壤质地(判断)']]
|
|
table_1_data = resData
|
|
table_1_data = resData
|
|
# 提取异常指标数据
|
|
# 提取异常指标数据
|
|
global table_1_index
|
|
global table_1_index
|
|
@@ -361,8 +361,8 @@ def checkData(fileUrl):
|
|
'原因': table_1_res['审核结果']
|
|
'原因': table_1_res['审核结果']
|
|
})
|
|
})
|
|
# 这里数据直接使用即可(土壤质地填报)todo
|
|
# 这里数据直接使用即可(土壤质地填报)todo
|
|
- del resData['土壤类型(判断)']
|
|
|
|
- resData.insert(loc=6, column='土壤类型(判断)', value=table_1_res['土壤类型(判断)'])
|
|
|
|
|
|
+ del resData['土壤质地(判断)']
|
|
|
|
+ resData.insert(loc=6, column='土壤质地(判断)', value=table_1_res['土壤质地(判断)'])
|
|
global resData_1_Style
|
|
global resData_1_Style
|
|
resData_1_Style = resData.style.apply(highlight_condition,axis=1)
|
|
resData_1_Style = resData.style.apply(highlight_condition,axis=1)
|
|
# 表2--------------------------表2 土壤容重与机械组成总体数据频度分析----------------------------------------
|
|
# 表2--------------------------表2 土壤容重与机械组成总体数据频度分析----------------------------------------
|
|
@@ -644,7 +644,7 @@ def checkData(fileUrl):
|
|
print("Excel 文件为空。")
|
|
print("Excel 文件为空。")
|
|
except Exception as err:
|
|
except Exception as err:
|
|
print('审核过程中出错!', err)
|
|
print('审核过程中出错!', err)
|
|
- show_error('审核过程中出错!')
|
|
|
|
|
|
+ show_error(f'审核过程中出错!错误原因:{err}')
|
|
|
|
|
|
|
|
|
|
def makeNormalWord(url):
|
|
def makeNormalWord(url):
|
|
@@ -797,8 +797,8 @@ def getReport(originData,data,changeFileUrl, saveFileUrl, check_1_data,
|
|
del middData['原样品编号']
|
|
del middData['原样品编号']
|
|
check_1_data = pd.merge(check_1_data,middData, how='left', on='编号')
|
|
check_1_data = pd.merge(check_1_data,middData, how='left', on='编号')
|
|
check_1_data = check_1_data.replace(np.nan,'')
|
|
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 = pd.DataFrame({})
|
|
allNeedData['原样品编号'] = check_1_data['编号']
|
|
allNeedData['原样品编号'] = check_1_data['编号']
|
|
@@ -1598,9 +1598,9 @@ def saveFile():
|
|
imgData = nowTable_sw.dropna(subset=['有机质g/kg','总和(%)'])
|
|
imgData = nowTable_sw.dropna(subset=['有机质g/kg','总和(%)'])
|
|
if not imgData['有机质g/kg'].empty and not imgData['总和(%)'].empty:
|
|
if not imgData['有机质g/kg'].empty and not imgData['总和(%)'].empty:
|
|
getImg(imgData['有机质g/kg'],imgData['总和(%)'],mkdir_path,
|
|
getImg(imgData['有机质g/kg'],imgData['总和(%)'],mkdir_path,
|
|
- '有机质与总和相关性分析图','水稳性大团聚体数据','有机质g/kg','总和(%)',imgData['编号'],
|
|
|
|
|
|
+ '有机质与水稳总和相关性散点图','水稳性大团聚体数据','有机质g/kg','水稳总和(%)',imgData['编号'],
|
|
mkdir_path + '/水稳性大团聚体数据-' + nowTime + '.xlsx','N1')
|
|
mkdir_path + '/水稳性大团聚体数据-' + nowTime + '.xlsx','N1')
|
|
- getStatisticsImg(nowTable_sw['总和(%)'], '总和(%)', '总和(%)',
|
|
|
|
|
|
+ getStatisticsImg(nowTable_sw['总和(%)'], '水稳总和(%)', '水稳总和(%)',
|
|
mkdir_path + '/水稳性大团聚体数据-' + nowTime + '.xlsx', mkdir_path, 'B19')
|
|
mkdir_path + '/水稳性大团聚体数据-' + nowTime + '.xlsx', mkdir_path, 'B19')
|
|
getStatisticsImg(nowTable_sw['>5mm%'], '>5mm%', '>5mm%',
|
|
getStatisticsImg(nowTable_sw['>5mm%'], '>5mm%', '>5mm%',
|
|
mkdir_path + '/水稳性大团聚体数据-' + nowTime + '.xlsx', mkdir_path, 'C19')
|
|
mkdir_path + '/水稳性大团聚体数据-' + nowTime + '.xlsx', mkdir_path, 'C19')
|
|
@@ -1633,7 +1633,7 @@ def saveFile():
|
|
nowTable_sr = pd.read_excel(mkdir_path + '/土壤水溶性盐数据-' + nowTime + '.xlsx',
|
|
nowTable_sr = pd.read_excel(mkdir_path + '/土壤水溶性盐数据-' + nowTime + '.xlsx',
|
|
sheet_name='水溶性盐数据')
|
|
sheet_name='水溶性盐数据')
|
|
imgData_sr = nowTable_sr.dropna(subset=['水溶性全盐量g/kg', '电导率ms/cm'])
|
|
imgData_sr = nowTable_sr.dropna(subset=['水溶性全盐量g/kg', '电导率ms/cm'])
|
|
- getImg(imgData_sr['水溶性全盐量g/kg'],imgData_sr['电导率ms/cm'],mkdir_path,'水溶性盐电导率相关性分析图',
|
|
|
|
|
|
+ getImg(imgData_sr['水溶性全盐量g/kg'],imgData_sr['电导率ms/cm'],mkdir_path,'全盐量与电导率相关性分析图',
|
|
'水溶性盐数据', '水溶性全盐量g/kg','电导率ms/cm',
|
|
'水溶性盐数据', '水溶性全盐量g/kg','电导率ms/cm',
|
|
imgData_sr['样品编号'],mkdir_path + '/土壤水溶性盐数据-' + nowTime + '.xlsx','T1')
|
|
imgData_sr['样品编号'],mkdir_path + '/土壤水溶性盐数据-' + nowTime + '.xlsx','T1')
|
|
getStatisticsImg(nowTable_sr['水溶性全盐量g/kg'], '水溶性全盐量g/kg', '水溶性全盐量',
|
|
getStatisticsImg(nowTable_sr['水溶性全盐量g/kg'], '水溶性全盐量g/kg', '水溶性全盐量',
|