20241107
This commit is contained in:
1 parent
3c3389a01e
commit
176bb74525
2 files changed
+438
-547
No files matched your search
+386
-158
@@ -2252,16 +2252,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 325,
|
||||
"execution_count": null,
|
||||
"id": "3fa6a1a9-63af-4f4e-9d30-b94f4357f7dc",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-20T01:58:47.982585Z",
|
||||
"iopub.status.busy": "2023-12-20T01:58:47.982111Z",
|
||||
"iopub.status.idle": "2023-12-20T01:58:48.241957Z",
|
||||
"shell.execute_reply": "2023-12-20T01:58:48.241442Z",
|
||||
"shell.execute_reply.started": "2023-12-20T01:58:47.982530Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
@@ -2499,27 +2492,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 324,
|
||||
"execution_count": null,
|
||||
"id": "8397633f-fddb-4cfa-b9bd-e38f3fe6772c",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-19T04:46:55.234792Z",
|
||||
"iopub.status.busy": "2023-12-19T04:46:55.234584Z",
|
||||
"iopub.status.idle": "2023-12-19T04:46:55.720872Z",
|
||||
"shell.execute_reply": "2023-12-19T04:46:55.720417Z",
|
||||
"shell.execute_reply.started": "2023-12-19T04:46:55.234777Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import os,sys,shutil\n",
|
||||
"import json\n",
|
||||
@@ -2558,16 +2536,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 323,
|
||||
"execution_count": null,
|
||||
"id": "35d1738a-1ec1-4764-bcbd-c1333fac6bfd",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-19T04:45:06.677002Z",
|
||||
"iopub.status.busy": "2023-12-19T04:45:06.676614Z",
|
||||
"iopub.status.idle": "2023-12-19T04:45:06.915694Z",
|
||||
"shell.execute_reply": "2023-12-19T04:45:06.915217Z",
|
||||
"shell.execute_reply.started": "2023-12-19T04:45:06.676971Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
@@ -2734,27 +2705,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 319,
|
||||
"execution_count": null,
|
||||
"id": "ca0780fe-5d74-4d4e-ad1d-38813040c778",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-18T11:26:08.026183Z",
|
||||
"iopub.status.busy": "2023-12-18T11:26:08.025794Z",
|
||||
"iopub.status.idle": "2023-12-18T11:26:08.295041Z",
|
||||
"shell.execute_reply": "2023-12-18T11:26:08.294596Z",
|
||||
"shell.execute_reply.started": "2023-12-18T11:26:08.026152Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import csv\n",
|
||||
@@ -2796,29 +2752,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 318,
|
||||
"execution_count": null,
|
||||
"id": "9b469138-1da9-43ca-98e8-8dc6cb3916ce",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-18T11:18:59.322901Z",
|
||||
"iopub.status.busy": "2023-12-18T11:18:59.322423Z",
|
||||
"iopub.status.idle": "2023-12-18T11:18:59.414582Z",
|
||||
"shell.execute_reply": "2023-12-18T11:18:59.414174Z",
|
||||
"shell.execute_reply.started": "2023-12-18T11:18:59.322852Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"1730629\n",
|
||||
"3499711\n",
|
||||
"3145556\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import csv\n",
|
||||
@@ -2869,26 +2808,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 53,
|
||||
"execution_count": null,
|
||||
"id": "2fdbadd7-e9b1-45bf-ae95-52b4d65e03e8",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-10-30T11:24:58.227514Z",
|
||||
"iopub.status.busy": "2024-10-30T11:24:58.226738Z",
|
||||
"iopub.status.idle": "2024-10-30T11:24:58.856785Z",
|
||||
"shell.execute_reply": "2024-10-30T11:24:58.856213Z",
|
||||
"shell.execute_reply.started": "2024-10-30T11:24:58.227440Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import openpyxl\n",
|
||||
"import json\n",
|
||||
@@ -2926,26 +2849,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"execution_count": null,
|
||||
"id": "ddb84188-aafb-49b3-836d-79d9b13dfe35",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-10-14T05:51:16.063432Z",
|
||||
"iopub.status.busy": "2024-10-14T05:51:16.062897Z",
|
||||
"iopub.status.idle": "2024-10-14T05:51:16.111372Z",
|
||||
"shell.execute_reply": "2024-10-14T05:51:16.110782Z",
|
||||
"shell.execute_reply.started": "2024-10-14T05:51:16.063381Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"\n",
|
||||
@@ -2978,27 +2885,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 60,
|
||||
"execution_count": null,
|
||||
"id": "f922ad6a-e7ff-4ff9-923f-3e7aa8ea112b",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-11-04T01:48:56.782816Z",
|
||||
"iopub.status.busy": "2024-11-04T01:48:56.782058Z",
|
||||
"iopub.status.idle": "2024-11-04T01:48:57.061456Z",
|
||||
"shell.execute_reply": "2024-11-04T01:48:57.060893Z",
|
||||
"shell.execute_reply.started": "2024-11-04T01:48:56.782746Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"4078\n",
|
||||
"4078\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import time\n",
|
||||
@@ -3057,17 +2947,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 62,
|
||||
"execution_count": null,
|
||||
"id": "f59cf12c-d409-4de8-80f9-8264e4a2d221",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-11-04T01:50:30.199976Z",
|
||||
"iopub.status.busy": "2024-11-04T01:50:30.199216Z",
|
||||
"iopub.status.idle": "2024-11-04T01:50:31.228142Z",
|
||||
"shell.execute_reply": "2024-11-04T01:50:31.227668Z",
|
||||
"shell.execute_reply.started": "2024-11-04T01:50:30.199902Z"
|
||||
}
|
||||
},
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
@@ -3120,17 +3002,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 59,
|
||||
"execution_count": null,
|
||||
"id": "8301201e-43fc-4d24-94a0-9c554ca39dfb",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-10-31T09:18:08.391778Z",
|
||||
"iopub.status.busy": "2024-10-31T09:18:08.391003Z",
|
||||
"iopub.status.idle": "2024-10-31T09:18:08.453792Z",
|
||||
"shell.execute_reply": "2024-10-31T09:18:08.453243Z",
|
||||
"shell.execute_reply.started": "2024-10-31T09:18:08.391707Z"
|
||||
}
|
||||
},
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
@@ -3176,17 +3050,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 8,
|
||||
"execution_count": null,
|
||||
"id": "efff43f0-a5f8-4de8-9f79-9564bf4fbb63",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-10-17T09:21:23.875202Z",
|
||||
"iopub.status.busy": "2024-10-17T09:21:23.874694Z",
|
||||
"iopub.status.idle": "2024-10-17T09:21:23.909617Z",
|
||||
"shell.execute_reply": "2024-10-17T09:21:23.908972Z",
|
||||
"shell.execute_reply.started": "2024-10-17T09:21:23.875155Z"
|
||||
}
|
||||
},
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
@@ -3226,6 +3092,368 @@
|
||||
"wb.save(filename)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "0e3c4368-a2d7-43c7-805a-7262cf43060c",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 部门、车间合并"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 11,
|
||||
"id": "e3eeb600-81a7-4220-bbfd-b0325f2ca06d",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-11-07T04:48:06.932386Z",
|
||||
"iopub.status.busy": "2024-11-07T04:48:06.931738Z",
|
||||
"iopub.status.idle": "2024-11-07T04:48:07.201453Z",
|
||||
"shell.execute_reply": "2024-11-07T04:48:07.200881Z",
|
||||
"shell.execute_reply.started": "2024-11-07T04:48:06.932361Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"4078\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"\n",
|
||||
"filename = 'data/result_天津石化2024.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"\n",
|
||||
"filename = 'data/天津石化人员2024.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict2 = json.load(fl)\n",
|
||||
"\n",
|
||||
"dict3 = {}\n",
|
||||
"for k, v in dict1.items():\n",
|
||||
" unit = v['unit']\n",
|
||||
" sub_unit = dict2[k]['sub_unit']\n",
|
||||
" v['sub_unit'] = sub_unit\n",
|
||||
"filename = 'data/result_天津2024(部门).json'\n",
|
||||
"\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(dict1, fl, ensure_ascii=False) \n",
|
||||
"print(len(dict1))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 15,
|
||||
"id": "9554ebdf-6a19-4301-8c14-465d6ae4d870",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-11-07T05:17:56.871294Z",
|
||||
"iopub.status.busy": "2024-11-07T05:17:56.871011Z",
|
||||
"iopub.status.idle": "2024-11-07T05:17:56.944831Z",
|
||||
"shell.execute_reply": "2024-11-07T05:17:56.944011Z",
|
||||
"shell.execute_reply.started": "2024-11-07T05:17:56.871269Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"物资采购中心 综合计划科 12\n",
|
||||
"公司机关 经营计划部 10\n",
|
||||
"研究院 科技开发中心 10\n",
|
||||
"化验计量部 安全设备科 11\n",
|
||||
"原油储运部 生产运行科 11\n",
|
||||
"电仪部 安全生产科 9\n",
|
||||
"水务部 设备科 7\n",
|
||||
"化工部 综合科(党群工作科、人力资源科) 20\n",
|
||||
"党委党校(培训中心) 综合科 14\n",
|
||||
"烯烃部 储运车间 8\n",
|
||||
"电仪部 电仪作业二区 10\n",
|
||||
"炼油部 设备科 7\n",
|
||||
"炼油部 联合六车间 9\n",
|
||||
"水务部 生产技术科 9\n",
|
||||
"烯烃部 聚丙烯车间 9\n",
|
||||
"信息档案管理中心 网络与通讯室 15\n",
|
||||
"公司机关 财务中心 9\n",
|
||||
"原油储运部 南港商储库 11\n",
|
||||
"物资采购中心 供应链管理科(招标办公室) 20\n",
|
||||
"电仪部 电仪作业三区 10\n",
|
||||
"电仪部 仪表作业一区 10\n",
|
||||
"水务部 水处理二车间 10\n",
|
||||
"电仪部 党群工作科(综合科) 14\n",
|
||||
"烯烃部 综合科(党群工作科、人力资源科) 20\n",
|
||||
"信息档案管理中心 ERP支持室 15\n",
|
||||
"公司机关 设备管理部 10\n",
|
||||
"聚醚部 研发中心 8\n",
|
||||
"行政事务中心 厂容绿化科 12\n",
|
||||
"研究院 材料技术研究一室 12\n",
|
||||
"研究院 理化研究室 9\n",
|
||||
"公司机关 安全环保部 10\n",
|
||||
"物资采购中心 储运配送车间 13\n",
|
||||
"研究院 精细化工团队 10\n",
|
||||
"热电部 新锅炉车间 9\n",
|
||||
"电仪部 电气作业一区 10\n",
|
||||
"研究院 材料技术研究二室 12\n",
|
||||
"水务部 综合科 7\n",
|
||||
"运输销售部 综合科(党群工作科) 16\n",
|
||||
"炼油部 党群工作科(人力资源科) 16\n",
|
||||
"电仪部 电气科 7\n",
|
||||
"装备研究院 设备安保室 11\n",
|
||||
"烯烃部 聚乙烯车间 9\n",
|
||||
"化工部 安全环保科 9\n",
|
||||
"党委党校(培训中心) 专业培训室 16\n",
|
||||
"消防支队 党群(综合)科 12\n",
|
||||
"聚醚部 党群工作科 9\n",
|
||||
"炼油部 安全环保科 9\n",
|
||||
"化工部 储运车间 8\n",
|
||||
"化验计量部 烯烃化验站 11\n",
|
||||
"原油储运部 天津商储库 11\n",
|
||||
"研究院 化工技术研究二室 12\n",
|
||||
"水务部 安全环保科 9\n",
|
||||
"装备研究院 综合室(党群工作室) 16\n",
|
||||
"南港烯烃部 ABS装置 11\n",
|
||||
"热电部 燃料车间 8\n",
|
||||
"行政事务中心 车队 9\n",
|
||||
"行政事务中心 离退服务室 12\n",
|
||||
"研究院 新能源技术研究室 12\n",
|
||||
"炼油部 保卫组 7\n",
|
||||
"公司机关 群众工作部 10\n",
|
||||
"研究院 设备安保科 9\n",
|
||||
"烯烃部 设备科 7\n",
|
||||
"热电部 汽机车间 8\n",
|
||||
"炼油部 联合九车间 9\n",
|
||||
"行政事务中心 信访室 10\n",
|
||||
"炼油部 生产科 7\n",
|
||||
"炼油部 联合一车间 9\n",
|
||||
"化工部 生产技术科 9\n",
|
||||
"运输销售部 调运队 9\n",
|
||||
"热电部 安全环保科 9\n",
|
||||
"信息档案管理中心 档案室 12\n",
|
||||
"公司机关 企业管理部 10\n",
|
||||
"化验计量部 化工化验站 11\n",
|
||||
"电仪部 控制系统运维室 11\n",
|
||||
"化验计量部 综合科 9\n",
|
||||
"化验计量部 环境监测和职业卫生检测站 18\n",
|
||||
"装备研究院 生产经营中心 12\n",
|
||||
"公司机关 工程部 8\n",
|
||||
"行政事务中心 综合服务队 12\n",
|
||||
"水务部 水处理一车间 10\n",
|
||||
"烯烃部 安全环保科 9\n",
|
||||
"化验计量部 党群工作科(人力资源科) 18\n",
|
||||
"原油储运部 党群工作科(人事科) 16\n",
|
||||
"运输销售部 销售运行中心 12\n",
|
||||
"装备研究院 科技开发中心 12\n",
|
||||
"电仪部 仪表科 7\n",
|
||||
"原油储运部 实华商储库 11\n",
|
||||
"化工部 环氧丙烷车间 10\n",
|
||||
"公司机关 审计部 8\n",
|
||||
"聚醚部 综合科 7\n",
|
||||
"聚醚部 聚醚装置区 9\n",
|
||||
"运输销售部 统销统配室 11\n",
|
||||
"物资采购中心 设备采购室(国产化办公室) 20\n",
|
||||
"公司机关 纪委 7\n",
|
||||
"炼油部 联合三车间 9\n",
|
||||
"化验计量部 炼油化验站 11\n",
|
||||
"聚醚部 销售中心 8\n",
|
||||
"研究院 党群工作科(综合科) 14\n",
|
||||
"电仪部 电仪南港分部 10\n",
|
||||
"化工部 芳烃车间 8\n",
|
||||
"聚醚部 生产技术科 9\n",
|
||||
"化工部 设备科 7\n",
|
||||
"物资采购中心 材料采购室 12\n",
|
||||
"物资采购中心 三剂采购室 12\n",
|
||||
"信息档案管理中心 党群工作室(综合科) 19\n",
|
||||
"炼油部 油品车间 8\n",
|
||||
"党委党校(培训中心) 党建与管理培训室 19\n",
|
||||
"运输销售部 机务队 9\n",
|
||||
"化验计量部 计量站 9\n",
|
||||
"公司机关 生产部 8\n",
|
||||
"行政事务中心 安保科 10\n",
|
||||
"聚醚部 设备科 7\n",
|
||||
"炼油部 联合七车间 9\n",
|
||||
"党委党校(培训中心) 技能培训室 16\n",
|
||||
"信息档案管理中心 编辑室 12\n",
|
||||
"研究院 设计开发研究室 11\n",
|
||||
"炼油部 联合五车间 9\n",
|
||||
"公司机关 新闻中心 9\n",
|
||||
"物资采购中心 电仪采购室 12\n",
|
||||
"党委党校(培训中心) 培训控制科 16\n",
|
||||
"运输销售部 营销业务室 11\n",
|
||||
"公司机关 HSE督查大队 12\n",
|
||||
"聚醚部 安全环保科 9\n",
|
||||
"炼油部 综合科 7\n",
|
||||
"物资采购中心 综合科 10\n",
|
||||
"信息档案管理中心 软件开发室 14\n",
|
||||
"热电部 综合科(党群工作科、人力资源科) 20\n",
|
||||
"炼油部 联合二车间 9\n",
|
||||
"电仪部 电仪作业四区 10\n",
|
||||
"化验计量部 生产技术科 11\n",
|
||||
"原油储运部 曹妃甸库区 11\n",
|
||||
"烯烃部 生产技术科 9\n",
|
||||
"热电部 电气车间 8\n",
|
||||
"运输销售部 铁路运行中心 12\n",
|
||||
"物资采购中心 项目服务室 12\n",
|
||||
"信息档案管理中心 信息化管理科 15\n",
|
||||
"党委党校(培训中心) 党群工作科(人事科) 21\n",
|
||||
"公司机关 办公室 8\n",
|
||||
"南港烯烃部 党群工作室 11\n",
|
||||
"原油储运部 设备工程科 11\n",
|
||||
"炼油部 技术质量科 9\n",
|
||||
"行政事务中心 党群工作科(综合科) 17\n",
|
||||
"电仪部 电力调度中心 10\n",
|
||||
"化工部 烷基化车间 9\n",
|
||||
"炼油部 新联合四车间 10\n",
|
||||
"热电部 生产技术科 9\n",
|
||||
"原油储运部 综合科 9\n",
|
||||
"原油储运部 安全环保科 11\n",
|
||||
"热电部 设备科 7\n",
|
||||
"信息档案管理中心 设备维护室 14\n",
|
||||
"化验计量部 计量检定站 11\n",
|
||||
"原油储运部 大港枢纽库 11\n",
|
||||
"党委党校(培训中心) 社保工作室 16\n",
|
||||
"研究院 科技开发科 9\n",
|
||||
"物资采购中心 原料采购室 12\n",
|
||||
"水务部 水净化车间 9\n",
|
||||
"研究院 化工技术研究一室 12\n",
|
||||
"信息档案管理中心 MES支持室 15\n",
|
||||
"信息档案管理中心 运行管理科 14\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"filename = 'data/result_天津2024(部门合并).json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"set1 = set()\n",
|
||||
"for k,v in dict1.items():\n",
|
||||
" set1.add(v['unit'])\n",
|
||||
"for item in set1:\n",
|
||||
" print(item,len(item))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "6d673f9e-e91b-40f6-bee6-c4bf59308302",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 体测报告按部门、车间分类"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 17,
|
||||
"id": "0f945c49-ac5e-4587-8d8c-96667c327248",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-11-07T06:20:08.059278Z",
|
||||
"iopub.status.busy": "2024-11-07T06:20:08.058524Z",
|
||||
"iopub.status.idle": "2024-11-07T06:20:09.347745Z",
|
||||
"shell.execute_reply": "2024-11-07T06:20:09.346893Z",
|
||||
"shell.execute_reply.started": "2024-11-07T06:20:08.059245Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import os,sys,shutil\n",
|
||||
"import json\n",
|
||||
"import glob\n",
|
||||
"from pathlib import Path\n",
|
||||
"\n",
|
||||
"fi_path = '/home/songyi/pdf-typescript-old2/天津石化2024'\n",
|
||||
"new_path = 'file/天津石化2024'\n",
|
||||
"old = []\n",
|
||||
"dict2 = {}\n",
|
||||
"\n",
|
||||
"filename = 'data/天津石化人员2024.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"fls = glob.glob(f'{fi_path}/*.pdf')\n",
|
||||
"for fn in fls:\n",
|
||||
" fi_name =Path(fn).stem.split('-')[0]\n",
|
||||
" code = int(fi_name)\n",
|
||||
" unit_path = Path(new_path,dict1[str(code)]['unit'],dict1[str(code)]['sub_unit'])\n",
|
||||
" unit_path.mkdir(parents = True, exist_ok = True)\n",
|
||||
" n_name = Path(unit_path,Path(fn).stem+'.pdf')\n",
|
||||
" if not os.path.exists(n_name):\n",
|
||||
" shutil.copyfile(fn,n_name)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "5cab4519-5ffa-4ac0-8db7-5674e181fc14",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 生成体测报告打印明细表"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 18,
|
||||
"id": "9dcbc866-2481-4cf6-a563-df4bb6596dfd",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-11-07T06:23:23.785642Z",
|
||||
"iopub.status.busy": "2024-11-07T06:23:23.785175Z",
|
||||
"iopub.status.idle": "2024-11-07T06:23:24.321254Z",
|
||||
"shell.execute_reply": "2024-11-07T06:23:24.320296Z",
|
||||
"shell.execute_reply.started": "2024-11-07T06:23:23.785599Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os,sys,shutil\n",
|
||||
"import json\n",
|
||||
"import glob\n",
|
||||
"from pathlib import Path\n",
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"fi_path = '/home/songyi/pdf-typescript-old2/天津石化2024'\n",
|
||||
"\n",
|
||||
"filename = 'data/天津石化人员2024.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"fls = glob.glob(f'{fi_path}/*.pdf')\n",
|
||||
"list1 = []\n",
|
||||
"title = ['测试编号','姓名','性别','部门','车间']\n",
|
||||
"for fn in fls:\n",
|
||||
" list2 = []\n",
|
||||
" fi_name =Path(fn).stem.split('-')[0] \n",
|
||||
" code = int(fi_name)\n",
|
||||
" sex = dict1[str(code)]['sex']\n",
|
||||
" unit = dict1[str(code)]['unit']\n",
|
||||
" sub_unit = dict1[str(code)]['sub_unit']\n",
|
||||
" list2 = [fi_name,Path(fn).stem.split('-')[1],sex,unit,sub_unit]\n",
|
||||
" \n",
|
||||
" list1.append(list2)\n",
|
||||
"\n",
|
||||
"filename = 'data/天津石化体测报告明细表(2024年).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) \n",
|
||||
"print('ok')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "85a03b00-9624-4ae9-aa6d-386798d457df",
|
||||
@@ -4243,7 +4471,7 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.12.3"
|
||||
"version": "3.10.12"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
||||
Reference in new issue
Block a user