20231203
This commit is contained in:
1 parent
b33bbbd408
commit
de6a5be703
3 files changed
+1026
-71
No files matched your search
+143
-1
@@ -1915,10 +1915,152 @@
|
||||
" print(k,v['name'])"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "e7e0e29c-0f12-4478-b687-a03486adc85e",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 报告按部门分类"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "a362768f-a67f-4c64-a830-b6a745ab35e4",
|
||||
"id": "3ff8ad3c-7868-4eb2-b879-4e8da19407ff",
|
||||
"metadata": {},
|
||||
"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/134'\n",
|
||||
"new_path = 'file/134'\n",
|
||||
"old = []\n",
|
||||
"dict2 = {}\n",
|
||||
"\n",
|
||||
"filename = 'data/天津石化人员名单2023.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'])\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)\n",
|
||||
" #print(n_name)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "abe43620-c456-43a0-905a-b29aad8b2e3c",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 核对新部门分类人员"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 140,
|
||||
"id": "a3f1476d-5f70-45c4-aa04-ebc6558033b8",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-02T09:58:33.152532Z",
|
||||
"iopub.status.busy": "2023-12-02T09:58:33.152132Z",
|
||||
"iopub.status.idle": "2023-12-02T09:58:33.270132Z",
|
||||
"shell.execute_reply": "2023-12-02T09:58:33.269673Z",
|
||||
"shell.execute_reply.started": "2023-12-02T09:58:33.152500Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"787\n",
|
||||
"1 吴强\n",
|
||||
"2 李丹\n",
|
||||
"3 王勃\n",
|
||||
"4 史海燕\n",
|
||||
"5 周美琴\n",
|
||||
"6 钟丽\n",
|
||||
"7 徐玉清\n",
|
||||
"8 苏洪梅\n",
|
||||
"9 张杰\n",
|
||||
"10 杨植文\n",
|
||||
"11 张梦瑶\n",
|
||||
"12 韩晓舒\n",
|
||||
"13 栗晓娜\n",
|
||||
"14 陈继杨\n",
|
||||
"15 陈雪梅\n",
|
||||
"16 林宏锟\n",
|
||||
"17 汝晴\n",
|
||||
"18 庞珺珊\n",
|
||||
"19 姚子翔\n",
|
||||
"20 罗泽伟\n",
|
||||
"21 吴子巍\n",
|
||||
"22 史策\n",
|
||||
"23 赵婷婷\n",
|
||||
"24 韦州全\n",
|
||||
"25 代迪\n",
|
||||
"26 傅志成\n",
|
||||
"27 刘国旭\n",
|
||||
"28 宋燕\n",
|
||||
"29 侯海霞\n",
|
||||
"30 刘慧\n",
|
||||
"31 古富兰\n",
|
||||
"32 范和文\n",
|
||||
"33 冯鸥\n",
|
||||
"34 王依然\n",
|
||||
"35 田长利\n",
|
||||
"36 杜苹苹\n",
|
||||
"37 姜涛\n",
|
||||
"38 王晓松\n",
|
||||
"39 雷文秀\n",
|
||||
"40 徐月\n",
|
||||
"41 李凤燕\n",
|
||||
"42 尹莎\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import csv\n",
|
||||
"import openpyxl\n",
|
||||
"import time\n",
|
||||
"from datetime import date\n",
|
||||
"\n",
|
||||
"filename = 'data/result_北海炼化2023.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"\n",
|
||||
"\n",
|
||||
"wb = openpyxl.load_workbook('data/北海炼化新名单.xlsx')\n",
|
||||
"sheet = wb.active\n",
|
||||
"# sheets = wb.sheetnames\n",
|
||||
"list1 = []\n",
|
||||
"\n",
|
||||
"for n in range(5, sheet.max_row+1):\n",
|
||||
" if sheet.cell(n,2).value is not None:\n",
|
||||
" list1.append(sheet.cell(n,2).value)\n",
|
||||
"print(len(list1)) \n",
|
||||
"i = 1\n",
|
||||
"for k, v in dict1.items():\n",
|
||||
" name = v['name']\n",
|
||||
" if name not in list1:\n",
|
||||
" print(i,name)\n",
|
||||
" i+=1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "e30031dc-3597-4594-8c32-693a958ae171",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
|
||||
Reference in new issue
Block a user