diff --git a/体测单位/东营石油工程设计院.ipynb b/体测单位/东营石油工程设计院.ipynb index cabfd97..4eb3e5e 100644 --- a/体测单位/东营石油工程设计院.ipynb +++ b/体测单位/东营石油工程设计院.ipynb @@ -865,7 +865,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/体测单位/东营羊庙.ipynb b/体测单位/东营羊庙.ipynb index c486c75..744c738 100644 --- a/体测单位/东营羊庙.ipynb +++ b/体测单位/东营羊庙.ipynb @@ -1404,7 +1404,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/体测单位/体质检测数据处理.ipynb b/体测单位/体质检测数据处理.ipynb index b519471..ff199a1 100644 --- a/体测单位/体质检测数据处理.ipynb +++ b/体测单位/体质检测数据处理.ipynb @@ -895,15 +895,15 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "id": "cf345bf0-f11b-459e-9b69-b2843836f6f3", "metadata": { "execution": { - "iopub.execute_input": "2023-05-19T08:30:41.861658Z", - "iopub.status.busy": "2023-05-19T08:30:41.860765Z", - "iopub.status.idle": "2023-05-19T08:30:42.006745Z", - "shell.execute_reply": "2023-05-19T08:30:42.006220Z", - "shell.execute_reply.started": "2023-05-19T08:30:41.861616Z" + "iopub.execute_input": "2023-08-29T13:51:03.280856Z", + "iopub.status.busy": "2023-08-29T13:51:03.280394Z", + "iopub.status.idle": "2023-08-29T13:51:03.399330Z", + "shell.execute_reply": "2023-08-29T13:51:03.398909Z", + "shell.execute_reply.started": "2023-08-29T13:51:03.280807Z" }, "tags": [] }, @@ -915,7 +915,7 @@ "mydb = myclient[\"baogao\"]\n", "mycol = mydb[\"place\"]\n", "\n", - "mydict = { \"id\": \"714309\",\"name\": \"中国石化石家庄炼化公司\", }\n", + "mydict = { \"id\": \"469849\",\"name\": \"长炼医院\", }\n", " \n", "x = mycol.insert_one(mydict) " ] @@ -1016,7 +1016,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/体测单位/北京农行.ipynb b/体测单位/北京农行.ipynb index ccb5918..1eaee0b 100644 --- a/体测单位/北京农行.ipynb +++ b/体测单位/北京农行.ipynb @@ -1,5 +1,13 @@ { "cells": [ + { + "cell_type": "markdown", + "id": "4626da6c-d228-4270-8d8d-c98784a106ad", + "metadata": {}, + "source": [ + "# 第一次体测" + ] + }, { "cell_type": "markdown", "id": "ba2deee7-9c63-4115-bcee-ad341175fc02", @@ -10,27 +18,12 @@ }, { "cell_type": "code", - "execution_count": 52, + "execution_count": null, "id": "dea5e486-6927-469f-aa57-e5efac4670be", "metadata": { - "execution": { - "iopub.execute_input": "2023-05-31T05:19:09.972334Z", - "iopub.status.busy": "2023-05-31T05:19:09.971473Z", - "iopub.status.idle": "2023-05-31T05:19:10.054344Z", - "shell.execute_reply": "2023-05-31T05:19:10.053621Z", - "shell.execute_reply.started": "2023-05-31T05:19:09.972292Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ok\n" - ] - } - ], + "outputs": [], "source": [ "import openpyxl\n", "import json\n", @@ -255,27 +248,12 @@ }, { "cell_type": "code", - "execution_count": 53, + "execution_count": null, "id": "c925d850-ff06-4be5-bf9f-31f4385c37c0", "metadata": { - "execution": { - "iopub.execute_input": "2023-05-31T05:19:14.796522Z", - "iopub.status.busy": "2023-05-31T05:19:14.795763Z", - "iopub.status.idle": "2023-05-31T05:19:14.859923Z", - "shell.execute_reply": "2023-05-31T05:19:14.858869Z", - "shell.execute_reply.started": "2023-05-31T05:19:14.796492Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "163\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", "import openpyxl\n", @@ -313,28 +291,12 @@ }, { "cell_type": "code", - "execution_count": 54, + "execution_count": null, "id": "a87384c6-dc46-4d09-b757-b42462ed818d", "metadata": { - "execution": { - "iopub.execute_input": "2023-05-31T05:19:18.950211Z", - "iopub.status.busy": "2023-05-31T05:19:18.949352Z", - "iopub.status.idle": "2023-05-31T05:19:18.965945Z", - "shell.execute_reply": "2023-05-31T05:19:18.964916Z", - "shell.execute_reply.started": "2023-05-31T05:19:18.950168Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "164\n", - "['659821', '079384', '876923', '387406', '694158', '563974', '628540', '281407', '798056', '274185', '705316', '571698', '693240', '650329', '481397', '610492', '250746', '619873', '675018', '619204', '984351', '279548', '027154', '856432', '296138', '290486', '218396', '973605', '269043', '653487', '528397', '031947', '370415', '872591', '018592', '251794', '718203', '869254', '408517', '071948', '536729', '259430', '867310', '285413', '805216', '405192', '630721', '386219', '504216', '418752', '402398', '231947', '850743', '901378', '394175', '431092', '157489', '961378', '305921', '620417', '352906', '629380', '417086', '086149', '804693', '342580', '310827', '637102', '128635', '346780', '325076', '643917', '710548', '046732', '762390', '350712', '368419', '342701', '245107', '087136', '023185', '759846', '346758', '514976', '570482', '781935', '210987', '340615', '075891', '810596', '430689', '920785', '815347', '917562', '295817', '765238', '058479', '674159', '567894', '109842', '851943', '703918', '073489', '403958', '578492', '798046', '502876', '943180', '498306', '835760', '726305', '490867', '709413', '275683', '256934', '721830', '973841', '729685', '021349', '265413', '321597', '064187', '136794', '708352', '710928', '657129', '962105', '905436', '513749', '257361', '420691', '941567', '839574', '906358', '218095', '364152', '562149', '109823', '560942', '293561', '194053', '509246', '026951', '243561', '093154', '654083', '519048', '459136', '914362', '605834', '508693', '823906', '349725', '572390', '541236', '419570', '513467', '724063', '164823', '890712', '529840', '641958', '678590', '648951']\n" - ] - } - ], + "outputs": [], "source": [ "import random\n", "import json\n", @@ -375,27 +337,12 @@ }, { "cell_type": "code", - "execution_count": 55, + "execution_count": null, "id": "10845b90-48b4-4418-9dac-dd4a6f0147c0", "metadata": { - "execution": { - "iopub.execute_input": "2023-05-31T05:19:22.535432Z", - "iopub.status.busy": "2023-05-31T05:19:22.534590Z", - "iopub.status.idle": "2023-05-31T05:19:22.546728Z", - "shell.execute_reply": "2023-05-31T05:19:22.545447Z", - "shell.execute_reply.started": "2023-05-31T05:19:22.535392Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "163\n" - ] - } - ], + "outputs": [], "source": [ "filename = 'data/农业银行测试手机号码.json'\n", "with open(filename,'r') as fl:\n", @@ -421,41 +368,14 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": null, "id": "62733f52-62c1-43aa-964a-232eab8b5251", "metadata": { - "execution": { - "iopub.execute_input": "2023-05-25T10:18:47.776482Z", - "iopub.status.busy": "2023-05-25T10:18:47.776048Z", - "iopub.status.idle": "2023-05-25T10:18:48.066702Z", - "shell.execute_reply": "2023-05-25T10:18:48.065832Z", - "shell.execute_reply.started": "2023-05-25T10:18:47.776444Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{\n", - " \"SendStatusSet\": [\n", - " {\n", - " \"SerialNo\": \"2640:135690281916850099280618075\",\n", - " \"PhoneNumber\": \"+8613793180751\",\n", - " \"Fee\": 1,\n", - " \"SessionContext\": \"\",\n", - " \"Code\": \"Ok\",\n", - " \"Message\": \"send success\",\n", - " \"IsoCode\": \"CN\"\n", - " }\n", - " ],\n", - " \"RequestId\": \"7601194b-56e4-45a8-9543-6fcc76ce16a6\"\n", - "}\n" - ] - } - ], + "outputs": [], "source": [ + "import json\n", "from tencentcloud.common import credential\n", "from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\n", "from tencentcloud.sms.v20210111 import sms_client, models\n", @@ -477,8 +397,8 @@ " req = models.SendSmsRequest()\n", " req.SmsSdkAppId = \"1400140089\"\n", " req.SignName = \"坤铭教育\"\n", - " req.TemplateId = \"1808914\" \n", - " req.TemplateParamSet = [\"1234\"]\n", + " req.TemplateId = \"1875765\" \n", + " req.TemplateParamSet = [\"北京石油分公司体测者\",\"01740518\"]\n", " req.PhoneNumberSet = [\"+8613793180751\"]\n", " req.SessionContext = \"\"\n", " req.ExtendCode = \"\"\n", @@ -491,27 +411,12 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": null, "id": "e924a0a9-65a5-49c4-bdf2-b9152d278ad5", "metadata": { - "execution": { - "iopub.execute_input": "2023-05-25T11:05:39.390622Z", - "iopub.status.busy": "2023-05-25T11:05:39.389793Z", - "iopub.status.idle": "2023-05-25T11:05:39.396312Z", - "shell.execute_reply": "2023-05-25T11:05:39.395239Z", - "shell.execute_reply.started": "2023-05-25T11:05:39.390580Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "send success\n" - ] - } - ], + "outputs": [], "source": [ "dict1 = json.loads(resp.to_json_string(indent=2))\n", "print(dict1['SendStatusSet'][0][\"Message\"])" @@ -527,30 +432,12 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": null, "id": "910d1881-d090-48dc-ac87-685ccaaf9553", "metadata": { - "execution": { - "iopub.execute_input": "2023-06-07T02:57:09.482569Z", - "iopub.status.busy": "2023-06-07T02:57:09.481698Z", - "iopub.status.idle": "2023-06-07T02:57:10.568979Z", - "shell.execute_reply": "2023-06-07T02:57:10.567913Z", - "shell.execute_reply.started": "2023-06-07T02:57:09.482528Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "亓宇航 send success\n", - "李伟丽 send success\n", - "高松 send success\n", - "张树伟 send success\n" - ] - } - ], + "outputs": [], "source": [ "\n", "from tencentcloud.common import credential\n", @@ -588,7 +475,7 @@ " req.SessionContext = \"\"\n", " req.ExtendCode = \"\"\n", " req.SenderId = \"\"\n", - " resp = client.SendSms(req)\n", + " #resp = client.SendSms(req)\n", " dict2 = json.loads(resp.to_json_string(indent=2))\n", "\n", " print(v['name'],dict2['SendStatusSet'][0][\"Message\"])\n", @@ -596,10 +483,308 @@ " print(v['name'],err)" ] }, + { + "cell_type": "markdown", + "id": "59d38404-e097-4f08-a3fd-565e351f09bb", + "metadata": {}, + "source": [ + "# 第二次体测" + ] + }, + { + "cell_type": "markdown", + "id": "deeb7606-5752-4337-9117-4ba9edc762e9", + "metadata": {}, + "source": [ + "## 人员信息导入" + ] + }, { "cell_type": "code", "execution_count": null, - "id": "759cad53-8745-4862-8874-cf35f13ab0b3", + "id": "d803a2b2-4a61-42ba-84a3-e9846e3e9f5c", + "metadata": {}, + "outputs": [], + "source": [ + "import openpyxl\n", + "import json\n", + "\n", + "\n", + "wb = openpyxl.load_workbook('data/北京分行员工体质检测情况表.xlsx')\n", + "sheet = wb.active\n", + "# sheets = wb.sheetnames\n", + "person = {}\n", + "\n", + "for n in range(2, sheet.max_row+1):\n", + " if sheet.cell(n,1).value is not None:\n", + " code = int(sheet.cell(n, 1).value)\n", + " person.setdefault(code, {})\n", + " dict1 = {}\n", + " dict1['name'] = sheet.cell(n, 3).value\n", + " if sheet.cell(n, 4).value ==1:\n", + " sex = '男'\n", + " else:\n", + " sex = '女'\n", + " dict1['sex'] = sex\n", + " birth = str(sheet.cell(n, 5).value).split()[0]\n", + " dict1['birth'] = birth\n", + " dict1['unit'] = sheet.cell(n, 2).value\n", + " if sheet.cell(n,6).value is not None:\n", + " dict1['phone'] = sheet.cell(n, 6).value \n", + " person[code] = dict1\n", + "\n", + "filename = 'data/北京农行人员名单2308.json'\n", + "with open(filename, 'w') as fl:\n", + " json.dump(person, fl, ensure_ascii=False)\n", + "print('ok')" + ] + }, + { + "cell_type": "markdown", + "id": "ff97823f-fd67-45ae-bd78-f209317be6b9", + "metadata": {}, + "source": [ + "## 成绩导入" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4adf86dd-addf-490a-9954-5dcac4693868", + "metadata": {}, + "outputs": [], + "source": [ + "import json\n", + "import time\n", + "import csv\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", + "re_ta = {}\n", + "dict1 = {}\n", + "list1 = []\n", + "filename = 'data/北京农行人员名单2308.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl) \n", + "\n", + "filename = 'data/places_result_20230825.csv'\n", + "with open(filename,'r',newline='') as csv_file:\n", + " fl = csv.reader(csv_file,delimiter=',')\n", + " header = next(fl) \n", + " for line in fl:\n", + " #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n", + " list1.append(line)\n", + "#print(list1)\n", + "for result in list1:\n", + " user = str(result[2])\n", + " if user in dict1.keys(): \n", + " m_item = str(result[3]) \n", + " re_ta.setdefault(user,{}) \n", + " re_ta[user]['name'] = dict1[user]['name']\n", + " re_ta[user]['sex'] = dict1[user]['sex'] \n", + " re_ta[user]['unit'] = dict1[user]['unit']\n", + " item_name = item[m_item]['name']\n", + " re_ta[user].setdefault(item_name,{}) \n", + " 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_北京农行0825.json'\n", + "\n", + "with open(filename,'w') as fl:\n", + " json.dump(re_ta, fl, ensure_ascii=False) \n", + "print(len(re_ta))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bb01b9a9-418d-4a1b-8ea9-1215af0b8285", + "metadata": {}, + "outputs": [], + "source": [ + "import json\n", + "import time\n", + "import csv\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", + "re_ta = {}\n", + "dict1 = {}\n", + "list1 = []\n", + "filename = 'data/北京农行人员名单2308.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl) \n", + "\n", + "filename = 'data/places_result_20230825.csv'\n", + "with open(filename,'r',newline='') as csv_file:\n", + " fl = csv.reader(csv_file,delimiter=',')\n", + " header = next(fl) \n", + " for line in fl:\n", + " #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n", + " list1.append(line)\n", + "#print(list1)\n", + "for result in list1:\n", + " user = str(result[2])\n", + " if user in dict1.keys(): \n", + " m_item = str(result[3]) \n", + " re_ta.setdefault(user,{}) \n", + " re_ta[user]['name'] = dict1[user]['name']\n", + " re_ta[user]['sex'] = dict1[user]['sex'] \n", + " re_ta[user]['unit'] = dict1[user]['unit']\n", + " item_name = item[m_item]['name']\n", + " re_ta[user].setdefault(item_name,{}) \n", + " 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_北京农行0825.json'\n", + "\n", + "with open(filename,'w') as fl:\n", + " json.dump(re_ta, fl, ensure_ascii=False) \n", + "print(len(re_ta))" + ] + }, + { + "cell_type": "markdown", + "id": "4d2a0d63-4124-4063-96a7-a02478b9eabe", + "metadata": {}, + "source": [ + "## 查看项目不足人员" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b26857af-5fa3-42d0-bf79-bc33d9f5e4a8", + "metadata": {}, + "outputs": [], + "source": [ + "import json\n", + "import time\n", + "import csv\n", + "\n", + "filename = 'data/result_北京农行0825.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl) \n", + "i= 0\n", + "for k, v in dict1.items():\n", + " if len(v.keys())< 8:\n", + " print(k,v['name'])" + ] + }, + { + "cell_type": "markdown", + "id": "1966307c-4161-4c5b-b19a-b8a143972223", + "metadata": {}, + "source": [ + "## 导出测试人员信息" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "288e39fb-b7e3-4566-ac13-ba98d7e72edb", + "metadata": {}, + "outputs": [], + "source": [ + "import json\n", + "import openpyxl\n", + "\n", + "\n", + "filename = 'data/result_北京农行0825.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl)\n", + "list1 =[]\n", + "for k, v in dict1.items():\n", + " list2 = []\n", + " list2 = [k,v['name'],v['sex'],v['unit']]\n", + " list1.append(list2)\n", + "filename = 'data/北京农行测试人员202308.xlsx'\n", + "wb = openpyxl.Workbook()\n", + "sheet = wb.active\n", + "\n", + "for row in list1:\n", + " sheet.append(row)\n", + " \n", + "wb.save(filename)" + ] + }, + { + "cell_type": "markdown", + "id": "a42cb587-8673-4655-8943-3cbd63f22b73", + "metadata": {}, + "source": [ + "## 检查性别" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6352b95c-0e19-4943-9e99-218138213060", + "metadata": {}, + "outputs": [], + "source": [ + "import json\n", + "\n", + "\n", + "filename = 'data/result_北京农行0825.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl)\n", + "for k, v in dict1.items():\n", + " if v['sex'] == '男' and '一分钟仰卧起坐' in v.keys():\n", + " print(k,'应为女性!')\n", + " if v['sex'] == '女' and '俯卧撑' in v.keys():\n", + " print(k,'应为男性!')" + ] + }, + { + "cell_type": "markdown", + "id": "fddd68cd-b20c-4cf9-b503-5d59f52e3c1b", + "metadata": {}, + "source": [ + "## 手工数据生成SQL" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "372294de-5370-41c0-9883-b18de9d8ef7e", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "import openpyxl\n", + "import json\n", + "\n", + "\n", + "wb = openpyxl.load_workbook('data/北京农行测试人员202308.xlsx')\n", + "sheet = wb.active\n", + "# sheets = wb.sheetnames\n", + "dict1 = {}\n", + "\n", + "data1 =list(sheet.values)\n", + "del data1[0]\n", + "list1 = []\n", + "for item in data1:\n", + " code = int(item[0])\n", + " list1.append((309118,code,5,item[4],'2023-08-23','2023-08-23 22:00:00'))\n", + "print(list1)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "93d4d513-17ee-4f20-bd86-be52398b5852", "metadata": {}, "outputs": [], "source": [] @@ -621,7 +806,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/体测单位/燕山石化.ipynb b/体测单位/燕山石化.ipynb index 7c396cc..f4873b5 100644 --- a/体测单位/燕山石化.ipynb +++ b/体测单位/燕山石化.ipynb @@ -2204,7 +2204,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/体测单位/石家庄石化.ipynb b/体测单位/石家庄石化.ipynb index 650795b..bc884d9 100644 --- a/体测单位/石家庄石化.ipynb +++ b/体测单位/石家庄石化.ipynb @@ -1150,7 +1150,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/体测单位/西藏.ipynb b/体测单位/西藏.ipynb index 2dd57d6..2f4259d 100644 --- a/体测单位/西藏.ipynb +++ b/体测单位/西藏.ipynb @@ -10,27 +10,12 @@ }, { "cell_type": "code", - "execution_count": 94, + "execution_count": null, "id": "07f7e97e-670e-4301-b83d-1304514f15d5", "metadata": { - "execution": { - "iopub.execute_input": "2023-07-05T02:45:10.229928Z", - "iopub.status.busy": "2023-07-05T02:45:10.229085Z", - "iopub.status.idle": "2023-07-05T02:45:10.320665Z", - "shell.execute_reply": "2023-07-05T02:45:10.319936Z", - "shell.execute_reply.started": "2023-07-05T02:45:10.229888Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ok\n" - ] - } - ], + "outputs": [], "source": [ "import openpyxl\n", "import json\n", @@ -65,6 +50,56 @@ "print('ok')" ] }, + { + "cell_type": "markdown", + "id": "be805082-d5d7-405b-975c-fb902085a041", + "metadata": {}, + "source": [ + "## 文件更名" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b51cf562-c708-4164-8431-5093247880c4", + "metadata": {}, + "outputs": [], + "source": [ + "import os,sys,shutil\n", + "import json\n", + "import math\n", + "import glob\n", + "from pathlib import Path\n", + "\n", + "fi_path = 'file/2023-06-07'\n", + "old = []\n", + "dict2 = {}\n", + "\n", + "filename = 'data/西藏人员.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl)\n", + "\n", + "for k, v in dict1.items():\n", + " m_name = v['name']\n", + " dict2[int(k)] = [m_name]\n", + "\n", + "fls = glob.glob(f'{fi_path}/*.pdf')\n", + "\n", + "for fn in fls:\n", + " old.append(os.path.basename(fn).split('.')[0])\n", + "\n", + "for n in old: \n", + " o_name = f'{fi_path}/{n}.pdf'\n", + " new_path = Path(fi_path,'new')\n", + " new_path.mkdir(parents = True, exist_ok = True)\n", + " n_name = Path(new_path,f'{str(n).rjust(5,\"0\")}-{dict2[int(n)][0]}.pdf')\n", + " if not os.path.exists(n_name):\n", + " shutil.copyfile(o_name,n_name)\n", + " print(n_name)\n", + " \n", + "print('ok')" + ] + }, { "cell_type": "markdown", "id": "962f6edd-c8d1-42a2-aaff-58f92ccf8d56", @@ -309,28 +344,12 @@ }, { "cell_type": "code", - "execution_count": 66, + "execution_count": null, "id": "e19a4c58-df1e-4136-bf10-33e9ed885e50", "metadata": { - "execution": { - "iopub.execute_input": "2023-07-04T13:02:15.967924Z", - "iopub.status.busy": "2023-07-04T13:02:15.967138Z", - "iopub.status.idle": "2023-07-04T13:02:16.005279Z", - "shell.execute_reply": "2023-07-04T13:02:16.004236Z", - "shell.execute_reply.started": "2023-07-04T13:02:15.967883Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "165\n", - "165\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", "import time\n", @@ -447,31 +466,12 @@ }, { "cell_type": "code", - "execution_count": 95, + "execution_count": null, "id": "3696d7e1-afb8-4f9d-ba29-9aaa977b52de", "metadata": { - "execution": { - "iopub.execute_input": "2023-07-05T02:45:28.348666Z", - "iopub.status.busy": "2023-07-05T02:45:28.348242Z", - "iopub.status.idle": "2023-07-05T02:45:28.389486Z", - "shell.execute_reply": "2023-07-05T02:45:28.388452Z", - "shell.execute_reply.started": "2023-07-05T02:45:28.348638Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "165\n", - "[]\n", - "165\n", - "ok\n", - "165\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", "import time\n", @@ -491,7 +491,7 @@ "re_ta = {}\n", "list1 = []\n", "#print(\"\\n运动项目信息:\")\n", - "filename = 'data/places_result_20230704.csv'\n", + "filename = 'data/places_result_20230714.csv'\n", "with open(filename,'r',newline='') as csv_file:\n", " fl = csv.reader(csv_file,delimiter=',')\n", " header = next(fl) \n", @@ -540,27 +540,12 @@ }, { "cell_type": "code", - "execution_count": 96, + "execution_count": null, "id": "b71c8bf6-2530-425f-9516-8757b40e3dc5", "metadata": { - "execution": { - "iopub.execute_input": "2023-07-05T02:45:31.683237Z", - "iopub.status.busy": "2023-07-05T02:45:31.682418Z", - "iopub.status.idle": "2023-07-05T02:45:31.710877Z", - "shell.execute_reply": "2023-07-05T02:45:31.709811Z", - "shell.execute_reply.started": "2023-07-05T02:45:31.683198Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ok\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", "import datetime\n", @@ -592,27 +577,12 @@ }, { "cell_type": "code", - "execution_count": 97, + "execution_count": null, "id": "0e75cfbb-2b63-4163-831c-933fff1481c2", "metadata": { - "execution": { - "iopub.execute_input": "2023-07-05T02:45:50.311946Z", - "iopub.status.busy": "2023-07-05T02:45:50.311092Z", - "iopub.status.idle": "2023-07-05T02:45:50.340231Z", - "shell.execute_reply": "2023-07-05T02:45:50.339150Z", - "shell.execute_reply.started": "2023-07-05T02:45:50.311906Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ok\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", "\n", @@ -646,31 +616,12 @@ }, { "cell_type": "code", - "execution_count": 98, + "execution_count": null, "id": "99f02e37-3a03-4d7d-a2b9-7bf5563c253c", "metadata": { - "execution": { - "iopub.execute_input": "2023-07-05T02:45:52.771879Z", - "iopub.status.busy": "2023-07-05T02:45:52.771043Z", - "iopub.status.idle": "2023-07-05T02:45:52.802079Z", - "shell.execute_reply": "2023-07-05T02:45:52.801054Z", - "shell.execute_reply.started": "2023-07-05T02:45:52.771839Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0~255分人数:115人,男性:67人,女性:48人\n", - "256~332分人数:42人,男性:27人,女性:15人\n", - "333~367分人数:8人,男性:4人,女性:4人\n", - "368~500分人数:0人,男性:0人,女性:0人\n", - "ok\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", "\n", @@ -714,34 +665,12 @@ }, { "cell_type": "code", - "execution_count": 99, + "execution_count": null, "id": "1435c8af-094d-44b3-a024-af3615c07c21", "metadata": { - "execution": { - "iopub.execute_input": "2023-07-05T02:45:57.071802Z", - "iopub.status.busy": "2023-07-05T02:45:57.070977Z", - "iopub.status.idle": "2023-07-05T02:45:57.086551Z", - "shell.execute_reply": "2023-07-05T02:45:57.085522Z", - "shell.execute_reply.started": "2023-07-05T02:45:57.071762Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "20~24岁平均成绩:2.43分,人数:9人,男性:7人\n", - "25~29岁平均成绩:2.14分,人数:49人,男性:27人\n", - "30~34岁平均成绩:2.26分,人数:38人,男性:22人\n", - "35~39岁平均成绩:2.39分,人数:27人,男性:12人\n", - "40~44岁平均成绩:2.37分,人数:26人,男性:15人\n", - "45~49岁平均成绩:2.52分,人数:10人,男性:9人\n", - "50~54岁平均成绩:2.48分,人数:5人,男性:5人\n", - "55~69岁平均成绩:2.67分,人数:1人,男性:1人\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", "\n", @@ -776,34 +705,12 @@ }, { "cell_type": "code", - "execution_count": 100, + "execution_count": null, "id": "650cf1eb-8681-4911-9b04-80468fe6bf64", "metadata": { - "execution": { - "iopub.execute_input": "2023-07-05T02:47:11.272824Z", - "iopub.status.busy": "2023-07-05T02:47:11.271965Z", - "iopub.status.idle": "2023-07-05T02:47:11.287782Z", - "shell.execute_reply": "2023-07-05T02:47:11.286539Z", - "shell.execute_reply.started": "2023-07-05T02:47:11.272783Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "20~24岁平均成绩:2.45分,人数:7人\n", - "25~29岁平均成绩:2.0分,人数:27人\n", - "30~34岁平均成绩:2.39分,人数:22人\n", - "35~39岁平均成绩:2.36分,人数:12人\n", - "40~44岁平均成绩:2.53分,人数:15人\n", - "45~49岁平均成绩:2.54分,人数:9人\n", - "50~54岁平均成绩:2.48分,人数:5人\n", - "55~80岁平均成绩:2.67分,人数:1人\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", "\n", @@ -838,34 +745,12 @@ }, { "cell_type": "code", - "execution_count": 74, + "execution_count": null, "id": "9ccb9b3c-de57-49f4-a4c6-10a24737e857", "metadata": { - "execution": { - "iopub.execute_input": "2023-07-04T13:08:22.477549Z", - "iopub.status.busy": "2023-07-04T13:08:22.476783Z", - "iopub.status.idle": "2023-07-04T13:08:22.492628Z", - "shell.execute_reply": "2023-07-04T13:08:22.491401Z", - "shell.execute_reply.started": "2023-07-04T13:08:22.477510Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "20~24岁平均成绩:2.33分,人数:2人\n", - "25~29岁平均成绩:2.32分,人数:22人\n", - "30~34岁平均成绩:2.07分,人数:16人\n", - "35~39岁平均成绩:2.41分,人数:15人\n", - "40~44岁平均成绩:2.15分,人数:11人\n", - "45~49岁平均成绩:2.33分,人数:1人\n", - "50~54岁平均成绩:0分,人数:0人\n", - "55~80岁平均成绩:0分,人数:0人\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", "\n", @@ -899,29 +784,12 @@ }, { "cell_type": "code", - "execution_count": 104, + "execution_count": null, "id": "c8cd897e-0d41-4faa-860f-395d42208674", "metadata": { - "execution": { - "iopub.execute_input": "2023-07-05T03:18:05.849161Z", - "iopub.status.busy": "2023-07-05T03:18:05.848313Z", - "iopub.status.idle": "2023-07-05T03:18:05.864430Z", - "shell.execute_reply": "2023-07-05T03:18:05.863382Z", - "shell.execute_reply.started": "2023-07-05T03:18:05.849120Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "平均成绩:2.3266分,男性:98人\n", - "平均成绩:2.2533分,女性:67人\n", - "平均成绩:2.2968分,总体:165人\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", "\n", @@ -960,34 +828,12 @@ }, { "cell_type": "code", - "execution_count": 91, + "execution_count": null, "id": "28b418f2-2324-450f-9684-4df15e012694", "metadata": { - "execution": { - "iopub.execute_input": "2023-07-05T02:43:38.489757Z", - "iopub.status.busy": "2023-07-05T02:43:38.488929Z", - "iopub.status.idle": "2023-07-05T02:43:38.506679Z", - "shell.execute_reply": "2023-07-05T02:43:38.505448Z", - "shell.execute_reply.started": "2023-07-05T02:43:38.489716Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "20-24 {'合格': 1, '不合格': 1}\n", - "25-29 {'良好': 2, '不合格': 15, '合格': 5}\n", - "30-34 {'合格': 3, '不合格': 12, '良好': 1}\n", - "35-39 {'合格': 4, '良好': 1, '不合格': 10}\n", - "40-44 {'不合格': 9, '良好': 0, '合格': 2}\n", - "45-49 {'不合格': 1, '合格': 0, '良好': 0}\n", - "50-54 {'合格': 0, '良好': 0, '不合格': 0}\n", - "55-80 {'合格': 0}\n" - ] - } - ], + "outputs": [], "source": [ "nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n", "\n", @@ -1027,34 +873,12 @@ }, { "cell_type": "code", - "execution_count": 102, + "execution_count": null, "id": "a80224fb-1726-4370-9d3d-6e0a27afa8b2", "metadata": { - "execution": { - "iopub.execute_input": "2023-07-05T02:47:19.469192Z", - "iopub.status.busy": "2023-07-05T02:47:19.468357Z", - "iopub.status.idle": "2023-07-05T02:47:19.486494Z", - "shell.execute_reply": "2023-07-05T02:47:19.485227Z", - "shell.execute_reply.started": "2023-07-05T02:47:19.469153Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "20-24 {'合格': 3, '不合格': 4}\n", - "25-29 {'良好': 0, '不合格': 24, '合格': 3}\n", - "30-34 {'合格': 7, '不合格': 15, '良好': 0}\n", - "35-39 {'合格': 5, '良好': 0, '不合格': 7}\n", - "40-44 {'不合格': 9, '良好': 1, '合格': 5}\n", - "45-49 {'不合格': 5, '合格': 2, '良好': 2}\n", - "50-54 {'合格': 1, '良好': 1, '不合格': 3}\n", - "55-80 {'合格': 1}\n" - ] - } - ], + "outputs": [], "source": [ "nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n", "\n", @@ -1094,32 +918,12 @@ }, { "cell_type": "code", - "execution_count": 103, + "execution_count": null, "id": "945b9bec-247b-498b-96f6-a52fabbf6c89", "metadata": { - "execution": { - "iopub.execute_input": "2023-07-05T02:47:22.379999Z", - "iopub.status.busy": "2023-07-05T02:47:22.379167Z", - "iopub.status.idle": "2023-07-05T02:47:22.392962Z", - "shell.execute_reply": "2023-07-05T02:47:22.391756Z", - "shell.execute_reply.started": "2023-07-05T02:47:22.379959Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "体重 3.46 164\n", - "肺活量 2.22 164\n", - "握力 1.19 164\n", - "坐位体前屈 1.9 163\n", - "单脚站立 2.19 165\n", - "选择反应时 2.8 165\n" - ] - } - ], + "outputs": [], "source": [ "with open(filename,'r') as fl:\n", " dict1 = json.load(fl) \n", @@ -1134,10 +938,123 @@ " print(item,round(score/n,2),n)" ] }, + { + "cell_type": "markdown", + "id": "abba5b74-bfcd-4ec0-b682-10170138ff36", + "metadata": {}, + "source": [ + "### 生成脊椎情况明细" + ] + }, { "cell_type": "code", "execution_count": null, - "id": "c840e9b2-ce95-40c5-9f67-438a88ae0736", + "id": "da4ba403-92a8-4fd8-8dfc-49802b941fca", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 23, + "id": "aebb4eb4-2bcd-411c-8868-292fae38d8b5", + "metadata": { + "execution": { + "iopub.execute_input": "2023-07-19T05:21:21.489267Z", + "iopub.status.busy": "2023-07-19T05:21:21.488401Z", + "iopub.status.idle": "2023-07-19T05:21:21.503231Z", + "shell.execute_reply": "2023-07-19T05:21:21.502005Z", + "shell.execute_reply.started": "2023-07-19T05:21:21.489227Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'q1': 34, 'q2': 37, 'q3': 32, 'q4': 86, 'q5': 55, 'q6': 33, 'q7': 63, 'q8': 29, 'q9': 59, 'q10': 14, 'q11': 47, 'q12': 58, 'q13': 14, 'q14': 8, 'q15': 54, 'q16': 52, 'q17': 20, 'q18': 54, 'q19': 43, 'q20': 1, 'q21': 31, 'q22': 22, 'q23': 50, 'q24': 10, 'q25': 2}\n" + ] + } + ], + "source": [ + "import json\n", + "import csv\n", + "\n", + "dict1 = {}\n", + "dict2 = {}\n", + "for i in range(1,26):\n", + " dict1[f'q{str(i)}'] = 0\n", + " \n", + "list1 = []\n", + "filename = 'data/Survey_20230719.csv'\n", + "with open(filename,'r',newline='') as csv_file:\n", + " fl = csv.reader(csv_file,delimiter=',')\n", + " header = next(fl) \n", + " for line in fl:\n", + " #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n", + " list1.append(line)\n", + "list2 = []\n", + "for result in list1:\n", + " data = json.loads(result[5].strip())\n", + " for k, v in data.items():\n", + " if v:\n", + " dict1[k] += 1\n", + "print(dict1) " + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "id": "ad102064-de18-41aa-9829-b9b398df53d6", + "metadata": { + "execution": { + "iopub.execute_input": "2023-07-19T05:18:48.000423Z", + "iopub.status.busy": "2023-07-19T05:18:47.999556Z", + "iopub.status.idle": "2023-07-19T05:18:48.014467Z", + "shell.execute_reply": "2023-07-19T05:18:48.013436Z", + "shell.execute_reply.started": "2023-07-19T05:18:48.000379Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['10422', 'zsyxz1', '', '张斌', '35', '{\"q25\":true,\"q1\":false,\"q2\":false,\"q3\":false,\"q4\":true,\"q5\":true,\"q6\":true,\"q7\":true,\"q8\":false,\"q9\":true,\"q10\":false,\"q11\":false,\"q12\":false,\"q13\":false,\"q14\":false,\"q15\":true,\"q16\":false,\"q17\":false,\"q18\":false,\"q19\":true,\"q20\":false,\"q21\":true,\"q22\":false,\"q23\":false,\"q24\":true}', '2023-06-01 20:00:00']\n", + "['10424', 'zsyxz1', '', '余兴见', '85', '{\"q25\":true,\"q1\":false,\"q2\":true,\"q3\":false,\"q4\":true,\"q5\":true,\"q6\":false,\"q7\":true,\"q8\":true,\"q9\":true,\"q10\":false,\"q11\":true,\"q12\":true,\"q13\":false,\"q14\":false,\"q15\":true,\"q16\":true,\"q17\":true,\"q18\":false,\"q19\":false,\"q20\":false,\"q21\":true,\"q22\":true,\"q23\":false,\"q24\":true}', '2023-06-01 20:00:00']\n" + ] + } + ], + "source": [ + "import json\n", + "import csv\n", + "\n", + "dict1 = {}\n", + "dict2 = {}\n", + "for i in range(1,26):\n", + " dict1[f'q{str(i)}'] = 0\n", + " \n", + "list1 = []\n", + "filename = 'data/Survey_20230719.csv'\n", + "with open(filename,'r',newline='') as csv_file:\n", + " fl = csv.reader(csv_file,delimiter=',')\n", + " header = next(fl) \n", + " for line in fl:\n", + " #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n", + " list1.append(line)\n", + "list2 = []\n", + "for result in list1:\n", + " data = json.loads(result[5].strip())\n", + " for k, v in data.items():\n", + " if k == 'q25'and v:\n", + " print(result)\n", + "#print(dict1) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2787bc9f-6492-4b51-9b37-87ac098d93b9", "metadata": {}, "outputs": [], "source": [] @@ -1159,7 +1076,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/体测单位/长炼医院.ipynb b/体测单位/长炼医院.ipynb index f7e1a3c..3ce17f3 100644 --- a/体测单位/长炼医院.ipynb +++ b/体测单位/长炼医院.ipynb @@ -10,27 +10,12 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": null, "id": "3154fc8c-0e91-4cda-ba75-666dc7bbb34d", "metadata": { - "execution": { - "iopub.execute_input": "2023-05-08T07:53:19.491869Z", - "iopub.status.busy": "2023-05-08T07:53:19.491008Z", - "iopub.status.idle": "2023-05-08T07:53:19.954513Z", - "shell.execute_reply": "2023-05-08T07:53:19.953763Z", - "shell.execute_reply.started": "2023-05-08T07:53:19.491826Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ok\n" - ] - } - ], + "outputs": [], "source": [ "import openpyxl\n", "import json\n", @@ -72,35 +57,18 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": null, "id": "5cea2f5e-37fc-4857-8455-090a634a1c0a", "metadata": { - "execution": { - "iopub.execute_input": "2023-07-04T11:13:00.968177Z", - "iopub.status.busy": "2023-07-04T11:13:00.967304Z", - "iopub.status.idle": "2023-07-04T11:13:01.076381Z", - "shell.execute_reply": "2023-07-04T11:13:01.075631Z", - "shell.execute_reply.started": "2023-07-04T11:13:00.968133Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "2125\n", - "ok\n", - "2360\n" - ] - } - ], + "outputs": [], "source": [ "import openpyxl\n", "import json\n", "\n", "\n", - "wb = openpyxl.load_workbook('data/长炼医院新增监测花名册(物资+消防).xlsx')\n", + "wb = openpyxl.load_workbook('data/长炼医院新增监测花名册(水务部).xlsx')\n", "sheet = wb.active\n", "# sheets = wb.sheetnames\n", "filename = 'data/长炼医院人员名单.json'\n", @@ -129,6 +97,80 @@ "print(len(person))" ] }, + { + "cell_type": "markdown", + "id": "56e4caa4-cf9d-4fdc-99c4-86f5e92afdfa", + "metadata": {}, + "source": [ + "## 补充员工编号" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0bdfe5e6-40e1-432d-85b4-ddb9e8d3dd90", + "metadata": {}, + "outputs": [], + "source": [ + "mport openpyxl\n", + "import json\n", + "\n", + "\n", + "wb = openpyxl.load_workbook('data/长炼医院体测人员编号情况表.xlsx')\n", + "sheet = wb.active\n", + "# sheets = wb.sheetnames\n", + "filename = 'data/长炼医院人员名单.json'\n", + "with open(filename,'r') as fl:\n", + " person = json.load(fl) \n", + "print(len(person))\n", + "for n in range(2, sheet.max_row+1):\n", + " if sheet.cell(n,1).value is not None:\n", + " code = int(sheet.cell(n, 4).value)\n", + " \n", + "\n", + "\n", + "with open(filename, 'w') as fl:\n", + " json.dump(person, fl, ensure_ascii=False)\n", + "print('ok')\n", + "print(len(person))" + ] + }, + { + "cell_type": "markdown", + "id": "1597f17a-1d9c-4d2c-9273-3afa8147c72e", + "metadata": {}, + "source": [ + "## 单独新增人员信息" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d6fde6c4-d696-4eb9-a73e-a7cc7018b62c", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "import openpyxl\n", + "import json\n", + "\n", + "\n", + "filename = 'data/长炼医院人员名单.json'\n", + "with open(filename,'r') as fl:\n", + " person = json.load(fl) \n", + "code = '3297'\n", + "name = '何治国'\n", + "sex = '男'\n", + "birth = '1982/02/15'\n", + "unit = '长炼医院外二科'\n", + "person[code] = {'name':name,'sex':sex,'birth':birth,'unit':unit}\n", + "with open(filename, 'w') as fl:\n", + " json.dump(person, fl, ensure_ascii=False)\n", + "print('ok')\n", + "print(len(person))" + ] + }, { "cell_type": "markdown", "id": "96d5b4bd-4198-4725-9005-070ac4e4f324", @@ -139,28 +181,12 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": null, "id": "4b52477e-926a-44b5-b8a0-20bff98d101d", "metadata": { - "execution": { - "iopub.execute_input": "2023-06-30T09:11:38.251783Z", - "iopub.status.busy": "2023-06-30T09:11:38.251003Z", - "iopub.status.idle": "2023-06-30T09:11:38.321383Z", - "shell.execute_reply": "2023-06-30T09:11:38.320331Z", - "shell.execute_reply.started": "2023-06-30T09:11:38.251750Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "332\n", - "332\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", "import time\n", @@ -179,7 +205,7 @@ "filename = 'data/长炼医院人员名单.json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl) \n", - "rq = '20230630'\n", + "rq = '20230830'\n", "filename = f'data/places_result_{rq}.csv'\n", "with open(filename,'r',newline='') as csv_file:\n", " fl = csv.reader(csv_file,delimiter=',')\n", @@ -202,7 +228,7 @@ " re_ta[user][item_name]['成绩'] = f'{score} {item[m_item][\"unit\"]}'\n", "print(len(re_ta))\n", "\n", - "filename = f'data/result_长炼医院({rq}).json'\n", + "filename = 'data/result_长炼医院.json'\n", "with open(filename,'w') as fl:\n", " json.dump(re_ta, fl, ensure_ascii=False) \n", "print(len(re_ta))\n" @@ -210,46 +236,17 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "033cc564-4aa9-4e88-b38b-ec62a02b1661", "metadata": { - "execution": { - "iopub.execute_input": "2023-05-26T08:29:09.963390Z", - "iopub.status.busy": "2023-05-26T08:29:09.962538Z", - "iopub.status.idle": "2023-05-26T08:29:10.005878Z", - "shell.execute_reply": "2023-05-26T08:29:10.004986Z", - "shell.execute_reply.started": "2023-05-26T08:29:09.963348Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "67\n", - "133 杨诚 已测试!\n", - "76 李克胜 已测试!\n", - "24 李璇 已测试!\n", - "45 乔志刚 已测试!\n", - "136 胡茂山 已测试!\n", - "182 刘立文 已测试!\n", - "163 乐文清 已测试!\n", - "160 李莉 已测试!\n", - "128 王聪 已测试!\n", - "161 王雅琴 已测试!\n", - "72 彭姝 已测试!\n", - "164 高维 已测试!\n", - "134 索怡心 已测试!\n", - "67\n", - "72\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", - "import time\n", + "import datetime\n", "import csv\n", + "from datetime import date\n", "\n", "filename = '../item.json'\n", "item = {}\n", @@ -258,54 +255,69 @@ " dict1 = json.load(fl) \n", "for k,v in dict1.items():\n", " item[k] = v\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", + "\n", "re_ta = {}\n", "dict1 = {}\n", "list1 = []\n", "filename = 'data/长炼医院人员名单.json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl) \n", - "#rq = '20230510'\n", - "filename = f'data/places_result_{rq}.csv'\n", + "\n", + "filename = 'data/places_result_20230830.csv'\n", "with open(filename,'r',newline='') as csv_file:\n", " fl = csv.reader(csv_file,delimiter=',')\n", " header = next(fl) \n", " for line in fl:\n", " #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n", " list1.append(line)\n", - "#print(list1)\n", + "#f_item = ['lung','grip','flexion','jump','balance','reaction','step','situp']\n", + "#m_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step']\n", "for result in list1:\n", " user = str(result[2])\n", - " if user in dict1.keys(): \n", + " if user in dict1.keys():\n", + " l_xm = []\n", " m_item = str(result[3]) \n", " re_ta.setdefault(user,{}) \n", " re_ta[user]['name'] = dict1[user]['name']\n", - " re_ta[user]['sex'] = dict1[user]['sex'] \n", + " re_ta[user]['sex'] = dict1[user]['sex']\n", + " if dict1[user]['sex'] == '男':\n", + " l_xm = ['weight','height','lung','grip','flexion','jump','pushup','balance','reaction','step']\n", + " else:\n", + " l_xm = ['weight','height','lung','grip','flexion','jump','balance','reaction','step','situp']\n", " re_ta[user]['unit'] = dict1[user]['unit']\n", - " item_name = item[m_item]['name']\n", - " re_ta[user].setdefault(item_name,{}) \n", - " score = int(result[4])/item[m_item]['divisor'] \n", - " re_ta[user][item_name]['成绩'] = f'{score} {item[m_item][\"unit\"]}'\n", + " birth = date.fromisoformat(dict1[user]['birth'].replace('/','-'))\n", + " #nian = int(birth[0].strip())\n", + " #yue = int(birth[1].strip())\n", + " #ri = int(birth[2].strip())\n", + " #print(k,nian,yue,ri)\n", + " item_name = item[m_item]['en'] \n", + " if item_name in l_xm: \n", + " days = (datetime.date(2023, 8, 29)-birth).days \n", + " re_ta[user]['age'] = int(days/365)\n", + " re_ta[user]['month'] = int(days/365*12)\n", + "\n", + "\n", + " re_ta[user].setdefault(item_name,{}) \n", + " 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", - "with open(filename,'r') as fl:\n", - " dict2 = json.load(fl)\n", - "for k in re_ta.keys():\n", - " if k in dict2.keys():\n", - " print(k,dict2[k]['name'],'已测试!')\n", - "for k, v in re_ta.items():\n", - " if k not in dict2.keys():\n", - " dict2[k] = v\n", - " else:\n", - " for k1,v1 in v.items():\n", - " dict2[k][k1] = v1\n", - "filename = f'data/result_长炼医院({rq}).json'\n", + "\n", "with open(filename,'w') as fl:\n", " json.dump(re_ta, fl, ensure_ascii=False) \n", - "print(len(re_ta))\n", - "filename = 'data/result_长炼医院.json'\n", - "with open(filename,'w') as fl:\n", - " json.dump(dict2, fl, ensure_ascii=False) \n", - "print(len(dict2))" + "print(len(re_ta))" ] }, { @@ -318,16 +330,9 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": null, "id": "2ffa583b-be51-40a8-bb55-de6a89d1a54a", "metadata": { - "execution": { - "iopub.execute_input": "2023-06-30T09:11:56.865111Z", - "iopub.status.busy": "2023-06-30T09:11:56.864246Z", - "iopub.status.idle": "2023-06-30T09:11:56.990299Z", - "shell.execute_reply": "2023-06-30T09:11:56.989605Z", - "shell.execute_reply.started": "2023-06-30T09:11:56.865066Z" - }, "tags": [] }, "outputs": [], @@ -367,14 +372,834 @@ "sheet.append(title)\n", "for row in list1:\n", " sheet.append(row)\n", - " \n", "wb.save(filename)" ] }, + { + "cell_type": "markdown", + "id": "be9ba440-3978-4a26-96a8-a0ec4a4f307f", + "metadata": {}, + "source": [ + "## 人员信息表导出" + ] + }, { "cell_type": "code", "execution_count": null, - "id": "ec011c39-f6b1-40d5-b95e-bc59b7a51058", + "id": "52e4d9cf-2ecd-4d96-9ab0-a71c507a32e0", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "import openpyxl\n", + "import json\n", + "\n", + "\n", + "filename = 'data/长炼医院人员名单.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl)\n", + "list1 = []\n", + "for k, v in dict1.items():\n", + " list2 = []\n", + " list2 = [k,v['name'],v['sex'],v['birth'],v['unit']]\n", + " list1.append(list2)\n", + "filename = f'data/长炼医院体测情况表(20230829).xlsx'\n", + "wb = openpyxl.Workbook()\n", + "sheet = wb.active\n", + "\n", + "for row in list1:\n", + " sheet.append(row)\n", + "wb.save(filename)" + ] + }, + { + "cell_type": "markdown", + "id": "f58f1da0-a558-4c92-ac09-341bc8a6055d", + "metadata": {}, + "source": [ + "## 计算测试得分" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3b10ab5b-a9e6-4b3b-b2ec-97a2de4af6cd", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "import json\n", + "import time\n", + "\n", + "filename = '../item.json'\n", + "item = {}\n", + "unit = {}\n", + "with open(filename,'r') as fl:\n", + " dict3 = json.load(fl) \n", + "for k,v in dict3.items():\n", + " item[k] = v\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/体质检测标准 (1).json' \n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl)\n", + "\n", + "\n", + "\n", + "def cal_score(data1):\n", + " #data = {'name':'张三','sex':'M','age':37,'item':'StepExperiment','result':46} \n", + " person = dict1['person']\n", + " criteria = dict1['criteria'] \n", + " info = data1['sex']+str(data1['age'])\n", + " bz = person[info]\n", + " mx = criteria[bz][data1['item']]\n", + " result = data1['result'] \n", + " if data1['item'] == 'reaction':\n", + " for bz1 in mx:\n", + " if result > bz1:\n", + " #print(bz1)\n", + " score = mx.index(bz1,0)\n", + " break\n", + " else:\n", + " score = 5\n", + " else:\n", + " for bz1 in mx:\n", + " if result < bz1:\n", + " #print(bz1)\n", + " score = mx.index(bz1,0)\n", + " break\n", + " else:\n", + " score = 5\n", + " return(score)\n", + "filename = 'data/体质检测标准_BMI.json'\n", + "with open(filename,'r') as fl:\n", + " dict4 = json.load(fl) \n", + " \n", + "def cal_bmi(data1):\n", + " # data = {'name':'张三','sex':'M','age':37,'item':'HeightWeight','result':'177.7,97.0'}\n", + " person = dict4['person']\n", + " criteria = dict4['criteria']\n", + " \n", + " info = data1['sex']+str(data1['age'])\n", + " bz = person[info]\n", + " #print(bz)\n", + " result = data1['result']\n", + " print(result)\n", + " height = int(float(result.split(',')[0]))\n", + " weight = float(result.split(',')[1])\n", + " mx = criteria[bz][str(height)]\n", + " if weight < mx[0]:\n", + " score = 1\n", + " elif weight < mx[1]:\n", + " score = 3\n", + " elif weight < mx[2]:\n", + " score = 5 \n", + " elif weight <= mx[3]:\n", + " score = 3 \n", + " elif weight > mx[3]:\n", + " score = 1\n", + " return score\n", + " \n", + " \n", + "\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", + "with open(filename,'r') as fl:\n", + " dict2 = json.load(fl) \n", + "for k, v in dict2.items():\n", + " if v['sex'] == '男':\n", + " sex = 'M'\n", + " else:\n", + " sex = 'F' \n", + " if 'height' in v.keys() and 'weight' in v.keys():\n", + " bmi_data = v['height']['成绩'].split()[0]+','+ v['weight']['成绩'].split()[0]\n", + " data1 = {'sex':sex,'age':v['age'],'item':'HeightWeight','result':bmi_data}\n", + " dict2[k]['bmi'] = {}\n", + " dict2[k]['bmi']['成绩'] = bmi_data\n", + " dict2[k]['bmi']['score'] = cal_bmi(data1)\n", + " for item_en in list_item:\n", + " if item_en in v.keys(): \n", + " data1 = {'sex':sex,'age':v['age'],'item':item_en,'result':float(v[item_en]['成绩'].split()[0])}\n", + " 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", + "with open(filename,'w') as fl:\n", + " json.dump(dict2,fl , ensure_ascii=False) \n", + "print('ok!') " + ] + }, + { + "cell_type": "markdown", + "id": "647c016d-640e-44ab-888d-09b80d5bb8b9", + "metadata": {}, + "source": [ + "## 生成报告" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bea5228f-0d65-4969-b00f-ea102ed12122", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "import requests\n", + "import json\n", + "\n", + "headers = {\n", + " \"Content-Type\": \"application/json; charset=UTF-8\"\n", + " }\n", + "filename = 'data/result_长炼医院.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl)\n", + "list1 = []\n", + "fiie_path ='./469849/'\n", + "list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','bmi']\n", + "for k, v in dict1.items():\n", + " list1 = []\n", + " mydata = {}\n", + " \n", + " id = str(k).rjust(5,\"0\")\n", + " mydata['path'] = fiie_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", + " for item in list_item:\n", + " if item in v.keys():\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:\n", + " \n", + " list1.append(mydata) \n", + " x = requests.post('http://192.168.31.163:3003', data = json.dumps(list1), headers=headers)\n", + " print(id,v['name'],x.text)\n", + " x.close()\n", + " #print(mydata)\n", + " " + ] + }, + { + "cell_type": "markdown", + "id": "effa061b-51f9-4074-b747-d7873217973a", + "metadata": {}, + "source": [ + "## 生成报告数据" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d403f2f4-ae6b-422f-9679-e7636bfec03e", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "import requests\n", + "import json\n", + "\n", + "headers = {\n", + " \"Content-Type\": \"application/json; charset=UTF-8\"\n", + " }\n", + "filename = 'data/result_长炼医院.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl)\n", + "list1 = []\n", + "\n", + "fiie_path ='./469849/'\n", + "list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','bmi']\n", + "for k, v in dict1.items(): \n", + " mydata = {}\n", + " id = str(k).rjust(5,\"0\")\n", + " mydata['path'] = fiie_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", + " for item in list_item:\n", + " if item in v.keys():\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: \n", + " list1.append(mydata) \n", + " #x = requests.post('http://192.168.31.163:3003', data = json.dumps(list1), headers=headers)\n", + " #print(id,v['name'],x.text)\n", + " #x.close()\n", + " #print(mydata)\n", + "json_data = json.dumps(list1,ensure_ascii=False, indent=4) \n", + "\n", + "# 将 json 数据写入文件\n", + "with open(\"data/长炼医院data.json\", \"w\",encoding = 'utf-8') as file:\n", + " file.write(json_data) " + ] + }, + { + "cell_type": "markdown", + "id": "1f74d57b-ef60-4a1e-8cb5-2dc4c96bdcca", + "metadata": {}, + "source": [ + "## 核对成绩" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c1c3330d-cce6-4603-99ea-8401cfa11e05", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "import json\n", + "import csv\n", + "\n", + "filename = '../item.json'\n", + "item = {}\n", + "unit = {}\n", + "with open(filename,'r') as fl:\n", + " dict3 = json.load(fl) \n", + "for k,v in dict3.items():\n", + " item[k] = v\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", + "re_ta = {}\n", + "list1 = []\n", + "item_list = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp']\n", + "filename = 'data/places_result_20230830.csv'\n", + "with open(filename,'r',newline='') as csv_file:\n", + " fl = csv.reader(csv_file,delimiter=',')\n", + " header = next(fl) \n", + " for line in fl:\n", + " #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n", + " list1.append(line)\n", + "#print(list1)\n", + "for result in list1:\n", + " user = str(result[2])\n", + " \n", + " m_item = str(result[3]) \n", + " re_ta.setdefault(user,{}) \n", + " item_name = item[m_item]['en']\n", + " re_ta[user].setdefault(item_name,{}) \n", + " score = int(result[4])/item[m_item]['divisor'] \n", + " re_ta[user][item_name]['成绩'] = result[5]\n", + "\n", + "filename = 'data/长炼医院data.json'\n", + "with open(filename,'r') as fl:\n", + " list1 = json.load(fl)\n", + "for data in list1:\n", + " code = str(int(data['id']))\n", + " for k, v in data['fits'].items():\n", + " if code in re_ta.keys():\n", + " if k in item_list:\n", + " print(code,k,v['score'],re_ta[code][k]['成绩'])\n", + " if k == 'bmi':\n", + " print(code,k,v['score'],re_ta[code]['weight']['成绩'])\n", + " \n", + " " + ] + }, + { + "cell_type": "markdown", + "id": "83fa2c1f-5269-4dec-a6b5-43f809db808c", + "metadata": {}, + "source": [ + "## 获取报告信息" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "f4aaab88-4a92-434c-98e5-2ef2f4c23707", + "metadata": { + "execution": { + "iopub.execute_input": "2023-09-05T06:24:53.514988Z", + "iopub.status.busy": "2023-09-05T06:24:53.514794Z", + "iopub.status.idle": "2023-09-05T06:24:53.526136Z", + "shell.execute_reply": "2023-09-05T06:24:53.525740Z", + "shell.execute_reply.started": "2023-09-05T06:24:53.514973Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0077 阳轶西\n", + "2044 罗鸣\n", + "2102 王凤\n", + "2173 倪炜强\n", + "1488 邓超\n", + "0511 杨锦\n", + "2091 黄琪\n", + "2046 李关亮\n", + "2082 贺凯\n", + "2069 周君良\n", + "1559 谢斌\n", + "1597 黄庭轩\n", + "2126 蔡安逸\n", + "0332 陈素玲\n", + "0102 江承光\n", + "1660 唐淑琴\n", + "0350 严正男\n", + "2169 宋德伟\n", + "2083 吴征宇\n", + "1579 彭小海\n", + "1230 向冬典\n", + "1971 江平\n", + "2145 陈世博\n", + "1547 陈文胜\n", + "1761 胡志祥\n", + "2172 王亚周\n", + "1476 张磊\n", + "2578 颜艳萍\n", + "2045 谈志亮\n", + "1878 张二学\n", + "2056 江汇涛\n", + "2040 常硕\n", + "1483 叶恒超\n", + "2000 祝恒兴\n", + "2012 丁文斌\n", + "1580 吕振 \n", + "2922 周勃\n", + "2469 黄平\n", + "1617 陈雪梅\n", + "1634 胡柯磊\n", + "2520 乔勇\n", + "2014 彭海军\n", + "0514 金超\n", + "1626 王军\n", + "0133 杨诚\n", + "1581 刘传钢\n", + "0100 钟宁辉\n", + "1529 蒋茂凤\n", + "2154 张坚发\n", + "1092 黄平\n", + "1551 陈伟\n", + "1504 龙群丽\n", + "1539 童志强\n", + "2087 张宁\n", + "1607 谭拥军\n", + "0134 索怡心\n", + "0123 刘世杰\n", + "1453 李勇\n", + "2055 俞华萍\n", + "1481 李咏\n", + "2067 黄建生\n", + "2108 冯军\n", + "1266 李昌东\n", + "2142 阳静\n", + "1856 廖康\n", + "1558 胡宏爱\n", + "2105 张哲\n", + "2124 唐睿\n", + "2076 姚佩\n", + "2122 周瑜\n", + "2496 曹鹏\n", + "2590 肖涛\n", + "2138 于业晟\n", + "2170 陈雅玲\n", + "1475 王柏强\n", + "0071 黄陵\n", + "2001 王复兴\n", + "1711 仇浩宇\n", + "1523 彭殿斌\n", + "1847 贺芳\n", + "2148 郑峻荣\n", + "1613 湛小平\n", + "2462 李亚平\n", + "1411 周为\n", + "1635 李泽上\n", + "0164 高维\n", + "2991 周金华\n", + "1517 湛敏\n", + "0163 乐文清\n", + "0496 宋立波\n", + "1629 张建忠\n", + "2557 邓宇波\n", + "0171 张晨阳\n", + "2223 王志建\n", + "2022 戴文立\n", + "2158 刘赫\n", + "2531 张宇星\n", + "2166 张梦圆\n", + "1841 唐军\n", + "1988 王志杰\n", + "0062 谢宜勇\n", + "2034 段威\n", + "0249 杨魁智\n", + "0109 杨胜辉\n", + "1474 乔亮\n", + "0001 徐迟\n", + "1870 龚斯壮\n", + "1552 王勇\n", + "0122 冯晨亮\n", + "1465 李建\n", + "2010 胡湘\n", + "2121 叶忠良\n", + "2386 陈意心\n", + "2245 谢金岑\n", + "2090 陈海\n", + "1671 龙琴\n", + "1490 胡帆\n", + "1999 李刚\n", + "2114 唐景柳\n", + "2096 李佳\n", + "1087 胡向前\n", + "1730 李强\n", + "1506 宁志强\n", + "2487 万艳芳\n", + "2057 王小军\n", + "2098 朱雨晴\n", + "2467 刘权\n", + "1812 陈伟\n", + "1721 宋治国\n", + "1584 彭晓香\n", + "2058 张伟\n", + "0103 王玮\n", + "1473 谢安娜\n", + "0044 李斌\n", + "2112 张翔\n", + "1623 黎泓松\n", + "2097 胡颖\n", + "2481 孔艳丽\n", + "1639 曹伟嘉\n", + "2115 张丽军\n", + "2111 张新芬\n", + "2068 陈文辉\n", + "2457 赖新平\n", + "0058 陈晓辉\n", + "2574 刘一统\n", + "1875 卢盛龙\n", + "2384 彭辉\n", + "2139 陈毅\n", + "1905 李诗聪\n", + "2061 廖念\n", + "2153 唐兆南\n", + "2157 胡诗琪\n", + "1591 金玉成\n", + "2149 朱凌\n", + "1714 方云星\n", + "2143 向嘉伟\n", + "2035 李南烽\n", + "2079 刘细\n", + "2196 李斌\n", + "1525 白健忠\n", + "0367 侯光明\n", + "0028 文庆伟\n", + "1512 陈万军\n", + "0084 彭昌兵\n", + "2259 刘重宇\n", + "2518 陈锦鑫\n", + "0056 郑际钧\n", + "2062 黄荣\n", + "0003 谢鑫\n", + "1502 周春峰\n", + "1576 瞿正泷\n", + "2176 张嫚\n", + "2341 刘剑楠\n", + "2389 彭超\n", + "0182 刘立文\n", + "1265 黄湘林\n", + "2021 任珍琦\n", + "1510 刘明星\n", + "1168 范连平\n", + "1996 骆洪武\n", + "2013 刘林波\n", + "2104 任金鹏\n", + "0113 屈亚平\n", + "1701 李军红\n", + "2160 湛博\n", + "2597 张钊\n", + "0079 曾丽\n", + "1361 罗军\n", + "0004 余光泉\n", + "1987 李明权\n", + "2475 龚荣\n", + "2084 王智浩\n", + "2127 姜波\n", + "1567 曾维琦\n", + "1593 荣敏\n", + "1572 王俊棋\n", + "2059 陈可\n", + "1708 易春海\n", + "0104 朱朝辉\n", + "1983 唐杰锋\n", + "1570 黄树\n", + "1519 高赛阳\n", + "2093 唐金滔\n", + "2017 高建华\n", + "0031 杨健\n", + "1636 李家秀\n", + "1575 万哲浩\n", + "1733 陈芷\n", + "2459 李开俊\n", + "1994 王卓见\n", + "2074 全世夷\n", + "0010 余宏伟\n", + "0121 易玉龙\n", + "1037 郑常浩\n", + "2054 朱喜忠\n", + "2103 王梓\n", + "2125 卞伟\n", + "2159 丁杰涛\n", + "2394 薛春喜\n", + "2099 刘毅\n", + "1984 陈志勇\n", + "2536 刘波\n", + "2335 宋珂炜\n", + "2151 李美玲\n", + "1594 孙颖\n", + "2006 叶可\n", + "1909 谭德军\n", + "2100 彭晨雨\n", + "1612 王怀\n", + "0043 徐贺红\n", + "1861 冯予译\n", + "2571 彭一夫\n", + "2432 刘忠\n", + "2168 邓野\n", + "1638 陈龙\n", + "3297 何治国\n", + "1631 刘波\n", + "0002 瞿岳云\n", + "1625 方学军\n", + "2426 罗广\n", + "0074 刘建强\n", + "2497 酉文华\n", + "1548 杨永红\n", + "1888 吴国亮\n", + "2047 石星星\n", + "0045 乔志刚\n", + "2060 徐向阳\n", + "1900 施巧\n", + "2024 谢军辉\n", + "1568 李卫华\n", + "0027 唐萍\n", + "2081 黄杰\n", + "0093 罗双辉\n", + "2063 杨杰\n", + "2065 汪剑尘\n", + "1992 姚小霞\n", + "1201 修军\n", + "2106 李青\n", + "1816 彭羿\n", + "1526 高永林\n", + "1688 郑华平\n", + "1588 汪小兵\n", + "0047 宾文\n", + "0118 孙广远\n", + "1569 王欣\n", + "2155 朱云龙\n", + "0131 罗圣\n", + "2303 何东海\n", + "2479 朱细平\n", + "2525 蔡莉\n", + "1535 周子瑜\n", + "1632 陆杨\n", + "1486 王小华\n", + "0136 胡茂山\n", + "1914 于斌\n", + "1694 易庆辉\n", + "1990 甘龙\n", + "2140 高洁\n", + "2086 何望凯\n", + "3253 刘杰\n", + "2085 李晓文\n", + "1564 向涛\n", + "0161 王雅琴\n", + "0086 王志新\n", + "1528 马明\n", + "1855 杨文轩\n", + "2109 李华锐\n", + "1571 李朝晖\n", + "0160 李莉\n", + "0022 杨佳洛\n", + "1723 郑虹\n", + "2141 马婷\n", + "1472 张文\n", + "1555 李燕舞\n", + "2073 张剑\n", + "2078 黎金龙\n", + "1470 袁康\n", + "1768 易新\n", + "2032 毛润政\n", + "1718 巴银花儿\n", + "1496 黄杰斌\n", + "2572 马璐\n", + "0312 方栩\n", + "1557 刘辉\n", + "0189 喻建兵\n", + "1507 李湘华\n", + "0024 李璇\n", + "2150 刘雨薇\n", + "2286 李林\n", + "0082 杨海顺\n", + "2077 贺飞\n", + "1611 蒋洪高\n", + "2023 梁军\n", + "1663 张叙雄\n", + "0072 彭姝\n", + "1993 陈杰\n", + "2443 吴艳红\n", + "1848 李逵\n", + "2165 刘雄峰\n", + "0076 李克胜\n", + "2088 许松\n", + "0025 杨慧文\n", + "2005 李振宇\n", + "2339 陈作\n", + "2175 李明\n", + "1489 李继林\n", + "2092 袁佳鑫\n", + "1565 唐光频\n", + "2501 黎贤贞智\n", + "1622 彭旭涛\n", + "2066 郑小芳\n", + "1616 聂琼\n", + "2120 刘瑜\n", + "0011 谭江\n", + "2869 游俊义\n", + "2004 刘敏明\n", + "1233 刘继华\n", + "2198 胡淼\n", + "2144 乔林臻\n", + "2649 丁键\n", + "1549 郑华荣\n", + "2167 熊东\n", + "1790 刘明荣\n", + "2025 彭国强\n", + "0128 王聪\n", + "1100 李琼\n", + "0096 李辉\n", + "2094 李富康\n", + "1574 吴芳\n", + "2050 彭宇\n", + "1624 周林\n", + "2314 钟亮\n", + "2028 罗文武\n", + "0048 唐平秋\n", + "0495 任勇军\n", + "1556 冯霞\n", + "1823 聂千凯\n", + "0414 陈博豪\n", + "2117 钟建东\n", + "1592 吴轩宇\n", + "2347 杨在宽\n", + "1696 邹楚辰\n", + "2009 魏刚强\n", + "2905 余熙尧\n", + "1997 于明浩\n", + "2041 李昂\n", + "1780 易浩东\n", + "1527 续颖\n", + "2162 刘明泽\n", + "0063 付伽\n", + "2156 陶冲\n", + "2456 刘琳\n", + "1986 倪博\n", + "1513 赵雨龙\n", + "2072 刘军\n", + "2116 胡敏\n", + "2070 胡向民\n", + "0041 田艳\n", + "0120 唐建强\n", + "2027 黄波\n", + "0157 王良格\n", + "1724 罗蓉\n", + "2146 李俊杰\n", + "2163 向玉娟\n", + "1211 柳志和\n", + "2161 周星宇\n", + "2113 周文\n", + "2031 张勇\n", + "1972 宋祖云\n", + "0055 皮志文\n", + "2089 梁一良\n", + "2118 周松林\n", + "1829 李华\n", + "1471 柴江华\n", + "2036 胡杰\n", + "0313 陈青\n", + "1995 张春华\n", + "2164 龚子辰\n", + "2107 邹尚辰\n" + ] + } + ], + "source": [ + "import os,sys,shutil\n", + "import json\n", + "import glob\n", + "from pathlib import Path\n", + "\n", + "fi_path = 'file/469849'\n", + "old = []\n", + "dict2 = {}\n", + "list1 = []\n", + "\n", + "filename = 'data/长炼医院人员名单.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl)\n", + " \n", + "fl = glob.glob(f'{fi_path}/*.pdf')\n", + "for fn in fl:\n", + " fi_name =Path(fn).stem.split('-')[0]\n", + " code = int(fi_name)\n", + " print(fi_name,dict1[str(code)]['name'])\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b3a24698-2dc2-4117-8bf5-319b42d1f841", "metadata": {}, "outputs": [], "source": [] @@ -396,7 +1221,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/数据处理.ipynb b/数据处理.ipynb index 0febc06..1734180 100644 --- a/数据处理.ipynb +++ b/数据处理.ipynb @@ -159,15 +159,33 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": { + "execution": { + "iopub.execute_input": "2023-08-29T03:26:35.055593Z", + "iopub.status.busy": "2023-08-29T03:26:35.055086Z", + "iopub.status.idle": "2023-08-29T03:26:35.077483Z", + "shell.execute_reply": "2023-08-29T03:26:35.076400Z", + "shell.execute_reply.started": "2023-08-29T03:26:35.055541Z" + }, "tags": [] }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "bs b'\\xd4\\xc0\\xcd\\xaf'\n", + "decode-bs: 岳童\n", + "gbcode: b'\\xc2\\xed\\xc1\\xa2\\xd1\\xc7'\n", + "gbs: c2edc1a2d1c7\n" + ] + } + ], "source": [ "import binascii\n", "\n", - "gbs = 'C0EEB574'\n", + "gbs = 'D4C0CDAF'\n", "bs = binascii.a2b_hex(gbs)\n", "print('bs', bs)\n", "print('decode-bs:', bs.decode('gbk'))\n", @@ -1440,7 +1458,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/文件操作.ipynb b/文件操作.ipynb index f2daac4..ec60e3e 100644 --- a/文件操作.ipynb +++ b/文件操作.ipynb @@ -1247,7 +1247,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.10.12" } }, "nbformat": 4, diff --git a/文件管理.ipynb b/文件管理.ipynb index 6dd3716..8e4b13a 100644 --- a/文件管理.ipynb +++ b/文件管理.ipynb @@ -1344,7 +1344,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.10.12" } }, "nbformat": 4,