20240103
This commit is contained in:
1 parent
996379d3cb
commit
5e368c4b76
4 files changed
+501
-320
No files matched your search
+7
-7
@@ -11,15 +11,15 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 11,
|
||||
"execution_count": 2,
|
||||
"id": "bbba6efc-73cd-4db6-bae7-014724fee731",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-11-28T02:30:49.403409Z",
|
||||
"iopub.status.busy": "2023-11-28T02:30:49.403129Z",
|
||||
"iopub.status.idle": "2023-11-28T02:30:49.433515Z",
|
||||
"shell.execute_reply": "2023-11-28T02:30:49.432950Z",
|
||||
"shell.execute_reply.started": "2023-11-28T02:30:49.403391Z"
|
||||
"iopub.execute_input": "2024-01-03T14:01:30.065117Z",
|
||||
"iopub.status.busy": "2024-01-03T14:01:30.064639Z",
|
||||
"iopub.status.idle": "2024-01-03T14:01:30.153986Z",
|
||||
"shell.execute_reply": "2024-01-03T14:01:30.153535Z",
|
||||
"shell.execute_reply.started": "2024-01-03T14:01:30.065060Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
@@ -53,7 +53,7 @@
|
||||
" dict1['id'] = sheet.cell(n,5).value\n",
|
||||
" id = str(sheet.cell(n,5).value)\n",
|
||||
" birth = id[6:10]+'-'+ id[10:12]+'-' +id[12:14]\n",
|
||||
" dict1['birth'] = birth\n",
|
||||
" dict1['birth'] = sheet.cell(n,9).value\n",
|
||||
" person[code] = dict1\n",
|
||||
"filename = 'data/中国石化化工销售.json'\n",
|
||||
"with open(filename, 'w') as fl:\n",
|
||||
|
||||
+22
-33
@@ -125,19 +125,21 @@
|
||||
"mydb = myclient[\"baogao\"]\n",
|
||||
"mycol = mydb[\"pdf\"]\n",
|
||||
"\n",
|
||||
"filename = 'data/积家村报告明细.json'\n",
|
||||
"filename = 'data/北京农行百日筑基.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"dict2 = {}\n",
|
||||
"place_id = 698465\n",
|
||||
"place_id = 309118\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",
|
||||
" if str(code) in dict1.keys() and 'phone' in dict1[str(code)].keys():\n",
|
||||
" dict2[code] = {'phone':str(dict1[str(code)]['phone']),'code':x['code']}\n",
|
||||
" if str(code) in dict1.keys():\n",
|
||||
" dict2[code] = {'phone':str(dict1[str(code)]['phone']),'code':x['code'],'name':x['fn']}\n",
|
||||
" else:\n",
|
||||
" print(code,'no phone')\n",
|
||||
" print('no phone')\n",
|
||||
"#print(dict2)\n",
|
||||
"i=1\n",
|
||||
"#dict2 = {375: {'phone': '13793180751', 'code': '0379208'}}\n",
|
||||
"for k, v in dict2.items():\n",
|
||||
" phone = '+86'+v['phone']\n",
|
||||
" yzm = v['code']\n",
|
||||
@@ -158,15 +160,17 @@
|
||||
" req.SmsSdkAppId = \"1400140089\"\n",
|
||||
" req.SignName = \"坤铭教育\"\n",
|
||||
" req.TemplateId = \"1875765\" \n",
|
||||
" req.TemplateParamSet = [\"淄博积家村体测者\",yzm]\n",
|
||||
" req.TemplateParamSet = [\"北京农行体测员工\",yzm]\n",
|
||||
" req.PhoneNumberSet = [phone]\n",
|
||||
" req.SessionContext = \"\"\n",
|
||||
" req.ExtendCode = \"\"\n",
|
||||
" req.SenderId = \"\"\n",
|
||||
" resp = client.SendSms(req)\n",
|
||||
" dict3 = json.loads(resp.to_json_string(indent=2))\n",
|
||||
" #resp = client.SendSms(req)\n",
|
||||
" #dict3 = json.loads(resp.to_json_string(indent=2))\n",
|
||||
"\n",
|
||||
" print(v['phone'],dict3['SendStatusSet'][0][\"Message\"])\n",
|
||||
" #print(v['phone'],dict3['SendStatusSet'][0][\"Message\"])\n",
|
||||
" print(i,v['phone'],v['name'],)\n",
|
||||
" i+=1\n",
|
||||
" except TencentCloudSDKException as err:\n",
|
||||
" print(v['phone'],err)"
|
||||
]
|
||||
@@ -200,16 +204,16 @@
|
||||
"mydb = myclient[\"baogao\"]\n",
|
||||
"mycol = mydb[\"pdf\"]\n",
|
||||
"\n",
|
||||
"filename = 'data/世纪花园人员信息.json'\n",
|
||||
"filename = 'data/北京农行百日筑基.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"dict2 = {}\n",
|
||||
"place_id = 698465\n",
|
||||
"place_id = 309118\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",
|
||||
" if str(code) in dict1.keys():\n",
|
||||
" dict2[code] = {'phone':str(dict1[str(code)]['phone']),'code':x['code']}\n",
|
||||
" dict2[code] = {'phone':str(dict1[str(code)]['phone']),'code':x['code'],'name':x['fn']}\n",
|
||||
" else:\n",
|
||||
" print('no phone')\n",
|
||||
"#print(dict2)\n",
|
||||
@@ -235,7 +239,7 @@
|
||||
" req.SmsSdkAppId = \"1400140089\"\n",
|
||||
" req.SignName = \"坤铭教育\"\n",
|
||||
" req.TemplateId = \"1875765\" \n",
|
||||
" req.TemplateParamSet = [\"淄博积家村体测者\",yzm]\n",
|
||||
" req.TemplateParamSet = [\"北京农行体测员工\",yzm]\n",
|
||||
" req.PhoneNumberSet = [phone]\n",
|
||||
" req.SessionContext = \"\"\n",
|
||||
" req.ExtendCode = \"\"\n",
|
||||
@@ -269,27 +273,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 86,
|
||||
"execution_count": null,
|
||||
"id": "25a269c3-758f-4e79-ae6d-a6e6f161d64b",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-11-27T03:02:47.586339Z",
|
||||
"iopub.status.busy": "2023-11-27T03:02:47.585869Z",
|
||||
"iopub.status.idle": "2023-11-27T03:02:47.873412Z",
|
||||
"shell.execute_reply": "2023-11-27T03:02:47.872245Z",
|
||||
"shell.execute_reply.started": "2023-11-27T03:02:47.586301Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"+8618264313303 send success\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from tencentcloud.common import credential\n",
|
||||
"from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\n",
|
||||
@@ -301,8 +290,8 @@
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"phone = '+86'+'18264313303'\n",
|
||||
"yzm = '066357'\n",
|
||||
"phone = '+86'+'13520300915'\n",
|
||||
"yzm = '036578'\n",
|
||||
"try: \n",
|
||||
" secretId = \"AKID22rVyvSqbikXFFvav31ykc9YmqjN6KYc\"\n",
|
||||
" secretKey = \"51XVL1YxDKI6mJh8au6DDuTskS1RhwJX\"\n",
|
||||
@@ -320,7 +309,7 @@
|
||||
" req.SmsSdkAppId = \"1400140089\"\n",
|
||||
" req.SignName = \"坤铭教育\"\n",
|
||||
" req.TemplateId = \"1875765\" \n",
|
||||
" req.TemplateParamSet = [\"淄博积家村体测者\",yzm]\n",
|
||||
" req.TemplateParamSet = [\"北京农行体测者\",yzm]\n",
|
||||
" req.PhoneNumberSet = [phone]\n",
|
||||
" req.SessionContext = \"\"\n",
|
||||
" req.ExtendCode = \"\"\n",
|
||||
|
||||
+68
-278
@@ -280,12 +280,28 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 97,
|
||||
"id": "3e614f4a-a623-48e2-97f8-b31f62c9a983",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-01-03T14:02:28.840955Z",
|
||||
"iopub.status.busy": "2024-01-03T14:02:28.840736Z",
|
||||
"iopub.status.idle": "2024-01-03T14:02:28.856652Z",
|
||||
"shell.execute_reply": "2024-01-03T14:02:28.856241Z",
|
||||
"shell.execute_reply.started": "2024-01-03T14:02:28.840937Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"44\n",
|
||||
"44\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import datetime\n",
|
||||
@@ -315,11 +331,11 @@
|
||||
"re_ta = {}\n",
|
||||
"dict1 = {}\n",
|
||||
"list1 = []\n",
|
||||
"filename = 'data/北海炼化2023年.json'\n",
|
||||
"filename = 'data/中国石化化工销售.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"\n",
|
||||
"filename = 'data/places_result_20231129.csv'\n",
|
||||
"filename = 'data/places_result_20240103.csv'\n",
|
||||
"with open(filename,'r',newline='') as csv_file:\n",
|
||||
" fl = csv.reader(csv_file,delimiter=',')\n",
|
||||
" header = next(fl) \n",
|
||||
@@ -342,7 +358,8 @@
|
||||
" 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'].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",
|
||||
@@ -359,7 +376,7 @@
|
||||
" 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_北海炼化2023.json'\n",
|
||||
"filename = 'data/result_中国石化化工销售.json'\n",
|
||||
"\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(re_ta, fl, ensure_ascii=False) \n",
|
||||
@@ -376,12 +393,27 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 98,
|
||||
"id": "141b30dc-5975-4dcb-9bc3-9b20d26a0917",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2024-01-03T14:03:22.531744Z",
|
||||
"iopub.status.busy": "2024-01-03T14:03:22.531496Z",
|
||||
"iopub.status.idle": "2024-01-03T14:03:22.548680Z",
|
||||
"shell.execute_reply": "2024-01-03T14:03:22.548172Z",
|
||||
"shell.execute_reply.started": "2024-01-03T14:03:22.531714Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok!\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import time\n",
|
||||
@@ -479,7 +511,7 @@
|
||||
"\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_北海炼化2023.json'\n",
|
||||
"filename = 'data/result_中国石化化工销售.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict2 = json.load(fl) \n",
|
||||
"for k, v in dict2.items():\n",
|
||||
@@ -500,7 +532,7 @@
|
||||
" dict2[k][item_en]['score'] = cal_score(data1)\n",
|
||||
" #print(k,v[item_en]['成绩'],cal_score(data1))\n",
|
||||
"\n",
|
||||
"filename = f'data/result_北海炼化2023.json'\n",
|
||||
"filename = f'data/result_中国石化化工销售.json'\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(dict2,fl , ensure_ascii=False) \n",
|
||||
"print('ok!') "
|
||||
@@ -516,27 +548,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 69,
|
||||
"execution_count": null,
|
||||
"id": "b123ee6b-85d2-4660-b226-321832a6b796",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-11-30T06:48:03.978422Z",
|
||||
"iopub.status.busy": "2023-11-30T06:48:03.978171Z",
|
||||
"iopub.status.idle": "2023-11-30T06:52:22.756021Z",
|
||||
"shell.execute_reply": "2023-11-30T06:52:22.754997Z",
|
||||
"shell.execute_reply.started": "2023-11-30T06:48:03.978405Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"719\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import requests\n",
|
||||
"import json\n",
|
||||
@@ -546,11 +563,11 @@
|
||||
"headers = {\n",
|
||||
" \"Content-Type\": \"application/json; charset=UTF-8\"\n",
|
||||
" }\n",
|
||||
"filename = 'data/result_北海炼化2023.json'\n",
|
||||
"filename = 'data/result_中国石化化工销售.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"list1 = []\n",
|
||||
"fiie_path ='./北海炼化2023/'\n",
|
||||
"fiie_path ='./中国石化化工销售/'\n",
|
||||
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','bmi']\n",
|
||||
"i=0\n",
|
||||
"list2 = []\n",
|
||||
@@ -560,7 +577,7 @@
|
||||
" \n",
|
||||
" id = str(k).rjust(4,\"0\")\n",
|
||||
" mydata['path'] = fiie_path+id+'-'+ v['name']+'.pdf'\n",
|
||||
" mydata['title'] = '中国石化北海炼化\\n有限责任公司'\n",
|
||||
" mydata['title'] = '中国农业银行股份有限公司'\n",
|
||||
" mydata['subtitle'] = v['unit']\n",
|
||||
" mydata['id'] = id\n",
|
||||
" mydata['name'] = v['name']\n",
|
||||
@@ -609,16 +626,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 91,
|
||||
"execution_count": null,
|
||||
"id": "d913a531-51b3-4795-adc3-f4fc858d7401",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-03T05:44:37.781259Z",
|
||||
"iopub.status.busy": "2023-12-03T05:44:37.780816Z",
|
||||
"iopub.status.idle": "2023-12-03T05:44:37.997978Z",
|
||||
"shell.execute_reply": "2023-12-03T05:44:37.997477Z",
|
||||
"shell.execute_reply.started": "2023-12-03T05:44:37.781224Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
@@ -657,28 +667,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 93,
|
||||
"execution_count": null,
|
||||
"id": "02319955-7fb6-4791-ae45-55b03bdadd54",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-03T05:54:39.061703Z",
|
||||
"iopub.status.busy": "2023-12-03T05:54:39.061244Z",
|
||||
"iopub.status.idle": "2023-12-03T05:54:39.128729Z",
|
||||
"shell.execute_reply": "2023-12-03T05:54:39.128308Z",
|
||||
"shell.execute_reply.started": "2023-12-03T05:54:39.061649Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"[['0325', '邱建明', '男', '炼油一部'], ['0175', '季彩平', '女', '检验计量中心'], ['0818', '刘潮辉', '男', '新上岗'], ['0396', '邓桂雄', '男', '炼油一部'], ['0780', '邓施艳', '女', '财务资产部'], ['0372', '李哲宇', '男', '炼油一部'], ['0340', '张宏智', '男', '炼油一部'], ['0403', '卫恒', '男', '炼油一部'], ['0090', '黄鑫', '女', '炼油三部'], ['0082', '董澄林', '男', '炼油三部'], ['0817', '封帆', '女', '新上岗'], ['0807', '张惜光', '男', '行政事务中心'], ['0433', '李晋渊', '男', '储运部'], ['0717', '杨梦春', '男', '生产技术部'], ['0386', '盛国娟', '女', '炼油一部'], ['0313', '李志永', '男', '炼油一部'], ['0561', '杨微', '女', '炼油二部'], ['0473', '王晓甫', '男', '储运部'], ['0643', '王梓润', '男', '炼油二部'], ['0453', '李志雄', '男', '储运部'], ['0010', '蓝志君', '男', '炼油三部'], ['0747', '吴文强', '男', '设备工程部'], ['0256', '马祥光', '男', '电气仪表中心'], ['0625', '郭卫富', '男', '炼油二部'], ['0475', '刘利', '男', '储运部'], ['0283', '魏建民', '男', '炼油一部'], ['0134', '赵小丽', '女', '公用工程部'], ['0057', '苗光浩', '男', '炼油三部'], ['0162', '李林', '男', '检验计量中心'], ['0092', '刘鸿亮', '男', '炼油三部'], ['0614', '张金斗', '男', '炼油二部'], ['0452', '江荣明', '男', '储运部'], ['0437', '张琪静', '女', '储运部'], ['0239', '陈孔兰', '女', '检验计量中心'], ['0622', '陆锡健', '男', '炼油二部'], ['0595', '李孩峄', '男', '炼油二部'], ['0246', '苏晓东', '男', '电气仪表中心'], ['0532', '王威', '男', '炼油二部'], ['0266', '刘建功', '男', '电气仪表中心'], ['0320', '涂莉', '女', '炼油一部'], ['0091', '冼冠宇', '男', '炼油三部'], ['0062', '刘天宇', '男', '炼油三部'], ['0432', '梁波', '男', '储运部'], ['0339', '王继政', '男', '炼油一部'], ['0683', '于洋', '女', '党群工作部'], ['0581', '王建鑫', '男', '炼油二部'], ['0011', '刘前程', '男', '炼油三部'], ['0610', '李忠', '男', '炼油二部'], ['0375', '聂珊珊', '女', '炼油一部'], ['0118', '苏远雄', '男', '公用工程部'], ['0801', '杨敏', '女', '物资采购中心'], ['0042', '赵欣野', '男', '炼油三部'], ['0496', '李晗', '男', '储运部'], ['0308', '田铮铮', '男', '炼油一部'], ['0772', '杨坤妮', '女', '安全环保部'], ['0400', '王海林', '男', '炼油一部'], ['0441', '郑志强', '男', '储运部'], ['0594', '陈达', '男', '炼油二部'], ['0563', '朱鑫', '男', '炼油二部'], ['0334', '黎镇杰', '男', '炼油一部'], ['0781', '文星', '男', '财务资产部'], ['0307', '黄春湖', '女', '炼油一部'], ['0686', '黄洁', '女', '党委组织部'], ['0564', '符龙', '男', '炼油二部'], ['0401', '陈福培', '男', '炼油一部'], ['0371', '张中升', '男', '炼油一部'], ['0109', '李红武', '男', '公用工程部'], ['0569', '张健尧', '男', '炼油二部'], ['0820', '苏铭', '男', '新上岗'], ['0815', '杨尊', '男', '新上岗'], ['0124', '曹炳锋', '男', '公用工程部'], ['0526', '吴德立', '男', '炼油二部'], ['0707', '徐业卫', '女', '发展计划部'], ['0143', '崔路巧', '男', '公用工程部'], ['0247', '许俊雄', '男', '电气仪表中心'], ['0830', '张原', '男', '新上岗'], ['0618', '王增利', '男', '炼油二部'], ['0600', '刘业宇', '男', '炼油二部'], ['0766', '翟璟峰', '男', '安全环保部'], ['0637', '阎千兵', '男', '炼油二部'], ['0730', '莫有先', '男', '生产技术部'], ['0026', '刘志', '男', '炼油三部'], ['0423', '罗海', '男', '储运部'], ['0348', '黎福营', '男', '炼油一部'], ['0177', '张健', '女', '检验计量中心'], ['0218', '杨植文', '男', '检验计量中心'], ['0560', '张健', '男', '炼油二部'], ['0367', '冯福', '男', '炼油一部'], ['0306', '杨水珍', '女', '炼油一部'], ['0787', '李建英', '女', '财务资产部'], ['0330', '王鹏', '男', '炼油一部'], ['0612', '默鑫晔', '男', '炼油二部'], ['0557', '梁本康', '男', '炼油二部'], ['0052', '张鹏', '男', '炼油三部'], ['0087', '张仕尧', '男', '炼油三部'], ['0216', '宁碧玉', '女', '检验计量中心'], ['0617', '张升坚', '男', '炼油二部'], ['0501', '谭力允', '男', '储运部'], ['0756', '文鹏', '男', '设备工程部'], ['0504', '李扩生', '男', '储运部'], ['0718', '谭德', '男', '生产技术部'], ['0466', '黄钰智', '男', '储运部'], ['0567', '王勇', '男', '炼油二部'], ['0763', '王健', '男', '安全环保部'], ['0095', '韦增铝', '男', '炼油三部'], ['0611', '韦汉团', '男', '炼油二部'], ['0314', '柏可军', '男', '炼油一部'], ['0506', '陆进生', '男', '储运部'], ['0085', '叶广兵', '男', '炼油三部'], [Line truncated
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import os,sys,shutil\n",
|
||||
"import json\n",
|
||||
@@ -1408,29 +1402,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 80,
|
||||
"execution_count": null,
|
||||
"id": "63edd636-f034-4aa6-8575-63d5cdb84adb",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-02T09:38:38.431850Z",
|
||||
"iopub.status.busy": "2023-12-02T09:38:38.431525Z",
|
||||
"iopub.status.idle": "2023-12-02T09:38:38.446189Z",
|
||||
"shell.execute_reply": "2023-12-02T09:38:38.445802Z",
|
||||
"shell.execute_reply.started": "2023-12-02T09:38:38.431810Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"平均成绩:2.8593分,男性:327人\n",
|
||||
"平均成绩:3.1506分,女性:77人\n",
|
||||
"平均成绩:2.9148分,总体:404人\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n",
|
||||
"filename = 'data/data_长炼医院.json'\n",
|
||||
@@ -1467,32 +1444,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 81,
|
||||
"execution_count": null,
|
||||
"id": "1b4a3f02-9b2e-41fc-ac6c-8163907a07f1",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-02T09:38:42.982840Z",
|
||||
"iopub.status.busy": "2023-12-02T09:38:42.982381Z",
|
||||
"iopub.status.idle": "2023-12-02T09:38:43.037289Z",
|
||||
"shell.execute_reply": "2023-12-02T09:38:43.036187Z",
|
||||
"shell.execute_reply.started": "2023-12-02T09:38:42.982802Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"0~255分人数:92人,男性:84人,女性:8人\n",
|
||||
"256~332分人数:217人,男性:178人,女性:39人\n",
|
||||
"333~367分人数:72人,男性:50人,女性:22人\n",
|
||||
"368~500分人数:23人,男性:15人,女性:8人\n",
|
||||
"404\n",
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"\n",
|
||||
@@ -1538,34 +1495,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 82,
|
||||
"execution_count": null,
|
||||
"id": "2d661ca6-6129-4da1-ac25-51d0156babb2",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-02T09:38:46.862847Z",
|
||||
"iopub.status.busy": "2023-12-02T09:38:46.862403Z",
|
||||
"iopub.status.idle": "2023-12-02T09:38:46.885423Z",
|
||||
"shell.execute_reply": "2023-12-02T09:38:46.884184Z",
|
||||
"shell.execute_reply.started": "2023-12-02T09:38:46.862811Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"20-24 {'合格': 11, '不合格': 4, '良好': 2, '优秀': 1}\n",
|
||||
"25-29 {'不合格': 0, '合格': 2, '良好': 3, '优秀': 1}\n",
|
||||
"30-34 {'合格': 3, '不合格': 0, '良好': 1, '优秀': 0}\n",
|
||||
"35-39 {'合格': 1, '不合格': 0, '良好': 1, '优秀': 1}\n",
|
||||
"40-44 {'合格': 4, '不合格': 0, '良好': 0, '优秀': 0}\n",
|
||||
"45-49 {'不合格': 3, '良好': 13, '合格': 17, '优秀': 5}\n",
|
||||
"50-54 {'不合格': 1, '合格': 1, '良好': 2, '优秀': 0}\n",
|
||||
"55-80 {'合格': 0, '不合格': 0}\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n",
|
||||
"\n",
|
||||
@@ -1605,34 +1540,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 83,
|
||||
"execution_count": null,
|
||||
"id": "fc97df37-34ff-4a02-9d26-b5d81b706e46",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-02T09:38:49.264932Z",
|
||||
"iopub.status.busy": "2023-12-02T09:38:49.264452Z",
|
||||
"iopub.status.idle": "2023-12-02T09:38:49.286566Z",
|
||||
"shell.execute_reply": "2023-12-02T09:38:49.285493Z",
|
||||
"shell.execute_reply.started": "2023-12-02T09:38:49.264866Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"20-24 {'合格': 34, '不合格': 19, '良好': 10, '优秀': 1}\n",
|
||||
"25-29 {'不合格': 9, '合格': 17, '良好': 3, '优秀': 0}\n",
|
||||
"30-34 {'合格': 24, '不合格': 12, '良好': 6, '优秀': 3}\n",
|
||||
"35-39 {'合格': 20, '不合格': 6, '良好': 4, '优秀': 3}\n",
|
||||
"40-44 {'合格': 14, '不合格': 5, '良好': 8, '优秀': 1}\n",
|
||||
"45-49 {'不合格': 15, '良好': 13, '合格': 27, '优秀': 2}\n",
|
||||
"50-54 {'不合格': 12, '合格': 31, '良好': 6, '优秀': 5}\n",
|
||||
"55-80 {'合格': 11, '不合格': 6}\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n",
|
||||
"\n",
|
||||
@@ -1672,34 +1585,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 84,
|
||||
"execution_count": null,
|
||||
"id": "dafb86f8-5ee0-4c87-a98f-c7ff0f631fe5",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-02T09:38:53.375671Z",
|
||||
"iopub.status.busy": "2023-12-02T09:38:53.375130Z",
|
||||
"iopub.status.idle": "2023-12-02T09:38:53.396164Z",
|
||||
"shell.execute_reply": "2023-12-02T09:38:53.394885Z",
|
||||
"shell.execute_reply.started": "2023-12-02T09:38:53.375634Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"16~24岁平均成绩:2.82分,人数:82人,男性:64人\n",
|
||||
"25~29岁平均成绩:2.84分,人数:35人,男性:29人\n",
|
||||
"30~34岁平均成绩:2.84分,人数:49人,男性:45人\n",
|
||||
"35~39岁平均成绩:3.03分,人数:36人,男性:33人\n",
|
||||
"40~44岁平均成绩:2.95分,人数:32人,男性:28人\n",
|
||||
"45~49岁平均成绩:3.03分,人数:95人,男性:57人\n",
|
||||
"50~54岁平均成绩:2.95分,人数:58人,男性:54人\n",
|
||||
"55~69岁平均成绩:2.72分,人数:17人,男性:17人\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"nld = [[16,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,69]]\n",
|
||||
"\n",
|
||||
@@ -1734,34 +1625,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 89,
|
||||
"execution_count": null,
|
||||
"id": "347703a1-501b-4800-bd29-16e94f4a6793",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-02T15:15:48.243512Z",
|
||||
"iopub.status.busy": "2023-12-02T15:15:48.243065Z",
|
||||
"iopub.status.idle": "2023-12-02T15:15:48.263263Z",
|
||||
"shell.execute_reply": "2023-12-02T15:15:48.262071Z",
|
||||
"shell.execute_reply.started": "2023-12-02T15:15:48.243476Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"20~24岁平均成绩:2.8分,人数:64人\n",
|
||||
"25~29岁平均成绩:2.74分,人数:29人\n",
|
||||
"30~34岁平均成绩:2.82分,人数:45人\n",
|
||||
"35~39岁平均成绩:2.96分,人数:33人\n",
|
||||
"40~44岁平均成绩:2.96分,人数:28人\n",
|
||||
"45~49岁平均成绩:2.89分,人数:57人\n",
|
||||
"50~54岁平均成绩:2.94分,人数:54人\n",
|
||||
"55~80岁平均成绩:2.72分,人数:17人\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"\n",
|
||||
@@ -1796,34 +1665,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 90,
|
||||
"execution_count": null,
|
||||
"id": "5900d1c7-2f8c-4dfa-a60e-a577fb90f22d",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-02T15:15:53.325620Z",
|
||||
"iopub.status.busy": "2023-12-02T15:15:53.325175Z",
|
||||
"iopub.status.idle": "2023-12-02T15:15:53.345673Z",
|
||||
"shell.execute_reply": "2023-12-02T15:15:53.344765Z",
|
||||
"shell.execute_reply.started": "2023-12-02T15:15:53.325577Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"20~24岁平均成绩:2.9分,人数:18人\n",
|
||||
"25~29岁平均成绩:3.32分,人数:6人\n",
|
||||
"30~34岁平均成绩:3.08分,人数:4人\n",
|
||||
"35~39岁平均成绩:3.74分,人数:3人\n",
|
||||
"40~44岁平均成绩:2.91分,人数:4人\n",
|
||||
"45~49岁平均成绩:3.23分,人数:38人\n",
|
||||
"50~54岁平均成绩:3.11分,人数:4人\n",
|
||||
"55~80岁平均成绩:0分,人数:0人\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n",
|
||||
"\n",
|
||||
@@ -1856,36 +1703,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 87,
|
||||
"execution_count": null,
|
||||
"id": "ad69c45d-3f62-42df-894d-47424e759029",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-02T09:39:03.145078Z",
|
||||
"iopub.status.busy": "2023-12-02T09:39:03.144630Z",
|
||||
"iopub.status.idle": "2023-12-02T09:39:03.164888Z",
|
||||
"shell.execute_reply": "2023-12-02T09:39:03.163659Z",
|
||||
"shell.execute_reply.started": "2023-12-02T09:39:03.145041Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"BMI 3.73 397\n",
|
||||
"肺活量 3.44 394\n",
|
||||
"握力 1.95 365\n",
|
||||
"坐位体前屈 3.19 249\n",
|
||||
"纵跳 2.73 377\n",
|
||||
"俯卧撑 2.24 248\n",
|
||||
"一分钟仰卧起坐 3.34 67\n",
|
||||
"单脚站立 2.75 378\n",
|
||||
"选择反应时 3.22 386\n",
|
||||
"台阶指数 2.78 331\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
@@ -1910,45 +1733,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 88,
|
||||
"execution_count": null,
|
||||
"id": "dcf152e7-bbcc-47d1-9c5f-83854db35412",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-02T09:39:08.338346Z",
|
||||
"iopub.status.busy": "2023-12-02T09:39:08.337893Z",
|
||||
"iopub.status.idle": "2023-12-02T09:39:08.356987Z",
|
||||
"shell.execute_reply": "2023-12-02T09:39:08.355926Z",
|
||||
"shell.execute_reply.started": "2023-12-02T09:39:08.338309Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"行政事务中心 2.46 12\n",
|
||||
"储运部 2.79 58\n",
|
||||
"长炼医院外二科 2.5 1\n",
|
||||
"设备工程部 3.22 2\n",
|
||||
"群众工作部 3.71 4\n",
|
||||
"纪委(监督部) 3.33 2\n",
|
||||
"IT服务中心 3.67 1\n",
|
||||
"计量站 2.87 3\n",
|
||||
"热电部 2.88 84\n",
|
||||
"生产部 3.38 1\n",
|
||||
"炼油一部 2.96 39\n",
|
||||
"安全环保部 2.35 2\n",
|
||||
"化工部 2.95 143\n",
|
||||
"财务资产部 2.67 1\n",
|
||||
"计划经营部 3.22 1\n",
|
||||
"炼油二部 3.02 44\n",
|
||||
"消防中心 3.0 1\n",
|
||||
"港口部 2.77 4\n",
|
||||
"水务部 3.11 1\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
|
||||
+404
-2
@@ -4,6 +4,7 @@
|
||||
"cell_type": "markdown",
|
||||
"id": "4626da6c-d228-4270-8d8d-c98784a106ad",
|
||||
"metadata": {
|
||||
"jp-MarkdownHeadingCollapsed": true,
|
||||
"tags": [],
|
||||
"toc-hr-collapsed": true
|
||||
},
|
||||
@@ -493,7 +494,6 @@
|
||||
"cell_type": "markdown",
|
||||
"id": "59d38404-e097-4f08-a3fd-565e351f09bb",
|
||||
"metadata": {
|
||||
"jp-MarkdownHeadingCollapsed": true,
|
||||
"tags": [],
|
||||
"toc-hr-collapsed": true
|
||||
},
|
||||
@@ -1550,10 +1550,412 @@
|
||||
" print(v['unit'],url)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "2112bdec-bd4e-46b7-88cb-ec53e70ad844",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 报告添加水印"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 137,
|
||||
"id": "ced8ec31-2b80-4ba1-901a-233f0c31c32c",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-28T03:47:55.677670Z",
|
||||
"iopub.status.busy": "2023-12-28T03:47:55.677205Z",
|
||||
"iopub.status.idle": "2023-12-28T03:48:41.694191Z",
|
||||
"shell.execute_reply": "2023-12-28T03:48:41.693753Z",
|
||||
"shell.execute_reply.started": "2023-12-28T03:47:55.677631Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok!\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os,sys,shutil\n",
|
||||
"import json\n",
|
||||
"import glob\n",
|
||||
"from pathlib import Path\n",
|
||||
"import PyPDF2\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"pdfWriter = PyPDF2.PdfWriter() \n",
|
||||
"\n",
|
||||
"fi_path = '/home/songyi/python/mycrm/flask/pdf/files/309118_1'\n",
|
||||
"new_path = 'file/309118_sy'\n",
|
||||
"\n",
|
||||
"filename = 'data/北京农行百日筑基.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"\n",
|
||||
"water = PyPDF2.PdfReader('data/气虚质.pdf').pages[0]\n",
|
||||
"fls = glob.glob(f'{fi_path}/*.pdf')\n",
|
||||
"for fn in fls:\n",
|
||||
" reader = PyPDF2.PdfReader(fn)\n",
|
||||
" writer = PyPDF2.PdfWriter()\n",
|
||||
" num = len(reader.pages)\n",
|
||||
" code =str(int(Path(fn).stem.split('-')[0]))\n",
|
||||
" sy_fn = 'data/'+dict1[code]['unit']+'.pdf'\n",
|
||||
" water = PyPDF2.PdfReader(sy_fn).pages[0]\n",
|
||||
" for i in range(num):\n",
|
||||
" page = reader.pages[i]\n",
|
||||
" if i == num -1:\n",
|
||||
" page.merge_page(water)\n",
|
||||
" writer.add_page(page)\n",
|
||||
" with open(f'file/309118_sy/{Path(fn).stem}.pdf', 'wb') as target_file:\n",
|
||||
" writer.write(target_file)\n",
|
||||
" \n",
|
||||
"print('ok!') "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "223fa825-da92-4667-bfc4-d359b87d3385",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 核对有体测无报告人员"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 134,
|
||||
"id": "12155bbc-81c7-48c5-a6bf-228184e9382c",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-28T03:13:06.270708Z",
|
||||
"iopub.status.busy": "2023-12-28T03:13:06.270214Z",
|
||||
"iopub.status.idle": "2023-12-28T03:13:06.288938Z",
|
||||
"shell.execute_reply": "2023-12-28T03:13:06.288393Z",
|
||||
"shell.execute_reply.started": "2023-12-28T03:13:06.270668Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"['11', '27', '28', '29', '31', '32', '34', '42', '47', '52', '60', '64', '75', '84', '85', '87', '98', '103', '104', '105', '106', '111', '113', '114', '118', '119', '123', '137', '151', '162', '222']\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import os,sys,shutil\n",
|
||||
"import json\n",
|
||||
"import glob\n",
|
||||
"from pathlib import Path\n",
|
||||
"import PyPDF2\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"pdfWriter = PyPDF2.PdfWriter() \n",
|
||||
"\n",
|
||||
"fi_path = '/home/songyi/python/mycrm/flask/pdf/files/309118'\n",
|
||||
"new_path = 'file/309118_sy'\n",
|
||||
"\n",
|
||||
"filename = 'data/北京农行百日筑基.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"\n",
|
||||
"list1 = []\n",
|
||||
"fls = glob.glob(f'{fi_path}/*.pdf')\n",
|
||||
"for fn in fls:\n",
|
||||
" code =str(int(Path(fn).stem.split('-')[0]))\n",
|
||||
" list1.append(code)\n",
|
||||
"list2 = []\n",
|
||||
"for k, v in dict1.items():\n",
|
||||
" if k not in list1 and k!='50':\n",
|
||||
" list2.append(k)\n",
|
||||
"print(list2)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "95c57366-499f-4fa6-9504-2bb67e61d203",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 补充第一次测试人员报告"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 133,
|
||||
"id": "edfbc320-a295-4564-b1e5-9165df5fbb22",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-28T03:12:46.687698Z",
|
||||
"iopub.status.busy": "2023-12-28T03:12:46.687241Z",
|
||||
"iopub.status.idle": "2023-12-28T03:12:46.720241Z",
|
||||
"shell.execute_reply": "2023-12-28T03:12:46.719132Z",
|
||||
"shell.execute_reply.started": "2023-12-28T03:12:46.687658Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"30\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import datetime\n",
|
||||
"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/北京农行人员名单all.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"\n",
|
||||
"filename = 'data/places_result_20231228.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",
|
||||
"for result in list1:\n",
|
||||
" user = str(result[2])\n",
|
||||
" if user in list2:\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",
|
||||
" 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",
|
||||
" birth = date.fromisoformat(dict1[user]['birth'].replace('/','-'))\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",
|
||||
" #print(len(re_ta))\n",
|
||||
"filename = 'data/result_北京农行补充人员.json'\n",
|
||||
"\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(re_ta, fl, ensure_ascii=False) \n",
|
||||
"print(len(re_ta))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 135,
|
||||
"id": "8e578850-ea32-45e4-a78f-646c2a7aee1d",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-28T03:20:49.080841Z",
|
||||
"iopub.status.busy": "2023-12-28T03:20:49.080377Z",
|
||||
"iopub.status.idle": "2023-12-28T03:20:59.726002Z",
|
||||
"shell.execute_reply": "2023-12-28T03:20:59.724866Z",
|
||||
"shell.execute_reply.started": "2023-12-28T03:20:49.080802Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"30\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_北京农行补充人员.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"list1 = []\n",
|
||||
"fiie_path ='./北京农行补充/'\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'] = fiie_path+id+'-'+ v['name']+'.pdf'\n",
|
||||
" mydata['title'] = '中国农业银行股份有限公司'\n",
|
||||
" mydata['subtitle'] = '北京市分行'\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",
|
||||
" \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": "markdown",
|
||||
"id": "3fcb653d-8f2b-4f01-99e0-9e563631563b",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 生成手机验证码"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 138,
|
||||
"id": "2fc466e3-80cf-4357-8910-94f8548cd3a5",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-12-28T03:57:03.930890Z",
|
||||
"iopub.status.busy": "2023-12-28T03:57:03.930680Z",
|
||||
"iopub.status.idle": "2023-12-28T03:57:04.143869Z",
|
||||
"shell.execute_reply": "2023-12-28T03:57:04.143389Z",
|
||||
"shell.execute_reply.started": "2023-12-28T03:57:03.930868Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"ok\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import openpyxl\n",
|
||||
"import os,sys,shutil\n",
|
||||
"import json\n",
|
||||
"import math\n",
|
||||
"import glob\n",
|
||||
"import random\n",
|
||||
"from pathlib import Path\n",
|
||||
"import pymongo\n",
|
||||
"\n",
|
||||
"myclient = pymongo.MongoClient('mongodb://localhost:27017/')\n",
|
||||
"mydb = myclient[\"baogao\"]\n",
|
||||
"\n",
|
||||
"place_id = 309118\n",
|
||||
"place_code = '03'\n",
|
||||
"dw_name = '中国农业银行股份有限公司北京市分行'\n",
|
||||
"fi_path = '/home/songyi/python/mycrm/flask/pdf/files'\n",
|
||||
"fls = glob.glob(f'{fi_path}/{str(place_id)}/*.pdf')\n",
|
||||
"\n",
|
||||
"code_list = []\n",
|
||||
"for i in range(10): # 0~9\n",
|
||||
" code_list.append(str(i))\n",
|
||||
" \n",
|
||||
"list1 = []\n",
|
||||
"i = 0\n",
|
||||
"while i < len(fls):\n",
|
||||
" code = random.sample(code_list,4) #随机取4位数\n",
|
||||
" code_num = ''.join(code) \n",
|
||||
" if place_code+code_num not in list1:\n",
|
||||
" list1.append(place_code+code_num)\n",
|
||||
" i +=1\n",
|
||||
"i = 0\n",
|
||||
"list2= []\n",
|
||||
"for fn in fls:\n",
|
||||
" dict2 = {}\n",
|
||||
" fi_name =Path(fn).stem.split('-')[0]\n",
|
||||
" code = int(fi_name)\n",
|
||||
" dxm = list1[i]\n",
|
||||
" dict2 = {'place_id':place_id,'code':dxm,'fn':Path(fn).name}\n",
|
||||
" list2.append(dict2)\n",
|
||||
" i +=1\n",
|
||||
"mycol = mydb[\"pdf\"]\n",
|
||||
"x = mycol.insert_many(list2)\n",
|
||||
"print('ok') \n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "70dbcf3b-4e6e-4462-8d55-dba314460eaf",
|
||||
"id": "4be9bcbe-bfeb-450e-9863-1d49605979a3",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
|
||||
Reference in new issue
Block a user