This commit is contained in:
512song committed 2025-11-17 22:46:37 +08:00
1 parent 48f119d087
commit 31ddcb887f
9 files changed
+1089 -276

No files matched your search

+102
View File
@@ -3513,6 +3513,108 @@
"print(len(list1),'ok')"
]
},
{
"cell_type": "markdown",
"id": "fd5cb794-6197-4204-a421-fd7a14aeab20",
"metadata": {},
"source": [
"## 获取人员测试成绩"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "52de3ba0-f430-444b-87e9-1f13c3e2dcc2",
"metadata": {
"execution": {
"iopub.execute_input": "2025-11-17T13:15:52.024202Z",
"iopub.status.busy": "2025-11-17T13:15:52.023733Z",
"iopub.status.idle": "2025-11-17T13:15:52.062303Z",
"shell.execute_reply": "2025-11-17T13:15:52.061818Z",
"shell.execute_reply.started": "2025-11-17T13:15:52.024158Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"253\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/天津石化人员2025.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"filename = 'data/marks_20251117-2.csv'\n",
"re_ta = My.get_result(filename,dict1)\n",
"\n",
"\n",
"filename = 'data/result_天津石化2025.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": "f58f041b-a3cb-475c-8ac2-a8a747c96386",
"metadata": {},
"source": [
"## 统计未体测人员明细表"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "04990b9f-a8f9-4442-935e-d223fde24e72",
"metadata": {
"execution": {
"iopub.execute_input": "2025-11-17T13:21:58.571623Z",
"iopub.status.busy": "2025-11-17T13:21:58.570712Z",
"iopub.status.idle": "2025-11-17T13:21:58.620055Z",
"shell.execute_reply": "2025-11-17T13:21:58.619536Z",
"shell.execute_reply.started": "2025-11-17T13:21:58.571556Z"
}
},
"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 dict1.items(): \n",
" list2 = [i,k,v['name'],v['unit']]\n",
" i+=1\n",
" list1.append(list2)\n",
"#print(list1)\n",
"filename = f'data/天津石化体测人员名单(截至20251117).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": "85a03b00-9624-4ae9-aa6d-386798d457df",