This commit is contained in:
512song committed 2023-10-09 00:26:37 +08:00
1 parent f0ab029617
commit 92a5aa7420
3 files changed
+128 -41

No files matched your search

+127 -40
View File
@@ -1505,15 +1505,15 @@
},
{
"cell_type": "code",
"execution_count": 100,
"execution_count": 118,
"id": "25283932-c03a-4a34-a59d-314fc64d8fbd",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-07T13:38:25.903412Z",
"iopub.status.busy": "2023-10-07T13:38:25.902894Z",
"iopub.status.idle": "2023-10-07T13:38:26.615317Z",
"shell.execute_reply": "2023-10-07T13:38:26.614878Z",
"shell.execute_reply.started": "2023-10-07T13:38:25.903374Z"
"iopub.execute_input": "2023-10-08T09:26:11.435305Z",
"iopub.status.busy": "2023-10-08T09:26:11.434910Z",
"iopub.status.idle": "2023-10-08T09:26:12.106407Z",
"shell.execute_reply": "2023-10-08T09:26:12.105853Z",
"shell.execute_reply.started": "2023-10-08T09:26:11.435275Z"
},
"tags": []
},
@@ -1600,15 +1600,15 @@
},
{
"cell_type": "code",
"execution_count": 103,
"execution_count": 119,
"id": "e26b88fc-c75b-4c1e-82ea-5017370afa9b",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-07T13:39:05.251760Z",
"iopub.status.busy": "2023-10-07T13:39:05.251487Z",
"iopub.status.idle": "2023-10-07T13:39:05.415155Z",
"shell.execute_reply": "2023-10-07T13:39:05.414701Z",
"shell.execute_reply.started": "2023-10-07T13:39:05.251741Z"
"iopub.execute_input": "2023-10-08T09:26:17.879551Z",
"iopub.status.busy": "2023-10-08T09:26:17.879342Z",
"iopub.status.idle": "2023-10-08T09:26:18.054445Z",
"shell.execute_reply": "2023-10-08T09:26:18.053896Z",
"shell.execute_reply.started": "2023-10-08T09:26:17.879537Z"
},
"tags": []
},
@@ -1617,8 +1617,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"3119\n",
"3119\n"
"3410\n",
"3410\n"
]
}
],
@@ -1641,7 +1641,7 @@
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"\n",
"filename = 'data/places_result_20231007.csv'\n",
"filename = 'data/places_result_20231008.csv'\n",
"with open(filename,'r',newline='') as csv_file:\n",
" fl = csv.reader(csv_file,delimiter=',')\n",
" header = next(fl) \n",
@@ -1680,15 +1680,15 @@
},
{
"cell_type": "code",
"execution_count": 104,
"execution_count": 120,
"id": "0a6ea33d-c112-4ed8-9366-3376e55a5731",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-07T13:39:31.514453Z",
"iopub.status.busy": "2023-10-07T13:39:31.514051Z",
"iopub.status.idle": "2023-10-07T13:39:32.378909Z",
"shell.execute_reply": "2023-10-07T13:39:32.378415Z",
"shell.execute_reply.started": "2023-10-07T13:39:31.514423Z"
"iopub.execute_input": "2023-10-08T09:26:29.234975Z",
"iopub.status.busy": "2023-10-08T09:26:29.234575Z",
"iopub.status.idle": "2023-10-08T09:26:30.234297Z",
"shell.execute_reply": "2023-10-08T09:26:30.233793Z",
"shell.execute_reply.started": "2023-10-08T09:26:29.234944Z"
},
"tags": []
},
@@ -1724,7 +1724,7 @@
" else:\n",
" list2.append('') \n",
" list1.append(list2)\n",
"filename = 'data/天津石化体测情况(截至20231007).xlsx'\n",
"filename = 'data/天津石化体测情况(截至20231008).xlsx'\n",
"wb = openpyxl.Workbook()\n",
"sheet = wb.active\n",
"sheet.append(title)\n",
@@ -1744,15 +1744,15 @@
},
{
"cell_type": "code",
"execution_count": 105,
"execution_count": 117,
"id": "589a5d44-605d-41a1-a981-7ec7258305ed",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-07T13:39:52.275607Z",
"iopub.status.busy": "2023-10-07T13:39:52.275395Z",
"iopub.status.idle": "2023-10-07T13:39:52.313594Z",
"shell.execute_reply": "2023-10-07T13:39:52.313117Z",
"shell.execute_reply.started": "2023-10-07T13:39:52.275592Z"
"iopub.execute_input": "2023-10-08T09:22:04.167779Z",
"iopub.status.busy": "2023-10-08T09:22:04.167511Z",
"iopub.status.idle": "2023-10-08T09:22:04.252535Z",
"shell.execute_reply": "2023-10-08T09:22:04.251999Z",
"shell.execute_reply.started": "2023-10-08T09:22:04.167759Z"
},
"tags": []
},
@@ -1789,7 +1789,7 @@
" list2 = [k,v['人数']]\n",
" list1.append(list2)\n",
"\n",
"filename = 'data/天津部门未测试情况(截至20231007).xlsx'\n",
"filename = 'data/天津部门未测试情况(截至20231008).xlsx'\n",
"wb = openpyxl.Workbook()\n",
"sheet = wb.active\n",
"sheet.append(title)\n",
@@ -1809,15 +1809,15 @@
},
{
"cell_type": "code",
"execution_count": 106,
"execution_count": 111,
"id": "2f7c9847-f283-4a09-b385-2c7559be7c7e",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-07T13:40:03.467534Z",
"iopub.status.busy": "2023-10-07T13:40:03.467035Z",
"iopub.status.idle": "2023-10-07T13:40:03.543492Z",
"shell.execute_reply": "2023-10-07T13:40:03.542125Z",
"shell.execute_reply.started": "2023-10-07T13:40:03.467498Z"
"iopub.execute_input": "2023-10-08T07:33:01.133632Z",
"iopub.status.busy": "2023-10-08T07:33:01.133414Z",
"iopub.status.idle": "2023-10-08T07:33:01.179672Z",
"shell.execute_reply": "2023-10-08T07:33:01.179189Z",
"shell.execute_reply.started": "2023-10-08T07:33:01.133617Z"
},
"tags": []
},
@@ -1833,8 +1833,8 @@
"filename = 'data/天津石化人员名单2023.json'\n",
"with open(filename,'r') as fl:\n",
" dict2 = json.load(fl)\n",
"unit_name = '聚醚部'\n",
"rq = '20231007'\n",
"unit_name = '炼油部'\n",
"rq = '20231008'\n",
"list1 = []\n",
"\n",
"i = 1\n",
@@ -1850,15 +1850,102 @@
"sheet = wb.active\n",
"sheet.append(title)\n",
"for row in list1:\n",
" sheet.append(row)\n",
" \n",
" sheet.append(row) \n",
"wb.save(filename)"
]
},
{
"cell_type": "markdown",
"id": "a0754a83-0b8e-4bd8-9deb-b7d70a850f43",
"metadata": {},
"source": [
"## 统计所有部门未体测人员明细表"
]
},
{
"cell_type": "code",
"execution_count": 121,
"id": "e47c361d-a047-4932-b24e-fdcf65cb8a73",
"metadata": {
"execution": {
"iopub.execute_input": "2023-10-08T10:04:34.305324Z",
"iopub.status.busy": "2023-10-08T10:04:34.304821Z",
"iopub.status.idle": "2023-10-08T10:04:34.620050Z",
"shell.execute_reply": "2023-10-08T10:04:34.619573Z",
"shell.execute_reply.started": "2023-10-08T10:04:34.305290Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"党委党校(培训中心)未测试人员名单(截至20231008)生产成功!\n",
"研究院未测试人员名单(截至20231008)生产成功!\n",
"原油储运部未测试人员名单(截至20231008)生产成功!\n",
"烯烃部未测试人员名单(截至20231008)生产成功!\n",
"化验计量部未测试人员名单(截至20231008)生产成功!\n",
"水务部未测试人员名单(截至20231008)生产成功!\n",
"消防支队未测试人员名单(截至20231008)生产成功!\n",
"公司机关未测试人员名单(截至20231008)生产成功!\n",
"聚醚部未测试人员名单(截至20231008)生产成功!\n",
"装备研究院未测试人员名单(截至20231008)生产成功!\n",
"电仪部未测试人员名单(截至20231008)生产成功!\n",
"行政事务中心未测试人员名单(截至20231008)生产成功!\n",
"运输销售部未测试人员名单(截至20231008)生产成功!\n",
"南港乙烯项目管理部未测试人员名单(截至20231008)生产成功!\n",
"热电部未测试人员名单(截至20231008)生产成功!\n",
"化工部未测试人员名单(截至20231008)生产成功!\n",
"南港烯烃部未测试人员名单(截至20231008)生产成功!\n",
"信息档案管理中心未测试人员名单(截至20231008)生产成功!\n",
"物资采购中心未测试人员名单(截至20231008)生产成功!\n",
"炼油部未测试人员名单(截至20231008)生产成功!\n"
]
}
],
"source": [
"import json\n",
"import openpyxl\n",
"\n",
"filename = 'data/result_天津2023.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"unit = set()\n",
"for k, v in dict1.items():\n",
" unit.add(v['unit'])\n",
"rq = '20231008'\n",
"filename = 'data/天津石化人员名单2023.json'\n",
"with open(filename,'r') as fl:\n",
" dict2 = json.load(fl)\n",
"for unit_name in unit:\n",
" list1 = []\n",
"\n",
" i = 1\n",
" for k, v in dict2.items():\n",
" unit = v['unit']\n",
" if unit == unit_name and k not in dict1.keys():\n",
" list2 = [i,k,v['name'],unit,v['sub_unit']]\n",
" i+=1\n",
" list1.append(list2)\n",
" filename = f'data/天津石化{unit_name}未测试人员名单(截至{rq}).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)\n",
" wb.close\n",
" print(f'{unit_name}未测试人员名单(截至{rq})生产成功!')\n",
"\n",
" "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f4bfc9f6-9d90-4ab1-8682-c012962389f0",
"id": "756df8f2-70ab-4f7f-9cc7-66c57fd47548",
"metadata": {},
"outputs": [],
"source": []