This commit is contained in:
512song committed 2025-11-26 15:29:09 +08:00
1 parent aff0303bc9
commit d41474d9f1
6 files changed
+662 -1607

No files matched your search

@@ -90,15 +90,15 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 1,
"id": "cac3736a-56da-403b-9e62-5caaf989a6d4",
"metadata": {
"execution": {
"iopub.execute_input": "2025-11-21T02:48:24.228686Z",
"iopub.status.busy": "2025-11-21T02:48:24.228035Z",
"iopub.status.idle": "2025-11-21T02:48:26.022844Z",
"shell.execute_reply": "2025-11-21T02:48:26.022393Z",
"shell.execute_reply.started": "2025-11-21T02:48:24.228627Z"
"iopub.execute_input": "2025-11-26T02:10:09.280736Z",
"iopub.status.busy": "2025-11-26T02:10:09.280206Z",
"iopub.status.idle": "2025-11-26T02:10:11.865840Z",
"shell.execute_reply": "2025-11-26T02:10:11.865214Z",
"shell.execute_reply.started": "2025-11-26T02:10:09.280687Z"
}
},
"outputs": [
@@ -106,7 +106,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"96 ok\n"
"118 ok\n"
]
}
],
@@ -201,17 +201,25 @@
"print(len(re_ta))"
]
},
{
"cell_type": "markdown",
"id": "e75065f5-127e-49c9-bc1f-c0843ab1996b",
"metadata": {},
"source": [
"## 获取人员测试成绩(202511)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 2,
"id": "925f7152-b365-4df8-8d98-73569aef68f8",
"metadata": {
"execution": {
"iopub.execute_input": "2025-11-21T02:51:03.993610Z",
"iopub.status.busy": "2025-11-21T02:51:03.993034Z",
"iopub.status.idle": "2025-11-21T02:51:04.009834Z",
"shell.execute_reply": "2025-11-21T02:51:04.008842Z",
"shell.execute_reply.started": "2025-11-21T02:51:03.993560Z"
"iopub.execute_input": "2025-11-26T02:14:20.866292Z",
"iopub.status.busy": "2025-11-26T02:14:20.865663Z",
"iopub.status.idle": "2025-11-26T02:14:20.885592Z",
"shell.execute_reply": "2025-11-26T02:14:20.884489Z",
"shell.execute_reply.started": "2025-11-26T02:14:20.866240Z"
}
},
"outputs": [
@@ -219,7 +227,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"48\n"
"59\n"
]
}
],
@@ -233,7 +241,7 @@
"filename = 'data/新疆油田采油工艺研究院-202511.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"filename = 'data/marks_20251121-1.csv'\n",
"filename = 'data/marks_20251126.csv'\n",
"re_ta = My.get_result(filename,dict1)\n",
"\n",
"\n",
@@ -311,15 +319,15 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 3,
"id": "0e71f6b8-e17e-49f8-a577-7a2eb6f5e994",
"metadata": {
"execution": {
"iopub.execute_input": "2025-11-21T02:54:29.164196Z",
"iopub.status.busy": "2025-11-21T02:54:29.163638Z",
"iopub.status.idle": "2025-11-21T02:54:29.182035Z",
"shell.execute_reply": "2025-11-21T02:54:29.181011Z",
"shell.execute_reply.started": "2025-11-21T02:54:29.164147Z"
"iopub.execute_input": "2025-11-26T02:14:31.777686Z",
"iopub.status.busy": "2025-11-26T02:14:31.776942Z",
"iopub.status.idle": "2025-11-26T02:14:31.796905Z",
"shell.execute_reply": "2025-11-26T02:14:31.796178Z",
"shell.execute_reply.started": "2025-11-26T02:14:31.777614Z"
}
},
"outputs": [
@@ -688,15 +696,15 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 4,
"id": "83872322-129c-410d-a9a3-ef6f4fe8dcde",
"metadata": {
"execution": {
"iopub.execute_input": "2025-11-21T02:53:17.422865Z",
"iopub.status.busy": "2025-11-21T02:53:17.422300Z",
"iopub.status.idle": "2025-11-21T02:53:17.441843Z",
"shell.execute_reply": "2025-11-21T02:53:17.441201Z",
"shell.execute_reply.started": "2025-11-21T02:53:17.422814Z"
"iopub.execute_input": "2025-11-26T02:15:53.506585Z",
"iopub.status.busy": "2025-11-26T02:15:53.506045Z",
"iopub.status.idle": "2025-11-26T02:15:53.538569Z",
"shell.execute_reply": "2025-11-26T02:15:53.537485Z",
"shell.execute_reply.started": "2025-11-26T02:15:53.506536Z"
}
},
"outputs": [
@@ -704,7 +712,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"48\n"
"59\n"
]
}
],
@@ -716,7 +724,7 @@
"from datetime import date\n",
"\n",
"list1 = []\n",
"filename = 'data/sql_20251121.csv'\n",
"filename = 'data/sql_20251126.csv'\n",
"with open(filename,'r',newline='') as csv_file:\n",
" fl = csv.reader(csv_file,delimiter=',')\n",
" header = next(fl) \n",
@@ -847,15 +855,15 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 18,
"id": "694ad38e-755e-4885-94a9-c157ddc96564",
"metadata": {
"execution": {
"iopub.execute_input": "2025-11-21T02:55:17.019680Z",
"iopub.status.busy": "2025-11-21T02:55:17.019091Z",
"iopub.status.idle": "2025-11-21T02:55:45.001413Z",
"shell.execute_reply": "2025-11-21T02:55:45.000749Z",
"shell.execute_reply.started": "2025-11-21T02:55:17.019625Z"
"iopub.execute_input": "2025-11-24T11:08:24.326077Z",
"iopub.status.busy": "2025-11-24T11:08:24.325551Z",
"iopub.status.idle": "2025-11-24T11:08:55.094267Z",
"shell.execute_reply": "2025-11-24T11:08:55.093154Z",
"shell.execute_reply.started": "2025-11-24T11:08:24.326028Z"
}
},
"outputs": [
@@ -863,7 +871,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"48\n"
"53\n"
]
}
],
@@ -929,6 +937,90 @@
"print(i)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "28790176-7666-4b2d-83a5-9207cb8ad757",
"metadata": {
"execution": {
"iopub.execute_input": "2025-11-26T02:19:09.568448Z",
"iopub.status.busy": "2025-11-26T02:19:09.567632Z",
"iopub.status.idle": "2025-11-26T02:19:13.217423Z",
"shell.execute_reply": "2025-11-26T02:19:13.216897Z",
"shell.execute_reply.started": "2025-11-26T02:19:09.568384Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"6\n"
]
}
],
"source": [
"import requests\n",
"import json\n",
"import openpyxl\n",
"\n",
"\n",
"headers = {\n",
" \"Content-Type\": \"application/json; charset=UTF-8\"\n",
" }\n",
"filename = 'data/result_新疆油田采油工艺研究院2511.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"\n",
"file_path ='./新疆油田采油工艺研究院2511/'\n",
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','bmi']\n",
"i=0\n",
"list2 = ['148','149','150','151','152','153']\n",
"for k, v in dict1.items():\n",
" if k in list2:\n",
" list1 = []\n",
" mydata = {}\n",
" \n",
" id = str(k).rjust(4,\"0\")\n",
" mydata['path'] = file_path+id+'-'+ v['name']+'.pdf'\n",
" mydata['title'] = '新疆油田采油工艺研究院'\n",
" mydata['subtitle'] = v['unit']\n",
" mydata['id'] = id\n",
" mydata['name'] = v['name']\n",
" if v['sex'] == '男':\n",
" mydata['gender'] = 'male'\n",
" else:\n",
" mydata['gender'] = 'female'\n",
" \n",
" mydata['month'] = v['month']\n",
" mydata['fits'] = {}\n",
" survey_list = ['tcm','psy57','spine']\n",
" for item in survey_list:\n",
" if item in v.keys():\n",
" mydata.setdefault('surveys',{})\n",
" mydata['surveys'][item] = v[item]\n",
" \n",
" \n",
" #mydata['fits'] = {}\n",
" for item in list_item:\n",
" if item in v.keys():\n",
" mydata.setdefault('fits',{})\n",
" if item in ['lung','pushup','step','situp']:\n",
" mark = v[item]['成绩'].split()[0].split('.')[0]\n",
" else:\n",
" mark = v[item]['成绩'].split()[0]\n",
" mydata['fits'][item] = {'mark':mark,'score':v[item]['score']}\n",
" #if len(mydata['fits']) >2 or len(mydata['surveys']) >0:\n",
" if len(mydata['fits']) >2 : \n",
" list1.append(mydata)\n",
" i+=1\n",
" x = requests.post('http://localhost:3003', data = json.dumps(list1), headers=headers)\n",
" #print(id,v['name'],x.text)\n",
" #print(mydata)\n",
" #x.close()\n",
"print(i)"
]
},
{
"cell_type": "markdown",
"id": "ffb6c02a-8ae1-4332-96ca-ce541bfbf0be",