20240710
This commit is contained in:
1 parent
962ba2c329
commit
daceb1e68d
4 files changed
+2588
-2276
No files matched your search
+88
-29
@@ -256,6 +256,65 @@
|
||||
"print('ok')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "ad5a702c-1503-463f-9d02-b78b881aad1b",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### 生成项目信息"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 31,
|
||||
"id": "5071c245-3fdb-4c16-8f15-998af7c1d2fe",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-07-09T02:15:58.088695Z",
|
||||
"iopub.status.busy": "2024-07-09T02:15:58.087921Z",
|
||||
"iopub.status.idle": "2024-07-09T02:15:58.100168Z",
|
||||
"shell.execute_reply": "2024-07-09T02:15:58.098962Z",
|
||||
"shell.execute_reply.started": "2024-07-09T02:15:58.088624Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"\n",
|
||||
"filename = '../item.json'\n",
|
||||
"item = {}\n",
|
||||
"unit = {}\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"for k,v in dict1.items():\n",
|
||||
" item[k] = v\n",
|
||||
" del item[k]['divisor']\n",
|
||||
"item['1']['en'] = 'lung'\n",
|
||||
"item['2']['en'] = 'grip'\n",
|
||||
"item['3']['en'] = 'flexion'\n",
|
||||
"item['4']['en'] = 'jump'\n",
|
||||
"item['5']['en'] = 'pushup'\n",
|
||||
"item['6']['en'] = 'balance'\n",
|
||||
"item['7']['en'] = 'reaction'\n",
|
||||
"item['8']['en'] = 'step'\n",
|
||||
"item['9']['en'] = 'situp'\n",
|
||||
"item['10']['en'] = 'height'\n",
|
||||
"item['11']['en'] = 'weight'\n",
|
||||
"\n",
|
||||
"filename = 'data/体质检测项目信息.json'\n",
|
||||
"with open(filename, 'w') as fl:\n",
|
||||
" json.dump(item, fl, ensure_ascii=False)\n",
|
||||
"print('ok')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "59f5708d-c2d0-4470-b2f4-b9face431865",
|
||||
@@ -372,15 +431,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"execution_count": 26,
|
||||
"id": "3e614f4a-a623-48e2-97f8-b31f62c9a983",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-06-05T08:38:54.344213Z",
|
||||
"iopub.status.busy": "2024-06-05T08:38:54.343465Z",
|
||||
"iopub.status.idle": "2024-06-05T08:38:54.410170Z",
|
||||
"shell.execute_reply": "2024-06-05T08:38:54.409619Z",
|
||||
"shell.execute_reply.started": "2024-06-05T08:38:54.344132Z"
|
||||
"iopub.execute_input": "2024-07-08T07:09:55.402103Z",
|
||||
"iopub.status.busy": "2024-07-08T07:09:55.401378Z",
|
||||
"iopub.status.idle": "2024-07-08T07:09:55.420303Z",
|
||||
"shell.execute_reply": "2024-07-08T07:09:55.419806Z",
|
||||
"shell.execute_reply.started": "2024-07-08T07:09:55.402036Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -389,8 +448,8 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"709\n",
|
||||
"709\n"
|
||||
"80\n",
|
||||
"80\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -423,11 +482,11 @@
|
||||
"re_ta = {}\n",
|
||||
"dict1 = {}\n",
|
||||
"list1 = []\n",
|
||||
"filename = 'data/中安联合.json'\n",
|
||||
"filename = 'data/湖南石化青年体质检测.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"\n",
|
||||
"filename = 'data/places_result_20240605.csv'\n",
|
||||
"filename = 'data/places_result_20240705.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
" header = next(fl) \n",
|
||||
@@ -468,7 +527,7 @@
|
||||
" score = int(result[4])/item[m_item]['divisor'] \n",
|
||||
" re_ta[user][item_name]['成绩'] = f'{score} {item[m_item][\"unit\"]}'\n",
|
||||
"print(len(re_ta))\n",
|
||||
"filename = 'data/result_中安联合.json'\n",
|
||||
"filename = 'data/result_湖南石化青年.json'\n",
|
||||
"\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(re_ta, fl, ensure_ascii=False) \n",
|
||||
@@ -485,15 +544,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 8,
|
||||
"execution_count": 27,
|
||||
"id": "141b30dc-5975-4dcb-9bc3-9b20d26a0917",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-06-05T08:39:59.079134Z",
|
||||
"iopub.status.busy": "2024-06-05T08:39:59.078630Z",
|
||||
"iopub.status.idle": "2024-06-05T08:39:59.141794Z",
|
||||
"shell.execute_reply": "2024-06-05T08:39:59.141195Z",
|
||||
"shell.execute_reply.started": "2024-06-05T08:39:59.079087Z"
|
||||
"iopub.execute_input": "2024-07-08T07:10:41.383092Z",
|
||||
"iopub.status.busy": "2024-07-08T07:10:41.382308Z",
|
||||
"iopub.status.idle": "2024-07-08T07:10:41.404375Z",
|
||||
"shell.execute_reply": "2024-07-08T07:10:41.403415Z",
|
||||
"shell.execute_reply.started": "2024-07-08T07:10:41.383013Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -603,7 +662,7 @@
|
||||
"\n",
|
||||
"#list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','height','weight']\n",
|
||||
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp']\n",
|
||||
"filename = 'data/result_中安联合.json'\n",
|
||||
"filename = 'data/result_湖南石化青年.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict2 = json.load(fl) \n",
|
||||
"for k, v in dict2.items():\n",
|
||||
@@ -624,7 +683,7 @@
|
||||
" dict2[k][item_en]['score'] = cal_score(data1)\n",
|
||||
" #print(k,v[item_en]['成绩'],cal_score(data1))\n",
|
||||
"\n",
|
||||
"filename = f'data/result_中安联合.json'\n",
|
||||
"filename = f'data/result_湖南石化青年.json'\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(dict2,fl , ensure_ascii=False) \n",
|
||||
"print('ok!') "
|
||||
@@ -787,15 +846,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 10,
|
||||
"execution_count": 28,
|
||||
"id": "b123ee6b-85d2-4660-b226-321832a6b796",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-06-05T08:52:25.451985Z",
|
||||
"iopub.status.busy": "2024-06-05T08:52:25.451119Z",
|
||||
"iopub.status.idle": "2024-06-05T08:58:26.399739Z",
|
||||
"shell.execute_reply": "2024-06-05T08:58:26.398553Z",
|
||||
"shell.execute_reply.started": "2024-06-05T08:52:25.451918Z"
|
||||
"iopub.execute_input": "2024-07-08T09:19:02.767495Z",
|
||||
"iopub.status.busy": "2024-07-08T09:19:02.766758Z",
|
||||
"iopub.status.idle": "2024-07-08T09:19:45.858591Z",
|
||||
"shell.execute_reply": "2024-07-08T09:19:45.857695Z",
|
||||
"shell.execute_reply.started": "2024-07-08T09:19:02.767428Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -804,7 +863,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"709\n"
|
||||
"80\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -817,11 +876,11 @@
|
||||
"headers = {\n",
|
||||
" \"Content-Type\": \"application/json; charset=UTF-8\"\n",
|
||||
" }\n",
|
||||
"filename = 'data/result_中安联合.json'\n",
|
||||
"filename = 'data/result_湖南石化青年.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"list1 = []\n",
|
||||
"file_path ='./中安联合/'\n",
|
||||
"file_path ='./湖南石化青年/'\n",
|
||||
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','bmi']\n",
|
||||
"i=0\n",
|
||||
"list2 = []\n",
|
||||
@@ -831,7 +890,7 @@
|
||||
" \n",
|
||||
" id = str(k).rjust(4,\"0\")\n",
|
||||
" mydata['path'] = file_path+id+'-'+ v['name']+'.pdf'\n",
|
||||
" mydata['title'] = '中安联合公司'\n",
|
||||
" mydata['title'] = '湖南石化青年职工'\n",
|
||||
" mydata['subtitle'] = v['unit']\n",
|
||||
" mydata['id'] = id\n",
|
||||
" mydata['name'] = v['name']\n",
|
||||
|
||||
Reference in new issue
Block a user