This commit is contained in:
512song committed 2025-11-14 13:50:06 +08:00
1 parent f3a7c981d5
commit 48f119d087
5 files changed
+1196 -131

No files matched your search

+222 -10
View File
@@ -10,15 +10,15 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 25,
"id": "270e8c57-36d3-476c-8c50-4d8bc38a918a",
"metadata": {
"execution": {
"iopub.execute_input": "2025-11-09T05:35:45.149501Z",
"iopub.status.busy": "2025-11-09T05:35:45.148976Z",
"iopub.status.idle": "2025-11-09T05:35:45.291101Z",
"shell.execute_reply": "2025-11-09T05:35:45.290596Z",
"shell.execute_reply.started": "2025-11-09T05:35:45.149453Z"
"iopub.execute_input": "2025-11-13T08:43:12.873509Z",
"iopub.status.busy": "2025-11-13T08:43:12.873249Z",
"iopub.status.idle": "2025-11-13T08:43:13.076138Z",
"shell.execute_reply": "2025-11-13T08:43:13.075593Z",
"shell.execute_reply.started": "2025-11-13T08:43:12.873486Z"
}
},
"outputs": [
@@ -26,7 +26,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"1299 ok\n"
"1301 ok\n"
]
}
],
@@ -48,7 +48,8 @@
" 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, 3).value\n",
" dict1['phone'] = str(sheet.cell(n, 7).value)\n",
" if sheet.cell(n, 7).value is not None:\n",
" dict1['phone'] = str(sheet.cell(n, 7).value)\n",
" person[code] = dict1\n",
"filename = 'data/沧州炼化人员.json'\n",
"with open(filename, 'w') as fl:\n",
@@ -169,13 +170,224 @@
"id": "f9ef800a-b760-4933-b7a4-c69edef593d0",
"metadata": {},
"source": [
"## 导出俯卧撑成绩"
"## 获取人员测试成绩"
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "ccb2fe86-c588-4373-85df-37adda55c694",
"metadata": {
"execution": {
"iopub.execute_input": "2025-11-14T04:02:24.632013Z",
"iopub.status.busy": "2025-11-14T04:02:24.631372Z",
"iopub.status.idle": "2025-11-14T04:02:24.726424Z",
"shell.execute_reply": "2025-11-14T04:02:24.725880Z",
"shell.execute_reply.started": "2025-11-14T04:02:24.631959Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1175\n"
]
}
],
"source": [
"import json\n",
"import datetime\n",
"import csv\n",
"from datetime import date\n",
"import my_module1 as My\n",
"\n",
"filename = 'data/沧州炼化人员.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"filename = 'data/marks_20251114.csv'\n",
"re_ta = My.get_result(filename,dict1)\n",
"\n",
"\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))"
]
},
{
"cell_type": "markdown",
"id": "a446935a-db14-41d5-9420-d1a5ddd0e548",
"metadata": {},
"source": [
"## 统计各部门测试情况"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "503c30bb-c537-43f6-b3c7-a1eeff4c313f",
"metadata": {
"execution": {
"iopub.execute_input": "2025-11-14T04:02:34.921004Z",
"iopub.status.busy": "2025-11-14T04:02:34.920268Z",
"iopub.status.idle": "2025-11-14T04:02:34.953734Z",
"shell.execute_reply": "2025-11-14T04:02:34.953246Z",
"shell.execute_reply.started": "2025-11-14T04:02:34.920949Z"
}
},
"outputs": [],
"source": [
"import json\n",
"\n",
"filename = 'data/result_沧州炼化.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"\n",
"filename = 'data/沧州炼化人员.json'\n",
"with open(filename,'r') as fl:\n",
" dict2 = json.load(fl)\n",
"\n",
"dict3 = {}\n",
"for k, v in dict2.items():\n",
" unit = v['unit']\n",
" #sub_unit = v['sub_unit']\n",
" dict3.setdefault(unit,{})\n",
" dict3[unit].setdefault('人数',0)\n",
" dict3[unit].setdefault('体测人数',0)\n",
" #dict3[unit].setdefault(sub_unit,0)\n",
" #dict3[unit][sub_unit] = dict3[unit][sub_unit] + 1\n",
" dict3[unit]['人数'] = dict3[unit]['人数'] + 1\n",
"\n",
"title =['单位','体测人数']\n",
"list1 = []\n",
"for k,v in dict1.items(): \n",
" unit = v['unit']\n",
" #sub_unit = v['sub_unit']\n",
" #dict3[unit][sub_unit] = dict3[unit][sub_unit] - 1\n",
" dict3[unit].setdefault('体测人数',0)\n",
" dict3[unit]['体测人数'] = dict3[unit]['体测人数'] + 1\n",
"for k, v in dict3.items():\n",
" list2 = [k,v['人数'],v['体测人数']]\n",
" list1.append(list2)\n",
"\n",
"filename = 'data/沧州炼化部门测试情况(截至20251114).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": "markdown",
"id": "e04d391d-57cb-4ece-a77b-b940950f6717",
"metadata": {},
"source": [
"## 统计未体测人员明细表"
]
},
{
"cell_type": "code",
"execution_count": 31,
"id": "57de7845-76f2-4cdc-88a9-eb869acb28a5",
"metadata": {
"execution": {
"iopub.execute_input": "2025-11-14T04:02:42.621335Z",
"iopub.status.busy": "2025-11-14T04:02:42.620669Z",
"iopub.status.idle": "2025-11-14T04:02:42.655530Z",
"shell.execute_reply": "2025-11-14T04:02:42.654876Z",
"shell.execute_reply.started": "2025-11-14T04:02:42.621305Z"
}
},
"outputs": [],
"source": [
"import json\n",
"import openpyxl\n",
"\n",
"filename = 'data/result_沧州炼化.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"\n",
"filename = 'data/沧州炼化人员.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 k not 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/沧州炼化未测试人员名单(截至20251114).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": "9d39b9e8-7932-4f99-88da-0becf48d73e0",
"metadata": {},
"source": [
"## 统计体测人员项目数"
]
},
{
"cell_type": "code",
"execution_count": 34,
"id": "c2ca861f-54ca-4312-bf24-20dbc2f3f2e6",
"metadata": {
"execution": {
"iopub.execute_input": "2025-11-14T04:11:04.381187Z",
"iopub.status.busy": "2025-11-14T04:11:04.380519Z",
"iopub.status.idle": "2025-11-14T04:11:04.413211Z",
"shell.execute_reply": "2025-11-14T04:11:04.412250Z",
"shell.execute_reply.started": "2025-11-14T04:11:04.381125Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1553238 齐金永 公用工程部 13231725301 2\n",
"1553763 王鑫 应急救援中心 15632778668 2\n",
"1552999 赵崇胜 储运部 13722775060 2\n",
"01553836 王成柱 炼油一部 13111760190 1\n",
"01553839 徐振柱 炼油一部 17772650508 1\n"
]
}
],
"source": [
"import json\n",
"\n",
"filename = 'data/result_沧州炼化.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"xm = ['bmi','lung','grip','flexion','jump','pushup','balance','reaction','step','situp']\n",
"for k,v in dict1.items():\n",
" list1 = []\n",
" for item in v.keys():\n",
" if item in xm:\n",
" list1.append(item)\n",
" if len(list1) <3:\n",
" print(k,v['name'],v['unit'],v['phone'],len(list1))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ccb2fe86-c588-4373-85df-37adda55c694",
"id": "e6dea90d-2b60-4ff5-9598-a49f41b6ab24",
"metadata": {},
"outputs": [],
"source": []