1286 lines
45 KiB
Plaintext
1286 lines
45 KiB
Plaintext
{
|
||
"cells": [
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "f501bde1-90cb-40c4-9dd4-533c27f81be5",
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"source": [
|
||
"# 调查报告线下数据管理"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "ced4bf30-e7ea-4c4c-ae46-8720ffc07a76",
|
||
"metadata": {},
|
||
"source": [
|
||
"## 羊庙人员信息导入"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "9b2b755e-049e-48c5-87d3-dd37dceb59fe",
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"import json\n",
|
||
"\n",
|
||
"filename = 'data/羊庙测试人员信息.json'\n",
|
||
"\n",
|
||
"with open(filename,'r') as fl:\n",
|
||
" dict1 = json.load(fl) \n",
|
||
"dict2 = {}\n",
|
||
"for k,v in dict1.items():\n",
|
||
" for item in v:\n",
|
||
" bh = item['avatar_id']\n",
|
||
" del item['avatar_id']\n",
|
||
" dict2[bh] = item\n",
|
||
"filename = 'data/羊庙人员名单.json'\n",
|
||
"with open(filename, 'w') as fl:\n",
|
||
" json.dump(dict2, fl, ensure_ascii=False,default=str)\n",
|
||
"print('ok')"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "00e9f538-c0f5-46a0-b768-51480ad3fbaf",
|
||
"metadata": {},
|
||
"source": [
|
||
"## 获取参加体测人员编号"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "d89e0e5e-0782-40a3-bba3-862cc9865d4e",
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"import json\n",
|
||
"import time\n",
|
||
"import csv\n",
|
||
"\n",
|
||
"filename = '../item.json'\n",
|
||
"item = {}\n",
|
||
"unit = {}\n",
|
||
"with open(filename,'r') as fl:\n",
|
||
" dict1 = json.load(fl) \n",
|
||
"for k,v in dict1.items():\n",
|
||
" item[k] = v\n",
|
||
"re_ta = {}\n",
|
||
"dict1 = {}\n",
|
||
"list1 = []\n",
|
||
"#print(\"\\n运动项目信息:\")\n",
|
||
"filename = 'data/140.csv'\n",
|
||
"with open(filename,'r',newline='') as csv_file:\n",
|
||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||
" header = next(fl) \n",
|
||
" for line in fl:\n",
|
||
" #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n",
|
||
" list1.append(line)\n",
|
||
"list2 = []\n",
|
||
"for result in list1:\n",
|
||
" user = int(result[2])\n",
|
||
" if user not in list2:\n",
|
||
" list2.append(user)\n",
|
||
"list2.sort()\n",
|
||
"print(len(list2))\n",
|
||
"print(list2)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "2c48f588-135a-4d1a-b01e-96222b70b987",
|
||
"metadata": {},
|
||
"source": [
|
||
"## 根据风险筛选统计卡获取信息"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "e76837e8-cdf4-41e0-9d51-6ae5223de813",
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"import openpyxl\n",
|
||
"import json\n",
|
||
"import time\n",
|
||
"\n",
|
||
"wb = openpyxl.load_workbook('data/杨庙运动风险筛查统计表.xlsx')\n",
|
||
"sheet = wb.active\n",
|
||
"person = {}\n",
|
||
"for n in range(2, sheet.max_row+1):\n",
|
||
" code = int(sheet.cell(n, 1).value)\n",
|
||
" person.setdefault(code, {})\n",
|
||
" dict1 = {}\n",
|
||
" if sheet.cell(n, 8).value is not None:\n",
|
||
" name = sheet.cell(n, 8).value\n",
|
||
" else:\n",
|
||
" name ='不详'\n",
|
||
" dict1['name'] = name\n",
|
||
" if sheet.cell(n, 9).value is not None:\n",
|
||
" dict1['birth'] = str(sheet.cell(n, 9).value).split(' ')[0]\n",
|
||
" if sheet.cell(n, 10).value is not None:\n",
|
||
" dict1['phone'] = str(sheet.cell(n, 10).value)\n",
|
||
" if sheet.cell(n,11).value is not None:\n",
|
||
" dict1['id_num'] = sheet.cell(n,11).value\n",
|
||
" person[code] = dict1\n",
|
||
"print(len(person))\n",
|
||
"filename = 'data/杨庙运动风险筛查统计表信息.json'\n",
|
||
"with open(filename, 'w') as fl:\n",
|
||
" json.dump(person, fl, ensure_ascii=False,default=str)\n",
|
||
"print('ok')"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "6cc6b614-85e2-43fd-bc97-301fc776fe29",
|
||
"metadata": {},
|
||
"source": [
|
||
"## 根据恢复版获取信息"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "1293cdaa-1fdf-43a5-99ce-a031a76f6688",
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"import openpyxl\n",
|
||
"import json\n",
|
||
"import time\n",
|
||
"\n",
|
||
"wb = openpyxl.load_workbook('data/羊庙恢复版.xlsx')\n",
|
||
"sheet = wb.active\n",
|
||
"person = {}\n",
|
||
"for n in range(2, sheet.max_row+1):\n",
|
||
" if sheet.cell(n, 4).value is not None: \n",
|
||
" code = int(sheet.cell(n, 4).value)\n",
|
||
" person.setdefault(code, {})\n",
|
||
" dict1 = {}\n",
|
||
" name = sheet.cell(n, 5).value\n",
|
||
" dict1['name'] = name\n",
|
||
" dict1['bh'] = n - 1\n",
|
||
" dict1['sex'] = sheet.cell(n, 6).value\n",
|
||
" if sheet.cell(n, 9).value is not None:\n",
|
||
" dict1['phone'] = str(sheet.cell(n, 9).value)\n",
|
||
" if sheet.cell(n,8).value is not None:\n",
|
||
" dict1['id_num'] = sheet.cell(n,8).value\n",
|
||
" if sheet.cell(n,3).value is not None:\n",
|
||
" dict1['unit'] = sheet.cell(n,3).value\n",
|
||
" person[code] = dict1\n",
|
||
"print(len(person))\n",
|
||
"filename = 'data/杨庙恢复版信息.json'\n",
|
||
"with open(filename, 'w') as fl:\n",
|
||
" json.dump(person, fl, ensure_ascii=False,default=str)\n",
|
||
"print('ok')"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "de1ce95b-4590-4eee-bd51-d37beabd6f87",
|
||
"metadata": {},
|
||
"source": [
|
||
"## 风险筛选统计卡可用人员信息"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "f21fff31-0da6-4c1a-bf7c-8c4a1d4a3ecf",
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"re_ta = {}\n",
|
||
"dict1 = {}\n",
|
||
"list1 = []\n",
|
||
"#print(\"\\n运动项目信息:\")\n",
|
||
"filename = 'data/140.csv'\n",
|
||
"with open(filename,'r',newline='') as csv_file:\n",
|
||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||
" header = next(fl) \n",
|
||
" for line in fl:\n",
|
||
" #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n",
|
||
" list1.append(line)\n",
|
||
"list2 = []\n",
|
||
"for result in list1:\n",
|
||
" user = int(result[2])\n",
|
||
" if user not in list2:\n",
|
||
" list2.append(user)\n",
|
||
"list2.sort()\n",
|
||
"set1 = set()\n",
|
||
"filename = 'data/杨庙恢复版信息.json'\n",
|
||
"with open(filename,'r') as fl:\n",
|
||
" dict_base = json.load(fl)\n",
|
||
"for k, v in dict_base.items():\n",
|
||
" set1.add(int(k))\n",
|
||
"filename = 'data/杨庙运动风险筛查统计表信息.json'\n",
|
||
"\n",
|
||
"with open(filename,'r') as fl:\n",
|
||
" dict1 = json.load(fl)\n",
|
||
"list_fx = []\n",
|
||
"\n",
|
||
"for k,v in dict1.items():\n",
|
||
" \n",
|
||
" if int(k) in list2 and k not in dict_base.keys() and v['name'] != '不详': \n",
|
||
" set1.add(int(k))\n",
|
||
"#print(len(list_fx))\n",
|
||
"#print(len(set1)) \n",
|
||
"for item in list2:\n",
|
||
" if item not in set1:\n",
|
||
" print(item)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "b08187a6-41d9-40ec-bc62-d99969148fe7",
|
||
"metadata": {},
|
||
"source": [
|
||
"## 补充恢复版信息"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "50a5e0f9-3850-48ac-9f3a-f5a7be51a7fd",
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"filename = 'data/杨庙恢复版信息.json'\n",
|
||
"with open(filename,'r') as fl:\n",
|
||
" dict_base = json.load(fl)\n",
|
||
"for k, v in dict_base.items():\n",
|
||
" set1.add(int(k))\n",
|
||
"filename = 'data/杨庙运动风险筛查统计表信息.json'\n",
|
||
"\n",
|
||
"with open(filename,'r') as fl:\n",
|
||
" dict1 = json.load(fl)\n",
|
||
"for k,v in dict_base.items():\n",
|
||
" if k in dict1.keys() and 'phone' not in v.keys() and 'phone' in dict1[k].keys():\n",
|
||
" #print(k,v['name'])\n",
|
||
" dict_base[k]['phone'] = dict1[k]['phone']\n",
|
||
"\n",
|
||
"for k, v in dict1.items():\n",
|
||
" if int(k) in list2 and k not in dict_base.keys():\n",
|
||
" dict_base[k] = v\n",
|
||
" \n",
|
||
"print(len(dict_base))\n",
|
||
"#print(dict_base)\n",
|
||
"filename = 'data/羊庙人员名单.json'\n",
|
||
"with open(filename,'r') as fl:\n",
|
||
" dict2 = json.load(fl)\n",
|
||
"i = 1\n",
|
||
"for k, v in dict_base.items():\n",
|
||
" if 'bh' not in v.keys():\n",
|
||
" name = v['name']\n",
|
||
" n = 0\n",
|
||
" for k1,v1 in dict2.items():\n",
|
||
" if name == v1['name']:\n",
|
||
" bh = k1\n",
|
||
" n = n+1\n",
|
||
" if n ==1:\n",
|
||
" dict_base[k]['bh'] = bh\n",
|
||
" else:\n",
|
||
" print(i,k,v['name'])\n",
|
||
" i+=1\n",
|
||
"filename = 'data/杨庙补充汇总信息.json'\n",
|
||
"with open(filename, 'w') as fl:\n",
|
||
" json.dump(dict_base, fl, ensure_ascii=False,default=str)\n",
|
||
"print('ok')"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "41c81dfc-ee3a-4934-8f02-077e3f07e5fc",
|
||
"metadata": {},
|
||
"source": [
|
||
"## 导出汇总信息"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "1106fa5d-f0dd-4af4-bc39-7b106786b438",
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"filename = 'data/杨庙补充汇总信息.json'\n",
|
||
"with open(filename,'r') as fl:\n",
|
||
" dict1 = json.load(fl)\n",
|
||
"list_item = ['name','bh','sex','phone','unit','id_num']\n",
|
||
"list_data = []\n",
|
||
"\n",
|
||
"for k, v in dict1.items():\n",
|
||
" list_mx = []\n",
|
||
" list_mx.append(k)\n",
|
||
" for item in list_item:\n",
|
||
" if item in v.keys():\n",
|
||
" list_mx.append(v[item])\n",
|
||
" else:\n",
|
||
" list_mx.append('')\n",
|
||
" list_data.append(list_mx)\n",
|
||
"#print(list_data) \n",
|
||
"filename = 'data/羊庙汇总情况表.xlsx'\n",
|
||
"wb = openpyxl.Workbook()\n",
|
||
"sheet = wb.active\n",
|
||
"#sheet.append(title)\n",
|
||
"for row in list_data:\n",
|
||
" sheet.append(row)\n",
|
||
" \n",
|
||
"wb.save(filename) \n",
|
||
"print('ok!')"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "d31fa9b7-26d8-4101-94d1-f41723428aa9",
|
||
"metadata": {},
|
||
"source": [
|
||
"## 成年问卷导入"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "dc20aabb-3942-49b9-8841-8e8a0823033a",
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"import openpyxl\n",
|
||
"import json\n",
|
||
"\n",
|
||
"filename = 'data/杨庙体测明确人员信息(20230328).json'\n",
|
||
"with open(filename,'r') as fl:\n",
|
||
" dict2 = json.load(fl)\n",
|
||
"wb = openpyxl.load_workbook('data/羊庙问卷统计表(成年组).xlsx')\n",
|
||
"sheet = wb.active\n",
|
||
"# sheets = wb.sheetnames\n",
|
||
"\n",
|
||
"dict1 = {}\n",
|
||
"no_xinli = [108,389,268,270]\n",
|
||
"sheet = wb.active\n",
|
||
"data1 =list(sheet.values)\n",
|
||
"list_bh = data1[0][1:]\n",
|
||
"del data1[0]\n",
|
||
"print(len(list_bh))\n",
|
||
"for i in range(1,len(list_bh)+1):\n",
|
||
" list2 = []\n",
|
||
" \n",
|
||
" for item in data1:\n",
|
||
" list2.append(item[i])\n",
|
||
" dict1[list_bh[i-1]] = list2\n",
|
||
"for k, v in dict1.items():\n",
|
||
" #if 0 in v:\n",
|
||
" # print(k)\n",
|
||
" if str(k) not in dict2.keys():\n",
|
||
" print(k,'不在清理名单中')\n",
|
||
"\n",
|
||
"#print(dict1)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "9a38f22b-6a8c-422f-a706-07382ccaceda",
|
||
"metadata": {},
|
||
"source": [
|
||
"## 成年问卷导出"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "2c84736a-b6cc-43d6-9407-ead6300748a5",
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"import openpyxl\n",
|
||
"import json\n",
|
||
"\n",
|
||
"filename = 'data/杨庙体测明确人员信息(20230328).json'\n",
|
||
"with open(filename,'r') as fl:\n",
|
||
" dict3 = json.load(fl)\n",
|
||
"wb = openpyxl.load_workbook('data/羊庙问卷统计表(成年组).xlsx')\n",
|
||
"sheet = wb.active\n",
|
||
"# sheets = wb.sheetnames\n",
|
||
"dict1 = {}\n",
|
||
"list_bh = []\n",
|
||
"no_xinli = [108,389,268,270]\n",
|
||
"zy = [2,7,9,11,12,21,24]\n",
|
||
"sheet = wb.active\n",
|
||
"data1 =list(sheet.values)\n",
|
||
"list_bh = data1[0][1:]\n",
|
||
"del data1[0]\n",
|
||
"\n",
|
||
"\n",
|
||
"for i in range(1,len(list_bh)+1):\n",
|
||
" list2 = []\n",
|
||
" \n",
|
||
" for item in data1:\n",
|
||
" list2.append(item[i])\n",
|
||
" dict1[list_bh[i-1]] = list2\n",
|
||
"#print(dict1)\n",
|
||
"s = ''\n",
|
||
"for k,v in dict1.items():\n",
|
||
" if str(k) in dict3.keys(): \n",
|
||
" if dict3[str(k)]['sex'] ==1:\n",
|
||
" sex = \"m\"\n",
|
||
" else:\n",
|
||
" sex = \"f\"\n",
|
||
" dict2 = {}\n",
|
||
" list_mx = []\n",
|
||
" list_mx.append(f'\"Gender\":\"{sex}\"')\n",
|
||
" list_mx.append(f'\"Age\":\"M\"')\n",
|
||
" dict2['surveyId'] = \"merge1\"\n",
|
||
" dict2['name'] = dict3[str(k)]['name'] \n",
|
||
" name = dict3[str(k)]['name'] \n",
|
||
" dict2['code'] = str(k)\n",
|
||
" ss = ''\n",
|
||
" \n",
|
||
" if k not in no_xinli:\n",
|
||
" for i in range(0,47):\n",
|
||
" list_mx.append(f'\"q{i+1}M\":{v[i]}') \n",
|
||
" \n",
|
||
" for i in range(1,61):\n",
|
||
" if i not in zy:\n",
|
||
" list_mx.append(f'\"q{i}\":{v[46+i]}')\n",
|
||
" for i in range(1,27):\n",
|
||
" list_mx.append(f'\"qv{i}\":{v[106+i]}')\n",
|
||
" ss = ','.join(list_mx)\n",
|
||
" ss ='{'+ss+'}'\n",
|
||
" dict2['data'] = ss\n",
|
||
" sj = '2023-03-28 20:02:00'\n",
|
||
" s= s+f'(\"merge1\",\"{name}\",\"{str(k)}\",\\'{ss}\\',\"{sj}\"),'\n",
|
||
" #print(dict2)\n",
|
||
"print(s)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "75dda87e-804e-42ba-b1a4-08c8a8b65050",
|
||
"metadata": {},
|
||
"source": [
|
||
"## 老年问卷导入"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "09a354e6-a07a-40b8-9b8c-3499fb0b7c28",
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"import openpyxl\n",
|
||
"import json\n",
|
||
"\n",
|
||
"filename = 'data/杨庙体测明确人员信息(20230328).json'\n",
|
||
"with open(filename,'r') as fl:\n",
|
||
" dict2 = json.load(fl)\n",
|
||
"wb = openpyxl.load_workbook('data/羊庙问卷统计表(老年组).xlsx')\n",
|
||
"sheet = wb.active\n",
|
||
"# sheets = wb.sheetnames\n",
|
||
"dict1 = {}\n",
|
||
"dict3 = {}\n",
|
||
"no_xinli = [286]\n",
|
||
"sheet = wb.active\n",
|
||
"data1 =list(sheet.values)\n",
|
||
"list_bh = data1[0][1:]\n",
|
||
"print(list_bh)\n",
|
||
"del data1[0]\n",
|
||
"print(len(list_bh))\n",
|
||
"for i in range(1,len(list_bh)+1):\n",
|
||
" list2 = []\n",
|
||
" \n",
|
||
" for item in data1:\n",
|
||
" list2.append(item[i])\n",
|
||
" dict1[list_bh[i-1]] = list2\n",
|
||
"for k, v in dict1.items():\n",
|
||
" #if 0 in v or ' ' in v:\n",
|
||
" # print(k)\n",
|
||
" if str(k) not in dict2.keys():\n",
|
||
" print(k,'不在清理名单中')\n",
|
||
"#print(dict1)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "e2e311b1-7436-49e3-bf52-93c38f088be1",
|
||
"metadata": {},
|
||
"source": [
|
||
"## 老年问卷导出"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "f41e130b-06e5-45ee-bf3d-cc25dfcc653d",
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"import openpyxl\n",
|
||
"import json\n",
|
||
"\n",
|
||
"filename = 'data/杨庙体测明确人员信息(20230328).json'\n",
|
||
"with open(filename,'r') as fl:\n",
|
||
" dict3 = json.load(fl)\n",
|
||
"wb = openpyxl.load_workbook('data/羊庙问卷统计表(老年组).xlsx')\n",
|
||
"sheet = wb.active\n",
|
||
"# sheets = wb.sheetnames\n",
|
||
"dict1 = {}\n",
|
||
"\n",
|
||
"no_xinli = [286]\n",
|
||
"sheet = wb.active\n",
|
||
"data1 =list(sheet.values)\n",
|
||
"list_bh = data1[0][1:]\n",
|
||
"#print(list_bh)\n",
|
||
"del data1[0]\n",
|
||
"\n",
|
||
"for i in range(1,len(list_bh)+1):\n",
|
||
" list2 = []\n",
|
||
" \n",
|
||
" for item in data1:\n",
|
||
" list2.append(item[i])\n",
|
||
" dict1[list_bh[i-1]] = list2\n",
|
||
"#print(dict1)\n",
|
||
"s = ''\n",
|
||
"for k,v in dict1.items():\n",
|
||
" if str(k) in dict3.keys(): \n",
|
||
" if dict3[str(k)]['sex'] ==1:\n",
|
||
" sex = \"m\"\n",
|
||
" else:\n",
|
||
" sex = \"f\"\n",
|
||
" dict2 = {}\n",
|
||
" list_mx = []\n",
|
||
" list_mx.append(f'\"Gender\":\"{sex}\"')\n",
|
||
" list_mx.append(f'\"Age\":\"O\"')\n",
|
||
" dict2['surveyId'] = \"merge1\"\n",
|
||
" dict2['name'] = dict3[str(k)]['name'] \n",
|
||
" dict2['code'] = str(k) \n",
|
||
" name = dict3[str(k)]['name'] \n",
|
||
" if k not in no_xinli:\n",
|
||
" for i in range(0,30):\n",
|
||
" list_mx.append(f'\"q{i+1}O\":{v[i]}') \n",
|
||
" \n",
|
||
" for i in range(1,61):\n",
|
||
" if i not in zy:\n",
|
||
" list_mx.append(f'\"q{i}\":{v[29+i]}')\n",
|
||
" for i in range(1,27):\n",
|
||
" list_mx.append(f'\"qv{i}\":{v[89+i]}')\n",
|
||
" ss = ','.join(list_mx)\n",
|
||
" ss ='{'+ss+'}'\n",
|
||
" dict2['data'] = ss\n",
|
||
" sj = '2023-03-28 20:02:00'\n",
|
||
" s= s+f'(\"merge1\",\"{name}\",\"{str(k)}\",\\'{ss}\\',\"{sj}\"),'\n",
|
||
" #print(dict2)\n",
|
||
"print(s)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "3262d713-92a4-4790-81a3-976ff308ee3d",
|
||
"metadata": {},
|
||
"source": [
|
||
"## 统计网络问卷信息"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "08980670-fda9-4660-a619-2f5f5ed8d334",
|
||
"metadata": {
|
||
"tags": []
|
||
},
|
||
"outputs": [],
|
||
"source": [
|
||
"filename = 'data/merge1.json'\n",
|
||
"\n",
|
||
"with open(filename,'r') as fl:\n",
|
||
" dict1 = json.load(fl)\n",
|
||
"#print(dict1)\n",
|
||
"filename = 'data/杨庙体测明确人员信息(20230328).json'\n",
|
||
"with open(filename,'r') as fl:\n",
|
||
" dict2 = json.load(fl)\n",
|
||
"dict3 = {}\n",
|
||
"for k, v in dict1.items():\n",
|
||
" print(len(v))\n",
|
||
" for item in v:\n",
|
||
" phone = item['phone']\n",
|
||
" dict3.setdefault(phone,{})\n",
|
||
" #dict3[phone]['data'] = v['data']\n",
|
||
" for k1,v1 in dict2.items():\n",
|
||
" if 'phone' in v1.keys() and phone == v1['phone']:\n",
|
||
" dict3[phone]['bh'] = k1\n",
|
||
"print(dict3)\n",
|
||
"for k, v in dict2.items():\n",
|
||
" for k1, v1 in dict2.items():\n",
|
||
" \n",
|
||
" if 'bh' not in v.keys():\n",
|
||
" print(k)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "e06b0149-c1ff-4fd0-b692-1be391433f40",
|
||
"metadata": {},
|
||
"source": [
|
||
"# 按照测试编号管理"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "54c8e75c-6d3a-4b0d-91a1-c5e9e79a119f",
|
||
"metadata": {},
|
||
"source": [
|
||
"## 导入测试人员信息表(符合条件)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 1,
|
||
"id": "b51b73fa-97fa-473c-ab8a-d1fd958eb52a",
|
||
"metadata": {
|
||
"execution": {
|
||
"iopub.execute_input": "2023-03-29T00:18:26.048784Z",
|
||
"iopub.status.busy": "2023-03-29T00:18:26.047970Z",
|
||
"iopub.status.idle": "2023-03-29T00:18:26.267055Z",
|
||
"shell.execute_reply": "2023-03-29T00:18:26.266257Z",
|
||
"shell.execute_reply.started": "2023-03-29T00:18:26.048741Z"
|
||
},
|
||
"tags": []
|
||
},
|
||
"outputs": [
|
||
{
|
||
"name": "stdout",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"ok\n"
|
||
]
|
||
}
|
||
],
|
||
"source": [
|
||
"import openpyxl\n",
|
||
"import json\n",
|
||
"import time\n",
|
||
"\n",
|
||
"wb = openpyxl.load_workbook('data/杨庙体测明确人员信息表(20230328).xlsx')\n",
|
||
"sheet = wb.active\n",
|
||
"person = {}\n",
|
||
"for n in range(2, sheet.max_row+1):\n",
|
||
" code = int(sheet.cell(n, 1).value)\n",
|
||
" person.setdefault(code, {})\n",
|
||
" dict1 = {}\n",
|
||
" name = sheet.cell(n, 2).value \n",
|
||
" dict1['name'] = name\n",
|
||
" dict1['sex'] = sheet.cell(n, 3).value\n",
|
||
" dict1['birth'] = str(sheet.cell(n, 4).value).split(' ')[0]\n",
|
||
" if sheet.cell(n, 5).value is not None:\n",
|
||
" dict1['phone'] = str(sheet.cell(n, 5).value)\n",
|
||
" if sheet.cell(n,6).value is not None:\n",
|
||
" dict1['unit'] = sheet.cell(n,6).value \n",
|
||
" person[code] = dict1\n",
|
||
"filename = 'data/杨庙体测明确人员信息(20230328).json'\n",
|
||
"with open(filename, 'w') as fl:\n",
|
||
" json.dump(person, fl, ensure_ascii=False,default=str)\n",
|
||
"print('ok')"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "cc0c1a86-e15f-43e9-99e9-140aed8475bf",
|
||
"metadata": {},
|
||
"source": [
|
||
"## 体测报告更名按部门分组"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 10,
|
||
"id": "ac3bb674-77e2-4edb-aae7-7b589c8d9b5a",
|
||
"metadata": {
|
||
"execution": {
|
||
"iopub.execute_input": "2023-03-29T02:59:45.489205Z",
|
||
"iopub.status.busy": "2023-03-29T02:59:45.488318Z",
|
||
"iopub.status.idle": "2023-03-29T02:59:46.069036Z",
|
||
"shell.execute_reply": "2023-03-29T02:59:46.068298Z",
|
||
"shell.execute_reply.started": "2023-03-29T02:59:45.489163Z"
|
||
},
|
||
"tags": []
|
||
},
|
||
"outputs": [
|
||
{
|
||
"name": "stdout",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"file/140/宋王村/00002-吴淑香.pdf\n",
|
||
"file/140/前许村/00003-许广仁.pdf\n",
|
||
"file/140/南范村/00004-王立英.pdf\n",
|
||
"file/140/小街村/00005-刘桂英.pdf\n",
|
||
"file/140/前许村/00006-李俊孝.pdf\n",
|
||
"file/140/东范村/00007-刘英芳.pdf\n",
|
||
"file/140/罗盖村/00008-盖玉德.pdf\n",
|
||
"file/140/新李村/00009-李国厂.pdf\n",
|
||
"file/140/罗盖村/00010-盖会存.pdf\n",
|
||
"file/140/罗盖村/00011-杨翠平.pdf\n",
|
||
"file/140/后许村/00012-王秀英.pdf\n",
|
||
"file/140/北范村/00013-张桂娥.pdf\n",
|
||
"file/140/罗盖村/00015-罗增峰.pdf\n",
|
||
"file/140/未明确/00016-王金花.pdf\n",
|
||
"file/140/杨庙村/00017-杨中华.pdf\n",
|
||
"file/140/罗盖村/00018-许华英.pdf\n",
|
||
"file/140/北范村/00022-李同艳.pdf\n",
|
||
"file/140/小街村/00023-刘云美.pdf\n",
|
||
"file/140/罗盖村/00024-盖象彬.pdf\n",
|
||
"file/140/未明确/00025-许福贞.pdf\n",
|
||
"file/140/后许村/00026-许华岭.pdf\n",
|
||
"file/140/南范村/00027-张霞.pdf\n",
|
||
"file/140/小街村/00028-盖玉娥.pdf\n",
|
||
"file/140/罗盖村/00029-盖树臣.pdf\n",
|
||
"file/140/小街村/00030-秦福成.pdf\n",
|
||
"file/140/罗盖村/00031-盖会西.pdf\n",
|
||
"file/140/小街村/00032-李梅.pdf\n",
|
||
"file/140/罗盖村/00033-史增欣.pdf\n",
|
||
"file/140/南范村/00034-胡世杰.pdf\n",
|
||
"file/140/杨庙村/00035-臧学亮.pdf\n",
|
||
"file/140/宋王村/00036-韩立庆.pdf\n",
|
||
"file/140/北范村/00037-李金友.pdf\n",
|
||
"file/140/罗盖村/00038-罗炳顺.pdf\n",
|
||
"file/140/罗盖村/00039-盖长胜.pdf\n",
|
||
"file/140/罗盖村/00040-罗守先.pdf\n",
|
||
"file/140/杨庙村/00041-程光田.pdf\n",
|
||
"file/140/杨庙村/00042-许奎果.pdf\n",
|
||
"file/140/南范村/00043-刘文吉.pdf\n",
|
||
"file/140/罗盖村/00044-盖明月.pdf\n",
|
||
"file/140/西韩村/00045-韩健康.pdf\n",
|
||
"file/140/杨庙村/00046-蒋梅.pdf\n",
|
||
"file/140/未明确/00047-王其美.pdf\n",
|
||
"file/140/罗盖村/00048-罗增勤.pdf\n",
|
||
"file/140/罗盖村/00049-盖子忠.pdf\n",
|
||
"file/140/小街村/00051-王荣华.pdf\n",
|
||
"file/140/杨庙村/00052-郑存玉.pdf\n",
|
||
"file/140/罗盖村/00053-盖孔德.pdf\n",
|
||
"file/140/东范村/00054-孙汉章.pdf\n",
|
||
"file/140/北范村/00055-张树森.pdf\n",
|
||
"file/140/杨庙村/00056-杨学功.pdf\n",
|
||
"file/140/罗盖村/00057-盖勤功.pdf\n",
|
||
"file/140/南范村/00058-程大英.pdf\n",
|
||
"file/140/罗盖村/00059-张守兰.pdf\n",
|
||
"file/140/未明确/00060-盖景华.pdf\n",
|
||
"file/140/小街村/00061-薄遵兰.pdf\n",
|
||
"file/140/未明确/00062-吕吉刚.pdf\n",
|
||
"file/140/南范村/00063-王长征.pdf\n",
|
||
"file/140/未明确/00064-刘小凤.pdf\n",
|
||
"file/140/未明确/00065-许秀风.pdf\n",
|
||
"file/140/杨庙村/00066-刘小玉.pdf\n",
|
||
"file/140/前许村/00067-许建忠.pdf\n",
|
||
"file/140/杨庙村/00068-杨恩.pdf\n",
|
||
"file/140/罗盖村/00069-臧小麦.pdf\n",
|
||
"file/140/罗盖村/00070-陈秀玙.pdf\n",
|
||
"file/140/南范村/00071-李爱花.pdf\n",
|
||
"file/140/东范村/00072-张芳.pdf\n",
|
||
"file/140/小街村/00073-韩针.pdf\n",
|
||
"file/140/北范村/00074-李若梅.pdf\n",
|
||
"file/140/宋王村/00075-李秀芬.pdf\n",
|
||
"file/140/未明确/00076-韩吉锋.pdf\n",
|
||
"file/140/前许村/00077-程绍秀.pdf\n",
|
||
"file/140/北范村/00078-赵收良.pdf\n",
|
||
"file/140/前许村/00079-盖三好.pdf\n",
|
||
"file/140/未明确/00080-刘凤英.pdf\n",
|
||
"file/140/小街村/00081-张守玲.pdf\n",
|
||
"file/140/小街村/00082-秦洪泽.pdf\n",
|
||
"file/140/北范村/00083-王在.pdf\n",
|
||
"file/140/东范村/00084-刘忠华.pdf\n",
|
||
"file/140/北范村/00085-李如杰.pdf\n",
|
||
"file/140/罗盖村/00086-盖长生.pdf\n",
|
||
"file/140/新李村/00087-李松山.pdf\n",
|
||
"file/140/未明确/00088-杨学忠.pdf\n",
|
||
"file/140/未明确/00089-石云贞.pdf\n",
|
||
"file/140/未明确/00090-刘桂英.pdf\n",
|
||
"file/140/西韩村/00091-刘学云.pdf\n",
|
||
"file/140/杨庙村/00092-王六好.pdf\n",
|
||
"file/140/小街村/00093-程春.pdf\n",
|
||
"file/140/未明确/00094-崔玉珍.pdf\n",
|
||
"file/140/小街村/00095-刘干臣.pdf\n",
|
||
"file/140/罗盖村/00096-吕兴秀.pdf\n",
|
||
"file/140/北范村/00097-黄爱勇.pdf\n",
|
||
"file/140/小街村/00098-左秀英.pdf\n",
|
||
"file/140/未明确/00099-周洪新.pdf\n",
|
||
"file/140/未明确/00100-韩春秀.pdf\n",
|
||
"file/140/小街村/00101-黄永臣.pdf\n",
|
||
"file/140/北范村/00103-张美荣.pdf\n",
|
||
"file/140/西韩村/00104-刘云翠.pdf\n",
|
||
"file/140/东范村/00105-孙汉永.pdf\n",
|
||
"file/140/小街村/00106-秦福华.pdf\n",
|
||
"file/140/杨庙村/00107-程国利.pdf\n",
|
||
"file/140/罗盖村/00108-盖玉帅.pdf\n",
|
||
"file/140/小街村/00109-黄永强.pdf\n",
|
||
"file/140/罗盖村/00110-罗传家.pdf\n",
|
||
"file/140/罗盖村/00111-盖兰英.pdf\n",
|
||
"file/140/罗盖村/00112-程爱菊.pdf\n",
|
||
"file/140/罗盖村/00113-程汝枝.pdf\n",
|
||
"file/140/未明确/00114-许建岭.pdf\n",
|
||
"file/140/宋王村/00115-程维荣.pdf\n",
|
||
"file/140/宋王村/00116-李凤英.pdf\n",
|
||
"file/140/西韩村/00117-韩帮庆.pdf\n",
|
||
"file/140/西韩村/00118-吕秀芬.pdf\n",
|
||
"file/140/小街村/00119-刘殿卿.pdf\n",
|
||
"file/140/未明确/00120-郑风.pdf\n",
|
||
"file/140/东范村/00121-李爱英.pdf\n",
|
||
"file/140/东范村/00122-王希云.pdf\n",
|
||
"file/140/东范村/00123-刘秀云.pdf\n",
|
||
"file/140/东范村/00124-孟献荣.pdf\n",
|
||
"file/140/小街村/00126-张小香.pdf\n",
|
||
"file/140/东范村/00127-孙小芹.pdf\n",
|
||
"file/140/罗盖村/00128-盖玉明.pdf\n",
|
||
"file/140/罗盖村/00129-盖会民.pdf\n",
|
||
"file/140/罗盖村/00130-吕德双.pdf\n",
|
||
"file/140/北范村/00132-崔新军.pdf\n",
|
||
"file/140/杨庙村/00133-李小荣.pdf\n",
|
||
"file/140/未明确/00134-张荣俊.pdf\n",
|
||
"file/140/罗盖村/00135-盖仁德.pdf\n",
|
||
"file/140/小街村/00136-刘兆合.pdf\n",
|
||
"file/140/罗盖村/00137-盖爱英.pdf\n",
|
||
"file/140/北范村/00138-赵殿文.pdf\n",
|
||
"file/140/新李村/00139-杨俊祥.pdf\n",
|
||
"file/140/南范村/00140-王泽民.pdf\n",
|
||
"file/140/北范村/00141-刘学荣.pdf\n",
|
||
"file/140/罗盖村/00142-吕相美.pdf\n",
|
||
"file/140/杨庙村/00143-王俊娥.pdf\n",
|
||
"file/140/杨庙村/00144-程国华.pdf\n",
|
||
"file/140/未明确/00145-裴建美.pdf\n",
|
||
"file/140/东范村/00146-张淑平.pdf\n",
|
||
"file/140/未明确/00147-王海方.pdf\n",
|
||
"file/140/未明确/00148-冯静静.pdf\n",
|
||
"file/140/未明确/00149-盖梦娜.pdf\n",
|
||
"file/140/宋王村/00150-韩继双.pdf\n",
|
||
"file/140/后许村/00151-许海仙.pdf\n",
|
||
"file/140/宋王村/00152-程明月.pdf\n",
|
||
"file/140/新李村/00153-李广民.pdf\n",
|
||
"file/140/东范村/00154-张友振.pdf\n",
|
||
"file/140/新李村/00155-程好.pdf\n",
|
||
"file/140/杨庙村/00156-李志娟.pdf\n",
|
||
"file/140/杨庙村/00157-李玉玲.pdf\n",
|
||
"file/140/罗盖村/00158-盖景献.pdf\n",
|
||
"file/140/小街村/00159-郭松年.pdf\n",
|
||
"file/140/小街村/00160-胡会.pdf\n",
|
||
"file/140/杨庙村/00161-程新华.pdf\n",
|
||
"file/140/东范村/00162-杨呈祥.pdf\n",
|
||
"file/140/宋王村/00163-程兴叶.pdf\n",
|
||
"file/140/北范村/00164-杨立新.pdf\n",
|
||
"file/140/南范村/00165-王长合.pdf\n",
|
||
"file/140/新李村/00166-李广明.pdf\n",
|
||
"file/140/东范村/00167-张学亭.pdf\n",
|
||
"file/140/杨庙村/00168-程宗华.pdf\n",
|
||
"file/140/罗盖村/00169-史增秀.pdf\n",
|
||
"file/140/罗盖村/00170-盖长平.pdf\n",
|
||
"file/140/杨庙村/00171-韩爱.pdf\n",
|
||
"file/140/新李村/00172-张相荣.pdf\n",
|
||
"file/140/前许村/00173-程兰兰.pdf\n",
|
||
"file/140/宋王村/00174-程芳斌.pdf\n",
|
||
"file/140/罗盖村/00175-盖胜泉.pdf\n",
|
||
"file/140/东范村/00177-胡环环.pdf\n",
|
||
"file/140/南范村/00178-马翠苹.pdf\n",
|
||
"file/140/北范村/00179-王希英.pdf\n",
|
||
"file/140/新李村/00180-程秀芹.pdf\n",
|
||
"file/140/杨庙村/00181-程云.pdf\n",
|
||
"file/140/后许村/00183-许荣德.pdf\n",
|
||
"file/140/南范村/00184-许奎英.pdf\n",
|
||
"file/140/宋王村/00185-李新美.pdf\n",
|
||
"file/140/小街村/00186-吴秀荣.pdf\n",
|
||
"file/140/小街村/00187-胡学来.pdf\n",
|
||
"file/140/未明确/00188-杨志敏.pdf\n",
|
||
"file/140/罗盖村/00189-盖士奎.pdf\n",
|
||
"file/140/南范村/00190-孙秀兰.pdf\n",
|
||
"file/140/后许村/00191-李建栋.pdf\n",
|
||
"file/140/罗盖村/00192-郑云香.pdf\n",
|
||
"file/140/小街村/00193-樊风贤.pdf\n",
|
||
"file/140/南范村/00194-王寿朋.pdf\n",
|
||
"file/140/后许村/00195-许春堂.pdf\n",
|
||
"file/140/未明确/00196-王连秀.pdf\n",
|
||
"file/140/新李村/00197-杨东云.pdf\n",
|
||
"file/140/新李村/00198-李福友.pdf\n",
|
||
"file/140/北范村/00199-李汝芹.pdf\n",
|
||
"file/140/未明确/00200-李勇军.pdf\n",
|
||
"file/140/罗盖村/00201-崔云花.pdf\n",
|
||
"file/140/北范村/00202-吕秀娥.pdf\n",
|
||
"file/140/宋王村/00203-程玉柱.pdf\n",
|
||
"file/140/罗盖村/00204-张玉花.pdf\n",
|
||
"file/140/杨庙村/00205-崔海玲.pdf\n",
|
||
"file/140/北范村/00206-王路荣.pdf\n",
|
||
"file/140/杨庙村/00207-程河清.pdf\n",
|
||
"file/140/未明确/00208-王小冬.pdf\n",
|
||
"file/140/小街村/00209-吴秀芝.pdf\n",
|
||
"file/140/北范村/00210-张立山.pdf\n",
|
||
"file/140/北范村/00211-赵学孔.pdf\n",
|
||
"file/140/小街村/00212-秦玉美.pdf\n",
|
||
"file/140/未明确/00213-张金宗.pdf\n",
|
||
"file/140/宋王村/00214-薛玉华.pdf\n",
|
||
"file/140/前许村/00215-李福翠.pdf\n",
|
||
"file/140/北范村/00216-李金江.pdf\n",
|
||
"file/140/罗盖村/00217-刘学荣.pdf\n",
|
||
"file/140/未明确/00218-程玉良.pdf\n",
|
||
"file/140/罗盖村/00219-盖敢含.pdf\n",
|
||
"file/140/未明确/00220-许胜田.pdf\n",
|
||
"file/140/前许村/00221-许广和.pdf\n",
|
||
"file/140/小街村/00222-张金花.pdf\n",
|
||
"file/140/未明确/00223-樊风亭.pdf\n",
|
||
"file/140/东范村/00224-崔彦美.pdf\n",
|
||
"file/140/新李村/00225-许清芝.pdf\n",
|
||
"file/140/罗盖村/00227-罗守生.pdf\n",
|
||
"file/140/南范村/00228-李新民.pdf\n",
|
||
"file/140/西韩村/00229-韩炳章.pdf\n",
|
||
"file/140/南范村/00231-王新荣.pdf\n",
|
||
"file/140/北范村/00233-胡相芝.pdf\n",
|
||
"file/140/罗盖村/00234-冯秀花.pdf\n",
|
||
"file/140/未明确/00235-胡巧英.pdf\n",
|
||
"file/140/罗盖村/00236-盖相英.pdf\n",
|
||
"file/140/罗盖村/00237-史宝英.pdf\n",
|
||
"file/140/前许村/00238-许洪民.pdf\n",
|
||
"file/140/小街村/00239-胡志东.pdf\n",
|
||
"file/140/北范村/00240-赵小华.pdf\n",
|
||
"file/140/东范村/00241-张合亭.pdf\n",
|
||
"file/140/小街村/00242-刘云祥.pdf\n",
|
||
"file/140/未明确/00243-盖会友.pdf\n",
|
||
"file/140/未明确/00244-罗桂贤.pdf\n",
|
||
"file/140/小街村/00245-刘维康.pdf\n",
|
||
"file/140/宋王村/00248-王联军.pdf\n",
|
||
"file/140/小街村/00249-胡志霞.pdf\n",
|
||
"file/140/小街村/00250-裴双双.pdf\n",
|
||
"file/140/罗盖村/00251-高继梅.pdf\n",
|
||
"file/140/罗盖村/00253-盖秀香.pdf\n",
|
||
"file/140/杨庙村/00255-程新永.pdf\n",
|
||
"file/140/小街村/00256-李介花.pdf\n",
|
||
"file/140/小街村/00257-刘茂亭.pdf\n",
|
||
"file/140/罗盖村/00258-罗公民.pdf\n",
|
||
"file/140/罗盖村/00259-盖象温.pdf\n",
|
||
"file/140/北范村/00260-李长会.pdf\n",
|
||
"file/140/罗盖村/00261-樊玉清.pdf\n",
|
||
"file/140/东范村/00262-范英华.pdf\n",
|
||
"file/140/罗盖村/00263-罗增海.pdf\n",
|
||
"file/140/东范村/00264-孙汉云.pdf\n",
|
||
"file/140/后许村/00265-杨麦英.pdf\n",
|
||
"file/140/宋王村/00266-程友海.pdf\n",
|
||
"file/140/未明确/00267-杨忠香.pdf\n",
|
||
"file/140/新李村/00268-盖学全.pdf\n",
|
||
"file/140/未明确/00269-韩娟娟.pdf\n",
|
||
"file/140/北范村/00270-蒋小岭.pdf\n",
|
||
"file/140/北范村/00271-张英.pdf\n",
|
||
"file/140/北范村/00272-崔跃宗.pdf\n",
|
||
"file/140/北范村/00273-生华荣.pdf\n",
|
||
"file/140/北范村/00274-张建民.pdf\n",
|
||
"file/140/小街村/00275-樊海昌.pdf\n",
|
||
"file/140/小街村/00276-刘建合.pdf\n",
|
||
"file/140/北范村/00277-赵殿武.pdf\n",
|
||
"file/140/罗盖村/00278-盖玉海.pdf\n",
|
||
"file/140/小街村/00279-周立美.pdf\n",
|
||
"file/140/小街村/00281-郭树本.pdf\n",
|
||
"file/140/北范村/00282-张成敏.pdf\n",
|
||
"file/140/北范村/00283-李金岭.pdf\n",
|
||
"file/140/小街村/00284-胡元乐.pdf\n",
|
||
"file/140/罗盖村/00285-盖玉祥.pdf\n",
|
||
"file/140/南范村/00286-王杰英.pdf\n",
|
||
"file/140/杨庙村/00287-程新利.pdf\n",
|
||
"file/140/罗盖村/00289-赵乐奎.pdf\n",
|
||
"file/140/罗盖村/00290-盖在庆.pdf\n",
|
||
"file/140/罗盖村/00291-盖树旺.pdf\n",
|
||
"file/140/罗盖村/00292-盖树强.pdf\n",
|
||
"file/140/西韩村/00293-韩冠英.pdf\n",
|
||
"file/140/未明确/00294-赵乐荣.pdf\n",
|
||
"file/140/罗盖村/00295-程建美.pdf\n",
|
||
"file/140/未明确/00296-张士忠.pdf\n",
|
||
"file/140/罗盖村/00297-盖长良.pdf\n",
|
||
"file/140/小街村/00301-樊盛杰.pdf\n",
|
||
"file/140/小街村/00302-张玉芹.pdf\n",
|
||
"file/140/南范村/00303-王玉枝.pdf\n",
|
||
"file/140/西韩村/00305-韩春光.pdf\n",
|
||
"file/140/西韩村/00306-许洪奎.pdf\n",
|
||
"file/140/未明确/00307-程潍芳.pdf\n",
|
||
"file/140/小街村/00308-刘玉娥.pdf\n",
|
||
"file/140/罗盖村/00309-罗炳花.pdf\n",
|
||
"file/140/未明确/00310-盖长修.pdf\n",
|
||
"file/140/未明确/00313-王祝娥.pdf\n",
|
||
"file/140/未明确/00314-程伯银.pdf\n",
|
||
"file/140/新李村/00315-盖学忠.pdf\n",
|
||
"file/140/杨庙村/00316-程泽旭.pdf\n",
|
||
"file/140/杨庙村/00317-程建国.pdf\n",
|
||
"file/140/罗盖村/00318-盖利民.pdf\n",
|
||
"file/140/罗盖村/00319-张学敏.pdf\n",
|
||
"file/140/罗盖村/00320-盖引.pdf\n",
|
||
"file/140/罗盖村/00321-杨霞.pdf\n",
|
||
"file/140/罗盖村/00322-胡秀兰.pdf\n",
|
||
"file/140/杨庙村/00323-程田.pdf\n",
|
||
"file/140/罗盖村/00324-史贞花.pdf\n",
|
||
"file/140/前许村/00325-李福荣.pdf\n",
|
||
"file/140/罗盖村/00326-王娜林.pdf\n",
|
||
"file/140/未明确/00327-魏希罕.pdf\n",
|
||
"file/140/未明确/00328-崔友秀.pdf\n",
|
||
"file/140/西韩村/00329-韩秀山.pdf\n",
|
||
"file/140/前许村/00330-李友秀.pdf\n",
|
||
"file/140/罗盖村/00331-王振芳.pdf\n",
|
||
"file/140/杨庙村/00332-杨秀英.pdf\n",
|
||
"file/140/北范村/00333-程少荣.pdf\n",
|
||
"file/140/东范村/00334-赵爱华.pdf\n",
|
||
"file/140/东范村/00335-李建文.pdf\n",
|
||
"file/140/南范村/00336-王秀珍.pdf\n",
|
||
"file/140/东范村/00337-李金花.pdf\n",
|
||
"file/140/小街村/00340-程美.pdf\n",
|
||
"file/140/前许村/00342-许建峰.pdf\n",
|
||
"file/140/罗盖村/00343-韩立花.pdf\n",
|
||
"file/140/新李村/00344-盖克怀.pdf\n",
|
||
"file/140/北范村/00345-崔振南.pdf\n",
|
||
"file/140/未明确/00346-韩翠荣.pdf\n",
|
||
"file/140/未明确/00347-刘慧丽.pdf\n",
|
||
"file/140/未明确/00348-李树兰.pdf\n",
|
||
"file/140/未明确/00349-刘跃芹.pdf\n",
|
||
"file/140/未明确/00351-魏小变.pdf\n",
|
||
"file/140/未明确/00352-魏建军.pdf\n",
|
||
"file/140/未明确/00353-韩英廷.pdf\n",
|
||
"file/140/未明确/00354-刘志强.pdf\n",
|
||
"file/140/未明确/00355-袁克英.pdf\n",
|
||
"file/140/宋王村/00356-任树荣.pdf\n",
|
||
"file/140/宋王村/00357-王桂荣.pdf\n",
|
||
"file/140/南范村/00358-史景霞.pdf\n",
|
||
"file/140/南范村/00359-刘增花.pdf\n",
|
||
"file/140/小街村/00360-刘德收.pdf\n",
|
||
"file/140/宋王村/00361-张玉环.pdf\n",
|
||
"file/140/小街村/00362-孙明华.pdf\n",
|
||
"file/140/北范村/00363-张焕.pdf\n",
|
||
"file/140/南范村/00364-李翠英.pdf\n",
|
||
"file/140/罗盖村/00365-盖会武.pdf\n",
|
||
"file/140/未明确/00368-韩华祥.pdf\n",
|
||
"file/140/北范村/00369-刘会英.pdf\n",
|
||
"file/140/宋王村/00370-张英.pdf\n",
|
||
"file/140/西韩村/00371-韩登峰.pdf\n",
|
||
"file/140/西韩村/00372-裴新红.pdf\n",
|
||
"file/140/罗盖村/00373-张琼.pdf\n",
|
||
"file/140/前许村/00374-李其珍.pdf\n",
|
||
"file/140/北范村/00375-赵鹏飞.pdf\n",
|
||
"file/140/杨庙村/00376-李大玉.pdf\n",
|
||
"file/140/杨庙村/00377-许翠田.pdf\n",
|
||
"file/140/杨庙村/00378-许福荣.pdf\n",
|
||
"file/140/东范村/00379-王希英.pdf\n",
|
||
"file/140/新李村/00381-张玉香.pdf\n",
|
||
"file/140/宋王村/00382-张树香.pdf\n",
|
||
"file/140/未明确/00383-张向明.pdf\n",
|
||
"file/140/罗盖村/00386-盖在昌.pdf\n",
|
||
"file/140/南范村/00387-刘良民.pdf\n",
|
||
"file/140/东范村/00389-杨建美.pdf\n",
|
||
"file/140/新李村/00391-盖景红.pdf\n",
|
||
"file/140/罗盖村/00392-赵庆英.pdf\n",
|
||
"file/140/东范村/00393-胡玉芝.pdf\n",
|
||
"file/140/西韩村/00394-韩宏祥.pdf\n",
|
||
"file/140/西韩村/00395-韩迎迎.pdf\n",
|
||
"file/140/罗盖村/00396-盖长吉.pdf\n",
|
||
"file/140/南范村/00397-王金花.pdf\n",
|
||
"file/140/新李村/00399-任瑞英.pdf\n",
|
||
"file/140/杨庙村/00400-程庆祥.pdf\n",
|
||
"file/140/西韩村/00401-郭荣华.pdf\n",
|
||
"file/140/东范村/00402-张立业.pdf\n",
|
||
"file/140/北范村/00403-缪秀荣.pdf\n",
|
||
"file/140/北范村/00404-何大英.pdf\n",
|
||
"file/140/罗盖村/00405-张树萍.pdf\n",
|
||
"file/140/北范村/00406-张绪珍.pdf\n",
|
||
"file/140/杨庙村/00407-程洪清.pdf\n",
|
||
"file/140/杨庙村/00408-张蕾蕾.pdf\n",
|
||
"file/140/罗盖村/00410-张花训.pdf\n",
|
||
"file/140/前许村/00411-许广新.pdf\n",
|
||
"file/140/宋王村/00412-程海峰.pdf\n",
|
||
"file/140/罗盖村/00414-李梅.pdf\n",
|
||
"file/140/小街村/00415-张连芬.pdf\n",
|
||
"file/140/小街村/00416-石金峰.pdf\n",
|
||
"file/140/南范村/00417-张玉娟.pdf\n",
|
||
"file/140/南范村/00418-王树青.pdf\n",
|
||
"file/140/小街村/00419-黄文星.pdf\n",
|
||
"file/140/东范村/00420-马燕辉.pdf\n",
|
||
"file/140/小街村/00421-刘云霄.pdf\n",
|
||
"file/140/小街村/00422-王海.pdf\n",
|
||
"file/140/东范村/00423-崔云卿.pdf\n",
|
||
"file/140/罗盖村/00424-王玉凤.pdf\n",
|
||
"file/140/南范村/00427-高俊臣.pdf\n",
|
||
"file/140/宋王村/00429-董丽娜.pdf\n",
|
||
"file/140/小街村/00430-许发荣.pdf\n",
|
||
"file/140/北范村/00431-魏玉珍.pdf\n",
|
||
"file/140/新李村/00432-王秀花.pdf\n",
|
||
"file/140/宋王村/00433-程军花.pdf\n",
|
||
"file/140/北范村/00434-王保芹.pdf\n",
|
||
"file/140/小街村/00435-崔娟.pdf\n",
|
||
"file/140/杨庙村/00436-杨大妮.pdf\n",
|
||
"file/140/小街村/00437-刘华训.pdf\n",
|
||
"file/140/未明确/06000-车呈淼.pdf\n",
|
||
"file/140/未明确/06001-苏莎莎.pdf\n",
|
||
"file/140/未明确/06002-宗文琴.pdf\n",
|
||
"file/140/未明确/06003-朱连梅.pdf\n",
|
||
"file/140/未明确/98765-张红霞.pdf\n",
|
||
"file/140/未明确/98776-唐庆振.pdf\n"
|
||
]
|
||
}
|
||
],
|
||
"source": [
|
||
"import os,sys,shutil\n",
|
||
"import json\n",
|
||
"import math\n",
|
||
"\n",
|
||
"filename = 'data/杨庙体测明确人员信息(20230328).json'\n",
|
||
"with open(filename,'r') as fl:\n",
|
||
" dict1 = json.load(fl)\n",
|
||
"old = []\n",
|
||
"depart = []\n",
|
||
"for k, v in dict1.items():\n",
|
||
" m_depart = v['unit']\n",
|
||
" if m_depart not in depart:\n",
|
||
" depart.append(m_depart)\n",
|
||
" \n",
|
||
"fi_path = '/data/pdf/ydyb/140/2023-03-29'\n",
|
||
"\n",
|
||
"\n",
|
||
"# 创建部门办公室 \n",
|
||
"m_path = 'file/140'\n",
|
||
"for pn in depart:\n",
|
||
" if not os.path.exists(m_path + '/' + pn):\n",
|
||
" os.mkdir(m_path + '/' + pn)\n",
|
||
"fl=os.listdir(fi_path)\n",
|
||
"for fn in fl:\n",
|
||
" if os.path.isfile(fi_path + '/' + fn):\n",
|
||
" ofn = int(fn.split('.')[0])\n",
|
||
" old.append(ofn) \n",
|
||
"old.sort()\n",
|
||
"for n in old: \n",
|
||
" o_name = f'{fi_path}/{n}.pdf'\n",
|
||
" unit = dict1[str(n)]['unit']\n",
|
||
" name = dict1[str(n)]['name']\n",
|
||
" n_name = f'{m_path}/{unit}/{str(n).rjust(5,\"0\")}-{name}.pdf'\n",
|
||
" #print(o_name,n_name)\n",
|
||
" if not os.path.exists(n_name):\n",
|
||
" shutil.copyfile(o_name,n_name)\n",
|
||
" print(n_name)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "a1e61c81-d63b-4089-8d79-f05b4a7a35e2",
|
||
"metadata": {},
|
||
"source": [
|
||
"## 生成体检报告情况表"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 11,
|
||
"id": "b1ff81f5-a8fa-4cea-9158-f80bccbf1494",
|
||
"metadata": {
|
||
"execution": {
|
||
"iopub.execute_input": "2023-03-29T03:02:01.912359Z",
|
||
"iopub.status.busy": "2023-03-29T03:02:01.911447Z",
|
||
"iopub.status.idle": "2023-03-29T03:02:01.978446Z",
|
||
"shell.execute_reply": "2023-03-29T03:02:01.977386Z",
|
||
"shell.execute_reply.started": "2023-03-29T03:02:01.912319Z"
|
||
},
|
||
"tags": []
|
||
},
|
||
"outputs": [
|
||
{
|
||
"name": "stdout",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"ok!\n"
|
||
]
|
||
}
|
||
],
|
||
"source": [
|
||
"import os,sys,shutil\n",
|
||
"import openpyxl\n",
|
||
"import json\n",
|
||
"\n",
|
||
"filename = 'data/杨庙体测明确人员信息(20230328).json'\n",
|
||
"with open(filename,'r') as fl:\n",
|
||
" dict1 = json.load(fl)\n",
|
||
"old = []\n",
|
||
"depart = []\n",
|
||
"for k, v in dict1.items():\n",
|
||
" m_depart = v['unit']\n",
|
||
" if m_depart not in depart:\n",
|
||
" depart.append(m_depart)\n",
|
||
" \n",
|
||
"fi_path = '/data/pdf/ydyb/140/2023-03-29'\n",
|
||
"fl=os.listdir(fi_path)\n",
|
||
"for fn in fl:\n",
|
||
" if os.path.isfile(fi_path + '/' + fn):\n",
|
||
" ofn = int(fn.split('.')[0])\n",
|
||
" old.append(ofn) \n",
|
||
"old.sort()\n",
|
||
"list1 = []\n",
|
||
"for n in old:\n",
|
||
" list2 =[]\n",
|
||
" unit = dict1[str(n)]['unit']\n",
|
||
" name = dict1[str(n)]['name']\n",
|
||
" list2 = [str(n).rjust(5,\"0\"),name,unit]\n",
|
||
" list1.append(list2)\n",
|
||
"\n",
|
||
"filename = 'data/杨庙体测报告明细表.xlsx'\n",
|
||
"wb = openpyxl.Workbook()\n",
|
||
"sheet = wb.active\n",
|
||
"title = ['体测编号','姓名','单位']\n",
|
||
"sheet.append(title)\n",
|
||
"for row in list1:\n",
|
||
" sheet.append(row)\n",
|
||
" \n",
|
||
"wb.save(filename) \n",
|
||
"print('ok!')"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "ca490666-c968-45e0-b42d-3b53a0e7c19c",
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": []
|
||
}
|
||
],
|
||
"metadata": {
|
||
"kernelspec": {
|
||
"display_name": "Python 3 (ipykernel)",
|
||
"language": "python",
|
||
"name": "python3"
|
||
},
|
||
"language_info": {
|
||
"codemirror_mode": {
|
||
"name": "ipython",
|
||
"version": 3
|
||
},
|
||
"file_extension": ".py",
|
||
"mimetype": "text/x-python",
|
||
"name": "python",
|
||
"nbconvert_exporter": "python",
|
||
"pygments_lexer": "ipython3",
|
||
"version": "3.10.6"
|
||
}
|
||
},
|
||
"nbformat": 4,
|
||
"nbformat_minor": 5
|
||
}
|