20231018
This commit is contained in:
1 parent
61fd173804
commit
c57e374ebb
2 files changed
+97
-37
No files matched your search
+28
-34
@@ -3,7 +3,9 @@
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "19280f5c-8e34-4a64-8dfb-6353cbf597d2",
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"# 体质检测数据处理"
|
||||
]
|
||||
@@ -11,7 +13,10 @@
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "112d80f4-607b-41f9-bb30-ac2eb8f52ee2",
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jp-MarkdownHeadingCollapsed": true,
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"## 基础数据管理"
|
||||
]
|
||||
@@ -510,27 +515,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 14,
|
||||
"execution_count": null,
|
||||
"id": "f20224aa-2131-473d-a0ec-0743482ed58e",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-10-18T04:07:20.752069Z",
|
||||
"iopub.status.busy": "2023-10-18T04:07:20.751766Z",
|
||||
"iopub.status.idle": "2023-10-18T04:07:20.842528Z",
|
||||
"shell.execute_reply": "2023-10-18T04:07:20.841931Z",
|
||||
"shell.execute_reply.started": "2023-10-18T04:07:20.752043Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok!\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"\n",
|
||||
@@ -550,7 +540,7 @@
|
||||
" i = 1\n",
|
||||
" list2 = []\n",
|
||||
"dict2[p] = list2\n",
|
||||
"filename = f'报告清单.json'\n",
|
||||
"filename = f'data/报告清单.json'\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(dict2,fl , ensure_ascii=False) \n",
|
||||
"print('ok!') "
|
||||
@@ -587,38 +577,42 @@
|
||||
"list1 = []\n",
|
||||
"fiie_path ='./134/'\n",
|
||||
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','bmi']\n",
|
||||
"i=1\n",
|
||||
"i = 27\n",
|
||||
"list2 = []\n",
|
||||
"for k, v in dict1.items():\n",
|
||||
"filename = 'data/报告清单.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict2 = json.load(fl)\n",
|
||||
"print(i)\n",
|
||||
"for k in dict2[str(i)]:\n",
|
||||
" \n",
|
||||
" list1 = []\n",
|
||||
" mydata = {}\n",
|
||||
" \n",
|
||||
" id = str(k).rjust(8,\"0\")\n",
|
||||
" mydata['path'] = fiie_path+id+'-'+ v['name']+'.pdf'\n",
|
||||
" mydata['path'] = fiie_path+id+'-'+ dict1[k]['name']+'.pdf'\n",
|
||||
" mydata['title'] = '中石化(天津)石油化工\\n有限公司'\n",
|
||||
" mydata['subtitle'] = v['unit']\n",
|
||||
" mydata['subtitle'] = dict1[k]['unit']\n",
|
||||
" mydata['id'] = id\n",
|
||||
" mydata['name'] = v['name']\n",
|
||||
" mydata['name'] = dict1[k]['name']\n",
|
||||
" if v['sex'] == '男':\n",
|
||||
" mydata['gender'] = 'male'\n",
|
||||
" else:\n",
|
||||
" mydata['gender'] = 'female'\n",
|
||||
" \n",
|
||||
" mydata['month'] = v['month']\n",
|
||||
" mydata['month'] = dict1[k]['month']\n",
|
||||
" mydata['fits'] = {}\n",
|
||||
" for item in list_item:\n",
|
||||
" if item in v.keys():\n",
|
||||
" if item in dict1[k].keys():\n",
|
||||
" if item in ['lung','pushup','step','situp']:\n",
|
||||
" mark = v[item]['成绩'].split()[0].split('.')[0]\n",
|
||||
" mark = dict1[k][item]['成绩'].split()[0].split('.')[0]\n",
|
||||
" else:\n",
|
||||
" mark = v[item]['成绩'].split()[0]\n",
|
||||
" mydata['fits'][item] = {'mark':mark,'score':v[item]['score']}\n",
|
||||
" mark = dict1[k][item]['成绩'].split()[0]\n",
|
||||
" mydata['fits'][item] = {'mark':mark,'score':dict1[k][item]['score']}\n",
|
||||
" if len(mydata['fits']) >2: \n",
|
||||
" list1.append(mydata)\n",
|
||||
" list2.append([k,v['name']])\n",
|
||||
" i+=1\n",
|
||||
" x = requests.post('http://192.168.1.148:3003', data = json.dumps(list1), headers=headers)\n",
|
||||
" print(id,v['name'],x.text)\n",
|
||||
" list2.append([k,dict1[k]['name']])\n",
|
||||
" x = requests.post('http://192.168.31.163:3003', data = json.dumps(list1), headers=headers)\n",
|
||||
" print(id,dict1[k]['name'],x.text)\n",
|
||||
" #x.close()\n"
|
||||
]
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user