diff --git a/体测单位/北海炼化.ipynb b/体测单位/北海炼化.ipynb index 6c87833..cc68c8b 100644 --- a/体测单位/北海炼化.ipynb +++ b/体测单位/北海炼化.ipynb @@ -122,26 +122,10 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": null, "id": "d2598172-cede-4baa-920e-3d676c079b7b", - "metadata": { - "execution": { - "iopub.execute_input": "2025-09-17T01:50:24.312281Z", - "iopub.status.busy": "2025-09-17T01:50:24.311666Z", - "iopub.status.idle": "2025-09-17T01:50:24.427182Z", - "shell.execute_reply": "2025-09-17T01:50:24.426684Z", - "shell.execute_reply.started": "2025-09-17T01:50:24.312223Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ok\n" - ] - } - ], + "metadata": {}, + "outputs": [], "source": [ "import json\n", "import time\n", @@ -2447,26 +2431,10 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": null, "id": "c5846968-1f2e-46b5-a79c-e2f129e5c233", - "metadata": { - "execution": { - "iopub.execute_input": "2025-09-17T01:51:05.541822Z", - "iopub.status.busy": "2025-09-17T01:51:05.541072Z", - "iopub.status.idle": "2025-09-17T01:51:05.595736Z", - "shell.execute_reply": "2025-09-17T01:51:05.595210Z", - "shell.execute_reply.started": "2025-09-17T01:51:05.541754Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ok!\n" - ] - } - ], + "metadata": {}, + "outputs": [], "source": [ "import json\n", "import time\n", @@ -2560,26 +2528,10 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": null, "id": "601f707b-bd34-4966-b781-c520a0bf69dc", - "metadata": { - "execution": { - "iopub.execute_input": "2024-12-24T07:03:16.793791Z", - "iopub.status.busy": "2024-12-24T07:03:16.793020Z", - "iopub.status.idle": "2024-12-24T07:03:16.938934Z", - "shell.execute_reply": "2024-12-24T07:03:16.938312Z", - "shell.execute_reply.started": "2024-12-24T07:03:16.793721Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "876\n" - ] - } - ], + "metadata": {}, + "outputs": [], "source": [ "import json\n", "import csv\n", @@ -2802,26 +2754,10 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": null, "id": "98e43475-06ca-42bc-b352-5c92a554e2c2", - "metadata": { - "execution": { - "iopub.execute_input": "2025-09-17T02:01:52.580879Z", - "iopub.status.busy": "2025-09-17T02:01:52.580448Z", - "iopub.status.idle": "2025-09-17T02:01:52.867257Z", - "shell.execute_reply": "2025-09-17T02:01:52.866600Z", - "shell.execute_reply.started": "2025-09-17T02:01:52.580841Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ok\n" - ] - } - ], + "metadata": {}, + "outputs": [], "source": [ "import json\n", "import openpyxl\n", @@ -3106,26 +3042,10 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "id": "58f6dbab-9ea2-4295-ae78-36951b67c2d3", - "metadata": { - "execution": { - "iopub.execute_input": "2025-10-31T04:59:33.610242Z", - "iopub.status.busy": "2025-10-31T04:59:33.609508Z", - "iopub.status.idle": "2025-10-31T04:59:33.725719Z", - "shell.execute_reply": "2025-10-31T04:59:33.725272Z", - "shell.execute_reply.started": "2025-10-31T04:59:33.610173Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "854 ok\n" - ] - } - ], + "metadata": {}, + "outputs": [], "source": [ "import openpyxl\n", "import json\n", @@ -3163,26 +3083,10 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "id": "dbe52ce7-f801-44c6-b675-f0a84867c4d9", - "metadata": { - "execution": { - "iopub.execute_input": "2025-10-31T04:59:36.768146Z", - "iopub.status.busy": "2025-10-31T04:59:36.767582Z", - "iopub.status.idle": "2025-10-31T04:59:36.787010Z", - "shell.execute_reply": "2025-10-31T04:59:36.786336Z", - "shell.execute_reply.started": "2025-10-31T04:59:36.768082Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "854 ok\n" - ] - } - ], + "metadata": {}, + "outputs": [], "source": [ "import json\n", "\n", @@ -3215,27 +3119,10 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": null, "id": "2d7f5a24-f247-4199-a84d-dcf611dbeef6", - "metadata": { - "execution": { - "iopub.execute_input": "2025-11-09T03:44:07.995486Z", - "iopub.status.busy": "2025-11-09T03:44:07.994757Z", - "iopub.status.idle": "2025-11-09T03:44:08.011078Z", - "shell.execute_reply": "2025-11-09T03:44:08.010474Z", - "shell.execute_reply.started": "2025-11-09T03:44:07.995415Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "880 熊峰 公用工程部\n", - "879 ok\n" - ] - } - ], + "metadata": {}, + "outputs": [], "source": [ "import json\n", "\n", @@ -3262,6 +3149,33 @@ "print(len(dict1),'ok')" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "f143e8d3-9e9a-4c27-be8c-88a3e5f94f51", + "metadata": {}, + "outputs": [], + "source": [ + "import json\n", + "\n", + "filename = 'data/北海炼化人员2025.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl)\n", + "\n", + "filename = 'data/data_北海2025.json'\n", + "with open(filename,'r') as fl:\n", + " list1 = json.load(fl)\n", + "for item in list1:\n", + " code = item['id'].lower()\n", + " if code in dict1.keys():\n", + " \n", + " dict1[code]['unit'] = item['unit']\n", + "filename = 'data/北海炼化人员2025.json'\n", + "with open(filename, 'w') as fl:\n", + " json.dump(dict1, fl, ensure_ascii=False)\n", + "print(len(dict1),'ok')" + ] + }, { "cell_type": "markdown", "id": "cccfebad-8fc5-4aa9-b15d-05eff2fa421f", @@ -3272,26 +3186,10 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": null, "id": "7b79c7bb-ce87-44b2-95b1-01e9cb66d5f0", - "metadata": { - "execution": { - "iopub.execute_input": "2025-11-09T03:44:19.407046Z", - "iopub.status.busy": "2025-11-09T03:44:19.406684Z", - "iopub.status.idle": "2025-11-09T03:44:19.448052Z", - "shell.execute_reply": "2025-11-09T03:44:19.447526Z", - "shell.execute_reply.started": "2025-11-09T03:44:19.407015Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "558\n" - ] - } - ], + "metadata": {}, + "outputs": [], "source": [ "import json\n", "import datetime\n", @@ -3302,7 +3200,7 @@ "filename = 'data/北海炼化人员2025.json'\n", "with open(filename,'r') as fl:\n", " dict1 = json.load(fl) \n", - "filename = 'data/marks_20251109.csv'\n", + "filename = 'data/marks_20251110.csv'\n", "re_ta = My.get_result(filename,dict1)\n", "\n", "\n", @@ -3322,17 +3220,9 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": null, "id": "ca079428-2df9-4f15-b141-2c83cd0efaf5", - "metadata": { - "execution": { - "iopub.execute_input": "2025-11-09T03:44:28.010017Z", - "iopub.status.busy": "2025-11-09T03:44:28.009339Z", - "iopub.status.idle": "2025-11-09T03:44:28.035577Z", - "shell.execute_reply": "2025-11-09T03:44:28.035016Z", - "shell.execute_reply.started": "2025-11-09T03:44:28.009952Z" - } - }, + "metadata": {}, "outputs": [], "source": [ "import json\n", @@ -3368,7 +3258,7 @@ " list2 = [k,v['人数'],v['体测人数']]\n", " list1.append(list2)\n", "\n", - "filename = 'data/北海炼化部门测试情况(截至20251109).xlsx'\n", + "filename = 'data/北海炼化部门测试情况(截至20251110).xlsx'\n", "wb = openpyxl.Workbook()\n", "sheet = wb.active\n", "sheet.append(title)\n", @@ -3388,17 +3278,9 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": null, "id": "482a3a46-31a6-433b-88a8-7cad228f853a", - "metadata": { - "execution": { - "iopub.execute_input": "2025-11-09T03:44:34.970909Z", - "iopub.status.busy": "2025-11-09T03:44:34.970151Z", - "iopub.status.idle": "2025-11-09T03:44:35.005510Z", - "shell.execute_reply": "2025-11-09T03:44:35.005025Z", - "shell.execute_reply.started": "2025-11-09T03:44:34.970841Z" - } - }, + "metadata": {}, "outputs": [], "source": [ "import json\n", @@ -3421,7 +3303,7 @@ " i+=1\n", " list1.append(list2)\n", "#print(list1)\n", - "filename = f'data/北海炼化未测试人员名单(截至20251109).xlsx'\n", + "filename = f'data/北海炼化未测试人员名单(截至20251110).xlsx'\n", "title = ['序号','员工编号','姓名','部门']\n", "wb = openpyxl.Workbook()\n", "sheet = wb.active\n", @@ -3431,10 +3313,173 @@ "wb.save(filename)" ] }, + { + "cell_type": "markdown", + "id": "bafcb189-a7b4-45bc-977a-9d7893938184", + "metadata": {}, + "source": [ + "## 问卷人员统计" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "id": "277fce35-2f95-4d52-8cab-4e27c9acd7b8", + "metadata": { + "execution": { + "iopub.execute_input": "2025-11-10T09:40:12.759033Z", + "iopub.status.busy": "2025-11-10T09:40:12.758367Z", + "iopub.status.idle": "2025-11-10T09:40:12.843476Z", + "shell.execute_reply": "2025-11-10T09:40:12.842924Z", + "shell.execute_reply.started": "2025-11-10T09:40:12.758969Z" + } + }, + "outputs": [], + "source": [ + "import json\n", + "import csv\n", + "import openpyxl\n", + "import time\n", + "from datetime import date\n", + "\n", + "\n", + "dict1 = {}\n", + "list1 = []\n", + "list2 = set()\n", + "filename = 'data/sql_20251110.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", + " list1.append(line)\n", + "nn = 0\n", + "for item in list1:\n", + " dict2 = {} \n", + " phone = str(item[0])[2:]\n", + " content = json.loads(json.loads(item[1]))\n", + " tcm = []\n", + " for i in range(0,60):\n", + " tcm.append(0)\n", + " for k, v in content.items(): \n", + " if 'tcm' not in k:\n", + " dict2[k] = v\n", + " else:\n", + " i = int(k[3:])\n", + " tcm[i-1] = int(v)\n", + " \n", + " code = phone\n", + " list2.add(code)\n", + " dict1.setdefault(code,{})\n", + " dict1[code]['name'] = content['name']\n", + " if content['gender'] == 'male':\n", + " dict1[code]['sex'] = '男'\n", + " else:\n", + " dict1[code]['sex'] = '女'\n", + " dict1[code]['birth'] = str(content['birth'])\n", + "filename = 'data/北海炼化人员2025.json'\n", + "with open(filename,'r') as fl:\n", + " dict2 = json.load(fl)\n", + "\n", + "i = 1\n", + "list3 = []\n", + "for k,v in dict2.items():\n", + " phone = str(v['phone'])\n", + " if phone not in list2:\n", + " list4 = []\n", + " list4 = [phone,v['name'],v['unit']]\n", + " list3.append(list4)\n", + "title =['手机号码','姓名','部门']\n", + "filename = 'data/北海炼化未参加问卷人员(截至20251110).xlsx'\n", + "wb = openpyxl.Workbook()\n", + "sheet = wb.active\n", + "sheet.append(title)\n", + "for row in list3:\n", + " sheet.append(row)\n", + " \n", + "wb.save(filename)\n", + "\n", + " " + ] + }, + { + "cell_type": "markdown", + "id": "e67ca2e1-a537-4eb4-9494-bfcf77139078", + "metadata": {}, + "source": [ + "## 问卷信息统计" + ] + }, { "cell_type": "code", "execution_count": null, - "id": "38024bd4-7d11-43df-956a-a62ee6bf176e", + "id": "f67f63d1-be8a-47ef-b95f-bdfca9725838", + "metadata": {}, + "outputs": [], + "source": [ + "import json\n", + "import csv\n", + "import openpyxl\n", + "import time\n", + "from datetime import date\n", + "\n", + "\n", + "dict1 = {}\n", + "list1 = []\n", + "filename = 'data/sql_20251110.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", + " list1.append(line)\n", + "nn = 0\n", + "for item in list1:\n", + " dict2 = {}\n", + " \n", + " phone = str(item[0])[2:]\n", + " content = json.loads(json.loads(item[1]))\n", + " tcm = []\n", + " for i in range(0,60):\n", + " tcm.append(0)\n", + " for k, v in content.items(): \n", + " if 'tcm' not in k:\n", + " dict2[k] = v\n", + " else:\n", + " i = int(k[3:])\n", + " tcm[i-1] = int(v)\n", + " \n", + " code = phone\n", + " dict1.setdefault(code,{})\n", + " dict1[code]['name'] = content['name']\n", + " if content['gender'] == 'male':\n", + " dict1[code]['sex'] = '男'\n", + " else:\n", + " dict1[code]['sex'] = '女'\n", + " dict1[code]['birth'] = str(content['birth'])\n", + " dict1[code]['unit'] = '北海炼化'\n", + " #dict1[code]['phone'] = phone\n", + " #dict1[code]['weight'] = dict2['weight']\n", + " #dict1[code]['waist'] = dict2['waist']\n", + " #dict1[code]['hip'] = dict2['hip']\n", + " dict1[code]['tcm'] = tcm\n", + "list1 = []\n", + "for k, v in dict1.items():\n", + " list2 = [k,v['name'],v['sex'],v['birth']]\n", + " list1.append(list2)\n", + "title =['手机号码','姓名','性别','出生年月']\n", + "filename = 'data/北海炼化问卷人员(截至20251110).xlsx'\n", + "wb = openpyxl.Workbook()\n", + "sheet = wb.active\n", + "sheet.append(title)\n", + "for row in list1:\n", + " sheet.append(row)\n", + " \n", + "wb.save(filename)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9cfbb3cd-8c5f-4353-b2fe-1eab7fa9ba6e", "metadata": {}, "outputs": [], "source": [] diff --git a/体测单位/天津石化.ipynb b/体测单位/天津石化.ipynb index 0f36931..a514900 100644 --- a/体测单位/天津石化.ipynb +++ b/体测单位/天津石化.ipynb @@ -2793,7 +2793,9 @@ { "cell_type": "markdown", "id": "08bcbf58-4356-4f30-850f-0d0ff0e2528b", - "metadata": {}, + "metadata": { + "jp-MarkdownHeadingCollapsed": true + }, "source": [ "# 第三次体测(2024年10月)" ] @@ -3395,6 +3397,122 @@ "print('ok') " ] }, + { + "cell_type": "markdown", + "id": "dd32c384-262d-4137-bb44-2d3a590438f4", + "metadata": {}, + "source": [ + "# 2025年体测" + ] + }, + { + "cell_type": "markdown", + "id": "cd516502-5515-47f5-85a0-2312d78cdca7", + "metadata": {}, + "source": [ + "## 体测人员导入" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "c101eccb-a2f3-4404-9583-682cec049160", + "metadata": { + "execution": { + "iopub.execute_input": "2025-11-10T10:34:09.617871Z", + "iopub.status.busy": "2025-11-10T10:34:09.617343Z", + "iopub.status.idle": "2025-11-10T10:34:10.297071Z", + "shell.execute_reply": "2025-11-10T10:34:10.296491Z", + "shell.execute_reply.started": "2025-11-10T10:34:09.617822Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "5053 ok\n" + ] + } + ], + "source": [ + "import openpyxl\n", + "import json\n", + "from datetime import date\n", + "\n", + "wb = openpyxl.load_workbook('data/天津石化人员2025.xlsx')\n", + "sheet = wb.active\n", + "# sheets = wb.sheetnames\n", + "person = {}\n", + "\n", + "for n in range(2, sheet.max_row+1):\n", + " code = str(sheet.cell(n, 1).value)\n", + " person.setdefault(code, {})\n", + " dict1 = {}\n", + " dict1['name'] = sheet.cell(n, 4).value\n", + " dict1['sex'] = sheet.cell(n, 5).value\n", + " dict1['birth'] = str(sheet.cell(n, 6).value).replace('/','-').split(' ')[0] \n", + " dict1['unit'] = sheet.cell(n, 2).value\n", + " dict1['sub_unit'] = sheet.cell(n, 3).value\n", + " person[code] = dict1\n", + "filename = 'data/天津石化人员2025.json'\n", + "with open(filename, 'w') as fl:\n", + " json.dump(person, fl, ensure_ascii=False)\n", + "print(len(person),'ok')" + ] + }, + { + "cell_type": "markdown", + "id": "3319058d-0a39-46f7-b493-260e1b529786", + "metadata": {}, + "source": [ + "## 生成读卡系统文件" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "85bae94e-f480-4c0b-a120-e516e6a5c14d", + "metadata": { + "execution": { + "iopub.execute_input": "2025-11-10T10:34:12.756830Z", + "iopub.status.busy": "2025-11-10T10:34:12.756579Z", + "iopub.status.idle": "2025-11-10T10:34:12.798482Z", + "shell.execute_reply": "2025-11-10T10:34:12.797837Z", + "shell.execute_reply.started": "2025-11-10T10:34:12.756807Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "5053 ok\n" + ] + } + ], + "source": [ + "import json\n", + "\n", + "filename = 'data/天津石化人员2025.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl)\n", + "list1 = []\n", + "for k, v in dict1.items():\n", + " dict2 = {}\n", + " #if dict1['sex'] =='男':\n", + " # sex = 1\n", + " \n", + " dict2 = {'id':k,'name':v['name'],'gender':v['sex'],'birth':v['birth'],'unit':v['unit']+'-'+v['sub_unit']}\n", + " list1.append(dict2)\n", + "json_data = json.dumps(list1,ensure_ascii=False, indent=4) \n", + "\n", + "# 将 json 数据写入文件\n", + "with open(\"data/card_天津石化2025.json\", \"w\",encoding = 'utf-8') as file:\n", + " file.write(json_data) \n", + "print(len(list1),'ok')" + ] + }, { "cell_type": "markdown", "id": "85a03b00-9624-4ae9-aa6d-386798d457df", diff --git a/体测单位/沧州炼化.ipynb b/体测单位/沧州炼化.ipynb index c772f99..0bed7e5 100644 --- a/体测单位/沧州炼化.ipynb +++ b/体测单位/沧州炼化.ipynb @@ -113,12 +113,12 @@ ] }, { - "cell_type": "code", - "execution_count": null, - "id": "6c1cfb7b-7252-49ff-97f9-399b658ddf38", + "cell_type": "markdown", + "id": "b4f7023f-127c-4c47-a8e2-78922fbcd975", "metadata": {}, - "outputs": [], - "source": [] + "source": [ + "## 生成读卡系统文件" + ] }, { "cell_type": "code", @@ -164,10 +164,18 @@ "print(len(list1),'ok')" ] }, + { + "cell_type": "markdown", + "id": "f9ef800a-b760-4933-b7a4-c69edef593d0", + "metadata": {}, + "source": [ + "## 导出俯卧撑成绩" + ] + }, { "cell_type": "code", "execution_count": null, - "id": "9148dcb7-ccaf-46f5-8390-ebe702ed4c02", + "id": "ccb2fe86-c588-4373-85df-37adda55c694", "metadata": {}, "outputs": [], "source": [] diff --git a/体测单位/镇海.ipynb b/体测单位/镇海.ipynb index a86cab8..50d970f 100644 --- a/体测单位/镇海.ipynb +++ b/体测单位/镇海.ipynb @@ -2225,6 +2225,59 @@ "wb.save(filename)" ] }, + { + "cell_type": "markdown", + "id": "e4c15761-e461-447a-bc60-5e5c29ba8cb3", + "metadata": {}, + "source": [ + "## 统计未提供手机号码人员明细表" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "id": "80c2b300-6a4f-4223-9b7a-9b8978ad4609", + "metadata": { + "execution": { + "iopub.execute_input": "2025-11-10T09:49:26.870477Z", + "iopub.status.busy": "2025-11-10T09:49:26.869856Z", + "iopub.status.idle": "2025-11-10T09:49:26.920161Z", + "shell.execute_reply": "2025-11-10T09:49:26.919605Z", + "shell.execute_reply.started": "2025-11-10T09:49:26.870441Z" + } + }, + "outputs": [], + "source": [ + "import json\n", + "import openpyxl\n", + "\n", + "filename = 'data/result_镇海2025.json'\n", + "with open(filename,'r') as fl:\n", + " dict1 = json.load(fl)\n", + "\n", + "filename = 'data/镇海人员2025.json'\n", + "with open(filename,'r') as fl:\n", + " dict2 = json.load(fl)\n", + "\n", + "list1 = []\n", + "\n", + "i = 1\n", + "for k, v in dict2.items(): \n", + " if 'phone' not in v.keys() and k in dict1.keys():\n", + " list2 = [i,k,v['name'],v['unit']]\n", + " i+=1\n", + " list1.append(list2)\n", + "#print(list1)\n", + "filename = f'data/镇海未提供手机号码人员名单.xlsx'\n", + "title = ['序号','员工编号','姓名','部门']\n", + "wb = openpyxl.Workbook()\n", + "sheet = wb.active\n", + "sheet.append(title)\n", + "for row in list1:\n", + " sheet.append(row) \n", + "wb.save(filename)" + ] + }, { "cell_type": "markdown", "id": "3e0e3b48-12f1-42f0-ba3c-f949857d29f7",