diff --git a/体测单位/南京化工.ipynb b/体测单位/南京化工.ipynb index 0e37cc2..50d553b 100644 --- a/体测单位/南京化工.ipynb +++ b/体测单位/南京化工.ipynb @@ -10,27 +10,12 @@ }, { "cell_type": "code", - "execution_count": 75, + "execution_count": null, "id": "bbba6efc-73cd-4db6-bae7-014724fee731", "metadata": { - "execution": { - "iopub.execute_input": "2025-07-03T14:10:10.030695Z", - "iopub.status.busy": "2025-07-03T14:10:10.030380Z", - "iopub.status.idle": "2025-07-03T14:10:10.104203Z", - "shell.execute_reply": "2025-07-03T14:10:10.103560Z", - "shell.execute_reply.started": "2025-07-03T14:10:10.030662Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "92 ok\n" - ] - } - ], + "outputs": [], "source": [ "import openpyxl\n", "import json\n", @@ -105,27 +90,12 @@ }, { "cell_type": "code", - "execution_count": 76, + "execution_count": null, "id": "970e171e-1360-448f-a28c-520ccb8f314a", "metadata": { - "execution": { - "iopub.execute_input": "2025-07-03T14:10:45.274585Z", - "iopub.status.busy": "2025-07-03T14:10:45.273833Z", - "iopub.status.idle": "2025-07-03T14:10:45.293613Z", - "shell.execute_reply": "2025-07-03T14:10:45.292999Z", - "shell.execute_reply.started": "2025-07-03T14:10:45.274514Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "86\n" - ] - } - ], + "outputs": [], "source": [ "import json\n", "import datetime\n", @@ -156,26 +126,10 @@ }, { "cell_type": "code", - "execution_count": 77, + "execution_count": null, "id": "0905ad6a-f7e4-43ed-ae29-c4850deb946b", - "metadata": { - "execution": { - "iopub.execute_input": "2025-07-03T14:10:49.291562Z", - "iopub.status.busy": "2025-07-03T14:10:49.290910Z", - "iopub.status.idle": "2025-07-03T14:10:49.313086Z", - "shell.execute_reply": "2025-07-03T14:10:49.312338Z", - "shell.execute_reply.started": "2025-07-03T14:10:49.291501Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ok!\n" - ] - } - ], + "metadata": {}, + "outputs": [], "source": [ "import json\n", "import time\n", @@ -287,16 +241,9 @@ }, { "cell_type": "code", - "execution_count": 78, + "execution_count": null, "id": "def3f47a-24ef-4815-b63b-2a16b79b4c15", "metadata": { - "execution": { - "iopub.execute_input": "2025-07-03T14:11:05.924023Z", - "iopub.status.busy": "2025-07-03T14:11:05.923517Z", - "iopub.status.idle": "2025-07-03T14:11:05.951213Z", - "shell.execute_reply": "2025-07-03T14:11:05.950561Z", - "shell.execute_reply.started": "2025-07-03T14:11:05.923975Z" - }, "tags": [] }, "outputs": [], @@ -317,7 +264,7 @@ "for k,v in dict1.items():\n", " phone1.add(v['phone'])\n", "list1 = []\n", - "filename = 'data/survey_records_20250703.csv'\n", + "filename = 'data/survey_records_20250711.csv'\n", "with open(filename,'r',newline='') as csv_file:\n", " fl = csv.reader(csv_file,delimiter=',')\n", " header = next(fl) \n", @@ -349,27 +296,10 @@ }, { "cell_type": "code", - "execution_count": 79, + "execution_count": null, "id": "9cb0172e-5f6c-4b47-8431-83dc5cc4601c", - "metadata": { - "execution": { - "iopub.execute_input": "2025-07-03T14:11:09.342124Z", - "iopub.status.busy": "2025-07-03T14:11:09.341492Z", - "iopub.status.idle": "2025-07-03T14:11:09.352176Z", - "shell.execute_reply": "2025-07-03T14:11:09.350856Z", - "shell.execute_reply.started": "2025-07-03T14:11:09.342065Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "13718042132\n", - "13705162311\n" - ] - } - ], + "metadata": {}, + "outputs": [], "source": [ "import json\n", "import csv\n", @@ -387,7 +317,7 @@ "for k,v in dict1.items():\n", " phone1.add(v['phone'])\n", "list1 = []\n", - "filename = 'data/survey_records_20250701.csv'\n", + "filename = 'data/survey_records_20250711.csv'\n", "with open(filename,'r',newline='') as csv_file:\n", " fl = csv.reader(csv_file,delimiter=',')\n", " header = next(fl) \n", @@ -410,17 +340,9 @@ }, { "cell_type": "code", - "execution_count": 80, + "execution_count": null, "id": "9d9dd574-9fbf-4d0a-96fd-9b55d98021d2", - "metadata": { - "execution": { - "iopub.execute_input": "2025-07-03T14:11:25.002448Z", - "iopub.status.busy": "2025-07-03T14:11:25.001635Z", - "iopub.status.idle": "2025-07-03T14:11:25.029582Z", - "shell.execute_reply": "2025-07-03T14:11:25.029137Z", - "shell.execute_reply.started": "2025-07-03T14:11:25.002370Z" - } - }, + "metadata": {}, "outputs": [], "source": [ "import json\n", @@ -444,7 +366,7 @@ " phone[v['phone']] = k\n", "\n", "list1 = []\n", - "filename = 'data/survey_records_20250703.csv'\n", + "filename = 'data/survey_records_20250711.csv'\n", "with open(filename,'r',newline='') as csv_file:\n", " fl = csv.reader(csv_file,delimiter=',')\n", " header = next(fl) \n", @@ -504,17 +426,9 @@ }, { "cell_type": "code", - "execution_count": 81, + "execution_count": null, "id": "4a0678c6-0c64-4314-bb03-24b10a3d695a", - "metadata": { - "execution": { - "iopub.execute_input": "2025-07-03T14:11:29.937365Z", - "iopub.status.busy": "2025-07-03T14:11:29.936849Z", - "iopub.status.idle": "2025-07-03T14:11:29.966917Z", - "shell.execute_reply": "2025-07-03T14:11:29.966365Z", - "shell.execute_reply.started": "2025-07-03T14:11:29.937316Z" - } - }, + "metadata": {}, "outputs": [], "source": [ "import json\n", @@ -545,6 +459,67 @@ " json.dump(dict1, fl, ensure_ascii=False)\n" ] }, + { + "cell_type": "markdown", + "id": "caf77c95-3090-4fa1-bcec-c9e8a38d4ca9", + "metadata": {}, + "source": [ + "## 体检报告汇总" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "b815a478-d178-4b87-9080-a779d397d945", + "metadata": { + "execution": { + "iopub.execute_input": "2025-07-23T11:12:10.951052Z", + "iopub.status.busy": "2025-07-23T11:12:10.950295Z", + "iopub.status.idle": "2025-07-23T11:12:11.030914Z", + "shell.execute_reply": "2025-07-23T11:12:11.030243Z", + "shell.execute_reply.started": "2025-07-23T11:12:10.950983Z" + } + }, + "outputs": [ + { + "ename": "FileNotFoundError", + "evalue": "[Errno 2] No such file or directory: 'file/南化体重/new/1789748-姜吉元.pdf'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[17], line 20\u001b[0m\n\u001b[1;32m 18\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m name \u001b[38;5;241m==\u001b[39m v[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mname\u001b[39m\u001b[38;5;124m'\u001b[39m]:\n\u001b[1;32m 19\u001b[0m n_name \u001b[38;5;241m=\u001b[39m Path(new_path,\u001b[38;5;28mstr\u001b[39m(k)\u001b[38;5;241m+\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m-\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;241m+\u001b[39mname\u001b[38;5;241m+\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m.pdf\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m---> 20\u001b[0m \u001b[43mshutil\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcopyfile\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfl\u001b[49m\u001b[43m,\u001b[49m\u001b[43mn_name\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 21\u001b[0m \u001b[38;5;28mprint\u001b[39m(n_name)\n", + "File \u001b[0;32m/usr/lib/python3.12/shutil.py:262\u001b[0m, in \u001b[0;36mcopyfile\u001b[0;34m(src, dst, follow_symlinks)\u001b[0m\n\u001b[1;32m 260\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28mopen\u001b[39m(src, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mrb\u001b[39m\u001b[38;5;124m'\u001b[39m) \u001b[38;5;28;01mas\u001b[39;00m fsrc:\n\u001b[1;32m 261\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 262\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28;43mopen\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mdst\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mwb\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m \u001b[38;5;28;01mas\u001b[39;00m fdst:\n\u001b[1;32m 263\u001b[0m \u001b[38;5;66;03m# macOS\u001b[39;00m\n\u001b[1;32m 264\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m _HAS_FCOPYFILE:\n\u001b[1;32m 265\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n", + "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'file/南化体重/new/1789748-姜吉元.pdf'" + ] + } + ], + "source": [ + "from pathlib import Path\n", + "import json\n", + "import shutil\n", + "\n", + "\n", + "target_directory = Path('./file/南化体重')\n", + "new_path = './file/南化体重/new'\n", + "filename = 'data/南京化工人员.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl)\n", + "# 遍历目标目录及其子目录获取所有文件\n", + "\n", + "for fl in target_directory.rglob('*.pdf'):\n", + " if fl.is_file():\n", + " fl_name = fl.stem\n", + " name = fl_name[12:] \n", + " for k, v in dict1.items(): \n", + " if name == v['name']:\n", + " n_name = Path(new_path,str(k)+'-'+name+'.pdf')\n", + " shutil.copyfile(fl,n_name)\n", + " print(n_name)\n", + " \n", + " " + ] + }, { "cell_type": "markdown", "id": "8d5f4103-0d1e-4711-b324-ece360f8dcd3", @@ -568,7 +543,7 @@ "headers = {\n", " \"Content-Type\": \"application/json; charset=UTF-8\"\n", " }\n", - "filename = 'data/result_南京化工.json'\n", + "filename = 'data/result_南京化工-1.json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl)\n", "list1 = []\n", @@ -582,7 +557,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", @@ -609,8 +584,8 @@ " 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", + " if len(mydata['fits']) >2 or len(mydata['surveys']) >0:\n", + " #if len(mydata['fits']) >2 : \n", " list1.append(mydata)\n", " list2.append([k,v['name']])\n", " i+=1\n", diff --git a/体测单位/新疆油田采油工艺研究院.ipynb b/体测单位/新疆油田采油工艺研究院.ipynb index 01ee887..25432c8 100644 --- a/体测单位/新疆油田采油工艺研究院.ipynb +++ b/体测单位/新疆油田采油工艺研究院.ipynb @@ -10,15 +10,15 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 21, "id": "bbba6efc-73cd-4db6-bae7-014724fee731", "metadata": { "execution": { - "iopub.execute_input": "2025-07-02T07:56:23.192197Z", - "iopub.status.busy": "2025-07-02T07:56:23.191439Z", - "iopub.status.idle": "2025-07-02T07:56:23.212284Z", - "shell.execute_reply": "2025-07-02T07:56:23.211376Z", - "shell.execute_reply.started": "2025-07-02T07:56:23.192125Z" + "iopub.execute_input": "2025-07-15T04:17:52.450721Z", + "iopub.status.busy": "2025-07-15T04:17:52.449970Z", + "iopub.status.idle": "2025-07-15T04:17:52.467224Z", + "shell.execute_reply": "2025-07-15T04:17:52.466044Z", + "shell.execute_reply.started": "2025-07-15T04:17:52.450647Z" }, "tags": [] }, @@ -27,7 +27,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "2 ok\n" + "3 ok\n" ] } ], @@ -47,7 +47,10 @@ " dict1 = {}\n", " dict1['name'] = sheet.cell(n, 2).value\n", " dict1['sex'] = sheet.cell(n, 3).value\n", - " dict1['unit'] = ' '#sheet.cell(n, 2).value \n", + " if sheet.cell(n,4).value is not None:\n", + " dict1['unit'] = sheet.cell(n, 4).value\n", + " else:\n", + " dict1['unit'] = ''\n", " dict1['birth'] = str(sheet.cell(n, 5).value).replace('/','-').split(' ')[0]\n", " #dict1['phone'] = sheet.cell(n, 12).value \n", " person[code] = dict1\n", @@ -67,15 +70,15 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 22, "id": "970e171e-1360-448f-a28c-520ccb8f314a", "metadata": { "execution": { - "iopub.execute_input": "2025-07-02T07:56:26.747275Z", - "iopub.status.busy": "2025-07-02T07:56:26.746522Z", - "iopub.status.idle": "2025-07-02T07:56:26.758502Z", - "shell.execute_reply": "2025-07-02T07:56:26.757404Z", - "shell.execute_reply.started": "2025-07-02T07:56:26.747205Z" + "iopub.execute_input": "2025-07-15T04:17:54.693914Z", + "iopub.status.busy": "2025-07-15T04:17:54.692725Z", + "iopub.status.idle": "2025-07-15T04:17:54.703956Z", + "shell.execute_reply": "2025-07-15T04:17:54.702901Z", + "shell.execute_reply.started": "2025-07-15T04:17:54.693844Z" }, "tags": [] }, @@ -84,7 +87,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "2\n" + "1\n" ] } ], @@ -98,7 +101,7 @@ "filename = 'data/新疆油田采油工艺研究院.json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl) \n", - "filename = 'data/marks_20250702.csv'\n", + "filename = 'data/marks_20250715.csv'\n", "re_ta = My.get_result(filename,dict1)\n", "\n", "\n", @@ -118,15 +121,15 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 23, "id": "0905ad6a-f7e4-43ed-ae29-c4850deb946b", "metadata": { "execution": { - "iopub.execute_input": "2025-07-02T07:56:29.423717Z", - "iopub.status.busy": "2025-07-02T07:56:29.422959Z", - "iopub.status.idle": "2025-07-02T07:56:29.434498Z", - "shell.execute_reply": "2025-07-02T07:56:29.433382Z", - "shell.execute_reply.started": "2025-07-02T07:56:29.423642Z" + "iopub.execute_input": "2025-07-15T04:17:57.064201Z", + "iopub.status.busy": "2025-07-15T04:17:57.063428Z", + "iopub.status.idle": "2025-07-15T04:17:57.077018Z", + "shell.execute_reply": "2025-07-15T04:17:57.075783Z", + "shell.execute_reply.started": "2025-07-15T04:17:57.064131Z" } }, "outputs": [ @@ -368,15 +371,15 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 24, "id": "23ffd115-72a3-4f90-9e64-ffa6420df8a4", "metadata": { "execution": { - "iopub.execute_input": "2025-07-02T07:56:40.122932Z", - "iopub.status.busy": "2025-07-02T07:56:40.122167Z", - "iopub.status.idle": "2025-07-02T07:56:41.662219Z", - "shell.execute_reply": "2025-07-02T07:56:41.661217Z", - "shell.execute_reply.started": "2025-07-02T07:56:40.122861Z" + "iopub.execute_input": "2025-07-15T04:18:02.549898Z", + "iopub.status.busy": "2025-07-15T04:18:02.549192Z", + "iopub.status.idle": "2025-07-15T04:18:03.406607Z", + "shell.execute_reply": "2025-07-15T04:18:03.405390Z", + "shell.execute_reply.started": "2025-07-15T04:18:02.549834Z" } }, "outputs": [ @@ -384,7 +387,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "2\n" + "1\n" ] } ], diff --git a/体测单位/海淀老干部大学.ipynb b/体测单位/海淀老干部大学.ipynb index 1ee7fa3..8362da6 100644 --- a/体测单位/海淀老干部大学.ipynb +++ b/体测单位/海淀老干部大学.ipynb @@ -122,15 +122,15 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 22, "id": "fd005ed3-24ee-4b39-a619-6c83e64c2852", "metadata": { "execution": { - "iopub.execute_input": "2025-06-30T06:01:30.713754Z", - "iopub.status.busy": "2025-06-30T06:01:30.713036Z", - "iopub.status.idle": "2025-06-30T06:01:30.730192Z", - "shell.execute_reply": "2025-06-30T06:01:30.729306Z", - "shell.execute_reply.started": "2025-06-30T06:01:30.713687Z" + "iopub.execute_input": "2025-07-07T07:36:12.263840Z", + "iopub.status.busy": "2025-07-07T07:36:12.263126Z", + "iopub.status.idle": "2025-07-07T07:36:12.282578Z", + "shell.execute_reply": "2025-07-07T07:36:12.281811Z", + "shell.execute_reply.started": "2025-07-07T07:36:12.263777Z" } }, "outputs": [ @@ -138,7 +138,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "30\n" + "32\n" ] } ], @@ -155,7 +155,7 @@ "with open(filename,'r') as fl:\n", " dict1 = json.load(fl) \n", "\n", - "filename = 'data/marks_20250627.csv'\n", + "filename = 'data/marks_20250707.csv'\n", "with open(filename,'r',newline='') as csv_file:\n", " fl = csv.reader(csv_file,delimiter=',')\n", " header = next(fl) \n", @@ -206,15 +206,15 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 23, "id": "9481765c-92b7-4a58-b192-582bb001f167", "metadata": { "execution": { - "iopub.execute_input": "2025-06-30T06:01:33.186253Z", - "iopub.status.busy": "2025-06-30T06:01:33.185404Z", - "iopub.status.idle": "2025-06-30T06:01:33.201547Z", - "shell.execute_reply": "2025-06-30T06:01:33.200481Z", - "shell.execute_reply.started": "2025-06-30T06:01:33.186179Z" + "iopub.execute_input": "2025-07-07T07:36:15.532762Z", + "iopub.status.busy": "2025-07-07T07:36:15.532205Z", + "iopub.status.idle": "2025-07-07T07:36:15.543842Z", + "shell.execute_reply": "2025-07-07T07:36:15.542589Z", + "shell.execute_reply.started": "2025-07-07T07:36:15.532709Z" } }, "outputs": [ @@ -355,15 +355,15 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 24, "id": "dd8ed4fe-5014-455f-993d-64a41519de6d", "metadata": { "execution": { - "iopub.execute_input": "2025-06-30T06:01:40.122434Z", - "iopub.status.busy": "2025-06-30T06:01:40.121692Z", - "iopub.status.idle": "2025-06-30T06:01:40.143208Z", - "shell.execute_reply": "2025-06-30T06:01:40.142553Z", - "shell.execute_reply.started": "2025-06-30T06:01:40.122360Z" + "iopub.execute_input": "2025-07-07T07:38:51.438170Z", + "iopub.status.busy": "2025-07-07T07:38:51.437458Z", + "iopub.status.idle": "2025-07-07T07:38:51.456851Z", + "shell.execute_reply": "2025-07-07T07:38:51.456386Z", + "shell.execute_reply.started": "2025-07-07T07:38:51.438105Z" } }, "outputs": [ @@ -371,7 +371,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "28\n" + "30\n" ] } ], @@ -397,7 +397,7 @@ " phone[v['phone']] = k\n", "\n", "list1 = []\n", - "filename = 'data/Survey_20250627.csv'\n", + "filename = 'data/Survey_20250707.csv'\n", "with open(filename,'r',newline='') as csv_file:\n", " fl = csv.reader(csv_file,delimiter=',')\n", " header = next(fl) \n", @@ -470,15 +470,15 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 25, "id": "b8b2fc93-9e8b-4bde-bc13-2de179de2b2d", "metadata": { "execution": { - "iopub.execute_input": "2025-06-30T06:01:46.226970Z", - "iopub.status.busy": "2025-06-30T06:01:46.226283Z", - "iopub.status.idle": "2025-06-30T06:02:03.514203Z", - "shell.execute_reply": "2025-06-30T06:02:03.513671Z", - "shell.execute_reply.started": "2025-06-30T06:01:46.226904Z" + "iopub.execute_input": "2025-07-07T07:39:01.153216Z", + "iopub.status.busy": "2025-07-07T07:39:01.152415Z", + "iopub.status.idle": "2025-07-07T07:39:18.744313Z", + "shell.execute_reply": "2025-07-07T07:39:18.743194Z", + "shell.execute_reply.started": "2025-07-07T07:39:01.153145Z" } }, "outputs": [