20241224
This commit is contained in:
1 parent
82372feb99
commit
c801f150ae
6 files changed
+1754
-593
No files matched your search
+389
-177
@@ -10,15 +10,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"execution_count": 58,
|
||||
"id": "bbba6efc-73cd-4db6-bae7-014724fee731",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-09-18T02:16:02.586698Z",
|
||||
"iopub.status.busy": "2024-09-18T02:16:02.585914Z",
|
||||
"iopub.status.idle": "2024-09-18T02:16:02.620560Z",
|
||||
"shell.execute_reply": "2024-09-18T02:16:02.620084Z",
|
||||
"shell.execute_reply.started": "2024-09-18T02:16:02.586621Z"
|
||||
"iopub.execute_input": "2024-12-23T05:16:55.108154Z",
|
||||
"iopub.status.busy": "2024-12-23T05:16:55.107437Z",
|
||||
"iopub.status.idle": "2024-12-23T05:16:55.138579Z",
|
||||
"shell.execute_reply": "2024-12-23T05:16:55.138007Z",
|
||||
"shell.execute_reply.started": "2024-12-23T05:16:55.108086Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -27,6 +27,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"89\n",
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
@@ -36,49 +37,49 @@
|
||||
"import json\n",
|
||||
"from datetime import date\n",
|
||||
"\n",
|
||||
"wb = openpyxl.load_workbook('data/北体体质康健.xlsx')\n",
|
||||
"wb = openpyxl.load_workbook('data/北体体质康健2班.xlsx')\n",
|
||||
"sheet = wb.active\n",
|
||||
"# sheets = wb.sheetnames\n",
|
||||
"person = {}\n",
|
||||
"\n",
|
||||
"for n in range(1, sheet.max_row+1):\n",
|
||||
"for n in range(3, sheet.max_row+1):\n",
|
||||
" code = int(sheet.cell(n, 1).value)\n",
|
||||
" person.setdefault(code, {})\n",
|
||||
" dict1 = {}\n",
|
||||
" dict1['name'] = sheet.cell(n, 2).value\n",
|
||||
" dict1['sex'] = sheet.cell(n, 3).value\n",
|
||||
" dict1['unit'] = '北体体质康健班'\n",
|
||||
" dict1['birth'] = str(sheet.cell(n, 4).value).replace('/','-').split(' ')[0]\n",
|
||||
" if sheet.cell(n,5).value is not None:\n",
|
||||
" dict1['phone'] = str(sheet.cell(n,5).value) \n",
|
||||
" dict1['name'] = sheet.cell(n, 3).value\n",
|
||||
" dict1['sex'] = sheet.cell(n, 4).value\n",
|
||||
" dict1['unit'] = sheet.cell(n, 2).value\n",
|
||||
" dict1['birth'] = str(sheet.cell(n, 5).value).replace('/','-').split(' ')[0]\n",
|
||||
" dict1['age'] = sheet.cell(n, 6).value\n",
|
||||
" if sheet.cell(n,7).value is not None:\n",
|
||||
" dict1['phone'] = str(sheet.cell(n,7).value) \n",
|
||||
" person[code] = dict1\n",
|
||||
"filename = 'data/北体体质康健.json'\n",
|
||||
"filename = 'data/北体体质康健班202412.json'\n",
|
||||
"with open(filename, 'w') as fl:\n",
|
||||
" json.dump(person, fl, ensure_ascii=False)\n",
|
||||
"print(len(person))\n",
|
||||
"print('ok')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "6bcd45c2-10af-4d5f-9e0b-5cd1df4f7a7f",
|
||||
"metadata": {
|
||||
"jp-MarkdownHeadingCollapsed": true
|
||||
},
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 获取人员测试成绩"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"execution_count": 51,
|
||||
"id": "970e171e-1360-448f-a28c-520ccb8f314a",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-09-18T02:17:10.941442Z",
|
||||
"iopub.status.busy": "2024-09-18T02:17:10.940669Z",
|
||||
"iopub.status.idle": "2024-09-18T02:17:10.997800Z",
|
||||
"shell.execute_reply": "2024-09-18T02:17:10.997322Z",
|
||||
"shell.execute_reply.started": "2024-09-18T02:17:10.941368Z"
|
||||
"iopub.execute_input": "2024-12-23T02:18:32.436129Z",
|
||||
"iopub.status.busy": "2024-12-23T02:18:32.435385Z",
|
||||
"iopub.status.idle": "2024-12-23T02:18:32.449327Z",
|
||||
"shell.execute_reply": "2024-12-23T02:18:32.448323Z",
|
||||
"shell.execute_reply.started": "2024-12-23T02:18:32.436058Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -87,8 +88,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"87\n",
|
||||
"87\n"
|
||||
"67\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -98,78 +98,51 @@
|
||||
"import csv\n",
|
||||
"from datetime import date\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",
|
||||
"item['1']['en'] = 'lung'\n",
|
||||
"item['2']['en'] = 'grip'\n",
|
||||
"item['3']['en'] = 'flexion'\n",
|
||||
"item['4']['en'] = 'jump'\n",
|
||||
"item['5']['en'] = 'pushup'\n",
|
||||
"item['6']['en'] = 'balance'\n",
|
||||
"item['7']['en'] = 'reaction'\n",
|
||||
"item['8']['en'] = 'step'\n",
|
||||
"item['9']['en'] = 'situp'\n",
|
||||
"item['10']['en'] = 'height'\n",
|
||||
"item['11']['en'] = 'weight'\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"re_ta = {}\n",
|
||||
"dict1 = {}\n",
|
||||
"list1 = []\n",
|
||||
"filename = 'data/北体体质康健.json'\n",
|
||||
"filename = 'data/北体体质康健班202412.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"\n",
|
||||
"filename = 'data/places_result_20240918.csv'\n",
|
||||
"filename = 'data/marks_20241222.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",
|
||||
"#f_item = ['lung','grip','flexion','jump','balance','reaction','step','situp']\n",
|
||||
"#m_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step']\n",
|
||||
"\n",
|
||||
"for result in list1:\n",
|
||||
" user = str(result[2])\n",
|
||||
" rq = date.fromisoformat(result[6].replace('/','-'))\n",
|
||||
" rq = date.fromisoformat(result[5].replace('/','-'))\n",
|
||||
" if user in dict1.keys():\n",
|
||||
" l_xm = []\n",
|
||||
" m_item = str(result[3]) \n",
|
||||
" re_ta.setdefault(user,{}) \n",
|
||||
" re_ta[user]['name'] = dict1[user]['name']\n",
|
||||
" re_ta[user]['sex'] = dict1[user]['sex']\n",
|
||||
" re_ta[user]['birth'] = dict1[user]['birth']\n",
|
||||
" re_ta[user]['unit'] = dict1[user]['unit']\n",
|
||||
" if 'phone' in dict1[user].keys():\n",
|
||||
" re_ta[user]['phone'] = dict1[user]['phone']\n",
|
||||
" if dict1[user]['sex'] == '男':\n",
|
||||
" l_xm = ['weight','height','lung','grip','flexion','jump','pushup','balance','reaction','step']\n",
|
||||
" l_xm = ['bmi','lung','grip','flexion','jump','pushup','balance','reaction','step']\n",
|
||||
" else:\n",
|
||||
" l_xm = ['weight','height','lung','grip','flexion','jump','balance','reaction','step','situp']\n",
|
||||
" re_ta[user]['unit'] = dict1[user]['unit']\n",
|
||||
" #birth = date.fromisoformat(dict1[user]['birth'].replace('/','-'))\n",
|
||||
" birth = date.fromisoformat(dict1[user]['birth'])\n",
|
||||
" #nian = int(birth[0].strip())\n",
|
||||
" #yue = int(birth[1].strip())\n",
|
||||
" #ri = int(birth[2].strip())\n",
|
||||
" #print(k,nian,yue,ri)\n",
|
||||
" item_name = item[m_item]['en'] \n",
|
||||
" l_xm = ['bmi','lung','grip','flexion','jump','balance','reaction','step','situp']\n",
|
||||
" #re_ta[user]['unit'] = dict1[user]['unit']\n",
|
||||
" birth = date.fromisoformat(dict1[user]['birth'].replace('/','-'))\n",
|
||||
" item_name = result[3] \n",
|
||||
" if item_name in l_xm: \n",
|
||||
" days = (rq-birth).days \n",
|
||||
" re_ta[user]['age'] = int(days/365)\n",
|
||||
" re_ta[user]['month'] = int(days/365*12)\n",
|
||||
" re_ta[user]['rq'] = result[6]\n",
|
||||
"\n",
|
||||
"\n",
|
||||
" re_ta[user]['rq'] = result[5]\n",
|
||||
" re_ta[user].setdefault(item_name,{}) \n",
|
||||
" score = int(result[4])/item[m_item]['divisor'] \n",
|
||||
" re_ta[user][item_name]['成绩'] = f'{score} {item[m_item][\"unit\"]}'\n",
|
||||
"print(len(re_ta))\n",
|
||||
"filename = 'data/result_北体体质康健.json'\n",
|
||||
" score = result[4] \n",
|
||||
" re_ta[user][item_name]['成绩'] = score\n",
|
||||
"\n",
|
||||
"filename = 'data/result_北体体质康健班202412.json'\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(re_ta, fl, ensure_ascii=False) \n",
|
||||
"print(len(re_ta))"
|
||||
@@ -177,19 +150,90 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "d034a61d-1fbd-417b-99bd-277e43ebb678",
|
||||
"metadata": {
|
||||
"jp-MarkdownHeadingCollapsed": true
|
||||
"id": "74ec60b7-b1d9-488d-95fa-4ddd020c2a4c",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 生成测试得分"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 52,
|
||||
"id": "c3b99428-00d5-45ea-9803-261194525fa4",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-23T02:18:35.914475Z",
|
||||
"iopub.status.busy": "2024-12-23T02:18:35.913744Z",
|
||||
"iopub.status.idle": "2024-12-23T02:18:35.934796Z",
|
||||
"shell.execute_reply": "2024-12-23T02:18:35.933710Z",
|
||||
"shell.execute_reply.started": "2024-12-23T02:18:35.914405Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok!\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import time\n",
|
||||
"import my_module as My\n",
|
||||
"\n",
|
||||
"#list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','height','weight']\n",
|
||||
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp']\n",
|
||||
"filename = 'data/result_北体体质康健班202412.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict2 = json.load(fl) \n",
|
||||
"for k, v in dict2.items():\n",
|
||||
" #print(k)\n",
|
||||
" if v['sex'] == '男':\n",
|
||||
" sex = 'M'\n",
|
||||
" else:\n",
|
||||
" sex = 'F' \n",
|
||||
" if 'bmi' in v.keys():\n",
|
||||
" #bmi_data = v['height']['成绩'].split()[0]+','+ v['weight']['成绩'].split()[0]\n",
|
||||
" bmi_data = v['bmi']['成绩']\n",
|
||||
" data1 = {'code':k,'sex':sex,'age':v['age'],'item':'HeightWeight','result':bmi_data}\n",
|
||||
" dict2[k]['bmi'] = {}\n",
|
||||
" dict2[k]['bmi']['成绩'] = bmi_data\n",
|
||||
" dict2[k]['bmi']['score'] = My.cal_bmi(data1)\n",
|
||||
" for item_en in list_item:\n",
|
||||
" if item_en in v.keys(): \n",
|
||||
" data1 = {'code':k,'sex':sex,'age':v['age'],'item':item_en,'result':float(v[item_en]['成绩'].split()[0])}\n",
|
||||
" #print(k,v['name'])\n",
|
||||
" dict2[k][item_en]['score'] = My.cal_score(data1)\n",
|
||||
" #print(k,v[item_en]['成绩'],cal_score(data1))\n",
|
||||
"\n",
|
||||
"filename = f'data/result_北体体质康健班202412.json'\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(dict2,fl , ensure_ascii=False) \n",
|
||||
"print('ok!') "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "d034a61d-1fbd-417b-99bd-277e43ebb678",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 导出测试人员信息"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 53,
|
||||
"id": "0c60a509-dfc0-426a-a44e-e9a760139463",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-23T02:18:43.101468Z",
|
||||
"iopub.status.busy": "2024-12-23T02:18:43.100822Z",
|
||||
"iopub.status.idle": "2024-12-23T02:18:43.133068Z",
|
||||
"shell.execute_reply": "2024-12-23T02:18:43.132432Z",
|
||||
"shell.execute_reply.started": "2024-12-23T02:18:43.101408Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
@@ -198,82 +242,81 @@
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"items = ['lung','grip','flexion','jump','pushup','situp','balance','reaction','step']\n",
|
||||
"bmi = ['height','weight']\n",
|
||||
"title = ['编号','姓名','性别','身高','体重','bmi','肺活量','','握力','','坐位体前屈','','纵跳','','俯卧撑','','一分钟仰卧起坐','','单脚站立','','选择反应时','','台阶指数']\n",
|
||||
"title = ['编号','姓名','性别','单位','身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
|
||||
"\n",
|
||||
"filename = 'data/727410_pdf.json'\n",
|
||||
"filename = 'data/result_北体体质康健班202412.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" list2 = json.load(fl)\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"\n",
|
||||
"list1 = []\n",
|
||||
"for xm in list2: \n",
|
||||
" list2 = []\n",
|
||||
" list2.append(xm['id'].rjust(3,'0'))\n",
|
||||
" list2.append(xm['name']) \n",
|
||||
" list2.append(xm['gender']) \n",
|
||||
"filename = 'data/北体体质康健班202412.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict2 = json.load(fl)\n",
|
||||
" \n",
|
||||
" i = 0\n",
|
||||
" if 'bmi' in xm['fits'].keys():\n",
|
||||
" m_bmi = xm['fits']['bmi']['mark']\n",
|
||||
" list2.append(m_bmi.split(',')[0])\n",
|
||||
" list2.append(m_bmi.split(',')[1])\n",
|
||||
" list2.append(xm['fits']['bmi']['score'])\n",
|
||||
" i+=1\n",
|
||||
"list1 = []\n",
|
||||
"for k, v in dict1.items():\n",
|
||||
" list2 = []\n",
|
||||
" list2.append(str(k).rjust(5,'0'))\n",
|
||||
" list2.append(v['name']) \n",
|
||||
" list2.append(dict2[k]['sex'])\n",
|
||||
" list2.append(dict2[k]['unit'])\n",
|
||||
" if 'bmi' in v.keys():\n",
|
||||
" height = v['bmi']['成绩'].split(',')[0]\n",
|
||||
" weight = v['bmi']['成绩'].split(',')[1]\n",
|
||||
" list2.append(height)\n",
|
||||
" list2.append(weight)\n",
|
||||
" else:\n",
|
||||
" list2.append('') \n",
|
||||
" list2.append('') \n",
|
||||
" list2.append('') \n",
|
||||
"\n",
|
||||
"\n",
|
||||
" list2.append('')\n",
|
||||
" list2.append('')\n",
|
||||
" for item in items:\n",
|
||||
" if item in xm['fits'].keys():\n",
|
||||
" list2.append(xm['fits'][item]['mark'])\n",
|
||||
" list2.append(xm['fits'][item]['score']) \n",
|
||||
" i+=1\n",
|
||||
" #elif item =='name':\n",
|
||||
" # list2.append(dict1[k][item])\n",
|
||||
" if item in v.keys():\n",
|
||||
" list2.append(v[item]['成绩']) \n",
|
||||
" elif item =='name':\n",
|
||||
" list2.append(v[item])\n",
|
||||
" else:\n",
|
||||
" list2.append('') \n",
|
||||
" list2.append('') \n",
|
||||
" print(list2)\n",
|
||||
" if i>2:\n",
|
||||
" list2.append('')\n",
|
||||
" \n",
|
||||
" list1.append(list2)\n",
|
||||
"filename = 'data/东营老年大学体测情况表.xlsx'\n",
|
||||
"filename = 'data/北体体质康健班体测情况表202412.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') "
|
||||
"wb.save(filename)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "d794e69d-9444-4765-9b7d-8dcb0f8c4343",
|
||||
"metadata": {
|
||||
"jp-MarkdownHeadingCollapsed": true
|
||||
},
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 导入问卷信息"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 24,
|
||||
"execution_count": 49,
|
||||
"id": "79fb7799-3693-4b7b-ae82-c0d8dee98d36",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-09-14T11:49:21.331114Z",
|
||||
"iopub.status.busy": "2024-09-14T11:49:21.330310Z",
|
||||
"iopub.status.idle": "2024-09-14T11:49:21.362941Z",
|
||||
"shell.execute_reply": "2024-09-14T11:49:21.362399Z",
|
||||
"shell.execute_reply.started": "2024-09-14T11:49:21.331031Z"
|
||||
"iopub.execute_input": "2024-12-22T07:18:34.575061Z",
|
||||
"iopub.status.busy": "2024-12-22T07:18:34.574259Z",
|
||||
"iopub.status.idle": "2024-12-22T07:18:34.606759Z",
|
||||
"shell.execute_reply": "2024-12-22T07:18:34.606260Z",
|
||||
"shell.execute_reply.started": "2024-12-22T07:18:34.574981Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"71\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import csv\n",
|
||||
@@ -283,63 +326,52 @@
|
||||
"\n",
|
||||
"dict1 = {}\n",
|
||||
"\n",
|
||||
"filename = 'data/result_北体体质康健.json'\n",
|
||||
"filename = 'data/result_北体体质康健班202412.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"filename = 'data/北体体质康健班202412.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict3 = json.load(fl)\n",
|
||||
"\n",
|
||||
"phone = {}\n",
|
||||
"for k,v in dict3.items():\n",
|
||||
" if 'phone' in v.keys():\n",
|
||||
" phone[v['phone']] = k\n",
|
||||
"\n",
|
||||
"list1 = []\n",
|
||||
"filename = 'data/Survey_20240914.csv'\n",
|
||||
"filename = 'data/Survey_20241220.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",
|
||||
" list1.append(line)\n",
|
||||
"#print(list1)\n",
|
||||
"dict2 = {}\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"for item in list1:\n",
|
||||
" psy = []\n",
|
||||
" if item[2] in phone.keys():\n",
|
||||
" psy =[]\n",
|
||||
" tcm = []\n",
|
||||
" spine = []\n",
|
||||
" for i in range(0,45):\n",
|
||||
" psy.append(0)\n",
|
||||
" psy[44] = []\n",
|
||||
" for i in range(0,60):\n",
|
||||
" tcm.append(0)\n",
|
||||
" for i in range(0,26):\n",
|
||||
" spine.append(0)\n",
|
||||
" phone = item[2]\n",
|
||||
" for k1, v1 in dict3.items():\n",
|
||||
" if 'phone' in v1.keys() and phone ==v1['phone']: \n",
|
||||
" dict1[k1] = dict3[k1]\n",
|
||||
" #dict1[k1]['month'] = dict1[k1]['age'] *12\n",
|
||||
"#print(dict1)\n",
|
||||
"for item in list1:\n",
|
||||
" #print(item)\n",
|
||||
" psy = []\n",
|
||||
" tcm = []\n",
|
||||
" spine = []\n",
|
||||
" for i in range(0,45):\n",
|
||||
" psy.append(0)\n",
|
||||
" for i in range(0,60):\n",
|
||||
" tcm.append(0)\n",
|
||||
" for i in range(0,26):\n",
|
||||
" spine.append(0)\n",
|
||||
" phone = item[2]\n",
|
||||
" for k1, v1 in dict1.items():\n",
|
||||
" #print((k1,v1))\n",
|
||||
" if phone ==v1['phone']: \n",
|
||||
" content = json.loads(item[5])\n",
|
||||
" #print(content)\n",
|
||||
" \n",
|
||||
" content = json.loads(item[5])\n",
|
||||
" if phone[item[2]] not in dict1.keys():\n",
|
||||
" dict1[phone[item[2]]] = dict3[phone[item[2]]]\n",
|
||||
" rq = date.fromisoformat(item[6].replace('/','-').split(' ')[0])\n",
|
||||
" #dict1[phone[item[2]]]['rq'] = date.fromisoformat(item[6].replace('/','-').split(' ')[0])\n",
|
||||
" dict1[phone[item[2]]]['rq'] = item[6].replace('/','-').split(' ')[0]\n",
|
||||
" for k, v in content.items():\n",
|
||||
" #print('k:',k,'v:',v)\n",
|
||||
" if 'psyOld' in k: \n",
|
||||
" if 'psyOld' in k:\n",
|
||||
" i = int(k[6:])\n",
|
||||
" psy[i-1] = int(v)\n",
|
||||
" if 'tcm' in k: \n",
|
||||
" if 'tcm' in k:\n",
|
||||
" i = int(k[3:])\n",
|
||||
" tcm[i-1] = int(v)\n",
|
||||
" if 'spine' in k:\n",
|
||||
@@ -352,41 +384,33 @@
|
||||
" for i in range(26,40):\n",
|
||||
" new_valve = 1+psy[i]\n",
|
||||
" psy[i] = new_valve\n",
|
||||
" psy[44] = []\n",
|
||||
" dict1[k1]['psy'] = psy\n",
|
||||
" \n",
|
||||
" dict1[phone[item[2]]]['psy_yangmiao_old'] = psy\n",
|
||||
" if 'tcm' in item[5]:\n",
|
||||
" if tcm[40] ==0:\n",
|
||||
" tcm[40] =1\n",
|
||||
" dict1[k1]['tcm'] = tcm\n",
|
||||
" dict1[phone[item[2]]]['tcm'] = tcm\n",
|
||||
" if 'spine' in item[5]:\n",
|
||||
" for ii in range(25,23,-1):\n",
|
||||
" \n",
|
||||
" spine[ii] = spine[ii-1]\n",
|
||||
" spine[22] = 0 \n",
|
||||
" dict1[phone[item[2]]]['spine'] = spine\n",
|
||||
" birth = date.fromisoformat(dict3[phone[item[2]]]['birth'].replace('/','-'))\n",
|
||||
" \n",
|
||||
" spine[22] = 0\n",
|
||||
" \n",
|
||||
" \n",
|
||||
" \n",
|
||||
" dict1[k1]['spine'] = spine\n",
|
||||
" #birth = date.fromisoformat(dict3[k1]['birth'].replace('/','-'))\n",
|
||||
"\n",
|
||||
" #days = (rq-birth).days \n",
|
||||
" #dict1[k1]['age'] = int(days/365)\n",
|
||||
" \n",
|
||||
" dict1[k1]['rq'] = item[6].replace('/','-').split(' ')[0]\n",
|
||||
"#print(dict1)\n",
|
||||
"filename = 'data/result_北体体质康健1.json'\n",
|
||||
" days = (rq-birth).days \n",
|
||||
" dict1[phone[item[2]]]['age'] = int(days/365)\n",
|
||||
" dict1[phone[item[2]]]['month'] = int(days/365*12)\n",
|
||||
"filename = 'data/result_北体体质康健班202412-1.json'\n",
|
||||
"\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(dict1, fl, ensure_ascii=False) "
|
||||
" json.dump(dict1, fl, ensure_ascii=False)\n",
|
||||
"print(len(dict1))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "9f9111f1-8cf0-4d45-b9b2-e3b631023581",
|
||||
"metadata": {
|
||||
"jp-MarkdownHeadingCollapsed": true
|
||||
},
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 获取问卷人员信息"
|
||||
]
|
||||
@@ -444,9 +468,16 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 13,
|
||||
"id": "eb4091f4-9823-4361-acb2-f3e898f9524b",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-22T00:37:03.115402Z",
|
||||
"iopub.status.busy": "2024-12-22T00:37:03.114604Z",
|
||||
"iopub.status.idle": "2024-12-22T00:37:03.144709Z",
|
||||
"shell.execute_reply": "2024-12-22T00:37:03.144175Z",
|
||||
"shell.execute_reply.started": "2024-12-22T00:37:03.115323Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
@@ -459,13 +490,13 @@
|
||||
"\n",
|
||||
"dict1 = {}\n",
|
||||
"\n",
|
||||
"filename = 'data/result_东营老年大学.json'\n",
|
||||
"filename = 'data/result_北体体质康健班202412.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict3 = json.load(fl)\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"list1 = []\n",
|
||||
"filename = 'data/Survey_20240321.csv'\n",
|
||||
"filename = 'data/Survey_20241220.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
" header = next(fl) \n",
|
||||
@@ -551,7 +582,7 @@
|
||||
" \n",
|
||||
" dict1[k1]['rq'] = item[6].replace('/','-').split(' ')[0]\n",
|
||||
"#print(dict1)\n",
|
||||
"filename = 'data/result_东营老年大学1.json'\n",
|
||||
"filename = 'data/result_北体体质康健班202412-1.json'\n",
|
||||
"\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(dict1, fl, ensure_ascii=False) "
|
||||
@@ -559,16 +590,197 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "a8dbc7ae-cf00-4591-8572-600c39b37750",
|
||||
"id": "85d087e3-c469-409e-893b-a22789d73613",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 核对人员成绩"
|
||||
"## 生成报告"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 50,
|
||||
"id": "327c33e2-7437-4421-b70c-ec98234a5e88",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-22T07:18:54.900729Z",
|
||||
"iopub.status.busy": "2024-12-22T07:18:54.899962Z",
|
||||
"iopub.status.idle": "2024-12-22T07:19:29.111150Z",
|
||||
"shell.execute_reply": "2024-12-22T07:19:29.110336Z",
|
||||
"shell.execute_reply.started": "2024-12-22T07:18:54.900656Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"71\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import requests\n",
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"headers = {\n",
|
||||
" \"Content-Type\": \"application/json; charset=UTF-8\"\n",
|
||||
" }\n",
|
||||
"filename = 'data/result_北体体质康健班202412-1.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"list1 = []\n",
|
||||
"file_path ='./北体体质康健班202412/'\n",
|
||||
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','bmi']\n",
|
||||
"i=0\n",
|
||||
"list2 = []\n",
|
||||
"for k, v in dict1.items():\n",
|
||||
" list1 = []\n",
|
||||
" mydata = {}\n",
|
||||
" \n",
|
||||
" id = str(k).rjust(4,\"0\")\n",
|
||||
" mydata['path'] = file_path+id+'-'+ v['name']+'.pdf'\n",
|
||||
" mydata['title'] = '北体体质康健班'\n",
|
||||
" mydata['subtitle'] = v['unit']\n",
|
||||
" mydata['id'] = id\n",
|
||||
" mydata['name'] = v['name']\n",
|
||||
" if v['sex'] == '男':\n",
|
||||
" mydata['gender'] = 'male'\n",
|
||||
" else:\n",
|
||||
" mydata['gender'] = 'female'\n",
|
||||
" \n",
|
||||
" mydata['month'] = v['month']\n",
|
||||
" mydata['fits'] = {}\n",
|
||||
" survey_list = ['tcm','psy_yangmiao_old','spine']\n",
|
||||
" for item in survey_list:\n",
|
||||
" if item in v.keys():\n",
|
||||
" mydata.setdefault('surveys',{})\n",
|
||||
" mydata['surveys'][item] = v[item]\n",
|
||||
" \n",
|
||||
" \n",
|
||||
" #mydata['fits'] = {}\n",
|
||||
" for item in list_item:\n",
|
||||
" if item in v.keys():\n",
|
||||
" mydata.setdefault('fits',{})\n",
|
||||
" if item in ['lung','pushup','step','situp']:\n",
|
||||
" mark = v[item]['成绩'].split()[0].split('.')[0]\n",
|
||||
" else:\n",
|
||||
" mark = v[item]['成绩'].split()[0]\n",
|
||||
" mydata['fits'][item] = {'mark':mark,'score':v[item]['score']}\n",
|
||||
" if len(mydata['fits']) >2 or len(mydata['surveys']) >0:\n",
|
||||
" #if len(mydata['fits']) >2 : \n",
|
||||
" list1.append(mydata)\n",
|
||||
" list2.append([k,v['name']])\n",
|
||||
" i+=1\n",
|
||||
" x = requests.post('http://localhost:3003', data = json.dumps(list1), headers=headers)\n",
|
||||
" #print(id,v['name'],x.text)\n",
|
||||
" #print(mydata)\n",
|
||||
" #x.close()\n",
|
||||
"print(i)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "raw",
|
||||
"id": "640b2865-5739-464b-ac51-0ffc49adb00f",
|
||||
"metadata": {},
|
||||
"source": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 88,
|
||||
"id": "46ff1333-f051-4022-a765-e0964a2ee427",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-24T14:45:09.893552Z",
|
||||
"iopub.status.busy": "2024-12-24T14:45:09.892819Z",
|
||||
"iopub.status.idle": "2024-12-24T14:45:09.940625Z",
|
||||
"shell.execute_reply": "2024-12-24T14:45:09.940171Z",
|
||||
"shell.execute_reply.started": "2024-12-24T14:45:09.893481Z"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import csv\n",
|
||||
"import openpyxl\n",
|
||||
"import time\n",
|
||||
"from datetime import date\n",
|
||||
"import ast\n",
|
||||
"\n",
|
||||
"items = ['lung','grip','flexion','balance','reaction','step']\n",
|
||||
"title = ['编号','姓名','性别','年龄','单位','身高','体重','得分','肺活量','得分','握力','得分','坐位体前屈','得分','单脚站立','得分','选择反应时','得分','台阶指数','得分']\n",
|
||||
"filename = 'data/北体体质康健班202412.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict2 = json.load(fl)\n",
|
||||
"\n",
|
||||
"filename = 'data/data2.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" list1 = json.load(fl)\n",
|
||||
"list2 = []\n",
|
||||
"for item in list1:\n",
|
||||
" list3 = []\n",
|
||||
" code = item['id']\n",
|
||||
" if 'fits' in item.keys() or 'surveysScore' in item.keys():\n",
|
||||
" list3.append(code)\n",
|
||||
" list3.append(dict2[code]['name'])\n",
|
||||
" list3.append(dict2[code]['sex'])\n",
|
||||
" list3.append(dict2[code]['age'])\n",
|
||||
" list3.append(dict2[code]['unit'])\n",
|
||||
" \n",
|
||||
" if 'fits' in item.keys():\n",
|
||||
" v = item['fits']\n",
|
||||
" if 'bmi' in v.keys():\n",
|
||||
" height = v['bmi']['mark'].split(',')[0]\n",
|
||||
" weight = v['bmi']['mark'].split(',')[1]\n",
|
||||
" list3.append(height)\n",
|
||||
" list3.append(weight)\n",
|
||||
" list3.append(v['bmi']['score']) \n",
|
||||
" else:\n",
|
||||
" list3.append('')\n",
|
||||
" list3.append('')\n",
|
||||
" list3.append('')\n",
|
||||
" for xm in items:\n",
|
||||
" if xm in v.keys():\n",
|
||||
" list3.append(v[xm]['mark'])\n",
|
||||
" list3.append(v[xm]['score']) \n",
|
||||
" else:\n",
|
||||
" list3.append('')\n",
|
||||
" list3.append('')\n",
|
||||
" else:\n",
|
||||
" for i in range(0,15):\n",
|
||||
" list3.append('')\n",
|
||||
" if 'surveysScore' in item.keys():\n",
|
||||
" v = item['surveysScore']\n",
|
||||
" list3.append(v['tcm']['type']['name'])\n",
|
||||
" list3.append(v['tcm']['near'])\n",
|
||||
" list3.append(v['psy']['身体健康满意度'])\n",
|
||||
" list3.append(v['psy']['心理健康'])\n",
|
||||
" list3.append(v['psy']['社会支持'])\n",
|
||||
" list3.append(v['psy']['环境满意度'])\n",
|
||||
" list3.append(v['spine']['颈椎段'])\n",
|
||||
" list3.append(v['spine']['胸椎段'])\n",
|
||||
" list3.append(v['spine']['腰椎段'])\n",
|
||||
" list3.append(v['spine']['骶尾椎段'])\n",
|
||||
" else:\n",
|
||||
" for i in range(0,10):\n",
|
||||
" list3.append('')\n",
|
||||
" list2.append(list3) \n",
|
||||
" \n",
|
||||
"filename = 'data/北体体质康健班体测情况表202412.xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"sheet.append(title)\n",
|
||||
"for row in list2:\n",
|
||||
" sheet.append(row)\n",
|
||||
" \n",
|
||||
"wb.save(filename)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "1e617679-6d57-4389-bc84-4e14e63616f1",
|
||||
"id": "9ce2589b-881a-4c36-8a48-9cfd212cc40b",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
|
||||
+230
-62
@@ -3,18 +3,23 @@
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "e6dcc663-e0ed-4ea3-b442-11f229f4af94",
|
||||
"metadata": {
|
||||
"jp-MarkdownHeadingCollapsed": true
|
||||
},
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 新增体测单位"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 1,
|
||||
"id": "360f0a97-d73d-43f3-9f7a-0f9582103c82",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-23T02:35:15.481801Z",
|
||||
"iopub.status.busy": "2024-12-23T02:35:15.481073Z",
|
||||
"iopub.status.idle": "2024-12-23T02:35:15.588908Z",
|
||||
"shell.execute_reply": "2024-12-23T02:35:15.588281Z",
|
||||
"shell.execute_reply.started": "2024-12-23T02:35:15.481732Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
@@ -25,10 +30,10 @@
|
||||
"mydb = myclient[\"baogao\"]\n",
|
||||
"mycol = mydb[\"place\"]\n",
|
||||
"\n",
|
||||
"place_id = 345321\n",
|
||||
"place_code = \"14\"\n",
|
||||
"dw_name = \"中国石化镇海炼化公司\"\n",
|
||||
"dw_jc = \"中国石化镇海炼化公司\"\n",
|
||||
"place_id = 141002\n",
|
||||
"place_code = \"15\"\n",
|
||||
"dw_name = \"北体体质康健班\"\n",
|
||||
"dw_jc = \"北体体质康健班\"\n",
|
||||
"myquery = { \"id\": place_id }\n",
|
||||
"num = mycol.count_documents(myquery)\n",
|
||||
"if num>0:\n",
|
||||
@@ -48,10 +53,26 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 3,
|
||||
"id": "6ce2cbc7-435a-461c-bdb8-abd9a6962fbc",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-23T02:37:43.114677Z",
|
||||
"iopub.status.busy": "2024-12-23T02:37:43.113786Z",
|
||||
"iopub.status.idle": "2024-12-23T02:37:43.138884Z",
|
||||
"shell.execute_reply": "2024-12-23T02:37:43.138013Z",
|
||||
"shell.execute_reply.started": "2024-12-23T02:37:43.114598Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"71 ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import openpyxl\n",
|
||||
"import os,sys,shutil\n",
|
||||
@@ -65,10 +86,10 @@
|
||||
"myclient = pymongo.MongoClient('mongodb://localhost:27017/')\n",
|
||||
"mydb = myclient[\"baogao\"]\n",
|
||||
"\n",
|
||||
"place_id = 496534\n",
|
||||
"place_code = \"12\"\n",
|
||||
"dw_name = \"天宫院社区\"\n",
|
||||
"dw_jc = \"天宫院社区\"\n",
|
||||
"place_id = 141002\n",
|
||||
"place_code = \"15\"\n",
|
||||
"dw_name = \"北体体质康健班\"\n",
|
||||
"dw_jc = \"北体体质康健班\"\n",
|
||||
"fi_path = '/home/songyi/python/mycrm/flask/pdf/files'\n",
|
||||
"fls = glob.glob(f'{fi_path}/{str(place_id)}/*.pdf')\n",
|
||||
"\n",
|
||||
@@ -86,7 +107,7 @@
|
||||
"\n",
|
||||
"i = 0\n",
|
||||
"while i < len(fls):\n",
|
||||
" code = random.sample(code_list,3) #随机取3位数\n",
|
||||
" code = random.sample(code_list,4) #随机取3位数\n",
|
||||
" code_num = ''.join(code) \n",
|
||||
" if place_code+code_num not in list1 and place_code+code_num not in list2:\n",
|
||||
" list1.append(place_code+code_num)\n",
|
||||
@@ -102,8 +123,8 @@
|
||||
" dict2 = {'place_id':place_id,'code':dxm,'fn':Path(fn).name}\n",
|
||||
" list2.append(dict2)\n",
|
||||
" i +=1\n",
|
||||
"#x = mycol.insert_many(list2)\n",
|
||||
"#print('ok') "
|
||||
"x = mycol.insert_many(list2)\n",
|
||||
"print(len(list2),'ok') "
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -116,12 +137,97 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 6,
|
||||
"id": "5f665c0f-8d30-4759-b7f8-fb7e13b98efa",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-23T05:43:17.023291Z",
|
||||
"iopub.status.busy": "2024-12-23T05:43:17.022726Z",
|
||||
"iopub.status.idle": "2024-12-23T05:43:17.056324Z",
|
||||
"shell.execute_reply": "2024-12-23T05:43:17.055498Z",
|
||||
"shell.execute_reply.started": "2024-12-23T05:43:17.023237Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"1 15552778879 87-韩秋春.pdf 157481\n",
|
||||
"2 13176607576 40-聂秋香.pdf 150269\n",
|
||||
"3 13515466253 20-成桂艳.pdf 154130\n",
|
||||
"4 13356838977 45-齐立红.pdf 159017\n",
|
||||
"5 15505463267 6-刘来珍.pdf 151957\n",
|
||||
"6 15618032716 72-林娟.pdf 153582\n",
|
||||
"7 13001564985 23-李慧珠.pdf 153760\n",
|
||||
"8 13854609739 85-连海燕.pdf 156827\n",
|
||||
"9 13605461196 50-刘瑛.pdf 159238\n",
|
||||
"10 13697833655 48-刘其英.pdf 157409\n",
|
||||
"11 18654608681 68-张桂芝.pdf 157534\n",
|
||||
"12 13561099637 9-吕建国.pdf 157281\n",
|
||||
"13 13589970661 30-王争华.pdf 151934\n",
|
||||
"14 15666215813 5-刘晓红.pdf 152476\n",
|
||||
"15 15954638716 41-胡桂凤.pdf 153278\n",
|
||||
"16 13793983616 80-董希娥.pdf 150362\n",
|
||||
"17 18661395568 56-娄金华.pdf 153028\n",
|
||||
"18 15006966879 38-耿宏勋.pdf 154872\n",
|
||||
"19 13006548397 15-宋立君.pdf 155673\n",
|
||||
"20 13054610560 88-马国丽.pdf 153905\n",
|
||||
"21 13864711691 11-吴晓燕.pdf 156580\n",
|
||||
"22 13013569039 39-耿红霞.pdf 155263\n",
|
||||
"23 13356615748 17-张桂荣.pdf 150152\n",
|
||||
"24 13589961337 35-王霞.pdf 152574\n",
|
||||
"25 13678611392 34-王金美.pdf 152549\n",
|
||||
"26 13963356165 31-王春爱.pdf 156502\n",
|
||||
"27 13589986778 26-杨素华.pdf 158590\n",
|
||||
"28 13361512362 77-秦春霞.pdf 154059\n",
|
||||
"29 13054658622 86-郗桂红.pdf 157145\n",
|
||||
"30 18661378656 54-周春萍.pdf 154763\n",
|
||||
"31 15154636366 25-李红霞.pdf 156873\n",
|
||||
"32 18654698789 37-罗秀艳.pdf 150825\n",
|
||||
"33 13054652092 8-卢霞.pdf 159367\n",
|
||||
"34 15610063229 7-刘英.pdf 159386\n",
|
||||
"35 13963359769 1-万秀香.pdf 156540\n",
|
||||
"36 18554659267 47-任大华.pdf 156039\n",
|
||||
"37 18661376637 18-张秀玉.pdf 157206\n",
|
||||
"38 18611391991 71-朱兰生.pdf 153617\n",
|
||||
"39 13563399566 67-张伟.pdf 158436\n",
|
||||
"40 15263888916 36-生月华.pdf 150476\n",
|
||||
"41 13210319979 33-王海燕.pdf 155632\n",
|
||||
"42 13561020118 84-赵立静.pdf 156825\n",
|
||||
"43 13371503039 53-吕鸿义.pdf 159602\n",
|
||||
"44 13864791829 75-王翠云.pdf 151079\n",
|
||||
"45 18705469686 42-范晓英.pdf 157035\n",
|
||||
"46 13706366656 57-孙家祥.pdf 153718\n",
|
||||
"47 18554718350 63-宋秀娟.pdf 152087\n",
|
||||
"48 13792060709 76-盖荣.pdf 153519\n",
|
||||
"49 18860629985 46-于瑞先.pdf 154058\n",
|
||||
"50 15314347726 55-姜英.pdf 151762\n",
|
||||
"51 13854650187 32-王毅.pdf 159436\n",
|
||||
"52 15020597108 78-程茂霞.pdf 153264\n",
|
||||
"53 15606470366 73-温建华.pdf 155470\n",
|
||||
"54 13945664258 49-刘桂君.pdf 150794\n",
|
||||
"55 18554660557 65-巴建云.pdf 154836\n",
|
||||
"56 15105468997 14-宋清贤.pdf 151746\n",
|
||||
"57 13963370053 16-张德芳.pdf 158790\n",
|
||||
"58 13864707888 60-宁振莹.pdf 151487\n",
|
||||
"59 13906472659 64-尚国勋.pdf 150875\n",
|
||||
"60 13963350118 12-唐慧芳.pdf 152738\n",
|
||||
"61 13356645705 29-牛春芳.pdf 153915\n",
|
||||
"62 13054625519 89-黄启江.pdf 150912\n",
|
||||
"63 15666210207 81-袁庆敏.pdf 157248\n",
|
||||
"64 15954620216 44-雒云秀.pdf 156738\n",
|
||||
"65 13562277856 22-朱振峰.pdf 155413\n",
|
||||
"66 13181996942 70-曹玉英.pdf 151820\n",
|
||||
"67 18653699788 27-林乐武.pdf 151893\n",
|
||||
"68 13589432668 83-赵福珍.pdf 156124\n",
|
||||
"69 13563376888 3-伊茂胜.pdf 156285\n",
|
||||
"70 13375466356 13-孟凡业.pdf 150571\n",
|
||||
"71 13854664965 4-刘学农.pdf 151763\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"from tencentcloud.common import credential\n",
|
||||
"from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\n",
|
||||
@@ -136,8 +242,8 @@
|
||||
"mydb = myclient[\"baogao\"]\n",
|
||||
"mycol = mydb[\"pdf\"]\n",
|
||||
"\n",
|
||||
"dw_jc = \"天宫院社区\"\n",
|
||||
"filename = 'data/天宫院社区240922.json'\n",
|
||||
"dw_jc = \"北体体质康健班学员\"\n",
|
||||
"filename = 'data/北体体质康健班202412.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"dict2 = {}\n",
|
||||
@@ -197,12 +303,97 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 7,
|
||||
"id": "4b2b5d76-665f-4dfe-bbd3-5c80abd8c3e3",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-23T05:43:33.444175Z",
|
||||
"iopub.status.busy": "2024-12-23T05:43:33.443420Z",
|
||||
"iopub.status.idle": "2024-12-23T06:01:33.534050Z",
|
||||
"shell.execute_reply": "2024-12-23T06:01:33.532110Z",
|
||||
"shell.execute_reply.started": "2024-12-23T05:43:33.444103Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"15552778879 157481 send success\n",
|
||||
"13176607576 150269 send success\n",
|
||||
"13515466253 154130 send success\n",
|
||||
"13356838977 159017 send success\n",
|
||||
"15505463267 151957 send success\n",
|
||||
"15618032716 153582 send success\n",
|
||||
"13001564985 153760 send success\n",
|
||||
"13854609739 156827 send success\n",
|
||||
"13605461196 159238 send success\n",
|
||||
"13697833655 157409 send success\n",
|
||||
"18654608681 157534 send success\n",
|
||||
"13561099637 157281 send success\n",
|
||||
"13589970661 151934 send success\n",
|
||||
"15666215813 152476 send success\n",
|
||||
"15954638716 153278 send success\n",
|
||||
"13793983616 150362 send success\n",
|
||||
"18661395568 153028 send success\n",
|
||||
"15006966879 154872 send success\n",
|
||||
"13006548397 155673 send success\n",
|
||||
"13054610560 153905 send success\n",
|
||||
"13864711691 156580 send success\n",
|
||||
"13013569039 155263 send success\n",
|
||||
"13356615748 150152 send success\n",
|
||||
"13589961337 152574 send success\n",
|
||||
"13678611392 152549 send success\n",
|
||||
"13963356165 156502 send success\n",
|
||||
"13589986778 158590 send success\n",
|
||||
"13361512362 154059 send success\n",
|
||||
"13054658622 157145 send success\n",
|
||||
"18661378656 154763 send success\n",
|
||||
"15154636366 156873 send success\n",
|
||||
"18654698789 150825 send success\n",
|
||||
"13054652092 159367 send success\n",
|
||||
"15610063229 159386 send success\n",
|
||||
"13963359769 156540 send success\n",
|
||||
"18554659267 156039 send success\n",
|
||||
"18661376637 157206 send success\n",
|
||||
"18611391991 153617 send success\n",
|
||||
"13563399566 158436 send success\n",
|
||||
"15263888916 150476 send success\n",
|
||||
"13210319979 155632 send success\n",
|
||||
"13561020118 156825 send success\n",
|
||||
"13371503039 159602 send success\n",
|
||||
"13864791829 151079 send success\n",
|
||||
"18705469686 157035 send success\n",
|
||||
"13706366656 153718 send success\n",
|
||||
"18554718350 152087 send success\n",
|
||||
"13792060709 153519 send success\n",
|
||||
"18860629985 154058 send success\n",
|
||||
"15314347726 151762 send success\n",
|
||||
"13854650187 159436 send success\n",
|
||||
"15020597108 153264 send success\n",
|
||||
"15606470366 155470 send success\n",
|
||||
"13945664258 150794 send success\n",
|
||||
"18554660557 154836 send success\n",
|
||||
"15105468997 151746 send success\n",
|
||||
"13963370053 158790 send success\n",
|
||||
"13864707888 151487 send success\n",
|
||||
"13906472659 150875 send success\n",
|
||||
"13963350118 152738 send success\n",
|
||||
"13356645705 153915 send success\n",
|
||||
"13054625519 150912 send success\n",
|
||||
"15666210207 157248 send success\n",
|
||||
"15954620216 156738 send success\n",
|
||||
"13562277856 155413 send success\n",
|
||||
"13181996942 151820 send success\n",
|
||||
"18653699788 151893 send success\n",
|
||||
"13589432668 156124 send success\n",
|
||||
"13563376888 156285 send success\n",
|
||||
"13375466356 150571 send success\n",
|
||||
"13854664965 151763 send success\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"from tencentcloud.common import credential\n",
|
||||
"from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\n",
|
||||
@@ -217,12 +408,12 @@
|
||||
"mydb = myclient[\"baogao\"]\n",
|
||||
"mycol = mydb[\"pdf\"]\n",
|
||||
"\n",
|
||||
"dw_jc = \"天宫院社区测试者\"\n",
|
||||
"filename = 'data/天宫院社区240922.json'\n",
|
||||
"dw_jc = \"北体体质康健班学员\"\n",
|
||||
"filename = 'data/北体体质康健班202412.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"dict2 = {}\n",
|
||||
"place_id = 496534\n",
|
||||
"place_id = 141002\n",
|
||||
"myquery = { \"place_id\": place_id }\n",
|
||||
"for x in mycol.find(myquery,{ \"_id\": 0, \"place_id\": 0}):\n",
|
||||
" code = int(x['fn'].split('-')[0])\n",
|
||||
@@ -287,15 +478,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"execution_count": 5,
|
||||
"id": "25a269c3-758f-4e79-ae6d-a6e6f161d64b",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-11-19T08:14:42.384832Z",
|
||||
"iopub.status.busy": "2024-11-19T08:14:42.384081Z",
|
||||
"iopub.status.idle": "2024-11-19T08:14:42.628910Z",
|
||||
"shell.execute_reply": "2024-11-19T08:14:42.627652Z",
|
||||
"shell.execute_reply.started": "2024-11-19T08:14:42.384763Z"
|
||||
"iopub.execute_input": "2024-12-23T05:38:55.858379Z",
|
||||
"iopub.status.busy": "2024-12-23T05:38:55.857680Z",
|
||||
"iopub.status.idle": "2024-12-23T05:38:56.119988Z",
|
||||
"shell.execute_reply": "2024-12-23T05:38:56.118643Z",
|
||||
"shell.execute_reply.started": "2024-12-23T05:38:55.858311Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -304,30 +495,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"no phone\n",
|
||||
"+8618993712869 send success\n"
|
||||
"+8613793180751 send success\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -344,12 +512,12 @@
|
||||
"mydb = myclient[\"baogao\"]\n",
|
||||
"mycol = mydb[\"pdf\"]\n",
|
||||
"\n",
|
||||
"dw_jc = \"青海油田测试者\"\n",
|
||||
"filename = 'data/天宫院社区240922.json'\n",
|
||||
"dw_jc = \"北体体质康健班学员\"\n",
|
||||
"filename = 'data/北体体质康健班202412.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"dict2 = {}\n",
|
||||
"place_id = 571315\n",
|
||||
"place_id = 141002\n",
|
||||
"myquery = { \"place_id\": place_id }\n",
|
||||
"for x in mycol.find(myquery,{ \"_id\": 0, \"place_id\": 0}):\n",
|
||||
" code = int(x['fn'].split('-')[0])\n",
|
||||
@@ -358,8 +526,8 @@
|
||||
" else:\n",
|
||||
" print('no phone')\n",
|
||||
"\n",
|
||||
"phone = '+86'+'18993712869'\n",
|
||||
"yzm = '109623'\n",
|
||||
"phone = '+86'+'13793180751'\n",
|
||||
"yzm = '155673'\n",
|
||||
"try: \n",
|
||||
" secretId = \"AKID22rVyvSqbikXFFvav31ykc9YmqjN6KYc\"\n",
|
||||
" secretKey = \"51XVL1YxDKI6mJh8au6DDuTskS1RhwJX\"\n",
|
||||
|
||||
+543
-45
@@ -815,42 +815,354 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 58,
|
||||
"execution_count": 19,
|
||||
"id": "d913a531-51b3-4795-adc3-f4fc858d7401",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-06T15:20:32.535010Z",
|
||||
"iopub.status.busy": "2024-12-06T15:20:32.534411Z",
|
||||
"iopub.status.idle": "2024-12-06T15:20:32.583820Z",
|
||||
"shell.execute_reply": "2024-12-06T15:20:32.583328Z",
|
||||
"shell.execute_reply.started": "2024-12-06T15:20:32.534952Z"
|
||||
"iopub.execute_input": "2024-12-12T07:37:15.387929Z",
|
||||
"iopub.status.busy": "2024-12-12T07:37:15.387152Z",
|
||||
"iopub.status.idle": "2024-12-12T07:37:15.525479Z",
|
||||
"shell.execute_reply": "2024-12-12T07:37:15.524900Z",
|
||||
"shell.execute_reply.started": "2024-12-12T07:37:15.387860Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"302\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0240049-陈晓辉.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001134-李和平.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526128-黎戬.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1984143-彭超.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526130-吴书鹏.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526186-周子瑄.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3498058-柳聪.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001147-黄紫暄.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3125602-王凤.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526182-李基博.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983629-黄喜阳.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983174-叶可.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001041-陈峥嵘.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983626-彭定荣.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001122-赵进.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001149-张嘉欣.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3498083-陆杨.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1989523-周松林.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983534-蔡维.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3245716-杨熙哲.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3125625-宋霰.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002091-黄琪.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526143-廖成思.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002144-乔林臻.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002035-李南烽.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983832-李刚.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1985478-刘志辉.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1985639-陈强.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3464129-谢倩.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1985328-张建.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983771-李振宇.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526134-刘晋炀.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3437585-贺常霏.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526199-徐敬.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983569-谢俊杰.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3413868-徐韩.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3464103-彭旭涛.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3464145-陈毅.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002037-饶军.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002116-胡敏.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001997-于明浩.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001145-戴玮兵.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001043-谢玉婷.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983740-万双华.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3437581-李成伟.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001076-荣贇.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3358823-黎贤贞智.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001128-欧阳雅馨.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3413865-孟繁荣.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3535865-王明珠.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3437567-朱雨晴.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001036-陈怀至.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001993-陈杰.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3464097-孙颖.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3464138-陈兰鑫.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001718-巴银花儿.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001115-吴梦瑶.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3170676-常硕.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001010-邱亮.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1989522-钟建东.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001133-彭宇博.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001096-温家祥.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983844-彭鑫.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1985485-张瑞.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983866-倪博.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1993388-蒋莉.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3170724-张翔.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001020-贾俊.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1989709-卞伟.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001092-钟兴阳.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983770-黄刚.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001114-曾子坤.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1985926-宁佐强.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3437574-胡颖.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983836-陈文辉.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526185-方劲松.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3281543-谢崴.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983837-罗文武.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1985666-李思.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526180-李今朝.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3281536-王智浩.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3498029-汤思煜.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001860-李晨阳.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983800-郭丽梅.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002023-梁军.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3437557-周念.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001053-刘志刚.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3497994-黄博轩.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002043-邓余斌.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983785-胡湘.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001144-黄英杰.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3535506-田子豪.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983775-胡向民.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1985551-吴敏.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526176-万航.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001119-汤艳.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3464081-刘权.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3358822-黎明.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1987904-李佳.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1985913-毛智勇.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3464205-胡雨丹.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001012-吴磊.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526187-夏堃喻.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3413857-仇乐.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3464122-眭永波.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526177-周晏本.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983661-李静.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3160188-冯军.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3498042-赵天宇.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983797-周辉灿.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3139284-全世夷.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3498031-吴义.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3319096-毛润政.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3358812-邵昌睿.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001130-许竹新.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1985287-陈宝林.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1985440-吴阳.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001069-李鑫.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001032-吴志祚.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3319086-唐子涵.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3503272-董晨阳.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3498000-陈旭.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3319099-肖博文.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3498059-李慧慧.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001028-李蓝蓝.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001034-严雅珂.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1989710-谭珂屿.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002056-江汇涛.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3245723-祝恒兴.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526154-陈柳.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001141-张俊凡.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983622-胡诗学.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526170-杨龙姣.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001093-李欣怡.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001078-张薇.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001058-杨红.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983830-刘军.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3245709-姚佩.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002036-胡杰.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983180-张毅.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983143-吴巍.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983100-余益波.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3245733-高帆.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1985907-毛卫群.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526135-高斯阳.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002159-丁杰涛.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983171-王复兴.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983109-谈志亮.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526127-郭倩颖.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983652-向彭.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3464069-于业晟.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526189-施陈心.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1986007-李明权.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3464134-陈亮.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002100-彭晨雨.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001072-薛苗.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001121-张蕾.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002004-刘敏明.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001040-向安平.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3503276-熊东.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001023-彭一夫.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1992225-叶忠良.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3358818-鲁轩熠.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1985356-黄超.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983119-经永华.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1985324-谢清峰.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3498065-刘雍涵.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983530-鲁世俊.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3281551-黄杰.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001070-黄辅君.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983108-张新芬.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526165-刘至清.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001073-翟秋霞.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1985891-王定鲜.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526156-袁子灿.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001074-陈佳.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3464077-冯晓阳.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983635-刘飞.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001031-高浩然.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3498028-刘明泽.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3427189-段威.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002115-张丽军.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983159-李华锐.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983759-闵敢.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001132-李颖.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001079-袁丽雯.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983322-张健.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3125613-李青.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002114-唐景柳.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001029-邓韧泰.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3498091-花慧.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1985673-刘国东.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001146-方娜.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002122-周瑜.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3245719-王宁.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001048-谢浩.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983777-谢林.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1985611-丁敏.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002176-张嫚.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1986235-郑小芳.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001120-薛美佳.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001046-汤茜.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3139304-王卓见.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983107-沈高峰.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3245735-黎金龙.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983846-廖念.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3319087-孟凡澄.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3464084-吴煜文.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983106-罗鸣.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983823-甘龙.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001057-彭菲.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001052-陈祥宇.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001059-罗嘉俊.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002039-胡荣华.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3464198-陈世博.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001098-刘夏俐.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001143-卢章凌.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001084-周博.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526193-李可.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3281545-贺凯.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526179-李博.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1989539-唐韵辅.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983557-涂彬.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001039-王鹏.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983831-黄波.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3498023-戴汉林.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983779-高建华.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001065-涂俐.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983863-张勇.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1985621-杨大为.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1985698-李开俊.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3245725-贺飞.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001044-李德文.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001870-龚斯壮.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3245717-汪洋.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002166-张梦圆.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3498020-倪炜强.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001050-马一文.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001027-向雅婷.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002126-蔡安逸.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3281530-吴征宇.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983683-李杜娟.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983630-龚付金.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3498004-江载舟.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001045-李尉铭.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001049-曾洪.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3125609-张哲.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3319101-袁楚云.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3281544-谢思遥.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1989487-彭华明.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526147-黄天舒.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3394214-唐金滔.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001001-梅小龙.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1993242-何东海.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002067-黄建生.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3498061-马璐.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3503275-邓野.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001033-邹雪平.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3464164-刘雨薇.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3498033-陈雅玲.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983595-侯代磊.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001095-江欢.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001087-阳涛.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001051-任藩韬.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1961098-武文娟.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001091-黄南.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3170725-赵雨龙.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983758-任珍琦.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3358815-陈海.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001042-杨宇凡.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983767-刘林波.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3245700-刘细.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983799-彭宇.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001038-彭健霖.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3498055-陶汝.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3464200-马婷.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983868-彭国强.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002151-李美玲.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983176-李关亮.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1993413-汤愉.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3464165-向嘉伟.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1987427-谢小飞.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3498044-张坚发.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3160187-邹尚辰.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001060-郭凌宇.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3437569-李湘川.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3498089-邹竞莹.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983965-文智.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3498080-颜艳萍.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002063-杨杰.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001148-张兰心.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3526138-于润韬.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3437554-刘毅.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1985838-郭汨.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3498063-游胜利.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1985615-喻永强.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3464148-黎泓松.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/1983262-杨淼君.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001085-刘海燕.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0001112-汤超.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/0002124-唐睿.pdf\n",
|
||||
"/home/songyi/pdf-typescript/长炼医院2024/3437578-黄晓平.pdf\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os,sys,shutil\n",
|
||||
"import json\n",
|
||||
"import glob\n",
|
||||
"from pathlib import Path\n",
|
||||
"\n",
|
||||
"fi_path = '/home/songyi/pdf-typescript/北海炼化2024'\n",
|
||||
"new_path = 'file/北海炼化2024'\n",
|
||||
"fi_path = '/home/songyi/pdf-typescript/长炼医院2024'\n",
|
||||
"new_path = 'file/长炼医院2024'\n",
|
||||
"old = []\n",
|
||||
"dict2 = {}\n",
|
||||
"\n",
|
||||
"filename = 'data/北海炼化人员2024.json'\n",
|
||||
"filename = 'data/result_长炼医院人员2024(汇总).json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"fls = glob.glob(f'{fi_path}/*.pdf')\n",
|
||||
"print(len(fls))\n",
|
||||
"for fn in fls:\n",
|
||||
" fi_name =Path(fn).stem.split('-')[0]\n",
|
||||
" code = int(fi_name)\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)"
|
||||
" #if not os.path.exists(n_name):\n",
|
||||
" shutil.copyfile(fn,n_name)\n",
|
||||
" print(fn)"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -863,15 +1175,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 59,
|
||||
"execution_count": 21,
|
||||
"id": "02319955-7fb6-4791-ae45-55b03bdadd54",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-06T15:23:36.869845Z",
|
||||
"iopub.status.busy": "2024-12-06T15:23:36.869086Z",
|
||||
"iopub.status.idle": "2024-12-06T15:23:36.941818Z",
|
||||
"shell.execute_reply": "2024-12-06T15:23:36.941344Z",
|
||||
"shell.execute_reply.started": "2024-12-06T15:23:36.869773Z"
|
||||
"iopub.execute_input": "2024-12-12T07:41:07.877091Z",
|
||||
"iopub.status.busy": "2024-12-12T07:41:07.876276Z",
|
||||
"iopub.status.idle": "2024-12-12T07:41:07.919596Z",
|
||||
"shell.execute_reply": "2024-12-12T07:41:07.919038Z",
|
||||
"shell.execute_reply.started": "2024-12-12T07:41:07.877012Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -891,9 +1203,9 @@
|
||||
"from pathlib import Path\n",
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"fi_path = '/home/songyi/pdf-typescript/北海炼化2024'\n",
|
||||
"fi_path = '/home/songyi/pdf-typescript/长炼医院2024'\n",
|
||||
"\n",
|
||||
"filename = 'data/北海炼化人员2024.json'\n",
|
||||
"filename = 'data/result_长炼医院人员2024(汇总).json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"fls = glob.glob(f'{fi_path}/*.pdf')\n",
|
||||
@@ -909,7 +1221,7 @@
|
||||
" \n",
|
||||
" list1.append(list2)\n",
|
||||
"\n",
|
||||
"filename = 'data/北海炼化2024年体测报告明细表.xlsx'\n",
|
||||
"filename = 'data/长炼医院2024年体测报告明细表.xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"sheet.append(title)\n",
|
||||
@@ -962,7 +1274,6 @@
|
||||
"cell_type": "markdown",
|
||||
"id": "732161bb-98f2-4861-ab66-7a374678bcd8",
|
||||
"metadata": {
|
||||
"jp-MarkdownHeadingCollapsed": true,
|
||||
"tags": [],
|
||||
"toc-hr-collapsed": true
|
||||
},
|
||||
@@ -1565,16 +1876,32 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 1,
|
||||
"id": "46aa847d-e1fe-45bd-85b6-e2d792ec8842",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-20T07:27:58.141604Z",
|
||||
"iopub.status.busy": "2024-12-20T07:27:58.140897Z",
|
||||
"iopub.status.idle": "2024-12-20T07:27:58.343114Z",
|
||||
"shell.execute_reply": "2024-12-20T07:27:58.342694Z",
|
||||
"shell.execute_reply.started": "2024-12-20T07:27:58.141536Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"301\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"filename = 'data/result_天津石化2024.json'\n",
|
||||
"filename = 'data/result_长炼医院人员2024(汇总).json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"\n",
|
||||
@@ -1627,7 +1954,7 @@
|
||||
" mydata['score'] = round(score/len(mydata['fits']),2)\n",
|
||||
" if len(mydata['fits']) >2:\n",
|
||||
" dict2[str(k)] = mydata\n",
|
||||
"filename = f'data/data_天津石化2024.json'\n",
|
||||
"filename = f'data/data_长炼医院人员2024(汇总).json'\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(dict2,fl , ensure_ascii=False) \n",
|
||||
"print(len(dict2)) "
|
||||
@@ -1643,17 +1970,34 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 2,
|
||||
"id": "63edd636-f034-4aa6-8575-63d5cdb84adb",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-20T07:28:13.394921Z",
|
||||
"iopub.status.busy": "2024-12-20T07:28:13.394348Z",
|
||||
"iopub.status.idle": "2024-12-20T07:28:13.405910Z",
|
||||
"shell.execute_reply": "2024-12-20T07:28:13.405307Z",
|
||||
"shell.execute_reply.started": "2024-12-20T07:28:13.394870Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"平均成绩:2.7497分,男性:223人\n",
|
||||
"平均成绩:2.9819分,女性:78人\n",
|
||||
"平均成绩:2.8099分,总体:301人\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"\n",
|
||||
"nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n",
|
||||
"filename = 'data/data_北海炼化2024.json'\n",
|
||||
"filename = 'data/data_长炼医院人员2024(汇总).json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"i = 1\n",
|
||||
@@ -1687,12 +2031,32 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 3,
|
||||
"id": "1b4a3f02-9b2e-41fc-ac6c-8163907a07f1",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-20T07:30:11.095892Z",
|
||||
"iopub.status.busy": "2024-12-20T07:30:11.095122Z",
|
||||
"iopub.status.idle": "2024-12-20T07:30:11.117663Z",
|
||||
"shell.execute_reply": "2024-12-20T07:30:11.117077Z",
|
||||
"shell.execute_reply.started": "2024-12-20T07:30:11.095822Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"0~255分人数:91人,男性:79人,女性:12人\n",
|
||||
"256~332分人数:143人,男性:100人,女性:43人\n",
|
||||
"333~367分人数:47人,男性:30人,女性:17人\n",
|
||||
"368~500分人数:20人,男性:14人,女性:6人\n",
|
||||
"301\n",
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"\n",
|
||||
@@ -1738,12 +2102,34 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 4,
|
||||
"id": "2d661ca6-6129-4da1-ac25-51d0156babb2",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-20T07:30:36.266609Z",
|
||||
"iopub.status.busy": "2024-12-20T07:30:36.266057Z",
|
||||
"iopub.status.idle": "2024-12-20T07:30:36.276604Z",
|
||||
"shell.execute_reply": "2024-12-20T07:30:36.275720Z",
|
||||
"shell.execute_reply.started": "2024-12-20T07:30:36.266557Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"20-24 {'不合格': 7, '良好': 4, '优秀': 2, '合格': 17}\n",
|
||||
"25-29 {'合格': 16, '不合格': 3, '良好': 6, '优秀': 1}\n",
|
||||
"30-34 {'合格': 1, '优秀': 1, '不合格': 1, '良好': 2}\n",
|
||||
"35-39 {'不合格': 0, '合格': 2, '良好': 1, '优秀': 1}\n",
|
||||
"40-44 {'合格': 1, '不合格': 1, '良好': 2, '优秀': 0}\n",
|
||||
"45-49 {'良好': 2, '合格': 5, '不合格': 0, '优秀': 1}\n",
|
||||
"50-54 {'良好': 0, '合格': 1, '优秀': 0, '不合格': 0}\n",
|
||||
"55-80 {'良好': 0, '合格': 0, '不合格': 0}\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n",
|
||||
"\n",
|
||||
@@ -1783,12 +2169,34 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 5,
|
||||
"id": "fc97df37-34ff-4a02-9d26-b5d81b706e46",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-20T07:30:38.696485Z",
|
||||
"iopub.status.busy": "2024-12-20T07:30:38.695765Z",
|
||||
"iopub.status.idle": "2024-12-20T07:30:38.711240Z",
|
||||
"shell.execute_reply": "2024-12-20T07:30:38.710163Z",
|
||||
"shell.execute_reply.started": "2024-12-20T07:30:38.696422Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"20-24 {'不合格': 28, '良好': 7, '优秀': 1, '合格': 26}\n",
|
||||
"25-29 {'合格': 18, '不合格': 17, '良好': 1, '优秀': 0}\n",
|
||||
"30-34 {'合格': 10, '优秀': 2, '不合格': 11, '良好': 4}\n",
|
||||
"35-39 {'不合格': 8, '合格': 13, '良好': 7, '优秀': 5}\n",
|
||||
"40-44 {'合格': 10, '不合格': 3, '良好': 3, '优秀': 1}\n",
|
||||
"45-49 {'良好': 4, '合格': 12, '不合格': 8, '优秀': 1}\n",
|
||||
"50-54 {'良好': 2, '合格': 8, '优秀': 4, '不合格': 2}\n",
|
||||
"55-80 {'良好': 2, '合格': 3, '不合格': 2}\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n",
|
||||
"\n",
|
||||
@@ -1828,12 +2236,34 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 6,
|
||||
"id": "dafb86f8-5ee0-4c87-a98f-c7ff0f631fe5",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-20T07:31:09.731948Z",
|
||||
"iopub.status.busy": "2024-12-20T07:31:09.731194Z",
|
||||
"iopub.status.idle": "2024-12-20T07:31:09.742741Z",
|
||||
"shell.execute_reply": "2024-12-20T07:31:09.741604Z",
|
||||
"shell.execute_reply.started": "2024-12-20T07:31:09.731880Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"16~24岁平均成绩:2.69分,人数:92人,男性:62人\n",
|
||||
"25~29岁平均成绩:2.72分,人数:62人,男性:36人\n",
|
||||
"30~34岁平均成绩:2.75分,人数:32人,男性:27人\n",
|
||||
"35~39岁平均成绩:3.04分,人数:37人,男性:33人\n",
|
||||
"40~44岁平均成绩:2.94分,人数:21人,男性:17人\n",
|
||||
"45~49岁平均成绩:2.89分,人数:33人,男性:25人\n",
|
||||
"50~54岁平均成绩:3.1分,人数:17人,男性:16人\n",
|
||||
"55~69岁平均成绩:2.85分,人数:7人,男性:7人\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"nld = [[16,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,69]]\n",
|
||||
"\n",
|
||||
@@ -1868,12 +2298,34 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 9,
|
||||
"id": "347703a1-501b-4800-bd29-16e94f4a6793",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-20T07:35:34.912029Z",
|
||||
"iopub.status.busy": "2024-12-20T07:35:34.911266Z",
|
||||
"iopub.status.idle": "2024-12-20T07:35:34.922511Z",
|
||||
"shell.execute_reply": "2024-12-20T07:35:34.921440Z",
|
||||
"shell.execute_reply.started": "2024-12-20T07:35:34.911960Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"20~24岁平均成绩:2.59分,人数:62人\n",
|
||||
"25~29岁平均成绩:2.52分,人数:36人\n",
|
||||
"30~34岁平均成绩:2.65分,人数:27人\n",
|
||||
"35~39岁平均成绩:3.02分,人数:33人\n",
|
||||
"40~44岁平均成绩:2.95分,人数:17人\n",
|
||||
"45~49岁平均成绩:2.81分,人数:25人\n",
|
||||
"50~54岁平均成绩:3.13分,人数:16人\n",
|
||||
"55~80岁平均成绩:2.85分,人数:7人\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"\n",
|
||||
@@ -1908,12 +2360,34 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 29,
|
||||
"id": "5900d1c7-2f8c-4dfa-a60e-a577fb90f22d",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-12T09:04:56.288764Z",
|
||||
"iopub.status.busy": "2024-12-12T09:04:56.288050Z",
|
||||
"iopub.status.idle": "2024-12-12T09:04:56.304610Z",
|
||||
"shell.execute_reply": "2024-12-12T09:04:56.303440Z",
|
||||
"shell.execute_reply.started": "2024-12-12T09:04:56.288700Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"20~24岁平均成绩:2.88分,人数:30人\n",
|
||||
"25~29岁平均成绩:2.98分,人数:26人\n",
|
||||
"30~34岁平均成绩:3.28分,人数:5人\n",
|
||||
"35~39岁平均成绩:3.24分,人数:4人\n",
|
||||
"40~44岁平均成绩:2.88分,人数:4人\n",
|
||||
"45~49岁平均成绩:3.14分,人数:8人\n",
|
||||
"50~54岁平均成绩:2.67分,人数:1人\n",
|
||||
"55~80岁平均成绩:0分,人数:0人\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n",
|
||||
"\n",
|
||||
@@ -1946,12 +2420,36 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 8,
|
||||
"id": "ad69c45d-3f62-42df-894d-47424e759029",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-20T07:34:04.864554Z",
|
||||
"iopub.status.busy": "2024-12-20T07:34:04.863864Z",
|
||||
"iopub.status.idle": "2024-12-20T07:34:04.875213Z",
|
||||
"shell.execute_reply": "2024-12-20T07:34:04.874207Z",
|
||||
"shell.execute_reply.started": "2024-12-20T07:34:04.864491Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"BMI 3.65 279\n",
|
||||
"肺活量 3.37 268\n",
|
||||
"握力 1.77 284\n",
|
||||
"坐位体前屈 2.78 249\n",
|
||||
"纵跳 2.82 245\n",
|
||||
"俯卧撑 2.31 145\n",
|
||||
"一分钟仰卧起坐 2.98 56\n",
|
||||
"单脚站立 2.59 205\n",
|
||||
"选择反应时 2.83 270\n",
|
||||
"台阶指数 2.88 213\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
|
||||
+144
-117
@@ -4,6 +4,7 @@
|
||||
"cell_type": "markdown",
|
||||
"id": "1c72f0cf-165b-4025-af9d-6771e4a0a5d1",
|
||||
"metadata": {
|
||||
"jp-MarkdownHeadingCollapsed": true,
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
@@ -2181,26 +2182,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 35,
|
||||
"execution_count": null,
|
||||
"id": "e1a1b329-acf1-4be9-bcf0-736dbe7f8e0b",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-06T06:33:02.890686Z",
|
||||
"iopub.status.busy": "2024-12-06T06:33:02.889945Z",
|
||||
"iopub.status.idle": "2024-12-06T06:33:02.953794Z",
|
||||
"shell.execute_reply": "2024-12-06T06:33:02.953311Z",
|
||||
"shell.execute_reply.started": "2024-12-06T06:33:02.890614Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"739\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import datetime\n",
|
||||
@@ -2265,17 +2250,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 36,
|
||||
"execution_count": null,
|
||||
"id": "17ebb0fd-9a45-47a4-bbe9-f4fb0a3481f6",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-06T06:33:08.201679Z",
|
||||
"iopub.status.busy": "2024-12-06T06:33:08.200968Z",
|
||||
"iopub.status.idle": "2024-12-06T06:33:08.367295Z",
|
||||
"shell.execute_reply": "2024-12-06T06:33:08.366715Z",
|
||||
"shell.execute_reply.started": "2024-12-06T06:33:08.201614Z"
|
||||
}
|
||||
},
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
@@ -2336,26 +2313,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 37,
|
||||
"execution_count": null,
|
||||
"id": "dd89efe8-13b9-4db8-8c39-2a48888dd635",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-06T06:34:03.871370Z",
|
||||
"iopub.status.busy": "2024-12-06T06:34:03.870707Z",
|
||||
"iopub.status.idle": "2024-12-06T06:34:05.280791Z",
|
||||
"shell.execute_reply": "2024-12-06T06:34:05.280240Z",
|
||||
"shell.execute_reply.started": "2024-12-06T06:34:03.871312Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok!\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import time\n",
|
||||
@@ -2392,6 +2353,130 @@
|
||||
"print('ok!') "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "5b9aef88-0341-4af0-8316-c7e2266f4b0c",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 统计参加问卷手机号码未提供人员"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "25004a96-c72c-4bbb-91e1-5bfccb7856c3",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import csv\n",
|
||||
"import openpyxl\n",
|
||||
"import time\n",
|
||||
"from datetime import date\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"filename = 'data/北海炼化人员2024.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"\n",
|
||||
"phone1 = set()\n",
|
||||
"phone2 = set()\n",
|
||||
"for k,v in dict1.items():\n",
|
||||
" phone1.add(v['phone'])\n",
|
||||
"list1 = []\n",
|
||||
"filename = 'data/Survey_20241224.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",
|
||||
" list1.append(line)\n",
|
||||
"\n",
|
||||
"for item in list1:\n",
|
||||
" if item[2] not in phone1:\n",
|
||||
" phone2.add(item[2])\n",
|
||||
"for item in phone2:\n",
|
||||
" print(i,item)\n",
|
||||
" i+=1\n",
|
||||
" "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "cca613c5-1fe3-465a-ab66-ca395e4bda9c",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 统计参加问卷人员"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 21,
|
||||
"id": "601f707b-bd34-4966-b781-c520a0bf69dc",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-24T07:03:16.793791Z",
|
||||
"iopub.status.busy": "2024-12-24T07:03:16.793020Z",
|
||||
"iopub.status.idle": "2024-12-24T07:03:16.938934Z",
|
||||
"shell.execute_reply": "2024-12-24T07:03:16.938312Z",
|
||||
"shell.execute_reply.started": "2024-12-24T07:03:16.793721Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"876\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import csv\n",
|
||||
"import openpyxl\n",
|
||||
"import time\n",
|
||||
"from datetime import date\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"filename = 'data/北海炼化人员2024.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"\n",
|
||||
"phone1 = set()\n",
|
||||
"phone2 = set()\n",
|
||||
"for k,v in dict1.items():\n",
|
||||
" phone1.add(v['phone'])\n",
|
||||
"list1 = []\n",
|
||||
"filename = 'data/Survey_20241224.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",
|
||||
" list1.append(line)\n",
|
||||
"print(len(phone1))\n",
|
||||
"i =1\n",
|
||||
"list2 = []\n",
|
||||
"for item in list1:\n",
|
||||
" code = item[2]\n",
|
||||
" for k, v in dict1.items():\n",
|
||||
" list3 = []\n",
|
||||
" if v['phone'] == code: \n",
|
||||
" list3.append(k)\n",
|
||||
" list3.append(v['name'])\n",
|
||||
" list3.append(v['sex'])\n",
|
||||
" list3.append(v['unit'])\n",
|
||||
" list3.append(code)\n",
|
||||
" list2.append(list3)\n",
|
||||
"filename = 'data/北海炼化问卷情况表2024.xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"#sheet.append(title)\n",
|
||||
"for row in list2:\n",
|
||||
" sheet.append(row)\n",
|
||||
" \n",
|
||||
"wb.save(filename) "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "b57447d9-ac3c-47c2-9592-3878c6845918",
|
||||
@@ -2402,17 +2487,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 43,
|
||||
"execution_count": null,
|
||||
"id": "9563c47b-94e4-44f7-98e1-7d284ad3841c",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-06T13:25:18.037788Z",
|
||||
"iopub.status.busy": "2024-12-06T13:25:18.037123Z",
|
||||
"iopub.status.idle": "2024-12-06T13:25:18.169186Z",
|
||||
"shell.execute_reply": "2024-12-06T13:25:18.168612Z",
|
||||
"shell.execute_reply.started": "2024-12-06T13:25:18.037728Z"
|
||||
}
|
||||
},
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
@@ -2515,26 +2592,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 47,
|
||||
"execution_count": null,
|
||||
"id": "a1a12409-aab8-47af-b10d-7ecb20b3b332",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-06T13:41:57.576034Z",
|
||||
"iopub.status.busy": "2024-12-06T13:41:57.575284Z",
|
||||
"iopub.status.idle": "2024-12-06T13:41:57.808661Z",
|
||||
"shell.execute_reply": "2024-12-06T13:41:57.808089Z",
|
||||
"shell.execute_reply.started": "2024-12-06T13:41:57.575964Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
@@ -2701,27 +2762,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 39,
|
||||
"execution_count": null,
|
||||
"id": "6d8a345d-39e0-40cd-9bed-ac4e144b426c",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-06T07:47:19.162940Z",
|
||||
"iopub.status.busy": "2024-12-06T07:47:19.162185Z",
|
||||
"iopub.status.idle": "2024-12-06T07:47:19.214132Z",
|
||||
"shell.execute_reply": "2024-12-06T07:47:19.213530Z",
|
||||
"shell.execute_reply.started": "2024-12-06T07:47:19.162868Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"738\n",
|
||||
"ok!\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
@@ -2789,27 +2833,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 58,
|
||||
"execution_count": null,
|
||||
"id": "6cba8d5e-92fd-4afd-94d2-0dcf42e2e22e",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-06T14:55:55.316383Z",
|
||||
"iopub.status.busy": "2024-12-06T14:55:55.315888Z",
|
||||
"iopub.status.idle": "2024-12-06T14:55:55.397708Z",
|
||||
"shell.execute_reply": "2024-12-06T14:55:55.397100Z",
|
||||
"shell.execute_reply.started": "2024-12-06T14:55:55.316334Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"757\n",
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
|
||||
+127
-28
@@ -10,15 +10,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"execution_count": 29,
|
||||
"id": "3d5ddc7a-a331-438d-aa8d-1ad74c7250d0",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-06T11:58:52.021888Z",
|
||||
"iopub.status.busy": "2024-12-06T11:58:52.021240Z",
|
||||
"iopub.status.idle": "2024-12-06T11:58:52.246798Z",
|
||||
"shell.execute_reply": "2024-12-06T11:58:52.245884Z",
|
||||
"shell.execute_reply.started": "2024-12-06T11:58:52.021830Z"
|
||||
"iopub.execute_input": "2024-12-24T04:10:44.463102Z",
|
||||
"iopub.status.busy": "2024-12-24T04:10:44.462345Z",
|
||||
"iopub.status.idle": "2024-12-24T04:10:44.481670Z",
|
||||
"shell.execute_reply": "2024-12-24T04:10:44.480911Z",
|
||||
"shell.execute_reply.started": "2024-12-24T04:10:44.463032Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@@ -55,6 +55,105 @@
|
||||
"print('ok')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 37,
|
||||
"id": "7b218973-965d-4324-9553-d8e7ddfda4cd",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-24T14:48:29.843853Z",
|
||||
"iopub.status.busy": "2024-12-24T14:48:29.843106Z",
|
||||
"iopub.status.idle": "2024-12-24T14:48:29.865282Z",
|
||||
"shell.execute_reply": "2024-12-24T14:48:29.864798Z",
|
||||
"shell.execute_reply.started": "2024-12-24T14:48:29.843783Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import openpyxl\n",
|
||||
"import json\n",
|
||||
"from datetime import date\n",
|
||||
"\n",
|
||||
"wb = openpyxl.load_workbook('data/城东中心党委.xlsx')\n",
|
||||
"sheet = wb.active\n",
|
||||
"# sheets = wb.sheetnames\n",
|
||||
"person = {}\n",
|
||||
"\n",
|
||||
"for n in range(3, sheet.max_row+1):\n",
|
||||
" code = int(sheet.cell(n, 1).value)\n",
|
||||
" person.setdefault(code, {})\n",
|
||||
" dict1 = {}\n",
|
||||
" dict1['name'] = sheet.cell(n, 2).value\n",
|
||||
" dict1['sex'] = sheet.cell(n, 3).value\n",
|
||||
" dict1['birth'] = str(sheet.cell(n, 4).value).replace('/','-').split(' ')[0] \n",
|
||||
" dict1['unit'] = sheet.cell(n, 5).value\n",
|
||||
" person[code] = dict1\n",
|
||||
"filename = 'data/新疆人员.json'\n",
|
||||
"with open(filename, 'w') as fl:\n",
|
||||
" json.dump(person, fl, ensure_ascii=False)\n",
|
||||
"print('ok')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "e505049e-9bd9-4230-8074-93e37b82419c",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 生成读卡系统文件"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 38,
|
||||
"id": "3849dc10-8fd1-4acf-b9a7-872327456f6a",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-24T14:48:31.958016Z",
|
||||
"iopub.status.busy": "2024-12-24T14:48:31.957269Z",
|
||||
"iopub.status.idle": "2024-12-24T14:48:31.967735Z",
|
||||
"shell.execute_reply": "2024-12-24T14:48:31.966636Z",
|
||||
"shell.execute_reply.started": "2024-12-24T14:48:31.957950Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"\n",
|
||||
"filename = 'data/新疆人员.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"list1 = []\n",
|
||||
"for k, v in dict1.items():\n",
|
||||
" dict2 = {}\n",
|
||||
" #if dict1['sex'] =='男':\n",
|
||||
" # sex = 1\n",
|
||||
" \n",
|
||||
" dict2 = {'id':k,'name':v['name'],'gender':v['sex'],'birth':v['birth'],'unit':v['unit']}\n",
|
||||
" list1.append(dict2)\n",
|
||||
"json_data = json.dumps(list1,ensure_ascii=False, indent=4) \n",
|
||||
"\n",
|
||||
"# 将 json 数据写入文件\n",
|
||||
"with open(\"data/card_新疆.json\", \"w\",encoding = 'utf-8') as file:\n",
|
||||
" file.write(json_data) \n",
|
||||
"print('ok')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "faf346a5-3b0e-414e-ab64-dbde3b8c3dbd",
|
||||
@@ -65,15 +164,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"execution_count": 30,
|
||||
"id": "72ec680f-ec0d-44f9-919c-17c8e614b885",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-06T12:00:30.883983Z",
|
||||
"iopub.status.busy": "2024-12-06T12:00:30.883111Z",
|
||||
"iopub.status.idle": "2024-12-06T12:00:30.895148Z",
|
||||
"shell.execute_reply": "2024-12-06T12:00:30.894116Z",
|
||||
"shell.execute_reply.started": "2024-12-06T12:00:30.883907Z"
|
||||
"iopub.execute_input": "2024-12-24T04:10:51.916961Z",
|
||||
"iopub.status.busy": "2024-12-24T04:10:51.916210Z",
|
||||
"iopub.status.idle": "2024-12-24T04:10:51.929768Z",
|
||||
"shell.execute_reply": "2024-12-24T04:10:51.928679Z",
|
||||
"shell.execute_reply.started": "2024-12-24T04:10:51.916890Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@@ -81,7 +180,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"3\n"
|
||||
"1\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -98,7 +197,7 @@
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"\n",
|
||||
"filename = 'data/marks_20241206.csv'\n",
|
||||
"filename = 'data/marks_20241224.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
" header = next(fl) \n",
|
||||
@@ -149,15 +248,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"execution_count": 31,
|
||||
"id": "8f459ed3-fc14-404f-998b-5ed2a15958c3",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-06T12:04:22.231686Z",
|
||||
"iopub.status.busy": "2024-12-06T12:04:22.230937Z",
|
||||
"iopub.status.idle": "2024-12-06T12:04:22.249578Z",
|
||||
"shell.execute_reply": "2024-12-06T12:04:22.248603Z",
|
||||
"shell.execute_reply.started": "2024-12-06T12:04:22.231616Z"
|
||||
"iopub.execute_input": "2024-12-24T04:10:56.430593Z",
|
||||
"iopub.status.busy": "2024-12-24T04:10:56.429864Z",
|
||||
"iopub.status.idle": "2024-12-24T04:10:56.441856Z",
|
||||
"shell.execute_reply": "2024-12-24T04:10:56.440815Z",
|
||||
"shell.execute_reply.started": "2024-12-24T04:10:56.430526Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@@ -215,15 +314,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"execution_count": 32,
|
||||
"id": "9e843585-fef3-4f5c-baae-76e711f2a42f",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-06T12:06:46.424162Z",
|
||||
"iopub.status.busy": "2024-12-06T12:06:46.422960Z",
|
||||
"iopub.status.idle": "2024-12-06T12:06:49.016373Z",
|
||||
"shell.execute_reply": "2024-12-06T12:06:49.015210Z",
|
||||
"shell.execute_reply.started": "2024-12-06T12:06:46.424089Z"
|
||||
"iopub.execute_input": "2024-12-24T04:10:59.919975Z",
|
||||
"iopub.status.busy": "2024-12-24T04:10:59.919307Z",
|
||||
"iopub.status.idle": "2024-12-24T04:11:00.529956Z",
|
||||
"shell.execute_reply": "2024-12-24T04:11:00.528814Z",
|
||||
"shell.execute_reply.started": "2024-12-24T04:10:59.919919Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@@ -231,7 +330,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"3\n"
|
||||
"1\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -256,7 +355,7 @@
|
||||
" list1 = []\n",
|
||||
" mydata = {}\n",
|
||||
" \n",
|
||||
" id = str(k).rjust(4,\"0\")\n",
|
||||
" id = str(k).rjust(5,\"0\")\n",
|
||||
" mydata['path'] = file_path+id+'-'+ v['name']+'.pdf'\n",
|
||||
" mydata['title'] = '新疆'\n",
|
||||
" mydata['subtitle'] = ''#v['unit']\n",
|
||||
|
||||
+321
-164
@@ -2309,26 +2309,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 24,
|
||||
"execution_count": null,
|
||||
"id": "610b20f3-9fd8-46fc-b8ee-d48c4c854289",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-09T09:22:38.802119Z",
|
||||
"iopub.status.busy": "2024-12-09T09:22:38.801372Z",
|
||||
"iopub.status.idle": "2024-12-09T09:22:38.835995Z",
|
||||
"shell.execute_reply": "2024-12-09T09:22:38.835477Z",
|
||||
"shell.execute_reply.started": "2024-12-09T09:22:38.802047Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import openpyxl\n",
|
||||
"import json\n",
|
||||
@@ -2368,26 +2352,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"execution_count": null,
|
||||
"id": "a6dc8ae7-5a51-4eb1-954e-19c17b6062cd",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-05T01:26:00.236419Z",
|
||||
"iopub.status.busy": "2024-12-05T01:26:00.235845Z",
|
||||
"iopub.status.idle": "2024-12-05T01:26:00.282366Z",
|
||||
"shell.execute_reply": "2024-12-05T01:26:00.281825Z",
|
||||
"shell.execute_reply.started": "2024-12-05T01:26:00.236362Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"\n",
|
||||
@@ -2416,27 +2384,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 26,
|
||||
"execution_count": null,
|
||||
"id": "1e2d586e-6ff5-4fd1-a909-278d23e54561",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-09T09:26:07.189575Z",
|
||||
"iopub.status.busy": "2024-12-09T09:26:07.187969Z",
|
||||
"iopub.status.idle": "2024-12-09T09:26:07.219642Z",
|
||||
"shell.execute_reply": "2024-12-09T09:26:07.219013Z",
|
||||
"shell.execute_reply.started": "2024-12-09T09:26:07.189495Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"207\n",
|
||||
"207\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import time\n",
|
||||
@@ -2486,27 +2437,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"execution_count": null,
|
||||
"id": "0cad0490-5199-4ca3-bf6f-a206829d702e",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-11T06:57:46.853287Z",
|
||||
"iopub.status.busy": "2024-12-11T06:57:46.852519Z",
|
||||
"iopub.status.idle": "2024-12-11T06:57:46.874391Z",
|
||||
"shell.execute_reply": "2024-12-11T06:57:46.873811Z",
|
||||
"shell.execute_reply.started": "2024-12-11T06:57:46.853199Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"78\n",
|
||||
"78\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import time\n",
|
||||
@@ -2556,27 +2490,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 13,
|
||||
"execution_count": null,
|
||||
"id": "dd681c34-dba9-434b-9cd3-ed12fefcce0f",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-11T07:10:57.109817Z",
|
||||
"iopub.status.busy": "2024-12-11T07:10:57.109051Z",
|
||||
"iopub.status.idle": "2024-12-11T07:10:57.134829Z",
|
||||
"shell.execute_reply": "2024-12-11T07:10:57.134208Z",
|
||||
"shell.execute_reply.started": "2024-12-11T07:10:57.109746Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"78\n",
|
||||
"78\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import datetime\n",
|
||||
@@ -2669,17 +2586,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 25,
|
||||
"execution_count": null,
|
||||
"id": "64c6e1e3-801c-4573-b78f-5a9e842597a9",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-09T09:23:41.690512Z",
|
||||
"iopub.status.busy": "2024-12-09T09:23:41.689765Z",
|
||||
"iopub.status.idle": "2024-12-09T09:23:41.726298Z",
|
||||
"shell.execute_reply": "2024-12-09T09:23:41.725869Z",
|
||||
"shell.execute_reply.started": "2024-12-09T09:23:41.690440Z"
|
||||
}
|
||||
},
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
@@ -2732,17 +2641,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 28,
|
||||
"execution_count": null,
|
||||
"id": "933f3eb1-8463-4782-ae45-8a1628abbb2b",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-09T09:29:03.983785Z",
|
||||
"iopub.status.busy": "2024-12-09T09:29:03.983528Z",
|
||||
"iopub.status.idle": "2024-12-09T09:29:04.043514Z",
|
||||
"shell.execute_reply": "2024-12-09T09:29:04.042868Z",
|
||||
"shell.execute_reply.started": "2024-12-09T09:29:03.983761Z"
|
||||
}
|
||||
},
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
@@ -2798,40 +2699,10 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"execution_count": null,
|
||||
"id": "dd7557bf-6f1e-4d01-aa93-5a4ad46a57a5",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-11T06:12:49.795632Z",
|
||||
"iopub.status.busy": "2024-12-11T06:12:49.794818Z",
|
||||
"iopub.status.idle": "2024-12-11T06:12:49.967842Z",
|
||||
"shell.execute_reply": "2024-12-11T06:12:49.967393Z",
|
||||
"shell.execute_reply.started": "2024-12-11T06:12:49.795561Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"3437581 李成伟\n",
|
||||
"3526193 李可\n",
|
||||
"3464205 胡雨丹\n",
|
||||
"1010 邱亮\n",
|
||||
"1012 吴磊\n",
|
||||
"3464081 刘权\n",
|
||||
"3125625 宋霰\n",
|
||||
"1020 贾俊\n",
|
||||
"1022 徐敬\n",
|
||||
"1023 彭一夫\n",
|
||||
"1024 刘至清\n",
|
||||
"1053 刘志刚\n",
|
||||
"1058 杨红\n",
|
||||
"1069 李鑫\n",
|
||||
"1144 黄英杰\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
@@ -2857,17 +2728,25 @@
|
||||
" print(k,v['name'])"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "26582cc3-4675-4f4f-8c22-4fc499e70481",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 汇总三组人员"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"id": "ded0ac64-9ba2-4d64-9617-e0961b437d4e",
|
||||
"execution_count": 25,
|
||||
"id": "952bbc05-afee-4247-810b-49f37b7fe939",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-11T06:33:09.011061Z",
|
||||
"iopub.status.busy": "2024-12-11T06:33:09.010467Z",
|
||||
"iopub.status.idle": "2024-12-11T06:33:09.030379Z",
|
||||
"shell.execute_reply": "2024-12-11T06:33:09.029760Z",
|
||||
"shell.execute_reply.started": "2024-12-11T06:33:09.011010Z"
|
||||
"iopub.execute_input": "2024-12-12T07:15:24.337351Z",
|
||||
"iopub.status.busy": "2024-12-12T07:15:24.336594Z",
|
||||
"iopub.status.idle": "2024-12-12T07:15:24.363321Z",
|
||||
"shell.execute_reply": "2024-12-12T07:15:24.362508Z",
|
||||
"shell.execute_reply.started": "2024-12-12T07:15:24.337276Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
@@ -2875,15 +2754,48 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"29\n",
|
||||
"29\n"
|
||||
"305\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import time\n",
|
||||
"\n",
|
||||
"filename = 'data/result_长炼医院人员2024(0417前).json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"\n",
|
||||
"filename = 'data/result_长炼医院人员2024(湖南青年).json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict2 = json.load(fl) \n",
|
||||
"filename = 'data/result_长炼医院人员2024(非湖南青年).json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict3 = json.load(fl) \n",
|
||||
"\n",
|
||||
"for k, v in dict2.items():\n",
|
||||
" dict1[k] = v\n",
|
||||
"\n",
|
||||
"for k, v in dict3.items():\n",
|
||||
" dict1[k] = v\n",
|
||||
"\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": null,
|
||||
"id": "ded0ac64-9ba2-4d64-9617-e0961b437d4e",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import datetime\n",
|
||||
"import csv\n",
|
||||
"from datetime import date\n",
|
||||
"\n",
|
||||
"filename = '../item1.json'\n",
|
||||
"item = {}\n",
|
||||
@@ -2892,6 +2804,19 @@
|
||||
" dict1 = json.load(fl) \n",
|
||||
"for k,v in dict1.items():\n",
|
||||
" item[k] = v\n",
|
||||
"item['1']['en'] = 'lung'\n",
|
||||
"item['2']['en'] = 'grip'\n",
|
||||
"item['3']['en'] = 'flexion'\n",
|
||||
"item['4']['en'] = 'jump'\n",
|
||||
"item['5']['en'] = 'pushup'\n",
|
||||
"item['6']['en'] = 'balance'\n",
|
||||
"item['7']['en'] = 'reaction'\n",
|
||||
"item['8']['en'] = 'step'\n",
|
||||
"item['9']['en'] = 'situp'\n",
|
||||
"item['10']['en'] = 'height'\n",
|
||||
"item['11']['en'] = 'weight'\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"re_ta = {}\n",
|
||||
"dict1 = {}\n",
|
||||
"list1 = []\n",
|
||||
@@ -2909,13 +2834,32 @@
|
||||
"#print(list1)\n",
|
||||
"for result in list1:\n",
|
||||
" user = str(result[2])\n",
|
||||
" if user in dict1.keys(): \n",
|
||||
" rq = date.fromisoformat(result[6].replace('/','-'))\n",
|
||||
" if user in dict1.keys():\n",
|
||||
" l_xm = []\n",
|
||||
" m_item = str(result[3]) \n",
|
||||
" re_ta.setdefault(user,{}) \n",
|
||||
" re_ta[user]['name'] = dict1[user]['name']\n",
|
||||
" re_ta[user]['sex'] = dict1[user]['sex'] \n",
|
||||
" re_ta[user]['sex'] = dict1[user]['sex']\n",
|
||||
" if dict1[user]['sex'] == '男':\n",
|
||||
" l_xm = ['weight','height','lung','grip','flexion','jump','pushup','balance','reaction','step']\n",
|
||||
" else:\n",
|
||||
" l_xm = ['weight','height','lung','grip','flexion','jump','balance','reaction','step','situp']\n",
|
||||
" re_ta[user]['unit'] = dict1[user]['unit']\n",
|
||||
" item_name = item[m_item]['name']\n",
|
||||
" birth = date.fromisoformat(dict1[user]['birth'].replace('/','-'))\n",
|
||||
" #birth = date.fromisoformat(dict1[user]['birth'])\n",
|
||||
" #nian = int(birth[0].strip())\n",
|
||||
" #yue = int(birth[1].strip())\n",
|
||||
" #ri = int(birth[2].strip())\n",
|
||||
" #print(k,nian,yue,ri)\n",
|
||||
" item_name = item[m_item]['en'] \n",
|
||||
" if item_name in l_xm: \n",
|
||||
" days = (rq-birth).days \n",
|
||||
" re_ta[user]['age'] = int(days/365)\n",
|
||||
" re_ta[user]['month'] = int(days/365*12)\n",
|
||||
" re_ta[user]['rq'] = result[6]\n",
|
||||
"\n",
|
||||
"\n",
|
||||
" re_ta[user].setdefault(item_name,{}) \n",
|
||||
" score = int(result[4])/item[m_item]['divisor'] \n",
|
||||
" re_ta[user][item_name]['成绩'] = f'{score} {item[m_item][\"unit\"]}'\n",
|
||||
@@ -2933,6 +2877,219 @@
|
||||
"id": "7583ad54-3e66-4ef8-ae51-f01eda2bf647",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import time\n",
|
||||
"\n",
|
||||
"filename = '../item1.json'\n",
|
||||
"item = {}\n",
|
||||
"unit = {}\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict3 = json.load(fl) \n",
|
||||
"for k,v in dict3.items():\n",
|
||||
" item[k] = v\n",
|
||||
"item['1']['en'] = 'lung'\n",
|
||||
"item['2']['en'] = 'grip'\n",
|
||||
"item['3']['en'] = 'flexion'\n",
|
||||
"item['4']['en'] = 'jump'\n",
|
||||
"item['5']['en'] = 'pushup'\n",
|
||||
"item['6']['en'] = 'balance'\n",
|
||||
"item['7']['en'] = 'reaction'\n",
|
||||
"item['8']['en'] = 'step'\n",
|
||||
"item['9']['en'] = 'situp'\n",
|
||||
"item['10']['en'] = 'height'\n",
|
||||
"item['11']['en'] = 'weight'\n",
|
||||
"\n",
|
||||
"filename = 'data/体质检测标准 (1).json' \n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"def cal_score(data1):\n",
|
||||
" #data = {'name':'张三','sex':'M','age':37,'item':'StepExperiment','result':46} \n",
|
||||
" person = dict1['person']\n",
|
||||
" criteria = dict1['criteria']\n",
|
||||
" if data1['age'] >59:\n",
|
||||
" data1['age'] = 59\n",
|
||||
" if data1['age'] <20:\n",
|
||||
" data1['age'] = 20\n",
|
||||
" info = data1['sex']+str(data1['age'])\n",
|
||||
" bz = person[info]\n",
|
||||
" mx = criteria[bz][data1['item']]\n",
|
||||
" result = data1['result'] \n",
|
||||
" if data1['item'] == 'reaction':\n",
|
||||
" for bz1 in mx:\n",
|
||||
" if result > bz1:\n",
|
||||
" #print(bz1)\n",
|
||||
" score = mx.index(bz1,0)\n",
|
||||
" break\n",
|
||||
" else:\n",
|
||||
" score = 5\n",
|
||||
" else:\n",
|
||||
" for bz1 in mx:\n",
|
||||
" if result < bz1:\n",
|
||||
" #print(bz1)\n",
|
||||
" score = mx.index(bz1,0)\n",
|
||||
" break\n",
|
||||
" else:\n",
|
||||
" score = 5\n",
|
||||
" return(score)\n",
|
||||
"filename = 'data/体质检测标准_BMI.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict4 = json.load(fl) \n",
|
||||
" \n",
|
||||
"def cal_bmi(data1):\n",
|
||||
" # data = {'name':'张三','sex':'M','age':37,'item':'HeightWeight','result':'177.7,97.0'}\n",
|
||||
" person = dict4['person']\n",
|
||||
" criteria = dict4['criteria']\n",
|
||||
" if data1['age'] > 59:\n",
|
||||
" data1['age'] = 59\n",
|
||||
" if data1['age'] <20:\n",
|
||||
" data1['age'] = 20\n",
|
||||
" info = data1['sex']+str(data1['age'])\n",
|
||||
" bz = person[info]\n",
|
||||
" #print(bz)\n",
|
||||
" result = data1['result']\n",
|
||||
" #print(data1['code'],result)\n",
|
||||
" height = int(float(result.split(',')[0]))\n",
|
||||
" weight = float(result.split(',')[1])\n",
|
||||
" if str(height) not in criteria[bz]:\n",
|
||||
" score = 1\n",
|
||||
" else: \n",
|
||||
" mx = criteria[bz][str(height)]\n",
|
||||
" if weight < mx[0]:\n",
|
||||
" score = 1\n",
|
||||
" elif weight < mx[1]:\n",
|
||||
" score = 3\n",
|
||||
" elif weight < mx[2]:\n",
|
||||
" score = 5 \n",
|
||||
" elif weight <= mx[3]:\n",
|
||||
" score = 3 \n",
|
||||
" elif weight > mx[3]:\n",
|
||||
" score = 1\n",
|
||||
" return score\n",
|
||||
" \n",
|
||||
" \n",
|
||||
"\n",
|
||||
"#list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','height','weight']\n",
|
||||
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp']\n",
|
||||
"filename = 'data/result_长炼医院人员2024(0417前).json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict2 = json.load(fl) \n",
|
||||
"for k, v in dict2.items():\n",
|
||||
" #print(k)\n",
|
||||
" if v['sex'] == '男':\n",
|
||||
" sex = 'M'\n",
|
||||
" else:\n",
|
||||
" sex = 'F' \n",
|
||||
" if 'height' in v.keys() and 'weight' in v.keys():\n",
|
||||
" bmi_data = v['height']['成绩'].split()[0]+','+ v['weight']['成绩'].split()[0]\n",
|
||||
" data1 = {'code':k,'sex':sex,'age':v['age'],'item':'HeightWeight','result':bmi_data}\n",
|
||||
" dict2[k]['bmi'] = {}\n",
|
||||
" dict2[k]['bmi']['成绩'] = bmi_data\n",
|
||||
" dict2[k]['bmi']['score'] = cal_bmi(data1)\n",
|
||||
" for item_en in list_item:\n",
|
||||
" if item_en in v.keys(): \n",
|
||||
" data1 = {'code':k,'sex':sex,'age':v['age'],'item':item_en,'result':float(v[item_en]['成绩'].split()[0])}\n",
|
||||
" dict2[k][item_en]['score'] = cal_score(data1)\n",
|
||||
" #print(k,v[item_en]['成绩'],cal_score(data1))\n",
|
||||
"filename = f'data/result_长炼医院人员2024(0417前).json'\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(dict2,fl , ensure_ascii=False) \n",
|
||||
"print('ok!') "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 26,
|
||||
"id": "dda61f0c-d789-491e-a5b3-c15122bc35be",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-12-12T07:17:38.512812Z",
|
||||
"iopub.status.busy": "2024-12-12T07:17:38.512027Z",
|
||||
"iopub.status.idle": "2024-12-12T07:20:00.155132Z",
|
||||
"shell.execute_reply": "2024-12-12T07:20:00.154082Z",
|
||||
"shell.execute_reply.started": "2024-12-12T07:17:38.512739Z"
|
||||
}
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"302\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import requests\n",
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"headers = {\n",
|
||||
" \"Content-Type\": \"application/json; charset=UTF-8\"\n",
|
||||
" }\n",
|
||||
"filename = 'data/result_长炼医院人员2024(汇总).json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"list1 = []\n",
|
||||
"file_path ='./长炼医院2024/'\n",
|
||||
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','bmi']\n",
|
||||
"i=0\n",
|
||||
"list2 = []\n",
|
||||
"for k, v in dict1.items():\n",
|
||||
" list1 = []\n",
|
||||
" mydata = {}\n",
|
||||
" \n",
|
||||
" id = str(k).rjust(7,\"0\")\n",
|
||||
" mydata['path'] = file_path+id+'-'+ v['name']+'.pdf'\n",
|
||||
" mydata['title'] = '中石化长岭分公司'\n",
|
||||
" mydata['subtitle'] = v['unit']\n",
|
||||
" mydata['id'] = id\n",
|
||||
" mydata['name'] = v['name']\n",
|
||||
" if v['sex'] == '男':\n",
|
||||
" mydata['gender'] = 'male'\n",
|
||||
" else:\n",
|
||||
" mydata['gender'] = 'female'\n",
|
||||
" \n",
|
||||
" mydata['month'] = v['month']\n",
|
||||
" mydata['fits'] = {}\n",
|
||||
" survey_list = ['tcm','psy','spine']\n",
|
||||
" for item in survey_list:\n",
|
||||
" if item in v.keys():\n",
|
||||
" mydata.setdefault('surveys',{})\n",
|
||||
" mydata['surveys'][item] = v[item]\n",
|
||||
" \n",
|
||||
" \n",
|
||||
" #mydata['fits'] = {}\n",
|
||||
" for item in list_item:\n",
|
||||
" if item in v.keys():\n",
|
||||
" mydata.setdefault('fits',{})\n",
|
||||
" if item in ['lung','pushup','step','situp']:\n",
|
||||
" mark = v[item]['成绩'].split()[0].split('.')[0]\n",
|
||||
" else:\n",
|
||||
" mark = v[item]['成绩'].split()[0]\n",
|
||||
" mydata['fits'][item] = {'mark':mark,'score':v[item]['score']}\n",
|
||||
" #if len(mydata['fits']) >2 or len(mydata['surveys']) >0:\n",
|
||||
" if len(mydata['fits']) >2 : \n",
|
||||
" list1.append(mydata)\n",
|
||||
" list2.append([k,v['name']])\n",
|
||||
" i+=1\n",
|
||||
" x = requests.post('http://localhost:3003', data = json.dumps(list1), headers=headers)\n",
|
||||
" #print(id,v['name'],x.text)\n",
|
||||
" #print(mydata)\n",
|
||||
" #x.close()\n",
|
||||
"print(i)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "9415e7a4-0d4c-4d7e-bdd0-4ec7be9006fb",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user